From ff3b6d10a05ce9bffa52a27ffa6e11e5ecf22c72 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 27 Feb 2024 16:48:07 +0000 Subject: context 2024.02.27 09:18, and luametatex git-svn-id: svn://tug.org/texlive/trunk@70189 c570f23f-e606-0410-a88d-b1316a301751 --- .../lexers/data/scite-context-data-context.lua | 4 +- .../lexers/data/scite-context-data-interfaces.lua | 2 +- .../lexers/data/scite-context-data-metafun.lua | 4 +- .../lexers/data/scite-context-data-metapost.lua | 4 +- .../context/lexers/data/scite-context-data-tex.lua | 6 +- .../context/lexers/scite-context-lexer-xml.lua | 7 +- .../scite/context/lexers/scite-context-lexer.lua | 1 + .../context/scite-context-data-context.properties | 605 +- .../scite-context-data-interfaces.properties | 2337 ++-- .../context/scite-context-data-metafun.properties | 5 +- .../context/scite-context-data-metapost.properties | 112 +- .../context/scite-context-data-tex.properties | 352 +- Master/texmf-dist/doc/context/README.adoc | 18 - Master/texmf-dist/doc/context/context-readme.txt | 74 + .../context/documents/general/manuals/cld-mkiv.pdf | Bin 692894 -> 688948 bytes .../documents/general/manuals/colors-mkiv.pdf | Bin 2319397 -> 4568797 bytes .../general/manuals/lowlevel-accuracy.pdf | Bin 0 -> 42897 bytes .../general/manuals/lowlevel-alignments.pdf | Bin 81652 -> 89475 bytes .../general/manuals/lowlevel-grouping.pdf | Bin 28352 -> 52745 bytes .../documents/general/manuals/lowlevel-lines.pdf | Bin 0 -> 423890 bytes .../documents/general/manuals/lowlevel-loops.pdf | Bin 43942 -> 48884 bytes .../documents/general/manuals/lowlevel-macros.pdf | Bin 88829 -> 119512 bytes .../general/manuals/lowlevel-paragraphs.pdf | Bin 296768 -> 299328 bytes .../general/manuals/lowlevel-registers.pdf | Bin 46958 -> 58263 bytes .../documents/general/manuals/luametatex.pdf | Bin 1470739 -> 1497909 bytes .../context/documents/general/manuals/musings.pdf | Bin 2144254 -> 2378758 bytes .../context/documents/general/manuals/ontarget.pdf | Bin 539819 -> 1920631 bytes .../context/documents/general/manuals/pdfmerge.pdf | Bin 0 -> 67294 bytes .../documents/general/manuals/primitives.pdf | Bin 161106 -> 628972 bytes .../context/documents/general/manuals/sql-mkiv.pdf | Bin 53962 -> 49685 bytes .../context/documents/general/qrcs/setup-de.pdf | Bin 845580 -> 845252 bytes .../context/documents/general/qrcs/setup-en.pdf | Bin 848669 -> 848819 bytes .../context/documents/general/qrcs/setup-fr.pdf | Bin 843783 -> 843645 bytes .../context/documents/general/qrcs/setup-it.pdf | Bin 844753 -> 844777 bytes .../documents/general/qrcs/setup-mapping-de.pdf | Bin 319913 -> 320169 bytes .../documents/general/qrcs/setup-mapping-en.pdf | Bin 317685 -> 317647 bytes .../documents/general/qrcs/setup-mapping-fr.pdf | Bin 321113 -> 321360 bytes .../documents/general/qrcs/setup-mapping-it.pdf | Bin 319712 -> 319765 bytes .../documents/general/qrcs/setup-mapping-nl.pdf | Bin 319146 -> 319350 bytes .../context/documents/general/qrcs/setup-nl.pdf | Bin 840670 -> 840533 bytes .../2017/context-2017-features-spacetest.tex | 2 +- .../presentations/examples/present-steps-001.pdf | Bin 12778 -> 17674 bytes .../doc/context/scripts/mkiv/context.html | 14 +- .../doc/context/scripts/mkiv/context.man | 22 +- .../doc/context/scripts/mkiv/context.xml | 28 +- .../doc/context/scripts/mkiv/luatools.html | 65 - .../doc/context/scripts/mkiv/luatools.man | 78 - .../doc/context/scripts/mkiv/luatools.xml | 31 - .../doc/context/scripts/mkiv/mtx-babel.man | 2 +- .../doc/context/scripts/mkiv/mtx-base.man | 2 +- .../doc/context/scripts/mkiv/mtx-bibtex.man | 2 +- .../doc/context/scripts/mkiv/mtx-cache.man | 2 +- .../doc/context/scripts/mkiv/mtx-chars.man | 2 +- .../doc/context/scripts/mkiv/mtx-check.man | 2 +- .../doc/context/scripts/mkiv/mtx-colors.man | 2 +- .../doc/context/scripts/mkiv/mtx-context.html | 14 +- .../doc/context/scripts/mkiv/mtx-context.man | 22 +- .../doc/context/scripts/mkiv/mtx-context.xml | 28 +- .../doc/context/scripts/mkiv/mtx-convert.html | 53 + .../doc/context/scripts/mkiv/mtx-convert.man | 42 + .../doc/context/scripts/mkiv/mtx-convert.xml | 20 + .../doc/context/scripts/mkiv/mtx-ctan.html | 51 + .../doc/context/scripts/mkiv/mtx-ctan.man | 36 + .../doc/context/scripts/mkiv/mtx-ctan.xml | 18 + .../doc/context/scripts/mkiv/mtx-dvi.man | 2 +- .../doc/context/scripts/mkiv/mtx-epub.man | 2 +- .../doc/context/scripts/mkiv/mtx-evohome.man | 2 +- .../doc/context/scripts/mkiv/mtx-fcd.man | 2 +- .../doc/context/scripts/mkiv/mtx-fixpdf.html | 59 + .../doc/context/scripts/mkiv/mtx-fixpdf.man | 57 + .../doc/context/scripts/mkiv/mtx-fixpdf.xml | 27 + .../doc/context/scripts/mkiv/mtx-flac.man | 2 +- .../doc/context/scripts/mkiv/mtx-fonts.man | 2 +- .../doc/context/scripts/mkiv/mtx-grep.html | 1 + .../doc/context/scripts/mkiv/mtx-grep.man | 5 +- .../doc/context/scripts/mkiv/mtx-grep.xml | 1 + .../context/scripts/mkiv/mtx-install-modules.html | 60 + .../context/scripts/mkiv/mtx-install-modules.man | 39 + .../context/scripts/mkiv/mtx-install-modules.xml | 39 + .../doc/context/scripts/mkiv/mtx-install.html | 57 + .../doc/context/scripts/mkiv/mtx-install.man | 54 + .../doc/context/scripts/mkiv/mtx-install.xml | 24 + .../doc/context/scripts/mkiv/mtx-interface.man | 2 +- .../doc/context/scripts/mkiv/mtx-kpse.html | 68 + .../doc/context/scripts/mkiv/mtx-kpse.man | 61 + .../doc/context/scripts/mkiv/mtx-kpse.xml | 44 + .../doc/context/scripts/mkiv/mtx-metapost.man | 2 +- .../doc/context/scripts/mkiv/mtx-modules.man | 2 +- .../doc/context/scripts/mkiv/mtx-package.man | 2 +- .../doc/context/scripts/mkiv/mtx-patterns.man | 2 +- .../doc/context/scripts/mkiv/mtx-pdf.html | 8 +- .../doc/context/scripts/mkiv/mtx-pdf.man | 18 +- .../doc/context/scripts/mkiv/mtx-pdf.xml | 13 +- .../doc/context/scripts/mkiv/mtx-plain.man | 2 +- .../doc/context/scripts/mkiv/mtx-profile.man | 2 +- .../doc/context/scripts/mkiv/mtx-rsync.man | 2 +- .../doc/context/scripts/mkiv/mtx-scite.man | 2 +- .../doc/context/scripts/mkiv/mtx-server.man | 2 +- .../doc/context/scripts/mkiv/mtx-spell.man | 2 +- .../doc/context/scripts/mkiv/mtx-synctex.html | 52 + .../doc/context/scripts/mkiv/mtx-synctex.man | 39 + .../doc/context/scripts/mkiv/mtx-synctex.xml | 19 + .../doc/context/scripts/mkiv/mtx-texworks.man | 2 +- .../doc/context/scripts/mkiv/mtx-timing.html | 50 - .../doc/context/scripts/mkiv/mtx-timing.man | 33 - .../doc/context/scripts/mkiv/mtx-timing.xml | 17 - .../doc/context/scripts/mkiv/mtx-tools.man | 2 +- .../doc/context/scripts/mkiv/mtx-unicode.man | 2 +- .../doc/context/scripts/mkiv/mtx-unzip.man | 2 +- .../doc/context/scripts/mkiv/mtx-update.man | 2 +- .../doc/context/scripts/mkiv/mtx-vscode.man | 2 +- .../doc/context/scripts/mkiv/mtx-watch.man | 2 +- .../doc/context/scripts/mkiv/mtx-youless.man | 2 +- .../texmf-dist/doc/context/scripts/mkiv/mtxrun.man | 2 +- .../general/manuals/cld/cld-afewdetails.tex | 16 +- .../sources/general/manuals/cld/cld-nicetoknow.tex | 2 +- .../general/manuals/colors/colors-graphics.tex | 180 + .../general/manuals/fonts/fonts-compact.tex | 517 + .../general/manuals/fonts/fonts-introduction.tex | 19 + .../sources/general/manuals/fonts/fonts-math.tex | 12 +- .../sources/general/manuals/fonts/fonts-mkiv.tex | 1 + .../sources/general/manuals/graphics/graphics.tex | 18 +- .../general/manuals/lowlevel/lowlevel-accuracy.tex | 335 + .../manuals/lowlevel/lowlevel-alignments.tex | 177 +- .../general/manuals/lowlevel/lowlevel-boxes.tex | 1 - .../general/manuals/lowlevel/lowlevel-grouping.tex | 321 +- .../general/manuals/lowlevel/lowlevel-lines.tex | 1178 ++ .../general/manuals/lowlevel/lowlevel-loops.tex | 91 + .../general/manuals/lowlevel/lowlevel-macros.tex | 530 +- .../manuals/lowlevel/lowlevel-paragraphs.tex | 24 +- .../manuals/lowlevel/lowlevel-registers.tex | 208 +- .../general/manuals/lowlevel/lowlevel-style.tex | 5 +- .../manuals/luametatex/luametatex-building.tex | 18 +- .../manuals/luametatex/luametatex-callbacks.tex | 2 +- .../manuals/luametatex/luametatex-enhancements.tex | 76 +- .../manuals/luametatex/luametatex-fonts.tex | 40 +- .../manuals/luametatex/luametatex-introduction.tex | 11 + .../general/manuals/luametatex/luametatex-math.tex | 194 +- .../luametatex/luametatex-modifications.tex | 38 +- .../manuals/luametatex/luametatex-nodes.tex | 13 +- .../manuals/luametatex/luametatex-style.tex | 2 +- .../general/manuals/luametatex/luametatex.tex | 37 +- .../sources/general/manuals/luatex/luatex-lua.tex | 147 +- .../sources/general/manuals/luatex/luatex.tex | 2 +- .../sources/general/manuals/math/math-tweaks.tex | 2 +- .../sources/general/manuals/mathml/envexamp.tex | 9 +- ...gr-e-blog-21-02-13-why-i-do-not-like-luatex.png | Bin 0 -> 163995 bytes .../manuals/musings/musings-assumptions.tex | 141 + .../general/manuals/musings/musings-deserved.tex | 356 + .../general/manuals/musings/musings-dontusetex.tex | 201 + .../general/manuals/musings/musings-history.tex | 294 + .../manuals/musings/musings-introduction.tex | 14 +- .../general/manuals/musings/musings-manuals.tex | 236 + .../general/manuals/musings/musings-perfection.tex | 124 + .../manuals/musings/musings-performance.tex | 382 + .../general/manuals/musings/musings-plain.tex | 11 +- .../general/manuals/musings/musings-style.tex | 2 +- .../general/manuals/musings/musings-treasures.tex | 201 + .../general/manuals/musings/musings-unicode.tex | 30 +- .../sources/general/manuals/musings/musings.tex | 20 +- .../general/manuals/ontarget/ontarget-accuracy.tex | 198 + .../general/manuals/ontarget/ontarget-active.tex | 252 + .../general/manuals/ontarget/ontarget-bars.tex | 204 + .../manuals/ontarget/ontarget-constants.tex | 220 + .../manuals/ontarget/ontarget-envelopes.tex | 914 ++ .../manuals/ontarget/ontarget-gettingridof.tex | 4 +- .../general/manuals/ontarget/ontarget-green.tex | 204 + .../manuals/ontarget/ontarget-introduction.tex | 8 +- .../general/manuals/ontarget/ontarget-jmn.tex | 245 + .../general/manuals/ontarget/ontarget-math.tex | 20 +- .../manuals/ontarget/ontarget-mathfonts.tex | 1247 ++ .../manuals/ontarget/ontarget-nostalgic-pgc.pdf | Bin 0 -> 11985 bytes .../manuals/ontarget/ontarget-nostalgic.tex | 268 + .../general/manuals/ontarget/ontarget-profiles.tex | 507 + .../general/manuals/ontarget/ontarget-radicals.tex | 160 + .../manuals/ontarget/ontarget-standardize.tex | 987 ++ .../general/manuals/ontarget/ontarget-style.tex | 5 +- .../sources/general/manuals/ontarget/ontarget.tex | 25 + .../manuals/pdfmerge/pdfmerge-testfiles.zip | Bin 0 -> 116288 bytes .../sources/general/manuals/pdfmerge/pdfmerge.tex | 604 + .../general/manuals/primitives/primitives.tex | 13308 ++++++++++++++++--- .../manuals/workflows/workflows-graphics.tex | 36 + .../manuals/workflows/workflows-parallel.tex | 121 +- .../general/manuals/xml/xml-mkiv-titlepage.tex | 2 + .../sources/general/manuals/xml/xml-mkiv.tex | 2 + Master/texmf-dist/doc/man/man1/context.1 | 22 +- Master/texmf-dist/doc/man/man1/context.man1.pdf | Bin 24004 -> 24608 bytes Master/texmf-dist/doc/man/man1/luatools.1 | 78 - Master/texmf-dist/doc/man/man1/luatools.man1.pdf | Bin 18048 -> 0 bytes Master/texmf-dist/doc/man/man1/mtx-babel.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf | Bin 16091 -> 16017 bytes Master/texmf-dist/doc/man/man1/mtx-base.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf | Bin 18229 -> 18303 bytes Master/texmf-dist/doc/man/man1/mtx-bibtex.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf | Bin 14816 -> 14744 bytes Master/texmf-dist/doc/man/man1/mtx-cache.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf | Bin 15618 -> 15547 bytes Master/texmf-dist/doc/man/man1/mtx-chars.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf | Bin 15799 -> 15727 bytes Master/texmf-dist/doc/man/man1/mtx-check.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf | Bin 15992 -> 15917 bytes Master/texmf-dist/doc/man/man1/mtx-colors.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf | Bin 14790 -> 14719 bytes Master/texmf-dist/doc/man/man1/mtx-context.1 | 22 +- .../texmf-dist/doc/man/man1/mtx-context.man1.pdf | Bin 24004 -> 24608 bytes Master/texmf-dist/doc/man/man1/mtx-convert.1 | 42 + .../texmf-dist/doc/man/man1/mtx-convert.man1.pdf | Bin 0 -> 15851 bytes Master/texmf-dist/doc/man/man1/mtx-ctan.1 | 36 + Master/texmf-dist/doc/man/man1/mtx-ctan.man1.pdf | Bin 0 -> 16049 bytes Master/texmf-dist/doc/man/man1/mtx-dvi.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-dvi.man1.pdf | Bin 15411 -> 15338 bytes Master/texmf-dist/doc/man/man1/mtx-epub.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf | Bin 16506 -> 16437 bytes Master/texmf-dist/doc/man/man1/mtx-evohome.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-evohome.man1.pdf | Bin 16117 -> 16051 bytes Master/texmf-dist/doc/man/man1/mtx-fcd.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf | Bin 16750 -> 16676 bytes Master/texmf-dist/doc/man/man1/mtx-fixpdf.1 | 57 + Master/texmf-dist/doc/man/man1/mtx-fixpdf.man1.pdf | Bin 0 -> 16525 bytes Master/texmf-dist/doc/man/man1/mtx-flac.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf | Bin 15764 -> 15692 bytes Master/texmf-dist/doc/man/man1/mtx-fonts.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf | Bin 17338 -> 17266 bytes Master/texmf-dist/doc/man/man1/mtx-grep.1 | 5 +- Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf | Bin 16454 -> 16437 bytes .../texmf-dist/doc/man/man1/mtx-install-modules.1 | 39 + .../doc/man/man1/mtx-install-modules.man1.pdf | Bin 0 -> 15275 bytes Master/texmf-dist/doc/man/man1/mtx-install.1 | 54 + .../texmf-dist/doc/man/man1/mtx-install.man1.pdf | Bin 0 -> 16171 bytes Master/texmf-dist/doc/man/man1/mtx-interface.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-interface.man1.pdf | Bin 18085 -> 18154 bytes Master/texmf-dist/doc/man/man1/mtx-kpse.1 | 61 + Master/texmf-dist/doc/man/man1/mtx-kpse.man1.pdf | Bin 0 -> 17492 bytes Master/texmf-dist/doc/man/man1/mtx-metapost.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-metapost.man1.pdf | Bin 15743 -> 15673 bytes Master/texmf-dist/doc/man/man1/mtx-modules.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-modules.man1.pdf | Bin 16136 -> 16065 bytes Master/texmf-dist/doc/man/man1/mtx-package.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-package.man1.pdf | Bin 15753 -> 15681 bytes Master/texmf-dist/doc/man/man1/mtx-patterns.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-patterns.man1.pdf | Bin 16866 -> 16799 bytes Master/texmf-dist/doc/man/man1/mtx-pdf.1 | 18 +- Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf | Bin 16552 -> 16700 bytes Master/texmf-dist/doc/man/man1/mtx-plain.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf | Bin 15790 -> 15722 bytes Master/texmf-dist/doc/man/man1/mtx-profile.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-profile.man1.pdf | Bin 16381 -> 16310 bytes Master/texmf-dist/doc/man/man1/mtx-rsync.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf | Bin 15799 -> 15730 bytes Master/texmf-dist/doc/man/man1/mtx-scite.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf | Bin 15896 -> 15820 bytes Master/texmf-dist/doc/man/man1/mtx-server.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf | Bin 16020 -> 15950 bytes Master/texmf-dist/doc/man/man1/mtx-spell.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-spell.man1.pdf | Bin 16180 -> 16108 bytes Master/texmf-dist/doc/man/man1/mtx-synctex.1 | 39 + .../texmf-dist/doc/man/man1/mtx-synctex.man1.pdf | Bin 0 -> 16417 bytes Master/texmf-dist/doc/man/man1/mtx-texworks.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-texworks.man1.pdf | Bin 15305 -> 15233 bytes Master/texmf-dist/doc/man/man1/mtx-timing.1 | 33 - Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf | Bin 15487 -> 0 bytes Master/texmf-dist/doc/man/man1/mtx-tools.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf | Bin 17772 -> 17699 bytes Master/texmf-dist/doc/man/man1/mtx-unicode.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-unicode.man1.pdf | Bin 15216 -> 15143 bytes Master/texmf-dist/doc/man/man1/mtx-unzip.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf | Bin 15387 -> 15311 bytes Master/texmf-dist/doc/man/man1/mtx-update.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf | Bin 17667 -> 17674 bytes Master/texmf-dist/doc/man/man1/mtx-vscode.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-vscode.man1.pdf | Bin 15907 -> 15831 bytes Master/texmf-dist/doc/man/man1/mtx-watch.1 | 2 +- Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf | Bin 16590 -> 16518 bytes Master/texmf-dist/doc/man/man1/mtx-youless.1 | 2 +- .../texmf-dist/doc/man/man1/mtx-youless.man1.pdf | Bin 16145 -> 16071 bytes Master/texmf-dist/doc/man/man1/mtxrun.1 | 2 +- Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf | Bin 20282 -> 20353 bytes .../fonts/map/luatex/context/demo-font.lum | 70 + .../metapost/context/base/mpxl/mp-cont.mpxl | 2 + .../metapost/context/base/mpxl/mp-lmtx.mpxl | 184 +- .../metapost/context/base/mpxl/mp-tool.mpxl | 45 +- .../texmf-dist/scripts/context/lua/mtx-context.lua | 275 +- .../texmf-dist/scripts/context/lua/mtx-context.xml | 28 +- .../texmf-dist/scripts/context/lua/mtx-convert.lua | 4 +- Master/texmf-dist/scripts/context/lua/mtx-ctan.lua | 3 +- .../texmf-dist/scripts/context/lua/mtx-fixpdf.lua | 203 + .../texmf-dist/scripts/context/lua/mtx-fonts.lua | 38 +- Master/texmf-dist/scripts/context/lua/mtx-grep.lua | 47 +- .../scripts/context/lua/mtx-install-modules.lua | 373 + .../scripts/context/lua/mtx-install-tikz.lua | 162 - .../texmf-dist/scripts/context/lua/mtx-install.lua | 91 +- Master/texmf-dist/scripts/context/lua/mtx-kpse.lua | 17 +- .../scripts/context/lua/mtx-patterns.lua | 4 +- Master/texmf-dist/scripts/context/lua/mtx-pdf.lua | 362 +- .../context/lua/mtx-server-ctx-fonttest.lua | 15 +- .../texmf-dist/scripts/context/lua/mtx-server.lua | 1 + .../texmf-dist/scripts/context/lua/mtx-synctex.lua | 4 +- .../texmf-dist/scripts/context/lua/mtx-unicode.lua | 74 +- .../texmf-dist/scripts/context/lua/mtx-update.lua | 37 +- .../texmf-dist/scripts/context/lua/mtx-watch.lua | 2 +- Master/texmf-dist/scripts/context/lua/mtxrun.lua | 483 +- .../scripts/context/stubs-mkiv/unix/contextjit | 3 - .../scripts/context/stubs-mkiv/unix/luatools | 2 - .../scripts/context/stubs-mkiv/unix/mtxrunjit | 3 - .../context/stubs-mkiv/win64/contextjit.cmd | 4 - .../scripts/context/stubs-mkiv/win64/luatools.cmd | 2 - .../scripts/context/stubs-mkiv/win64/mtxrunjit.cmd | 4 - .../texmf-dist/tex/context/base/mkiv/back-exp.lua | 17 +- .../texmf-dist/tex/context/base/mkiv/char-def.lua | 6650 ++++----- .../texmf-dist/tex/context/base/mkiv/char-ini.lua | 52 +- .../texmf-dist/tex/context/base/mkiv/char-tex.lua | 12 +- .../texmf-dist/tex/context/base/mkiv/char-utf.lua | 6 +- .../texmf-dist/tex/context/base/mkiv/chem-str.lua | 86 +- .../texmf-dist/tex/context/base/mkiv/cldf-ini.lua | 28 +- .../texmf-dist/tex/context/base/mkiv/cldf-prs.lua | 29 +- .../texmf-dist/tex/context/base/mkiv/cont-new.mkiv | 2 +- .../texmf-dist/tex/context/base/mkiv/context.mkiv | 2 +- .../texmf-dist/tex/context/base/mkiv/core-con.lua | 20 +- .../texmf-dist/tex/context/base/mkiv/core-con.mkiv | 9 +- .../texmf-dist/tex/context/base/mkiv/core-ctx.lua | 16 +- .../texmf-dist/tex/context/base/mkiv/core-env.mkiv | 15 +- .../texmf-dist/tex/context/base/mkiv/data-env.lua | 13 +- .../texmf-dist/tex/context/base/mkiv/data-exp.lua | 6 +- .../texmf-dist/tex/context/base/mkiv/data-res.lua | 62 +- .../texmf-dist/tex/context/base/mkiv/file-ini.lua | 22 +- .../texmf-dist/tex/context/base/mkiv/file-job.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/file-lib.lua | 8 +- .../texmf-dist/tex/context/base/mkiv/font-agl.lua | 4157 +++++- .../texmf-dist/tex/context/base/mkiv/font-con.lua | 36 +- .../texmf-dist/tex/context/base/mkiv/font-dsp.lua | 55 +- .../tex/context/base/mkiv/font-imp-dimensions.lua | 14 +- .../texmf-dist/tex/context/base/mkiv/font-map.lua | 4 +- .../texmf-dist/tex/context/base/mkiv/font-mis.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/font-one.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/font-onr.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/font-osd.lua | 78 +- .../texmf-dist/tex/context/base/mkiv/font-otl.lua | 4 +- .../texmf-dist/tex/context/base/mkiv/font-oto.lua | 16 +- .../texmf-dist/tex/context/base/mkiv/font-otr.lua | 3 + .../texmf-dist/tex/context/base/mkiv/font-ots.lua | 192 +- .../texmf-dist/tex/context/base/mkiv/font-oup.lua | 31 +- .../texmf-dist/tex/context/base/mkiv/font-prv.lua | 15 +- .../texmf-dist/tex/context/base/mkiv/font-syn.lua | 1 + .../texmf-dist/tex/context/base/mkiv/font-tpk.lua | 18 +- .../texmf-dist/tex/context/base/mkiv/good-ini.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/grph-chk.lua | 2 +- .../tex/context/base/mkiv/java-imp-fields.mkiv | 4 +- Master/texmf-dist/tex/context/base/mkiv/l-os.lua | 2 + .../texmf-dist/tex/context/base/mkiv/l-table.lua | 39 +- .../base/mkiv/lang-imp-simpleascii-data.lgz | Bin 0 -> 554570 bytes .../tex/context/base/mkiv/lang-imp-simpleascii.lua | 114 + .../texmf-dist/tex/context/base/mkiv/lang-rep.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/lang-txt.lua | 32 +- .../texmf-dist/tex/context/base/mkiv/lang-wrd.lua | 3 +- .../texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua | 155 +- .../texmf-dist/tex/context/base/mkiv/lpdf-ini.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/lpdf-pda.xml | 436 +- .../texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml | 106 +- .../texmf-dist/tex/context/base/mkiv/lpdf-pua.xml | 470 +- .../texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua | 40 +- .../texmf-dist/tex/context/base/mkiv/luat-cnf.lua | 12 - .../texmf-dist/tex/context/base/mkiv/luat-env.lua | 4 +- .../texmf-dist/tex/context/base/mkiv/luat-lib.mkiv | 2 +- .../texmf-dist/tex/context/base/mkiv/luat-log.lua | 4 +- .../texmf-dist/tex/context/base/mkiv/luat-mac.lua | 10 +- .../texmf-dist/tex/context/base/mkiv/luat-sta.lua | 194 +- .../texmf-dist/tex/context/base/mkiv/lxml-ini.lua | 7 +- .../texmf-dist/tex/context/base/mkiv/lxml-lpt.lua | 14 +- .../texmf-dist/tex/context/base/mkiv/lxml-tab.lua | 15 +- .../texmf-dist/tex/context/base/mkiv/lxml-tex.lua | 147 +- .../texmf-dist/tex/context/base/mkiv/math-fbk.lua | 8 +- .../texmf-dist/tex/context/base/mkiv/math-ini.lua | 4 +- .../texmf-dist/tex/context/base/mkiv/math-ini.mkiv | 5 + .../texmf-dist/tex/context/base/mkiv/math-tag.lua | 6 +- .../texmf-dist/tex/context/base/mkiv/meta-tex.lua | 22 +- .../tex/context/base/mkiv/mtx-context-compare.tex | 71 +- .../tex/context/base/mkiv/mtx-context-copy.tex | 123 +- .../texmf-dist/tex/context/base/mkiv/mult-def.lua | 139 +- .../texmf-dist/tex/context/base/mkiv/mult-fun.lua | 5 + .../texmf-dist/tex/context/base/mkiv/mult-low.lua | 124 +- .../texmf-dist/tex/context/base/mkiv/mult-mes.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/mult-mps.lua | 134 +- .../texmf-dist/tex/context/base/mkiv/mult-prm.lua | 210 +- .../texmf-dist/tex/context/base/mkiv/page-cst.lua | 50 +- .../tex/context/base/mkiv/publ-imp-apa.mkvi | 119 +- .../tex/context/base/mkiv/publ-imp-aps.mkvi | 2 +- .../context/base/mkiv/publ-imp-definitions.mkvi | 4 +- .../tex/context/base/mkiv/publ-imp-list.mkvi | 2 +- .../texmf-dist/tex/context/base/mkiv/publ-ini.mkiv | 8 +- .../texmf-dist/tex/context/base/mkiv/publ-reg.lua | 21 +- .../texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi | 11 +- .../texmf-dist/tex/context/base/mkiv/scrp-cjk.lua | 1 + .../texmf-dist/tex/context/base/mkiv/sort-ini.lua | 2 +- .../texmf-dist/tex/context/base/mkiv/spac-ali.mkiv | 3 - .../tex/context/base/mkiv/status-files.pdf | Bin 24657 -> 23984 bytes .../tex/context/base/mkiv/status-lua.pdf | Bin 271357 -> 249757 bytes .../texmf-dist/tex/context/base/mkiv/strc-reg.lua | 7 +- .../context/base/mkiv/symb-imp-fontawesome.mkiv | 20 +- .../texmf-dist/tex/context/base/mkiv/syst-aux.mkiv | 4 +- .../texmf-dist/tex/context/base/mkiv/trac-log.lua | 5 +- .../texmf-dist/tex/context/base/mkiv/trac-set.lua | 4 +- .../texmf-dist/tex/context/base/mkiv/typo-duc.lua | 3 +- .../texmf-dist/tex/context/base/mkiv/util-deb.lua | 8 +- .../texmf-dist/tex/context/base/mkiv/util-dim.lua | 4 +- .../texmf-dist/tex/context/base/mkiv/util-env.lua | 49 +- .../texmf-dist/tex/context/base/mkiv/util-evo.lua | 2 + .../texmf-dist/tex/context/base/mkiv/util-lua.lua | 1 + .../texmf-dist/tex/context/base/mkiv/util-prs.lua | 20 +- .../tex/context/base/mkiv/util-soc-imp-ftp.lua | 4 +- .../tex/context/base/mkiv/util-soc-imp-http.lua | 52 +- .../tex/context/base/mkiv/util-sql-imp-client.lua | 1 + .../texmf-dist/tex/context/base/mkiv/util-str.lua | 24 + .../texmf-dist/tex/context/base/mkiv/util-zip.lua | 363 +- .../texmf-dist/tex/context/base/mkxl/anch-bar.mkxl | 12 +- .../texmf-dist/tex/context/base/mkxl/anch-bck.mklx | 12 +- .../texmf-dist/tex/context/base/mkxl/anch-box.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/anch-loc.lmt | 9 +- .../texmf-dist/tex/context/base/mkxl/anch-pgr.lmt | 21 +- .../texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl | 36 +- .../texmf-dist/tex/context/base/mkxl/anch-pos.lmt | 41 +- .../texmf-dist/tex/context/base/mkxl/anch-pos.mkxl | 20 +- .../texmf-dist/tex/context/base/mkxl/anch-tab.mkxl | 28 +- .../texmf-dist/tex/context/base/mkxl/attr-alt.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/attr-alt.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/attr-col.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/attr-eff.lmt | 5 +- .../texmf-dist/tex/context/base/mkxl/attr-eff.mkxl | 3 +- .../texmf-dist/tex/context/base/mkxl/attr-ini.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/attr-ini.mkxl | 39 +- .../texmf-dist/tex/context/base/mkxl/attr-lay.lmt | 41 +- .../texmf-dist/tex/context/base/mkxl/attr-lay.mkxl | 33 +- .../texmf-dist/tex/context/base/mkxl/attr-mkr.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/attr-neg.lmt | 9 +- .../tex/context/base/mkxl/back-exp-imp-mth.lmt | 883 +- .../tex/context/base/mkxl/back-exp-imp-tag.lmt | 30 +- .../texmf-dist/tex/context/base/mkxl/back-exp.lmt | 267 +- .../texmf-dist/tex/context/base/mkxl/back-exp.mkxl | 68 +- .../tex/context/base/mkxl/back-imp-lua.lmt | 25 +- .../tex/context/base/mkxl/back-imp-mps.lmt | 24 +- .../tex/context/base/mkxl/back-imp-pdf.mkxl | 8 +- .../tex/context/base/mkxl/back-imp-pdp.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/back-ini.lmt | 5 +- .../texmf-dist/tex/context/base/mkxl/back-ini.mkxl | 7 +- .../texmf-dist/tex/context/base/mkxl/back-res.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl | 24 +- .../texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl | 38 +- .../texmf-dist/tex/context/base/mkxl/blob-ini.lmt | 5 +- .../texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl | 16 +- .../texmf-dist/tex/context/base/mkxl/buff-ini.lmt | 118 +- .../texmf-dist/tex/context/base/mkxl/buff-ini.mkxl | 23 +- .../texmf-dist/tex/context/base/mkxl/buff-par.mklx | 18 +- .../texmf-dist/tex/context/base/mkxl/buff-ver.lmt | 992 ++ .../texmf-dist/tex/context/base/mkxl/buff-ver.mkxl | 120 +- .../texmf-dist/tex/context/base/mkxl/catc-act.mkxl | 10 +- .../texmf-dist/tex/context/base/mkxl/catc-def.mkxl | 25 + .../texmf-dist/tex/context/base/mkxl/catc-ini.mkxl | 97 +- .../texmf-dist/tex/context/base/mkxl/char-ini.mkxl | 12 +- .../texmf-dist/tex/context/base/mkxl/char-tex.lmt | 67 +- .../texmf-dist/tex/context/base/mkxl/chem-str.mkxl | 361 +- .../texmf-dist/tex/context/base/mkxl/cldf-bas.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/cldf-int.lmt | 11 +- .../texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt | 46 +- .../texmf-dist/tex/context/base/mkxl/cldf-pos.lmt | 7 +- .../texmf-dist/tex/context/base/mkxl/colo-ini.mkxl | 72 +- .../texmf-dist/tex/context/base/mkxl/colo-nod.lmt | 6 +- .../texmf-dist/tex/context/base/mkxl/cont-log.mkxl | 53 +- .../texmf-dist/tex/context/base/mkxl/cont-new.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/cont-run.lmt | 3 + .../texmf-dist/tex/context/base/mkxl/cont-run.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/context.mkxl | 51 +- .../texmf-dist/tex/context/base/mkxl/core-con.lmt | 2262 ++++ .../texmf-dist/tex/context/base/mkxl/core-con.mkxl | 25 +- .../texmf-dist/tex/context/base/mkxl/core-dat.lmt | 22 +- .../texmf-dist/tex/context/base/mkxl/core-dat.mkxl | 47 +- .../texmf-dist/tex/context/base/mkxl/core-def.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/core-env.lmt | 290 +- .../texmf-dist/tex/context/base/mkxl/core-env.mkxl | 248 +- .../texmf-dist/tex/context/base/mkxl/core-ini.mkxl | 25 +- .../texmf-dist/tex/context/base/mkxl/core-lmt.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/core-pag.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/core-pag.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/core-sys.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/core-sys.mkxl | 106 +- .../texmf-dist/tex/context/base/mkxl/core-two.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/driv-ini.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/driv-shp.lmt | 224 +- .../texmf-dist/tex/context/base/mkxl/driv-usr.lmt | 35 +- .../texmf-dist/tex/context/base/mkxl/enco-ini.mkxl | 16 +- .../texmf-dist/tex/context/base/mkxl/file-ini.mklx | 8 +- .../texmf-dist/tex/context/base/mkxl/file-job.lmt | 79 +- .../texmf-dist/tex/context/base/mkxl/file-job.mklx | 34 +- .../texmf-dist/tex/context/base/mkxl/file-mod.mklx | 38 +- .../texmf-dist/tex/context/base/mkxl/font-cff.lmt | 2840 ++-- .../texmf-dist/tex/context/base/mkxl/font-chk.lmt | 80 +- .../texmf-dist/tex/context/base/mkxl/font-col.lmt | 57 +- .../texmf-dist/tex/context/base/mkxl/font-col.mklx | 14 +- .../texmf-dist/tex/context/base/mkxl/font-con.lmt | 258 +- .../texmf-dist/tex/context/base/mkxl/font-ctx.lmt | 234 +- .../texmf-dist/tex/context/base/mkxl/font-def.lmt | 31 +- .../texmf-dist/tex/context/base/mkxl/font-dsp.lmt | 979 +- .../texmf-dist/tex/context/base/mkxl/font-emp.mklx | 4 +- .../texmf-dist/tex/context/base/mkxl/font-fea.mklx | 8 +- .../texmf-dist/tex/context/base/mkxl/font-fil.mklx | 92 +- .../texmf-dist/tex/context/base/mkxl/font-gds.mklx | 4 +- .../texmf-dist/tex/context/base/mkxl/font-hsh.lmt | 2 +- .../tex/context/base/mkxl/font-imp-dimensions.lmt | 177 + .../tex/context/base/mkxl/font-imp-effects.lmt | 511 +- .../tex/context/base/mkxl/font-imp-italics.lmt | 45 + .../tex/context/base/mkxl/font-imp-math.lmt | 22 +- .../tex/context/base/mkxl/font-imp-quality.lmt | 565 +- .../tex/context/base/mkxl/font-imp-tracing.lmt | 12 +- .../texmf-dist/tex/context/base/mkxl/font-ini.mklx | 1455 +- .../texmf-dist/tex/context/base/mkxl/font-lib.mklx | 4 +- .../texmf-dist/tex/context/base/mkxl/font-map.lmt | 21 +- .../texmf-dist/tex/context/base/mkxl/font-mat.mklx | 234 +- .../texmf-dist/tex/context/base/mkxl/font-mpf.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/font-ogr.lmt | 11 +- .../texmf-dist/tex/context/base/mkxl/font-one.lmt | 19 +- .../texmf-dist/tex/context/base/mkxl/font-onr.lmt | 28 +- .../texmf-dist/tex/context/base/mkxl/font-ota.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/font-otj.lmt | 87 +- .../texmf-dist/tex/context/base/mkxl/font-otl.lmt | 57 +- .../texmf-dist/tex/context/base/mkxl/font-oto.lmt | 81 +- .../texmf-dist/tex/context/base/mkxl/font-ots.lmt | 219 +- .../context/base/mkxl/font-phb-imp-internal.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/font-phb.lmt | 11 +- .../texmf-dist/tex/context/base/mkxl/font-pre.mkxl | 70 +- .../texmf-dist/tex/context/base/mkxl/font-set.mklx | 28 +- .../texmf-dist/tex/context/base/mkxl/font-shp.lmt | 406 + .../texmf-dist/tex/context/base/mkxl/font-sol.mklx | 2 +- .../texmf-dist/tex/context/base/mkxl/font-sty.mklx | 37 +- .../texmf-dist/tex/context/base/mkxl/font-tex.lmt | 11 +- .../texmf-dist/tex/context/base/mkxl/font-tfm.lmt | 122 +- .../texmf-dist/tex/context/base/mkxl/font-tpk.lmt | 405 +- .../texmf-dist/tex/context/base/mkxl/font-ttf.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/font-txt.lmt | 18 +- .../texmf-dist/tex/context/base/mkxl/font-var.mklx | 34 + .../texmf-dist/tex/context/base/mkxl/good-gen.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/good-mth.lmt | 2 + .../texmf-dist/tex/context/base/mkxl/grph-epd.lmt | 12 +- .../texmf-dist/tex/context/base/mkxl/grph-epd.mkxl | 26 +- .../texmf-dist/tex/context/base/mkxl/grph-fig.mkxl | 30 +- .../texmf-dist/tex/context/base/mkxl/grph-inc.lmt | 95 +- .../texmf-dist/tex/context/base/mkxl/grph-inc.mkxl | 129 +- .../texmf-dist/tex/context/base/mkxl/grph-pat.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/grph-raw.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/grph-rul.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/grph-trf.lmt | 18 +- .../texmf-dist/tex/context/base/mkxl/grph-trf.mkxl | 137 +- .../texmf-dist/tex/context/base/mkxl/hand-ini.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/l-bit32.lmt | 109 + Master/texmf-dist/tex/context/base/mkxl/l-lua.lmt | 88 + .../texmf-dist/tex/context/base/mkxl/l-unicode.lmt | 34 +- .../texmf-dist/tex/context/base/mkxl/lang-def.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/lang-dis.lmt | 19 +- .../texmf-dist/tex/context/base/mkxl/lang-frq.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/lang-hup.lmt | 22 +- .../texmf-dist/tex/context/base/mkxl/lang-hyp.lmt | 26 +- .../texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl | 67 +- .../texmf-dist/tex/context/base/mkxl/lang-ini.lmt | 21 +- .../texmf-dist/tex/context/base/mkxl/lang-ini.mkxl | 68 +- .../texmf-dist/tex/context/base/mkxl/lang-lab.lmt | 58 +- .../texmf-dist/tex/context/base/mkxl/lang-lab.mkxl | 24 +- .../texmf-dist/tex/context/base/mkxl/lang-mis.mkxl | 36 +- .../texmf-dist/tex/context/base/mkxl/lang-rep.lmt | 118 +- .../texmf-dist/tex/context/base/mkxl/lang-rep.mkxl | 20 +- .../texmf-dist/tex/context/base/mkxl/lang-tra.lmt | 11 +- .../texmf-dist/tex/context/base/mkxl/lang-tra.mkxl | 184 +- .../texmf-dist/tex/context/base/mkxl/lang-url.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/lang-url.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/lang-wrd.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/layo-ini.lmt | 4 +- .../tex/context/base/mkxl/libs-imp-mysql.lmt | 1 + .../tex/context/base/mkxl/libs-imp-openssl.lmt | 116 + .../tex/context/base/mkxl/libs-imp-postgress.lmt | 1 + .../tex/context/base/mkxl/libs-imp-zint.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt | 91 +- .../texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt | 18 +- .../texmf-dist/tex/context/base/mkxl/lpdf-col.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt | 628 +- .../texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt | 177 +- .../context/base/mkxl/lpdf-fix-imp-contents.lmt | 711 + .../tex/context/base/mkxl/lpdf-fix-imp-fonts.lmt | 1100 ++ .../texmf-dist/tex/context/base/mkxl/lpdf-fix.lmt | 131 + .../texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt | 61 +- .../texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt | 165 +- .../texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt | 189 - .../texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt | 104 +- .../texmf-dist/tex/context/base/mkxl/lpdf-img.lmt | 96 +- .../texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt | 82 +- .../texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt | 909 +- .../texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt | 42 +- .../texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt | 623 +- .../texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt | 48 +- .../texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt | 287 +- .../texmf-dist/tex/context/base/mkxl/lpdf-sig.lmt | 430 + .../texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt | 502 +- .../texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt | 25 +- .../texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt | 185 +- .../texmf-dist/tex/context/base/mkxl/luat-bas.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/luat-cbk.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/luat-cnf.lmt | 37 +- .../texmf-dist/tex/context/base/mkxl/luat-cod.lmt | 14 +- .../texmf-dist/tex/context/base/mkxl/luat-ini.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/luat-ini.mkxl | 9 +- .../texmf-dist/tex/context/base/mkxl/luat-lib.mkxl | 3 +- .../texmf-dist/tex/context/base/mkxl/luat-log.lmt | 50 +- .../texmf-dist/tex/context/base/mkxl/luat-run.lmt | 1 - .../texmf-dist/tex/context/base/mkxl/lxml-css.lmt | 1193 ++ .../texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl | 22 +- .../texmf-dist/tex/context/base/mkxl/lxml-mms.lmt | 1120 ++ .../texmf-dist/tex/context/base/mkxl/math-acc.mklx | 56 +- .../texmf-dist/tex/context/base/mkxl/math-act.lmt | 1054 +- .../texmf-dist/tex/context/base/mkxl/math-ali.mkxl | 1785 ++- .../texmf-dist/tex/context/base/mkxl/math-com.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/math-def.mkxl | 24 +- .../texmf-dist/tex/context/base/mkxl/math-del.mkxl | 22 +- .../texmf-dist/tex/context/base/mkxl/math-dif.mkxl | 56 +- .../texmf-dist/tex/context/base/mkxl/math-dld.mklx | 34 +- .../texmf-dist/tex/context/base/mkxl/math-fen.mkxl | 342 +- .../texmf-dist/tex/context/base/mkxl/math-fnt.lmt | 59 +- .../texmf-dist/tex/context/base/mkxl/math-frc.mkxl | 226 +- .../texmf-dist/tex/context/base/mkxl/math-inc.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/math-ini.lmt | 918 +- .../texmf-dist/tex/context/base/mkxl/math-ini.mkxl | 1788 ++- .../texmf-dist/tex/context/base/mkxl/math-lop.mkxl | 39 +- .../texmf-dist/tex/context/base/mkxl/math-map.lmt | 29 +- .../texmf-dist/tex/context/base/mkxl/math-noa.lmt | 1033 +- .../texmf-dist/tex/context/base/mkxl/math-pln.mkxl | 27 + .../texmf-dist/tex/context/base/mkxl/math-rad.mklx | 107 +- .../texmf-dist/tex/context/base/mkxl/math-ren.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/math-spa.lmt | 220 +- .../texmf-dist/tex/context/base/mkxl/math-stc.mklx | 250 +- .../texmf-dist/tex/context/base/mkxl/math-tag.lmt | 1056 +- .../texmf-dist/tex/context/base/mkxl/math-toy.mkxl | 12 +- .../context/base/mkxl/math-txt-imp-chemistry.lmt | 63 + .../tex/context/base/mkxl/math-txt-imp-default.lmt | 1540 +++ .../texmf-dist/tex/context/base/mkxl/math-txt.lmt | 139 + .../texmf-dist/tex/context/base/mkxl/math-vfu.lmt | 5 +- .../tex/context/base/mkxl/meta-imp-clock.mkxl | 2 +- .../tex/context/base/mkxl/meta-imp-demo.mkxl | 2 +- .../tex/context/base/mkxl/meta-imp-kaktovik.mkxl | 71 +- .../tex/context/base/mkxl/meta-imp-threesix.mkxl | 12 +- .../tex/context/base/mkxl/meta-imp-txt.lmt | 2 +- .../tex/context/base/mkxl/meta-imp-txt.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/meta-ini.mkxl | 116 +- .../texmf-dist/tex/context/base/mkxl/meta-nod.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl | 17 +- .../texmf-dist/tex/context/base/mkxl/meta-tex.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl | 8 + .../texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt | 29 +- .../texmf-dist/tex/context/base/mkxl/mlib-int.lmt | 219 +- .../texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt | 14 +- .../texmf-dist/tex/context/base/mkxl/mlib-lua.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/mlib-ptr.lmt | 505 + .../texmf-dist/tex/context/base/mkxl/mlib-scn.lmt | 46 +- .../texmf-dist/tex/context/base/mkxl/mlib-svg.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/mult-aux.mkxl | 491 +- .../texmf-dist/tex/context/base/mkxl/mult-ini.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/mult-ini.mkxl | 36 +- .../texmf-dist/tex/context/base/mkxl/mult-prm.mkxl | 2 + .../texmf-dist/tex/context/base/mkxl/mult-sys.mkxl | 6 + .../texmf-dist/tex/context/base/mkxl/node-acc.lmt | 25 +- .../texmf-dist/tex/context/base/mkxl/node-ali.lmt | 785 +- .../texmf-dist/tex/context/base/mkxl/node-aux.lmt | 125 +- .../texmf-dist/tex/context/base/mkxl/node-bck.lmt | 18 +- .../texmf-dist/tex/context/base/mkxl/node-cmp.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/node-dir.lmt | 11 +- .../texmf-dist/tex/context/base/mkxl/node-ext.lmt | 6 +- .../texmf-dist/tex/context/base/mkxl/node-fin.lmt | 26 +- .../texmf-dist/tex/context/base/mkxl/node-fnt.lmt | 17 +- .../texmf-dist/tex/context/base/mkxl/node-gcm.lmt | 6 +- .../texmf-dist/tex/context/base/mkxl/node-ini.lmt | 27 +- .../texmf-dist/tex/context/base/mkxl/node-ini.mkxl | 10 +- .../texmf-dist/tex/context/base/mkxl/node-mig.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/node-nut.lmt | 22 +- .../texmf-dist/tex/context/base/mkxl/node-pro.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/node-ref.lmt | 46 +- .../texmf-dist/tex/context/base/mkxl/node-res.lmt | 33 +- .../texmf-dist/tex/context/base/mkxl/node-rul.lmt | 132 +- .../texmf-dist/tex/context/base/mkxl/node-rul.mkxl | 107 +- .../texmf-dist/tex/context/base/mkxl/node-scn.lmt | 57 +- .../texmf-dist/tex/context/base/mkxl/node-ser.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/node-shp.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/node-syn.lmt | 44 +- .../texmf-dist/tex/context/base/mkxl/node-tra.lmt | 36 +- .../texmf-dist/tex/context/base/mkxl/node-tsk.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/node-tst.lmt | 12 +- .../texmf-dist/tex/context/base/mkxl/pack-bar.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/pack-bck.mklx | 30 +- .../texmf-dist/tex/context/base/mkxl/pack-box.mkxl | 119 +- .../texmf-dist/tex/context/base/mkxl/pack-com.mkxl | 144 +- .../texmf-dist/tex/context/base/mkxl/pack-cut.mkxl | 46 +- .../texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl | 67 +- .../texmf-dist/tex/context/base/mkxl/pack-mat.mkxl | 68 +- .../texmf-dist/tex/context/base/mkxl/pack-mis.mklx | 6 +- .../texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl | 146 +- .../texmf-dist/tex/context/base/mkxl/pack-pos.mkxl | 31 +- .../texmf-dist/tex/context/base/mkxl/pack-rul.lmt | 22 +- .../texmf-dist/tex/context/base/mkxl/pack-rul.mkxl | 273 +- .../texmf-dist/tex/context/base/mkxl/page-app.mkxl | 44 +- .../texmf-dist/tex/context/base/mkxl/page-bck.mkxl | 251 +- .../texmf-dist/tex/context/base/mkxl/page-blk.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/page-box.mklx | 8 +- .../texmf-dist/tex/context/base/mkxl/page-brk.mkxl | 82 +- .../texmf-dist/tex/context/base/mkxl/page-col.mkxl | 5 + .../texmf-dist/tex/context/base/mkxl/page-com.mkxl | 24 +- .../texmf-dist/tex/context/base/mkxl/page-cst.mkxl | 56 +- .../texmf-dist/tex/context/base/mkxl/page-fac.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/page-ffl.mkxl | 20 +- .../texmf-dist/tex/context/base/mkxl/page-flt.mkxl | 60 +- .../texmf-dist/tex/context/base/mkxl/page-flw.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/page-imp.mkxl | 81 +- .../texmf-dist/tex/context/base/mkxl/page-inf.mkxl | 10 +- .../texmf-dist/tex/context/base/mkxl/page-ini.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/page-ini.mkxl | 22 +- .../texmf-dist/tex/context/base/mkxl/page-inj.mklx | 14 +- .../texmf-dist/tex/context/base/mkxl/page-ins.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/page-lay.mkxl | 131 +- .../texmf-dist/tex/context/base/mkxl/page-lin.lmt | 24 +- .../texmf-dist/tex/context/base/mkxl/page-lin.mklx | 95 +- .../texmf-dist/tex/context/base/mkxl/page-mak.mklx | 26 +- .../texmf-dist/tex/context/base/mkxl/page-mbk.mklx | 31 +- .../texmf-dist/tex/context/base/mkxl/page-mcl.mkxl | 38 +- .../texmf-dist/tex/context/base/mkxl/page-mix.mkxl | 72 +- .../texmf-dist/tex/context/base/mkxl/page-mrk.mkxl | 42 +- .../texmf-dist/tex/context/base/mkxl/page-one.mkxl | 260 +- .../texmf-dist/tex/context/base/mkxl/page-otr.mklx | 90 +- .../texmf-dist/tex/context/base/mkxl/page-pcl.mkxl | 230 +- .../texmf-dist/tex/context/base/mkxl/page-pst.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/page-sel.mklx | 94 +- .../texmf-dist/tex/context/base/mkxl/page-sid.mkxl | 62 +- .../texmf-dist/tex/context/base/mkxl/page-smp.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/page-spr.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/page-str.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/page-txt.mklx | 257 +- .../texmf-dist/tex/context/base/mkxl/phys-dim.lmt | 18 +- .../texmf-dist/tex/context/base/mkxl/phys-dim.mkxl | 42 +- .../texmf-dist/tex/context/base/mkxl/publ-aut.lmt | 1050 ++ .../texmf-dist/tex/context/base/mkxl/publ-ini.mkxl | 108 +- .../texmf-dist/tex/context/base/mkxl/publ-oth.lmt | 159 + .../texmf-dist/tex/context/base/mkxl/scrn-bar.mklx | 211 +- .../texmf-dist/tex/context/base/mkxl/scrn-but.mklx | 108 +- .../texmf-dist/tex/context/base/mkxl/scrn-fld.mklx | 182 +- .../texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx | 12 +- .../texmf-dist/tex/context/base/mkxl/scrn-ini.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/scrn-ini.mklx | 28 +- .../texmf-dist/tex/context/base/mkxl/scrn-pag.mklx | 8 +- .../texmf-dist/tex/context/base/mkxl/scrn-ref.mklx | 22 +- .../texmf-dist/tex/context/base/mkxl/scrn-wid.lmt | 7 +- .../texmf-dist/tex/context/base/mkxl/scrn-wid.mklx | 50 +- .../texmf-dist/tex/context/base/mkxl/scrp-ini.lmt | 12 +- .../texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl | 10 +- .../texmf-dist/tex/context/base/mkxl/spac-ali.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/spac-ali.mkxl | 434 +- .../texmf-dist/tex/context/base/mkxl/spac-brk.lmt | 236 + .../texmf-dist/tex/context/base/mkxl/spac-brk.mkxl | 43 + .../texmf-dist/tex/context/base/mkxl/spac-chr.lmt | 44 +- .../texmf-dist/tex/context/base/mkxl/spac-chr.mkxl | 42 +- .../texmf-dist/tex/context/base/mkxl/spac-def.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/spac-flr.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/spac-grd.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/spac-hor.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/spac-hor.mkxl | 122 +- .../tex/context/base/mkxl/spac-imp-tests.mkxl | 247 + .../texmf-dist/tex/context/base/mkxl/spac-lin.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/spac-pag.mkxl | 32 +- .../texmf-dist/tex/context/base/mkxl/spac-par.mkxl | 98 +- .../texmf-dist/tex/context/base/mkxl/spac-pas.lmt | 263 + .../texmf-dist/tex/context/base/mkxl/spac-pas.mkxl | 111 + .../texmf-dist/tex/context/base/mkxl/spac-prf.lmt | 54 +- .../texmf-dist/tex/context/base/mkxl/spac-prf.mklx | 20 +- .../texmf-dist/tex/context/base/mkxl/spac-ver.lmt | 147 +- .../texmf-dist/tex/context/base/mkxl/spac-ver.mkxl | 454 +- .../texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/strc-blk.mkxl | 12 +- .../texmf-dist/tex/context/base/mkxl/strc-con.mklx | 53 +- .../texmf-dist/tex/context/base/mkxl/strc-des.mklx | 17 +- .../texmf-dist/tex/context/base/mkxl/strc-enu.mklx | 21 +- .../texmf-dist/tex/context/base/mkxl/strc-flt.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/strc-flt.mklx | 698 +- .../texmf-dist/tex/context/base/mkxl/strc-ind.mkxl | 17 +- .../texmf-dist/tex/context/base/mkxl/strc-itm.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/strc-itm.mklx | 642 +- .../texmf-dist/tex/context/base/mkxl/strc-lab.mkxl | 35 +- .../texmf-dist/tex/context/base/mkxl/strc-lev.mklx | 2 +- .../texmf-dist/tex/context/base/mkxl/strc-lnt.mklx | 35 +- .../texmf-dist/tex/context/base/mkxl/strc-lst.lmt | 35 +- .../texmf-dist/tex/context/base/mkxl/strc-lst.mklx | 173 +- .../tex/context/base/mkxl/strc-mar-old.lmt | 759 -- .../texmf-dist/tex/context/base/mkxl/strc-mar.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/strc-mar.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/strc-mat.mkxl | 683 +- .../texmf-dist/tex/context/base/mkxl/strc-not.lmt | 7 +- .../texmf-dist/tex/context/base/mkxl/strc-not.mklx | 212 +- .../texmf-dist/tex/context/base/mkxl/strc-num.mkxl | 14 +- .../texmf-dist/tex/context/base/mkxl/strc-pag.mkxl | 32 +- .../texmf-dist/tex/context/base/mkxl/strc-ref.lmt | 45 +- .../texmf-dist/tex/context/base/mkxl/strc-ref.mklx | 91 +- .../texmf-dist/tex/context/base/mkxl/strc-reg.lmt | 146 +- .../texmf-dist/tex/context/base/mkxl/strc-reg.mkxl | 274 +- .../texmf-dist/tex/context/base/mkxl/strc-ren.mkxl | 48 +- .../texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl | 15 +- .../texmf-dist/tex/context/base/mkxl/strc-sec.mkxl | 199 +- .../texmf-dist/tex/context/base/mkxl/strc-syn.lmt | 12 +- .../texmf-dist/tex/context/base/mkxl/strc-syn.mkxl | 54 +- .../texmf-dist/tex/context/base/mkxl/strc-tag.lmt | 357 +- .../texmf-dist/tex/context/base/mkxl/strc-tag.mkxl | 38 +- .../texmf-dist/tex/context/base/mkxl/strc-tnt.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/strc-usr.mkxl | 10 +- .../texmf-dist/tex/context/base/mkxl/supp-box.lmt | 168 +- .../texmf-dist/tex/context/base/mkxl/supp-box.mkxl | 245 +- .../texmf-dist/tex/context/base/mkxl/supp-dir.mkxl | 3 - .../texmf-dist/tex/context/base/mkxl/supp-mat.mkxl | 13 - .../texmf-dist/tex/context/base/mkxl/symb-ini.lmt | 5 +- .../texmf-dist/tex/context/base/mkxl/symb-ini.mkxl | 45 +- .../texmf-dist/tex/context/base/mkxl/syst-aux.lmt | 433 +- .../texmf-dist/tex/context/base/mkxl/syst-aux.mkxl | 573 +- .../texmf-dist/tex/context/base/mkxl/syst-con.lmt | 156 + .../texmf-dist/tex/context/base/mkxl/syst-con.mkxl | 15 +- .../texmf-dist/tex/context/base/mkxl/syst-ini.mkxl | 287 +- .../texmf-dist/tex/context/base/mkxl/syst-lua.lmt | 28 +- .../texmf-dist/tex/context/base/mkxl/syst-lua.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/syst-mac.lmt | 14 +- .../texmf-dist/tex/context/base/mkxl/tabl-ali.lmt | 82 + .../texmf-dist/tex/context/base/mkxl/tabl-ali.mkxl | 46 + .../texmf-dist/tex/context/base/mkxl/tabl-com.mkxl | 14 +- .../texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl | 56 +- .../texmf-dist/tex/context/base/mkxl/tabl-itm.mkxl | 102 + .../texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl | 47 +- .../texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl | 62 +- .../texmf-dist/tex/context/base/mkxl/tabl-ntb.lmt | 7 +- .../texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl | 204 +- .../texmf-dist/tex/context/base/mkxl/tabl-nte.mkxl | 14 +- .../texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl | 133 +- .../texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt | 6 +- .../texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl | 411 +- .../texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl | 172 +- .../texmf-dist/tex/context/base/mkxl/tabl-xnt.mklx | 4 +- .../texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt | 69 +- .../texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx | 70 +- .../texmf-dist/tex/context/base/mkxl/task-ini.lmt | 13 +- .../texmf-dist/tex/context/base/mkxl/toks-aux.lmt | 325 +- .../texmf-dist/tex/context/base/mkxl/toks-ini.lmt | 13 +- .../texmf-dist/tex/context/base/mkxl/toks-scn.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/trac-bld.lmt | 288 + .../texmf-dist/tex/context/base/mkxl/trac-bld.mkxl | 52 + .../texmf-dist/tex/context/base/mkxl/trac-brk.lmt | 425 + .../texmf-dist/tex/context/base/mkxl/trac-brk.mkxl | 47 + .../texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl | 6 +- .../texmf-dist/tex/context/base/mkxl/trac-inf.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/trac-jus.lmt | 9 +- .../texmf-dist/tex/context/base/mkxl/trac-riv.lmt | 320 + .../texmf-dist/tex/context/base/mkxl/trac-riv.mkxl | 87 + .../texmf-dist/tex/context/base/mkxl/trac-set.lmt | 4 +- .../texmf-dist/tex/context/base/mkxl/trac-tex.lmt | 120 + .../texmf-dist/tex/context/base/mkxl/trac-tex.mkxl | 39 +- .../texmf-dist/tex/context/base/mkxl/trac-vis.lmt | 603 +- .../texmf-dist/tex/context/base/mkxl/trac-vis.mkxl | 18 +- .../texmf-dist/tex/context/base/mkxl/type-ini.mklx | 59 +- .../texmf-dist/tex/context/base/mkxl/type-set.mkxl | 3 + .../texmf-dist/tex/context/base/mkxl/typo-ada.lmt | 89 +- .../texmf-dist/tex/context/base/mkxl/typo-ada.mkxl | 23 +- .../texmf-dist/tex/context/base/mkxl/typo-adj.lmt | 7 +- .../texmf-dist/tex/context/base/mkxl/typo-adj.mkxl | 1 - .../texmf-dist/tex/context/base/mkxl/typo-bld.lmt | 34 +- .../texmf-dist/tex/context/base/mkxl/typo-brk.lmt | 21 +- .../texmf-dist/tex/context/base/mkxl/typo-brk.mkxl | 12 +- .../texmf-dist/tex/context/base/mkxl/typo-cap.lmt | 71 +- .../texmf-dist/tex/context/base/mkxl/typo-cap.mkxl | 116 +- .../texmf-dist/tex/context/base/mkxl/typo-chr.lmt | 14 +- .../texmf-dist/tex/context/base/mkxl/typo-cln.lmt | 18 +- .../texmf-dist/tex/context/base/mkxl/typo-del.mkxl | 19 +- .../texmf-dist/tex/context/base/mkxl/typo-dha.lmt | 22 +- .../texmf-dist/tex/context/base/mkxl/typo-dig.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/typo-dig.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/typo-dir.lmt | 21 +- .../texmf-dist/tex/context/base/mkxl/typo-dir.mkxl | 14 +- .../texmf-dist/tex/context/base/mkxl/typo-drp.lmt | 147 +- .../texmf-dist/tex/context/base/mkxl/typo-drp.mkxl | 24 +- .../texmf-dist/tex/context/base/mkxl/typo-duc.lmt | 33 +- .../texmf-dist/tex/context/base/mkxl/typo-fkr.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/typo-fln.lmt | 21 +- .../texmf-dist/tex/context/base/mkxl/typo-fln.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/typo-hid.lmt | 9 +- .../texmf-dist/tex/context/base/mkxl/typo-inj.lmt | 5 +- .../texmf-dist/tex/context/base/mkxl/typo-inj.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/typo-itc.lmt | 1008 +- .../texmf-dist/tex/context/base/mkxl/typo-itc.mklx | 77 +- .../texmf-dist/tex/context/base/mkxl/typo-itm.mkxl | 23 +- .../texmf-dist/tex/context/base/mkxl/typo-krn.lmt | 142 +- .../texmf-dist/tex/context/base/mkxl/typo-krn.mkxl | 10 +- .../texmf-dist/tex/context/base/mkxl/typo-lan.lmt | 7 +- .../texmf-dist/tex/context/base/mkxl/typo-lbx.lmt | 14 +- .../texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl | 16 +- .../texmf-dist/tex/context/base/mkxl/typo-lin.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/typo-mar.lmt | 48 +- .../texmf-dist/tex/context/base/mkxl/typo-mar.mkxl | 26 +- .../texmf-dist/tex/context/base/mkxl/typo-ovl.lmt | 10 +- .../texmf-dist/tex/context/base/mkxl/typo-pag.lmt | 16 +- .../texmf-dist/tex/context/base/mkxl/typo-plc.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/typo-pnc.lmt | 19 +- .../texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl | 2 +- .../texmf-dist/tex/context/base/mkxl/typo-prc.mklx | 2 +- .../texmf-dist/tex/context/base/mkxl/typo-rep.lmt | 7 +- .../texmf-dist/tex/context/base/mkxl/typo-rub.lmt | 37 +- .../texmf-dist/tex/context/base/mkxl/typo-rub.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/typo-scr.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/typo-shp.lmt | 2 +- .../texmf-dist/tex/context/base/mkxl/typo-shp.mkxl | 15 +- .../texmf-dist/tex/context/base/mkxl/typo-spa.lmt | 147 +- .../texmf-dist/tex/context/base/mkxl/typo-spa.mkxl | 44 +- .../texmf-dist/tex/context/base/mkxl/typo-sus.lmt | 38 +- .../texmf-dist/tex/context/base/mkxl/typo-sus.mkxl | 4 +- .../texmf-dist/tex/context/base/mkxl/typo-syn.lmt | 40 +- .../texmf-dist/tex/context/base/mkxl/typo-syn.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/typo-tal.lmt | 20 +- .../texmf-dist/tex/context/base/mkxl/typo-tal.mkxl | 8 +- .../texmf-dist/tex/context/base/mkxl/typo-txt.mklx | 25 +- .../texmf-dist/tex/context/base/mkxl/typo-wrp.lmt | 14 +- .../texmf-dist/tex/context/base/mkxl/util-deb.lmt | 8 +- .../texmf-dist/tex/context/base/mkxl/util-jsn.lmt | 469 + .../texmf-dist/tex/context/base/mkxl/util-prs.lmt | 897 ++ .../context/colors/icc/context/colorprofiles.lua | 14 - .../context/colors/icc/context/colorprofiles.xml | 427 - .../tex/context/fonts/mkiv/antykwa-math.lfg | 9 +- .../tex/context/fonts/mkiv/bonum-math.lfg | 16 +- .../tex/context/fonts/mkiv/cambria-math.lfg | 24 +- .../tex/context/fonts/mkiv/color-latin.lfg | 11 + .../tex/context/fonts/mkiv/common-math.lfg | 147 +- .../tex/context/fonts/mkiv/concrete-math.lfg | 15 +- .../tex/context/fonts/mkiv/dejavu-math.lfg | 7 +- .../tex/context/fonts/mkiv/ebgaramond-math.lfg | 5 +- .../tex/context/fonts/mkiv/erewhon-math.lfg | 11 +- .../tex/context/fonts/mkiv/euler-math.lfg | 31 +- .../tex/context/fonts/mkiv/fira-math.lfg | 23 + .../tex/context/fonts/mkiv/fontawesome.lfg | 30 + .../tex/context/fonts/mkiv/gfsneohellenic-math.lfg | 109 + .../tex/context/fonts/mkiv/iwona-math.lfg | 3 + .../tex/context/fonts/mkiv/kpfonts-math.lfg | 5 + .../tex/context/fonts/mkiv/kurier-math.lfg | 3 + .../tex/context/fonts/mkiv/libertinus-math.lfg | 37 +- .../tex/context/fonts/mkiv/minion-math.lfg | 5 + .../tex/context/fonts/mkiv/modern-math.lfg | 286 +- .../context/fonts/mkiv/newcomputermodern-math.lfg | 17 +- .../tex/context/fonts/mkiv/pagella-math.lfg | 50 +- .../tex/context/fonts/mkiv/schola-math.lfg | 1 + .../tex/context/fonts/mkiv/stixtwo-math.lfg | 49 +- .../tex/context/fonts/mkiv/termes-math.lfg | 26 +- .../tex/context/fonts/mkiv/type-imp-antykwa.mkiv | 33 +- .../tex/context/fonts/mkiv/type-imp-cambria.mkiv | 8 + .../context/fonts/mkiv/type-imp-ebgaramond.mkiv | 8 +- .../tex/context/fonts/mkiv/type-imp-erewhon.mkiv | 6 + .../tex/context/fonts/mkiv/type-imp-fira.mkiv | 31 + .../fonts/mkiv/type-imp-gfsneohellenic.mkiv | 35 + .../tex/context/fonts/mkiv/type-imp-iwona.mkiv | 187 +- .../tex/context/fonts/mkiv/type-imp-kurier.mkiv | 182 +- .../context/fonts/mkiv/type-imp-latinmodern.mkiv | 10 + .../tex/context/fonts/mkiv/type-imp-plex.mkiv | 40 +- .../tex/context/fonts/mkiv/type-imp-source.mkiv | 64 + .../tex/context/fonts/mkiv/type-imp-texgyre.mkiv | 16 +- .../tex/context/fonts/mkiv/type-imp-xcharter.mkiv | 6 + .../tex/context/fonts/mkiv/xcharter-math.lfg | 5 + .../tex/context/fonts/mkxl/type-imp-euler.mkxl | 23 +- .../tex/context/interface/mkiv/context-en.xml | 37 + .../tex/context/interface/mkiv/i-align.xml | 2 + .../tex/context/interface/mkiv/i-context.pdf | Bin 848669 -> 848819 bytes .../tex/context/interface/mkiv/i-framed.xml | 8 + .../tex/context/interface/mkiv/i-graphics.xml | 11 + .../tex/context/interface/mkiv/i-readme.pdf | Bin 24624 -> 25039 bytes .../tex/context/interface/mkiv/i-textrule.xml | 6 + .../tex/context/interface/mkiv/i-thinrule.xml | 6 + .../tex/context/interface/mkiv/i-verbatim.xml | 4 + .../tex/context/modules/mkiv/m-asymptote.lua | 1 + .../tex/context/modules/mkiv/m-circuitikz.mkiv | 7 +- .../tex/context/modules/mkiv/m-escrito.lua | 1 - .../tex/context/modules/mkiv/m-graph.mkiv | 3 +- .../tex/context/modules/mkiv/m-scite.mkiv | 12 +- .../tex/context/modules/mkiv/m-tikz.mkiv | 20 + .../context/modules/mkiv/s-abbreviations-logos.tex | 47 +- .../tex/context/modules/mkiv/s-evohome.mkiv | 190 +- .../tex/context/modules/mkiv/s-fonts-charts.mkiv | 2 +- .../tex/context/modules/mkiv/s-fonts-features.lua | 90 +- .../tex/context/modules/mkiv/s-fonts-features.mkiv | 45 +- .../tex/context/modules/mkiv/s-fonts-variable.mkiv | 8 +- .../tex/context/modules/mkiv/s-inf-03.mkiv | 1 + .../tex/context/modules/mkiv/s-inf-04.mkiv | 2 +- .../tex/context/modules/mkiv/s-math-characters.lua | 154 +- .../context/modules/mkiv/s-math-characters.mkiv | 23 +- .../context/modules/mkiv/s-math-parameters.mkiv | 2 + .../context/modules/mkiv/s-obsolete-tokens.mkiv | 2 + .../tex/context/modules/mkiv/s-present-banner.mkiv | 2 + .../tex/context/modules/mkiv/s-present-tiles.mkiv | 2 + .../context/modules/mkiv/s-present-wobbling.mkiv | 2 + .../tex/context/modules/mkiv/s-setups-missing.mkiv | 14 +- .../tex/context/modules/mkiv/s-tugboat.mkiv | 20 +- .../tex/context/modules/mkiv/s-xml-analyzers.lua | 13 +- .../tex/context/modules/mkiv/x-asciimath.lua | 28 +- .../tex/context/modules/mkxl/m-circuitikz.mkxl | 7 +- .../tex/context/modules/mkxl/m-gimmicks.mkxl | 6 +- .../tex/context/modules/mkxl/m-json.mkxl | 2 +- .../tex/context/modules/mkxl/m-mathfun.mkxl | 233 - .../tex/context/modules/mkxl/m-oldmath.mkxl | 42 +- .../tex/context/modules/mkxl/m-polynomial.mkxl | 900 ++ .../tex/context/modules/mkxl/m-tikz.mkxl | 94 +- .../tex/context/modules/mkxl/s-colors-show.mkxl | 8 +- .../tex/context/modules/mkxl/s-fonts-outlines.mkxl | 240 + .../tex/context/modules/mkxl/s-fonts-show.mkxl | 71 +- .../tex/context/modules/mkxl/s-games-2023.mkxl | 224 + .../tex/context/modules/mkxl/s-math-show.mkxl | 140 + .../tex/context/modules/mkxl/s-math-tweaks.mkxl | 63 +- .../tex/context/modules/mkxl/s-system-macros.mkxl | 1 + .../tex/context/modules/mkxl/s-system-syntax.lmt | 2176 +++ .../tex/context/modules/mkxl/s-system-syntax.mkxl | 293 + .../tex/context/modules/mkxl/s-system-tokens.lmt | 22 +- .../tex/context/modules/mkxl/s-system-units.mkxl | 90 + .../tex/context/modules/mkxl/s-text-tests.mkxl | 22 + .../context/modules/mkxl/s-tugboat-columns.mkxl | 831 ++ .../context/modules/mkxl/s-tugboat-exceptions.mkxl | 9 + .../tex/context/modules/mkxl/s-tugboat-logos.mkxl | 83 + .../tex/context/modules/mkxl/s-tugboat.mkxl | 7 + .../tex/context/modules/mkxl/x-asciimath.lmt | 2304 ++++ .../tex/context/modules/mkxl/x-asciimath.mkxl | 497 + .../tex/context/modules/mkxl/x-calcmath.lmt | 364 + .../tex/context/modules/mkxl/x-calcmath.mkxl | 80 + .../tex/context/modules/mkxl/x-mathml.mkxl | 97 +- .../modules/third/mtx-install-imp-modules.lua | 74 + .../context/modules/third/mtx-install-imp-tikz.lua | 50 + .../tex/context/patterns/common/lang-hy.rme | 3 + .../tex/context/patterns/common/lang-id.rme | 3 + .../tex/context/patterns/mkiv/lang-hy.lua | 20 + .../tex/context/patterns/mkiv/lang-id.lua | 23 + .../tex/context/sample/common/dijkstra.tex | 3 + .../tex/context/sample/common/knuth-gpt.tex | 4 + .../tex/context/sample/common/knuthmath.tex | 3 + .../tex/context/sample/common/samples.tex | 8 +- .../tex/context/sample/math/math-knuth-dt.tex | 16 + .../context/sample/math/math-kontinuitet-sv.tex | 8 + .../tex/context/sample/third/alfredsson-sv.tex | 6 + .../tex/context/sample/third/falstaff-sv.tex | 5 + .../sample/third/lansburgh-letterspacing-sv.tex | 6 + .../texmf-dist/tex/context/sample/third/readme.txt | 23 + .../tex/context/test/mkiv/pdf-a1a-2005.mkiv | 3 + .../texmf-dist/tex/context/test/mkiv/pdf-a3a.mkiv | 17 +- .../tex/generic/context/luatex/luatex-core.lua | 124 +- .../generic/context/luatex/luatex-fonts-merged.lua | 375 +- 1048 files changed, 93578 insertions(+), 31530 deletions(-) delete mode 100644 Master/texmf-dist/doc/context/README.adoc create mode 100644 Master/texmf-dist/doc/context/context-readme.txt create mode 100644 Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-accuracy.pdf create mode 100644 Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-lines.pdf create mode 100644 Master/texmf-dist/doc/context/documents/general/manuals/pdfmerge.pdf delete mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/luatools.html delete mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/luatools.man delete mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/luatools.xml create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.html create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.man create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.xml create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.html create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.man create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.xml create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.html create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.man create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.xml create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.html create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.man create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.xml create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.html create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.man create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.xml create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.html create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.man create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.xml create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.html create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.man create mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.xml delete mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.html delete mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.man delete mode 100644 Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.xml create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-compact.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-accuracy.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-lines.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/eutypon-gr-e-blog-21-02-13-why-i-do-not-like-luatex.png create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-assumptions.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-deserved.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-dontusetex.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-history.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-manuals.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-perfection.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-performance.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-treasures.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-accuracy.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-active.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-bars.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-constants.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-envelopes.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-green.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-jmn.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-mathfonts.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic-pgc.pdf create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-profiles.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-radicals.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-standardize.tex create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge-testfiles.zip create mode 100644 Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge.tex delete mode 100644 Master/texmf-dist/doc/man/man1/luatools.1 delete mode 100644 Master/texmf-dist/doc/man/man1/luatools.man1.pdf create mode 100644 Master/texmf-dist/doc/man/man1/mtx-convert.1 create mode 100644 Master/texmf-dist/doc/man/man1/mtx-convert.man1.pdf create mode 100644 Master/texmf-dist/doc/man/man1/mtx-ctan.1 create mode 100644 Master/texmf-dist/doc/man/man1/mtx-ctan.man1.pdf create mode 100644 Master/texmf-dist/doc/man/man1/mtx-fixpdf.1 create mode 100644 Master/texmf-dist/doc/man/man1/mtx-fixpdf.man1.pdf create mode 100644 Master/texmf-dist/doc/man/man1/mtx-install-modules.1 create mode 100644 Master/texmf-dist/doc/man/man1/mtx-install-modules.man1.pdf create mode 100644 Master/texmf-dist/doc/man/man1/mtx-install.1 create mode 100644 Master/texmf-dist/doc/man/man1/mtx-install.man1.pdf create mode 100644 Master/texmf-dist/doc/man/man1/mtx-kpse.1 create mode 100644 Master/texmf-dist/doc/man/man1/mtx-kpse.man1.pdf create mode 100644 Master/texmf-dist/doc/man/man1/mtx-synctex.1 create mode 100644 Master/texmf-dist/doc/man/man1/mtx-synctex.man1.pdf delete mode 100644 Master/texmf-dist/doc/man/man1/mtx-timing.1 delete mode 100644 Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf create mode 100644 Master/texmf-dist/fonts/map/luatex/context/demo-font.lum create mode 100644 Master/texmf-dist/scripts/context/lua/mtx-fixpdf.lua create mode 100644 Master/texmf-dist/scripts/context/lua/mtx-install-modules.lua delete mode 100644 Master/texmf-dist/scripts/context/lua/mtx-install-tikz.lua delete mode 100755 Master/texmf-dist/scripts/context/stubs-mkiv/unix/contextjit delete mode 100755 Master/texmf-dist/scripts/context/stubs-mkiv/unix/luatools delete mode 100755 Master/texmf-dist/scripts/context/stubs-mkiv/unix/mtxrunjit delete mode 100755 Master/texmf-dist/scripts/context/stubs-mkiv/win64/contextjit.cmd delete mode 100755 Master/texmf-dist/scripts/context/stubs-mkiv/win64/luatools.cmd delete mode 100755 Master/texmf-dist/scripts/context/stubs-mkiv/win64/mtxrunjit.cmd create mode 100644 Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii-data.lgz create mode 100644 Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii.lua create mode 100644 Master/texmf-dist/tex/context/base/mkxl/buff-ver.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/core-con.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/font-imp-dimensions.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/font-imp-italics.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/font-shp.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/l-bit32.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/l-lua.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/libs-imp-openssl.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-fonts.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/lpdf-fix.lmt delete mode 100644 Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/lpdf-sig.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/lxml-css.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/lxml-mms.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-chemistry.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-default.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/math-txt.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/mlib-ptr.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/publ-aut.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/publ-oth.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/spac-brk.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/spac-brk.mkxl create mode 100644 Master/texmf-dist/tex/context/base/mkxl/spac-imp-tests.mkxl create mode 100644 Master/texmf-dist/tex/context/base/mkxl/spac-pas.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/spac-pas.mkxl delete mode 100644 Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/syst-con.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/tabl-ali.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/tabl-ali.mkxl create mode 100644 Master/texmf-dist/tex/context/base/mkxl/tabl-itm.mkxl create mode 100644 Master/texmf-dist/tex/context/base/mkxl/trac-bld.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/trac-bld.mkxl create mode 100644 Master/texmf-dist/tex/context/base/mkxl/trac-brk.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/trac-brk.mkxl create mode 100644 Master/texmf-dist/tex/context/base/mkxl/trac-riv.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/trac-riv.mkxl create mode 100644 Master/texmf-dist/tex/context/base/mkxl/trac-tex.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/util-jsn.lmt create mode 100644 Master/texmf-dist/tex/context/base/mkxl/util-prs.lmt delete mode 100644 Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.lua delete mode 100644 Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml create mode 100644 Master/texmf-dist/tex/context/fonts/mkiv/fira-math.lfg create mode 100644 Master/texmf-dist/tex/context/fonts/mkiv/fontawesome.lfg create mode 100644 Master/texmf-dist/tex/context/fonts/mkiv/gfsneohellenic-math.lfg create mode 100644 Master/texmf-dist/tex/context/fonts/mkiv/type-imp-fira.mkiv create mode 100644 Master/texmf-dist/tex/context/fonts/mkiv/type-imp-gfsneohellenic.mkiv delete mode 100644 Master/texmf-dist/tex/context/modules/mkxl/m-mathfun.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/m-polynomial.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-fonts-outlines.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-games-2023.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-math-show.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.lmt create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-system-units.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-columns.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-exceptions.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-logos.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/s-tugboat.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.lmt create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.lmt create mode 100644 Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.mkxl create mode 100644 Master/texmf-dist/tex/context/modules/third/mtx-install-imp-modules.lua create mode 100644 Master/texmf-dist/tex/context/modules/third/mtx-install-imp-tikz.lua create mode 100644 Master/texmf-dist/tex/context/patterns/common/lang-hy.rme create mode 100644 Master/texmf-dist/tex/context/patterns/common/lang-id.rme create mode 100644 Master/texmf-dist/tex/context/patterns/mkiv/lang-hy.lua create mode 100644 Master/texmf-dist/tex/context/patterns/mkiv/lang-id.lua create mode 100644 Master/texmf-dist/tex/context/sample/common/dijkstra.tex create mode 100644 Master/texmf-dist/tex/context/sample/common/knuth-gpt.tex create mode 100644 Master/texmf-dist/tex/context/sample/common/knuthmath.tex create mode 100644 Master/texmf-dist/tex/context/sample/math/math-knuth-dt.tex create mode 100644 Master/texmf-dist/tex/context/sample/math/math-kontinuitet-sv.tex create mode 100644 Master/texmf-dist/tex/context/sample/third/alfredsson-sv.tex create mode 100644 Master/texmf-dist/tex/context/sample/third/falstaff-sv.tex create mode 100644 Master/texmf-dist/tex/context/sample/third/lansburgh-letterspacing-sv.tex (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-context.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-context.lua index 15b1cca86ae..b0707090b61 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-context.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-context.lua @@ -1,4 +1,4 @@ return { - ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen", "plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone", "maxiterator", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip", "centeringfillskip", "stretchingfillskip", "shrinkingfillskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty", "thickermuskip", "directionlefttoright", "directionrighttoleft", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "prerollrun", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "texenginefunctionality", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "contextformat", "contextversion", "contextlmtxmode", "contextmark", "mksuffix", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "statuswrite", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "rlncatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "commaasciicode", "spaceasciicode", "periodasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "semicolonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "leftparentasciicode", "rightparentasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode", "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode", "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode", "loosenessfrozenparcode", "lastlinefrozenparcode", "linepenaltyfrozenparcode", "clubpenaltyfrozenparcode", "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode", "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode", "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode", "mathpenaltyfrozenparcode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode", "mathchoicegroupcode", "alsosimplegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode", "alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode", "markautomigrationcode", "insertautomigrationcode", "adjustautomigrationcode", "preautomigrationcode", "postautomigrationcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "overrulemathcontrolcode", "underrulemathcontrolcode", "radicalrulemathcontrolcode", "fractionrulemathcontrolcode", "accentskewhalfmathcontrolcode", "accentskewapplymathcontrolcode", "applyordinarykernpairmathcontrolcode", "applyverticalitalickernmathcontrolcode", "applyordinaryitalickernmathcontrolcode", "applycharitalickernmathcontrolcode", "reboxcharitalickernmathcontrolcode", "applyboxeditalickernmathcontrolcode", "staircasekernmathcontrolcode", "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode", "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode", "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode", "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", "extendaccentsmathcontrolcode", "extenddelimitersmathcontrolcode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode", "noitaliccorrectionglyphoptioncode", "islargeoperatorglyphoptioncode", "hasitalicshapeglyphoptioncode", "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode", "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode", "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode", "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode", "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode", "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode", "halfwaytotallistanchorcode", "halfwayheightlistanchorcode", "halfwaydepthlistanchorcode", "halfwayleftlistanchorcode", "halfwayrightlistanchorcode", "negatexlistsigncode", "negateylistsigncode", "negatelistsigncode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "mathexheight", "mathemwidth", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathaxisheight", "muquad", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifelsemode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startlocalcomponent", "stoplocalcomponent", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument", "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "everystoptext", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "definemode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode", "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode", "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode", "mathfractioncode", "mathmiddlecode", "mathaccentcode", "mathfencedcode", "mathghostcode", "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode", "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode", "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "lrm", "rlm", "bidilre", "bidirle", "bidipop", "bidilro", "bidirlo", "breakablethinspace", "nobreakspace", "nonbreakablespace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "enquad", "emquad", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace", "Ux", "eUx", "parfillleftskip", "parfillrightskip", "startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode", "wildcardsymbol", "normalhyphenationcode", "automatichyphenationcode", "explicithyphenationcode", "syllablehyphenationcode", "uppercasehyphenationcode", "collapsehyphenationcode", "compoundhyphenationcode", "strictstarthyphenationcode", "strictendhyphenationcode", "automaticpenaltyhyphenationcode", "explicitpenaltyhyphenationcode", "permitgluehyphenationcode", "permitallhyphenationcode", "permitmathreplacehyphenationcode", "forcecheckhyphenationcode", "lazyligatureshyphenationcode", "forcehandlerhyphenationcode", "feedbackcompoundhyphenationcode", "ignoreboundshyphenationcode", "partialhyphenationcode", "completehyphenationcode", "normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode", "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode", "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", "nopreslackclassoptioncode", "nopostslackclassoptioncode", "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", "lookaheadforendclassoptioncode", "noitaliccorrectionclassoptioncode", "defaultmathclassoptions", "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode", "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode", "operatoritaliccorrectionclassoptioncode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode", "nokerningcode", "noligaturingcode", "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode", "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode", "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode", "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode" }, - ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "startcontextdefinitioncode", "stopcontextdefinitioncode", "texdefinition", "doifelsesetups", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "fastsetup", "copysetups", "resetsetups", "doifelsecommandhandler", "doifcommandhandlerelse", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "globalsetmode", "globalresetmode", "globalsetsystemmode", "globalresetsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newfloat", "newlanguage", "newfamily", "newfam", "newhelp", "newinteger", "newdimension", "newgluespec", "newmugluespec", "newposit", "aliasinteger", "aliasdimension", "aliasposit", "then", "begcsname", "autorule", "strippedcsname", "checkedstrippedcsname", "nofarguments", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthargumenttrue", "sixthargumentfalse", "sixthargumenttrue", "seventhargumentfalse", "seventhargumenttrue", "vkern", "hkern", "vpenalty", "hpenalty", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall", "donetrue", "donefalse", "foundtrue", "foundfalse", "inlineordisplaymath", "indisplaymath", "forcedisplaymath", "startforceddisplaymath", "stopforceddisplaymath", "startpickupmath", "stoppickupmath", "reqno", "forceinlinemath", "mathortext", "thebox", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "hsplit", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilll", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "normalhfilllneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilll", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "normalvfilllneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruleddbox", "ruledvcenter", "ruledmbox", "ruledhpack", "ruledvpack", "ruledtpack", "ruleddpack", "ruledvsplit", "ruledtsplit", "ruleddsplit", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk", "scratchstring", "scratchstringone", "scratchstringtwo", "tempstring", "scratchcounter", "globalscratchcounter", "privatescratchcounter", "scratchdimen", "globalscratchdimen", "privatescratchdimen", "scratchskip", "globalscratchskip", "privatescratchskip", "scratchmuskip", "globalscratchmuskip", "privatescratchmuskip", "scratchtoks", "globalscratchtoks", "privatescratchtoks", "scratchbox", "globalscratchbox", "privatescratchbox", "scratchmacro", "scratchmacroone", "scratchmacrotwo", "scratchconditiontrue", "scratchconditionfalse", "ifscratchcondition", "scratchconditiononetrue", "scratchconditiononefalse", "ifscratchconditionone", "scratchconditiontwotrue", "scratchconditiontwofalse", "ifscratchconditiontwo", "globalscratchcounterone", "globalscratchcountertwo", "globalscratchcounterthree", "groupedcommand", "groupedcommandcs", "triggergroupedcommand", "triggergroupedcommandcs", "simplegroupedcommand", "simplegroupedcommandcs", "pickupgroupedcommand", "pickupgroupedcommandcs", "mathgroupedcommandcs", "usedbaselineskip", "usedlineskip", "usedlineskiplimit", "availablehsize", "localhsize", "setlocalhsize", "distributedhsize", "hsizefraction", "next", "nexttoken", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "flushnextbox", "boxisempty", "boxtostring", "contentostring", "prerolltostring", "givenwidth", "givenheight", "givendepth", "scangivendimensions", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal", "scratchitalic", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchcounterfour", "scratchcounterfive", "scratchcountersix", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchdimenfour", "scratchdimenfive", "scratchdimensix", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchskipfour", "scratchskipfive", "scratchskipsix", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchmuskipfour", "scratchmuskipfive", "scratchmuskipsix", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchtoksfour", "scratchtoksfive", "scratchtokssix", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchboxfour", "scratchboxfive", "scratchboxsix", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchunicode", "scratchmin", "scratchmax", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "firstinset", "doifinset", "doifnotinset", "doifelseinset", "doifinsetelse", "doifelsenextchar", "doifnextcharelse", "doifelsenextcharcs", "doifnextcharcselse", "doifelsenextoptional", "doifnextoptionalelse", "doifelsenextoptionalcs", "doifnextoptionalcselse", "doifelsefastoptionalcheck", "doiffastoptionalcheckelse", "doifelsefastoptionalcheckcs", "doiffastoptionalcheckcselse", "doifelsenextbgroup", "doifnextbgroupelse", "doifelsenextbgroupcs", "doifnextbgroupcselse", "doifelsenextparenthesis", "doifnextparenthesiselse", "doifelseundefined", "doifundefinedelse", "doifelsedefined", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifnothingelse", "doifelsesomething", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifvaluenothingelse", "doifelsedimension", "doifdimensionelse", "doifelsenumber", "doifnumberelse", "doifnumber", "doifnotnumber", "doifelsecommon", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifelseinstring", "doifinstringelse", "doifelseassignment", "doifassignmentelse", "docheckassignment", "doifelseassignmentcs", "doifassignmentelsecs", "validassignment", "novalidassignment", "doiftext", "doifelsetext", "doiftextelse", "doifnottext", "quitcondition", "truecondition", "falsecondition", "tracingall", "tracingnone", "loggingall", "tracingcatcodes", "showluatokens", "aliasmacro", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "emspace", "charspace", "nbsp", "crlf", "obeyspaces", "obeylines", "obeytabs", "obeypages", "obeyedspace", "obeyedline", "obeyedtab", "obeyedpage", "normalspace", "naturalspace", "controlspace", "normalspaces", "ignoretabs", "ignorelines", "ignorepages", "ignoreeofs", "setcontrolspaces", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "removepunctuation", "ignoreparskip", "forcestrutdepth", "onlynonbreakablespace", "wait", "writestatus", "define", "defineexpandable", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "directmeasure", "setquantity", "setequantity", "setgquantity", "setxquantity", "definequantity", "freezequantity", "quantity", "quantitied", "directquantity", "installcorenamespace", "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "setexpandeddummyparameter", "resetdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "firstoftwounexpanded", "secondoftwounexpanded", "firstofthreeunexpanded", "secondofthreeunexpanded", "thirdofthreeunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "fastloopindex", "fastloopfinal", "dowith", "doloopovermatch", "doloopovermatched", "doloopoverlist", "newconstant", "setnewconstant", "setconstant", "setconstantvalue", "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "setconditional", "newmacro", "setnewmacro", "newfraction", "newsignal", "newboundary", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "permitspacesbetweengroups", "dontpermitspacesbetweengroups", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "onlypdfobjectcompression", "nopdfobjectcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doifelsefirstchar", "doiffirstcharelse", "mathclassvalue", "startnointerference", "stopnointerference", "twodigits", "threedigits", "leftorright", "offinterlineskip", "oninterlineskip", "nointerlineskip", "strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight", "leftboundary", "rightboundary", "signalcharacter", "aligncontentleft", "aligncontentmiddle", "aligncontentright", "shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox", "normalreqno", "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", "normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript", "normalprimescript", "superscript", "subscript", "nosuperscript", "nosubscript", "primescript", "superprescript", "subprescript", "nosuperprescript", "nosubsprecript", "uncramped", "cramped", "mathstyletrigger", "triggermathstyle", "triggeredmathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", "pushmathstyle", "popmathstyle", "triggerdisplaystyle", "triggertextstyle", "triggerscriptstyle", "triggerscriptscriptstyle", "triggeruncrampedstyle", "triggercrampedstyle", "triggersmallstyle", "triggeruncrampedsmallstyle", "triggercrampedsmallstyle", "triggerbigstyle", "triggeruncrampedbigstyle", "triggercrampedbigstyle", "luaexpr", "expelsedoif", "expdoif", "expdoifnot", "expdoifelsecommon", "expdoifcommonelse", "expdoifelseinset", "expdoifinsetelse", "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", "startctxfunction", "stopctxfunction", "ctxfunction", "startctxfunctiondefinition", "stopctxfunctiondefinition", "installctxfunction", "installprotectedctxfunction", "installprotectedctxscanner", "installctxscanner", "resetctxscanner", "cldprocessfile", "cldloadfile", "cldloadviafile", "cldcontext", "cldcommand", "carryoverpar", "freezeparagraphproperties", "defrostparagraphproperties", "setparagraphfreezing", "forgetparagraphfreezing", "updateparagraphproperties", "updateparagraphpenalties", "updateparagraphdemerits", "updateparagraphshapes", "updateparagraphlines", "lastlinewidth", "assumelongusagecs", "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", "autodirhbox", "autodirvbox", "autodirvtop", "leftorrighthbox", "leftorrightvbox", "leftorrightvtop", "lefttoright", "righttoleft", "checkedlefttoright", "checkedrighttoleft", "synchronizelayoutdirection", "synchronizedisplaydirection", "synchronizeinlinedirection", "dirlre", "dirrle", "dirlro", "dirrlo", "rtltext", "ltrtext", "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "dohyphencollapsing", "nohyphencollapsing", "compounddiscretionary", "Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath", "break", "nobreak", "allowbreak", "goodbreak", "nospace", "nospacing", "dospacing", "naturalhbox", "naturalvbox", "naturalvtop", "naturalhpack", "naturalvpack", "naturaltpack", "reversehbox", "reversevbox", "reversevtop", "reversehpack", "reversevpack", "reversetpack", "hcontainer", "vcontainer", "tcontainer", "frule", "compoundhyphenpenalty", "start", "stop", "unsupportedcs", "openout", "closeout", "write", "openin", "closein", "read", "readline", "readfromterminal", "boxlines", "boxline", "setboxline", "copyboxline", "boxlinewd", "boxlineht", "boxlinedp", "boxlinenw", "boxlinenh", "boxlinend", "boxlinels", "boxliners", "boxlinelh", "boxlinerh", "boxlinelp", "boxlinerp", "boxlinein", "boxrangewd", "boxrangeht", "boxrangedp", "bitwiseset", "bitwiseand", "bitwiseor", "bitwisexor", "bitwisenot", "bitwisenil", "ifbitwiseand", "bitwise", "bitwiseshift", "bitwiseflip", "textdir", "linedir", "pardir", "boxdir", "prelistbox", "postlistbox", "prelistcopy", "postlistcopy", "setprelistbox", "setpostlistbox", "noligaturing", "nokerning", "noexpansion", "noprotrusion", "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing", "noitaliccorrection", "futureletnexttoken", "defbackslashbreak", "letbackslashbreak", "pushoverloadmode", "popoverloadmode", "pushrunstate", "poprunstate", "suggestedalias", "showboxhere", "discoptioncodestring", "flagcodestring", "frozenparcodestring", "glyphoptioncodestring", "groupcodestring", "hyphenationcodestring", "mathcontrolcodestring", "mathflattencodestring", "normalizecodestring", "parcontextcodestring", "newlocalcount", "newlocaldimen", "newlocalskip", "newlocalmuskip", "newlocaltoks", "newlocalbox", "newlocalwrite", "newlocalread", "setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox", "ifexpression" }, + ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen", "plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone", "maxiterator", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip", "centeringfillskip", "stretchingfillskip", "shrinkingfillskip", "centeringfilllskip", "stretchingfilllskip", "shrinkingfilllskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty", "thickermuskip", "continuationmuskip", "fencemuskip", "mathinterwordmuskip", "zerofloat", "directionlefttoright", "directionrighttoleft", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "prerollrun", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "texenginefunctionality", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "contextformat", "contextversion", "contextlmtxmode", "contextmark", "mksuffix", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "statuswrite", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "rlncatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "commaasciicode", "spaceasciicode", "periodasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "semicolonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "leftparentasciicode", "rightparentasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode", "zeroasciicode", "nineasciicode", "alowercaseasciicode", "zlowercaseasciicode", "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode", "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode", "loosenessfrozenparcode", "lastlinefrozenparcode", "linepenaltyfrozenparcode", "clubpenaltyfrozenparcode", "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode", "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode", "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode", "emergencyfrozenparcode", "parpassesfrozenparcode", "singlelinepenaltyfrozenparcode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode", "mathchoicegroupcode", "alsosimplegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode", "alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode", "markautomigrationcode", "insertautomigrationcode", "adjustautomigrationcode", "preautomigrationcode", "postautomigrationcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "overrulemathcontrolcode", "underrulemathcontrolcode", "radicalrulemathcontrolcode", "fractionrulemathcontrolcode", "accentskewhalfmathcontrolcode", "accentskewapplymathcontrolcode", "applyordinarykernpairmathcontrolcode", "applyverticalitalickernmathcontrolcode", "applyordinaryitalickernmathcontrolcode", "applycharitalickernmathcontrolcode", "reboxcharitalickernmathcontrolcode", "applyboxeditalickernmathcontrolcode", "staircasekernmathcontrolcode", "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode", "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode", "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode", "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", "extendaccentsmathcontrolcode", "extenddelimitersmathcontrolcode", "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode", "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode", "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode", "normalparbegincode", "forceparbegincode", "indentparbegincode", "noindentparbegincode", "mathcharparbegincode", "charparbegincode", "boundaryparbegincode", "spaceparbegincode", "mathparbegincode", "kernparbegincode", "hskipparbegincode", "unhboxparbegincode", "valignparbegincode", "vruleparbegincode", "fixedsuperorsubscriptsmodecode", "fixedsuperandsubscriptsmodecode", "ignoreemptyscriptsmodecode", "ignoreemptysuperscriptsmodecode", "ignoreemptysubscriptsmodecode", "ignoreemptyprimescriptsmodecode", "inheritclassdoublescriptmodecode", "discardshapekerndoublescriptmodecode", "realignscriptsdoublescriptmodecode", "reorderprescriptsdoublescriptmodecode", "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode", "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode", "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode", "halfwaytotallistanchorcode", "halfwayheightlistanchorcode", "halfwaydepthlistanchorcode", "halfwayleftlistanchorcode", "halfwayrightlistanchorcode", "negatexlistsigncode", "negateylistsigncode", "negatelistsigncode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "mathexheight", "mathemwidth", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathaxisheight", "muquad", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifelsemode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startlocalcomponent", "stoplocalcomponent", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument", "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "everystoptext", "everyforgetall", "luaenvironment", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "definemode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode", "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode", "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode", "mathfractioncode", "mathmiddlecode", "mathprimecode", "mathaccentcode", "mathfencedcode", "mathghostcode", "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode", "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode", "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", "mathcontinuationcode", "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathintegralcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode", "mathchemicalbondcode", "mathimplicationcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "lrm", "rlm", "bidilre", "bidirle", "bidipop", "bidilro", "bidirlo", "breakablethinspace", "nobreakspace", "nonbreakablespace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "enquad", "emquad", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace", "Ux", "eUx", "startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode", "wildcardsymbol", "normalhyphenationcode", "automatichyphenationcode", "explicithyphenationcode", "syllablehyphenationcode", "uppercasehyphenationcode", "collapsehyphenationcode", "compoundhyphenationcode", "strictstarthyphenationcode", "strictendhyphenationcode", "automaticpenaltyhyphenationcode", "explicitpenaltyhyphenationcode", "permitgluehyphenationcode", "permitallhyphenationcode", "permitmathreplacehyphenationcode", "forcecheckhyphenationcode", "lazyligatureshyphenationcode", "forcehandlerhyphenationcode", "feedbackcompoundhyphenationcode", "ignoreboundshyphenationcode", "partialhyphenationcode", "completehyphenationcode", "normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode", "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode", "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", "limitprevgrafnormalizeparcode", "nopreslackclassoptioncode", "nopostslackclassoptioncode", "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", "lookaheadforendclassoptioncode", "noitaliccorrectionclassoptioncode", "defaultmathclassoptions", "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode", "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode", "operatoritaliccorrectionclassoptioncode", "shortinlineclassoptioncode", "pushnestingclassoptioncode", "popnestingclassoptioncode", "obeynestingclassoptioncode", "noitaliccorrectionglyphoptioncode", "nozeroitaliccorrectionglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noleftkernglyphoptioncode", "norightkernglyphoptioncode", "noleftligatureglyphoptioncode", "norightligatureglyphoptioncode", "textcheckitalicglyphoptioncode", "mathcheckitalicglyphoptioncode", "nokerningcode", "noligaturingcode", "noitalicscode", "indecentparpassclasses", "looseparpassclasses", "tightparpassclasses", "verylooseparpassclass", "looseparpassclass", "semilooseparpassclass", "decentparpassclass", "almostdecentparpassclasses", "semitightparpassclass", "tightparpassclass", "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode", "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode", "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode", "preferbreakdiscoptioncode", "prefernobreakdiscoptioncode", "noitaliccorrectiondiscoptioncode", "nozeroitaliccorrectiondiscoptioncode", "textcheckitalicdiscoptioncode", "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode", "uunit" }, + ["helpers"]={ "pushglobalsetups", "popglobalsetups", "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "startcontextdefinitioncode", "stopcontextdefinitioncode", "texdefinition", "doifelsesetups", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "fastsetup", "copysetups", "resetsetups", "doifelsecommandhandler", "doifcommandhandlerelse", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "globalsetmode", "globalresetmode", "globalsetsystemmode", "globalresetsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newfloat", "newlanguage", "newfamily", "newfam", "newhelp", "newuserunit", "newinteger", "newdimension", "newgluespec", "newmugluespec", "newposit", "aliasinteger", "aliasdimension", "aliasposit", "then", "begcsname", "autorule", "tobit", "tobits", "tohexa", "strippedcsname", "checkedstrippedcsname", "nofarguments", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthargumenttrue", "sixthargumentfalse", "sixthargumenttrue", "seventhargumentfalse", "seventhargumenttrue", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall", "donetrue", "donefalse", "foundtrue", "foundfalse", "globaldonetrue", "globaldonefalse", "globalfoundtrue", "globalfoundfalse", "inlineordisplaymath", "indisplaymath", "forcedisplaymath", "startforceddisplaymath", "stopforceddisplaymath", "startpickupmath", "stoppickupmath", "reqno", "forceinlinemath", "mathortext", "thebox", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "hsplit", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilll", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "normalhfilllneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilll", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "normalvfilllneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruleddbox", "ruledvcenter", "ruledmbox", "ruledhpack", "ruledvpack", "ruledtpack", "ruleddpack", "ruledvsplit", "ruledtsplit", "ruleddsplit", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk", "scratchstring", "scratchstringone", "scratchstringtwo", "tempstring", "scratchcounter", "globalscratchcounter", "privatescratchcounter", "scratchfloat", "globalscratchfloat", "privatescratchfloat", "scratchdimen", "globalscratchdimen", "privatescratchdimen", "scratchskip", "globalscratchskip", "privatescratchskip", "scratchmuskip", "globalscratchmuskip", "privatescratchmuskip", "scratchtoks", "globalscratchtoks", "privatescratchtoks", "scratchbox", "globalscratchbox", "privatescratchbox", "scratchmacro", "scratchmacroone", "scratchmacrotwo", "scratchconditiontrue", "scratchconditionfalse", "ifscratchcondition", "scratchconditiononetrue", "scratchconditiononefalse", "ifscratchconditionone", "scratchconditiontwotrue", "scratchconditiontwofalse", "ifscratchconditiontwo", "globalscratchcounterone", "globalscratchcountertwo", "globalscratchcounterthree", "groupedcommand", "groupedcommandcs", "triggergroupedcommand", "triggergroupedcommandcs", "simplegroupedcommand", "simplegroupedcommandcs", "pickupgroupedcommand", "pickupgroupedcommandcs", "mathgroupedcommandcs", "usedbaselineskip", "usedlineskip", "usedlineskiplimit", "availablehsize", "localhsize", "setlocalhsize", "distributedhsize", "hsizefraction", "next", "nexttoken", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "flushnextbox", "boxisempty", "boxtostring", "contentostring", "prerolltostring", "givenwidth", "givenheight", "givendepth", "scangivendimensions", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal", "scratchitalic", "scratchhsize", "scratchvsize", "scratchclass", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchcounterfour", "scratchcounterfive", "scratchcountersix", "scratchfloatone", "scratchfloattwo", "scratchfloatthree", "scratchfloatfour", "scratchfloatfive", "scratchfloatsix", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchdimenfour", "scratchdimenfive", "scratchdimensix", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchskipfour", "scratchskipfive", "scratchskipsix", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchmuskipfour", "scratchmuskipfive", "scratchmuskipsix", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchtoksfour", "scratchtoksfive", "scratchtokssix", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchboxfour", "scratchboxfive", "scratchboxsix", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchunicode", "scratchunicodeone", "scratchunicodetwo", "scratchunicodethree", "scratchmin", "scratchmax", "scratchread", "scratchwrite", "pfsin", "pfcos", "pftan", "pfasin", "pfacos", "pfatan", "pfsinh", "pfcosh", "pftanh", "pfasinh", "pfacosh", "pfatanh", "pfsqrt", "pflog", "pfexp", "pfceil", "pffloor", "pfround", "pfabs", "pfrad", "pfdeg", "pfatantwo", "pfpow", "pfmod", "pfrem", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "firstinset", "doifinset", "doifnotinset", "doifelseinset", "doifinsetelse", "doifelsenextchar", "doifnextcharelse", "doifelsenextcharcs", "doifnextcharcselse", "doifelsenextoptional", "doifnextoptionalelse", "doifelsenextoptionalcs", "doifnextoptionalcselse", "doifelsefastoptionalcheck", "doiffastoptionalcheckelse", "doifelsefastoptionalcheckcs", "doiffastoptionalcheckcselse", "doifelsenextbgroup", "doifnextbgroupelse", "doifelsenextbgroupcs", "doifnextbgroupcselse", "doifelsenextparenthesis", "doifnextparenthesiselse", "doifelseundefined", "doifundefinedelse", "doifelsedefined", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifnothingelse", "doifelsesomething", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifvaluenothingelse", "doifelsedimension", "doifdimensionelse", "doifelsenumber", "doifnumberelse", "doifnumber", "doifnotnumber", "doifelsecommon", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifelseinstring", "doifinstringelse", "doifelseassignment", "doifassignmentelse", "docheckassignment", "doifelseassignmentcs", "doifassignmentelsecs", "validassignment", "novalidassignment", "doiftext", "doifelsetext", "doiftextelse", "doifnottext", "validtext", "quitcondition", "truecondition", "falsecondition", "tracingall", "tracingnone", "loggingall", "tracingcatcodes", "showluatokens", "aliasmacro", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "emspace", "charspace", "nbsp", "crlf", "obeyspaces", "obeylines", "obeytabs", "obeypages", "obeyedspace", "obeyedline", "obeyedtab", "obeyedpage", "normalspace", "naturalspace", "controlspace", "normalspaces", "ignoretabs", "ignorelines", "ignorepages", "ignoreeofs", "setcontrolspaces", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "removepunctuation", "ignoreparskip", "forcestrutdepth", "onlynonbreakablespace", "wait", "writestatus", "writeline", "define", "defineexpandable", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "directmeasure", "setquantity", "setequantity", "setgquantity", "setxquantity", "definequantity", "freezequantity", "quantity", "quantitied", "directquantity", "installcorenamespace", "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "setexpandeddummyparameter", "resetdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "firstoftwounexpanded", "secondoftwounexpanded", "firstofthreeunexpanded", "secondofthreeunexpanded", "thirdofthreeunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "fastloopindex", "fastloopfinal", "dowith", "doloopovermatch", "doloopovermatched", "doloopoverlist", "newconstant", "setnewconstant", "setconstant", "setconstantvalue", "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "setconditional", "newmacro", "setnewmacro", "newfraction", "newsignal", "newboundary", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "permitspacesbetweengroups", "dontpermitspacesbetweengroups", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "onlypdfobjectcompression", "nopdfobjectcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doifelsefirstchar", "doiffirstcharelse", "mathclassvalue", "startnointerference", "stopnointerference", "twodigits", "threedigits", "leftorright", "offinterlineskip", "oninterlineskip", "nointerlineskip", "strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight", "leftboundary", "rightboundary", "signalcharacter", "ascender", "descender", "capheight", "aligncontentleft", "aligncontentmiddle", "aligncontentright", "shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox", "normalreqno", "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", "uncramped", "cramped", "mathstyletrigger", "triggermathstyle", "triggeredmathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", "pushmathstyle", "popmathstyle", "triggerdisplaystyle", "triggertextstyle", "triggerscriptstyle", "triggerscriptscriptstyle", "triggeruncrampedstyle", "triggercrampedstyle", "triggersmallstyle", "triggeruncrampedsmallstyle", "triggercrampedsmallstyle", "triggerbigstyle", "triggeruncrampedbigstyle", "triggercrampedbigstyle", "luaexpr", "expelsedoif", "expdoif", "expdoifnot", "expdoifelsecommon", "expdoifcommonelse", "expdoifelseinset", "expdoifinsetelse", "glyphscaled", "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch", "ctxluamatchfile", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", "startctxfunction", "stopctxfunction", "ctxfunction", "startctxfunctiondefinition", "stopctxfunctiondefinition", "installctxfunction", "installprotectedctxfunction", "installprotectedctxscanner", "installctxscanner", "resetctxscanner", "cldprocessfile", "cldloadfile", "cldloadviafile", "cldcontext", "cldcommand", "carryoverpar", "freezeparagraphproperties", "defrostparagraphproperties", "setparagraphfreezing", "forgetparagraphfreezing", "updateparagraphproperties", "updateparagraphpenalties", "updateparagraphdemerits", "updateparagraphshapes", "updateparagraphlines", "updateparagraphpasses", "lastlinewidth", "assumelongusagecs", "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", "autodirhbox", "autodirvbox", "autodirvtop", "leftorrighthbox", "leftorrightvbox", "leftorrightvtop", "lefttoright", "righttoleft", "checkedlefttoright", "checkedrighttoleft", "synchronizelayoutdirection", "synchronizedisplaydirection", "synchronizeinlinedirection", "dirlre", "dirrle", "dirlro", "dirrlo", "rtltext", "ltrtext", "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "dohyphencollapsing", "nohyphencollapsing", "compounddiscretionary", "Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath", "break", "nobreak", "allowbreak", "goodbreak", "nospace", "nospacing", "dospacing", "naturalhbox", "naturalvbox", "naturalvtop", "naturalhpack", "naturalvpack", "naturaltpack", "reversehbox", "reversevbox", "reversevtop", "reversehpack", "reversevpack", "reversetpack", "hcontainer", "vcontainer", "tcontainer", "frule", "compoundhyphenpenalty", "start", "stop", "unsupportedcs", "openout", "closeout", "write", "openin", "closein", "read", "readline", "readlinedirect", "readfromterminal", "boxlines", "boxline", "setboxline", "copyboxline", "boxlinewd", "boxlineht", "boxlinedp", "boxlinenw", "boxlinenh", "boxlinend", "boxlinels", "boxliners", "boxlinelh", "boxlinerh", "boxlinelp", "boxlinerp", "boxlinein", "boxrangewd", "boxrangeht", "boxrangedp", "bitwiseset", "bitwiseand", "bitwiseor", "bitwisexor", "bitwisenot", "bitwisenil", "ifbitwiseand", "bitwise", "bitwiseshift", "bitwiseflip", "textdir", "linedir", "pardir", "boxdir", "prelistbox", "postlistbox", "prelistcopy", "postlistcopy", "setprelistbox", "setpostlistbox", "noligaturing", "nokerning", "noexpansion", "noprotrusion", "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing", "noitaliccorrection", "futureletnexttoken", "defbackslashbreak", "letbackslashbreak", "pushoverloadmode", "popoverloadmode", "pushrunstate", "poprunstate", "suggestedalias", "showboxhere", "discoptioncodestring", "flagcodestring", "frozenparcodestring", "glyphoptioncodestring", "groupcodestring", "hyphenationcodestring", "mathcontrolcodestring", "mathflattencodestring", "normalizecodestring", "parcontextcodestring", "newlocalcount", "newlocaldimen", "newlocalskip", "newlocalmuskip", "newlocaltoks", "newlocalbox", "newlocalwrite", "newlocalread", "setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox", "ifexpression", "localcontrolledrepeating", "expandedrepeating", "unexpandedrepeating", "lastchkinteger", "ifchkinteger", "mathordinary", "mathoperator", "mathbinary", "mathrelation", "mathpunctuation", "mathfraction", "mathradical", "mathmiddle", "mathaccent", "mathfenced", "mathghost", "mathvariable", "mathactive", "mathvcenter", "mathimaginary", "mathdifferential", "mathexponential", "mathdigit", "mathdivision", "mathfactorial", "mathwrapped", "mathconstruct", "mathdimension", "mathunary", "mathchemicalbond", "mathimplication", "filebasename", "filenameonly", "filedirname", "filesuffix", "setmathoption", "resetmathoption", "Ustack", "Umathdict", "Umathclass", "Ustyle", "Uchar", "Usuperscript", "Usubscript", "Unosuperscript", "Unosubscript", "Uprimescript", "Usuperprescript", "Usubprescript", "Unosuperprescript", "Unosubprescript", "ignorefile", "boxwidth", "boxheight", "boxdepth" }, } \ No newline at end of file diff --git a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-interfaces.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-interfaces.lua index e914f917644..ca68c655c89 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-interfaces.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-interfaces.lua @@ -1,4 +1,4 @@ return { - ["common"]={ "AEacute", "AEligature", "AEmacron", "AMSTEX", "Aacute", "Abreve", "Abreveacute", "Abrevedotbelow", "Abrevegrave", "Abrevehook", "Abrevetilde", "Acaron", "Acircumflex", "Acircumflexacute", "Acircumflexdotbelow", "Acircumflexgrave", "Acircumflexhook", "Acircumflextilde", "Adiaeresis", "Adiaeresismacron", "Adotaccent", "Adotaccentmacron", "Adotbelow", "Adoublegrave", "AfterPar", "Agrave", "Ahook", "Ainvertedbreve", "Alpha", "Alphabeticnumerals", "AmSTeX", "Amacron", "And", "Angstrom", "Aogonek", "Aring", "Aringacute", "Arrowvert", "Astroke", "Atilde", "BeforePar", "Beta", "Bhook", "Big", "Bigg", "Biggl", "Biggm", "Biggr", "Bigl", "Bigm", "Bigr", "Box", "Bumpeq", "CONTEXT", "Cacute", "Cap", "Caps", "Ccaron", "Ccedilla", "Ccircumflex", "Cdotaccent", "Character", "Characters", "Chi", "Chook", "ConTeXt", "Context", "ConvertConstantAfter", "ConvertToConstant", "Cstroke", "Cup", "DAYLONG", "DAYSHORT", "DZcaronligature", "DZligature", "Dafrican", "Dcaron", "Dd", "Ddownarrow", "Delta", "Dhook", "Doteq", "Downarrow", "Dstroke", "Dzcaronligature", "Dzligature", "ETEX", "Eacute", "Ebreve", "Ecaron", "Ecedilla", "Ecircumflex", "Ecircumflexacute", "Ecircumflexdotbelow", "Ecircumflexgrave", "Ecircumflexhook", "Ecircumflextilde", "Ediaeresis", "Edotaccent", "Edotbelow", "Edoublegrave", "Egrave", "Ehook", "Einvertedbreve", "Emacron", "Eogonek", "Epsilon", "Eta", "Eth", "Etilde", "Eulerconst", "EveryLine", "EveryPar", "Fhook", "Finv", "Gacute", "Game", "Gamma", "Gbreve", "Gcaron", "Gcircumflex", "Gcommaaccent", "Gdotaccent", "GetPar", "Ghook", "GotoPar", "Greeknumerals", "Gstroke", "Hcaron", "Hcircumflex", "Hstroke", "IJligature", "INRSTEX", "Iacute", "Ibreve", "Icaron", "Icircumflex", "Idiaeresis", "Idotaccent", "Idotbelow", "Idoublegrave", "Igrave", "Ihook", "Iinvertedbreve", "Im", "Imacron", "Iogonek", "Iota", "Istroke", "Itilde", "Jcircumflex", "Join", "Kappa", "Kcaron", "Kcommaaccent", "Khook", "LAMSTEX", "LATEX", "LJligature", "LUAJITTEX", "LUAMETATEX", "LUATEX", "LaTeX", "Lacute", "LamSTeX", "Lambda", "Lbar", "Lcaron", "Lcommaaccent", "Ldotmiddle", "Ldsh", "Leftarrow", "Leftrightarrow", "Ljligature", "Lleftarrow", "Longleftarrow", "Longleftrightarrow", "Longmapsfrom", "Longmapsto", "Longrightarrow", "Lsh", "Lstroke", "Lua", "LuaMetaTeX", "LuaTeX", "LuajitTeX", "METAFONT", "METAFUN", "METAPOST", "MKII", "MKIV", "MKIX", "MKLX", "MKVI", "MKXI", "MKXL", "MONTH", "MONTHLONG", "MONTHSHORT", "MPII", "MPIV", "MPLX", "MPVI", "MPXL", "MPanchor", "MPbetex", "MPc", "MPcode", "MPcolor", "MPcoloronly", "MPcolumn", "MPd", "MPdrawing", "MPfontsizehskip", "MPgetmultipars", "MPgetmultishape", "MPgetposboxes", "MPh", "MPinclusions", "MPleftskip", "MPll", "MPlr", "MPls", "MPmenubuttons", "MPn", "MPoptions", "MPoverlayanchor", "MPp", "MPpage", "MPpardata", "MPplus", "MPpos", "MPpositiongraphic", "MPposset", "MPr", "MPrawvar", "MPregion", "MPrest", "MPrightskip", "MPrs", "MPstring", "MPtext", "MPtransparency", "MPul", "MPur", "MPv", "MPvar", "MPvariable", "MPvv", "MPw", "MPwhd", "MPx", "MPxy", "MPxywhd", "MPy", "Mapsfrom", "Mapsto", "MetaFont", "MetaFun", "MetaPost", "Mu", "NJligature", "Nacute", "Ncaron", "Ncommaaccent", "Nearrow", "Neng", "Ngrave", "Njligature", "NormalizeFontHeight", "NormalizeFontWidth", "NormalizeTextHeight", "NormalizeTextWidth", "Ntilde", "Nu", "Numbers", "Nwarrow", "OEligature", "Oacute", "Obreve", "Ocaron", "Ocircumflex", "Ocircumflexacute", "Ocircumflexdotbelow", "Ocircumflexgrave", "Ocircumflexhook", "Ocircumflextilde", "Odiaeresis", "Odiaeresismacron", "Odotaccent", "Odotaccentmacron", "Odotbelow", "Odoublegrave", "Ograve", "Ohook", "Ohorn", "Ohornacute", "Ohorndotbelow", "Ohorngrave", "Ohornhook", "Ohorntilde", "Ohungarumlaut", "Oinvertedbreve", "Omacron", "Omega", "Omicron", "Oogonek", "Oogonekmacron", "Ostroke", "Ostrokeacute", "Otilde", "Otildemacron", "P", "PDFETEX", "PDFTEX", "PDFcolor", "PICTEX", "PPCHTEX", "PPCHTeX", "PRAGMA", "Phi", "Phook", "Pi", "PiCTeX", "Plankconst", "PointsToBigPoints", "PointsToReal", "PointsToWholeBigPoints", "PropertyLine", "Psi", "PtToCm", "Racute", "Rcaron", "Rcommaaccent", "Rdoublegrave", "Rdsh", "Re", "ReadFile", "Relbar", "Rho", "Rightarrow", "Rinvertedbreve", "Romannumerals", "Rrightarrow", "Rsh", "S", "Sacute", "ScaledPointsToBigPoints", "ScaledPointsToWholeBigPoints", "Scaron", "Scedilla", "Schwa", "Scircumflex", "Scommaaccent", "Searrow", "Sigma", "Smallcapped", "Subset", "Supset", "Swarrow", "TABLE", "TEX", "TaBlE", "Tau", "Tcaron", "Tcedilla", "Tcommaaccent", "TeX", "TheNormalizedFontSize", "Theta", "Thook", "Thorn", "TransparencyHack", "Tstroke", "Uacute", "Ubreve", "Ucaron", "Ucircumflex", "Udiaeresis", "Udiaeresisacute", "Udiaeresiscaron", "Udiaeresisgrave", "Udiaeresismacron", "Udotbelow", "Udoublegrave", "Ugrave", "Uhook", "Uhorn", "Uhornacute", "Uhorndotbelow", "Uhorngrave", "Uhornhook", "Uhorntilde", "Uhungarumlaut", "Uinvertedbreve", "Umacron", "Uogonek", "Uparrow", "Updownarrow", "Upsilon", "Uring", "Utilde", "Uuparrow", "VDash", "Vdash", "VerboseNumber", "Vert", "Vhook", "Vvdash", "WEEKDAY", "WORD", "WORDS", "Wcircumflex", "WidthSpanningText", "Word", "Words", "XETEX", "XeTeX", "Xi", "Yacute", "Ycircumflex", "Ydiaeresis", "Ydotbelow", "Ygrave", "Yhook", "Ymacron", "Ytilde", "Zacute", "Zcaron", "Zdotaccent", "Zeta", "Zhook", "Zstroke", "aacute", "abbreviation", "abjadnaivenumerals", "abjadnodotnumerals", "abjadnumerals", "about", "abreve", "abreveacute", "abrevedotbelow", "abrevegrave", "abrevehook", "abrevetilde", "acaron", "acircumflex", "acircumflexacute", "acircumflexdotbelow", "acircumflexgrave", "acircumflexhook", "acircumflextilde", "activatespacehandler", "actualday", "actualmonth", "actualyear", "actuarial", "acute", "acwopencirclearrow", "adaptcollector", "adaptfontfeature", "adaptlayout", "adaptpapersize", "addfeature", "addtoJSpreamble", "addtocommalist", "addvalue", "adiaeresis", "adiaeresismacron", "adotaccent", "adotaccentmacron", "adotbelow", "adoublegrave", "aeacute", "aeligature", "aemacron", "afghanicurrency", "aftersplitstring", "aftertestandsplitstring", "agrave", "ahook", "ainvertedbreve", "aleph", "alignbottom", "aligned", "alignedbox", "alignedline", "alignhere", "alignmentcharacter", "allinputpaths", "alpha", "alphabeticnumerals", "alwayscitation", "alwayscite", "amacron", "amalg", "ampersand", "anchor", "angle", "aogonek", "appendetoks", "appendgvalue", "appendtocommalist", "appendtoks", "appendtoksonce", "appendvalue", "apply", "applyalternativestyle", "applyfunction", "applyprocessor", "applytocharacters", "applytofirstcharacter", "applytosplitstringchar", "applytosplitstringcharspaced", "applytosplitstringline", "applytosplitstringlinespaced", "applytosplitstringword", "applytosplitstringwordspaced", "applytowords", "approx", "approxEq", "approxeq", "approxnEq", "arabicakbar", "arabicalayhe", "arabicallah", "arabicallallahou", "arabicasterisk", "arabicbasmalah", "arabiccomma", "arabiccuberoot", "arabicdateseparator", "arabicdecimals", "arabicdisputedendofayah", "arabicendofayah", "arabicexnumerals", "arabicfootnotemarker", "arabicfourthroot", "arabichighain", "arabichighalayheassallam", "arabichigheqala", "arabichighesala", "arabichighfootnotemarker", "arabichighjeem", "arabichighlamalef", "arabichighmadda", "arabichighmeemlong", "arabichighmeemshort", "arabichighnisf", "arabichighnoon", "arabichighnoonkasra", "arabichighqaf", "arabichighqif", "arabichighradiallahouanhu", "arabichighrahmatullahalayhe", "arabichighrubc", "arabichighsad", "arabichighsajda", "arabichighsakta", "arabichighsallallahou", "arabichighseen", "arabichighsmallsafha", "arabichightah", "arabichightakhallus", "arabichighthalatha", "arabichighwaqf", "arabichighyeh", "arabichighzain", "arabicjallajalalouhou", "arabiclettermark", "arabiclowmeemlong", "arabiclownoonkasra", "arabiclowseen", "arabicmisra", "arabicmuhammad", "arabicnumber", "arabicnumberabove", "arabicnumerals", "arabicparenleft", "arabicparenright", "arabicpercent", "arabicperiod", "arabicpermille", "arabicpertenthousand", "arabicpoeticverse", "arabicqala", "arabicquestion", "arabicrasoul", "arabicray", "arabicrialsign", "arabicsafha", "arabicsajdah", "arabicsalla", "arabicsamvat", "arabicsanah", "arabicsemicolon", "arabicshighthreedots", "arabicslcm", "arabicstartofrubc", "arabictripledot", "arabicvowelwaw", "arabicvowelyeh", "arabicwasallam", "arg", "aring", "aringacute", "asciimode", "asciistr", "aside", "assignalfadimension", "assigndimen", "assigndimension", "assignifempty", "assigntranslation", "assignvalue", "assignwidth", "assumelongusagecs", "ast", "astype", "asymp", "at", "atilde", "atleftmargin", "atpage", "atrightmargin", "attachment", "autocap", "autodirhbox", "autodirvbox", "autodirvtop", "autoinsertnextspace", "autointegral", "automathematics", "autoorientation", "autopagestaterealpage", "autopagestaterealpageorder", "autorule", "autosetups", "availablehsize", "averagecharwidth", "backepsilon", "background", "backgroundimage", "backgroundimagefill", "backgroundline", "backprime", "backsim", "backslash", "bar", "barleftarrow", "barleftarrowrightarrowbar", "barovernorthwestarrow", "barwedge", "basegrid", "baselinebottom", "baselineleftbox", "baselinemiddlebox", "baselinerightbox", "bbordermatrix", "bbox", "because", "beforesplitstring", "beforetestandsplitstring", "beta", "beth", "between", "bhook", "big", "bigbodyfont", "bigcap", "bigcirc", "bigcircle", "bigcup", "bigdiamond", "bigg", "bigger", "biggl", "biggm", "biggr", "bigl", "bigm", "bigodot", "bigoplus", "bigotimes", "bigr", "bigskip", "bigsqcap", "bigsqcup", "bigsquare", "bigstar", "bigtimes", "bigtriangledown", "bigtriangleup", "bigudot", "biguplus", "bigvee", "bigwedge", "binom", "bitmapimage", "blacklozenge", "blackrule", "blackrules", "blacksquare", "blacktriangle", "blacktriangledown", "blacktriangleleft", "blacktriangleright", "blank", "blap", "bleed", "bleedheight", "bleedwidth", "blockligatures", "blockquote", "blocksynctexfile", "blockuservariable", "bodyfontenvironmentlist", "bodyfontsize", "bold", "boldface", "bolditalic", "boldslanted", "bookmark", "booleanmodevalue", "bordermatrix", "bot", "bottombox", "bottomleftbox", "bottomrightbox", "bowtie", "boxcursor", "boxdot", "boxmarker", "boxminus", "boxofsize", "boxplus", "boxreference", "boxtimes", "bpos", "breakablethinspace", "breakhere", "breve", "bstroke", "btxabbreviatedjournal", "btxaddjournal", "btxalwayscitation", "btxauthorfield", "btxdetail", "btxdirect", "btxdoif", "btxdoifcombiinlistelse", "btxdoifelse", "btxdoifelsecombiinlist", "btxdoifelsesameasprevious", "btxdoifelsesameaspreviouschecked", "btxdoifelseuservariable", "btxdoifnot", "btxdoifsameaspreviouscheckedelse", "btxdoifsameaspreviouselse", "btxdoifuservariableelse", "btxexpandedjournal", "btxfield", "btxfieldname", "btxfieldtype", "btxfirstofrange", "btxflush", "btxflushauthor", "btxflushauthorinverted", "btxflushauthorinvertedshort", "btxflushauthorname", "btxflushauthornormal", "btxflushauthornormalshort", "btxflushsuffix", "btxfoundname", "btxfoundtype", "btxhiddencitation", "btxhybridcite", "btxlabellanguage", "btxlabeltext", "btxlistcitation", "btxloadjournalist", "btxoneorrange", "btxremapauthor", "btxsavejournalist", "btxsetup", "btxsingularorplural", "btxsingularplural", "btxtextcitation", "buildmathaccent", "buildtextaccent", "buildtextbottomcomma", "buildtextbottomdot", "buildtextcedilla", "buildtextgrave", "buildtextmacron", "buildtextognek", "bullet", "button", "cacute", "calligraphic", "camel", "cap", "capital", "carriagereturn", "catcodetablename", "cbox", "ccaron", "ccedilla", "ccircumflex", "ccurl", "cdot", "cdotaccent", "cdotp", "cdots", "centeraligned", "centerbox", "centerdot", "centeredbox", "centeredlastline", "centerednextbox", "centerline", "cfrac", "chapter", "character", "characters", "chardescription", "charwidthlanguage", "check", "checkcharacteralign", "checkedblank", "checkedchar", "checkedfiller", "checkedstrippedcsname", "checkinjector", "checkmark", "checknextindentation", "checknextinjector", "checkpage", "checkparameters", "checkpreviousinjector", "checksoundtrack", "checktwopassdata", "checkvariables", "chem", "chemical", "chemicalbottext", "chemicalmidtext", "chemicalsymbol", "chemicaltext", "chemicaltoptext", "chi", "chineseallnumerals", "chinesecapnumerals", "chinesenumerals", "chook", "circ", "circeq", "circlearrowleft", "circlearrowright", "circledR", "circledS", "circledast", "circledcirc", "circleddash", "circledequals", "circleonrightarrow", "citation", "cite", "clap", "classfont", "cldcommand", "cldcontext", "cldloadfile", "cldprocessfile", "cleftarrow", "clip", "clippedoverlayimage", "clonefield", "clubsuit", "collect", "collectedtext", "collectexpanded", "colon", "coloncolonequals", "colonequals", "color", "colorbar", "colorcomponents", "colored", "coloronly", "colorvalue", "column", "columnbreak", "columnsetspanwidth", "combinepages", "commalistelement", "commalistsentence", "commalistsize", "comment", "comparecolorgroup", "comparedimension", "comparedimensioneps", "comparepalet", "complement", "completebtxrendering", "completecontent", "completeindex", "completelist", "completelistofabbreviations", "completelistofchemicals", "completelistoffigures", "completelistofgraphics", "completelistofintermezzi", "completelistoflogos", "completelistofpublications", "completelistofsorts", "completelistofsynonyms", "completelistoftables", "completepagenumber", "completeregister", "complexes", "complexorsimple", "complexorsimpleempty", "component", "composedcollector", "composedlayer", "compounddiscretionary", "compresult", "cong", "constantdimen", "constantdimenargument", "constantemptyargument", "constantnumber", "constantnumberargument", "contentreference", "continuednumber", "continueifinputfile", "convertargument", "convertcommand", "convertedcounter", "converteddimen", "convertedsubcounter", "convertmonth", "convertnumber", "convertvalue", "convertvboxtohbox", "coprod", "copyboxfromcache", "copybtxlabeltext", "copyfield", "copyheadtext", "copylabeltext", "copymathlabeltext", "copyoperatortext", "copypages", "copyparameters", "copyposition", "copyprefixtext", "copyright", "copysetups", "copysuffixtext", "copytaglabeltext", "copyunittext", "correctwhitespace", "countersubs", "counttoken", "counttokens", "cramped", "crampedclap", "crampedllap", "crampedrlap", "crightarrow", "crightoverleftarrow", "crlf", "crlfplaceholder", "cstroke", "ctop", "ctxcommand", "ctxdirectcommand", "ctxdirectlua", "ctxfunction", "ctxlatecommand", "ctxlatelua", "ctxloadluafile", "ctxlua", "ctxluabuffer", "ctxluacode", "ctxreport", "ctxsprint", "cup", "curlyeqprec", "curlyeqsucc", "curlyvee", "curlywedge", "currentassignmentlistkey", "currentassignmentlistvalue", "currentbtxuservariable", "currentcommalistitem", "currentcomponent", "currentdate", "currentenvironment", "currentfeaturetest", "currentheadnumber", "currentinterface", "currentlanguage", "currentlistentrydestinationattribute", "currentlistentrylimitedtext", "currentlistentrynumber", "currentlistentrypagenumber", "currentlistentryreferenceattribute", "currentlistentrytitle", "currentlistentrytitlerendered", "currentlistsymbol", "currentmainlanguage", "currentmessagetext", "currentmoduleparameter", "currentoutputstream", "currentproduct", "currentproject", "currentregime", "currentregisterpageuserdata", "currentresponses", "currenttime", "currentvalue", "currentxtablecolumn", "currentxtablerow", "curvearrowleft", "curvearrowright", "cwopencirclearrow", "cyrillicA", "cyrillicAE", "cyrillicAbreve", "cyrillicAdiaeresis", "cyrillicB", "cyrillicBIGYUS", "cyrillicBIGYUSiotified", "cyrillicC", "cyrillicCH", "cyrillicCHEDC", "cyrillicCHEDCabkhasian", "cyrillicCHEabkhasian", "cyrillicCHEdiaeresis", "cyrillicCHEkhakassian", "cyrillicCHEvertstroke", "cyrillicD", "cyrillicDASIAPNEUMATA", "cyrillicDJE", "cyrillicDZE", "cyrillicDZEabkhasian", "cyrillicDZHE", "cyrillicE", "cyrillicELtail", "cyrillicEMtail", "cyrillicENDC", "cyrillicENGHE", "cyrillicENhook", "cyrillicENtail", "cyrillicEREV", "cyrillicERY", "cyrillicERtick", "cyrillicEbreve", "cyrillicEdiaeresis", "cyrillicEgrave", "cyrillicEiotified", "cyrillicF", "cyrillicFITA", "cyrillicG", "cyrillicGHEmidhook", "cyrillicGHEstroke", "cyrillicGHEupturn", "cyrillicGJE", "cyrillicH", "cyrillicHA", "cyrillicHADC", "cyrillicHRDSN", "cyrillicI", "cyrillicIE", "cyrillicII", "cyrillicISHRT", "cyrillicISHRTtail", "cyrillicIZHITSA", "cyrillicIZHITSAdoublegrave", "cyrillicIdiaeresis", "cyrillicIgrave", "cyrillicImacron", "cyrillicJE", "cyrillicK", "cyrillicKADC", "cyrillicKAbashkir", "cyrillicKAhook", "cyrillicKAstroke", "cyrillicKAvertstroke", "cyrillicKJE", "cyrillicKOPPA", "cyrillicKSI", "cyrillicL", "cyrillicLITTLEYUS", "cyrillicLITTLEYUSiotified", "cyrillicLJE", "cyrillicM", "cyrillicN", "cyrillicNJE", "cyrillicO", "cyrillicOMEGA", "cyrillicOMEGAround", "cyrillicOMEGAtitlo", "cyrillicOT", "cyrillicObarred", "cyrillicObarreddiaeresis", "cyrillicOdiaeresis", "cyrillicP", "cyrillicPALATALIZATION", "cyrillicPALOCHKA", "cyrillicPEmidhook", "cyrillicPSI", "cyrillicPSILIPNEUMATA", "cyrillicR", "cyrillicS", "cyrillicSCHWA", "cyrillicSCHWAdiaeresis", "cyrillicSDSC", "cyrillicSEMISOFT", "cyrillicSFTSN", "cyrillicSH", "cyrillicSHCH", "cyrillicSHHA", "cyrillicT", "cyrillicTEDC", "cyrillicTETSE", "cyrillicTITLO", "cyrillicTSHE", "cyrillicU", "cyrillicUK", "cyrillicUSHRT", "cyrillicUdiaeresis", "cyrillicUdoubleacute", "cyrillicUmacron", "cyrillicV", "cyrillicYA", "cyrillicYAT", "cyrillicYERUdiaeresis", "cyrillicYI", "cyrillicYO", "cyrillicYU", "cyrillicYstr", "cyrillicYstrstroke", "cyrillicZ", "cyrillicZDSC", "cyrillicZEdiaeresis", "cyrillicZH", "cyrillicZHEbreve", "cyrillicZHEdescender", "cyrillicZHEdiaeresis", "cyrillica", "cyrillicabreve", "cyrillicadiaeresis", "cyrillicae", "cyrillicb", "cyrillicbigyus", "cyrillicbigyusiotified", "cyrillicc", "cyrillicch", "cyrilliccheabkhasian", "cyrillicchedc", "cyrillicchedcabkhasian", "cyrillicchediaeresis", "cyrillicchekhakassian", "cyrillicchevertstroke", "cyrillicd", "cyrillicdje", "cyrillicdze", "cyrillicdzeabkhasian", "cyrillicdzhe", "cyrillice", "cyrillicebreve", "cyrillicediaeresis", "cyrillicegrave", "cyrilliceiotified", "cyrilliceltail", "cyrillicemtail", "cyrillicendc", "cyrillicenghe", "cyrillicenhook", "cyrillicentail", "cyrillicerev", "cyrillicertick", "cyrillicery", "cyrillicf", "cyrillicfita", "cyrillicg", "cyrillicghemidhook", "cyrillicghestroke", "cyrillicgheupturn", "cyrillicgje", "cyrillich", "cyrillicha", "cyrillichadc", "cyrillichrdsn", "cyrillici", "cyrillicidiaeresis", "cyrillicie", "cyrillicigrave", "cyrillicii", "cyrillicimacron", "cyrillicishrt", "cyrillicishrttail", "cyrillicizhitsa", "cyrillicizhitsadoublegrave", "cyrillicje", "cyrillick", "cyrillickabashkir", "cyrillickadc", "cyrillickahook", "cyrillickastroke", "cyrillickavertstroke", "cyrillickje", "cyrillickoppa", "cyrillicksi", "cyrillicl", "cyrilliclittleyus", "cyrilliclittleyusiotified", "cyrilliclje", "cyrillicm", "cyrillicn", "cyrillicnje", "cyrillico", "cyrillicobarred", "cyrillicobarreddiaeresis", "cyrillicodiaeresis", "cyrillicomega", "cyrillicomegaround", "cyrillicomegatitlo", "cyrillicot", "cyrillicp", "cyrillicpemidhook", "cyrillicpsi", "cyrillicr", "cyrillics", "cyrillicschwa", "cyrillicschwadiaeresis", "cyrillicsdsc", "cyrillicsemisoft", "cyrillicsftsn", "cyrillicsh", "cyrillicshch", "cyrillicshha", "cyrillict", "cyrillictedc", "cyrillictetse", "cyrillictshe", "cyrillicu", "cyrillicudiaeresis", "cyrillicudoubleacute", "cyrillicuk", "cyrillicumacron", "cyrillicushrt", "cyrillicv", "cyrillicya", "cyrillicyat", "cyrillicyerudiaeresis", "cyrillicyi", "cyrillicyo", "cyrillicystr", "cyrillicystrstroke", "cyrillicyu", "cyrillicz", "cyrilliczdsc", "cyrilliczediaeresis", "cyrilliczh", "cyrilliczhebreve", "cyrilliczhedescender", "cyrilliczhediaeresis", "d", "dag", "dagger", "daleth", "dasharrow", "dashedleftarrow", "dashedrightarrow", "dashv", "datasetvariable", "date", "daylong", "dayoftheweek", "dayshort", "dayspermonth", "dbinom", "dcaron", "dcurl", "dd", "ddag", "ddagger", "dddot", "ddot", "ddots", "decrement", "decrementcounter", "decrementedcounter", "decrementpagenumber", "decrementsubpagenumber", "decrementvalue", "defaultinterface", "defaultobjectpage", "defaultobjectreference", "defcatcodecommand", "defconvertedargument", "defconvertedcommand", "defconvertedvalue", "define", "defineMPinstance", "defineTABLEsetup", "defineaccent", "defineactivecharacter", "definealternativestyle", "defineanchor", "defineattachment", "defineattribute", "definebackground", "definebar", "defineblock", "definebodyfont", "definebodyfontenvironment", "definebodyfontswitch", "definebreakpoint", "definebreakpoints", "definebtx", "definebtxdataset", "definebtxregister", "definebtxrendering", "definebuffer", "definebutton", "definecapitals", "definecharacter", "definecharacterkerning", "definecharacterspacing", "definechemical", "definechemicals", "definechemicalsymbol", "definecollector", "definecolor", "definecolorgroup", "definecolumnbreak", "definecolumnset", "definecolumnsetarea", "definecolumnsetspan", "definecombination", "definecombinedlist", "definecommand", "definecomment", "definecomplexorsimple", "definecomplexorsimpleempty", "defineconversion", "defineconversionset", "definecounter", "definedataset", "definedate", "definedelimitedtext", "definedeq", "definedescription", "definedfont", "definedocument", "defineeffect", "defineenumeration", "defineexpandable", "defineexpansion", "defineexternalfigure", "definefacingfloat", "definefallbackfamily", "definefield", "definefieldbody", "definefieldbodyset", "definefieldcategory", "definefieldstack", "definefiguresymbol", "definefileconstant", "definefilefallback", "definefilesynonym", "definefiller", "definefirstline", "definefittingpage", "definefloat", "definefont", "definefontalternative", "definefontfallback", "definefontfamily", "definefontfamilypreset", "definefontfeature", "definefontfile", "definefontsize", "definefontsolution", "definefontstyle", "definefontsynonym", "defineformula", "defineformulaalternative", "defineformulaframed", "defineframed", "defineframedcontent", "defineframedtable", "defineframedtext", "definefrozenfont", "defineglobalcolor", "definegraphictypesynonym", "definegridsnapping", "definehbox", "definehead", "defineheadalternative", "definehelp", "definehigh", "definehighlight", "definehspace", "definehyphenationfeatures", "defineindentedtext", "defineindenting", "defineinitial", "defineinsertion", "defineinteraction", "defineinteractionbar", "defineinteractionmenu", "defineinterfaceconstant", "defineinterfaceelement", "defineinterfacevariable", "defineinterlinespace", "defineintermediatecolor", "defineitemgroup", "defineitems", "definelabel", "definelabelclass", "definelayer", "definelayerpreset", "definelayout", "definelinefiller", "definelinenote", "definelinenumbering", "definelines", "definelist", "definelistalternative", "definelistextra", "definelow", "definelowhigh", "definelowmidhigh", "definemakeup", "definemarginblock", "definemargindata", "definemarker", "definemarking", "definemathaccent", "definemathalignment", "definemathcases", "definemathcommand", "definemathdouble", "definemathdoubleextensible", "definemathematics", "definemathextensible", "definemathfence", "definemathfraction", "definemathframed", "definemathmatrix", "definemathornament", "definemathover", "definemathoverextensible", "definemathovertextextensible", "definemathradical", "definemathstackers", "definemathstyle", "definemathtriplet", "definemathunder", "definemathunderextensible", "definemathundertextextensible", "definemathunstacked", "definemeasure", "definemessageconstant", "definemixedcolumns", "definemode", "definemulticolumns", "definemultitonecolor", "definenamedcolor", "definenamespace", "definenarrower", "definenote", "defineorientation", "defineornament", "defineoutputroutine", "defineoutputroutinecommand", "defineoverlay", "definepage", "definepagebreak", "definepagechecker", "definepagecolumns", "definepageinjection", "definepageinjectionalternative", "definepageshift", "definepagestate", "definepairedbox", "definepalet", "definepapersize", "defineparagraph", "defineparagraphs", "defineparallel", "defineparbuilder", "defineperiodkerning", "defineplaceholder", "defineplacement", "definepositioning", "defineprefixset", "defineprocesscolor", "defineprocessor", "defineprofile", "defineprogram", "definepushbutton", "definepushsymbol", "definereference", "definereferenceformat", "defineregister", "definerenderingwindow", "defineresetset", "defineruby", "definescale", "definescript", "definesection", "definesectionblock", "definesectionlevels", "defineselector", "defineseparatorset", "defineshift", "definesidebar", "definesort", "definesorting", "definespotcolor", "definestartstop", "definestyle", "definestyleinstance", "definesubfield", "definesubformula", "definesymbol", "definesynonym", "definesynonyms", "definesystemattribute", "definesystemconstant", "definesystemvariable", "definetabletemplate", "definetabulate", "definetext", "definetextbackground", "definetextflow", "definetextnote", "definetokenlist", "definetooltip", "definetransparency", "definetwopasslist", "definetype", "definetypeface", "definetypescriptprefix", "definetypescriptsynonym", "definetypesetting", "definetyping", "defineunit", "defineuserdata", "defineuserdataalternative", "defineviewerlayer", "definevspace", "definevspacing", "definevspacingamount", "definextable", "defrostparagraphproperties", "delimited", "delimitedtext", "delta", "depthofstring", "depthonlybox", "depthspanningtext", "depthstrut", "determineheadnumber", "determinelistcharacteristics", "determinenoflines", "determineregistercharacteristics", "devanagarinumerals", "dfrac", "dhook", "diameter", "diamond", "diamondsuit", "differentialD", "differentiald", "digamma", "digits", "dimensiontocount", "directboxfromcache", "directcolor", "directcolored", "directconvertedcounter", "directcopyboxfromcache", "directdummyparameter", "directgetboxllx", "directgetboxlly", "directhighlight", "directlocalframed", "directluacode", "directparwrapper", "directselect", "directsetbar", "directsetup", "directsymbol", "directvspacing", "dis", "disabledirectives", "disableexperiments", "disablemode", "disableoutputstream", "disableparpositions", "disableregime", "disabletrackers", "displaymath", "displaymathematics", "displaymessage", "disposeluatable", "distributedhsize", "div", "dividedsize", "divideontimes", "divides", "doadaptleftskip", "doadaptrightskip", "doaddfeature", "doassign", "doassignempty", "doboundtext", "docheckassignment", "docheckedpair", "documentvariable", "dodoubleargument", "dodoubleargumentwithset", "dodoubleempty", "dodoubleemptywithset", "dodoublegroupempty", "doeassign", "doexpandedrecurse", "dofastloopcs", "dogetattribute", "dogetattributeid", "dogetcommacommandelement", "dogobbledoubleempty", "dogobblesingleempty", "dohyphens", "doif", "doifMPgraphicelse", "doifallcommon", "doifallcommonelse", "doifalldefinedelse", "doifallmodes", "doifallmodeselse", "doifassignmentelse", "doifassignmentelsecs", "doifblackelse", "doifbothsides", "doifbothsidesoverruled", "doifboxelse", "doifbufferelse", "doifcheckedpagestate", "doifcolor", "doifcolorelse", "doifcommandhandler", "doifcommandhandlerelse", "doifcommon", "doifcommonelse", "doifcontent", "doifconversiondefinedelse", "doifconversionnumberelse", "doifcounter", "doifcounterelse", "doifcurrentfonthasfeatureelse", "doifdefined", "doifdefinedcounter", "doifdefinedcounterelse", "doifdefinedelse", "doifdimensionelse", "doifdimenstringelse", "doifdocumentargument", "doifdocumentargumentelse", "doifdocumentfilename", "doifdocumentfilenameelse", "doifdocumentvariable", "doifdocumentvariableelse", "doifdrawingblackelse", "doifelse", "doifelseMPgraphic", "doifelseallcommon", "doifelsealldefined", "doifelseallmodes", "doifelseassignment", "doifelseassignmentcs", "doifelseblack", "doifelsebox", "doifelseboxincache", "doifelsebuffer", "doifelsecolor", "doifelsecommandhandler", "doifelsecommon", "doifelseconversiondefined", "doifelseconversionnumber", "doifelsecounter", "doifelsecurrentfonthasfeature", "doifelsecurrentsortingused", "doifelsecurrentsynonymshown", "doifelsecurrentsynonymused", "doifelsedefined", "doifelsedefinedcounter", "doifelsedimension", "doifelsedimenstring", "doifelsedocumentargument", "doifelsedocumentfilename", "doifelsedocumentvariable", "doifelsedrawingblack", "doifelseempty", "doifelseemptyvalue", "doifelseemptyvariable", "doifelseenv", "doifelsefastoptionalcheck", "doifelsefastoptionalcheckcs", "doifelsefieldbody", "doifelsefieldcategory", "doifelsefigure", "doifelsefile", "doifelsefiledefined", "doifelsefileexists", "doifelsefirstchar", "doifelseflagged", "doifelsefontchar", "doifelsefontfeature", "doifelsefontpresent", "doifelsefontsynonym", "doifelseframed", "doifelsehasspace", "doifelsehelp", "doifelseincsname", "doifelseindented", "doifelseinelement", "doifelseinputfile", "doifelseinsertion", "doifelseinset", "doifelseinstring", "doifelseinsymbolset", "doifelseintoks", "doifelseintwopassdata", "doifelseitalic", "doifelselanguage", "doifelselayerdata", "doifelselayoutdefined", "doifelselayoutsomeline", "doifelselayouttextline", "doifelseleapyear", "doifelselist", "doifelselocation", "doifelselocfile", "doifelsemainfloatbody", "doifelsemarkedcontent", "doifelsemarkedpage", "doifelsemarking", "doifelsemeaning", "doifelsemessage", "doifelsemode", "doifelsenextbgroup", "doifelsenextbgroupcs", "doifelsenextchar", "doifelsenextoptional", "doifelsenextoptionalcs", "doifelsenextparenthesis", "doifelsenonzeropositive", "doifelsenoteonsamepage", "doifelsenothing", "doifelsenumber", "doifelseobjectfound", "doifelseobjectreferencefound", "doifelseoddpage", "doifelseoddpagefloat", "doifelseoldercontext", "doifelseolderversion", "doifelseorientation", "doifelseoverlapping", "doifelseoverlay", "doifelseparallel", "doifelseparentfile", "doifelseparwrapper", "doifelsepath", "doifelsepathexists", "doifelsepatterns", "doifelseposition", "doifelsepositionaction", "doifelsepositiononpage", "doifelsepositionsonsamepage", "doifelsepositionsonthispage", "doifelsepositionsused", "doifelsereferencefound", "doifelserightpage", "doifelserightpagefloat", "doifelserighttoleftinbox", "doifelsesamelinereference", "doifelsesamestring", "doifelsesetups", "doifelsesomebackground", "doifelsesomespace", "doifelsesomething", "doifelsesometoks", "doifelsestringinstring", "doifelsestructurelisthasnumber", "doifelsestructurelisthaspage", "doifelsesymboldefined", "doifelsesymbolset", "doifelsetext", "doifelsetextflow", "doifelsetextflowcollector", "doifelsetopofpage", "doifelsetypingfile", "doifelseundefined", "doifelseurldefined", "doifelsevalue", "doifelsevaluenothing", "doifelsevariable", "doifempty", "doifemptyelse", "doifemptytoks", "doifemptyvalue", "doifemptyvalueelse", "doifemptyvariable", "doifemptyvariableelse", "doifenv", "doifenvelse", "doiffastoptionalcheckcselse", "doiffastoptionalcheckelse", "doiffieldbodyelse", "doiffieldcategoryelse", "doiffigureelse", "doiffile", "doiffiledefinedelse", "doiffileelse", "doiffileexistselse", "doiffirstcharelse", "doifflaggedelse", "doiffontcharelse", "doiffontfeatureelse", "doiffontpresentelse", "doiffontsynonymelse", "doifhasspaceelse", "doifhelpelse", "doifincsnameelse", "doifinelementelse", "doifinputfileelse", "doifinsertionelse", "doifinset", "doifinsetelse", "doifinstring", "doifinstringelse", "doifinsymbolset", "doifinsymbolsetelse", "doifintokselse", "doifintwopassdataelse", "doifitalicelse", "doiflanguageelse", "doiflayerdataelse", "doiflayoutdefinedelse", "doiflayoutsomelineelse", "doiflayouttextlineelse", "doifleapyearelse", "doiflistelse", "doiflocationelse", "doiflocfileelse", "doifmainfloatbodyelse", "doifmarkingelse", "doifmeaningelse", "doifmessageelse", "doifmode", "doifmodeelse", "doifnextbgroupcselse", "doifnextbgroupelse", "doifnextcharelse", "doifnextoptionalcselse", "doifnextoptionalelse", "doifnextparenthesiselse", "doifnonzeropositiveelse", "doifnot", "doifnotallcommon", "doifnotallmodes", "doifnotcommandhandler", "doifnotcommon", "doifnotcounter", "doifnotdocumentargument", "doifnotdocumentfilename", "doifnotdocumentvariable", "doifnotempty", "doifnotemptyvalue", "doifnotemptyvariable", "doifnotenv", "doifnoteonsamepageelse", "doifnotescollected", "doifnotfile", "doifnotflagged", "doifnothing", "doifnothingelse", "doifnotinset", "doifnotinsidesplitfloat", "doifnotinstring", "doifnotmode", "doifnotnumber", "doifnotsamestring", "doifnotsetups", "doifnotvalue", "doifnotvariable", "doifnumber", "doifnumberelse", "doifobjectfoundelse", "doifobjectreferencefoundelse", "doifoddpageelse", "doifoddpagefloatelse", "doifoldercontextelse", "doifolderversionelse", "doifoutervmode", "doifoverlappingelse", "doifoverlayelse", "doifparallelelse", "doifparentfileelse", "doifpathelse", "doifpathexistselse", "doifpatternselse", "doifposition", "doifpositionaction", "doifpositionactionelse", "doifpositionelse", "doifpositiononpageelse", "doifpositionsonsamepageelse", "doifpositionsonthispageelse", "doifpositionsusedelse", "doifreferencefoundelse", "doifrightpageelse", "doifrightpagefloatelse", "doifrighttoleftinboxelse", "doifsamelinereferenceelse", "doifsamestring", "doifsamestringelse", "doifsetups", "doifsetupselse", "doifsomebackground", "doifsomebackgroundelse", "doifsomespaceelse", "doifsomething", "doifsomethingelse", "doifsometoks", "doifsometokselse", "doifstringinstringelse", "doifstructurelisthasnumberelse", "doifstructurelisthaspageelse", "doifsymboldefinedelse", "doifsymbolsetelse", "doiftext", "doiftextelse", "doiftextflowcollectorelse", "doiftextflowelse", "doiftopofpageelse", "doiftypingfileelse", "doifundefined", "doifundefinedcounter", "doifundefinedelse", "doifunknownfontfeature", "doifurldefinedelse", "doifvalue", "doifvalueelse", "doifvaluenothing", "doifvaluenothingelse", "doifvaluesomething", "doifvariable", "doifvariableelse", "doindentation", "dollar", "doloop", "doloopoverlist", "donothing", "dontconvertfont", "dontleavehmode", "dontpermitspacesbetweengroups", "dopositionaction", "doprocesslocalsetups", "doquadrupleargument", "doquadrupleempty", "doquadruplegroupempty", "doquintupleargument", "doquintupleempty", "doquintuplegroupempty", "dorechecknextindentation", "dorecurse", "dorepeatwithcommand", "doreplacefeature", "doresetandafffeature", "doresetattribute", "dorotatebox", "dosetattribute", "dosetleftskipadaption", "dosetrightskipadaption", "dosetupcheckedinterlinespace", "doseventupleargument", "doseventupleempty", "dosingleargument", "dosingleempty", "dosinglegroupempty", "dosixtupleargument", "dosixtupleempty", "dosomebreak", "dostepwiserecurse", "dosubtractfeature", "dot", "doteq", "doteqdot", "dotfill", "dotfskip", "dotlessI", "dotlessJ", "dotlessi", "dotlessj", "dotlessjstroke", "dotminus", "dotoks", "dotplus", "dotripleargument", "dotripleargumentwithset", "dotripleempty", "dotripleemptywithset", "dotriplegroupempty", "dots", "dottedcircle", "dottedrightarrow", "doublebar", "doublebond", "doublebrace", "doublebracket", "doublecap", "doublecup", "doubleparent", "doubleprime", "doubleverticalbar", "dowith", "dowithnextbox", "dowithnextboxcontent", "dowithnextboxcontentcs", "dowithnextboxcs", "dowithpargument", "dowithrange", "dowithwargument", "downarrow", "downdasharrow", "downdownarrows", "downharpoonleft", "downharpoonright", "downuparrows", "downwhitearrow", "downzigzagarrow", "dpofstring", "dstroke", "dtail", "dummydigit", "dummyparameter", "dzcaronligature", "dzligature", "eTeX", "eacute", "ebreve", "ecaron", "ecedilla", "ecircumflex", "ecircumflexacute", "ecircumflexdotbelow", "ecircumflexgrave", "ecircumflexhook", "ecircumflextilde", "edefconvertedargument", "ediaeresis", "edotaccent", "edotbelow", "edoublegrave", "ee", "efcmaxheight", "efcmaxwidth", "efcminheight", "efcminwidth", "efcparameter", "effect", "egrave", "ehook", "einvertedbreve", "elapsedseconds", "elapsedsteptime", "elapsedtime", "eleftarrowfill", "eleftharpoondownfill", "eleftharpoonupfill", "eleftrightarrowfill", "ell", "em", "emacron", "emdash", "emphasisboldface", "emphasistypeface", "emptylines", "emptyset", "emquad", "emspace", "enableasciimode", "enabledirectives", "enableexperiments", "enablemode", "enableoutputstream", "enableparpositions", "enableregime", "enabletrackers", "endash", "endnote", "enquad", "enskip", "enspace", "env", "environment", "envvar", "eogonek", "eoverbarfill", "eoverbracefill", "eoverbracketfill", "eoverparentfill", "epos", "epsilon", "eq", "eqcirc", "eqeq", "eqeqeq", "eqgtr", "eqless", "eqsim", "eqslantgtr", "eqslantless", "equaldigits", "equalscolon", "equiv", "erightarrowfill", "erightharpoondownfill", "erightharpoonupfill", "eta", "eth", "ethiopic", "etilde", "etwoheadrightarrowfill", "eunderbarfill", "eunderbracefill", "eunderbracketfill", "eunderparentfill", "exclamdown", "executeifdefined", "exists", "exitloop", "exitloopnow", "expandcheckedcsname", "expanded", "expandeddoif", "expandeddoifelse", "expandeddoifnot", "expandfontsynonym", "expdoif", "expdoifcommonelse", "expdoifelse", "expdoifelsecommon", "expdoifelseinset", "expdoifinsetelse", "expdoifnot", "exponentiale", "externalfigure", "externalfigurecollectionmaxheight", "externalfigurecollectionmaxwidth", "externalfigurecollectionminheight", "externalfigurecollectionminwidth", "externalfigurecollectionparameter", "fakebox", "fallingdotseq", "fastdecrement", "fastincrement", "fastlocalframed", "fastloopfinal", "fastloopindex", "fastscale", "fastsetup", "fastsetupwithargument", "fastsetupwithargumentswapped", "fastswitchtobodyfont", "fastsxsy", "feature", "fence", "fenced", "fetchallmarkings", "fetchallmarks", "fetchmark", "fetchmarking", "fetchonemark", "fetchonemarking", "fetchruntinecommand", "fetchtwomarkings", "fetchtwomarks", "ffiligature", "ffligature", "fflligature", "fhook", "field", "fieldbody", "fieldstack", "fifthoffivearguments", "fifthofsixarguments", "figuredash", "figurefilename", "figurefilepath", "figurefiletype", "figurefullname", "figureheight", "figurenaturalheight", "figurenaturalwidth", "figurespace", "figuresymbol", "figurewidth", "filename", "filigature", "filledhboxb", "filledhboxc", "filledhboxg", "filledhboxk", "filledhboxm", "filledhboxr", "filledhboxy", "filler", "fillinline", "fillinrules", "fillintext", "fillupto", "filterfromnext", "filterfromvalue", "filterpages", "filterreference", "findtwopassdata", "finishregisterentry", "firstcharacter", "firstcounter", "firstcountervalue", "firstinlist", "firstoffivearguments", "firstoffourarguments", "firstofoneargument", "firstofoneunexpanded", "firstofsixarguments", "firstofthreearguments", "firstofthreeunexpanded", "firstoftwoarguments", "firstoftwounexpanded", "firstrealpage", "firstrealpagenumber", "firstsubcountervalue", "firstsubpage", "firstsubpagenumber", "firstuserpage", "firstuserpagenumber", "fitfield", "fitfieldframed", "fittopbaselinegrid", "fiveeighths", "fivesixths", "fixedspace", "fixedspaces", "flag", "flat", "flligature", "floatuserdataparameter", "flushbox", "flushboxregister", "flushcollector", "flushedrightlastline", "flushlayer", "flushlocalfloats", "flushnextbox", "flushnotes", "flushoutputstream", "flushshapebox", "flushtextflow", "flushtokens", "flushtoks", "fontalternative", "fontbody", "fontchar", "fontcharbyindex", "fontclass", "fontclassname", "fontface", "fontfeaturelist", "fontsize", "fontstyle", "footnote", "footnotetext", "forall", "forcecharacterstripping", "forcelocalfloats", "forgeteverypar", "forgetparagraphfreezing", "forgetparameters", "forgetparskip", "forgetparwrapper", "forgetragged", "formula", "formulanumber", "foundbox", "fourfifths", "fourperemspace", "fourthoffivearguments", "fourthoffourarguments", "fourthofsixarguments", "frac", "framed", "frameddimension", "framedparameter", "framedtext", "freezedimenmacro", "freezemeasure", "freezeparagraphproperties", "frenchspacing", "from", "fromlinenote", "frown", "frozenhbox", "frule", "gacute", "gamma", "gbreve", "gcaron", "gcircumflex", "gcommaaccent", "gdefconvertedargument", "gdefconvertedcommand", "gdotaccent", "ge", "geq", "geqq", "geqslant", "getMPdrawing", "getMPlayer", "getboxfromcache", "getboxllx", "getboxlly", "getbuffer", "getbufferdata", "getcommacommandsize", "getcommalistsize", "getdatavalue", "getdayoftheweek", "getdayspermonth", "getdefinedbuffer", "getdocumentargument", "getdocumentargumentdefault", "getdocumentfilename", "getdummyparameters", "getemptyparameters", "geteparameters", "getexpandedparameters", "getfiguredimensions", "getfirstcharacter", "getfirsttwopassdata", "getfromcommacommand", "getfromcommalist", "getfromluatable", "getfromtwopassdata", "getglyphdirect", "getglyphstyled", "getgparameters", "getinlineuserdata", "getlasttwopassdata", "getlocalfloat", "getlocalfloats", "getmarking", "getmessage", "getnamedglyphdirect", "getnamedglyphstyled", "getnamedtwopassdatalist", "getnaturaldimensions", "getnoflines", "getobject", "getobjectdimensions", "getpaletsize", "getparameters", "getparwrapper", "getprivatechar", "getprivateslot", "getrandomcount", "getrandomdimen", "getrandomfloat", "getrandomnumber", "getrandomseed", "getraweparameters", "getrawgparameters", "getrawnoflines", "getrawparameters", "getrawxparameters", "getreference", "getreferenceentry", "getroundednoflines", "gets", "getsubstring", "gettokenlist", "gettwopassdata", "gettwopassdatalist", "getuserdata", "getuvalue", "getvalue", "getvariable", "getvariabledefault", "getxparameters", "gg", "ggg", "gggtr", "gimel", "globaldisablemode", "globalenablemode", "globalletempty", "globalpopbox", "globalpopmacro", "globalpreventmode", "globalprocesscommalist", "globalpushbox", "globalpushmacro", "globalswapcounts", "globalswapdimens", "globalswapmacros", "globalundefine", "glyphfontfile", "gnapprox", "gneqq", "gnsim", "gobbledoubleempty", "gobbleeightarguments", "gobblefivearguments", "gobblefiveoptionals", "gobblefourarguments", "gobblefouroptionals", "gobbleninearguments", "gobbleoneargument", "gobbleoneoptional", "gobblesevenarguments", "gobblesingleempty", "gobblesixarguments", "gobblespacetokens", "gobbletenarguments", "gobblethreearguments", "gobblethreeoptionals", "gobbletwoarguments", "gobbletwooptionals", "gobbleuntil", "gobbleuntilrelax", "godown", "goto", "gotobox", "gotopage", "grabbufferdata", "grabbufferdatadirect", "grabuntil", "grave", "graycolor", "grayvalue", "greedysplitstring", "greekAlpha", "greekAlphadasia", "greekAlphadasiaperispomeni", "greekAlphadasiatonos", "greekAlphadasiavaria", "greekAlphaiotasub", "greekAlphaiotasubdasia", "greekAlphaiotasubdasiaperispomeni", "greekAlphaiotasubdasiatonos", "greekAlphaiotasubdasiavaria", "greekAlphaiotasubpsili", "greekAlphaiotasubpsiliperispomeni", "greekAlphaiotasubpsilitonos", "greekAlphaiotasubpsilivaria", "greekAlphamacron", "greekAlphapsili", "greekAlphapsiliperispomeni", "greekAlphapsilitonos", "greekAlphapsilivaria", "greekAlphatonos", "greekAlphavaria", "greekAlphavrachy", "greekBeta", "greekChi", "greekCoronis", "greekDelta", "greekEpsilon", "greekEpsilondasia", "greekEpsilondasiatonos", "greekEpsilondasiavaria", "greekEpsilonpsili", "greekEpsilonpsilitonos", "greekEpsilonpsilivaria", "greekEpsilontonos", "greekEpsilonvaria", "greekEta", "greekEtadasia", "greekEtadasiaperispomeni", "greekEtadasiatonos", "greekEtadasiavaria", "greekEtaiotasub", "greekEtaiotasubdasia", "greekEtaiotasubdasiaperispomeni", "greekEtaiotasubdasiatonos", "greekEtaiotasubdasiavaria", "greekEtaiotasubpsili", "greekEtaiotasubpsiliperispomeni", "greekEtaiotasubpsilitonos", "greekEtaiotasubpsilivaria", "greekEtapsili", "greekEtapsiliperispomeni", "greekEtapsilitonos", "greekEtapsilivaria", "greekEtatonos", "greekEtavaria", "greekGamma", "greekIota", "greekIotadasia", "greekIotadasiaperispomeni", "greekIotadasiatonos", "greekIotadasiavaria", "greekIotadialytika", "greekIotamacron", "greekIotapsili", "greekIotapsiliperispomeni", "greekIotapsilitonos", "greekIotapsilivaria", "greekIotatonos", "greekIotavaria", "greekIotavrachy", "greekKappa", "greekLambda", "greekMu", "greekNu", "greekOmega", "greekOmegadasia", "greekOmegadasiaperispomeni", "greekOmegadasiatonos", "greekOmegadasiavaria", "greekOmegaiotasub", "greekOmegaiotasubdasia", "greekOmegaiotasubdasiaperispomeni", "greekOmegaiotasubdasiatonos", "greekOmegaiotasubdasiavaria", "greekOmegaiotasubpsili", "greekOmegaiotasubpsiliperispomeni", "greekOmegaiotasubpsilitonos", "greekOmegaiotasubpsilivaria", "greekOmegapsili", "greekOmegapsiliperispomeni", "greekOmegapsilitonos", "greekOmegapsilivaria", "greekOmegatonos", "greekOmegavaria", "greekOmicron", "greekOmicrondasia", "greekOmicrondasiatonos", "greekOmicrondasiavaria", "greekOmicronpsili", "greekOmicronpsilitonos", "greekOmicronpsilivaria", "greekOmicrontonos", "greekOmicronvaria", "greekPhi", "greekPi", "greekPsi", "greekRho", "greekRhodasia", "greekSigma", "greekSigmalunate", "greekTau", "greekTheta", "greekUpsilon", "greekUpsilondasia", "greekUpsilondasiaperispomeni", "greekUpsilondasiatonos", "greekUpsilondasiavaria", "greekUpsilondialytika", "greekUpsilonmacron", "greekUpsilontonos", "greekUpsilonvaria", "greekUpsilonvrachy", "greekXi", "greekZeta", "greekalpha", "greekalphadasia", "greekalphadasiaperispomeni", "greekalphadasiatonos", "greekalphadasiavaria", "greekalphaiotasub", "greekalphaiotasubdasia", "greekalphaiotasubdasiaperispomeni", "greekalphaiotasubdasiatonos", "greekalphaiotasubdasiavaria", "greekalphaiotasubperispomeni", "greekalphaiotasubpsili", "greekalphaiotasubpsiliperispomeni", "greekalphaiotasubpsilitonos", "greekalphaiotasubpsilivaria", "greekalphaiotasubtonos", "greekalphaiotasubvaria", "greekalphamacron", "greekalphaoxia", "greekalphaperispomeni", "greekalphapsili", "greekalphapsiliperispomeni", "greekalphapsilitonos", "greekalphapsilivaria", "greekalphatonos", "greekalphavaria", "greekalphavrachy", "greekbeta", "greekbetaalt", "greekchi", "greekdasia", "greekdasiaperispomeni", "greekdasiavaria", "greekdelta", "greekdialytikaperispomeni", "greekdialytikatonos", "greekdialytikavaria", "greekdigamma", "greekepsilon", "greekepsilonalt", "greekepsilondasia", "greekepsilondasiatonos", "greekepsilondasiavaria", "greekepsilonoxia", "greekepsilonpsili", "greekepsilonpsilitonos", "greekepsilonpsilivaria", "greekepsilontonos", "greekepsilonvaria", "greeketa", "greeketadasia", "greeketadasiaperispomeni", "greeketadasiatonos", "greeketadasiavaria", "greeketaiotasub", "greeketaiotasubdasia", "greeketaiotasubdasiaperispomeni", "greeketaiotasubdasiatonos", "greeketaiotasubdasiavaria", "greeketaiotasubperispomeni", "greeketaiotasubpsili", "greeketaiotasubpsiliperispomeni", "greeketaiotasubpsilitonos", "greeketaiotasubpsilivaria", "greeketaiotasubtonos", "greeketaiotasubvaria", "greeketaoxia", "greeketaperispomeni", "greeketapsili", "greeketapsiliperispomeni", "greeketapsilitonos", "greeketapsilivaria", "greeketatonos", "greeketavaria", "greekfinalsigma", "greekgamma", "greekiota", "greekiotadasia", "greekiotadasiaperispomeni", "greekiotadasiatonos", "greekiotadasiavaria", "greekiotadialytika", "greekiotadialytikaperispomeni", "greekiotadialytikatonos", "greekiotadialytikavaria", "greekiotamacron", "greekiotaoxia", "greekiotaperispomeni", "greekiotapsili", "greekiotapsiliperispomeni", "greekiotapsilitonos", "greekiotapsilivaria", "greekiotatonos", "greekiotavaria", "greekiotavrachy", "greekkappa", "greekkoppa", "greeklambda", "greekmu", "greeknu", "greeknumerals", "greeknumkoppa", "greekomega", "greekomegadasia", "greekomegadasiaperispomeni", "greekomegadasiatonos", "greekomegadasiavaria", "greekomegaiotasub", "greekomegaiotasubdasia", "greekomegaiotasubdasiaperispomeni", "greekomegaiotasubdasiatonos", "greekomegaiotasubdasiavaria", "greekomegaiotasubperispomeni", "greekomegaiotasubpsili", "greekomegaiotasubpsiliperispomeni", "greekomegaiotasubpsilitonos", "greekomegaiotasubpsilivaria", "greekomegaiotasubtonos", "greekomegaiotasubvaria", "greekomegaoxia", "greekomegaperispomeni", "greekomegapsili", "greekomegapsiliperispomeni", "greekomegapsilitonos", "greekomegapsilivaria", "greekomegatonos", "greekomegavaria", "greekomicron", "greekomicrondasia", "greekomicrondasiatonos", "greekomicrondasiavaria", "greekomicronoxia", "greekomicronpsili", "greekomicronpsilitonos", "greekomicronpsilivaria", "greekomicrontonos", "greekomicronvaria", "greekoxia", "greekperispomeni", "greekphi", "greekphialt", "greekpi", "greekpialt", "greekprosgegrammeni", "greekpsi", "greekpsili", "greekpsiliperispomeni", "greekpsilivaria", "greekrho", "greekrhoalt", "greekrhodasia", "greekrhopsili", "greeksampi", "greeksigma", "greeksigmalunate", "greekstigma", "greektau", "greektheta", "greekthetaalt", "greektonos", "greekupsilon", "greekupsilondasia", "greekupsilondasiaperispomeni", "greekupsilondasiatonos", "greekupsilondasiavaria", "greekupsilondiaeresis", "greekupsilondialytikaperispomeni", "greekupsilondialytikatonos", "greekupsilondialytikavaria", "greekupsilonmacron", "greekupsilonoxia", "greekupsilonperispomeni", "greekupsilonpsili", "greekupsilonpsiliperispomeni", "greekupsilonpsilitonos", "greekupsilonpsilivaria", "greekupsilontonos", "greekupsilonvaria", "greekupsilonvrachy", "greekvaria", "greekxi", "greekzeta", "grid", "groupedcommand", "gsetboxllx", "gsetboxlly", "gstroke", "gt", "gtrapprox", "gtrdot", "gtreqless", "gtreqqless", "gtrless", "gtrsim", "guilsingleleft", "guilsingleright", "gujaratinumerals", "gurmurkhinumerals", "hairline", "hairspace", "halflinestrut", "halfstrut", "halfwaybox", "handletokens", "handwritten", "hangul", "hanzi", "hash", "hat", "hbar", "hboxofvbox", "hboxreference", "hcaron", "hcircumflex", "hdofstring", "headhbox", "headlanguage", "headnumber", "headnumbercontent", "headnumberdistance", "headnumberwidth", "headreferenceattributes", "headsetupspacing", "headtext", "headtextcontent", "headtextdistance", "headtexts", "headtextwidth", "headvbox", "headwidth", "heartsuit", "hebrewAlef", "hebrewAyin", "hebrewBet", "hebrewDalet", "hebrewGimel", "hebrewHe", "hebrewHet", "hebrewKaf", "hebrewKaffinal", "hebrewLamed", "hebrewMem", "hebrewMemfinal", "hebrewNun", "hebrewNunfinal", "hebrewPe", "hebrewPefinal", "hebrewQof", "hebrewResh", "hebrewSamekh", "hebrewShin", "hebrewTav", "hebrewTet", "hebrewTsadi", "hebrewTsadifinal", "hebrewVav", "hebrewYod", "hebrewZayin", "hebrewnumerals", "heightanddepthofstring", "heightofstring", "heightspanningtext", "helptext", "hexnumber", "hexstringtonumber", "hglue", "hiddenbar", "hiddencitation", "hiddencite", "hideblocks", "high", "highlight", "highordinalstr", "hilo", "himilo", "hl", "hookleftarrow", "hookrightarrow", "horizontalgrowingbar", "horizontalpositionbar", "hpackbox", "hpackedbox", "hphantom", "hpos", "hsizefraction", "hslash", "hsmash", "hsmashbox", "hsmashed", "hspace", "hstroke", "htdpofstring", "htofstring", "hyphen", "hyphenatedcoloredword", "hyphenatedfile", "hyphenatedfilename", "hyphenatedhbox", "hyphenatedpar", "hyphenatedurl", "hyphenatedword", "iacute", "ibox", "ibreve", "icaron", "icircumflex", "ideographichalffillspace", "ideographicspace", "idiaeresis", "idotaccent", "idotbelow", "idoublegrave", "idxfromluatable", "ifassignment", "iff", "ifinobject", "ifinoutputstream", "ifparameters", "iftrialtypesetting", "ignoreimplicitspaces", "ignoretagsinexport", "ignorevalue", "igrave", "ihook", "ii", "iiiint", "iiiintop", "iiint", "iiintop", "iint", "iintop", "iinvertedbreve", "ijligature", "imacron", "imaginaryi", "imaginaryj", "imath", "immediatesavetwopassdata", "impliedby", "implies", "imply", "in", "includemenu", "includesvgbuffer", "includesvgfile", "includeversioninfo", "increment", "incrementcounter", "incrementedcounter", "incrementpagenumber", "incrementsubpagenumber", "incrementvalue", "indentation", "index", "infofont", "infofontbold", "inframed", "infty", "infull", "inheritparameter", "inhibitblank", "ininner", "ininneredge", "ininnermargin", "initializeboxstack", "inleft", "inleftedge", "inleftmargin", "inline", "inlinebuffer", "inlinedbox", "inlinemath", "inlinemathematics", "inlinemessage", "inlineordisplaymath", "inlineprettyprintbuffer", "inlinerange", "inmargin", "inmframed", "innerflushshapebox", "inother", "inouter", "inouteredge", "inoutermargin", "input", "inputfilebarename", "inputfilename", "inputfilerealsuffix", "inputfilesuffix", "inputgivenfile", "inright", "inrightedge", "inrightmargin", "insertpages", "inspectluatable", "installactionhandler", "installactivecharacter", "installanddefineactivecharacter", "installattributestack", "installautocommandhandler", "installautosetuphandler", "installbasicautosetuphandler", "installbasicparameterhandler", "installbottomframerenderer", "installcommandhandler", "installcorenamespace", "installctxfunction", "installctxscanner", "installdefinehandler", "installdefinitionset", "installdefinitionsetmember", "installdirectcommandhandler", "installdirectparameterhandler", "installdirectparametersethandler", "installdirectsetuphandler", "installdirectstyleandcolorhandler", "installframedautocommandhandler", "installframedcommandhandler", "installglobalmacrostack", "installlanguage", "installleftframerenderer", "installmacrostack", "installnamespace", "installoutputroutine", "installpagearrangement", "installparameterhandler", "installparameterhashhandler", "installparametersethandler", "installparentinjector", "installprotectedctxfunction", "installprotectedctxscanner", "installrightframerenderer", "installrootparameterhandler", "installsetuphandler", "installsetuponlycommandhandler", "installshipoutmethod", "installsimplecommandhandler", "installsimpleframedcommandhandler", "installstyleandcolorhandler", "installswitchcommandhandler", "installswitchsetuphandler", "installtexdirective", "installtextracker", "installtopframerenderer", "installunitsseparator", "installunitsspace", "installversioninfo", "int", "intclockwise", "integerrounding", "integers", "interactionbar", "interactionbuttons", "interactionmenu", "intercal", "intertext", "interwordspaceafter", "interwordspacebefore", "interwordspaces", "interwordspacesafter", "interwordspacesbefore", "intop", "invisiblecomma", "invisibleplus", "invisibletimes", "invokepagehandler", "iogonek", "iota", "italic", "italicbold", "italiccorrection", "italicface", "item", "items", "itemtag", "itilde", "jcaron", "jcircumflex", "ji", "jmath", "jobfilename", "jobfilesuffix", "kap", "kappa", "kcaron", "kcommaaccent", "keepblocks", "keeplinestogether", "keepunwantedspaces", "kerncharacters", "khook", "kkra", "koreancirclenumerals", "koreannumerals", "koreannumeralsc", "koreannumeralsp", "koreanparentnumerals", "lVert", "labellanguage", "labeltext", "labeltexts", "lacute", "lambda", "lambdabar", "land", "langle", "language", "languageCharacters", "languagecharacters", "languagecharwidth", "laplace", "lastcounter", "lastcountervalue", "lastdigit", "lastlinewidth", "lastnaturalboxdp", "lastnaturalboxht", "lastnaturalboxwd", "lastparwrapper", "lastpredefinedsymbol", "lastrealpage", "lastrealpagenumber", "lastsubcountervalue", "lastsubpage", "lastsubpagenumber", "lasttwodigits", "lastuserpage", "lastuserpagenumber", "lateluacode", "latin", "layeredtext", "layerheight", "layerwidth", "lazysavetaggedtwopassdata", "lazysavetwopassdata", "lbar", "lbox", "lbrace", "lbracket", "lcaron", "lceil", "lchexnumber", "lchexnumbers", "lcommaaccent", "lcurl", "ldot", "ldotmiddle", "ldotp", "ldots", "le", "leadsto", "left", "leftaligned", "leftarrow", "leftarrowtail", "leftarrowtriangle", "leftbottombox", "leftbox", "leftdasharrow", "leftguillemot", "leftharpoondown", "leftharpoonup", "lefthbox", "leftheadtext", "leftlabeltext", "leftleftarrows", "leftline", "leftmathlabeltext", "leftorrighthbox", "leftorrightvbox", "leftorrightvtop", "leftrightarrow", "leftrightarrows", "leftrightarrowtriangle", "leftrightharpoons", "leftrightsquigarrow", "leftskipadaption", "leftsquigarrow", "leftsubguillemot", "leftthreetimes", "lefttopbox", "lefttoright", "lefttorighthbox", "lefttorightvbox", "lefttorightvtop", "leftwavearrow", "leftwhitearrow", "leq", "leqq", "leqslant", "lessapprox", "lessdot", "lesseqgtr", "lesseqqgtr", "lessgtr", "lesssim", "letbeundefined", "letcatcodecommand", "letcscsname", "letcsnamecs", "letcsnamecsname", "letdummyparameter", "letempty", "letgvalue", "letgvalueempty", "letgvalurelax", "letterampersand", "letterat", "letterbackslash", "letterbar", "letterbgroup", "letterclosebrace", "lettercolon", "letterdollar", "letterdoublequote", "letteregroup", "letterescape", "letterexclamationmark", "letterhash", "letterhat", "letterleftbrace", "letterleftbracket", "letterleftparenthesis", "letterless", "lettermore", "letteropenbrace", "letterpercent", "letterquestionmark", "letterrightbrace", "letterrightbracket", "letterrightparenthesis", "lettersinglequote", "letterslash", "letterspacing", "lettertilde", "letterunderscore", "letvalue", "letvalueempty", "letvaluerelax", "lfence", "lfloor", "lgroup", "lhbox", "lhooknwarrow", "lhooksearrow", "limitatefirstline", "limitatelines", "limitatetext", "line", "linebox", "linefeed", "linefillerhbox", "linefillervbox", "linefillervtop", "linenote", "linespanningtext", "linethickness", "linterval", "listcitation", "listcite", "listlength", "listnamespaces", "literalmode", "ljligature", "ll", "llangle", "llap", "llbracket", "llcorner", "lll", "llless", "llointerval", "lmoustache", "lnapprox", "lneq", "lneqq", "lnot", "lnsim", "loadanyfile", "loadanyfileonce", "loadbtxdefinitionfile", "loadbtxreplacementfile", "loadcldfile", "loadcldfileonce", "loadfontgoodies", "loadluafile", "loadluafileonce", "loadspellchecklist", "loadtexfile", "loadtexfileonce", "loadtypescriptfile", "localframed", "localframedwithsettings", "localhsize", "localpopbox", "localpopmacro", "localpushbox", "localpushmacro", "localundefine", "locatedfilepath", "locatefilepath", "locfilename", "logo", "lohi", "lointerval", "lomihi", "longleftarrow", "longleftrightarrow", "longmapsfrom", "longmapsto", "longrightarrow", "longrightsquigarrow", "looparrowleft", "looparrowright", "lor", "low", "lowerbox", "lowercased", "lowercasestring", "lowercasing", "lowerleftdoubleninequote", "lowerleftsingleninequote", "lowerrightdoubleninequote", "lowerrightsingleninequote", "lozenge", "lparent", "lrcorner", "lrointerval", "lrtbbox", "lstroke", "lt", "ltimes", "ltop", "ltrhbox", "ltrvbox", "ltrvtop", "luaTeX", "luacode", "luaconditional", "luaenvironment", "luaexpanded", "luaexpr", "luafunction", "luajitTeX", "luamajorversion", "luametaTeX", "luaminorversion", "luaparameterset", "luasetup", "luaversion", "lvert", "m", "mLeftarrow", "mLeftrightarrow", "mRightarrow", "mVert", "mainlanguage", "makecharacteractive", "makerawcommalist", "makestrutofbox", "maltese", "mapfontsize", "mapsdown", "mapsfrom", "mapsto", "mapsup", "margindata", "margintext", "markcontent", "markedpages", "marking", "markinjector", "markpage", "markreferencepage", "mat", "math", "mathampersand", "mathbf", "mathbi", "mathblackboard", "mathbs", "mathdefault", "mathdollar", "mathdouble", "mathematics", "mathfraktur", "mathfunction", "mathhash", "mathhyphen", "mathit", "mathitalic", "mathlabellanguage", "mathlabeltext", "mathlabeltexts", "mathop", "mathover", "mathpercent", "mathrm", "mathscript", "mathsl", "mathss", "mathtext", "mathtextbf", "mathtextbi", "mathtextbs", "mathtextit", "mathtextsl", "mathtexttf", "mathtf", "mathtriplet", "mathtt", "mathunder", "mathupright", "mathword", "mathwordbf", "mathwordbi", "mathwordbs", "mathwordit", "mathwordsl", "mathwordtf", "maxaligned", "mbox", "mcframed", "measure", "measured", "measuredangle", "measuredeq", "medskip", "medspace", "menubutton", "mequal", "message", "mfence", "mframed", "mfunction", "mfunctionlabeltext", "mhbox", "mho", "mhookleftarrow", "mhookrightarrow", "mid", "midaligned", "middle", "middlealigned", "middlebox", "midhbox", "midsubsentence", "minimalhbox", "minus", "minuscolon", "mirror", "mixedcaps", "mkvibuffer", "mleftarrow", "mleftharpoondown", "mleftharpoonup", "mleftrightarrow", "mleftrightharpoons", "mmapsto", "models", "moduleparameter", "molecule", "mono", "monobold", "mononormal", "month", "monthlong", "monthshort", "mp", "mprandomnumber", "mrel", "mrightarrow", "mrightharpoondown", "mrightharpoonup", "mrightleftharpoons", "mrightoverleftarrow", "mtext", "mtriplerel", "mtwoheadleftarrow", "mtwoheadrightarrow", "mu", "multimap", "mvert", "nHdownarrow", "nHuparrow", "nLeftarrow", "nLeftrightarrow", "nRightarrow", "nVDash", "nVdash", "nVleftarrow", "nVleftrightarrow", "nVrightarrow", "nabla", "nacute", "namedheadnumber", "namedstructureheadlocation", "namedstructureuservariable", "namedstructurevariable", "namedtaggedlabeltexts", "napostrophe", "napprox", "napproxEq", "narrownobreakspace", "nasymp", "natural", "naturalhbox", "naturalhpack", "naturalnumbers", "naturaltpack", "naturalvbox", "naturalvcenter", "naturalvpack", "naturalvtop", "naturalwd", "ncaron", "ncommaaccent", "ncong", "ncurl", "ndivides", "ne", "nearrow", "neg", "negatecolorbox", "negated", "negativesign", "negemspace", "negenspace", "negthinspace", "neng", "neq", "nequiv", "neswarrow", "newattribute", "newcatcodetable", "newcounter", "newevery", "newfrenchspacing", "newluatable", "newmode", "newsignal", "newsystemmode", "nexists", "nextbox", "nextboxdp", "nextboxht", "nextboxhtdp", "nextboxwd", "nextcounter", "nextcountervalue", "nextdepth", "nextparagraphs", "nextrealpage", "nextrealpagenumber", "nextsubcountervalue", "nextsubpage", "nextsubpagenumber", "nextuserpage", "nextuserpagenumber", "ngeq", "ngrave", "ngtr", "ngtrless", "ngtrsim", "ni", "nihongo", "nin", "njligature", "nleftarrow", "nleftrightarrow", "nleq", "nless", "nlessgtr", "nlesssim", "nmid", "nni", "nobar", "nobreakspace", "nocap", "nocharacteralign", "nocitation", "nocite", "nodetostring", "noffigurepages", "noflines", "noflinesinbox", "noflocalfloats", "noheaderandfooterlines", "noheightstrut", "nohyphens", "noindentation", "noitem", "nonfrenchspacing", "nonmathematics", "nonvalidassignment", "normal", "normalboldface", "normalframedwithsettings", "normalitalicface", "normalizebodyfontsize", "normalizedfontsize", "normalizefontdepth", "normalizefontheight", "normalizefontline", "normalizefontwidth", "normalizetextdepth", "normalizetextheight", "normalizetextline", "normalizetextwidth", "normalslantedface", "normaltypeface", "nospace", "not", "note", "notesymbol", "notin", "notopandbottomlines", "notragged", "nowns", "nparallel", "nprec", "npreccurlyeq", "nrightarrow", "nsim", "nsimeq", "nsqsubseteq", "nsqsupseteq", "nsubset", "nsubseteq", "nsucc", "nsucccurlyeq", "nsupset", "nsupseteq", "ntilde", "ntimes", "ntriangleleft", "ntrianglelefteq", "ntriangleright", "ntrianglerighteq", "nu", "numberofpoints", "numbers", "nvDash", "nvdash", "nvleftarrow", "nvleftrightarrow", "nvrightarrow", "nwarrow", "nwsearrow", "oacute", "obeydepth", "objectdepth", "objectheight", "objectmargin", "objectwidth", "obox", "obreve", "ocaron", "ocircumflex", "ocircumflexacute", "ocircumflexdotbelow", "ocircumflexgrave", "ocircumflexhook", "ocircumflextilde", "octnumber", "octstringtonumber", "odiaeresis", "odiaeresismacron", "odot", "odotaccent", "odotaccentmacron", "odotbelow", "odoublegrave", "oeligature", "offset", "offsetbox", "ograve", "ohm", "ohook", "ohorn", "ohornacute", "ohorndotbelow", "ohorngrave", "ohornhook", "ohorntilde", "ohungarumlaut", "oiiint", "oiint", "oint", "ointclockwise", "ointctrclockwise", "oinvertedbreve", "omacron", "omega", "omicron", "ominus", "onedigitrounding", "oneeighth", "onefifth", "onehalf", "onequarter", "onesixth", "onesuperior", "onethird", "oogonek", "oogonekmacron", "operatorlanguage", "operatortext", "oplus", "ordfeminine", "ordinaldaynumber", "ordinalstr", "ordmasculine", "ornamenttext", "oslash", "ostroke", "ostrokeacute", "otilde", "otildemacron", "otimes", "outputfilename", "outputstreambox", "outputstreamcopy", "outputstreamunvbox", "outputstreamunvcopy", "over", "overbar", "overbars", "overbartext", "overbarunderbar", "overbrace", "overbracetext", "overbraceunderbrace", "overbracket", "overbrackettext", "overbracketunderbracket", "overlaybutton", "overlaycolor", "overlaydepth", "overlayfigure", "overlayheight", "overlayimage", "overlaylinecolor", "overlaylinewidth", "overlayoffset", "overlayrollbutton", "overlaywidth", "overleftarrow", "overleftharpoondown", "overleftharpoonup", "overleftrightarrow", "overloaderror", "overparent", "overparenttext", "overparentunderparent", "overrightarrow", "overrightharpoondown", "overrightharpoonup", "overset", "overstrike", "overstrikes", "overtwoheadleftarrow", "overtwoheadrightarrow", "owns", "page", "pagearea", "pagebreak", "pagefigure", "pageinjection", "pagenumber", "pagereference", "pagestaterealpage", "pagestaterealpageorder", "paletsize", "paragraphmark", "parallel", "part", "partial", "pdfTeX", "pdfactualtext", "pdfbackendactualtext", "pdfbackendcurrentresources", "pdfbackendsetcatalog", "pdfbackendsetcolorspace", "pdfbackendsetextgstate", "pdfbackendsetinfo", "pdfbackendsetname", "pdfbackendsetpageattribute", "pdfbackendsetpageresource", "pdfbackendsetpagesattribute", "pdfbackendsetpattern", "pdfbackendsetshade", "pdfcolor", "pdfeTeX", "percent", "percentdimen", "periodcentered", "periods", "permitcaretescape", "permitcircumflexescape", "permitspacesbetweengroups", "perp", "persiandecimals", "persiandecimalseparator", "persiannumerals", "persianthousandsseparator", "perthousand", "phantom", "phantombox", "phi", "phook", "pi", "pickupgroupedcommand", "pitchfork", "placeattachments", "placebookmarks", "placebtxrendering", "placechemical", "placecitation", "placecombinedlist", "placecomments", "placecontent", "placecurrentformulanumber", "placedbox", "placefigure", "placefloat", "placefloatcaption", "placefloatwithsetups", "placefootnotes", "placeformula", "placeframed", "placegraphic", "placeheadnumber", "placeheadtext", "placehelp", "placeholder", "placeindex", "placeinitial", "placeintermezzo", "placelayer", "placelayeredtext", "placelegend", "placelist", "placelistofabbreviations", "placelistofchemicals", "placelistoffigures", "placelistofgraphics", "placelistofintermezzi", "placelistoflogos", "placelistofpublications", "placelistofsorts", "placelistofsynonyms", "placelistoftables", "placelocalfootnotes", "placelocalnotes", "placement", "placenamedfloat", "placenamedformula", "placenotes", "placeongrid", "placeontopofeachother", "placepagenumber", "placepairedbox", "placeparallel", "placerawheaddata", "placerawheadnumber", "placerawheadtext", "placerawlist", "placeregister", "placerenderingwindow", "placesidebyside", "placesubformula", "placetable", "pm", "popattribute", "popmacro", "popmode", "popsystemmode", "position", "positionoverlay", "positionregionoverlay", "positivesign", "postponenotes", "prec", "precapprox", "preccurlyeq", "preceq", "preceqq", "precnapprox", "precneq", "precneqq", "precnsim", "precsim", "predefinedfont", "predefinefont", "predefinesymbol", "prefixedpagenumber", "prefixlanguage", "prefixtext", "prependetoks", "prependgvalue", "prependtocommalist", "prependtoks", "prependtoksonce", "prependvalue", "prerollblank", "presetbtxlabeltext", "presetdocument", "presetfieldsymbols", "presetheadtext", "presetlabeltext", "presetmathlabeltext", "presetoperatortext", "presetprefixtext", "presetsuffixtext", "presettaglabeltext", "presetunittext", "pretocommalist", "prettyprintbuffer", "prevcounter", "prevcountervalue", "preventmode", "prevrealpage", "prevrealpagenumber", "prevsubcountervalue", "prevsubpage", "prevsubpagenumber", "prevuserpage", "prevuserpagenumber", "prime", "primes", "procent", "processMPbuffer", "processMPfigurefile", "processaction", "processallactionsinset", "processassignlist", "processassignmentcommand", "processassignmentlist", "processbetween", "processblocks", "processbodyfontenvironmentlist", "processcolorcomponents", "processcommacommand", "processcommalist", "processcommalistwithparameters", "processcontent", "processfile", "processfilemany", "processfilenone", "processfileonce", "processfirstactioninset", "processisolatedchars", "processisolatedwords", "processlinetablebuffer", "processlinetablefile", "processlist", "processmonth", "processranges", "processseparatedlist", "processtexbuffer", "processtokens", "processuntil", "processxtablebuffer", "processyear", "prod", "product", "profiledbox", "profilegivenbox", "program", "project", "propto", "pseudoMixedCapped", "pseudoSmallCapped", "pseudoSmallcapped", "pseudosmallcapped", "psi", "punctuationspace", "purenumber", "pushattribute", "pushbutton", "pushmacro", "pushmode", "pushoutputstream", "pushsystemmode", "putboxincache", "putnextboxincache", "qquad", "quad", "quadrupleprime", "quads", "quarterstrut", "questiondown", "questionedeq", "quitcommalist", "quitprevcommalist", "quittypescriptscanning", "quotation", "quote", "quotedbl", "quotedblbase", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "quotesingle", "quotesinglebase", "rVert", "racute", "raggedbottom", "raggedcenter", "raggedleft", "raggedright", "raggedwidecenter", "raisebox", "randomizetext", "randomnumber", "rangle", "rationals", "rawcounter", "rawcountervalue", "rawdate", "rawdoifelseinset", "rawdoifinset", "rawdoifinsetelse", "rawgetparameters", "rawprocessaction", "rawprocesscommacommand", "rawprocesscommalist", "rawstructurelistuservariable", "rawsubcountervalue", "rbox", "rbrace", "rbracket", "rcaron", "rceil", "rcommaaccent", "rdoublegrave", "readfile", "readfixfile", "readjobfile", "readlocfile", "readsetfile", "readsysfile", "readtexfile", "readxmlfile", "realSmallCapped", "realSmallcapped", "realpagenumber", "reals", "realsmallcapped", "recursedepth", "recurselevel", "recursestring", "redoconvertfont", "ref", "reference", "referencecolumnnumber", "referencepagedetail", "referencepagestate", "referenceprefix", "referencerealpage", "referencesymbol", "referring", "registerattachment", "registerctxluafile", "registered", "registerexternalfigure", "registerfontclass", "registerhyphenationexception", "registerhyphenationpattern", "registermenubuttons", "registerparwrapper", "registerparwrapperreverse", "registersort", "registersynonym", "registerunit", "regular", "relatemarking", "relateparameterhandlers", "relaxvalueifundefined", "relbar", "remainingcharacters", "remark", "removebottomthings", "removedepth", "removefromcommalist", "removelastskip", "removelastspace", "removemarkedcontent", "removepunctuation", "removesubstring", "removetoks", "removeunwantedspaces", "repeathead", "replacefeature", "replaceincommalist", "replaceword", "rescan", "rescanwithsetup", "resetMPdrawing", "resetMPenvironment", "resetMPinstance", "resetallattributes", "resetandaddfeature", "resetbar", "resetboxesincache", "resetbreakpoints", "resetbuffer", "resetcharacteralign", "resetcharacterkerning", "resetcharacterspacing", "resetcharacterstripping", "resetcollector", "resetcounter", "resetctxscanner", "resetdigitsmanipulation", "resetdirection", "resetfeature", "resetflag", "resetfontcolorsheme", "resetfontfallback", "resetfontsolution", "resethyphenationfeatures", "resetinjector", "resetinteractionmenu", "resetitaliccorrection", "resetlayer", "resetlocalfloats", "resetmarker", "resetmarking", "resetmode", "resetpagenumber", "resetparallel", "resetpath", "resetpenalties", "resetperiodkerning", "resetprofile", "resetrecurselevel", "resetreference", "resetreplacements", "resetscript", "resetsetups", "resetshownsynonyms", "resetsubpagenumber", "resetsymbolset", "resetsystemmode", "resettimer", "resettokenlist", "resettrackers", "resettrialtypesetting", "resetusedsortings", "resetusedsynonyms", "resetuserpagenumber", "resetvalue", "resetvisualizers", "reshapebox", "resolvedglyphdirect", "resolvedglyphstyled", "restartcounter", "restorebox", "restorecatcodes", "restorecounter", "restorecurrentattributes", "restoreendofline", "restoreglobalbodyfont", "restriction", "retestfeature", "reusableMPgraphic", "reuseMPgraphic", "reuserandomseed", "reverseddoubleprime", "reversedprime", "reversedtripleprime", "reversehbox", "reversehpack", "reversetpack", "reversevbox", "reversevboxcontent", "reversevpack", "reversevtop", "revivefeature", "rfence", "rfloor", "rgroup", "rhbox", "rho", "rhooknearrow", "rhookswarrow", "right", "rightaligned", "rightangle", "rightarrow", "rightarrowbar", "rightarrowtail", "rightarrowtriangle", "rightbottombox", "rightbox", "rightdasharrow", "rightguillemot", "rightharpoondown", "rightharpoonup", "righthbox", "rightheadtext", "rightlabeltext", "rightleftarrows", "rightleftharpoons", "rightline", "rightmathlabeltext", "rightorleftpageaction", "rightpageorder", "rightrightarrows", "rightskipadaption", "rightsquigarrow", "rightsubguillemot", "rightthreearrows", "rightthreetimes", "righttoleft", "righttolefthbox", "righttoleftvbox", "righttoleftvtop", "righttopbox", "rightwavearrow", "rightwhitearrow", "ring", "rinterval", "rinvertedbreve", "risingdotseq", "rlap", "rlointerval", "rmoustache", "rneq", "robustaddtocommalist", "robustdoifelseinset", "robustdoifinsetelse", "robustpretocommalist", "rointerval", "rollbutton", "roman", "romanC", "romanD", "romanI", "romanII", "romanIII", "romanIV", "romanIX", "romanL", "romanM", "romanV", "romanVI", "romanVII", "romanVIII", "romanX", "romanXI", "romanXII", "romanc", "romand", "romani", "romanii", "romaniii", "romaniv", "romanix", "romanl", "romanm", "romannumerals", "romanv", "romanvi", "romanvii", "romanviii", "romanx", "romanxi", "romanxii", "rootradical", "rotate", "rparent", "rrangle", "rrbracket", "rrointerval", "rtimes", "rtlhbox", "rtlvbox", "rtlvtop", "rtop", "ruby", "ruledhbox", "ruledhpack", "ruledmbox", "ruledtopv", "ruledtpack", "ruledvbox", "ruledvpack", "ruledvtop", "runMPbuffer", "runninghbox", "russianNumerals", "russiannumerals", "rvert", "sacute", "safechar", "samplefile", "sans", "sansbold", "sansnormal", "sansserif", "savebox", "savebtxdataset", "savebuffer", "savecounter", "savecurrentattributes", "savenormalmeaning", "savetaggedtwopassdata", "savetwopassdata", "sbox", "scale", "scaron", "scedilla", "schwa", "schwahook", "scircumflex", "scommaaccent", "screen", "searrow", "secondoffivearguments", "secondoffourarguments", "secondofsixarguments", "secondofthreearguments", "secondofthreeunexpanded", "secondoftwoarguments", "secondoftwounexpanded", "section", "sectionmark", "seeindex", "select", "selectblocks", "serializecommalist", "serializedcommalist", "serif", "serifbold", "serifnormal", "setJSpreamble", "setMPlayer", "setMPpositiongraphic", "setMPpositiongraphicrange", "setMPtext", "setMPvariable", "setMPvariables", "setautopagestaterealpageno", "setbar", "setbigbodyfont", "setboxllx", "setboxlly", "setbreakpoints", "setcapstrut", "setcatcodetable", "setcharacteralign", "setcharacteraligndetail", "setcharactercasing", "setcharactercleaning", "setcharacterkerning", "setcharacterspacing", "setcharacterstripping", "setcharstrut", "setcollector", "setcolormodell", "setcounter", "setcounterown", "setctxluafunction", "setcurrentfontclass", "setdataset", "setdatavalue", "setdefaultpenalties", "setdigitsmanipulation", "setdirection", "setdocumentargument", "setdocumentargumentdefault", "setdocumentfilename", "setdummyparameter", "setelementexporttag", "setemeasure", "setevalue", "setevariable", "setevariables", "setexpansion", "setfirstline", "setfirstpasscharacteralign", "setflag", "setfont", "setfontcolorsheme", "setfontfeature", "setfontsolution", "setfontstrut", "setfractions", "setglobalscript", "setgmeasure", "setgvalue", "setgvariable", "setgvariables", "sethboxregister", "sethyphenatedurlafter", "sethyphenatedurlbefore", "sethyphenatedurlnormal", "sethyphenationfeatures", "setinitial", "setinjector", "setinteraction", "setinterfacecommand", "setinterfaceconstant", "setinterfaceelement", "setinterfacemessage", "setinterfacevariable", "setinternalrendering", "setitaliccorrection", "setlayer", "setlayerframed", "setlayertext", "setlinefiller", "setlocalhsize", "setlocalscript", "setluatable", "setmainbodyfont", "setmainparbuilder", "setmarker", "setmarking", "setmathstyle", "setmeasure", "setmessagetext", "setminus", "setmode", "setnostrut", "setnote", "setnotetext", "setobject", "setoldstyle", "setpagereference", "setpagestate", "setpagestaterealpageno", "setparagraphfreezing", "setpenalties", "setpercentdimen", "setperiodkerning", "setposition", "setpositionbox", "setpositiondata", "setpositiondataplus", "setpositiononly", "setpositionplus", "setpositionstrut", "setprofile", "setrandomseed", "setreference", "setreferencedobject", "setregisterentry", "setreplacements", "setrigidcolumnbalance", "setrigidcolumnhsize", "setscript", "setsecondpasscharacteralign", "setsectionblock", "setsimplecolumnshsize", "setsmallbodyfont", "setsmallcaps", "setstackbox", "setstructurepageregister", "setstrut", "setsuperiors", "setsystemmode", "settabular", "settaggedmetadata", "settestcrlf", "settextcontent", "settightobject", "settightreferencedobject", "settightstrut", "settightunreferencedobject", "settokenlist", "settrialtypesetting", "setuevalue", "setugvalue", "setunreferencedobject", "setup", "setupMPgraphics", "setupMPinstance", "setupMPpage", "setupMPvariables", "setupTABLE", "setupTEXpage", "setupalign", "setupalternativestyles", "setuparranging", "setupattachment", "setupattachments", "setupbackend", "setupbackground", "setupbackgrounds", "setupbar", "setupbars", "setupblackrules", "setupblank", "setupbleeding", "setupblock", "setupbodyfont", "setupbodyfontenvironment", "setupbookmark", "setupbottom", "setupbottomtexts", "setupbtx", "setupbtxdataset", "setupbtxlabeltext", "setupbtxlist", "setupbtxregister", "setupbtxrendering", "setupbuffer", "setupbutton", "setupcapitals", "setupcaption", "setupcaptions", "setupcharacteralign", "setupcharacterkerning", "setupcharacterspacing", "setupchemical", "setupchemicalframed", "setupclipping", "setupcollector", "setupcolor", "setupcolors", "setupcolumns", "setupcolumnset", "setupcolumnsetarea", "setupcolumnsetareatext", "setupcolumnsetlines", "setupcolumnsetspan", "setupcolumnsetstart", "setupcombination", "setupcombinedlist", "setupcomment", "setupcontent", "setupcounter", "setupdataset", "setupdelimitedtext", "setupdescription", "setupdescriptions", "setupdirections", "setupdocument", "setupeffect", "setupenumeration", "setupenumerations", "setupenv", "setupexpansion", "setupexport", "setupexternalfigure", "setupexternalfigures", "setupexternalsoundtracks", "setupfacingfloat", "setupfield", "setupfieldbody", "setupfieldcategory", "setupfieldcontentframed", "setupfieldlabelframed", "setupfields", "setupfieldtotalframed", "setupfiller", "setupfillinlines", "setupfillinrules", "setupfirstline", "setupfittingpage", "setupfloat", "setupfloatframed", "setupfloats", "setupfloatsplitting", "setupfontexpansion", "setupfontprotrusion", "setupfonts", "setupfontsolution", "setupfooter", "setupfootertexts", "setupfootnotes", "setupforms", "setupformula", "setupformulae", "setupformulaframed", "setupframed", "setupframedcontent", "setupframedtable", "setupframedtablecolumn", "setupframedtablerow", "setupframedtext", "setupframedtexts", "setupglobalreferenceprefix", "setuphead", "setupheadalternative", "setupheader", "setupheadertexts", "setupheadnumber", "setupheads", "setupheadtext", "setuphelp", "setuphigh", "setuphighlight", "setuphyphenation", "setuphyphenmark", "setupindentedtext", "setupindenting", "setupindex", "setupinitial", "setupinsertion", "setupinteraction", "setupinteractionbar", "setupinteractionmenu", "setupinteractionscreen", "setupinterlinespace", "setupitaliccorrection", "setupitemgroup", "setupitemizations", "setupitemize", "setupitems", "setuplabel", "setuplabeltext", "setuplanguage", "setuplayer", "setuplayeredtext", "setuplayout", "setuplayouttext", "setuplegend", "setuplinefiller", "setuplinefillers", "setuplinenote", "setuplinenumbering", "setuplines", "setuplinetable", "setuplinewidth", "setuplist", "setuplistalternative", "setuplistextra", "setuplocalfloats", "setuplocalinterlinespace", "setuplow", "setuplowhigh", "setuplowmidhigh", "setupmakeup", "setupmarginblock", "setupmargindata", "setupmarginframed", "setupmarginrule", "setupmarginrules", "setupmarking", "setupmathalignment", "setupmathcases", "setupmathematics", "setupmathfence", "setupmathfraction", "setupmathfractions", "setupmathframed", "setupmathlabeltext", "setupmathmatrix", "setupmathornament", "setupmathradical", "setupmathstackers", "setupmathstyle", "setupmixedcolumns", "setupmodule", "setupmulticolumns", "setupnarrower", "setupnotation", "setupnotations", "setupnote", "setupnotes", "setupoffset", "setupoffsetbox", "setupoperatortext", "setupoppositeplacing", "setuporientation", "setupoutput", "setupoutputroutine", "setuppagechecker", "setuppagecolumns", "setuppagecomment", "setuppageinjection", "setuppageinjectionalternative", "setuppagenumber", "setuppagenumbering", "setuppageshift", "setuppagestate", "setuppagetransitions", "setuppairedbox", "setuppalet", "setuppaper", "setuppapersize", "setupparagraph", "setupparagraphintro", "setupparagraphnumbering", "setupparagraphs", "setupparallel", "setupperiodkerning", "setupperiods", "setupplaceholder", "setupplacement", "setuppositionbar", "setuppositioning", "setupprefixtext", "setupprocessor", "setupprofile", "setupprograms", "setupquotation", "setupquote", "setuprealpagenumber", "setupreferenceformat", "setupreferenceprefix", "setupreferencestructureprefix", "setupreferencing", "setupregister", "setupregisters", "setuprenderingwindow", "setuprotate", "setupruby", "setups", "setupscale", "setupscript", "setupscripts", "setupsectionblock", "setupselector", "setupshift", "setupsidebar", "setupsorting", "setupspacing", "setupspellchecking", "setupstartstop", "setupstretched", "setupstrut", "setupstyle", "setupsubformula", "setupsubformulas", "setupsubpagenumber", "setupsuffixtext", "setupsymbols", "setupsymbolset", "setupsynctex", "setupsynonyms", "setupsystem", "setuptables", "setuptabulate", "setuptagging", "setuptaglabeltext", "setuptext", "setuptextbackground", "setuptextflow", "setuptextnote", "setuptextrules", "setuptexttexts", "setupthinrules", "setuptolerance", "setuptooltip", "setuptop", "setuptoptexts", "setuptype", "setuptyping", "setupunit", "setupunittext", "setupurl", "setupuserdata", "setupuserdataalternative", "setupuserpagenumber", "setupversion", "setupviewerlayer", "setupvspacing", "setupwhitespace", "setupwithargument", "setupwithargumentswapped", "setupxml", "setupxtable", "setuvalue", "setuxvalue", "setvalue", "setvariable", "setvariables", "setvboxregister", "setvisualizerfont", "setvtopregister", "setwidthof", "setxmeasure", "setxvalue", "setxvariable", "setxvariables", "seveneighths", "sfrac", "shapedhbox", "sharp", "shiftbox", "shiftdown", "shiftup", "showallmakeup", "showattributes", "showbodyfont", "showbodyfontenvironment", "showboxes", "showbtxdatasetauthors", "showbtxdatasetcompleteness", "showbtxdatasetfields", "showbtxfields", "showbtxhashedauthors", "showbtxtables", "showchardata", "showcharratio", "showcolor", "showcolorbar", "showcolorcomponents", "showcolorgroup", "showcolorset", "showcolorstruts", "showcounter", "showdirectives", "showdirsinmargin", "showedebuginfo", "showexperiments", "showfont", "showfontdata", "showfontexpansion", "showfontitalics", "showfontkerns", "showfontparameters", "showfontstrip", "showfontstyle", "showframe", "showglyphdata", "showglyphs", "showgrid", "showgridsnapping", "showhelp", "showhyphenationtrace", "showhyphens", "showinjector", "showjustification", "showkerning", "showlayout", "showlayoutcomponents", "showligature", "showligatures", "showlogcategories", "showluatables", "showmakeup", "showmargins", "showmessage", "showminimalbaseline", "shownextbox", "showotfcomposition", "showpalet", "showparentchain", "showparwrapperstate", "showprint", "showsetups", "showsetupsdefinition", "showstruts", "showsymbolset", "showtimer", "showtokens", "showtrackers", "showvalue", "showvariable", "showwarning", "sigma", "signalrightpage", "sim", "simeq", "simplealignedbox", "simplealignedboxplus", "simplealignedspreadbox", "simplegroupedcommand", "simplereversealignedbox", "simplereversealignedboxplus", "singalcharacteralign", "singlebond", "singleverticalbar", "sixperemspace", "sixthofsixarguments", "slanted", "slantedbold", "slantedface", "slash", "slicepages", "slong", "slovenianNumerals", "sloveniannumerals", "small", "smallbodyfont", "smallbold", "smallbolditalic", "smallboldslanted", "smallcappedcharacters", "smallcappedromannumerals", "smallcaps", "smaller", "smallitalicbold", "smallnormal", "smallskip", "smallslanted", "smallslantedbold", "smalltype", "smash", "smashbox", "smashboxed", "smashedhbox", "smashedvbox", "smile", "snaptogrid", "softhyphen", "solidus", "someheadnumber", "somekindoftab", "someline", "somelocalfloat", "somenamedheadnumber", "someplace", "somewhere", "space", "spaceddigits", "spaceddigitsmethod", "spaceddigitsseparator", "spaceddigitssymbol", "spadesuit", "spanishNumerals", "spanishnumerals", "speech", "sphericalangle", "splitatasterisk", "splitatcolon", "splitatcolons", "splitatcomma", "splitatperiod", "splitdfrac", "splitfilename", "splitfloat", "splitfrac", "splitoffbase", "splitofffull", "splitoffkind", "splitoffname", "splitoffpath", "splitoffroot", "splitofftokens", "splitofftype", "splitstring", "spreadhbox", "sqcap", "sqcup", "sqrt", "sqsubset", "sqsubseteq", "sqsubsetneq", "sqsupset", "sqsupseteq", "sqsupsetneq", "square", "squaredots", "ssharp", "stackrel", "stackscripts", "star", "stareq", "startJScode", "startJSpreamble", "startLUA", "startMP", "startMPclip", "startMPcode", "startMPdefinitions", "startMPdrawing", "startMPenvironment", "startMPextensions", "startMPinclusions", "startMPinitializations", "startMPpage", "startMPpositiongraphic", "startMPpositionmethod", "startMPrun", "startPARSEDXML", "startTABLE", "startTABLEbody", "startTABLEfoot", "startTABLEhead", "startTABLEnested", "startTABLEnext", "startTC", "startTD", "startTDs", "startTEX", "startTEXpage", "startTH", "startTN", "startTR", "startTRs", "startTX", "startTY", "startXML", "startalign", "startalignment", "startallmodes", "startappendices", "startarrangedpages", "startasciimode", "startaside", "startattachment", "startbackground", "startbackmatter", "startbar", "startbbordermatrix", "startbitmapimage", "startblockquote", "startbodymatter", "startbordermatrix", "startboxedcolumns", "startbtxlabeltext", "startbtxrenderingdefinitions", "startbuffer", "startcases", "startcatcodetable", "startcenteraligned", "startchapter", "startcharacteralign", "startcheckedfences", "startchemical", "startchemicaltext", "startcollect", "startcollecting", "startcolor", "startcolorintent", "startcoloronly", "startcolorset", "startcolumns", "startcolumnset", "startcolumnsetspan", "startcombination", "startcomment", "startcomponent", "startcontextcode", "startcontextdefinitioncode", "startctxfunction", "startctxfunctiondefinition", "startcurrentcolor", "startcurrentlistentrywrapper", "startdelimited", "startdelimitedtext", "startdisplaymath", "startdmath", "startdocument", "starteffect", "startelement", "startembeddedxtable", "startendnote", "startendofline", "startenvironment", "startexceptions", "startexpanded", "startexpandedcollect", "startextendedcatcodetable", "startexternalfigurecollection", "startfacingfloat", "startfact", "startfigure", "startfiguretext", "startfittingpage", "startfixed", "startfloatcombination", "startfont", "startfontclass", "startfontsolution", "startfootnote", "startformula", "startformulas", "startframed", "startframedcell", "startframedcontent", "startframedrow", "startframedtable", "startframedtext", "startfrontmatter", "startgoto", "startgraphictext", "startgridsnapping", "starthanging", "starthbox", "starthboxestohbox", "starthboxregister", "starthead", "startheadtext", "starthelptext", "starthiding", "starthighlight", "starthyphenation", "startimath", "startindentation", "startindentedtext", "startinteraction", "startinteractionmenu", "startinterface", "startintermezzotext", "startintertext", "startitem", "startitemgroup", "startitemgroupcolumns", "startitemize", "startknockout", "startlabeltext", "startlanguage", "startlayout", "startleftaligned", "startlegend", "startline", "startlinealignment", "startlinecorrection", "startlinefiller", "startlinenote", "startlinenumbering", "startlines", "startlinetable", "startlinetablebody", "startlinetablecell", "startlinetablehead", "startlocalfootnotes", "startlocalheadsetup", "startlocallinecorrection", "startlocalnotes", "startlocalsetups", "startlua", "startluacode", "startluaparameterset", "startluasetups", "startmakeup", "startmarginblock", "startmarginrule", "startmarkedcontent", "startmarkpages", "startmathalignment", "startmathcases", "startmathlabeltext", "startmathmatrix", "startmathmode", "startmathstyle", "startmatrices", "startmatrix", "startmaxaligned", "startmdformula", "startmidaligned", "startmiddlealigned", "startmiddlemakeup", "startmixedcolumns", "startmode", "startmodeset", "startmodule", "startmoduletestsection", "startmpformula", "startmulticolumns", "startnamedsection", "startnamedsubformulas", "startnarrow", "startnarrower", "startnegative", "startnicelyfilledbox", "startnointerference", "startnotallmodes", "startnotext", "startnotmode", "startoperatortext", "startopposite", "startoutputstream", "startoverlay", "startoverprint", "startpacked", "startpagecolumns", "startpagecomment", "startpagefigure", "startpagelayout", "startpagemakeup", "startpar", "startparagraph", "startparagraphs", "startparagraphscell", "startparbuilder", "startpart", "startpath", "startplacechemical", "startplacefigure", "startplacefloat", "startplaceformula", "startplacegraphic", "startplaceintermezzo", "startplacelegend", "startplacepairedbox", "startplacetable", "startpositioning", "startpositionoverlay", "startpositive", "startpostponing", "startpostponingnotes", "startprefixtext", "startprocessassignmentcommand", "startprocessassignmentlist", "startprocesscommacommand", "startprocesscommalist", "startproduct", "startproject", "startprotect", "startprotectedcolors", "startpublication", "startpunctuation", "startquotation", "startquote", "startrandomized", "startrandomseed", "startrawsetups", "startreadingfile", "startreferenceprefix", "startregime", "startregister", "startreusableMPgraphic", "startrightaligned", "startruby", "startscript", "startsdformula", "startsection", "startsectionblock", "startsectionblockenvironment", "startsectionlevel", "startsetups", "startshapebox", "startshift", "startsidebar", "startsimplecolumns", "startspecialitem", "startspeech", "startspformula", "startsplitformula", "startsplittext", "startspread", "startstandardmakeup", "startstaticMPfigure", "startstaticMPgraphic", "startstrictinspectnextcharacter", "startstructurepageregister", "startstrut", "startstyle", "startsubformulas", "startsubject", "startsubjectlevel", "startsubsection", "startsubsentence", "startsubstack", "startsubsubject", "startsubsubsection", "startsubsubsubject", "startsubsubsubsection", "startsubsubsubsubject", "startsubsubsubsubsection", "startsubsubsubsubsubject", "startsuffixtext", "startsymbolset", "starttable", "starttablehead", "starttables", "starttabletail", "starttabletext", "starttabulate", "starttabulatehead", "starttabulatetail", "starttagged", "starttaglabeltext", "starttexcode", "starttexdefinition", "starttext", "starttextbackground", "starttextbackgroundmanual", "starttextcolor", "starttextcolorintent", "starttextflow", "starttextmakeup", "starttextrule", "startthematrix", "starttitle", "starttokenlist", "starttokens", "starttransparent", "starttypescript", "starttypescriptcollection", "starttyping", "startuniqueMPgraphic", "startuniqueMPpagegraphic", "startunittext", "startunpacked", "startusableMPgraphic", "startuseMPgraphic", "startusemathstyleparameter", "startuserdata", "startusingbtxspecification", "startvbox", "startvboxregister", "startvboxtohbox", "startvboxtohboxseparator", "startviewerlayer", "startvtop", "startvtopregister", "startxcell", "startxcellgroup", "startxcolumn", "startxgroup", "startxmldisplayverbatim", "startxmlinlineverbatim", "startxmlraw", "startxmlsetups", "startxrow", "startxrowgroup", "startxtable", "startxtablebody", "startxtablefoot", "startxtablehead", "startxtablenext", "stligature", "stopJScode", "stopJSpreamble", "stopLUA", "stopMP", "stopMPclip", "stopMPcode", "stopMPdefinitions", "stopMPdrawing", "stopMPenvironment", "stopMPextensions", "stopMPinclusions", "stopMPinitializations", "stopMPpage", "stopMPpositiongraphic", "stopMPpositionmethod", "stopMPrun", "stopPARSEDXML", "stopTABLE", "stopTABLEbody", "stopTABLEfoot", "stopTABLEhead", "stopTABLEnested", "stopTABLEnext", "stopTC", "stopTD", "stopTDs", "stopTEX", "stopTEXpage", "stopTH", "stopTN", "stopTR", "stopTRs", "stopTX", "stopTY", "stopXML", "stopalign", "stopalignment", "stopallmodes", "stopappendices", "stoparrangedpages", "stopasciimode", "stopaside", "stopattachment", "stopbackground", "stopbackmatter", "stopbar", "stopbbordermatrix", "stopbitmapimage", "stopblockquote", "stopbodymatter", "stopbordermatrix", "stopboxedcolumns", "stopbtxlabeltext", "stopbtxrenderingdefinitions", "stopbuffer", "stopcases", "stopcatcodetable", "stopcenteraligned", "stopchapter", "stopcharacteralign", "stopcheckedfences", "stopchemical", "stopchemicaltext", "stopcollect", "stopcollecting", "stopcolor", "stopcolorintent", "stopcoloronly", "stopcolorset", "stopcolumns", "stopcolumnset", "stopcolumnsetspan", "stopcombination", "stopcomment", "stopcomponent", "stopcontextcode", "stopcontextdefinitioncode", "stopctxfunction", "stopctxfunctiondefinition", "stopcurrentcolor", "stopcurrentlistentrywrapper", "stopdelimited", "stopdelimitedtext", "stopdisplaymath", "stopdmath", "stopdocument", "stopeffect", "stopelement", "stopembeddedxtable", "stopendnote", "stopendofline", "stopenvironment", "stopexceptions", "stopexpanded", "stopexpandedcollect", "stopextendedcatcodetable", "stopexternalfigurecollection", "stopfacingfloat", "stopfact", "stopfigure", "stopfiguretext", "stopfittingpage", "stopfixed", "stopfloatcombination", "stopfont", "stopfontclass", "stopfontsolution", "stopfootnote", "stopformula", "stopformulas", "stopframed", "stopframedcell", "stopframedcontent", "stopframedrow", "stopframedtable", "stopframedtext", "stopfrontmatter", "stopgoto", "stopgraphictext", "stopgridsnapping", "stophanging", "stophbox", "stophboxestohbox", "stophboxregister", "stophead", "stopheadtext", "stophelptext", "stophiding", "stophighlight", "stophyphenation", "stopimath", "stopindentation", "stopindentedtext", "stopinteraction", "stopinteractionmenu", "stopinterface", "stopintermezzotext", "stopintertext", "stopitem", "stopitemgroup", "stopitemgroupcolumns", "stopitemize", "stopknockout", "stoplabeltext", "stoplanguage", "stoplayout", "stopleftaligned", "stoplegend", "stopline", "stoplinealignment", "stoplinecorrection", "stoplinefiller", "stoplinenote", "stoplinenumbering", "stoplines", "stoplinetable", "stoplinetablebody", "stoplinetablecell", "stoplinetablehead", "stoplocalfootnotes", "stoplocalheadsetup", "stoplocallinecorrection", "stoplocalnotes", "stoplocalsetups", "stoplua", "stopluacode", "stopluaparameterset", "stopluasetups", "stopmakeup", "stopmarginblock", "stopmarginrule", "stopmarkedcontent", "stopmarkpages", "stopmathalignment", "stopmathcases", "stopmathlabeltext", "stopmathmatrix", "stopmathmode", "stopmathstyle", "stopmatrices", "stopmatrix", "stopmaxaligned", "stopmdformula", "stopmidaligned", "stopmiddlealigned", "stopmiddlemakeup", "stopmixedcolumns", "stopmode", "stopmodeset", "stopmodule", "stopmoduletestsection", "stopmpformula", "stopmulticolumns", "stopnamedsection", "stopnamedsubformulas", "stopnarrow", "stopnarrower", "stopnegative", "stopnicelyfilledbox", "stopnointerference", "stopnotallmodes", "stopnotext", "stopnotmode", "stopoperatortext", "stopopposite", "stopoutputstream", "stopoverlay", "stopoverprint", "stoppacked", "stoppagecolumns", "stoppagecomment", "stoppagefigure", "stoppagelayout", "stoppagemakeup", "stoppar", "stopparagraph", "stopparagraphs", "stopparagraphscell", "stopparbuilder", "stoppart", "stoppath", "stopplacechemical", "stopplacefigure", "stopplacefloat", "stopplaceformula", "stopplacegraphic", "stopplaceintermezzo", "stopplacelegend", "stopplacepairedbox", "stopplacetable", "stoppositioning", "stoppositionoverlay", "stoppositive", "stoppostponing", "stoppostponingnotes", "stopprefixtext", "stopprocessassignmentcommand", "stopprocessassignmentlist", "stopprocesscommacommand", "stopprocesscommalist", "stopproduct", "stopproject", "stopprotect", "stopprotectedcolors", "stoppublication", "stoppunctuation", "stopquotation", "stopquote", "stoprandomized", "stoprandomseed", "stoprawsetups", "stopreadingfile", "stopreferenceprefix", "stopregime", "stopreusableMPgraphic", "stoprightaligned", "stopruby", "stopscript", "stopsdformula", "stopsection", "stopsectionblock", "stopsectionblockenvironment", "stopsectionlevel", "stopsetups", "stopshapebox", "stopshift", "stopsidebar", "stopsimplecolumns", "stopspecialitem", "stopspeech", "stopspformula", "stopsplitformula", "stopsplittext", "stopspread", "stopstandardmakeup", "stopstaticMPfigure", "stopstaticMPgraphic", "stopstrictinspectnextcharacter", "stopstrut", "stopstyle", "stopsubformulas", "stopsubject", "stopsubjectlevel", "stopsubsection", "stopsubsentence", "stopsubstack", "stopsubsubject", "stopsubsubsection", "stopsubsubsubject", "stopsubsubsubsection", "stopsubsubsubsubject", "stopsubsubsubsubsection", "stopsubsubsubsubsubject", "stopsuffixtext", "stopsymbolset", "stoptable", "stoptablehead", "stoptables", "stoptabletail", "stoptabletext", "stoptabulate", "stoptabulatehead", "stoptabulatetail", "stoptagged", "stoptaglabeltext", "stoptexcode", "stoptexdefinition", "stoptext", "stoptextbackground", "stoptextbackgroundmanual", "stoptextcolor", "stoptextcolorintent", "stoptextflow", "stoptextmakeup", "stoptextrule", "stopthematrix", "stoptitle", "stoptokenlist", "stoptokens", "stoptransparent", "stoptypescript", "stoptypescriptcollection", "stoptyping", "stopuniqueMPgraphic", "stopuniqueMPpagegraphic", "stopunittext", "stopunpacked", "stopusableMPgraphic", "stopuseMPgraphic", "stopusemathstyleparameter", "stopuserdata", "stopusingbtxspecification", "stopvbox", "stopvboxregister", "stopvboxtohbox", "stopvboxtohboxseparator", "stopviewerlayer", "stopvtop", "stopvtopregister", "stopxcell", "stopxcellgroup", "stopxcolumn", "stopxgroup", "stopxmldisplayverbatim", "stopxmlinlineverbatim", "stopxmlraw", "stopxmlsetups", "stopxrow", "stopxrowgroup", "stopxtable", "stopxtablebody", "stopxtablefoot", "stopxtablehead", "stopxtablenext", "stretched", "strictdoifelsenextoptional", "strictdoifnextoptionalelse", "stripcharacter", "strippedcsname", "stripspaces", "structurelistuservariable", "structurenumber", "structuretitle", "structureuservariable", "structurevariable", "strut", "strutdp", "strutgap", "strutht", "struthtdp", "struttedbox", "strutwd", "style", "styleinstance", "subject", "subpagenumber", "subsection", "subsentence", "subset", "subseteq", "subseteqq", "subsetneq", "subsetneqq", "substituteincommalist", "subsubject", "subsubsection", "subsubsubject", "subsubsubsection", "subsubsubsubject", "subsubsubsubsection", "subsubsubsubsubject", "subtractfeature", "succ", "succapprox", "succcurlyeq", "succeq", "succeqq", "succnapprox", "succneq", "succneqq", "succnsim", "succsim", "suffixlanguage", "suffixtext", "sum", "supset", "supseteq", "supseteqq", "supsetneq", "supsetneqq", "surd", "surdradical", "swapcounts", "swapdimens", "swapface", "swapmacros", "swaptypeface", "swarrow", "switchstyleonly", "switchtobodyfont", "switchtocolor", "switchtointerlinespace", "symbol", "symbolreference", "synchronizeblank", "synchronizeindenting", "synchronizemarking", "synchronizeoutputstreams", "synchronizestrut", "synchronizewhitespace", "synctexblockfilename", "synctexresetfilename", "synctexsetfilename", "systemlog", "systemlogfirst", "systemloglast", "systemsetups", "tLeftarrow", "tLeftrightarrow", "tRightarrow", "tabulateautoline", "tabulateautorule", "tabulateline", "tabulaterule", "taggedctxcommand", "taggedlabeltexts", "taglabellanguage", "taglabeltext", "tau", "tbinom", "tbox", "tcaron", "tcedilla", "tcommaaccent", "tcurl", "tequal", "test", "testandsplitstring", "testcolumn", "testfeature", "testfeatureonce", "testpage", "testpageonly", "testpagesync", "testtokens", "tex", "texdefinition", "texsetup", "textAngstrom", "textacute", "textampersand", "textasciicircum", "textasciitilde", "textat", "textbackslash", "textbar", "textbottomcomma", "textbottomdot", "textbraceleft", "textbraceright", "textbreve", "textbrokenbar", "textbullet", "textcaron", "textcedilla", "textcelsius", "textcent", "textcircledP", "textcircumflex", "textcitation", "textcite", "textcomma", "textcontrolspace", "textcurrency", "textdag", "textddag", "textdegree", "textdiaeresis", "textdiv", "textdollar", "textdong", "textdotaccent", "textellipsis", "texteuro", "textflowcollector", "textfraction", "textgrave", "texthash", "texthorizontalbar", "texthungarumlaut", "texthyphen", "textkelvin", "textlognot", "textmacron", "textmath", "textmho", "textminus", "textmp", "textmu", "textmultiply", "textnumero", "textogonek", "textohm", "textormathchar", "textormathchars", "textounce", "textpercent", "textperiod", "textplus", "textpm", "textreference", "textring", "textrule", "textslash", "textsterling", "texttilde", "textunderscore", "textvisiblespace", "textyen", "thai", "thainumerals", "thedatavalue", "thefirstcharacter", "thematrix", "thenormalizedbodyfontsize", "theorientation", "therefore", "theremainingcharacters", "theta", "thickspace", "thinrule", "thinrules", "thinspace", "thirdoffivearguments", "thirdoffourarguments", "thirdofsixarguments", "thirdofthreearguments", "thirdofthreeunexpanded", "thook", "thookleftarrow", "thookrightarrow", "thorn", "threedigitrounding", "threeeighths", "threefifths", "threeperemspace", "threequarter", "threesuperior", "tibetannumerals", "tightlayer", "tilde", "times", "tinyfont", "title", "tlap", "tleftarrow", "tleftharpoondown", "tleftharpoonup", "tleftrightarrow", "tleftrightharpoons", "tmapsto", "to", "tochar", "tolinenote", "tooltip", "top", "topbox", "topleftbox", "toplinebox", "toprightbox", "topskippedbox", "tracecatcodetables", "tracedfontname", "tracedpagestate", "traceoutputroutines", "tracepositions", "trademark", "translate", "transparencycomponents", "transparent", "trel", "triangle", "triangledown", "triangleleft", "triangleq", "triangleright", "trightarrow", "trightharpoondown", "trightharpoonup", "trightleftharpoons", "trightoverleftarrow", "triplebond", "tripleprime", "tripleverticalbar", "truefilename", "truefontname", "tstroke", "ttraggedright", "ttriplerel", "ttwoheadleftarrow", "ttwoheadrightarrow", "turnediota", "twodigitrounding", "twofifths", "twoheaddownarrow", "twoheadleftarrow", "twoheadrightarrow", "twoheadrightarrowtail", "twoheaduparrow", "twosuperior", "twothirds", "tx", "txx", "typ", "type", "typebuffer", "typedefinedbuffer", "typeface", "typefile", "typeinlinebuffer", "typescriptone", "typescriptprefix", "typescriptthree", "typescripttwo", "typesetbuffer", "typesetbufferonly", "typesetfile", "uacute", "ubreve", "ucaron", "uchexnumber", "uchexnumbers", "ucircumflex", "uconvertnumber", "udiaeresis", "udiaeresisacute", "udiaeresiscaron", "udiaeresisgrave", "udiaeresismacron", "udotbelow", "udots", "udoublegrave", "uedcatcodecommand", "ugrave", "uhook", "uhorn", "uhornacute", "uhorndotbelow", "uhorngrave", "uhornhook", "uhorntilde", "uhungarumlaut", "uinvertedbreve", "ulcorner", "umacron", "undefinevalue", "undepthed", "underbar", "underbars", "underbartext", "underbrace", "underbracetext", "underbracket", "underbrackettext", "underdash", "underdashes", "underdot", "underdots", "underleftarrow", "underleftharpoondown", "underleftharpoonup", "underleftrightarrow", "underparent", "underparenttext", "underrandom", "underrandoms", "underrightarrow", "underrightharpoondown", "underrightharpoonup", "underset", "understrike", "understrikes", "undertwoheadleftarrow", "undertwoheadrightarrow", "undoassign", "unexpandeddocumentvariable", "unframed", "unhhbox", "unihex", "uniqueMPgraphic", "uniqueMPpagegraphic", "unit", "unitlanguage", "unitshigh", "unitslow", "unittext", "unknown", "unprotected", "unregisterhyphenationpattern", "unregisterparwrapper", "unspaceafter", "unspaceargument", "unspaced", "unspacestring", "unstackscripts", "untexargument", "untexcommand", "uogonek", "upand", "uparrow", "updasharrow", "updateparagraphdemerits", "updateparagraphpenalties", "updateparagraphproperties", "updateparagraphshapes", "updownarrow", "updownarrowbar", "updownarrows", "upharpoonleft", "upharpoonright", "uplus", "uppercased", "uppercasestring", "uppercasing", "upperleftdoubleninequote", "upperleftdoublesixquote", "upperleftsingleninequote", "upperleftsinglesixquote", "upperrightdoubleninequote", "upperrightdoublesixquote", "upperrightsingleninequote", "upperrightsinglesixquote", "upsilon", "upuparrows", "upwhitearrow", "urcorner", "uring", "url", "useJSscripts", "useMPenvironmentbuffer", "useMPgraphic", "useMPlibrary", "useMPrun", "useMPvariables", "useURL", "usealignparameter", "useblankparameter", "useblocks", "usebodyfont", "usebodyfontparameter", "usebtxdataset", "usebtxdefinitions", "usecitation", "usecolors", "usecomponent", "usedirectory", "usedummycolorparameter", "usedummystyleandcolor", "usedummystyleparameter", "useenvironment", "useexternaldocument", "useexternalfigure", "useexternalrendering", "useexternalsoundtrack", "usefigurebase", "usefile", "usefontpath", "usegridparameter", "usehyphensparameter", "useindentingparameter", "useindentnextparameter", "useinterlinespaceparameter", "uselanguageparameter", "useluamodule", "useluatable", "usemathstyleparameter", "usemodule", "useproduct", "useprofileparameter", "useproject", "usereferenceparameter", "userpagenumber", "usesetupsparameter", "usestaticMPfigure", "usesubpath", "usesymbols", "usetexmodule", "usetypescript", "usetypescriptfile", "useurl", "usezipfile", "utfchar", "utflower", "utfupper", "utilde", "utilityregisterlength", "vDash", "validassignment", "varTheta", "varepsilon", "varkappa", "varnothing", "varphi", "varpi", "varrho", "varsigma", "vartheta", "vboxreference", "vdash", "vdots", "vec", "vee", "veebar", "veeeq", "verbatim", "verbatimstring", "verbosenumber", "version", "vert", "verticalgrowingbar", "verticalpositionbar", "veryraggedcenter", "veryraggedleft", "veryraggedright", "vglue", "viewerlayer", "vl", "vpackbox", "vpackedbox", "vphantom", "vpos", "vsmash", "vsmashbox", "vsmashed", "vspace", "vspacing", "wcircumflex", "wdofstring", "wedge", "wedgeeq", "weekday", "whitearrowupfrombar", "wideacute", "widebar", "widebreve", "widecheck", "wideddot", "widedot", "widegrave", "widehat", "widering", "widetilde", "widthofstring", "widthspanningtext", "withoutpt", "word", "wordright", "words", "wordtonumber", "wp", "wr", "writebetweenlist", "writedatatolist", "writestatus", "writetolist", "xLeftarrow", "xLeftrightarrow", "xRightarrow", "xdefconvertedargument", "xequal", "xfrac", "xhookleftarrow", "xhookrightarrow", "xi", "xleftarrow", "xleftharpoondown", "xleftharpoonup", "xleftrightarrow", "xleftrightharpoons", "xmapsto", "xmladdindex", "xmlafterdocumentsetup", "xmlaftersetup", "xmlall", "xmlappenddocumentsetup", "xmlappendsetup", "xmlapplyselectors", "xmlatt", "xmlattdef", "xmlattribute", "xmlattributedef", "xmlbadinclusions", "xmlbeforedocumentsetup", "xmlbeforesetup", "xmlchainatt", "xmlchainattdef", "xmlchecknamespace", "xmlcommand", "xmlconcat", "xmlconcatrange", "xmlcontext", "xmlcount", "xmldefaulttotext", "xmldepth", "xmldirectives", "xmldirectivesafter", "xmldirectivesbefore", "xmldisplayverbatim", "xmldoif", "xmldoifatt", "xmldoifelse", "xmldoifelseatt", "xmldoifelseempty", "xmldoifelseselfempty", "xmldoifelsetext", "xmldoifelsevalue", "xmldoifnot", "xmldoifnotatt", "xmldoifnotselfempty", "xmldoifnottext", "xmldoifselfempty", "xmldoiftext", "xmlelement", "xmlfilter", "xmlfirst", "xmlflush", "xmlflushcontext", "xmlflushdocumentsetups", "xmlflushlinewise", "xmlflushpure", "xmlflushspacewise", "xmlflushtext", "xmlinclude", "xmlinclusion", "xmlinclusions", "xmlinfo", "xmlinjector", "xmlinlineprettyprint", "xmlinlineprettyprinttext", "xmlinlineverbatim", "xmlinstalldirective", "xmllast", "xmllastatt", "xmllastmatch", "xmllastpar", "xmlloadbuffer", "xmlloaddata", "xmlloaddirectives", "xmlloadfile", "xmlloadonly", "xmlmain", "xmlmapvalue", "xmlname", "xmlnamespace", "xmlnonspace", "xmlpar", "xmlparam", "xmlpath", "xmlpos", "xmlposition", "xmlprependdocumentsetup", "xmlprependsetup", "xmlprettyprint", "xmlprettyprinttext", "xmlprocessbuffer", "xmlprocessdata", "xmlprocessfile", "xmlpure", "xmlraw", "xmlrefatt", "xmlregistereddocumentsetups", "xmlregisteredsetups", "xmlregisterns", "xmlremapname", "xmlremapnamespace", "xmlremovedocumentsetup", "xmlremovesetup", "xmlresetdocumentsetups", "xmlresetinjectors", "xmlresetsetups", "xmlsave", "xmlsetatt", "xmlsetattribute", "xmlsetentity", "xmlsetfunction", "xmlsetinjectors", "xmlsetpar", "xmlsetparam", "xmlsetsetup", "xmlsetup", "xmlshow", "xmlsnippet", "xmlstrip", "xmlstripnolines", "xmlstripped", "xmlstrippednolines", "xmltag", "xmltexentity", "xmltext", "xmltobuffer", "xmltobufferverbose", "xmltofile", "xmlvalue", "xmlverbatim", "xrel", "xrightarrow", "xrightharpoondown", "xrightharpoonup", "xrightleftharpoons", "xrightoverleftarrow", "xsplitstring", "xtriplerel", "xtwoheadleftarrow", "xtwoheadrightarrow", "xxfrac", "xypos", "yacute", "ycircumflex", "ydiaeresis", "ydotbelow", "yen", "ygrave", "yhook", "yiddishnumerals", "ymacron", "ytilde", "zacute", "zcaron", "zdotaccent", "zeronumberconversion", "zerowidthnobreakspace", "zerowidthspace", "zeta", "zhook", "zstroke", "zwj", "zwnj" }, + ["common"]={ "AEacute", "AEligature", "AEmacron", "AMSTEX", "Aacute", "Abreve", "Abreveacute", "Abrevedotbelow", "Abrevegrave", "Abrevehook", "Abrevetilde", "Acaron", "Acircumflex", "Acircumflexacute", "Acircumflexdotbelow", "Acircumflexgrave", "Acircumflexhook", "Acircumflextilde", "Adiaeresis", "Adiaeresismacron", "Adotaccent", "Adotaccentmacron", "Adotbelow", "Adoublegrave", "AfterPar", "Agrave", "Ahook", "Ainvertedbreve", "Alpha", "Alphabeticnumerals", "AmSTeX", "Amacron", "And", "Angstrom", "Aogonek", "Aring", "Aringacute", "Arrowvert", "Astroke", "Atilde", "BeforePar", "Beta", "Bhook", "Big", "Bigg", "Biggl", "Biggm", "Biggr", "Bigl", "Bigm", "Bigr", "Box", "Bumpeq", "CONTEXT", "Cacute", "Cap", "Caps", "Ccaron", "Ccedilla", "Ccircumflex", "Cdotaccent", "Character", "Characters", "Chi", "Chook", "ConTeXt", "Context", "ConvertConstantAfter", "ConvertToConstant", "Cstroke", "Cup", "DAYLONG", "DAYSHORT", "DZcaronligature", "DZligature", "Dafrican", "Dcaron", "Ddownarrow", "Delta", "Dhook", "Doteq", "Downarrow", "Dstroke", "Dzcaronligature", "Dzligature", "ETEX", "Eacute", "Ebreve", "Ecaron", "Ecedilla", "Ecircumflex", "Ecircumflexacute", "Ecircumflexdotbelow", "Ecircumflexgrave", "Ecircumflexhook", "Ecircumflextilde", "Ediaeresis", "Edotaccent", "Edotbelow", "Edoublegrave", "Egrave", "Ehook", "Einvertedbreve", "Emacron", "Eogonek", "Epsilon", "Eta", "Eth", "Etilde", "Eulerconst", "EveryLine", "EveryPar", "Fhook", "Finv", "Gacute", "Game", "Gamma", "Gbreve", "Gcaron", "Gcircumflex", "Gcommaaccent", "Gdotaccent", "GetPar", "Ghook", "GotoPar", "Greeknumerals", "Gstroke", "Hcaron", "Hcircumflex", "Hstroke", "IJligature", "INRSTEX", "Iacute", "Ibreve", "Icaron", "Icircumflex", "Idiaeresis", "Idotaccent", "Idotbelow", "Idoublegrave", "Igrave", "Ihook", "Iinvertedbreve", "Im", "Imacron", "Iogonek", "Iota", "Istroke", "Itilde", "Jcircumflex", "Join", "Kappa", "Kcaron", "Kcommaaccent", "Khook", "LAMSTEX", "LATEX", "LJligature", "LUAJITTEX", "LUAMETATEX", "LUATEX", "LaTeX", "Lacute", "LamSTeX", "Lambda", "Lbar", "Lcaron", "Lcommaaccent", "Ldotmiddle", "Ldsh", "Leftarrow", "Leftrightarrow", "Ljligature", "Lleftarrow", "Longleftarrow", "Longleftrightarrow", "Longmapsfrom", "Longmapsto", "Longrightarrow", "Lsh", "Lstroke", "Lua", "LuaMetaTeX", "LuaTeX", "LuajitTeX", "METAFONT", "METAFUN", "METAPOST", "MKII", "MKIV", "MKIX", "MKLX", "MKVI", "MKXI", "MKXL", "MONTH", "MONTHLONG", "MONTHSHORT", "MPII", "MPIV", "MPLX", "MPVI", "MPXL", "MPanchor", "MPbetex", "MPc", "MPcode", "MPcolor", "MPcoloronly", "MPcolumn", "MPd", "MPdrawing", "MPfontsizehskip", "MPgetmultipars", "MPgetmultishape", "MPgetposboxes", "MPh", "MPinclusions", "MPleftskip", "MPll", "MPlr", "MPls", "MPmenubuttons", "MPn", "MPoptions", "MPoverlayanchor", "MPp", "MPpage", "MPpardata", "MPplus", "MPpos", "MPpositiongraphic", "MPposset", "MPr", "MPrawvar", "MPregion", "MPrest", "MPrightskip", "MPrs", "MPstring", "MPtext", "MPtransparency", "MPul", "MPur", "MPv", "MPvar", "MPvariable", "MPvv", "MPw", "MPwhd", "MPx", "MPxy", "MPxywhd", "MPy", "Mapsfrom", "Mapsto", "MetaFont", "MetaFun", "MetaPost", "Mu", "NJligature", "Nacute", "Ncaron", "Ncommaaccent", "Nearrow", "Neng", "Ngrave", "Njligature", "NormalizeFontHeight", "NormalizeFontWidth", "NormalizeTextHeight", "NormalizeTextWidth", "Ntilde", "Nu", "Numbers", "Nwarrow", "OEligature", "Oacute", "Obreve", "Ocaron", "Ocircumflex", "Ocircumflexacute", "Ocircumflexdotbelow", "Ocircumflexgrave", "Ocircumflexhook", "Ocircumflextilde", "Odiaeresis", "Odiaeresismacron", "Odotaccent", "Odotaccentmacron", "Odotbelow", "Odoublegrave", "Ograve", "Ohook", "Ohorn", "Ohornacute", "Ohorndotbelow", "Ohorngrave", "Ohornhook", "Ohorntilde", "Ohungarumlaut", "Oinvertedbreve", "Omacron", "Omega", "Omicron", "Oogonek", "Oogonekmacron", "Ostroke", "Ostrokeacute", "Otilde", "Otildemacron", "P", "PDFETEX", "PDFTEX", "PDFcolor", "PICTEX", "PPCHTEX", "PPCHTeX", "PRAGMA", "Phi", "Phook", "Pi", "PiCTeX", "Plankconst", "PointsToBigPoints", "PointsToReal", "PointsToWholeBigPoints", "Psi", "PtToCm", "Racute", "Rcaron", "Rcommaaccent", "Rdoublegrave", "Rdsh", "Re", "ReadFile", "Relbar", "Rho", "Rightarrow", "Rinvertedbreve", "Romannumerals", "Rrightarrow", "Rsh", "S", "Sacute", "ScaledPointsToBigPoints", "ScaledPointsToWholeBigPoints", "Scaron", "Scedilla", "Schwa", "Scircumflex", "Scommaaccent", "Searrow", "Sigma", "Smallcapped", "Subset", "Supset", "Swarrow", "TABLE", "TEX", "TaBlE", "Tau", "Tcaron", "Tcedilla", "Tcommaaccent", "TeX", "TheNormalizedFontSize", "Theta", "Thook", "Thorn", "TransparencyHack", "Tstroke", "Uacute", "Ubreve", "Ucaron", "Ucircumflex", "Udiaeresis", "Udiaeresisacute", "Udiaeresiscaron", "Udiaeresisgrave", "Udiaeresismacron", "Udotbelow", "Udoublegrave", "Ugrave", "Uhook", "Uhorn", "Uhornacute", "Uhorndotbelow", "Uhorngrave", "Uhornhook", "Uhorntilde", "Uhungarumlaut", "Uinvertedbreve", "Umacron", "Uogonek", "Uparrow", "Updownarrow", "Upsilon", "Uring", "Utilde", "Uuparrow", "VDash", "Vdash", "VerboseNumber", "Vert", "Vhook", "Vvdash", "WEEKDAY", "WORD", "WORDS", "Wcircumflex", "WidthSpanningText", "Word", "Words", "XETEX", "XeTeX", "Xi", "Yacute", "Ycircumflex", "Ydiaeresis", "Ydotbelow", "Ygrave", "Yhook", "Ymacron", "Ytilde", "Zacute", "Zcaron", "Zdotaccent", "Zeta", "Zhook", "Zstroke", "aacute", "abbreviation", "abjadnaivenumerals", "abjadnodotnumerals", "abjadnumerals", "about", "abreve", "abreveacute", "abrevedotbelow", "abrevegrave", "abrevehook", "abrevetilde", "acaron", "acircumflex", "acircumflexacute", "acircumflexdotbelow", "acircumflexgrave", "acircumflexhook", "acircumflextilde", "activatespacehandler", "actualday", "actualmonth", "actualyear", "actuarial", "acute", "acwopencirclearrow", "adaptcollector", "adaptfontfeature", "adaptlayout", "adaptpapersize", "addfeature", "addtoJSpreamble", "addtocommalist", "addvalue", "adiaeresis", "adiaeresismacron", "adjointsymbol", "adotaccent", "adotaccentmacron", "adotbelow", "adoublegrave", "aeacute", "aeligature", "aemacron", "afghanicurrency", "aftersplitstring", "aftertestandsplitstring", "agrave", "ahook", "ainvertedbreve", "aleph", "alignbottom", "aligned", "alignedbox", "alignedline", "alignhere", "alignmentcharacter", "allinputpaths", "alpha", "alphabeticnumerals", "alwayscitation", "alwayscite", "amacron", "amalg", "ampersand", "anchor", "angle", "aogonek", "appendetoks", "appendgvalue", "appendtocommalist", "appendtoks", "appendtoksonce", "appendvalue", "apply", "applyalternativestyle", "applyfunction", "applyfunctionof", "applyprocessor", "applytocharacters", "applytofirstcharacter", "applytosplitstringchar", "applytosplitstringcharspaced", "applytosplitstringline", "applytosplitstringlinespaced", "applytosplitstringword", "applytosplitstringwordspaced", "applytowords", "approx", "approxEq", "approxeq", "approxnEq", "arabicakbar", "arabicalayhe", "arabicallah", "arabicallallahou", "arabicasterisk", "arabicbasmalah", "arabiccomma", "arabiccuberoot", "arabicdateseparator", "arabicdecimals", "arabicdisputedendofayah", "arabicendofayah", "arabicexnumerals", "arabicfootnotemarker", "arabicfourthroot", "arabichighain", "arabichighalayheassallam", "arabichigheqala", "arabichighesala", "arabichighfootnotemarker", "arabichighjeem", "arabichighlamalef", "arabichighmadda", "arabichighmeemlong", "arabichighmeemshort", "arabichighnisf", "arabichighnoon", "arabichighnoonkasra", "arabichighqaf", "arabichighqif", "arabichighradiallahouanhu", "arabichighrahmatullahalayhe", "arabichighrubc", "arabichighsad", "arabichighsajda", "arabichighsakta", "arabichighsallallahou", "arabichighseen", "arabichighsmallsafha", "arabichightah", "arabichightakhallus", "arabichighthalatha", "arabichighwaqf", "arabichighyeh", "arabichighzain", "arabicjallajalalouhou", "arabiclettermark", "arabiclowmeemlong", "arabiclownoonkasra", "arabiclowseen", "arabicmisra", "arabicmuhammad", "arabicnumber", "arabicnumberabove", "arabicnumerals", "arabicparenleft", "arabicparenright", "arabicpercent", "arabicperiod", "arabicpermille", "arabicpertenthousand", "arabicpoeticverse", "arabicqala", "arabicquestion", "arabicrasoul", "arabicray", "arabicrialsign", "arabicsafha", "arabicsajdah", "arabicsalla", "arabicsamvat", "arabicsanah", "arabicsemicolon", "arabicshighthreedots", "arabicslcm", "arabicstartofrubc", "arabictripledot", "arabicvowelwaw", "arabicvowelyeh", "arabicwasallam", "arg", "aring", "aringacute", "asciimode", "asciistr", "aside", "assignalfadimension", "assigndimen", "assigndimension", "assignifempty", "assigntranslation", "assignvalue", "assignwidth", "assumelongusagecs", "ast", "astype", "asymp", "at", "atilde", "atleftmargin", "atpage", "atrightmargin", "attachment", "autocap", "autodirhbox", "autodirvbox", "autodirvtop", "autoinsertnextspace", "autointegral", "automathematics", "autoorientation", "autopagestaterealpage", "autopagestaterealpageorder", "autorule", "autosetups", "availablehsize", "averagecharwidth", "backepsilon", "background", "backgroundimage", "backgroundimagefill", "backgroundline", "backsim", "backslash", "bar", "barleftarrow", "barleftarrowrightarrowbar", "barovernorthwestarrow", "barwedge", "basegrid", "baselinebottom", "baselineleftbox", "baselinemiddlebox", "baselinerightbox", "bbordermatrix", "bbox", "because", "beforesplitstring", "beforetestandsplitstring", "beta", "beth", "between", "bhook", "big", "bigbodyfont", "bigcap", "bigcirc", "bigcircle", "bigcup", "bigdiamond", "bigg", "bigger", "biggl", "biggm", "biggr", "bigl", "bigm", "bigodot", "bigoplus", "bigotimes", "bigr", "bigskip", "bigsqcap", "bigsqcup", "bigsquare", "bigstar", "bigtimes", "bigtriangledown", "bigtriangleup", "bigudot", "biguplus", "bigvee", "bigwedge", "binom", "bitmapimage", "blacklozenge", "blackrule", "blackrules", "blacksquare", "blacktriangle", "blacktriangledown", "blacktriangleleft", "blacktriangleright", "blank", "blap", "bleed", "bleedheight", "bleedwidth", "blockligatures", "blockquote", "blocksynctexfile", "blockuservariable", "bodyfontenvironmentlist", "bodyfontsize", "bold", "boldface", "bolditalic", "boldslanted", "bookmark", "booleanmodevalue", "bordermatrix", "bot", "bottombox", "bottomleftbox", "bottomrightbox", "bowtie", "boxcursor", "boxdot", "boxmarker", "boxminus", "boxofsize", "boxplus", "boxreference", "boxtimes", "bpos", "breakablethinspace", "breakhere", "breve", "bstroke", "btxabbreviatedjournal", "btxaddjournal", "btxalwayscitation", "btxauthorfield", "btxdetail", "btxdirect", "btxdoif", "btxdoifcombiinlistelse", "btxdoifelse", "btxdoifelsecombiinlist", "btxdoifelsesameasprevious", "btxdoifelsesameaspreviouschecked", "btxdoifelseuservariable", "btxdoifnot", "btxdoifsameaspreviouscheckedelse", "btxdoifsameaspreviouselse", "btxdoifuservariableelse", "btxexpandedjournal", "btxfield", "btxfieldname", "btxfieldtype", "btxfirstofrange", "btxflush", "btxflushauthor", "btxflushauthorinverted", "btxflushauthorinvertedshort", "btxflushauthorname", "btxflushauthornormal", "btxflushauthornormalshort", "btxflushsuffix", "btxfoundname", "btxfoundtype", "btxhiddencitation", "btxhybridcite", "btxlabellanguage", "btxlabeltext", "btxlistcitation", "btxloadjournalist", "btxoneorrange", "btxremapauthor", "btxsavejournalist", "btxsetup", "btxsingularorplural", "btxsingularplural", "btxtextcitation", "buildmathaccent", "buildtextaccent", "buildtextbottomcomma", "buildtextbottomdot", "buildtextcedilla", "buildtextgrave", "buildtextmacron", "buildtextognek", "bullet", "button", "cacute", "calligraphic", "camel", "cap", "capital", "carriagereturn", "catcodetablename", "cbox", "ccaron", "ccedilla", "ccircumflex", "ccurl", "cdot", "cdotaccent", "cdotp", "cdots", "centeraligned", "centerbox", "centerdot", "centeredbox", "centeredlastline", "centerednextbox", "centerline", "cfrac", "chapter", "character", "characters", "chardescription", "charwidthlanguage", "check", "checkcharacteralign", "checkedblank", "checkedchar", "checkedfiller", "checkedstrippedcsname", "checkinjector", "checkmark", "checknextindentation", "checknextinjector", "checkpage", "checkparameters", "checkpreviousinjector", "checksoundtrack", "checktwopassdata", "checkvariables", "chem", "chemical", "chemicalbottext", "chemicalmidtext", "chemicalsymbol", "chemicaltext", "chemicaltoptext", "chi", "chineseallnumerals", "chinesecapnumerals", "chinesenumerals", "chook", "circ", "circeq", "circlearrowleft", "circlearrowright", "circledR", "circledS", "circledast", "circledcirc", "circleddash", "circledequals", "circleonrightarrow", "citation", "cite", "clap", "classfont", "cldcommand", "cldcontext", "cldloadfile", "cldprocessfile", "cleftarrow", "clip", "clippedoverlayimage", "clonefield", "clubsuit", "collect", "collectedtext", "collectexpanded", "colon", "coloncolonequals", "colonequals", "color", "colorbar", "colorcomponents", "colored", "coloronly", "colorvalue", "column", "columnbreak", "columnsetspanwidth", "combinepages", "commalistelement", "commalistsentence", "commalistsize", "comment", "comparecolorgroup", "comparedimension", "comparedimensioneps", "comparepalet", "complement", "completebtxrendering", "completecontent", "completeindex", "completelist", "completelistofabbreviations", "completelistofchemicals", "completelistoffigures", "completelistofgraphics", "completelistofintermezzi", "completelistoflogos", "completelistofpublications", "completelistofsorts", "completelistofsynonyms", "completelistoftables", "completepagenumber", "completeregister", "complexes", "complexorsimple", "complexorsimpleempty", "component", "composedcollector", "composedlayer", "compounddiscretionary", "compresult", "cong", "constantdimen", "constantdimenargument", "constantemptyargument", "constantnumber", "constantnumberargument", "contentreference", "continuednumber", "continueifinputfile", "convertargument", "convertcommand", "convertedcounter", "converteddimen", "convertedsubcounter", "convertmonth", "convertnumber", "convertvalue", "convertvboxtohbox", "convolve", "coprod", "copyboxfromcache", "copybtxlabeltext", "copyfield", "copyheadtext", "copylabeltext", "copymathlabeltext", "copyoperatortext", "copypages", "copyparameters", "copyposition", "copyprefixtext", "copyright", "copysetups", "copysuffixtext", "copytaglabeltext", "copyunittext", "correctwhitespace", "countersubs", "counttoken", "counttokens", "cramped", "crampedclap", "crampedllap", "crampedrlap", "crightarrow", "crightoverleftarrow", "crlf", "crlfplaceholder", "crossproduct", "cstroke", "ctop", "ctxcommand", "ctxdirectcommand", "ctxdirectlua", "ctxfunction", "ctxlatecommand", "ctxlatelua", "ctxloadluafile", "ctxlua", "ctxluabuffer", "ctxluacode", "ctxreport", "ctxsprint", "cup", "curlyeqprec", "curlyeqsucc", "curlyvee", "curlywedge", "currentassignmentlistkey", "currentassignmentlistvalue", "currentbtxuservariable", "currentcommalistitem", "currentcomponent", "currentdate", "currentenvironment", "currentfeaturetest", "currentheadnumber", "currentinterface", "currentlanguage", "currentlistentrydestinationattribute", "currentlistentrylimitedtext", "currentlistentrynumber", "currentlistentrypagenumber", "currentlistentryreferenceattribute", "currentlistentrytitle", "currentlistentrytitlerendered", "currentlistsymbol", "currentmainlanguage", "currentmessagetext", "currentmoduleparameter", "currentoutputstream", "currentproduct", "currentproject", "currentregime", "currentregisterpageuserdata", "currentresponses", "currenttime", "currentvalue", "currentxtablecolumn", "currentxtablerow", "curvearrowleft", "curvearrowright", "cwopencirclearrow", "cyrillicA", "cyrillicAE", "cyrillicAbreve", "cyrillicAdiaeresis", "cyrillicB", "cyrillicBIGYUS", "cyrillicBIGYUSiotified", "cyrillicC", "cyrillicCH", "cyrillicCHEDC", "cyrillicCHEDCabkhasian", "cyrillicCHEabkhasian", "cyrillicCHEdiaeresis", "cyrillicCHEkhakassian", "cyrillicCHEvertstroke", "cyrillicD", "cyrillicDASIAPNEUMATA", "cyrillicDJE", "cyrillicDZE", "cyrillicDZEabkhasian", "cyrillicDZHE", "cyrillicE", "cyrillicELtail", "cyrillicEMtail", "cyrillicENDC", "cyrillicENGHE", "cyrillicENhook", "cyrillicENtail", "cyrillicEREV", "cyrillicERY", "cyrillicERtick", "cyrillicEbreve", "cyrillicEdiaeresis", "cyrillicEgrave", "cyrillicEiotified", "cyrillicF", "cyrillicFITA", "cyrillicG", "cyrillicGHEmidhook", "cyrillicGHEstroke", "cyrillicGHEupturn", "cyrillicGJE", "cyrillicH", "cyrillicHA", "cyrillicHADC", "cyrillicHRDSN", "cyrillicI", "cyrillicIE", "cyrillicII", "cyrillicISHRT", "cyrillicISHRTtail", "cyrillicIZHITSA", "cyrillicIZHITSAdoublegrave", "cyrillicIdiaeresis", "cyrillicIgrave", "cyrillicImacron", "cyrillicJE", "cyrillicK", "cyrillicKADC", "cyrillicKAbashkir", "cyrillicKAhook", "cyrillicKAstroke", "cyrillicKAvertstroke", "cyrillicKJE", "cyrillicKOPPA", "cyrillicKSI", "cyrillicL", "cyrillicLITTLEYUS", "cyrillicLITTLEYUSiotified", "cyrillicLJE", "cyrillicM", "cyrillicN", "cyrillicNJE", "cyrillicO", "cyrillicOMEGA", "cyrillicOMEGAround", "cyrillicOMEGAtitlo", "cyrillicOT", "cyrillicObarred", "cyrillicObarreddiaeresis", "cyrillicOdiaeresis", "cyrillicP", "cyrillicPALATALIZATION", "cyrillicPALOCHKA", "cyrillicPEmidhook", "cyrillicPSI", "cyrillicPSILIPNEUMATA", "cyrillicR", "cyrillicS", "cyrillicSCHWA", "cyrillicSCHWAdiaeresis", "cyrillicSDSC", "cyrillicSEMISOFT", "cyrillicSFTSN", "cyrillicSH", "cyrillicSHCH", "cyrillicSHHA", "cyrillicT", "cyrillicTEDC", "cyrillicTETSE", "cyrillicTITLO", "cyrillicTSHE", "cyrillicU", "cyrillicUK", "cyrillicUSHRT", "cyrillicUdiaeresis", "cyrillicUdoubleacute", "cyrillicUmacron", "cyrillicV", "cyrillicYA", "cyrillicYAT", "cyrillicYERUdiaeresis", "cyrillicYI", "cyrillicYO", "cyrillicYU", "cyrillicYstr", "cyrillicYstrstroke", "cyrillicZ", "cyrillicZDSC", "cyrillicZEdiaeresis", "cyrillicZH", "cyrillicZHEbreve", "cyrillicZHEdescender", "cyrillicZHEdiaeresis", "cyrillica", "cyrillicabreve", "cyrillicadiaeresis", "cyrillicae", "cyrillicb", "cyrillicbigyus", "cyrillicbigyusiotified", "cyrillicc", "cyrillicch", "cyrilliccheabkhasian", "cyrillicchedc", "cyrillicchedcabkhasian", "cyrillicchediaeresis", "cyrillicchekhakassian", "cyrillicchevertstroke", "cyrillicd", "cyrillicdje", "cyrillicdze", "cyrillicdzeabkhasian", "cyrillicdzhe", "cyrillice", "cyrillicebreve", "cyrillicediaeresis", "cyrillicegrave", "cyrilliceiotified", "cyrilliceltail", "cyrillicemtail", "cyrillicendc", "cyrillicenghe", "cyrillicenhook", "cyrillicentail", "cyrillicerev", "cyrillicertick", "cyrillicery", "cyrillicf", "cyrillicfita", "cyrillicg", "cyrillicghemidhook", "cyrillicghestroke", "cyrillicgheupturn", "cyrillicgje", "cyrillich", "cyrillicha", "cyrillichadc", "cyrillichrdsn", "cyrillici", "cyrillicidiaeresis", "cyrillicie", "cyrillicigrave", "cyrillicii", "cyrillicimacron", "cyrillicishrt", "cyrillicishrttail", "cyrillicizhitsa", "cyrillicizhitsadoublegrave", "cyrillicje", "cyrillick", "cyrillickabashkir", "cyrillickadc", "cyrillickahook", "cyrillickastroke", "cyrillickavertstroke", "cyrillickje", "cyrillickoppa", "cyrillicksi", "cyrillicl", "cyrilliclittleyus", "cyrilliclittleyusiotified", "cyrilliclje", "cyrillicm", "cyrillicn", "cyrillicnje", "cyrillico", "cyrillicobarred", "cyrillicobarreddiaeresis", "cyrillicodiaeresis", "cyrillicomega", "cyrillicomegaround", "cyrillicomegatitlo", "cyrillicot", "cyrillicp", "cyrillicpemidhook", "cyrillicpsi", "cyrillicr", "cyrillics", "cyrillicschwa", "cyrillicschwadiaeresis", "cyrillicsdsc", "cyrillicsemisoft", "cyrillicsftsn", "cyrillicsh", "cyrillicshch", "cyrillicshha", "cyrillict", "cyrillictedc", "cyrillictetse", "cyrillictshe", "cyrillicu", "cyrillicudiaeresis", "cyrillicudoubleacute", "cyrillicuk", "cyrillicumacron", "cyrillicushrt", "cyrillicv", "cyrillicya", "cyrillicyat", "cyrillicyerudiaeresis", "cyrillicyi", "cyrillicyo", "cyrillicystr", "cyrillicystrstroke", "cyrillicyu", "cyrillicz", "cyrilliczdsc", "cyrilliczediaeresis", "cyrilliczh", "cyrilliczhebreve", "cyrilliczhedescender", "cyrilliczhediaeresis", "d", "dag", "dagger", "daleth", "dasharrow", "dashedleftarrow", "dashedrightarrow", "dashv", "datasetvariable", "date", "daylong", "dayoftheweek", "dayshort", "dayspermonth", "dbinom", "dcaron", "dcurl", "ddag", "ddagger", "dddot", "ddot", "ddots", "decrement", "decrementcounter", "decrementedcounter", "decrementpagenumber", "decrementsubpagenumber", "decrementvalue", "defaultinterface", "defaultobjectpage", "defaultobjectreference", "defcatcodecommand", "defconvertedargument", "defconvertedcommand", "defconvertedvalue", "define", "defineMPinstance", "defineTABLEsetup", "defineaccent", "defineactivecharacter", "definealternativestyle", "defineanchor", "defineattachment", "defineattribute", "definebackground", "definebar", "defineblock", "definebodyfont", "definebodyfontenvironment", "definebodyfontswitch", "definebreakpoint", "definebreakpoints", "definebtx", "definebtxdataset", "definebtxregister", "definebtxrendering", "definebuffer", "definebutton", "definecapitals", "definecharacter", "definecharacterkerning", "definecharacterspacing", "definechemical", "definechemicals", "definechemicalsymbol", "definecollector", "definecolor", "definecolorgroup", "definecolumnbreak", "definecolumnset", "definecolumnsetarea", "definecolumnsetspan", "definecombination", "definecombinedlist", "definecommand", "definecomment", "definecomplexorsimple", "definecomplexorsimpleempty", "defineconversion", "defineconversionset", "definecounter", "definedataset", "definedate", "definedelimitedtext", "definedeq", "definedescription", "definedfont", "definedocument", "defineeffect", "defineenumeration", "defineexpandable", "defineexpansion", "defineexternalfigure", "definefacingfloat", "definefallbackfamily", "definefield", "definefieldbody", "definefieldbodyset", "definefieldcategory", "definefieldstack", "definefiguresymbol", "definefileconstant", "definefilefallback", "definefilesynonym", "definefiller", "definefirstline", "definefittingpage", "definefloat", "definefont", "definefontalternative", "definefontfallback", "definefontfamily", "definefontfamilypreset", "definefontfeature", "definefontfile", "definefontsize", "definefontsolution", "definefontstyle", "definefontsynonym", "defineformula", "defineformulaalternative", "defineformulaframed", "defineframed", "defineframedcontent", "defineframedtable", "defineframedtext", "definefrozenfont", "defineglobalcolor", "definegraphictypesynonym", "definegridsnapping", "definehbox", "definehead", "defineheadalternative", "definehelp", "definehigh", "definehighlight", "definehspace", "definehyphenationfeatures", "defineindentedtext", "defineindenting", "defineinitial", "defineinsertion", "defineinteraction", "defineinteractionbar", "defineinteractionmenu", "defineinterfaceconstant", "defineinterfaceelement", "defineinterfacevariable", "defineinterlinespace", "defineintermediatecolor", "defineitemgroup", "defineitems", "definelabel", "definelabelclass", "definelayer", "definelayerpreset", "definelayout", "definelinefiller", "definelinenote", "definelinenumbering", "definelines", "definelist", "definelistalternative", "definelistextra", "definelow", "definelowhigh", "definelowmidhigh", "definemakeup", "definemarginblock", "definemargindata", "definemarker", "definemarking", "definemathaccent", "definemathalignment", "definemathcases", "definemathcommand", "definemathdouble", "definemathdoubleextensible", "definemathematics", "definemathextensible", "definemathfence", "definemathfraction", "definemathframed", "definemathmatrix", "definemathornament", "definemathover", "definemathoverextensible", "definemathovertextextensible", "definemathradical", "definemathstackers", "definemathstyle", "definemathtriplet", "definemathunder", "definemathunderextensible", "definemathundertextextensible", "definemathunstacked", "definemeasure", "definemessageconstant", "definemixedcolumns", "definemode", "definemulticolumns", "definemultitonecolor", "definenamedcolor", "definenamespace", "definenarrower", "definenote", "defineorientation", "defineornament", "defineoutputroutine", "defineoutputroutinecommand", "defineoverlay", "definepage", "definepagebreak", "definepagechecker", "definepagecolumns", "definepageinjection", "definepageinjectionalternative", "definepageshift", "definepagestate", "definepairedbox", "definepalet", "definepapersize", "defineparagraph", "defineparagraphs", "defineparallel", "defineparbuilder", "defineperiodkerning", "defineplaceholder", "defineplacement", "definepositioning", "defineprefixset", "defineprocesscolor", "defineprocessor", "defineprofile", "defineprogram", "definepushbutton", "definepushsymbol", "definereference", "definereferenceformat", "defineregister", "definerenderingwindow", "defineresetset", "defineruby", "definescale", "definescript", "definesection", "definesectionblock", "definesectionlevels", "defineselector", "defineseparatorset", "defineshift", "definesidebar", "definesort", "definesorting", "definespotcolor", "definestartstop", "definestyle", "definestyleinstance", "definesubfield", "definesubformula", "definesymbol", "definesynonym", "definesynonyms", "definesystemattribute", "definesystemconstant", "definesystemvariable", "definetabletemplate", "definetabulate", "definetext", "definetextbackground", "definetextflow", "definetextnote", "definetokenlist", "definetooltip", "definetransparency", "definetwopasslist", "definetype", "definetypeface", "definetypescriptprefix", "definetypescriptsynonym", "definetypesetting", "definetyping", "defineunit", "defineuserdata", "defineuserdataalternative", "defineviewerlayer", "definevspace", "definevspacing", "definevspacingamount", "definextable", "defrostparagraphproperties", "delimited", "delimitedtext", "delta", "depthofstring", "depthonlybox", "depthspanningtext", "depthstrut", "derivativesymbol", "determineheadnumber", "determinelistcharacteristics", "determinenoflines", "determineregistercharacteristics", "devanagarinumerals", "dfrac", "dhook", "diameter", "diamond", "diamondsuit", "differentialD", "differentiald", "digamma", "digits", "dimensiontocount", "directboxfromcache", "directcolor", "directcolored", "directconvertedcounter", "directcopyboxfromcache", "directdummyparameter", "directgetboxllx", "directgetboxlly", "directhighlight", "directlocalframed", "directluacode", "directparwrapper", "directselect", "directsetbar", "directsetup", "directsymbol", "directvspacing", "dis", "disabledirectives", "disableexperiments", "disablemode", "disableoutputstream", "disableparpositions", "disableregime", "disabletrackers", "displaymath", "displaymathematics", "displaymessage", "disposeluatable", "distributedhsize", "div", "dividedsize", "divideontimes", "divides", "doadaptleftskip", "doadaptrightskip", "doaddfeature", "doassign", "doassignempty", "doboundtext", "docheckassignment", "docheckedpair", "documentvariable", "dodoubleargument", "dodoubleargumentwithset", "dodoubleempty", "dodoubleemptywithset", "dodoublegroupempty", "doeassign", "doexpandedrecurse", "dofastloopcs", "dogetattribute", "dogetattributeid", "dogetcommacommandelement", "dogobbledoubleempty", "dogobblesingleempty", "dohyphens", "doif", "doifMPgraphicelse", "doifallcommon", "doifallcommonelse", "doifalldefinedelse", "doifallmodes", "doifallmodeselse", "doifassignmentelse", "doifassignmentelsecs", "doifblackelse", "doifbothsides", "doifbothsidesoverruled", "doifboxelse", "doifbufferelse", "doifcheckedpagestate", "doifcolor", "doifcolorelse", "doifcommandhandler", "doifcommandhandlerelse", "doifcommon", "doifcommonelse", "doifcontent", "doifconversiondefinedelse", "doifconversionnumberelse", "doifcounter", "doifcounterelse", "doifcurrentfonthasfeatureelse", "doifdefined", "doifdefinedcounter", "doifdefinedcounterelse", "doifdefinedelse", "doifdimensionelse", "doifdimenstringelse", "doifdocumentargument", "doifdocumentargumentelse", "doifdocumentfilename", "doifdocumentfilenameelse", "doifdocumentvariable", "doifdocumentvariableelse", "doifdrawingblackelse", "doifelse", "doifelseMPgraphic", "doifelseallcommon", "doifelsealldefined", "doifelseallmodes", "doifelseassignment", "doifelseassignmentcs", "doifelseblack", "doifelsebox", "doifelseboxincache", "doifelsebuffer", "doifelsecolor", "doifelsecommandhandler", "doifelsecommon", "doifelseconversiondefined", "doifelseconversionnumber", "doifelsecounter", "doifelsecurrentfonthasfeature", "doifelsecurrentsortingused", "doifelsecurrentsynonymshown", "doifelsecurrentsynonymused", "doifelsedefined", "doifelsedefinedcounter", "doifelsedimension", "doifelsedimenstring", "doifelsedocumentargument", "doifelsedocumentfilename", "doifelsedocumentvariable", "doifelsedrawingblack", "doifelseempty", "doifelseemptyvalue", "doifelseemptyvariable", "doifelseenv", "doifelsefastoptionalcheck", "doifelsefastoptionalcheckcs", "doifelsefieldbody", "doifelsefieldcategory", "doifelsefigure", "doifelsefile", "doifelsefiledefined", "doifelsefileexists", "doifelsefirstchar", "doifelseflagged", "doifelsefontchar", "doifelsefontfeature", "doifelsefontpresent", "doifelsefontsynonym", "doifelseframed", "doifelsehasspace", "doifelsehelp", "doifelseincsname", "doifelseindented", "doifelseinelement", "doifelseinputfile", "doifelseinsertion", "doifelseinset", "doifelseinstring", "doifelseinsymbolset", "doifelseintoks", "doifelseintwopassdata", "doifelseitalic", "doifelselanguage", "doifelselayerdata", "doifelselayoutdefined", "doifelselayoutsomeline", "doifelselayouttextline", "doifelseleapyear", "doifelselist", "doifelselocation", "doifelselocfile", "doifelsemainfloatbody", "doifelsemarkedcontent", "doifelsemarkedpage", "doifelsemarking", "doifelsemeaning", "doifelsemessage", "doifelsemode", "doifelsenextbgroup", "doifelsenextbgroupcs", "doifelsenextchar", "doifelsenextoptional", "doifelsenextoptionalcs", "doifelsenextparenthesis", "doifelsenonzeropositive", "doifelsenoteonsamepage", "doifelsenothing", "doifelsenumber", "doifelseobjectfound", "doifelseobjectreferencefound", "doifelseoddpage", "doifelseoddpagefloat", "doifelseoldercontext", "doifelseolderversion", "doifelseorientation", "doifelseoverlapping", "doifelseoverlay", "doifelseparallel", "doifelseparentfile", "doifelseparwrapper", "doifelsepath", "doifelsepathexists", "doifelsepatterns", "doifelseposition", "doifelsepositionaction", "doifelsepositiononpage", "doifelsepositionsonsamepage", "doifelsepositionsonthispage", "doifelsepositionsused", "doifelsereferencefound", "doifelserightpage", "doifelserightpagefloat", "doifelserighttoleftinbox", "doifelsesamelinereference", "doifelsesamestring", "doifelsesetups", "doifelsesomebackground", "doifelsesomespace", "doifelsesomething", "doifelsesometoks", "doifelsestringinstring", "doifelsestructurelisthasnumber", "doifelsestructurelisthaspage", "doifelsesymboldefined", "doifelsesymbolset", "doifelsetext", "doifelsetextflow", "doifelsetextflowcollector", "doifelsetopofpage", "doifelsetypingfile", "doifelseundefined", "doifelseurldefined", "doifelsevalue", "doifelsevaluenothing", "doifelsevariable", "doifempty", "doifemptyelse", "doifemptytoks", "doifemptyvalue", "doifemptyvalueelse", "doifemptyvariable", "doifemptyvariableelse", "doifenv", "doifenvelse", "doiffastoptionalcheckcselse", "doiffastoptionalcheckelse", "doiffieldbodyelse", "doiffieldcategoryelse", "doiffigureelse", "doiffile", "doiffiledefinedelse", "doiffileelse", "doiffileexistselse", "doiffirstcharelse", "doifflaggedelse", "doiffontcharelse", "doiffontfeatureelse", "doiffontpresentelse", "doiffontsynonymelse", "doifhasspaceelse", "doifhelpelse", "doifincsnameelse", "doifinelementelse", "doifinputfileelse", "doifinsertionelse", "doifinset", "doifinsetelse", "doifinstring", "doifinstringelse", "doifinsymbolset", "doifinsymbolsetelse", "doifintokselse", "doifintwopassdataelse", "doifitalicelse", "doiflanguageelse", "doiflayerdataelse", "doiflayoutdefinedelse", "doiflayoutsomelineelse", "doiflayouttextlineelse", "doifleapyearelse", "doiflistelse", "doiflocationelse", "doiflocfileelse", "doifmainfloatbodyelse", "doifmarkingelse", "doifmeaningelse", "doifmessageelse", "doifmode", "doifmodeelse", "doifnextbgroupcselse", "doifnextbgroupelse", "doifnextcharelse", "doifnextoptionalcselse", "doifnextoptionalelse", "doifnextparenthesiselse", "doifnonzeropositiveelse", "doifnot", "doifnotallcommon", "doifnotallmodes", "doifnotcommandhandler", "doifnotcommon", "doifnotcounter", "doifnotdocumentargument", "doifnotdocumentfilename", "doifnotdocumentvariable", "doifnotempty", "doifnotemptyvalue", "doifnotemptyvariable", "doifnotenv", "doifnoteonsamepageelse", "doifnotescollected", "doifnotfile", "doifnotflagged", "doifnothing", "doifnothingelse", "doifnotinset", "doifnotinsidesplitfloat", "doifnotinstring", "doifnotmode", "doifnotnumber", "doifnotsamestring", "doifnotsetups", "doifnotvalue", "doifnotvariable", "doifnumber", "doifnumberelse", "doifobjectfoundelse", "doifobjectreferencefoundelse", "doifoddpageelse", "doifoddpagefloatelse", "doifoldercontextelse", "doifolderversionelse", "doifoutervmode", "doifoverlappingelse", "doifoverlayelse", "doifparallelelse", "doifparentfileelse", "doifpathelse", "doifpathexistselse", "doifpatternselse", "doifposition", "doifpositionaction", "doifpositionactionelse", "doifpositionelse", "doifpositiononpageelse", "doifpositionsonsamepageelse", "doifpositionsonthispageelse", "doifpositionsusedelse", "doifreferencefoundelse", "doifrightpageelse", "doifrightpagefloatelse", "doifrighttoleftinboxelse", "doifsamelinereferenceelse", "doifsamestring", "doifsamestringelse", "doifsetups", "doifsetupselse", "doifsomebackground", "doifsomebackgroundelse", "doifsomespaceelse", "doifsomething", "doifsomethingelse", "doifsometoks", "doifsometokselse", "doifstringinstringelse", "doifstructurelisthasnumberelse", "doifstructurelisthaspageelse", "doifsymboldefinedelse", "doifsymbolsetelse", "doiftext", "doiftextelse", "doiftextflowcollectorelse", "doiftextflowelse", "doiftopofpageelse", "doiftypingfileelse", "doifundefined", "doifundefinedcounter", "doifundefinedelse", "doifunknownfontfeature", "doifurldefinedelse", "doifvalue", "doifvalueelse", "doifvaluenothing", "doifvaluenothingelse", "doifvaluesomething", "doifvariable", "doifvariableelse", "doindentation", "dollar", "doloop", "doloopoverlist", "donothing", "dontconvertfont", "dontleavehmode", "dontpermitspacesbetweengroups", "dopositionaction", "doprocesslocalsetups", "doquadrupleargument", "doquadrupleempty", "doquadruplegroupempty", "doquintupleargument", "doquintupleempty", "doquintuplegroupempty", "dorechecknextindentation", "dorecurse", "dorepeatwithcommand", "doreplacefeature", "doresetandafffeature", "doresetattribute", "dorotatebox", "dosetattribute", "dosetleftskipadaption", "dosetrightskipadaption", "dosetupcheckedinterlinespace", "doseventupleargument", "doseventupleempty", "dosingleargument", "dosingleempty", "dosinglegroupempty", "dosixtupleargument", "dosixtupleempty", "dosomebreak", "dostepwiserecurse", "dosubtractfeature", "dot", "doteq", "doteqdot", "dotfill", "dotfskip", "dotlessI", "dotlessJ", "dotlessi", "dotlessj", "dotlessjstroke", "dotminus", "dotoks", "dotplus", "dotripleargument", "dotripleargumentwithset", "dotripleempty", "dotripleemptywithset", "dotriplegroupempty", "dots", "dottedcircle", "dottedrightarrow", "doublebar", "doublebond", "doublebrace", "doublebracket", "doublecap", "doublecup", "doubleparent", "doubleprime", "doubleverticalbar", "dowith", "dowithnextbox", "dowithnextboxcontent", "dowithnextboxcontentcs", "dowithnextboxcs", "dowithpargument", "dowithrange", "dowithwargument", "downarrow", "downdasharrow", "downdownarrows", "downharpoonleft", "downharpoonright", "downuparrows", "downwhitearrow", "downzigzagarrow", "dpofstring", "dstroke", "dtail", "dummydigit", "dummyparameter", "dzcaronligature", "dzligature", "eTeX", "eacute", "ebreve", "ecaron", "ecedilla", "ecircumflex", "ecircumflexacute", "ecircumflexdotbelow", "ecircumflexgrave", "ecircumflexhook", "ecircumflextilde", "edefconvertedargument", "ediaeresis", "edotaccent", "edotbelow", "edoublegrave", "ee", "efcmaxheight", "efcmaxwidth", "efcminheight", "efcminwidth", "efcparameter", "effect", "egrave", "ehook", "einvertedbreve", "elapsedseconds", "elapsedsteptime", "elapsedtime", "eleftarrowfill", "eleftharpoondownfill", "eleftharpoonupfill", "eleftrightarrowfill", "ell", "em", "emacron", "emdash", "emphasisboldface", "emphasistypeface", "emptylines", "emptyset", "emquad", "emspace", "enableasciimode", "enabledirectives", "enableexperiments", "enablemode", "enableoutputstream", "enableparpositions", "enableregime", "enabletrackers", "endash", "endnote", "enquad", "enskip", "enspace", "env", "environment", "envvar", "eogonek", "eoverbarfill", "eoverbracefill", "eoverbracketfill", "eoverparentfill", "epos", "epsilon", "eq", "eqcirc", "eqeq", "eqeqeq", "eqgtr", "eqless", "eqsim", "eqslantgtr", "eqslantless", "equaldigits", "equalscolon", "equiv", "erightarrowfill", "erightharpoondownfill", "erightharpoonupfill", "eta", "eth", "ethiopic", "etilde", "etwoheadrightarrowfill", "eunderbarfill", "eunderbracefill", "eunderbracketfill", "eunderparentfill", "exclamdown", "executeifdefined", "exists", "exitloop", "exitloopnow", "expandcheckedcsname", "expanded", "expandeddoif", "expandeddoifelse", "expandeddoifnot", "expandfontsynonym", "expdoif", "expdoifcommonelse", "expdoifelse", "expdoifelsecommon", "expdoifelseinset", "expdoifinsetelse", "expdoifnot", "exponentiale", "externalfigure", "externalfigurecollectionmaxheight", "externalfigurecollectionmaxwidth", "externalfigurecollectionminheight", "externalfigurecollectionminwidth", "externalfigurecollectionparameter", "fakebox", "fallingdotseq", "fastdecrement", "fastincrement", "fastlocalframed", "fastloopfinal", "fastloopindex", "fastscale", "fastsetup", "fastsetupwithargument", "fastsetupwithargumentswapped", "fastswitchtobodyfont", "fastsxsy", "feature", "fence", "fenced", "fetchallmarkings", "fetchallmarks", "fetchmark", "fetchmarking", "fetchonemark", "fetchonemarking", "fetchruntinecommand", "fetchtwomarkings", "fetchtwomarks", "ffiligature", "ffligature", "fflligature", "fhook", "field", "fieldbody", "fieldstack", "fifthoffivearguments", "fifthofsixarguments", "figuredash", "figurefilename", "figurefilepath", "figurefiletype", "figurefullname", "figureheight", "figurenaturalheight", "figurenaturalwidth", "figurespace", "figuresymbol", "figurewidth", "filename", "filigature", "filledhboxb", "filledhboxc", "filledhboxg", "filledhboxk", "filledhboxm", "filledhboxr", "filledhboxy", "filler", "fillinline", "fillinrules", "fillintext", "fillupto", "filterfromnext", "filterfromvalue", "filterpages", "filterreference", "findtwopassdata", "finishregisterentry", "firstcharacter", "firstcounter", "firstcountervalue", "firstinlist", "firstoffivearguments", "firstoffourarguments", "firstofoneargument", "firstofoneunexpanded", "firstofsixarguments", "firstofthreearguments", "firstofthreeunexpanded", "firstoftwoarguments", "firstoftwounexpanded", "firstrealpage", "firstrealpagenumber", "firstsubcountervalue", "firstsubpage", "firstsubpagenumber", "firstuserpage", "firstuserpagenumber", "fitfield", "fitfieldframed", "fittopbaselinegrid", "fiveeighths", "fivesixths", "fixedspace", "fixedspaces", "flag", "flat", "flligature", "floatuserdataparameter", "flushbox", "flushboxregister", "flushcollector", "flushedrightlastline", "flushlayer", "flushlocalfloats", "flushnextbox", "flushnotes", "flushoutputstream", "flushshapebox", "flushtextflow", "flushtokens", "flushtoks", "fontalternative", "fontbody", "fontchar", "fontcharbyindex", "fontclass", "fontclassname", "fontface", "fontfeaturelist", "fontsize", "fontstyle", "footnote", "footnotetext", "forall", "forcecharacterstripping", "forcelocalfloats", "forgeteverypar", "forgetparagraphfreezing", "forgetparameters", "forgetparskip", "forgetparwrapper", "forgetragged", "formula", "formulanumber", "foundbox", "fourfifths", "fourperemspace", "fourthderivativesymbol", "fourthoffivearguments", "fourthoffourarguments", "fourthofsixarguments", "frac", "framed", "frameddimension", "framedparameter", "framedtext", "freezedimenmacro", "freezemeasure", "freezeparagraphproperties", "frenchspacing", "from", "fromlinenote", "frown", "frozenhbox", "frule", "gacute", "gamma", "gbreve", "gcaron", "gcircumflex", "gcommaaccent", "gdefconvertedargument", "gdefconvertedcommand", "gdotaccent", "ge", "geq", "geqq", "geqslant", "getMPdrawing", "getMPlayer", "getboxfromcache", "getboxllx", "getboxlly", "getbuffer", "getbufferdata", "getcommacommandsize", "getcommalistsize", "getdatavalue", "getdayoftheweek", "getdayspermonth", "getdefinedbuffer", "getdocumentargument", "getdocumentargumentdefault", "getdocumentfilename", "getdummyparameters", "getemptyparameters", "geteparameters", "getexpandedparameters", "getfiguredimensions", "getfirstcharacter", "getfirsttwopassdata", "getfromcommacommand", "getfromcommalist", "getfromluatable", "getfromtwopassdata", "getglyphdirect", "getglyphstyled", "getgparameters", "getinlineuserdata", "getlasttwopassdata", "getlocalfloat", "getlocalfloats", "getmarking", "getmessage", "getnamedglyphdirect", "getnamedglyphstyled", "getnamedtwopassdatalist", "getnaturaldimensions", "getnoflines", "getobject", "getobjectdimensions", "getpaletsize", "getparameters", "getparwrapper", "getprivatechar", "getprivateslot", "getrandomcount", "getrandomdimen", "getrandomfloat", "getrandomnumber", "getrandomseed", "getraweparameters", "getrawgparameters", "getrawnoflines", "getrawparameters", "getrawxparameters", "getreference", "getreferenceentry", "getroundednoflines", "gets", "getsubstring", "gettokenlist", "gettwopassdata", "gettwopassdatalist", "getuserdata", "getuvalue", "getvalue", "getvariable", "getvariabledefault", "getxparameters", "gg", "ggg", "gggtr", "gimel", "globaldisablemode", "globalenablemode", "globalletempty", "globalpopbox", "globalpopmacro", "globalpreventmode", "globalprocesscommalist", "globalpushbox", "globalpushmacro", "globalswapcounts", "globalswapdimens", "globalswapmacros", "globalundefine", "glyphfontfile", "gnapprox", "gneqq", "gnsim", "gobbledoubleempty", "gobbleeightarguments", "gobblefivearguments", "gobblefiveoptionals", "gobblefourarguments", "gobblefouroptionals", "gobbleninearguments", "gobbleoneargument", "gobbleoneoptional", "gobblesevenarguments", "gobblesingleempty", "gobblesixarguments", "gobblespacetokens", "gobbletenarguments", "gobblethreearguments", "gobblethreeoptionals", "gobbletwoarguments", "gobbletwooptionals", "gobbleuntil", "gobbleuntilrelax", "godown", "goto", "gotobox", "gotopage", "grabbufferdata", "grabbufferdatadirect", "grabuntil", "gradient", "grave", "graycolor", "grayvalue", "greedysplitstring", "greekAlpha", "greekAlphadasia", "greekAlphadasiaperispomeni", "greekAlphadasiatonos", "greekAlphadasiavaria", "greekAlphaiotasub", "greekAlphaiotasubdasia", "greekAlphaiotasubdasiaperispomeni", "greekAlphaiotasubdasiatonos", "greekAlphaiotasubdasiavaria", "greekAlphaiotasubpsili", "greekAlphaiotasubpsiliperispomeni", "greekAlphaiotasubpsilitonos", "greekAlphaiotasubpsilivaria", "greekAlphamacron", "greekAlphapsili", "greekAlphapsiliperispomeni", "greekAlphapsilitonos", "greekAlphapsilivaria", "greekAlphatonos", "greekAlphavaria", "greekAlphavrachy", "greekBeta", "greekChi", "greekCoronis", "greekDelta", "greekEpsilon", "greekEpsilondasia", "greekEpsilondasiatonos", "greekEpsilondasiavaria", "greekEpsilonpsili", "greekEpsilonpsilitonos", "greekEpsilonpsilivaria", "greekEpsilontonos", "greekEpsilonvaria", "greekEta", "greekEtadasia", "greekEtadasiaperispomeni", "greekEtadasiatonos", "greekEtadasiavaria", "greekEtaiotasub", "greekEtaiotasubdasia", "greekEtaiotasubdasiaperispomeni", "greekEtaiotasubdasiatonos", "greekEtaiotasubdasiavaria", "greekEtaiotasubpsili", "greekEtaiotasubpsiliperispomeni", "greekEtaiotasubpsilitonos", "greekEtaiotasubpsilivaria", "greekEtapsili", "greekEtapsiliperispomeni", "greekEtapsilitonos", "greekEtapsilivaria", "greekEtatonos", "greekEtavaria", "greekGamma", "greekIota", "greekIotadasia", "greekIotadasiaperispomeni", "greekIotadasiatonos", "greekIotadasiavaria", "greekIotadialytika", "greekIotamacron", "greekIotapsili", "greekIotapsiliperispomeni", "greekIotapsilitonos", "greekIotapsilivaria", "greekIotatonos", "greekIotavaria", "greekIotavrachy", "greekKappa", "greekLambda", "greekMu", "greekNu", "greekOmega", "greekOmegadasia", "greekOmegadasiaperispomeni", "greekOmegadasiatonos", "greekOmegadasiavaria", "greekOmegaiotasub", "greekOmegaiotasubdasia", "greekOmegaiotasubdasiaperispomeni", "greekOmegaiotasubdasiatonos", "greekOmegaiotasubdasiavaria", "greekOmegaiotasubpsili", "greekOmegaiotasubpsiliperispomeni", "greekOmegaiotasubpsilitonos", "greekOmegaiotasubpsilivaria", "greekOmegapsili", "greekOmegapsiliperispomeni", "greekOmegapsilitonos", "greekOmegapsilivaria", "greekOmegatonos", "greekOmegavaria", "greekOmicron", "greekOmicrondasia", "greekOmicrondasiatonos", "greekOmicrondasiavaria", "greekOmicronpsili", "greekOmicronpsilitonos", "greekOmicronpsilivaria", "greekOmicrontonos", "greekOmicronvaria", "greekPhi", "greekPi", "greekPsi", "greekRho", "greekRhodasia", "greekSigma", "greekSigmalunate", "greekTau", "greekTheta", "greekUpsilon", "greekUpsilondasia", "greekUpsilondasiaperispomeni", "greekUpsilondasiatonos", "greekUpsilondasiavaria", "greekUpsilondialytika", "greekUpsilonmacron", "greekUpsilontonos", "greekUpsilonvaria", "greekUpsilonvrachy", "greekXi", "greekZeta", "greekalpha", "greekalphadasia", "greekalphadasiaperispomeni", "greekalphadasiatonos", "greekalphadasiavaria", "greekalphaiotasub", "greekalphaiotasubdasia", "greekalphaiotasubdasiaperispomeni", "greekalphaiotasubdasiatonos", "greekalphaiotasubdasiavaria", "greekalphaiotasubperispomeni", "greekalphaiotasubpsili", "greekalphaiotasubpsiliperispomeni", "greekalphaiotasubpsilitonos", "greekalphaiotasubpsilivaria", "greekalphaiotasubtonos", "greekalphaiotasubvaria", "greekalphamacron", "greekalphaoxia", "greekalphaperispomeni", "greekalphapsili", "greekalphapsiliperispomeni", "greekalphapsilitonos", "greekalphapsilivaria", "greekalphatonos", "greekalphavaria", "greekalphavrachy", "greekbeta", "greekbetaalt", "greekchi", "greekdasia", "greekdasiaperispomeni", "greekdasiavaria", "greekdelta", "greekdialytikaperispomeni", "greekdialytikatonos", "greekdialytikavaria", "greekdigamma", "greekepsilon", "greekepsilonalt", "greekepsilondasia", "greekepsilondasiatonos", "greekepsilondasiavaria", "greekepsilonoxia", "greekepsilonpsili", "greekepsilonpsilitonos", "greekepsilonpsilivaria", "greekepsilontonos", "greekepsilonvaria", "greeketa", "greeketadasia", "greeketadasiaperispomeni", "greeketadasiatonos", "greeketadasiavaria", "greeketaiotasub", "greeketaiotasubdasia", "greeketaiotasubdasiaperispomeni", "greeketaiotasubdasiatonos", "greeketaiotasubdasiavaria", "greeketaiotasubperispomeni", "greeketaiotasubpsili", "greeketaiotasubpsiliperispomeni", "greeketaiotasubpsilitonos", "greeketaiotasubpsilivaria", "greeketaiotasubtonos", "greeketaiotasubvaria", "greeketaoxia", "greeketaperispomeni", "greeketapsili", "greeketapsiliperispomeni", "greeketapsilitonos", "greeketapsilivaria", "greeketatonos", "greeketavaria", "greekfinalsigma", "greekgamma", "greekiota", "greekiotadasia", "greekiotadasiaperispomeni", "greekiotadasiatonos", "greekiotadasiavaria", "greekiotadialytika", "greekiotadialytikaperispomeni", "greekiotadialytikatonos", "greekiotadialytikavaria", "greekiotamacron", "greekiotaoxia", "greekiotaperispomeni", "greekiotapsili", "greekiotapsiliperispomeni", "greekiotapsilitonos", "greekiotapsilivaria", "greekiotatonos", "greekiotavaria", "greekiotavrachy", "greekkappa", "greekkoppa", "greeklambda", "greekmu", "greeknu", "greeknumerals", "greeknumkoppa", "greekomega", "greekomegadasia", "greekomegadasiaperispomeni", "greekomegadasiatonos", "greekomegadasiavaria", "greekomegaiotasub", "greekomegaiotasubdasia", "greekomegaiotasubdasiaperispomeni", "greekomegaiotasubdasiatonos", "greekomegaiotasubdasiavaria", "greekomegaiotasubperispomeni", "greekomegaiotasubpsili", "greekomegaiotasubpsiliperispomeni", "greekomegaiotasubpsilitonos", "greekomegaiotasubpsilivaria", "greekomegaiotasubtonos", "greekomegaiotasubvaria", "greekomegaoxia", "greekomegaperispomeni", "greekomegapsili", "greekomegapsiliperispomeni", "greekomegapsilitonos", "greekomegapsilivaria", "greekomegatonos", "greekomegavaria", "greekomicron", "greekomicrondasia", "greekomicrondasiatonos", "greekomicrondasiavaria", "greekomicronoxia", "greekomicronpsili", "greekomicronpsilitonos", "greekomicronpsilivaria", "greekomicrontonos", "greekomicronvaria", "greekoxia", "greekperispomeni", "greekphi", "greekphialt", "greekpi", "greekpialt", "greekprosgegrammeni", "greekpsi", "greekpsili", "greekpsiliperispomeni", "greekpsilivaria", "greekrho", "greekrhoalt", "greekrhodasia", "greekrhopsili", "greeksampi", "greeksigma", "greeksigmalunate", "greekstigma", "greektau", "greektheta", "greekthetaalt", "greektonos", "greekupsilon", "greekupsilondasia", "greekupsilondasiaperispomeni", "greekupsilondasiatonos", "greekupsilondasiavaria", "greekupsilondiaeresis", "greekupsilondialytikaperispomeni", "greekupsilondialytikatonos", "greekupsilondialytikavaria", "greekupsilonmacron", "greekupsilonoxia", "greekupsilonperispomeni", "greekupsilonpsili", "greekupsilonpsiliperispomeni", "greekupsilonpsilitonos", "greekupsilonpsilivaria", "greekupsilontonos", "greekupsilonvaria", "greekupsilonvrachy", "greekvaria", "greekxi", "greekzeta", "grid", "groupedcommand", "gsetboxllx", "gsetboxlly", "gstroke", "gt", "gtrapprox", "gtrdot", "gtreqless", "gtreqqless", "gtrless", "gtrsim", "guilsingleleft", "guilsingleright", "gujaratinumerals", "gurmurkhinumerals", "hairline", "hairspace", "halflinestrut", "halfstrut", "halfwaybox", "handletokens", "handwritten", "hangul", "hanzi", "hash", "hat", "hbar", "hboxofvbox", "hboxreference", "hcaron", "hcircumflex", "hdofstring", "headhbox", "headlanguage", "headnumber", "headnumbercontent", "headnumberdistance", "headnumberwidth", "headreferenceattributes", "headsetupspacing", "headtext", "headtextcontent", "headtextdistance", "headtexts", "headtextwidth", "headvbox", "headwidth", "heartsuit", "hebrewAlef", "hebrewAyin", "hebrewBet", "hebrewDalet", "hebrewGimel", "hebrewHe", "hebrewHet", "hebrewKaf", "hebrewKaffinal", "hebrewLamed", "hebrewMem", "hebrewMemfinal", "hebrewNun", "hebrewNunfinal", "hebrewPe", "hebrewPefinal", "hebrewQof", "hebrewResh", "hebrewSamekh", "hebrewShin", "hebrewTav", "hebrewTet", "hebrewTsadi", "hebrewTsadifinal", "hebrewVav", "hebrewYod", "hebrewZayin", "hebrewnumerals", "heightanddepthofstring", "heightofstring", "heightspanningtext", "helptext", "hexnumber", "hexstringtonumber", "hglue", "hiddenbar", "hiddencitation", "hiddencite", "hideblocks", "high", "highlight", "highordinalstr", "hilo", "himilo", "hl", "hookleftarrow", "hookrightarrow", "horizontalgrowingbar", "horizontalpositionbar", "hpackbox", "hpackedbox", "hphantom", "hpos", "hsizefraction", "hslash", "hsmash", "hsmashbox", "hsmashed", "hspace", "hstroke", "htdpofstring", "htofstring", "hyphen", "hyphenatedcoloredword", "hyphenatedfile", "hyphenatedfilename", "hyphenatedhbox", "hyphenatedpar", "hyphenatedurl", "hyphenatedword", "iacute", "ibox", "ibreve", "icaron", "icircumflex", "ideographichalffillspace", "ideographicspace", "idiaeresis", "idotaccent", "idotbelow", "idoublegrave", "idxfromluatable", "ifassignment", "iff", "ifinobject", "ifinoutputstream", "ifparameters", "iftrialtypesetting", "ignoreimplicitspaces", "ignoretagsinexport", "ignorevalue", "igrave", "ihook", "ii", "iiiint", "iiiintop", "iiint", "iiintop", "iint", "iintop", "iinvertedbreve", "ijligature", "imacron", "imaginaryi", "imaginaryj", "imath", "immediatesavetwopassdata", "impliedby", "implies", "imply", "in", "includemenu", "includesvgbuffer", "includesvgfile", "includeversioninfo", "increment", "incrementcounter", "incrementedcounter", "incrementpagenumber", "incrementsubpagenumber", "incrementvalue", "indentation", "index", "infofont", "infofontbold", "inframed", "infty", "infull", "inheritparameter", "inhibitblank", "ininner", "ininneredge", "ininnermargin", "initializeboxstack", "inleft", "inleftedge", "inleftmargin", "inline", "inlinebuffer", "inlinedbox", "inlinemath", "inlinemathematics", "inlinemessage", "inlineordisplaymath", "inlineprettyprintbuffer", "inlinerange", "inmargin", "inmframed", "innerflushshapebox", "inother", "inouter", "inouteredge", "inoutermargin", "input", "inputfilebarename", "inputfilename", "inputfilerealsuffix", "inputfilesuffix", "inputgivenfile", "inright", "inrightedge", "inrightmargin", "insertpages", "inspectluatable", "installactionhandler", "installactivecharacter", "installanddefineactivecharacter", "installattributestack", "installautocommandhandler", "installautosetuphandler", "installbasicautosetuphandler", "installbasicparameterhandler", "installbottomframerenderer", "installcommandhandler", "installcorenamespace", "installctxfunction", "installctxscanner", "installdefinehandler", "installdefinitionset", "installdefinitionsetmember", "installdirectcommandhandler", "installdirectparameterhandler", "installdirectparametersethandler", "installdirectsetuphandler", "installdirectstyleandcolorhandler", "installframedautocommandhandler", "installframedcommandhandler", "installglobalmacrostack", "installlanguage", "installleftframerenderer", "installmacrostack", "installnamespace", "installoutputroutine", "installpagearrangement", "installparameterhandler", "installparameterhashhandler", "installparametersethandler", "installparentinjector", "installprotectedctxfunction", "installprotectedctxscanner", "installrightframerenderer", "installrootparameterhandler", "installsetuphandler", "installsetuponlycommandhandler", "installshipoutmethod", "installsimplecommandhandler", "installsimpleframedcommandhandler", "installstyleandcolorhandler", "installswitchcommandhandler", "installswitchsetuphandler", "installtexdirective", "installtextracker", "installtopframerenderer", "installunitsseparator", "installunitsspace", "installversioninfo", "int", "intclockwise", "integerrounding", "integers", "interactionbar", "interactionbuttons", "interactionmenu", "intercal", "intertext", "interwordspaceafter", "interwordspacebefore", "interwordspaces", "interwordspacesafter", "interwordspacesbefore", "intop", "invisiblecomma", "invisibleplus", "invisibletimes", "invokepagehandler", "iogonek", "iota", "italic", "italicbold", "italiccorrection", "italicface", "item", "items", "itemtag", "itilde", "jcaron", "jcircumflex", "ji", "jmath", "jobfilename", "jobfilesuffix", "kap", "kappa", "kcaron", "kcommaaccent", "keepblocks", "keeplinestogether", "keepunwantedspaces", "kerncharacters", "khook", "kkra", "koreancirclenumerals", "koreannumerals", "koreannumeralsc", "koreannumeralsp", "koreanparentnumerals", "lVert", "labellanguage", "labeltext", "labeltexts", "lacute", "lambda", "lambdabar", "land", "langle", "language", "languageCharacters", "languagecharacters", "languagecharwidth", "laplace", "lastcounter", "lastcountervalue", "lastdigit", "lastlinewidth", "lastnaturalboxdp", "lastnaturalboxht", "lastnaturalboxwd", "lastparwrapper", "lastpredefinedsymbol", "lastrealpage", "lastrealpagenumber", "lastsubcountervalue", "lastsubpage", "lastsubpagenumber", "lasttwodigits", "lastuserpage", "lastuserpagenumber", "lateluacode", "latin", "layeredtext", "layerheight", "layerwidth", "lazysavetaggedtwopassdata", "lazysavetwopassdata", "lbar", "lbox", "lbrace", "lbracket", "lcaron", "lceil", "lchexnumber", "lchexnumbers", "lcommaaccent", "lcurl", "ldot", "ldotmiddle", "ldotp", "ldots", "le", "leadsto", "left", "leftaligned", "leftarrow", "leftarrowtail", "leftarrowtriangle", "leftbottombox", "leftbox", "leftdasharrow", "leftguillemot", "leftharpoondown", "leftharpoonup", "lefthbox", "leftheadtext", "leftlabeltext", "leftleftarrows", "leftline", "leftmathlabeltext", "leftorrighthbox", "leftorrightvbox", "leftorrightvtop", "leftrightarrow", "leftrightarrows", "leftrightarrowtriangle", "leftrightharpoons", "leftrightsquigarrow", "leftskipadaption", "leftsquigarrow", "leftsubguillemot", "leftthreetimes", "lefttopbox", "lefttoright", "lefttorighthbox", "lefttorightvbox", "lefttorightvtop", "leftwavearrow", "leftwhitearrow", "leq", "leqq", "leqslant", "lessapprox", "lessdot", "lesseqgtr", "lesseqqgtr", "lessgtr", "lesssim", "letbeundefined", "letcatcodecommand", "letcscsname", "letcsnamecs", "letcsnamecsname", "letdummyparameter", "letempty", "letgvalue", "letgvalueempty", "letgvalurelax", "letterampersand", "letterat", "letterbackslash", "letterbar", "letterbgroup", "letterclosebrace", "lettercolon", "letterdollar", "letterdoublequote", "letteregroup", "letterescape", "letterexclamationmark", "letterhash", "letterhat", "letterleftbrace", "letterleftbracket", "letterleftparenthesis", "letterless", "lettermore", "letteropenbrace", "letterpercent", "letterquestionmark", "letterrightbrace", "letterrightbracket", "letterrightparenthesis", "lettersinglequote", "letterslash", "letterspacing", "lettertilde", "letterunderscore", "letvalue", "letvalueempty", "letvaluerelax", "lfence", "lfloor", "lgroup", "lhbox", "lhooknwarrow", "lhooksearrow", "limitatefirstline", "limitatelines", "limitatetext", "line", "linebox", "linefeed", "linefillerhbox", "linefillervbox", "linefillervtop", "linenote", "linespanningtext", "linethickness", "linterval", "listcitation", "listcite", "listlength", "listnamespaces", "literalmode", "ljligature", "ll", "llangle", "llap", "llbracket", "llcorner", "lll", "llless", "llointerval", "lmoustache", "lnapprox", "lneq", "lneqq", "lnot", "lnsim", "loadanyfile", "loadanyfileonce", "loadbtxdefinitionfile", "loadbtxreplacementfile", "loadcldfile", "loadcldfileonce", "loadfontgoodies", "loadluafile", "loadluafileonce", "loadspellchecklist", "loadtexfile", "loadtexfileonce", "loadtypescriptfile", "localframed", "localframedwithsettings", "localhsize", "localpopbox", "localpopmacro", "localpushbox", "localpushmacro", "localundefine", "locatedfilepath", "locatefilepath", "locfilename", "logo", "lohi", "lointerval", "lomihi", "longleftarrow", "longleftrightarrow", "longmapsfrom", "longmapsto", "longrightarrow", "longrightsquigarrow", "looparrowleft", "looparrowright", "lor", "low", "lowerbox", "lowercased", "lowercasestring", "lowercasing", "lowerleftdoubleninequote", "lowerleftsingleninequote", "lowerrightdoubleninequote", "lowerrightsingleninequote", "lozenge", "lparent", "lrcorner", "lrointerval", "lrtbbox", "lstroke", "lt", "ltimes", "ltop", "ltrhbox", "ltrvbox", "ltrvtop", "luaTeX", "luacode", "luaconditional", "luaenvironment", "luaexpanded", "luaexpr", "luafunction", "luajitTeX", "luamajorversion", "luametaTeX", "luaminorversion", "luaparameterset", "luasetup", "luaversion", "lvert", "m", "mLeftarrow", "mLeftrightarrow", "mRightarrow", "mVert", "mainlanguage", "makecharacteractive", "makerawcommalist", "makestrutofbox", "maltese", "mapfontsize", "maps", "mapsas", "mapsdown", "mapsfrom", "mapsto", "mapsup", "margindata", "margintext", "markcontent", "markedpages", "marking", "markinjector", "markpage", "markreferencepage", "mat", "math", "mathDitalicshape", "mathDuprightshape", "mathampersand", "mathbf", "mathbi", "mathblackboard", "mathbs", "mathdefault", "mathditalicshape", "mathdollar", "mathdouble", "mathduprightshape", "mathematics", "mathfraktur", "mathfunction", "mathhash", "mathhyphen", "mathit", "mathitalic", "mathlabellanguage", "mathlabeltext", "mathlabeltexts", "mathop", "mathover", "mathpercent", "mathrm", "mathscript", "mathsl", "mathss", "mathtext", "mathtextbf", "mathtextbi", "mathtextbs", "mathtextit", "mathtextsl", "mathtexttf", "mathtf", "mathtriplet", "mathtt", "mathunder", "mathupright", "mathword", "mathwordbf", "mathwordbi", "mathwordbs", "mathwordit", "mathwordsl", "mathwordtf", "maxaligned", "mbox", "mcframed", "measure", "measured", "measuredangle", "measuredeq", "medskip", "medspace", "menubutton", "mequal", "message", "mfence", "mframed", "mfunction", "mfunctionlabeltext", "mhbox", "mho", "mhookleftarrow", "mhookrightarrow", "mid", "midaligned", "middle", "middlealigned", "middlebox", "midhbox", "midsubsentence", "minimalhbox", "minus", "minuscolon", "mirror", "mixedcaps", "mkvibuffer", "mleftarrow", "mleftharpoondown", "mleftharpoonup", "mleftrightarrow", "mleftrightharpoons", "mmapsto", "models", "moduleparameter", "molecule", "mono", "monobold", "mononormal", "month", "monthlong", "monthshort", "mp", "mprandomnumber", "mrel", "mrightarrow", "mrightharpoondown", "mrightharpoonup", "mrightleftharpoons", "mrightoverleftarrow", "mtext", "mtriplerel", "mtwoheadleftarrow", "mtwoheadrightarrow", "mu", "multimap", "mvert", "nHdownarrow", "nHuparrow", "nLeftarrow", "nLeftrightarrow", "nRightarrow", "nVDash", "nVdash", "nVleftarrow", "nVleftrightarrow", "nVrightarrow", "nabla", "nacute", "namedheadnumber", "namedstructureheadlocation", "namedstructureuservariable", "namedstructurevariable", "namedtaggedlabeltexts", "napostrophe", "napprox", "napproxEq", "narrownobreakspace", "nasymp", "natural", "naturalhbox", "naturalhpack", "naturalnumbers", "naturaltpack", "naturalvbox", "naturalvcenter", "naturalvpack", "naturalvtop", "naturalwd", "ncaron", "ncommaaccent", "ncong", "ncurl", "ndivides", "ne", "nearrow", "negatecolorbox", "negated", "negativesign", "negemspace", "negenspace", "negthinspace", "neng", "neq", "nequiv", "neswarrow", "newattribute", "newcatcodetable", "newcounter", "newevery", "newfrenchspacing", "newluatable", "newmode", "newsignal", "newsystemmode", "nexists", "nextbox", "nextboxdp", "nextboxht", "nextboxhtdp", "nextboxwd", "nextcounter", "nextcountervalue", "nextdepth", "nextparagraphs", "nextrealpage", "nextrealpagenumber", "nextsubcountervalue", "nextsubpage", "nextsubpagenumber", "nextuserpage", "nextuserpagenumber", "ngeq", "ngrave", "ngtr", "ngtrless", "ngtrsim", "ni", "nihongo", "nin", "njligature", "nleftarrow", "nleftrightarrow", "nleq", "nless", "nlessgtr", "nlesssim", "nmid", "nni", "nobar", "nobreakspace", "nocap", "nocharacteralign", "nocitation", "nocite", "nodetostring", "noffigurepages", "noflines", "noflinesinbox", "noflocalfloats", "noheaderandfooterlines", "noheightstrut", "nohyphens", "noindentation", "noitem", "nonfrenchspacing", "nonmathematics", "nonvalidassignment", "normal", "normalboldface", "normalframedwithsettings", "normalitalicface", "normalizebodyfontsize", "normalizedfontsize", "normalizefontdepth", "normalizefontheight", "normalizefontline", "normalizefontwidth", "normalizetextdepth", "normalizetextheight", "normalizetextline", "normalizetextwidth", "normalslantedface", "normaltypeface", "nospace", "not", "note", "notesymbol", "notimes", "notin", "notopandbottomlines", "notragged", "nowns", "nparallel", "nprec", "npreccurlyeq", "nrightarrow", "nsim", "nsimeq", "nsqsubseteq", "nsqsupseteq", "nsubset", "nsubseteq", "nsucc", "nsucccurlyeq", "nsupset", "nsupseteq", "ntilde", "ntimes", "ntriangleleft", "ntrianglelefteq", "ntriangleright", "ntrianglerighteq", "nu", "numberofpoints", "numbers", "nvDash", "nvdash", "nvleftarrow", "nvleftrightarrow", "nvrightarrow", "nwarrow", "nwsearrow", "oacute", "obeydepth", "objectdepth", "objectheight", "objectmargin", "objectwidth", "obox", "obreve", "ocaron", "ocircumflex", "ocircumflexacute", "ocircumflexdotbelow", "ocircumflexgrave", "ocircumflexhook", "ocircumflextilde", "octnumber", "octstringtonumber", "odiaeresis", "odiaeresismacron", "odot", "odotaccent", "odotaccentmacron", "odotbelow", "odoublegrave", "oeligature", "offset", "offsetbox", "ograve", "ohm", "ohook", "ohorn", "ohornacute", "ohorndotbelow", "ohorngrave", "ohornhook", "ohorntilde", "ohungarumlaut", "oiiint", "oiint", "oint", "ointclockwise", "ointctrclockwise", "oinvertedbreve", "omacron", "omega", "omicron", "ominus", "onedigitrounding", "oneeighth", "onefifth", "onehalf", "onequarter", "onesixth", "onesuperior", "onethird", "oogonek", "oogonekmacron", "operatorlanguage", "operatortext", "oplus", "ordfeminine", "ordinaldaynumber", "ordinalstr", "ordmasculine", "ornamenttext", "oslash", "ostroke", "ostrokeacute", "otilde", "otildemacron", "otimes", "outputfilename", "outputstreambox", "outputstreamcopy", "outputstreamunvbox", "outputstreamunvcopy", "over", "overbar", "overbars", "overbartext", "overbarunderbar", "overbrace", "overbracetext", "overbraceunderbrace", "overbracket", "overbrackettext", "overbracketunderbracket", "overlaybutton", "overlaycolor", "overlaydepth", "overlayfigure", "overlayheight", "overlayimage", "overlaylinecolor", "overlaylinewidth", "overlayoffset", "overlayrollbutton", "overlaywidth", "overleftarrow", "overleftharpoondown", "overleftharpoonup", "overleftrightarrow", "overloaderror", "overparent", "overparenttext", "overparentunderparent", "overrightarrow", "overrightharpoondown", "overrightharpoonup", "overset", "overstrike", "overstrikes", "overtwoheadleftarrow", "overtwoheadrightarrow", "owns", "page", "pagearea", "pagebreak", "pagefigure", "pageinjection", "pagenumber", "pagereference", "pagestaterealpage", "pagestaterealpageorder", "paletsize", "paragraphmark", "parallel", "part", "partial", "pdfTeX", "pdfactualtext", "pdfbackendactualtext", "pdfbackendcurrentresources", "pdfbackendsetcatalog", "pdfbackendsetcolorspace", "pdfbackendsetextgstate", "pdfbackendsetinfo", "pdfbackendsetname", "pdfbackendsetpageattribute", "pdfbackendsetpageresource", "pdfbackendsetpagesattribute", "pdfbackendsetpattern", "pdfbackendsetshade", "pdfcolor", "pdfeTeX", "percent", "percentdimen", "periodcentered", "periods", "permitcaretescape", "permitcircumflexescape", "permitspacesbetweengroups", "perp", "persiandecimals", "persiandecimalseparator", "persiannumerals", "persianthousandsseparator", "perthousand", "phantom", "phantombox", "phi", "phook", "pi", "pickupgroupedcommand", "pitchfork", "placeattachments", "placebookmarks", "placebtxrendering", "placechemical", "placecitation", "placecombinedlist", "placecomments", "placecontent", "placecurrentformulanumber", "placedbox", "placefigure", "placefloat", "placefloatcaption", "placefloatwithsetups", "placefootnotes", "placeformula", "placeframed", "placegraphic", "placeheadnumber", "placeheadtext", "placehelp", "placeholder", "placeindex", "placeinitial", "placeintermezzo", "placelayer", "placelayeredtext", "placelegend", "placelist", "placelistofabbreviations", "placelistofchemicals", "placelistoffigures", "placelistofgraphics", "placelistofintermezzi", "placelistoflogos", "placelistofpublications", "placelistofsorts", "placelistofsynonyms", "placelistoftables", "placelocalfootnotes", "placelocalnotes", "placement", "placenamedfloat", "placenamedformula", "placenotes", "placeongrid", "placeontopofeachother", "placepagenumber", "placepairedbox", "placeparallel", "placerawheaddata", "placerawheadnumber", "placerawheadtext", "placerawlist", "placeregister", "placerenderingwindow", "placesidebyside", "placesubformula", "placetable", "pm", "popattribute", "popmacro", "popmode", "popsystemmode", "position", "positionoverlay", "positionregionoverlay", "positivesign", "postponenotes", "prec", "precapprox", "preccurlyeq", "preceq", "preceqq", "precnapprox", "precneq", "precneqq", "precnsim", "precsim", "predefinedfont", "predefinefont", "predefinesymbol", "prefixedpagenumber", "prefixlanguage", "prefixtext", "prependetoks", "prependgvalue", "prependtocommalist", "prependtoks", "prependtoksonce", "prependvalue", "prerollblank", "presetbtxlabeltext", "presetdocument", "presetfieldsymbols", "presetheadtext", "presetlabeltext", "presetmathlabeltext", "presetoperatortext", "presetprefixtext", "presetsuffixtext", "presettaglabeltext", "presetunittext", "pretocommalist", "prettyprintbuffer", "prevcounter", "prevcountervalue", "preventmode", "prevrealpage", "prevrealpagenumber", "prevsubcountervalue", "prevsubpage", "prevsubpagenumber", "prevuserpage", "prevuserpagenumber", "prime", "primes", "procent", "processMPbuffer", "processMPfigurefile", "processaction", "processallactionsinset", "processassignlist", "processassignmentcommand", "processassignmentlist", "processbetween", "processblocks", "processbodyfontenvironmentlist", "processcolorcomponents", "processcommacommand", "processcommalist", "processcommalistwithparameters", "processcontent", "processfile", "processfilemany", "processfilenone", "processfileonce", "processfirstactioninset", "processisolatedchars", "processisolatedwords", "processlinetablebuffer", "processlinetablefile", "processlist", "processmonth", "processranges", "processseparatedlist", "processtexbuffer", "processtokens", "processuntil", "processxtablebuffer", "processyear", "prod", "product", "profiledbox", "profilegivenbox", "program", "project", "propto", "pseudoMixedCapped", "pseudoSmallCapped", "pseudoSmallcapped", "pseudosmallcapped", "psi", "punctuationspace", "purenumber", "pushattribute", "pushbutton", "pushmacro", "pushmode", "pushoutputstream", "pushsystemmode", "putboxincache", "putnextboxincache", "qquad", "quad", "quadrupleprime", "quads", "quarterstrut", "questiondown", "questionedeq", "quitcommalist", "quitprevcommalist", "quittypescriptscanning", "quotation", "quote", "quotedbl", "quotedblbase", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "quotesingle", "quotesinglebase", "rVert", "racute", "raggedbottom", "raggedcenter", "raggedleft", "raggedright", "raggedwidecenter", "raisebox", "randomizetext", "randomnumber", "rangle", "rationals", "rawcounter", "rawcountervalue", "rawdate", "rawdoifelseinset", "rawdoifinset", "rawdoifinsetelse", "rawgetparameters", "rawprocessaction", "rawprocesscommacommand", "rawprocesscommalist", "rawstructurelistuservariable", "rawsubcountervalue", "rbox", "rbrace", "rbracket", "rcaron", "rceil", "rcommaaccent", "rdoublegrave", "readfile", "readfixfile", "readjobfile", "readlocfile", "readsetfile", "readsysfile", "readtexfile", "readxmlfile", "realSmallCapped", "realSmallcapped", "realpagenumber", "reals", "realsmallcapped", "recursedepth", "recurselevel", "recursestring", "redoconvertfont", "ref", "reference", "referencecolumnnumber", "referencepagedetail", "referencepagestate", "referenceprefix", "referencerealpage", "referencesymbol", "referring", "registerattachment", "registerctxluafile", "registered", "registerexternalfigure", "registerfontclass", "registerhyphenationexception", "registerhyphenationpattern", "registermenubuttons", "registerparwrapper", "registerparwrapperreverse", "registersort", "registersynonym", "registerunit", "regular", "relatemarking", "relateparameterhandlers", "relaxvalueifundefined", "relbar", "remainingcharacters", "remark", "removebottomthings", "removedepth", "removefromcommalist", "removelastskip", "removelastspace", "removemarkedcontent", "removepunctuation", "removesubstring", "removetoks", "removeunwantedspaces", "repeathead", "replacefeature", "replaceincommalist", "replaceword", "rescan", "rescanwithsetup", "resetMPdrawing", "resetMPenvironment", "resetMPinstance", "resetallattributes", "resetandaddfeature", "resetbar", "resetboxesincache", "resetbreakpoints", "resetbuffer", "resetcharacteralign", "resetcharacterkerning", "resetcharacterspacing", "resetcharacterstripping", "resetcollector", "resetcounter", "resetctxscanner", "resetdigitsmanipulation", "resetdirection", "resetfeature", "resetflag", "resetfontcolorsheme", "resetfontfallback", "resetfontsolution", "resethyphenationfeatures", "resetinjector", "resetinteractionmenu", "resetitaliccorrection", "resetlayer", "resetlocalfloats", "resetmarker", "resetmarking", "resetmode", "resetpagenumber", "resetparallel", "resetpath", "resetpenalties", "resetperiodkerning", "resetprofile", "resetrecurselevel", "resetreference", "resetreplacements", "resetscript", "resetsetups", "resetshownsynonyms", "resetsubpagenumber", "resetsymbolset", "resetsystemmode", "resettimer", "resettokenlist", "resettrackers", "resettrialtypesetting", "resetusedsortings", "resetusedsynonyms", "resetuserpagenumber", "resetvalue", "resetvisualizers", "reshapebox", "resolvedglyphdirect", "resolvedglyphstyled", "restartcounter", "restorebox", "restorecatcodes", "restorecounter", "restorecurrentattributes", "restoreendofline", "restoreglobalbodyfont", "restriction", "retestfeature", "reusableMPgraphic", "reuseMPgraphic", "reuserandomseed", "reverseddoubleprime", "reversedprime", "reversedtripleprime", "reversehbox", "reversehpack", "reversetpack", "reversevbox", "reversevboxcontent", "reversevpack", "reversevtop", "revivefeature", "rfence", "rfloor", "rgroup", "rhbox", "rho", "rhooknearrow", "rhookswarrow", "right", "rightaligned", "rightangle", "rightarrow", "rightarrowbar", "rightarrowtail", "rightarrowtriangle", "rightbottombox", "rightbox", "rightdasharrow", "rightguillemot", "rightharpoondown", "rightharpoonup", "righthbox", "rightheadtext", "rightlabeltext", "rightleftarrows", "rightleftharpoons", "rightline", "rightmathlabeltext", "rightorleftpageaction", "rightpageorder", "rightrightarrows", "rightskipadaption", "rightsquigarrow", "rightsubguillemot", "rightthreearrows", "rightthreetimes", "righttoleft", "righttolefthbox", "righttoleftvbox", "righttoleftvtop", "righttopbox", "rightwavearrow", "rightwhitearrow", "ring", "rinterval", "rinvertedbreve", "risingdotseq", "rlap", "rlointerval", "rmoustache", "rneq", "robustaddtocommalist", "robustdoifelseinset", "robustdoifinsetelse", "robustpretocommalist", "rointerval", "rollbutton", "roman", "romanC", "romanD", "romanI", "romanII", "romanIII", "romanIV", "romanIX", "romanL", "romanM", "romanV", "romanVI", "romanVII", "romanVIII", "romanX", "romanXI", "romanXII", "romanc", "romand", "romani", "romanii", "romaniii", "romaniv", "romanix", "romanl", "romanm", "romannumerals", "romanv", "romanvi", "romanvii", "romanviii", "romanx", "romanxi", "romanxii", "rootradical", "rotate", "rparent", "rrangle", "rrbracket", "rrointerval", "rtimes", "rtlhbox", "rtlvbox", "rtlvtop", "rtop", "ruby", "ruledhbox", "ruledhpack", "ruledmbox", "ruledtopv", "ruledtpack", "ruledvbox", "ruledvpack", "ruledvtop", "runMPbuffer", "runninghbox", "russianNumerals", "russiannumerals", "rvert", "sacute", "safechar", "samplefile", "sans", "sansbold", "sansnormal", "sansserif", "savebox", "savebtxdataset", "savebuffer", "savecounter", "savecurrentattributes", "savenormalmeaning", "savetaggedtwopassdata", "savetwopassdata", "sbox", "scalarproduct", "scale", "scaron", "scedilla", "schwa", "schwahook", "scircumflex", "scommaaccent", "screen", "searrow", "secondderivativesymbol", "secondoffivearguments", "secondoffourarguments", "secondofsixarguments", "secondofthreearguments", "secondofthreeunexpanded", "secondoftwoarguments", "secondoftwounexpanded", "section", "sectionmark", "seeindex", "select", "selectblocks", "serializecommalist", "serializedcommalist", "serif", "serifbold", "serifnormal", "setJSpreamble", "setMPlayer", "setMPpositiongraphic", "setMPpositiongraphicrange", "setMPtext", "setMPvariable", "setMPvariables", "setautopagestaterealpageno", "setbar", "setbigbodyfont", "setboxllx", "setboxlly", "setbreakpoints", "setcapstrut", "setcatcodetable", "setcharacteralign", "setcharacteraligndetail", "setcharactercasing", "setcharactercleaning", "setcharacterkerning", "setcharacterspacing", "setcharacterstripping", "setcharstrut", "setcollector", "setcolormodell", "setcounter", "setcounterown", "setctxluafunction", "setcurrentfontclass", "setdataset", "setdatavalue", "setdefaultpenalties", "setdigitsmanipulation", "setdirection", "setdocumentargument", "setdocumentargumentdefault", "setdocumentfilename", "setdummyparameter", "setelementexporttag", "setemeasure", "setevalue", "setevariable", "setevariables", "setexpansion", "setfirstline", "setfirstpasscharacteralign", "setflag", "setfont", "setfontcolorsheme", "setfontfeature", "setfontsolution", "setfontstrut", "setfractions", "setglobalscript", "setgmeasure", "setgvalue", "setgvariable", "setgvariables", "sethboxregister", "sethyphenatedurlafter", "sethyphenatedurlbefore", "sethyphenatedurlnormal", "sethyphenationfeatures", "setinitial", "setinjector", "setinteraction", "setinterfacecommand", "setinterfaceconstant", "setinterfaceelement", "setinterfacemessage", "setinterfacevariable", "setinternalrendering", "setitaliccorrection", "setlayer", "setlayerframed", "setlayertext", "setlinefiller", "setlocalhsize", "setlocalscript", "setluatable", "setmainbodyfont", "setmainparbuilder", "setmarker", "setmarking", "setmathstyle", "setmeasure", "setmessagetext", "setminus", "setmode", "setnostrut", "setnote", "setnotetext", "setobject", "setoldstyle", "setpagereference", "setpagestate", "setpagestaterealpageno", "setparagraphfreezing", "setpenalties", "setpercentdimen", "setperiodkerning", "setposition", "setpositionbox", "setpositiondata", "setpositiondataplus", "setpositiononly", "setpositionplus", "setpositionstrut", "setprofile", "setrandomseed", "setreference", "setreferencedobject", "setregisterentry", "setreplacements", "setrigidcolumnbalance", "setrigidcolumnhsize", "setscript", "setsecondpasscharacteralign", "setsectionblock", "setsimplecolumnshsize", "setsmallbodyfont", "setsmallcaps", "setstackbox", "setstructurepageregister", "setstrut", "setsuperiors", "setsystemmode", "settabular", "settaggedmetadata", "settestcrlf", "settextcontent", "settightobject", "settightreferencedobject", "settightstrut", "settightunreferencedobject", "settokenlist", "settrialtypesetting", "setuevalue", "setugvalue", "setunreferencedobject", "setup", "setupMPgraphics", "setupMPinstance", "setupMPpage", "setupMPvariables", "setupTABLE", "setupTEXpage", "setupalign", "setupalternativestyles", "setuparranging", "setupattachment", "setupattachments", "setupbackend", "setupbackground", "setupbackgrounds", "setupbar", "setupbars", "setupblackrules", "setupblank", "setupbleeding", "setupblock", "setupbodyfont", "setupbodyfontenvironment", "setupbookmark", "setupbottom", "setupbottomtexts", "setupbtx", "setupbtxdataset", "setupbtxlabeltext", "setupbtxlist", "setupbtxregister", "setupbtxrendering", "setupbuffer", "setupbutton", "setupcapitals", "setupcaption", "setupcaptions", "setupcharacteralign", "setupcharacterkerning", "setupcharacterspacing", "setupchemical", "setupchemicalframed", "setupclipping", "setupcollector", "setupcolor", "setupcolors", "setupcolumns", "setupcolumnset", "setupcolumnsetarea", "setupcolumnsetareatext", "setupcolumnsetlines", "setupcolumnsetspan", "setupcolumnsetstart", "setupcombination", "setupcombinedlist", "setupcomment", "setupcontent", "setupcounter", "setupdataset", "setupdelimitedtext", "setupdescription", "setupdescriptions", "setupdirections", "setupdocument", "setupeffect", "setupenumeration", "setupenumerations", "setupenv", "setupexpansion", "setupexport", "setupexternalfigure", "setupexternalfigures", "setupexternalsoundtracks", "setupfacingfloat", "setupfield", "setupfieldbody", "setupfieldcategory", "setupfieldcontentframed", "setupfieldlabelframed", "setupfields", "setupfieldtotalframed", "setupfiller", "setupfillinlines", "setupfillinrules", "setupfirstline", "setupfittingpage", "setupfloat", "setupfloatframed", "setupfloats", "setupfloatsplitting", "setupfontexpansion", "setupfontprotrusion", "setupfonts", "setupfontsolution", "setupfooter", "setupfootertexts", "setupfootnotes", "setupforms", "setupformula", "setupformulae", "setupformulaframed", "setupframed", "setupframedcontent", "setupframedtable", "setupframedtablecolumn", "setupframedtablerow", "setupframedtext", "setupframedtexts", "setupglobalreferenceprefix", "setuphead", "setupheadalternative", "setupheader", "setupheadertexts", "setupheadnumber", "setupheads", "setupheadtext", "setuphelp", "setuphigh", "setuphighlight", "setuphyphenation", "setuphyphenmark", "setupindentedtext", "setupindenting", "setupindex", "setupinitial", "setupinsertion", "setupinteraction", "setupinteractionbar", "setupinteractionmenu", "setupinteractionscreen", "setupinterlinespace", "setupitaliccorrection", "setupitemgroup", "setupitemizations", "setupitemize", "setupitems", "setuplabel", "setuplabeltext", "setuplanguage", "setuplayer", "setuplayeredtext", "setuplayout", "setuplayouttext", "setuplegend", "setuplinefiller", "setuplinefillers", "setuplinenote", "setuplinenumbering", "setuplines", "setuplinetable", "setuplinewidth", "setuplist", "setuplistalternative", "setuplistextra", "setuplocalfloats", "setuplocalinterlinespace", "setuplow", "setuplowhigh", "setuplowmidhigh", "setupmakeup", "setupmarginblock", "setupmargindata", "setupmarginframed", "setupmarginrule", "setupmarginrules", "setupmarking", "setupmathalignment", "setupmathcases", "setupmathematics", "setupmathfence", "setupmathfraction", "setupmathfractions", "setupmathframed", "setupmathlabeltext", "setupmathmatrix", "setupmathornament", "setupmathradical", "setupmathstackers", "setupmathstyle", "setupmixedcolumns", "setupmodule", "setupmulticolumns", "setupnarrower", "setupnotation", "setupnotations", "setupnote", "setupnotes", "setupoffset", "setupoffsetbox", "setupoperatortext", "setupoppositeplacing", "setuporientation", "setupoutput", "setupoutputroutine", "setuppagechecker", "setuppagecolumns", "setuppagecomment", "setuppageinjection", "setuppageinjectionalternative", "setuppagenumber", "setuppagenumbering", "setuppageshift", "setuppagestate", "setuppagetransitions", "setuppairedbox", "setuppalet", "setuppaper", "setuppapersize", "setupparagraph", "setupparagraphintro", "setupparagraphnumbering", "setupparagraphs", "setupparallel", "setupperiodkerning", "setupperiods", "setupplaceholder", "setupplacement", "setuppositionbar", "setuppositioning", "setupprefixtext", "setupprocessor", "setupprofile", "setupprograms", "setupquotation", "setupquote", "setuprealpagenumber", "setupreferenceformat", "setupreferenceprefix", "setupreferencestructureprefix", "setupreferencing", "setupregister", "setupregisters", "setuprenderingwindow", "setuprotate", "setupruby", "setups", "setupscale", "setupscript", "setupscripts", "setupsectionblock", "setupselector", "setupshift", "setupsidebar", "setupsorting", "setupspacing", "setupspellchecking", "setupstartstop", "setupstretched", "setupstrut", "setupstyle", "setupsubformula", "setupsubformulas", "setupsubpagenumber", "setupsuffixtext", "setupsymbols", "setupsymbolset", "setupsynctex", "setupsynonyms", "setupsystem", "setuptables", "setuptabulate", "setuptagging", "setuptaglabeltext", "setuptext", "setuptextbackground", "setuptextflow", "setuptextnote", "setuptextrules", "setuptexttexts", "setupthinrules", "setuptolerance", "setuptooltip", "setuptop", "setuptoptexts", "setuptype", "setuptyping", "setupunit", "setupunittext", "setupurl", "setupuserdata", "setupuserdataalternative", "setupuserpagenumber", "setupversion", "setupviewerlayer", "setupvspacing", "setupwhitespace", "setupwithargument", "setupwithargumentswapped", "setupxml", "setupxtable", "setuvalue", "setuxvalue", "setvalue", "setvariable", "setvariables", "setvboxregister", "setvisualizerfont", "setvtopregister", "setwidthof", "setxmeasure", "setxvalue", "setxvariable", "setxvariables", "seveneighths", "sfrac", "shapedhbox", "sharp", "shiftbox", "shiftdown", "shiftup", "showallmakeup", "showattributes", "showbodyfont", "showbodyfontenvironment", "showboxes", "showbtxdatasetauthors", "showbtxdatasetcompleteness", "showbtxdatasetfields", "showbtxfields", "showbtxhashedauthors", "showbtxtables", "showchardata", "showcharratio", "showcolor", "showcolorbar", "showcolorcomponents", "showcolorgroup", "showcolorset", "showcolorstruts", "showcounter", "showdirectives", "showdirsinmargin", "showedebuginfo", "showexperiments", "showfont", "showfontdata", "showfontexpansion", "showfontitalics", "showfontkerns", "showfontparameters", "showfontstrip", "showfontstyle", "showframe", "showglyphdata", "showglyphs", "showgrid", "showgridsnapping", "showhelp", "showhyphenationtrace", "showhyphens", "showinjector", "showjustification", "showkerning", "showlayout", "showlayoutcomponents", "showligature", "showligatures", "showlogcategories", "showluatables", "showmakeup", "showmargins", "showmessage", "showminimalbaseline", "shownextbox", "showotfcomposition", "showpalet", "showparentchain", "showparwrapperstate", "showprint", "showsetups", "showsetupsdefinition", "showstruts", "showsymbolset", "showtimer", "showtokens", "showtrackers", "showvalue", "showvariable", "showwarning", "sigma", "signalrightpage", "sim", "simeq", "simplealignedbox", "simplealignedboxplus", "simplealignedspreadbox", "simplegroupedcommand", "simplereversealignedbox", "simplereversealignedboxplus", "singalcharacteralign", "singlebond", "singleverticalbar", "sixperemspace", "sixthofsixarguments", "slanted", "slantedbold", "slantedface", "slash", "slicepages", "slong", "slovenianNumerals", "sloveniannumerals", "small", "smallbodyfont", "smallbold", "smallbolditalic", "smallboldslanted", "smallcappedcharacters", "smallcappedromannumerals", "smallcaps", "smaller", "smallitalicbold", "smallnormal", "smallskip", "smallslanted", "smallslantedbold", "smalltype", "smash", "smashbox", "smashboxed", "smashedhbox", "smashedvbox", "smile", "snaptogrid", "softhyphen", "solidus", "someheadnumber", "somekindoftab", "someline", "somelocalfloat", "somenamedheadnumber", "someplace", "somewhere", "space", "spaceddigits", "spaceddigitsmethod", "spaceddigitsseparator", "spaceddigitssymbol", "spadesuit", "spanishNumerals", "spanishnumerals", "speech", "sphericalangle", "splitatasterisk", "splitatcolon", "splitatcolons", "splitatcomma", "splitatperiod", "splitdfrac", "splitfilename", "splitfloat", "splitfrac", "splitoffbase", "splitofffull", "splitoffkind", "splitoffname", "splitoffpath", "splitoffroot", "splitofftokens", "splitofftype", "splitstring", "spreadhbox", "sqcap", "sqcup", "sqrt", "sqsubset", "sqsubseteq", "sqsubsetneq", "sqsupset", "sqsupseteq", "sqsupsetneq", "square", "squaredots", "ssharp", "stackrel", "stackscripts", "star", "stareq", "startJScode", "startJSpreamble", "startLUA", "startMP", "startMPclip", "startMPcode", "startMPdefinitions", "startMPdrawing", "startMPenvironment", "startMPextensions", "startMPinclusions", "startMPinitializations", "startMPpage", "startMPpositiongraphic", "startMPpositionmethod", "startMPrun", "startPARSEDXML", "startTABLE", "startTABLEbody", "startTABLEfoot", "startTABLEhead", "startTABLEnested", "startTABLEnext", "startTC", "startTD", "startTDs", "startTEX", "startTEXpage", "startTH", "startTN", "startTR", "startTRs", "startTX", "startTY", "startXML", "startalign", "startalignment", "startallmodes", "startappendices", "startarrangedpages", "startasciimode", "startaside", "startattachment", "startbackground", "startbackmatter", "startbar", "startbbordermatrix", "startbitmapimage", "startblockquote", "startbodymatter", "startbordermatrix", "startboxedcolumns", "startbtxlabeltext", "startbtxrenderingdefinitions", "startbuffer", "startcases", "startcatcodetable", "startcenteraligned", "startchapter", "startcharacteralign", "startcheckedfences", "startchemical", "startchemicaltext", "startcollect", "startcollecting", "startcolor", "startcolorintent", "startcoloronly", "startcolorset", "startcolumns", "startcolumnset", "startcolumnsetspan", "startcombination", "startcomment", "startcomponent", "startcontextcode", "startcontextdefinitioncode", "startctxfunction", "startctxfunctiondefinition", "startcurrentcolor", "startcurrentlistentrywrapper", "startdelimited", "startdelimitedtext", "startdisplaymath", "startdmath", "startdocument", "starteffect", "startelement", "startembeddedxtable", "startendnote", "startendofline", "startenvironment", "startexceptions", "startexpanded", "startexpandedcollect", "startextendedcatcodetable", "startexternalfigurecollection", "startfacingfloat", "startfact", "startfigure", "startfiguretext", "startfittingpage", "startfixed", "startfloatcombination", "startfont", "startfontclass", "startfontsolution", "startfootnote", "startformula", "startformulas", "startframed", "startframedcell", "startframedcontent", "startframedrow", "startframedtable", "startframedtext", "startfrontmatter", "startgoto", "startgraphictext", "startgridsnapping", "starthanging", "starthbox", "starthboxestohbox", "starthboxregister", "starthead", "startheadtext", "starthelptext", "starthiding", "starthighlight", "starthyphenation", "startimath", "startindentation", "startindentedtext", "startinteraction", "startinteractionmenu", "startinterface", "startintermezzotext", "startintertext", "startitem", "startitemgroup", "startitemgroupcolumns", "startitemize", "startknockout", "startlabeltext", "startlanguage", "startlayout", "startleftaligned", "startlegend", "startline", "startlinealignment", "startlinecorrection", "startlinefiller", "startlinenote", "startlinenumbering", "startlines", "startlinetable", "startlinetablebody", "startlinetablecell", "startlinetablehead", "startlocalfootnotes", "startlocalheadsetup", "startlocallinecorrection", "startlocalnotes", "startlocalsetups", "startlua", "startluacode", "startluaparameterset", "startluasetups", "startmakeup", "startmarginblock", "startmarginrule", "startmarkedcontent", "startmarkpages", "startmathalignment", "startmathcases", "startmathlabeltext", "startmathmatrix", "startmathmode", "startmathstyle", "startmatrices", "startmatrix", "startmaxaligned", "startmdformula", "startmidaligned", "startmiddlealigned", "startmiddlemakeup", "startmixedcolumns", "startmode", "startmodeset", "startmodule", "startmoduletestsection", "startmpformula", "startmulticolumns", "startnamedsection", "startnamedsubformulas", "startnarrow", "startnarrower", "startnegative", "startnicelyfilledbox", "startnointerference", "startnotallmodes", "startnotext", "startnotmode", "startoperatortext", "startopposite", "startoutputstream", "startoverlay", "startoverprint", "startpacked", "startpagecolumns", "startpagecomment", "startpagefigure", "startpagelayout", "startpagemakeup", "startpar", "startparagraph", "startparagraphs", "startparagraphscell", "startparbuilder", "startpart", "startpath", "startplacechemical", "startplacefigure", "startplacefloat", "startplaceformula", "startplacegraphic", "startplaceintermezzo", "startplacelegend", "startplacepairedbox", "startplacetable", "startpositioning", "startpositionoverlay", "startpositive", "startpostponing", "startpostponingnotes", "startprefixtext", "startprocessassignmentcommand", "startprocessassignmentlist", "startprocesscommacommand", "startprocesscommalist", "startproduct", "startproject", "startprotect", "startprotectedcolors", "startpublication", "startpunctuation", "startquotation", "startquote", "startrandomized", "startrandomseed", "startrawsetups", "startreadingfile", "startreferenceprefix", "startregime", "startregister", "startreusableMPgraphic", "startrightaligned", "startruby", "startscript", "startsdformula", "startsection", "startsectionblock", "startsectionblockenvironment", "startsectionlevel", "startsetups", "startshapebox", "startshift", "startsidebar", "startsimplecolumns", "startspecialitem", "startspeech", "startspformula", "startsplitformula", "startsplittext", "startspread", "startstandardmakeup", "startstaticMPfigure", "startstaticMPgraphic", "startstrictinspectnextcharacter", "startstructurepageregister", "startstrut", "startstyle", "startsubformulas", "startsubject", "startsubjectlevel", "startsubsection", "startsubsentence", "startsubstack", "startsubsubject", "startsubsubsection", "startsubsubsubject", "startsubsubsubsection", "startsubsubsubsubject", "startsubsubsubsubsection", "startsubsubsubsubsubject", "startsuffixtext", "startsymbolset", "starttable", "starttablehead", "starttables", "starttabletail", "starttabletext", "starttabulate", "starttabulatehead", "starttabulatetail", "starttagged", "starttaglabeltext", "starttexcode", "starttexdefinition", "starttext", "starttextbackground", "starttextbackgroundmanual", "starttextcolor", "starttextcolorintent", "starttextflow", "starttextmakeup", "starttextrule", "startthematrix", "starttitle", "starttokenlist", "starttokens", "starttransparent", "starttypescript", "starttypescriptcollection", "starttyping", "startuniqueMPgraphic", "startuniqueMPpagegraphic", "startunittext", "startunpacked", "startusableMPgraphic", "startuseMPgraphic", "startusemathstyleparameter", "startuserdata", "startusingbtxspecification", "startvbox", "startvboxregister", "startvboxtohbox", "startvboxtohboxseparator", "startviewerlayer", "startvtop", "startvtopregister", "startxcell", "startxcellgroup", "startxcolumn", "startxgroup", "startxmldisplayverbatim", "startxmlinlineverbatim", "startxmlraw", "startxmlsetups", "startxrow", "startxrowgroup", "startxtable", "startxtablebody", "startxtablefoot", "startxtablehead", "startxtablenext", "stligature", "stopJScode", "stopJSpreamble", "stopLUA", "stopMP", "stopMPclip", "stopMPcode", "stopMPdefinitions", "stopMPdrawing", "stopMPenvironment", "stopMPextensions", "stopMPinclusions", "stopMPinitializations", "stopMPpage", "stopMPpositiongraphic", "stopMPpositionmethod", "stopMPrun", "stopPARSEDXML", "stopTABLE", "stopTABLEbody", "stopTABLEfoot", "stopTABLEhead", "stopTABLEnested", "stopTABLEnext", "stopTC", "stopTD", "stopTDs", "stopTEX", "stopTEXpage", "stopTH", "stopTN", "stopTR", "stopTRs", "stopTX", "stopTY", "stopXML", "stopalign", "stopalignment", "stopallmodes", "stopappendices", "stoparrangedpages", "stopasciimode", "stopaside", "stopattachment", "stopbackground", "stopbackmatter", "stopbar", "stopbbordermatrix", "stopbitmapimage", "stopblockquote", "stopbodymatter", "stopbordermatrix", "stopboxedcolumns", "stopbtxlabeltext", "stopbtxrenderingdefinitions", "stopbuffer", "stopcases", "stopcatcodetable", "stopcenteraligned", "stopchapter", "stopcharacteralign", "stopcheckedfences", "stopchemical", "stopchemicaltext", "stopcollect", "stopcollecting", "stopcolor", "stopcolorintent", "stopcoloronly", "stopcolorset", "stopcolumns", "stopcolumnset", "stopcolumnsetspan", "stopcombination", "stopcomment", "stopcomponent", "stopcontextcode", "stopcontextdefinitioncode", "stopctxfunction", "stopctxfunctiondefinition", "stopcurrentcolor", "stopcurrentlistentrywrapper", "stopdelimited", "stopdelimitedtext", "stopdisplaymath", "stopdmath", "stopdocument", "stopeffect", "stopelement", "stopembeddedxtable", "stopendnote", "stopendofline", "stopenvironment", "stopexceptions", "stopexpanded", "stopexpandedcollect", "stopextendedcatcodetable", "stopexternalfigurecollection", "stopfacingfloat", "stopfact", "stopfigure", "stopfiguretext", "stopfittingpage", "stopfixed", "stopfloatcombination", "stopfont", "stopfontclass", "stopfontsolution", "stopfootnote", "stopformula", "stopformulas", "stopframed", "stopframedcell", "stopframedcontent", "stopframedrow", "stopframedtable", "stopframedtext", "stopfrontmatter", "stopgoto", "stopgraphictext", "stopgridsnapping", "stophanging", "stophbox", "stophboxestohbox", "stophboxregister", "stophead", "stopheadtext", "stophelptext", "stophiding", "stophighlight", "stophyphenation", "stopimath", "stopindentation", "stopindentedtext", "stopinteraction", "stopinteractionmenu", "stopinterface", "stopintermezzotext", "stopintertext", "stopitem", "stopitemgroup", "stopitemgroupcolumns", "stopitemize", "stopknockout", "stoplabeltext", "stoplanguage", "stoplayout", "stopleftaligned", "stoplegend", "stopline", "stoplinealignment", "stoplinecorrection", "stoplinefiller", "stoplinenote", "stoplinenumbering", "stoplines", "stoplinetable", "stoplinetablebody", "stoplinetablecell", "stoplinetablehead", "stoplocalfootnotes", "stoplocalheadsetup", "stoplocallinecorrection", "stoplocalnotes", "stoplocalsetups", "stoplua", "stopluacode", "stopluaparameterset", "stopluasetups", "stopmakeup", "stopmarginblock", "stopmarginrule", "stopmarkedcontent", "stopmarkpages", "stopmathalignment", "stopmathcases", "stopmathlabeltext", "stopmathmatrix", "stopmathmode", "stopmathstyle", "stopmatrices", "stopmatrix", "stopmaxaligned", "stopmdformula", "stopmidaligned", "stopmiddlealigned", "stopmiddlemakeup", "stopmixedcolumns", "stopmode", "stopmodeset", "stopmodule", "stopmoduletestsection", "stopmpformula", "stopmulticolumns", "stopnamedsection", "stopnamedsubformulas", "stopnarrow", "stopnarrower", "stopnegative", "stopnicelyfilledbox", "stopnointerference", "stopnotallmodes", "stopnotext", "stopnotmode", "stopoperatortext", "stopopposite", "stopoutputstream", "stopoverlay", "stopoverprint", "stoppacked", "stoppagecolumns", "stoppagecomment", "stoppagefigure", "stoppagelayout", "stoppagemakeup", "stoppar", "stopparagraph", "stopparagraphs", "stopparagraphscell", "stopparbuilder", "stoppart", "stoppath", "stopplacechemical", "stopplacefigure", "stopplacefloat", "stopplaceformula", "stopplacegraphic", "stopplaceintermezzo", "stopplacelegend", "stopplacepairedbox", "stopplacetable", "stoppositioning", "stoppositionoverlay", "stoppositive", "stoppostponing", "stoppostponingnotes", "stopprefixtext", "stopprocessassignmentcommand", "stopprocessassignmentlist", "stopprocesscommacommand", "stopprocesscommalist", "stopproduct", "stopproject", "stopprotect", "stopprotectedcolors", "stoppublication", "stoppunctuation", "stopquotation", "stopquote", "stoprandomized", "stoprandomseed", "stoprawsetups", "stopreadingfile", "stopreferenceprefix", "stopregime", "stopreusableMPgraphic", "stoprightaligned", "stopruby", "stopscript", "stopsdformula", "stopsection", "stopsectionblock", "stopsectionblockenvironment", "stopsectionlevel", "stopsetups", "stopshapebox", "stopshift", "stopsidebar", "stopsimplecolumns", "stopspecialitem", "stopspeech", "stopspformula", "stopsplitformula", "stopsplittext", "stopspread", "stopstandardmakeup", "stopstaticMPfigure", "stopstaticMPgraphic", "stopstrictinspectnextcharacter", "stopstrut", "stopstyle", "stopsubformulas", "stopsubject", "stopsubjectlevel", "stopsubsection", "stopsubsentence", "stopsubstack", "stopsubsubject", "stopsubsubsection", "stopsubsubsubject", "stopsubsubsubsection", "stopsubsubsubsubject", "stopsubsubsubsubsection", "stopsubsubsubsubsubject", "stopsuffixtext", "stopsymbolset", "stoptable", "stoptablehead", "stoptables", "stoptabletail", "stoptabletext", "stoptabulate", "stoptabulatehead", "stoptabulatetail", "stoptagged", "stoptaglabeltext", "stoptexcode", "stoptexdefinition", "stoptext", "stoptextbackground", "stoptextbackgroundmanual", "stoptextcolor", "stoptextcolorintent", "stoptextflow", "stoptextmakeup", "stoptextrule", "stopthematrix", "stoptitle", "stoptokenlist", "stoptokens", "stoptransparent", "stoptypescript", "stoptypescriptcollection", "stoptyping", "stopuniqueMPgraphic", "stopuniqueMPpagegraphic", "stopunittext", "stopunpacked", "stopusableMPgraphic", "stopuseMPgraphic", "stopusemathstyleparameter", "stopuserdata", "stopusingbtxspecification", "stopvbox", "stopvboxregister", "stopvboxtohbox", "stopvboxtohboxseparator", "stopviewerlayer", "stopvtop", "stopvtopregister", "stopxcell", "stopxcellgroup", "stopxcolumn", "stopxgroup", "stopxmldisplayverbatim", "stopxmlinlineverbatim", "stopxmlraw", "stopxmlsetups", "stopxrow", "stopxrowgroup", "stopxtable", "stopxtablebody", "stopxtablefoot", "stopxtablehead", "stopxtablenext", "stretched", "strictdoifelsenextoptional", "strictdoifnextoptionalelse", "stripcharacter", "strippedcsname", "stripspaces", "structurelistuservariable", "structurenumber", "structuretitle", "structureuservariable", "structurevariable", "strut", "strutdp", "strutgap", "strutht", "struthtdp", "struttedbox", "strutwd", "style", "styleinstance", "subject", "subpagenumber", "subsection", "subsentence", "subset", "subseteq", "subseteqq", "subsetneq", "subsetneqq", "substituteincommalist", "subsubject", "subsubsection", "subsubsubject", "subsubsubsection", "subsubsubsubject", "subsubsubsubsection", "subsubsubsubsubject", "subtractfeature", "succ", "succapprox", "succcurlyeq", "succeq", "succeqq", "succnapprox", "succneq", "succneqq", "succnsim", "succsim", "suffixlanguage", "suffixtext", "sum", "supset", "supseteq", "supseteqq", "supsetneq", "supsetneqq", "surd", "surdradical", "swapcounts", "swapdimens", "swapface", "swapmacros", "swaptypeface", "swarrow", "switchstyleonly", "switchtobodyfont", "switchtocolor", "switchtointerlinespace", "symbol", "symbolreference", "synchronizeblank", "synchronizeindenting", "synchronizemarking", "synchronizeoutputstreams", "synchronizestrut", "synchronizewhitespace", "synctexblockfilename", "synctexresetfilename", "synctexsetfilename", "systemlog", "systemlogfirst", "systemloglast", "systemsetups", "tLeftarrow", "tLeftrightarrow", "tRightarrow", "tabulateautoline", "tabulateautorule", "tabulateline", "tabulaterule", "taggedctxcommand", "taggedlabeltexts", "taglabellanguage", "taglabeltext", "tau", "tbinom", "tbox", "tcaron", "tcedilla", "tcommaaccent", "tcurl", "tendsto", "tequal", "test", "testandsplitstring", "testcolumn", "testfeature", "testfeatureonce", "testpage", "testpageonly", "testpagesync", "testtokens", "tex", "texdefinition", "texsetup", "textAngstrom", "textacute", "textampersand", "textasciicircum", "textasciitilde", "textat", "textbackslash", "textbar", "textbottomcomma", "textbottomdot", "textbraceleft", "textbraceright", "textbreve", "textbrokenbar", "textbullet", "textcaron", "textcedilla", "textcelsius", "textcent", "textcircledP", "textcircumflex", "textcitation", "textcite", "textcomma", "textcontrolspace", "textcurrency", "textdag", "textddag", "textdegree", "textdiaeresis", "textdiv", "textdollar", "textdong", "textdotaccent", "textellipsis", "texteuro", "textflowcollector", "textfraction", "textgrave", "texthash", "texthorizontalbar", "texthungarumlaut", "texthyphen", "textkelvin", "textlognot", "textmacron", "textmath", "textmho", "textminus", "textmp", "textmu", "textmultiply", "textnumero", "textogonek", "textohm", "textormathchar", "textormathchars", "textounce", "textpercent", "textperiod", "textplus", "textpm", "textreference", "textring", "textrule", "textslash", "textsterling", "texttilde", "textunderscore", "textvisiblespace", "textyen", "thai", "thainumerals", "thedatavalue", "thefirstcharacter", "thematrix", "thenormalizedbodyfontsize", "theorientation", "therefore", "theremainingcharacters", "theta", "thickspace", "thinrule", "thinrules", "thinspace", "thirdderivativesymbol", "thirdoffivearguments", "thirdoffourarguments", "thirdofsixarguments", "thirdofthreearguments", "thirdofthreeunexpanded", "thook", "thookleftarrow", "thookrightarrow", "thorn", "threedigitrounding", "threeeighths", "threefifths", "threeperemspace", "threequarter", "threesuperior", "tibetannumerals", "tightlayer", "tilde", "times", "tinyfont", "title", "tlap", "tleftarrow", "tleftharpoondown", "tleftharpoonup", "tleftrightarrow", "tleftrightharpoons", "tmapsto", "to", "tochar", "tolinenote", "tooltip", "top", "topbox", "topleftbox", "toplinebox", "toprightbox", "topskippedbox", "tracecatcodetables", "tracedfontname", "tracedpagestate", "traceoutputroutines", "tracepositions", "trademark", "translate", "transparencycomponents", "transparent", "transposesymbol", "trel", "triangle", "triangledown", "triangleleft", "triangleq", "triangleright", "trightarrow", "trightharpoondown", "trightharpoonup", "trightleftharpoons", "trightoverleftarrow", "triplebond", "tripleprime", "tripleverticalbar", "truefilename", "truefontname", "tstroke", "ttraggedright", "ttriplerel", "ttwoheadleftarrow", "ttwoheadrightarrow", "turnediota", "twodigitrounding", "twofifths", "twoheaddownarrow", "twoheadleftarrow", "twoheadrightarrow", "twoheadrightarrowtail", "twoheaduparrow", "twosuperior", "twothirds", "tx", "txx", "typ", "type", "typebuffer", "typedefinedbuffer", "typeface", "typefile", "typeinlinebuffer", "typescriptone", "typescriptprefix", "typescriptthree", "typescripttwo", "typesetbuffer", "typesetbufferonly", "typesetfile", "uacute", "ubreve", "ucaron", "uchexnumber", "uchexnumbers", "ucircumflex", "uconvertnumber", "udiaeresis", "udiaeresisacute", "udiaeresiscaron", "udiaeresisgrave", "udiaeresismacron", "udotbelow", "udots", "udoublegrave", "uedcatcodecommand", "ugrave", "uhook", "uhorn", "uhornacute", "uhorndotbelow", "uhorngrave", "uhornhook", "uhorntilde", "uhungarumlaut", "uinvertedbreve", "ulcorner", "umacron", "undefinevalue", "undepthed", "underbar", "underbars", "underbartext", "underbrace", "underbracetext", "underbracket", "underbrackettext", "underdash", "underdashes", "underdot", "underdots", "underleftarrow", "underleftharpoondown", "underleftharpoonup", "underleftrightarrow", "underparent", "underparenttext", "underrandom", "underrandoms", "underrightarrow", "underrightharpoondown", "underrightharpoonup", "underset", "understrike", "understrikes", "undertwoheadleftarrow", "undertwoheadrightarrow", "undoassign", "unexpandeddocumentvariable", "unframed", "unhhbox", "unihex", "uniqueMPgraphic", "uniqueMPpagegraphic", "unit", "unitlanguage", "unitshigh", "unitslow", "unittext", "unknown", "unprotected", "unregisterhyphenationpattern", "unregisterparwrapper", "unspaceafter", "unspaceargument", "unspaced", "unspacestring", "unstackscripts", "untexargument", "untexcommand", "uogonek", "upand", "uparrow", "updasharrow", "updateparagraphdemerits", "updateparagraphpenalties", "updateparagraphproperties", "updateparagraphshapes", "updownarrow", "updownarrowbar", "updownarrows", "upharpoonleft", "upharpoonright", "uplus", "uppercased", "uppercasestring", "uppercasing", "upperleftdoubleninequote", "upperleftdoublesixquote", "upperleftsingleninequote", "upperleftsinglesixquote", "upperrightdoubleninequote", "upperrightdoublesixquote", "upperrightsingleninequote", "upperrightsinglesixquote", "upsilon", "upuparrows", "upwhitearrow", "urcorner", "uring", "url", "useJSscripts", "useMPenvironmentbuffer", "useMPgraphic", "useMPlibrary", "useMPrun", "useMPvariables", "useURL", "usealignparameter", "useblankparameter", "useblocks", "usebodyfont", "usebodyfontparameter", "usebtxdataset", "usebtxdefinitions", "usecitation", "usecolors", "usecomponent", "usedirectory", "usedummycolorparameter", "usedummystyleandcolor", "usedummystyleparameter", "useenvironment", "useexternaldocument", "useexternalfigure", "useexternalrendering", "useexternalsoundtrack", "usefigurebase", "usefile", "usefontpath", "usegridparameter", "usehyphensparameter", "useindentingparameter", "useindentnextparameter", "useinterlinespaceparameter", "uselanguageparameter", "useluamodule", "useluatable", "usemathstyleparameter", "usemodule", "useproduct", "useprofileparameter", "useproject", "usereferenceparameter", "userpagenumber", "usesetupsparameter", "usestaticMPfigure", "usesubpath", "usesymbols", "usetexmodule", "usetypescript", "usetypescriptfile", "useurl", "usezipfile", "utfchar", "utflower", "utfupper", "utilde", "utilityregisterlength", "vDash", "validassignment", "varTheta", "varepsilon", "varkappa", "varnothing", "varphi", "varpi", "varrho", "varsigma", "vartheta", "vboxreference", "vdash", "vdots", "vec", "vee", "veebar", "veeeq", "verbatim", "verbatimstring", "verbosenumber", "version", "vert", "verticalgrowingbar", "verticalpositionbar", "veryraggedcenter", "veryraggedleft", "veryraggedright", "vglue", "viewerlayer", "vl", "vpackbox", "vpackedbox", "vphantom", "vpos", "vsmash", "vsmashbox", "vsmashed", "vspace", "vspacing", "wcircumflex", "wdofstring", "wedge", "wedgeeq", "weekday", "whitearrowupfrombar", "wideacute", "widebar", "widebreve", "widecheck", "wideddot", "widedot", "widegrave", "widehat", "widering", "widetilde", "widthofstring", "widthspanningtext", "withoutpt", "word", "wordright", "words", "wordtonumber", "wp", "wr", "writebetweenlist", "writedatatolist", "writestatus", "writetolist", "xLeftarrow", "xLeftrightarrow", "xRightarrow", "xdefconvertedargument", "xequal", "xfrac", "xhookleftarrow", "xhookrightarrow", "xi", "xleftarrow", "xleftharpoondown", "xleftharpoonup", "xleftrightarrow", "xleftrightharpoons", "xmapsto", "xmladdindex", "xmlafterdocumentsetup", "xmlaftersetup", "xmlall", "xmlappenddocumentsetup", "xmlappendsetup", "xmlapplyselectors", "xmlatt", "xmlattdef", "xmlattribute", "xmlattributedef", "xmlbadinclusions", "xmlbeforedocumentsetup", "xmlbeforesetup", "xmlchainatt", "xmlchainattdef", "xmlchecknamespace", "xmlcommand", "xmlconcat", "xmlconcatrange", "xmlcontext", "xmlcount", "xmldefaulttotext", "xmldepth", "xmldirectives", "xmldirectivesafter", "xmldirectivesbefore", "xmldisplayverbatim", "xmldoif", "xmldoifatt", "xmldoifelse", "xmldoifelseatt", "xmldoifelseempty", "xmldoifelseselfempty", "xmldoifelsetext", "xmldoifelsevalue", "xmldoifnot", "xmldoifnotatt", "xmldoifnotselfempty", "xmldoifnottext", "xmldoifselfempty", "xmldoiftext", "xmlelement", "xmlfilter", "xmlfirst", "xmlflush", "xmlflushcontext", "xmlflushdocumentsetups", "xmlflushlinewise", "xmlflushpure", "xmlflushspacewise", "xmlflushtext", "xmlinclude", "xmlinclusion", "xmlinclusions", "xmlinfo", "xmlinjector", "xmlinlineprettyprint", "xmlinlineprettyprinttext", "xmlinlineverbatim", "xmlinstalldirective", "xmllast", "xmllastatt", "xmllastmatch", "xmllastpar", "xmlloadbuffer", "xmlloaddata", "xmlloaddirectives", "xmlloadfile", "xmlloadonly", "xmlmain", "xmlmapvalue", "xmlname", "xmlnamespace", "xmlnonspace", "xmlpar", "xmlparam", "xmlpath", "xmlpos", "xmlposition", "xmlprependdocumentsetup", "xmlprependsetup", "xmlprettyprint", "xmlprettyprinttext", "xmlprocessbuffer", "xmlprocessdata", "xmlprocessfile", "xmlpure", "xmlraw", "xmlrefatt", "xmlregistereddocumentsetups", "xmlregisteredsetups", "xmlregisterns", "xmlremapname", "xmlremapnamespace", "xmlremovedocumentsetup", "xmlremovesetup", "xmlresetdocumentsetups", "xmlresetinjectors", "xmlresetsetups", "xmlsave", "xmlsetatt", "xmlsetattribute", "xmlsetentity", "xmlsetfunction", "xmlsetinjectors", "xmlsetpar", "xmlsetparam", "xmlsetsetup", "xmlsetup", "xmlshow", "xmlsnippet", "xmlstrip", "xmlstripnolines", "xmlstripped", "xmlstrippednolines", "xmltag", "xmltexentity", "xmltext", "xmltobuffer", "xmltobufferverbose", "xmltofile", "xmlvalue", "xmlverbatim", "xrel", "xrightarrow", "xrightharpoondown", "xrightharpoonup", "xrightleftharpoons", "xrightoverleftarrow", "xsplitstring", "xtriplerel", "xtwoheadleftarrow", "xtwoheadrightarrow", "xxfrac", "xypos", "yacute", "ycircumflex", "ydiaeresis", "ydotbelow", "yen", "ygrave", "yhook", "yiddishnumerals", "ymacron", "ytilde", "zacute", "zcaron", "zdotaccent", "zeronumberconversion", "zerowidthnobreakspace", "zerowidthspace", "zeta", "zhook", "zstroke", "zwj", "zwnj" }, ["en"]={}, } \ No newline at end of file diff --git a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua index be9b2692a49..ecd377f6599 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "unitoctagon", "fulloctagon", "unithexagon", "fullhexagon", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadecenterone", "withshadecentertwo", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "infotext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "withpattern", "withpatternscale", "withpatternfloat", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "enfill", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks", "positionpath", "positioncurve", "positionxy", "positionparagraph", "positioncolumn", "positionwhd", "positionpage", "positionregion", "positionbox", "positionx", "positiony", "positionanchor", "positioninregion", "positionatanchor", "positioncolumnbox", "overlaycolumnbox", "positioncolumnatx", "getposboxes", "getmultipars", "getpospage", "getposparagraph", "getposcolumn", "getposregion", "getposx", "getposy", "getposwidth", "getposheight", "getposdepth", "getposleftskip", "getposrightskip", "getposhsize", "getposparindent", "getposhangindent", "getposhangafter", "getposxy", "getposupperleft", "getposlowerleft", "getposupperright", "getposlowerright", "getposllx", "getposlly", "getposurx", "getposury", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "fromhash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "xslanted", "yslanted", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvard", "mpvarn", "mpvars", "mpvar", "withtolerance", "hatched", "withdashes", "processpath", "pencilled", "sortedintersectiontimes", "intersectionpath", "firstintersectionpath", "secondintersectionpath", "intersectionsfound", "cutbeforefirst", "cutafterfirst", "cutbeforelast", "cutafterlast", "xnormalized", "ynormalized", "xynormalized", "phantom", "scrutinized" }, - ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "shadeoffset", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "crossingdebug", "contextlmtxmode", "metafunversion", "minifunversion", "getparameters", "presetparameters", "hasparameter", "hasoption", "getparameter", "getparameterdefault", "getparametercount", "getmaxparametercount", "getparameterpath", "getparameterpen", "getparametertext", "applyparameters", "mergeparameters", "pushparameters", "popparameters", "setluaparameter", "definecolor", "record", "newrecord", "setrecord", "getrecord", "cntrecord", "anchorxy", "anchorx", "anchory", "anchorht", "anchordp", "anchorul", "anchorll", "anchorlr", "anchorur", "localanchorbox", "localanchorcell", "localanchorspan", "anchorbox", "anchorcell", "anchorspan", "matrixbox", "matrixcell", "matrixspan", "pensilcolor", "pensilstep" }, + ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "unitoctagon", "fulloctagon", "unithexagon", "fullhexagon", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadecenterone", "withshadecentertwo", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "infotext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "withpattern", "withpatternscale", "withpatternfloat", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "enfill", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks", "positionpath", "positioncurve", "positionxy", "positionparagraph", "positioncolumn", "positionwhd", "positionpage", "positionregion", "positionbox", "positionx", "positiony", "positionanchor", "positioninregion", "positionatanchor", "positioncolumnbox", "overlaycolumnbox", "positioncolumnatx", "getposboxes", "getmultipars", "getpospage", "getposparagraph", "getposcolumn", "getposregion", "getposx", "getposy", "getposwidth", "getposheight", "getposdepth", "getposleftskip", "getposrightskip", "getposhsize", "getposparindent", "getposhangindent", "getposhangafter", "getposxy", "getposupperleft", "getposlowerleft", "getposupperright", "getposlowerright", "getposllx", "getposlly", "getposurx", "getposury", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "fromhash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "xslanted", "yslanted", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvard", "mpvarn", "mpvars", "mpvar", "withtolerance", "hatched", "withdashes", "processpath", "pencilled", "sortedintersectiontimes", "intersectionpath", "firstintersectionpath", "secondintersectionpath", "intersectionsfound", "cutbeforefirst", "cutafterfirst", "cutbeforelast", "cutafterlast", "xnormalized", "ynormalized", "xynormalized", "phantom", "scrutinized", "xshifted", "yshifted" }, + ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "shadeoffset", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "crossingdebug", "contextlmtxmode", "metafunversion", "minifunversion", "getparameters", "presetparameters", "hasparameter", "hasoption", "getparameter", "getparameterdefault", "getparametercount", "getmaxparametercount", "getparameterpath", "getparameterpen", "getparametertext", "applyparameters", "mergeparameters", "pushparameters", "popparameters", "setluaparameter", "definecolor", "record", "newrecord", "setrecord", "getrecord", "cntrecord", "anchorxy", "anchorx", "anchory", "anchorht", "anchordp", "anchorul", "anchorll", "anchorlr", "anchorur", "localanchorbox", "localanchorcell", "localanchorspan", "anchorbox", "anchorcell", "anchorspan", "matrixbox", "matrixcell", "matrixspan", "pensilcolor", "pensilstep", "uu" }, } \ No newline at end of file diff --git a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metapost.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metapost.lua index f06e3596925..29643365ed9 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metapost.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metapost.lua @@ -3,7 +3,7 @@ return { ["disabled"]={ "verbatimtex", "troffmode" }, ["internals"]={ "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", "charscale", "inicatcoderegime", "texcatcoderegime", "luacatcoderegime", "notcatcoderegime", "vrbcatcoderegime", "prtcatcoderegime", "ctxcatcoderegime", "txtcatcoderegime", "catcoderegime", "ditto", "EOF", "pen_lft", "pen_rt", "pen_top", "pen_bot" }, ["metafont"]={ "autorounding", "beginchar", "blacker", "boundarychar", "capsule_def", "capsule_end", "change_width", "chardp", "chardx", "chardy", "charexists", "charext", "charht", "charic", "charlist", "charwd", "cull", "cullit", "currenttransform", "currentwindow", "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", "designsize", "display", "displaying", "endchar", "extensible", "extra_beginchar", "extra_endchar", "extra_setup", "fillin", "font_coding_scheme", "font_extra_space", "font_identifier", "font_normal_shrink", "font_normal_space", "font_normal_stretch", "font_quad", "font_size", "font_slant", "font_x_height", "fontdimen", "fontmaking", "gfcorners", "granularity", "grayfont", "headerbyte", "hppp", "hround", "imagerules", "italcorr", "kern", "labelfont", "ligtable", "lowres_fix", "makebox", "makegrid", "maketicks", "mode_def", "mode_setup", "nodisplays", "notransforms", "numspecial", "o_correction", "openit", "openwindow", "pixels_per_inch", "proofing", "proofoffset", "proofrule", "proofrulethickness", "rulepen", "screenchars", "screenrule", "screenstrokes", "screen_cols", "screen_rows", "showit", "slantfont", "smode", "smoothing", "titlefont", "totalweight", "tracingedges", "tracingpens", "turningcheck", "unitpixel", "vppp", "vround", "xoffset", "yoffset" }, - ["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "stacking", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "penspec", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "void", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "setgroup", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withcmykcolor", "withpen", "withstacking", "dashed", "envelope", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "closefrom", "withprescript", "withpostscript", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "colormodel", "graypart", "greypart", "greycolor", "graycolor", "dashpart", "penpart", "stackingpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", "runscript", "maketext", "numbersystem", "overloadmode", "setproperty", "intersectiontimeslist", "arcpoint", "arcpointlist", "subarclength", "maxknotpool", "nocycle", "pathpoint", "pathprecontrol", "pathpostcontrol", "pathdirection", "deltapoint", "deltaprecontrol", "deltapostcontrol", "deltadirection", "corner", "xrange", "yrange", "convexed", "uncontrolled", "nep", "makenep", "withmiterlimit", "withlinejoin", "withlinecap", "centerof", "centerofmass" }, - ["shortcuts"]={ "..", "...", "--", "---", "&", "&&", "\\" }, + ["primitives"]={ "tracingtitles", "tracingequations", "tracingcapsules", "tracingchoices", "tracingspecs", "tracingcommands", "tracingrestores", "tracingmacros", "tracingoutput", "tracingstats", "tracingonline", "year", "month", "day", "time", "hour", "minute", "charcode", "charwd", "charht", "chardp", "charic", "pausing", "showstopping", "texscriptmode", "overloadmode", "linejoin", "linecap", "stacking", "miterlimit", "warningcheck", "truecorners", "defaultcolormodel", "restoreclipcolor", "numbersystem", "numberprecision", "jobname", "addto", "atleast", "begingroup", "controls", "curl", "delimiters", "endgroup", "everyjob", "exitif", "expandafter", "interim", "let", "newinternal", "of", "randomseed", "maxknotpool", "save", "scantokens", "runscript", "maketext", "shipout", "step", "str", "void", "tension", "to", "until", "within", "write", "btex", "verbatimtex", "etex", "def", "vardef", "primarydef", "secondarydef", "tertiarydef", "enddef", "for", "forsuffixes", "forever", "endfor", "quote", "expr", "suffix", "text", "primary", "secondary", "tertiary", "input", "endinput", "if", "fi", "else", "elseif", "true", "false", "nullpicture", "nullpen", "readstring", "pencircle", "normaldeviate", "readfrom", "closefrom", "odd", "known", "unknown", "not", "decimal", "reverse", "uncycle", "makepath", "makepen", "makenep", "convexed", "uncontrolled", "oct", "hex", "ASCII", "char", "length", "turningnumber", "xpart", "ypart", "xxpart", "xypart", "yxpart", "yypart", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "greypart", "colormodel", "prescriptpart", "postscriptpart", "stackingpart", "pathpart", "penpart", "dashpart", "sqrt", "mexp", "mlog", "sind", "cosd", "floor", "uniformdeviate", "llcorner", "lrcorner", "ulcorner", "urcorner", "centerof", "centerofmass", "corners", "xrange", "yrange", "deltapoint", "deltaprecontrol", "deltapostcontrol", "deltadirection", "arclength", "angle", "cycle", "nocycle", "stroked", "filled", "clipped", "grouped", "bounded", "or", "and", "substring", "subpath", "directiontime", "point", "precontrol", "postcontrol", "direction", "pathpoint", "pathprecontrol", "pathpostcontrol", "pathdirection", "penoffset", "arctime", "arcpoint", "arcpointlist", "subarclength", "mpversion", "rotated", "slanted", "scaled", "shifted", "transformed", "xscaled", "yscaled", "zscaled", "intersectiontimes", "intersectiontimeslist", "envelope", "boundingpath", "numeric", "string", "boolean", "path", "pen", "nep", "picture", "transform", "color", "rgbcolor", "cmykcolor", "pair", "end", "dump", "batchmode", "nonstopmode", "scrollmode", "errorstopmode", "silentmode", "inner", "outer", "setproperty", "showtoken", "showstats", "show", "showvariable", "showdependencies", "doublepath", "contour", "also", "withpen", "dashed", "withprescript", "withpostscript", "withstacking", "withlinecap", "withlinejoin", "withmiterlimit", "withoutcolor", "withgreyscale", "withcolor", "withrgbcolor", "withcmykcolor", "clip", "setgroup", "setbounds", "message", "errmessage", "errhelp", "graypart" }, + ["shortcuts"]={ "..", "...", "--", "---", "&", "&&", "&&&", "&&&&", "\\" }, ["tex"]={ "btex", "etex", "verbatimtex" }, } \ No newline at end of file diff --git a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-tex.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-tex.lua index 4ed2037840a..48c73ba586d 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-tex.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-tex.lua @@ -1,9 +1,9 @@ return { ["aleph"]={ "Alephminorversion", "Alephrevision", "Alephversion" }, - ["etex"]={ "botmarks", "clubpenalties", "currentgrouplevel", "currentgrouptype", "currentifbranch", "currentiflevel", "currentiftype", "detokenize", "dimexpr", "displaywidowpenalties", "everyeof", "firstmarks", "fontchardp", "fontcharht", "fontcharic", "fontcharwd", "glueexpr", "glueshrink", "glueshrinkorder", "gluestretch", "gluestretchorder", "gluetomu", "ifcsname", "ifdefined", "iffontchar", "interactionmode", "interlinepenalties", "lastlinefit", "lastnodetype", "marks", "muexpr", "mutoglue", "numexpr", "pagediscards", "parshapedimen", "parshapeindent", "parshapelength", "predisplaydirection", "protected", "savinghyphcodes", "savingvdiscards", "scantokens", "showgroups", "showifs", "showtokens", "splitbotmarks", "splitdiscards", "splitfirstmarks", "topmarks", "tracingassigns", "tracinggroups", "tracingifs", "tracingnesting", "unexpanded", "unless", "widowpenalties" }, - ["luatex"]={ "Uabove", "Uabovewithdelims", "Uatop", "Uatopwithdelims", "Uchar", "Udelcode", "Udelimited", "Udelimiter", "Udelimiterover", "Udelimiterunder", "Uhextensible", "Uleft", "Umathaccent", "Umathaccentbasedepth", "Umathaccentbaseheight", "Umathaccentbottomovershoot", "Umathaccentbottomshiftdown", "Umathaccentextendmargin", "Umathaccentsuperscriptdrop", "Umathaccentsuperscriptpercent", "Umathaccenttopovershoot", "Umathaccenttopshiftup", "Umathaccentvariant", "Umathadapttoleft", "Umathadapttoright", "Umathaxis", "Umathbottomaccentvariant", "Umathchar", "Umathcharclass", "Umathchardef", "Umathcharfam", "Umathcharslot", "Umathclass", "Umathcode", "Umathconnectoroverlapmin", "Umathdegreevariant", "Umathdelimiterextendmargin", "Umathdelimiterovervariant", "Umathdelimiterpercent", "Umathdelimitershortfall", "Umathdelimiterundervariant", "Umathdenominatorvariant", "Umathdict", "Umathdictdef", "Umathdiscretionary", "Umathextrasubpreshift", "Umathextrasubprespace", "Umathextrasubshift", "Umathextrasubspace", "Umathextrasuppreshift", "Umathextrasupprespace", "Umathextrasupshift", "Umathextrasupspace", "Umathflattenedaccentbasedepth", "Umathflattenedaccentbaseheight", "Umathflattenedaccentbottomshiftdown", "Umathflattenedaccenttopshiftup", "Umathfractiondelsize", "Umathfractiondenomdown", "Umathfractiondenomvgap", "Umathfractionnumup", "Umathfractionnumvgap", "Umathfractionrule", "Umathfractionvariant", "Umathhextensiblevariant", "Umathlimitabovebgap", "Umathlimitabovekern", "Umathlimitabovevgap", "Umathlimitbelowbgap", "Umathlimitbelowkern", "Umathlimitbelowvgap", "Umathlimits", "Umathnoaxis", "Umathnolimits", "Umathnolimitsubfactor", "Umathnolimitsupfactor", "Umathnumeratorvariant", "Umathopenupdepth", "Umathopenupheight", "Umathoperatorsize", "Umathoverbarkern", "Umathoverbarrule", "Umathoverbarvgap", "Umathoverdelimiterbgap", "Umathoverdelimitervariant", "Umathoverdelimitervgap", "Umathoverlayaccentvariant", "Umathoverlinevariant", "Umathphantom", "Umathpresubshiftdistance", "Umathpresupshiftdistance", "Umathprimeraise", "Umathprimeraisecomposed", "Umathprimeshiftdrop", "Umathprimeshiftup", "Umathprimespaceafter", "Umathprimevariant", "Umathprimewidth", "Umathquad", "Umathradicaldegreeafter", "Umathradicaldegreebefore", "Umathradicaldegreeraise", "Umathradicalextensibleafter", "Umathradicalextensiblebefore", "Umathradicalkern", "Umathradicalrule", "Umathradicalvariant", "Umathradicalvgap", "Umathruledepth", "Umathruleheight", "Umathskeweddelimitertolerance", "Umathskewedfractionhgap", "Umathskewedfractionvgap", "Umathsource", "Umathspaceafterscript", "Umathspacebeforescript", "Umathstackdenomdown", "Umathstacknumup", "Umathstackvariant", "Umathstackvgap", "Umathsubscriptvariant", "Umathsubshiftdistance", "Umathsubshiftdown", "Umathsubshiftdrop", "Umathsubsupshiftdown", "Umathsubsupvgap", "Umathsubtopmax", "Umathsupbottommin", "Umathsuperscriptvariant", "Umathsupshiftdistance", "Umathsupshiftdrop", "Umathsupshiftup", "Umathsupsubbottommax", "Umathtopaccentvariant", "Umathunderbarkern", "Umathunderbarrule", "Umathunderbarvgap", "Umathunderdelimiterbgap", "Umathunderdelimitervariant", "Umathunderdelimitervgap", "Umathunderlinevariant", "Umathuseaxis", "Umathvextensiblevariant", "Umathvoid", "Umathxscale", "Umathyscale", "Umiddle", "Unosubprescript", "Unosubscript", "Unosuperprescript", "Unosuperscript", "Uoperator", "Uover", "Uoverdelimiter", "Uoverwithdelims", "Uprimescript", "Uradical", "Uright", "Uroot", "Urooted", "Ushiftedsubprescript", "Ushiftedsubscript", "Ushiftedsuperprescript", "Ushiftedsuperscript", "Uskewed", "Uskewedwithdelims", "Ustack", "Ustartdisplaymath", "Ustartmath", "Ustartmathmode", "Ustopdisplaymath", "Ustopmath", "Ustopmathmode", "Ustretched", "Ustretchedwithdelims", "Ustyle", "Usubprescript", "Usubscript", "Usuperprescript", "Usuperscript", "Uunderdelimiter", "Uvextensible", "adjustspacing", "adjustspacingshrink", "adjustspacingstep", "adjustspacingstretch", "afterassigned", "aftergrouped", "aliased", "aligncontent", "alignmark", "alignmentcellsource", "alignmentwrapsource", "aligntab", "allcrampedstyles", "alldisplaystyles", "allmainstyles", "allmathstyles", "allscriptscriptstyles", "allscriptstyles", "allsplitstyles", "alltextstyles", "alluncrampedstyles", "allunsplitstyles", "amcode", "atendofgroup", "atendofgrouped", "attribute", "attributedef", "automaticdiscretionary", "automatichyphenpenalty", "automigrationmode", "autoparagraphmode", "begincsname", "beginlocalcontrol", "beginmathgroup", "beginsimplegroup", "boundary", "boxadapt", "boxanchor", "boxanchors", "boxattribute", "boxdirection", "boxfreeze", "boxgeometry", "boxorientation", "boxrepack", "boxshift", "boxsource", "boxtarget", "boxtotal", "boxvadjust", "boxxmove", "boxxoffset", "boxymove", "boxyoffset", "catcodetable", "cdef", "cdefcsname", "cfcode", "clearmarks", "constant", "copymathatomrule", "copymathparent", "copymathspacing", "crampeddisplaystyle", "crampedscriptscriptstyle", "crampedscriptstyle", "crampedtextstyle", "csactive", "csstring", "currentloopiterator", "currentloopnesting", "currentmarks", "dbox", "defcsname", "deferred", "detokenized", "dimensiondef", "dimexpression", "directlua", "dpack", "dsplit", "edefcsname", "efcode", "endlocalcontrol", "endmathgroup", "endsimplegroup", "enforced", "etoks", "etoksapp", "etokspre", "eufactor", "everybeforepar", "everymathatom", "everytab", "exceptionpenalty", "expand", "expandactive", "expandafterpars", "expandafterspaces", "expandcstoken", "expanded", "expandedafter", "expandedloop", "expandtoken", "explicitdiscretionary", "explicithyphenpenalty", "firstvalidlanguage", "float", "floatdef", "floatexpr", "flushmarks", "fontcharba", "fontcharta", "fontid", "fontmathcontrol", "fontspecdef", "fontspecid", "fontspecifiedname", "fontspecifiedsize", "fontspecscale", "fontspecxscale", "fontspecyscale", "fonttextcontrol", "formatname", "frozen", "futurecsname", "futuredef", "futureexpand", "futureexpandis", "futureexpandisap", "gdefcsname", "gleaders", "glet", "gletcsname", "glettonothing", "gluespecdef", "glyph", "glyphdatafield", "glyphoptions", "glyphscale", "glyphscriptfield", "glyphscriptscale", "glyphscriptscriptscale", "glyphstatefield", "glyphtextscale", "glyphxoffset", "glyphxscale", "glyphxscaled", "glyphyoffset", "glyphyscale", "glyphyscaled", "gtoksapp", "gtokspre", "hccode", "hjcode", "hmcode", "holdingmigrations", "hpack", "hyphenationmin", "hyphenationmode", "ifabsdim", "ifabsfloat", "ifabsnum", "ifarguments", "ifboolean", "ifchkdim", "ifchkdimension", "ifchknum", "ifchknumber", "ifcmpdim", "ifcmpnum", "ifcondition", "ifcstok", "ifdimexpression", "ifdimval", "ifempty", "ifflags", "iffloat", "ifhaschar", "ifhastok", "ifhastoks", "ifhasxtoks", "ifincsname", "ifinsert", "ifmathparameter", "ifmathstyle", "ifnumexpression", "ifnumval", "ifparameter", "ifparameters", "ifrelax", "iftok", "ifzerodim", "ifzerofloat", "ifzeronum", "ignorearguments", "ignoredepthcriterium", "ignorepars", "immediate", "immutable", "indexofcharacter", "indexofregister", "inherited", "initcatcodetable", "insertbox", "insertcopy", "insertdepth", "insertdistance", "insertheight", "insertheights", "insertlimit", "insertmaxdepth", "insertmode", "insertmultiplier", "insertpenalty", "insertprogress", "insertstorage", "insertstoring", "insertunbox", "insertuncopy", "insertwidth", "instance", "integerdef", "lastarguments", "lastatomclass", "lastboundary", "lastchkdim", "lastchknum", "lastleftclass", "lastloopiterator", "lastnamedcs", "lastnodesubtype", "lastpageextra", "lastparcontext", "lastrightclass", "leftmarginkern", "letcharcode", "letcsname", "letfrozen", "letmathatomrule", "letmathparent", "letmathspacing", "letprotected", "lettonothing", "linebreakcriterium", "linedirection", "localbrokenpenalty", "localcontrol", "localcontrolled", "localcontrolledloop", "localinterlinepenalty", "localleftbox", "localleftboxbox", "localmiddlebox", "localmiddleboxbox", "localrightbox", "localrightboxbox", "lpcode", "luabytecode", "luabytecodecall", "luacopyinputnodes", "luadef", "luaescapestring", "luafunction", "luafunctioncall", "luatexbanner", "luatexrevision", "luatexversion", "mathaccent", "mathatom", "mathatomglue", "mathatomskip", "mathbackwardpenalties", "mathbeginclass", "mathbinary", "mathcheckfencesmode", "mathclose", "mathdictgroup", "mathdictproperties", "mathdirection", "mathdisplaymode", "mathdisplayskipmode", "mathdoublescriptmode", "mathendclass", "matheqnogapstep", "mathfenced", "mathfontcontrol", "mathforwardpenalties", "mathfraction", "mathghost", "mathgluemode", "mathgroupingmode", "mathinner", "mathleftclass", "mathlimitsmode", "mathmainstyle", "mathmiddle", "mathnolimitsmode", "mathopen", "mathoperator", "mathordinary", "mathoverline", "mathpenaltiesmode", "mathpunctuation", "mathradical", "mathrelation", "mathrightclass", "mathrulesfam", "mathrulesmode", "mathscale", "mathscriptsmode", "mathslackmode", "mathspacingmode", "mathstackstyle", "mathstyle", "mathstylefontid", "mathsurroundmode", "mathsurroundskip", "maththreshold", "mathunderline", "meaningasis", "meaningful", "meaningfull", "meaningles", "meaningless", "mugluespecdef", "mutable", "noaligned", "noatomruling", "noboundary", "nohrule", "norelax", "normalizelinemode", "normalizeparmode", "nospaces", "novrule", "numericscale", "numexpression", "orelse", "orphanpenalties", "orphanpenalty", "orunless", "outputbox", "overloaded", "overloadmode", "overshoot", "pageboundary", "pageextragoal", "pagevsize", "parametercount", "parametermark", "parattribute", "pardirection", "permanent", "pettymuskip", "positdef", "postexhyphenchar", "posthyphenchar", "postinlinepenalty", "prebinoppenalty", "predisplaygapfactor", "preexhyphenchar", "prehyphenchar", "preinlinepenalty", "prerelpenalty", "protrudechars", "protrusionboundary", "pxdimen", "quitloop", "quitvmode", "resetmathspacing", "retokenized", "rightmarginkern", "rpcode", "savecatcodetable", "scaledemwidth", "scaledexheight", "scaledextraspace", "scaledfontdimen", "scaledinterwordshrink", "scaledinterwordspace", "scaledinterwordstretch", "scaledmathstyle", "scaledslantperpoint", "scantextokens", "semiexpand", "semiexpanded", "semiprotected", "setdefaultmathcodes", "setfontid", "setmathatomrule", "setmathdisplaypostpenalty", "setmathdisplayprepenalty", "setmathignore", "setmathoptions", "setmathpostpenalty", "setmathprepenalty", "setmathspacing", "shapingpenaltiesmode", "shapingpenalty", "snapshotpar", "srule", "supmarkmode", "swapcsvalues", "tabsize", "textdirection", "thewithoutunit", "tinymuskip", "todimension", "tohexadecimal", "tointeger", "tokenized", "toksapp", "tokspre", "tolerant", "tomathstyle", "toscaled", "tosparsedimension", "tosparsescaled", "tpack", "tracingadjusts", "tracingalignments", "tracingexpressions", "tracingfonts", "tracingfullboxes", "tracinghyphenation", "tracinginserts", "tracinglevels", "tracinglists", "tracingmarks", "tracingmath", "tracingnodes", "tracingpenalties", "tsplit", "uleaders", "undent", "unexpandedloop", "unhpack", "unletfrozen", "unletprotected", "untraced", "unvpack", "variablefam", "virtualhrule", "virtualvrule", "vpack", "wordboundary", "wrapuppar", "xdefcsname", "xtoks", "xtoksapp", "xtokspre" }, + ["etex"]={ "botmarks", "clubpenalties", "currentgrouplevel", "currentgrouptype", "currentifbranch", "currentiflevel", "currentiftype", "currentstacksize", "detokenize", "dimexpr", "displaywidowpenalties", "everyeof", "firstmarks", "fontchardp", "fontcharht", "fontcharic", "fontcharwd", "glueexpr", "glueshrink", "glueshrinkorder", "gluestretch", "gluestretchorder", "gluetomu", "ifcsname", "ifdefined", "iffontchar", "interactionmode", "interlinepenalties", "lastlinefit", "lastnodetype", "marks", "muexpr", "mutoglue", "numexpr", "pagediscards", "parshapedimen", "parshapeindent", "parshapelength", "predisplaydirection", "protected", "savinghyphcodes", "savingvdiscards", "scantokens", "showgroups", "showifs", "showtokens", "splitbotmarks", "splitdiscards", "splitfirstmarks", "topmarks", "tracingassigns", "tracinggroups", "tracingifs", "tracingnesting", "unexpanded", "unless", "widowpenalties" }, + ["luatex"]={ "Uabove", "Uabovewithdelims", "Uatop", "Uatopwithdelims", "Udelcode", "Udelimited", "Udelimiter", "Udelimiterover", "Udelimiterunder", "Uhextensible", "Uleft", "Umathaccent", "Umathaccentbasedepth", "Umathaccentbaseheight", "Umathaccentbottomovershoot", "Umathaccentbottomshiftdown", "Umathaccentextendmargin", "Umathaccentsuperscriptdrop", "Umathaccentsuperscriptpercent", "Umathaccenttopovershoot", "Umathaccenttopshiftup", "Umathaccentvariant", "Umathadapttoleft", "Umathadapttoright", "Umathaxis", "Umathbottomaccentvariant", "Umathchar", "Umathchardef", "Umathcode", "Umathconnectoroverlapmin", "Umathdegreevariant", "Umathdelimiterextendmargin", "Umathdelimiterovervariant", "Umathdelimiterpercent", "Umathdelimitershortfall", "Umathdelimiterundervariant", "Umathdenominatorvariant", "Umathdictdef", "Umathexheight", "Umathextrasubpreshift", "Umathextrasubprespace", "Umathextrasubshift", "Umathextrasubspace", "Umathextrasuppreshift", "Umathextrasupprespace", "Umathextrasupshift", "Umathextrasupspace", "Umathflattenedaccentbasedepth", "Umathflattenedaccentbaseheight", "Umathflattenedaccentbottomshiftdown", "Umathflattenedaccenttopshiftup", "Umathfractiondelsize", "Umathfractiondenomdown", "Umathfractiondenomvgap", "Umathfractionnumup", "Umathfractionnumvgap", "Umathfractionrule", "Umathfractionvariant", "Umathhextensiblevariant", "Umathlimitabovebgap", "Umathlimitabovekern", "Umathlimitabovevgap", "Umathlimitbelowbgap", "Umathlimitbelowkern", "Umathlimitbelowvgap", "Umathlimits", "Umathnoaxis", "Umathnolimits", "Umathnolimitsubfactor", "Umathnolimitsupfactor", "Umathnumeratorvariant", "Umathopenupdepth", "Umathopenupheight", "Umathoperatorsize", "Umathoverbarkern", "Umathoverbarrule", "Umathoverbarvgap", "Umathoverdelimiterbgap", "Umathoverdelimitervariant", "Umathoverdelimitervgap", "Umathoverlayaccentvariant", "Umathoverlinevariant", "Umathphantom", "Umathpresubshiftdistance", "Umathpresupshiftdistance", "Umathprimeraise", "Umathprimeraisecomposed", "Umathprimeshiftdrop", "Umathprimeshiftup", "Umathprimespaceafter", "Umathprimevariant", "Umathprimewidth", "Umathquad", "Umathradicaldegreeafter", "Umathradicaldegreebefore", "Umathradicaldegreeraise", "Umathradicalextensibleafter", "Umathradicalextensiblebefore", "Umathradicalkern", "Umathradicalrule", "Umathradicalvariant", "Umathradicalvgap", "Umathruledepth", "Umathruleheight", "Umathskeweddelimitertolerance", "Umathskewedfractionhgap", "Umathskewedfractionvgap", "Umathsource", "Umathspaceafterscript", "Umathspacebeforescript", "Umathspacebetweenscript", "Umathstackdenomdown", "Umathstacknumup", "Umathstackvariant", "Umathstackvgap", "Umathsubscriptsnap", "Umathsubscriptvariant", "Umathsubshiftdistance", "Umathsubshiftdown", "Umathsubshiftdrop", "Umathsubsupshiftdown", "Umathsubsupvgap", "Umathsubtopmax", "Umathsupbottommin", "Umathsuperscriptsnap", "Umathsuperscriptvariant", "Umathsupshiftdistance", "Umathsupshiftdrop", "Umathsupshiftup", "Umathsupsubbottommax", "Umathtopaccentvariant", "Umathunderbarkern", "Umathunderbarrule", "Umathunderbarvgap", "Umathunderdelimiterbgap", "Umathunderdelimitervariant", "Umathunderdelimitervgap", "Umathunderlinevariant", "Umathuseaxis", "Umathvextensiblevariant", "Umathvoid", "Umathxscale", "Umathyscale", "Umiddle", "Uoperator", "Uover", "Uoverdelimiter", "Uoverwithdelims", "Uradical", "Uright", "Uroot", "Urooted", "Uskewed", "Uskewedwithdelims", "Ustartdisplaymath", "Ustartmath", "Ustartmathmode", "Ustopdisplaymath", "Ustopmath", "Ustopmathmode", "Ustretched", "Ustretchedwithdelims", "Uunderdelimiter", "Uvextensible", "additionalpageskip", "adjustspacing", "adjustspacingshrink", "adjustspacingstep", "adjustspacingstretch", "advanceby", "afterassigned", "aftergrouped", "aliased", "aligncontent", "alignmark", "alignmentcellsource", "alignmentwrapsource", "aligntab", "allcrampedstyles", "alldisplaystyles", "allmainstyles", "allmathstyles", "allscriptscriptstyles", "allscriptstyles", "allsplitstyles", "alltextstyles", "alluncrampedstyles", "allunsplitstyles", "amcode", "associateunit", "atendoffile", "atendoffiled", "atendofgroup", "atendofgrouped", "attribute", "attributedef", "automaticdiscretionary", "automatichyphenpenalty", "automigrationmode", "autoparagraphmode", "begincsname", "beginlocalcontrol", "beginmathgroup", "beginsimplegroup", "boundary", "boxadapt", "boxanchor", "boxanchors", "boxattribute", "boxdirection", "boxfinalize", "boxfreeze", "boxgeometry", "boxlimit", "boxlimitate", "boxlimitmode", "boxorientation", "boxrepack", "boxshift", "boxshrink", "boxsource", "boxstretch", "boxtarget", "boxtotal", "boxvadjust", "boxxmove", "boxxoffset", "boxymove", "boxyoffset", "catcodetable", "cdef", "cdefcsname", "cfcode", "clearmarks", "constant", "constrained", "copymathatomrule", "copymathparent", "copymathspacing", "crampeddisplaystyle", "crampedscriptscriptstyle", "crampedscriptstyle", "crampedtextstyle", "csactive", "csstring", "currentloopiterator", "currentloopnesting", "currentlysetmathstyle", "currentmarks", "dbox", "defcsname", "deferred", "detokened", "detokenized", "dimensiondef", "dimexpression", "directlua", "discretionaryoptions", "divideby", "doubleadjdemerits", "dpack", "dsplit", "edefcsname", "edivide", "edivideby", "efcode", "emergencyleftskip", "emergencyrightskip", "endlocalcontrol", "endmathgroup", "endsimplegroup", "enforced", "etoks", "etoksapp", "etokspre", "eufactor", "everybeforepar", "everymathatom", "everytab", "exceptionpenalty", "expand", "expandactive", "expandafterpars", "expandafterspaces", "expandcstoken", "expanded", "expandedafter", "expandeddetokenize", "expandedendless", "expandedloop", "expandedrepeat", "expandparameter", "expandtoken", "expandtoks", "explicitdiscretionary", "explicithyphenpenalty", "explicititaliccorrection", "explicitspace", "firstvalidlanguage", "float", "floatdef", "floatexpr", "flushmarks", "fontcharba", "fontcharta", "fontid", "fontmathcontrol", "fontspecdef", "fontspecid", "fontspecifiedname", "fontspecifiedsize", "fontspecscale", "fontspecslant", "fontspecweight", "fontspecxscale", "fontspecyscale", "fonttextcontrol", "forcedleftcorrection", "forcedrightcorrection", "formatname", "frozen", "futurecsname", "futuredef", "futureexpand", "futureexpandis", "futureexpandisap", "gdefcsname", "givenmathstyle", "gleaders", "glet", "gletcsname", "glettonothing", "gluespecdef", "glyph", "glyphdatafield", "glyphoptions", "glyphscale", "glyphscriptfield", "glyphscriptscale", "glyphscriptscriptscale", "glyphslant", "glyphstatefield", "glyphtextscale", "glyphweight", "glyphxoffset", "glyphxscale", "glyphxscaled", "glyphyoffset", "glyphyscale", "glyphyscaled", "gtoksapp", "gtokspre", "hccode", "hjcode", "hmcode", "holdingmigrations", "hpack", "hpenalty", "hyphenationmin", "hyphenationmode", "ifabsdim", "ifabsfloat", "ifabsnum", "ifarguments", "ifboolean", "ifchkdim", "ifchkdimension", "ifchknum", "ifchknumber", "ifcmpdim", "ifcmpnum", "ifcondition", "ifcramped", "ifcstok", "ifdimexpression", "ifdimval", "ifempty", "ifflags", "iffloat", "ifhaschar", "ifhastok", "ifhastoks", "ifhasxtoks", "ifinalignment", "ifincsname", "ifinsert", "ifintervaldim", "ifintervalfloat", "ifintervalnum", "iflastnamedcs", "ifmathparameter", "ifmathstyle", "ifnumexpression", "ifnumval", "ifparameter", "ifparameters", "ifrelax", "iftok", "ifzerodim", "ifzerofloat", "ifzeronum", "ignorearguments", "ignoredepthcriterion", "ignorenestedupto", "ignorepars", "ignorerest", "ignoreupto", "immediate", "immutable", "indexofcharacter", "indexofregister", "inherited", "initcatcodetable", "initialpageskip", "initialtopskip", "insertbox", "insertcopy", "insertdepth", "insertdistance", "insertheight", "insertheights", "insertlimit", "insertmaxdepth", "insertmode", "insertmultiplier", "insertpenalty", "insertprogress", "insertstorage", "insertstoring", "insertunbox", "insertuncopy", "insertwidth", "instance", "integerdef", "lastarguments", "lastatomclass", "lastboundary", "lastchkdimension", "lastchknumber", "lastleftclass", "lastloopiterator", "lastnamedcs", "lastnodesubtype", "lastpageextra", "lastparcontext", "lastpartrigger", "lastrightclass", "leftmarginkern", "letcharcode", "letcsname", "letfrozen", "letmathatomrule", "letmathparent", "letmathspacing", "letprotected", "lettolastnamedcs", "lettonothing", "linebreakcriterion", "linebreakoptional", "linebreakpasses", "linedirection", "localbrokenpenalty", "localcontrol", "localcontrolled", "localcontrolledendless", "localcontrolledloop", "localcontrolledrepeat", "localinterlinepenalty", "localleftbox", "localleftboxbox", "localmiddlebox", "localmiddleboxbox", "localpretolerance", "localrightbox", "localrightboxbox", "localtolerance", "lpcode", "luabytecode", "luabytecodecall", "luacopyinputnodes", "luadef", "luaescapestring", "luafunction", "luafunctioncall", "luatexbanner", "luatexrevision", "luatexversion", "mathatom", "mathatomglue", "mathatomskip", "mathbackwardpenalties", "mathbeginclass", "mathboundary", "mathcharclass", "mathcharfam", "mathcharslot", "mathcheckfencesmode", "mathclass", "mathdictgroup", "mathdictionary", "mathdictproperties", "mathdirection", "mathdiscretionary", "mathdisplaymode", "mathdisplaypenaltyfactor", "mathdisplayskipmode", "mathdoublescriptmode", "mathendclass", "matheqnogapstep", "mathfontcontrol", "mathforwardpenalties", "mathgluemode", "mathgroupingmode", "mathinlinepenaltyfactor", "mathleftclass", "mathlimitsmode", "mathmainstyle", "mathnolimitsmode", "mathparentstyle", "mathpenaltiesmode", "mathpretolerance", "mathrightclass", "mathrulesfam", "mathrulesmode", "mathscale", "mathscriptsmode", "mathslackmode", "mathspacingmode", "mathstack", "mathstackstyle", "mathstyle", "mathstylefontid", "mathsurroundmode", "mathsurroundskip", "maththreshold", "mathtolerance", "meaningasis", "meaningful", "meaningfull", "meaningles", "meaningless", "mugluespecdef", "multiplyby", "mutable", "nestedloopiterator", "noaligned", "noatomruling", "noboundary", "nohrule", "nomathchar", "norelax", "normalizelinemode", "normalizeparmode", "noscript", "nospaces", "nosubprescript", "nosubscript", "nosuperprescript", "nosuperscript", "novrule", "numericscale", "numericscaled", "numexpression", "optionalboundary", "orelse", "orphanpenalties", "orphanpenalty", "orunless", "outputbox", "overloaded", "overloadmode", "overshoot", "pageboundary", "pagedepth", "pageexcess", "pageextragoal", "pagefistretch", "pagelastdepth", "pagelastfilllstretch", "pagelastfillstretch", "pagelastfilstretch", "pagelastfistretch", "pagelastheight", "pagelastshrink", "pagelaststretch", "pagevsize", "parametercount", "parameterdef", "parameterindex", "parametermark", "parametermode", "parattribute", "pardirection", "parfillleftskip", "parfillrightskip", "parinitleftskip", "parinitrightskip", "parpasses", "parshapewidth", "permanent", "pettymuskip", "positdef", "postexhyphenchar", "posthyphenchar", "postinlinepenalty", "postshortinlinepenalty", "prebinoppenalty", "predisplaygapfactor", "preexhyphenchar", "prehyphenchar", "preinlinepenalty", "prerelpenalty", "preshortinlinepenalty", "previousloopiterator", "primescript", "protecteddetokenize", "protectedexpandeddetokenize", "protrudechars", "protrusionboundary", "pxdimen", "quitloop", "quitloopnow", "quitvmode", "rdivide", "rdivideby", "realign", "resetmathspacing", "restorecatcodetable", "retained", "retokenized", "rightmarginkern", "rpcode", "savecatcodetable", "scaledemwidth", "scaledexheight", "scaledextraspace", "scaledfontcharba", "scaledfontchardp", "scaledfontcharht", "scaledfontcharic", "scaledfontcharta", "scaledfontcharwd", "scaledfontdimen", "scaledinterwordshrink", "scaledinterwordspace", "scaledinterwordstretch", "scaledmathaxis", "scaledmathemwidth", "scaledmathexheight", "scaledmathstyle", "scaledslantperpoint", "scantextokens", "scriptspaceafterfactor", "scriptspacebeforefactor", "scriptspacebetweenfactor", "semiexpand", "semiexpanded", "semiprotected", "setdefaultmathcodes", "setfontid", "setmathatomrule", "setmathdisplaypostpenalty", "setmathdisplayprepenalty", "setmathignore", "setmathoptions", "setmathpostpenalty", "setmathprepenalty", "setmathspacing", "shapingpenaltiesmode", "shapingpenalty", "shiftedsubprescript", "shiftedsubscript", "shiftedsuperprescript", "shiftedsuperscript", "shortinlinemaththreshold", "shortinlineorphanpenalty", "showcodestack", "showstack", "singlelinepenalty", "snapshotpar", "spacefactormode", "spacefactorshrinklimit", "spacefactorstretchlimit", "srule", "subprescript", "subscript", "superprescript", "superscript", "supmarkmode", "swapcsvalues", "tabsize", "textdirection", "thewithoutunit", "tinymuskip", "tocharacter", "todimension", "tohexadecimal", "tointeger", "tokenized", "toksapp", "tokspre", "tolerant", "tomathstyle", "toscaled", "tosparsedimension", "tosparsescaled", "tpack", "tracingadjusts", "tracingalignments", "tracingexpressions", "tracingfullboxes", "tracinghyphenation", "tracinginserts", "tracinglevels", "tracinglists", "tracingmarks", "tracingmath", "tracingnodes", "tracingpasses", "tracingpenalties", "tsplit", "uleaders", "undent", "unexpandedendless", "unexpandedloop", "unexpandedrepeat", "unhpack", "unletfrozen", "unletprotected", "untraced", "unvpack", "variablefam", "virtualhrule", "virtualvrule", "vpack", "vpenalty", "wordboundary", "wrapuppar", "xdefcsname", "xtoks", "xtoksapp", "xtokspre" }, ["omega"]={ "Omegaminorversion", "Omegarevision", "Omegaversion" }, ["pdftex"]={ "ifpdfabsdim", "ifpdfabsnum", "ifpdfprimitive", "pdfadjustspacing", "pdfannot", "pdfcatalog", "pdfcolorstack", "pdfcolorstackinit", "pdfcompresslevel", "pdfcopyfont", "pdfcreationdate", "pdfdecimaldigits", "pdfdest", "pdfdestmargin", "pdfdraftmode", "pdfeachlinedepth", "pdfeachlineheight", "pdfendlink", "pdfendthread", "pdffirstlineheight", "pdffontattr", "pdffontexpand", "pdffontname", "pdffontobjnum", "pdffontsize", "pdfgamma", "pdfgentounicode", "pdfglyphtounicode", "pdfhorigin", "pdfignoreddimen", "pdfignoreunknownimages", "pdfimageaddfilename", "pdfimageapplygamma", "pdfimagegamma", "pdfimagehicolor", "pdfimageresolution", "pdfincludechars", "pdfinclusioncopyfonts", "pdfinclusionerrorlevel", "pdfinfo", "pdfinfoomitdate", "pdfinsertht", "pdflastannot", "pdflastlinedepth", "pdflastlink", "pdflastobj", "pdflastxform", "pdflastximage", "pdflastximagepages", "pdflastxpos", "pdflastypos", "pdflinkmargin", "pdfliteral", "pdfmajorversion", "pdfmapfile", "pdfmapline", "pdfminorversion", "pdfnames", "pdfnoligatures", "pdfnormaldeviate", "pdfobj", "pdfobjcompresslevel", "pdfomitcharset", "pdfomitcidset", "pdfomitinfodict", "pdfoutline", "pdfoutput", "pdfpageattr", "pdfpagebox", "pdfpageheight", "pdfpageref", "pdfpageresources", "pdfpagesattr", "pdfpagewidth", "pdfpkfixeddpi", "pdfpkmode", "pdfpkresolution", "pdfprimitive", "pdfprotrudechars", "pdfpxdimen", "pdfrandomseed", "pdfrecompress", "pdfrefobj", "pdfrefxform", "pdfrefximage", "pdfreplacefont", "pdfrestore", "pdfretval", "pdfsave", "pdfsavepos", "pdfsetmatrix", "pdfsetrandomseed", "pdfstartlink", "pdfstartthread", "pdfsuppressoptionalinfo", "pdfsuppressptexinfo", "pdftexbanner", "pdftexrevision", "pdftexversion", "pdfthread", "pdfthreadmargin", "pdftracingfonts", "pdftrailer", "pdftrailerid", "pdfuniformdeviate", "pdfuniqueresname", "pdfvorigin", "pdfxform", "pdfxformattr", "pdfxformmargin", "pdfxformname", "pdfxformresources", "pdfximage" }, - ["tex"]={ " ", "-", "/", "above", "abovedisplayshortskip", "abovedisplayskip", "abovewithdelims", "accent", "adjdemerits", "advance", "advanceby", "afterassignment", "aftergroup", "atop", "atopwithdelims", "badness", "baselineskip", "batchmode", "begingroup", "belowdisplayshortskip", "belowdisplayskip", "binoppenalty", "botmark", "box", "boxmaxdepth", "brokenpenalty", "catcode", "char", "chardef", "cleaders", "clubpenalty", "copy", "count", "countdef", "cr", "crcr", "csname", "day", "deadcycles", "def", "defaulthyphenchar", "defaultskewchar", "delcode", "delimiter", "delimiterfactor", "delimitershortfall", "dimen", "dimendef", "discretionary", "displayindent", "displaylimits", "displaystyle", "displaywidowpenalty", "displaywidth", "divide", "divideby", "doublehyphendemerits", "dp", "dump", "edef", "else", "emergencystretch", "end", "endcsname", "endgroup", "endinput", "endlinechar", "eqno", "errhelp", "errmessage", "errorcontextlines", "errorstopmode", "escapechar", "everycr", "everydisplay", "everyhbox", "everyjob", "everymath", "everypar", "everyvbox", "exhyphenchar", "exhyphenpenalty", "expandafter", "fam", "fi", "finalhyphendemerits", "firstmark", "floatingpenalty", "font", "fontdimen", "fontname", "futurelet", "gdef", "global", "globaldefs", "halign", "hangafter", "hangindent", "hbadness", "hbox", "hfil", "hfill", "hfilneg", "hfuzz", "holdinginserts", "hrule", "hsize", "hskip", "hss", "ht", "hyphenation", "hyphenchar", "hyphenpenalty", "if", "ifcase", "ifcat", "ifdim", "iffalse", "ifhbox", "ifhmode", "ifinner", "ifmmode", "ifnum", "ifodd", "iftrue", "ifvbox", "ifvmode", "ifvoid", "ifx", "ignorespaces", "indent", "input", "inputlineno", "insert", "insertpenalties", "interlinepenalty", "jobname", "kern", "language", "lastbox", "lastkern", "lastpenalty", "lastskip", "lccode", "leaders", "left", "lefthyphenmin", "leftskip", "leqno", "let", "limits", "linepenalty", "lineskip", "lineskiplimit", "long", "looseness", "lower", "lowercase", "mark", "mathbin", "mathchar", "mathchardef", "mathchoice", "mathcode", "mathop", "mathord", "mathpunct", "mathrel", "mathsurround", "maxdeadcycles", "maxdepth", "meaning", "medmuskip", "message", "middle", "mkern", "month", "moveleft", "moveright", "mskip", "multiply", "multiplyby", "muskip", "muskipdef", "newlinechar", "noalign", "noexpand", "noindent", "nolimits", "nonscript", "nonstopmode", "nulldelimiterspace", "nullfont", "number", "omit", "or", "outer", "output", "outputpenalty", "over", "overfullrule", "overline", "overwithdelims", "pagedepth", "pagefilllstretch", "pagefillstretch", "pagefilstretch", "pagegoal", "pageshrink", "pagestretch", "pagetotal", "par", "parfillleftskip", "parfillskip", "parindent", "parinitleftskip", "parinitrightskip", "parshape", "parskip", "patterns", "pausing", "penalty", "postdisplaypenalty", "predisplaypenalty", "predisplaysize", "pretolerance", "prevdepth", "prevgraf", "radical", "raise", "relax", "relpenalty", "right", "righthyphenmin", "rightskip", "romannumeral", "scriptfont", "scriptscriptfont", "scriptscriptstyle", "scriptspace", "scriptstyle", "scrollmode", "setbox", "setlanguage", "sfcode", "shipout", "show", "showbox", "showboxbreadth", "showboxdepth", "showlists", "shownodedetails", "showthe", "skewchar", "skip", "skipdef", "spacefactor", "spaceskip", "span", "splitbotmark", "splitfirstmark", "splitmaxdepth", "splittopskip", "string", "tabskip", "textfont", "textstyle", "the", "thickmuskip", "thinmuskip", "time", "toks", "toksdef", "tolerance", "topmark", "topskip", "tracingcommands", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingpages", "tracingparagraphs", "tracingrestores", "tracingstats", "uccode", "uchyph", "unboundary", "underline", "unhbox", "unhcopy", "unkern", "unpenalty", "unskip", "unvbox", "unvcopy", "uppercase", "vadjust", "valign", "vbadness", "vbox", "vcenter", "vfil", "vfill", "vfilneg", "vfuzz", "vrule", "vsize", "vskip", "vsplit", "vss", "vtop", "wd", "widowpenalty", "xdef", "xleaders", "xspaceskip", "year" }, + ["tex"]={ " ", "-", "/", "above", "abovedisplayshortskip", "abovedisplayskip", "abovewithdelims", "accent", "adjdemerits", "advance", "afterassignment", "aftergroup", "atop", "atopwithdelims", "badness", "baselineskip", "batchmode", "begingroup", "belowdisplayshortskip", "belowdisplayskip", "binoppenalty", "botmark", "box", "boxmaxdepth", "brokenpenalty", "catcode", "char", "chardef", "cleaders", "clubpenalty", "copy", "count", "countdef", "cr", "crcr", "csname", "day", "deadcycles", "def", "defaulthyphenchar", "defaultskewchar", "delcode", "delimiter", "delimiterfactor", "delimitershortfall", "dimen", "dimendef", "discretionary", "displayindent", "displaylimits", "displaystyle", "displaywidowpenalty", "displaywidth", "divide", "doublehyphendemerits", "dp", "dump", "edef", "else", "emergencyextrastretch", "emergencystretch", "end", "endcsname", "endgroup", "endinput", "endlinechar", "eofinput", "eqno", "errhelp", "errmessage", "errorcontextlines", "errorstopmode", "escapechar", "everycr", "everydisplay", "everyhbox", "everyjob", "everymath", "everypar", "everyvbox", "exhyphenchar", "exhyphenpenalty", "expandafter", "fam", "fi", "finalhyphendemerits", "firstmark", "floatingpenalty", "font", "fontdimen", "fontname", "futurelet", "gdef", "global", "globaldefs", "halign", "hangafter", "hangindent", "hbadness", "hbox", "hfil", "hfill", "hfilneg", "hfuzz", "hkern", "holdinginserts", "hrule", "hsize", "hskip", "hss", "ht", "hyphenation", "hyphenchar", "hyphenpenalty", "if", "ifcase", "ifcat", "ifdim", "iffalse", "ifhbox", "ifhmode", "ifinner", "ifmmode", "ifnum", "ifodd", "iftrue", "ifvbox", "ifvmode", "ifvoid", "ifx", "ignorespaces", "indent", "input", "inputlineno", "insert", "insertpenalties", "interlinepenalty", "jobname", "kern", "language", "lastbox", "lastkern", "lastpenalty", "lastskip", "lccode", "leaders", "left", "lefthyphenmin", "leftskip", "leqno", "let", "limits", "linepenalty", "lineskip", "lineskiplimit", "long", "looseness", "lower", "lowercase", "mark", "mathaccent", "mathbin", "mathchar", "mathchardef", "mathchoice", "mathclose", "mathcode", "mathinner", "mathop", "mathopen", "mathord", "mathpunct", "mathrel", "mathsurround", "maxdeadcycles", "maxdepth", "meaning", "medmuskip", "message", "middle", "mkern", "month", "moveleft", "moveright", "mskip", "multiply", "muskip", "muskipdef", "newlinechar", "noalign", "noexpand", "noindent", "nolimits", "nonscript", "nonstopmode", "nulldelimiterspace", "nullfont", "number", "omit", "or", "outer", "output", "outputpenalty", "over", "overfullrule", "overline", "overwithdelims", "pagefilllstretch", "pagefillstretch", "pagefilstretch", "pagegoal", "pageshrink", "pagestretch", "pagetotal", "par", "parfillskip", "parindent", "parshape", "parskip", "patterns", "pausing", "penalty", "postdisplaypenalty", "predisplaypenalty", "predisplaysize", "pretolerance", "prevdepth", "prevgraf", "radical", "raise", "relax", "relpenalty", "right", "righthyphenmin", "rightskip", "romannumeral", "scriptfont", "scriptscriptfont", "scriptscriptstyle", "scriptspace", "scriptstyle", "scrollmode", "setbox", "setlanguage", "sfcode", "shipout", "show", "showbox", "showboxbreadth", "showboxdepth", "showlists", "shownodedetails", "showthe", "skewchar", "skip", "skipdef", "spacefactor", "spaceskip", "span", "splitbotmark", "splitfirstmark", "splitmaxdepth", "splittopskip", "string", "tabskip", "textfont", "textstyle", "the", "thickmuskip", "thinmuskip", "time", "toks", "toksdef", "tolerance", "topmark", "topskip", "tracingcommands", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingpages", "tracingparagraphs", "tracingrestores", "tracingstats", "uccode", "uchyph", "unboundary", "underline", "unhbox", "unhcopy", "unkern", "unpenalty", "unskip", "unvbox", "unvcopy", "uppercase", "vadjust", "valign", "vbadness", "vbox", "vcenter", "vfil", "vfill", "vfilneg", "vfuzz", "vkern", "vrule", "vsize", "vskip", "vsplit", "vss", "vtop", "wd", "widowpenalty", "xdef", "xleaders", "xspaceskip", "year" }, ["xetex"]={ "XeTeXversion" }, } \ No newline at end of file diff --git a/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml.lua index f4ab8426d2b..8c8cec9b674 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml.lua @@ -30,7 +30,6 @@ local xmlcdatalexer = lexers.load("scite-context-lexer-xml-cdata") local xmlscriptlexer = lexers.load("scite-context-lexer-xml-script") local lualexer = lexers.load("scite-context-lexer-lua") - local space = patterns.space local any = patterns.any @@ -72,6 +71,7 @@ local opendoctype = P("") + P(">") local openscript = openbegin * (P("script") + P("SCRIPT")) * (1-closeend)^0 * closeend -- begin local closescript = openend * (P("script") + P("SCRIPT")) * closeend +local charpattern = lexers.helpers.charpattern local openlua = "" @@ -85,7 +85,6 @@ local closelua = "?>" local entity = ampersand * (1-semicolon)^1 * semicolon -local utfchar = lexers.helpers.utfchar local wordtoken = patterns.wordtoken local iwordtoken = patterns.iwordtoken local wordpattern = patterns.wordpattern @@ -114,10 +113,10 @@ local t_word = C(iwordpattern) * Cp() / function(s,p) return styleofword(validwords,validminimum,s,p) end -- a bit of a hack local t_rest = - token("default", any) + token("default", charpattern) local t_text = - token("default", (1-S("<>&")-space)^1) + token("default", (charpattern-S("<>&")-space)^1) local t_spacing = token(xmlwhitespace, space^1) diff --git a/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer.lua index 2efe23916be..55705919312 100644 --- a/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer.lua +++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer.lua @@ -291,6 +291,7 @@ do + utf8two / function(s) local c1, c2 = byte(s,1,2) return c1 * 64 + c2 - 12416 end + utf8three / function(s) local c1, c2, c3 = byte(s,1,3) return (c1 * 64 + c2) * 64 + c3 - 925824 end + utf8four / function(s) local c1, c2, c3, c4 = byte(s,1,4) return ((c1 * 64 + c2) * 64 + c3) * 64 + c4 - 63447168 end + helpers.charpattern = usage == "scite" and 1 or helpers.utfcharpattern local p_false = P(false) local p_true = P(true) diff --git a/Master/texmf-dist/context/data/scite/context/scite-context-data-context.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-context.properties index 88b20999f3c..e3824e12b06 100644 --- a/Master/texmf-dist/context/data/scite/context/scite-context-data-context.properties +++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-context.properties @@ -8,280 +8,299 @@ medcard maxcard maxcardminusone maxiterator zeropoint \ onepoint halfapoint onebasepoint maxcount maxdimen \ scaledpoint thousandpoint points halfpoint zeroskip \ centeringskip stretchingskip shrinkingskip centeringfillskip stretchingfillskip \ -shrinkingfillskip zeromuskip onemuskip pluscxxvii pluscxxviii \ -pluscclv pluscclvi normalpagebox binaryshiftedten binaryshiftedtwenty \ -binaryshiftedthirty thickermuskip directionlefttoright directionrighttoleft endoflinetoken \ -outputnewlinechar emptytoks empty undefined prerollrun \ -voidbox emptybox emptyvbox emptyhbox bigskipamount \ -medskipamount smallskipamount fmtname fmtversion texengine \ -texenginename texengineversion texenginefunctionality luatexengine pdftexengine \ -xetexengine unknownengine contextformat contextversion contextlmtxmode \ -contextmark mksuffix activecatcode bgroup egroup \ -endline conditionaltrue conditionalfalse attributeunsetvalue statuswrite \ -uprotationangle rightrotationangle downrotationangle leftrotationangle inicatcodes \ -ctxcatcodes texcatcodes notcatcodes txtcatcodes vrbcatcodes \ -prtcatcodes nilcatcodes luacatcodes tpacatcodes tpbcatcodes \ -xmlcatcodes ctdcatcodes rlncatcodes escapecatcode begingroupcatcode \ -endgroupcatcode mathshiftcatcode alignmentcatcode endoflinecatcode parametercatcode \ -superscriptcatcode subscriptcatcode ignorecatcode spacecatcode lettercatcode \ -othercatcode activecatcode commentcatcode invalidcatcode tabasciicode \ -newlineasciicode formfeedasciicode endoflineasciicode endoffileasciicode commaasciicode \ -spaceasciicode periodasciicode hashasciicode dollarasciicode commentasciicode \ -ampersandasciicode colonasciicode semicolonasciicode backslashasciicode circumflexasciicode \ -underscoreasciicode leftbraceasciicode barasciicode rightbraceasciicode tildeasciicode \ -delasciicode leftparentasciicode rightparentasciicode lessthanasciicode morethanasciicode \ -doublecommentsignal atsignasciicode exclamationmarkasciicode questionmarkasciicode doublequoteasciicode \ -singlequoteasciicode forwardslashasciicode primeasciicode hyphenasciicode percentasciicode \ -leftbracketasciicode rightbracketasciicode hsizefrozenparcode skipfrozenparcode hangfrozenparcode \ -indentfrozenparcode parfillfrozenparcode adjustfrozenparcode protrudefrozenparcode tolerancefrozenparcode \ -stretchfrozenparcode loosenessfrozenparcode lastlinefrozenparcode linepenaltyfrozenparcode clubpenaltyfrozenparcode \ -widowpenaltyfrozenparcode displaypenaltyfrozenparcode brokenpenaltyfrozenparcode demeritsfrozenparcode shapefrozenparcode \ -linefrozenparcode hyphenationfrozenparcode shapingpenaltyfrozenparcode orphanpenaltyfrozenparcode allfrozenparcode \ -mathpenaltyfrozenparcode activemathcharcode activetabtoken activeformfeedtoken activeendoflinetoken \ -batchmodecode nonstopmodecode scrollmodecode errorstopmodecode bottomlevelgroupcode \ -simplegroupcode hboxgroupcode adjustedhboxgroupcode vboxgroupcode vtopgroupcode \ -aligngroupcode noaligngroupcode outputgroupcode mathgroupcode discretionarygroupcode \ -insertgroupcode vadjustgroupcode vcentergroupcode mathabovegroupcode mathchoicegroupcode \ -alsosimplegroupcode semisimplegroupcode mathshiftgroupcode mathleftgroupcode localboxgroupcode \ -splitoffgroupcode splitkeepgroupcode preamblegroupcode alignsetgroupcode finrowgroupcode \ -discretionarygroupcode markautomigrationcode insertautomigrationcode adjustautomigrationcode preautomigrationcode \ -postautomigrationcode charnodecode hlistnodecode vlistnodecode rulenodecode \ -insertnodecode marknodecode adjustnodecode ligaturenodecode discretionarynodecode \ -whatsitnodecode mathnodecode gluenodecode kernnodecode penaltynodecode \ -unsetnodecode mathsnodecode overrulemathcontrolcode underrulemathcontrolcode radicalrulemathcontrolcode \ -fractionrulemathcontrolcode accentskewhalfmathcontrolcode accentskewapplymathcontrolcode applyordinarykernpairmathcontrolcode applyverticalitalickernmathcontrolcode \ -applyordinaryitalickernmathcontrolcode applycharitalickernmathcontrolcode reboxcharitalickernmathcontrolcode applyboxeditalickernmathcontrolcode staircasekernmathcontrolcode \ -applytextitalickernmathcontrolcode applyscriptitalickernmathcontrolcode checkspaceitalickernmathcontrolcode checktextitalickernmathcontrolcode analyzescriptnucleuscharmathcontrolcode \ -analyzescriptnucleuslistmathcontrolcode analyzescriptnucleusboxmathcontrolcode accenttopskewwithoffsetmathcontrolcode ignorekerndimensionsmathcontrolcode ignoreflataccentsmathcontrolcode \ -extendaccentsmathcontrolcode extenddelimitersmathcontrolcode noligaturingglyphoptioncode nokerningglyphoptioncode noexpansionglyphoptioncode \ -noprotrusionglyphoptioncode noleftkerningglyphoptioncode noleftligaturingglyphoptioncode norightkerningglyphoptioncode norightligaturingglyphoptioncode \ -noitaliccorrectionglyphoptioncode islargeoperatorglyphoptioncode hasitalicshapeglyphoptioncode normalparcontextcode vmodeparcontextcode \ -vboxparcontextcode vtopparcontextcode vcenterparcontextcode vadjustparcontextcode insertparcontextcode \ -outputparcontextcode alignparcontextcode noalignparcontextcode spanparcontextcode resetparcontextcode \ -leftoriginlistanchorcode leftheightlistanchorcode leftdepthlistanchorcode rightoriginlistanchorcode rightheightlistanchorcode \ -rightdepthlistanchorcode centeroriginlistanchorcode centerheightlistanchorcode centerdepthlistanchorcode halfwaytotallistanchorcode \ -halfwayheightlistanchorcode halfwaydepthlistanchorcode halfwayleftlistanchorcode halfwayrightlistanchorcode negatexlistsigncode \ -negateylistsigncode negatelistsigncode fontslantperpoint fontinterwordspace fontinterwordstretch \ -fontinterwordshrink fontexheight fontemwidth fontextraspace slantperpoint \ -mathexheight mathemwidth interwordspace interwordstretch interwordshrink \ -exheight emwidth extraspace mathaxisheight muquad \ -startmode stopmode startnotmode stopnotmode startmodeset \ -stopmodeset doifmode doifelsemode doifmodeelse doifnotmode \ -startmodeset stopmodeset startallmodes stopallmodes startnotallmodes \ -stopnotallmodes doifallmodes doifelseallmodes doifallmodeselse doifnotallmodes \ -startenvironment stopenvironment environment startcomponent stopcomponent \ -component startlocalcomponent stoplocalcomponent startproduct stopproduct \ -product startproject stopproject project starttext \ -stoptext startnotext stopnotext startdocument stopdocument \ -documentvariable unexpandeddocumentvariable setupdocument presetdocument doifelsedocumentvariable \ -doifdocumentvariableelse doifdocumentvariable doifnotdocumentvariable startmodule stopmodule \ -usemodule usetexmodule useluamodule setupmodule currentmoduleparameter \ -moduleparameter everystarttext everystoptext startTEXpage stopTEXpage \ -enablemode disablemode preventmode definemode globalenablemode \ -globaldisablemode globalpreventmode pushmode popmode typescriptone \ -typescripttwo typescriptthree mathsizesuffix mathordinarycode mathordcode \ -mathoperatorcode mathopcode mathbinarycode mathbincode mathrelationcode \ -mathrelcode mathopencode mathclosecode mathpunctuationcode mathpunctcode \ -mathovercode mathundercode mathinnercode mathradicalcode mathfractioncode \ -mathmiddlecode mathaccentcode mathfencedcode mathghostcode mathvariablecode \ -mathactivecode mathvcentercode mathconstructcode mathwrappedcode mathbegincode \ -mathendcode mathexplicitcode mathdivisioncode mathfactorialcode mathdimensioncode \ -mathexperimentalcode mathtextpunctuationcode mathimaginarycode mathdifferentialcode mathexponentialcode \ -mathellipsiscode mathfunctioncode mathdigitcode mathalphacode mathboxcode \ -mathchoicecode mathnothingcode mathlimopcode mathnolopcode mathunsetcode \ -mathunspacedcode mathallcode mathfakecode mathunarycode mathmaybeordinarycode \ -mathmayberelationcode mathmaybebinarycode mathnumbergroupcode constantnumber constantnumberargument \ -constantdimen constantdimenargument constantemptyargument luastringsep !!bs \ -!!es lefttorightmark righttoleftmark lrm rlm \ -bidilre bidirle bidipop bidilro bidirlo \ -breakablethinspace nobreakspace nonbreakablespace narrownobreakspace zerowidthnobreakspace \ -ideographicspace ideographichalffillspace twoperemspace threeperemspace fourperemspace \ -fiveperemspace sixperemspace figurespace punctuationspace hairspace \ -enquad emquad zerowidthspace zerowidthnonjoiner zerowidthjoiner \ -zwnj zwj optionalspace asciispacechar softhyphen \ -autoinsertedspace Ux eUx parfillleftskip parfillrightskip \ -startlmtxmode stoplmtxmode startmkivmode stopmkivmode wildcardsymbol \ -normalhyphenationcode automatichyphenationcode explicithyphenationcode syllablehyphenationcode uppercasehyphenationcode \ -collapsehyphenationcode compoundhyphenationcode strictstarthyphenationcode strictendhyphenationcode automaticpenaltyhyphenationcode \ -explicitpenaltyhyphenationcode permitgluehyphenationcode permitallhyphenationcode permitmathreplacehyphenationcode forcecheckhyphenationcode \ -lazyligatureshyphenationcode forcehandlerhyphenationcode feedbackcompoundhyphenationcode ignoreboundshyphenationcode partialhyphenationcode \ -completehyphenationcode normalizelinenormalizecode parindentskipnormalizecode swaphangindentnormalizecode swapparsshapenormalizecode \ -breakafterdirnormalizecode removemarginkernsnormalizecode clipwidthnormalizecode flattendiscretionariesnormalizecode discardzerotabskipsnormalizecode \ -flattenhleadersnormalizecode normalizeparnormalizeparcode flattenvleadersnormalizeparcode nopreslackclassoptioncode nopostslackclassoptioncode \ -lefttopkernclassoptioncode righttopkernclassoptioncode leftbottomkernclassoptioncode rightbottomkernclassoptioncode lookaheadforendclassoptioncode \ -noitaliccorrectionclassoptioncode defaultmathclassoptions checkligatureclassoptioncode checkitaliccorrectionclassoptioncode checkkernpairclassoptioncode \ -flattenclassoptioncode omitpenaltyclassoptioncode unpackclassoptioncode raiseprimeclassoptioncode carryoverlefttopkernclassoptioncode \ -carryoverleftbottomkernclassoptioncode carryoverrighttopkernclassoptioncode carryoverrightbottomkernclassoptioncode preferdelimiterdimensionsclassoptioncode autoinjectclassoptioncode \ -removeitaliccorrectionclassoptioncode operatoritaliccorrectionclassoptioncode noligaturingglyphoptioncode nokerningglyphoptioncode noleftligatureglyphoptioncode \ -noleftkernglyphoptioncode norightligatureglyphoptioncode norightkernglyphoptioncode noexpansionglyphoptioncode noprotrusionglyphoptioncode \ -noitaliccorrectionglyphoptioncode nokerningcode noligaturingcode frozenflagcode tolerantflagcode \ -protectedflagcode primitiveflagcode permanentflagcode noalignedflagcode immutableflagcode \ -mutableflagcode globalflagcode overloadedflagcode immediateflagcode conditionalflagcode \ -valueflagcode instanceflagcode ordmathflattencode binmathflattencode relmathflattencode \ -punctmathflattencode innermathflattencode normalworddiscoptioncode preworddiscoptioncode postworddiscoptioncode \ -continueifinputfile continuewhenlmtxmode continuewhenmkivmode +shrinkingfillskip centeringfilllskip stretchingfilllskip shrinkingfilllskip zeromuskip \ +onemuskip pluscxxvii pluscxxviii pluscclv pluscclvi \ +normalpagebox binaryshiftedten binaryshiftedtwenty binaryshiftedthirty thickermuskip \ +continuationmuskip fencemuskip mathinterwordmuskip zerofloat directionlefttoright \ +directionrighttoleft endoflinetoken outputnewlinechar emptytoks empty \ +undefined prerollrun voidbox emptybox emptyvbox \ +emptyhbox bigskipamount medskipamount smallskipamount fmtname \ +fmtversion texengine texenginename texengineversion texenginefunctionality \ +luatexengine pdftexengine xetexengine unknownengine contextformat \ +contextversion contextlmtxmode contextmark mksuffix activecatcode \ +bgroup egroup endline conditionaltrue conditionalfalse \ +attributeunsetvalue statuswrite uprotationangle rightrotationangle downrotationangle \ +leftrotationangle inicatcodes ctxcatcodes texcatcodes notcatcodes \ +txtcatcodes vrbcatcodes prtcatcodes nilcatcodes luacatcodes \ +tpacatcodes tpbcatcodes xmlcatcodes ctdcatcodes rlncatcodes \ +escapecatcode begingroupcatcode endgroupcatcode mathshiftcatcode alignmentcatcode \ +endoflinecatcode parametercatcode superscriptcatcode subscriptcatcode ignorecatcode \ +spacecatcode lettercatcode othercatcode activecatcode commentcatcode \ +invalidcatcode tabasciicode newlineasciicode formfeedasciicode endoflineasciicode \ +endoffileasciicode commaasciicode spaceasciicode periodasciicode hashasciicode \ +dollarasciicode commentasciicode ampersandasciicode colonasciicode semicolonasciicode \ +backslashasciicode circumflexasciicode underscoreasciicode leftbraceasciicode barasciicode \ +rightbraceasciicode tildeasciicode delasciicode leftparentasciicode rightparentasciicode \ +lessthanasciicode morethanasciicode doublecommentsignal atsignasciicode exclamationmarkasciicode \ +questionmarkasciicode doublequoteasciicode singlequoteasciicode forwardslashasciicode primeasciicode \ +hyphenasciicode percentasciicode leftbracketasciicode rightbracketasciicode zeroasciicode \ +nineasciicode alowercaseasciicode zlowercaseasciicode hsizefrozenparcode skipfrozenparcode \ +hangfrozenparcode indentfrozenparcode parfillfrozenparcode adjustfrozenparcode protrudefrozenparcode \ +tolerancefrozenparcode stretchfrozenparcode loosenessfrozenparcode lastlinefrozenparcode linepenaltyfrozenparcode \ +clubpenaltyfrozenparcode widowpenaltyfrozenparcode displaypenaltyfrozenparcode brokenpenaltyfrozenparcode demeritsfrozenparcode \ +shapefrozenparcode linefrozenparcode hyphenationfrozenparcode shapingpenaltyfrozenparcode orphanpenaltyfrozenparcode \ +allfrozenparcode emergencyfrozenparcode parpassesfrozenparcode singlelinepenaltyfrozenparcode activemathcharcode \ +activetabtoken activeformfeedtoken activeendoflinetoken batchmodecode nonstopmodecode \ +scrollmodecode errorstopmodecode bottomlevelgroupcode simplegroupcode hboxgroupcode \ +adjustedhboxgroupcode vboxgroupcode vtopgroupcode aligngroupcode noaligngroupcode \ +outputgroupcode mathgroupcode discretionarygroupcode insertgroupcode vadjustgroupcode \ +vcentergroupcode mathabovegroupcode mathchoicegroupcode alsosimplegroupcode semisimplegroupcode \ +mathshiftgroupcode mathleftgroupcode localboxgroupcode splitoffgroupcode splitkeepgroupcode \ +preamblegroupcode alignsetgroupcode finrowgroupcode discretionarygroupcode markautomigrationcode \ +insertautomigrationcode adjustautomigrationcode preautomigrationcode postautomigrationcode charnodecode \ +hlistnodecode vlistnodecode rulenodecode insertnodecode marknodecode \ +adjustnodecode ligaturenodecode discretionarynodecode whatsitnodecode mathnodecode \ +gluenodecode kernnodecode penaltynodecode unsetnodecode mathsnodecode \ +overrulemathcontrolcode underrulemathcontrolcode radicalrulemathcontrolcode fractionrulemathcontrolcode accentskewhalfmathcontrolcode \ +accentskewapplymathcontrolcode applyordinarykernpairmathcontrolcode applyverticalitalickernmathcontrolcode applyordinaryitalickernmathcontrolcode applycharitalickernmathcontrolcode \ +reboxcharitalickernmathcontrolcode applyboxeditalickernmathcontrolcode staircasekernmathcontrolcode applytextitalickernmathcontrolcode applyscriptitalickernmathcontrolcode \ +checkspaceitalickernmathcontrolcode checktextitalickernmathcontrolcode analyzescriptnucleuscharmathcontrolcode analyzescriptnucleuslistmathcontrolcode analyzescriptnucleusboxmathcontrolcode \ +accenttopskewwithoffsetmathcontrolcode ignorekerndimensionsmathcontrolcode ignoreflataccentsmathcontrolcode extendaccentsmathcontrolcode extenddelimitersmathcontrolcode \ +normalparcontextcode vmodeparcontextcode vboxparcontextcode vtopparcontextcode vcenterparcontextcode \ +vadjustparcontextcode insertparcontextcode outputparcontextcode alignparcontextcode noalignparcontextcode \ +spanparcontextcode resetparcontextcode normalparbegincode forceparbegincode indentparbegincode \ +noindentparbegincode mathcharparbegincode charparbegincode boundaryparbegincode spaceparbegincode \ +mathparbegincode kernparbegincode hskipparbegincode unhboxparbegincode valignparbegincode \ +vruleparbegincode fixedsuperorsubscriptsmodecode fixedsuperandsubscriptsmodecode ignoreemptyscriptsmodecode ignoreemptysuperscriptsmodecode \ +ignoreemptysubscriptsmodecode ignoreemptyprimescriptsmodecode inheritclassdoublescriptmodecode discardshapekerndoublescriptmodecode realignscriptsdoublescriptmodecode \ +reorderprescriptsdoublescriptmodecode leftoriginlistanchorcode leftheightlistanchorcode leftdepthlistanchorcode rightoriginlistanchorcode \ +rightheightlistanchorcode rightdepthlistanchorcode centeroriginlistanchorcode centerheightlistanchorcode centerdepthlistanchorcode \ +halfwaytotallistanchorcode halfwayheightlistanchorcode halfwaydepthlistanchorcode halfwayleftlistanchorcode halfwayrightlistanchorcode \ +negatexlistsigncode negateylistsigncode negatelistsigncode fontslantperpoint fontinterwordspace \ +fontinterwordstretch fontinterwordshrink fontexheight fontemwidth fontextraspace \ +slantperpoint mathexheight mathemwidth interwordspace interwordstretch \ +interwordshrink exheight emwidth extraspace mathaxisheight \ +muquad startmode stopmode startnotmode stopnotmode \ +startmodeset stopmodeset doifmode doifelsemode doifmodeelse \ +doifnotmode startmodeset stopmodeset startallmodes stopallmodes \ +startnotallmodes stopnotallmodes doifallmodes doifelseallmodes doifallmodeselse \ +doifnotallmodes startenvironment stopenvironment environment startcomponent \ +stopcomponent component startlocalcomponent stoplocalcomponent startproduct \ +stopproduct product startproject stopproject project \ +starttext stoptext startnotext stopnotext startdocument \ +stopdocument documentvariable unexpandeddocumentvariable setupdocument presetdocument \ +doifelsedocumentvariable doifdocumentvariableelse doifdocumentvariable doifnotdocumentvariable startmodule \ +stopmodule usemodule usetexmodule useluamodule setupmodule \ +currentmoduleparameter moduleparameter everystarttext everystoptext everyforgetall \ +luaenvironment startTEXpage stopTEXpage enablemode disablemode \ +preventmode definemode globalenablemode globaldisablemode globalpreventmode \ +pushmode popmode typescriptone typescripttwo typescriptthree \ +mathsizesuffix mathordinarycode mathordcode mathoperatorcode mathopcode \ +mathbinarycode mathbincode mathrelationcode mathrelcode mathopencode \ +mathclosecode mathpunctuationcode mathpunctcode mathovercode mathundercode \ +mathinnercode mathradicalcode mathfractioncode mathmiddlecode mathprimecode \ +mathaccentcode mathfencedcode mathghostcode mathvariablecode mathactivecode \ +mathvcentercode mathconstructcode mathwrappedcode mathbegincode mathendcode \ +mathexplicitcode mathdivisioncode mathfactorialcode mathdimensioncode mathexperimentalcode \ +mathtextpunctuationcode mathcontinuationcode mathimaginarycode mathdifferentialcode mathexponentialcode \ +mathintegralcode mathellipsiscode mathfunctioncode mathdigitcode mathalphacode \ +mathboxcode mathchoicecode mathnothingcode mathlimopcode mathnolopcode \ +mathunsetcode mathunspacedcode mathallcode mathfakecode mathunarycode \ +mathmaybeordinarycode mathmayberelationcode mathmaybebinarycode mathnumbergroupcode mathchemicalbondcode \ +mathimplicationcode constantnumber constantnumberargument constantdimen constantdimenargument \ +constantemptyargument luastringsep !!bs !!es lefttorightmark \ +righttoleftmark lrm rlm bidilre bidirle \ +bidipop bidilro bidirlo breakablethinspace nobreakspace \ +nonbreakablespace narrownobreakspace zerowidthnobreakspace ideographicspace ideographichalffillspace \ +twoperemspace threeperemspace fourperemspace fiveperemspace sixperemspace \ +figurespace punctuationspace hairspace enquad emquad \ +zerowidthspace zerowidthnonjoiner zerowidthjoiner zwnj zwj \ +optionalspace asciispacechar softhyphen autoinsertedspace Ux \ +eUx startlmtxmode stoplmtxmode startmkivmode stopmkivmode \ +wildcardsymbol normalhyphenationcode automatichyphenationcode explicithyphenationcode syllablehyphenationcode \ +uppercasehyphenationcode collapsehyphenationcode compoundhyphenationcode strictstarthyphenationcode strictendhyphenationcode \ +automaticpenaltyhyphenationcode explicitpenaltyhyphenationcode permitgluehyphenationcode permitallhyphenationcode permitmathreplacehyphenationcode \ +forcecheckhyphenationcode lazyligatureshyphenationcode forcehandlerhyphenationcode feedbackcompoundhyphenationcode ignoreboundshyphenationcode \ +partialhyphenationcode completehyphenationcode normalizelinenormalizecode parindentskipnormalizecode swaphangindentnormalizecode \ +swapparsshapenormalizecode breakafterdirnormalizecode removemarginkernsnormalizecode clipwidthnormalizecode flattendiscretionariesnormalizecode \ +discardzerotabskipsnormalizecode flattenhleadersnormalizecode normalizeparnormalizeparcode flattenvleadersnormalizeparcode limitprevgrafnormalizeparcode \ +nopreslackclassoptioncode nopostslackclassoptioncode lefttopkernclassoptioncode righttopkernclassoptioncode leftbottomkernclassoptioncode \ +rightbottomkernclassoptioncode lookaheadforendclassoptioncode noitaliccorrectionclassoptioncode defaultmathclassoptions checkligatureclassoptioncode \ +checkitaliccorrectionclassoptioncode checkkernpairclassoptioncode flattenclassoptioncode omitpenaltyclassoptioncode unpackclassoptioncode \ +raiseprimeclassoptioncode carryoverlefttopkernclassoptioncode carryoverleftbottomkernclassoptioncode carryoverrighttopkernclassoptioncode carryoverrightbottomkernclassoptioncode \ +preferdelimiterdimensionsclassoptioncode autoinjectclassoptioncode removeitaliccorrectionclassoptioncode operatoritaliccorrectionclassoptioncode shortinlineclassoptioncode \ +pushnestingclassoptioncode popnestingclassoptioncode obeynestingclassoptioncode noitaliccorrectionglyphoptioncode nozeroitaliccorrectionglyphoptioncode \ +noexpansionglyphoptioncode noprotrusionglyphoptioncode noleftkernglyphoptioncode norightkernglyphoptioncode noleftligatureglyphoptioncode \ +norightligatureglyphoptioncode textcheckitalicglyphoptioncode mathcheckitalicglyphoptioncode nokerningcode noligaturingcode \ +noitalicscode indecentparpassclasses looseparpassclasses tightparpassclasses verylooseparpassclass \ +looseparpassclass semilooseparpassclass decentparpassclass almostdecentparpassclasses semitightparpassclass \ +tightparpassclass frozenflagcode tolerantflagcode protectedflagcode primitiveflagcode \ +permanentflagcode noalignedflagcode immutableflagcode mutableflagcode globalflagcode \ +overloadedflagcode immediateflagcode conditionalflagcode valueflagcode instanceflagcode \ +ordmathflattencode binmathflattencode relmathflattencode punctmathflattencode innermathflattencode \ +normalworddiscoptioncode preworddiscoptioncode postworddiscoptioncode preferbreakdiscoptioncode prefernobreakdiscoptioncode \ +noitaliccorrectiondiscoptioncode nozeroitaliccorrectiondiscoptioncode textcheckitalicdiscoptioncode continueifinputfile continuewhenlmtxmode \ +continuewhenmkivmode uunit keywordclass.context.helpers=\ -startsetups stopsetups startxmlsetups stopxmlsetups \ -startluasetups stopluasetups starttexsetups stoptexsetups startrawsetups \ -stoprawsetups startlocalsetups stoplocalsetups starttexdefinition stoptexdefinition \ -starttexcode stoptexcode startcontextcode stopcontextcode startcontextdefinitioncode \ -stopcontextdefinitioncode texdefinition doifelsesetups doifsetupselse doifsetups \ -doifnotsetups setup setups texsetup xmlsetup \ -luasetup directsetup fastsetup copysetups resetsetups \ -doifelsecommandhandler doifcommandhandlerelse doifnotcommandhandler doifcommandhandler newmode \ -setmode resetmode newsystemmode setsystemmode resetsystemmode \ -pushsystemmode popsystemmode globalsetmode globalresetmode globalsetsystemmode \ -globalresetsystemmode booleanmodevalue newcount newdimen newskip \ -newmuskip newbox newtoks newread newwrite \ -newmarks newinsert newattribute newif newfloat \ -newlanguage newfamily newfam newhelp newinteger \ -newdimension newgluespec newmugluespec newposit aliasinteger \ -aliasdimension aliasposit then begcsname autorule \ -strippedcsname checkedstrippedcsname nofarguments firstargumentfalse firstargumenttrue \ -secondargumentfalse secondargumenttrue thirdargumentfalse thirdargumenttrue fourthargumentfalse \ -fourthargumenttrue fifthargumentfalse fifthargumenttrue sixthargumentfalse sixthargumenttrue \ -seventhargumentfalse seventhargumenttrue vkern hkern vpenalty \ -hpenalty doglobal dodoglobal redoglobal resetglobal \ -donothing untraceddonothing dontcomplain moreboxtracing lessboxtracing \ -noboxtracing forgetall donetrue donefalse foundtrue \ -foundfalse inlineordisplaymath indisplaymath forcedisplaymath startforceddisplaymath \ -stopforceddisplaymath startpickupmath stoppickupmath reqno forceinlinemath \ -mathortext thebox htdp unvoidbox hfilll \ -vfilll mathbox mathlimop mathnolop mathnothing \ -mathalpha currentcatcodetable defaultcatcodetable catcodetablename newcatcodetable \ -startcatcodetable stopcatcodetable startextendcatcodetable stopextendcatcodetable pushcatcodetable \ -popcatcodetable restorecatcodes setcatcodetable letcatcodecommand defcatcodecommand \ -uedcatcodecommand hglue vglue hfillneg vfillneg \ -hfilllneg vfilllneg hsplit ruledhss ruledhfil \ -ruledhfill ruledhfilll ruledhfilneg ruledhfillneg normalhfillneg \ -normalhfilllneg ruledvss ruledvfil ruledvfill ruledvfilll \ -ruledvfilneg ruledvfillneg normalvfillneg normalvfilllneg ruledhbox \ -ruledvbox ruledvtop ruleddbox ruledvcenter ruledmbox \ -ruledhpack ruledvpack ruledtpack ruleddpack ruledvsplit \ -ruledtsplit ruleddsplit ruledhskip ruledvskip ruledkern \ -ruledmskip ruledmkern ruledhglue ruledvglue normalhglue \ -normalvglue ruledpenalty filledhboxb filledhboxr filledhboxg \ -filledhboxc filledhboxm filledhboxy filledhboxk scratchstring \ -scratchstringone scratchstringtwo tempstring scratchcounter globalscratchcounter \ -privatescratchcounter scratchdimen globalscratchdimen privatescratchdimen scratchskip \ -globalscratchskip privatescratchskip scratchmuskip globalscratchmuskip privatescratchmuskip \ -scratchtoks globalscratchtoks privatescratchtoks scratchbox globalscratchbox \ -privatescratchbox scratchmacro scratchmacroone scratchmacrotwo scratchconditiontrue \ -scratchconditionfalse ifscratchcondition scratchconditiononetrue scratchconditiononefalse ifscratchconditionone \ -scratchconditiontwotrue scratchconditiontwofalse ifscratchconditiontwo globalscratchcounterone globalscratchcountertwo \ -globalscratchcounterthree groupedcommand groupedcommandcs triggergroupedcommand triggergroupedcommandcs \ -simplegroupedcommand simplegroupedcommandcs pickupgroupedcommand pickupgroupedcommandcs mathgroupedcommandcs \ -usedbaselineskip usedlineskip usedlineskiplimit availablehsize localhsize \ -setlocalhsize distributedhsize hsizefraction next nexttoken \ -nextbox dowithnextbox dowithnextboxcs dowithnextboxcontent dowithnextboxcontentcs \ -flushnextbox boxisempty boxtostring contentostring prerolltostring \ -givenwidth givenheight givendepth scangivendimensions scratchwidth \ -scratchheight scratchdepth scratchoffset scratchdistance scratchtotal \ -scratchitalic scratchhsize scratchvsize scratchxoffset scratchyoffset \ +pushglobalsetups popglobalsetups startsetups stopsetups \ +startxmlsetups stopxmlsetups startluasetups stopluasetups starttexsetups \ +stoptexsetups startrawsetups stoprawsetups startlocalsetups stoplocalsetups \ +starttexdefinition stoptexdefinition starttexcode stoptexcode startcontextcode \ +stopcontextcode startcontextdefinitioncode stopcontextdefinitioncode texdefinition doifelsesetups \ +doifsetupselse doifsetups doifnotsetups setup setups \ +texsetup xmlsetup luasetup directsetup fastsetup \ +copysetups resetsetups doifelsecommandhandler doifcommandhandlerelse doifnotcommandhandler \ +doifcommandhandler newmode setmode resetmode newsystemmode \ +setsystemmode resetsystemmode pushsystemmode popsystemmode globalsetmode \ +globalresetmode globalsetsystemmode globalresetsystemmode booleanmodevalue newcount \ +newdimen newskip newmuskip newbox newtoks \ +newread newwrite newmarks newinsert newattribute \ +newif newfloat newlanguage newfamily newfam \ +newhelp newuserunit newinteger newdimension newgluespec \ +newmugluespec newposit aliasinteger aliasdimension aliasposit \ +then begcsname autorule tobit tobits \ +tohexa strippedcsname checkedstrippedcsname nofarguments firstargumentfalse \ +firstargumenttrue secondargumentfalse secondargumenttrue thirdargumentfalse thirdargumenttrue \ +fourthargumentfalse fourthargumenttrue fifthargumentfalse fifthargumenttrue sixthargumentfalse \ +sixthargumenttrue seventhargumentfalse seventhargumenttrue doglobal dodoglobal \ +redoglobal resetglobal donothing untraceddonothing dontcomplain \ +moreboxtracing lessboxtracing noboxtracing forgetall donetrue \ +donefalse foundtrue foundfalse globaldonetrue globaldonefalse \ +globalfoundtrue globalfoundfalse inlineordisplaymath indisplaymath forcedisplaymath \ +startforceddisplaymath stopforceddisplaymath startpickupmath stoppickupmath reqno \ +forceinlinemath mathortext thebox htdp unvoidbox \ +hfilll vfilll mathbox mathlimop mathnolop \ +mathnothing mathalpha currentcatcodetable defaultcatcodetable catcodetablename \ +newcatcodetable startcatcodetable stopcatcodetable startextendcatcodetable stopextendcatcodetable \ +pushcatcodetable popcatcodetable restorecatcodes setcatcodetable letcatcodecommand \ +defcatcodecommand uedcatcodecommand hglue vglue hfillneg \ +vfillneg hfilllneg vfilllneg hsplit ruledhss \ +ruledhfil ruledhfill ruledhfilll ruledhfilneg ruledhfillneg \ +normalhfillneg normalhfilllneg ruledvss ruledvfil ruledvfill \ +ruledvfilll ruledvfilneg ruledvfillneg normalvfillneg normalvfilllneg \ +ruledhbox ruledvbox ruledvtop ruleddbox ruledvcenter \ +ruledmbox ruledhpack ruledvpack ruledtpack ruleddpack \ +ruledvsplit ruledtsplit ruleddsplit ruledhskip ruledvskip \ +ruledkern ruledmskip ruledmkern ruledhglue ruledvglue \ +normalhglue normalvglue ruledpenalty filledhboxb filledhboxr \ +filledhboxg filledhboxc filledhboxm filledhboxy filledhboxk \ +scratchstring scratchstringone scratchstringtwo tempstring scratchcounter \ +globalscratchcounter privatescratchcounter scratchfloat globalscratchfloat privatescratchfloat \ +scratchdimen globalscratchdimen privatescratchdimen scratchskip globalscratchskip \ +privatescratchskip scratchmuskip globalscratchmuskip privatescratchmuskip scratchtoks \ +globalscratchtoks privatescratchtoks scratchbox globalscratchbox privatescratchbox \ +scratchmacro scratchmacroone scratchmacrotwo scratchconditiontrue scratchconditionfalse \ +ifscratchcondition scratchconditiononetrue scratchconditiononefalse ifscratchconditionone scratchconditiontwotrue \ +scratchconditiontwofalse ifscratchconditiontwo globalscratchcounterone globalscratchcountertwo globalscratchcounterthree \ +groupedcommand groupedcommandcs triggergroupedcommand triggergroupedcommandcs simplegroupedcommand \ +simplegroupedcommandcs pickupgroupedcommand pickupgroupedcommandcs mathgroupedcommandcs usedbaselineskip \ +usedlineskip usedlineskiplimit availablehsize localhsize setlocalhsize \ +distributedhsize hsizefraction next nexttoken nextbox \ +dowithnextbox dowithnextboxcs dowithnextboxcontent dowithnextboxcontentcs flushnextbox \ +boxisempty boxtostring contentostring prerolltostring givenwidth \ +givenheight givendepth scangivendimensions scratchwidth scratchheight \ +scratchdepth scratchoffset scratchdistance scratchtotal scratchitalic \ +scratchhsize scratchvsize scratchclass scratchxoffset scratchyoffset \ scratchhoffset scratchvoffset scratchxposition scratchyposition scratchtopoffset \ scratchbottomoffset scratchleftoffset scratchrightoffset scratchcounterone scratchcountertwo \ -scratchcounterthree scratchcounterfour scratchcounterfive scratchcountersix scratchdimenone \ -scratchdimentwo scratchdimenthree scratchdimenfour scratchdimenfive scratchdimensix \ -scratchskipone scratchskiptwo scratchskipthree scratchskipfour scratchskipfive \ -scratchskipsix scratchmuskipone scratchmuskiptwo scratchmuskipthree scratchmuskipfour \ -scratchmuskipfive scratchmuskipsix scratchtoksone scratchtokstwo scratchtoksthree \ -scratchtoksfour scratchtoksfive scratchtokssix scratchboxone scratchboxtwo \ -scratchboxthree scratchboxfour scratchboxfive scratchboxsix scratchnx \ -scratchny scratchmx scratchmy scratchunicode scratchmin \ -scratchmax scratchleftskip scratchrightskip scratchtopskip scratchbottomskip \ -doif doifnot doifelse firstinset doifinset \ -doifnotinset doifelseinset doifinsetelse doifelsenextchar doifnextcharelse \ -doifelsenextcharcs doifnextcharcselse doifelsenextoptional doifnextoptionalelse doifelsenextoptionalcs \ -doifnextoptionalcselse doifelsefastoptionalcheck doiffastoptionalcheckelse doifelsefastoptionalcheckcs doiffastoptionalcheckcselse \ -doifelsenextbgroup doifnextbgroupelse doifelsenextbgroupcs doifnextbgroupcselse doifelsenextparenthesis \ -doifnextparenthesiselse doifelseundefined doifundefinedelse doifelsedefined doifdefinedelse \ -doifundefined doifdefined doifelsevalue doifvalue doifnotvalue \ -doifnothing doifsomething doifelsenothing doifnothingelse doifelsesomething \ -doifsomethingelse doifvaluenothing doifvaluesomething doifelsevaluenothing doifvaluenothingelse \ -doifelsedimension doifdimensionelse doifelsenumber doifnumberelse doifnumber \ -doifnotnumber doifelsecommon doifcommonelse doifcommon doifnotcommon \ -doifinstring doifnotinstring doifelseinstring doifinstringelse doifelseassignment \ -doifassignmentelse docheckassignment doifelseassignmentcs doifassignmentelsecs validassignment \ -novalidassignment doiftext doifelsetext doiftextelse doifnottext \ -quitcondition truecondition falsecondition tracingall tracingnone \ -loggingall tracingcatcodes showluatokens aliasmacro removetoks \ -appendtoks prependtoks appendtotoks prependtotoks to \ -endgraf endpar reseteverypar finishpar empty \ -null space quad enspace emspace \ -charspace nbsp crlf obeyspaces obeylines \ -obeytabs obeypages obeyedspace obeyedline obeyedtab \ -obeyedpage normalspace naturalspace controlspace normalspaces \ -ignoretabs ignorelines ignorepages ignoreeofs setcontrolspaces \ -executeifdefined singleexpandafter doubleexpandafter tripleexpandafter dontleavehmode \ -removelastspace removeunwantedspaces keepunwantedspaces removepunctuation ignoreparskip \ -forcestrutdepth onlynonbreakablespace wait writestatus define \ -defineexpandable redefine setmeasure setemeasure setgmeasure \ -setxmeasure definemeasure freezemeasure measure measured \ -directmeasure setquantity setequantity setgquantity setxquantity \ -definequantity freezequantity quantity quantitied directquantity \ -installcorenamespace getvalue getuvalue setvalue setevalue \ -setgvalue setxvalue letvalue letgvalue resetvalue \ -undefinevalue ignorevalue setuvalue setuevalue setugvalue \ -setuxvalue globallet udef ugdef uedef \ -uxdef checked unique getparameters geteparameters \ -getgparameters getxparameters forgetparameters copyparameters getdummyparameters \ -dummyparameter directdummyparameter setdummyparameter letdummyparameter setexpandeddummyparameter \ -resetdummyparameter usedummystyleandcolor usedummystyleparameter usedummycolorparameter processcommalist \ -processcommacommand quitcommalist quitprevcommalist processaction processallactions \ -processfirstactioninset processallactionsinset unexpanded expanded startexpanded \ -stopexpanded protect unprotect firstofoneargument firstoftwoarguments \ -secondoftwoarguments firstofthreearguments secondofthreearguments thirdofthreearguments firstoffourarguments \ -secondoffourarguments thirdoffourarguments fourthoffourarguments firstoffivearguments secondoffivearguments \ -thirdoffivearguments fourthoffivearguments fifthoffivearguments firstofsixarguments secondofsixarguments \ -thirdofsixarguments fourthofsixarguments fifthofsixarguments sixthofsixarguments firstofoneunexpanded \ -firstoftwounexpanded secondoftwounexpanded firstofthreeunexpanded secondofthreeunexpanded thirdofthreeunexpanded \ -gobbleoneargument gobbletwoarguments gobblethreearguments gobblefourarguments gobblefivearguments \ -gobblesixarguments gobblesevenarguments gobbleeightarguments gobbleninearguments gobbletenarguments \ -gobbleoneoptional gobbletwooptionals gobblethreeoptionals gobblefouroptionals gobblefiveoptionals \ -dorecurse doloop exitloop dostepwiserecurse recurselevel \ -recursedepth dofastloopcs fastloopindex fastloopfinal dowith \ -doloopovermatch doloopovermatched doloopoverlist newconstant setnewconstant \ -setconstant setconstantvalue newconditional settrue setfalse \ -settruevalue setfalsevalue setconditional newmacro setnewmacro \ -newfraction newsignal newboundary dosingleempty dodoubleempty \ -dotripleempty doquadrupleempty doquintupleempty dosixtupleempty doseventupleempty \ -dosingleargument dodoubleargument dotripleargument doquadrupleargument doquintupleargument \ -dosixtupleargument doseventupleargument dosinglegroupempty dodoublegroupempty dotriplegroupempty \ -doquadruplegroupempty doquintuplegroupempty permitspacesbetweengroups dontpermitspacesbetweengroups nopdfcompression \ -maximumpdfcompression normalpdfcompression onlypdfobjectcompression nopdfobjectcompression modulonumber \ -dividenumber getfirstcharacter doifelsefirstchar doiffirstcharelse mathclassvalue \ -startnointerference stopnointerference twodigits threedigits leftorright \ -offinterlineskip oninterlineskip nointerlineskip strut halfstrut \ -quarterstrut depthstrut halflinestrut noheightstrut setstrut \ -strutbox strutht strutdp strutwd struthtdp \ -strutgap begstrut endstrut lineheight leftboundary \ -rightboundary signalcharacter aligncontentleft aligncontentmiddle aligncontentright \ -shiftbox vpackbox hpackbox vpackedbox hpackedbox \ -normalreqno startimath stopimath normalstartimath normalstopimath \ -startdmath stopdmath normalstartdmath normalstopdmath normalsuperscript \ -normalsubscript normalnosuperscript normalnosubscript normalprimescript superscript \ -subscript nosuperscript nosubscript primescript superprescript \ -subprescript nosuperprescript nosubsprecript uncramped cramped \ -mathstyletrigger triggermathstyle triggeredmathstyle mathstylefont mathsmallstylefont \ -mathstyleface mathsmallstyleface mathstylecommand mathpalette mathstylehbox \ -mathstylevbox mathstylevcenter mathstylevcenteredhbox mathstylevcenteredvbox mathtext \ -setmathsmalltextbox setmathtextbox pushmathstyle popmathstyle triggerdisplaystyle \ -triggertextstyle triggerscriptstyle triggerscriptscriptstyle triggeruncrampedstyle triggercrampedstyle \ -triggersmallstyle triggeruncrampedsmallstyle triggercrampedsmallstyle triggerbigstyle triggeruncrampedbigstyle \ -triggercrampedbigstyle luaexpr expelsedoif expdoif expdoifnot \ -expdoifelsecommon expdoifcommonelse expdoifelseinset expdoifinsetelse ctxdirectlua \ -ctxlatelua ctxsprint ctxwrite ctxcommand ctxdirectcommand \ -ctxlatecommand ctxreport ctxlua luacode lateluacode \ -directluacode registerctxluafile ctxloadluafile luaversion luamajorversion \ -luaminorversion ctxluacode luaconditional luaexpanded ctxluamatch \ -startluaparameterset stopluaparameterset luaparameterset definenamedlua obeylualines \ -obeyluatokens startluacode stopluacode startlua stoplua \ -startctxfunction stopctxfunction ctxfunction startctxfunctiondefinition stopctxfunctiondefinition \ -installctxfunction installprotectedctxfunction installprotectedctxscanner installctxscanner resetctxscanner \ -cldprocessfile cldloadfile cldloadviafile cldcontext cldcommand \ -carryoverpar freezeparagraphproperties defrostparagraphproperties setparagraphfreezing forgetparagraphfreezing \ -updateparagraphproperties updateparagraphpenalties updateparagraphdemerits updateparagraphshapes updateparagraphlines \ +scratchcounterthree scratchcounterfour scratchcounterfive scratchcountersix scratchfloatone \ +scratchfloattwo scratchfloatthree scratchfloatfour scratchfloatfive scratchfloatsix \ +scratchdimenone scratchdimentwo scratchdimenthree scratchdimenfour scratchdimenfive \ +scratchdimensix scratchskipone scratchskiptwo scratchskipthree scratchskipfour \ +scratchskipfive scratchskipsix scratchmuskipone scratchmuskiptwo scratchmuskipthree \ +scratchmuskipfour scratchmuskipfive scratchmuskipsix scratchtoksone scratchtokstwo \ +scratchtoksthree scratchtoksfour scratchtoksfive scratchtokssix scratchboxone \ +scratchboxtwo scratchboxthree scratchboxfour scratchboxfive scratchboxsix \ +scratchnx scratchny scratchmx scratchmy scratchunicode \ +scratchunicodeone scratchunicodetwo scratchunicodethree scratchmin scratchmax \ +scratchread scratchwrite pfsin pfcos pftan \ +pfasin pfacos pfatan pfsinh pfcosh \ +pftanh pfasinh pfacosh pfatanh pfsqrt \ +pflog pfexp pfceil pffloor pfround \ +pfabs pfrad pfdeg pfatantwo pfpow \ +pfmod pfrem scratchleftskip scratchrightskip scratchtopskip \ +scratchbottomskip doif doifnot doifelse firstinset \ +doifinset doifnotinset doifelseinset doifinsetelse doifelsenextchar \ +doifnextcharelse doifelsenextcharcs doifnextcharcselse doifelsenextoptional doifnextoptionalelse \ +doifelsenextoptionalcs doifnextoptionalcselse doifelsefastoptionalcheck doiffastoptionalcheckelse doifelsefastoptionalcheckcs \ +doiffastoptionalcheckcselse doifelsenextbgroup doifnextbgroupelse doifelsenextbgroupcs doifnextbgroupcselse \ +doifelsenextparenthesis doifnextparenthesiselse doifelseundefined doifundefinedelse doifelsedefined \ +doifdefinedelse doifundefined doifdefined doifelsevalue doifvalue \ +doifnotvalue doifnothing doifsomething doifelsenothing doifnothingelse \ +doifelsesomething doifsomethingelse doifvaluenothing doifvaluesomething doifelsevaluenothing \ +doifvaluenothingelse doifelsedimension doifdimensionelse doifelsenumber doifnumberelse \ +doifnumber doifnotnumber doifelsecommon doifcommonelse doifcommon \ +doifnotcommon doifinstring doifnotinstring doifelseinstring doifinstringelse \ +doifelseassignment doifassignmentelse docheckassignment doifelseassignmentcs doifassignmentelsecs \ +validassignment novalidassignment doiftext doifelsetext doiftextelse \ +doifnottext validtext quitcondition truecondition falsecondition \ +tracingall tracingnone loggingall tracingcatcodes showluatokens \ +aliasmacro removetoks appendtoks prependtoks appendtotoks \ +prependtotoks to endgraf endpar reseteverypar \ +finishpar empty null space quad \ +enspace emspace charspace nbsp crlf \ +obeyspaces obeylines obeytabs obeypages obeyedspace \ +obeyedline obeyedtab obeyedpage normalspace naturalspace \ +controlspace normalspaces ignoretabs ignorelines ignorepages \ +ignoreeofs setcontrolspaces executeifdefined singleexpandafter doubleexpandafter \ +tripleexpandafter dontleavehmode removelastspace removeunwantedspaces keepunwantedspaces \ +removepunctuation ignoreparskip forcestrutdepth onlynonbreakablespace wait \ +writestatus writeline define defineexpandable redefine \ +setmeasure setemeasure setgmeasure setxmeasure definemeasure \ +freezemeasure measure measured directmeasure setquantity \ +setequantity setgquantity setxquantity definequantity freezequantity \ +quantity quantitied directquantity installcorenamespace getvalue \ +getuvalue setvalue setevalue setgvalue setxvalue \ +letvalue letgvalue resetvalue undefinevalue ignorevalue \ +setuvalue setuevalue setugvalue setuxvalue globallet \ +udef ugdef uedef uxdef checked \ +unique getparameters geteparameters getgparameters getxparameters \ +forgetparameters copyparameters getdummyparameters dummyparameter directdummyparameter \ +setdummyparameter letdummyparameter setexpandeddummyparameter resetdummyparameter usedummystyleandcolor \ +usedummystyleparameter usedummycolorparameter processcommalist processcommacommand quitcommalist \ +quitprevcommalist processaction processallactions processfirstactioninset processallactionsinset \ +unexpanded expanded startexpanded stopexpanded protect \ +unprotect firstofoneargument firstoftwoarguments secondoftwoarguments firstofthreearguments \ +secondofthreearguments thirdofthreearguments firstoffourarguments secondoffourarguments thirdoffourarguments \ +fourthoffourarguments firstoffivearguments secondoffivearguments thirdoffivearguments fourthoffivearguments \ +fifthoffivearguments firstofsixarguments secondofsixarguments thirdofsixarguments fourthofsixarguments \ +fifthofsixarguments sixthofsixarguments firstofoneunexpanded firstoftwounexpanded secondoftwounexpanded \ +firstofthreeunexpanded secondofthreeunexpanded thirdofthreeunexpanded gobbleoneargument gobbletwoarguments \ +gobblethreearguments gobblefourarguments gobblefivearguments gobblesixarguments gobblesevenarguments \ +gobbleeightarguments gobbleninearguments gobbletenarguments gobbleoneoptional gobbletwooptionals \ +gobblethreeoptionals gobblefouroptionals gobblefiveoptionals dorecurse doloop \ +exitloop dostepwiserecurse recurselevel recursedepth dofastloopcs \ +fastloopindex fastloopfinal dowith doloopovermatch doloopovermatched \ +doloopoverlist newconstant setnewconstant setconstant setconstantvalue \ +newconditional settrue setfalse settruevalue setfalsevalue \ +setconditional newmacro setnewmacro newfraction newsignal \ +newboundary dosingleempty dodoubleempty dotripleempty doquadrupleempty \ +doquintupleempty dosixtupleempty doseventupleempty dosingleargument dodoubleargument \ +dotripleargument doquadrupleargument doquintupleargument dosixtupleargument doseventupleargument \ +dosinglegroupempty dodoublegroupempty dotriplegroupempty doquadruplegroupempty doquintuplegroupempty \ +permitspacesbetweengroups dontpermitspacesbetweengroups nopdfcompression maximumpdfcompression normalpdfcompression \ +onlypdfobjectcompression nopdfobjectcompression modulonumber dividenumber getfirstcharacter \ +doifelsefirstchar doiffirstcharelse mathclassvalue startnointerference stopnointerference \ +twodigits threedigits leftorright offinterlineskip oninterlineskip \ +nointerlineskip strut halfstrut quarterstrut depthstrut \ +halflinestrut noheightstrut setstrut strutbox strutht \ +strutdp strutwd struthtdp strutgap begstrut \ +endstrut lineheight leftboundary rightboundary signalcharacter \ +ascender descender capheight aligncontentleft aligncontentmiddle \ +aligncontentright shiftbox vpackbox hpackbox vpackedbox \ +hpackedbox normalreqno startimath stopimath normalstartimath \ +normalstopimath startdmath stopdmath normalstartdmath normalstopdmath \ +uncramped cramped mathstyletrigger triggermathstyle triggeredmathstyle \ +mathstylefont mathsmallstylefont mathstyleface mathsmallstyleface mathstylecommand \ +mathpalette mathstylehbox mathstylevbox mathstylevcenter mathstylevcenteredhbox \ +mathstylevcenteredvbox mathtext setmathsmalltextbox setmathtextbox pushmathstyle \ +popmathstyle triggerdisplaystyle triggertextstyle triggerscriptstyle triggerscriptscriptstyle \ +triggeruncrampedstyle triggercrampedstyle triggersmallstyle triggeruncrampedsmallstyle triggercrampedsmallstyle \ +triggerbigstyle triggeruncrampedbigstyle triggercrampedbigstyle luaexpr expelsedoif \ +expdoif expdoifnot expdoifelsecommon expdoifcommonelse expdoifelseinset \ +expdoifinsetelse glyphscaled ctxdirectlua ctxlatelua ctxsprint \ +ctxwrite ctxcommand ctxdirectcommand ctxlatecommand ctxreport \ +ctxlua luacode lateluacode directluacode registerctxluafile \ +ctxloadluafile luaversion luamajorversion luaminorversion ctxluacode \ +luaconditional luaexpanded ctxluamatch ctxluamatchfile startluaparameterset \ +stopluaparameterset luaparameterset definenamedlua obeylualines obeyluatokens \ +startluacode stopluacode startlua stoplua startctxfunction \ +stopctxfunction ctxfunction startctxfunctiondefinition stopctxfunctiondefinition installctxfunction \ +installprotectedctxfunction installprotectedctxscanner installctxscanner resetctxscanner cldprocessfile \ +cldloadfile cldloadviafile cldcontext cldcommand carryoverpar \ +freezeparagraphproperties defrostparagraphproperties setparagraphfreezing forgetparagraphfreezing updateparagraphproperties \ +updateparagraphpenalties updateparagraphdemerits updateparagraphshapes updateparagraphlines updateparagraphpasses \ lastlinewidth assumelongusagecs righttolefthbox lefttorighthbox righttoleftvbox \ lefttorightvbox righttoleftvtop lefttorightvtop rtlhbox ltrhbox \ rtlvbox ltrvbox rtlvtop ltrvtop autodirhbox \ @@ -297,21 +316,33 @@ reversehbox reversevbox reversevtop reversehpack reversevpack \ reversetpack hcontainer vcontainer tcontainer frule \ compoundhyphenpenalty start stop unsupportedcs openout \ closeout write openin closein read \ -readline readfromterminal boxlines boxline setboxline \ -copyboxline boxlinewd boxlineht boxlinedp boxlinenw \ -boxlinenh boxlinend boxlinels boxliners boxlinelh \ -boxlinerh boxlinelp boxlinerp boxlinein boxrangewd \ -boxrangeht boxrangedp bitwiseset bitwiseand bitwiseor \ -bitwisexor bitwisenot bitwisenil ifbitwiseand bitwise \ -bitwiseshift bitwiseflip textdir linedir pardir \ -boxdir prelistbox postlistbox prelistcopy postlistcopy \ -setprelistbox setpostlistbox noligaturing nokerning noexpansion \ -noprotrusion noleftkerning noleftligaturing norightkerning norightligaturing \ -noitaliccorrection futureletnexttoken defbackslashbreak letbackslashbreak pushoverloadmode \ -popoverloadmode pushrunstate poprunstate suggestedalias showboxhere \ -discoptioncodestring flagcodestring frozenparcodestring glyphoptioncodestring groupcodestring \ -hyphenationcodestring mathcontrolcodestring mathflattencodestring normalizecodestring parcontextcodestring \ -newlocalcount newlocaldimen newlocalskip newlocalmuskip newlocaltoks \ -newlocalbox newlocalwrite newlocalread setnewlocalcount setnewlocaldimen \ -setnewlocalskip setnewlocalmuskip setnewlocaltoks setnewlocalbox ifexpression +readline readlinedirect readfromterminal boxlines boxline \ +setboxline copyboxline boxlinewd boxlineht boxlinedp \ +boxlinenw boxlinenh boxlinend boxlinels boxliners \ +boxlinelh boxlinerh boxlinelp boxlinerp boxlinein \ +boxrangewd boxrangeht boxrangedp bitwiseset bitwiseand \ +bitwiseor bitwisexor bitwisenot bitwisenil ifbitwiseand \ +bitwise bitwiseshift bitwiseflip textdir linedir \ +pardir boxdir prelistbox postlistbox prelistcopy \ +postlistcopy setprelistbox setpostlistbox noligaturing nokerning \ +noexpansion noprotrusion noleftkerning noleftligaturing norightkerning \ +norightligaturing noitaliccorrection futureletnexttoken defbackslashbreak letbackslashbreak \ +pushoverloadmode popoverloadmode pushrunstate poprunstate suggestedalias \ +showboxhere discoptioncodestring flagcodestring frozenparcodestring glyphoptioncodestring \ +groupcodestring hyphenationcodestring mathcontrolcodestring mathflattencodestring normalizecodestring \ +parcontextcodestring newlocalcount newlocaldimen newlocalskip newlocalmuskip \ +newlocaltoks newlocalbox newlocalwrite newlocalread setnewlocalcount \ +setnewlocaldimen setnewlocalskip setnewlocalmuskip setnewlocaltoks setnewlocalbox \ +ifexpression localcontrolledrepeating expandedrepeating unexpandedrepeating lastchkinteger \ +ifchkinteger mathordinary mathoperator mathbinary mathrelation \ +mathpunctuation mathfraction mathradical mathmiddle mathaccent \ +mathfenced mathghost mathvariable mathactive mathvcenter \ +mathimaginary mathdifferential mathexponential mathdigit mathdivision \ +mathfactorial mathwrapped mathconstruct mathdimension mathunary \ +mathchemicalbond mathimplication filebasename filenameonly filedirname \ +filesuffix setmathoption resetmathoption Ustack Umathdict \ +Umathclass Ustyle Uchar Usuperscript Usubscript \ +Unosuperscript Unosubscript Uprimescript Usuperprescript Usubprescript \ +Unosuperprescript Unosubprescript ignorefile boxwidth boxheight \ +boxdepth diff --git a/Master/texmf-dist/context/data/scite/context/scite-context-data-interfaces.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-interfaces.properties index 49382a1bd76..27721a3ecbc 100644 --- a/Master/texmf-dist/context/data/scite/context/scite-context-data-interfaces.properties +++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-interfaces.properties @@ -14,93 +14,93 @@ Cacute Cap Caps Ccaron Ccedilla \ Ccircumflex Cdotaccent Character Characters Chi \ Chook ConTeXt Context ConvertConstantAfter ConvertToConstant \ Cstroke Cup DAYLONG DAYSHORT DZcaronligature \ -DZligature Dafrican Dcaron Dd Ddownarrow \ -Delta Dhook Doteq Downarrow Dstroke \ -Dzcaronligature Dzligature ETEX Eacute Ebreve \ -Ecaron Ecedilla Ecircumflex Ecircumflexacute Ecircumflexdotbelow \ -Ecircumflexgrave Ecircumflexhook Ecircumflextilde Ediaeresis Edotaccent \ -Edotbelow Edoublegrave Egrave Ehook Einvertedbreve \ -Emacron Eogonek Epsilon Eta Eth \ -Etilde Eulerconst EveryLine EveryPar Fhook \ -Finv Gacute Game Gamma Gbreve \ -Gcaron Gcircumflex Gcommaaccent Gdotaccent GetPar \ -Ghook GotoPar Greeknumerals Gstroke Hcaron \ -Hcircumflex Hstroke IJligature INRSTEX Iacute \ -Ibreve Icaron Icircumflex Idiaeresis Idotaccent \ -Idotbelow Idoublegrave Igrave Ihook Iinvertedbreve \ -Im Imacron Iogonek Iota Istroke \ -Itilde Jcircumflex Join Kappa Kcaron \ -Kcommaaccent Khook LAMSTEX LATEX LJligature \ -LUAJITTEX LUAMETATEX LUATEX LaTeX Lacute \ -LamSTeX Lambda Lbar Lcaron Lcommaaccent \ -Ldotmiddle Ldsh Leftarrow Leftrightarrow Ljligature \ -Lleftarrow Longleftarrow Longleftrightarrow Longmapsfrom Longmapsto \ -Longrightarrow Lsh Lstroke Lua LuaMetaTeX \ -LuaTeX LuajitTeX METAFONT METAFUN METAPOST \ -MKII MKIV MKIX MKLX MKVI \ -MKXI MKXL MONTH MONTHLONG MONTHSHORT \ -MPII MPIV MPLX MPVI MPXL \ -MPanchor MPbetex MPc MPcode MPcolor \ -MPcoloronly MPcolumn MPd MPdrawing MPfontsizehskip \ -MPgetmultipars MPgetmultishape MPgetposboxes MPh MPinclusions \ -MPleftskip MPll MPlr MPls MPmenubuttons \ -MPn MPoptions MPoverlayanchor MPp MPpage \ -MPpardata MPplus MPpos MPpositiongraphic MPposset \ -MPr MPrawvar MPregion MPrest MPrightskip \ -MPrs MPstring MPtext MPtransparency MPul \ -MPur MPv MPvar MPvariable MPvv \ -MPw MPwhd MPx MPxy MPxywhd \ -MPy Mapsfrom Mapsto MetaFont MetaFun \ -MetaPost Mu NJligature Nacute Ncaron \ -Ncommaaccent Nearrow Neng Ngrave Njligature \ -NormalizeFontHeight NormalizeFontWidth NormalizeTextHeight NormalizeTextWidth Ntilde \ -Nu Numbers Nwarrow OEligature Oacute \ -Obreve Ocaron Ocircumflex Ocircumflexacute Ocircumflexdotbelow \ -Ocircumflexgrave Ocircumflexhook Ocircumflextilde Odiaeresis Odiaeresismacron \ -Odotaccent Odotaccentmacron Odotbelow Odoublegrave Ograve \ -Ohook Ohorn Ohornacute Ohorndotbelow Ohorngrave \ -Ohornhook Ohorntilde Ohungarumlaut Oinvertedbreve Omacron \ -Omega Omicron Oogonek Oogonekmacron Ostroke \ -Ostrokeacute Otilde Otildemacron P PDFETEX \ -PDFTEX PDFcolor PICTEX PPCHTEX PPCHTeX \ -PRAGMA Phi Phook Pi PiCTeX \ -Plankconst PointsToBigPoints PointsToReal PointsToWholeBigPoints PropertyLine \ -Psi PtToCm Racute Rcaron Rcommaaccent \ -Rdoublegrave Rdsh Re ReadFile Relbar \ -Rho Rightarrow Rinvertedbreve Romannumerals Rrightarrow \ -Rsh S Sacute ScaledPointsToBigPoints ScaledPointsToWholeBigPoints \ -Scaron Scedilla Schwa Scircumflex Scommaaccent \ -Searrow Sigma Smallcapped Subset Supset \ -Swarrow TABLE TEX TaBlE Tau \ -Tcaron Tcedilla Tcommaaccent TeX TheNormalizedFontSize \ -Theta Thook Thorn TransparencyHack Tstroke \ -Uacute Ubreve Ucaron Ucircumflex Udiaeresis \ -Udiaeresisacute Udiaeresiscaron Udiaeresisgrave Udiaeresismacron Udotbelow \ -Udoublegrave Ugrave Uhook Uhorn Uhornacute \ -Uhorndotbelow Uhorngrave Uhornhook Uhorntilde Uhungarumlaut \ -Uinvertedbreve Umacron Uogonek Uparrow Updownarrow \ -Upsilon Uring Utilde Uuparrow VDash \ -Vdash VerboseNumber Vert Vhook Vvdash \ -WEEKDAY WORD WORDS Wcircumflex WidthSpanningText \ -Word Words XETEX XeTeX Xi \ -Yacute Ycircumflex Ydiaeresis Ydotbelow Ygrave \ -Yhook Ymacron Ytilde Zacute Zcaron \ -Zdotaccent Zeta Zhook Zstroke aacute \ -abbreviation abjadnaivenumerals abjadnodotnumerals abjadnumerals about \ -abreve abreveacute abrevedotbelow abrevegrave abrevehook \ -abrevetilde acaron acircumflex acircumflexacute acircumflexdotbelow \ -acircumflexgrave acircumflexhook acircumflextilde activatespacehandler actualday \ -actualmonth actualyear actuarial acute acwopencirclearrow \ -adaptcollector adaptfontfeature adaptlayout adaptpapersize addfeature \ -addtoJSpreamble addtocommalist addvalue adiaeresis adiaeresismacron \ -adotaccent adotaccentmacron adotbelow adoublegrave aeacute \ -aeligature aemacron afghanicurrency aftersplitstring aftertestandsplitstring \ -agrave ahook ainvertedbreve aleph alignbottom \ -aligned alignedbox alignedline alignhere alignmentcharacter \ -allinputpaths alpha alphabeticnumerals alwayscitation alwayscite \ -amacron amalg ampersand anchor angle \ -aogonek appendetoks appendgvalue appendtocommalist appendtoks \ -appendtoksonce appendvalue apply applyalternativestyle applyfunction \ +DZligature Dafrican Dcaron Ddownarrow Delta \ +Dhook Doteq Downarrow Dstroke Dzcaronligature \ +Dzligature ETEX Eacute Ebreve Ecaron \ +Ecedilla Ecircumflex Ecircumflexacute Ecircumflexdotbelow Ecircumflexgrave \ +Ecircumflexhook Ecircumflextilde Ediaeresis Edotaccent Edotbelow \ +Edoublegrave Egrave Ehook Einvertedbreve Emacron \ +Eogonek Epsilon Eta Eth Etilde \ +Eulerconst EveryLine EveryPar Fhook Finv \ +Gacute Game Gamma Gbreve Gcaron \ +Gcircumflex Gcommaaccent Gdotaccent GetPar Ghook \ +GotoPar Greeknumerals Gstroke Hcaron Hcircumflex \ +Hstroke IJligature INRSTEX Iacute Ibreve \ +Icaron Icircumflex Idiaeresis Idotaccent Idotbelow \ +Idoublegrave Igrave Ihook Iinvertedbreve Im \ +Imacron Iogonek Iota Istroke Itilde \ +Jcircumflex Join Kappa Kcaron Kcommaaccent \ +Khook LAMSTEX LATEX LJligature LUAJITTEX \ +LUAMETATEX LUATEX LaTeX Lacute LamSTeX \ +Lambda Lbar Lcaron Lcommaaccent Ldotmiddle \ +Ldsh Leftarrow Leftrightarrow Ljligature Lleftarrow \ +Longleftarrow Longleftrightarrow Longmapsfrom Longmapsto Longrightarrow \ +Lsh Lstroke Lua LuaMetaTeX LuaTeX \ +LuajitTeX METAFONT METAFUN METAPOST MKII \ +MKIV MKIX MKLX MKVI MKXI \ +MKXL MONTH MONTHLONG MONTHSHORT MPII \ +MPIV MPLX MPVI MPXL MPanchor \ +MPbetex MPc MPcode MPcolor MPcoloronly \ +MPcolumn MPd MPdrawing MPfontsizehskip MPgetmultipars \ +MPgetmultishape MPgetposboxes MPh MPinclusions MPleftskip \ +MPll MPlr MPls MPmenubuttons MPn \ +MPoptions MPoverlayanchor MPp MPpage MPpardata \ +MPplus MPpos MPpositiongraphic MPposset MPr \ +MPrawvar MPregion MPrest MPrightskip MPrs \ +MPstring MPtext MPtransparency MPul MPur \ +MPv MPvar MPvariable MPvv MPw \ +MPwhd MPx MPxy MPxywhd MPy \ +Mapsfrom Mapsto MetaFont MetaFun MetaPost \ +Mu NJligature Nacute Ncaron Ncommaaccent \ +Nearrow Neng Ngrave Njligature NormalizeFontHeight \ +NormalizeFontWidth NormalizeTextHeight NormalizeTextWidth Ntilde Nu \ +Numbers Nwarrow OEligature Oacute Obreve \ +Ocaron Ocircumflex Ocircumflexacute Ocircumflexdotbelow Ocircumflexgrave \ +Ocircumflexhook Ocircumflextilde Odiaeresis Odiaeresismacron Odotaccent \ +Odotaccentmacron Odotbelow Odoublegrave Ograve Ohook \ +Ohorn Ohornacute Ohorndotbelow Ohorngrave Ohornhook \ +Ohorntilde Ohungarumlaut Oinvertedbreve Omacron Omega \ +Omicron Oogonek Oogonekmacron Ostroke Ostrokeacute \ +Otilde Otildemacron P PDFETEX PDFTEX \ +PDFcolor PICTEX PPCHTEX PPCHTeX PRAGMA \ +Phi Phook Pi PiCTeX Plankconst \ +PointsToBigPoints PointsToReal PointsToWholeBigPoints Psi PtToCm \ +Racute Rcaron Rcommaaccent Rdoublegrave Rdsh \ +Re ReadFile Relbar Rho Rightarrow \ +Rinvertedbreve Romannumerals Rrightarrow Rsh S \ +Sacute ScaledPointsToBigPoints ScaledPointsToWholeBigPoints Scaron Scedilla \ +Schwa Scircumflex Scommaaccent Searrow Sigma \ +Smallcapped Subset Supset Swarrow TABLE \ +TEX TaBlE Tau Tcaron Tcedilla \ +Tcommaaccent TeX TheNormalizedFontSize Theta Thook \ +Thorn TransparencyHack Tstroke Uacute Ubreve \ +Ucaron Ucircumflex Udiaeresis Udiaeresisacute Udiaeresiscaron \ +Udiaeresisgrave Udiaeresismacron Udotbelow Udoublegrave Ugrave \ +Uhook Uhorn Uhornacute Uhorndotbelow Uhorngrave \ +Uhornhook Uhorntilde Uhungarumlaut Uinvertedbreve Umacron \ +Uogonek Uparrow Updownarrow Upsilon Uring \ +Utilde Uuparrow VDash Vdash VerboseNumber \ +Vert Vhook Vvdash WEEKDAY WORD \ +WORDS Wcircumflex WidthSpanningText Word Words \ +XETEX XeTeX Xi Yacute Ycircumflex \ +Ydiaeresis Ydotbelow Ygrave Yhook Ymacron \ +Ytilde Zacute Zcaron Zdotaccent Zeta \ +Zhook Zstroke aacute abbreviation abjadnaivenumerals \ +abjadnodotnumerals abjadnumerals about abreve abreveacute \ +abrevedotbelow abrevegrave abrevehook abrevetilde acaron \ +acircumflex acircumflexacute acircumflexdotbelow acircumflexgrave acircumflexhook \ +acircumflextilde activatespacehandler actualday actualmonth actualyear \ +actuarial acute acwopencirclearrow adaptcollector adaptfontfeature \ +adaptlayout adaptpapersize addfeature addtoJSpreamble addtocommalist \ +addvalue adiaeresis adiaeresismacron adjointsymbol adotaccent \ +adotaccentmacron adotbelow adoublegrave aeacute aeligature \ +aemacron afghanicurrency aftersplitstring aftertestandsplitstring agrave \ +ahook ainvertedbreve aleph alignbottom aligned \ +alignedbox alignedline alignhere alignmentcharacter allinputpaths \ +alpha alphabeticnumerals alwayscitation alwayscite amacron \ +amalg ampersand anchor angle aogonek \ +appendetoks appendgvalue appendtocommalist appendtoks appendtoksonce \ +appendvalue apply applyalternativestyle applyfunction applyfunctionof \ applyprocessor applytocharacters applytofirstcharacter applytosplitstringchar applytosplitstringcharspaced \ applytosplitstringline applytosplitstringlinespaced applytosplitstringword applytosplitstringwordspaced applytowords \ approx approxEq approxeq approxnEq arabicakbar \ @@ -128,136 +128,136 @@ atrightmargin attachment autocap autodirhbox autodirvbox \ autodirvtop autoinsertnextspace autointegral automathematics autoorientation \ autopagestaterealpage autopagestaterealpageorder autorule autosetups availablehsize \ averagecharwidth backepsilon background backgroundimage backgroundimagefill \ -backgroundline backprime backsim backslash bar \ -barleftarrow barleftarrowrightarrowbar barovernorthwestarrow barwedge basegrid \ -baselinebottom baselineleftbox baselinemiddlebox baselinerightbox bbordermatrix \ -bbox because beforesplitstring beforetestandsplitstring beta \ -beth between bhook big bigbodyfont \ -bigcap bigcirc bigcircle bigcup bigdiamond \ -bigg bigger biggl biggm biggr \ -bigl bigm bigodot bigoplus bigotimes \ -bigr bigskip bigsqcap bigsqcup bigsquare \ -bigstar bigtimes bigtriangledown bigtriangleup bigudot \ -biguplus bigvee bigwedge binom bitmapimage \ -blacklozenge blackrule blackrules blacksquare blacktriangle \ -blacktriangledown blacktriangleleft blacktriangleright blank blap \ -bleed bleedheight bleedwidth blockligatures blockquote \ -blocksynctexfile blockuservariable bodyfontenvironmentlist bodyfontsize bold \ -boldface bolditalic boldslanted bookmark booleanmodevalue \ -bordermatrix bot bottombox bottomleftbox bottomrightbox \ -bowtie boxcursor boxdot boxmarker boxminus \ -boxofsize boxplus boxreference boxtimes bpos \ -breakablethinspace breakhere breve bstroke btxabbreviatedjournal \ -btxaddjournal btxalwayscitation btxauthorfield btxdetail btxdirect \ -btxdoif btxdoifcombiinlistelse btxdoifelse btxdoifelsecombiinlist btxdoifelsesameasprevious \ -btxdoifelsesameaspreviouschecked btxdoifelseuservariable btxdoifnot btxdoifsameaspreviouscheckedelse btxdoifsameaspreviouselse \ -btxdoifuservariableelse btxexpandedjournal btxfield btxfieldname btxfieldtype \ -btxfirstofrange btxflush btxflushauthor btxflushauthorinverted btxflushauthorinvertedshort \ -btxflushauthorname btxflushauthornormal btxflushauthornormalshort btxflushsuffix btxfoundname \ -btxfoundtype btxhiddencitation btxhybridcite btxlabellanguage btxlabeltext \ -btxlistcitation btxloadjournalist btxoneorrange btxremapauthor btxsavejournalist \ -btxsetup btxsingularorplural btxsingularplural btxtextcitation buildmathaccent \ -buildtextaccent buildtextbottomcomma buildtextbottomdot buildtextcedilla buildtextgrave \ -buildtextmacron buildtextognek bullet button cacute \ -calligraphic camel cap capital carriagereturn \ -catcodetablename cbox ccaron ccedilla ccircumflex \ -ccurl cdot cdotaccent cdotp cdots \ -centeraligned centerbox centerdot centeredbox centeredlastline \ -centerednextbox centerline cfrac chapter character \ -characters chardescription charwidthlanguage check checkcharacteralign \ -checkedblank checkedchar checkedfiller checkedstrippedcsname checkinjector \ -checkmark checknextindentation checknextinjector checkpage checkparameters \ -checkpreviousinjector checksoundtrack checktwopassdata checkvariables chem \ -chemical chemicalbottext chemicalmidtext chemicalsymbol chemicaltext \ -chemicaltoptext chi chineseallnumerals chinesecapnumerals chinesenumerals \ -chook circ circeq circlearrowleft circlearrowright \ -circledR circledS circledast circledcirc circleddash \ -circledequals circleonrightarrow citation cite clap \ -classfont cldcommand cldcontext cldloadfile cldprocessfile \ -cleftarrow clip clippedoverlayimage clonefield clubsuit \ -collect collectedtext collectexpanded colon coloncolonequals \ -colonequals color colorbar colorcomponents colored \ -coloronly colorvalue column columnbreak columnsetspanwidth \ -combinepages commalistelement commalistsentence commalistsize comment \ -comparecolorgroup comparedimension comparedimensioneps comparepalet complement \ -completebtxrendering completecontent completeindex completelist completelistofabbreviations \ -completelistofchemicals completelistoffigures completelistofgraphics completelistofintermezzi completelistoflogos \ -completelistofpublications completelistofsorts completelistofsynonyms completelistoftables completepagenumber \ -completeregister complexes complexorsimple complexorsimpleempty component \ -composedcollector composedlayer compounddiscretionary compresult cong \ -constantdimen constantdimenargument constantemptyargument constantnumber constantnumberargument \ -contentreference continuednumber continueifinputfile convertargument convertcommand \ -convertedcounter converteddimen convertedsubcounter convertmonth convertnumber \ -convertvalue convertvboxtohbox coprod copyboxfromcache copybtxlabeltext \ +backgroundline backsim backslash bar barleftarrow \ +barleftarrowrightarrowbar barovernorthwestarrow barwedge basegrid baselinebottom \ +baselineleftbox baselinemiddlebox baselinerightbox bbordermatrix bbox \ +because beforesplitstring beforetestandsplitstring beta beth \ +between bhook big bigbodyfont bigcap \ +bigcirc bigcircle bigcup bigdiamond bigg \ +bigger biggl biggm biggr bigl \ +bigm bigodot bigoplus bigotimes bigr \ +bigskip bigsqcap bigsqcup bigsquare bigstar \ +bigtimes bigtriangledown bigtriangleup bigudot biguplus \ +bigvee bigwedge binom bitmapimage blacklozenge \ +blackrule blackrules blacksquare blacktriangle blacktriangledown \ +blacktriangleleft blacktriangleright blank blap bleed \ +bleedheight bleedwidth blockligatures blockquote blocksynctexfile \ +blockuservariable bodyfontenvironmentlist bodyfontsize bold boldface \ +bolditalic boldslanted bookmark booleanmodevalue bordermatrix \ +bot bottombox bottomleftbox bottomrightbox bowtie \ +boxcursor boxdot boxmarker boxminus boxofsize \ +boxplus boxreference boxtimes bpos breakablethinspace \ +breakhere breve bstroke btxabbreviatedjournal btxaddjournal \ +btxalwayscitation btxauthorfield btxdetail btxdirect btxdoif \ +btxdoifcombiinlistelse btxdoifelse btxdoifelsecombiinlist btxdoifelsesameasprevious btxdoifelsesameaspreviouschecked \ +btxdoifelseuservariable btxdoifnot btxdoifsameaspreviouscheckedelse btxdoifsameaspreviouselse btxdoifuservariableelse \ +btxexpandedjournal btxfield btxfieldname btxfieldtype btxfirstofrange \ +btxflush btxflushauthor btxflushauthorinverted btxflushauthorinvertedshort btxflushauthorname \ +btxflushauthornormal btxflushauthornormalshort btxflushsuffix btxfoundname btxfoundtype \ +btxhiddencitation btxhybridcite btxlabellanguage btxlabeltext btxlistcitation \ +btxloadjournalist btxoneorrange btxremapauthor btxsavejournalist btxsetup \ +btxsingularorplural btxsingularplural btxtextcitation buildmathaccent buildtextaccent \ +buildtextbottomcomma buildtextbottomdot buildtextcedilla buildtextgrave buildtextmacron \ +buildtextognek bullet button cacute calligraphic \ +camel cap capital carriagereturn catcodetablename \ +cbox ccaron ccedilla ccircumflex ccurl \ +cdot cdotaccent cdotp cdots centeraligned \ +centerbox centerdot centeredbox centeredlastline centerednextbox \ +centerline cfrac chapter character characters \ +chardescription charwidthlanguage check checkcharacteralign checkedblank \ +checkedchar checkedfiller checkedstrippedcsname checkinjector checkmark \ +checknextindentation checknextinjector checkpage checkparameters checkpreviousinjector \ +checksoundtrack checktwopassdata checkvariables chem chemical \ +chemicalbottext chemicalmidtext chemicalsymbol chemicaltext chemicaltoptext \ +chi chineseallnumerals chinesecapnumerals chinesenumerals chook \ +circ circeq circlearrowleft circlearrowright circledR \ +circledS circledast circledcirc circleddash circledequals \ +circleonrightarrow citation cite clap classfont \ +cldcommand cldcontext cldloadfile cldprocessfile cleftarrow \ +clip clippedoverlayimage clonefield clubsuit collect \ +collectedtext collectexpanded colon coloncolonequals colonequals \ +color colorbar colorcomponents colored coloronly \ +colorvalue column columnbreak columnsetspanwidth combinepages \ +commalistelement commalistsentence commalistsize comment comparecolorgroup \ +comparedimension comparedimensioneps comparepalet complement completebtxrendering \ +completecontent completeindex completelist completelistofabbreviations completelistofchemicals \ +completelistoffigures completelistofgraphics completelistofintermezzi completelistoflogos completelistofpublications \ +completelistofsorts completelistofsynonyms completelistoftables completepagenumber completeregister \ +complexes complexorsimple complexorsimpleempty component composedcollector \ +composedlayer compounddiscretionary compresult cong constantdimen \ +constantdimenargument constantemptyargument constantnumber constantnumberargument contentreference \ +continuednumber continueifinputfile convertargument convertcommand convertedcounter \ +converteddimen convertedsubcounter convertmonth convertnumber convertvalue \ +convertvboxtohbox convolve coprod copyboxfromcache copybtxlabeltext \ copyfield copyheadtext copylabeltext copymathlabeltext copyoperatortext \ copypages copyparameters copyposition copyprefixtext copyright \ copysetups copysuffixtext copytaglabeltext copyunittext correctwhitespace \ countersubs counttoken counttokens cramped crampedclap \ crampedllap crampedrlap crightarrow crightoverleftarrow crlf \ -crlfplaceholder cstroke ctop ctxcommand ctxdirectcommand \ -ctxdirectlua ctxfunction ctxlatecommand ctxlatelua ctxloadluafile \ -ctxlua ctxluabuffer ctxluacode ctxreport ctxsprint \ -cup curlyeqprec curlyeqsucc curlyvee curlywedge \ -currentassignmentlistkey currentassignmentlistvalue currentbtxuservariable currentcommalistitem currentcomponent \ -currentdate currentenvironment currentfeaturetest currentheadnumber currentinterface \ -currentlanguage currentlistentrydestinationattribute currentlistentrylimitedtext currentlistentrynumber currentlistentrypagenumber \ -currentlistentryreferenceattribute currentlistentrytitle currentlistentrytitlerendered currentlistsymbol currentmainlanguage \ -currentmessagetext currentmoduleparameter currentoutputstream currentproduct currentproject \ -currentregime currentregisterpageuserdata currentresponses currenttime currentvalue \ -currentxtablecolumn currentxtablerow curvearrowleft curvearrowright cwopencirclearrow \ -cyrillicA cyrillicAE cyrillicAbreve cyrillicAdiaeresis cyrillicB \ -cyrillicBIGYUS cyrillicBIGYUSiotified cyrillicC cyrillicCH cyrillicCHEDC \ -cyrillicCHEDCabkhasian cyrillicCHEabkhasian cyrillicCHEdiaeresis cyrillicCHEkhakassian cyrillicCHEvertstroke \ -cyrillicD cyrillicDASIAPNEUMATA cyrillicDJE cyrillicDZE cyrillicDZEabkhasian \ -cyrillicDZHE cyrillicE cyrillicELtail cyrillicEMtail cyrillicENDC \ -cyrillicENGHE cyrillicENhook cyrillicENtail cyrillicEREV cyrillicERY \ -cyrillicERtick cyrillicEbreve cyrillicEdiaeresis cyrillicEgrave cyrillicEiotified \ -cyrillicF cyrillicFITA cyrillicG cyrillicGHEmidhook cyrillicGHEstroke \ -cyrillicGHEupturn cyrillicGJE cyrillicH cyrillicHA cyrillicHADC \ -cyrillicHRDSN cyrillicI cyrillicIE cyrillicII cyrillicISHRT \ -cyrillicISHRTtail cyrillicIZHITSA cyrillicIZHITSAdoublegrave cyrillicIdiaeresis cyrillicIgrave \ -cyrillicImacron cyrillicJE cyrillicK cyrillicKADC cyrillicKAbashkir \ -cyrillicKAhook cyrillicKAstroke cyrillicKAvertstroke cyrillicKJE cyrillicKOPPA \ -cyrillicKSI cyrillicL cyrillicLITTLEYUS cyrillicLITTLEYUSiotified cyrillicLJE \ -cyrillicM cyrillicN cyrillicNJE cyrillicO cyrillicOMEGA \ -cyrillicOMEGAround cyrillicOMEGAtitlo cyrillicOT cyrillicObarred cyrillicObarreddiaeresis \ -cyrillicOdiaeresis cyrillicP cyrillicPALATALIZATION cyrillicPALOCHKA cyrillicPEmidhook \ -cyrillicPSI cyrillicPSILIPNEUMATA cyrillicR cyrillicS cyrillicSCHWA \ -cyrillicSCHWAdiaeresis cyrillicSDSC cyrillicSEMISOFT cyrillicSFTSN cyrillicSH \ -cyrillicSHCH cyrillicSHHA cyrillicT cyrillicTEDC cyrillicTETSE \ -cyrillicTITLO cyrillicTSHE cyrillicU cyrillicUK cyrillicUSHRT \ -cyrillicUdiaeresis cyrillicUdoubleacute cyrillicUmacron cyrillicV cyrillicYA \ -cyrillicYAT cyrillicYERUdiaeresis cyrillicYI cyrillicYO cyrillicYU \ -cyrillicYstr cyrillicYstrstroke cyrillicZ cyrillicZDSC cyrillicZEdiaeresis \ -cyrillicZH cyrillicZHEbreve cyrillicZHEdescender cyrillicZHEdiaeresis cyrillica \ -cyrillicabreve cyrillicadiaeresis cyrillicae cyrillicb cyrillicbigyus \ -cyrillicbigyusiotified cyrillicc cyrillicch cyrilliccheabkhasian cyrillicchedc \ -cyrillicchedcabkhasian cyrillicchediaeresis cyrillicchekhakassian cyrillicchevertstroke cyrillicd \ -cyrillicdje cyrillicdze cyrillicdzeabkhasian cyrillicdzhe cyrillice \ -cyrillicebreve cyrillicediaeresis cyrillicegrave cyrilliceiotified cyrilliceltail \ -cyrillicemtail cyrillicendc cyrillicenghe cyrillicenhook cyrillicentail \ -cyrillicerev cyrillicertick cyrillicery cyrillicf cyrillicfita \ -cyrillicg cyrillicghemidhook cyrillicghestroke cyrillicgheupturn cyrillicgje \ -cyrillich cyrillicha cyrillichadc cyrillichrdsn cyrillici \ -cyrillicidiaeresis cyrillicie cyrillicigrave cyrillicii cyrillicimacron \ -cyrillicishrt cyrillicishrttail cyrillicizhitsa cyrillicizhitsadoublegrave cyrillicje \ -cyrillick cyrillickabashkir cyrillickadc cyrillickahook cyrillickastroke \ -cyrillickavertstroke cyrillickje cyrillickoppa cyrillicksi cyrillicl \ -cyrilliclittleyus cyrilliclittleyusiotified cyrilliclje cyrillicm cyrillicn \ -cyrillicnje cyrillico cyrillicobarred cyrillicobarreddiaeresis cyrillicodiaeresis \ -cyrillicomega cyrillicomegaround cyrillicomegatitlo cyrillicot cyrillicp \ -cyrillicpemidhook cyrillicpsi cyrillicr cyrillics cyrillicschwa \ -cyrillicschwadiaeresis cyrillicsdsc cyrillicsemisoft cyrillicsftsn cyrillicsh \ -cyrillicshch cyrillicshha cyrillict cyrillictedc cyrillictetse \ -cyrillictshe cyrillicu cyrillicudiaeresis cyrillicudoubleacute cyrillicuk \ -cyrillicumacron cyrillicushrt cyrillicv cyrillicya cyrillicyat \ -cyrillicyerudiaeresis cyrillicyi cyrillicyo cyrillicystr cyrillicystrstroke \ -cyrillicyu cyrillicz cyrilliczdsc cyrilliczediaeresis cyrilliczh \ -cyrilliczhebreve cyrilliczhedescender cyrilliczhediaeresis d dag \ -dagger daleth dasharrow dashedleftarrow dashedrightarrow \ -dashv datasetvariable date daylong dayoftheweek \ -dayshort dayspermonth dbinom dcaron dcurl \ -dd ddag ddagger dddot ddot \ +crlfplaceholder crossproduct cstroke ctop ctxcommand \ +ctxdirectcommand ctxdirectlua ctxfunction ctxlatecommand ctxlatelua \ +ctxloadluafile ctxlua ctxluabuffer ctxluacode ctxreport \ +ctxsprint cup curlyeqprec curlyeqsucc curlyvee \ +curlywedge currentassignmentlistkey currentassignmentlistvalue currentbtxuservariable currentcommalistitem \ +currentcomponent currentdate currentenvironment currentfeaturetest currentheadnumber \ +currentinterface currentlanguage currentlistentrydestinationattribute currentlistentrylimitedtext currentlistentrynumber \ +currentlistentrypagenumber currentlistentryreferenceattribute currentlistentrytitle currentlistentrytitlerendered currentlistsymbol \ +currentmainlanguage currentmessagetext currentmoduleparameter currentoutputstream currentproduct \ +currentproject currentregime currentregisterpageuserdata currentresponses currenttime \ +currentvalue currentxtablecolumn currentxtablerow curvearrowleft curvearrowright \ +cwopencirclearrow cyrillicA cyrillicAE cyrillicAbreve cyrillicAdiaeresis \ +cyrillicB cyrillicBIGYUS cyrillicBIGYUSiotified cyrillicC cyrillicCH \ +cyrillicCHEDC cyrillicCHEDCabkhasian cyrillicCHEabkhasian cyrillicCHEdiaeresis cyrillicCHEkhakassian \ +cyrillicCHEvertstroke cyrillicD cyrillicDASIAPNEUMATA cyrillicDJE cyrillicDZE \ +cyrillicDZEabkhasian cyrillicDZHE cyrillicE cyrillicELtail cyrillicEMtail \ +cyrillicENDC cyrillicENGHE cyrillicENhook cyrillicENtail cyrillicEREV \ +cyrillicERY cyrillicERtick cyrillicEbreve cyrillicEdiaeresis cyrillicEgrave \ +cyrillicEiotified cyrillicF cyrillicFITA cyrillicG cyrillicGHEmidhook \ +cyrillicGHEstroke cyrillicGHEupturn cyrillicGJE cyrillicH cyrillicHA \ +cyrillicHADC cyrillicHRDSN cyrillicI cyrillicIE cyrillicII \ +cyrillicISHRT cyrillicISHRTtail cyrillicIZHITSA cyrillicIZHITSAdoublegrave cyrillicIdiaeresis \ +cyrillicIgrave cyrillicImacron cyrillicJE cyrillicK cyrillicKADC \ +cyrillicKAbashkir cyrillicKAhook cyrillicKAstroke cyrillicKAvertstroke cyrillicKJE \ +cyrillicKOPPA cyrillicKSI cyrillicL cyrillicLITTLEYUS cyrillicLITTLEYUSiotified \ +cyrillicLJE cyrillicM cyrillicN cyrillicNJE cyrillicO \ +cyrillicOMEGA cyrillicOMEGAround cyrillicOMEGAtitlo cyrillicOT cyrillicObarred \ +cyrillicObarreddiaeresis cyrillicOdiaeresis cyrillicP cyrillicPALATALIZATION cyrillicPALOCHKA \ +cyrillicPEmidhook cyrillicPSI cyrillicPSILIPNEUMATA cyrillicR cyrillicS \ +cyrillicSCHWA cyrillicSCHWAdiaeresis cyrillicSDSC cyrillicSEMISOFT cyrillicSFTSN \ +cyrillicSH cyrillicSHCH cyrillicSHHA cyrillicT cyrillicTEDC \ +cyrillicTETSE cyrillicTITLO cyrillicTSHE cyrillicU cyrillicUK \ +cyrillicUSHRT cyrillicUdiaeresis cyrillicUdoubleacute cyrillicUmacron cyrillicV \ +cyrillicYA cyrillicYAT cyrillicYERUdiaeresis cyrillicYI cyrillicYO \ +cyrillicYU cyrillicYstr cyrillicYstrstroke cyrillicZ cyrillicZDSC \ +cyrillicZEdiaeresis cyrillicZH cyrillicZHEbreve cyrillicZHEdescender cyrillicZHEdiaeresis \ +cyrillica cyrillicabreve cyrillicadiaeresis cyrillicae cyrillicb \ +cyrillicbigyus cyrillicbigyusiotified cyrillicc cyrillicch cyrilliccheabkhasian \ +cyrillicchedc cyrillicchedcabkhasian cyrillicchediaeresis cyrillicchekhakassian cyrillicchevertstroke \ +cyrillicd cyrillicdje cyrillicdze cyrillicdzeabkhasian cyrillicdzhe \ +cyrillice cyrillicebreve cyrillicediaeresis cyrillicegrave cyrilliceiotified \ +cyrilliceltail cyrillicemtail cyrillicendc cyrillicenghe cyrillicenhook \ +cyrillicentail cyrillicerev cyrillicertick cyrillicery cyrillicf \ +cyrillicfita cyrillicg cyrillicghemidhook cyrillicghestroke cyrillicgheupturn \ +cyrillicgje cyrillich cyrillicha cyrillichadc cyrillichrdsn \ +cyrillici cyrillicidiaeresis cyrillicie cyrillicigrave cyrillicii \ +cyrillicimacron cyrillicishrt cyrillicishrttail cyrillicizhitsa cyrillicizhitsadoublegrave \ +cyrillicje cyrillick cyrillickabashkir cyrillickadc cyrillickahook \ +cyrillickastroke cyrillickavertstroke cyrillickje cyrillickoppa cyrillicksi \ +cyrillicl cyrilliclittleyus cyrilliclittleyusiotified cyrilliclje cyrillicm \ +cyrillicn cyrillicnje cyrillico cyrillicobarred cyrillicobarreddiaeresis \ +cyrillicodiaeresis cyrillicomega cyrillicomegaround cyrillicomegatitlo cyrillicot \ +cyrillicp cyrillicpemidhook cyrillicpsi cyrillicr cyrillics \ +cyrillicschwa cyrillicschwadiaeresis cyrillicsdsc cyrillicsemisoft cyrillicsftsn \ +cyrillicsh cyrillicshch cyrillicshha cyrillict cyrillictedc \ +cyrillictetse cyrillictshe cyrillicu cyrillicudiaeresis cyrillicudoubleacute \ +cyrillicuk cyrillicumacron cyrillicushrt cyrillicv cyrillicya \ +cyrillicyat cyrillicyerudiaeresis cyrillicyi cyrillicyo cyrillicystr \ +cyrillicystrstroke cyrillicyu cyrillicz cyrilliczdsc cyrilliczediaeresis \ +cyrilliczh cyrilliczhebreve cyrilliczhedescender cyrilliczhediaeresis d \ +dag dagger daleth dasharrow dashedleftarrow \ +dashedrightarrow dashv datasetvariable date daylong \ +dayoftheweek dayshort dayspermonth dbinom dcaron \ +dcurl ddag ddagger dddot ddot \ ddots decrement decrementcounter decrementedcounter decrementpagenumber \ decrementsubpagenumber decrementvalue defaultinterface defaultobjectpage defaultobjectreference \ defcatcodecommand defconvertedargument defconvertedcommand defconvertedvalue define \ @@ -313,964 +313,967 @@ definetype definetypeface definetypescriptprefix definetypescriptsynonym definet definetyping defineunit defineuserdata defineuserdataalternative defineviewerlayer \ definevspace definevspacing definevspacingamount definextable defrostparagraphproperties \ delimited delimitedtext delta depthofstring depthonlybox \ -depthspanningtext depthstrut determineheadnumber determinelistcharacteristics determinenoflines \ -determineregistercharacteristics devanagarinumerals dfrac dhook diameter \ -diamond diamondsuit differentialD differentiald digamma \ -digits dimensiontocount directboxfromcache directcolor directcolored \ -directconvertedcounter directcopyboxfromcache directdummyparameter directgetboxllx directgetboxlly \ -directhighlight directlocalframed directluacode directparwrapper directselect \ -directsetbar directsetup directsymbol directvspacing dis \ -disabledirectives disableexperiments disablemode disableoutputstream disableparpositions \ -disableregime disabletrackers displaymath displaymathematics displaymessage \ -disposeluatable distributedhsize div dividedsize divideontimes \ -divides doadaptleftskip doadaptrightskip doaddfeature doassign \ -doassignempty doboundtext docheckassignment docheckedpair documentvariable \ -dodoubleargument dodoubleargumentwithset dodoubleempty dodoubleemptywithset dodoublegroupempty \ -doeassign doexpandedrecurse dofastloopcs dogetattribute dogetattributeid \ -dogetcommacommandelement dogobbledoubleempty dogobblesingleempty dohyphens doif \ -doifMPgraphicelse doifallcommon doifallcommonelse doifalldefinedelse doifallmodes \ -doifallmodeselse doifassignmentelse doifassignmentelsecs doifblackelse doifbothsides \ -doifbothsidesoverruled doifboxelse doifbufferelse doifcheckedpagestate doifcolor \ -doifcolorelse doifcommandhandler doifcommandhandlerelse doifcommon doifcommonelse \ -doifcontent doifconversiondefinedelse doifconversionnumberelse doifcounter doifcounterelse \ -doifcurrentfonthasfeatureelse doifdefined doifdefinedcounter doifdefinedcounterelse doifdefinedelse \ -doifdimensionelse doifdimenstringelse doifdocumentargument doifdocumentargumentelse doifdocumentfilename \ -doifdocumentfilenameelse doifdocumentvariable doifdocumentvariableelse doifdrawingblackelse doifelse \ -doifelseMPgraphic doifelseallcommon doifelsealldefined doifelseallmodes doifelseassignment \ -doifelseassignmentcs doifelseblack doifelsebox doifelseboxincache doifelsebuffer \ -doifelsecolor doifelsecommandhandler doifelsecommon doifelseconversiondefined doifelseconversionnumber \ -doifelsecounter doifelsecurrentfonthasfeature doifelsecurrentsortingused doifelsecurrentsynonymshown doifelsecurrentsynonymused \ -doifelsedefined doifelsedefinedcounter doifelsedimension doifelsedimenstring doifelsedocumentargument \ -doifelsedocumentfilename doifelsedocumentvariable doifelsedrawingblack doifelseempty doifelseemptyvalue \ -doifelseemptyvariable doifelseenv doifelsefastoptionalcheck doifelsefastoptionalcheckcs doifelsefieldbody \ -doifelsefieldcategory doifelsefigure doifelsefile doifelsefiledefined doifelsefileexists \ -doifelsefirstchar doifelseflagged doifelsefontchar doifelsefontfeature doifelsefontpresent \ -doifelsefontsynonym doifelseframed doifelsehasspace doifelsehelp doifelseincsname \ -doifelseindented doifelseinelement doifelseinputfile doifelseinsertion doifelseinset \ -doifelseinstring doifelseinsymbolset doifelseintoks doifelseintwopassdata doifelseitalic \ -doifelselanguage doifelselayerdata doifelselayoutdefined doifelselayoutsomeline doifelselayouttextline \ -doifelseleapyear doifelselist doifelselocation doifelselocfile doifelsemainfloatbody \ -doifelsemarkedcontent doifelsemarkedpage doifelsemarking doifelsemeaning doifelsemessage \ -doifelsemode doifelsenextbgroup doifelsenextbgroupcs doifelsenextchar doifelsenextoptional \ -doifelsenextoptionalcs doifelsenextparenthesis doifelsenonzeropositive doifelsenoteonsamepage doifelsenothing \ -doifelsenumber doifelseobjectfound doifelseobjectreferencefound doifelseoddpage doifelseoddpagefloat \ -doifelseoldercontext doifelseolderversion doifelseorientation doifelseoverlapping doifelseoverlay \ -doifelseparallel doifelseparentfile doifelseparwrapper doifelsepath doifelsepathexists \ -doifelsepatterns doifelseposition doifelsepositionaction doifelsepositiononpage doifelsepositionsonsamepage \ -doifelsepositionsonthispage doifelsepositionsused doifelsereferencefound doifelserightpage doifelserightpagefloat \ -doifelserighttoleftinbox doifelsesamelinereference doifelsesamestring doifelsesetups doifelsesomebackground \ -doifelsesomespace doifelsesomething doifelsesometoks doifelsestringinstring doifelsestructurelisthasnumber \ -doifelsestructurelisthaspage doifelsesymboldefined doifelsesymbolset doifelsetext doifelsetextflow \ -doifelsetextflowcollector doifelsetopofpage doifelsetypingfile doifelseundefined doifelseurldefined \ -doifelsevalue doifelsevaluenothing doifelsevariable doifempty doifemptyelse \ -doifemptytoks doifemptyvalue doifemptyvalueelse doifemptyvariable doifemptyvariableelse \ -doifenv doifenvelse doiffastoptionalcheckcselse doiffastoptionalcheckelse doiffieldbodyelse \ -doiffieldcategoryelse doiffigureelse doiffile doiffiledefinedelse doiffileelse \ -doiffileexistselse doiffirstcharelse doifflaggedelse doiffontcharelse doiffontfeatureelse \ -doiffontpresentelse doiffontsynonymelse doifhasspaceelse doifhelpelse doifincsnameelse \ -doifinelementelse doifinputfileelse doifinsertionelse doifinset doifinsetelse \ -doifinstring doifinstringelse doifinsymbolset doifinsymbolsetelse doifintokselse \ -doifintwopassdataelse doifitalicelse doiflanguageelse doiflayerdataelse doiflayoutdefinedelse \ -doiflayoutsomelineelse doiflayouttextlineelse doifleapyearelse doiflistelse doiflocationelse \ -doiflocfileelse doifmainfloatbodyelse doifmarkingelse doifmeaningelse doifmessageelse \ -doifmode doifmodeelse doifnextbgroupcselse doifnextbgroupelse doifnextcharelse \ -doifnextoptionalcselse doifnextoptionalelse doifnextparenthesiselse doifnonzeropositiveelse doifnot \ -doifnotallcommon doifnotallmodes doifnotcommandhandler doifnotcommon doifnotcounter \ -doifnotdocumentargument doifnotdocumentfilename doifnotdocumentvariable doifnotempty doifnotemptyvalue \ -doifnotemptyvariable doifnotenv doifnoteonsamepageelse doifnotescollected doifnotfile \ -doifnotflagged doifnothing doifnothingelse doifnotinset doifnotinsidesplitfloat \ -doifnotinstring doifnotmode doifnotnumber doifnotsamestring doifnotsetups \ -doifnotvalue doifnotvariable doifnumber doifnumberelse doifobjectfoundelse \ -doifobjectreferencefoundelse doifoddpageelse doifoddpagefloatelse doifoldercontextelse doifolderversionelse \ -doifoutervmode doifoverlappingelse doifoverlayelse doifparallelelse doifparentfileelse \ -doifpathelse doifpathexistselse doifpatternselse doifposition doifpositionaction \ -doifpositionactionelse doifpositionelse doifpositiononpageelse doifpositionsonsamepageelse doifpositionsonthispageelse \ -doifpositionsusedelse doifreferencefoundelse doifrightpageelse doifrightpagefloatelse doifrighttoleftinboxelse \ -doifsamelinereferenceelse doifsamestring doifsamestringelse doifsetups doifsetupselse \ -doifsomebackground doifsomebackgroundelse doifsomespaceelse doifsomething doifsomethingelse \ -doifsometoks doifsometokselse doifstringinstringelse doifstructurelisthasnumberelse doifstructurelisthaspageelse \ -doifsymboldefinedelse doifsymbolsetelse doiftext doiftextelse doiftextflowcollectorelse \ -doiftextflowelse doiftopofpageelse doiftypingfileelse doifundefined doifundefinedcounter \ -doifundefinedelse doifunknownfontfeature doifurldefinedelse doifvalue doifvalueelse \ -doifvaluenothing doifvaluenothingelse doifvaluesomething doifvariable doifvariableelse \ -doindentation dollar doloop doloopoverlist donothing \ -dontconvertfont dontleavehmode dontpermitspacesbetweengroups dopositionaction doprocesslocalsetups \ -doquadrupleargument doquadrupleempty doquadruplegroupempty doquintupleargument doquintupleempty \ -doquintuplegroupempty dorechecknextindentation dorecurse dorepeatwithcommand doreplacefeature \ -doresetandafffeature doresetattribute dorotatebox dosetattribute dosetleftskipadaption \ -dosetrightskipadaption dosetupcheckedinterlinespace doseventupleargument doseventupleempty dosingleargument \ -dosingleempty dosinglegroupempty dosixtupleargument dosixtupleempty dosomebreak \ -dostepwiserecurse dosubtractfeature dot doteq doteqdot \ -dotfill dotfskip dotlessI dotlessJ dotlessi \ -dotlessj dotlessjstroke dotminus dotoks dotplus \ -dotripleargument dotripleargumentwithset dotripleempty dotripleemptywithset dotriplegroupempty \ -dots dottedcircle dottedrightarrow doublebar doublebond \ -doublebrace doublebracket doublecap doublecup doubleparent \ -doubleprime doubleverticalbar dowith dowithnextbox dowithnextboxcontent \ -dowithnextboxcontentcs dowithnextboxcs dowithpargument dowithrange dowithwargument \ -downarrow downdasharrow downdownarrows downharpoonleft downharpoonright \ -downuparrows downwhitearrow downzigzagarrow dpofstring dstroke \ -dtail dummydigit dummyparameter dzcaronligature dzligature \ -eTeX eacute ebreve ecaron ecedilla \ -ecircumflex ecircumflexacute ecircumflexdotbelow ecircumflexgrave ecircumflexhook \ -ecircumflextilde edefconvertedargument ediaeresis edotaccent edotbelow \ -edoublegrave ee efcmaxheight efcmaxwidth efcminheight \ -efcminwidth efcparameter effect egrave ehook \ -einvertedbreve elapsedseconds elapsedsteptime elapsedtime eleftarrowfill \ -eleftharpoondownfill eleftharpoonupfill eleftrightarrowfill ell em \ -emacron emdash emphasisboldface emphasistypeface emptylines \ -emptyset emquad emspace enableasciimode enabledirectives \ -enableexperiments enablemode enableoutputstream enableparpositions enableregime \ -enabletrackers endash endnote enquad enskip \ -enspace env environment envvar eogonek \ -eoverbarfill eoverbracefill eoverbracketfill eoverparentfill epos \ -epsilon eq eqcirc eqeq eqeqeq \ -eqgtr eqless eqsim eqslantgtr eqslantless \ -equaldigits equalscolon equiv erightarrowfill erightharpoondownfill \ -erightharpoonupfill eta eth ethiopic etilde \ -etwoheadrightarrowfill eunderbarfill eunderbracefill eunderbracketfill eunderparentfill \ -exclamdown executeifdefined exists exitloop exitloopnow \ -expandcheckedcsname expanded expandeddoif expandeddoifelse expandeddoifnot \ -expandfontsynonym expdoif expdoifcommonelse expdoifelse expdoifelsecommon \ -expdoifelseinset expdoifinsetelse expdoifnot exponentiale externalfigure \ -externalfigurecollectionmaxheight externalfigurecollectionmaxwidth externalfigurecollectionminheight externalfigurecollectionminwidth externalfigurecollectionparameter \ -fakebox fallingdotseq fastdecrement fastincrement fastlocalframed \ -fastloopfinal fastloopindex fastscale fastsetup fastsetupwithargument \ -fastsetupwithargumentswapped fastswitchtobodyfont fastsxsy feature fence \ -fenced fetchallmarkings fetchallmarks fetchmark fetchmarking \ -fetchonemark fetchonemarking fetchruntinecommand fetchtwomarkings fetchtwomarks \ -ffiligature ffligature fflligature fhook field \ -fieldbody fieldstack fifthoffivearguments fifthofsixarguments figuredash \ -figurefilename figurefilepath figurefiletype figurefullname figureheight \ -figurenaturalheight figurenaturalwidth figurespace figuresymbol figurewidth \ -filename filigature filledhboxb filledhboxc filledhboxg \ -filledhboxk filledhboxm filledhboxr filledhboxy filler \ -fillinline fillinrules fillintext fillupto filterfromnext \ -filterfromvalue filterpages filterreference findtwopassdata finishregisterentry \ -firstcharacter firstcounter firstcountervalue firstinlist firstoffivearguments \ -firstoffourarguments firstofoneargument firstofoneunexpanded firstofsixarguments firstofthreearguments \ -firstofthreeunexpanded firstoftwoarguments firstoftwounexpanded firstrealpage firstrealpagenumber \ -firstsubcountervalue firstsubpage firstsubpagenumber firstuserpage firstuserpagenumber \ -fitfield fitfieldframed fittopbaselinegrid fiveeighths fivesixths \ -fixedspace fixedspaces flag flat flligature \ -floatuserdataparameter flushbox flushboxregister flushcollector flushedrightlastline \ -flushlayer flushlocalfloats flushnextbox flushnotes flushoutputstream \ -flushshapebox flushtextflow flushtokens flushtoks fontalternative \ -fontbody fontchar fontcharbyindex fontclass fontclassname \ -fontface fontfeaturelist fontsize fontstyle footnote \ -footnotetext forall forcecharacterstripping forcelocalfloats forgeteverypar \ -forgetparagraphfreezing forgetparameters forgetparskip forgetparwrapper forgetragged \ -formula formulanumber foundbox fourfifths fourperemspace \ -fourthoffivearguments fourthoffourarguments fourthofsixarguments frac framed \ -frameddimension framedparameter framedtext freezedimenmacro freezemeasure \ -freezeparagraphproperties frenchspacing from fromlinenote frown \ -frozenhbox frule gacute gamma gbreve \ -gcaron gcircumflex gcommaaccent gdefconvertedargument gdefconvertedcommand \ -gdotaccent ge geq geqq geqslant \ -getMPdrawing getMPlayer getboxfromcache getboxllx getboxlly \ -getbuffer getbufferdata getcommacommandsize getcommalistsize getdatavalue \ -getdayoftheweek getdayspermonth getdefinedbuffer getdocumentargument getdocumentargumentdefault \ -getdocumentfilename getdummyparameters getemptyparameters geteparameters getexpandedparameters \ -getfiguredimensions getfirstcharacter getfirsttwopassdata getfromcommacommand getfromcommalist \ -getfromluatable getfromtwopassdata getglyphdirect getglyphstyled getgparameters \ -getinlineuserdata getlasttwopassdata getlocalfloat getlocalfloats getmarking \ -getmessage getnamedglyphdirect getnamedglyphstyled getnamedtwopassdatalist getnaturaldimensions \ -getnoflines getobject getobjectdimensions getpaletsize getparameters \ -getparwrapper getprivatechar getprivateslot getrandomcount getrandomdimen \ -getrandomfloat getrandomnumber getrandomseed getraweparameters getrawgparameters \ -getrawnoflines getrawparameters getrawxparameters getreference getreferenceentry \ -getroundednoflines gets getsubstring gettokenlist gettwopassdata \ -gettwopassdatalist getuserdata getuvalue getvalue getvariable \ -getvariabledefault getxparameters gg ggg gggtr \ -gimel globaldisablemode globalenablemode globalletempty globalpopbox \ -globalpopmacro globalpreventmode globalprocesscommalist globalpushbox globalpushmacro \ -globalswapcounts globalswapdimens globalswapmacros globalundefine glyphfontfile \ -gnapprox gneqq gnsim gobbledoubleempty gobbleeightarguments \ -gobblefivearguments gobblefiveoptionals gobblefourarguments gobblefouroptionals gobbleninearguments \ -gobbleoneargument gobbleoneoptional gobblesevenarguments gobblesingleempty gobblesixarguments \ -gobblespacetokens gobbletenarguments gobblethreearguments gobblethreeoptionals gobbletwoarguments \ -gobbletwooptionals gobbleuntil gobbleuntilrelax godown goto \ -gotobox gotopage grabbufferdata grabbufferdatadirect grabuntil \ -grave graycolor grayvalue greedysplitstring greekAlpha \ -greekAlphadasia greekAlphadasiaperispomeni greekAlphadasiatonos greekAlphadasiavaria greekAlphaiotasub \ -greekAlphaiotasubdasia greekAlphaiotasubdasiaperispomeni greekAlphaiotasubdasiatonos greekAlphaiotasubdasiavaria greekAlphaiotasubpsili \ -greekAlphaiotasubpsiliperispomeni greekAlphaiotasubpsilitonos greekAlphaiotasubpsilivaria greekAlphamacron greekAlphapsili \ -greekAlphapsiliperispomeni greekAlphapsilitonos greekAlphapsilivaria greekAlphatonos greekAlphavaria \ -greekAlphavrachy greekBeta greekChi greekCoronis greekDelta \ -greekEpsilon greekEpsilondasia greekEpsilondasiatonos greekEpsilondasiavaria greekEpsilonpsili \ -greekEpsilonpsilitonos greekEpsilonpsilivaria greekEpsilontonos greekEpsilonvaria greekEta \ -greekEtadasia greekEtadasiaperispomeni greekEtadasiatonos greekEtadasiavaria greekEtaiotasub \ -greekEtaiotasubdasia greekEtaiotasubdasiaperispomeni greekEtaiotasubdasiatonos greekEtaiotasubdasiavaria greekEtaiotasubpsili \ -greekEtaiotasubpsiliperispomeni greekEtaiotasubpsilitonos greekEtaiotasubpsilivaria greekEtapsili greekEtapsiliperispomeni \ -greekEtapsilitonos greekEtapsilivaria greekEtatonos greekEtavaria greekGamma \ -greekIota greekIotadasia greekIotadasiaperispomeni greekIotadasiatonos greekIotadasiavaria \ -greekIotadialytika greekIotamacron greekIotapsili greekIotapsiliperispomeni greekIotapsilitonos \ -greekIotapsilivaria greekIotatonos greekIotavaria greekIotavrachy greekKappa \ -greekLambda greekMu greekNu greekOmega greekOmegadasia \ -greekOmegadasiaperispomeni greekOmegadasiatonos greekOmegadasiavaria greekOmegaiotasub greekOmegaiotasubdasia \ -greekOmegaiotasubdasiaperispomeni greekOmegaiotasubdasiatonos greekOmegaiotasubdasiavaria greekOmegaiotasubpsili greekOmegaiotasubpsiliperispomeni \ -greekOmegaiotasubpsilitonos greekOmegaiotasubpsilivaria greekOmegapsili greekOmegapsiliperispomeni greekOmegapsilitonos \ -greekOmegapsilivaria greekOmegatonos greekOmegavaria greekOmicron greekOmicrondasia \ -greekOmicrondasiatonos greekOmicrondasiavaria greekOmicronpsili greekOmicronpsilitonos greekOmicronpsilivaria \ -greekOmicrontonos greekOmicronvaria greekPhi greekPi greekPsi \ -greekRho greekRhodasia greekSigma greekSigmalunate greekTau \ -greekTheta greekUpsilon greekUpsilondasia greekUpsilondasiaperispomeni greekUpsilondasiatonos \ -greekUpsilondasiavaria greekUpsilondialytika greekUpsilonmacron greekUpsilontonos greekUpsilonvaria \ -greekUpsilonvrachy greekXi greekZeta greekalpha greekalphadasia \ -greekalphadasiaperispomeni greekalphadasiatonos greekalphadasiavaria greekalphaiotasub greekalphaiotasubdasia \ -greekalphaiotasubdasiaperispomeni greekalphaiotasubdasiatonos greekalphaiotasubdasiavaria greekalphaiotasubperispomeni greekalphaiotasubpsili \ -greekalphaiotasubpsiliperispomeni greekalphaiotasubpsilitonos greekalphaiotasubpsilivaria greekalphaiotasubtonos greekalphaiotasubvaria \ -greekalphamacron greekalphaoxia greekalphaperispomeni greekalphapsili greekalphapsiliperispomeni \ -greekalphapsilitonos greekalphapsilivaria greekalphatonos greekalphavaria greekalphavrachy \ -greekbeta greekbetaalt greekchi greekdasia greekdasiaperispomeni \ -greekdasiavaria greekdelta greekdialytikaperispomeni greekdialytikatonos greekdialytikavaria \ -greekdigamma greekepsilon greekepsilonalt greekepsilondasia greekepsilondasiatonos \ -greekepsilondasiavaria greekepsilonoxia greekepsilonpsili greekepsilonpsilitonos greekepsilonpsilivaria \ -greekepsilontonos greekepsilonvaria greeketa greeketadasia greeketadasiaperispomeni \ -greeketadasiatonos greeketadasiavaria greeketaiotasub greeketaiotasubdasia greeketaiotasubdasiaperispomeni \ -greeketaiotasubdasiatonos greeketaiotasubdasiavaria greeketaiotasubperispomeni greeketaiotasubpsili greeketaiotasubpsiliperispomeni \ -greeketaiotasubpsilitonos greeketaiotasubpsilivaria greeketaiotasubtonos greeketaiotasubvaria greeketaoxia \ -greeketaperispomeni greeketapsili greeketapsiliperispomeni greeketapsilitonos greeketapsilivaria \ -greeketatonos greeketavaria greekfinalsigma greekgamma greekiota \ -greekiotadasia greekiotadasiaperispomeni greekiotadasiatonos greekiotadasiavaria greekiotadialytika \ -greekiotadialytikaperispomeni greekiotadialytikatonos greekiotadialytikavaria greekiotamacron greekiotaoxia \ -greekiotaperispomeni greekiotapsili greekiotapsiliperispomeni greekiotapsilitonos greekiotapsilivaria \ -greekiotatonos greekiotavaria greekiotavrachy greekkappa greekkoppa \ -greeklambda greekmu greeknu greeknumerals greeknumkoppa \ -greekomega greekomegadasia greekomegadasiaperispomeni greekomegadasiatonos greekomegadasiavaria \ -greekomegaiotasub greekomegaiotasubdasia greekomegaiotasubdasiaperispomeni greekomegaiotasubdasiatonos greekomegaiotasubdasiavaria \ -greekomegaiotasubperispomeni greekomegaiotasubpsili greekomegaiotasubpsiliperispomeni greekomegaiotasubpsilitonos greekomegaiotasubpsilivaria \ -greekomegaiotasubtonos greekomegaiotasubvaria greekomegaoxia greekomegaperispomeni greekomegapsili \ -greekomegapsiliperispomeni greekomegapsilitonos greekomegapsilivaria greekomegatonos greekomegavaria \ -greekomicron greekomicrondasia greekomicrondasiatonos greekomicrondasiavaria greekomicronoxia \ -greekomicronpsili greekomicronpsilitonos greekomicronpsilivaria greekomicrontonos greekomicronvaria \ -greekoxia greekperispomeni greekphi greekphialt greekpi \ -greekpialt greekprosgegrammeni greekpsi greekpsili greekpsiliperispomeni \ -greekpsilivaria greekrho greekrhoalt greekrhodasia greekrhopsili \ -greeksampi greeksigma greeksigmalunate greekstigma greektau \ -greektheta greekthetaalt greektonos greekupsilon greekupsilondasia \ -greekupsilondasiaperispomeni greekupsilondasiatonos greekupsilondasiavaria greekupsilondiaeresis greekupsilondialytikaperispomeni \ -greekupsilondialytikatonos greekupsilondialytikavaria greekupsilonmacron greekupsilonoxia greekupsilonperispomeni \ -greekupsilonpsili greekupsilonpsiliperispomeni greekupsilonpsilitonos greekupsilonpsilivaria greekupsilontonos \ -greekupsilonvaria greekupsilonvrachy greekvaria greekxi greekzeta \ -grid groupedcommand gsetboxllx gsetboxlly gstroke \ -gt gtrapprox gtrdot gtreqless gtreqqless \ -gtrless gtrsim guilsingleleft guilsingleright gujaratinumerals \ -gurmurkhinumerals hairline hairspace halflinestrut halfstrut \ -halfwaybox handletokens handwritten hangul hanzi \ -hash hat hbar hboxofvbox hboxreference \ -hcaron hcircumflex hdofstring headhbox headlanguage \ -headnumber headnumbercontent headnumberdistance headnumberwidth headreferenceattributes \ -headsetupspacing headtext headtextcontent headtextdistance headtexts \ -headtextwidth headvbox headwidth heartsuit hebrewAlef \ -hebrewAyin hebrewBet hebrewDalet hebrewGimel hebrewHe \ -hebrewHet hebrewKaf hebrewKaffinal hebrewLamed hebrewMem \ -hebrewMemfinal hebrewNun hebrewNunfinal hebrewPe hebrewPefinal \ -hebrewQof hebrewResh hebrewSamekh hebrewShin hebrewTav \ -hebrewTet hebrewTsadi hebrewTsadifinal hebrewVav hebrewYod \ -hebrewZayin hebrewnumerals heightanddepthofstring heightofstring heightspanningtext \ -helptext hexnumber hexstringtonumber hglue hiddenbar \ -hiddencitation hiddencite hideblocks high highlight \ -highordinalstr hilo himilo hl hookleftarrow \ -hookrightarrow horizontalgrowingbar horizontalpositionbar hpackbox hpackedbox \ -hphantom hpos hsizefraction hslash hsmash \ -hsmashbox hsmashed hspace hstroke htdpofstring \ -htofstring hyphen hyphenatedcoloredword hyphenatedfile hyphenatedfilename \ -hyphenatedhbox hyphenatedpar hyphenatedurl hyphenatedword iacute \ -ibox ibreve icaron icircumflex ideographichalffillspace \ -ideographicspace idiaeresis idotaccent idotbelow idoublegrave \ -idxfromluatable ifassignment iff ifinobject ifinoutputstream \ -ifparameters iftrialtypesetting ignoreimplicitspaces ignoretagsinexport ignorevalue \ -igrave ihook ii iiiint iiiintop \ -iiint iiintop iint iintop iinvertedbreve \ -ijligature imacron imaginaryi imaginaryj imath \ -immediatesavetwopassdata impliedby implies imply in \ -includemenu includesvgbuffer includesvgfile includeversioninfo increment \ -incrementcounter incrementedcounter incrementpagenumber incrementsubpagenumber incrementvalue \ -indentation index infofont infofontbold inframed \ -infty infull inheritparameter inhibitblank ininner \ -ininneredge ininnermargin initializeboxstack inleft inleftedge \ -inleftmargin inline inlinebuffer inlinedbox inlinemath \ -inlinemathematics inlinemessage inlineordisplaymath inlineprettyprintbuffer inlinerange \ -inmargin inmframed innerflushshapebox inother inouter \ -inouteredge inoutermargin input inputfilebarename inputfilename \ -inputfilerealsuffix inputfilesuffix inputgivenfile inright inrightedge \ -inrightmargin insertpages inspectluatable installactionhandler installactivecharacter \ -installanddefineactivecharacter installattributestack installautocommandhandler installautosetuphandler installbasicautosetuphandler \ -installbasicparameterhandler installbottomframerenderer installcommandhandler installcorenamespace installctxfunction \ -installctxscanner installdefinehandler installdefinitionset installdefinitionsetmember installdirectcommandhandler \ -installdirectparameterhandler installdirectparametersethandler installdirectsetuphandler installdirectstyleandcolorhandler installframedautocommandhandler \ -installframedcommandhandler installglobalmacrostack installlanguage installleftframerenderer installmacrostack \ -installnamespace installoutputroutine installpagearrangement installparameterhandler installparameterhashhandler \ -installparametersethandler installparentinjector installprotectedctxfunction installprotectedctxscanner installrightframerenderer \ -installrootparameterhandler installsetuphandler installsetuponlycommandhandler installshipoutmethod installsimplecommandhandler \ -installsimpleframedcommandhandler installstyleandcolorhandler installswitchcommandhandler installswitchsetuphandler installtexdirective \ -installtextracker installtopframerenderer installunitsseparator installunitsspace installversioninfo \ -int intclockwise integerrounding integers interactionbar \ -interactionbuttons interactionmenu intercal intertext interwordspaceafter \ -interwordspacebefore interwordspaces interwordspacesafter interwordspacesbefore intop \ -invisiblecomma invisibleplus invisibletimes invokepagehandler iogonek \ -iota italic italicbold italiccorrection italicface \ -item items itemtag itilde jcaron \ -jcircumflex ji jmath jobfilename jobfilesuffix \ -kap kappa kcaron kcommaaccent keepblocks \ -keeplinestogether keepunwantedspaces kerncharacters khook kkra \ -koreancirclenumerals koreannumerals koreannumeralsc koreannumeralsp koreanparentnumerals \ -lVert labellanguage labeltext labeltexts lacute \ -lambda lambdabar land langle language \ -languageCharacters languagecharacters languagecharwidth laplace lastcounter \ -lastcountervalue lastdigit lastlinewidth lastnaturalboxdp lastnaturalboxht \ -lastnaturalboxwd lastparwrapper lastpredefinedsymbol lastrealpage lastrealpagenumber \ -lastsubcountervalue lastsubpage lastsubpagenumber lasttwodigits lastuserpage \ -lastuserpagenumber lateluacode latin layeredtext layerheight \ -layerwidth lazysavetaggedtwopassdata lazysavetwopassdata lbar lbox \ -lbrace lbracket lcaron lceil lchexnumber \ -lchexnumbers lcommaaccent lcurl ldot ldotmiddle \ -ldotp ldots le leadsto left \ -leftaligned leftarrow leftarrowtail leftarrowtriangle leftbottombox \ -leftbox leftdasharrow leftguillemot leftharpoondown leftharpoonup \ -lefthbox leftheadtext leftlabeltext leftleftarrows leftline \ -leftmathlabeltext leftorrighthbox leftorrightvbox leftorrightvtop leftrightarrow \ -leftrightarrows leftrightarrowtriangle leftrightharpoons leftrightsquigarrow leftskipadaption \ -leftsquigarrow leftsubguillemot leftthreetimes lefttopbox lefttoright \ -lefttorighthbox lefttorightvbox lefttorightvtop leftwavearrow leftwhitearrow \ -leq leqq leqslant lessapprox lessdot \ -lesseqgtr lesseqqgtr lessgtr lesssim letbeundefined \ -letcatcodecommand letcscsname letcsnamecs letcsnamecsname letdummyparameter \ -letempty letgvalue letgvalueempty letgvalurelax letterampersand \ -letterat letterbackslash letterbar letterbgroup letterclosebrace \ -lettercolon letterdollar letterdoublequote letteregroup letterescape \ -letterexclamationmark letterhash letterhat letterleftbrace letterleftbracket \ -letterleftparenthesis letterless lettermore letteropenbrace letterpercent \ -letterquestionmark letterrightbrace letterrightbracket letterrightparenthesis lettersinglequote \ -letterslash letterspacing lettertilde letterunderscore letvalue \ -letvalueempty letvaluerelax lfence lfloor lgroup \ -lhbox lhooknwarrow lhooksearrow limitatefirstline limitatelines \ -limitatetext line linebox linefeed linefillerhbox \ -linefillervbox linefillervtop linenote linespanningtext linethickness \ -linterval listcitation listcite listlength listnamespaces \ -literalmode ljligature ll llangle llap \ -llbracket llcorner lll llless llointerval \ -lmoustache lnapprox lneq lneqq lnot \ -lnsim loadanyfile loadanyfileonce loadbtxdefinitionfile loadbtxreplacementfile \ -loadcldfile loadcldfileonce loadfontgoodies loadluafile loadluafileonce \ -loadspellchecklist loadtexfile loadtexfileonce loadtypescriptfile localframed \ -localframedwithsettings localhsize localpopbox localpopmacro localpushbox \ -localpushmacro localundefine locatedfilepath locatefilepath locfilename \ -logo lohi lointerval lomihi longleftarrow \ -longleftrightarrow longmapsfrom longmapsto longrightarrow longrightsquigarrow \ -looparrowleft looparrowright lor low lowerbox \ -lowercased lowercasestring lowercasing lowerleftdoubleninequote lowerleftsingleninequote \ -lowerrightdoubleninequote lowerrightsingleninequote lozenge lparent lrcorner \ -lrointerval lrtbbox lstroke lt ltimes \ -ltop ltrhbox ltrvbox ltrvtop luaTeX \ -luacode luaconditional luaenvironment luaexpanded luaexpr \ -luafunction luajitTeX luamajorversion luametaTeX luaminorversion \ -luaparameterset luasetup luaversion lvert m \ -mLeftarrow mLeftrightarrow mRightarrow mVert mainlanguage \ -makecharacteractive makerawcommalist makestrutofbox maltese mapfontsize \ +depthspanningtext depthstrut derivativesymbol determineheadnumber determinelistcharacteristics \ +determinenoflines determineregistercharacteristics devanagarinumerals dfrac dhook \ +diameter diamond diamondsuit differentialD differentiald \ +digamma digits dimensiontocount directboxfromcache directcolor \ +directcolored directconvertedcounter directcopyboxfromcache directdummyparameter directgetboxllx \ +directgetboxlly directhighlight directlocalframed directluacode directparwrapper \ +directselect directsetbar directsetup directsymbol directvspacing \ +dis disabledirectives disableexperiments disablemode disableoutputstream \ +disableparpositions disableregime disabletrackers displaymath displaymathematics \ +displaymessage disposeluatable distributedhsize div dividedsize \ +divideontimes divides doadaptleftskip doadaptrightskip doaddfeature \ +doassign doassignempty doboundtext docheckassignment docheckedpair \ +documentvariable dodoubleargument dodoubleargumentwithset dodoubleempty dodoubleemptywithset \ +dodoublegroupempty doeassign doexpandedrecurse dofastloopcs dogetattribute \ +dogetattributeid dogetcommacommandelement dogobbledoubleempty dogobblesingleempty dohyphens \ +doif doifMPgraphicelse doifallcommon doifallcommonelse doifalldefinedelse \ +doifallmodes doifallmodeselse doifassignmentelse doifassignmentelsecs doifblackelse \ +doifbothsides doifbothsidesoverruled doifboxelse doifbufferelse doifcheckedpagestate \ +doifcolor doifcolorelse doifcommandhandler doifcommandhandlerelse doifcommon \ +doifcommonelse doifcontent doifconversiondefinedelse doifconversionnumberelse doifcounter \ +doifcounterelse doifcurrentfonthasfeatureelse doifdefined doifdefinedcounter doifdefinedcounterelse \ +doifdefinedelse doifdimensionelse doifdimenstringelse doifdocumentargument doifdocumentargumentelse \ +doifdocumentfilename doifdocumentfilenameelse doifdocumentvariable doifdocumentvariableelse doifdrawingblackelse \ +doifelse doifelseMPgraphic doifelseallcommon doifelsealldefined doifelseallmodes \ +doifelseassignment doifelseassignmentcs doifelseblack doifelsebox doifelseboxincache \ +doifelsebuffer doifelsecolor doifelsecommandhandler doifelsecommon doifelseconversiondefined \ +doifelseconversionnumber doifelsecounter doifelsecurrentfonthasfeature doifelsecurrentsortingused doifelsecurrentsynonymshown \ +doifelsecurrentsynonymused doifelsedefined doifelsedefinedcounter doifelsedimension doifelsedimenstring \ +doifelsedocumentargument doifelsedocumentfilename doifelsedocumentvariable doifelsedrawingblack doifelseempty \ +doifelseemptyvalue doifelseemptyvariable doifelseenv doifelsefastoptionalcheck doifelsefastoptionalcheckcs \ +doifelsefieldbody doifelsefieldcategory doifelsefigure doifelsefile doifelsefiledefined \ +doifelsefileexists doifelsefirstchar doifelseflagged doifelsefontchar doifelsefontfeature \ +doifelsefontpresent doifelsefontsynonym doifelseframed doifelsehasspace doifelsehelp \ +doifelseincsname doifelseindented doifelseinelement doifelseinputfile doifelseinsertion \ +doifelseinset doifelseinstring doifelseinsymbolset doifelseintoks doifelseintwopassdata \ +doifelseitalic doifelselanguage doifelselayerdata doifelselayoutdefined doifelselayoutsomeline \ +doifelselayouttextline doifelseleapyear doifelselist doifelselocation doifelselocfile \ +doifelsemainfloatbody doifelsemarkedcontent doifelsemarkedpage doifelsemarking doifelsemeaning \ +doifelsemessage doifelsemode doifelsenextbgroup doifelsenextbgroupcs doifelsenextchar \ +doifelsenextoptional doifelsenextoptionalcs doifelsenextparenthesis doifelsenonzeropositive doifelsenoteonsamepage \ +doifelsenothing doifelsenumber doifelseobjectfound doifelseobjectreferencefound doifelseoddpage \ +doifelseoddpagefloat doifelseoldercontext doifelseolderversion doifelseorientation doifelseoverlapping \ +doifelseoverlay doifelseparallel doifelseparentfile doifelseparwrapper doifelsepath \ +doifelsepathexists doifelsepatterns doifelseposition doifelsepositionaction doifelsepositiononpage \ +doifelsepositionsonsamepage doifelsepositionsonthispage doifelsepositionsused doifelsereferencefound doifelserightpage \ +doifelserightpagefloat doifelserighttoleftinbox doifelsesamelinereference doifelsesamestring doifelsesetups \ +doifelsesomebackground doifelsesomespace doifelsesomething doifelsesometoks doifelsestringinstring \ +doifelsestructurelisthasnumber doifelsestructurelisthaspage doifelsesymboldefined doifelsesymbolset doifelsetext \ +doifelsetextflow doifelsetextflowcollector doifelsetopofpage doifelsetypingfile doifelseundefined \ +doifelseurldefined doifelsevalue doifelsevaluenothing doifelsevariable doifempty \ +doifemptyelse doifemptytoks doifemptyvalue doifemptyvalueelse doifemptyvariable \ +doifemptyvariableelse doifenv doifenvelse doiffastoptionalcheckcselse doiffastoptionalcheckelse \ +doiffieldbodyelse doiffieldcategoryelse doiffigureelse doiffile doiffiledefinedelse \ +doiffileelse doiffileexistselse doiffirstcharelse doifflaggedelse doiffontcharelse \ +doiffontfeatureelse doiffontpresentelse doiffontsynonymelse doifhasspaceelse doifhelpelse \ +doifincsnameelse doifinelementelse doifinputfileelse doifinsertionelse doifinset \ +doifinsetelse doifinstring doifinstringelse doifinsymbolset doifinsymbolsetelse \ +doifintokselse doifintwopassdataelse doifitalicelse doiflanguageelse doiflayerdataelse \ +doiflayoutdefinedelse doiflayoutsomelineelse doiflayouttextlineelse doifleapyearelse doiflistelse \ +doiflocationelse doiflocfileelse doifmainfloatbodyelse doifmarkingelse doifmeaningelse \ +doifmessageelse doifmode doifmodeelse doifnextbgroupcselse doifnextbgroupelse \ +doifnextcharelse doifnextoptionalcselse doifnextoptionalelse doifnextparenthesiselse doifnonzeropositiveelse \ +doifnot doifnotallcommon doifnotallmodes doifnotcommandhandler doifnotcommon \ +doifnotcounter doifnotdocumentargument doifnotdocumentfilename doifnotdocumentvariable doifnotempty \ +doifnotemptyvalue doifnotemptyvariable doifnotenv doifnoteonsamepageelse doifnotescollected \ +doifnotfile doifnotflagged doifnothing doifnothingelse doifnotinset \ +doifnotinsidesplitfloat doifnotinstring doifnotmode doifnotnumber doifnotsamestring \ +doifnotsetups doifnotvalue doifnotvariable doifnumber doifnumberelse \ +doifobjectfoundelse doifobjectreferencefoundelse doifoddpageelse doifoddpagefloatelse doifoldercontextelse \ +doifolderversionelse doifoutervmode doifoverlappingelse doifoverlayelse doifparallelelse \ +doifparentfileelse doifpathelse doifpathexistselse doifpatternselse doifposition \ +doifpositionaction doifpositionactionelse doifpositionelse doifpositiononpageelse doifpositionsonsamepageelse \ +doifpositionsonthispageelse doifpositionsusedelse doifreferencefoundelse doifrightpageelse doifrightpagefloatelse \ +doifrighttoleftinboxelse doifsamelinereferenceelse doifsamestring doifsamestringelse doifsetups \ +doifsetupselse doifsomebackground doifsomebackgroundelse doifsomespaceelse doifsomething \ +doifsomethingelse doifsometoks doifsometokselse doifstringinstringelse doifstructurelisthasnumberelse \ +doifstructurelisthaspageelse doifsymboldefinedelse doifsymbolsetelse doiftext doiftextelse \ +doiftextflowcollectorelse doiftextflowelse doiftopofpageelse doiftypingfileelse doifundefined \ +doifundefinedcounter doifundefinedelse doifunknownfontfeature doifurldefinedelse doifvalue \ +doifvalueelse doifvaluenothing doifvaluenothingelse doifvaluesomething doifvariable \ +doifvariableelse doindentation dollar doloop doloopoverlist \ +donothing dontconvertfont dontleavehmode dontpermitspacesbetweengroups dopositionaction \ +doprocesslocalsetups doquadrupleargument doquadrupleempty doquadruplegroupempty doquintupleargument \ +doquintupleempty doquintuplegroupempty dorechecknextindentation dorecurse dorepeatwithcommand \ +doreplacefeature doresetandafffeature doresetattribute dorotatebox dosetattribute \ +dosetleftskipadaption dosetrightskipadaption dosetupcheckedinterlinespace doseventupleargument doseventupleempty \ +dosingleargument dosingleempty dosinglegroupempty dosixtupleargument dosixtupleempty \ +dosomebreak dostepwiserecurse dosubtractfeature dot doteq \ +doteqdot dotfill dotfskip dotlessI dotlessJ \ +dotlessi dotlessj dotlessjstroke dotminus dotoks \ +dotplus dotripleargument dotripleargumentwithset dotripleempty dotripleemptywithset \ +dotriplegroupempty dots dottedcircle dottedrightarrow doublebar \ +doublebond doublebrace doublebracket doublecap doublecup \ +doubleparent doubleprime doubleverticalbar dowith dowithnextbox \ +dowithnextboxcontent dowithnextboxcontentcs dowithnextboxcs dowithpargument dowithrange \ +dowithwargument downarrow downdasharrow downdownarrows downharpoonleft \ +downharpoonright downuparrows downwhitearrow downzigzagarrow dpofstring \ +dstroke dtail dummydigit dummyparameter dzcaronligature \ +dzligature eTeX eacute ebreve ecaron \ +ecedilla ecircumflex ecircumflexacute ecircumflexdotbelow ecircumflexgrave \ +ecircumflexhook ecircumflextilde edefconvertedargument ediaeresis edotaccent \ +edotbelow edoublegrave ee efcmaxheight efcmaxwidth \ +efcminheight efcminwidth efcparameter effect egrave \ +ehook einvertedbreve elapsedseconds elapsedsteptime elapsedtime \ +eleftarrowfill eleftharpoondownfill eleftharpoonupfill eleftrightarrowfill ell \ +em emacron emdash emphasisboldface emphasistypeface \ +emptylines emptyset emquad emspace enableasciimode \ +enabledirectives enableexperiments enablemode enableoutputstream enableparpositions \ +enableregime enabletrackers endash endnote enquad \ +enskip enspace env environment envvar \ +eogonek eoverbarfill eoverbracefill eoverbracketfill eoverparentfill \ +epos epsilon eq eqcirc eqeq \ +eqeqeq eqgtr eqless eqsim eqslantgtr \ +eqslantless equaldigits equalscolon equiv erightarrowfill \ +erightharpoondownfill erightharpoonupfill eta eth ethiopic \ +etilde etwoheadrightarrowfill eunderbarfill eunderbracefill eunderbracketfill \ +eunderparentfill exclamdown executeifdefined exists exitloop \ +exitloopnow expandcheckedcsname expanded expandeddoif expandeddoifelse \ +expandeddoifnot expandfontsynonym expdoif expdoifcommonelse expdoifelse \ +expdoifelsecommon expdoifelseinset expdoifinsetelse expdoifnot exponentiale \ +externalfigure externalfigurecollectionmaxheight externalfigurecollectionmaxwidth externalfigurecollectionminheight externalfigurecollectionminwidth \ +externalfigurecollectionparameter fakebox fallingdotseq fastdecrement fastincrement \ +fastlocalframed fastloopfinal fastloopindex fastscale fastsetup \ +fastsetupwithargument fastsetupwithargumentswapped fastswitchtobodyfont fastsxsy feature \ +fence fenced fetchallmarkings fetchallmarks fetchmark \ +fetchmarking fetchonemark fetchonemarking fetchruntinecommand fetchtwomarkings \ +fetchtwomarks ffiligature ffligature fflligature fhook \ +field fieldbody fieldstack fifthoffivearguments fifthofsixarguments \ +figuredash figurefilename figurefilepath figurefiletype figurefullname \ +figureheight figurenaturalheight figurenaturalwidth figurespace figuresymbol \ +figurewidth filename filigature filledhboxb filledhboxc \ +filledhboxg filledhboxk filledhboxm filledhboxr filledhboxy \ +filler fillinline fillinrules fillintext fillupto \ +filterfromnext filterfromvalue filterpages filterreference findtwopassdata \ +finishregisterentry firstcharacter firstcounter firstcountervalue firstinlist \ +firstoffivearguments firstoffourarguments firstofoneargument firstofoneunexpanded firstofsixarguments \ +firstofthreearguments firstofthreeunexpanded firstoftwoarguments firstoftwounexpanded firstrealpage \ +firstrealpagenumber firstsubcountervalue firstsubpage firstsubpagenumber firstuserpage \ +firstuserpagenumber fitfield fitfieldframed fittopbaselinegrid fiveeighths \ +fivesixths fixedspace fixedspaces flag flat \ +flligature floatuserdataparameter flushbox flushboxregister flushcollector \ +flushedrightlastline flushlayer flushlocalfloats flushnextbox flushnotes \ +flushoutputstream flushshapebox flushtextflow flushtokens flushtoks \ +fontalternative fontbody fontchar fontcharbyindex fontclass \ +fontclassname fontface fontfeaturelist fontsize fontstyle \ +footnote footnotetext forall forcecharacterstripping forcelocalfloats \ +forgeteverypar forgetparagraphfreezing forgetparameters forgetparskip forgetparwrapper \ +forgetragged formula formulanumber foundbox fourfifths \ +fourperemspace fourthderivativesymbol fourthoffivearguments fourthoffourarguments fourthofsixarguments \ +frac framed frameddimension framedparameter framedtext \ +freezedimenmacro freezemeasure freezeparagraphproperties frenchspacing from \ +fromlinenote frown frozenhbox frule gacute \ +gamma gbreve gcaron gcircumflex gcommaaccent \ +gdefconvertedargument gdefconvertedcommand gdotaccent ge geq \ +geqq geqslant getMPdrawing getMPlayer getboxfromcache \ +getboxllx getboxlly getbuffer getbufferdata getcommacommandsize \ +getcommalistsize getdatavalue getdayoftheweek getdayspermonth getdefinedbuffer \ +getdocumentargument getdocumentargumentdefault getdocumentfilename getdummyparameters getemptyparameters \ +geteparameters getexpandedparameters getfiguredimensions getfirstcharacter getfirsttwopassdata \ +getfromcommacommand getfromcommalist getfromluatable getfromtwopassdata getglyphdirect \ +getglyphstyled getgparameters getinlineuserdata getlasttwopassdata getlocalfloat \ +getlocalfloats getmarking getmessage getnamedglyphdirect getnamedglyphstyled \ +getnamedtwopassdatalist getnaturaldimensions getnoflines getobject getobjectdimensions \ +getpaletsize getparameters getparwrapper getprivatechar getprivateslot \ +getrandomcount getrandomdimen getrandomfloat getrandomnumber getrandomseed \ +getraweparameters getrawgparameters getrawnoflines getrawparameters getrawxparameters \ +getreference getreferenceentry getroundednoflines gets getsubstring \ +gettokenlist gettwopassdata gettwopassdatalist getuserdata getuvalue \ +getvalue getvariable getvariabledefault getxparameters gg \ +ggg gggtr gimel globaldisablemode globalenablemode \ +globalletempty globalpopbox globalpopmacro globalpreventmode globalprocesscommalist \ +globalpushbox globalpushmacro globalswapcounts globalswapdimens globalswapmacros \ +globalundefine glyphfontfile gnapprox gneqq gnsim \ +gobbledoubleempty gobbleeightarguments gobblefivearguments gobblefiveoptionals gobblefourarguments \ +gobblefouroptionals gobbleninearguments gobbleoneargument gobbleoneoptional gobblesevenarguments \ +gobblesingleempty gobblesixarguments gobblespacetokens gobbletenarguments gobblethreearguments \ +gobblethreeoptionals gobbletwoarguments gobbletwooptionals gobbleuntil gobbleuntilrelax \ +godown goto gotobox gotopage grabbufferdata \ +grabbufferdatadirect grabuntil gradient grave graycolor \ +grayvalue greedysplitstring greekAlpha greekAlphadasia greekAlphadasiaperispomeni \ +greekAlphadasiatonos greekAlphadasiavaria greekAlphaiotasub greekAlphaiotasubdasia greekAlphaiotasubdasiaperispomeni \ +greekAlphaiotasubdasiatonos greekAlphaiotasubdasiavaria greekAlphaiotasubpsili greekAlphaiotasubpsiliperispomeni greekAlphaiotasubpsilitonos \ +greekAlphaiotasubpsilivaria greekAlphamacron greekAlphapsili greekAlphapsiliperispomeni greekAlphapsilitonos \ +greekAlphapsilivaria greekAlphatonos greekAlphavaria greekAlphavrachy greekBeta \ +greekChi greekCoronis greekDelta greekEpsilon greekEpsilondasia \ +greekEpsilondasiatonos greekEpsilondasiavaria greekEpsilonpsili greekEpsilonpsilitonos greekEpsilonpsilivaria \ +greekEpsilontonos greekEpsilonvaria greekEta greekEtadasia greekEtadasiaperispomeni \ +greekEtadasiatonos greekEtadasiavaria greekEtaiotasub greekEtaiotasubdasia greekEtaiotasubdasiaperispomeni \ +greekEtaiotasubdasiatonos greekEtaiotasubdasiavaria greekEtaiotasubpsili greekEtaiotasubpsiliperispomeni greekEtaiotasubpsilitonos \ +greekEtaiotasubpsilivaria greekEtapsili greekEtapsiliperispomeni greekEtapsilitonos greekEtapsilivaria \ +greekEtatonos greekEtavaria greekGamma greekIota greekIotadasia \ +greekIotadasiaperispomeni greekIotadasiatonos greekIotadasiavaria greekIotadialytika greekIotamacron \ +greekIotapsili greekIotapsiliperispomeni greekIotapsilitonos greekIotapsilivaria greekIotatonos \ +greekIotavaria greekIotavrachy greekKappa greekLambda greekMu \ +greekNu greekOmega greekOmegadasia greekOmegadasiaperispomeni greekOmegadasiatonos \ +greekOmegadasiavaria greekOmegaiotasub greekOmegaiotasubdasia greekOmegaiotasubdasiaperispomeni greekOmegaiotasubdasiatonos \ +greekOmegaiotasubdasiavaria greekOmegaiotasubpsili greekOmegaiotasubpsiliperispomeni greekOmegaiotasubpsilitonos greekOmegaiotasubpsilivaria \ +greekOmegapsili greekOmegapsiliperispomeni greekOmegapsilitonos greekOmegapsilivaria greekOmegatonos \ +greekOmegavaria greekOmicron greekOmicrondasia greekOmicrondasiatonos greekOmicrondasiavaria \ +greekOmicronpsili greekOmicronpsilitonos greekOmicronpsilivaria greekOmicrontonos greekOmicronvaria \ +greekPhi greekPi greekPsi greekRho greekRhodasia \ +greekSigma greekSigmalunate greekTau greekTheta greekUpsilon \ +greekUpsilondasia greekUpsilondasiaperispomeni greekUpsilondasiatonos greekUpsilondasiavaria greekUpsilondialytika \ +greekUpsilonmacron greekUpsilontonos greekUpsilonvaria greekUpsilonvrachy greekXi \ +greekZeta greekalpha greekalphadasia greekalphadasiaperispomeni greekalphadasiatonos \ +greekalphadasiavaria greekalphaiotasub greekalphaiotasubdasia greekalphaiotasubdasiaperispomeni greekalphaiotasubdasiatonos \ +greekalphaiotasubdasiavaria greekalphaiotasubperispomeni greekalphaiotasubpsili greekalphaiotasubpsiliperispomeni greekalphaiotasubpsilitonos \ +greekalphaiotasubpsilivaria greekalphaiotasubtonos greekalphaiotasubvaria greekalphamacron greekalphaoxia \ +greekalphaperispomeni greekalphapsili greekalphapsiliperispomeni greekalphapsilitonos greekalphapsilivaria \ +greekalphatonos greekalphavaria greekalphavrachy greekbeta greekbetaalt \ +greekchi greekdasia greekdasiaperispomeni greekdasiavaria greekdelta \ +greekdialytikaperispomeni greekdialytikatonos greekdialytikavaria greekdigamma greekepsilon \ +greekepsilonalt greekepsilondasia greekepsilondasiatonos greekepsilondasiavaria greekepsilonoxia \ +greekepsilonpsili greekepsilonpsilitonos greekepsilonpsilivaria greekepsilontonos greekepsilonvaria \ +greeketa greeketadasia greeketadasiaperispomeni greeketadasiatonos greeketadasiavaria \ +greeketaiotasub greeketaiotasubdasia greeketaiotasubdasiaperispomeni greeketaiotasubdasiatonos greeketaiotasubdasiavaria \ +greeketaiotasubperispomeni greeketaiotasubpsili greeketaiotasubpsiliperispomeni greeketaiotasubpsilitonos greeketaiotasubpsilivaria \ +greeketaiotasubtonos greeketaiotasubvaria greeketaoxia greeketaperispomeni greeketapsili \ +greeketapsiliperispomeni greeketapsilitonos greeketapsilivaria greeketatonos greeketavaria \ +greekfinalsigma greekgamma greekiota greekiotadasia greekiotadasiaperispomeni \ +greekiotadasiatonos greekiotadasiavaria greekiotadialytika greekiotadialytikaperispomeni greekiotadialytikatonos \ +greekiotadialytikavaria greekiotamacron greekiotaoxia greekiotaperispomeni greekiotapsili \ +greekiotapsiliperispomeni greekiotapsilitonos greekiotapsilivaria greekiotatonos greekiotavaria \ +greekiotavrachy greekkappa greekkoppa greeklambda greekmu \ +greeknu greeknumerals greeknumkoppa greekomega greekomegadasia \ +greekomegadasiaperispomeni greekomegadasiatonos greekomegadasiavaria greekomegaiotasub greekomegaiotasubdasia \ +greekomegaiotasubdasiaperispomeni greekomegaiotasubdasiatonos greekomegaiotasubdasiavaria greekomegaiotasubperispomeni greekomegaiotasubpsili \ +greekomegaiotasubpsiliperispomeni greekomegaiotasubpsilitonos greekomegaiotasubpsilivaria greekomegaiotasubtonos greekomegaiotasubvaria \ +greekomegaoxia greekomegaperispomeni greekomegapsili greekomegapsiliperispomeni greekomegapsilitonos \ +greekomegapsilivaria greekomegatonos greekomegavaria greekomicron greekomicrondasia \ +greekomicrondasiatonos greekomicrondasiavaria greekomicronoxia greekomicronpsili greekomicronpsilitonos \ +greekomicronpsilivaria greekomicrontonos greekomicronvaria greekoxia greekperispomeni \ +greekphi greekphialt greekpi greekpialt greekprosgegrammeni \ +greekpsi greekpsili greekpsiliperispomeni greekpsilivaria greekrho \ +greekrhoalt greekrhodasia greekrhopsili greeksampi greeksigma \ +greeksigmalunate greekstigma greektau greektheta greekthetaalt \ +greektonos greekupsilon greekupsilondasia greekupsilondasiaperispomeni greekupsilondasiatonos \ +greekupsilondasiavaria greekupsilondiaeresis greekupsilondialytikaperispomeni greekupsilondialytikatonos greekupsilondialytikavaria \ +greekupsilonmacron greekupsilonoxia greekupsilonperispomeni greekupsilonpsili greekupsilonpsiliperispomeni \ +greekupsilonpsilitonos greekupsilonpsilivaria greekupsilontonos greekupsilonvaria greekupsilonvrachy \ +greekvaria greekxi greekzeta grid groupedcommand \ +gsetboxllx gsetboxlly gstroke gt gtrapprox \ +gtrdot gtreqless gtreqqless gtrless gtrsim \ +guilsingleleft guilsingleright gujaratinumerals gurmurkhinumerals hairline \ +hairspace halflinestrut halfstrut halfwaybox handletokens \ +handwritten hangul hanzi hash hat \ +hbar hboxofvbox hboxreference hcaron hcircumflex \ +hdofstring headhbox headlanguage headnumber headnumbercontent \ +headnumberdistance headnumberwidth headreferenceattributes headsetupspacing headtext \ +headtextcontent headtextdistance headtexts headtextwidth headvbox \ +headwidth heartsuit hebrewAlef hebrewAyin hebrewBet \ +hebrewDalet hebrewGimel hebrewHe hebrewHet hebrewKaf \ +hebrewKaffinal hebrewLamed hebrewMem hebrewMemfinal hebrewNun \ +hebrewNunfinal hebrewPe hebrewPefinal hebrewQof hebrewResh \ +hebrewSamekh hebrewShin hebrewTav hebrewTet hebrewTsadi \ +hebrewTsadifinal hebrewVav hebrewYod hebrewZayin hebrewnumerals \ +heightanddepthofstring heightofstring heightspanningtext helptext hexnumber \ +hexstringtonumber hglue hiddenbar hiddencitation hiddencite \ +hideblocks high highlight highordinalstr hilo \ +himilo hl hookleftarrow hookrightarrow horizontalgrowingbar \ +horizontalpositionbar hpackbox hpackedbox hphantom hpos \ +hsizefraction hslash hsmash hsmashbox hsmashed \ +hspace hstroke htdpofstring htofstring hyphen \ +hyphenatedcoloredword hyphenatedfile hyphenatedfilename hyphenatedhbox hyphenatedpar \ +hyphenatedurl hyphenatedword iacute ibox ibreve \ +icaron icircumflex ideographichalffillspace ideographicspace idiaeresis \ +idotaccent idotbelow idoublegrave idxfromluatable ifassignment \ +iff ifinobject ifinoutputstream ifparameters iftrialtypesetting \ +ignoreimplicitspaces ignoretagsinexport ignorevalue igrave ihook \ +ii iiiint iiiintop iiint iiintop \ +iint iintop iinvertedbreve ijligature imacron \ +imaginaryi imaginaryj imath immediatesavetwopassdata impliedby \ +implies imply in includemenu includesvgbuffer \ +includesvgfile includeversioninfo increment incrementcounter incrementedcounter \ +incrementpagenumber incrementsubpagenumber incrementvalue indentation index \ +infofont infofontbold inframed infty infull \ +inheritparameter inhibitblank ininner ininneredge ininnermargin \ +initializeboxstack inleft inleftedge inleftmargin inline \ +inlinebuffer inlinedbox inlinemath inlinemathematics inlinemessage \ +inlineordisplaymath inlineprettyprintbuffer inlinerange inmargin inmframed \ +innerflushshapebox inother inouter inouteredge inoutermargin \ +input inputfilebarename inputfilename inputfilerealsuffix inputfilesuffix \ +inputgivenfile inright inrightedge inrightmargin insertpages \ +inspectluatable installactionhandler installactivecharacter installanddefineactivecharacter installattributestack \ +installautocommandhandler installautosetuphandler installbasicautosetuphandler installbasicparameterhandler installbottomframerenderer \ +installcommandhandler installcorenamespace installctxfunction installctxscanner installdefinehandler \ +installdefinitionset installdefinitionsetmember installdirectcommandhandler installdirectparameterhandler installdirectparametersethandler \ +installdirectsetuphandler installdirectstyleandcolorhandler installframedautocommandhandler installframedcommandhandler installglobalmacrostack \ +installlanguage installleftframerenderer installmacrostack installnamespace installoutputroutine \ +installpagearrangement installparameterhandler installparameterhashhandler installparametersethandler installparentinjector \ +installprotectedctxfunction installprotectedctxscanner installrightframerenderer installrootparameterhandler installsetuphandler \ +installsetuponlycommandhandler installshipoutmethod installsimplecommandhandler installsimpleframedcommandhandler installstyleandcolorhandler \ +installswitchcommandhandler installswitchsetuphandler installtexdirective installtextracker installtopframerenderer \ +installunitsseparator installunitsspace installversioninfo int intclockwise \ +integerrounding integers interactionbar interactionbuttons interactionmenu \ +intercal intertext interwordspaceafter interwordspacebefore interwordspaces \ +interwordspacesafter interwordspacesbefore intop invisiblecomma invisibleplus \ +invisibletimes invokepagehandler iogonek iota italic \ +italicbold italiccorrection italicface item items \ +itemtag itilde jcaron jcircumflex ji \ +jmath jobfilename jobfilesuffix kap kappa \ +kcaron kcommaaccent keepblocks keeplinestogether keepunwantedspaces \ +kerncharacters khook kkra koreancirclenumerals koreannumerals \ +koreannumeralsc koreannumeralsp koreanparentnumerals lVert labellanguage \ +labeltext labeltexts lacute lambda lambdabar \ +land langle language languageCharacters languagecharacters \ +languagecharwidth laplace lastcounter lastcountervalue lastdigit \ +lastlinewidth lastnaturalboxdp lastnaturalboxht lastnaturalboxwd lastparwrapper \ +lastpredefinedsymbol lastrealpage lastrealpagenumber lastsubcountervalue lastsubpage \ +lastsubpagenumber lasttwodigits lastuserpage lastuserpagenumber lateluacode \ +latin layeredtext layerheight layerwidth lazysavetaggedtwopassdata \ +lazysavetwopassdata lbar lbox lbrace lbracket \ +lcaron lceil lchexnumber lchexnumbers lcommaaccent \ +lcurl ldot ldotmiddle ldotp ldots \ +le leadsto left leftaligned leftarrow \ +leftarrowtail leftarrowtriangle leftbottombox leftbox leftdasharrow \ +leftguillemot leftharpoondown leftharpoonup lefthbox leftheadtext \ +leftlabeltext leftleftarrows leftline leftmathlabeltext leftorrighthbox \ +leftorrightvbox leftorrightvtop leftrightarrow leftrightarrows leftrightarrowtriangle \ +leftrightharpoons leftrightsquigarrow leftskipadaption leftsquigarrow leftsubguillemot \ +leftthreetimes lefttopbox lefttoright lefttorighthbox lefttorightvbox \ +lefttorightvtop leftwavearrow leftwhitearrow leq leqq \ +leqslant lessapprox lessdot lesseqgtr lesseqqgtr \ +lessgtr lesssim letbeundefined letcatcodecommand letcscsname \ +letcsnamecs letcsnamecsname letdummyparameter letempty letgvalue \ +letgvalueempty letgvalurelax letterampersand letterat letterbackslash \ +letterbar letterbgroup letterclosebrace lettercolon letterdollar \ +letterdoublequote letteregroup letterescape letterexclamationmark letterhash \ +letterhat letterleftbrace letterleftbracket letterleftparenthesis letterless \ +lettermore letteropenbrace letterpercent letterquestionmark letterrightbrace \ +letterrightbracket letterrightparenthesis lettersinglequote letterslash letterspacing \ +lettertilde letterunderscore letvalue letvalueempty letvaluerelax \ +lfence lfloor lgroup lhbox lhooknwarrow \ +lhooksearrow limitatefirstline limitatelines limitatetext line \ +linebox linefeed linefillerhbox linefillervbox linefillervtop \ +linenote linespanningtext linethickness linterval listcitation \ +listcite listlength listnamespaces literalmode ljligature \ +ll llangle llap llbracket llcorner \ +lll llless llointerval lmoustache lnapprox \ +lneq lneqq lnot lnsim loadanyfile \ +loadanyfileonce loadbtxdefinitionfile loadbtxreplacementfile loadcldfile loadcldfileonce \ +loadfontgoodies loadluafile loadluafileonce loadspellchecklist loadtexfile \ +loadtexfileonce loadtypescriptfile localframed localframedwithsettings localhsize \ +localpopbox localpopmacro localpushbox localpushmacro localundefine \ +locatedfilepath locatefilepath locfilename logo lohi \ +lointerval lomihi longleftarrow longleftrightarrow longmapsfrom \ +longmapsto longrightarrow longrightsquigarrow looparrowleft looparrowright \ +lor low lowerbox lowercased lowercasestring \ +lowercasing lowerleftdoubleninequote lowerleftsingleninequote lowerrightdoubleninequote lowerrightsingleninequote \ +lozenge lparent lrcorner lrointerval lrtbbox \ +lstroke lt ltimes ltop ltrhbox \ +ltrvbox ltrvtop luaTeX luacode luaconditional \ +luaenvironment luaexpanded luaexpr luafunction luajitTeX \ +luamajorversion luametaTeX luaminorversion luaparameterset luasetup \ +luaversion lvert m mLeftarrow mLeftrightarrow \ +mRightarrow mVert mainlanguage makecharacteractive makerawcommalist \ +makestrutofbox maltese mapfontsize maps mapsas \ mapsdown mapsfrom mapsto mapsup margindata \ margintext markcontent markedpages marking markinjector \ -markpage markreferencepage mat math mathampersand \ -mathbf mathbi mathblackboard mathbs mathdefault \ -mathdollar mathdouble mathematics mathfraktur mathfunction \ -mathhash mathhyphen mathit mathitalic mathlabellanguage \ -mathlabeltext mathlabeltexts mathop mathover mathpercent \ -mathrm mathscript mathsl mathss mathtext \ -mathtextbf mathtextbi mathtextbs mathtextit mathtextsl \ -mathtexttf mathtf mathtriplet mathtt mathunder \ -mathupright mathword mathwordbf mathwordbi mathwordbs \ -mathwordit mathwordsl mathwordtf maxaligned mbox \ -mcframed measure measured measuredangle measuredeq \ -medskip medspace menubutton mequal message \ -mfence mframed mfunction mfunctionlabeltext mhbox \ -mho mhookleftarrow mhookrightarrow mid midaligned \ -middle middlealigned middlebox midhbox midsubsentence \ -minimalhbox minus minuscolon mirror mixedcaps \ -mkvibuffer mleftarrow mleftharpoondown mleftharpoonup mleftrightarrow \ -mleftrightharpoons mmapsto models moduleparameter molecule \ -mono monobold mononormal month monthlong \ -monthshort mp mprandomnumber mrel mrightarrow \ -mrightharpoondown mrightharpoonup mrightleftharpoons mrightoverleftarrow mtext \ -mtriplerel mtwoheadleftarrow mtwoheadrightarrow mu multimap \ -mvert nHdownarrow nHuparrow nLeftarrow nLeftrightarrow \ -nRightarrow nVDash nVdash nVleftarrow nVleftrightarrow \ -nVrightarrow nabla nacute namedheadnumber namedstructureheadlocation \ -namedstructureuservariable namedstructurevariable namedtaggedlabeltexts napostrophe napprox \ -napproxEq narrownobreakspace nasymp natural naturalhbox \ -naturalhpack naturalnumbers naturaltpack naturalvbox naturalvcenter \ -naturalvpack naturalvtop naturalwd ncaron ncommaaccent \ -ncong ncurl ndivides ne nearrow \ -neg negatecolorbox negated negativesign negemspace \ -negenspace negthinspace neng neq nequiv \ -neswarrow newattribute newcatcodetable newcounter newevery \ -newfrenchspacing newluatable newmode newsignal newsystemmode \ -nexists nextbox nextboxdp nextboxht nextboxhtdp \ -nextboxwd nextcounter nextcountervalue nextdepth nextparagraphs \ -nextrealpage nextrealpagenumber nextsubcountervalue nextsubpage nextsubpagenumber \ -nextuserpage nextuserpagenumber ngeq ngrave ngtr \ -ngtrless ngtrsim ni nihongo nin \ -njligature nleftarrow nleftrightarrow nleq nless \ -nlessgtr nlesssim nmid nni nobar \ -nobreakspace nocap nocharacteralign nocitation nocite \ -nodetostring noffigurepages noflines noflinesinbox noflocalfloats \ -noheaderandfooterlines noheightstrut nohyphens noindentation noitem \ -nonfrenchspacing nonmathematics nonvalidassignment normal normalboldface \ -normalframedwithsettings normalitalicface normalizebodyfontsize normalizedfontsize normalizefontdepth \ -normalizefontheight normalizefontline normalizefontwidth normalizetextdepth normalizetextheight \ -normalizetextline normalizetextwidth normalslantedface normaltypeface nospace \ -not note notesymbol notin notopandbottomlines \ -notragged nowns nparallel nprec npreccurlyeq \ -nrightarrow nsim nsimeq nsqsubseteq nsqsupseteq \ -nsubset nsubseteq nsucc nsucccurlyeq nsupset \ -nsupseteq ntilde ntimes ntriangleleft ntrianglelefteq \ -ntriangleright ntrianglerighteq nu numberofpoints numbers \ -nvDash nvdash nvleftarrow nvleftrightarrow nvrightarrow \ -nwarrow nwsearrow oacute obeydepth objectdepth \ -objectheight objectmargin objectwidth obox obreve \ -ocaron ocircumflex ocircumflexacute ocircumflexdotbelow ocircumflexgrave \ -ocircumflexhook ocircumflextilde octnumber octstringtonumber odiaeresis \ -odiaeresismacron odot odotaccent odotaccentmacron odotbelow \ -odoublegrave oeligature offset offsetbox ograve \ -ohm ohook ohorn ohornacute ohorndotbelow \ -ohorngrave ohornhook ohorntilde ohungarumlaut oiiint \ -oiint oint ointclockwise ointctrclockwise oinvertedbreve \ -omacron omega omicron ominus onedigitrounding \ -oneeighth onefifth onehalf onequarter onesixth \ -onesuperior onethird oogonek oogonekmacron operatorlanguage \ -operatortext oplus ordfeminine ordinaldaynumber ordinalstr \ -ordmasculine ornamenttext oslash ostroke ostrokeacute \ -otilde otildemacron otimes outputfilename outputstreambox \ -outputstreamcopy outputstreamunvbox outputstreamunvcopy over overbar \ -overbars overbartext overbarunderbar overbrace overbracetext \ -overbraceunderbrace overbracket overbrackettext overbracketunderbracket overlaybutton \ -overlaycolor overlaydepth overlayfigure overlayheight overlayimage \ -overlaylinecolor overlaylinewidth overlayoffset overlayrollbutton overlaywidth \ -overleftarrow overleftharpoondown overleftharpoonup overleftrightarrow overloaderror \ -overparent overparenttext overparentunderparent overrightarrow overrightharpoondown \ -overrightharpoonup overset overstrike overstrikes overtwoheadleftarrow \ -overtwoheadrightarrow owns page pagearea pagebreak \ -pagefigure pageinjection pagenumber pagereference pagestaterealpage \ -pagestaterealpageorder paletsize paragraphmark parallel part \ -partial pdfTeX pdfactualtext pdfbackendactualtext pdfbackendcurrentresources \ -pdfbackendsetcatalog pdfbackendsetcolorspace pdfbackendsetextgstate pdfbackendsetinfo pdfbackendsetname \ -pdfbackendsetpageattribute pdfbackendsetpageresource pdfbackendsetpagesattribute pdfbackendsetpattern pdfbackendsetshade \ -pdfcolor pdfeTeX percent percentdimen periodcentered \ -periods permitcaretescape permitcircumflexescape permitspacesbetweengroups perp \ -persiandecimals persiandecimalseparator persiannumerals persianthousandsseparator perthousand \ -phantom phantombox phi phook pi \ -pickupgroupedcommand pitchfork placeattachments placebookmarks placebtxrendering \ -placechemical placecitation placecombinedlist placecomments placecontent \ -placecurrentformulanumber placedbox placefigure placefloat placefloatcaption \ -placefloatwithsetups placefootnotes placeformula placeframed placegraphic \ -placeheadnumber placeheadtext placehelp placeholder placeindex \ -placeinitial placeintermezzo placelayer placelayeredtext placelegend \ -placelist placelistofabbreviations placelistofchemicals placelistoffigures placelistofgraphics \ -placelistofintermezzi placelistoflogos placelistofpublications placelistofsorts placelistofsynonyms \ -placelistoftables placelocalfootnotes placelocalnotes placement placenamedfloat \ -placenamedformula placenotes placeongrid placeontopofeachother placepagenumber \ -placepairedbox placeparallel placerawheaddata placerawheadnumber placerawheadtext \ -placerawlist placeregister placerenderingwindow placesidebyside placesubformula \ -placetable pm popattribute popmacro popmode \ -popsystemmode position positionoverlay positionregionoverlay positivesign \ -postponenotes prec precapprox preccurlyeq preceq \ -preceqq precnapprox precneq precneqq precnsim \ -precsim predefinedfont predefinefont predefinesymbol prefixedpagenumber \ -prefixlanguage prefixtext prependetoks prependgvalue prependtocommalist \ -prependtoks prependtoksonce prependvalue prerollblank presetbtxlabeltext \ -presetdocument presetfieldsymbols presetheadtext presetlabeltext presetmathlabeltext \ -presetoperatortext presetprefixtext presetsuffixtext presettaglabeltext presetunittext \ -pretocommalist prettyprintbuffer prevcounter prevcountervalue preventmode \ -prevrealpage prevrealpagenumber prevsubcountervalue prevsubpage prevsubpagenumber \ -prevuserpage prevuserpagenumber prime primes procent \ -processMPbuffer processMPfigurefile processaction processallactionsinset processassignlist \ -processassignmentcommand processassignmentlist processbetween processblocks processbodyfontenvironmentlist \ -processcolorcomponents processcommacommand processcommalist processcommalistwithparameters processcontent \ -processfile processfilemany processfilenone processfileonce processfirstactioninset \ -processisolatedchars processisolatedwords processlinetablebuffer processlinetablefile processlist \ -processmonth processranges processseparatedlist processtexbuffer processtokens \ -processuntil processxtablebuffer processyear prod product \ -profiledbox profilegivenbox program project propto \ -pseudoMixedCapped pseudoSmallCapped pseudoSmallcapped pseudosmallcapped psi \ -punctuationspace purenumber pushattribute pushbutton pushmacro \ -pushmode pushoutputstream pushsystemmode putboxincache putnextboxincache \ -qquad quad quadrupleprime quads quarterstrut \ -questiondown questionedeq quitcommalist quitprevcommalist quittypescriptscanning \ -quotation quote quotedbl quotedblbase quotedblleft \ -quotedblright quoteleft quoteright quotesingle quotesinglebase \ -rVert racute raggedbottom raggedcenter raggedleft \ -raggedright raggedwidecenter raisebox randomizetext randomnumber \ -rangle rationals rawcounter rawcountervalue rawdate \ -rawdoifelseinset rawdoifinset rawdoifinsetelse rawgetparameters rawprocessaction \ -rawprocesscommacommand rawprocesscommalist rawstructurelistuservariable rawsubcountervalue rbox \ -rbrace rbracket rcaron rceil rcommaaccent \ -rdoublegrave readfile readfixfile readjobfile readlocfile \ -readsetfile readsysfile readtexfile readxmlfile realSmallCapped \ -realSmallcapped realpagenumber reals realsmallcapped recursedepth \ -recurselevel recursestring redoconvertfont ref reference \ -referencecolumnnumber referencepagedetail referencepagestate referenceprefix referencerealpage \ -referencesymbol referring registerattachment registerctxluafile registered \ -registerexternalfigure registerfontclass registerhyphenationexception registerhyphenationpattern registermenubuttons \ -registerparwrapper registerparwrapperreverse registersort registersynonym registerunit \ -regular relatemarking relateparameterhandlers relaxvalueifundefined relbar \ -remainingcharacters remark removebottomthings removedepth removefromcommalist \ -removelastskip removelastspace removemarkedcontent removepunctuation removesubstring \ -removetoks removeunwantedspaces repeathead replacefeature replaceincommalist \ -replaceword rescan rescanwithsetup resetMPdrawing resetMPenvironment \ -resetMPinstance resetallattributes resetandaddfeature resetbar resetboxesincache \ -resetbreakpoints resetbuffer resetcharacteralign resetcharacterkerning resetcharacterspacing \ -resetcharacterstripping resetcollector resetcounter resetctxscanner resetdigitsmanipulation \ -resetdirection resetfeature resetflag resetfontcolorsheme resetfontfallback \ -resetfontsolution resethyphenationfeatures resetinjector resetinteractionmenu resetitaliccorrection \ -resetlayer resetlocalfloats resetmarker resetmarking resetmode \ -resetpagenumber resetparallel resetpath resetpenalties resetperiodkerning \ -resetprofile resetrecurselevel resetreference resetreplacements resetscript \ -resetsetups resetshownsynonyms resetsubpagenumber resetsymbolset resetsystemmode \ -resettimer resettokenlist resettrackers resettrialtypesetting resetusedsortings \ -resetusedsynonyms resetuserpagenumber resetvalue resetvisualizers reshapebox \ -resolvedglyphdirect resolvedglyphstyled restartcounter restorebox restorecatcodes \ -restorecounter restorecurrentattributes restoreendofline restoreglobalbodyfont restriction \ -retestfeature reusableMPgraphic reuseMPgraphic reuserandomseed reverseddoubleprime \ -reversedprime reversedtripleprime reversehbox reversehpack reversetpack \ -reversevbox reversevboxcontent reversevpack reversevtop revivefeature \ -rfence rfloor rgroup rhbox rho \ -rhooknearrow rhookswarrow right rightaligned rightangle \ -rightarrow rightarrowbar rightarrowtail rightarrowtriangle rightbottombox \ -rightbox rightdasharrow rightguillemot rightharpoondown rightharpoonup \ -righthbox rightheadtext rightlabeltext rightleftarrows rightleftharpoons \ -rightline rightmathlabeltext rightorleftpageaction rightpageorder rightrightarrows \ -rightskipadaption rightsquigarrow rightsubguillemot rightthreearrows rightthreetimes \ -righttoleft righttolefthbox righttoleftvbox righttoleftvtop righttopbox \ -rightwavearrow rightwhitearrow ring rinterval rinvertedbreve \ -risingdotseq rlap rlointerval rmoustache rneq \ -robustaddtocommalist robustdoifelseinset robustdoifinsetelse robustpretocommalist rointerval \ -rollbutton roman romanC romanD romanI \ -romanII romanIII romanIV romanIX romanL \ -romanM romanV romanVI romanVII romanVIII \ -romanX romanXI romanXII romanc romand \ -romani romanii romaniii romaniv romanix \ -romanl romanm romannumerals romanv romanvi \ -romanvii romanviii romanx romanxi romanxii \ -rootradical rotate rparent rrangle rrbracket \ -rrointerval rtimes rtlhbox rtlvbox rtlvtop \ -rtop ruby ruledhbox ruledhpack ruledmbox \ -ruledtopv ruledtpack ruledvbox ruledvpack ruledvtop \ -runMPbuffer runninghbox russianNumerals russiannumerals rvert \ -sacute safechar samplefile sans sansbold \ -sansnormal sansserif savebox savebtxdataset savebuffer \ -savecounter savecurrentattributes savenormalmeaning savetaggedtwopassdata savetwopassdata \ -sbox scale scaron scedilla schwa \ +markpage markreferencepage mat math mathDitalicshape \ +mathDuprightshape mathampersand mathbf mathbi mathblackboard \ +mathbs mathdefault mathditalicshape mathdollar mathdouble \ +mathduprightshape mathematics mathfraktur mathfunction mathhash \ +mathhyphen mathit mathitalic mathlabellanguage mathlabeltext \ +mathlabeltexts mathop mathover mathpercent mathrm \ +mathscript mathsl mathss mathtext mathtextbf \ +mathtextbi mathtextbs mathtextit mathtextsl mathtexttf \ +mathtf mathtriplet mathtt mathunder mathupright \ +mathword mathwordbf mathwordbi mathwordbs mathwordit \ +mathwordsl mathwordtf maxaligned mbox mcframed \ +measure measured measuredangle measuredeq medskip \ +medspace menubutton mequal message mfence \ +mframed mfunction mfunctionlabeltext mhbox mho \ +mhookleftarrow mhookrightarrow mid midaligned middle \ +middlealigned middlebox midhbox midsubsentence minimalhbox \ +minus minuscolon mirror mixedcaps mkvibuffer \ +mleftarrow mleftharpoondown mleftharpoonup mleftrightarrow mleftrightharpoons \ +mmapsto models moduleparameter molecule mono \ +monobold mononormal month monthlong monthshort \ +mp mprandomnumber mrel mrightarrow mrightharpoondown \ +mrightharpoonup mrightleftharpoons mrightoverleftarrow mtext mtriplerel \ +mtwoheadleftarrow mtwoheadrightarrow mu multimap mvert \ +nHdownarrow nHuparrow nLeftarrow nLeftrightarrow nRightarrow \ +nVDash nVdash nVleftarrow nVleftrightarrow nVrightarrow \ +nabla nacute namedheadnumber namedstructureheadlocation namedstructureuservariable \ +namedstructurevariable namedtaggedlabeltexts napostrophe napprox napproxEq \ +narrownobreakspace nasymp natural naturalhbox naturalhpack \ +naturalnumbers naturaltpack naturalvbox naturalvcenter naturalvpack \ +naturalvtop naturalwd ncaron ncommaaccent ncong \ +ncurl ndivides ne nearrow negatecolorbox \ +negated negativesign negemspace negenspace negthinspace \ +neng neq nequiv neswarrow newattribute \ +newcatcodetable newcounter newevery newfrenchspacing newluatable \ +newmode newsignal newsystemmode nexists nextbox \ +nextboxdp nextboxht nextboxhtdp nextboxwd nextcounter \ +nextcountervalue nextdepth nextparagraphs nextrealpage nextrealpagenumber \ +nextsubcountervalue nextsubpage nextsubpagenumber nextuserpage nextuserpagenumber \ +ngeq ngrave ngtr ngtrless ngtrsim \ +ni nihongo nin njligature nleftarrow \ +nleftrightarrow nleq nless nlessgtr nlesssim \ +nmid nni nobar nobreakspace nocap \ +nocharacteralign nocitation nocite nodetostring noffigurepages \ +noflines noflinesinbox noflocalfloats noheaderandfooterlines noheightstrut \ +nohyphens noindentation noitem nonfrenchspacing nonmathematics \ +nonvalidassignment normal normalboldface normalframedwithsettings normalitalicface \ +normalizebodyfontsize normalizedfontsize normalizefontdepth normalizefontheight normalizefontline \ +normalizefontwidth normalizetextdepth normalizetextheight normalizetextline normalizetextwidth \ +normalslantedface normaltypeface nospace not note \ +notesymbol notimes notin notopandbottomlines notragged \ +nowns nparallel nprec npreccurlyeq nrightarrow \ +nsim nsimeq nsqsubseteq nsqsupseteq nsubset \ +nsubseteq nsucc nsucccurlyeq nsupset nsupseteq \ +ntilde ntimes ntriangleleft ntrianglelefteq ntriangleright \ +ntrianglerighteq nu numberofpoints numbers nvDash \ +nvdash nvleftarrow nvleftrightarrow nvrightarrow nwarrow \ +nwsearrow oacute obeydepth objectdepth objectheight \ +objectmargin objectwidth obox obreve ocaron \ +ocircumflex ocircumflexacute ocircumflexdotbelow ocircumflexgrave ocircumflexhook \ +ocircumflextilde octnumber octstringtonumber odiaeresis odiaeresismacron \ +odot odotaccent odotaccentmacron odotbelow odoublegrave \ +oeligature offset offsetbox ograve ohm \ +ohook ohorn ohornacute ohorndotbelow ohorngrave \ +ohornhook ohorntilde ohungarumlaut oiiint oiint \ +oint ointclockwise ointctrclockwise oinvertedbreve omacron \ +omega omicron ominus onedigitrounding oneeighth \ +onefifth onehalf onequarter onesixth onesuperior \ +onethird oogonek oogonekmacron operatorlanguage operatortext \ +oplus ordfeminine ordinaldaynumber ordinalstr ordmasculine \ +ornamenttext oslash ostroke ostrokeacute otilde \ +otildemacron otimes outputfilename outputstreambox outputstreamcopy \ +outputstreamunvbox outputstreamunvcopy over overbar overbars \ +overbartext overbarunderbar overbrace overbracetext overbraceunderbrace \ +overbracket overbrackettext overbracketunderbracket overlaybutton overlaycolor \ +overlaydepth overlayfigure overlayheight overlayimage overlaylinecolor \ +overlaylinewidth overlayoffset overlayrollbutton overlaywidth overleftarrow \ +overleftharpoondown overleftharpoonup overleftrightarrow overloaderror overparent \ +overparenttext overparentunderparent overrightarrow overrightharpoondown overrightharpoonup \ +overset overstrike overstrikes overtwoheadleftarrow overtwoheadrightarrow \ +owns page pagearea pagebreak pagefigure \ +pageinjection pagenumber pagereference pagestaterealpage pagestaterealpageorder \ +paletsize paragraphmark parallel part partial \ +pdfTeX pdfactualtext pdfbackendactualtext pdfbackendcurrentresources pdfbackendsetcatalog \ +pdfbackendsetcolorspace pdfbackendsetextgstate pdfbackendsetinfo pdfbackendsetname pdfbackendsetpageattribute \ +pdfbackendsetpageresource pdfbackendsetpagesattribute pdfbackendsetpattern pdfbackendsetshade pdfcolor \ +pdfeTeX percent percentdimen periodcentered periods \ +permitcaretescape permitcircumflexescape permitspacesbetweengroups perp persiandecimals \ +persiandecimalseparator persiannumerals persianthousandsseparator perthousand phantom \ +phantombox phi phook pi pickupgroupedcommand \ +pitchfork placeattachments placebookmarks placebtxrendering placechemical \ +placecitation placecombinedlist placecomments placecontent placecurrentformulanumber \ +placedbox placefigure placefloat placefloatcaption placefloatwithsetups \ +placefootnotes placeformula placeframed placegraphic placeheadnumber \ +placeheadtext placehelp placeholder placeindex placeinitial \ +placeintermezzo placelayer placelayeredtext placelegend placelist \ +placelistofabbreviations placelistofchemicals placelistoffigures placelistofgraphics placelistofintermezzi \ +placelistoflogos placelistofpublications placelistofsorts placelistofsynonyms placelistoftables \ +placelocalfootnotes placelocalnotes placement placenamedfloat placenamedformula \ +placenotes placeongrid placeontopofeachother placepagenumber placepairedbox \ +placeparallel placerawheaddata placerawheadnumber placerawheadtext placerawlist \ +placeregister placerenderingwindow placesidebyside placesubformula placetable \ +pm popattribute popmacro popmode popsystemmode \ +position positionoverlay positionregionoverlay positivesign postponenotes \ +prec precapprox preccurlyeq preceq preceqq \ +precnapprox precneq precneqq precnsim precsim \ +predefinedfont predefinefont predefinesymbol prefixedpagenumber prefixlanguage \ +prefixtext prependetoks prependgvalue prependtocommalist prependtoks \ +prependtoksonce prependvalue prerollblank presetbtxlabeltext presetdocument \ +presetfieldsymbols presetheadtext presetlabeltext presetmathlabeltext presetoperatortext \ +presetprefixtext presetsuffixtext presettaglabeltext presetunittext pretocommalist \ +prettyprintbuffer prevcounter prevcountervalue preventmode prevrealpage \ +prevrealpagenumber prevsubcountervalue prevsubpage prevsubpagenumber prevuserpage \ +prevuserpagenumber prime primes procent processMPbuffer \ +processMPfigurefile processaction processallactionsinset processassignlist processassignmentcommand \ +processassignmentlist processbetween processblocks processbodyfontenvironmentlist processcolorcomponents \ +processcommacommand processcommalist processcommalistwithparameters processcontent processfile \ +processfilemany processfilenone processfileonce processfirstactioninset processisolatedchars \ +processisolatedwords processlinetablebuffer processlinetablefile processlist processmonth \ +processranges processseparatedlist processtexbuffer processtokens processuntil \ +processxtablebuffer processyear prod product profiledbox \ +profilegivenbox program project propto pseudoMixedCapped \ +pseudoSmallCapped pseudoSmallcapped pseudosmallcapped psi punctuationspace \ +purenumber pushattribute pushbutton pushmacro pushmode \ +pushoutputstream pushsystemmode putboxincache putnextboxincache qquad \ +quad quadrupleprime quads quarterstrut questiondown \ +questionedeq quitcommalist quitprevcommalist quittypescriptscanning quotation \ +quote quotedbl quotedblbase quotedblleft quotedblright \ +quoteleft quoteright quotesingle quotesinglebase rVert \ +racute raggedbottom raggedcenter raggedleft raggedright \ +raggedwidecenter raisebox randomizetext randomnumber rangle \ +rationals rawcounter rawcountervalue rawdate rawdoifelseinset \ +rawdoifinset rawdoifinsetelse rawgetparameters rawprocessaction rawprocesscommacommand \ +rawprocesscommalist rawstructurelistuservariable rawsubcountervalue rbox rbrace \ +rbracket rcaron rceil rcommaaccent rdoublegrave \ +readfile readfixfile readjobfile readlocfile readsetfile \ +readsysfile readtexfile readxmlfile realSmallCapped realSmallcapped \ +realpagenumber reals realsmallcapped recursedepth recurselevel \ +recursestring redoconvertfont ref reference referencecolumnnumber \ +referencepagedetail referencepagestate referenceprefix referencerealpage referencesymbol \ +referring registerattachment registerctxluafile registered registerexternalfigure \ +registerfontclass registerhyphenationexception registerhyphenationpattern registermenubuttons registerparwrapper \ +registerparwrapperreverse registersort registersynonym registerunit regular \ +relatemarking relateparameterhandlers relaxvalueifundefined relbar remainingcharacters \ +remark removebottomthings removedepth removefromcommalist removelastskip \ +removelastspace removemarkedcontent removepunctuation removesubstring removetoks \ +removeunwantedspaces repeathead replacefeature replaceincommalist replaceword \ +rescan rescanwithsetup resetMPdrawing resetMPenvironment resetMPinstance \ +resetallattributes resetandaddfeature resetbar resetboxesincache resetbreakpoints \ +resetbuffer resetcharacteralign resetcharacterkerning resetcharacterspacing resetcharacterstripping \ +resetcollector resetcounter resetctxscanner resetdigitsmanipulation resetdirection \ +resetfeature resetflag resetfontcolorsheme resetfontfallback resetfontsolution \ +resethyphenationfeatures resetinjector resetinteractionmenu resetitaliccorrection resetlayer \ +resetlocalfloats resetmarker resetmarking resetmode resetpagenumber \ +resetparallel resetpath resetpenalties resetperiodkerning resetprofile \ +resetrecurselevel resetreference resetreplacements resetscript resetsetups \ +resetshownsynonyms resetsubpagenumber resetsymbolset resetsystemmode resettimer \ +resettokenlist resettrackers resettrialtypesetting resetusedsortings resetusedsynonyms \ +resetuserpagenumber resetvalue resetvisualizers reshapebox resolvedglyphdirect \ +resolvedglyphstyled restartcounter restorebox restorecatcodes restorecounter \ +restorecurrentattributes restoreendofline restoreglobalbodyfont restriction retestfeature \ +reusableMPgraphic reuseMPgraphic reuserandomseed reverseddoubleprime reversedprime \ +reversedtripleprime reversehbox reversehpack reversetpack reversevbox \ +reversevboxcontent reversevpack reversevtop revivefeature rfence \ +rfloor rgroup rhbox rho rhooknearrow \ +rhookswarrow right rightaligned rightangle rightarrow \ +rightarrowbar rightarrowtail rightarrowtriangle rightbottombox rightbox \ +rightdasharrow rightguillemot rightharpoondown rightharpoonup righthbox \ +rightheadtext rightlabeltext rightleftarrows rightleftharpoons rightline \ +rightmathlabeltext rightorleftpageaction rightpageorder rightrightarrows rightskipadaption \ +rightsquigarrow rightsubguillemot rightthreearrows rightthreetimes righttoleft \ +righttolefthbox righttoleftvbox righttoleftvtop righttopbox rightwavearrow \ +rightwhitearrow ring rinterval rinvertedbreve risingdotseq \ +rlap rlointerval rmoustache rneq robustaddtocommalist \ +robustdoifelseinset robustdoifinsetelse robustpretocommalist rointerval rollbutton \ +roman romanC romanD romanI romanII \ +romanIII romanIV romanIX romanL romanM \ +romanV romanVI romanVII romanVIII romanX \ +romanXI romanXII romanc romand romani \ +romanii romaniii romaniv romanix romanl \ +romanm romannumerals romanv romanvi romanvii \ +romanviii romanx romanxi romanxii rootradical \ +rotate rparent rrangle rrbracket rrointerval \ +rtimes rtlhbox rtlvbox rtlvtop rtop \ +ruby ruledhbox ruledhpack ruledmbox ruledtopv \ +ruledtpack ruledvbox ruledvpack ruledvtop runMPbuffer \ +runninghbox russianNumerals russiannumerals rvert sacute \ +safechar samplefile sans sansbold sansnormal \ +sansserif savebox savebtxdataset savebuffer savecounter \ +savecurrentattributes savenormalmeaning savetaggedtwopassdata savetwopassdata sbox \ +scalarproduct scale scaron scedilla schwa \ schwahook scircumflex scommaaccent screen searrow \ -secondoffivearguments secondoffourarguments secondofsixarguments secondofthreearguments secondofthreeunexpanded \ -secondoftwoarguments secondoftwounexpanded section sectionmark seeindex \ -select selectblocks serializecommalist serializedcommalist serif \ -serifbold serifnormal setJSpreamble setMPlayer setMPpositiongraphic \ -setMPpositiongraphicrange setMPtext setMPvariable setMPvariables setautopagestaterealpageno \ -setbar setbigbodyfont setboxllx setboxlly setbreakpoints \ -setcapstrut setcatcodetable setcharacteralign setcharacteraligndetail setcharactercasing \ -setcharactercleaning setcharacterkerning setcharacterspacing setcharacterstripping setcharstrut \ -setcollector setcolormodell setcounter setcounterown setctxluafunction \ -setcurrentfontclass setdataset setdatavalue setdefaultpenalties setdigitsmanipulation \ -setdirection setdocumentargument setdocumentargumentdefault setdocumentfilename setdummyparameter \ -setelementexporttag setemeasure setevalue setevariable setevariables \ -setexpansion setfirstline setfirstpasscharacteralign setflag setfont \ -setfontcolorsheme setfontfeature setfontsolution setfontstrut setfractions \ -setglobalscript setgmeasure setgvalue setgvariable setgvariables \ -sethboxregister sethyphenatedurlafter sethyphenatedurlbefore sethyphenatedurlnormal sethyphenationfeatures \ -setinitial setinjector setinteraction setinterfacecommand setinterfaceconstant \ -setinterfaceelement setinterfacemessage setinterfacevariable setinternalrendering setitaliccorrection \ -setlayer setlayerframed setlayertext setlinefiller setlocalhsize \ -setlocalscript setluatable setmainbodyfont setmainparbuilder setmarker \ -setmarking setmathstyle setmeasure setmessagetext setminus \ -setmode setnostrut setnote setnotetext setobject \ -setoldstyle setpagereference setpagestate setpagestaterealpageno setparagraphfreezing \ -setpenalties setpercentdimen setperiodkerning setposition setpositionbox \ -setpositiondata setpositiondataplus setpositiononly setpositionplus setpositionstrut \ -setprofile setrandomseed setreference setreferencedobject setregisterentry \ -setreplacements setrigidcolumnbalance setrigidcolumnhsize setscript setsecondpasscharacteralign \ -setsectionblock setsimplecolumnshsize setsmallbodyfont setsmallcaps setstackbox \ -setstructurepageregister setstrut setsuperiors setsystemmode settabular \ -settaggedmetadata settestcrlf settextcontent settightobject settightreferencedobject \ -settightstrut settightunreferencedobject settokenlist settrialtypesetting setuevalue \ -setugvalue setunreferencedobject setup setupMPgraphics setupMPinstance \ -setupMPpage setupMPvariables setupTABLE setupTEXpage setupalign \ -setupalternativestyles setuparranging setupattachment setupattachments setupbackend \ -setupbackground setupbackgrounds setupbar setupbars setupblackrules \ -setupblank setupbleeding setupblock setupbodyfont setupbodyfontenvironment \ -setupbookmark setupbottom setupbottomtexts setupbtx setupbtxdataset \ -setupbtxlabeltext setupbtxlist setupbtxregister setupbtxrendering setupbuffer \ -setupbutton setupcapitals setupcaption setupcaptions setupcharacteralign \ -setupcharacterkerning setupcharacterspacing setupchemical setupchemicalframed setupclipping \ -setupcollector setupcolor setupcolors setupcolumns setupcolumnset \ -setupcolumnsetarea setupcolumnsetareatext setupcolumnsetlines setupcolumnsetspan setupcolumnsetstart \ -setupcombination setupcombinedlist setupcomment setupcontent setupcounter \ -setupdataset setupdelimitedtext setupdescription setupdescriptions setupdirections \ -setupdocument setupeffect setupenumeration setupenumerations setupenv \ -setupexpansion setupexport setupexternalfigure setupexternalfigures setupexternalsoundtracks \ -setupfacingfloat setupfield setupfieldbody setupfieldcategory setupfieldcontentframed \ -setupfieldlabelframed setupfields setupfieldtotalframed setupfiller setupfillinlines \ -setupfillinrules setupfirstline setupfittingpage setupfloat setupfloatframed \ -setupfloats setupfloatsplitting setupfontexpansion setupfontprotrusion setupfonts \ -setupfontsolution setupfooter setupfootertexts setupfootnotes setupforms \ -setupformula setupformulae setupformulaframed setupframed setupframedcontent \ -setupframedtable setupframedtablecolumn setupframedtablerow setupframedtext setupframedtexts \ -setupglobalreferenceprefix setuphead setupheadalternative setupheader setupheadertexts \ -setupheadnumber setupheads setupheadtext setuphelp setuphigh \ -setuphighlight setuphyphenation setuphyphenmark setupindentedtext setupindenting \ -setupindex setupinitial setupinsertion setupinteraction setupinteractionbar \ -setupinteractionmenu setupinteractionscreen setupinterlinespace setupitaliccorrection setupitemgroup \ -setupitemizations setupitemize setupitems setuplabel setuplabeltext \ -setuplanguage setuplayer setuplayeredtext setuplayout setuplayouttext \ -setuplegend setuplinefiller setuplinefillers setuplinenote setuplinenumbering \ -setuplines setuplinetable setuplinewidth setuplist setuplistalternative \ -setuplistextra setuplocalfloats setuplocalinterlinespace setuplow setuplowhigh \ -setuplowmidhigh setupmakeup setupmarginblock setupmargindata setupmarginframed \ -setupmarginrule setupmarginrules setupmarking setupmathalignment setupmathcases \ -setupmathematics setupmathfence setupmathfraction setupmathfractions setupmathframed \ -setupmathlabeltext setupmathmatrix setupmathornament setupmathradical setupmathstackers \ -setupmathstyle setupmixedcolumns setupmodule setupmulticolumns setupnarrower \ -setupnotation setupnotations setupnote setupnotes setupoffset \ -setupoffsetbox setupoperatortext setupoppositeplacing setuporientation setupoutput \ -setupoutputroutine setuppagechecker setuppagecolumns setuppagecomment setuppageinjection \ -setuppageinjectionalternative setuppagenumber setuppagenumbering setuppageshift setuppagestate \ -setuppagetransitions setuppairedbox setuppalet setuppaper setuppapersize \ -setupparagraph setupparagraphintro setupparagraphnumbering setupparagraphs setupparallel \ -setupperiodkerning setupperiods setupplaceholder setupplacement setuppositionbar \ -setuppositioning setupprefixtext setupprocessor setupprofile setupprograms \ -setupquotation setupquote setuprealpagenumber setupreferenceformat setupreferenceprefix \ -setupreferencestructureprefix setupreferencing setupregister setupregisters setuprenderingwindow \ -setuprotate setupruby setups setupscale setupscript \ -setupscripts setupsectionblock setupselector setupshift setupsidebar \ -setupsorting setupspacing setupspellchecking setupstartstop setupstretched \ -setupstrut setupstyle setupsubformula setupsubformulas setupsubpagenumber \ -setupsuffixtext setupsymbols setupsymbolset setupsynctex setupsynonyms \ -setupsystem setuptables setuptabulate setuptagging setuptaglabeltext \ -setuptext setuptextbackground setuptextflow setuptextnote setuptextrules \ -setuptexttexts setupthinrules setuptolerance setuptooltip setuptop \ -setuptoptexts setuptype setuptyping setupunit setupunittext \ -setupurl setupuserdata setupuserdataalternative setupuserpagenumber setupversion \ -setupviewerlayer setupvspacing setupwhitespace setupwithargument setupwithargumentswapped \ -setupxml setupxtable setuvalue setuxvalue setvalue \ -setvariable setvariables setvboxregister setvisualizerfont setvtopregister \ -setwidthof setxmeasure setxvalue setxvariable setxvariables \ -seveneighths sfrac shapedhbox sharp shiftbox \ -shiftdown shiftup showallmakeup showattributes showbodyfont \ -showbodyfontenvironment showboxes showbtxdatasetauthors showbtxdatasetcompleteness showbtxdatasetfields \ -showbtxfields showbtxhashedauthors showbtxtables showchardata showcharratio \ -showcolor showcolorbar showcolorcomponents showcolorgroup showcolorset \ -showcolorstruts showcounter showdirectives showdirsinmargin showedebuginfo \ -showexperiments showfont showfontdata showfontexpansion showfontitalics \ -showfontkerns showfontparameters showfontstrip showfontstyle showframe \ -showglyphdata showglyphs showgrid showgridsnapping showhelp \ -showhyphenationtrace showhyphens showinjector showjustification showkerning \ -showlayout showlayoutcomponents showligature showligatures showlogcategories \ -showluatables showmakeup showmargins showmessage showminimalbaseline \ -shownextbox showotfcomposition showpalet showparentchain showparwrapperstate \ -showprint showsetups showsetupsdefinition showstruts showsymbolset \ -showtimer showtokens showtrackers showvalue showvariable \ -showwarning sigma signalrightpage sim simeq \ -simplealignedbox simplealignedboxplus simplealignedspreadbox simplegroupedcommand simplereversealignedbox \ -simplereversealignedboxplus singalcharacteralign singlebond singleverticalbar sixperemspace \ -sixthofsixarguments slanted slantedbold slantedface slash \ -slicepages slong slovenianNumerals sloveniannumerals small \ -smallbodyfont smallbold smallbolditalic smallboldslanted smallcappedcharacters \ -smallcappedromannumerals smallcaps smaller smallitalicbold smallnormal \ -smallskip smallslanted smallslantedbold smalltype smash \ -smashbox smashboxed smashedhbox smashedvbox smile \ -snaptogrid softhyphen solidus someheadnumber somekindoftab \ -someline somelocalfloat somenamedheadnumber someplace somewhere \ -space spaceddigits spaceddigitsmethod spaceddigitsseparator spaceddigitssymbol \ -spadesuit spanishNumerals spanishnumerals speech sphericalangle \ -splitatasterisk splitatcolon splitatcolons splitatcomma splitatperiod \ -splitdfrac splitfilename splitfloat splitfrac splitoffbase \ -splitofffull splitoffkind splitoffname splitoffpath splitoffroot \ -splitofftokens splitofftype splitstring spreadhbox sqcap \ -sqcup sqrt sqsubset sqsubseteq sqsubsetneq \ -sqsupset sqsupseteq sqsupsetneq square squaredots \ -ssharp stackrel stackscripts star stareq \ -startJScode startJSpreamble startLUA startMP startMPclip \ -startMPcode startMPdefinitions startMPdrawing startMPenvironment startMPextensions \ -startMPinclusions startMPinitializations startMPpage startMPpositiongraphic startMPpositionmethod \ -startMPrun startPARSEDXML startTABLE startTABLEbody startTABLEfoot \ -startTABLEhead startTABLEnested startTABLEnext startTC startTD \ -startTDs startTEX startTEXpage startTH startTN \ -startTR startTRs startTX startTY startXML \ -startalign startalignment startallmodes startappendices startarrangedpages \ -startasciimode startaside startattachment startbackground startbackmatter \ -startbar startbbordermatrix startbitmapimage startblockquote startbodymatter \ -startbordermatrix startboxedcolumns startbtxlabeltext startbtxrenderingdefinitions startbuffer \ -startcases startcatcodetable startcenteraligned startchapter startcharacteralign \ -startcheckedfences startchemical startchemicaltext startcollect startcollecting \ -startcolor startcolorintent startcoloronly startcolorset startcolumns \ -startcolumnset startcolumnsetspan startcombination startcomment startcomponent \ -startcontextcode startcontextdefinitioncode startctxfunction startctxfunctiondefinition startcurrentcolor \ -startcurrentlistentrywrapper startdelimited startdelimitedtext startdisplaymath startdmath \ -startdocument starteffect startelement startembeddedxtable startendnote \ -startendofline startenvironment startexceptions startexpanded startexpandedcollect \ -startextendedcatcodetable startexternalfigurecollection startfacingfloat startfact startfigure \ -startfiguretext startfittingpage startfixed startfloatcombination startfont \ -startfontclass startfontsolution startfootnote startformula startformulas \ -startframed startframedcell startframedcontent startframedrow startframedtable \ -startframedtext startfrontmatter startgoto startgraphictext startgridsnapping \ -starthanging starthbox starthboxestohbox starthboxregister starthead \ -startheadtext starthelptext starthiding starthighlight starthyphenation \ -startimath startindentation startindentedtext startinteraction startinteractionmenu \ -startinterface startintermezzotext startintertext startitem startitemgroup \ -startitemgroupcolumns startitemize startknockout startlabeltext startlanguage \ -startlayout startleftaligned startlegend startline startlinealignment \ -startlinecorrection startlinefiller startlinenote startlinenumbering startlines \ -startlinetable startlinetablebody startlinetablecell startlinetablehead startlocalfootnotes \ -startlocalheadsetup startlocallinecorrection startlocalnotes startlocalsetups startlua \ -startluacode startluaparameterset startluasetups startmakeup startmarginblock \ -startmarginrule startmarkedcontent startmarkpages startmathalignment startmathcases \ -startmathlabeltext startmathmatrix startmathmode startmathstyle startmatrices \ -startmatrix startmaxaligned startmdformula startmidaligned startmiddlealigned \ -startmiddlemakeup startmixedcolumns startmode startmodeset startmodule \ -startmoduletestsection startmpformula startmulticolumns startnamedsection startnamedsubformulas \ -startnarrow startnarrower startnegative startnicelyfilledbox startnointerference \ -startnotallmodes startnotext startnotmode startoperatortext startopposite \ -startoutputstream startoverlay startoverprint startpacked startpagecolumns \ -startpagecomment startpagefigure startpagelayout startpagemakeup startpar \ -startparagraph startparagraphs startparagraphscell startparbuilder startpart \ -startpath startplacechemical startplacefigure startplacefloat startplaceformula \ -startplacegraphic startplaceintermezzo startplacelegend startplacepairedbox startplacetable \ -startpositioning startpositionoverlay startpositive startpostponing startpostponingnotes \ -startprefixtext startprocessassignmentcommand startprocessassignmentlist startprocesscommacommand startprocesscommalist \ -startproduct startproject startprotect startprotectedcolors startpublication \ -startpunctuation startquotation startquote startrandomized startrandomseed \ -startrawsetups startreadingfile startreferenceprefix startregime startregister \ -startreusableMPgraphic startrightaligned startruby startscript startsdformula \ -startsection startsectionblock startsectionblockenvironment startsectionlevel startsetups \ -startshapebox startshift startsidebar startsimplecolumns startspecialitem \ -startspeech startspformula startsplitformula startsplittext startspread \ -startstandardmakeup startstaticMPfigure startstaticMPgraphic startstrictinspectnextcharacter startstructurepageregister \ -startstrut startstyle startsubformulas startsubject startsubjectlevel \ -startsubsection startsubsentence startsubstack startsubsubject startsubsubsection \ -startsubsubsubject startsubsubsubsection startsubsubsubsubject startsubsubsubsubsection startsubsubsubsubsubject \ -startsuffixtext startsymbolset starttable starttablehead starttables \ -starttabletail starttabletext starttabulate starttabulatehead starttabulatetail \ -starttagged starttaglabeltext starttexcode starttexdefinition starttext \ -starttextbackground starttextbackgroundmanual starttextcolor starttextcolorintent starttextflow \ -starttextmakeup starttextrule startthematrix starttitle starttokenlist \ -starttokens starttransparent starttypescript starttypescriptcollection starttyping \ -startuniqueMPgraphic startuniqueMPpagegraphic startunittext startunpacked startusableMPgraphic \ -startuseMPgraphic startusemathstyleparameter startuserdata startusingbtxspecification startvbox \ -startvboxregister startvboxtohbox startvboxtohboxseparator startviewerlayer startvtop \ -startvtopregister startxcell startxcellgroup startxcolumn startxgroup \ -startxmldisplayverbatim startxmlinlineverbatim startxmlraw startxmlsetups startxrow \ -startxrowgroup startxtable startxtablebody startxtablefoot startxtablehead \ -startxtablenext stligature stopJScode stopJSpreamble stopLUA \ -stopMP stopMPclip stopMPcode stopMPdefinitions stopMPdrawing \ -stopMPenvironment stopMPextensions stopMPinclusions stopMPinitializations stopMPpage \ -stopMPpositiongraphic stopMPpositionmethod stopMPrun stopPARSEDXML stopTABLE \ -stopTABLEbody stopTABLEfoot stopTABLEhead stopTABLEnested stopTABLEnext \ -stopTC stopTD stopTDs stopTEX stopTEXpage \ -stopTH stopTN stopTR stopTRs stopTX \ -stopTY stopXML stopalign stopalignment stopallmodes \ -stopappendices stoparrangedpages stopasciimode stopaside stopattachment \ -stopbackground stopbackmatter stopbar stopbbordermatrix stopbitmapimage \ -stopblockquote stopbodymatter stopbordermatrix stopboxedcolumns stopbtxlabeltext \ -stopbtxrenderingdefinitions stopbuffer stopcases stopcatcodetable stopcenteraligned \ -stopchapter stopcharacteralign stopcheckedfences stopchemical stopchemicaltext \ -stopcollect stopcollecting stopcolor stopcolorintent stopcoloronly \ -stopcolorset stopcolumns stopcolumnset stopcolumnsetspan stopcombination \ -stopcomment stopcomponent stopcontextcode stopcontextdefinitioncode stopctxfunction \ -stopctxfunctiondefinition stopcurrentcolor stopcurrentlistentrywrapper stopdelimited stopdelimitedtext \ -stopdisplaymath stopdmath stopdocument stopeffect stopelement \ -stopembeddedxtable stopendnote stopendofline stopenvironment stopexceptions \ -stopexpanded stopexpandedcollect stopextendedcatcodetable stopexternalfigurecollection stopfacingfloat \ -stopfact stopfigure stopfiguretext stopfittingpage stopfixed \ -stopfloatcombination stopfont stopfontclass stopfontsolution stopfootnote \ -stopformula stopformulas stopframed stopframedcell stopframedcontent \ -stopframedrow stopframedtable stopframedtext stopfrontmatter stopgoto \ -stopgraphictext stopgridsnapping stophanging stophbox stophboxestohbox \ -stophboxregister stophead stopheadtext stophelptext stophiding \ -stophighlight stophyphenation stopimath stopindentation stopindentedtext \ -stopinteraction stopinteractionmenu stopinterface stopintermezzotext stopintertext \ -stopitem stopitemgroup stopitemgroupcolumns stopitemize stopknockout \ -stoplabeltext stoplanguage stoplayout stopleftaligned stoplegend \ -stopline stoplinealignment stoplinecorrection stoplinefiller stoplinenote \ -stoplinenumbering stoplines stoplinetable stoplinetablebody stoplinetablecell \ -stoplinetablehead stoplocalfootnotes stoplocalheadsetup stoplocallinecorrection stoplocalnotes \ -stoplocalsetups stoplua stopluacode stopluaparameterset stopluasetups \ -stopmakeup stopmarginblock stopmarginrule stopmarkedcontent stopmarkpages \ -stopmathalignment stopmathcases stopmathlabeltext stopmathmatrix stopmathmode \ -stopmathstyle stopmatrices stopmatrix stopmaxaligned stopmdformula \ -stopmidaligned stopmiddlealigned stopmiddlemakeup stopmixedcolumns stopmode \ -stopmodeset stopmodule stopmoduletestsection stopmpformula stopmulticolumns \ -stopnamedsection stopnamedsubformulas stopnarrow stopnarrower stopnegative \ -stopnicelyfilledbox stopnointerference stopnotallmodes stopnotext stopnotmode \ -stopoperatortext stopopposite stopoutputstream stopoverlay stopoverprint \ -stoppacked stoppagecolumns stoppagecomment stoppagefigure stoppagelayout \ -stoppagemakeup stoppar stopparagraph stopparagraphs stopparagraphscell \ -stopparbuilder stoppart stoppath stopplacechemical stopplacefigure \ -stopplacefloat stopplaceformula stopplacegraphic stopplaceintermezzo stopplacelegend \ -stopplacepairedbox stopplacetable stoppositioning stoppositionoverlay stoppositive \ -stoppostponing stoppostponingnotes stopprefixtext stopprocessassignmentcommand stopprocessassignmentlist \ -stopprocesscommacommand stopprocesscommalist stopproduct stopproject stopprotect \ -stopprotectedcolors stoppublication stoppunctuation stopquotation stopquote \ -stoprandomized stoprandomseed stoprawsetups stopreadingfile stopreferenceprefix \ -stopregime stopreusableMPgraphic stoprightaligned stopruby stopscript \ -stopsdformula stopsection stopsectionblock stopsectionblockenvironment stopsectionlevel \ -stopsetups stopshapebox stopshift stopsidebar stopsimplecolumns \ -stopspecialitem stopspeech stopspformula stopsplitformula stopsplittext \ -stopspread stopstandardmakeup stopstaticMPfigure stopstaticMPgraphic stopstrictinspectnextcharacter \ -stopstrut stopstyle stopsubformulas stopsubject stopsubjectlevel \ -stopsubsection stopsubsentence stopsubstack stopsubsubject stopsubsubsection \ -stopsubsubsubject stopsubsubsubsection stopsubsubsubsubject stopsubsubsubsubsection stopsubsubsubsubsubject \ -stopsuffixtext stopsymbolset stoptable stoptablehead stoptables \ -stoptabletail stoptabletext stoptabulate stoptabulatehead stoptabulatetail \ -stoptagged stoptaglabeltext stoptexcode stoptexdefinition stoptext \ -stoptextbackground stoptextbackgroundmanual stoptextcolor stoptextcolorintent stoptextflow \ -stoptextmakeup stoptextrule stopthematrix stoptitle stoptokenlist \ -stoptokens stoptransparent stoptypescript stoptypescriptcollection stoptyping \ -stopuniqueMPgraphic stopuniqueMPpagegraphic stopunittext stopunpacked stopusableMPgraphic \ -stopuseMPgraphic stopusemathstyleparameter stopuserdata stopusingbtxspecification stopvbox \ -stopvboxregister stopvboxtohbox stopvboxtohboxseparator stopviewerlayer stopvtop \ -stopvtopregister stopxcell stopxcellgroup stopxcolumn stopxgroup \ -stopxmldisplayverbatim stopxmlinlineverbatim stopxmlraw stopxmlsetups stopxrow \ -stopxrowgroup stopxtable stopxtablebody stopxtablefoot stopxtablehead \ -stopxtablenext stretched strictdoifelsenextoptional strictdoifnextoptionalelse stripcharacter \ -strippedcsname stripspaces structurelistuservariable structurenumber structuretitle \ -structureuservariable structurevariable strut strutdp strutgap \ -strutht struthtdp struttedbox strutwd style \ -styleinstance subject subpagenumber subsection subsentence \ -subset subseteq subseteqq subsetneq subsetneqq \ -substituteincommalist subsubject subsubsection subsubsubject subsubsubsection \ -subsubsubsubject subsubsubsubsection subsubsubsubsubject subtractfeature succ \ -succapprox succcurlyeq succeq succeqq succnapprox \ -succneq succneqq succnsim succsim suffixlanguage \ -suffixtext sum supset supseteq supseteqq \ -supsetneq supsetneqq surd surdradical swapcounts \ -swapdimens swapface swapmacros swaptypeface swarrow \ -switchstyleonly switchtobodyfont switchtocolor switchtointerlinespace symbol \ -symbolreference synchronizeblank synchronizeindenting synchronizemarking synchronizeoutputstreams \ -synchronizestrut synchronizewhitespace synctexblockfilename synctexresetfilename synctexsetfilename \ -systemlog systemlogfirst systemloglast systemsetups tLeftarrow \ -tLeftrightarrow tRightarrow tabulateautoline tabulateautorule tabulateline \ -tabulaterule taggedctxcommand taggedlabeltexts taglabellanguage taglabeltext \ -tau tbinom tbox tcaron tcedilla \ -tcommaaccent tcurl tequal test testandsplitstring \ -testcolumn testfeature testfeatureonce testpage testpageonly \ -testpagesync testtokens tex texdefinition texsetup \ -textAngstrom textacute textampersand textasciicircum textasciitilde \ -textat textbackslash textbar textbottomcomma textbottomdot \ -textbraceleft textbraceright textbreve textbrokenbar textbullet \ -textcaron textcedilla textcelsius textcent textcircledP \ -textcircumflex textcitation textcite textcomma textcontrolspace \ -textcurrency textdag textddag textdegree textdiaeresis \ -textdiv textdollar textdong textdotaccent textellipsis \ -texteuro textflowcollector textfraction textgrave texthash \ -texthorizontalbar texthungarumlaut texthyphen textkelvin textlognot \ -textmacron textmath textmho textminus textmp \ -textmu textmultiply textnumero textogonek textohm \ -textormathchar textormathchars textounce textpercent textperiod \ -textplus textpm textreference textring textrule \ -textslash textsterling texttilde textunderscore textvisiblespace \ -textyen thai thainumerals thedatavalue thefirstcharacter \ -thematrix thenormalizedbodyfontsize theorientation therefore theremainingcharacters \ -theta thickspace thinrule thinrules thinspace \ -thirdoffivearguments thirdoffourarguments thirdofsixarguments thirdofthreearguments thirdofthreeunexpanded \ -thook thookleftarrow thookrightarrow thorn threedigitrounding \ -threeeighths threefifths threeperemspace threequarter threesuperior \ -tibetannumerals tightlayer tilde times tinyfont \ -title tlap tleftarrow tleftharpoondown tleftharpoonup \ -tleftrightarrow tleftrightharpoons tmapsto to tochar \ -tolinenote tooltip top topbox topleftbox \ -toplinebox toprightbox topskippedbox tracecatcodetables tracedfontname \ -tracedpagestate traceoutputroutines tracepositions trademark translate \ -transparencycomponents transparent trel triangle triangledown \ -triangleleft triangleq triangleright trightarrow trightharpoondown \ -trightharpoonup trightleftharpoons trightoverleftarrow triplebond tripleprime \ -tripleverticalbar truefilename truefontname tstroke ttraggedright \ -ttriplerel ttwoheadleftarrow ttwoheadrightarrow turnediota twodigitrounding \ -twofifths twoheaddownarrow twoheadleftarrow twoheadrightarrow twoheadrightarrowtail \ -twoheaduparrow twosuperior twothirds tx txx \ -typ type typebuffer typedefinedbuffer typeface \ -typefile typeinlinebuffer typescriptone typescriptprefix typescriptthree \ -typescripttwo typesetbuffer typesetbufferonly typesetfile uacute \ -ubreve ucaron uchexnumber uchexnumbers ucircumflex \ -uconvertnumber udiaeresis udiaeresisacute udiaeresiscaron udiaeresisgrave \ -udiaeresismacron udotbelow udots udoublegrave uedcatcodecommand \ -ugrave uhook uhorn uhornacute uhorndotbelow \ -uhorngrave uhornhook uhorntilde uhungarumlaut uinvertedbreve \ -ulcorner umacron undefinevalue undepthed underbar \ -underbars underbartext underbrace underbracetext underbracket \ -underbrackettext underdash underdashes underdot underdots \ -underleftarrow underleftharpoondown underleftharpoonup underleftrightarrow underparent \ -underparenttext underrandom underrandoms underrightarrow underrightharpoondown \ -underrightharpoonup underset understrike understrikes undertwoheadleftarrow \ -undertwoheadrightarrow undoassign unexpandeddocumentvariable unframed unhhbox \ -unihex uniqueMPgraphic uniqueMPpagegraphic unit unitlanguage \ -unitshigh unitslow unittext unknown unprotected \ -unregisterhyphenationpattern unregisterparwrapper unspaceafter unspaceargument unspaced \ -unspacestring unstackscripts untexargument untexcommand uogonek \ -upand uparrow updasharrow updateparagraphdemerits updateparagraphpenalties \ -updateparagraphproperties updateparagraphshapes updownarrow updownarrowbar updownarrows \ -upharpoonleft upharpoonright uplus uppercased uppercasestring \ -uppercasing upperleftdoubleninequote upperleftdoublesixquote upperleftsingleninequote upperleftsinglesixquote \ -upperrightdoubleninequote upperrightdoublesixquote upperrightsingleninequote upperrightsinglesixquote upsilon \ -upuparrows upwhitearrow urcorner uring url \ -useJSscripts useMPenvironmentbuffer useMPgraphic useMPlibrary useMPrun \ -useMPvariables useURL usealignparameter useblankparameter useblocks \ -usebodyfont usebodyfontparameter usebtxdataset usebtxdefinitions usecitation \ -usecolors usecomponent usedirectory usedummycolorparameter usedummystyleandcolor \ -usedummystyleparameter useenvironment useexternaldocument useexternalfigure useexternalrendering \ -useexternalsoundtrack usefigurebase usefile usefontpath usegridparameter \ -usehyphensparameter useindentingparameter useindentnextparameter useinterlinespaceparameter uselanguageparameter \ -useluamodule useluatable usemathstyleparameter usemodule useproduct \ -useprofileparameter useproject usereferenceparameter userpagenumber usesetupsparameter \ -usestaticMPfigure usesubpath usesymbols usetexmodule usetypescript \ -usetypescriptfile useurl usezipfile utfchar utflower \ -utfupper utilde utilityregisterlength vDash validassignment \ -varTheta varepsilon varkappa varnothing varphi \ -varpi varrho varsigma vartheta vboxreference \ -vdash vdots vec vee veebar \ -veeeq verbatim verbatimstring verbosenumber version \ -vert verticalgrowingbar verticalpositionbar veryraggedcenter veryraggedleft \ -veryraggedright vglue viewerlayer vl vpackbox \ -vpackedbox vphantom vpos vsmash vsmashbox \ -vsmashed vspace vspacing wcircumflex wdofstring \ -wedge wedgeeq weekday whitearrowupfrombar wideacute \ -widebar widebreve widecheck wideddot widedot \ -widegrave widehat widering widetilde widthofstring \ -widthspanningtext withoutpt word wordright words \ -wordtonumber wp wr writebetweenlist writedatatolist \ -writestatus writetolist xLeftarrow xLeftrightarrow xRightarrow \ -xdefconvertedargument xequal xfrac xhookleftarrow xhookrightarrow \ -xi xleftarrow xleftharpoondown xleftharpoonup xleftrightarrow \ -xleftrightharpoons xmapsto xmladdindex xmlafterdocumentsetup xmlaftersetup \ -xmlall xmlappenddocumentsetup xmlappendsetup xmlapplyselectors xmlatt \ -xmlattdef xmlattribute xmlattributedef xmlbadinclusions xmlbeforedocumentsetup \ -xmlbeforesetup xmlchainatt xmlchainattdef xmlchecknamespace xmlcommand \ -xmlconcat xmlconcatrange xmlcontext xmlcount xmldefaulttotext \ -xmldepth xmldirectives xmldirectivesafter xmldirectivesbefore xmldisplayverbatim \ -xmldoif xmldoifatt xmldoifelse xmldoifelseatt xmldoifelseempty \ -xmldoifelseselfempty xmldoifelsetext xmldoifelsevalue xmldoifnot xmldoifnotatt \ -xmldoifnotselfempty xmldoifnottext xmldoifselfempty xmldoiftext xmlelement \ -xmlfilter xmlfirst xmlflush xmlflushcontext xmlflushdocumentsetups \ -xmlflushlinewise xmlflushpure xmlflushspacewise xmlflushtext xmlinclude \ -xmlinclusion xmlinclusions xmlinfo xmlinjector xmlinlineprettyprint \ -xmlinlineprettyprinttext xmlinlineverbatim xmlinstalldirective xmllast xmllastatt \ -xmllastmatch xmllastpar xmlloadbuffer xmlloaddata xmlloaddirectives \ -xmlloadfile xmlloadonly xmlmain xmlmapvalue xmlname \ -xmlnamespace xmlnonspace xmlpar xmlparam xmlpath \ -xmlpos xmlposition xmlprependdocumentsetup xmlprependsetup xmlprettyprint \ -xmlprettyprinttext xmlprocessbuffer xmlprocessdata xmlprocessfile xmlpure \ -xmlraw xmlrefatt xmlregistereddocumentsetups xmlregisteredsetups xmlregisterns \ -xmlremapname xmlremapnamespace xmlremovedocumentsetup xmlremovesetup xmlresetdocumentsetups \ -xmlresetinjectors xmlresetsetups xmlsave xmlsetatt xmlsetattribute \ -xmlsetentity xmlsetfunction xmlsetinjectors xmlsetpar xmlsetparam \ -xmlsetsetup xmlsetup xmlshow xmlsnippet xmlstrip \ -xmlstripnolines xmlstripped xmlstrippednolines xmltag xmltexentity \ -xmltext xmltobuffer xmltobufferverbose xmltofile xmlvalue \ -xmlverbatim xrel xrightarrow xrightharpoondown xrightharpoonup \ -xrightleftharpoons xrightoverleftarrow xsplitstring xtriplerel xtwoheadleftarrow \ -xtwoheadrightarrow xxfrac xypos yacute ycircumflex \ -ydiaeresis ydotbelow yen ygrave yhook \ -yiddishnumerals ymacron ytilde zacute zcaron \ -zdotaccent zeronumberconversion zerowidthnobreakspace zerowidthspace zeta \ -zhook zstroke zwj zwnj +secondderivativesymbol secondoffivearguments secondoffourarguments secondofsixarguments secondofthreearguments \ +secondofthreeunexpanded secondoftwoarguments secondoftwounexpanded section sectionmark \ +seeindex select selectblocks serializecommalist serializedcommalist \ +serif serifbold serifnormal setJSpreamble setMPlayer \ +setMPpositiongraphic setMPpositiongraphicrange setMPtext setMPvariable setMPvariables \ +setautopagestaterealpageno setbar setbigbodyfont setboxllx setboxlly \ +setbreakpoints setcapstrut setcatcodetable setcharacteralign setcharacteraligndetail \ +setcharactercasing setcharactercleaning setcharacterkerning setcharacterspacing setcharacterstripping \ +setcharstrut setcollector setcolormodell setcounter setcounterown \ +setctxluafunction setcurrentfontclass setdataset setdatavalue setdefaultpenalties \ +setdigitsmanipulation setdirection setdocumentargument setdocumentargumentdefault setdocumentfilename \ +setdummyparameter setelementexporttag setemeasure setevalue setevariable \ +setevariables setexpansion setfirstline setfirstpasscharacteralign setflag \ +setfont setfontcolorsheme setfontfeature setfontsolution setfontstrut \ +setfractions setglobalscript setgmeasure setgvalue setgvariable \ +setgvariables sethboxregister sethyphenatedurlafter sethyphenatedurlbefore sethyphenatedurlnormal \ +sethyphenationfeatures setinitial setinjector setinteraction setinterfacecommand \ +setinterfaceconstant setinterfaceelement setinterfacemessage setinterfacevariable setinternalrendering \ +setitaliccorrection setlayer setlayerframed setlayertext setlinefiller \ +setlocalhsize setlocalscript setluatable setmainbodyfont setmainparbuilder \ +setmarker setmarking setmathstyle setmeasure setmessagetext \ +setminus setmode setnostrut setnote setnotetext \ +setobject setoldstyle setpagereference setpagestate setpagestaterealpageno \ +setparagraphfreezing setpenalties setpercentdimen setperiodkerning setposition \ +setpositionbox setpositiondata setpositiondataplus setpositiononly setpositionplus \ +setpositionstrut setprofile setrandomseed setreference setreferencedobject \ +setregisterentry setreplacements setrigidcolumnbalance setrigidcolumnhsize setscript \ +setsecondpasscharacteralign setsectionblock setsimplecolumnshsize setsmallbodyfont setsmallcaps \ +setstackbox setstructurepageregister setstrut setsuperiors setsystemmode \ +settabular settaggedmetadata settestcrlf settextcontent settightobject \ +settightreferencedobject settightstrut settightunreferencedobject settokenlist settrialtypesetting \ +setuevalue setugvalue setunreferencedobject setup setupMPgraphics \ +setupMPinstance setupMPpage setupMPvariables setupTABLE setupTEXpage \ +setupalign setupalternativestyles setuparranging setupattachment setupattachments \ +setupbackend setupbackground setupbackgrounds setupbar setupbars \ +setupblackrules setupblank setupbleeding setupblock setupbodyfont \ +setupbodyfontenvironment setupbookmark setupbottom setupbottomtexts setupbtx \ +setupbtxdataset setupbtxlabeltext setupbtxlist setupbtxregister setupbtxrendering \ +setupbuffer setupbutton setupcapitals setupcaption setupcaptions \ +setupcharacteralign setupcharacterkerning setupcharacterspacing setupchemical setupchemicalframed \ +setupclipping setupcollector setupcolor setupcolors setupcolumns \ +setupcolumnset setupcolumnsetarea setupcolumnsetareatext setupcolumnsetlines setupcolumnsetspan \ +setupcolumnsetstart setupcombination setupcombinedlist setupcomment setupcontent \ +setupcounter setupdataset setupdelimitedtext setupdescription setupdescriptions \ +setupdirections setupdocument setupeffect setupenumeration setupenumerations \ +setupenv setupexpansion setupexport setupexternalfigure setupexternalfigures \ +setupexternalsoundtracks setupfacingfloat setupfield setupfieldbody setupfieldcategory \ +setupfieldcontentframed setupfieldlabelframed setupfields setupfieldtotalframed setupfiller \ +setupfillinlines setupfillinrules setupfirstline setupfittingpage setupfloat \ +setupfloatframed setupfloats setupfloatsplitting setupfontexpansion setupfontprotrusion \ +setupfonts setupfontsolution setupfooter setupfootertexts setupfootnotes \ +setupforms setupformula setupformulae setupformulaframed setupframed \ +setupframedcontent setupframedtable setupframedtablecolumn setupframedtablerow setupframedtext \ +setupframedtexts setupglobalreferenceprefix setuphead setupheadalternative setupheader \ +setupheadertexts setupheadnumber setupheads setupheadtext setuphelp \ +setuphigh setuphighlight setuphyphenation setuphyphenmark setupindentedtext \ +setupindenting setupindex setupinitial setupinsertion setupinteraction \ +setupinteractionbar setupinteractionmenu setupinteractionscreen setupinterlinespace setupitaliccorrection \ +setupitemgroup setupitemizations setupitemize setupitems setuplabel \ +setuplabeltext setuplanguage setuplayer setuplayeredtext setuplayout \ +setuplayouttext setuplegend setuplinefiller setuplinefillers setuplinenote \ +setuplinenumbering setuplines setuplinetable setuplinewidth setuplist \ +setuplistalternative setuplistextra setuplocalfloats setuplocalinterlinespace setuplow \ +setuplowhigh setuplowmidhigh setupmakeup setupmarginblock setupmargindata \ +setupmarginframed setupmarginrule setupmarginrules setupmarking setupmathalignment \ +setupmathcases setupmathematics setupmathfence setupmathfraction setupmathfractions \ +setupmathframed setupmathlabeltext setupmathmatrix setupmathornament setupmathradical \ +setupmathstackers setupmathstyle setupmixedcolumns setupmodule setupmulticolumns \ +setupnarrower setupnotation setupnotations setupnote setupnotes \ +setupoffset setupoffsetbox setupoperatortext setupoppositeplacing setuporientation \ +setupoutput setupoutputroutine setuppagechecker setuppagecolumns setuppagecomment \ +setuppageinjection setuppageinjectionalternative setuppagenumber setuppagenumbering setuppageshift \ +setuppagestate setuppagetransitions setuppairedbox setuppalet setuppaper \ +setuppapersize setupparagraph setupparagraphintro setupparagraphnumbering setupparagraphs \ +setupparallel setupperiodkerning setupperiods setupplaceholder setupplacement \ +setuppositionbar setuppositioning setupprefixtext setupprocessor setupprofile \ +setupprograms setupquotation setupquote setuprealpagenumber setupreferenceformat \ +setupreferenceprefix setupreferencestructureprefix setupreferencing setupregister setupregisters \ +setuprenderingwindow setuprotate setupruby setups setupscale \ +setupscript setupscripts setupsectionblock setupselector setupshift \ +setupsidebar setupsorting setupspacing setupspellchecking setupstartstop \ +setupstretched setupstrut setupstyle setupsubformula setupsubformulas \ +setupsubpagenumber setupsuffixtext setupsymbols setupsymbolset setupsynctex \ +setupsynonyms setupsystem setuptables setuptabulate setuptagging \ +setuptaglabeltext setuptext setuptextbackground setuptextflow setuptextnote \ +setuptextrules setuptexttexts setupthinrules setuptolerance setuptooltip \ +setuptop setuptoptexts setuptype setuptyping setupunit \ +setupunittext setupurl setupuserdata setupuserdataalternative setupuserpagenumber \ +setupversion setupviewerlayer setupvspacing setupwhitespace setupwithargument \ +setupwithargumentswapped setupxml setupxtable setuvalue setuxvalue \ +setvalue setvariable setvariables setvboxregister setvisualizerfont \ +setvtopregister setwidthof setxmeasure setxvalue setxvariable \ +setxvariables seveneighths sfrac shapedhbox sharp \ +shiftbox shiftdown shiftup showallmakeup showattributes \ +showbodyfont showbodyfontenvironment showboxes showbtxdatasetauthors showbtxdatasetcompleteness \ +showbtxdatasetfields showbtxfields showbtxhashedauthors showbtxtables showchardata \ +showcharratio showcolor showcolorbar showcolorcomponents showcolorgroup \ +showcolorset showcolorstruts showcounter showdirectives showdirsinmargin \ +showedebuginfo showexperiments showfont showfontdata showfontexpansion \ +showfontitalics showfontkerns showfontparameters showfontstrip showfontstyle \ +showframe showglyphdata showglyphs showgrid showgridsnapping \ +showhelp showhyphenationtrace showhyphens showinjector showjustification \ +showkerning showlayout showlayoutcomponents showligature showligatures \ +showlogcategories showluatables showmakeup showmargins showmessage \ +showminimalbaseline shownextbox showotfcomposition showpalet showparentchain \ +showparwrapperstate showprint showsetups showsetupsdefinition showstruts \ +showsymbolset showtimer showtokens showtrackers showvalue \ +showvariable showwarning sigma signalrightpage sim \ +simeq simplealignedbox simplealignedboxplus simplealignedspreadbox simplegroupedcommand \ +simplereversealignedbox simplereversealignedboxplus singalcharacteralign singlebond singleverticalbar \ +sixperemspace sixthofsixarguments slanted slantedbold slantedface \ +slash slicepages slong slovenianNumerals sloveniannumerals \ +small smallbodyfont smallbold smallbolditalic smallboldslanted \ +smallcappedcharacters smallcappedromannumerals smallcaps smaller smallitalicbold \ +smallnormal smallskip smallslanted smallslantedbold smalltype \ +smash smashbox smashboxed smashedhbox smashedvbox \ +smile snaptogrid softhyphen solidus someheadnumber \ +somekindoftab someline somelocalfloat somenamedheadnumber someplace \ +somewhere space spaceddigits spaceddigitsmethod spaceddigitsseparator \ +spaceddigitssymbol spadesuit spanishNumerals spanishnumerals speech \ +sphericalangle splitatasterisk splitatcolon splitatcolons splitatcomma \ +splitatperiod splitdfrac splitfilename splitfloat splitfrac \ +splitoffbase splitofffull splitoffkind splitoffname splitoffpath \ +splitoffroot splitofftokens splitofftype splitstring spreadhbox \ +sqcap sqcup sqrt sqsubset sqsubseteq \ +sqsubsetneq sqsupset sqsupseteq sqsupsetneq square \ +squaredots ssharp stackrel stackscripts star \ +stareq startJScode startJSpreamble startLUA startMP \ +startMPclip startMPcode startMPdefinitions startMPdrawing startMPenvironment \ +startMPextensions startMPinclusions startMPinitializations startMPpage startMPpositiongraphic \ +startMPpositionmethod startMPrun startPARSEDXML startTABLE startTABLEbody \ +startTABLEfoot startTABLEhead startTABLEnested startTABLEnext startTC \ +startTD startTDs startTEX startTEXpage startTH \ +startTN startTR startTRs startTX startTY \ +startXML startalign startalignment startallmodes startappendices \ +startarrangedpages startasciimode startaside startattachment startbackground \ +startbackmatter startbar startbbordermatrix startbitmapimage startblockquote \ +startbodymatter startbordermatrix startboxedcolumns startbtxlabeltext startbtxrenderingdefinitions \ +startbuffer startcases startcatcodetable startcenteraligned startchapter \ +startcharacteralign startcheckedfences startchemical startchemicaltext startcollect \ +startcollecting startcolor startcolorintent startcoloronly startcolorset \ +startcolumns startcolumnset startcolumnsetspan startcombination startcomment \ +startcomponent startcontextcode startcontextdefinitioncode startctxfunction startctxfunctiondefinition \ +startcurrentcolor startcurrentlistentrywrapper startdelimited startdelimitedtext startdisplaymath \ +startdmath startdocument starteffect startelement startembeddedxtable \ +startendnote startendofline startenvironment startexceptions startexpanded \ +startexpandedcollect startextendedcatcodetable startexternalfigurecollection startfacingfloat startfact \ +startfigure startfiguretext startfittingpage startfixed startfloatcombination \ +startfont startfontclass startfontsolution startfootnote startformula \ +startformulas startframed startframedcell startframedcontent startframedrow \ +startframedtable startframedtext startfrontmatter startgoto startgraphictext \ +startgridsnapping starthanging starthbox starthboxestohbox starthboxregister \ +starthead startheadtext starthelptext starthiding starthighlight \ +starthyphenation startimath startindentation startindentedtext startinteraction \ +startinteractionmenu startinterface startintermezzotext startintertext startitem \ +startitemgroup startitemgroupcolumns startitemize startknockout startlabeltext \ +startlanguage startlayout startleftaligned startlegend startline \ +startlinealignment startlinecorrection startlinefiller startlinenote startlinenumbering \ +startlines startlinetable startlinetablebody startlinetablecell startlinetablehead \ +startlocalfootnotes startlocalheadsetup startlocallinecorrection startlocalnotes startlocalsetups \ +startlua startluacode startluaparameterset startluasetups startmakeup \ +startmarginblock startmarginrule startmarkedcontent startmarkpages startmathalignment \ +startmathcases startmathlabeltext startmathmatrix startmathmode startmathstyle \ +startmatrices startmatrix startmaxaligned startmdformula startmidaligned \ +startmiddlealigned startmiddlemakeup startmixedcolumns startmode startmodeset \ +startmodule startmoduletestsection startmpformula startmulticolumns startnamedsection \ +startnamedsubformulas startnarrow startnarrower startnegative startnicelyfilledbox \ +startnointerference startnotallmodes startnotext startnotmode startoperatortext \ +startopposite startoutputstream startoverlay startoverprint startpacked \ +startpagecolumns startpagecomment startpagefigure startpagelayout startpagemakeup \ +startpar startparagraph startparagraphs startparagraphscell startparbuilder \ +startpart startpath startplacechemical startplacefigure startplacefloat \ +startplaceformula startplacegraphic startplaceintermezzo startplacelegend startplacepairedbox \ +startplacetable startpositioning startpositionoverlay startpositive startpostponing \ +startpostponingnotes startprefixtext startprocessassignmentcommand startprocessassignmentlist startprocesscommacommand \ +startprocesscommalist startproduct startproject startprotect startprotectedcolors \ +startpublication startpunctuation startquotation startquote startrandomized \ +startrandomseed startrawsetups startreadingfile startreferenceprefix startregime \ +startregister startreusableMPgraphic startrightaligned startruby startscript \ +startsdformula startsection startsectionblock startsectionblockenvironment startsectionlevel \ +startsetups startshapebox startshift startsidebar startsimplecolumns \ +startspecialitem startspeech startspformula startsplitformula startsplittext \ +startspread startstandardmakeup startstaticMPfigure startstaticMPgraphic startstrictinspectnextcharacter \ +startstructurepageregister startstrut startstyle startsubformulas startsubject \ +startsubjectlevel startsubsection startsubsentence startsubstack startsubsubject \ +startsubsubsection startsubsubsubject startsubsubsubsection startsubsubsubsubject startsubsubsubsubsection \ +startsubsubsubsubsubject startsuffixtext startsymbolset starttable starttablehead \ +starttables starttabletail starttabletext starttabulate starttabulatehead \ +starttabulatetail starttagged starttaglabeltext starttexcode starttexdefinition \ +starttext starttextbackground starttextbackgroundmanual starttextcolor starttextcolorintent \ +starttextflow starttextmakeup starttextrule startthematrix starttitle \ +starttokenlist starttokens starttransparent starttypescript starttypescriptcollection \ +starttyping startuniqueMPgraphic startuniqueMPpagegraphic startunittext startunpacked \ +startusableMPgraphic startuseMPgraphic startusemathstyleparameter startuserdata startusingbtxspecification \ +startvbox startvboxregister startvboxtohbox startvboxtohboxseparator startviewerlayer \ +startvtop startvtopregister startxcell startxcellgroup startxcolumn \ +startxgroup startxmldisplayverbatim startxmlinlineverbatim startxmlraw startxmlsetups \ +startxrow startxrowgroup startxtable startxtablebody startxtablefoot \ +startxtablehead startxtablenext stligature stopJScode stopJSpreamble \ +stopLUA stopMP stopMPclip stopMPcode stopMPdefinitions \ +stopMPdrawing stopMPenvironment stopMPextensions stopMPinclusions stopMPinitializations \ +stopMPpage stopMPpositiongraphic stopMPpositionmethod stopMPrun stopPARSEDXML \ +stopTABLE stopTABLEbody stopTABLEfoot stopTABLEhead stopTABLEnested \ +stopTABLEnext stopTC stopTD stopTDs stopTEX \ +stopTEXpage stopTH stopTN stopTR stopTRs \ +stopTX stopTY stopXML stopalign stopalignment \ +stopallmodes stopappendices stoparrangedpages stopasciimode stopaside \ +stopattachment stopbackground stopbackmatter stopbar stopbbordermatrix \ +stopbitmapimage stopblockquote stopbodymatter stopbordermatrix stopboxedcolumns \ +stopbtxlabeltext stopbtxrenderingdefinitions stopbuffer stopcases stopcatcodetable \ +stopcenteraligned stopchapter stopcharacteralign stopcheckedfences stopchemical \ +stopchemicaltext stopcollect stopcollecting stopcolor stopcolorintent \ +stopcoloronly stopcolorset stopcolumns stopcolumnset stopcolumnsetspan \ +stopcombination stopcomment stopcomponent stopcontextcode stopcontextdefinitioncode \ +stopctxfunction stopctxfunctiondefinition stopcurrentcolor stopcurrentlistentrywrapper stopdelimited \ +stopdelimitedtext stopdisplaymath stopdmath stopdocument stopeffect \ +stopelement stopembeddedxtable stopendnote stopendofline stopenvironment \ +stopexceptions stopexpanded stopexpandedcollect stopextendedcatcodetable stopexternalfigurecollection \ +stopfacingfloat stopfact stopfigure stopfiguretext stopfittingpage \ +stopfixed stopfloatcombination stopfont stopfontclass stopfontsolution \ +stopfootnote stopformula stopformulas stopframed stopframedcell \ +stopframedcontent stopframedrow stopframedtable stopframedtext stopfrontmatter \ +stopgoto stopgraphictext stopgridsnapping stophanging stophbox \ +stophboxestohbox stophboxregister stophead stopheadtext stophelptext \ +stophiding stophighlight stophyphenation stopimath stopindentation \ +stopindentedtext stopinteraction stopinteractionmenu stopinterface stopintermezzotext \ +stopintertext stopitem stopitemgroup stopitemgroupcolumns stopitemize \ +stopknockout stoplabeltext stoplanguage stoplayout stopleftaligned \ +stoplegend stopline stoplinealignment stoplinecorrection stoplinefiller \ +stoplinenote stoplinenumbering stoplines stoplinetable stoplinetablebody \ +stoplinetablecell stoplinetablehead stoplocalfootnotes stoplocalheadsetup stoplocallinecorrection \ +stoplocalnotes stoplocalsetups stoplua stopluacode stopluaparameterset \ +stopluasetups stopmakeup stopmarginblock stopmarginrule stopmarkedcontent \ +stopmarkpages stopmathalignment stopmathcases stopmathlabeltext stopmathmatrix \ +stopmathmode stopmathstyle stopmatrices stopmatrix stopmaxaligned \ +stopmdformula stopmidaligned stopmiddlealigned stopmiddlemakeup stopmixedcolumns \ +stopmode stopmodeset stopmodule stopmoduletestsection stopmpformula \ +stopmulticolumns stopnamedsection stopnamedsubformulas stopnarrow stopnarrower \ +stopnegative stopnicelyfilledbox stopnointerference stopnotallmodes stopnotext \ +stopnotmode stopoperatortext stopopposite stopoutputstream stopoverlay \ +stopoverprint stoppacked stoppagecolumns stoppagecomment stoppagefigure \ +stoppagelayout stoppagemakeup stoppar stopparagraph stopparagraphs \ +stopparagraphscell stopparbuilder stoppart stoppath stopplacechemical \ +stopplacefigure stopplacefloat stopplaceformula stopplacegraphic stopplaceintermezzo \ +stopplacelegend stopplacepairedbox stopplacetable stoppositioning stoppositionoverlay \ +stoppositive stoppostponing stoppostponingnotes stopprefixtext stopprocessassignmentcommand \ +stopprocessassignmentlist stopprocesscommacommand stopprocesscommalist stopproduct stopproject \ +stopprotect stopprotectedcolors stoppublication stoppunctuation stopquotation \ +stopquote stoprandomized stoprandomseed stoprawsetups stopreadingfile \ +stopreferenceprefix stopregime stopreusableMPgraphic stoprightaligned stopruby \ +stopscript stopsdformula stopsection stopsectionblock stopsectionblockenvironment \ +stopsectionlevel stopsetups stopshapebox stopshift stopsidebar \ +stopsimplecolumns stopspecialitem stopspeech stopspformula stopsplitformula \ +stopsplittext stopspread stopstandardmakeup stopstaticMPfigure stopstaticMPgraphic \ +stopstrictinspectnextcharacter stopstrut stopstyle stopsubformulas stopsubject \ +stopsubjectlevel stopsubsection stopsubsentence stopsubstack stopsubsubject \ +stopsubsubsection stopsubsubsubject stopsubsubsubsection stopsubsubsubsubject stopsubsubsubsubsection \ +stopsubsubsubsubsubject stopsuffixtext stopsymbolset stoptable stoptablehead \ +stoptables stoptabletail stoptabletext stoptabulate stoptabulatehead \ +stoptabulatetail stoptagged stoptaglabeltext stoptexcode stoptexdefinition \ +stoptext stoptextbackground stoptextbackgroundmanual stoptextcolor stoptextcolorintent \ +stoptextflow stoptextmakeup stoptextrule stopthematrix stoptitle \ +stoptokenlist stoptokens stoptransparent stoptypescript stoptypescriptcollection \ +stoptyping stopuniqueMPgraphic stopuniqueMPpagegraphic stopunittext stopunpacked \ +stopusableMPgraphic stopuseMPgraphic stopusemathstyleparameter stopuserdata stopusingbtxspecification \ +stopvbox stopvboxregister stopvboxtohbox stopvboxtohboxseparator stopviewerlayer \ +stopvtop stopvtopregister stopxcell stopxcellgroup stopxcolumn \ +stopxgroup stopxmldisplayverbatim stopxmlinlineverbatim stopxmlraw stopxmlsetups \ +stopxrow stopxrowgroup stopxtable stopxtablebody stopxtablefoot \ +stopxtablehead stopxtablenext stretched strictdoifelsenextoptional strictdoifnextoptionalelse \ +stripcharacter strippedcsname stripspaces structurelistuservariable structurenumber \ +structuretitle structureuservariable structurevariable strut strutdp \ +strutgap strutht struthtdp struttedbox strutwd \ +style styleinstance subject subpagenumber subsection \ +subsentence subset subseteq subseteqq subsetneq \ +subsetneqq substituteincommalist subsubject subsubsection subsubsubject \ +subsubsubsection subsubsubsubject subsubsubsubsection subsubsubsubsubject subtractfeature \ +succ succapprox succcurlyeq succeq succeqq \ +succnapprox succneq succneqq succnsim succsim \ +suffixlanguage suffixtext sum supset supseteq \ +supseteqq supsetneq supsetneqq surd surdradical \ +swapcounts swapdimens swapface swapmacros swaptypeface \ +swarrow switchstyleonly switchtobodyfont switchtocolor switchtointerlinespace \ +symbol symbolreference synchronizeblank synchronizeindenting synchronizemarking \ +synchronizeoutputstreams synchronizestrut synchronizewhitespace synctexblockfilename synctexresetfilename \ +synctexsetfilename systemlog systemlogfirst systemloglast systemsetups \ +tLeftarrow tLeftrightarrow tRightarrow tabulateautoline tabulateautorule \ +tabulateline tabulaterule taggedctxcommand taggedlabeltexts taglabellanguage \ +taglabeltext tau tbinom tbox tcaron \ +tcedilla tcommaaccent tcurl tendsto tequal \ +test testandsplitstring testcolumn testfeature testfeatureonce \ +testpage testpageonly testpagesync testtokens tex \ +texdefinition texsetup textAngstrom textacute textampersand \ +textasciicircum textasciitilde textat textbackslash textbar \ +textbottomcomma textbottomdot textbraceleft textbraceright textbreve \ +textbrokenbar textbullet textcaron textcedilla textcelsius \ +textcent textcircledP textcircumflex textcitation textcite \ +textcomma textcontrolspace textcurrency textdag textddag \ +textdegree textdiaeresis textdiv textdollar textdong \ +textdotaccent textellipsis texteuro textflowcollector textfraction \ +textgrave texthash texthorizontalbar texthungarumlaut texthyphen \ +textkelvin textlognot textmacron textmath textmho \ +textminus textmp textmu textmultiply textnumero \ +textogonek textohm textormathchar textormathchars textounce \ +textpercent textperiod textplus textpm textreference \ +textring textrule textslash textsterling texttilde \ +textunderscore textvisiblespace textyen thai thainumerals \ +thedatavalue thefirstcharacter thematrix thenormalizedbodyfontsize theorientation \ +therefore theremainingcharacters theta thickspace thinrule \ +thinrules thinspace thirdderivativesymbol thirdoffivearguments thirdoffourarguments \ +thirdofsixarguments thirdofthreearguments thirdofthreeunexpanded thook thookleftarrow \ +thookrightarrow thorn threedigitrounding threeeighths threefifths \ +threeperemspace threequarter threesuperior tibetannumerals tightlayer \ +tilde times tinyfont title tlap \ +tleftarrow tleftharpoondown tleftharpoonup tleftrightarrow tleftrightharpoons \ +tmapsto to tochar tolinenote tooltip \ +top topbox topleftbox toplinebox toprightbox \ +topskippedbox tracecatcodetables tracedfontname tracedpagestate traceoutputroutines \ +tracepositions trademark translate transparencycomponents transparent \ +transposesymbol trel triangle triangledown triangleleft \ +triangleq triangleright trightarrow trightharpoondown trightharpoonup \ +trightleftharpoons trightoverleftarrow triplebond tripleprime tripleverticalbar \ +truefilename truefontname tstroke ttraggedright ttriplerel \ +ttwoheadleftarrow ttwoheadrightarrow turnediota twodigitrounding twofifths \ +twoheaddownarrow twoheadleftarrow twoheadrightarrow twoheadrightarrowtail twoheaduparrow \ +twosuperior twothirds tx txx typ \ +type typebuffer typedefinedbuffer typeface typefile \ +typeinlinebuffer typescriptone typescriptprefix typescriptthree typescripttwo \ +typesetbuffer typesetbufferonly typesetfile uacute ubreve \ +ucaron uchexnumber uchexnumbers ucircumflex uconvertnumber \ +udiaeresis udiaeresisacute udiaeresiscaron udiaeresisgrave udiaeresismacron \ +udotbelow udots udoublegrave uedcatcodecommand ugrave \ +uhook uhorn uhornacute uhorndotbelow uhorngrave \ +uhornhook uhorntilde uhungarumlaut uinvertedbreve ulcorner \ +umacron undefinevalue undepthed underbar underbars \ +underbartext underbrace underbracetext underbracket underbrackettext \ +underdash underdashes underdot underdots underleftarrow \ +underleftharpoondown underleftharpoonup underleftrightarrow underparent underparenttext \ +underrandom underrandoms underrightarrow underrightharpoondown underrightharpoonup \ +underset understrike understrikes undertwoheadleftarrow undertwoheadrightarrow \ +undoassign unexpandeddocumentvariable unframed unhhbox unihex \ +uniqueMPgraphic uniqueMPpagegraphic unit unitlanguage unitshigh \ +unitslow unittext unknown unprotected unregisterhyphenationpattern \ +unregisterparwrapper unspaceafter unspaceargument unspaced unspacestring \ +unstackscripts untexargument untexcommand uogonek upand \ +uparrow updasharrow updateparagraphdemerits updateparagraphpenalties updateparagraphproperties \ +updateparagraphshapes updownarrow updownarrowbar updownarrows upharpoonleft \ +upharpoonright uplus uppercased uppercasestring uppercasing \ +upperleftdoubleninequote upperleftdoublesixquote upperleftsingleninequote upperleftsinglesixquote upperrightdoubleninequote \ +upperrightdoublesixquote upperrightsingleninequote upperrightsinglesixquote upsilon upuparrows \ +upwhitearrow urcorner uring url useJSscripts \ +useMPenvironmentbuffer useMPgraphic useMPlibrary useMPrun useMPvariables \ +useURL usealignparameter useblankparameter useblocks usebodyfont \ +usebodyfontparameter usebtxdataset usebtxdefinitions usecitation usecolors \ +usecomponent usedirectory usedummycolorparameter usedummystyleandcolor usedummystyleparameter \ +useenvironment useexternaldocument useexternalfigure useexternalrendering useexternalsoundtrack \ +usefigurebase usefile usefontpath usegridparameter usehyphensparameter \ +useindentingparameter useindentnextparameter useinterlinespaceparameter uselanguageparameter useluamodule \ +useluatable usemathstyleparameter usemodule useproduct useprofileparameter \ +useproject usereferenceparameter userpagenumber usesetupsparameter usestaticMPfigure \ +usesubpath usesymbols usetexmodule usetypescript usetypescriptfile \ +useurl usezipfile utfchar utflower utfupper \ +utilde utilityregisterlength vDash validassignment varTheta \ +varepsilon varkappa varnothing varphi varpi \ +varrho varsigma vartheta vboxreference vdash \ +vdots vec vee veebar veeeq \ +verbatim verbatimstring verbosenumber version vert \ +verticalgrowingbar verticalpositionbar veryraggedcenter veryraggedleft veryraggedright \ +vglue viewerlayer vl vpackbox vpackedbox \ +vphantom vpos vsmash vsmashbox vsmashed \ +vspace vspacing wcircumflex wdofstring wedge \ +wedgeeq weekday whitearrowupfrombar wideacute widebar \ +widebreve widecheck wideddot widedot widegrave \ +widehat widering widetilde widthofstring widthspanningtext \ +withoutpt word wordright words wordtonumber \ +wp wr writebetweenlist writedatatolist writestatus \ +writetolist xLeftarrow xLeftrightarrow xRightarrow xdefconvertedargument \ +xequal xfrac xhookleftarrow xhookrightarrow xi \ +xleftarrow xleftharpoondown xleftharpoonup xleftrightarrow xleftrightharpoons \ +xmapsto xmladdindex xmlafterdocumentsetup xmlaftersetup xmlall \ +xmlappenddocumentsetup xmlappendsetup xmlapplyselectors xmlatt xmlattdef \ +xmlattribute xmlattributedef xmlbadinclusions xmlbeforedocumentsetup xmlbeforesetup \ +xmlchainatt xmlchainattdef xmlchecknamespace xmlcommand xmlconcat \ +xmlconcatrange xmlcontext xmlcount xmldefaulttotext xmldepth \ +xmldirectives xmldirectivesafter xmldirectivesbefore xmldisplayverbatim xmldoif \ +xmldoifatt xmldoifelse xmldoifelseatt xmldoifelseempty xmldoifelseselfempty \ +xmldoifelsetext xmldoifelsevalue xmldoifnot xmldoifnotatt xmldoifnotselfempty \ +xmldoifnottext xmldoifselfempty xmldoiftext xmlelement xmlfilter \ +xmlfirst xmlflush xmlflushcontext xmlflushdocumentsetups xmlflushlinewise \ +xmlflushpure xmlflushspacewise xmlflushtext xmlinclude xmlinclusion \ +xmlinclusions xmlinfo xmlinjector xmlinlineprettyprint xmlinlineprettyprinttext \ +xmlinlineverbatim xmlinstalldirective xmllast xmllastatt xmllastmatch \ +xmllastpar xmlloadbuffer xmlloaddata xmlloaddirectives xmlloadfile \ +xmlloadonly xmlmain xmlmapvalue xmlname xmlnamespace \ +xmlnonspace xmlpar xmlparam xmlpath xmlpos \ +xmlposition xmlprependdocumentsetup xmlprependsetup xmlprettyprint xmlprettyprinttext \ +xmlprocessbuffer xmlprocessdata xmlprocessfile xmlpure xmlraw \ +xmlrefatt xmlregistereddocumentsetups xmlregisteredsetups xmlregisterns xmlremapname \ +xmlremapnamespace xmlremovedocumentsetup xmlremovesetup xmlresetdocumentsetups xmlresetinjectors \ +xmlresetsetups xmlsave xmlsetatt xmlsetattribute xmlsetentity \ +xmlsetfunction xmlsetinjectors xmlsetpar xmlsetparam xmlsetsetup \ +xmlsetup xmlshow xmlsnippet xmlstrip xmlstripnolines \ +xmlstripped xmlstrippednolines xmltag xmltexentity xmltext \ +xmltobuffer xmltobufferverbose xmltofile xmlvalue xmlverbatim \ +xrel xrightarrow xrightharpoondown xrightharpoonup xrightleftharpoons \ +xrightoverleftarrow xsplitstring xtriplerel xtwoheadleftarrow xtwoheadrightarrow \ +xxfrac xypos yacute ycircumflex ydiaeresis \ +ydotbelow yen ygrave yhook yiddishnumerals \ +ymacron ytilde zacute zcaron zdotaccent \ +zeronumberconversion zerowidthnobreakspace zerowidthspace zeta zhook \ +zstroke zwj zwnj keywordclass.context.en=\ diff --git a/Master/texmf-dist/context/data/scite/context/scite-context-data-metafun.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-metafun.properties index abb45d25c43..cfc13fadca7 100644 --- a/Master/texmf-dist/context/data/scite/context/scite-context-data-metafun.properties +++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-metafun.properties @@ -92,7 +92,8 @@ newpair mpvard mpvarn mpvars mpvar \ withtolerance hatched withdashes processpath pencilled \ sortedintersectiontimes intersectionpath firstintersectionpath secondintersectionpath intersectionsfound \ cutbeforefirst cutafterfirst cutbeforelast cutafterlast xnormalized \ -ynormalized xynormalized phantom scrutinized +ynormalized xynormalized phantom scrutinized xshifted \ +yshifted keywordclass.metafun.internals=\ nocolormodel greycolormodel graycolormodel rgbcolormodel \ @@ -111,5 +112,5 @@ setrecord getrecord cntrecord anchorxy anchorx \ anchory anchorht anchordp anchorul anchorll \ anchorlr anchorur localanchorbox localanchorcell localanchorspan \ anchorbox anchorcell anchorspan matrixbox matrixcell \ -matrixspan pensilcolor pensilstep +matrixspan pensilcolor pensilstep uu diff --git a/Master/texmf-dist/context/data/scite/context/scite-context-data-metapost.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-metapost.properties index badf738287e..d7dfaccc14f 100644 --- a/Master/texmf-dist/context/data/scite/context/scite-context-data-metapost.properties +++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-metapost.properties @@ -70,69 +70,61 @@ titlefont totalweight tracingedges tracingpens turningcheck \ unitpixel vppp vround xoffset yoffset keywordclass.metapost.primitives=\ -charcode day linecap linejoin \ -miterlimit stacking month pausing prologues \ -showstopping time tracingcapsules tracingchoices mpprocset \ -tracingcommands tracingequations tracinglostchars tracingmacros tracingonline \ -tracingoutput tracingrestores tracingspecs tracingstats tracingtitles \ -truecorners warningcheck year false nullpicture \ -pencircle penspec true and angle \ -arclength arctime ASCII boolean bot \ -char color cosd cycle decimal \ -directiontime floor fontsize hex infont \ -intersectiontimes known void length llcorner \ -lrcorner makepath makepen mexp mlog \ -normaldeviate not numeric oct odd \ -or path pair pen penoffset \ -picture point postcontrol precontrol reverse \ -rotated scaled shifted sind slanted \ -sqrt str string subpath substring \ -transform transformed ulcorner uniformdeviate unknown \ -urcorner xpart xscaled xxpart xypart \ -ypart yscaled yxpart yypart zscaled \ -addto clip input interim let \ -newinternal save setbounds setgroup shipout \ -show showdependencies showtoken showvariable special \ -begingroup endgroup of curl tension \ -and controls def vardef enddef \ -expr suffix text primary secondary \ -tertiary primarydef secondarydef tertiarydef randomseed \ -also contour doublepath withcolor withcmykcolor \ -withpen withstacking dashed envelope if \ -else elseif fi for endfor \ -forever exitif within forsuffixes step \ -until charlist extensible fontdimen headerbyte \ -kern ligtable boundarychar chardp charext \ -charht charic charwd designsize fontmaking \ -charexists cullit currenttransform gfcorners grayfont \ -hround imagerules lowres_fix nodisplays notransforms \ -openit displaying currentwindow screen_rows screen_cols \ -pixels_per_inch cull display openwindow numspecial \ -totalweight autorounding fillin proofing tracingpens \ -xoffset chardx granularity smoothing turningcheck \ -yoffset chardy hppp tracingedges vppp \ -extra_beginfig extra_endfig mpxbreak endinput message \ -delimiters turningnumber errmessage scantokens end \ -outer inner write to readfrom \ -closefrom withprescript withpostscript redpart greenpart \ -bluepart cyanpart magentapart yellowpart blackpart \ -prescriptpart postscriptpart rgbcolor cmykcolor colormodel \ -graypart greypart greycolor graycolor dashpart \ -penpart stackingpart stroked filled textual \ -clipped bounded pathpart expandafter minute \ -hour outputformat outputtemplate filenametemplate fontmapfile \ -fontmapline fontpart fontsize glyph restoreclipcolor \ -troffmode runscript maketext numbersystem overloadmode \ -setproperty intersectiontimeslist arcpoint arcpointlist subarclength \ -maxknotpool nocycle pathpoint pathprecontrol pathpostcontrol \ -pathdirection deltapoint deltaprecontrol deltapostcontrol deltadirection \ -corner xrange yrange convexed uncontrolled \ -nep makenep withmiterlimit withlinejoin withlinecap \ -centerof centerofmass +tracingtitles tracingequations tracingcapsules tracingchoices \ +tracingspecs tracingcommands tracingrestores tracingmacros tracingoutput \ +tracingstats tracingonline year month day \ +time hour minute charcode charwd \ +charht chardp charic pausing showstopping \ +texscriptmode overloadmode linejoin linecap stacking \ +miterlimit warningcheck truecorners defaultcolormodel restoreclipcolor \ +numbersystem numberprecision jobname addto atleast \ +begingroup controls curl delimiters endgroup \ +everyjob exitif expandafter interim let \ +newinternal of randomseed maxknotpool save \ +scantokens runscript maketext shipout step \ +str void tension to until \ +within write btex verbatimtex etex \ +def vardef primarydef secondarydef tertiarydef \ +enddef for forsuffixes forever endfor \ +quote expr suffix text primary \ +secondary tertiary input endinput if \ +fi else elseif true false \ +nullpicture nullpen readstring pencircle normaldeviate \ +readfrom closefrom odd known unknown \ +not decimal reverse uncycle makepath \ +makepen makenep convexed uncontrolled oct \ +hex ASCII char length turningnumber \ +xpart ypart xxpart xypart yxpart \ +yypart redpart greenpart bluepart cyanpart \ +magentapart yellowpart blackpart greypart colormodel \ +prescriptpart postscriptpart stackingpart pathpart penpart \ +dashpart sqrt mexp mlog sind \ +cosd floor uniformdeviate llcorner lrcorner \ +ulcorner urcorner centerof centerofmass corners \ +xrange yrange deltapoint deltaprecontrol deltapostcontrol \ +deltadirection arclength angle cycle nocycle \ +stroked filled clipped grouped bounded \ +or and substring subpath directiontime \ +point precontrol postcontrol direction pathpoint \ +pathprecontrol pathpostcontrol pathdirection penoffset arctime \ +arcpoint arcpointlist subarclength mpversion rotated \ +slanted scaled shifted transformed xscaled \ +yscaled zscaled intersectiontimes intersectiontimeslist envelope \ +boundingpath numeric string boolean path \ +pen nep picture transform color \ +rgbcolor cmykcolor pair end dump \ +batchmode nonstopmode scrollmode errorstopmode silentmode \ +inner outer setproperty showtoken showstats \ +show showvariable showdependencies doublepath contour \ +also withpen dashed withprescript withpostscript \ +withstacking withlinecap withlinejoin withmiterlimit withoutcolor \ +withgreyscale withcolor withrgbcolor withcmykcolor clip \ +setgroup setbounds message errmessage errhelp \ +graypart keywordclass.metapost.shortcuts=\ .. ... -- --- \ -& && \ +& && &&& &&&& \ keywordclass.metapost.tex=\ btex etex verbatimtex diff --git a/Master/texmf-dist/context/data/scite/context/scite-context-data-tex.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-tex.properties index c1d632957ac..7ea01a7854f 100644 --- a/Master/texmf-dist/context/data/scite/context/scite-context-data-tex.properties +++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-tex.properties @@ -3,146 +3,168 @@ Alephminorversion Alephrevision Alephversion keywordclass.tex.etex=\ botmarks clubpenalties currentgrouplevel currentgrouptype \ -currentifbranch currentiflevel currentiftype detokenize dimexpr \ -displaywidowpenalties everyeof firstmarks fontchardp fontcharht \ -fontcharic fontcharwd glueexpr glueshrink glueshrinkorder \ -gluestretch gluestretchorder gluetomu ifcsname ifdefined \ -iffontchar interactionmode interlinepenalties lastlinefit lastnodetype \ -marks muexpr mutoglue numexpr pagediscards \ -parshapedimen parshapeindent parshapelength predisplaydirection protected \ -savinghyphcodes savingvdiscards scantokens showgroups showifs \ -showtokens splitbotmarks splitdiscards splitfirstmarks topmarks \ -tracingassigns tracinggroups tracingifs tracingnesting unexpanded \ -unless widowpenalties +currentifbranch currentiflevel currentiftype currentstacksize detokenize \ +dimexpr displaywidowpenalties everyeof firstmarks fontchardp \ +fontcharht fontcharic fontcharwd glueexpr glueshrink \ +glueshrinkorder gluestretch gluestretchorder gluetomu ifcsname \ +ifdefined iffontchar interactionmode interlinepenalties lastlinefit \ +lastnodetype marks muexpr mutoglue numexpr \ +pagediscards parshapedimen parshapeindent parshapelength predisplaydirection \ +protected savinghyphcodes savingvdiscards scantokens showgroups \ +showifs showtokens splitbotmarks splitdiscards splitfirstmarks \ +topmarks tracingassigns tracinggroups tracingifs tracingnesting \ +unexpanded unless widowpenalties keywordclass.tex.luatex=\ Uabove Uabovewithdelims Uatop Uatopwithdelims \ -Uchar Udelcode Udelimited Udelimiter Udelimiterover \ -Udelimiterunder Uhextensible Uleft Umathaccent Umathaccentbasedepth \ -Umathaccentbaseheight Umathaccentbottomovershoot Umathaccentbottomshiftdown Umathaccentextendmargin Umathaccentsuperscriptdrop \ -Umathaccentsuperscriptpercent Umathaccenttopovershoot Umathaccenttopshiftup Umathaccentvariant Umathadapttoleft \ -Umathadapttoright Umathaxis Umathbottomaccentvariant Umathchar Umathcharclass \ -Umathchardef Umathcharfam Umathcharslot Umathclass Umathcode \ +Udelcode Udelimited Udelimiter Udelimiterover Udelimiterunder \ +Uhextensible Uleft Umathaccent Umathaccentbasedepth Umathaccentbaseheight \ +Umathaccentbottomovershoot Umathaccentbottomshiftdown Umathaccentextendmargin Umathaccentsuperscriptdrop Umathaccentsuperscriptpercent \ +Umathaccenttopovershoot Umathaccenttopshiftup Umathaccentvariant Umathadapttoleft Umathadapttoright \ +Umathaxis Umathbottomaccentvariant Umathchar Umathchardef Umathcode \ Umathconnectoroverlapmin Umathdegreevariant Umathdelimiterextendmargin Umathdelimiterovervariant Umathdelimiterpercent \ -Umathdelimitershortfall Umathdelimiterundervariant Umathdenominatorvariant Umathdict Umathdictdef \ -Umathdiscretionary Umathextrasubpreshift Umathextrasubprespace Umathextrasubshift Umathextrasubspace \ -Umathextrasuppreshift Umathextrasupprespace Umathextrasupshift Umathextrasupspace Umathflattenedaccentbasedepth \ -Umathflattenedaccentbaseheight Umathflattenedaccentbottomshiftdown Umathflattenedaccenttopshiftup Umathfractiondelsize Umathfractiondenomdown \ -Umathfractiondenomvgap Umathfractionnumup Umathfractionnumvgap Umathfractionrule Umathfractionvariant \ -Umathhextensiblevariant Umathlimitabovebgap Umathlimitabovekern Umathlimitabovevgap Umathlimitbelowbgap \ -Umathlimitbelowkern Umathlimitbelowvgap Umathlimits Umathnoaxis Umathnolimits \ -Umathnolimitsubfactor Umathnolimitsupfactor Umathnumeratorvariant Umathopenupdepth Umathopenupheight \ -Umathoperatorsize Umathoverbarkern Umathoverbarrule Umathoverbarvgap Umathoverdelimiterbgap \ -Umathoverdelimitervariant Umathoverdelimitervgap Umathoverlayaccentvariant Umathoverlinevariant Umathphantom \ -Umathpresubshiftdistance Umathpresupshiftdistance Umathprimeraise Umathprimeraisecomposed Umathprimeshiftdrop \ -Umathprimeshiftup Umathprimespaceafter Umathprimevariant Umathprimewidth Umathquad \ -Umathradicaldegreeafter Umathradicaldegreebefore Umathradicaldegreeraise Umathradicalextensibleafter Umathradicalextensiblebefore \ -Umathradicalkern Umathradicalrule Umathradicalvariant Umathradicalvgap Umathruledepth \ -Umathruleheight Umathskeweddelimitertolerance Umathskewedfractionhgap Umathskewedfractionvgap Umathsource \ -Umathspaceafterscript Umathspacebeforescript Umathstackdenomdown Umathstacknumup Umathstackvariant \ -Umathstackvgap Umathsubscriptvariant Umathsubshiftdistance Umathsubshiftdown Umathsubshiftdrop \ -Umathsubsupshiftdown Umathsubsupvgap Umathsubtopmax Umathsupbottommin Umathsuperscriptvariant \ -Umathsupshiftdistance Umathsupshiftdrop Umathsupshiftup Umathsupsubbottommax Umathtopaccentvariant \ -Umathunderbarkern Umathunderbarrule Umathunderbarvgap Umathunderdelimiterbgap Umathunderdelimitervariant \ -Umathunderdelimitervgap Umathunderlinevariant Umathuseaxis Umathvextensiblevariant Umathvoid \ -Umathxscale Umathyscale Umiddle Unosubprescript Unosubscript \ -Unosuperprescript Unosuperscript Uoperator Uover Uoverdelimiter \ -Uoverwithdelims Uprimescript Uradical Uright Uroot \ -Urooted Ushiftedsubprescript Ushiftedsubscript Ushiftedsuperprescript Ushiftedsuperscript \ -Uskewed Uskewedwithdelims Ustack Ustartdisplaymath Ustartmath \ -Ustartmathmode Ustopdisplaymath Ustopmath Ustopmathmode Ustretched \ -Ustretchedwithdelims Ustyle Usubprescript Usubscript Usuperprescript \ -Usuperscript Uunderdelimiter Uvextensible adjustspacing adjustspacingshrink \ -adjustspacingstep adjustspacingstretch afterassigned aftergrouped aliased \ -aligncontent alignmark alignmentcellsource alignmentwrapsource aligntab \ -allcrampedstyles alldisplaystyles allmainstyles allmathstyles allscriptscriptstyles \ -allscriptstyles allsplitstyles alltextstyles alluncrampedstyles allunsplitstyles \ -amcode atendofgroup atendofgrouped attribute attributedef \ -automaticdiscretionary automatichyphenpenalty automigrationmode autoparagraphmode begincsname \ -beginlocalcontrol beginmathgroup beginsimplegroup boundary boxadapt \ -boxanchor boxanchors boxattribute boxdirection boxfreeze \ -boxgeometry boxorientation boxrepack boxshift boxsource \ -boxtarget boxtotal boxvadjust boxxmove boxxoffset \ -boxymove boxyoffset catcodetable cdef cdefcsname \ -cfcode clearmarks constant copymathatomrule copymathparent \ -copymathspacing crampeddisplaystyle crampedscriptscriptstyle crampedscriptstyle crampedtextstyle \ -csactive csstring currentloopiterator currentloopnesting currentmarks \ -dbox defcsname deferred detokenized dimensiondef \ -dimexpression directlua dpack dsplit edefcsname \ -efcode endlocalcontrol endmathgroup endsimplegroup enforced \ -etoks etoksapp etokspre eufactor everybeforepar \ -everymathatom everytab exceptionpenalty expand expandactive \ -expandafterpars expandafterspaces expandcstoken expanded expandedafter \ -expandedloop expandtoken explicitdiscretionary explicithyphenpenalty firstvalidlanguage \ +Umathdelimitershortfall Umathdelimiterundervariant Umathdenominatorvariant Umathdictdef Umathexheight \ +Umathextrasubpreshift Umathextrasubprespace Umathextrasubshift Umathextrasubspace Umathextrasuppreshift \ +Umathextrasupprespace Umathextrasupshift Umathextrasupspace Umathflattenedaccentbasedepth Umathflattenedaccentbaseheight \ +Umathflattenedaccentbottomshiftdown Umathflattenedaccenttopshiftup Umathfractiondelsize Umathfractiondenomdown Umathfractiondenomvgap \ +Umathfractionnumup Umathfractionnumvgap Umathfractionrule Umathfractionvariant Umathhextensiblevariant \ +Umathlimitabovebgap Umathlimitabovekern Umathlimitabovevgap Umathlimitbelowbgap Umathlimitbelowkern \ +Umathlimitbelowvgap Umathlimits Umathnoaxis Umathnolimits Umathnolimitsubfactor \ +Umathnolimitsupfactor Umathnumeratorvariant Umathopenupdepth Umathopenupheight Umathoperatorsize \ +Umathoverbarkern Umathoverbarrule Umathoverbarvgap Umathoverdelimiterbgap Umathoverdelimitervariant \ +Umathoverdelimitervgap Umathoverlayaccentvariant Umathoverlinevariant Umathphantom Umathpresubshiftdistance \ +Umathpresupshiftdistance Umathprimeraise Umathprimeraisecomposed Umathprimeshiftdrop Umathprimeshiftup \ +Umathprimespaceafter Umathprimevariant Umathprimewidth Umathquad Umathradicaldegreeafter \ +Umathradicaldegreebefore Umathradicaldegreeraise Umathradicalextensibleafter Umathradicalextensiblebefore Umathradicalkern \ +Umathradicalrule Umathradicalvariant Umathradicalvgap Umathruledepth Umathruleheight \ +Umathskeweddelimitertolerance Umathskewedfractionhgap Umathskewedfractionvgap Umathsource Umathspaceafterscript \ +Umathspacebeforescript Umathspacebetweenscript Umathstackdenomdown Umathstacknumup Umathstackvariant \ +Umathstackvgap Umathsubscriptsnap Umathsubscriptvariant Umathsubshiftdistance Umathsubshiftdown \ +Umathsubshiftdrop Umathsubsupshiftdown Umathsubsupvgap Umathsubtopmax Umathsupbottommin \ +Umathsuperscriptsnap Umathsuperscriptvariant Umathsupshiftdistance Umathsupshiftdrop Umathsupshiftup \ +Umathsupsubbottommax Umathtopaccentvariant Umathunderbarkern Umathunderbarrule Umathunderbarvgap \ +Umathunderdelimiterbgap Umathunderdelimitervariant Umathunderdelimitervgap Umathunderlinevariant Umathuseaxis \ +Umathvextensiblevariant Umathvoid Umathxscale Umathyscale Umiddle \ +Uoperator Uover Uoverdelimiter Uoverwithdelims Uradical \ +Uright Uroot Urooted Uskewed Uskewedwithdelims \ +Ustartdisplaymath Ustartmath Ustartmathmode Ustopdisplaymath Ustopmath \ +Ustopmathmode Ustretched Ustretchedwithdelims Uunderdelimiter Uvextensible \ +additionalpageskip adjustspacing adjustspacingshrink adjustspacingstep adjustspacingstretch \ +advanceby afterassigned aftergrouped aliased aligncontent \ +alignmark alignmentcellsource alignmentwrapsource aligntab allcrampedstyles \ +alldisplaystyles allmainstyles allmathstyles allscriptscriptstyles allscriptstyles \ +allsplitstyles alltextstyles alluncrampedstyles allunsplitstyles amcode \ +associateunit atendoffile atendoffiled atendofgroup atendofgrouped \ +attribute attributedef automaticdiscretionary automatichyphenpenalty automigrationmode \ +autoparagraphmode begincsname beginlocalcontrol beginmathgroup beginsimplegroup \ +boundary boxadapt boxanchor boxanchors boxattribute \ +boxdirection boxfinalize boxfreeze boxgeometry boxlimit \ +boxlimitate boxlimitmode boxorientation boxrepack boxshift \ +boxshrink boxsource boxstretch boxtarget boxtotal \ +boxvadjust boxxmove boxxoffset boxymove boxyoffset \ +catcodetable cdef cdefcsname cfcode clearmarks \ +constant constrained copymathatomrule copymathparent copymathspacing \ +crampeddisplaystyle crampedscriptscriptstyle crampedscriptstyle crampedtextstyle csactive \ +csstring currentloopiterator currentloopnesting currentlysetmathstyle currentmarks \ +dbox defcsname deferred detokened detokenized \ +dimensiondef dimexpression directlua discretionaryoptions divideby \ +doubleadjdemerits dpack dsplit edefcsname edivide \ +edivideby efcode emergencyleftskip emergencyrightskip endlocalcontrol \ +endmathgroup endsimplegroup enforced etoks etoksapp \ +etokspre eufactor everybeforepar everymathatom everytab \ +exceptionpenalty expand expandactive expandafterpars expandafterspaces \ +expandcstoken expanded expandedafter expandeddetokenize expandedendless \ +expandedloop expandedrepeat expandparameter expandtoken expandtoks \ +explicitdiscretionary explicithyphenpenalty explicititaliccorrection explicitspace firstvalidlanguage \ float floatdef floatexpr flushmarks fontcharba \ fontcharta fontid fontmathcontrol fontspecdef fontspecid \ -fontspecifiedname fontspecifiedsize fontspecscale fontspecxscale fontspecyscale \ -fonttextcontrol formatname frozen futurecsname futuredef \ -futureexpand futureexpandis futureexpandisap gdefcsname gleaders \ +fontspecifiedname fontspecifiedsize fontspecscale fontspecslant fontspecweight \ +fontspecxscale fontspecyscale fonttextcontrol forcedleftcorrection forcedrightcorrection \ +formatname frozen futurecsname futuredef futureexpand \ +futureexpandis futureexpandisap gdefcsname givenmathstyle gleaders \ glet gletcsname glettonothing gluespecdef glyph \ glyphdatafield glyphoptions glyphscale glyphscriptfield glyphscriptscale \ -glyphscriptscriptscale glyphstatefield glyphtextscale glyphxoffset glyphxscale \ -glyphxscaled glyphyoffset glyphyscale glyphyscaled gtoksapp \ -gtokspre hccode hjcode hmcode holdingmigrations \ -hpack hyphenationmin hyphenationmode ifabsdim ifabsfloat \ -ifabsnum ifarguments ifboolean ifchkdim ifchkdimension \ -ifchknum ifchknumber ifcmpdim ifcmpnum ifcondition \ -ifcstok ifdimexpression ifdimval ifempty ifflags \ -iffloat ifhaschar ifhastok ifhastoks ifhasxtoks \ -ifincsname ifinsert ifmathparameter ifmathstyle ifnumexpression \ -ifnumval ifparameter ifparameters ifrelax iftok \ -ifzerodim ifzerofloat ifzeronum ignorearguments ignoredepthcriterium \ -ignorepars immediate immutable indexofcharacter indexofregister \ -inherited initcatcodetable insertbox insertcopy insertdepth \ -insertdistance insertheight insertheights insertlimit insertmaxdepth \ -insertmode insertmultiplier insertpenalty insertprogress insertstorage \ -insertstoring insertunbox insertuncopy insertwidth instance \ -integerdef lastarguments lastatomclass lastboundary lastchkdim \ -lastchknum lastleftclass lastloopiterator lastnamedcs lastnodesubtype \ -lastpageextra lastparcontext lastrightclass leftmarginkern letcharcode \ +glyphscriptscriptscale glyphslant glyphstatefield glyphtextscale glyphweight \ +glyphxoffset glyphxscale glyphxscaled glyphyoffset glyphyscale \ +glyphyscaled gtoksapp gtokspre hccode hjcode \ +hmcode holdingmigrations hpack hpenalty hyphenationmin \ +hyphenationmode ifabsdim ifabsfloat ifabsnum ifarguments \ +ifboolean ifchkdim ifchkdimension ifchknum ifchknumber \ +ifcmpdim ifcmpnum ifcondition ifcramped ifcstok \ +ifdimexpression ifdimval ifempty ifflags iffloat \ +ifhaschar ifhastok ifhastoks ifhasxtoks ifinalignment \ +ifincsname ifinsert ifintervaldim ifintervalfloat ifintervalnum \ +iflastnamedcs ifmathparameter ifmathstyle ifnumexpression ifnumval \ +ifparameter ifparameters ifrelax iftok ifzerodim \ +ifzerofloat ifzeronum ignorearguments ignoredepthcriterion ignorenestedupto \ +ignorepars ignorerest ignoreupto immediate immutable \ +indexofcharacter indexofregister inherited initcatcodetable initialpageskip \ +initialtopskip insertbox insertcopy insertdepth insertdistance \ +insertheight insertheights insertlimit insertmaxdepth insertmode \ +insertmultiplier insertpenalty insertprogress insertstorage insertstoring \ +insertunbox insertuncopy insertwidth instance integerdef \ +lastarguments lastatomclass lastboundary lastchkdimension lastchknumber \ +lastleftclass lastloopiterator lastnamedcs lastnodesubtype lastpageextra \ +lastparcontext lastpartrigger lastrightclass leftmarginkern letcharcode \ letcsname letfrozen letmathatomrule letmathparent letmathspacing \ -letprotected lettonothing linebreakcriterium linedirection localbrokenpenalty \ -localcontrol localcontrolled localcontrolledloop localinterlinepenalty localleftbox \ -localleftboxbox localmiddlebox localmiddleboxbox localrightbox localrightboxbox \ -lpcode luabytecode luabytecodecall luacopyinputnodes luadef \ -luaescapestring luafunction luafunctioncall luatexbanner luatexrevision \ -luatexversion mathaccent mathatom mathatomglue mathatomskip \ -mathbackwardpenalties mathbeginclass mathbinary mathcheckfencesmode mathclose \ -mathdictgroup mathdictproperties mathdirection mathdisplaymode mathdisplayskipmode \ -mathdoublescriptmode mathendclass matheqnogapstep mathfenced mathfontcontrol \ -mathforwardpenalties mathfraction mathghost mathgluemode mathgroupingmode \ -mathinner mathleftclass mathlimitsmode mathmainstyle mathmiddle \ -mathnolimitsmode mathopen mathoperator mathordinary mathoverline \ -mathpenaltiesmode mathpunctuation mathradical mathrelation mathrightclass \ -mathrulesfam mathrulesmode mathscale mathscriptsmode mathslackmode \ -mathspacingmode mathstackstyle mathstyle mathstylefontid mathsurroundmode \ -mathsurroundskip maththreshold mathunderline meaningasis meaningful \ -meaningfull meaningles meaningless mugluespecdef mutable \ -noaligned noatomruling noboundary nohrule norelax \ -normalizelinemode normalizeparmode nospaces novrule numericscale \ -numexpression orelse orphanpenalties orphanpenalty orunless \ -outputbox overloaded overloadmode overshoot pageboundary \ -pageextragoal pagevsize parametercount parametermark parattribute \ -pardirection permanent pettymuskip positdef postexhyphenchar \ -posthyphenchar postinlinepenalty prebinoppenalty predisplaygapfactor preexhyphenchar \ -prehyphenchar preinlinepenalty prerelpenalty protrudechars protrusionboundary \ -pxdimen quitloop quitvmode resetmathspacing retokenized \ -rightmarginkern rpcode savecatcodetable scaledemwidth scaledexheight \ -scaledextraspace scaledfontdimen scaledinterwordshrink scaledinterwordspace scaledinterwordstretch \ -scaledmathstyle scaledslantperpoint scantextokens semiexpand semiexpanded \ -semiprotected setdefaultmathcodes setfontid setmathatomrule setmathdisplaypostpenalty \ -setmathdisplayprepenalty setmathignore setmathoptions setmathpostpenalty setmathprepenalty \ -setmathspacing shapingpenaltiesmode shapingpenalty snapshotpar srule \ -supmarkmode swapcsvalues tabsize textdirection thewithoutunit \ -tinymuskip todimension tohexadecimal tointeger tokenized \ +letprotected lettolastnamedcs lettonothing linebreakcriterion linebreakoptional \ +linebreakpasses linedirection localbrokenpenalty localcontrol localcontrolled \ +localcontrolledendless localcontrolledloop localcontrolledrepeat localinterlinepenalty localleftbox \ +localleftboxbox localmiddlebox localmiddleboxbox localpretolerance localrightbox \ +localrightboxbox localtolerance lpcode luabytecode luabytecodecall \ +luacopyinputnodes luadef luaescapestring luafunction luafunctioncall \ +luatexbanner luatexrevision luatexversion mathatom mathatomglue \ +mathatomskip mathbackwardpenalties mathbeginclass mathboundary mathcharclass \ +mathcharfam mathcharslot mathcheckfencesmode mathclass mathdictgroup \ +mathdictionary mathdictproperties mathdirection mathdiscretionary mathdisplaymode \ +mathdisplaypenaltyfactor mathdisplayskipmode mathdoublescriptmode mathendclass matheqnogapstep \ +mathfontcontrol mathforwardpenalties mathgluemode mathgroupingmode mathinlinepenaltyfactor \ +mathleftclass mathlimitsmode mathmainstyle mathnolimitsmode mathparentstyle \ +mathpenaltiesmode mathpretolerance mathrightclass mathrulesfam mathrulesmode \ +mathscale mathscriptsmode mathslackmode mathspacingmode mathstack \ +mathstackstyle mathstyle mathstylefontid mathsurroundmode mathsurroundskip \ +maththreshold mathtolerance meaningasis meaningful meaningfull \ +meaningles meaningless mugluespecdef multiplyby mutable \ +nestedloopiterator noaligned noatomruling noboundary nohrule \ +nomathchar norelax normalizelinemode normalizeparmode noscript \ +nospaces nosubprescript nosubscript nosuperprescript nosuperscript \ +novrule numericscale numericscaled numexpression optionalboundary \ +orelse orphanpenalties orphanpenalty orunless outputbox \ +overloaded overloadmode overshoot pageboundary pagedepth \ +pageexcess pageextragoal pagefistretch pagelastdepth pagelastfilllstretch \ +pagelastfillstretch pagelastfilstretch pagelastfistretch pagelastheight pagelastshrink \ +pagelaststretch pagevsize parametercount parameterdef parameterindex \ +parametermark parametermode parattribute pardirection parfillleftskip \ +parfillrightskip parinitleftskip parinitrightskip parpasses parshapewidth \ +permanent pettymuskip positdef postexhyphenchar posthyphenchar \ +postinlinepenalty postshortinlinepenalty prebinoppenalty predisplaygapfactor preexhyphenchar \ +prehyphenchar preinlinepenalty prerelpenalty preshortinlinepenalty previousloopiterator \ +primescript protecteddetokenize protectedexpandeddetokenize protrudechars protrusionboundary \ +pxdimen quitloop quitloopnow quitvmode rdivide \ +rdivideby realign resetmathspacing restorecatcodetable retained \ +retokenized rightmarginkern rpcode savecatcodetable scaledemwidth \ +scaledexheight scaledextraspace scaledfontcharba scaledfontchardp scaledfontcharht \ +scaledfontcharic scaledfontcharta scaledfontcharwd scaledfontdimen scaledinterwordshrink \ +scaledinterwordspace scaledinterwordstretch scaledmathaxis scaledmathemwidth scaledmathexheight \ +scaledmathstyle scaledslantperpoint scantextokens scriptspaceafterfactor scriptspacebeforefactor \ +scriptspacebetweenfactor semiexpand semiexpanded semiprotected setdefaultmathcodes \ +setfontid setmathatomrule setmathdisplaypostpenalty setmathdisplayprepenalty setmathignore \ +setmathoptions setmathpostpenalty setmathprepenalty setmathspacing shapingpenaltiesmode \ +shapingpenalty shiftedsubprescript shiftedsubscript shiftedsuperprescript shiftedsuperscript \ +shortinlinemaththreshold shortinlineorphanpenalty showcodestack showstack singlelinepenalty \ +snapshotpar spacefactormode spacefactorshrinklimit spacefactorstretchlimit srule \ +subprescript subscript superprescript superscript supmarkmode \ +swapcsvalues tabsize textdirection thewithoutunit tinymuskip \ +tocharacter todimension tohexadecimal tointeger tokenized \ toksapp tokspre tolerant tomathstyle toscaled \ tosparsedimension tosparsescaled tpack tracingadjusts tracingalignments \ -tracingexpressions tracingfonts tracingfullboxes tracinghyphenation tracinginserts \ -tracinglevels tracinglists tracingmarks tracingmath tracingnodes \ -tracingpenalties tsplit uleaders undent unexpandedloop \ -unhpack unletfrozen unletprotected untraced unvpack \ -variablefam virtualhrule virtualvrule vpack wordboundary \ -wrapuppar xdefcsname xtoks xtoksapp xtokspre +tracingexpressions tracingfullboxes tracinghyphenation tracinginserts tracinglevels \ +tracinglists tracingmarks tracingmath tracingnodes tracingpasses \ +tracingpenalties tsplit uleaders undent unexpandedendless \ +unexpandedloop unexpandedrepeat unhpack unletfrozen unletprotected \ +untraced unvpack variablefam virtualhrule virtualvrule \ +vpack vpenalty wordboundary wrapuppar xdefcsname \ +xtoks xtoksapp xtokspre keywordclass.tex.omega=\ Omegaminorversion Omegarevision Omegaversion @@ -175,18 +197,18 @@ pdfxformmargin pdfxformname pdfxformresources pdfximage keywordclass.tex.tex=\ - / above \ abovedisplayshortskip abovedisplayskip abovewithdelims accent adjdemerits \ -advance advanceby afterassignment aftergroup atop \ -atopwithdelims badness baselineskip batchmode begingroup \ -belowdisplayshortskip belowdisplayskip binoppenalty botmark box \ -boxmaxdepth brokenpenalty catcode char chardef \ -cleaders clubpenalty copy count countdef \ -cr crcr csname day deadcycles \ -def defaulthyphenchar defaultskewchar delcode delimiter \ -delimiterfactor delimitershortfall dimen dimendef discretionary \ -displayindent displaylimits displaystyle displaywidowpenalty displaywidth \ -divide divideby doublehyphendemerits dp dump \ -edef else emergencystretch end endcsname \ -endgroup endinput endlinechar eqno errhelp \ +advance afterassignment aftergroup atop atopwithdelims \ +badness baselineskip batchmode begingroup belowdisplayshortskip \ +belowdisplayskip binoppenalty botmark box boxmaxdepth \ +brokenpenalty catcode char chardef cleaders \ +clubpenalty copy count countdef cr \ +crcr csname day deadcycles def \ +defaulthyphenchar defaultskewchar delcode delimiter delimiterfactor \ +delimitershortfall dimen dimendef discretionary displayindent \ +displaylimits displaystyle displaywidowpenalty displaywidth divide \ +doublehyphendemerits dp dump edef else \ +emergencyextrastretch emergencystretch end endcsname endgroup \ +endinput endlinechar eofinput eqno errhelp \ errmessage errorcontextlines errorstopmode escapechar everycr \ everydisplay everyhbox everyjob everymath everypar \ everyvbox exhyphenchar exhyphenpenalty expandafter fam \ @@ -194,29 +216,29 @@ fi finalhyphendemerits firstmark floatingpenalty font \ fontdimen fontname futurelet gdef global \ globaldefs halign hangafter hangindent hbadness \ hbox hfil hfill hfilneg hfuzz \ -holdinginserts hrule hsize hskip hss \ -ht hyphenation hyphenchar hyphenpenalty if \ -ifcase ifcat ifdim iffalse ifhbox \ -ifhmode ifinner ifmmode ifnum ifodd \ -iftrue ifvbox ifvmode ifvoid ifx \ -ignorespaces indent input inputlineno insert \ -insertpenalties interlinepenalty jobname kern language \ -lastbox lastkern lastpenalty lastskip lccode \ -leaders left lefthyphenmin leftskip leqno \ -let limits linepenalty lineskip lineskiplimit \ -long looseness lower lowercase mark \ -mathbin mathchar mathchardef mathchoice mathcode \ -mathop mathord mathpunct mathrel mathsurround \ +hkern holdinginserts hrule hsize hskip \ +hss ht hyphenation hyphenchar hyphenpenalty \ +if ifcase ifcat ifdim iffalse \ +ifhbox ifhmode ifinner ifmmode ifnum \ +ifodd iftrue ifvbox ifvmode ifvoid \ +ifx ignorespaces indent input inputlineno \ +insert insertpenalties interlinepenalty jobname kern \ +language lastbox lastkern lastpenalty lastskip \ +lccode leaders left lefthyphenmin leftskip \ +leqno let limits linepenalty lineskip \ +lineskiplimit long looseness lower lowercase \ +mark mathaccent mathbin mathchar mathchardef \ +mathchoice mathclose mathcode mathinner mathop \ +mathopen mathord mathpunct mathrel mathsurround \ maxdeadcycles maxdepth meaning medmuskip message \ middle mkern month moveleft moveright \ -mskip multiply multiplyby muskip muskipdef \ -newlinechar noalign noexpand noindent nolimits \ -nonscript nonstopmode nulldelimiterspace nullfont number \ -omit or outer output outputpenalty \ -over overfullrule overline overwithdelims pagedepth \ -pagefilllstretch pagefillstretch pagefilstretch pagegoal pageshrink \ -pagestretch pagetotal par parfillleftskip parfillskip \ -parindent parinitleftskip parinitrightskip parshape parskip \ +mskip multiply muskip muskipdef newlinechar \ +noalign noexpand noindent nolimits nonscript \ +nonstopmode nulldelimiterspace nullfont number omit \ +or outer output outputpenalty over \ +overfullrule overline overwithdelims pagefilllstretch pagefillstretch \ +pagefilstretch pagegoal pageshrink pagestretch pagetotal \ +par parfillskip parindent parshape parskip \ patterns pausing penalty postdisplaypenalty predisplaypenalty \ predisplaysize pretolerance prevdepth prevgraf radical \ raise relax relpenalty right righthyphenmin \ @@ -234,9 +256,9 @@ tracingstats uccode uchyph unboundary underline \ unhbox unhcopy unkern unpenalty unskip \ unvbox unvcopy uppercase vadjust valign \ vbadness vbox vcenter vfil vfill \ -vfilneg vfuzz vrule vsize vskip \ -vsplit vss vtop wd widowpenalty \ -xdef xleaders xspaceskip year +vfilneg vfuzz vkern vrule vsize \ +vskip vsplit vss vtop wd \ +widowpenalty xdef xleaders xspaceskip year keywordclass.tex.xetex=\ XeTeXversion diff --git a/Master/texmf-dist/doc/context/README.adoc b/Master/texmf-dist/doc/context/README.adoc deleted file mode 100644 index 130aa717025..00000000000 --- a/Master/texmf-dist/doc/context/README.adoc +++ /dev/null @@ -1,18 +0,0 @@ -== ConTeXt source code - -This repository hosts ConTeXt, a TeX macro package. There are three versions: - -MkII:: the frozen version meant for pdfTeX -MkIV:: the mostly frozen version meant for LuaTeX -MkXL:: the latest version running on LuaMetaTeX - -Here we collect all the file needed to run ConTeXt, including the sources of -LuaMetaTeX. More information can be found on the wiki: - -* https://wiki.contextgarden.net - -For support there is a mailing list available ntg-context@ntg.nl - -* https://www.ntg.nl/mailman/listinfo/ntg-context - -Hans Hagen diff --git a/Master/texmf-dist/doc/context/context-readme.txt b/Master/texmf-dist/doc/context/context-readme.txt new file mode 100644 index 00000000000..771c31bae9c --- /dev/null +++ b/Master/texmf-dist/doc/context/context-readme.txt @@ -0,0 +1,74 @@ +Welcome to context, + +The standalone context distribution has the following structure. Installations +like texlive use a different organization. + + tex/texmf-context : the files in this tree (zip) + tex/texmf-/bin : the tex binaries and runners + tex/texmf-modules : optional user installed modules + tex/texmf-project : user project files + tex/texmf-fonts/data/ : user installed fonts + +There is only one binary: luametatex, two if you also have luatex, so the amount +of binary code is rather small. The mtxrun and context runners (stubs) are links +but when that doesn't work you can make copies luametatex (which is not that +large anyway). Because luametatex is also its own runner, there are no +dependencies on other binaries. + + luametatex[.exe] : the main tex binary, also runner [around 3MB] + + mtxrun[.exe] : a (sym)link to luametatex + context[.exe] : a (sym)link to luametatex + + mtxrun.lua : the main runner code + context.lua : the context runner code + + luatex[.exe] : optional + +The lua files have to be alongside its runner. Wrapping a runner in some launcher +makes no sense and is not supported. The whole idea is to have one single +independent framework that is the same on all main platforms (windows, linux, +osx). The mtxrun runner also handles the other mtx-* scripts that are in the +context tree, which is why we have only a few files in the binary path. It also +reduces the risk for clashes in binary names. + +Once the bin path is added to the PATH environment variable the commands: + + context + mtxrun + +will manage your tex runs. For example: + + mtxrun --generate + mtxrun --script fonts --reload + + context --make + context --make pdftex + context --make luatex + + context foo.tex + context --pdftex foo.tex + context --luatex foo.tex + +When mkii (with pdftex or xetex) is used the texexec ruby script is launched. By +using the runners the likelyhood of a clash with other program in a tex +distriubution is minimized. Other ways of running context and its related scripts +is not officially supported by the: + +An installation can be done using the installer but also by unzipping the archive +or fetching from github (contextgarden). You can, if needed, compile the binary +yourself from the includes source code. + +All tex resources (macros, styles, fonts, patterns, etc.) are located relative +to the binary path so you only need to make sure that the binary is in the path. + +The project and font trees can be shared (using links) and are untouched by the +installers. By keeping fonts in the tree you retain stability, By using the +project tree you can make sure that your styles are found when you process files +outside the tex tree. + +After installing you need to run 'mtxrun --generate' so that a successive +'context' run can find the files it needs. + +You can get help and more information on the context garden, mailing lists and user +forums cq. platforms. diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/cld-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/cld-mkiv.pdf index bb92f9aff0f..e037684dd0e 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/cld-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/cld-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/colors-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/colors-mkiv.pdf index e52eed2f05d..0c502246541 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/colors-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/colors-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-accuracy.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-accuracy.pdf new file mode 100644 index 00000000000..cdeb62fd069 Binary files /dev/null and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-accuracy.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-alignments.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-alignments.pdf index 1dcc320c788..d382069f0fc 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-alignments.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-alignments.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-grouping.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-grouping.pdf index 1289c75028a..1bda16578af 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-grouping.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-grouping.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-lines.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-lines.pdf new file mode 100644 index 00000000000..cbcd0bd5b27 Binary files /dev/null and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-lines.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-loops.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-loops.pdf index 48a619793f7..7f55fd37a3a 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-loops.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-loops.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-macros.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-macros.pdf index a33a3b659ae..7d21b16c7b4 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-macros.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-macros.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-paragraphs.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-paragraphs.pdf index 11c70780f50..ddd7a3281ac 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-paragraphs.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-paragraphs.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-registers.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-registers.pdf index 9b0b5a7cbd6..503a1d4e6ca 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-registers.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/lowlevel-registers.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/luametatex.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/luametatex.pdf index a6c0d6c4202..d6ffc80c026 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/luametatex.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/luametatex.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/musings.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/musings.pdf index a02e1b6a1da..e19138bc6c7 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/musings.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/musings.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/ontarget.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/ontarget.pdf index c8c3fe85458..639d13f7967 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/ontarget.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/ontarget.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/pdfmerge.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/pdfmerge.pdf new file mode 100644 index 00000000000..75d3f21ebc1 Binary files /dev/null and b/Master/texmf-dist/doc/context/documents/general/manuals/pdfmerge.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/primitives.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/primitives.pdf index c465be6cb58..fdce9321f69 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/primitives.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/primitives.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/sql-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/sql-mkiv.pdf index 57f6a9dc06f..7ebb6600f27 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/sql-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/sql-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-de.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-de.pdf index 0da977ac590..8a03859f6b0 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-de.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-de.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-en.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-en.pdf index ee5d4853c99..989f3e3b8b9 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-en.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-en.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-fr.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-fr.pdf index 3a591a59333..19a367c9cfa 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-fr.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-fr.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-it.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-it.pdf index 2c0b57b9287..4620bb0ad88 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-it.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-it.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-de.pdf index 0cdae12ff26..22d26a7663a 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-de.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-de.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-en.pdf index 9a9f8ae7104..18e78ea49c9 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-en.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-en.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-fr.pdf index 272ec4b153f..9ae1c81f27b 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-fr.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-fr.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-it.pdf index c81c8a05b14..51bde3456a5 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-it.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-it.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-nl.pdf index d5728f047ae..d2d7b31e226 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-nl.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-nl.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-nl.pdf b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-nl.pdf index af3e99f3f89..618bd191581 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/qrcs/setup-nl.pdf and b/Master/texmf-dist/doc/context/documents/general/qrcs/setup-nl.pdf differ diff --git a/Master/texmf-dist/doc/context/presentations/context/2017/context-2017-features-spacetest.tex b/Master/texmf-dist/doc/context/presentations/context/2017/context-2017-features-spacetest.tex index 48ad4e32f8c..5b7fc2f4163 100644 --- a/Master/texmf-dist/doc/context/presentations/context/2017/context-2017-features-spacetest.tex +++ b/Master/texmf-dist/doc/context/presentations/context/2017/context-2017-features-spacetest.tex @@ -27,7 +27,7 @@ \starttext -\enabledirectives[fonts.injections.useitalics] % use italic kerns for tracing +\enabledirectives[fonts.injections.usespacefontkerns] \definecolor[tgray][s=.5,t=.5,a=1] \showfontkerns \showfontitalics \showglyphs diff --git a/Master/texmf-dist/doc/context/presentations/examples/present-steps-001.pdf b/Master/texmf-dist/doc/context/presentations/examples/present-steps-001.pdf index c9ad7561330..2a31ec44c7f 100644 Binary files a/Master/texmf-dist/doc/context/presentations/examples/present-steps-001.pdf and b/Master/texmf-dist/doc/context/presentations/examples/present-steps-001.pdf differ diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/context.html b/Master/texmf-dist/doc/context/scripts/mkiv/context.html index 035e3a7db88..95dcdee75b7 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/context.html +++ b/Master/texmf-dist/doc/context/scripts/mkiv/context.html @@ -14,7 +14,7 @@ - ConTeXt Process Management 1.04 + ConTeXt Process Management 1.06 - - - -
-
luatools 1.35
-
-
-
-
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
-
-
-
- -
-
-

Command line options

- - - - - - - - - - - - - - - - - - - - - -
flagvaluedescription
--generategenerate file database
--variablesshow configuration variables
--configurationsshow configuration order
--expand-bracesexpand complex variable
--expand-pathexpand variable (resolve paths)
--expand-varexpand variable (resolve references)
--show-pathshow path expansion of ...
--var-valuereport value of variable
--find-filereport file location
--find-pathreport path of file
--make[or --ini] make luatex format
--run[or --fmt] run luatex format
--compileassemble and compile lua inifile
--verbosegive a bit more info
--allshow all found files
--formatstrfilter cf format specification (default 'tex', use 'any' for any match)
--patternstrfilter variables
--trackerslistenable given trackers
-
-
-
- - diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/luatools.man b/Master/texmf-dist/doc/context/scripts/mkiv/luatools.man deleted file mode 100644 index 58de54abfa2..00000000000 --- a/Master/texmf-dist/doc/context/scripts/mkiv/luatools.man +++ /dev/null @@ -1,78 +0,0 @@ -.TH "luatools" "1" "01-01-2023" "version 1.35" "ConTeXt TDS Management Tool (aka luatools)" -.SH NAME - luatools - ConTeXt TDS Management Tool (aka luatools) -.SH SYNOPSIS -.B luatools [ -.I OPTIONS ... -.B ] [ -.I FILENAMES -.B ] -.SH DESCRIPTION -.B ConTeXt TDS Management Tool (aka luatools) -.SH OPTIONS -.TP -.B --generate -generate file database -.TP -.B --variables -show configuration variables -.TP -.B --configurations -show configuration order -.TP -.B --expand-braces -expand complex variable -.TP -.B --expand-path -expand variable (resolve paths) -.TP -.B --expand-var -expand variable (resolve references) -.TP -.B --show-path -show path expansion of ... -.TP -.B --var-value -report value of variable -.TP -.B --find-file -report file location -.TP -.B --find-path -report path of file -.TP -.B --make -[or --ini] make luatex format -.TP -.B --run -[or --fmt] run luatex format -.TP -.B --compile -assemble and compile lua inifile -.TP -.B --verbose -give a bit more info -.TP -.B --all -show all found files -.TP -.B --format=str -filter cf format specification (default 'tex', use 'any' for any match) -.TP -.B --pattern=str -filter variables -.TP -.B --trackers=list -enable given trackers -.SH AUTHOR -More information about ConTeXt and the tools that come with it can be found at: - - -.B "maillist:" -ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context - -.B "webpage:" -http://www.pragma-ade.nl / http://tex.aanhet.net - -.B "wiki:" -http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/luatools.xml b/Master/texmf-dist/doc/context/scripts/mkiv/luatools.xml deleted file mode 100644 index 34460fffec4..00000000000 --- a/Master/texmf-dist/doc/context/scripts/mkiv/luatools.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - luatools - ConTeXt TDS Management Tool (aka luatools) - 1.35 - - - - - generate file database - show configuration variables - show configuration order - expand complex variable - expand variable (resolve paths) - expand variable (resolve references) - show path expansion of ... - report value of variable - report file location - report path of file - [or ] make luatex format - [or ] run luatex format - assemble and compile lua inifile - give a bit more info - show all found files - filter cf format specification (default 'tex', use 'any' for any match) - filter variables - enable given trackers - - - - \ No newline at end of file diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-babel.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-babel.man index 851c17a7ac4..293ef2d959c 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-babel.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-babel.man @@ -1,4 +1,4 @@ -.TH "mtx-babel" "1" "01-01-2023" "version 1.20" "Babel Input To UTF Conversion" +.TH "mtx-babel" "1" "01-01-2024" "version 1.20" "Babel Input To UTF Conversion" .SH NAME mtx-babel - Babel Input To UTF Conversion .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-base.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-base.man index 4a5133c13cf..b25656de69e 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-base.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-base.man @@ -1,4 +1,4 @@ -.TH "mtx-base" "1" "01-01-2023" "version 1.35" "ConTeXt TDS Management Tool (aka luatools)" +.TH "mtx-base" "1" "01-01-2024" "version 1.35" "ConTeXt TDS Management Tool (aka luatools)" .SH NAME mtx-base - ConTeXt TDS Management Tool (aka luatools) .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-bibtex.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-bibtex.man index 79aeb0ff73a..5c18226b76b 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-bibtex.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-bibtex.man @@ -1,4 +1,4 @@ -.TH "mtx-bibtex" "1" "01-01-2023" "version 1.00" "bibtex helpers" +.TH "mtx-bibtex" "1" "01-01-2024" "version 1.00" "bibtex helpers" .SH NAME mtx-bibtex - bibtex helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-cache.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-cache.man index ab1b1293c26..fb8949e517e 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-cache.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-cache.man @@ -1,4 +1,4 @@ -.TH "mtx-cache" "1" "01-01-2023" "version 1.01" "ConTeXt & MetaTeX Cache Management" +.TH "mtx-cache" "1" "01-01-2024" "version 1.01" "ConTeXt & MetaTeX Cache Management" .SH NAME mtx-cache - ConTeXt & MetaTeX Cache Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-chars.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-chars.man index 059d419e252..04bbcd3fb10 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-chars.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-chars.man @@ -1,4 +1,4 @@ -.TH "mtx-chars" "1" "01-01-2023" "version 0.10" "MkII Character Table Generators" +.TH "mtx-chars" "1" "01-01-2024" "version 0.10" "MkII Character Table Generators" .SH NAME mtx-chars - MkII Character Table Generators .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-check.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-check.man index d41ba5c45cb..d81161cae42 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-check.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-check.man @@ -1,4 +1,4 @@ -.TH "mtx-check" "1" "01-01-2023" "version 0.10" "Basic ConTeXt Syntax Checking" +.TH "mtx-check" "1" "01-01-2024" "version 0.10" "Basic ConTeXt Syntax Checking" .SH NAME mtx-check - Basic ConTeXt Syntax Checking .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-colors.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-colors.man index e072c8eda54..df4cbd19d45 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-colors.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-colors.man @@ -1,4 +1,4 @@ -.TH "mtx-colors" "1" "01-01-2023" "version 0.10" "ConTeXt Color Management" +.TH "mtx-colors" "1" "01-01-2024" "version 0.10" "ConTeXt Color Management" .SH NAME mtx-colors - ConTeXt Color Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-context.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-context.html index 035e3a7db88..95dcdee75b7 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-context.html +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-context.html @@ -14,7 +14,7 @@ - ConTeXt Process Management 1.04 + ConTeXt Process Management 1.06 + + + +
+
ConTeXT Graphic Conversion Helpers 0.10
+
+
+
+
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
+
+
+
+ +
+
+

Command line options

+ + + + + + + + + +
flagvaluedescription
--convertallconvert all graphics on path
--inputpathstringoriginal graphics path
--outputpathstringconverted graphics path
--watchwatch folders
--forceforce conversion (even if older)
--delaytime between sweeps
+
+
+
+ + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.man new file mode 100644 index 00000000000..6f00ee01e0b --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.man @@ -0,0 +1,42 @@ +.TH "mtx-convert" "1" "01-01-2024" "version 0.10" "ConTeXT Graphic Conversion Helpers" +.SH NAME + mtx-convert - ConTeXT Graphic Conversion Helpers +.SH SYNOPSIS +.B mtxrun --script convert [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXT Graphic Conversion Helpers +.SH OPTIONS +.TP +.B --convertall +convert all graphics on path +.TP +.B --inputpath=string +original graphics path +.TP +.B --outputpath=string +converted graphics path +.TP +.B --watch +watch folders +.TP +.B --force +force conversion (even if older) +.TP +.B --delay +time between sweeps +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.xml new file mode 100644 index 00000000000..641116c58ac --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-convert.xml @@ -0,0 +1,20 @@ + + + + mtx-convert + ConTeXT Graphic Conversion Helpers + 0.10 + + + + + convert all graphics on path + original graphics path + converted graphics path + watch folders + force conversion (even if older) + time between sweeps + + + + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.html new file mode 100644 index 00000000000..1ec6ad48980 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.html @@ -0,0 +1,51 @@ + + + + + + + + + + + Dealing with CTAN + + + + + +
+
Dealing with CTAN
+
+
+
+
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
+
+
+
+ +
+
+

Command line options

+ + + + + + + +
flagvaluedescription
--packageslist available packages [--field=key|name|caption]
--topicslist available topics [--field=key|name|details]
--detailsshow details about package
--patternstringuse this pattern, otherwise first argument
+
+
+
+ + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.man new file mode 100644 index 00000000000..8f1edd6c621 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.man @@ -0,0 +1,36 @@ +.TH "mtx-ctan" "1" "01-01-2024" "version 1.00" "Dealing with CTAN" +.SH NAME + mtx-ctan - Dealing with CTAN +.SH SYNOPSIS +.B mtxrun --script ctan [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B Dealing with CTAN +.SH OPTIONS +.TP +.B --packages +list available packages [--field=key|name|caption] +.TP +.B --topics +list available topics [--field=key|name|details] +.TP +.B --details +show details about package +.TP +.B --pattern=string +use this pattern, otherwise first argument +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.xml new file mode 100644 index 00000000000..32f78ee36ff --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-ctan.xml @@ -0,0 +1,18 @@ + + + + mtx-ctan + Dealing with CTAN + 1.00 + + + + + list available packages [--field=key|name|caption] + list available topics [--field=key|name|details] + show details about package + use this pattern, otherwise first argument + + + + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-dvi.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-dvi.man index 6719dc72c9a..fec258b7399 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-dvi.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-dvi.man @@ -1,4 +1,4 @@ -.TH "mtx-dvi" "1" "01-01-2023" "version 0.01" "ConTeXt DVI Helpers" +.TH "mtx-dvi" "1" "01-01-2024" "version 0.01" "ConTeXt DVI Helpers" .SH NAME mtx-dvi - ConTeXt DVI Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-epub.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-epub.man index 3b53984c7b8..2b4767d2b20 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-epub.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-epub.man @@ -1,4 +1,4 @@ -.TH "mtx-epub" "1" "01-01-2023" "version 1.10" "ConTeXt EPUB Helpers" +.TH "mtx-epub" "1" "01-01-2024" "version 1.10" "ConTeXt EPUB Helpers" .SH NAME mtx-epub - ConTeXt EPUB Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-evohome.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-evohome.man index c415c5425a0..c366a7da6eb 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-evohome.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-evohome.man @@ -1,4 +1,4 @@ -.TH "mtx-evohome" "1" "01-01-2023" "version 1.00" "Evohome Fetcher" +.TH "mtx-evohome" "1" "01-01-2024" "version 1.00" "Evohome Fetcher" .SH NAME mtx-evohome - Evohome Fetcher .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fcd.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fcd.man index 12ac2cd3b74..de6e98c0073 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fcd.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fcd.man @@ -1,4 +1,4 @@ -.TH "mtx-fcd" "1" "01-01-2023" "version 1.00" "Fast Directory Change" +.TH "mtx-fcd" "1" "01-01-2024" "version 1.00" "Fast Directory Change" .SH NAME mtx-fcd - Fast Directory Change .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.html new file mode 100644 index 00000000000..6ebda822414 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.html @@ -0,0 +1,59 @@ + + + + + + + + + + + Making PDF files more compliant + + + + + +
+
Making PDF files more compliant
+
+
+
+
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
+
+
+
+ +
+
+

Command line options

+ + + + + + + + + + + + + + + +
flagvaluedescription
--uncompressuncompress using qpdf
--validatevalidate using verapdf
--checkcheck verification result
--convertconvert using context
--comparecompare result with original
--compactoruse given compactor
--standarduse given standard
--patternprocesss files according to pattern
--silentsuppress messages
--oncerun only once
--resolutionuse this resolution when comparing
+
+
+
+ + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.man new file mode 100644 index 00000000000..24cc85aa0f6 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.man @@ -0,0 +1,57 @@ +.TH "mtx-tools" "1" "01-01-2024" "version 1.01" "Some File Related Goodies" +.SH NAME + mtx-tools - Some File Related Goodies +.SH SYNOPSIS +.B mtxrun --script tools [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B Some File Related Goodies +.SH OPTIONS +.TP +.B --uncompress +uncompress using qpdf +.TP +.B --validate +validate using verapdf +.TP +.B --check +check verification result +.TP +.B --convert +convert using context +.TP +.B --compare +compare result with original +.TP +.B --compactor +use given compactor +.TP +.B --standard +use given standard +.TP +.B --pattern +processs files according to pattern +.TP +.B --silent +suppress messages +.TP +.B --once +run only once +.TP +.B --resolution +use this resolution when comparing +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.xml new file mode 100644 index 00000000000..0582c68e719 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fixpdf.xml @@ -0,0 +1,27 @@ + + + + mtx-tools + Some File Related Goodies + 1.01 + + + + + uncompress using qpdf + validate using verapdf + check verification result + convert using context + compare result with original + use given compactor + use given standard + + + processs files according to pattern + suppress messages + run only once + use this resolution when comparing + + + + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-flac.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-flac.man index f6981986548..8fe33278614 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-flac.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-flac.man @@ -1,4 +1,4 @@ -.TH "mtx-flac" "1" "01-01-2023" "version 0.10" "ConTeXt Flac Helpers" +.TH "mtx-flac" "1" "01-01-2024" "version 0.10" "ConTeXt Flac Helpers" .SH NAME mtx-flac - ConTeXt Flac Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fonts.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fonts.man index 16cd7f068f0..656d70d27c7 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fonts.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-fonts.man @@ -1,4 +1,4 @@ -.TH "mtx-fonts" "1" "01-01-2023" "version 1.00" "ConTeXt Font Database Management" +.TH "mtx-fonts" "1" "01-01-2024" "version 1.00" "ConTeXt Font Database Management" .SH NAME mtx-fonts - ConTeXt Font Database Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.html index 10df98cf4e4..fa9e727b5ac 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.html +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.html @@ -42,6 +42,7 @@ --patternsearch for pattern (optional) --countcount matches only --nocommentskip lines that start with %% or # + --noatticskip files that hh considers irrelevant --nshow at most n matches --firstonly show first match --matchreturn the match (if it is one) diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.man index 5114ec7e21e..16eddae3690 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.man @@ -1,4 +1,4 @@ -.TH "mtx-grep" "1" "01-01-2023" "version 0.10" "Simple Grepper" +.TH "mtx-grep" "1" "01-01-2024" "version 0.10" "Simple Grepper" .SH NAME mtx-grep - Simple Grepper .SH SYNOPSIS @@ -20,6 +20,9 @@ count matches only .B --nocomment skip lines that start with %% or # .TP +.B --noattic +skip files that hh considers irrelevant +.TP .B --n show at most n matches .TP diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.xml index a78565b57cb..de8bc32a5a7 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.xml +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-grep.xml @@ -11,6 +11,7 @@ search for pattern (optional) count matches only skip lines that start with %% or # + skip files that hh considers irrelevant show at most n matches only show first match return the match (if it is one) diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.html new file mode 100644 index 00000000000..c8430e57ba5 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.html @@ -0,0 +1,60 @@ + + + + + + + + + + + ConTeXt Module Installer 1.00 + + + + + +
+
ConTeXt Module Installer 1.00
+
+
+
+
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
+
+
+
+ +
+
+

Command line options

+ + + + + + + + +
flagvaluedescription
--listlist modules
--installedlist installed modules
--installinstall modules
--uninstalluninstall modules
--moduleinstall (zip) file(s)
+
+

Examples

+mtxrun --script install-modules --list +

mtxrun --script install-modules --install filter letter +
mtxrun --script install-modules --install tikz +
mtxrun --script install-modules --install --all +

mtxrun --script install-modules --install --module t-letter.zip +
mtxrun --script install-modules --uninstall --module t-letter.zip +

mtxrun --script install-modules --installed +

+
+ + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.man new file mode 100644 index 00000000000..3adb4f3ba04 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.man @@ -0,0 +1,39 @@ +.TH "mtx-install" "1" "01-01-2024" "version 2.01" "ConTeXt Installer" +.SH NAME + mtx-install - ConTeXt Installer +.SH SYNOPSIS +.B mtxrun --script install [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXt Installer +.SH OPTIONS +.TP +.B --list +list modules +.TP +.B --installed +list installed modules +.TP +.B --install +install modules +.TP +.B --uninstall +uninstall modules +.TP +.B --module +install (zip) file(s) +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.xml new file mode 100644 index 00000000000..cee53e9126c --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install-modules.xml @@ -0,0 +1,39 @@ + + + + mtx-install + ConTeXt Installer + 2.01 + + + + + list modules + list installed modules + install modules + uninstall modules + install (zip) file(s) + + + + + + Examples + + mtxrun --script install-modules --list + + + mtxrun --script install-modules --install filter letter + mtxrun --script install-modules --install tikz + mtxrun --script install-modules --install --all + + + mtxrun --script install-modules --install --module t-letter.zip + mtxrun --script install-modules --uninstall --module t-letter.zip + + + mtxrun --script install-modules --installed + + + + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.html new file mode 100644 index 00000000000..dc08c4837df --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.html @@ -0,0 +1,57 @@ + + + + + + + + + + + ConTeXt Installer 2.01 + + + + + +
+
ConTeXt Installer 2.01
+
+
+
+
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
+
+
+
+ +
+
+

Command line options

+ + + + + + + + + + + + + +
flagvaluedescription
--platformstringplatform
--serverstringrepository url (rsync://contextgarden.net)
--modulesstringextra modules (can be list or 'all')
--fontsstringadditional fonts (can be list or 'all')
--goodiesstringextra binaries (like scite and texworks)
--installinstall context
--updateupdate context
--erasewipe the cache
--identifycreate list of files
--secureuse curl for https
+
+
+
+ + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.man new file mode 100644 index 00000000000..bb99a481402 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.man @@ -0,0 +1,54 @@ +.TH "mtx-install" "1" "01-01-2024" "version 2.01" "ConTeXt Installer" +.SH NAME + mtx-install - ConTeXt Installer +.SH SYNOPSIS +.B mtxrun --script install [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXt Installer +.SH OPTIONS +.TP +.B --platform=string +platform +.TP +.B --server=string +repository url (rsync://contextgarden.net) +.TP +.B --modules=string +extra modules (can be list or 'all') +.TP +.B --fonts=string +additional fonts (can be list or 'all') +.TP +.B --goodies=string +extra binaries (like scite and texworks) +.TP +.B --install +install context +.TP +.B --update +update context +.TP +.B --erase +wipe the cache +.TP +.B --identify +create list of files +.TP +.B --secure +use curl for https +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.xml new file mode 100644 index 00000000000..a7dd8631c3c --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-install.xml @@ -0,0 +1,24 @@ + + + + mtx-install + ConTeXt Installer + 2.01 + + + + + platform + repository url (rsync://contextgarden.net) + extra modules (can be list or 'all') + additional fonts (can be list or 'all') + extra binaries (like scite and texworks) + install context + update context + wipe the cache + create list of files + use curl for https + + + + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-interface.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-interface.man index f8aa9020642..a906a1a1c38 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-interface.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-interface.man @@ -1,4 +1,4 @@ -.TH "mtx-interface" "1" "01-01-2023" "version 0.13" "ConTeXt Interface Related Goodies" +.TH "mtx-interface" "1" "01-01-2024" "version 0.13" "ConTeXt Interface Related Goodies" .SH NAME mtx-interface - ConTeXt Interface Related Goodies .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.html new file mode 100644 index 00000000000..1da2382da12 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.html @@ -0,0 +1,68 @@ + + + + + + + + + + + ConTeXt KPSE checking utility + + + + + +
+
ConTeXt KPSE checking utility
+
+
+
+
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
+
+
+
+ +
+
+

Command line options

+ + + + + + + + + + + + + + + + + + +
flagvaluedescription
basic
--prognamemandate, set the program name (e.g. pdftex)
--findfilereport the fully qualified path of the given file
--findfilesreport a list of all full names of the given file
--expandpathexpand the given path variable
--expandvarexpand a variable
--expandbracesexpand a complex variable specification
--varvalueshow the value of a variable
--readablefilereport if a file is readable
--filetypeslist all supported formats
additional
--formatformat type
--pathpath variable
--splitsplit result in lines
+
+

Examples

+mtxrun --script kpse --progname=pdftex --findfile context.mkii +
mtxrun --script kpse --progname=pdftex --findfile context.mkii --format=tex +
mtxrun --script kpse --progname=pdftex --findfiles context.mkii --path=$TEXINPUTS +

mtxrun --script kpse --progname=pdftex --expandpath $TEXMFVAR +
mtxrun --script kpse --progname=pdftex --expandpath $TEXINPUTS -- split +

+
+ + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.man new file mode 100644 index 00000000000..6690cbdd479 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.man @@ -0,0 +1,61 @@ +.TH "mtx-kpse" "1" "01-01-2024" "version 1.00" "ConTeXt KPSE checking utility" +.SH NAME + mtx-kpse - ConTeXt KPSE checking utility +.SH SYNOPSIS +.B mtxrun --script kpse [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXt KPSE checking utility +.SH OPTIONS: BASIC +.TP +.B --progname +mandate, set the program name (e.g. pdftex) +.TP +.B --findfile +report the fully qualified path of the given file +.TP +.B --findfiles +report a list of all full names of the given file +.TP +.B --expandpath +expand the given path variable +.TP +.B --expandvar +expand a variable +.TP +.B --expandbraces +expand a complex variable specification +.TP +.B --varvalue +show the value of a variable +.TP +.B --readablefile +report if a file is readable +.TP +.B --filetypes +list all supported formats +.SH OPTIONS: ADDITIONAL +.TP +.B --format +format type +.TP +.B --path +path variable +.TP +.B --split +split result in lines +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.xml new file mode 100644 index 00000000000..3b2259d9fb5 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-kpse.xml @@ -0,0 +1,44 @@ + + + + mtx-kpse + ConTeXt KPSE checking utility + 1.00 + + + + + mandate, set the program name (e.g. pdftex) + report the fully qualified path of the given file + report a list of all full names of the given file + expand the given path variable + expand a variable + expand a complex variable specification + show the value of a variable + report if a file is readable + list all supported formats + + + + + format type + path variable + split result in lines + + + + + + Examples + + mtxrun --script kpse --progname=pdftex --findfile context.mkii + mtxrun --script kpse --progname=pdftex --findfile context.mkii --format=tex + mtxrun --script kpse --progname=pdftex --findfiles context.mkii --path=$TEXINPUTS + + + mtxrun --script kpse --progname=pdftex --expandpath $TEXMFVAR + mtxrun --script kpse --progname=pdftex --expandpath $TEXINPUTS -- split + + + + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-metapost.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-metapost.man index 265a203e421..338ee9fa322 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-metapost.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-metapost.man @@ -1,4 +1,4 @@ -.TH "mtx-metapost" "1" "01-01-2023" "version 0.10" "MetaPost to PDF processor" +.TH "mtx-metapost" "1" "01-01-2024" "version 0.10" "MetaPost to PDF processor" .SH NAME mtx-metapost - MetaPost to PDF processor .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-modules.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-modules.man index 11629fedef9..5d9e481a105 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-modules.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-modules.man @@ -1,4 +1,4 @@ -.TH "mtx-modules" "1" "01-01-2023" "version 1.00" "ConTeXt Module Documentation Generators" +.TH "mtx-modules" "1" "01-01-2024" "version 1.00" "ConTeXt Module Documentation Generators" .SH NAME mtx-modules - ConTeXt Module Documentation Generators .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-package.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-package.man index 33ce616ed1e..38ea0271be8 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-package.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-package.man @@ -1,4 +1,4 @@ -.TH "mtx-package" "1" "01-01-2023" "version 0.10" "Distribution Related Goodies" +.TH "mtx-package" "1" "01-01-2024" "version 0.10" "Distribution Related Goodies" .SH NAME mtx-package - Distribution Related Goodies .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-patterns.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-patterns.man index 771c86f0a9c..8f652546524 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-patterns.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-patterns.man @@ -1,4 +1,4 @@ -.TH "mtx-patterns" "1" "01-01-2023" "version 0.20" "ConTeXt Pattern File Management" +.TH "mtx-patterns" "1" "01-01-2024" "version 0.20" "ConTeXt Pattern File Management" .SH NAME mtx-patterns - ConTeXt Pattern File Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.html index 3e4541a0ccb..6220b6449b8 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.html +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.html @@ -41,10 +41,14 @@ --infoshow some info about the given file --metadatashow metadata xml blob + --formdatashow formdata --prettyreplace newlines in metadata --fontsshow used fonts (--detail) - --objectshow object"/> - --linksshow links"/> + --objectshow object + --linksshow links + --signsign document (assumes signature template) + --verifyverify document + --detailprint detail to the console
diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.man index 222261a8184..0c5dff19f45 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.man @@ -1,4 +1,4 @@ -.TH "mtx-pdf" "1" "01-01-2023" "version 0.10" "ConTeXt PDF Helpers" +.TH "mtx-pdf" "1" "01-01-2024" "version 0.10" "ConTeXt PDF Helpers" .SH NAME mtx-pdf - ConTeXt PDF Helpers .SH SYNOPSIS @@ -17,6 +17,9 @@ show some info about the given file .B --metadata show metadata xml blob .TP +.B --formdata +show formdata +.TP .B --pretty replace newlines in metadata .TP @@ -24,10 +27,19 @@ replace newlines in metadata show used fonts (--detail) .TP .B --object -show object"/> +show object .TP .B --links -show links"/> +show links +.TP +.B --sign +sign document (assumes signature template) +.TP +.B --verify +verify document +.TP +.B --detail +print detail to the console .SH AUTHOR More information about ConTeXt and the tools that come with it can be found at: diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.xml index 6b2efdcb802..39be43710f6 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.xml +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-pdf.xml @@ -10,16 +10,23 @@ show some info about the given file show metadata xml blob + show formdata replace newlines in metadata - show used fonts ( - show object"/> - show links"/> + show used fonts () + show object + show links + sign document (assumes signature template) + verify document + print detail to the console mtxrun --script pdf --info foo.pdf mtxrun --script pdf --metadata foo.pdf mtxrun --script pdf --metadata --pretty foo.pdf mtxrun --script pdf --stream=4 foo.pdf + mtxrun --script pdf --sign --certificate=somesign.pem --password=test --uselibrary somefile + mtxrun --script pdf --verify --certificate=somesign.pem --password=test --uselibrary somefile + mtxrun --script pdf --detail=nofpages somefile diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-plain.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-plain.man index c1af287c71c..00512ab3cb4 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-plain.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-plain.man @@ -1,4 +1,4 @@ -.TH "mtx-plain" "1" "01-01-2023" "version 1.00" "Plain TeX Runner" +.TH "mtx-plain" "1" "01-01-2024" "version 1.00" "Plain TeX Runner" .SH NAME mtx-plain - Plain TeX Runner .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-profile.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-profile.man index 13067b503fd..a5b220cd604 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-profile.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-profile.man @@ -1,4 +1,4 @@ -.TH "mtx-profile" "1" "01-01-2023" "version 1.00" "ConTeXt MkIV LuaTeX Profiler" +.TH "mtx-profile" "1" "01-01-2024" "version 1.00" "ConTeXt MkIV LuaTeX Profiler" .SH NAME mtx-profile - ConTeXt MkIV LuaTeX Profiler .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-rsync.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-rsync.man index b9e5002354c..8acda886e67 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-rsync.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-rsync.man @@ -1,4 +1,4 @@ -.TH "mtx-rsync" "1" "01-01-2023" "version 0.10" "Rsync Helpers" +.TH "mtx-rsync" "1" "01-01-2024" "version 0.10" "Rsync Helpers" .SH NAME mtx-rsync - Rsync Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-scite.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-scite.man index 3de8ea5876a..c429bf12b56 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-scite.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-scite.man @@ -1,4 +1,4 @@ -.TH "mtx-scite" "1" "01-01-2023" "version 1.00" "Scite Helper Script" +.TH "mtx-scite" "1" "01-01-2024" "version 1.00" "Scite Helper Script" .SH NAME mtx-scite - Scite Helper Script .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-server.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-server.man index 5fa9da9cafa..50eea81f111 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-server.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-server.man @@ -1,4 +1,4 @@ -.TH "mtx-server" "1" "01-01-2023" "version 0.10" "Simple Webserver For Helpers" +.TH "mtx-server" "1" "01-01-2024" "version 0.10" "Simple Webserver For Helpers" .SH NAME mtx-server - Simple Webserver For Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-spell.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-spell.man index 578fde17dc2..ffe3850011e 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-spell.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-spell.man @@ -1,4 +1,4 @@ -.TH "mtx-spell" "1" "01-01-2023" "version 0.10" "ConTeXt Word Filtering" +.TH "mtx-spell" "1" "01-01-2024" "version 0.10" "ConTeXt Word Filtering" .SH NAME mtx-spell - ConTeXt Word Filtering .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.html new file mode 100644 index 00000000000..504074cae96 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.html @@ -0,0 +1,52 @@ + + + + + + + + + + + ConTeXt SyncTeX Checker 1.01 + + + + + +
+
ConTeXt SyncTeX Checker 1.01
+
+
+
+
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
+
+
+
+ +
+
+

Command line options

+ + + + + + + + +
flagvaluedescription
--editopen file at line: --line=.. --editor=.. sourcefile
--listshow all areas: synctexfile
--gotoopen file at position: --page=.. --x=.. --y=.. [--tolerance=] --editor=.. synctexfile
--reportshow (tex) file and line: [--direct] --page=.. --x=.. --y=.. [--tolerance=] --console synctexfile
--findfind (pdf) page and box: [--direct] --file=.. --line=.. synctexfile
+
+
+
+ + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.man new file mode 100644 index 00000000000..dae4ab761a1 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.man @@ -0,0 +1,39 @@ +.TH "mtx-synctex" "1" "01-01-2024" "version 1.01" "SyncTeX Checker" +.SH NAME + mtx-synctex - SyncTeX Checker +.SH SYNOPSIS +.B mtxrun --script synctex [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B SyncTeX Checker +.SH OPTIONS +.TP +.B --edit +open file at line: --line=.. --editor=.. sourcefile +.TP +.B --list +show all areas: synctexfile +.TP +.B --goto +open file at position: --page=.. --x=.. --y=.. [--tolerance=] --editor=.. synctexfile +.TP +.B --report +show (tex) file and line: [--direct] --page=.. --x=.. --y=.. [--tolerance=] --console synctexfile +.TP +.B --find +find (pdf) page and box: [--direct] --file=.. --line=.. synctexfile +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.xml new file mode 100644 index 00000000000..623090ad5b1 --- /dev/null +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-synctex.xml @@ -0,0 +1,19 @@ + + + + mtx-synctex + SyncTeX Checker + 1.01 + + + + + open file at line: --line=.. --editor=.. sourcefile + show all areas: synctexfile + open file at position: --page=.. --x=.. --y=.. [--tolerance=] --editor=.. synctexfile + show (tex) file and line: [--direct] --page=.. --x=.. --y=.. [--tolerance=] --console synctexfile + find (pdf) page and box: [--direct] --file=.. --line=.. synctexfile + + + + diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-texworks.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-texworks.man index 0416a11b65d..7ea913aca72 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-texworks.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-texworks.man @@ -1,4 +1,4 @@ -.TH "mtx-texworks" "1" "01-01-2023" "version 1.00" "TeXworks Startup Script" +.TH "mtx-texworks" "1" "01-01-2024" "version 1.00" "TeXworks Startup Script" .SH NAME mtx-texworks - TeXworks Startup Script .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.html b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.html deleted file mode 100644 index 54598c8caf4..00000000000 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - ConTeXt Timing Tools 0.10 - - - - - -
-
ConTeXt Timing Tools 0.10
-
-
-
-
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
-
-
-
- -
-
-

Command line options

- - - - - - -
flagvaluedescription
--xhtmlmake xhtml file
--launchlaunch after conversion
--removeremove after launching
-
-
-
- - diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.man deleted file mode 100644 index 31b2671c99b..00000000000 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.man +++ /dev/null @@ -1,33 +0,0 @@ -.TH "mtx-timing" "1" "01-01-2023" "version 0.10" "ConTeXt Timing Tools" -.SH NAME - mtx-timing - ConTeXt Timing Tools -.SH SYNOPSIS -.B mtxrun --script timing [ -.I OPTIONS ... -.B ] [ -.I FILENAMES -.B ] -.SH DESCRIPTION -.B ConTeXt Timing Tools -.SH OPTIONS -.TP -.B --xhtml -make xhtml file -.TP -.B --launch -launch after conversion -.TP -.B --remove -remove after launching -.SH AUTHOR -More information about ConTeXt and the tools that come with it can be found at: - - -.B "maillist:" -ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context - -.B "webpage:" -http://www.pragma-ade.nl / http://tex.aanhet.net - -.B "wiki:" -http://contextgarden.net diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.xml b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.xml deleted file mode 100644 index d41322799dd..00000000000 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-timing.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - mtx-timing - ConTeXt Timing Tools - 0.10 - - - - - make xhtml file - launch after conversion - remove after launching - - - - diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-tools.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-tools.man index 10751133d80..54f21ddede6 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-tools.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-tools.man @@ -1,4 +1,4 @@ -.TH "mtx-tools" "1" "01-01-2023" "version 1.01" "Some File Related Goodies" +.TH "mtx-tools" "1" "01-01-2024" "version 1.01" "Some File Related Goodies" .SH NAME mtx-tools - Some File Related Goodies .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unicode.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unicode.man index 651a4c07627..bebbba61e53 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unicode.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unicode.man @@ -1,4 +1,4 @@ -.TH "mtx-unicode" "1" "01-01-2023" "version 1.02" "Checker for char-dat.lua" +.TH "mtx-unicode" "1" "01-01-2024" "version 1.02" "Checker for char-dat.lua" .SH NAME mtx-unicode - Checker for char-dat.lua .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unzip.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unzip.man index 59725ff8376..7e2c32a06a1 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unzip.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-unzip.man @@ -1,4 +1,4 @@ -.TH "mtx-unzip" "1" "01-01-2023" "version 0.10" "Simple Unzipper" +.TH "mtx-unzip" "1" "01-01-2024" "version 0.10" "Simple Unzipper" .SH NAME mtx-unzip - Simple Unzipper .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-update.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-update.man index 83079fb4013..a3398717d4e 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-update.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-update.man @@ -1,4 +1,4 @@ -.TH "mtx-update" "1" "01-01-2023" "version 1.03" "ConTeXt Minimals Updater" +.TH "mtx-update" "1" "01-01-2024" "version 1.03" "ConTeXt Minimals Updater" .SH NAME mtx-update - ConTeXt Minimals Updater .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-vscode.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-vscode.man index df9c4f9baaa..f125b36c6af 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-vscode.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-vscode.man @@ -1,4 +1,4 @@ -.TH "mtx-vscode" "1" "01-01-2023" "version 1.00" "vscode extension generator" +.TH "mtx-vscode" "1" "01-01-2024" "version 1.00" "vscode extension generator" .SH NAME mtx-vscode - vscode extension generator .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-watch.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-watch.man index 8ca17920e66..5049b1f5a89 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-watch.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-watch.man @@ -1,4 +1,4 @@ -.TH "mtx-watch" "1" "01-01-2023" "version 1.00" "ConTeXt Request Watchdog" +.TH "mtx-watch" "1" "01-01-2024" "version 1.00" "ConTeXt Request Watchdog" .SH NAME mtx-watch - ConTeXt Request Watchdog .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-youless.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-youless.man index 0f53b233ba4..e54fd1dd32b 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtx-youless.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtx-youless.man @@ -1,4 +1,4 @@ -.TH "mtx-youless" "1" "01-01-2023" "version 1.100" "youless Fetcher" +.TH "mtx-youless" "1" "01-01-2024" "version 1.100" "youless Fetcher" .SH NAME mtx-youless - youless Fetcher .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/scripts/mkiv/mtxrun.man b/Master/texmf-dist/doc/context/scripts/mkiv/mtxrun.man index 644ceefd1e2..29eeb28cc80 100644 --- a/Master/texmf-dist/doc/context/scripts/mkiv/mtxrun.man +++ b/Master/texmf-dist/doc/context/scripts/mkiv/mtxrun.man @@ -1,4 +1,4 @@ -.TH "mtxrun" "1" "01-01-2023" "version 1.33" "ConTeXt TDS Runner Tool" +.TH "mtxrun" "1" "01-01-2024" "version 1.33" "ConTeXt TDS Runner Tool" .SH NAME mtxrun - ConTeXt TDS Runner Tool .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-afewdetails.tex b/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-afewdetails.tex index 9c3221e7528..264861f8c9e 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-afewdetails.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-afewdetails.tex @@ -187,7 +187,7 @@ context.copy(false,0) but this works as well: \startbuffer -context(node.copy_list(tex.box[0])) +context(node.copylist(tex.box[0])) \stopbuffer \typebuffer @@ -226,7 +226,7 @@ function userdata.processmystuff(head) if enabled then local color = "mynesting:" .. (count % 3) -- for n in node.traverse(head) do - for n in node.traverse_id(nodes.nodecodes.glyph,head) do + for n in node.traverseid(nodes.nodecodes.glyph,head) do setcolor(n,color) end count = count + 1 @@ -297,7 +297,7 @@ local setcolor = nodes.tracers.colors.set function userdata.processmystuff(head) count = count + 1 local color = "mynesting:" .. (count % 3) - for n in node.traverse_id(nodes.nodecodes.glyph,head) do + for n in node.traverseid(nodes.nodecodes.glyph,head) do setcolor(n,color) end return head, true @@ -340,13 +340,13 @@ The \LUA\ code like similar to the code presented before: \startbuffer \startluacode -local setcolor = nodes.tracers.colors.setlist -local getmarker = nodes.markers.get -local hlist_code = nodes.nodecodes.hlist -local traverse_id = node.traverse_id +local setcolor = nodes.tracers.colors.setlist +local getmarker = nodes.markers.get +local hlist_code = nodes.nodecodes.hlist +local traverseid = node.traverseid function userdata.processmystuff(head) - for n in traverse_id(hlist_code,head) do + for n in traverseid(hlist_code,head) do local m = getmarker(n,"mymarker") if m then setcolor(n.list,"mymarker:" .. m) diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-nicetoknow.tex b/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-nicetoknow.tex index 950e394c7c0..cd5b985879d 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-nicetoknow.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/cld/cld-nicetoknow.tex @@ -105,7 +105,7 @@ tex.setbox(0,b) So we end up with: \starttyping -local b = node.copy_list(tex.getbox(0)) +local b = node.copylist(tex.getbox(0)) -- mess around with b tex.setbox(0,b) \stoptyping diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/colors/colors-graphics.tex b/Master/texmf-dist/doc/context/sources/general/manuals/colors/colors-graphics.tex index c438a4630cc..78319d5ad4f 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/colors/colors-graphics.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/colors/colors-graphics.tex @@ -1,3 +1,4 @@ + % language=us runpath=texruns:manuals/colors \startcomponent colors-basics @@ -229,6 +230,185 @@ on bad images). \stopsection +\startsection[title=Masks] + +A \PNG\ bitmap image can have a mask that permits a background to shine through +but you can also apply that effect to a regular \PNG\ image. The next examples +use two (pre)defined masks: + +\startbuffer +\registerfiguremask [mymask1] { + { + { 0, 100, 0x00 }, + { 101, 200, 0x7F }, + { 201, 255, 0xFF }, + } +} + +\registerfiguremask [mymask2] { + 210 +} +\stopbuffer + +% demomask = { +% { 0, 63, 0 }, +% { 64, 127, 127 }, +% { 128, 195, 195 }, +% { 196, 255, 255 }, +% } + +% \registerfiguremask [mymask1] { +% function() +% return { +% { 0, 100, 0x00 }, +% { 101, 200, 0x7F }, +% { 201, 255, 0xFF }, +% } +% end +% } + +\typebuffer + +The first mask maps the (grayscale) image values onto a mask value by range while +the second just passes a criterium. The argument to \type {\registerfiguremask} +is a number, table or string in \LUA\ speak + +\getbuffer + +For the examples we define two colors: + +\startbuffer +\definecolor[mymaskcolor1][darkred] +\definecolor[mymaskcolor2][.75(darkblue,white)] +\stopbuffer + +\typebuffer + +\getbuffer + +\startbuffer[zero] +\externalfigure + [2019-sneaky-bw-lowres.png] + [width=\measure{combination}] +\stopbuffer + +\startbuffer[one] +\externalfigure + [2019-sneaky-bw-lowres.png] + [background=color, + backgroundcolor=mymaskcolor1, + mask=mymask1, + width=\measure{combination}] +\stopbuffer + +\startbuffer[two] +\externalfigure + [2019-sneaky-bw-lowres.png] + [background=color, + backgroundcolor=mymaskcolor2, + mask=mymask2, + width=\measure{combination}] +\stopbuffer + +\startbuffer[three] +\externalfigure + [2019-sneaky-bw-lowres.png] + [background=color, + backgroundcolor=mymaskcolor2, + mask=demomask, + width=\measure{combination}] +\stopbuffer + +We now include two images: + +\typebuffer[one] + +and + +\typebuffer[two] + +The result is shown in \in {figure} [fig:masks:one] and shows that one has +probably experiment a bit with the values. The first shows the original and the +last the predefined \quote {demomask} that uses a table with four ranges. + +\startplacefigure[title=Masks,reference=fig:masks:one] + \startcombination[4*1] + {\inlinebuffer[zero]} {original} + {\inlinebuffer[one]} {table} + {\inlinebuffer[two]} {number} + {\inlinebuffer[three]}{demomask} + \stopcombination +\stopplacefigure + +We can also use an image as mask. Take these three definitions: + +\startbuffer[one] +\externalfigure + [mill.png] + [height=5cm] +\stopbuffer + +\startbuffer[two] +\externalfigure + [2019-sneaky-bw-lowres.png] + [height=5cm] +\stopbuffer + +\startbuffer[three] +\externalfigure + [mill.png] + [mask=2019-sneaky-bw-lowres.png,height=5cm] +\stopbuffer + +\typebuffer[one,two,three] + +In \in {figure} [fig:masks:two] the third example has both images stacked. + +\startplacefigure[title=Masks,reference=fig:masks:two] + \startcombination[3*1] + {\inlinebuffer[one]} {} + {\inlinebuffer[two]} {} + {\inlinebuffer[three]}{} + \stopcombination +\stopplacefigure + +Next we show how to make an image lighter or darker. For this we use the \type +{range} key. It can be assigned a number (fraction) or a name that serves as +lookup in a registry. As with masks these are \LUA\ definitions. AN example of a +range definition is: + +\startbuffer +\registerfigurerange [myrange] { + { 0.2, 1.2 } +} +\stopbuffer + +For an \RGB\ you can provide two or six values. In \in {figure} [fig:ranges:gray] +we show a lighter, normal, darker and limited example. In \in {figure} +[fig:ranges:color] we apply them to a \JPEG\ image. + +\typebuffer \getbuffer + +\startplacefigure[title=Ranges,reference=fig:ranges:gray] + \startcombination[4*1] + {\externalfigure[mill.png][width=\measure{combination},range=0.80]} {\type{range=0.80}} + {\externalfigure[mill.png][width=\measure{combination}]} {default} + {\externalfigure[mill.png][width=\measure{combination},range=1.20]} {\type{range=1.20}} + {\externalfigure[mill.png][width=\measure{combination},range=myrange]} {\type{range=myrange}} + \stopcombination +\stopplacefigure + +\startplacefigure[title=Ranges,reference=fig:ranges:color] + \startcombination[4*1] + {\externalfigure[hacker.jpg][width=\measure{combination},range=0.80]} {\type{range=0.80}} + {\externalfigure[hacker.jpg][width=\measure{combination}]} {default} + {\externalfigure[hacker.jpg][width=\measure{combination},range=1.20]} {\type{range=1.20}} + {\externalfigure[hacker.jpg][width=\measure{combination},range=myrange]} {\type{range=myrange}} + \stopcombination +\stopplacefigure + +\stopsection + \stopchapter \stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-compact.tex b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-compact.tex new file mode 100644 index 00000000000..69cfdfb55b9 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-compact.tex @@ -0,0 +1,517 @@ + +% language=us runpath=texruns:manuals/fonts + +\continuewhenlmtxmode + +\startcomponent fonts-compact + +\environment fonts-environment + +\definetypeface + [narrowtt] [tt] + [mono] [modern-condensed] [default] [features=none] + +\startchapter[title=Compact][color=darkgray] + +\startsection[title=Introduction] + +The title of this chapter is somewhat misleading but in the end a lot boils down +to efficient but flexible usage as offered in \CONTEXT\ \LMTX\ and \LUAMETATEX. +This also means that what is discussed here does not apply to \MKIV. + +\stopsection + +\startsection[title=Compact mode] + +\startsubsection[title=What \TEX\ needs] + +A traditional \TEX\ approach to fonts is that you explicitly load a font +that then gets an identifier which is used to trigger its usage. In plain \TEX\ +you find these lines: + +\startcolumns[n=3] +\starttyping +\font\tenrm cmr10 +\font\preloaded cmr9 +\font\preloaded cmr8 +\font\sevenrm cmr7 +\font\preloaded cmr6 +\font\fiverm cmr5 + +\font\teni cmmi10 +\font\preloaded cmmi9 +\font\preloaded cmmi8 +\font\seveni cmmi7 +\font\preloaded cmmi6 +\font\fivei cmmi5 + +\font\tensy cmsy10 +\font\preloaded cmsy9 +\font\preloaded cmsy8 +\font\sevensy cmsy7 +\font\preloaded cmsy6 +\font\fivesy cmsy5 + +\font\tenex cmex10 + +\font\preloaded cmss10 +\font\preloaded cmssq8 + +\font\preloaded cmssi10 +\font\preloaded cmssqi8 + +\font\tenbf cmbx10 +\font\preloaded cmbx9 +\font\preloaded cmbx8 +\font\sevenbf cmbx7 +\font\preloaded cmbx6 +\font\fivebf cmbx5 + +\font\tentt cmtt10 +\font\preloaded cmtt9 +\font\preloaded cmtt8 + +\font\preloaded cmsltt10 + +\font\tensl cmsl10 +\font\preloaded cmsl9 +\font\preloaded cmsl8 + +\font\tenit cmti10 +\font\preloaded cmti9 +\font\preloaded cmti8 +\font\preloaded cmti7 +\stoptyping +\stopcolumns + +There are a few more later on in that file. Although users seldom see such low +level definitions it shows a few interesting aspects. First of all, we see that +there are different fonts for different sizes. These can be triggered with +commands like \type {\tenbf}. We also see that some fonts get the name \type +{\preloaded} but because later one we have: + +\starttyping +\let\preloaded\undefined +\stoptyping + +that command is no longer meaningful. The fonts are loaded but not accessible. +However, when you define it again, the already loaded variant will be used which +might save some runtime. Back to the sizes: all is centered around a ten point +body font. The smaller sizes are for math and footnotes, the larger ones for +section titles and such. The different sizes are optimized for that size and +expected to be printed at that size. Of course looking at a document on a phone, +epub device, high resolution monitor or beamer image, spoils that concept: +instead of being optimized for some size it then becomes a variant with different +properties. A seven point glyph at indeed seven point in a math superscript makes +sense but when blown up to 16 point there is less need for a different shape +unless one wants (for instance) to run the scripts narrower. The danger of ink +filling shapes at small sizes is not present when we scale up. + +Anyway, the engine loads a font and when triggered it will use the dimensions +that it provides: character properties like widths, heights, depths, italic +corrections, kerns, ligatures, math variants and extensibles as well as font +properties like spacing. If you load a ten point font at fifteen point the +original gets scaled and a copy is used with these new properties. If you use +400 sizes, you get 400 copies. + +\stopsubsection + +\startsubsection[title=How \LUATEX\ works] + +Because \LUATEX\ is a wide engine loading a font not only takes more time but +using one also consumes more memory. In principle there should be no real +difference in the amount of fonts loaded unless the macro package does a poor +job. In what we call base mode, there is no difference with the traditional +approach: \TEX\ needs the usual properties so, assuming that callbacks are used +for font management, only these have to be passed to the engine. In what we call +node mode in \CONTEXT\ rendering is delegated to \LUA. The engine is not involved +in for instance ligature building and kerning. + +Where in a traditional engine small caps and old style variants are bound to +specific fonts, using them involves loading a new instance. However, in \CONTEXT\ +we can avoid that by using dynamic features. This dynamic mechanism is part of +node mode and is a convenient way to deal with small caps and oldstyle shapes. So +here we can actually save some memory due to less instances but of course at the +cost of some more complexity. But we still have dedicated instances for say eight +point and ten point. + +\stopsubsection + +\startsubsection[title=What \LUAMETATEX\ can do] + +In this engine we can do scaling of glyphs on demand. This makes it possible to +only define a ten point instance and scale for instance an eight point size from +that instance. This can come at the cost of more runtime due to more calculations +but in the end experiments demonstrated that runtime can become less. Memory +consumption of course is less anyway. + +This scaling feature has quite some impact on the front|-|end because dimensions +that relate to the current font might have to be scaled too. It is definitely +something to take into account at the \LUA\ end. In addition to scaling we also +have some other manipulations. Although these are taken into account in the +frontend, it is the backend that eventually has to take care of it. + +\starttabulate +\NC \type {\glyphscale } \NC scales the glyphs in two directions \NC \NR +\NC \type {\glyphxscale} \NC scales the glyphs horizontally, aka extending \NC \NR +\NC \type {\glyphyscale} \NC scales the glyphs vertically, aka squeezing \NC \NR +\NC \type {\glyphslant } \NC transforms the glyphs such that it becomes oblique\NC \NR +\NC \type {\glyphweight} \NC boldens the glyphs \NC \NR +\stoptabulate + +Apart from slanting all these primitives result in different metrics. The weight is +somewhat tricky because here we need some guesswork. + +When we use compact font mode in \CONTEXT\ \LMTX, the same font is loaded once +and scaled on demand using the above control options. Of course this need some +management, for instance because when setting the scale an already active scale +might effectively get rescaled. + +% \unprotect +% \meaning\font_scale_defined_x +% \protect +% \glyphscale\dimexpr\xtextface*\plushundred/\onepoint\relax +% \gyphrescale\xtextface\relax + +\stopsubsection + +\stopsection + +\startsection[title=Design sizes] + +\startsubsection[title=Introduction] + +The first \TEX\ distributions had an important characteristic: the fonts that +came with them were tuned for a certain size and we could speak of them having +\quote {design sizes}. There were good reasons for this. + +\startitemize + +\startitem + The typeset result was supposed to be printed and we were not talking desktop + printers here, but printing presses. A book normally came in a ten point + design; after all, how many type does a typesetter has available in lead or + film. +\stopitem + +\startitem + When math is involved there are two levels of script which means that there + are seven and five point sizes used too. At these smaller sizes some details of a + glyph have to be exaggerated and other bits and pieces have to become more + open in order not to become a blob of black ink. +\stopitem + +\startitem + A section header or maybe a bit larger chapter title got its own size, often a + bit heavier and maybe running somewhat wider. +\stopitem + +\startitem + Combined, this kind of usage results in a predictable way of presenting the + result to the user. Unless the reader uses a magnifying glass, what you see is + what you got. +\stopitem + +\stopitemize + +Compare this to todays rendering and presentation. What is a ten point on a +mobile phone, 1920x1080 14 inch laptop screen, a 27 inch 4K desktop monitor, or +beamed on the wall presentation with a 3 meter diameter? And let's not bring +these low res epub devices into the discussion. It is of course also a matter of +taste but it is not uncommon to hear \TEX ies claim virtues of fonts and the +rendering with \TEX\ (take expansion) while at the same time observing that they +ignore aspects of typesetting that would really make their documents look nice. + +Where in the good old \TEX\ approach, rooted in traditional typesetting and +printing, the concept of \quote {design size} made sense, I personally think that +in today's rendering and usage it has no real meaning. A basic ten point font can +show up in any size and is not adapted on-the-fly which in turn would demand +on-the-fly typesetting with definitely a different look and feel due to different +line breaks, and we don't even consider how scaling (bitmap or vector) images fit +into such adaptations. It might work in browsers but not on more traditional +designed and optimized published content. + +There is a sort of tradition that a font comes in \quote {normal}, \quote {bold}, +\quote {italic} and \quote {bolditalic} shapes. It can make sense to come up with +a bit lighter and more heavy variant, but some designers can't make up their mind +and come with a whole range, so we see \quote {thin}, \quote {demi-bold}, \quote +{medium} and \quote {medium-bold}, and whatever fits the repertoire. The choice +of what looks best is delegated to the user. In the past there definitely was a +commercial aspect to this, after all each set has to be bought, and when it's not +clear what to use you end up with dozens of fonts, of which most are never used. +Today the drive probably comes from the possibilities that font design programs +offer. And when variable fonts showed up we suddenly saw fonts come in many +weights, again putting the burden of what looks best on users instead of what is +intended on designers. As a side effect, the distinction between designs becomes +vague and there is a danger that in the end users no longer really care what font +they use because they can make it look like any other anyway. + +I like to argue that these \quote {new} fonts that come in what some call design +sizes has little to do with design sizes in the traditional sense. The variants +more reflect usage, like \quote {display} or \quote {heading}. As mentioned +above, one can indeed consider them to be designed for (say) larger than default +sizes, but then the word \quote {size} no longer hold. + +Say that in a traditional \TEX\ document one has the running text in ten point. A +section header can use the twelve point and a chapter heading fourteen (\TEX\ has +these 14.4pt, 17.3pt sizes). In print they really are like that but but when +watched on a device the ten point can effectively be a eight point (epub) or +twenty point (monitor) so there size has become meaningless because the font is +not seen at the size it was designed for. When we choose a different one (say +\quote {display}) we do so because of other properties than size. This means that +instead of \quote {design size} we can better talk of \quote {usage}. + +The advantage of talking \quote {usage} is that we don't need to think size. In a +traditional \TEX\ setup using design sizes you end up with (difficult) choices. +If the document is in eleven point, do we scale down the twelve point or scale up +the ten point, assuming that we have ten and twelve point designs optimized for +the running text. And how about math when we go down to eight point in footnotes, +do we really use five point script and three point script script or do we go for +six point and five or maybe four point. Nowadays we can decide to just scale +relative, and sticking to what was common in the days of lead typesetters with +fixed sizes is not needed. Maybe a gradual evolution meant that we stuck to +concepts a bit too much. So in todays \TEX\ setup we can decide to just define a +basic setup (no design sizes at all) and do that multiple times depending on +usage: kicking in a different set of shapes for \quote {display} and \quote +{heading} when available. There is no reason to use a shape meant for display for +a sixteen point running text because we scale the ten point and then use the +display font at (say) twenty four point: it is usage and not scale that matters +here. And an occasional ten point display font used at ten point in a ten point +running text can have some use, but we make sure to trigger it with the right +denomination: we mix a \quote {display} design into a \quote {regular} stream at +the same size. + +It is of course also a matter of perception and taste but as with font expansion +(aka hz) it could be annoying to see two different two's in $2^2$, something at +10 points might look better at small sizes but worse as larger. In {figures} +[fig:designsizes:1] \in {and} [fig:designsizes:2] you can see how it looks when +we scale a design size beyond its intended size. Especially the second stylistic +variant (meant for script script) can stand out. + +\def\SampleOne#1#2{\switchtobodyfont[#1]\scale[scale=#2000]{\im{2^{2^2}}}} + +\startbuffer +\startcombination[6*3] + {\SampleOne{lucida} {1}} {} + {\SampleOne{lucida} {2}} {} + {\SampleOne{lucida} {3}} {} + {\SampleOne{lucida} {4}} {} + {\SampleOne{lucida} {5}} {} + {\SampleOne{lucida} {6}} {} + {\SampleOne{pagella}{1}} {} + {\SampleOne{pagella}{2}} {} + {\SampleOne{pagella}{3}} {} + {\SampleOne{pagella}{4}} {} + {\SampleOne{pagella}{5}} {} + {\SampleOne{pagella}{6}} {} + {\SampleOne{modern} {1}} {} + {\SampleOne{modern} {2}} {} + {\SampleOne{modern} {3}} {} + {\SampleOne{modern} {4}} {} + {\SampleOne{modern} {5}} {} + {\SampleOne{modern} {6}} {} +\stopcombination +\stopbuffer + +\startplacefigure[title={Design sizes beyond their design size (1).},reference=fig:designsizes:1] + \getbuffer +\stopplacefigure + +\def\SampleOne#1#2{\switchtobodyfont[#1]\scale[scale=#2000]{\im{2\char\getmathcharone`2 \char\getmathchartwo`2}}} + +\startplacefigure[title={Design sizes beyond their design size (2).},reference=fig:designsizes:2] + \getbuffer +\stopplacefigure + +With arbitrary scaling \quote {design size} no longer is a meaningful concept but +(intended) usage might be; we could just drop the \quote {sizes} and stick to +\quote {design} or maybe go for \quote {design variants} or simply \quote +{usage}. So, that is what in \CONTEXT\ we will carry on. That still leaves the +user the horrible task of figuring out all these weights, because in the worst +case all the usage sets (3-5) combined with weights (3-8) will give us (9-40) +setups to come up with and then choose from. Of course we can decide that the +regular shape is what the designer came up with and that the rest is just +marketing and bit of technical show-off. And if it's all too much work for a +user, the regular shapes a good choice anyway. I wonder if readers really care +that much, especially when they read on devices instead of proper high resolution +print. + +\stopsubsection + +\startsubsection[title=A system] + +Mainly because, as shown above, \TEX\ shipped with Computer Modern in several +design sizes the low level font system is designed to deal with that. This means +that setups for \MKII\ look more complex than those for \MKIV\ and \LMTX, +although deep down the same mechanism is active. + +Most fonts come with normal, bold, italic and bolditalic variants and for such a +basic set of four, defining a typescript is relatively easy. If we don't need to +access the specific fonts by name (like \typ {MyFontSerif}) we can just map +(file)names onto \type {Serif} directly. If the \quote {select font} mechanism is +used (\typ {\definefontfamily}) one doesn't even make typescripts but that +assumes that we can reliably resolve fontnames. + +So how, in the perspective of the mentioned (usage specific) font variants does +one set up a system. I will use Iwona as an example because that font comes in +different variants. For that font we have the following choices: + +\startlines +iwona iwona-light iwona-medium iwona-heavy +iwona-cond iwona-light-cond iwona-medium-cond iwona-heavy-cond +\stoplines + +\startbuffer[iwona-use] +\usebodyfont[iwona] +\usebodyfont[iwona-heavy] +\usebodyfont[iwona-cond] +\stopbuffer + +Say that we know that we use, we can instruct \CONTEXT\ to preload these so that +we don't get local definitions and loading when we use one of them grouped, as in +a section title. + +\typebuffer[iwona-use] + +These names are a bit too bound to the fontname so we introduce some abstraction: + +\startbuffer[iwona-abstract] +\aliasbodyfont[mainfont] [iwona] +\aliasbodyfont[titlefont][iwona-heavy] +\aliasbodyfont[notefont] [iwona-cond] +\stopbuffer + +\typebuffer[iwona-abstract] + +\startbuffer[iwona-demo] +\setupbodyfont[mainfont] +\setuphead[chapter][style=\switchtobodyfont[titlefont]\tfd] +\setuphead[section][style=\switchtobodyfont[titlefont]\tfc] +\setupnotes[bodyfont={notefont,small}] + +\starttext + +\startchapter[title=Demo] +\startsection[title=Demo] +\samplefile {tufte} \footnote{\samplefile{tufte}} +\stopsection +\stopchapter + +\stoptext +\stopbuffer + +\typebuffer[iwona-demo] + +We see the result in \in {figure} [fig:iwona:demo] and when that example is +processed the log tells that quite some fonts got loaded: 18. The majority is +traditional math fonts that get assembled into a pseudo \OPENTYPE\ font. + +\startplacefigure[default=page,title={An example font setup},reference=fig:iwona:demo] + \scale[width=\textwidth]{\typesetbuffer[iwona-use,iwona-abstract,iwona-demo]} +\stopplacefigure + +The log also mentions: {\tt 28 instances, 24 shared in backend, 2 common vectors, +22 common hashes, load time 0.615 seconds}. When we start the document with: + +\starttyping +\enableexperiments[fonts.compact] +\stoptyping + +We can see that less instances are loaded: {\tt 6 instances, 2 shared in backend, +2 common vectors, 0 common hashes, load time 0.154 seconds}. We also save half a +second. All this is because we now enabled scaling on-the-fly. + +\stopsubsection + +\startsubsection[title=Relations] + +There is a lot of history behind the font system. We started out with design +sizes and features distributed over fonts. So, at the lowest level we had to +handle for instance small caps and oldstyle via specific definitions. A tenpoint +definition looked similar to a twelvepoint but with different font names. On top +of that there were more general (and abstract) definitions as well as size +specific mappings to larger or smaller variants of the fonts used at that size. + +With a single design size a setup is much simpler but it still uses that granular +low level mechanism. In all of this, typescripts play an important role: they are +recipes that relate symbolic names to files, and use these symbolic names in +assemblies of fonts. Eventually a combination of serif, sans, mono and math is +defined, even if most fonts don't have these four available. In that case we +combine different designs. + +We could come up with a new system and it could even be a bit faster but we also +need to keep compatibility in mind. It is not trivial to come up with something +better (read: more \LMTX-ish) that is backward compatible. The default setup for +a bodyfont is a rather safe one but not always the best for every body font. +Without complicatign the existing mechanisms too much some extensions in for +instance the bodyfont environment system were possible, for instance: + +% \setupbodyfontenvironment +% [metric] +% [ +% small=0.7, +% interlinespace=1.4, +% ] + +\starttyping +\definebodyfontenvironment[iwona] [default][metric] +\definebodyfontenvironment[iwona-heavy][default][metric] +\definebodyfontenvironment[iwona-cond] [default][metric] +\stoptyping + +where \type {metric} is a predefined setup and \type {default} indicates that all +unset sizes use that one. You can define your own or adapt the predefined ones. + +\starttyping +\setupbodyfontenvironment + [metric] + [small=0.7] +\stoptyping + +or + +\starttyping +\setupbodyfontenvironment + [metric] + [interlinespace=1.4] +\stoptyping + +for a line height relative to the bodyfont size. Although this seldom happens +you can be even mor granular. Say that you have + +\starttyping +\definetypeface [DejavuA] [rm] [serif] [dejavu] [default] +\definetypeface [DejavuA] [ss] [sans] [dejavu] [default] +\definetypeface [DejavuA] [tt] [mono] [dejavu] [default] +\definetypeface [DejavuA] [mm] [math] [dejavu] [default] +\stoptyping + +We can now make the sans a bit smaller: + +\starttyping +\definebodyfontenvironment + [DejavuA] [ss] [default] + [text=0.95, ...] +\stoptyping + +and a specific bodyfont size even more: + +\starttyping +\definebodyfontenvironment + [DejavuA] [ss] [8pt] + [text=0.85, ...] +\stoptyping + +Of course this kind of setups can best be achieved with an isolated, stepwise +written environment file because testing it on a huge and versatile document +source is not much fun. + +\stopsubsection + +% TODO: set tx to be some other bodyfont but with same interlinespace + +\stopsection + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-introduction.tex b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-introduction.tex index d0e844d1f0c..010fd079ae7 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-introduction.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-introduction.tex @@ -93,3 +93,22 @@ Summer 2011 \endash\ Spring 2016 \stopchapter \stopcomponent + +% When visiting one of our small town supermarkets I often observe how well suited +% these are for kids to explore their abilities due to the partime jobs they offer: +% human interaction, problem solving, calculus, working together, taking +% initiatives come to mind. It is therefore in my opinion one these cases where +% further automation (like self scan counters) is going to backfire on society. +% These micro societies with various tasks to perform are perfect low risk learning +% environments. + +% In a similar fashion one can observe the way fonts are used in documents. It is +% all about making choices, setting up a consistent system, suitability to the task +% and kind of document, not going overboard in features, sizes, variants and more. +% One might need to improvise and compromise. It is a good learning environment. +% One can argue that the more we automate the less opportunity there is for users +% to explore. + +% That said, a \TEX\ ecosystem has to provide some tools to make it possible to set +% up fonts, and can best hide some nasty (and messy) details, but at the same time +% has to provide enough flexibility to explore and educate. diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-math.tex b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-math.tex index 745a5e9cb6a..e69612d5521 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-math.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-math.tex @@ -276,6 +276,8 @@ glyphs and building special constructs. The same is true for spacing. Although math fonts do have kerning information, most of the math spacing is controlled by properties of characters and not by the font. +\startmkivmode + \unexpanded\def\SampleLine#1% {\NC \type{$a #1{+} b$} @@ -299,6 +301,8 @@ according to their usage. \footnote {There are a few more commands, like \type {\mathlimop}, \type {\mathnolop} and \type {mathbox} but these are used differently.} +\stopmkivmode + With \TEX\ being the oldest and still dominant math renderer it is no surprise that \MICROSOFT\ modelled its math renderer after \TEX\ and Cambria quite well suits the concept. In retrospect it is somewhat unfortunate that we're still @@ -776,12 +780,12 @@ command. An example is the fence mechanism: \definemathfence [fancybracket] [bracket] [color=darkblue] -\definemathfence +\definemathfence % mkiv: command, mkxl: define [smallbracket] [bracket] - [command=yes,color=darkgreen,mathstyle=small] -\definemathfence + [command=yes,define=yes,color=darkgreen,mathstyle=small] +\definemathfence % mkiv: command, mkxl: define [normalbracket] [bracket] - [command=yes,color=darkred] + [command=yes,define=yes,color=darkred] \stopbuffer \typebuffer \getbuffer diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-mkiv.tex b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-mkiv.tex index 79d9535741f..21b9c6ce597 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-mkiv.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/fonts/fonts-mkiv.tex @@ -67,6 +67,7 @@ \component fonts-extensions \component fonts-hooks \component fonts-tricks + \component fonts-compact \stopbodymatter \startappendices diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/graphics/graphics.tex b/Master/texmf-dist/doc/context/sources/general/manuals/graphics/graphics.tex index 97785c1700b..92a225d2689 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/graphics/graphics.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/graphics/graphics.tex @@ -52,8 +52,8 @@ -- kind of self-explaining: - local xsize = 210 - local ysize = 297 + local xsize = 255 + local ysize = 255 local colordepth = 1 local usemask = true local colorspace = "rgb" @@ -73,7 +73,7 @@ local d = data[i] local m = mask[i] for j=1,xsize do - d[j] = { i, max(i,j), j, min(i,j) } + d[j] = { i, max(i,j), min(i,j) } m[j] = random(minmask,maxmask) end end @@ -147,8 +147,8 @@ become a linked list of so called nodes: glyphs, kerns, glue, rules, boxes and a couple of more items. But, when doing the job, \TEX\ is only interested in dimensions. -In traditional \TEX\ an image inclusion happens via the extension primitive -\type {\special}, so you can think of something: +In traditional \TEX\ an image inclusion happens via the extension primitive \type +{\special}, so you can think of something: \starttyping \vbox to 10cm {% @@ -389,10 +389,10 @@ The actually inclusion of this image happened with: % point but for now you need to enable that explicitly: % % \starttyping[option=TEX] -% \enabledirectrive[graphics.pdf.uselua] -% \enabledirectrive[graphics.jpg.uselua] -% \enabledirectrive[graphics.jp2.uselua] -% \enabledirectrive[graphics.png.uselua] +% \enabledirective[graphics.pdf.uselua] +% \enabledirective[graphics.jpg.uselua] +% \enabledirective[graphics.jp2.uselua] +% \enabledirective[graphics.png.uselua] % \stoptyping % % All four can be enabled with: diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-accuracy.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-accuracy.tex new file mode 100644 index 00000000000..9247de48377 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-accuracy.tex @@ -0,0 +1,335 @@ +% language=us runpath=texruns:manuals/lowlevel + +\environment lowlevel-style + +\startdocument + [title=accuracy, + color=darkgray] + +\startsectionlevel[title=Introduction] + +When you look at \TEX\ and \METAPOST\ output the accuracy of the rendering stands +out, unless of course you do a sloppy job on design and interfere badly with the +system. Much has to do with the fact that calculations are very precise, +especially given the time when \TEX\ was written. Because \TEX\ doesn't rely on +(at that time non|-|portable) floating point calculations, it does all with 32 +bit integers, except in the backend where glue calculations are used for +finalizing the glue values. It all changed a bit when we added \LUA\ because +there we mix integers and doubles but in practice it works out okay. + +When looking at floating point (and posits) one can end up in discussions about +which one is better, what the flaws fo each are, etc. Here we're only interested +in the fact that posits are more accurate in the ranges where \TEX\ and +\METAPOST\ operate, as well as the fact that we only have 32 bits for floats in +\TEX, unless we patch more heavily. So, it is also very much about storage. + +When you work with dimensions like points, they get converted to an integer +number (the \type {sp} unit) and from that it's just integer calculations. The +maximum dimension is \the\maxdimen, which already shows a rounding issue. Of +course when one goes precise for sure there is some loss, but on the average +we're okay. So, in the next example the two last rows are equivalent: + +\starttabulate[|Tr|r|r|] +\NC .1pt \NC \the\dimexpr.1pt \relax \NC \number\dimexpr.1pt \relax sp \NC \NR +\NC .2pt \NC \the\dimexpr.2pt \relax \NC \number\dimexpr.2pt \relax sp \NC \NR +\NC .3pt \NC \the\dimexpr.3pt \relax \NC \number\dimexpr.3pt \relax sp \NC \NR +\NC .1pt + .2pt \NC \the\dimexpr.1pt+.2pt\relax \NC \number\dimexpr.1pt+.2pt\relax sp \NC \NR +\stoptabulate + +When we're at the \LUA\ end things are different, there numbers are mapped onto +64 bit floating point variables (doubles) and not all numbers map well. This is +what we get when we work with doubles in \LUA: + +\starttabulate[|Tr|r|] +\NC .1 \NC \luaexpr{.1 } \NC \NR +\NC .2 \NC \luaexpr{.2 } \NC \NR +\NC .3 \NC \luaexpr{.3 } \NC \NR +\NC .1 + .2 \NC \luaexpr{.1+.2} \NC \NR +\stoptabulate + +The serialization looks as if all is okay but when we test for equality there +is a problem: + +\starttabulate[|Tr|l|] +\NC .3 == .3 \NC \luaexpr{tostring( .3 == .3)} \NC \NR +\NC .1 + .2 == .3 \NC \luaexpr{tostring(.1 + .2 == .3)} \NC \NR +\stoptabulate + +This means that a test like this can give false positives or negatives unless one +tests the difference against the accuracy (in \METAPOST\ we have the {eps} +variable for that). In \TEX\ clipping of the decimal fraction influences equality. + +\starttabulate[|Tr|l|] +\NC \type{\iflua { .3 == .3 } Y\else N\fi} \NC \iflua{ .3 == .3} equal\else different\fi \NC \NR +\NC \type{\iflua { .1 + .2 == .3 } Y\else N\fi} \NC \iflua{.1 + .2 == .3} equal\else different\fi \NC \NR +\stoptabulate + +The serialization above misguides us because the number of digits displayed is +limited. Actually, when we would compare serialized strings the equality holds, +definitely within the accuracy of \TEX. But here is reality: + +\startluacode + local a = 0.1 + local b = 0.2 + local c = 0.3 + local d = a + b + local NC, NR = context.NC, context.NR + local function show(f) + context.NC() context(context.escaped(f)) + context.NC() context(f,c) + context.NC() context(f,d) + context.NC() context.NR() + end + context.starttabulate { "|T|l|l|" } + context.NC() + context.NC() context(".3") + context.NC() context(".1 + .2") + context.NC() context.NR() + -- show("%0.05g",c) + show("%0.10g",c) + show("%0.17g",c) + show("%0.20g",c) + show("%0.25g",c) + context.stoptabulate() +\stopluacode + +The above examples use $0.1$, $0.2$ and $0.3$ and on a 32 bit float that actually +works out okay, but \LUAMETATEX\ is 64 bit. Is this really important in practice? +There are indeed cases where we are bitten by this. At the \LUA\ end we seldom +test for equality on calculated values but it might impact check for less or +greater then. At the \TEX\ end there are a few cases where we have issues but +these also relate to the limited precision. It is not uncommon to loose a few +scaled points so that has to be taken into account then. So how can we deal with +this? In the next section(s) an alternative approach is discussed. It is not so +much the solution for all problems but who knows. + +\stopsectionlevel + +\startsectionlevel[title=Posits] + +% TODO: don't check for sign (1+2) + +The next table shows the same as what we started with but with a different +serialization. + +\starttabulate[|Tr|r|] +\NC .1 \NC \positunum{.1 } \NC \NR +\NC .2 \NC \positunum{.2 } \NC \NR +\NC .3 \NC \positunum{.3 } \NC \NR +\NC .1 + .2 \NC \positunum{.1 + .2} \NC \NR +\stoptabulate + +And here we get equality in both cases: + +\starttabulate[|Tr|l|] +\NC .3 == .3 \NC \positunum{ .3 == .3} \NC \NR +\NC .1 + .2 == .3 \NC \positunum{.1 + .2 == .3} \NC \NR +\stoptabulate + +The next table shows what we actually are dealing with. The \type {\if}|-|test is +not a primitive but provided by \CONTEXT. + +\starttabulate[|Tr|l|] +\NC \type{\ifpositunum { .3 == .3 } Y\else N\fi} \NC \ifpositunum{ .3 == .3} equal\else different\fi \NC \NR +\NC \type{\ifpositunum { .1 + .2 == .3 } Y\else N\fi} \NC \ifpositunum{.1 + .2 == .3} equal\else different\fi \NC \NR +\stoptabulate + +And what happens when we do more complex calculations: + +\starttabulate[|Tr|l|] +\NC \type {math .sin(0.1 + 0.2) == math .sin(0.3)} \NC \luaexpr{tostring(math.sin(0.1 + 0.2) == math.sin(0.3))} \NC \NR +\NC \type {posit.sin(0.1 + 0.2) == posit.sin(0.3)} \NC \positunum{sin(0.1 + 0.2) == sin(0.3)} \NC \NR +\stoptabulate + +Of course other numbers might work out differently! I just took the simple tests +that came to mind. + +So what are these posits? Here it's enough to know that they are a different way +to store numbers with fractions. They still can loose precision but a bit less on +smaller values and often we have relative small values in \TEX. Here are some links: + +\starttyping +https://www.johngustafson.net/pdfs/BeatingFloatingPoint.pdf +https://posithub.org/conga/2019/docs/14/1130-FlorentDeDinechin.pdf +\stoptyping + +There are better explanations out there than I can provide (if at all). When I +first read about these unums (a review of the 2015 book \quotation {The End of +Error Unum Computing}) I was intrigued and when in 2023 I read something about it +in relation to RISCV I decided to just add this playground for the users. After +all we also have decimal support. And interval based solutions might actually be +good for \METAPOST, so that is why we have it as extra number model. There we +need to keep in mind that \METAPOST\ in non scaled models also apply some of the +range checking and clipping that happens in scaled (these magick 4096 tricks). + +For now it is enough to know that it's an alternative for floats that {\em could} +work better in some cases but not all. The presentation mentioned above gives +some examples of physics constants where 32 posits are not good enough for +encoding the extremely large or small constants, but for $\pi$ it's all fine. +\footnote {Are 64 bit posits actually being worked on in softposit? There are +some commented sections. We also need to patch some unions to make it compile as +C.} In double mode we actually have quite good precision compared to 32 bit +posits but with 32 bit floats we gain some. Very small numbers and very large +numbers are less precise, but around 1 we gain: the next value after 1 is +1.0000001 for a float and 1.000000008 for a posit (both 32 bit). So, currently +for \METAPOST\ there is no real gain but if we'd add posits to \TEX\ we could +gain some because there a halfword (used for storing data) is 32 bit. + +But how about \TEX ? Per April 2023 the \LUAMETATEX\ engine has native support +for floats (this in addition to \LUA\ based floats that we already had in +\CONTEXT). How that works can be demonstrated with some examples. The float +related commands are similar to those for numbers and dimensions: \typ +{\floatdef}, \typ {\float}, \typ {\floatexpr}, \typ {\iffloat}, \typ +{\ifzerofloat} and \typ {\ifintervalfloat}. That means that we also have them as +registers. The \typ {\positdef} primitive is similar to \typ {\dimensiondef}. +When a float (posit) is seen in a dimension context it will be interpreted as +points, and in an integer context it will be a rounded number. As with other +registers we have a \typ {\newfloat} macro. The \typ {\advance}, \typ +{\multiply} and \typ {\divide} primitives accept floats. + +\startbuffer[reset] +\scratchdimen=1.23456pt +\scratchfloat=1.23456 +\stopbuffer + +\typebuffer[reset] \getbuffer[reset] + +We now use these two variables in an example: + +\startbuffer[dimensions] +\setbox0\hbox to \scratchdimen {x}\the\wd0 +\scratchdimen \dimexpr \scratchdimen * 2\relax +\setbox0\hbox to \scratchdimen {x}\the\wd0 +\advance \scratchdimen \scratchdimen +\setbox0\hbox to \scratchdimen {x}\the\wd0 +\multiply\scratchdimen by 2 +\setbox0\hbox to \scratchdimen {x}\the\wd0 +\stopbuffer + +\typebuffer[dimensions] \startlines\darkblue\tttf\getbuffer[reset,dimensions]\stoplines + +When we use floats we get this: + +\startbuffer[floats] +\setbox0\hbox to \scratchfloat {x}\the\wd0 +\scratchfloat \floatexpr \scratchfloat * 2\relax +\setbox0\hbox to \scratchfloat {x}\the\wd0 +\advance \scratchfloat \scratchfloat +\setbox0\hbox to \scratchfloat {x}\the\wd0 +\multiply\scratchfloat by 2 +\setbox0\hbox to \scratchfloat {x}\the\wd0 +\stopbuffer + +\typebuffer[floats] \startlines\darkblue\tttf\getbuffer[reset,floats]\stoplines + +So which approach is more accurate? At first sight you might think that the +dimensions are better because in the last two lines they indeed duplicate. +However, the next example shows that with dimensions we lost some between steps. + +\startbuffer[noboxes] + \the\scratchfloat +\scratchfloat \floatexpr \scratchfloat * 2\relax \the\scratchfloat +\advance \scratchfloat \scratchfloat \the\scratchfloat +\multiply\scratchfloat by 2 \the\scratchfloat +\stopbuffer + +\typebuffer[noboxes] \startlines\darkblue\tttf\getbuffer[reset,noboxes]\stoplines + +One problem with accuracy is that it can build up. So when one eventually does +some comparison the expectations can be wrong. + +\startbuffer +\dimen0=1.2345pt +\dimen2=1.2345pt + +\ifdim \dimen0=\dimen2 S\else D\fi \space +0sp: [dim] +\ifintervaldim0sp\dimen0 \dimen2 O\else D\fi \space +0sp: [0sp] + +\advance\dimen2 1sp + +\ifdim \dimen0=\dimen2 S\else D\fi \space +1sp: [dim] +\ifintervaldim 1sp \dimen0 \dimen2 O\else D\fi \space +1sp: [1sp] +\ifintervaldim 1sp \dimen2 \dimen0 O\else D\fi \space +1sp: [1sp] +\ifintervaldim 2sp \dimen0 \dimen2 O\else D\fi \space +1sp: [2sp] +\ifintervaldim 2sp \dimen2 \dimen0 O\else D\fi \space +1sp: [2sp] + +\advance\dimen2 1sp + +\ifintervaldim 1sp \dimen0\dimen2 O\else D\fi \space +2sp: [1sp] +\ifintervaldim 1sp \dimen2\dimen0 O\else D\fi \space +2sp: [1sp] +\ifintervaldim 5sp \dimen0\dimen2 O\else D\fi \space +2sp: [5sp] +\ifintervaldim 5sp \dimen2\dimen0 O\else D\fi \space +2sp: [5sp] +\stopbuffer + +\typebuffer + +Here we show a test for overlap in values, the same can be done with integer +numbers (counts) and floats. This interval checking is an experiment and we'll +see it if gets used. + +\startpacked\darkblue \tttf \getbuffer \stoppacked + +There are also \typ {\ifintervalfloat} and \typ{\ifintervalnum}. Because I have +worked around these few scaled point rounding issues for decades, it might +actually take some time before we see the interval tests being used in \CONTEXT. +After all, there is no reason to touch somewhat tricky mechanism without reason +(read: users complaining). + +To come back to posits, just to be clear, we use 32 bit posits and not 32 bit +floats, which we could have but that way we gain some accuracy because less bits +are used by default for the exponential. + +In \CONTEXT\ we also provide a bunch of pseudo primitives. These take one float: +\type {\pfsin}, \type {\pfcos}, \type {\pftan}, \type {\pfasin}, \type {\pfacos}, +\type {\pfatan}, \type {\pfsinh}, \type {\pfcosh}, \type {\pftanh}, \type +{\pfasinh}, \type {\pfacosh}, \type {\pfatanh}, \type {\pfsqrt}, \type {\pflog}, +\type {\pfexp}, \type {\pfceil}, \type {\pffloor}, \type {\pfround}, \type +{\pfabs}, \type {\pfrad} and \type {\pfdeg}, whiel these expect two floats: \type +{\pfatantwo}, \type {\pfpow}, \type {\pfmod} and \type {\pfrem}. + +% \pageextragoal = 5sp + +\stopsectionlevel + +\startsectionlevel[title=\METAPOST] + +In addition to the instances \typ {metafun} (double in \LMTX), \typ {scaledfun}, +\typ {doublefun}, \typ {decimalfun} we now also have \typ {positfun}. Because we +currently use 32 bit posits in the new number system there is no real gain over +the already present 64 bit doubles. When 64 bit posits show up we might move on +to that. + +\stopsectionlevel + +\startsectionlevel[title=\LUA] + +We support posits in \LUA\ too. Here we need to create a posit user data +object. The usual metatable magick kicks in: + +\starttyping +local p = posit.new(123.456) +local q = posit.new(789.123) +local r = p + q +\stoptyping + +Here we just mention what is currently interface. The management functions are: +\typ {new}, \type {copy}, \typ {tostring}, \typ {tonumber}, \typ {integer}, \typ +{rounded}, \typ {toposit} and \typ {fromposit}. The usual operators are also +supported: \type{+}, \type{-}, \type{*}, \type{/}, \type{^}, as well as the +binary \type {|}. \type {&}, \type {~}, \type {<<} and \type {>>}. We can compare +with \type {==}, \type {>=}, \type {<=} and \type {~=}. The more verbose \type +{bor}, \type {bxor}, \type {band}, \type {shift}, \type {rotate} are there too. + +There is a subset of math provided: \type {min}, \type {max}, \type {abs}, \type +{conj}, \type {modf}, \type {acos}, \type {asin}, \type {atan}, \type {ceil}, +\type {cos}, \type {exp}, \type {exp2}, \type {floor}, \type {log}, \type +{log10}, \type {log1p}, \type {log2}, \type {logb}, \type {pow}, \type {round}, +\type {sin}, \type {sqrt} and \type {tan}. Somewhat special are \type {NaN} and +\type {NaR}. + +Currently integer division (\type {//}) and modulo (\type {%}) are not available, +but that might happen at some time. + +\stopsectionlevel + +\stopdocument diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex index a70e222ea77..7962e5420ed 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex @@ -624,10 +624,11 @@ Spans are applied at the end so you see a mix of templates applied. {\showboxes\getbuffer[blownup-2]} -When you define an alignment inside a macro, you need to duplicate the \type {\alignmark} -signals. This is similar to embedded macro definitions. But in \LUAMETATEX\ we can get -around that by using \type {\aligncontent}. Keep in mind that when the preamble is scanned there -is no doesn't expand with the exception of the token after \type {\span}. +When you define an alignment inside a macro, you need to duplicate the \type +{\alignmark} signals. This is similar to embedded macro definitions. But in +\LUAMETATEX\ we can get around that by using \type {\aligncontent}. Keep in mind +that when the preamble is scanned there is no doesn't expand with the exception +of the token after \type {\span}. \startbuffer \halign \bgroup @@ -792,6 +793,163 @@ like tabulate. \stopsectionlevel +\startsectionlevel[title=Templates] + +The \type {\omit} command signals that the template should not be applied. But +what if we actually want something at the left and right of the content? Here is +how it's done: + +\startbuffer +\tabskip10pt \showboxes +\halign\bgroup + [\hss\aligncontent\hss]\aligntab + [\hss\aligncontent\hss]\aligntab + [\hss\aligncontent\hss]\cr + x\aligntab x\aligntab x\cr + xx\aligntab xx\aligntab xx\cr + xxx\aligntab xxx\aligntab xxx\cr + \omit oo\aligntab\omit oo\aligntab\omit oo\cr + xx\aligntab\realign{\hss(}{)\hss}xx\aligntab xx\cr + \realign{\hss(}{)\hss}xx\aligntab xx\aligntab xx\cr +\egroup +\stopbuffer + +\typebuffer[option=TEX] + +The \type {\realign} command is like an \type {omit} but it expects two token +lists that will for this cell be used instead of the ones from the preamble. +While \type {\omit} also skips insertion of \type {\everytab}, here it is +inserted, just like with normal preambles. + +\start \blank \getbuffer \blank \stop + +It will probably take a while before I'll apply this in \CONTEXT\ because changing +existing (stable) table environment is not something done lightly. + +\stopsectionlevel + +\startsectionlevel[title=Pitfalls] + +Alignment have a few properties that can catch you off|-|guard. One is the use of +\type {\everycr}. The next example demonstrates that it is also injected after the +preamble definition. + +\startbuffer +\everycr{\noalign{\hrule}} +\halign\bgroup \hsize 5cm \strut \alignmark\cr one\cr two\cr\egroup +\stopbuffer + +\typebuffer[option=TEX] + +This makes sense because it is one way to make sure that for instance a rule gets +the width of the cell. + +\startpacked +\showboxes \getbuffer +\stoppacked + +The sam eis of course true for a vertical align: + +\startbuffer +\everycr{\noalign{\vrule}} +\valign\bgroup \hsize 4cm \strut \aligncontent\cr one\cr two\cr\egroup +\stopbuffer + +\typebuffer[option=TEX] + +We set the width because otherwise the current text width is used. + +\startpacked +\showboxes \getbuffer +\stoppacked + +Something similar happens with a \type {\tabskip}: the value set before the +alignment is used left of the first cell. + +\startbuffer +\tabskip10pt +\halign\bgroup \tabskip20pt\relax\aligncontent\cr x\cr x\cr \egroup +\stopbuffer + +\typebuffer[option=TEX] + +\startpacked +\showboxes \getbuffer +\stoppacked + +The \type {\tabskip} outside the alignment is an internal glue register so you +can for instance use the prefix \type {\global}. However, in a preamble it is +more a directive: the given value is stored with the cell. This means that the +next code is invalid: + +\starttyping +\tabskip10pt +\halign\bgroup \global\tabskip20pt\relax\aligncontent\cr x\cr x\cr \egroup +\stoptyping + +The parser looks at tokens in the preamble, sees the \type {\global} and appends +it to the current pre|-|part of the cell's template. Then it sees a \type +{\tabskip} and assigns the value after it to the cell's skip. The token and its +value just disappear, they are not appended to the template. Now, when the +template is injected (and interpreted) this \type {\global} expects a variable +next and in our case the \type {x} doesn't qualify. The next snippet however works +okay: + +\startbuffer +\scratchcounter0 +\halign\bgroup + \global\tabskip40pt\relax\advance\scratchcounter\plusone\aligncontent\cr + x:\the\scratchcounter\cr + x:\the\scratchcounter\cr + x:\the\scratchcounter\cr +\egroup +\stopbuffer + +\typebuffer[option=TEX] + +Here the \type {\global} is applied to the \type {advance} because the skip +definition is {\em not} in the preamble. + +\start \blank \getbuffer \blank \stop + +Here is a variant: + +\startbuffer +\scratchcounter0 +\halign\bgroup + \global\tabskip10pt\relax\aligncontent\cr + \advance\scratchcounter\plusone x:\the\scratchcounter\cr + \advance\scratchcounter\plusone x:\the\scratchcounter\cr + \advance\scratchcounter\plusone x:\the\scratchcounter\cr +\egroup +\stopbuffer + +\typebuffer[option=TEX] + +Again the \type {\global} stays and this time if ends up before the content which +starts with an \type {\advance}. + +\start \getbuffer \stop + +Normally you will not need the next trickery but it shows that cells are grouped: + +\startbuffer +\halign\bgroup\aligncontent\cr + 1\atendofgrouped{A}\atendofgrouped{B}\cr + 2\aftergrouped {A}\aftergrouped {B}\cr + 3 \cr +\egroup +\stopbuffer + +\typebuffer[option=TEX] + +Maybe at some point I'll add something a bit more tuned for dealing with cells, +but here is what you get with the above: + +\getbuffer + +\stopsectionlevel + \startsectionlevel[title=Remark] It can be that the way alignments are interfaced with respect to attributes is a bit @@ -828,3 +986,14 @@ to add these. % \omit\span \hss ccc\hss\cr % \egroup \egroup % \egroup + +% \protected\def\oof#1{[#1]} +% \def\foo{\aligncontent} +% \def\foo{\oof{\aligncontent}} + +% \halign\bgroup +% \hss\span\foo\hss\cr +% x\cr +% \omit xx\cr +% xxx\cr +% \egroup diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex index e2e34bd20a8..086b1313177 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex @@ -177,7 +177,6 @@ some so called struts to enforce a consistent height and depth. A strut is an invisible quantity (consider it a black box) that enforces consistent line dimensions: height and depth. - \startlinecorrection {\dontcomplain\hbox{\showstruts\showboxes\getbuffer}} \stoplinecorrection diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-grouping.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-grouping.tex index 12d12f7f4d4..47d79648615 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-grouping.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-grouping.tex @@ -12,7 +12,7 @@ This is a rather short explanation. I decided to write it after presenting the other topics at the 2019 \CONTEXT\ meeting where there was a question about grouping. -\stopsectionlevel +% \stopsectionlevel \startsectionlevel[title=\PASCAL] @@ -36,7 +36,7 @@ to pack a sequence of statements. In \TEX\ macros (or source code) the following can occur: -\starttyping +\starttyping[option=TEX] \begingroup ... \endgroup @@ -44,7 +44,7 @@ In \TEX\ macros (or source code) the following can occur: as well as: -\starttyping +\starttyping[option=TEX] \bgroup ... \egroup @@ -54,7 +54,7 @@ Here we really group in the sense that assignments to variables inside a group are forgotten afterwards. All assignments are local to the group unless they are explicitly done global: -\starttyping +\starttyping[option=TEX] \scratchcounter=1 \def\foo{foo} \begingroup @@ -70,7 +70,7 @@ counterpart is now two. The \type {\foo} macro is also changed globally. Although you can use both sets of commands to group, you cannot mix them, so this will trigger an error: -\starttyping +\starttyping[option=TEX] \bgroup \endgroup \stoptyping @@ -86,19 +86,19 @@ of \TEX. The \METAPOST\ language also has a concept of grouping but in this case it's more like a programming language. -\starttyping +\starttyping[option=MP] begingroup ; n := 123 ; -engroup ; +endgroup ; \stoptyping In this case the value of \type {n} is 123 after the group is left, unless you do this (for numerics there is actually no need to declare them): -\starttyping +\starttyping[option=MP] begingroup ; save n ; numeric n ; n := 123 ; -engroup ; +endgroup ; \stoptyping Given the use of \METAPOST\ (read: \METAFONT) this makes a lot of sense: often @@ -116,7 +116,7 @@ saved inside a group. In \LUA\ all assignments are global unless a variable is defines local: -\starttyping +\starttyping[option=LUA] local x = 1 local y = 1 for i = 1, 10 do @@ -153,4 +153,305 @@ statement end, while in \METAPOST\ it does end a statement (expression). \stopsectionlevel +\stopsectionlevel + +\startsectionlevel[title=Kinds of grouping] + +Explicit grouping is accomplished by the two grouping primitives: + +\starttyping[option=TEX] +\begingroup + \sl render slanted here +\endgroup +\stoptyping + +However, often you will find this being used: + +\starttyping[option=TEX] +{\sl render slanted here} +\stoptyping + +This is not only more compact but also avoids the \type {\endgroup} gobbling +following spaces when used inline. The next code is equivalent but also suffers +from the gobbling: + +\starttyping[option=TEX] +\bgroup + \sl render slanted here +\egroup +\stoptyping + +The \type {\bgroup} and \type {\egroup} commands are not primitives but aliases +(made by \type {\let}) to the left and right curly brace. These two characters +have so called category codes that signal that they can be used for grouping. The +{\em can be} here suggest that there are other purposes and indeed there are, for +instance in: + +\starttyping[option=TEX] +\toks 0 = {abs} +\hbox {def} +\stoptyping + +In the case of a token list assignment the curly braces fence the assignment, so scanning +stops when a matching right brace is found. The following are all valid: + +\starttyping[option=TEX] +\toks 0 = {a{b}s} +\toks 0 = \bgroup a{b}s} +\toks 0 = {a{\bgroup b}s} +\toks 0 = {a{\egroup b}s} +\toks 0 = \bgroup a{\bgroup b}s} +\toks 0 = \bgroup a{\egroup b}s} +\stoptyping + +They have in common that the final fence has to be a right brace. That the first +one can be a an alias is due to the fact that the scanner searches for a brace +equivalent when it looks for the value. Because the equal is optional, there is +some lookahead involved which involves expansion and possibly push back while +once scanning for the content starts just tokens are collected, with a fast +check for nested and final braces. + +In the case of the box, all these specifications are valid: + +\starttyping[option=TEX] +\hbox {def} +\hbox \bgroup def\egroup +\hbox \bgroup def} +\hbox \bgroup d{e\egroup f} +\hbox {def\egroup +\stoptyping + +This is because now the braces and equivalent act as grouping symbols so as long +as they match we're fine. There is a pitfall here: you cannot mix and match +different grouping, so the next issues an error: + +\starttyping[option=TEX] +\bgroup xxx\endgroup % error +\begingroup xxx\egroup % error +\stoptyping + +This can make it somewhat hard to write generic grouping macros without trickery +that is not always obvious to the user. Fortunately it can be hidden in macros +like the helper \typ {\groupedcommand}. In \LUAMETATEX\ we have a clean way out +of this dilemma: + +\starttyping[option=TEX] +\beginsimplegroup xxx\endsimplegroup +\beginsimplegroup xxx\endgroup +\beginsimplegroup xxx\egroup +\stoptyping + +When you start a group with \typ {\beginsimplegroup} you can end it in the three +ways shows above. This means that the user (or calling macro) doesn't take into +account what kind of grouping was used to start with. + +When we are in math mode things are different. First of all, grouping with \typ +{\begingroup} and \typ {\endgroup} in some cases works as expected, but because +the math input is converted in a list that gets processed later some settings can +become persistent, like changes in style or family. You can bet better use \typ +{\beginmathgroup} and \typ {\endmathgroup} as they restore some properties. We +also just mention the \type {\frozen} prefix that can be used to freeze +assignments to some math specific parameters inside a group. + +\stopsectionlevel + +\startsectionlevel[title=Hooks] + +In addition to the original \type {\aftergroup} primitive we have some more +hooks. They can best be demonstrated with an example: + +\startbuffer +\begingroup \bf + % + \aftergroup A \aftergroup 1 + \atendofgroup B \atendofgroup 1 + % + \aftergrouped {A2} + \atendofgrouped {B2} + % + test +\endgroup +\stopbuffer + +\typebuffer[option=TEX] + +These collectors are accumulative. Watch how the bold is applied to what we +inject before the group ends. + +\getbuffer + +\stopsectionlevel + +\startsectionlevel[title=Local versus global] + +When \TEX\ enters a group and an assignment is made the current value is stored +on the save stack, and at the end of the group the original value is restored. In +\LUAMETATEX\ this mechanism is made a bit more efficient by avoiding redundant +stack entries. This is also why the next feature can give unexpected results when +not used wisely. + +Now consider the following example: + +\startbuffer +\newdimension\MyDimension + +\starttabulate[||||] + \NC \MyDimension10pt \the\MyDimension + \NC \advance\MyDimension10pt \the\MyDimension + \NC \advance\MyDimension10pt \the\MyDimension \NC \NR + \NC \MyDimension10pt \the\MyDimension + \NC \advance\MyDimension10pt \the\MyDimension + \NC \advance\MyDimension10pt \the\MyDimension \NC \NR +\stoptabulate +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +The reason why we get the same values is that cells are a group and therefore the +value gets restored as we move on. We can use the \type {\global} prefix to get +around this + +\startbuffer +\starttabulate[||||] + \NC \global \MyDimension10pt \the\MyDimension + \NC \global\advance\MyDimension10pt \the\MyDimension + \NC \global\advance\MyDimension10pt \the\MyDimension \NC \NR + \NC \global \MyDimension10pt \the\MyDimension + \NC \global\advance\MyDimension10pt \the\MyDimension + \NC \global\advance\MyDimension10pt \the\MyDimension \NC \NR +\stoptabulate +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +Instead of using a global assignment and increment we can also use the following + +\startbuffer +\constrained\MyDimension\zeropoint +\starttabulate[||||] + \NC \retained \MyDimension10pt \the\MyDimension + \NC \retained\advance\MyDimension10pt \the\MyDimension + \NC \retained\advance\MyDimension10pt \the\MyDimension \NC \NR + \NC \retained \MyDimension10pt \the\MyDimension + \NC \retained\advance\MyDimension10pt \the\MyDimension + \NC \retained\advance\MyDimension10pt \the\MyDimension \NC \NR +\stoptabulate +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +So what is the difference with the global approach? Say we have these two buffers: + +\startbuffer +\startbuffer[one] + \global\MyDimension\zeropoint + \framed { + \framed {\global\advance\MyDimension10pt \the\MyDimension} + \framed {\global\advance\MyDimension10pt \the\MyDimension} + } + \framed { + \framed {\global\advance\MyDimension10pt \the\MyDimension} + \framed {\global\advance\MyDimension10pt \the\MyDimension} + } +\stopbuffer + +\startbuffer[two] + \global\MyDimension\zeropoint + \framed { + \framed {\global\advance\MyDimension10pt \the\MyDimension} + \framed {\global\advance\MyDimension10pt \the\MyDimension} + \getbuffer[one] + } + \framed { + \framed {\global\advance\MyDimension10pt \the\MyDimension} + \framed {\global\advance\MyDimension10pt \the\MyDimension} + \getbuffer[one] + } +\stopbuffer +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +Typesetting the second buffer gives us: + +\startlinecorrection +\getbuffer[two] +\stoplinecorrection + +When we want to have these entities independent and not use different variables, +the global settings bleeding from one into the other entity is messy. Therefore +we can use this: + +\startbuffer +\startbuffer[one] + \constrained\MyDimension\zeropoint + \framed { + \framed {\retained \MyDimension10pt \the\MyDimension} + \framed {\retained\advance\MyDimension10pt \the\MyDimension} + } + \framed { + \framed {\retained \MyDimension10pt \the\MyDimension} + \framed {\retained\advance\MyDimension10pt \the\MyDimension} + } +\stopbuffer + +\startbuffer[two] + \constrained\MyDimension\zeropoint + \framed { + \framed {\retained\advance\MyDimension10pt \the\MyDimension} + \framed {\retained\advance\MyDimension10pt \the\MyDimension} + \getbuffer[one] + } + \framed { + \framed {\retained\advance\MyDimension10pt \the\MyDimension} + \framed {\retained\advance\MyDimension10pt \the\MyDimension} + \getbuffer[one] + } +\stopbuffer +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +Now we get this: + +\startlinecorrection +\getbuffer[two] +\stoplinecorrection + +The \type {\constrained} prefix makes sure that we have a stack entry, without +being clever with respect to the current value. Then the \type {\retained} prefix +can do its work reliably and avoid pushing the old value on the stack. Without +the constrain it gets a bit unpredictable because then it all depends on where +further up the chain the value was put on the stack. Of course one can argue that +we should not have the \quotation {save stack redundant entries optimization} but +that's not going to be removed. + +\stopsectionlevel + +\startsectionlevel[title=Files] + +Although it doesn't really fit in this chapter, here are some hooks into processing +files: + +\starttyping[option=TEX] +Hello World!\atendoffiled {\writestatus{FILE}{ATEOF B #1}}\par +Hello World!\atendoffiled {\writestatus{FILE}{ATEOF A #1}}\par +Hello World!\atendoffiled reverse {\writestatus{FILE}{ATEOF C #1}}\par +Hello World!\begingroup\sl \atendoffiled {\endgroup}\par +\stoptyping + +Inside a file you can register tokens that will be expanded when the file ends. +You can also do that beforehand using a variant of the \type {\input} primitive: + +\starttyping[option=TEX] +\eofinput {\writestatus{FILE}{DONE}} {thatfile.tex} +\stoptyping + +This feature is mostly there for consistency with the hooks into groups and +paragraphs but also because \type {\everyeof} is kind of useless given that one +never knows beforehand if a file loads another file. The hooks mentioned above +are bound to the current file. + +\stopsectionlevel + \stopdocument diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-lines.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-lines.tex new file mode 100644 index 00000000000..e2df3fa0309 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-lines.tex @@ -0,0 +1,1178 @@ +% language=us runpath=texruns:manuals/lowlevel + +\environment lowlevel-style + +\startdocument + [title=lines, + coauthor=Mikael Sundqvist, + color=middleorange] + +\startsectionlevel[title=Introduction] + +There is no doubt that \TEX\ does an amazing job of \quotation {breaking +paragraphs into lines} where a paragraph is a sequence of words in the input +separated by spaces or its equivalents (single line endings turned space). The +best descriptions of how that is done can be found in Don Knuths \quotation {The +\TEX\ Book}, \quotation {\TEX\ The Program} and \quotation {Digital Typography}. +Reading and rereading the relevant portions of those texts is a good exercise in +humility. + +That said, whatever follows here builds upon what Knuth gave us and in no way we +pretend to do better than that. It started out as a side track of improving +rendering math in combination with more control over breaking inline math. It +pretty much about having fun with the par builder but in the end can also help +make your results look better. This is especially true for proze. + +Trying to describe the inner working of the par builder makes no sense. Not only +is it kind of complex, riddled with magic constants and heuristics, but there is +a good chance for us to talk nonsense thanks to misunderstanding. However, some +curious aspects will be brought up. Consider what follows a somewhat naive +approach and whatever goes wrong, blame the authors, not \TEX. + +If you're one of those reader who love to complain about the bad manuals, you can +stop reading here. There is plenty said in the mentioned books but you can also +consult Viktor Eijkhouts excellent \quotation {\TEX\ by Topic} (just search the +web for how the get these books). If you're curious and in for some adventure, +keep reading. + +\stopsectionlevel + +\startsectionlevel[title=Warning] + +This is a first version. What is described here will stay but is still +experimental and how it evolves also depends on what demands we get from the +users. We have defined some experimental setups in \CONTEXT. We wil try to +improve the explanations in ways that (we hope) makes clear what happens deep +down but that takes time. These might change depending on feedback. We assume +that we're in granular mode: + +\starttyping +\setupalign[granular] +\stoptyping + +We will explain below what that means, but let us already now make clear that +this will likely become the default! As far as we can see, due to the larger +solution space, the inter-word spacing is more even but that also means that some +paragraphs can become one line less or more. + +\stopsectionlevel + +\startsectionlevel[title=Constructing paragraphs] + +There are several concepts at work when \TEX\ breaks a paragraph into lines. Here +we assume that we talk about text: words separated by spaces. We also assume that +the text starts at the left edge and nicely runs till the right edge, with the +exception of the last line. + +\startitemize +\startitem + The spaces between words can stretch or shrink. We don't want that to be too + inconsistent (visible) between two lines. This is where the terms loose and + tight come into play. +\stopitem +\startitem + Words can be hyphenated but we don't want that to happen too often. We also + discourage neighboring lines to have hyphens. Hyphenating the (pre) final line + is also sort of bad. +\stopitem +\startitem + We definitely don't want words to stick out in the margin. If we have to choose, + stretching is preferred over shrinking. If spaces become too small words, + start to blur. +\stopitem +\startitem + If needed glyphs can stretch or shrink a little in order to get rid of + excessive spacing. But we really want to keep it minimal, and avoid it when + possible. Usually we permit more stretch than shrink. Not all scripts (and + fonts for that matter) might work well with this feature. +\stopitem +\startitem + As a last resort we can stretch spaces so that we get rid of any still + sticking out word. When \TEX\ reports an overfull box (often a line) you have + to pay attention! +\stopitem +\stopitemize + +When \TEX\ decides where to break and when to finish doing so it uses a system of +penalties and demerits and at some point makes decisions with regards to how bad +a breakpoint (and eventually a paragraph) is. The penalties are normally +relatively small unless we really want to penalize. When \TEX\ is in the process +of breaking a paragraph it calculates badness values for each line. This can be +seen as a measure on how bad looking a line is; a badness of zero is good, but +the larger the badness becomes, the worse the line is. + +Here we shortly summarize the parameters that play a role in calculating what +\TEX\ calls the costs of breaking a line at some point: it's a combination of +weighting penalties as well as over- or undershooting the line with, where the +amount (dimension) and kind of (fillers) stretch and shrink determien the final +verdict. + +\startbuffer +\ruledhbox to 20 ts{left \hss right} +\ruledhbox to 40 ts{left \hss right} +\ruledhbox to 5 ts{left \hss right} +\ruledhbox to 5 ts{left right} +\ruledhbox to 5 es{% + left + \hskip 1ts plus 0.5ts\relax + middle + \hskip 1ts plus 1.5ts\relax + right% +} +\stopbuffer + +\typebuffer + +These boxes show a bit what happens with spacing that can stretch of shrink. The +first three cases are not bad because it's what we ask for with the wildcard +\type {\hss}. \footnote {We use this opportunity to promote the new \type {ts} and +\type {es} units.} + +\startlines \getbuffer \stoplines + +\TEX\ will run over each paragraph at most three times. On each such run, it will +choose different breakpoints, calculate badness of each possible line, combine +that with eventual penalties, and calculate a certain demerit value for each +possible paragraph. It creats a set of solutions as it progresses, discards the +worse cases so far and eventually ends of what it thinks is best. + +The process is primarily controlled by these parameters: + +\startitemize +\startitem + \type {\pretolerance}: This number determines the success of the first, not + hyphenated pass. Often the value is set to the plain \TEX\ value of 100. + If \TEX\ finds a possible division of a paragraph such that no line has + a badness higher than \type {\pretolerance}, the algorithm quits here and + that line is chosen. +\stopitem +\startitem + \type {\tolerance}: This number determines the success of the second, + hyphenated pass. Often the value is set to the plain \TEX\ value of 200. +\stopitem +\startitem + \type {\emergencystretch}: This dimension kicks in when the second pass is + not successful. In \CONTEXT\ we often set it to \type {2\bodyfontsize}. +\stopitem +\stopitemize + +When we are (in \CONTEXT\ speak) \type {tolerant}, we have a value of 3000, while +\type {verytolerant} bumps it to 4500. These are pretty large values compared to +the default 100 and 200 that seem to cover most cases well, especially when we +have short words, a reasonable width and lots of opportunities for hyphenation. +Keep in mind that a macro package has to default to values that make sense for +the average case. + +We now come to the other relevant parameters. You need to keep in mind that the +demerits are made from penalty values that get squared which is why parameters +with demerits in their name have high values: a penalty of $50$ squared has to +relate to a demerit of $5000$, so we might have $2500 + 5000$ at some point. + +The formula (most often) used to calculate the demerits \im{d} is + +\startformula + d = (l + b + p)^2 + e +\stopformula + +Here \im {l} is the \type {\linepenalty}, set to \im {10} in plain, \im {b} is the +badness of the line, and \im {p} is the penalty of the current break (for example, +added by hyphenation, or by breaking an inline formula). The \im {e} stands for +extra non-local demerits, that do not depend on only the current line, like +the \type {\doublehyphendemerits} that is added if two lines in a row are +hyphenated. + +The badness reflects how the natural linewidth relates to the target width and +uses a cubic function. A badness of zero is of course optimal, but a badness of +99 is pretty bad. A magic threshold is 12 (around that value a line is considered +decent). If you look at the formula above you can now understand why the line +penalty defaults to the low value of 10. + +\startitemize +\startitem + \type {\hyphenpenalty}: When a breakpoint occurs at a discretionary this one + gets added. In \LUAMETATEX\ we store penalties in the discretionary nodes but + user defined \typ {\discretionary}'s can carry dedicated penalties. This + value is set to 50, which is not that much. Large values reduce the solution + space so best keep this one reasonable. +\stopitem +\startitem + \type {\linepenalty}: Normally this is set to 10 and it is the baseline for a + breakpoint. This is again a small value compared to for instance the + penalties that you find in inline math. There we need some breakpoints and + after binary and relation symbols such an opportunity is created. The + specific penalties are normally 500 and 700. One has to keep in mind, as + shown in the formula above, that the penalties are not acting on a linear + scale when the demerits are calculated. Math spacing and penalty control is + discussed in the (upcoming) math manual. +\stopitem +\startitem + \type {\doublehyphendemerits}: Because it is considered bad to have two + hyphens in a row this is often set pretty high, many thousands. These are + treated as demerits (so outside of the squared part of the above formula). +\stopitem +\startitem + \type {\finalhyphendemerits}: The final (pre last) line having a hyphen is + also considered bad. The last line is handled differently anyway, just + because it gets normally flushed left. +\stopitem +\startitem + \type {\adjdemerits}: lines get rated in terms of being loose, decent, tight, + etc. When two lines have a different rating we bump the total demerits. +\stopitem +\startitem + \type {\looseness}: it is possible to force less or more lines but to what + extend this request is honored depends on for instance the possible + (emergency) stretch in the spaces (or any glue for that matter). ` + % Needs an explanation +\stopitem +\stopitemize + +It is worth noticing that you can set \typ {\lastlinefit} such that the spaces in +the last line will be comparable to those in the preceding line. This is a +feature that \ETEX\ brought us. Anyways, keep in mind normally penalties are +either small, or when we want to be tough, pretty high. Demerits are often +relatively large. + +The next one is a flag that triggers expansion (or compression) of glyphs to kick +in. Those get added to the available stretch and/or shrink of a line: + +\startitemize[continue] +\startitem + \type {\adjustspacing}: Its value determines if expansion kicks in: glyphs + basically get a stretch and shrink value, something that helps filling our + lines. We only have zero, two and three (and not the \PDFTEX\ value of two): + three means \quote {only glyphs} and two means \quote {font kerns and + glyphs}. +\stopitem +\stopitemize + +In \LUAMETATEX\ we also have: + +\startitemize +\startitem + \typ {\linebreakcriterion}: The normal distinction between loose, decent and + tight in \TEX\ uses 12 for 0.5 and 99 for about 1.0, but because we have more + granularity (.25) we can set four values instead. The default of zero (\type + {"0C0C0C63}) then becomes \type {"020C2A63}. When set that way the default + \typ {\adjdemerits} has to be halved 5000 so that we compare the more + granular distances. Don't worry if you \quote {don't get it}, hardly any user + will change these values. One can think of the 100 squared becomes a 10000 + (at least this helps relating these numbers) and 10000 is pretty bad in \TEX s + perception. +\stopitem +\startitem + \type {\adjustspacingstep}: When set this one is are used instead of the font + bound value which permits local control without defining a new font instance. +\stopitem +\startitem + \type {\adjustspacingstretch}: idem. +\stopitem +\startitem + \type {\adjustspacingshrink}: idem. +\stopitem +% \startitem +% \type {\extrahyphenpenalty}: +% \stopitem +\startitem + \type {\orphanpenalty}: This penalty will be injected before the last word of a paragraph. +\stopitem +\startitem + \type {\orphanpenalties}: Alternatively a series of penalties can be defined. + This primitive expects a count followed by that number of penalties. These + will be injected starting from the end. +\stopitem +\stopitemize + +The shape of a paragraph is determined by \typ {\hangindent}, \type {\hangafter}, +\typ {\parshape} and \typ {\parindent}. The width is controlled by \typ {\hsize}, +\typ {\leftskip}, \typ {\rightskip}. In addition there are \typ +{\parinitleftskip}, \typ {\parinitrightskip}, \typ {\parfillleftskip} and \typ +{\parfillrightskip} that control first and last lines. + +We also have these: + +\startitemize +\startitem + \type {\linebreakpasses}: When set to one, the currently set \type {\parpasses} + will be applied. +\stopitem +\startitem + \type {\parpasses}: This primitive defined a set of sub passes that kick in + when the second pass is finished. This basically opens up the par builder. It + is still experimental and will be improved based upon user feedback. Although + it is a side effect of improving the breaking of extensive mixes of math and + text, it is also quite useful for text only (think novels). +\stopitem +\stopitemize + +In the next sections we will explain how these can improve the look and feel of +what you typeset. + +\stopsectionlevel + +\startsectionlevel[title=Subpasses] + +In \LUATEX\ and therefore also in \LUAMETATEX\ a paragraph is constructed in steps: + +\startitemize +\startitem + The list of nodes that makes the paragraph is hyphenated: words become a + mixture of glyphs and discretionaries. +\stopitem +\startitem + That list is processed by a font handler that can remove, add or change glyphs + depending on how glyphs interact. This depends on the language and scripts used. +\stopitem +\startitem + The result is fed into the parbuilder that applies upto three passes as mentioned + before. +\stopitem +\stopitemize + +In traditional \TEX\ these three actions are combined into one and the overhead +is shared. In the split case the processing time gets distributed and in practice +the last action is not the one that takes most time. This is why the mechanism +that we discuss next has little impact on the run: calling the par builder a few +times more seldom results in more runtime. This is why in we support so called +sub passes between the second and third one. + +Here is an example of a setup. We set a low tolerance for the first pass and second +pass. We can do that because we don't need to play safe nor need to compromise. + +\starttyping +\pretolerance 75 +\tolerance 150 +\parpasses 3 + threshold 0.025pt + classes \indecentparpassclasses + tolerance 150 + next + threshold 0.025pt + classes \indecentparpassclasses + tolerance 200 + emergencystretch .25\bodyfontsize + next + threshold 0.025pt + classes \indecentparpassclasses + tolerance 200 + optional 1 + emergencystretch .5\bodyfontsize +\relax +\linebreakpasses 1 +\stoptyping + +Because we want to retain performance we need to test efficiently if we really +need the (here upto three) additional passes, so let's see how it is done. When a +pass list is defined, and line break passes are enabled, the engine will check {\em after} +the second pass if some more work is needed. For that it will do a quick analysis and +calculate four values: + +\startitemize[packed] +\startitem overflow : the maximum value found, this is something really bad. \stopitem +\startitem underflow : the maximum value found, this is something we can live with. \stopitem +\startitem verdict : what is the worst badness of lines in this paragraph. \stopitem +\startitem classified : what classes are assigned to lines, think looseness, decent and tight. \stopitem +\stopitemize + +There are two cases where the engine will continue with the applying passes: +there is an overflow or there is a verdict (max badness) larger than zero. When we +tested this on some large documents we noticed that this is nearly always true, +but by checking we save a few unnecessary passes. + +Next we test if a pass is really needed, and if not we check the next pass. When +a pass is done, we pick up where we left, but we test for the overflow or badness +every sub pass. The next checks make us run a pass: + +\startitemize[packed] +\startitem overfull exceeds threshold \stopitem +\startitem verdict exceeds badness \stopitem +\startitem classified overlaps classes \stopitem +\stopitemize + +Here \typ {threshold}, \typ {badness} and \typ {classes} are options in a pass +section. Which test makes sense depends a bit on how \TEX\ sees the result. +Internally \TEX\ uses numbers for its classification (0..5) but we map that onto +a bitset because we want an overview: + +\starttabulate[|r|l|c|c|c|c|] +\NC \NC \BC indecent \BC almostdecent \BC loose \BC tight \NC \NR +\NC 1 \BC veryloose \NC + \NC + \NC + \NC \NC \NR +\NC 2 \BC loose \NC + \NC + \NC + \NC \NC \NR +\NC 4 \BC semiloose \NC + \NC \NC + \NC \NC \NR +\NC 8 \BC decent \NC \NC \NC \NC \NC \NR +\NC 16 \BC semitight \NC + \NC \NC \NC + \NC \NR +\NC 32 \BC tight \NC + \NC + \NC \NC + \NC \NR +\stoptabulate + +The semiloose and semitight values are something \LUAMETATEX. In \CONTEXT\ we +have these four variants predefined as \typ {\indecentparpassclasses} and such. + +The sections in a par pass setup are separated by \type {next}. For testing +purposes you can add \type {skip} and \type {quit}. The \type {threshold} tests +against the overfull value, the \type {badness} against the verdict and \type +{classes} checks for overlap with encountered classes, the classification. + +You can specify an \typ {identifier} in the first segment that then will be used +in tracing but it is also passed to callbacks that relate to this feature. +Discussing these callback is outside the scope fo this wrapup. + +You need to keep in mind that parameters are not reset to their original values +between two subpasses of a paragraph. +We have \typ {tolerance} and \typ {emergencystretch} which are handy for simple +setups. When we start with a small tolerance we often need to bump that one. The +stretch is likely a last resort. The usual demerits can be set too: \typ +{doublehyphendemerits}, \typ {finalhyphendemerits} and \typ {adjdemerits}. We +have \typ {extrahyphenpenalty} that gets added to the penalty in a discretionary. +You can also set \typ {linepenalty} to a different value than it normally gets. + +The \typ {looseness} can be set but keep in mind that this only makes sense in +very special cases. It's hard to be loose when there is not much stretch or shrink +available. The \typ {linebreakcriterion} parameter can best be left untouched and is +mostly there for testing purposes. + +The \LUAMETATEX\ specific \typ {orphanpenalty} gets injected before the last word +in a paragraph. High values can lead to overfull boxes but when used in text that +hyphenate well or with languages that have short words it might work out well. + +The next four parameters are related to expansion: \typ {adjustspacing}, \typ +{adjustspacingstep}, \typ {adjustspacingshrink} and \typ {adjustspacingstretch}. +Here we have several scenarios. + +\startitemize +\startitem + Fonts are set up for expansion (in \CONTEXT\ for instance with the quality + specifier). When \type {hz} is then enabled it will always kick in. +\stopitem +\startitem + When we don't enable it, the par pass can do it by setting \typ {adjustspacing} (to 3). +\stopitem +\startitem + When the other parameters are set these will overload the ones in the font, + but used with the factors in there, so different characters get scaled + differently. You can set the step to one to get more granular results. +\stopitem +\startitem + When expansion is {\em not} set on the font, setting the options in a pass will activate + expansion but with the factors set to 1000. This means all characters are treated equal, + which is less subtle. +\stopitem +\stopitemize + +When a font is not set up to use expansion, you can do something like this: + +\starttyping +\parpasses 6 + classes \indecentparpassclasses + threshold 0.025pt + tolerance 250 + extrahyphenpenalty 50 + orphanpenalty 5000 + % font driven + next ifadjustspacing + threshold 0.025pt + classes \tightparpassclasses + tolerance 300 + adjustspacing 3 + orphanpenalty 5000 + next ifadjustspacing + threshold 0.025pt + tolerance 350 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + orphanpenalty 5000 + emergencystretch .25\bodyfontsize + % otherwise, factors 1000 + next + threshold 0.025pt + classes \tightparpassclasses + tolerance 300 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 10 + adjustspacingstretch 15 + orphanpenalty 5000 + next + threshold 0.025pt + tolerance 350 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + orphanpenalty 5000 + emergencystretch .25\bodyfontsize + % whatever + next + threshold 0.025pt + tolerance 3000 + orphanpenalty 5000 + emergencystretch .25\bodyfontsize +\relax +\stoptyping + +With \typ {ifadjustspacing} you ignore steps that expect the font to be setup, so +you don't waste time if that is not the case. + +There is also a \typ {callback} parameter but that one is experimental and used +for special purposes and testing. We don't expect users to mess with that. + +A really special feature is optional content. Here we use as example a quote from +Digital Typography: + +\starttyping[paragraph=yes,align=flushleft] +Many readers will skim over formulas on their first reading +of your exposition. Therefore, your sentences should flow +smoothly when all but the simplest formulas are replaced by +\quotation {blah} or some other \optionalword {1} {grunting }noise. +\stoptyping + +Here the \type {grunting} (with embedded space) is considered optional. When you +set \typ {\linebreakoptional} to~1 this word will be typeset. However, when you +set the pass parameter \typ {linebreakoptional} to~0 it will be skipped. There +can be multiple optional words with different numbers. The numbers are actually +bits in a bit set so plenty is possible. However, normally these two values are +enough, if used at all. + +\stopsectionlevel + +\startsectionlevel[title=Definitions] + +The description above is rather low level and in practice users will use a bit +higher level interface. Also, in practice only a subset of the parameters makes +sense in general usage. It is not that easy to decide on what parameter subset +will work out well but it can be fun to play with variants. After all, this is +also what \TEX\ is about: look, feel and fun. + +Some users praise the ability of recent \TEX\ engines to provide expansion and +protrusion. This feature is a bit demanding because not only does it add to +runtime (although in \LUAMETATEX\ that normally can be neglected), it also makes +the output files larger. Some find it hard to admit, but it even can result in +bad looking documents when applied with extremes. + +The traditional (\MKIV) way to set up expansion is to add this to the top of the +document, or at least before fonts get loaded. + +\startbuffer[pass-a] +\definefontfeature + [default] + [default] + [expansion=quality,protrusion=quality] +\stopbuffer + +\typebuffer[a] + +and later on to enable it with: + +\starttyping +\setupalign[hz] +\stoptyping + +However, par passes make it possible to be more selective. Take the following two +definitions: + +\startbuffer[pass-b] +\startsetups align:pass:quality:1 + \pretolerance 50 + \tolerance 150 + \parpasses 6 + identifier \parpassidentifier{quality:1} + threshold 0.025pt + tolerance 175 + next + threshold 0.025pt + tolerance 200 + next + threshold 0.025pt + tolerance 250 + next + classes \almostdecentparpassclasses + tolerance 300 + emergencystretch .25\bodyfontsize + next ifadjustspacing + classes \indecentparpassclasses + tolerance 300 + adjustspacing 3 + emergencystretch .25\bodyfontsize + next + threshold 0.025pt + tolerance 3000 + emergencystretch 2\bodyfontsize + \relax +\stopsetups + +\startsetups align:pass:quality:2 + \pretolerance 50 + \tolerance 150 + \parpasses 5 + identifier \parpassidentifier{quality:2} + threshold 0.025pt + tolerance 175 + next + threshold 0.025pt + tolerance 200 + next + threshold 0.025pt + tolerance 250 + next ifadjustspacing + classes \indecentparpassclasses + tolerance 300 + adjustspacing 3 + emergencystretch .25\bodyfontsize + next + threshold 0.025pt + tolerance 3000 + emergencystretch 2\bodyfontsize + \relax +\stopsetups +\stopbuffer + +\typebuffer[pass-b] + +You can now enable one of these: + +\starttyping +\setupalignpass[quality:1] +\stoptyping + +\startbuffer[pass-c] +\starttext + \showmakeup[expansion,space] + \startTEXpage[offset=1ts] + \startcombination[3*3] + {\vtop{\hsize 8cm\setupalignpass[none] \samplefile{tufte}}} {none} + {\vtop{\hsize 9cm\setupalignpass[none] \samplefile{tufte}}} {none} + {\vtop{\hsize12cm\setupalignpass[none] \samplefile{tufte}}} {none} + {\vtop{\hsize 8cm\setupalignpass[quality:1]\samplefile{tufte}}} {quality:1} + {\vtop{\hsize 9cm\setupalignpass[quality:1]\samplefile{tufte}}} {quality:1} + {\vtop{\hsize12cm\setupalignpass[quality:1]\samplefile{tufte}}} {quality:1} + {\vtop{\hsize 8cm\setupalignpass[quality:2]\samplefile{tufte}}} {quality:2} + {\vtop{\hsize 9cm\setupalignpass[quality:2]\samplefile{tufte}}} {quality:2} + {\vtop{\hsize12cm\setupalignpass[quality:2]\samplefile{tufte}}} {quality:2} + \stopcombination + \stopTEXpage +\stoptext +\stopbuffer + +The result is shown in \in {figure} [fig:passes:expansion] where you can see that +expansion is applied selectively; you have to zoom in to see where. + +\startplacefigure[location=page,reference=fig:passes:expansion,title={Two different passes applied to \type {tufte.tex}.}] + \typesetbuffer[pass-a,pass-b,pass-c][width=\textwidth] +\stopplacefigure + +\stopsectionlevel + +\startsectionlevel[title=Tracing] + +There are several ways to see what goes on. The engine has a tracing option that +is set with \type {\tracingpasses}. Setting it to \type {1} reports the passes on +the console, and a value of \type {2} also gives some details. + +There is a also a tracker, \type {paragraphs.passes} that can be enabled. This gives +a bit more information: + +\starttyping +\enabletrackers[paragraphs.passes] +\enabletrackers[paragraphs.passes=summary] +\enabletrackers[paragraphs.passes=details] +\stoptyping + +If you want to see where expansion kicks in, you can use: + +\starttyping +\showmakeup[expansion] +\stoptyping + +This is just one of the options, \type {spaces}, \type {penalties}, \type {glue} +are are useful when you play with passes, but if you are really into the low level +details, this is what you want: + +\startbuffer +\startnarrower[5*right] +\startshowbreakpoints[option=margin,offset=\dimexpr{.5\emwidth-\rightskip}] +\samplefile{tufte} +\stopshowbreakpoints +\stopnarrower +\stopbuffer + +\typebuffer \getbuffer + +You can see the chosen solutions with + +\startbuffer +\showbreakpoints[n=1] +\stopbuffer + +\typebuffer \getbuffer + +When we started playing with the par builder in the perspective of +math, we side tracked and ended up with a feature that can ge used +in controlled situations. Currently we only have a low level +\CONTEXT\ interface for this (see \in {figure} [fig:passes:lousiness]). + +\startbuffer[lousiness] + \startTEXpage[offset=1ts] + \startcombination[3*1] + \bgroup \vtop\bgroup + \hsize8cm + \setupalign[verytolerant] + \tracinglousiness 1 + \lousiness 0 + \samplefile{ward} + \egroup \egroup + {\type {\tracinglousiness 1} + \type {\lousiness 0}} + \bgroup \vtop\bgroup + \hsize8cm + \setupalign[verytolerant] + \lousiness 1 11 0 + \samplefile{ward} + \egroup \egroup + {\type {\lousiness 1 11 0}} + \bgroup \vtop\bgroup + \hsize8cm + \setupalign[verytolerant] + \silliness 11 + \samplefile{ward} + \egroup \egroup + {\type {\silliness 11}} + \stopcombination +\stopTEXpage +\stopbuffer + +\startplacefigure[location=here,reference=fig:passes:lousiness,title={Influencing the way \TEX\ breaks lines applied to \type {ward.tex}.}] + \typesetbuffer[lousiness][width=\textwidth] +\stopplacefigure + +\stopsectionlevel + +\startsectionlevel[title=Criterion] + +The \type {granular} alignment option will configure the linebreakcriterion to +work with $0.25$ steps instead of $0.50$ steps which means that successive lines +can become a bit closer in spacing. There is no real impact on performance +because testing happens anyway. In \in {figure}[fig:criterion] you see some +examples, where in some it indeed makes a difference. + +\startbuffer[criterion] +\starttext +\definecolor[ttest][a=1,t=.5] +\definecolor[rtest][a=1,t=.5,r=1] +\dostepwiserecurse{80}{120}{1}{ + \startTEXpage[offset=1ts] + \startcombination[3*1] + {\startoverlay + {\vtop{\showmakeup[space]\hsize #1mm\ttest \samplefile{tufte}}} + {\vtop{\showmakeup[space]\hsize #1mm\rtest \setupalign[granular]\samplefile{tufte}}} + \stopoverlay} {} + {\vtop{\showmakeup[space]\hsize #1mm\ttest \samplefile{tufte}}} {} + {\vtop{\showmakeup[space]\hsize #1mm\rtest \setupalign[granular]\samplefile{tufte}}} {} + \stopcombination + \stopTEXpage +} +\stoptext +\stopbuffer + +\startplacefigure[location=here,reference=fig:criterion,title={More granular interline criteria.}] + \startcombination[1*4] + {\typesetbuffer[criterion][width=\textwidth,page=35]} {} + {\typesetbuffer[criterion][width=\textwidth,page=36]} {} + {\typesetbuffer[criterion][width=\textwidth,page=37]} {} + {\typesetbuffer[criterion][width=\textwidth,page=38]} {} + \stopcombination +\stopplacefigure + +\stopsectionlevel + +\startsectionlevel[title=Examples] + +\start \em + + The \CONTEXT\ distribution comes with a few test setups: \typ + {spac-imp-tests.mkxl}. Once we have found a suitable set of values and sample + texts we might discuss them here. + + Currently we provide the following predefined passes that you can enable with + \typ {\setupalignpass}: \type {decent}, \type {quality}, \type {test1}, \type + {test2}, \type {test3}, \type {test4}, \type {test5}. We hope that users are + willing to test these. + +\stop + +\stopsectionlevel + +\startsectionlevel[title=Pages] + +While the par builder does multiple passes, the page builder is a single pass +progressive routine. Every time something gets added to the (so called) main +vertical list the page state gets updated and when the page overflows what has +been collected gets passed to the output routine. It is to a large extend driven +by glue (with stretch and shrink) and penalties and when content (boxes) is added +the process is somewhat complicated by inserts as these needs to be taken into +account too. + +You can get pages that run from top to bottom by adding stretch between lines but +by default in \CONTEXT\ we prefer to fill up the bottom with white space. + +It can be hard to make decisions at the \TEX\ end around a potential page break +because in order to get an idea how much space is left, one needs to trigger the +page builder which can have side effects. + +Penalties play an important role and because these are used to control for +instance widows and clubs high values can lead to underfull pages so if we want +to influence that we need to cheat. For this we have three experimental +mechanisms: + +\startitemize[packed] +\startitem tweaking the page goal: \type {\pageextragoal} \stopitem +\startitem initializing the state quantities: \type {\initialpageskip} \stopitem +\startitem adapting the state quantities as we go: \type {\additionalpageskip} \stopitem +\stopitemize + +The first tweak is for me to play with, and when a widow or club is seen the +extra amount can kick in. This feature is likely to be replaced by a more +configurable one. + +The second tweak lets the empty page start out with some given height, stretch +and shrink. This variable is persistent over pages. This is not true for the +third tweak: it kicks in when the page gets initialized {\em or} as we go, but +after it has been applied the value is reset. That makes it a feature like \type +{\looseness}. We could combine these into one (because one can set up a +persistent one in the macro package at well defined spots) but having an initial +one also nicely can compensate the usual topskip glue hackery with a more natural +control option. + +\startbuffer[pagelooseness-1] +\starttext + \showframe[text] + \setuplayout[width=middle,headerdistance=5mm] + \setupalign[vertical,height] + \dorecurse{10}{ + \samplefile{tufte}\par + \setpagelooseness[lines=2]% + \dorecurse{5}{ + {\red \samplefile{knuth}}\par + {\green \samplefile {ward}}\par + {\blue \samplefile{davis}}\par + } + \page + } +\stoptext +\stopbuffer + +\startbuffer[pagelooseness-2] +\starttext + \showframe[text] + \setuplayout[width=middle,headerdistance=5mm] + \setupalign[vertical,height] + \dorecurse{10}{ + \samplefile{tufte}\par + \setpagelooseness[-3]% + \dorecurse{5}{ + {\red \samplefile{knuth}}\par + {\green \samplefile {ward}}\par + {\blue \samplefile{davis}}\par + } + \page + } +\stoptext +\stopbuffer + +Adapting the layout (within the regular text area) is done with \typ +{\setpagelooseness} an demonstrated in \in {figure} [fig:pagelooseness-1] and \in +{figure} [fig:pagelooseness-2]. Possible parameters are \type {lines}, \type +{height}, \type {stretch} and \type {shrink}. You can also directly specify the +number of lines. The other two features are not (yet) interfaced. + +\startplacefigure[location=here,reference=fig:pagelooseness-1,title={Cheating with page dimensions: \type {[lines=2]}.}] + \startcombination[4*1] + {\typesetbuffer[pagelooseness-1][width=\combinationwidth,page=1,frame=on]} {} + {\typesetbuffer[pagelooseness-1][width=\combinationwidth,page=2,frame=on]} {} + {\typesetbuffer[pagelooseness-1][width=\combinationwidth,page=3,frame=on]} {} + {\typesetbuffer[pagelooseness-1][width=\combinationwidth,page=4,frame=on]} {} + \stopcombination +\stopplacefigure + +\startplacefigure[location=here,reference=fig:pagelooseness-2,title={Cheating with page dimensions: \type {[-3]}.}] + \startcombination[4*1] + {\typesetbuffer[pagelooseness-2][width=\combinationwidth,page=1,frame=on]} {} + {\typesetbuffer[pagelooseness-2][width=\combinationwidth,page=2,frame=on]} {} + {\typesetbuffer[pagelooseness-2][width=\combinationwidth,page=3,frame=on]} {} + {\typesetbuffer[pagelooseness-2][width=\combinationwidth,page=4,frame=on]} {} + \stopcombination +\stopplacefigure + +It is not that trivial to fulfill the wide range of user demands but over time +the \typ {\setupalign} commands has gotten plenty of features. Getting for +instance windows and clubs right in the kind of mixed usage that is common in +\CONTEXT\ is not always easy. One can experiment with scenarios (also to get some +understanding of matters) but none is probably perfect (unless one does something +close to manual tweaking). There is also the butterfly effect: a change here +might trigger na issue there. + +The examples in \in {figure} [fig:vz-1], \in [fig:vz-2] and \in [fig:vz-3] scale +vertically in order ti fill up the text area; the \type {vz} parameter is set +with \typ {setuplayout}. In the example the widow and club penalties are set to +$10000$. In these examples we have enabled the \typ {layout.vz} trackers that +shows a small black rule indicating the amount of stretch. + +\startbuffer[vz-1] +\starttext + \showframe[text] + \enabletrackers[layout.vz] + \setuplayout[width=middle,headerdistance=5mm,vz=no] + \clubpenalty 10000 + \widowpenalty 10000 + \dostepwiserecurse{0}{30}{1}{ + \dorecurse{#1}{\strut dummy line ##1\par} + \dorecurse{4}{\samplefile{tufte}\par} + } +\stoptext +\stopbuffer + +\startbuffer[vz-2] +\starttext + \showframe[text] + \enabletrackers[layout.vz] + \setuplayout[width=middle,headerdistance=5mm,vz=yes] + \clubpenalty 10000 + \widowpenalty 10000 + \dostepwiserecurse{0}{30}{1}{ + \dorecurse{#1}{\strut dummy line ##1\par} + \dorecurse{4}{\samplefile{tufte}\par} + } +\stoptext +\stopbuffer + +\startbuffer[vz-3] +\starttext + \showframe[text] + \enabletrackers[layout.vz] + \setuplayout[width=middle,headerdistance=5mm,vz=2] + \clubpenalty 10000 + \widowpenalty 10000 + \dostepwiserecurse{0}{30}{1}{ + \dorecurse{#1}{\strut dummy line ##1\par} + \dorecurse{4}{\samplefile{tufte}\par} + } +\stoptext +\stopbuffer + +\startplacefigure[location=here,reference=fig:vz-1,title={Cheating with vertical expansion: \type {[vz=no]}.}] + \startcombination[4*1] + {\typesetbuffer[vz-1][width=\combinationwidth,page=1,frame=on]} {} + {\typesetbuffer[vz-1][width=\combinationwidth,page=2,frame=on]} {} + {\typesetbuffer[vz-1][width=\combinationwidth,page=3,frame=on]} {} + {\typesetbuffer[vz-1][width=\combinationwidth,page=4,frame=on]} {} + \stopcombination +\stopplacefigure + +\startplacefigure[location=here,reference=fig:vz-2,title={Cheating with vertical expansion: \type {[vz=yes]}.}] + \startcombination[4*1] + {\typesetbuffer[vz-2][width=\combinationwidth,page=1,frame=on]} {} + {\typesetbuffer[vz-2][width=\combinationwidth,page=2,frame=on]} {} + {\typesetbuffer[vz-2][width=\combinationwidth,page=3,frame=on]} {} + {\typesetbuffer[vz-2][width=\combinationwidth,page=4,frame=on]} {} + \stopcombination +\stopplacefigure + +\startplacefigure[location=here,reference=fig:vz-3,title={Cheating with vertical expansion: \type {[vz=2]}.}] + \startcombination[4*1] + {\typesetbuffer[vz-3][width=\combinationwidth,page=1,frame=on]} {} + {\typesetbuffer[vz-3][width=\combinationwidth,page=2,frame=on]} {} + {\typesetbuffer[vz-3][width=\combinationwidth,page=3,frame=on]} {} + {\typesetbuffer[vz-3][width=\combinationwidth,page=4,frame=on]} {} + \stopcombination +\stopplacefigure + +There are a few other tweaks but these one can wonder about these. We can add +stretch and shrink to the baseline skip, something that can also be triggered +with the \quote {spread} option to \typ {\setupalign}, assuming that also \typ +{height} is given). An alternative is to permit an extra line and accept a visual +overflow, assuming that the layout is set up to make sure that the footer line +doesn't overlap. None of this guarantees that a whole document with plenty of +graphics and special constructs will come out well, but for text only it might +work okay. \in {Figures} [fig:extra-1], \in [fig:extra-2] and \in [fig:extra-3] +show some of this. + +\startbuffer[extra-1] +\starttext + \showframe[text] + \setuplayout[width=middle,headerdistance=15mm,vz=no] + \setupalign[height] + \clubpenalty 10000 + \widowpenalty 10000 + \dorecurse{10}{ + \samplefile{tufte}\par + \samplefile{knuth}\par + \samplefile{ward}\par + \samplefile{davis}\par + } +\stoptext +\stopbuffer + +\startbuffer[extra-2] +\starttext + \showframe[text] + \setuplayout[width=middle,headerdistance=15mm,vz=no] + \setupalign[height] + \clubpenalty 10000 + \widowpenalty 10000 + \baselineskip 1\baselineskip plus 1pt minus .1pt + \dorecurse{10}{ + \samplefile{tufte}\par + \samplefile{knuth}\par + \samplefile{ward}\par + \samplefile{davis}\par + } +\stoptext +\stopbuffer + +\startbuffer[extra-3] +\starttext + \showframe[text] + \setuplayout[width=middle,headerdistance=15mm,vz=no] + \setupalign[height] + \clubpenalty 10000 + \widowpenalty 10000 + \pageextragoal1\lineheight + \dorecurse{10}{ + \samplefile{tufte}\par + \samplefile{knuth}\par + \samplefile{ward}\par + \samplefile{davis}\par + } +\stoptext +\stopbuffer + +\page + +\startplacefigure[location=here,reference=fig:extra-1,title={Cheating: just high penalties.}] + \startcombination[4*2] + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=1,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=2,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=3,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=4,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=5,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=6,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=7,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-1][width=\combinationwidth,page=8,frame=on]}} {} + \stopcombination +\stopplacefigure + +\startplacefigure[location=here,reference=fig:extra-2,title={Cheating: \typ {\baselineskip 1\baselineskip plus 1pt minus .1pt}.}] + \startcombination[4*2] + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=1,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=2,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=3,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=4,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=5,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=6,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=7,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-2][width=\combinationwidth,page=8,frame=on]}} {} + \stopcombination +\stopplacefigure + +\startplacefigure[location=here,reference=fig:extra-3,title={Cheating: \typ {\pageextragoal \lineheight}.}] + \startcombination[4*2] + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=1,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=2,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=3,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=4,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=5,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=6,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=7,frame=on]}} {} + {\clip[ny=12,sy=1,y=10]{\typesetbuffer[extra-3][width=\combinationwidth,page=8,frame=on]}} {} + \stopcombination +\stopplacefigure + +\stopsectionlevel + +\startsectionlevel[title=Profiles] + +You can have a paragraph with lines that exceed the maximum height and/or depth +or where spaces end up in a way that create so called rivers. Rivers are more a +curiosity than an annoyance because any attempt to avoid them is likely to result +in a worse looking result. The unequal line distances can be annoying too but +these can be avoided when bringing lines closer together doesn't lead to clashes. +This can be done without reformatting the paragraph by passing the \type +{profile} option to \typ {\setupalign}. It comes at the cost of a little more +runtime and (as far as we observed) it kicks in seldom, for instance when inline +math is used that has super- or subscripts, radicals, fractions or other slightly +higher constructs. + +\stopsectionlevel + +\page % colofon after flushed page float + +\stopdocument + +% \showmakeup[glue] + +% \startsetups align:pass:whatever +% \pretolerance 75 +% \tolerance 150 +% \parpasses 3 +% threshold 0.025pt +% classes \indecentparpassclasses +% tolerance 150 +% next +% threshold 0.025pt +% classes \indecentparpassclasses +% tolerance 200 +% emergencystretch .25\bodyfontsize +% next +% threshold 0.025pt +% classes \indecentparpassclasses +% tolerance 200 +% optional 1 +% emergencystretch .5\bodyfontsize +% \relax +% \linebreakpasses\plusone +% \stopsetups + + +% \dostepwiserecurse{80}{120}{2} { +% \start +% \hsize#1mm \getbuffer \getbuffer \blank +% \hsize#1mm \setupalignpass[whatever] \getbuffer \getbuffer \page +% \stop +% } + +% discuss the disc options options pre, post orphaned, penalties (or maybe in a new +% lowlevel-discretionaries) + +% \starttext +% \showmakeup[line] +% % \discretionaryoptions\zerocount +% % \discretionaryoptions\prefernobreakdiscoptioncode +% \hsize\widthofstring{sciencefiction} +% science\discretionary{\red fict-}{\green ion}{\blue fiction}\par +% science\discretionary{\red f\kern0ptiction}{}{\blue fiction}\par +% science\-fiction\par +% science\discretionary{-}{}{\blue fiction}\par +% \hyphenation{science-fiction} +% sciencefiction\par +% \stoptext + +% optional content example (todo: show break and nobreak keywords): + +% \start +% \tttf +% \hsize\widthofstring{short} +% --:\par +% \discretionaryoptions\zerocount +% \discretionary{before}{after}{short}\par +% \discretionary{before}{}{short}\blank +% nb:\par +% \discretionaryoptions\prefernobreakdiscoptioncode +% \discretionary{before}{after}{short}\par +% \discretionary{before}{}{short}\blank +% br:\par +% \discretionaryoptions\preferbreakdiscoptioncode +% \discretionary{before}{after}{short}\par +% \discretionary{before}{}{short}\blank +% \stop + + diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-loops.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-loops.tex index 30a3ef64cfb..cf7ab7706c3 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-loops.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-loops.tex @@ -324,4 +324,95 @@ So: \stopsectionlevel +\startsectionlevel[title=About quitting] + +You can quit a local and expanded loop at the next iteration using \typ +{\quitloop}. With \typ {\quitloopnow} you immediately leave the loop but you +need to beware of side effects, like not ending a condition properly. Keep in +mind that a macro language like \TEX\ is not that friendly towards loops so the +implementation is a bit hairy. + +\stopsectionlevel + +\startsectionlevel[title=Simple repeaters] + +For simple iterations we have \typ {\localcontrolledrepeat}, \typ +{\expandedrepeat}, \typ {\unexpandedrepeat}. These take one integer instead of +three: the final iterator value. + +\stopsectionlevel + +\startsectionlevel[title=Endless loops] + +There are three endless loop primitives: \typ {\localcontrolledendless}, \typ +{\expandedendless}, \typ {\unexpandedendless}. These will keep running till you +quit them. The loop counter can overflow the maximum integer value and will then +start again at 1. + +\stopsectionlevel + + +\startsectionlevel[title=Loop variables] + +The following example shows how we can access the current, parent and grand parent +loop iterator values using a parameter like syntax: + +\startbuffer +\localcontrolledloop 1 4 1 {% + \localcontrolledloop 1 3 1 {% + \localcontrolledloop 1 2 1 {% + \edef\foo{[#G,#P,#I]}\foo + \def \oof{<#G,#P,#I>}\oof + (#G,#P,#I)\space + } + \par + } +} +\stopbuffer + +\typebuffer \startpacked\getbuffer\stoppacked + +Another way to access a(ny) parent is: + +\starttyping +\localcontrolledloop 1 4 1 {% + \localcontrolledloop 1 3 1 {% + \localcontrolledloop 1 2 1 {% + (\the\previousloopiterator2,% + \the\previousloopiterator1,% + \the\currentloopiterator) + } + \par + } +} +\stoptyping + +These methods make that one doesn't have to store the outer loop variables for +usage inside the inner loop. Watch out with the \type {\edef}: + +\startbuffer +\edef\foo{[#G,#P,#I]} +\def \oof{<#G,#P,#I>} + +\localcontrolledloop 1 4 1 {% + \localcontrolledloop 1 3 1 {% + \localcontrolledloop 1 2 1 {% + % + % I iterator \currentloopiterator + % P parent \previousloopiterator1 + % G grandparent \previousloopiterator2 + % + \edef\ofo{[#G,#P,#I]}% + \foo\oof\ofo(#G,#P,#I)\space + % + } + \par + } +} +\stopbuffer + +\typebuffer \startpacked\getbuffer\stoppacked + +\stopsectionlevel + \stopdocument diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex index 83e43818f08..9557a7299da 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex @@ -11,10 +11,10 @@ % released \quotation {Versions of the Truth} which again a magnificent drumming by % Gavin Harrison. - % \permanent\tolerant\protected\def\xx[#1]#*#;[#2]#:#3% loops .. todo \usemodule[system-tokens] +\usemodule[system-syntax] \environment lowlevel-style @@ -991,6 +991,522 @@ in turn only needs incrementing a reference counter. \stopsectionlevel +\startsectionlevel[title=Passing parameters] + +When you define a macro, the \type {#1} and more parameters are embedded as a +reference to a parameter that is passed. When we have four parameters, the +parameter stack has four entries and when an entry is eventually accessed a new +input level is pushed and tokens are fetched from that list. This has some side +effects when we check a parameter. This can happen multiple times, depending on +how often we access a parameter. Take the following: + +\startbuffer +\def\oof#1{#1} + +\tolerant\def\foo[#1]#*[#2]% + {1:\ifparameter#1\or Y\else N\fi\quad + 2:\ifparameter#2\or Y\else N\fi\quad + \oof{3:\ifparameter #1\or Y\else N\fi\quad + 4:\ifparameter #2\or Y\else N\fi\quad}% + \par} + +\foo \foo[] \foo[][] \foo[A] \foo[A][B] +\stopbuffer + +\typebuffer + +This gives: + +\startpacked \tttf +\inlinebuffer +\stoppacked + +as you probably expect. However the first two checks are different from the +embedded checks because they can check against the parameter reference. When we +expand \type {\oof} its argument gets passed to the macro as a list and when the +scanner collects the next token it will then push the parameter content on the +input stack. So, then, instead of a reference we get the referenced parameter +list. Internally that means that in 3 and 4 we check for a token and not for the +length of the list (as in case 1 & 2). This means that + +\starttyping +\iftok{#1}\emptytoks Y\else N\fi +\ifparameter#1\or Y\else N\fi +\stoptyping + +are different. In the first case we have a proper token list and nested +conditionals in that list are okay. In the second case we just look ahead to see +if there is an \type {\or}, \type {\else} or other condition related command and +if so we decide that there is no parameter. So, if \type {\ifparameter} is a +suitable check for empty depends on the need for expansion. + +When you define macros that themselves call macros that should operate on the +arguments of its parent you can easily pass these: + +\startbuffer[test-1] +\def\foo#1#2% + {\oof{#1}{#2}{P}% + \oof{#1}{#2}{Q}% + \oof{#1}{#2}{R}} + +\def\oof#1#2#3% + {[#1][#1]% + #3% + [#2][#2]} +\stopbuffer + +\typebuffer[test-1] + +Here the nested call to \type {\oof} involved three passed parameters. You can +avoid that as follows: + +\startbuffer[test-2] +\def\foo#1#2% + {\def\MyIndexOne{#1}% + \def\MyIndexTwo{#2}% + \oof{P}\oof{Q}\oof{R}} + +\def\oof#1% + {(\MyIndexOne)(\MyIndexOne)% + #1% + (\MyIndexTwo)(\MyIndexTwo)} +\stopbuffer + +\typebuffer[test-2] + +You can also do this: + +\startbuffer[test-3] +\def\foo#1#2% + {\def\oof##1% + {/#1/#2/% + ##1% + /#1//#2/}% + \oof{P}\oof{Q}\oof{R}} +\stopbuffer + +\typebuffer[test-3] + +These parameters indicated by \type {#} in the macro body are in fact references. +When we call for instance \type {\foo {1}{2}} the two parameters get pushed on a +parameter stack and the embodied references point to these stack entries. By the +time that body gets expanded \TEX\ bumps the input level and pushes the parameter +list onto the input stack. It then continues expansion. The parameter is not +copied, because it can't be changed anyway. The only penalty in terms of +performance and memory usage is the pushing and popping of the input. So how does +that work out for these three cases? + +When in the first case the \type {\oof{#1}{#2}{P}} is seen, \TEX\ starts expanding +the \type {\oof} macro. That one expects three arguments. The \type {#1} reference is +seen and in this case a copy of that parameter is passed. The same is true for the +other two. Then, inside \type {\oof} expansion happens on the parameters on the stack +and no copies have to be made there. + +The second case defines two macros so again two copies are made that make the bodies +of these macros. This comes at the cost of some runtime and memory. However, this +time with \type {\oof{P}} only one argument gets passed and instead expansion of the +macros happen in there. + +Normally macro arguments are not that large but there can be situations where we +really want to avoid useless copying. This not only saves memory but also can give a +bit better performance. In the examples above the second variant is some 10\percent +faster than the first one. We can gain another 10\percent with the following trick: + +\startbuffer[test-4] +\def\foo#1#2% + {\parameterdef\MyIndexOne\plusone % 1 + \parameterdef\MyIndexTwo\plustwo % 2 + \oof{P}\oof{Q}\oof{R}\norelax} + +\def\oof#1% + {<\MyIndexOne><\MyIndexOne>% + #1% + <\MyIndexTwo><\MyIndexTwo>} +\stopbuffer + +\typebuffer[test-4] + +Here we define an explicit parameter reference that we access later on. There is +the overhead of a definition but it can be neglected. We use that reference +(abstraction) in \type {\oof}. Actually you can use that reference in any call +down the chain. + +When applied to \type {\foo{1}{2}} the four variants above give us: + +\startpacked +\startlines \tt +\getbuffer[test-1]\foo{1}{2} +\getbuffer[test-2]\foo{1}{2} +\getbuffer[test-3]\foo{1}{2} +\getbuffer[test-4]\foo{1}{2} +\stoplines +\stoppacked + +Before we had \type {parameterdef} we had this: + +\startbuffer[test-5] +\def\foo#1#2% + {\integerdef\MyIndexOne\parameterindex\plusone % 1 + \integerdef\MyIndexTwo\parameterindex\plustwo % 2 + \oof{P}\oof{Q}\oof{R}\norelax} + +\def\oof#1% + {<\expandparameter\MyIndexOne><\expandparameter\MyIndexOne>% + #1% + <\expandparameter\MyIndexTwo><\expandparameter\MyIndexTwo>} +\stopbuffer + +\typebuffer[test-5] + +It involves more tokens, is a bit less abstract, but as it is a cheap extension +we kept it. It actually demonstrates that one can access parameters in the stack +by index, but it one then needs to keep track of where access takes place. In +principle one can debug the call chain this way. + +To come back to performance and memory usage, when the arguments become larger +the fourth variant with the \type {\parameterdef} quickly gains over the others. +But it only shows in exceptional usage. This mechanism is more about abstraction: +it permits us to efficiently turn arguments into local variables without the +overhead involved in creating macros. + +\stopsectionlevel + +\startsectionlevel[title=Nesting] + +We also have a few preamble features that relate to nesting. Although we can do +without (as shown for years in \LMTX) they do have some benefits. They are +discussed as group here and because they are only useful for low level +programming we stick to simple examples. The \type {#L} and \type {#R} use the +following token as delimiters. Here we use \type {[} and \type {]} but they can +be a \type {\cs} as well. Nested delimiters are handled well. + +The \type {#S} grabs the argument till the next final square bracket \type {]} +but in the process will grab nested with it sees a \type {[}. The \type {#P} does +the same for parentheses and \type {#X} for angle brackets. In the next examples +the \type {#*} just gobbles optional spaces but we've seen that one already. + +The \type {#G} argument just registers the next token as delimiter but it will +grab multiple of them. The \type {#M} gobbles more: in addition to the delimiter +spaces are gobbled. + +\startbuffer +\tolerant\def\fooA [#1]{(#1)} +\tolerant\def\fooB [#L[#R]#1{(#1)} +\tolerant\def\fooC #S#1{(#1)} +\tolerant\def\fooE #S#1,{(#1)} +\tolerant\def\fooF #S#1#*#S#2{(#1/#2)} +\tolerant\def\fooG [#1]#S[#2]#*#S[#3]{(#1/#2/#3)} +\tolerant\def\fooH [#1][#S#2]#*[#S#3]{(#1/#2/#3)} +\tolerant\def\fooI #1=#2#G,{(#1=#2)} +\tolerant\def\fooJ #1=#2#M,{(#1=#2)} +\stopbuffer + +\typebuffer + +\getbuffer + +\starttabulate[|T|T|T||] +\NC \type{\fooA [x]} \NC \fooA [x] \NC (x) \NC \NR +\NC \type{\fooB [x]} \NC \fooB [x] \NC (x) \NC \NR +\NC \type{\fooC [1[2]3[4]5]} \NC \fooC [1[2]3[4]5] \NC (1[2]3[4]5) \NC \NR +\NC \type{\fooE X[,]X,} \NC \fooE X[,]X, \NC (X[,]X) \NC \NR +\NC \type{\fooF [A] [B]} \NC \fooF [A] [B] \NC (A/B) \NC \NR +\NC \type{\fooF [] []} \NC \fooF [] [] \NC (/) \NC \NR +\NC \type{\fooG [a][b][c]} \NC \fooG [a][b][c] \NC (a/b/c) \NC \NR +\NC \type{\fooG [a][b]} \NC \fooG [a][b] \NC (a/b/) \NC \NR +\NC \type{\fooG [a]} \NC \fooG [a] \NC (a//) \NC \NR +\NC \type{\fooG [a][x[x]x][c]} \NC \fooG [a][x[x]x][c] \NC (a/x[x]x/c) \NC \NR +\NC \type{\fooH [a][x[x]x][c]} \NC \fooH [a][x[x]x][c] \NC (a/x[x]x/c) \NC \NR +\NC \type{\fooI X=X,,,} \NC \fooI X=X,,, \NC (X=X) \NC \NR +\NC \type{\fooJ X=X, , ,} \NC \fooJ X=X, , , \NC (X=X) \NC \NR +\stoptabulate + +These features make it possible to support nested setups more efficiently and +also makes it possible to accept values that contain balanced brackets in setup +commands without additional overhead. Although it has never been an issue to let +users specify: + +\starttyping +\defineoverlay[whatever][{some \command[withparameters] here}] + +\setupfoo[before={\blank[big]}] +\stoptyping + +it might be less confusing to permit: + +\starttyping +\defineoverlay[whatever][some \command[withparameters] here] + +\setupfoo[before=\blank[big]] +\stoptyping + +as well, if only because occasionally users get hit by this. + +\stopsectionlevel + +\startsectionlevel[title=Duplicate hashes] + +In \TEX\ every character has a so called category code. Most characters are +classified as \quote {letter} (they make up words) or as \quote {other}. In +\UNICODE\ we distinguish symbols, punctuation, and more, but in \TEX\ these are +all of category \quote {other}. In math however we can classify them differently +but in this perspective we ignore that. The backslash has category \quote +{escape} and it starts a control sequence. The curly braces are (internally) of +category \quote {left brace} and \quote {right brace} aka \quote {begin group} +and \quote {end group} but, no matter what they are called, they begin and end +something: a group, argument, token list, box, etc. Any character can have those +categories. Although it would loook strange to a \TEX\ user, this can be made +valid: + +\startbuffer +!protected !gdef !weird¶1 +B + something: ¶1 +E +!weird BhereE +\stopbuffer + +\typebuffer + +In such a setup spaces can be of category \quote {invisible}. The paragraph +symbol takes the place of the hash as parameter identifier. The next code shows +how this is done. Here we wrap all in a macro so that we don't get catcode +interference in the document source. + +\startbuffer[demo] +\def\NotSoTeX + {\begingroup + \catcode `B \begingroupcatcode + \catcode `E \endgroupcatcode + \catcode `¶ \parametercatcode + \catcode `! \escapecatcode + \catcode 32 \ignorecatcode + \catcode 13 \ignorecatcode + % this buffer has a definition: + \getbuffer + % which is now known globally + \endgroup} +\NotSoTeX +\weird{there} +\stopbuffer + +\typebuffer[demo] + +This results in: + +\startlines +\getbuffer [demo] +\stoplines + +In the first line the \type {!}, \type {B} and \type {E} are used as escape and +argument delimiters, in the second one we use the normal characters. When we show +the \type {\meaningasis} we get: + +\startlines \tt +\meaningasis\weird +\stoplines + +or in more detail: + +\start \tt +\luatokentable\weird +\stop + +So, no matter how we set up the system, in the end we get some generic +representation. When we see \type {#1} in \quote {print} it can be either two +tokens, \type {#} (catcode parameter) followed by \type {1} with catcode other, +or one token referring to parameter \type {1} where the character \type {1} is +the opcode of an internal \quote {reference command}. In order to distinguish a +reference from the two token case, parameter hash tokens get shown as doubles. + +\start + +\catcode `¶=\parametercatcode +\catcode `§=\parametercatcode + +\startbuffer +\def\test #1{x#1x##1x####1x} +\def\tset ¶1{x¶1x¶¶1x¶¶¶¶1x} +\stopbuffer + +\typebuffer \getbuffer + +And with \type {\meaning} we get, consistent with the input: + +\startlines \tt +\meaning\test +\meaning\tset +\stoplines + +These are equivalent, apart from the parameter character in the body of the +definition: + +\startlines \tt +\luatokentable\test +\luatokentable\tset +\stoplines + +\stop + +Watch how every \quote {parameter} is just a character with the \UNICODE\ index +of the used input character as property. Let us summarize the process. When a +single parameter character is seen in the input, the next characer determines how +it will be interpreted. If there is a digit then it becomes a reference to a +parameter in the preamble, and when followed by another parameter character it +will be appended to the body of the macro and that second one is dropped. So, two +parameter characters become one, and four become two. One parameter character +becomes a reference and from that you can guess what three in a row become. +However, when \TEX\ is showing the macro definition (using \type {meaning}) the +hashes get duplicated in order to distinguish parameter references from parameter +characters that were kept (e.g.\ for nested definitions). One can make an +argument for \type {\parameterchar} as we also have \type {\escapechar} but by +now this convention is settled and it doesn't look that bad anyway. + +We now come to the more tricky part with respect to the doubling of hashes. When +\TEX\ was written its application landscape looked a bit different. For instance, +fonts were limited and therefore it was natural to access special characters by +name. Using \type {\#} to get a hash in the text was not that problematic, if one +needed that character at all. The same can be said for the braces, backslash and +even the dollar (after all \TEX\ is free software). + +But what if we have more visualization and|/|or serialization than meanings and +tracing? When we opened op the internals in \LUATEX\ and even more in +\LUAMETATEX\ the duplicating of hashes became a bit of a problem. There we don't +need to distinguish between a parameter reference and a parameter character +because by that time these references are resolved. All hashes that we encounter +are just that: hashes. And this is why in \LUAMETATEX\ we disable the duplication +for those cases where it serves no purpose. + +When the engine scans a macro definition it starts with pickin g up the name of +the macro. Then it starts scanning the preamble upto the left brace. In the +preamble of a macro the scanner converts hashes followed by another token into +single match token. Then when the macro body is scanned single hashes followed by +a number become a reference, while double hashes become one hash and get +interpreted at expansion time (possibly triggering an error when not followed by +a valid specifier like a number). In traditional \TEX\ we basically had this: + +\starttyping +\def\test#1{#1} +\def\test#1{##} +\def\test#1{#X} +\def\test#1{##1} +\stoptyping + +There can be a traling \type {#} in the preamble for special purposes but we +forget about that now. The first definition is valid, the second definition is +invalid when the macro is expanded and the third definition triggers an error at +definition time. The last definition will again trigger an error at expansion +time. + +However, in \LUAMETATEX\ we have an extended preamble where the following +preamble parameters are handled (some only in tolerant mode): + +\starttabulate[|c|||] +\NC \type{#n} \NC parameter \NC index \type{1} upto \type{E} \NC \NR +\TB +\NC \type{#0} \NC throw away parameter \NC increment index \NC \NR +\NC \type{#-} \NC ignore parameter \NC keep index \NC \NR +\TB +\NC \type{#*} \NC gobble white space \NC \NC \NR +\NC \type{#+} \NC keep (honor) the braces \NC \NC \NR +\NC \type{#.} \NC ignore pars and spaces \NC \NC \NR +\NC \type{#,} \NC push back space when no match \NC \NC \NR +\NC \type{#/} \NC remove leading and trailing spaces and pars \NC \NC \NR +\NC \type{#=} \NC braces are mandate \NC \NC \NR +\NC \type{#^} \NC keep leading spaces \NC \NC \NR +\NC \type{#_} \NC braces are mandate and kept (obey) \NC \NC \NR +\TB +\NC \type{#@} \NC par delimiter \NC only for internal usage \NC \NR +\TB +\NC \type{#:} \NC pick up scanning here \NC \NC \NR +\NC \type{#;} \NC quit scanning \NC \NC \NR +\TB +\NC \type{#L} \NC left delimiter token \NC followed by token \NC \NR +\NC \type{#R} \NC right delimiter token \NC followed by token \NC \NR +\TB +\NC \type{#G} \NC gobble token \NC followed by token \NC \NR +\NC \type{#M} \NC gobble token and spaces \NC followed by token \NC \NR +\TB +\NC \type{#S} \NC nest square brackets \NC only inner pairs \NC \NR +\NC \type{#X} \NC nest angle brackets \NC only inner pairs \NC \NR +\NC \type{#P} \NC nest parentheses \NC only inner pairs \NC \NR +\stoptabulate + +As mentioned these will become so called match tokens and only when we show the +meaning the hash will show up again. + +\startbuffer +\def\test[#1]#*[*S#2]{.#1.#2.} +\stopbuffer + +\typebuffer \getbuffer + +\startlines \tt +\luatokentable\test +\stoplines + +This means that in the body of a macro you will not see \type {#*} show up. It is +just a directive that tells the macro parser that spaces are to be skipped. The +\type {#S} directive makes the parser for the second parameter handle nested +square bracket. The only hash that we can see end up in the body is the one that +we entered as double hash (then turned single) followed by (in traditional terms) +a number that when all gets parsed with then become a reference: the sequence +\type {##1} internally is \type {#1} and becomes \quote {reference to parameter +1} assuming that we define a macro in that body. If no number is there, an error +is issued. This opens up the possibility to add more variants because it will +only break compatibility with respect to what is seen as error. As with the +preamble extensions, old documents that have them would have crashed before they +became available. + +So, this means that in the body, and actually anywhere in the document apart from +preambles, we now support the following general parameter specifiers. Keep in +mind that they expand in an expansion context which can be tricky when they +overlap with preamble entries, like for instance \type {#R} in such an expansion. +Future extensions can add more so {\em any} hashed shortcut is sensitive for +that. + +\starttabulate[|l|||] +\NC \type{#I} \NC current iterator \NC \type {\currentloopiterator} \NC \NR +\NC \type{#P} \NC parent iterator \NC \type {\previousloopiterator 1} \NC \NR +\NC \type{#G} \NC grandparent iterator \NC \type {\previousloopiterator 2} \NC \NR +\TB +\NC \type{#H} \NC hash escape \NC \type {#} \NC \NR +\NC \type{#S} \NC space escape \NC \ruledhbox to \interwordspace{\novrule height .8\strutht} \NC \NR +\NC \type{#T} \NC tab escape \NC \type {\t} \NC \NR +\NC \type{#L} \NC newline escape \NC \type {\n} \NC \NR +\NC \type{#R} \NC return escape \NC \type {\r} \NC \NR +\NC \type{#X} \NC backslash escape \NC \tex {} \NC \NR +\TB +\NC \type{#N} \NC nbsp \NC \type {U+00A0} (under consideration) \NC \NR +\NC \type{#Z} \NC zws \NC \type {U+200B} (under consideration) \NC \NR +%NC \type{#-} \NC zwnj \NC \type {U+200C} (under consideration) \NC \NR +%NC \type{#+} \NC zwj \NC \type {U+200D} (under consideration) \NC \NR +%NC \type{#>} \NC l2r \NC \type {U+200E} (under consideration) \NC \NR +%NC \type{#<} \NC r2l \NC \type {U+200F} (under consideration) \NC \NR +\stoptabulate + +Some will now argue that we already have \type {^^} escapes in \TEX\ and \type +{^^^^} and \type {^^^^^^} in \LUATEX\ and that is true. However, these can be +disabled, and in \CONTEXT\ they are, where we instead enable the prescript, +postscript, and index features in mathmode and there type {^} and \type {_} are +used. Even more: in \CONTEXT\ we just let \type {^}, \type {_} and \type {&} be +what they are. Occasionally I consider \type {$} to be just that but as I don't +have dollars I will happily leave that for inline math. When users are not +defining macros or are using the alternative definitions we can consider making +the \type {#} a hash. An excellent discussion of how \TEX\ reads it's input and +changes state accordingly can be found in Victor Eijkhouts \quotation {\TEX\ By +Topic}, section 2.6: when \type {^^} is followed by a character with $v < 128$ +the interpreter will inject a character with code $v - 64$. When followed by two +(!) lowercase hexadecimal characters, the corresponding character will be +injected. Anyway, it not only looks kind of ugly, it also is somewhat weird +because what follows is interpreted mixed way. The substitution happens early on +(which is okay). But, how about the output? Traditional \TEX\ serializes special +characters with a similar syntax but that has become optional when eight bit mode +was added to the engines, it is configurable in \LUATEX\ and has been dropped in +\LUAMETATEX: we operate in a \UTF\ universum. + +\stopsectionlevel + \stopdocument % freezing pitfalls: @@ -1010,3 +1526,15 @@ in turn only needs incrementing a reference counter. % \defcsname % \edefcsname % \letcsname + +% { +% \scratchdimenone 10pt \the\currentstacksize\par +% \scratchdimentwo 10pt \the\currentstacksize\par +% \scratchdimenone 20pt \the\currentstacksize\par +% \scratchdimentwo 20pt \the\currentstacksize\par +% \scratchdimenone 10pt \the\currentstacksize\par +% { +% \scratchdimenone 10pt \the\currentstacksize\par +% \scratchdimentwo 20pt \the\currentstacksize\par +% } +% } diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex index 6543c079591..3412a740f5b 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex @@ -1247,7 +1247,7 @@ that a negative depth of more than 1000 point made no sense at all. The last depth on a vertical list is registered in the \type {\prevdepth} variable. This is basically a reference into the current list. In order to illustrate some interesting side effects of setting this \type {\prevdepth} and especially when -we set it to -1000pt. In order to illustrate this this special value can be set +we set it to $\tf -1000pt$. In order to illustrate this this special value can be set to a different value in \LUAMETATEX. However, as dealing with the property is somewhat special in the engine you should not set it unless you know that the macro package is ware of it. @@ -1307,21 +1307,23 @@ coded dimension. We now give a more extensive example: \egroup \stopbuffer -In this example we set \type {\ignoredepthcriterium} to $\tf-50.0pt$ instead of the +\typebuffer[example][option=TEX] + +In this example we set \type {\ignoredepthcriterium} to $\tf -50.0pt$ instead of the normal $\tf -1000pt$. The helper is defined as: -\typebuffer[option=TEX][definitions-1] +\typebuffer[definition-1][option=TEX] or -\typebuffer[option=TEX][definitions-2] +\typebuffer[definition-2][option=TEX] -The result of the following example is shown in \in {figures} [fig:prevdepth-1] -\in {and} [fig:prevdepth-2]. The first case is what we normally have in text and -we haven't set \type {prevdepth} explicitly between lines so \TEX\ will just look -at the depth of the lines. In the second case the depth is ignored when less than -the criterium which is why, when we set the depth of the box to a negative value -we get somewhat interesting skips. +The result is shown in \in {figures} [fig:prevdepth-1] \in {and} +[fig:prevdepth-2]. The first case is what we normally have in text and we haven't +set \type {prevdepth} explicitly between lines so \TEX\ will just look at the +depth of the lines. In the second case the depth is ignored when less than the +criterium which is why, when we set the depth of the box to a negative value we +get somewhat interesting skips. \startplacefigure[reference=fig:prevdepth-1] \showmakeup[line] @@ -1355,6 +1357,8 @@ we get with positive values: \egroup \stopbuffer +\typebuffer[example][option=TEX] + \startplacefigure[reference=fig:prevdepth-3] \showmakeup[line] \ignoredepthcriterium50pt diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-registers.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-registers.tex index 233a8c1788d..cdd026fb6fb 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-registers.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-registers.tex @@ -282,5 +282,211 @@ macros. \stopsectionlevel -\stopdocument +\startsectionlevel[title=Units] + +The \LUAMETATEX\ engine supports the following units. The first batch is constant +with hard coded fine tuned values. The second set is related to the current font. +The last group is kind of special, the \type {es} is a replacement for the \type +{in} and has a little sister in \type {ts}. The \type {dk} is dedicated to the +master and makes a nice offset for so called \TEX\ pages that we use for demos. + +\starttabulate[|Tl|Tr|l|] +\FL +\NC pt \NC \thewithoutunit\dimexpr1pt \NC point \NC \NR +\NC bp \NC \thewithoutunit\dimexpr1bp \NC big point (aka postscript point) \NC \NR +\NC in \NC \thewithoutunit\dimexpr1in \NC inch \NC \NR +\NC cm \NC \thewithoutunit\dimexpr1cm \NC centimeter \NC \NR +\NC mm \NC \thewithoutunit\dimexpr1mm \NC milimeter \NC \NR +\NC dd \NC \thewithoutunit\dimexpr1dd \NC didot \NC \NR +\NC cc \NC \thewithoutunit\dimexpr1cc \NC cicero \NC \NR +\NC pc \NC \thewithoutunit\dimexpr1pc \NC pica \NC \NR +\NC sp \NC \thewithoutunit\dimexpr1sp \NC scaled points \NC \NR +\NC px \NC \thewithoutunit\dimexpr1sp \NC pixel \NC \NR +\ML +\NC ex \NC \thewithoutunit\dimexpr1ex \NC ex height \NC \NR +\NC em \NC \thewithoutunit\dimexpr1em \NC em width \NC \NR +\NC mu \NC $\tt\thewithoutunit\onemuskip$ \NC math unit \NC \NR +\ML +\NC ts \NC \thewithoutunit\dimexpr1ts \NC tove \NC \NR +\NC es \NC \thewithoutunit\dimexpr1es \NC edith \NC \NR +\NC eu \NC \thewithoutunit\dimexpr1eu \NC european unit \NC \NR +\NC dk \NC \thewithoutunit\dimexpr1dk \NC knuth \NC \NR +\LL +\stoptabulate + +The \type {fi[lll]} unit is not really a unit but a multiplier for infinite +stretch and shrink; original \TEX\ doesn't have the simple \type {fi}. + +In addition to these we can have many more. In principle a user can define +additional ones but there's always a danger of clashing. For users we reserve the +units starting with an \type{u}. Here is how you define your own, we show three +variants: + +\startbuffer +\newdimension \FooA \FooA 1.23pt +\newdimen \FooB \FooB 12.3pt +\protected\def\FooC {\the\dimexpr\FooA +\FooB\relax} + +\pushoverloadmode % just in case + \newuserunit\FooA ua + \newuserunit\FooB ub + \newuserunit\FooC uc +\popoverloadmode +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +And this is how they show up: + +\startbuffer +\the\dimexpr 2 ua \relax\quad +\the\dimexpr 2 ub \relax\quad +\the\dimexpr 2 uc \relax +\stopbuffer + +\getbuffer + +with + +\typebuffer[option=TEX] + +The following additional units are predefined (reserved). The values are in +points and some depend on the current layout and document font. + +\starttabulate[|T|Tr|l|] +\NC pi \NC \thewithoutunit\dimexpr 1pi \NC {\tt\pi} for Mikael \NC \NR +\NC ft \NC \thewithoutunit\dimexpr 1ft \NC \type {foot} for Alan \NC \NR +\NC fs \NC \thewithoutunit\dimexpr 1fs \NC (global body) font size \NC \NR +\NC tw \NC \thewithoutunit\dimexpr 1tw \NC (layout) text width \NC \NR +\NC th \NC \thewithoutunit\dimexpr 1th \NC (layout) text height \NC \NR +\NC hs \NC \thewithoutunit\dimexpr 1hs \NC (current) hsize \NC \NR +\NC vs \NC \thewithoutunit\dimexpr 1vs \NC (current) vsize \NC \NR +\NC cd \NC \thewithoutunit\dimexpr 1cd \NC (when set) column distance \NC \NR % todo +\NC cw \NC \thewithoutunit\dimexpr 1cw \NC (when set) column width \NC \NR % todo +\NC cx \NC \thewithoutunit\dimexpr 1cx \NC combination cell width \NC \NR +\NC uu \NC \thewithoutunit\dimexpr 1uu \NC user unit (\METAFUN) \NC \NR +\NC fw \NC \thewithoutunit\dimexpr 1fw \NC framed width \NC \NR +\NC fh \NC \thewithoutunit\dimexpr 1fh \NC framed height \NC \NR +\NC fo \NC \thewithoutunit\dimexpr 1fo \NC framed offset \NC \NR +\NC lw \NC \thewithoutunit\dimexpr 1lw \NC line width \NC \NR +\NC sh \NC \thewithoutunit\dimexpr 1sh \NC strut height \NC \NR +\NC sd \NC \thewithoutunit\dimexpr 1sd \NC strut depth \NC \NR +\NC st \NC \thewithoutunit\dimexpr 1st \NC strut total \NC \NR +\NC ch \NC \thewithoutunit\dimexpr 1ch \NC width of zero (css) \NC \NR +\NC fa \NC \thewithoutunit\dimexpr 1fa \NC font ascender \NC \NR +\NC fd \NC \thewithoutunit\dimexpr 1fd \NC font descender \NC \NR +\NC fc \NC \thewithoutunit\dimexpr 1fc \NC font cap height \NC \NR +\stoptabulate + +Here is an example of usage: + +\startbuffer +\startcombination[nx=4,ny=1] + {\ruledhbox to 1cx{\strut one}} {1} + {\ruledhbox to 1cx{\strut two}} {2} + {\ruledhbox to 1cx{\strut three}} {3} + {\ruledhbox to 1cx{\strut four}} {4} +\stopcombination +\stopbuffer + +\usemodule[system-units] +\startplacefigure[title=A map of available units,reference=fig:unitsmap] + \framed[offset=1ex]{\showunitsmap} +\stopplacefigure + +\typebuffer[option=TEX] + +\startlinecorrection +\getbuffer +\stoplinecorrection + +The \type {uu} can be set by users using the \type {\uunit} dimension variable. +The default valu sis 1cm. Its current value is also known at the \METAPOST\ end, +as demonstrated in \in {figure} [fig:userunits]. + +\startbuffer +\startcombination[nx=2,ny=1] + \startcontent + \uunit=1cm + \framed[offset=1uu] + \bgroup + \startMPcode + fill fullcircle scaled 3uu withcolor "darkred" ; + fill fullcircle scaled 2cm withcolor "darkgreen" ; + \stopMPcode + \egroup + \stopcontent + \startcaption + \type {\uunit = 1cm} + \stopcaption + \startcontent + \uunit=1cx + \framed[offset=.1uu] + \bgroup + \startMPcode + fill fullcircle scaled .5uu withcolor "darkblue" ; + fill fullcircle scaled 2cm withcolor "darkyellow" ; + \stopMPcode + \egroup + \stopcontent + \startcaption + \type {\uunit = 1cx} + \stopcaption +\stopcombination +\stopbuffer + +% \framed[offset=1uu] +% \bgroup +% \startMPcode +% save uu ; numeric uu ; uu := 1cm ; +% fill fullcircle scaled 3uu withcolor "darkcyan" ; +% fill fullcircle scaled 2cm withcolor "darkmagenta" ; +% \stopMPcode +% \egroup + +\typebuffer[option=TEX] + +There is one catch here. If you use your own \type {uu} as numeric, you might +need this: + +\starttyping[option=MP] +save uu ; numeric uu ; uu := 1cm ; +\stoptyping + +That is: make sure the meaning is restored afterwards and explicitly declare the +variable. But this is good practice anyway when you generate multiple graphics +using the same \METAPOST\ instance. + +\startplacefigure[reference=fig:userunits,title={Shared user units in \TEX\ and \METAFUN.}] + \getbuffer +\stopplacefigure + +There a few units not mentioned yet and those concern math, where we need to adapt to +the current style. + +\protected\def\ShowMathUnits#1% + {\im{#1x\mathord{+ + {\darkgray \vrule width 1pt depth 0pt height 1ex \relax}% + {\darkred \vrule width 1pt depth 0pt height 1ma \relax}% + {\darkgreen\vrule width 1pt depth 0pt height 1mx \relax}% + {\darkblue \vrule width 1pt depth 0pt height 1mq \relax}% + x}}} + +\startlinecorrection +\startcombination[nx=3,ny=1] + {\scale[scale=6000]{\ShowMathUnits\textstyle}} {text style} + {\scale[scale=6000]{\ShowMathUnits\scriptstyle}} {script style} + {\scale[scale=6000]{\ShowMathUnits\scriptscriptstyle}} {script script style} +\stopcombination +\stoplinecorrection + +The bars show \type {1ex}, \type {1ma} (axis), \type {1mx} (ex|-|height) and +\type {1mq} (em|-|width or quad). The last three adapt themselves to the style. +Often the \type {mx} makes more sense than \type {ex}. + +\stopsectionlevel + +\page + +\stopdocument diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-style.tex b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-style.tex index 9d3bcdbb337..c0111a97d4a 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-style.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/lowlevel/lowlevel-style.tex @@ -14,6 +14,7 @@ [document] [title=No Title, author=No Author, + coauthor=, color=NoColor] \setupbodyfont @@ -124,7 +125,9 @@ \startsectionlevel[title=Colofon,number=no,saveinlist=no] \starttabulate - \NC Author \NC Hans Hagen \NC \NR + \NC Author \NC Hans Hagen + \doifdocumentvariable{coauthor}{ & \documentvariable{coauthor}} + \NC \NR \NC \CONTEXT \NC \contextversion \NC \NR \NC \LUAMETATEX \NC \texengineversion \NC \NR \NC Support \NC www.pragma-ade.com \NC \NR diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-building.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-building.tex index 277d39251db..e4c00d3a241 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-building.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-building.tex @@ -393,7 +393,7 @@ There is however a catch. The keyword scanners in \LUAMETATEX\ are implemented slightly different. When \TEX\ scans a keyword it will (case insensitive) scan for a whole keyword. So, it scans for \type {height} and when it doesn't find it it will scan for \type {depth} etc. When it does find a keyword in this case it -expects a dimension next. When that criterium is not met it will issue an error +expects a dimension next. When that criterion is not met it will issue an error message. In order to avoid look ahead failures like that it is recommended to end the @@ -457,10 +457,10 @@ up such that it can adapt itself: \hbox to 3cm {x\leaders\hrule\hfil x} \hbox{x \vrule width 4cm \relax x} \hbox{x \srule width 4cm \relax x} -\hbox{x \vrule font \font char `( width 4cm \relax x} \hbox{x \srule font \font char `( width 4cm \relax x} \hbox{$x \srule fam \fam char `( width 4cm \relax x$} -\hbox{$x \vrule fam \fam char `( width 4cm \relax x$} +% \hbox{x \vrule font \font char `( width 4cm \relax x} +% \hbox{$x \vrule fam \fam char `( width 4cm \relax x$} \stopbuffer \typebuffer @@ -885,7 +885,7 @@ criteria makes a difference. Experiments with this demonstrated the usual: when asked what looks best contradictions mix with expectations and being triggered by events that one related to \TEX, like successive hyphenated lines. -The \prm {linebreakcriterium} parameter can be set to a value made from four bytes. We're +The \prm {linebreakcriterion} parameter can be set to a value made from four bytes. We're not going to explain the magic numbers because they come from and are discussed in original \TEX. It is enough to know that we have four criteria: @@ -908,9 +908,9 @@ The original decisions are made in the following way: \starttyping function loose(badness) - if badness > loose_criterium then + if badness > loose_criterion then return very_loose_fit - elseif badness > decent_criterium then + elseif badness > decent_criterion then return loose_fit else { return decent_fit @@ -918,7 +918,7 @@ function loose(badness) end function tight(badness) - if badness > decent_criterium then + if badness > decent_criterion then return tight_fit else { return decent_fit @@ -957,7 +957,7 @@ doesn't work out as you expect. Don Knuth did a good job on the heuristics and after many decades there is no real need to change something. Consider it a playground. -The parameter \prm {ignoredepthcriterium} is set to -1000pt at startup and is a +The parameter \prm {ignoredepthcriterion} is set to -1000pt at startup and is a special signal for \prm {prevdepth}. You can change the value locally for educational purposes but best not mess with this standard value in production code unless you want special effects. @@ -1181,7 +1181,7 @@ variable is global. Traditional \TEX\ has the \prm {parfillskip} parameter that determines the way the last line is filled. In \LUAMETATEX\ we also have \prm {parfillleftskip}. The counterparts for the first line are \prm {parinitleftskip} and \prm -{parinitrightskip}. +{parinitrightskip}. We also have \prm {parfillrightskip} as consistency alias. \startbuffer \leftskip 2em diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-callbacks.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-callbacks.tex index 803b0427b04..89265a6665a 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-callbacks.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-callbacks.tex @@ -223,7 +223,7 @@ state is with respect to the \quote {current page}. The possible values for the \stopsubsection -\startsubsection[title={\cbk {build_page_insert}}] +\startsubsection[title={\cbk {insert_distance}}] \topicindex{callbacks+inserts} diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex index 46d986bfb57..a72a9236f69 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex @@ -270,11 +270,11 @@ live in a \UNICODE\ galaxy that is no real problem. \stopsubsection -\startsubsection[title={\prm {Uchar}}] +\startsubsection[title={\prm {tocharacter}}] \topicindex{\UNICODE} -The expandable command \prm {Uchar} reads a number between~0 and $1{,}114{,}111$ +The expandable command \prm {tocharacter} reads a number between~0 and $1{,}114{,}111$ and expands to the associated \UNICODE\ character. \stopsubsection @@ -1258,15 +1258,15 @@ In addition to these \ASCII\ combinations, we also support some \UNICODE\ variants. The extra comparison options are: \starttabulate[|l|c|c|l|] -\DB character \BC \BC \BC operation \NC \NR +\DB character \BC \BC \BC operation \NC \NR \TB -\NC \type {0x2208} \NC $\Uchar"2208$ \NC \NC element of \NC \NR -\NC \type {0x2209} \NC $\Uchar"2209$ \NC \NC not element of \NC \NR -\NC \type {0x2260} \NC $\Uchar"2260$ \NC \type {!=} \NC not equal \NC \NR -\NC \type {0x2264} \NC $\Uchar"2264$ \NC \type {!>} \NC less equal \NC \NR -\NC \type {0x2265} \NC $\Uchar"2265$ \NC \type {!<} \NC greater equal \NC \NR -\NC \type {0x2270} \NC $\Uchar"2270$ \NC \NC not less equal \NC \NR -\NC \type {0x2271} \NC $\Uchar"2271$ \NC \NC not greater equal \NC \NR +\NC \type {0x2208} \NC $\tocharacter"2208$ \NC \NC element of \NC \NR +\NC \type {0x2209} \NC $\tocharacter"2209$ \NC \NC not element of \NC \NR +\NC \type {0x2260} \NC $\tocharacter"2260$ \NC \type {!=} \NC not equal \NC \NR +\NC \type {0x2264} \NC $\tocharacter"2264$ \NC \type {!>} \NC less equal \NC \NR +\NC \type {0x2265} \NC $\tocharacter"2265$ \NC \type {!<} \NC greater equal \NC \NR +\NC \type {0x2270} \NC $\tocharacter"2270$ \NC \NC not less equal \NC \NR +\NC \type {0x2271} \NC $\tocharacter"2271$ \NC \NC not greater equal \NC \NR \LL \stoptabulate @@ -1767,6 +1767,30 @@ else \quote {last} has been seen. \stopsection +\startsection[title=Kerns and penalties] + +\startsubsection[title=\prm {hkern} and \prm {vkern}] + +\topicindex {kerns} + +These two primitives complement \prm {hskip} and \prm {vskip} and force the right +mode when issued. Contrary to the skips, internally we still have a common kern +command code but that is not something the user has to worry about. + +\stopsubsection + +\startsubsection[title=\prm {hpenalty} and \prm {vpenalty}] + +\topicindex {penalties} + +As the kern and skip related primitives mentioned in the in the previous section +these two primitives are there fort consistency: they force the right (related) +mode. (Sometimes being a bit more explicit is cleaner.) + +\stopsubsection + +\stopsection + \startsection[title=Scanning] \startsubsection[title=Keywords] @@ -2488,6 +2512,38 @@ Unit equivalent to ten Toves or one Edith. \stopsection +\startsection[title=Registers] + + +\startsubsection[title={32 bit floats}] + +The engine has native float registers which means that we have a similar set of +primitives as for dimensions and integers: \prm {float}, \prm {floatdef}, \prm +{floatexpr} and \prm {iffloat}. In the context if an integer a rounded value is +used, in the context of a dimensions the floating point number is interpreted as +points. Internally floats are stored as so called posits, which gives more accuracy +for smaller values. + +\stopsubsection + +\startsubsection[title={32 bit posits}] + +{\em This is a playground. It will stay but might evolve.} + +\stopsubsection + +\startsubsection[title={Extra features}] + +There are \prm {ifabsnum}, \prm {ifabsdim} and \prm {ifabsfloat} that compare +absolute values of quantities. The primitives \prm{ifzeronum}, \prm{ifzerodim}, +\prm{ifzerofloat} do a fast test for zero. The \prm {ifintervalnum}, \prm +{ifintervaldim} and \prm {ifintervalfloat} primitives take a delta and two values +and check if these values overlap within the ranges dedicated by the delta. + +\stopsubsection + +\stopsection + \startsection[title=Expressions] \startsubsection[title={Rounding and scaling}] diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex index 7f0a7a62c3b..2b3fc2d1c24 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex @@ -1011,26 +1011,26 @@ values only makes sense in the perspective of the used macro package. \stopsubsection -\startsubsection[title={Tracing}] - -The \prm {tracingfonts} primitive that has been inherited from \PDFTEX\ has -been adapted to support variants in reporting the font. The reason for this -extension is that a csname not always makes sense. The zero case is the default. - -\starttabulate[|l|l|] -\DB value \BC reported \NC \NR -\TB -\NC \type{0} \NC \type{\foo xyz} \NC \NR -\NC \type{1} \NC \type{\foo (bar)} \NC \NR -\NC \type{2} \NC \type{ xyz} \NC \NR -\NC \type{3} \NC \type{ xyz} \NC \NR -\NC \type{4} \NC \type{} \NC \NR -\NC \type{5} \NC \type{} \NC \NR -\NC \type{6} \NC \type{ xyz} \NC \NR -\LL -\stoptabulate - -\stopsubsection +% \startsubsection[title={Tracing}] +% +% The \prm {tracingfonts} primitive that has been inherited from \PDFTEX\ has +% been adapted to support variants in reporting the font. The reason for this +% extension is that a csname not always makes sense. The zero case is the default. +% +% \starttabulate[|l|l|] +% \DB value \BC reported \NC \NR +% \TB +% \NC \type{0} \NC \type{\foo xyz} \NC \NR +% \NC \type{1} \NC \type{\foo (bar)} \NC \NR +% \NC \type{2} \NC \type{ xyz} \NC \NR +% \NC \type{3} \NC \type{ xyz} \NC \NR +% \NC \type{4} \NC \type{} \NC \NR +% \NC \type{5} \NC \type{} \NC \NR +% \NC \type{6} \NC \type{ xyz} \NC \NR +% \LL +% \stoptabulate +% +% \stopsubsection \stopsection diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-introduction.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-introduction.tex index 142f18c3259..c793f39192d 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-introduction.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-introduction.tex @@ -116,6 +116,17 @@ additions to \METAPOST: in due time these will be discussed in the \LUAMETAFUN\ manual (the official \METAPOST\ manual is maintained elsewhere and should not discuss features that are not in the \LUATEX\ version). +This manual is not a tutorial. It is also not a replacement for {\em The \TEX\ +Book}. It just collects (as we go) what is available in \LUAMETATEX, and +therefore it always is a bit behind; actually the \TEX\ sources of the manuals +might be ahead of the file you read right now. For new functionality you can look +at documents (or source files or test files) that come with \CONTEXT\ where it is +put into perspective. Some new primitives might speak for themselves, especially +when you are familiar with \TEX. Some might not give a clue at all even with a +bit of explanation: if so, just forget about them. You can always ask on the +\CONTEXT\ list for the how, when and why of new features. It all comes for free, +so keep that in mind when you are going to complain. + \blank[big] Hans Hagen diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-math.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-math.tex index 61ec42ec36e..5843084f5e8 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-math.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-math.tex @@ -68,14 +68,13 @@ transformed in the font engine later on, just as hyphenation directive can be added. Eventually one (normally) gets a mix of glyphs, font kerns from a sequence of glyphs -In math mode \type {abc} results in three simple ordinary noads and \type {a -b c} is equivalent to that: three noads. But \type {a bc} results in two -ordinary noads where the second one has a sublist of two ordinary noads. -Because characters have class properties, \type {( a + b = c )} results in a -simple open noad, a simple ordinary, a simple binary, a simple ordinary, a -simple relation, a simple ordinary and simple close noad. The next samples show a -bit of this; in order to see th effects spacing between ordinary atoms set -to \type {9mu}. +In math mode \type {abc} results in three simple ordinary noads and \type {a b c} +is equivalent to that: three noads. But \type {a bc} results in two ordinary +noads where the second one has a sublist of two ordinary noads. Because +characters have class properties, \type {( a + b = c )} results in a simple open +noad, a simple ordinary, a simple binary, a simple ordinary, a simple relation, a +simple ordinary and simple close noad. The next samples show a bit of this; in +order to see the effects of spacing between ordinary atoms set it to \type {9mu}. \startbuffer \typebuffer[sample] @@ -635,7 +634,7 @@ are not bound to fonts because we don't know if have a font involved. \startsection[title={Math styles}] -\startsubsection[title={\prm {mathstyle}, \prm {mathstackstyle} and \prm {Ustyle}}] +\startsubsection[title={\prm {mathstyle}, \prm {mathstackstyle} and \prm {givenmathstyle}}] \topicindex {math+styles} @@ -756,12 +755,12 @@ that when you got it, and want to act upon it, you need to remap it onto say \pr why we also have a more efficient alternative that you can use in macros: \starttyping -\normalexpand{ ... \Ustyle\the\mathstyle ...} -\normalexpand{ ... \Ustyle\the\mathstackstyle ...} +\normalexpand{ ... \givenmathstyle\the\mathstyle ...} +\normalexpand{ ... \givenmathstyle\the\mathstackstyle ...} \stoptyping -This new primitive \prm {Ustyle} accepts a numeric value. The \prm -{mathstackstyle} primitive is just a bonus (it complements \prm {Ustack}). +This new primitive \prm {givenmathstyle} accepts a numeric value. The \prm +{mathstackstyle} primitive is just a bonus (it complements \prm {mathstack}). The styles that the different math components and their subcomponents start out with are no longer hard coded but can be set at runtime: @@ -815,7 +814,7 @@ are no real reasons to change them. \stopsubsection -\startsubsection[title={\prm {Ustack}}] +\startsubsection[title={\prm {mathstack}}] \topicindex {math+stacks} @@ -823,13 +822,13 @@ There are a few math commands in \TEX\ where the style that will be used is not known straight from the start. These commands (\prm {over}, \prm {atop}, \prm {overwithdelims}, \prm {atopwithdelims}) would therefore normally return wrong values for \prm {mathstyle}. To fix this, \LUATEX\ introduces a special -prefix command: \prm {Ustack}: +prefix command: \prm {mathstack}: \starttyping -$\Ustack {a \over b}$ +$\mathstack {a \over b}$ \stoptyping -The \prm {Ustack} command will scan the next brace and start a new math group +The \prm {mathstack} command will scan the next brace and start a new math group with the correct (numerator) math style. The \prm {mathstackstyle} primitive relates to this feature. @@ -1526,16 +1525,16 @@ front. \startbuffer $ - x \Usubscript {-} - \frozen\Umathsubshiftdown\textstyle 0pt x \Usubscript {0} - {\frozen\Umathsubshiftdown\textstyle 5pt x \Usubscript {5}} - x \Usubscript {0} - {\frozen\Umathsubshiftdown\textstyle 15pt x \Usubscript {15}} - x \Usubscript {0} - {\frozen\Umathsubshiftdown\textstyle 20pt x \Usubscript {20}} - x \Usubscript {0} - \frozen\Umathsubshiftdown\textstyle 10pt x \Usubscript {10} - x \Usubscript {0} + x \subscript {-} + \frozen\Umathsubshiftdown\textstyle 0pt x \subscript {0} + {\frozen\Umathsubshiftdown\textstyle 5pt x \subscript {5}} + x \subscript {0} + {\frozen\Umathsubshiftdown\textstyle 15pt x \subscript {15}} + x \subscript {0} + {\frozen\Umathsubshiftdown\textstyle 20pt x \subscript {20}} + x \subscript {0} + \frozen\Umathsubshiftdown\textstyle 10pt x \subscript {10} + x \subscript {0} $ \stopbuffer @@ -1555,17 +1554,17 @@ unprocessed math list. The result looks as follows: \startsubsection[title={Arbitrary atoms with \prm {mathatom} etc.}] -The original \TEX\ engine has primitives like \prm {mathord} and a limited set of -possible atoms. In \LUAMETATEX\ we have many more built in and you can add more. -It will take a while before we have documented all the new math features and more -details can be found in the manuals that come with \CONTEXT\ for which all this -was implemented. In addition to \prm {mathordinary} (aka \prm {mathord}), \prm -{mathoperator} (aka \prm {mathop}), \prm {mathbinary} (aka \prm {mathbin}), \prm -{mathrelation} (aka \prm {mathrel}), \prm {mathopen}, \prm {mathclose}, \prm -{mathpunctuation} (aka {mathpunct}) and \prm {mathinner} we have \prm -{mathfraction}, \prm {mathradical}, \prm {mathmiddle}, \prm {mathaccent}, \prm -{mathfenced}, \prm {mathghost} and the existing \prm {mathunderline} (aka \prm -{underline}) and \prm {mathoverline} (aka \prm {overline}) class driven atoms. +% The original \TEX\ engine has primitives like \prm {mathord} and a limited set of +% possible atoms. In \LUAMETATEX\ we have many more built in and you can add more. +% It will take a while before we have documented all the new math features and more +% details can be found in the manuals that come with \CONTEXT\ for which all this +% was implemented. In addition to \prm {mathordinary} (aka \prm {mathord}), \prm +% {mathoperator} (aka \prm {mathop}), \prm {mathbinary} (aka \prm {mathbin}), \prm +% {mathrelation} (aka \prm {mathrel}), \prm {mathopen}, \prm {mathclose}, \prm +% {mathpunctuation} (aka {mathpunct}) and \prm {mathinner} we have \prm +% {mathfraction}, \prm {mathradical}, \prm {mathmiddle}, \prm {mathaccent}, \prm +% {mathfenced}, \prm {mathghost} and the existing \prm {mathunderline} (aka \prm +% {underline}) and \prm {mathoverline} (aka \prm {overline}) class driven atoms. The \prm {mathatom} primitive is the generic one and it accepts a couple of keywords: @@ -2115,12 +2114,12 @@ These render as: \getbuffer \stopsubsection -\startsubsection[title={Math styles: \prm {Ustyle}}] +\startsubsection[title={Math styles: \prm {givenmathstyle}}] This primitive accepts a style identifier: \starttyping -\Ustyle \displaystyle +\givenmathstyle \displaystyle \stoptyping This in itself is not spectacular because it is equivalent to @@ -2135,9 +2134,12 @@ zero upto seven (like the ones reported by the primitive \prm {mathstyle}). So, next few lines give identical results: \startbuffer -$\Ustyle0 \number\mathstyle \Ustyle7 \number\mathstyle$ -$\Ustyle\displaystyle \number\mathstyle \Ustyle\crampedscriptscriptstyle \number\mathstyle$ -$ \displaystyle \number\mathstyle \crampedscriptscriptstyle \number\mathstyle$ +$\givenmathstyle0 \number\mathstyle + \givenmathstyle7 \number\mathstyle$ +$\givenmathstyle\displaystyle \number\mathstyle + \givenmathstyle\crampedscriptscriptstyle \number\mathstyle$ +$\displaystyle \number\mathstyle + \crampedscriptscriptstyle \number\mathstyle$ \stopbuffer Like: \inlinebuffer . Values outside the valid range are ignored. @@ -2194,8 +2196,8 @@ influence the spacing. The numbers are the same as for character classes. \startsection[title={Extracting values}] -\startsubsection[title={Codes and using \prm {Umathcode}, \prm {Umathcharclass}, \prm -{Umathcharfam} and \prm {Umathcharslot}}] +\startsubsection[title={Codes and using \prm {Umathcode}, \prm {mathcharclass}, \prm +{mathcharfam} and \prm {mathcharslot}}] \topicindex {math+codes} @@ -2210,7 +2212,7 @@ you can extract the components of a math character. Say that we have defined: then \starttyping -[\Umathcharclass\Umathcode1] [\Umathcharfam\Umathcode1] [\Umathcharslot\Umathcode1] +[\mathcharclass\Umathcode1] [\Umathcharfam\Umathcode1] [\Umathcharslot\Umathcode1] \stoptyping which will return: @@ -2227,7 +2229,7 @@ These commands are provided as convenience. Before they became available you could do the following: \starttyping -\def\Umathcharclass{\numexpr +\def\mathcharclass{\numexpr \directlua{tex.print(tex.getmathcode(token.scan_int())[1])} \relax} \def\Umathcharfam{\numexpr @@ -2279,8 +2281,8 @@ identifier that determines in what style we end up in. \stopsubsection -\startsubsection[title={Verbose versions of single|-|character math commands like \prm {Usuperscript} -and \prm {Usubscript}}] +\startsubsection[title={Verbose versions of single|-|character math commands like \prm {superscript} +and \prm {subscript}}] \topicindex {math+styles} @@ -2290,8 +2292,8 @@ and \prm {Usubscript}}] \starttabulate[|l|l|] \DB primitive \BC explanation \NC \NR \TB -\NC \prm {Usuperscript} \NC duplicates the functionality of \type {^} \NC \NR -\NC \prm {Usubscript} \NC duplicates the functionality of \type {_} \NC \NR +\NC \prm {superscript} \NC duplicates the functionality of \type {^} \NC \NR +\NC \prm {subscript} \NC duplicates the functionality of \type {_} \NC \NR \NC \prm {Ustartmath} \NC duplicates the functionality of \type {$}, % $ when used in non-math mode. \NC \NR \NC \prm {Ustopmath} \NC duplicates the functionality of \type {$}, % $ @@ -2309,7 +2311,7 @@ the four mathon|/|mathoff commands with explicit dollar sign(s). \stopsubsection -\startsubsection[title={Script commands \prm {Unosuperscript}, \prm {Unosubscript}, \prm {Unosuperprescript} and \prm {Unosubprescript}}] +\startsubsection[title={Script commands \prm {nosuperscript}, \prm {nosubscript}, \prm {nosuperprescript} and \prm {nosubprescript}}] \topicindex {math+styles} \topicindex {math+scripts} @@ -2319,10 +2321,10 @@ time of rendering). So, \startbuffer[script] $ - x\Usuperscript {1}\Usubscript {2} = - x\Unosuperscript{1}\Unosubscript{2} = - x\Usuperscript {1}\Unosubscript{2} = - x\Unosuperscript{1}\Usubscript {2} + x\superscript {1}\subscript {2} = + x\nosuperscript{1}\nosubscript{2} = + x\superscript {1}\nosubscript{2} = + x\nosuperscript{1}\subscript {2} $ \stopbuffer @@ -2332,7 +2334,7 @@ results in \inlinebuffer[script]. \stopsubsection -\startsubsection[title={Script commands \prm {Ushiftedsuperscript}, \prm {Ushiftedsubscript}, \prm {Ushiftedsuperprescript} and \prm {Ushiftedsubprescript}}] +\startsubsection[title={Script commands \prm {shiftedsuperscript}, \prm {shiftedsubscript}, \prm {shiftedsuperprescript} and \prm {shiftedsubprescript}}] \topicindex {math+styles} \topicindex {math+scripts} @@ -2344,10 +2346,10 @@ are shown: \startbuffer[script] $ - x\Usuperscript {1}\Usubscript {2} = - x\Ushiftedsuperscript{1}\Ushiftedsubscript{2} = - x\Usuperscript {1}\Ushiftedsubscript{2} = - x\Ushiftedsuperscript{1}\Usubscript {2} + x\superscript {1}\subscript {2} = + x\shiftedsuperscript{1}\shiftedsubscript{2} = + x\superscript {1}\shiftedsubscript{2} = + x\shiftedsuperscript{1}\subscript {2} $ \stopbuffer @@ -2357,7 +2359,7 @@ results in \inlinebuffer[script]. \stopsubsection -\startsubsection[title={Injecting primes with \prm {Uprimescript}}] +\startsubsection[title={Injecting primes with \prm {primescript}}] This one is a bit special. In \LUAMETATEX\ a prime is a native element of a nucleus, alongside the two prescript and two postscripts. The most confusing @@ -2367,9 +2369,9 @@ are applied so we don't covert it. That leaves three cases: \startbuffer[script] $ - a \Uprimescript{1} \Usuperscript{2} \Usubscript {3} + - b \Usubscript {3} \Uprimescript{1} + - c \Uprimescript{1} \Usubscript {3} = d + a \primescript{1} \superscript{2} \subscript {3} + + b \subscript {3} \primescript{1} + + c \primescript{1} \subscript {3} = d $ \stopbuffer @@ -2380,16 +2382,16 @@ it were an index. \stopsubsection -\startsubsection[title={Prescripts with \prm {Usuperprescript} and \prm {Usubprescript}}] +\startsubsection[title={Prescripts with \prm {superprescript} and \prm {subprescript}}] \startbuffer \hbox{$ - {\tf X}^1_2^^3__4 \quad - {\tf X}^1 ^^3 \quad - {\tf X} _1 __4 \quad - {\tf X} ^^3 \quad - {\tf X} __4 \quad - {\tf X}^^3 __4 + {\tf X}^1_2^^^3___4 \quad + {\tf X}^1 ^^^3 \quad + {\tf X} _1 ___4 \quad + {\tf X} ^^^3 \quad + {\tf X} ___4 \quad + {\tf X}^^^3 ___4 $} \stopbuffer @@ -2409,15 +2411,15 @@ The more explicit commands are: \startbuffer \hbox{$ -{\tf X}\Usuperscript{1} \quad -{\tf X} \Usubscript{2} \quad -{\tf X}\Usuperscript{1}\Usubscript{2} \quad -{\tf X}\Usuperscript{1} \Usuperprescript{3} \quad -{\tf X} \Usubscript{2} \Usubprescript{4}\quad -{\tf X}\Usuperscript{1}\Usubscript{2}\Usuperprescript{3}\Usubprescript{4}\quad -{\tf X} \Usuperprescript{3} \quad -{\tf X} \Usubprescript{4}\quad -{\tf X} \Usuperprescript{3}\Usubprescript{4} +{\tf X}\superscript{1} \quad +{\tf X} \subscript{2} \quad +{\tf X}\superscript{1}\subscript{2} \quad +{\tf X}\superscript{1} \superprescript{3} \quad +{\tf X} \subscript{2} \subprescript{4}\quad +{\tf X}\superscript{1}\subscript{2}\superprescript{3}\subprescript{4}\quad +{\tf X} \superprescript{3} \quad +{\tf X} \subprescript{4}\quad +{\tf X} \superprescript{3}\subprescript{4} $} \stopbuffer @@ -2521,16 +2523,16 @@ If you also want to see something on the console make sure to set \prm \startsection[title={Classes}] -\startsubsection[title={Forcing classes with \prm {Umathclass}}] +\startsubsection[title={Forcing classes with \prm {mathclass}}] You can change the class of a math character on the fly: \startbuffer -$x\mathopen {!}+123+\mathclose {!}x$ -$x\Umathclass4 `! +123+\Umathclass5 `! x$ -$x ! +123+ ! x$ -$x\mathclose {!}+123+\mathopen {!}x$ -$x\Umathclass5 `! +123+\Umathclass4 `! x$ +$x\mathopen {!}+123+\mathclose {!}x$ +$x\mathclass4 `! +123+\mathclass5 `! x$ +$x ! +123+ ! x$ +$x\mathclose {!}+123+\mathopen {!}x$ +$x\mathclass5 `! +123+\mathclass4 `! x$ \stopbuffer \typebuffer @@ -2655,17 +2657,21 @@ they indicate pre- and postscripts. \starttabulate[|c|c|c|c|] \NC \type {^} \NC \NC super \NC post \NC \NR \NC \type {_} \NC \NC sub \NC post \NC \NR -\NC \type {^^} \NC \NC super \NC pre \NC \NR -\NC \type {__} \NC \NC sub \NC pre \NC \NR -\NC \type {^^^} \NC shifted \NC super \NC post \NC \NR -\NC \type {___} \NC shifted \NC sub \NC post \NC \NR +\NC \type {^^} \NC \NC super \NC post \NC \NR +\NC \type {__} \NC \NC sub \NC post \NC \NR +\NC \type {^^^} \NC shifted \NC super \NC pre \NC \NR +\NC \type {___} \NC shifted \NC sub \NC pre \NC \NR \NC \type {^^^^} \NC shifted \NC super \NC pre \NC \NR \NC \type {____} \NC shifted \NC sub \NC pre \NC \NR \stoptabulate -The shifted variants force a script to be an index and thereby make the other -script move. This multiple character features used to be optional but is now always -active. +The shifted variants force a script to be marked as index. In versions upto 2.10 +a subscript was moved to after the superscript but when we introduced continued +scripts that feature was disabled (we might bring it back as configurable +option). The shifted variants now behave the same but at the \LUA\ end one can +check if they carry this flag. Since 2.11 the one and two character are for post +while three and four handle prescripts (indices are more common than prescripts). +The \prm {noscript} command signals that we're up for a new continuation. Related to this is the issue of double scripts. The regular \TEX\ is to issue an error message, inject an ordinary node and carry on when asked to. Here we have diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex index f19cee29ef6..44fcd6e9edd 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex @@ -906,6 +906,29 @@ all is discussed in detail in this manual but there are introductions in the \CONTEXT\ distribution that explain them. But the \TEX\ kernel is of course omnipresent. +\startbuffer[luatex] + +The following primitives are available in \LUATEX\ but not in \LUAMETATEX. Some +of these are emulated in \CONTEXT. Some of these primitives that deal with math +and start with an \type {U} have been renamed to names not having this prefix. + +\stopbuffer + +\startbuffer[luametatex] + +The following primitives are available in \LUAMETATEX\ only. In the meantime the +\LUAMETATEX\ code base is so different from \LUATEX\ that porting back is no +longer reasonable. The primitives can roughly be divided in those that relate to +programming and those that deal with typesetting. In this manual we don't go into +details about most of these. More information (and examples) of the first +category can be found in the \quote {primitives} manual that ships with \CONTEXT, +and the second category is spread over (for instance) the \quote {lowlevel} +manuals. After all, it is easier to present usage in a known environment. Because +development of \LUATEX\ and \LUAMETATEX\ is related to \CONTEXT\ development, you +can also expect to find more examples of usage there. + +\stopbuffer + \startluacode local luametatex = tex.primitives() @@ -921,7 +944,6 @@ if not luatex then luatex = table.load("luatex-primitives.lua") end - if luatex and luametatex then local match = string.match @@ -945,10 +967,7 @@ if luatex and luametatex then luametatex = table.tohash(luametatex) -- context.page() - - context("The following primitives are available in \\LUATEX\\ but not in \\LUAMETATEX. ") - context("Some of these are emulated in \\CONTEXT.") - + context.getbuffer { "luatex"} context.blank() context.startcolumns { n = 2 } for k, v in table.sortedhash(luatex) do @@ -964,11 +983,7 @@ if luatex and luametatex then context.blank() -- context.page() - - context("The following primitives are available in \\LUAMETATEX\\ only. In the meantime ") - context("the \\LUAMETATEX\\ code base is so different from \\LUATEX\\ that backporting ") - context("is no longer reasonable.") - + context.getbuffer { "luametatex"} context.blank() context.startcolumns { n = 2 } for k, v in table.sortedhash(luametatex) do @@ -988,6 +1003,9 @@ end \stopluacode +When in the preceding list a primitive has \type {[todo]} in front it is sort of +experimental and it will be discussed later on when it's stable. + \stopsubsection \startsubsection[title=Changed function names] diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex index df4da576e65..a6a17f3531d 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex @@ -69,7 +69,7 @@ numbers (exclusive numbers or bits): \ShowTeXValues{normalizepar} \ShowTeXValues{packtype} \ShowTeXValues{pagecontext} -\ShowTeXValues{parbegin} +\ShowTeXValues{partrigger} \ShowTeXValues{parcontext} \ShowTeXValues{parmode} % \ShowTeXValues{runstate} @@ -1774,19 +1774,22 @@ If the attribute was actually deleted, returns its old value. Otherwise, returns \startsubsection[title={Glyph handling}][library=node] -\startsubsubsection[title={\type {firstglyph}}] +\startsubsubsection[title={\type {firstglyphnode}, \type {firstchar}, \type {firstglyph}}] +\libindex {firstglyphnode} +\libindex {firstchar} \libindex {firstglyph} \startfunctioncall - n = node.firstglyph( n) - n = node.firstglyph( n, m) + n = node.firstglyphnode( n) + n = node.firstglyphnode( n, m) \stopfunctioncall Returns the first node in the list starting at \type {n} that is a glyph node with a subtype indicating it is a glyph, or \type {nil}. If \type {m} is given, processing stops at (but including) that node, otherwise processing stops at the -end of the list. +end of the list. The \type {char} and \type {glyph} variants check for the +protected field being (yet) unset or (already) set. \stopsubsubsection diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-style.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-style.tex index b3591344ab2..803a0ee2661 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-style.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex-style.tex @@ -39,7 +39,7 @@ [each] [packed] -\definesymbol[1][\Uchar"2023] +\definesymbol[1][\tocharacter"2023] \definesymbol[2][\endash] \definesymbol[3][\wait] % we want to catch it diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex.tex index e7505397219..a02e27a3672 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luametatex/luametatex.tex @@ -1,5 +1,16 @@ % language=us runpath=texruns:manuals/luametatex +% \definefontfeature +% [default] +% [default] +% [expansion=quality] + +% % \setupalignpass[none] +% \setupalignpass[decent] +% % \setupalignpass[quality] + +% \pushoverloadmode \let\cdef\edef \let\cdefcsname\edefcsname \popoverloadmode + % \enabledirectives[backend.pdf.inmemory] % \setupalign[profile] @@ -108,17 +119,35 @@ % End Feburari 2023 I observed 8.2 seconds for 360 pages and making a format needed % 1.9 seconds instead if the usual 2.1 but that can be a side effect of the terminal % because the amount of output which is sensitive for refresh delays set. The new -% target is nwo 50 pages per second for this manual but on this laptop that is +% target is now 50 pages per second for this manual but on this laptop that is % unlikely to happen any time soon. With tabulateusesize and tabulatesparseskips -% experiments enabled we needed 8.1 second and 44.3 pps. +% experiments enabled we needed 8.1 second and 44.3 pps.% 368 pages may/june 2023: +% +% no constant definitions : 8.55 +% constant \*!whatever : 8.47 +% also constant \current* : 8.36 % \enableexperiments [tabulateusesize] % \enableexperiments [tabulatesparseskips] -\ifdefined\linebuffering \linebuffering \fi +% 2023-07-10: context --make > temp.log (after a few times so with cached files) +% +% 1.90 sec including mtxrun +% 1.65 sec tex only +% 1.45 sec without saving format + +% 20230714 : 368 pages +% +% mingw : 8.4 (we gained more that for the amd ... more cache and faster mem) +% rpi 64 : (hdd, not overclocked) +% amd 10 fitlet : 30.9 12pps (we gained over 25% compared to the 268 page manual) + +% \ifdefined\linebuffering \linebuffering \fi + +% \linebuffering \enableexperiments[fonts.compact] -%disableexperiments[fonts.accurate] +% \enableexperiments[fonts.accurate] % \enabledirectives[fonts.injections.method=advance] % tricky ... not all xoffsets are advance robust diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-lua.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-lua.tex index 3b2f9b1a7dc..ef750c493a0 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-lua.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-lua.tex @@ -68,41 +68,44 @@ similar fashion as the other \TEX\ engines. Some options are accepted but have n consequence. The following command|-|line options are understood: \starttabulate[|l|p|] -\DB commandline argument \BC explanation \NC \NR +\DB commandline argument \BC explanation \NC \NR \TB -\NC \type{--credits} \NC display credits and exit \NC \NR -\NC \type{--debug-format} \NC enable format debugging \NC \NR -\NC \type{--draftmode} \NC switch on draft mode i.e.\ generate no output in \PDF\ mode \NC \NR -\NC \type{--[no-]file-line-error} \NC disable/enable \type {file:line:error} style messages \NC \NR -\NC \type{--[no-]file-line-error-style} \NC aliases of \type {--[no-]file-line-error} \NC \NR -\NC \type{--fmt=FORMAT} \NC load the format file \type {FORMAT} \NC\NR -\NC \type{--halt-on-error} \NC stop processing at the first error\NC \NR -\NC \type{--help} \NC display help and exit \NC\NR -\NC \type{--ini} \NC be \type {iniluatex}, for dumping formats \NC\NR -\NC \type{--interaction=STRING} \NC set interaction mode: \type {batchmode}, \type {nonstopmode}, - \type {scrollmode} or \type {errorstopmode} \NC \NR -\NC \type{--jobname=STRING} \NC set the job name to \type {STRING} \NC \NR -\NC \type{--kpathsea-debug=NUMBER} \NC set path searching debugging flags according to the bits of - \type {NUMBER} \NC \NR -\NC \type{--lua=FILE} \NC load and execute a \LUA\ initialization script \NC\NR -\NC \type{--[no-]mktex=FMT} \NC disable/enable \type {mktexFMT} generation with \type {FMT} is - \type {tex} or \type {tfm} \NC \NR -\NC \type{--nosocket} or \type{--no-socket} \NC disable the \LUA\ socket library \NC\NR -\NC \type{--socket} \NC enable the \LUA\ socket library \NC\NR -\NC \type{--output-comment=STRING} \NC use \type {STRING} for \DVI\ file comment instead of date (no - effect for \PDF) \NC \NR -\NC \type{--output-directory=DIR} \NC use \type {DIR} as the directory to write files to \NC \NR -\NC \type{--output-format=FORMAT} \NC use \type {FORMAT} for job output; \type {FORMAT} is \type {dvi} - or \type {pdf} \NC \NR -\NC \type{--progname=STRING} \NC set the program name to \type {STRING} \NC \NR -\NC \type{--recorder} \NC enable filename recorder \NC \NR -\NC \type{--safer} \NC disable easily exploitable \LUA\ commands \NC\NR -\NC \type{--[no-]shell-escape} \NC disable/enable system calls \NC \NR -\NC \type{--shell-restricted} \NC restrict system calls to a list of commands given in \type - {texmf.cnf} \NC \NR -\NC \type{--synctex=NUMBER} \NC enable \type {synctex} \NC \NR -\NC \type{--utc} \NC use utc times when applicable \NC \NR -\NC \type{--version} \NC display version and exit \NC \NR +\NC \type{--credits} \NC display credits and exit \NC \NR +\NC \type{--debug-format} \NC enable format debugging \NC \NR +\NC \type{--draftmode} \NC switch on draft mode i.e.\ generate no output in \PDF\ mode \NC \NR +\NC \type{--[no-]check-dvi-total-pages} \NC exit when DVI exceeds 65535 pages (default: check) \NC \NR +\NC \type{--[no-]file-line-error} \NC disable/enable \type {file:line:error} style messages \NC \NR +\NC \type{--[no-]file-line-error-style} \NC aliases of \type {--[no-]file-line-error} \NC \NR +\NC \type{--fmt=FORMAT} \NC load the format file \type {FORMAT} \NC\NR +\NC \type{--halt-on-error} \NC stop processing at the first error\NC \NR +\NC \type{--help} \NC display help and exit \NC\NR +\NC \type{--ini} \NC be \type {iniluatex}, for dumping formats \NC\NR +\NC \type{--interaction=STRING} \NC set interaction mode: \type {batchmode}, \type {nonstopmode}, + \type {scrollmode} or \type {errorstopmode} \NC \NR +\NC \type{--jobname=STRING} \NC set the job name to \type {STRING} \NC \NR +\NC \type{--kpathsea-debug=NUMBER} \NC set path searching debugging flags according to the bits of + \type {NUMBER} \NC \NR +\NC \type{--lua=FILE} \NC load and execute a \LUA\ initialization script \NC\NR +\NC \type{--luadebug} \NC enable the \type{debug} library\NC\NR +\NC \type{--[no-]mktex=FMT} \NC disable/enable \type {mktexFMT} generation with \type {FMT} is + \type {tex} or \type {tfm} \NC \NR +\NC \type{--nosocket} \NC disable the \LUA\ socket library \NC\NR +\NC \type{--no-socket} \NC disable the \LUA\ socket library \NC\NR +\NC \type{--socket} \NC enable the \LUA\ socket library \NC\NR +\NC \type{--output-comment=STRING} \NC use \type {STRING} for \DVI\ file comment instead of date (no + effect for \PDF) \NC \NR +\NC \type{--output-directory=DIR} \NC use \type {DIR} as the directory to write files to \NC \NR +\NC \type{--output-format=FORMAT} \NC use \type {FORMAT} for job output; \type {FORMAT} is \type {dvi} + or \type {pdf} \NC \NR +\NC \type{--progname=STRING} \NC set the program name to \type {STRING} \NC \NR +\NC \type{--recorder} \NC enable filename recorder \NC \NR +\NC \type{--safer} \NC disable easily exploitable \LUA\ commands \NC\NR +\NC \type{--[no-]shell-escape} \NC disable/enable system calls \NC \NR +\NC \type{--shell-restricted} \NC restrict system calls to a list of commands given in \type + {texmf.cnf} \NC \NR +\NC \type{--synctex=NUMBER} \NC enable \type {synctex} \NC \NR +\NC \type{--utc} \NC use utc times when applicable \NC \NR +\NC \type{--version} \NC display version and exit \NC \NR \LL \stoptabulate @@ -135,6 +138,10 @@ The file names for output files that are generated automatically are created by attaching the proper extension (\type {log}, \type {pdf}, etc.) to the found \prm {jobname}. These files are created in the directory pointed to by \type {--output-directory}, or in the current directory, if that switch is not present. +If \type{--output-directory} is not empty, its value it's copied to the +\type{TEXMF_OUTPUT_DIRECTORY} env. variable; if it's empty, the value of +\type{TEXMF_OUTPUT_DIRECTORY} is the value of the output directory. + Without the \type {--lua} option, command line processing works like it does in any other \WEBC|-|based typesetting engine, except that \LUATEX\ has a few extra @@ -147,10 +154,11 @@ in the following order: \startitem First, it will parse the command line as usual, but it will only interpret a - small subset of the options immediately: \type {--safer}, \type {--nosocket} - (\type {--no-socket}), \type {--socket}, \type {--[no-]shell-escape}, \type - {--enable-write18}, \type {--disable-write18}, \type {--shell-restricted}, - \type {--help}, \type {--version}, and \type {--credits}. + small subset of the options immediately: \type {--safer}, \type {--nosocket}, + \type {--no-socket}, + \type {--socket}, \type {--[no-]shell-escape}, \type {--enable-write18}, \type + {--disable-write18}, \type {--shell-restricted}, \type {--help}, \type + {--version}, and \type {--credits}. \stopitem \startitem @@ -162,8 +170,8 @@ in the following order: \startitem Then it checks the various safety switches. You can use those to disable some - \LUA\ commands that can easily be abused by a malicious document. At the - moment, \type {--safer} \type {nil}s the following functions: + \LUA\ commands that can easily be abused by a malicious document. Currently + \type {--safer} nils the following functions: \blank @@ -174,8 +182,8 @@ in the following order: \type {spawn} \type {setenv} \type {rename} \type {remove} \type {tmpdir} \NC \NR \NC \type {io} \NC \type {popen} \type {output} \type {tmpfile} \NC \NR - \NC \type {lfs} \NC \type {rmdir} \type {mkdir} \type {chdir} \type {lock} - \type {touch} \NC \NR + \NC \type {lfs} \NC \type {rmdir} \type {mkdir} \type {mkdirp} \type {chdir} + \type {lock} \type {touch} \NC \NR \LL \stoptabulate @@ -186,11 +194,27 @@ in the following order: Finally, it disables the \type {socket} library unconditionally (but not the \type {mime} library which is always available). + + From version 1.18.0 and if \KPATHSEA\ is used, with the exception of \type{debug.traceback} + the \type{debug} library is not enabled by default; it can be enabled with the \type + {--luadebug} switch. The \type{debug} library is always enabled in shell-escape mode. + + Also from version 1.18.0 and if \KPATHSEA\ is used, the functions + \type{os.rename},\type{os.remove}, \type{lfs.attributes}, \type{lfs.chdir}, + \type{lfs.lock_dir}, \type{lfs.dir}, \type{lfs.link}, \type{lfs.mkdir}, \type{lfs.mkdirp}, + \type{lfs.rmdir}, \type{lfs.symlinkattributes}, \type{lfs.touch} + return \type{true} if both \type{kpse.in_name_ok_silent_extended} and + \type{kpse.out_name_ok_silent_extended} validate the pathname; + \type{lfs.attributes}, \type{lfs.dir} and \type{lfs.symlinkattributes} are validated + only against \type{kpse.in_name_ok_silent_extended}. + + + \stopitem \startitem When \LUATEX\ starts it sets the \type {locale} to a neutral value. If for - some reason you use \type {os.locale}, you need to make sure you \type {nil} + some reason you use \type {os.setlocale}, you need to make sure you \type {nil} it afterwards because otherwise it can interfere with code that for instance generates dates. You can ignore the \type {locale} with: @@ -198,19 +222,19 @@ in the following order: os.setlocale(nil,nil) \stoptyping - The \type {--nosocket} (\type {--no-socket}) option makes the socket library - unavailable, so that \LUA\ cannot use networking; the \type {--socket} option + The \type {--nosocket} or \type {--no-socket} option makes the socket library + unavailable, so that \LUA\ cannot use networking. The \type {--socket} option makes the socket library available. - The switches \type {--[no-]shell-escape}, \type {--[enable|disable]-write18}, - and \type {--shell-restricted} have the same effects as in \PDFTEX, and - additionally make \type {io.popen()}, \type {os.execute}, \type {os.exec}, - \type {os.kpsepopen} and \type {os.spawn} adhere to the requested option. + The switches \type {--[no-]shell-escape}, \type {--[enable|disable]-write18}, and + \type {--shell-restricted} have the same effects as in \PDFTEX, and additionally + make \type {io.popen()}, \type {os.execute}, \type {os.exec}, \type {os.kpsepopen} + and \type {os.spawn} adhere to the requested option. - By default the socket library is not enabled: one can enable it with with - \type {--socket} or with \type {--shell-escape} (but without \type - {--shell-restricted}) and disable it with \type {--nosocket} (\type - {--no-socket}) or unconditionally with \type {--safer}. + By default the socket library is not enabled: one can enable it with with \type + {--socket} or with \type {--shell-escape} (but without \type {--shell-restricted}) + and disable it with \type {--nosocket} (or \type {--no-socket}) or unconditionally + with \type {--safer}. In case of conflictual options, the most restrictive wins. @@ -260,6 +284,12 @@ finished: in order to initialize the built|-|in \KPATHSEA\ library properly, check \type {--progname}, or \type {--ini} and \type {--fmt}, if \type {--progname} is missing. +From version 1.17.1, in \DVI\ mode the new commandline switch \type {--check-dvi-total-pages}, +enabled by default, checks that the total number of pages does not exceeds 65535, +and in case the run abort. This breaks the compatibility with \PDFTEX\ where, as in \TEX, +when the total number of pages is greater than 65535 the file will lie. The previous behaviour +can be restored with \type {--[no-]check-dvi-total-pages}. + \stopsubsection \stopsection @@ -353,11 +383,12 @@ instance, when we started with \LUATEX\ we added some helpers to the \type {lfs.isdir} and \type {lfs.isfile} were speedy and better variants of what could be done with \type {lfs.attributes}. The additional function \type {lfs.shortname} takes a file name and returns its short name on \type {win32} -platforms. Finally, for non|-|\type {win32} platforms only, we provided \type -{lfs.readlink} that takes an existing symbolic link as argument and returns its -name. However, the \type {lfs} library evolved so we have dropped these in favour of -pure \LUA\ variants. The \type {shortname} helper is obsolete and now just -returns the name. +platforms; \type{lfs.mkdirp} is like \type{lfs.mkdir} but make parent directories +as needed (it is a \LUA\ wrapper function). Finally, for non|-|\type {win32} +platforms only, we provided \type {lfs.readlink} that takes an existing symbolic +link as argument and returns its name. However, the \type {lfs} library evolved so +we have dropped these in favour of pure \LUA\ variants. The \type {shortname} +helper is obsolete and now just returns the name. \stopsubsection diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex.tex index 2dd4a8bf1d1..00b0b2ea544 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex.tex @@ -73,7 +73,7 @@ \startdocument [manual=Lua\TeX, status=stable, - version=1.16] + version=1.18] \startnotmode[*export] \component luatex-titlepage diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/math/math-tweaks.tex b/Master/texmf-dist/doc/context/sources/general/manuals/math/math-tweaks.tex index 6a775688d20..4845b254204 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/math/math-tweaks.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/math/math-tweaks.tex @@ -1595,7 +1595,7 @@ mechanism as radicals (roots) but from the other edge. \starttexdefinition ActuarianTest #1 \NC #1 \NC \switchtobodyfont[#1] - $\bar{A}^1_{x:\rannuity{n}}^^{2}__{\rannuity{m}}$ + $\bar{A}^1_{x:\rannuity{n}}^^^{2}___{\rannuity{m}}$ \NC \NR \stoptexdefinition diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/mathml/envexamp.tex b/Master/texmf-dist/doc/context/sources/general/manuals/mathml/envexamp.tex index 50a38fc0fb8..6ca822fce06 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/mathml/envexamp.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/mathml/envexamp.tex @@ -11,13 +11,8 @@ columns=2, title=MathML in \ConTeXt] -\startmode[atpragma] - \setupbodyfont[lucidanova] -\stopmode - -\startnotmode[atpragma] - \setupbodyfont[palatino] -\stopnotmode +\setupbodyfont + [palatino] \setupbodyfont [10pt] diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/eutypon-gr-e-blog-21-02-13-why-i-do-not-like-luatex.png b/Master/texmf-dist/doc/context/sources/general/manuals/musings/eutypon-gr-e-blog-21-02-13-why-i-do-not-like-luatex.png new file mode 100644 index 00000000000..3975957a430 Binary files /dev/null and b/Master/texmf-dist/doc/context/sources/general/manuals/musings/eutypon-gr-e-blog-21-02-13-why-i-do-not-like-luatex.png differ diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-assumptions.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-assumptions.tex new file mode 100644 index 00000000000..20c82fc38b0 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-assumptions.tex @@ -0,0 +1,141 @@ +% language=us runpath=texruns:manuals/musings + +\startcomponent musings-assumptions + +\environment musings-style + +\startchapter[title={Strange assumptions}] + +% \startsection[title={Introduction}] +% \stopsection + +Below I will collect some of the questions and remarks|-|turned|-|questions that +keep popping up and start annoying me, especially when they come from people who +should know better (being involved in development themselves). I'm always puzzled +why these things come up, especially by people who are no user and should not +waste time on commenting on \CONTEXT. + +\startsubsubject[title={All these versions, \CONTEXT\ keep changing, so what's next?}] + +Sure, we're now at the third version, \MKII, \MKIV\ and \LMTX, but there is is +some progression in this. The first version evolved from \TEX\ to \ETEX\ to +\PDFTEX\ (but also could handle \XETEX\ and \ALEPH). But in order to get things +done better we moved on to \LUATEX\ and because that is a \CONTEXT\ related +project it made sense to split the code base which made us end up with a frozen +stable \MKII\ and an evolving|-|with|-|\LUATEX\ \MKIV. Then there was a demand +for a stable \LUATEX\ for usage otherwise which in turn lead to the \LUAMETATEX\ +project and its related \CONTEXT\ evolution \LMTX. So, yes, this macro package +keeps changing. And it this bad? Don't other macro packages evolve? And why do +users of other packages bother anyway? I never heard a \CONTEXT\ user complain +either. By the way, how do other macro packages actually count and distinguish +versions? + +\stopsubject + +\startsubsubject[title={Why is \CONTEXT\ so slow?}] + +Because I seldom hear complaints from users about performance, why do users of +other macro packages find reason to even bother. In \MKII\ we immediately started +with a high level keyword driven interface so that came with a price. But quite +some effort was put into making it as fast and efficient as possible. Fortunately +for \CONTEXT\ users the \MKIV\ version became faster over time, in spite of it +using a 32 bit engine (which comes at a price). Even better is that \LMTX\ with +\LUAMETATEX\ has gained a lot over \MKIV. But then, I guess, other macro packages +that use \LUATEX\ are also fast, so maybe the claims that \CONTEXT\ is much +slower than other macro packages still hold. I'm not going to check it, and I bet +\CONTEXT\ users don't care. + +\stopsubject + +\startsubsubject[title={Why does \CONTEXT\ (even) needs a runner.}] + +Indeed, because we don't want users to be bothered with managing runs right from +the start it came with a program (\MODULA2) and later a script (\PERL\ followed +up by \RUBY) that checks if an additional run is needed because of some change in +the table of contents, references, the index, abbreviations, positioning, etc. +Index sorting was done too so there was no further dependency. We though that +was actually a good thing. With \LUATEX\ and \LUAMETATEX\ all that became even +more integrated because \LUA\ was used. The runner(s) also made it possible to +ship additional scripts without the need for potentially clashing applications in +the ever growing \TEX\ ecosystem. Interesting is that ridiculing \CONTEXT\ for +script dependency was never complemented by ridiculing other macro packages that +nowadays seem to depend on scripts (with some even using \LUATEX\ which +originates in the \CONTEXT\ domain). + +\stopsubject + +\startsubsubject[title={Why does \CONTEXT\ organizes files that way?}] + +\CONTEXT\ sticks quite well to the \TEX\ Directory Structure, so what is the +problem here?. Yes, we needed some granularity (e.g.\ for \METAPOST) but later +that just became normal. And indeed we optionally let users use a flat directory +structure for fonts but that's normally in the users own local tree. Oh, and in +\MKIV\ and \LMTX\ we use our own file database (actually also in \MKII\ at some +point), just because (definitely at that time) it was way faster and we needed +more features. The same is true for the font database, \UTF\ encoded hyphenation +patterns, and so on. Can it be that we're often just ahead of the pack? + +Let's nor forget to complain about the fact that \MKIV\ and \LMTX\ use a cache +but so do lots or programs: just think browsers of some scripting language +ecosystems. And that was introduced right after we started with \MKIV\ and hasn't +changed much at all. Users expect no less. And other macro packages are free not to +use the cache (for e.g.\ fonts). + +\stopsubject + +\startsubsubject[title={The authors of \CONTEXT\ don't care about compatibility, do they?}] + +You're joking, right? Surely some features became sort of obsolete when we moved +to \MKIV, like encodings. But if users like to stick to them, they can. Do you +really think that user like us to drop compatibility? Maybe it fits some +narrative to spread that story. Of course, we make things better if we can, and +the interfaces have always permitted upgrades and extensions. There are +definitely cases when (maybe due to user demand) something new gets added that +then evolves towards a stable state, so yes, there can be code in flux. But that +is natural. Should we just assume that other macro packages don't evolve, never +have bugs, don't break anything, never fix broken things immediately? Maybe. And +complaining about \CONTEXT\ evolving is none of its non|-|users business anyway. + +\stopsubject + +\startsubsubject[title={Is \CONTEXT\ commercial?}] + +This is one of the strangest questions (or remarks). We use \CONTEXT\ ourself and +using it in a job is by definition commercial use. Are all other \TEX ies only +using \TEX\ macro packages in the free time, as hobby? I'm pretty sure that more +money is made by competing package users and I'm also sure that most of the time +involved in creating \CONTEXT\ (and \LUAMETATEX\ for that matter) is not covered +by income. Using the fact that \CONTEXT\ is developed by a (small) company excuse +for lack of development elsewhere is about as lame as it can get. Much +development is done without us needed it, but because we like doing it, because +of the challenge. + +\stopsubject + +\startsubsubject[title={Should I use \CONTEXT\ for math?}] + +Of course, because that's what \TEX\ is good at. It you are forced to use a +specific macro package for its math abilities, just do so. If you want to move on +or want consistent interfaces, maybe \CONTEXT\ is for you. We don't care. Trust +your eyes more than assumed standards or ways of doing math typesetting. + +\stopsubject + +\startsubsubject[title={Why is the format file so much larger than for other packages?}] + +The answer is simple: we have an integrated system, so we have plenty macros and +with each token taking 8 bytes (data and link) that adds up. And for \MKIV\ and +\LMTX\ there also \LUA\ code involved as well as a rather large character +database. In \LUATEX\ the format file is compressed (and also zipped) and in +\LUAMETATEX\ is it is a bit more compressed but now zipped; still the \LMTX\ +format file is smaller than the \MKIV\ one. We let those who complain wonder why +that is. We also let users of other macro packages wonder if loading a ton of +stuff later on doesn't accumulate to a similar or larger memory footprint. And, as +with many critics: make sure to check every few years if that other macro package +hasn't catched up and can be criticized the same way. + +\stopsubject + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-deserved.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-deserved.tex new file mode 100644 index 00000000000..5d16fd92840 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-deserved.tex @@ -0,0 +1,356 @@ +% language=us runpath=texruns:manuals/musings + +% \enableexperiments[fonts.compact] + +\startcomponent musings-deserved + +\environment musings-style + +\startchapter[title={We deserved it}] + +\startsection[title={Introduction}] + +Among the first macros we cooked up are the ones that we used to typeset +chemistry. They come under the \PPCHTEX, and it was mostly done by Hans, Ton and +Tobias. Over time rendering structures by \PICTEX\ got replaced by \PSTRICKS\ and +later \METAPOST. When we moved to \MKIV\ all that got reimplemented, this time by +Hans and Alan and we stuck to \METAPOST. We actually also updated the syntax and, +because old documents were supposed to be rendered by \MKII\ we took the liberty +to sacrifice some compatibility for a more complete and consistent feature set. +However we never came to updating the existing manual and the new one became work +in progress. We didn't really needed the code and Alan, who did need it, knew +what was there anyway. + +Then Mikael had some questions and it pushed me into manual mode: upgrade the old +one and combine it with the pending new one. That also made me wonder if we could +now benefit from some new features in the math engine, which in turn could +simplify the code base. This is typically something that takes weeks instead of +hours so better do it right from the start. And, while at it, one then of course +ends up in looking (again) at arrows (or more specifically: stackers) and from +that to \UNICODE, which in turn is good for some introspection. + +\stopsection + +\startsection[title={Implementation}] + +Among the (old) complications in dealing with chemistry are the following: + +\startitemize[packed] +\startitem + Simple inline chemical formulas (snippets) of the kind \ic { U ___92 ^^^ 238 + ^ +} where scripts need to be properly vertically aligned and an upright font + is used. +\stopitem +\startitem + In running text one wants to use \ic {A + B -> C} but also \ic {A + B <-> C} + or \ic {A + B <=> C}. +\stopitem +\startitem + Even more symbolic representations might be on the wish list, think of + \ic {A - B -- C --- D}. +\stopitem +\stopitemize + +There is more but these examples demonstrate a few features: we need prescripts, +proper spacing, line breaks at preferred spots, and some symbols. + +\start + +\setupalign[profile] +% \showglyphs \showmakeup[boxes] \showstruts +\setupmathstackers[reverse][strut=no] + +\startitemize[packed] +\startitem + And of course one also wants to annotate like \ic {A + B ->{here} C} but also + \ic {A + B <->{}{there} C} or \ic {A + B <=>{where}{every} C} where the + arrows stretch with the text. +\stopitem +\startitem + It would be nice if we can also use the advanced alignment options that are + available in math but discussing this is beyond this musing. +\stopitem +\stopitemize + +\stop + +\stopsection + +\startsection[title=Unicode] + +Implementing the above has never been that hard but just became a little easier +in \LMTX. However, when doing that I wondered if there were more than the already +present symbols to be taken care of. And so I did a search on the internet for +\quotation {unicode and chemistry}. One of the first hits was \quotation {Five +symbols used in chemistry L2/23-193}, a request for some more arrows. One can +search the web for it and see if it is still around. When staring at I wondered a +bit about the descriptions: + +\starttyping +BALANCED EQUILIBRIUM ARROW +EQUILIBRIUM ARROW LYING TOWARD THE RIGHT +EQUILIBRIUM ARROW LYING TOWARD THE LEFT +REACTION DOES NOT PROCEED +STANDARD STATE SYMBOL +\stoptyping + +When later I discussed this with Mikael we came to the conclusion that \quote +{LYING} probably means \quote {LEANING} but we're not chemists so we can be +wrong. The proposed rendering of the first three boils down to arrows with half a +tip, also known as harpoons: long left and right pointing ones stacked for the +first and long over short ones for the other two. + +\startlinecorrection +\setupmathstackers[mathematics][strut=no] +\startcombination[nx=3,ny=1] + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 2cm{$\mrightharpoonup {\hskip2cm}{}$} + \ruledhbox to 2cm{$\mleftharpoondown{\hskip1cm}{}\hss$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 2cm{$\mrightharpoonup {\hskip2cm}{}$} + \ruledhbox to 2cm{$\mleftharpoondown{\hskip2cm}{}$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 2cm{$\mleftharpoonup{\hskip2cm}{}$} + \ruledhbox to 2cm{\hss$\mrightharpoondown{\hskip1cm}{}$} + }} {} +\stopcombination +\stoplinecorrection + +There are several observation to make here. First of all, there is a whole bunch +of arrows (stacked and single) that bare descriptions mentioning them being +arrows. There is no meaning in them. One can even wonder why some are there. So, +in order to be in sync with that it makes more sense to add a few more harpoons. +Cooking up names like this serves no purpose. + +If we look at the proposed shapes (which are actually different from those used +in \TEX\ packages that are references) one can actually wonder about the way +these are supposed to stretch. The short variant is not different from existing +double harpoons in which case the meaning is lost. Then when we go longer we get +this empty space and then we should wonder how the extensible should kick in: how +do the left- and rightmost fixed glyphs and the one or two middle repeated ones +behave? + +\startlinecorrection +\setupmathstackers[mathematics][strut=no] +\startcombination[nx=3,ny=1] + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 1cm{$\mrightharpoonup {\hskip1cm}{}$} + \ruledhbox to 1cm{$\mleftharpoondown{\hskip1cm}{}\hss$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 1cm{$\mrightharpoonup {\hskip1cm}{}$} + \ruledhbox to 1cm{$\mleftharpoondown{\hskip1cm}{}$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 1cm{$\mleftharpoonup{\hskip1cm}{}$} + \ruledhbox to 1cm{\hss$\mrightharpoondown{\hskip1cm}{}$} + }} {} +\stopcombination +\stoplinecorrection + +Why don't we just use the next three? After all, as with math, how we interpret +symbols depends on how we define them to be read. Sometimes Mikael and I get a +good laugh over some of the shapes bound to math code points and we're sure that +some legend is needed when using them. + +\startlinecorrection +\setupmathstackers[mathematics][strut=no] +\startcombination[nx=3,ny=1] + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 2cm{$\mleftrightharpoons{\hskip2cm}{}$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 2cm{$\mrightharpoonup {\hskip2cm}{}$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox to 2cm{$\mleftharpoondown{\hskip2cm}{}\hss$} + }} {} +\stopcombination +\stoplinecorrection + +Of course there are and can be conventions but getting some agreement is not +trivial. We only have to look at \UNICODE\ math to see some issues, like: + +\startitemize[packed] +\startitem + The repertoire of symbols is large but to a large extent somewhat arbitrary: + what was known (or assumed) to be used got in there. There is a difference + between a left, right and even middle bar, just like there is a left and + right brace. +\stopitem +\startitem + There are alphabets but they come with holes. We're not supposed to + distinguish between a Plank constant \quote {h} and variable \quote {h}. We + can distinguish the greek uppercase \type {A} from a latin \type {A} so + mathematicians are less convincing. +\stopitem +\startitem + One can define extensible fences with components but not all of them. There + are no constructors for arrows. Some likely come from old encodings but + why add these and not be consistent. +\stopitem +\stopitemize + +Plugging a hole in an alphabet is doable. Adding some missing snippets for fences +is also no big deal, just because we have a limited set. Making bars consistent +also is not hard. But I don't see it happen soon. After all, we're decades along +the road and no one bothered much about it till now, and above all, it will never +be complete. I wonder if there ever has been a good analysis, extensive +description and a watertight arguing from the \TEX\ community about what should +go in \UNICODE\ and fonts. It was easy to point to existing fonts and the names +used in macro packages and that shows. + +To the above we can add: + +\startitemize[packed] +\startitem + There are some combinations of arrows and e.g.rules missing that could have + made adding composed constructs easier when there is demand for that. After + all, this is what existing characters are also used for. And these chemistry + ones fit into this. +\stopitem +\stopitemize + +Our solution is to just accept that the \TEX\ community got what it deserved: a +bit of chaos, unreliable cur'n'paste support, symbols but no meaning, imperfect +\UNICODE\ coverage and therefore imperfect coverage in fonts. The good news is +that we can adapt. But we have to be honest: it is not perfect. + +\stopsection + +\startsection[title=How about] + +As mentioned we have a problem with base glyphs versus extensibles and these +combined hooked things are bad for that. In the chemistry macros the first four +are the ones that we always had and the last two are examples of how we can +render the two leaning extras. + +\starttabulate[|c||c||] +\NC \type {<->} \NC \ic {A + B <-> C}\NC \type {<-->} \NC \ic {A + B <--> C} \NC \NR +\NC \type {->} \NC \ic {A + B -> C}\NC \type {-->} \NC \ic {A + B --> C} \NC \NR +\NC \type {<-} \NC \ic {A + B <- C}\NC \type {<--} \NC \ic {A + B <-- C} \NC \NR +\NC \type {<=>} \NC \ic {A + B <=> C}\NC \type {<==>} \NC \ic {A + B <==> C} \NC \NR +\ML +\NC \type {=>} \NC \ic {A + B => C}\NC \type {==>} \NC \ic {A + B ==> C} \NC \NR +\NC \type {<=} \NC \ic {A + B <= C}\NC \type {<==} \NC \ic {A + B <== C} \NC \NR +\stoptabulate + +Watch the longer should arrow. Not al fonts have it as extensible, which +indicates that not that much thought has been put in usage patterns. That said, +more interesting would be to use something like this, where we fake a character +from two existing arrows: + +\startlinecorrection +\switchtobodyfont[cambria] +\definemathextensible [mathematics] [mleftarrowdashed] ["21E0] +\definemathextensible [mathematics] [mrightarrowdashed] ["21E2] +\setupmathstackers[mathematics][strut=no] +\startcombination[nx=4,ny=1] + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox{$\mrightarrow {}{}$} + \ruledhbox{$\mleftarrowdashed{}{}$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox{$\mrightarrow{}{}$} + \ruledhbox{$\mleftarrow {}{}$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox{$\mrightarrowdashed{}{}$} + \ruledhbox{$\mleftarrow {}{}$} + }} {} + {\vbox{\offinterlineskip\glyphscale2000 + \ruledhbox{$\mrightarrowdashed{}{}$} + \ruledhbox{$\mleftarrowdashed {}{}$} + }} {} +% {\vbox{\offinterlineskip\glyphscale2000 +% \ruledhbox to 2cm{$\mrightarrow {\hskip2cm}{}$} +% \ruledhbox to 2cm{$\mleftarrowdashed{\hskip2cm}{}$} +% }} {} +% {\vbox{\offinterlineskip\glyphscale2000 +% \ruledhbox to 2cm{$\mrightarrow{\hskip2cm}{}$} +% \ruledhbox to 2cm{$\mleftarrow {\hskip2cm}{}$} +% }} {} +% {\vbox{\offinterlineskip\glyphscale2000 +% \ruledhbox to 2cm{$\mrightarrowdashed{\hskip2cm}{}$} +% \ruledhbox to 2cm{$\mleftarrow {\hskip2cm}{}$} +% }} {} +% {\vbox{\offinterlineskip\glyphscale2000 +% \ruledhbox to 2cm{$\mrightarrowdashed{\hskip2cm}{}$} +% \ruledhbox to 2cm{$\mleftarrowdashed {\hskip2cm}{}$} +% }} {} +\stopcombination +\stoplinecorrection + +However, not all math fonts provide these dashed arrows and therefore here we +have to use Cambria (here). And even if it has such dashed hashes, they don't +come with an extensible. I just want to point out that by looking at what we +already have, it might make more sense to extend some (combinations) of those. + +It is good to notice that these arrows come with qualifications like \quotation +{code for undetermined script}, so one can wonder how much they relate to math. +Actually the fact that we have these holes in alphabets already indicates that +math is not really seen as script. Occasionally (old) scripts get added and they +get lots of code points, while one can argue for sharing there too, but maybe +their status is higher than the status of math. In \OPENTYPE\ fonts math is seen +as script but that's because it is basically a selector. One can actually argue +for chemistry as a math language in fonts. + +The main point I want to make here is that adding some new symbol that is +somewhere used but never made it in \UNICODE\ in the first place needs some +thought. Especially when used in a setting of formulas, where size matters. + +\stopsection + +\startsection[title=Also] + +In \CONTEXT\ we have stackers: text above and|/|or below an extensible, or +extensibles above and|/|or below text. The mentioned arrows are using this +mechanism. However, when playing with \type {\iff}, \typ {\implies} and \typ +{impliedby} in math mode, we noticed some spacing side effects. Originally these +double arrows got skips around them but that interfered with our alignment +mechanism. However, that could be solved without much hassle by letting the +commands check the nature (class) of the previous atom (an indication of being at +the start of a next alignment line). In the end that we decided that an extra +\quote {implication} class was more flexible than adding glue. More interesting +was the observation that in Latin Modern and some other math fonts these arrows +have different dimensions, which leads to yet another alignment issue. + +Again that could be solved by taking the usage into account but one can wonder +why the opportunity was lost to make the glyphs consistent with each other, read: +come up with a proper analysis of requirements based on decades of \TEX\ usage. +At least there could have been recommended alternates. But wait, aren't +alternates kind of bad as they demand user intervention (choices)? Sure, but +there are more examples of alternates, take the \quote {\dotlessi} (dotless i). +It has a textual code point but is not in the math alphabets, so one needs +alternates as way out (and yes, fonts then have a blackboard and fraktur dotless +i). + +One can argue that these are visual aspects, but with arrows as well as symbols, +we have ended up in a somewhat curious inconsistent situation: there are no +established command names for the single arrows, so there we speak \type +{\..arrow..} while for some there are names, like \type {\iff}. The same is true +for characters like the dotless i and j. Some mathematicians use these in the +same way as some hard- and software vendors put an \quote {i} in front of a +product name, but in order to get it one has to communicate in terms of \type +{\dotless.} or somthing with an \type {i} in the macro name. + +\stopsection + +\startsection[title=Conclusion] + +To come back to updating chemistry. It makes no sense to add much more. +Implementing the left- and right leaning is easy with existing hooks so this is +what we will do. Proper math fonts have these and how likely is it that existing +math fonts get new ones? If it ever comes to more chemistry in \UNICODE\ a +handful of them will not help much. It is probably not that hard to find an +existing symbol that can act as standard state symbol. In fact, some code points +have several additional descriptions so we could just add some to existing one. +It's not like we have gone over the top with doing that for math yet. + +\stopsection + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-dontusetex.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-dontusetex.tex new file mode 100644 index 00000000000..f8f81079525 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-dontusetex.tex @@ -0,0 +1,201 @@ +% language=us runpath=texruns:manuals/musings + +\startcomponent musings-dontusetex + +\environment musings-style + +\setupquotation[style=italic] + +\startchapter[title={Don't use \TEX !}] + +Occasionally I run into a web post that involves \LUATEX\ and it is sometimes +surprising what nonsense one can read. Now, I normally don't care that much but +there are cases where I feel that a comment is justified. Partly because I'm one +of the developers, but also because I'm involved in user groups. + +In this particular case the title of a (small) blog post was \quotation {Why I do +not like luaTeX!} and the website announced itself ambitiously as \quote {DIGITAL +TYPOGRAPHY NEWS}. Normally I assume that in such a case it is a general site +about typesetting and that the author has not much experience or insight in the +already ancient \TEX\ typesetting system. However, the \URL\ is: + +\starttyping +eutypon.gr/e-blog/index.php/2021/02/13/why-i-do-not-like-luatex/ +\stoptyping + +which happens to be the Greek User Groups portal. So why do I feel the need to +reflect on this? Why do I even care? The answer is simple: because user groups +should inform their (potential) users correctly. Another reason is that I'm +involved in the program that is disliked, and yet another one is that there is a +suggestion that language support is bad in \LUATEX, while actually hyphenation +patterns are very well maintained by Mojca and Arthur who are also actively +involved in the community around the mentioned engine. + +\startplacefigure[location=page,number=no,title={\type {eutypon.gr/e-blog/index.php/2021/02/13/why-i-do-not-like-luatex/}}] + \externalfigure + [eutypon-gr-e-blog-21-02-13-why-i-do-not-like-luatex.png] + [width=\textwidth] +\stopplacefigure + +Let's start with the title. For sure one might not like a specific program, but +when it involves one of the mainstream \TEX\ engines, it should at least be clear +that it's a personal opinion. Because no name is mentioned, we can assume that +this is the opinion of the Greek user group as a whole. The text starts with +\quotation {Most people speak with good words about luaTeX.} and the \quote {most} +in that sentence sort of puts the author in a small group, which should trigger +using a bit more careful title. Now I know a couple of users who use \LUATEX\ +(with \CONTEXT) for typesetting Greek, and we can assume that they are among the +people who speak those good words: typesetting Greek just works. + +More good news is that \quotation {They seem to like things it can do that no +other TeX derived systrem can do.} This might invite potential users to take a +closer look at the system, especially because we already know that most people +are positive. In 2021 one should keep in mind that, although the \LUATEX\ engine +is around for more than a decade, the level of support can differ per macro +package which is why \PDFTEX\ is still the most widespread used \TEX\ variant: +much \TEX\ usage relates to writing (scientific articles) in English so one +doesn't really need an \UNICODE\ engine. I always say: don't change a good +working workflow if you have no reason; use what makes you feel comfortable. Only +use \LUATEX\ if you have a reason. There is plenty of good and positive advice to +be given. + +With \quotation {Personally, I do not care about these features but yesterday a +friend told me that he wanted to write something in Greek with luaLaTeX.} the +author steps over his or her personal rejection of the engine and enters the +help|-|a|-|friend mode. \quotation {And what’s the catch, one may ask. The +problem is that luaLaTeX does not load any hyphenation patterns but the default +ones. So one needs to load them.} I'm not sure why this is a catch. It actually +is a feature. One drawback of the traditional \TEX\ engines is that one needs to +preload the hyphenation patterns. Before memory was bumped, that often meant +creating format files for a subset of languages, and when memory became plenty it +meant preloading dozens of patterns by default. The good news is that in all +these cases the macro package takes care of that. In the case of \LUATEX\ no +patterns need to be preloaded so it might even be that \LATEX\ doesn't have any +preloaded but, not being a user, I didn't check that. + +This all makes the next sentence puzzling: \quotation {In TeX one uses a command +like the follolwing one : \type {\language\l@monogreek}, where \type +{\l@monogreek} is numerical value assigned to each language contained in the +format.} Now, I'm no expert on \LATEX\ but I'm pretty sure that the \type {@} +sign is not a letter by default. I'm also pretty sure that there is some high +level interface to enable a language, and in the case of \LUATEX\ being used that +mechanism will load the patterns runtime. I bet it will also deal with making +sure other language specific properties are set. Therefore the \quotation {This +is well documented in the TeXbook.} is somewhat weird: original \TEX\ only had +one language and later versions could deal with more, but plain \TEX\ has no +\type {\l@monogreek} command. It doesn't sound like the best advice to me. + +Just to be sure, I unpacked all the archives in the most recent \TEXLIVE\ \DVD\ +and grepped for that command in \type {tex} and \type {sty} files and surprise: +in the \LATEX\ specific style file \typ {/tex/xelatex/xgreek/xgreek.sty} there is +a line \typ {\language \l@monogreek \else \HyphenRules{monogreek}\fi} which to me +looks way to low level for common users to figure out, let alone that it's a file +for \XETEX\ so bound to a specific engine. Further grepping for \type {{greek}} +gave hits for \LATEX's babel an there are Greek files under the \type +{polyglossia} directory so I bet that Arthur (who once told me he was reponsible +for languages) deals with Greek there. Even I, as a \CONTEXT\ user who never use +\LATEX\ and only know some things by rumor (like the fact that there is something +like polyglossia at all) could help a new user with some suggestions of where to +look, just by googling for a solution. But explicitly using the \type {\language} +primitive is not one of them. Okay, in \CONTEXT\ the \type {\language [greek]} +command does something useful, but we're not talking about that package here, if +only because it relates to \LUATEX\ development, which as we will see later is a +kind of inner circle. + +So, picking up on the blog post, in an attempt to get Greek working in \LATEX\ +the author got online but \quotation {Now despite the fact that I spent a few +hours searching for information on how to load specific hyphenation patterns, I +could not find anything!} It might have helped to search for \type {lualatex +greek} because that gives plenty of hits. And maybe there are even manuals out +there that explain which of the packages in the \TEX\ tree to load in order to get +it working. Maybe searching \CTAN\ or \TEXLIVE\ helps too. Maybe other user +groups have experts who can help out. No matter what you run into, I don't think +that the average user expects to find a recipe for installing and invoking +patterns. Just for the record, the \LUATEX\ manual has a whole chapter on +language support, but again, users can safely assume that the macro package that +they use hides those details. Actually, if users were supposed to load patterns +using a unique id, they are likely to end up in the modern Greek versus ancient +Greek, as well as Greek mixed with English or other languages situations. That +demands some more in depth knowledge to deal with, in any macro package and with +any engine. You can add a bit of \UNICODE\ and \UTF-8\ or encodings in the mix +too. Suggesting to consult the \TEX book is even a bit dangerous because one then +also ends up in an eight bit universe where font encodings play a role, while +\LUATEX\ is an \UNICODE\ engine that expects \UTF\ and uses \OPENTYPE\ fonts. +And, while languages seem to be a problem for the author and his|/|her friend, +fonts seem to be an easy deal. In my experience it's more likely that a user runs +into font issues because modern fonts operate on multiple axis: script, language +and features. + +Maybe the confusion (or at that time accumulated frustration) is best summarized +by \quotation {Moreover, I could not find any information on how one loads a lua +package (i.e., some external lua package that is available in the TeX +installation).} Well, again I'm sure that one can find some information on +\LATEX\ support sites but as I already said: language support is so basic in a +macro package that users can use some simple command to enable their favorite +one. So, when \quotation {People know that they can load a LaTeX package with the +\type {\usepackage} command but I have no information on how to load lua code.} +the first part is what matters: \LUA\ files are often part of a package and +thereby they get loaded by the package, also because often stand|-|alone usage +makes not much sense. + +It is absolutely no problem if someone doesn't like (or maybe even hates) +\LUATEX, but it's a different matter when we end up in disinformation, and even +worse in comments that smell like conspiracy: there is an inner circle of +\LUATEX\ developers and \quotation {Practically, this means that if one is not +part of the inner circle of luaTeX developers, then she cannot really know what +is really going on.} Really? Is this how user groups educate their users? There +are manuals written, plenty of articles published, active mailing lists, +presentations given, and there is support on platforms like Stack Exchange. And +most of that (the development of \LUATEX\ included) is done by volunteers in +their spare time, for free. Of course the groups of core developers are small but +that is true for any development. History (in the \TEX\ community) has +demonstrated that this is the only way to make progress at all, simply because +there are too many different views on matters, and also because the time of +volunteers is limited. It is the end result what counts and when that is properly +embedded in the community all is fine. So we have some different engines like +\TEX, \PDFTEX, \LUATEX, etc., different macro packages, specialized engines like +those dealing with large \CJK\ fonts, all serving a different audience from the +same ecosystem. Are these all secretive inner circles with bad intentions to +confuse users? + +The blog post ends with \quotation {And this is exactly the reason why I do not +like luaTeX.} to which I can only comment that I already long ago decided not to +waste any time on users who in their comments sound like they were forced to use +a \TEX\ system (and seem to dislike it, so probably are better off with Microsoft +Word, but nevertheless like to bark against some specific \TEX\ tree), who +complain about manuals not realizing that their own contributions might be rather +minimalistic, maybe even counter productive, or possibly of not much use to +potential users anyway. I also ignore those who love to brag about the many bugs, +any small number suits that criterium, without ever mentioning how bugged their +own stuff is, etc. If your ego grows by disregarding something you don't even +use, it's fine for me. + +So why do I bother writing this? Because I think it is a very bad move and signal +of a user group to mix personal dislike, whatever the reason is, with informing +and educating users. If a group is that frustrated with developments, it should +resolve itself. On the other hand, it fits well in how todays communication +works: everyone is a specialist, which get confirmed by the fact that many +publish (also on topics they should stay away from) on the web without fact +checking, and where likes and page hits are interpreted as a confirmation of +one's expertise. Even for the \TEX\ community there seems to be no escaping from +this. + +The objectives of \TEX\ user groups shift, simply because users can find +information and help online instead of at meetings and in journals. The physical +\TEX\ distributions get replaced by fast downloads but they are definitely under +control of able packagers. Maybe a new task of user groups is to act as guardian +against disinformation. Of course one then has to run into these nonsense blogs +(or comments on forums) and such but that can partly be solved by a mechanism +where readers can report this. A user group can then try to make its own +information better. However, we have a problem when user groups themselves are +the source of disinformation. I see no easy way out of this. We can only hope +that such a port drowns in the ocean of information that is already out there to +confuse users. In the end a good and able \TEX\ friend is all you need to get +going, right? The blog post leaves it open if the Greek text ever got typeset +well. If not, there's always \CONTEXT\ to consider, but then one eventually ends +up with \LUAMETATEX\ which might work on the author as another \quotation {\nl +rode lap op een stier} as we say in Dutch. + +\stopchapter + +\stoptext diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-history.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-history.tex new file mode 100644 index 00000000000..28e9575192c --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-history.tex @@ -0,0 +1,294 @@ +% language=us runpath=texruns:manuals/musings + +\startcomponent musings-history + +\environment musings-style + +\startchapter[title={All those \TEX's}] + +\startlines \setupalign[flushright] +Hans Hagen +Hasselt NL +February 2020 +\stoplines + +% \startsection[title=Introduction] +% \stopsection + +This is about \TEX, the program that is used as part of the large suite of +resources that make up what we call a \quote {\TEX\ distribution}, which is used +to typeset documents. There are many flavors of this program and all end with +\type {tex}. But not everything in a distribution that ends with these three +characters is a typesetting program. For instance, \type {latex} launches the a +macro package \LATEX, code that feeds the program \type {tex} to do something +useful. Other formats are Plain (no \type {tex} appended) or \CONTEXT\ (\type +{tex} in the middle. Just take a look at the binary path of the \TEX\ +distribution to get an idea. When you see \type {pdftex} it is the program, when +you see \type {pdflatex} it is the macro package \LATEX\ using the \PDFTEX\ +program. You won't find this for \CONTEXT\ as we don't use that model of mixing +program names and macro package names. + +Here I will discuss the programs, not the macro packages that use them. When you +look at a complete \TEXLIVE\ installation, you will see many \TEX\ binaries. (I +will use the verbatim names to indicate that we're talking of programs). Of +course there is the original \type {tex}. Then there is its also official +extended version \type {etex}, which is mostly known for adding some more +primitives and more registers. There can be \type {aleph}, which is a stable +variant of \type {omega} meant for handling more complex scripts. When \PDF\ +became popular the \type {pdftex} program popped up: this was the first \TEX\ +engine that has a backend built in. Before that you always had to run an +additional program to convert the native \DVI\ output of \TEX\ into for instance +\POSTSCRIPT. Much later, \type {xetex} showed up, that, like \OMEGA, dealt with +more complex scripts, but using recent font technologies. Eventually we saw \type +{luatex} enter the landscape, an engine that opened up the internals with the +\LUA\ script subsystem; it was basically a follow up on \type {pdftex} and \type +{aleph}. + +The previous paragraph mentions a lot of variants and there are plenty more. For +\CJK\ and especially Japanese there are \type {ptex}, \type {eptex}, \type +{uptex}, \type {euptex}. Parallel to \type {luatex} we have \type {luajittex} and +\type {luahbtex}. As a follow up on the (presumed stable) \type {luatex} the +\CONTEXT\ community now develops \type {luametatex}. A not yet mentioned side +track is \NTS\ (New \TEX\ system), a rewrite of good old \TEX\ in \JAVA, which in +the end didn't take off and was never really used. + +There are even more \TEX's and they came and went. There was \type {enctex} which +added encoding support, there were \type {emtex} and \type {hugeemtex} that +didn't add functionality but made more possible by removing some limits on memory +and such; these were quite important. Then there were vendors of \TEX\ systems +that came up with variants (some had extra capabilities), like \type {microtex}, +\type {pctex}, \type {yandytex} and \type {vtex} but they never became part of +the public effort. + +For sure there are more, and I know this because not so long ago, when I cleaned +up some of my archives, I found \type {eetex} (extended \ETEX), and suddenly +remembered that Taco Hoekwater and I indeed had experimented with some extensions +that we had in mind but that never made it into \ETEX. I had completely forgotten +about it, probably because we moved on to \LUATEX. It is the reason why I wrap +this up here. + +In parallel there have been some developments in the graphic counterparts. Knuts +\type {metafont} program got a \LUA\ enhanced cousin \type {mflua} while \type +{metapost} (aka \type {mpost} or \type {mp}) became a library that is embedded in +\LUATEX\ (and gets a follow up in \LUAMETATEX). I will not discuss these here. + +If we look back at all this, we need to keep in mind that originally \TEX\ was +made by Don Knuth for typesetting his books. These are in English (although over +time due to references he needed to handle different scripts than Latin, be it +just snippets and not whole paragraphs). Much development of successors was the +result of demands with respect to scripts other than Latin and languages other +than English. Given the fact that (at least in my country) English seems to +become more dominant (kids use it, universities switch to it) one can wonder if +at some point the traditional engine can just serve us as well. + +The original \type {tex} program was actually extended once: support for mixed +usage of multiple languages became possible. But apart from that, the standard +program has been pretty stable in terms of functionality. Of course, the parts +that made the extension interface have seen changes but that was foreseeable. For +instance, the file system hooks into the \KPSE\ library and one can execute +programs via the \type {\write} command. Virtual font technology was also an +extension but that didn't require a change in the program but involved +postprocessing the \DVI\ files. + +The first major \quote {upgrade} was \ETEX. For quite a while extensions were +discussed but at some point the first version became available. For me, once +\PDFTEX\ incorporated these extensions, it became the default. So what did it +bring? First of all we got more than 256 registers (counters, dimensions, etc.). +Then there are some extra primitives, for instance \type {\protected} that +permits the definition of unexpandable macros (although before that one could +simulate it at the cost of some overhead) and convenient ways to test the +existence of a macro with \type {\ifdefined} and \type {\ifcsname}. Although not +strictly needed, one could use \type {\dimexpr} for expressions. A probably +seldom used extension was the (paragraph bound) right to left typesetting. That +actually is a less large extension than one might imagine: we just signal where +the direction changes and the backend deals with the reverse flushing. It was +mostly about convenience. + +The \OMEGA\ project (later followed up by \ALEPH) didn't provide the additional +programming related primitives but made the use of wide fonts possible. It did +extend the number of registers, just by bumping the limits. As a consequence it +was much more demanding with respect to memory. The first time I heard of \ETEX\ +and \OMEGA\ was at the 1995 euro\TEX\ meeting organized by the \NTG\ and I was +sort of surprised by the sometimes emotional clash between the supporters of +these two variants. Actually it was the first time I became aware of \TEX\ +politics in general, but that is another story. It was also the time that I +realized that practical discussions could be obscured by nitpicking about +speaking the right terminology (token, node, primitive, expansion, gut, stomach, +etc.) and that one could best keep silent about some issues. + +The \PDFTEX\ follow up had quite some impact: as mentioned it had a backend built +in, but it also permitted hyperlinks and such by means of additional primitives. +It added a couple more, for instance for generating random numbers. But it +actually was a research project: the frontend was extended with so called +character protrusion (which lets glyphs hang into the margin) and expansion (a +way to make the output look better by scaling shapes horizontally). Both these +extensions were integrated in the paragraph builder and are thereby extending +core code. Adding some primitives to the macro processor is one thing, adapting a +very fundamental property of the typesetting machinery is something else. Users +could get excited: \TEX\ renders a text even better (of course hardly anyone +notices this, even \TEX\ users, as experiments proved). + +In the end \OMEGA\ never took off, probably because there was never a really +stable version and because at some time \XETEX\ showed up. This variant was first +only available on Apple computers because it depends on third party libraries. +Later, ports to other systems showed up. Using libraries is not specific for +\XETEX. For instance \PDFTEX\ uses them for embedding images. But, as that is +actually a (backend) extension it is not critical. Using libraries in the +frontend is more tricky as it adds a dependency and the whole idea about \TEX\ +was that is is independent. The fact that after a while \XETEX\ switched +libraries is an indication of this dependency. But, if a user can live with that, +it's okay. The same is true for (possibly changing) fonts provided by the +operating system. Not all users care too strongly about long term compatibility. +In fact, most users work on a document, and once finished store some \PDF\ copy +some place and then move on and forget about it. + +It must be noted that where \ETEX\ has some limited right to left support, +\OMEGA\ supports more. That has some more impact on all kinds of calculations in +the machinery because when one goes vertical the width is swapped with the +height|/|depth and therefore the progression is calculated differently. + +Naturally, in order to deal with scripts other than Latin, \XETEX\ did add some +primitives. I must admit that I never looked into those, as \CONTEXT\ only added +support for wide fonts. Maybe these extensions were natural for \LATEX, but I +never saw a reason to adapt the \CONTEXT\ machinery to it, also because some +\PDFTEX\ features were lacking in \XETEX\ that \CONTEXT\ assumed to be present +(for the kind of usage it is meant for). But we can safely say that the impact of +\XETEX\ was that the \TEX\ community became aware that there were new font +technologies that were taking over the existing ones used till now. One thing +that is worth noticing is that \XETEX\ is still pretty much a traditional \TEX\ +engine: it does for instance \OPENTYPE\ math in a traditional \TEX\ way. This is +understandable as one realizes that the \OPENTYPE\ math standard was kind of +fuzzy for quite a while. A consequence is that for instance the \OPENTYPE\ math +fonts produced by the \GUST\ foundation are a kind of hybrid. Later versions +adopted some more \PDFTEX\ features like expansion and protrusion. + +I skip the Japanese \TEX\ engines because they serve a very specific audience and +provide features for scripts that don't hyphenate but use specific spacing and +line breaks by injecting glues and penalties. One should keep in mind that before +\UNICODE\ all kinds of encodings were used for these scripts and the 256 +limitations of traditional \TEX\ were not suited for that. Add to that demands +for vertical typesetting and it will be clear that a specialized engine makes +sense. It actually fits perfectly in the original idea that one could extend +\TEX\ for any purpose. It is a typical example of where one can argue that users +should switch to for instance \XETEX\ or \LUATEX\ but these were not available +and therefore there is no reason to ditch a good working system just because some +new (yet unproven) alternative shows up a while later. + +We now arrive at \LUATEX. It started as an experiment in 2005 where a \LUA\ +interpreter was added to \PDFTEX. One could pipe data into the \TEX\ machinery +and query some properties, like the values of registers. At some point the +project sped up because Idris Hamid got involved. He was one of the few \CONTEXT\ +users who used \OMEGA\ (which it actually did support to some extent) but he was +not satisfied with the results. His oriental \TEX\ project helped pushing the +\LUATEX\ project forward. The idea was that by opening up the internals of \TEX\ +we could do things with fonts and paragraph building that were not possible +before. The alternative, \XETEX\ was not suitable for him as it was too bound to +what the libraries provides (rendering then depends on what library gets used and +what is possible at what time). But, dealing with scripts and fonts is just one +aspect of \LUATEX. For instance more primitives were added and the math machinery +got an additional \OPENTYPE\ code path. Memory constraints were lifted and all +became \UNICODE\ internally. Each stage in the typesetting process can be +intercepted, overloaded, extended. + +Where the \ETEX\ and \OMEGA\ extensions were the result of many years of +discussion, the \PDFTEX, \XETEX\ and \LUATEX\ originate in practical demands. +Very small development teams that made fast decisions made that possible. + +Let's give some more examples of extensions in \LUATEX. Because \PDFTEX\ is the +starting point there is protrusion and expansion, but these mechanisms have been +promoted to core functionality. The same is true for embedding images and content +reuse: these are now core features. This makes it possible to implement them more +naturally and efficiently. All the backend related functionality (literal \PDF, +hyperlinks, etc) is now collected in a few extension primitives and the code is +better isolated. This took a bit of effort but is in my opinion better. Support +for directions comes from \OMEGA\ and after consulting with its authors it was +decided that only four made sense. Here we also promoted the directionality to +core features instead of extensions. Because we wanted to serve \OMEGA\ users too +extended \TFM\ fonts can be read, not that there are many of them, which fits +nicely into the whole machinery going 32~instead of 8~bits. Instead of the \ETEX\ +register model, where register numbers larger than 255 were implemented +differently, we adopted the \OMEGA\ model of just bumping 256 to 65536 (and of +course, 16K would have been sufficient too but the additional memory it uses can +be neglected compared to what other programs use and|/|or what resources users +carry on their machines). + +The modus operandi for extending \TEX\ is to take the original literate \WEB\ +sources and define change files. The \PDFTEX\ program already deviated from that +by using a monolithic source. But still \PASCAL\ is used for the body of core +code. It gets translated to \CCODE\ before being compiled. In the \LUATEX\ +project Taco Hoekwater took that converted code and laid the foundation for what +became the original \LUATEX\ code base. + +Some extensions relate to the fact that we have \LUA\ and have access to \TEX's +internal node lists for manipulations. An example is the concept of attributes. +By setting an attribute to a value, the current nodes (glyphs, kerns, glue, +penalties, boxes, etc) get these as properties and one can query them at the +\LUA\ end. This basically permits variables to travel with nodes and act +accordingly. One can for instance implement color support this way. Instead of +injecting literal or special nodes that themselves can interfere we now can have +information that does not interfere at all (apart from maybe some performance +hit). I think that conceptually this is pretty nice. + +At the \LUA\ one has access to the \TEX\ internals but one can also use specific +token scanners to fetch information from the input streams. In principle one can +create new primitives this way. It is always a chicken|-|egg question what works +better but the possibility is there. There are many such conceptual additions +in \LUATEX, which for sure makes it the most \quote {aggressive} extension of +\TEX\ so far. One reason for these experiments and extensions is that \LUA\ +is such a nice and suitable language for this purpose. + +Of course a fundamental part of \LUATEX\ is the embedded \METAPOST\ library. For +sure the fact that \CONTEXT\ integrates \METAPOST\ has been the main reason for +that. + +The \CONTEXT\ macro package is well adapted to \LUATEX\ and the fact that its +users are always willing to update made the development of \LUATEX\ possible. +However, we are now in a stage that other macro packages use it so \LUATEX\ has +entered a state where nothing more gets added. The \LATEX\ macro package now +also supports \LUATEX, although it uses a variant that falls back on a library to +deal with fonts (like \XETEX\ does). + +With \LUATEX\ being frozen (of course bugs will be fixed), further exploration +and development is now moved to \LUAMETATEX, again in the perspective of +\CONTEXT. I will not go into details apart from saying that is is a lightweight +version of \LUATEX. More is delegated to \LUA, which already happened in +\CONTEXT\ anyway, but also some extra primitives were added, mostly to enable +writing nicer looking code. However, a major aspect is that this program uses a +lean and mean code base, is supposed to compile out of the box, and that sources +will be an integral part of the \CONTEXT\ code base, so that users are always in +sync. + +So, to summarize: we started with \type {tex} and moved on to \type {etex} and +\type {pdftex}. At some point \type {omega} and \type {xetex} filled the +\UNICODE\ and script gaps, but it now looks like \type {luatex} is becoming +popular. Although \type {luatex} is the reference implementation, \LATEX\ +exclusively uses \type {luahbtex}, while \CONTEXT\ has a version that targets at +\type {luametatex}. In parallel, the \type {[e][u][p]tex} engines fill the +specific needs for Japanese users. In most cases, good old \type {tex} and less +old \type {etex} are just shortcuts to \type {pdftex} which is compatible but has +the \PDF\ backend on board. That 8 bit engine is not only faster than the more +recent engines, but also suits quite well for a large audience, simply because +for articles, thesis, etc. (written in a Latin script, most often English) it +fits the bill well. + +I deliberately didn't mention names and years as well as detailed pros and cons. +A user should have the freedom to choose what suits best. I'm not sure how well +\TEX\ would have evolved or will evolve in these days of polarized views on +operating systems, changing popularity of languages, many (also open source) +projects being set up to eventually be monetized. We live in a time where so +called influencers play a role, where experience and age often matters less than +being fancy or able to target audiences. Where something called a standard today +is replaced quickly by a new one tomorrow. Where stability and long term usage of +a program is only a valid argument for a few. Where one can read claims that one +should use this or that because it is todays fashion instead of the older thing +that was the actually the only way to achieve something at all a while ago. Where +a presence on facebook, twitter, instagram, whatsapp, stack exchange is also an +indication of being around at all. Where hits, likes, badges, bounties all play a +role in competing and self promotion. Where today's standards are tomorrow's +drawbacks. Where even in the \TEX\ community politics seem to creep in. Maybe you +can best not tell what is your favorite \TEX\ engine because what is hip today +makes you look out of place tomorrow. + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-introduction.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-introduction.tex index dc5eb28892c..a973de1ff02 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-introduction.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-introduction.tex @@ -19,13 +19,21 @@ for more than a decade but is still used without problems) I wrote \quotation {Stability}. Many of the thoughts in these articles are influenced by discussions with my -colleagues Ton Otten and Kees van Marle. Operating in a similar arena, they -provide me the reflection needed to sort out my thoughts on these matters. +colleagues Ton Otten and Kees van Marle, users and developers. Operating in a +similar arena, they provide me the reflection needed to sort out my thoughts on +these matters. + +The order in this document is not chronological. In the meantime we also put some +development related stories in this collection, just because they have to fit in +somewhere. + +Not all musings are checked and copy|-|edited so let me know if there are errors +and typos in them. \startlines Hans Hagen Hasselt NL -2017\endash 1028 +2017\endash 2023+ \stoplines \stopchapter diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-manuals.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-manuals.tex new file mode 100644 index 00000000000..170517a5ab3 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-manuals.tex @@ -0,0 +1,236 @@ +% language=us runpath=texruns:manuals/musings + +% \showfontkerns + +% \setupalign[granular] + +\startcomponent musings-manuals + +\environment musings-style + +\startchapter[title={About manuals}] + +\startsection[title={Introduction}] + +I'm always puzzled when I read that someone wonders if \CONTEXT\ is still up to +date or maintained because some manual has a timestamp of a decade ago. I'm also +puzzled by some rants you can run into when searching the web. In the next few +paragraphs I'll comment on this. + +\stopsection + +\startsection[title={Stability}] + +Say that you're an enthusiastic user of console commands like \type {ls} (\type +{dir}), \type {cp} (\type {copy}) or maybe \type {ssh}, \type {rsync}, \type +{curl}. How often do you consult a manual on how they evolve? And say that you, +for some reason, do consult a manual, there is a good change that it is +pretty old. Does that mean that the commands are obsolete? The binaries probably +get fixed for bugs but the interface stays the same, which is what you expect. +Every time we generate a zip for the \CONTEXT\ distribution, the related website +also gets generated, using a bunch of \XML\ files that get transformed to \HTML\ +using \XSLT\ and a pretty ancient version of \type {xsltproc} (why should I +update). I never check for a new manual as it keeps doing the job. And additional +manuals and reports get added. + +So, once some functionality is stable, and a lot of macro code in \CONTEXT\ is +just that, there is no need to update a manual! Putting a new time stamp on it is +basically fake updating. And often the more introductionary kind of manuals don't +need to be updated at all, apart from maybe cultural changes that demand a +(political correct) update. Them being a bit old and not being updated is +actually a good thing as it signals stability. + +It is worth mentioning that the \CONTEXT\ distribution is not the only source of +information. There are manuals written by others and there is the Wiki. All is +the work of volunteers and updating all that depends on how much time one can +allocate. + +\stopsection + +\startsection[title={Excuses}] + +It is a fact that \CONTEXT\ evolves. New functionality gets added and some +mechanism get extended. Often these are described in dedicated manuals or +articles that end up in collections, and there are plenty of them in the +distribution. For some reason those complaining about a beginners manual with an +old time stamp don't check if there is more, and there is quite some more! Don't +only look at the \CONTEXT\ garden (the wiki) but also keep an eye on what gets +distributed. Some users are very good in track of what gets added, because +sometimes I get fixes for typos send within a few hours after uploading a zip. + +We appreciate that other users point out that writing manuals takes time and that +indeed our time is not without limits. If I could sit down and write manuals +whole day, and it would get paid, I might do it. But it is a fact that +development of \CONTEXT\ is not paid for at all. I can work on it in company time +but much happens in spare time. Most development is a gamble on future use or +done because we want to be complete or because code can be improved. So, writing +a manual then closely relates to what we like doing: it determines the topics and +priorities. If something gets explored and ends up in new functionality then that +gets documented in the process. It is the fun factor that drives it. The same is +true for \LUATEX\ development. + +So, we have as valid excuse that new manuals relate to (new) functionality and +old ones stay as they are. Don Knuth remarks somewhere that writing a manual as +part of the development is a good thing. We fully agree with that. + +\stopsection + +\startsection[title={Cutting edge}] + +Does an old manual indicate that nothing happens? Definitely not. Over a decade +of \LUATEX\ development is closely related to \CONTEXT\ and there is plenty of +reporting about that. Does that mean that we need to rewrite manuals? No, +existing functionality remains. And of course users are free to come up with +more detailed manuals (which they seldom do). Some developments get published +in user group journals but we don't publish much about specific \CONTEXT\ features +and usage because it's hard to do that for a diverse audience. + +Currently we have what is called \CONTEXT\ \MKXL\ (aka \LMTX), but we also have +the prelude to that, \MKIV, and the frozen predecessor \MKII. Apart from changes in +technology (most noticeably fonts and encodings) the functionality is accumulative: +most old manuals (unless they are specialized into old school fonts for instance) +apply to the latest greatest version. + +It is a misunderstanding that the development of \CONTEXT, \LUATEX\ and +\LUAMETATEX\ is somehow funded by projects that we do. This is not true. We can +apply both in projects but as we charge by the hour (or day) no customer ever +sees development on the bill. Of course during a project we can gain on +efficiency (so then development pays back) and because we know the system style +writing is efficient too. In fact, in most cases our customers don't know or care +what tool we use because tools are expected to be part of the deal. Most projects +we can (and could) only do because we can use \CONTEXT\ and that is a side effect +of the fact that we do develop beforehand. We're often the only technically +and|/|or affordable way out. It's a chicken|-|egg issue: we have a tool and +therefore get a project. We never get a projects where we can develop a tool. No +one pays for \TEX\ development or at least no one ever came to us with specific +\TEX\ related demands. It looks like the world takes it for granted that \TEX\ is +just there. \footnote {There are a few subcomponents of \CONTEXT\ that were +partially sponsored by users and we do have some support contracts that permit +experiments and development.} + +The reason for \CONTEXT\ being cutting edge (in terms of \TEX) is that we like +challenges, that users demand features that are interesting to explore and that +we've been part of the \TEX\ scenery for a while now. We just like that. + +It's good to know that \CONTEXT\ was and is developed as a toolkit. We started +long ago because we needed a way to quickly create and update reports of meetings +that we chaired. Next we needed a way to efficiently produce high quality +education materials (of various kind) and support maintenance of sets of related +(quality assurance) manuals. We could have used wordstar, wordperfect or msword +but liked the \TEX\ way much more. As said, most customers didn't even know or +care what tool was used because the (often highly interactive \PDF) outcome +mattered most. In fact, we would not be interested in this kind of work if we +were forced to use clumsy tools, but for sure a lot can be done with those as +well. + +\stopsection + +\startsection[title={Continuity}] + +Most development happens at \PRAGMA\ by me (Hans) with help from my two +colleagues (Ton and Kees) and the community (Aditya, Alan, Mikael, Mojca, Luigi, +Hraban, Taco, Thomas, Tomas, Willi, Wolfgang, and others). \footnote {More names +could be here as I write this in 2022.} I won't mention those on the mailing list +who contribute with ideas, testing and support, but they can't be missed. The +biggest danger for continuity is a polluted code base where everyone just pushed +code into a repository. So this is closely guarded. A user patch might work well +for that user but can break something else. + +With \TEX\ you need to keep in mind that once a solution works there is no need +to update code or manuals. As long as there is a working \LUATEX\ (\LUAMETATEX) +binary you're fine. Maybe if some specific fonts are used, a filename might need +to be adapted. + +An example. When we added a new \XML\ subsystem to \CONTEXT\ \MKIV\ we knew that +some day we could use it. We now uses it in a few projects and I'm pretty sure +that we would not do these projects otherwise as it would demand writing quite +complex \XSLT\ style sheets that then would have to be applied to thousands of +files per run. To some extend what is available in \CONTEXT\ sort of drives the +kind of work you look for. That said: if you consider using \CONTEXT\ for simple +or complex documents, either of not in a collection, either or not using \TEX\ or +\XML\ input you can be assured that this will work (and might even get better) +because we use it ourselves. + +If you want to get an idea about development, just look at the (five) documents +that describe the development of \LUATEX\ (\LUAMETATEX). Locating them in the +distribution is a good opportunity to explore the documents. They will show you +what happened the last decade(s) and give you some trust in \CONTEXT. Or come to +a \CONTEXT\ meeting and meet those involved. + +\stopsection + +% \startsection[title={Stay away}] +% +% There are reasons why you won't find us (me) on some social media. First of all +% we like using the mailing list. It puts some time between what one thinks or +% wants to ask and actually getting it out in the open. After all, one might regret +% a too spontaneous complain or even rant, so it sort of protects subscribers. +% +% It is not that hard to search the web (say Reddit) and find someone complaining +% about something \TEX\ (or \CONTEXT) related, including \type {f**ck} kind of +% wording. If you're in that category, please stay away from \CONTEXT\ or try to +% constrain yourself. It won't trigger help. Why on earth does one rant about a +% system that one doesn't like unless maybe one is enforced to use it. We prefer 10 +% out of 10000 \TEX\ users using \CONTEXT\ over 1000 of which 990 are unhappy: use +% another macro package and be part of the possible unhappy crowd there. We're not +% selling a product, we're sharing a potential useful tool! Also keep in mind that +% (as I know a bit about \TEX\ and its ecosystem) it would be very easy for me to +% counter you if I really wanted that; it might make you look ridiculous. +% +% That said, we see no benefit in being on Facebook. I never look for something +% there myself I'm too unfamiliar with it, I have nothing to share and and don't +% look forward to keeping something up to date. There is no need for an instant +% news channel on Whatsapp, Instagram, Telegram, Tiktok or other media that are +% driven by advertisements and filtering user data. We could post tutorials on +% YouTube but don't. It is already bad enough that I have to endure advertisements +% myself, let alone that users get bombarded by unrelated crap. We could have a +% fancy website and try to sell \CONTEXT\ \quote {professional} or present some +% \quote {plans}, but we like to keep it simple: the site is generated when we push +% an update and has been for decades so little work is involved in that. We don't +% keep statistics, let alone have trackers. I see no benefit in it and I don't +% like to waste time on that either. +% +% We are not on Stack Exchange but other \CONTEXT\ developers post very nice +% \CONTEXT\ answers there. Personally I just don't like a system with likes, votes, +% counters and somewhat persistent old (sometimes confusing) stuff. But I'm +% thankful for others who can deal with it. +% +% We could have a Patreon account but that's not how we work here and from seeing +% how it is used it would make me feel uncomfortable anyway. In a similar fashion +% we don't see benefits in commercializing the Github repository. Those who need +% support or and want to support development can find us if they want to. +% +% We have always participated in \TEX\ meetings and publish in use group journals +% about developments and such. We also have always been pretty active in the +% community and like it there. Just stay away from it when ranting is all you can +% contribute. +% +% \stopsection + +\startsection[title={Closing remark}] + +So next time someone asks if \CONTEXT\ is maintained because some old manual +stays around, return the question if frequently updated manuals are a sign of +stability. Also ask if someone looked a bit in the documentation tree. The oldest +manual in the \TEX\ world is the \TEX book that describes the oldest stable set +of macros: plain \TEX. There are happy users out there who love that stability. +If it were not for the wonderful personality of Don Knuth this program would +already been forgotten. I think that long term stability and unchanged code and +manuals are something that we need to cherish and get accustomed to, which is not +easy in a time when a phone and its operating system are outdated as soon as you +unbox it. It's also not easy in a time of instant communication, more and more +confused by what is called artificial intelligent mumbling, but that's for +another wrapup. + +\stopsection + +\startlines +Hans Hagen +Hasselt NL + +(uncorrected so there's something left to complain) +\stoplines + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-perfection.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-perfection.tex new file mode 100644 index 00000000000..18eeb6da5a3 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-perfection.tex @@ -0,0 +1,124 @@ +% language=us runpath=texruns:manuals/musings + +\startcomponent musings-perfection + +\environment musings-style + +\startchapter[title={Do we need perfection ?}] + +\startsection[title={Introduction}] + +It doesn't take much imagination to think of a future were jobs become less +interesting. Automation and especially machine learning will dominate more and +more. At least in the Netherlands there is a tendency to talk in terms of jobs +that assume \quotation {highly educated} folk, but often that is just a way to +boost one's self esteem, of worse, to suggest that a job is very interesting. In +this perspective the term {\em bs job} comes up. I like working with computers +but I'm not sure if I'd choose to work with them when I were young: the +perspective often for instance {\em scrumming through the workload} doesn't +really attract me. Add to that the fact that todays employer tomorrow has a +different owner and changed objectives and it becomes even less attractive. + +I often get the impression that the more constructive jobs are also the more +interesting ones but alas they are not that advocated (or popular). On the +Internet you can find plenty videos of the amazing things that humans can do. +Incredible mechanical solutions: buildings, ships, planes, gears, waterworks, +chips, and when you go a bit back in time you'll notice that often what we +consider advanced today was inspired by the past (hint: search for lunar module +computer and colossus if you're interested in the origins of computing as we know +it today). + +When you read about old school typography it is clear that we are dealing with a +craft. At some point extensive manual labor got assistance from tools: chisels, +lead letter forms, the printing press, semi|-|automated mechanical devices like +Monotype and Linotype but it was still craftmanship that was in demand. These +tools made it possible to scale up. + +When computers came around the landscape changed. The things that could not be +automated still demanded manual intervention but soon (at least that is what we +noticed) the demands simply changed. When the computer cannot hyphenate well, +just forget about it and there's always an argument to come up with. And yes, +much of today's typesetting is not really new but comes from the (near) past. The +Monotype 4|-|line system for math looks quite interesting and advanced. If you +think that our emoji are hip and modern, just look at what the Aztec did. + +The \TEX\ system has always been a bit different because it demands some manual +work to get things right. Of course one can use some precooked style but then +we're not talking craftmanship. The focus is then on the content and if it looks +kind of right all is good. It either gets retypeset \quotation {far far away} or +when it is just pushed on the web no one bothers (it has best fit on a phone). + +It is really puzzling to see how little attention is paid to digitizing documents +It is not too hard to find 150 dpi scans where the pages were scanned in an angle +of relatively recent documents \typ +{https://www.tug.org/docs/liang/liang-thesis.pdf}. When I finally decided to buy +the original \CCODE\ book, a wondered why I had to pay some 60 dollar for what +looks like either a bad scan or some low quality digital print and after a first +glance I decided that I'll probably throw it in the paper bin some day soon +because I can as well use some bad scan from Internet. One of my first buys with +respect to typesetting was \quotation {Digital Typography: An Introduction to +Type and Composition for Computer System Design} by Richard Rubinstein. That one +was done on a Mac with MSWord in 1988 and looks better than the average document +done by \TEX\ that students get from their teachers who were (probably) educated +around that time. It's more about paying attention than about the tools. + +The idea behind \CONTEXT\ macro package is (and will be) that users themselves +have some influence on what it does. There is no way that it can compete in the +\TEX\ domain with precooked styles simply because the standard has been set very +early to \LATEX\ (and \AMS\ math) and most marketing in the community targets to +such usage. One|-|time and one|-|shot users, of whom I bet some {\em have to} use +\TEX, but would gladly use something else, are not the audience for \CONTEXT. So +that brings us to questions like \quotation {What are the objectives of a macro +package like \CONTEXT ?}, \quotation {Do we need to provide perfect solutions.}, +\quotation {What do users want?}. Being forced to use (a) \TEX\ (macro package) +is not much different from being forced to use an operating system, editor or +programming language. In the end there has to be a \quote {click} and when it's +there long term happy usage will often also lead to mastery and satisfaction. + +Another set of questions relate to how eager we should be to keep up with all +demands. Do we really need to listen to publishers, especially when there is no +real indication of interest in typesetting but more in growth, profit, periodical +selling oneself. Demands change and standards come and go. A good example of a +currently popular demand is tagging documents, but when you look at that from +that with \TEX\ glasses on it is kind of weird. A \TEX\ based system can pretty +well render any variant of a document and target specific needs: paper, screen, +dedicated devices, different fonts, colors etc.\ is all pretty trivial. If a +house is not well accessible you adapt it. If clothing doesn't fit, you shop for +a different make. If you have an allergy you get different food. When it comes to +documents we can distribute variants and even the source. Not doing that when +there is demand is just laziness, unwillingness or going cheap. So, should we +adapt, or should we be more creative with designs and target alternative (and +multiple) media? If we don't, at least we should come up with good reasons. + +To go back to what I started with: how do we keep working with documents, coming +up with solutions, playing with layout, interesting? It might as well be that in +the future when the ratio employment versus free time also gives more room for +figuring things out. The interaction between coming with the content and somehow +present it using tools like \CONTEXT\ can have a positive result on the final +product. Isn't is a nice challenge to serve a broad audience with well tuned +documents? + +My impression is that the more extensive \CONTEXT\ users have enough freedom to +use a system like that. They are probably not working at large companies or in +large organizations that impress tools and methods. So a valid question is: how +does a system have to look like in order to draw those users into the game and +how does it keep them in a position that they can keep using it. We don't need +perfect, all automated, human replacement tools, do we? We're more talking +\quote {toolkit}, aren't we? + +I'd like users to come up with additional sections here. How do they use +\CONTEXT ? What do they expect from a system like that? How should it evolve? +Where should it stop? What challenges should it leave to the user? What can go +and what (kind of control) should be added? + +\stopsection + +\startsection[title={Your turn}] + +{\em user contributions} + +\stopsection + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-performance.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-performance.tex new file mode 100644 index 00000000000..aad29f9ea46 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-performance.tex @@ -0,0 +1,382 @@ +% language=us runpath=texruns:manuals/musings + +% \usemodule[abbreviations-smallcaps] + +\startcomponent musings-performance + +\environment musings-style + +\startchapter[title={Performance again}] + +\startlines \setupalign[flushright] +Hans Hagen +Hasselt NL +Februari 2020 (public 2023) +\stoplines + +\startsection[title=Introduction] + +In a \MAPS\ article of 2019 I tried to answer the question \quote {Is \TEX\ +really slow?}. A while after it was published on the Dutch \TEX\ mailing list a +user posted a comment stating that in his experience the \LUATEX\ engine in +combination with \LATEX\ was terribly slow: one page per second for a Japanese +text. It was also slower than \PDFTEX\ with English, but for Japanese it was +close to unusable. The alternative, using a Japanese \TEX\ engine was no option +due to lack of support for certain images. + +In order to check this claim I ran a test in \CONTEXT. Even on my 8 year old +laptop I could get 45 pages per second for full page Japanese texts (6 paragraphs +with each 300 characters per page): 167 pages took just less than 4 seconds. +Typesetting Japanese involves specific spacing and line break handling. So, +naturally the question arises: why the difference. Frans Goddijn wondered if I +could explain a bit more about that, so here we go. + +In the mentioned article I already have explained what factors play a role and +the macro package is one of them. It is hard to say to what extent inefficient +macros or a complex layout influence the runtime, but my experience is that it is +pretty hard to get speeds as low as 1 page per second. On an average complex +document like the \LUATEX\ manual (lots of verbatim and tables, but nothing else +demanding apart from color being used and a unique \METAPOST\ graphic per page) I +get at least a comfortable 20 pages per second. + +I can imagine that for a \TEX\ user who sees other programs on a computer do +complex things fast, the performance of \TEX\ is puzzling. But, where for +instance rendering videos can benefit from specific features of (video) +processors, multiple cores, or just aggressive optimization by compilers of +(nested) loops and manipulation of arrays of bytes, this is not the case for +\TEX. This program processes all in sequence, there is not much repetition that +can be optimized, it cannot exploit the processor in special ways and the +compiler can not do that many optimizations. + +I can't answer why a \LATEX\ run is slower than a \CONTEXT\ run. Actually, one +persistent story has always been that \CONTEXT\ was slow in comparison. But maybe +it helps to know a bit what happens deep down in \TEX\ and how macro code can +play a role in performance. When doing that I will simplify things a bit. + +\stopsection + +\startsection[title=Text and nodes] + +The \TEX\ machinery takes input and turns that into some representation that can +be turned into a visual representation ending up as \PDF. So say that we have +this: + +\starttyping +hello +\stoptyping + +In a regular programming language this is a string with five characters. When the +string is manipulated it is basically still a sequence of bytes in memory. In +\TEX, if this is meant as text, at some point the internal representation is a so +called node list: + +\starttyping +[h] -> [e] -> [l] -> [l] -> [o] +\stoptyping + +In traditional \TEX\ these are actually character nodes. They have a few properties, +like what font the character is from and what the character code is (0 up to 255). +At some point \TEX\ will turn that list into a glyph list. Say that we have this: + +\starttyping +efficient +\stoptyping + +This will eventually become seven nodes: + +\starttyping +[e] -> [ffi] -> [c] -> [i] -> [e] -> [n] -> [t] +\stoptyping + +The ffi ligature is a glyph node which actually also keeps information about this +one character being made from three. + +In \LUATEX\ it is different, and this is one of the reasons for it being slower. We +stick to the first example: + +\starttyping +[h] <-> [e] <-> [l] <-> [l] <-> [o] +\stoptyping + +So, instead of pointing to the next node, we also point back to the previous: we +have a double linked list. This means that all over the program we need to +maintain these extra links too. They are not used by \TEX\ itself, but handy at +the \LUA\ end. But, instead of only having the font as property there is much +more. The \TEX\ program can deal with multiple languages at the same time and +this relates to hyphenation. In traditional \TEX\ there are language nodes that +indicate a switch to another language. But in \LUATEX\ that property is kept with +each glyph node. Actually, even specific language properties like the hyphen min, +hyphen max and the choice if uppercase should be hyphenated are kept with these +nodes. Spaces are turned into glue nodes, and these nodes are also larger than in +regular \TEX\ engines. + +So, in \LUATEX, when a character goes from the input into a node, a more complex +data structure has to be set up and the larger data structure also takes more +memory. That in turn means that caching (close to the \CPU) gets influenced. Add +to that the fact that we operate on 32 bit character values, which also comes +with higher memory demands. + +We mentioned that a traditional engine goes from one state of node list into +another (the ligature building). Actually this is an integrated process: a lot +happens on the fly. If something is put into a \type {\hbox} no hyphenation takes +place, only ligature building and kerning. When a paragraph is typeset, +hyphenation happens on demand, in places where it makes sense. + +In \LUATEX\ these stages are split. A node list is {\em always} hyphenated. This +step as well as ligature building and kerning are {\em three} separate steps. So, +there's always more hyphenation going on than in a traditional \TEX\ engine: we +get more discretionary nodes and again these take more memory than before; also +the more nodes we have, the more it will impact performance down the line. The +reason for this is that each step can be intercepted and replaced by a \LUA\ +driven one. In practice, with modern \OPENTYPE\ fonts that is what happens: these +are dealt with (or at least managed in) \LUA. For Japanese for sure the +built|-|in ligature and kerning doesn't apply: the work is delegated and this +comes at a price. Japanese needs no hyphenation but instead characters are +treated with respect to their neighbors and glue nodes are injected when needed. +This is something that \LUA\ code is used for so here performance is determined +by how well the plugged in code behaves. It can be inefficient but it can also be +so clever that it just takes a bit of time to complete. + +I didn't mention another property of nodes: attributes. Each node that has some +meaning in the node list (glyphs, kerns, glue, penalties, discretionary, +\unknown, these terms should ring bells for a \TEX\ user) have a pointer to an +attribute list. Often these are the same for neighboring nodes, but they can be +different. If a macro package sets 10 attributes, then there will be lists of ten +attributes nodes (plus some overhead) active. When values change, copies are made +with the change applied. Grouping even complicates this a little more. This has +an impact on performance. Not only need these lists be managed, when they are +consulted at the \LUA\ end (as they are meant as communication with that bit of +the engine) these lists are interpreted. It all adds up to more runtime. There is +nothing like that in traditional \TEX, but there some more macro juggling to +achieve the same effects can cause a performance hit. + +\stopsection + +\startsection[title=Macros and tokens] + +When you define a macro like this: + +\starttyping +\def\MyMacro#1{\hbox{here: #1!}} +\stoptyping + +the \TEX\ engine will parse this as follows (we keep it simple): + +\starttabulate[|Tc|l|] +\NC \string\def \NC primitive token \NC \NR +\NC \string\MyMacro \NC user macro pointing to: \NC \NR +\NC \char\hashasciicode 1 \NC argument list of length 1 and no delimiters \NC \NR +\NC \char\leftbraceasciicode \NC openbrace token \NC \NR +\NC \string\hbox \NC hbox primitive token \NC \NR +\NC h \NC letter token h \NC \NR +\NC e \NC letter token e \NC \NR +\NC r \NC letter token r \NC \NR +\NC e \NC letter token e \NC \NR +\NC : \NC other token : \NC \NR +\NC \NC space token \NC \NR +\NC \char\hashasciicode 1 \NC reference to argument \NC \NR +\NC ! \NC other token ! \NC \NR +\NC \char\rightbraceasciicode \NC close brace token \NC \NR +\stoptabulate + +The \type {\def} is eventually lost, and the meaning of the macro is stored as a +linked list of tokens that get bound to the user macro \type {\MyMacro}. The details +about how this list is stored internally can differ a bit per engine but the idea +remains. If you compare tokens of a traditional \TEX\ engine with \LUATEX, the main +difference is in the size: those in \LUATEX\ take more memory and again that impacts +performance. + +\stopsection + +\startsection[title=Processing] + +Now, for a moment we step aside and look at a regular programming language, like +\PASCAL, the language \TEX\ is written in, or \CCODE\ that is used for \LUATEX. +The high level definitions, using the syntax of the language, gets compiled into +low level machine code: a sequence of instructions for the \CPU. When doing so +the compiler can try to optimize the code. When the program is executed all the +\CPU\ has to do is fetch the instructions, and execute them, which in turn can +lead to fetching data from memory. Successive versions of \CPU's have become more +clever in handling this, predicting what might happen, (pre) fetching data from +memory etc. + +When you look at scripting languages, again a high level syntax is used but after +interpretation it becomes compact so called bytecode: a sequence of instructions +for a virtual machine that itself is a compiled program. The virtual machine +fetches the bytes and acts upon them. It also deals with managing memory and +variables. There is not much optimization going on there, certainly not when the +language permits dynamically changing function calls and such. Here performance +is not only influenced by the virtual machine but also by the quality of the +original code (the scripts). In \LUATEX\ we're talking \LUA\ here, a scripting +language that is actually considered to be pretty fast. + +Sometimes bytecode can be compiled Just In Time into low level machine code but +for \LUATEX\ that doesn't work out well. Much \LUA\ code is executed only once or +a few times so it simply doesn't pay off. Apart from that there are other +limitations with this (in itself impressive) technology so I will not go into +more detail. + +So how does \TEX\ work? It is important to realize that we have a mix of input +and macros. The engine interprets that on the fly. A character enters the input +and \TEX\ has to look at it in the perspective of what it what it expects. It is +just a character? Is it part of a control sequence that started (normally) with a +backslash? Does it have a special meaning, like triggering math mode? When a +macro is defined, it gets stored as a linked list of tokens and when it gets +called the engine has to expand that meaning. In the process some actions +themselves kind of generate input. When that happens a new level of input is +entered and further expansion takes place. Sometimes \TEX\ looks ahead and when +not satisfied, pushes something back into the input which again introduces a new +level. A lot can happen when a macro gets expanded. If you want to see this, just +add \type {\tracingall} at the top of your file: you will be surprised! You will +not see how often tokens get pushed and popped but you can see how much got +expanded and how often local changes get restored. By the way, here is something +to think about: + +\starttyping +\count4=123 +\advance \count4 by 123 +\stoptyping + +If this is in your running text, the scanner sees \type {\count} and then +triggers the code that handles it. That code expects a register number, here that +is the \type {4}. Then it checks if there is an optional \type {=} which means +that it has to look ahead. In the second line it checks for the optional keyword +\type {by}. This optional scanning has a side effect: when the next token is {\em +not} an equal or keyword, it has to push back what it just read (we enter a new +input level) and go forward. It then scans a number. That number ends with a +space or \type {\relax} or something not being a number. Again, some push back +onto the input can happen. In fact, say that instead of \type {4} we have a macro +indicating the register number, intermediate expansion takes place. So, even +these simple lines already involve a lot of action! Now, say that we have this + +\starttyping +% \newcounter \scratchcounter % done once +\scratchcounter 123 +\scratchcounter =123 +\advance\scratchcounter by 123 +\advance\scratchcounter 123 +\stoptyping + +Can you predict what is more efficient? If this operation doesn't happen +frequently, performance wise there is no real difference between the variants +with and without \type {=} and with and without \type {b}. This is because \TEX\ +is pretty fast in tokenizing its input and interpreting its already stored token +lists that have these commands. But given what we said before, when you talk of +millions of such assignments, adding the equal sign and \type {by} {\em could} +actually be faster because there is no pushing back onto the input stack +involved. It probably makes no sense to take this into account when writing +macros but just keep in mind that performance is in the details. + +% written in 2020, the next added in Januari 2023 + +Actually, contrary to what you might expect, \type {\scratchcounter} is not even a +counter in \CONTEXT, and in \LUAMETATEX we can also do this: + +\starttyping +% \newinteger\scratchcounter % done once +\scratchcounter 123 +\scratchcounter =123 +\advanceby\scratchcounter 123 +\stoptyping + +Which means that because this counter is defined as so called \quotation +{constant integer} it avoids some indirectness (to a counter register) and +because \type {\advanceby} doesn't scan for a keyword the code above runs faster +anyway. + +This model of expansion is very different from compiled code or bytecode. To some +extent you can consider a list of tokens that make up a macro to be bytecode, but +instead of a sequence of bytes it is a linked list. That itself has a penalty in +performance. Depending on how macros expand, the engine can be hopping all over +the token memory following that list. That means that quite likely the data that +gets accessed is not in your \CPU\ cache and as a result performance cannot +benefit from it apart of course from the expanding machinery itself, but that one +is not a simple loop messing around with variables: it accesses code all over the +place! Text gets hyphenated, fonts get applied, material gets boxed, paragraphs +constructed, pages built. We're not moving a blob of bits around (as in a video) +but we're constantly manipulating small amounts of memory scattered around memory +space. + +Now, where a traditional \TEX\ engine works on 8 bit characters and smaller +tokens, the 32 bit \LUATEX\ works on larger chunks. Although macro names are +stored as single symbolic units, there are moments when its real (serialized to +characters) name is used, for instance when with \type {\csname}. When that +happens, the singular token becomes a list, so for instance the (stored) token +\type {\foo} becomes a temporary three token list (actually four if you also +count the initial reference token). Those tree tokens become three characters in +a string that then is used in the hash lookup. There are plenty cases where such +temporary string variables are allocated and filled. Compare: + +\starttyping +\def\foo{\hello} +\stoptyping + +Here the macro \type {\foo} has just a one token reference to \type {\hello} +because that's how a macro reference gets stored. But in + +\starttyping +\def\foo{\csname hello\endcsname} +\stoptyping + +we have two plus five tokens to access what effectively is \type {\hello}. Each +character token has to be converted to a byte into the assembled string. Now it +must be said that in practice this is still pretty fast but when we have longer +names and especially when we have \UTF8 characters in there it can come at a +price. It really depends on how your macro package works and sometimes you just +pay the price of progress. Buying a faster machine is then the solution because +often we're not talking of extreme performance loss here. And modern \CPU's can +juggle bytes quite efficiently. Actually, when we go to 64 bit architectures, +\LUATEX's data structures fit quite well to that. As a side note: when you run a +32 bit binary on a 64 bit architecture there can even be a price being paid for +that when you use \LUATEX. Just move on! + +\stopsection + +\startsection[title=Management] + +Before we can even reach the point that some content becomes typeset, much can +happen: the engine has to start up. It is quite common that a macro package uses +a memory dump so that macros are not to be parsed each run. In traditional +engines hyphenation patterns are stored in the memory dump as well. And some +macro packages can put fonts in it. All kind of details, like upper- and +lowercase codes can get stored too. In \LUATEX\ fonts and patterns are normally +kept out of the dump. That dump itself is much larger already because we have 32 +bit characters instead of 8 bit so more memory is used. There are also new +concepts, like catcode tables that take space. Math is 32 bit too, so more codes +related to math are stored. Actually the format is so much larger that \LUATEX\ +compresses it. Anyway, it has an impact on startup time. It is not that much, but +when you measure differences on a one page document the overhead in getting +\LUATEX\ up and running will definitely impact the measurement. + +The same is true for the backend. A traditional engine uses (normally) \TYPEONE\ +fonts and \LUATEX\ relies on \OPENTYPE. So, the backend has to do more work. The +impact is normally only visible when the document is finalized. There can be a +slightly larger hickup after the last page. So, when you measure one page +performance, it again pollutes the page per second performance. + +\stopsection + +\startsection[title=Summary] + +So, to come back to the observation that \LUATEX\ is slower than \PDFTEX. At +least for \CONTEXT\ we can safely conclude that indeed \PDFTEX\ is faster when we +talk about a standard English document, with \TEX\ \ASCII\ input, where we can do +with traditional small fonts, with only some kerning and simple ligatures. But as +soon as we deal with for instance \XML, have different languages and scripts, +have more demanding layouts, use color and images, and maybe even features that +we were not aware of and therefore didn't require in former times the \LUATEX\ +engine (and for \CONTEXT\ it's \LUAMETATEX\ follow up) performs way better than +\PDFTEX. And how about support for hyper links, protrusion and expansion, tagging +for the sake of accessibility, new layers of abstraction, etc. The impact on +performance can differ a lot per engine (and probably also per macro package). +So, there is no simple answer and explanation for the fact that the observed slow +\LATEX\ run on Japanese text, apart from that we can say: look at the whole +picture: we have more complex tokens, nodes, scripts and languages, fonts, +macros, demands on the machinery, etc. Maybe it is just the price you are paying +for that. + +\stopsection + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-plain.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-plain.tex index 96396bb8162..1a33efbfe8d 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-plain.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-plain.tex @@ -6,7 +6,9 @@ \environment musings-style -\definetyping[narrowtyping][style=\ttx] +\ifdefined\startnarrowtyping \else + \definetyping[narrowtyping][style=\ttx] +\fi \startchapter[title={About what \CONTEXT\ isn't}] @@ -546,6 +548,13 @@ that those coming up with answers and remarks like that probably missed somethin in assessing \CONTEXT. Just let users find out themselves what suits best (and for some that actually might be plain \TEX). +Let me make on thing clear. If you look at the documents that describe the +development of \TEX, \METAFONT\ and the related fonts, you can only awe at what +was done on hardware that doesn't come close to what we hold now in the palm of +our hand. And it was done in a relative short time span. The fact that plain +\TEX\ ran on it the way it did is amazing. Anyone who considers criticizing \TEX\ +and plain \TEX\ should think (more than) twice. + \stopsection \stopchapter diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-style.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-style.tex index 873c652c133..8d6733031a7 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-style.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-style.tex @@ -2,7 +2,7 @@ \startenvironment musings-style -\usemodule[abr-04] +\usemodule[abbreviations-logos] \setupbodyfont [pagella] diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-treasures.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-treasures.tex new file mode 100644 index 00000000000..aaa3c4b7a1c --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-treasures.tex @@ -0,0 +1,201 @@ +% language=us runpath=texruns:manuals/musings + +\startcomponent musings-treasures + +\environment musings-style + +\startchapter[title={Hidden treasures}] + +\startlines \setupalign[flushright] +Hans Hagen +Hasselt 2020 +February 2020 +\stoplines + +At \CONTEXT\ meetings we always find our moments to reflect on the interesting +things that relate to \TEX\ that we have run into. Among those we discussed were +some of the historic treasures one can run into when one looks at source files. I +will show examples from several domains in the ecosystem and we hereby invite the +reader to come up with other interesting observations, not so much in order to +criticize the fantastic open source efforts related to \TEX, but just to indicate +how decades of development and usage are reflected in the code base and usage, if +only to make it part of the history of computing. + +I start with the plain \TEX\ format. At the top of that file we run into this: + +\starttyping[style=\ttx] +% The following changes define internal codes as recommended +% in Appendix C of The TeXbook: + +\mathcode`\^^@="2201 % \cdot +\mathcode`\^^A="3223 % \downarrow +\mathcode`\^^B="010B % \alpha +\mathcode`\^^C="010C % \beta +\mathcode`\^^D="225E % \land +\mathcode`\^^E="023A % \lnot +\mathcode`\^^F="3232 % \in +... +\mathcode`\^^Y="3221 % \rightarrow +\mathcode`\^^Z="8000 % \ne +\mathcode`\^^[="2205 % \diamond +\mathcode`\^^\="3214 % \le +\mathcode`\^^]="3215 % \ge +\mathcode`\^^^="3211 % \equiv +\mathcode`\^^_="225F % \lor +\stoptyping + +This means that when you manage to key in one of these recommended character +codes that in \ASCII\ sits below the space slot, you will get some math symbol, +given that you are in math mode. Now, if you also consider that the plain \TEX\ +format is pretty compact and that no bytes are wasted,\footnote {Such definitions +don't take additional space in the format file.} you might wonder what these +lines do there. The answer is simple: there were keyboards out there that had +these symbols. But, by the time \TEX\ became popular, the dominance of the \IBM\ +keyboard let those memories fade away. This is just Don's personal touch I guess. +Of course the question remains if the sources of TAOCP contain these characters. + +There is another interesting hack in the plain \TEX\ file, one that actually, +when I first looked at the file, didn't immediately made sense to me. + +\starttyping[style=\ttx] +\font\preloaded=cmti9 +\font\preloaded=cmti8 +\font\preloaded=cmti7 + +\let\preloaded=\undefined +\stoptyping + +What happens here is that a bunch of fonts get defined and they all use the same +name. Then eventually that name gets nilled. The reason that these definitions +are there is that when \TEX\ dumps a format file, the information that comes from +those fonts is embedded to (dimensions, ligatures, kerns, parameters and math +related) data. It is an indication that in those days it was more efficient to +have them preloaded (that is why they use that name) than loading them at +runtime. The fonts are loaded but you can only access them when you define them +again! Of course nowadays that makes less sense, especially because storage is +fast and operating systems do a nice job at caching files in memory so that +successive runs have font files available already. + +Talking of fonts, one of the things a new \TEX\ user will notice and also one of +the things users love to brag about is ligatures. If you run the \type {tftopl} +program on a file like \type {cmr10.tfm} you will get a verbose representation of +the font. Here are some lines: + +\starttyping[style=\ttx] +(LABEL C f) (LIG C i O 14) (LIG C f O 13) (LIG C l O 15) +(LABEL O 13) (LIG C i O 16) (LIG C l O 17) +(LABEL C `) (LIG C ` C \) +(LABEL C ') (LIG C ' C ") +(LABEL C -) (LIG C - C {) +(LABEL C {) (LIG C - C |) +(LABEL C !) (LIG C ` C <) +(LABEL C ?) (LIG C ` C >) +\stoptyping + +The \type {C} is followed by an \ASCII\ representation and the \type {)} by the +position in the font \type {O} (a number) or \type {C} (a character). So, +consider the first two lines to be a puzzle: they define the fi, ff, fl ligatures +as well as the ffi and ffl ones. Do you see how ligatures are chained? + +But anyway, what do these other lines do there? It looks like \type {``} becomes +the character in the backslash slot and \type {''} the one in the double quote. +Keep in mind that \TEX\ treats the backslash special and when you want it, it +will be taken from elsewhere. But still, these two ligatures look familiar: they +point to slots that have the left and right double quotes.\footnote {\CONTEXT\ +never assumed this and encourages users to use the quotation macros. Those \type +{``quotes''} look horrible in a source anyway.} They are not really ligatures but +abuse the ligature mechanism to achieve a similar effect. The last four lines are +the most interesting: these are ligatures that (probably) no \TEX\ user ever uses +or encounters. They are again something from the past. Also, changes are low that +you mistakenly enter these sequences and the follow up Latin Modern fonts don't +have them anyway. + +Actually, if you look at the \METAFONT and \METAPOST\ sources you can find +lines like these (here we took from \type {mp.w} in the \LUATEX\ repository): + +\starttyping[style=\ttx] +@ @= +mp_primitive (mp, "=:", mp_lig_kern_token, 0); +@:=:_}{\.{=:} primitive@>; +mp_primitive (mp, "=:|", mp_lig_kern_token, 1); +@:=:/_}{\.{=:\char'174} primitive@>; +mp_primitive (mp, "=:|>", mp_lig_kern_token, 5); +@:=:/>_}{\.{=:\char'174>} primitive@>; +mp_primitive (mp, "|=:", mp_lig_kern_token, 2); +@:=:/_}{\.{\char'174=:} primitive@>; +mp_primitive (mp, "|=:>", mp_lig_kern_token, 6); +@:=:/>_}{\.{\char'174=:>} primitive@>; +mp_primitive (mp, "|=:|", mp_lig_kern_token, 3); +@:=:/_}{\.{\char'174=:\char'174} primitive@>; +mp_primitive (mp, "|=:|>", mp_lig_kern_token, 7); +@:=:/>_}{\.{\char'174=:\char'174>} primitive@>; +mp_primitive (mp, "|=:|>>", mp_lig_kern_token, 11); +@:=:/>_}{\.{\char'174=:\char'174>>} primitive@>; +\stoptyping + +I won't explain what happens there (as I would have to reread the relevant +sections of \TEX\ The Program) but the magic is in the special sequences: \typ +{=: =:| =:|> |=: |=:> |=:| |=:|> |=:|>>}. Similar sequences are used in some font +related files. I bet that most \METAPOST\ users never entered these as they +relate to defining ligatures for fonts. Most users know that combining a \type +{f} and \type {i} gives a \type {fi} but there are other ways to combine too. One +can praise today's capabilities of \OPENTYPE\ ligature building but \TEX\ was not +stupid either! But these options were never really used and this treasure will +stay hidden. Actually, to come back to a previous remark about abusing the +ligature mechanism: \OPENTYPE\ fonts are just as sloppy as \TEX\ with the quotes: +there a ligature is just a name for a multiple|-|to|-|one mapping which is not +always the same as a ligature. + +But there are even more surprises with fonts. When Alan Braslau and I redid the +bibliography subsystem of \CONTEXT\ with help from \LUA, I wrote a converter in +that language. I actually did that the way I normally do: look at a file (in this +case a \BIBTEX\ file) and write a parser from scratch. However, at some point we +wondered how exactly strings got concatenated so I decided to locate the source +and look at it there. When I scrolled down I noticed a peculiar section: + +\starttyping[style=\ttx] +@^character set dependencies@> +@^system dependencies@> +Now we initialize the system-dependent |char_width| array, for which +|space| is the only |white_space| character given a nonzero printing +width. The widths here are taken from Stanford's June~'87 +$cmr10$~font and represent hundredths of a point (rounded), but since +they're used only for relative comparisons, the units have no meaning. + +@d ss_width = 500 {character |@'31|'s width in the $cmr10$ font} +@d ae_width = 722 {character |@'32|'s width in the $cmr10$ font} +@d oe_width = 778 {character |@'33|'s width in the $cmr10$ font} +@d upper_ae_width = 903 {character |@'35|'s width in the $cmr10$ font} +@d upper_oe_width = 1014 {character |@'36|'s width in the $cmr10$ font} + +@= +for i:=0 to @'177 do char_width[i] := 0; +@# +char_width[@'40] := 278; +char_width[@'41] := 278; +char_width[@'42] := 500; +char_width[@'43] := 833; +char_width[@'44] := 500; +char_width[@'45] := 833; +\stoptyping + +Do you see what happens here? There are hard coded font metrics in there! As far +as I can tell, these are used in order to guess the width of the margin for +references. Of course that won't work well in practice, simply because fonts +differ. But given that the majority of documents that need references are using +Computer Modern fonts, it actually might work well, especially with Plain \TEX\ +because that is also hardwired for 10pt fonts. Personally I'd go for a multipass +analysis (or maybe would have had \BIBTEX\ produce a list of those labels for the +purpose of analysis but for sure at that time any extra pass was costly in terms +of performance). That code stays around of course. It makes for some nice +deduction by historians in the future. + +I bet that one can also find weird or unexpected code in \CONTEXT, and definitely +on the machines of \TEX\ users all around the world. For instance, now that most +people use \UTF8\ all those encoding related hacks have become history. On the +other hand, as history tends to cycle, bitmap symbolic fonts suddenly can look +modern in a time when emoji are often bitmaps. We should guard our treasures. + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-unicode.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-unicode.tex index 06ec019854b..397a5a2a2c1 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-unicode.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings-unicode.tex @@ -1550,20 +1550,32 @@ the math in his writing doesn't automatically translate in all \TEX ies doing th same. I don't claim that \CONTEXT\ is doing better but I do hope that its users keep going for the best outcome. +One final note. In \CONTEXT\ we always tried to keep up with developments and +\UNICODE\ input as well as using \OPENTYPE\ math fonts are part of that. However, +because we're not part of the \quote {gremia of \TEX\ math and related coding} it +hardly matters what our opinions are with respect to these issues. The best we +can do is adapt to whatever shows up, it being bad or good. It is however kind of +funny to see (by now rusty) problems that have been noticed already long ago +being presented as kind of new. Hopefully staying ahead and|/|or adapting with +specific solutions doesn't'backfire to hard on the \CONTEXT\ users. If so, we're +sorry for that. As long as they can render their documents well, it doesn't +matter that much anyway. After all, we can always just blame \quote {the others +involved}. + \stopsection \startsection[title=Resources] \starttyping -[1] https://en.wikipedia.org/wiki/Slash_(punctuation) -[2] http://www.unicode.org/reports/tr25 -[3] https://www.w3.org/TR/MathML3 -[4] https://www.unicode.org/Public/math/revision-15/MathClass-15.txt -[5] https://en.wikipedia.org/wiki/Vertical_bar -[6] https://en.wikipedia.org/wiki/Dash -[7] https://en.wikipedia.org/wiki/Commercial_minus_sign -[8] https://en.wikipedia.org/wiki/Division_sign -[9] https://en.wikipedia.org/wiki/Bullet_(typography) +[1] en.wikipedia.org/wiki/Slash_(punctuation) +[2] www.unicode.org/reports/tr25 +[3] www.w3.org/TR/MathML3 +[4] www.unicode.org/Public/math/revision-15/MathClass-15.txt +[5] en.wikipedia.org/wiki/Vertical_bar +[6] en.wikipedia.org/wiki/Dash +[7] en.wikipedia.org/wiki/Commercial_minus_sign +[8] en.wikipedia.org/wiki/Division_sign +[9] en.wikipedia.org/wiki/Bullet_(typography) \stoptyping \stopsection diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings.tex b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings.tex index 2d0e7c09499..84431317935 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/musings/musings.tex @@ -21,15 +21,27 @@ \component musings-names \component musings-plain \component musings-toocomplex - % \component musings-manuals + \component musings-manuals \component musings-performance - % \component musings-history - % \component musings-treasures - % \component musings-whytex-again + \component musings-history + \component musings-treasures + % \component musings-whytex-again % maybe \component musings-dontusetex \component musings-speed + \component musings-unicode \component musings-texlive \component musings-hownotto + % \component musings-security % maybe + % \component musings-usage % maybe + % \component musings-sideeffects % article + % \component musings-perfection % source included as teaser + \component musings-assumptions + % \component musings-green % unfinished + % \component musings-cheats + % \component musings-units % article + % \component musings-kerns % probably article + \component musings-deserved % probably article \stopbodymatter \stopproduct + diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-accuracy.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-accuracy.tex new file mode 100644 index 00000000000..16e89b049c0 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-accuracy.tex @@ -0,0 +1,198 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-accuracy + +\environment ontarget-style + +\startchapter[title={Accuracy}] + +One of the virtues of \TEX\ is that it can produce the same output over a long +period. The original engine only uses integers and although dimensions have +fractions but these are just a way to present then to the user because internally +they are scaled points. + +\starttabulate[|l|l|] +\FL +\NC \type{\dimexpr .4999pt : 2 \relax} \NC + \the\dimexpr .4999pt : 2 \relax +\NC \NR +\NC \type{\dimexpr .4999pt / 2 \relax} \NC + \the\dimexpr .4999pt / 2 \relax +\NC \NR +\ML +\NC \type{\scratchdimen.4999pt \divide \scratchdimen 2 \the\scratchdimen} \NC + \scratchdimen.4999pt \divide \scratchdimen 2 \the\scratchdimen +\NC \NR +\NC \type{\scratchdimen.4999pt \edivide\scratchdimen 2 \the\scratchdimen} \NC + \scratchdimen.4999pt \edivide\scratchdimen 2 \the\scratchdimen +\NC \NR +\ML +\NC \type{\scratchdimen4999pt \divide\scratchdimen 2 \the\scratchdimen} \NC + \scratchdimen4999pt \divide\scratchdimen 2 \the\scratchdimen +\NC \NR +\NC \type{\scratchdimen4999pt \edivide\scratchdimen 2 \the\scratchdimen} \NC + \scratchdimen4999pt \edivide\scratchdimen 2 \the\scratchdimen +\NC \NR +\NC \type{\scratchdimen4999pt \rdivide\scratchdimen 2 \the\scratchdimen} \NC + \scratchdimen4999pt \rdivide\scratchdimen 2 \the\scratchdimen +\NC \NR +\ML +\NC \type{\numexpr 1001 : 2 \relax} \NC + \the\numexpr 1001 : 2 \relax +\NC \NR +\NC \type{\numexpr 1001 / 2 \relax} \NC + \the\numexpr 1001 / 2 \relax +\NC \NR +\ML +\NC \type{\scratchcounter1001 \divide \scratchcounter 2 \the\scratchcounter} \NC + \scratchcounter1001 \divide \scratchcounter 2 \the\scratchcounter +\NC \NR +\NC \type{\scratchcounter1001 \edivide\scratchcounter 2 \the\scratchcounter} \NC + \scratchcounter1001 \edivide\scratchcounter 2 \the\scratchcounter +\NC \NR +\LL +\stoptabulate + +The above table shows what happens when we divide an odd integer or for that +matter odd fraction. Note the incompatibility between \type {\numexpr} and \type +{\dimexpr} on the one hand and \type {\divide} on the other. This is why in +\LUAMETATEX\ we have the \type {:} variant that does the same integer divide (no +rounding) as \type {\divide} does, and why we have \type {\edivide} that divides +like an expression using the \type {/}. The \type {\rdivide} only makes sense for +dimensions and rounds the result. + +As soon as one start calculating or comparing accumulated values one can run into +the values being a few scaled points off. This means that when one tests against +a criterium it might be that some range comparison is better. The most likely +place for that to happen is in the output routine and when special constructs +like floats, tables and images come into play. Just like not every number can be +represented in a float (double), we saw that dividing an odd integer can give +some unexpected rounding as part of the integer is considered a fraction. So, in +practice, even when the calculations are the same, there is a certain +unpredictable outcome from the user perspective: \quotation {Why does it fit here +and not there?} Well, we can be a few scaled points off due to some not entirely +round|-|trip calculation. + +When \TEX\ showed up it came with fonts and in those times once a font was +released it was unlikely to change. But today fonts do change. And changes means +that a document can render differently after an update. Of course this is an +argument for keeping a font in the \TEX\ tree but even then updating is kind of +normal. Take math: the fact that fonts often have issues makes that we need to +tweak them and some tweaks only get added when we run into some issue. If that +issue has been there for a while we are incompatible. + +Hyphenation patterns are another source of breaking compatibility but normally +they change little. And here one can also assume that the user want words to be +hyphenated properly. Even with such fundamental changes as a syllable being able +to move to the next line, it is often unlikely that the paragraphs gets less or +more lines. I bet that users are more worried about the impact on vertical +rendering that has consequences for page breaks that for lines coming out +differently (hopefully better). + +So, what are other potential areas in addition to slight differences due to +division, fonts and patterns? We now enter the world of \LUAMETATEX\ and +\CONTEXT. As soon as one starts to use \LUA\ code, doubles show up. It means that +we can do calculation with little loss because a double can safely hold the +maximum dimension (in scaled point). However, mixing 64 bit doubles at the \LUA\ +end with 32 bit integers in the engine can have side effects. As soon as set some +property at the \TEX\ end using \LUA\ rounding takes place. Of course we can do +all calculations like \TEX\ does, but that would have too much of an impact on +performance. + +So, going back and forth between \TEX\ and \LUA\ can introduce some inaccuracies +creeping in but as long as it is consistent, there is no real issue. It mostly +involves fonts and especially the dimensions of characters: the width, height and +depth but when one uses the xheight as relative measure there is also some +influence on for instance interline spacing, offsets and such. + +So how can fonts make a difference? In \CONTEXT\ there are two ways to use fonts: +normal mode and compact mode. In normal mode every size is an instance, where the +dimension properties of characters are scaled. In compact mode we use one size +and delegate scaling to the engine which means that we end up with the (usual) +1000 being scale 1 kind of calculations. In the end a font with design size of +10bp (most fonts) scaled to 12pt normal is not behaving the same as a 10pt setup +where a 12pt size is scaled on demand. First there is the scaling from 10bp +loaded font to the 10pt used font that gets passed to \TEX. Here we have to deal +with history: defining a font in pt points is quite normal. Then applying a 1200 +scale (later divided by 1000) in the engine again involves some rounding to +integers because that is what is used internally. I will come back to this later. + +The main conclusion to draw is that normal mode and compact mode come close but +give different results. We can come closer when we a more accurate normal mode. +In order to limit the number of font instances we normally limit the number of +digits (also in compact mode but there accuracy comes a little cost). There is a +pitfall here: While \TEX\ can happily work with any resolution, the backend has +to make sure that embedded fonts get scaled right and that (in the case of \PDF) +we compensate for drift in the page stream, because there character widths +determine the advance and these are in (often rounded) bp (big postscript +points). Especially when we enable font expansion drift prevention comes with a +price as there we are dealing with real small difference in dimensions. + +As an experiment I played with clipping measures in the engine which boils down +to rounding the last digit but that didn't work out well. For simple text we can +get normal and compact mode identical but kick in some math (many parameters +involved), font expansion and|/|or protrusion, additional inter|-|character +kerning and so on, and one never get the same output. Keep in mind that we are +not talking visual differences here, although there can be cases. More think of +due to a slightly different vertical spacing triggering a different page break, +for instance when footnotes are involved. In \CONTEXT\ the line height (and +therefore derived parameters) is defined in terms of the xheight so even a few +scaled points off makes a difference. + +At the user level, currently compact mode is enabled with: + +\starttyping +\enableexperiments[fonts.compact] +\stoptyping + +It works quite okay already for years (writing end 2023) in most scenarios but +there might be cases where existing code still needs to be adapted, which is no +big deal. The additional overhead is compensated by loading less font instances +and a smaller output file. In some cases documents actually process faster and it +definitely pays of for large fonts (\CJK) and demanding mix size feature +processing. + +A more accurate normal mode is set by: + +\starttyping +\enableexperiments[fonts.accurate] +\stoptyping + +but it doesn't bring much. It was introduced in order for Mikael Sundqvist and me +to compare and check math tweaks, especially those that depend on precise +combinations of glyphs. We temporary had some additional control in the engine +but after experiments and comparing variants the decision was made to remove that +feature. + +We ran experiments with large documents where different versions were overlaid +and depending on scenarios indeed there can be differences, but when there are +chapters starting on new pages and when vertical spacing has stretch, there are +not that many differences. When you compare the so called \type {tuc} files you +might notice small difference is position tracking but these values are seldom +used in a way that influences the rendering of text, line and page breaks. + +\def\RatioBpPt{( \number \dimexpr 10bp \relax / \number \dimexpr 10pt \relax ) } + +To come back to the bp vs pt issue. Among the options considered are moving the +character and font properties from integers to doubles, but that would impact the +memory footprint quite a bit. Another idea is that compact mode goes 10bp instead +of 10pt but that would not help. One bp is \number \dimexpr 10bp \relax \space +scaled points and one pt is \number \dimexpr 10pt \relax \space sp. The ratio +between them is \cldcontext { \RatioBpPt }, so a \TEX\ scale 1200 effectively +becomes \formatted { "\letterpercent .3N", 1200 * \RatioBpPt }, and assuming +rounding to an integer we then get \cldcontext { math.round ( 1200 * \RatioBpPt +) }. So in the end we get a less fortunate number instead of 1200 and it's not +even accurate. Therefore this option was also rejected. For the record: an +intermediate approach would have been to cheat: use an internal multiplier (the +shown ratio) and although it is not hard to support, it also means that at the +\LUA\ end we always need to take this into account, so again a no|-|go. + +In the end the only outcome of this bit of \quote {research} has been that we can +have accurate normal font handling (which is not that useful) and have two +additional divide related primitives that might be useful and add some +consistency (and these might actually get used). + +\stopchapter + +\stopcomponent + diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-active.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-active.tex new file mode 100644 index 00000000000..0f9e418da05 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-active.tex @@ -0,0 +1,252 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-active + +\environment ontarget-style + +\usemodule[system-tokens] + +\startchapter[title={Active characters}] + +Each character in \TEX\ has a so called category code. Most are of category +\quote {letter} or \quote {other character} but some have a special meaning, like +\quote {superscript} or \quote {subscript} or \quote {math shift}. Of course the +backslash is special too and it has the \quote {escape} category. + +A single character can also be a command in which case it has category \quote +{active}. In \CONTEXT\ the \type {|} is an example of that. It grabs an argument +delimited by yet another such (active) bar and handles that argument as compound +character. + +From the perspective of \CONTEXT\ we have a couple of challenges with respect to +active characters. + +\startitemize +\startitem + We want to limit the number of special symbols so we only really have to deal with the + active bar and tilde. Both have a history starting with \MKII. +\stopitem +\startitem + There are cases where we don't want them to be not active, most noticeably in + math and verbatim. This means that we either have to make a sure that they + are not active bit in nested exceptions, for instance when we flush a page + halfway verbatim, made active again. +\stopitem +\startitem + In text we always hade catcode regimes to deal with this (which is actually + why in \LUATEX\ efficient catcode tables were one of the first native + features to implement. This involves some namespace management. +\stopitem +\startitem + In math we have to fall back on a different meaning which adds another + (meaning) axis alongside catcode regimes: in math we use the same catcode + regime as in text so we have a mode dependent meaning on top of the catcode + regime specific one. +\stopitem +\startitem + In math we have this special active class|/|character definition value \type + {"8000} that makes characters active in math only. We use(d) that for permitting + regular hat and underscore characters in text mode but let them act as + superscript and subscript triggers in math mode. +\stopitem +\startitem + Active characters travel in a special way trough the system: they are + actually stored as macro calls in token lists en macro bodies. This normally + goes unnoticed (and is not that different from other catcodes being frozen in + macros). +\stopitem +\stopitemize + +So far we could always comfortably implement whatever we wanted but sometimes the +code was not that pretty. Because part of the \LUAMETATEX\ project is to make +code cleaner, I started wondering if we could come up with a better mechanism for +dealing with active characters especially in math. Among the other reasons were: +less tracing clutter, a bit more natural approach, and less intercepts for +special cases. Of course we have to be compatible. Some first experiments were +promising but as usual it took a while to identify all the cases we have to deal +with. At moments I wondered if I should go forward but as I stepwise adapted the +\CONTEXT\ code to the experiment there was no way back. I did however reject +experiments that out active characters in the catcode table namespaces. + +In \LUATEX\ (and its predecessors) internally active characters are stored as a +reference to a control sequence, although a \type {\show} or trace will report +the character as \quote {name}. For example: + +\startbuffer +\catcode `!=\activecatcode +\def !{whatever} % we also have \letcharcode +\def\foo{x!x} +\stopbuffer + +\typebuffer + +is stored as (cs, cmd, chr): + +\start +\getbuffer +\luatokentable\foo +\stop + +However, when we want some more hybrid approach, a text versus math mix, we need +to postpone resolving into a control sequence. Examples are macro bodies and +token registers. When we flag a character (with \type {amcode}) as being of a +different catcode than active in math mode, we get the following: + +\startbuffer +\amcode`! \othercatcode +\catcode `!=\activecatcode +\def !{whatever} +\def\foo{x!x} +\stopbuffer +\typebuffer + +\start +\getbuffer +\luatokentable\foo +\stop + +The difference is that here we get the active character in the body of the macro. +Interesting is that this is not something that parser is prepared for so the main +loop has now to catch active characters. This is no big deal but also not +something to neglect. The same is true for serialization of tokens. + +Other situations when we need to be clever is for instance when we try to enter +math mode. In math mode we want the (in text) active character as math character +and a convenient test is checking the mode. However, when we see \type {$} we are +not yet in math mode and as \TEX\ looks for a potential next \type {$} we grab a +active character it should not resolve in a reference to an command. The reason +for that is that when \TEX\ pushes back the token (because it doesn't see a \type +{$}) we need it to be an active character and not a control sequence. If it were +a control sequence we would see it as such in math mode which is not what we +intended. It is one of these cases where \TEX\ is not roundtrip. Similar cases +occur when \TEX\ looks ahead for (what makes a) number and doesn't see one which +then results in a push back. Actually, there are many look ahead and push back +moments in the source. + +\startbuffer +text: \def\foo{x|!|x} + +\meaningasis\foo + +\luatokentable\foo + +$x\foo x$ \foo +\stopbuffer + +\typebuffer \start\getbuffer\stop + +\startbuffer +math: $\gdef\oof{x|!|x}$ + +\meaningasis\oof + +\luatokentable\oof + +$x\oof x$ \oof +\stopbuffer + +\typebuffer \start\getbuffer\stop + +\startbuffer +toks: \scratchtoks{x|!|x} + +\detokenize\expandafter{\the\scratchtoks} + +\luatokentable\scratchtoks + +$x\the\scratchtoks x$ \the\scratchtoks +\stopbuffer + +\typebuffer \start\getbuffer\stop + +A good test case for \CONTEXT\ is: + +\startbuffer +\def\foo{x|!|x||x} + + x|!|x||x + \foo +$x|!|x||x + \foo$ +\stopbuffer + +\typebuffer + +Here we expect bars in math mode but the compound mechanism applied in text mode: + +\startlines\getbuffer\stoplines + +So the bottom line is this: + +\startitemize +\startitem + Active characters should behave as expected, which means that they get + replaced by references to commands. +\stopitem +\startitem + When the \type {\amcode} is set, this signal the engine to delay that + replacement and retain the active character. +\stopitem +\startitem + When the moment is there the engine either expands it as command (text mode) + or injects the alternative meaning based on the catcode. There we support + letters, other characters, super- and subscripts and alignment codes. The + rest we simply ignore (for now). +\stopitem +\stopitemize + +Of course you can abuse this mechanism and also retain the character's active +property in text mode by simply setting the \type {\amcode}. We'll see how that +works out. Actually this mechanism was provided in the first place to get around +the \type {"8000} limitations! So here is another cheat: + +\starttyping +\catcode `^ \othercatcode % so a ^ is just that +\amcode `^ \superscriptcatcode % but a ^ in math signals a superscript +\stoptyping + +So, the \type {a} in \type {\amcode} stands for both \quote {active} and \quote +{alternative}. As mentioned, because we distinguish between math and text mode we +no longer need to adapt the meaning of active commands: think of using \type +{\mathtext} in a formula where we leave math mode and then need to use the text +meaning of the bar, just as outside the formula. + +In the end, because we only have a few active characters and no user ever +demanded name spaces that mechanism was declared obsolete. There is no need to +keep code around that is not really used any more. + +% Although this mechanism works okay, there is a pitfall. When you define a macro, and +% \type {\amcode} is set, the active character is stored as such. That means that doing +% something like this is likely to fail: +% +% \starttyping +% \def\whatever{\let~\space} +% \stoptyping +% +% when the tilde is active as well as has a \type {\amcode} set. However, +% +% \starttyping +% \def\whatever{\letcharcode\tildeasciicode\space} +% \stoptyping +% +% will work just fine. + +Internally an active character is stored in the hash that also stores regular +control sequences. The character becomes an \UTF\ string prefixed by the \UTF\ +value of \type {0xFFFF} which doesn't exist in \UNICODE. The \type {\csactive} +primitive is a variant on \type {\csstring} that returns this hash. Its companion +\type {\expandactive} (a variant on \type {\expand}) can be used to inject the +related control sequence. If \type {\csactive} is not followed by an active +character it expands to just the prefix, as does \type {\Uchar"FFFF} but a bit of +abstraction makes sense. + +% control sequence: xxxx +% 271731 13 126 active char +% control sequence: xxxx +% 271732 135 0 protected call ~ +% control sequence: xxxx +% 271734 12 65535 other char ￿ (U+0FFFF) +% 408124 135 0 protected call ~ + +\stopchapter + +\stopcomponent + diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-bars.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-bars.tex new file mode 100644 index 00000000000..21a6eb6c099 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-bars.tex @@ -0,0 +1,204 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-bars + +\usebodyfont[modern] +\usebodyfont[modern-nt] + +\environment ontarget-style + +\startchapter[title={Between bars}] + +\startsubject[title=Inconsistencies] + +The bar in math can a real pain. There are several reasons for this, for instance +there is no proper left, middle and right bar in \UNICODE\ and as a result there +is more work involved in getting them spaced well. Another possible issue can be +to make them fit well with other fences. You expect the bars in \im {\left(x +\middle| y\right)} and \im {\left|x \middle| y\right|} to look similar. + +\start \glyphscale2000 \startformula + \mathaxisbelow \dorecurse {\nofmathvariants \barasciicode} { + \char \getmathvariant #1 \leftbracketasciicode + \char \getmathvariant #1 \barasciicode + \char \getmathvariant #1 \rightparentasciicode + \quad + } +\stopformula \stop + +However, math fonts have their surprises: + +\start \switchtobodyfont[modern-nt] \glyphscale2000 \startformula + \mathaxisbelow \dorecurse {\nofmathvariants \barasciicode} { + \char \getmathvariant #1 \leftbracketasciicode + \char \getmathvariant #1 \barasciicode + \char \getmathvariant #1 \rightparentasciicode + \quad + } +\stopformula \stop + +In Latin Modern only the first variant is tuned to work together but for larger +sizes the bars stick out. This is a problem when we want fences to adapt. The +fact that such side effects probably get unnoticed comes from the fact that macro +packages assume \type {\bigg} and friends to be used but in \CONTEXT, and +especially \LMTX, we have various mechanisms for this. One method is based on +selecting specific variants, in the case of Latin Modern 1, 4, 6 and 7, where in +in fact 7 is the last one before we switch to extensible fences. One can try to +use a different selection for brackets and bars when there is no nice match but +there are no equal height matches. + +\startbuffer +\im {\left| x \right|} +\im {\left| x^2 \right|} +\im {\left| x^{1/n} \right|} +\stopbuffer + +\typebuffer + +These example formulas can trigger a larger fence: + +\startlinecorrection \showglyphs +\ruledhbox{\scale[width=1tw]{\getbuffer}} +\stoplinecorrection + +In untweaked Latin Modern we get this: + +\startlinecorrection \switchtobodyfont[modern-nt] \showglyphs +\ruledhbox{\scale[width=1tw]{\getbuffer}} +\stoplinecorrection + +The slash in this font is rather high and therefore triggers the larger fence. +One can configure this with the \typ {\delimiterfactor} and \typ +{\delimitershortfall} but as you can see values have to relate to the font. In +\LMTX\ we set them to 1000 and 0pt and use the \LUAMETATEX\ equivalent font +variables instead, so we can indeed fine tune per font. + +To come back to the mismatch in fences, this is dealt with in a tweak: we scale +the single, double and triple bars to match the brackets: + +\start \switchtobodyfont[modern] \startformula + \mathaxisbelow \dorecurse {\nofmathvariants \barasciicode} { + \char \getmathvariant #1 \leftbracketasciicode + \char \getmathvariant #1 \barasciicode + \char \getmathvariant #1 \rightparentasciicode + \quad + } +\stopformula \stop + +Combined with proper settings for the factor (or percentage in \OPENTYPE\ math +speak) and shortfall, we now get: + +\startlinecorrection \switchtobodyfont[modern] \showglyphs +\ruledhbox{\scale[width=1tw]{\getbuffer}} +\stoplinecorrection + +When we let the upgraded math subsystem evolve we make many examples. +Unfortunately there is always an exception. For instance, we test a specific +font, notice something, deal with it, even test all fonts in inline and display +math and then after months the exception shows up. In this case it was the \im +{1/n} in a superscript that (only?) in Latin Modern goes over the top. Actually +we had noticed that bars are often inconsistent so we had a \type {fixbars} +tweak, However, for Latin Modern we found that the inconsistency between bars and +other fences needed something more drastic. Of course fixing the font is best but +we're beyond that stage now: the fonts are basically frozen. + +A close inspection of the too large fence which itself results from it being +larger than expected by design (which we noticed by adding parentheses) itself +was the result from deciding to configure additional inter|-|atom spacing for +open and close fences (see below) which then brings us back to the fact that one +bar serves three purposes. We might actually introduce these three (left, middle +and right) at some point. + +\startbuffer +\dm {\left| \frac{n^3 - 2n + 1}{n^5 - 3} - 0 \right| < \frac{4}{n^2} } +\stopbuffer + +\startlinecorrection +\switchtobodyfont[modern] +\hbox{\scale[width=.45tw]{\getbuffer}\hskip .1tw +\inherited\setmathspacing\mathordinarycode\mathclosecode\allmathstyles\zeromuskip +\scale[width=.45tw]{\getbuffer}} +\stoplinecorrection + +\stopsubject + +\startsubject[title=Missing shapes] + +The tweak discusses in the previous section is a brute force one: we put an +extensible on the base glyph. Among the arguments for doing this is that we want +to be able to add consistent double and triple bars. Without mentioning fonts +explicitly (as some might get fixed after we files bug reports) this is what +we observed: + +\startitemize[packed] +\startitem + There are single bars, double bars and triple bars and each has variants and + extensibles. This is okay. +\stopitem +\startitem + Most are there but the triple bar has no variants and extensibles +\stopitem +\startitem + We have all three base characters but no variants. The extensible has a + different width. +\stopitem +\startitem + Single, double and triple bars are inconsistent with each other. +\stopitem +\startitem + Everything is there but widths differ per variant; some match the parenthesis, + brackets and braces but not consistently. +\stopitem +\startitem + The different variant sizes are out of sync with the sizes of parenthesis + etc.\ and this makes for inconsistent matches, especially when also the width + and positioning differs. +\stopitem +\startitem + Spacing between and around double and triple bars isn't always consistent. +\stopitem +\stopitemize + +These observations lead us to the conclusion that there is no single tweak that +can fix this. Adapting the \quote {addbars} tweak to deal with all this made for +too many alternatives in checks and fixes to feel comfortable with. This is why +we decided to come up with companion fonts that provide the missing double and +triple variants and extensibles consistent with the single ones, fix spacing in +double and triple ones, fix inconsistent widths of bars, etc. Minor details like +bad positioning are already handled well do we can keep the \quote {design} as it +is. + +\usebodyfont[pagella] + +\start +\switchtobodyfont[pagella,15pt] +\dm{ + \dorecurse {\nofmathvariants "28} { + \char \getmathvariant #1 "5B + \char \getmathvariant #1 "7B + \char \getmathvariant #1 "28 + \char \getmathvariant #1 "7C + \char \getmathvariant #1 "29 + \char \getmathvariant #1 "7D + \char \getmathvariant #1 "5D \quad } +} + +\dm{ + \dorecurse {\nofmathvariants "7C} { + \char \getmathvariant #1 "7C \enspace + \char \getmathvariant #1 "2016 \enspace + \char \getmathvariant #1 "2980 \quad } +} +\stop + +\stopsubject + +\startsubject[title=Different sizes] + +middle + +\stopsubject + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-constants.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-constants.tex new file mode 100644 index 00000000000..958e78dc2bc --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-constants.tex @@ -0,0 +1,220 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-constants + +\environment ontarget-style + +\usemodule[system-tokens] + +\startchapter[title={Constants}] + +Strings don't really fit into the concept of \TEX. There everything we input and +store is tokens and nodes, so when you define a macro like + +\startbuffer +\def\foo{foo} +\stopbuffer + +\typebuffer \getbuffer + +you don't store a string but a tokenlist with three tokens: + +\luatokentable\foo + +We have three single byte characters but end up with 32 bytes memory used because +we have a linked list with a housekeeping initial token; such a token has a value +(operator & operand) as well as a pointer to a next token. This is quite ok +because whenever we need that macro the body has to be interpreted and it already +being tokenized is what makes \TEX\ fly. + +There are occasions where the expansion of a list that itself can contain +references to macros produces a new list in which case copies are being made. +Take this: + +\startbuffer +\def\oof{foo} +\def\foo{foo \oof} +\stopbuffer + +\typebuffer \getbuffer + +\luatokentable\foo + +When \type {\foo} is expanded, the macro body is pushed onto the input stack and +traversed and when \type {\oof} is seen, that one gets pushed and processed. No +copy is needed. Now take this: + +\startbuffer +\def\oof{foo} +\edef\foo{foo \oof} +\stopbuffer + +\typebuffer \getbuffer + +\luatokentable\foo + +Here \type {\foo} gets the expanded result but again \type {\oof} got pushed onto +the stack. This doesn't involved copying either but there is still the pushing +and popping input overhead. So when does copying occur? Here is an example: + +\startbuffer +\def\oof{oof} +\def\ofo{ofo} +\def\foo{\begincsname \oof:\ofo\endcsname} +\stopbuffer + +\typebuffer \getbuffer + +\luatokentable\foo + +When a csname is checked, the engine needs to construct a string in order to access the +hash table. Here is what happens: + +\startitemize[packed] +\startitem + everything upto the \type {\endcsname} is collected +\stopitem +\startitem + in the process macros are expanded (with pushing and popping input) and the + expanded tokens are appended to the result +\stopitem +\startitem + when we're okay that list get converted to a string +\stopitem +\startitem + that string is used as lookup into the hash +\stopitem +\stopitemize + +Normally we're okay but when there is some unexpected unexpandable token (an +assignment, node generator, protected macro, etc.) the collection stops and the +list so far is recycled. This process is quite efficient, as is everything \TEX, +but given that going from token list to string involved some \UTF8 juggling too +there definitely is some overhead. + +In \CONTEXT\ we use csname checking and usage quite a lot. The first line is the +traditional way. It has the disadvantage that it creates an hash entry with alias +\type {\relax} if there is no such name. That is why \ETEX\ came up with the test +as in the second line. In \LUATEX\ we introduced \type {\lastnamedcs} so that we +don't have to construct the mentioned) token list again which saves time. The +fourth line is similar to the first line but doesn't create a new command. + +\starttyping +\csname \namespace\key\endcsname ... +\ifcsname \namespace\key\endcsname \csname \namespace\key\endcsname ... \fi +\ifcsname \namespace\key\endcsname \lastnamedcs ... \fi +\begincsname \namespace\key\endcsname +\stoptyping + +One of the things all versions of \CONTEXT\ have in common (right from the start) +is that we use this namespace model consistently. In \MKIV\ we changed the +subsystem that deals with this: it's more flexible and uses less memory but it +also has way more overhead. But on the average performance is about the same so +users didn't notice that. + +There is however a trick to speed this up a bit. In the 360 page \LUAMETATEX\ +manual we expand macros like \type {\namespace} and \type {\key} 4.3 million +times (beginning of June 2023). Because Mikael Sundqvist and I are in the middle +of some math magic, we also checked his 300 page math book, and that also does it +4.2 million times (the gain was about 0.5 seconds). The upcoming math manual has +some 1.2 million. How come that we have so many expansions? First of all we use +abstraction when possible and that means that there's plenty of checking of +options and some constructs fall back on parent classes (sometimes more that two +times up the parent chain). Also, we often have three macros to expand: + +\starttyping +\ifcsname\namespace\currentinstance\key\endcsname +\stoptyping + +But these have an important property: their body is basically a string. Nothing +in there needs expansion and if it does, it's an indication of rubish that +doesn't contribute for a valid csname anyway. Once we know that we can improve +performance: + +\startbuffer +\cdef\oof{oof} +\cdef\ofo{ofo} +\def\foo{\begincsname \oof:\ofo\endcsname} +\stopbuffer + +\typebuffer \getbuffer + +So, \type {\cdef} (or \type {\constant \edef} flags the macro as being a constant +that doesn't require expansion. For the record, when you define that macro having +arguments it just becomes an \type {\edef}. + +\luatokentable\foo + +Here we define the two macros as constant ones which in practice means that they +are just macros but also indicates that in some scenarios we can directly use +their body. Now when in this csname construction we do this instead: + +\startitemize[packed] +\startitem + everything upto the \type {\endcsname} is collected +\stopitem +\startitem + in the process macros are expanded (with pushing and popping input) but when + we have a constant we add reference token when there is more than one body + token, otherwise the expanded tokens are appended to the result +\stopitem +\startitem + when we're okay that list get converted to a string and in that stage we just + convert the referenced body of the constant +\stopitem +\startitem + that string is used as lookup into the hash +\stopitem +\stopitemize + +So, instead of immediately injecting an expanded body of a macro that needs no +expansion we inject a reference and use that later on for the conversion into +characters. On the 4242938 times in \LUAMETATEX\ (at the time of writing this) this +trick gives the following results. + +\starttyping +\edef\foo{xxxx} \begincsname\foo\endcsname 0.37 +\cdef\foo{xxxx} \begincsname\foo\endcsname 0.28 +\edef\foo{xxxx} \ifcsname\foo\endcsname\fi 0.53 +\cdef\foo{xxxx} \ifcsname\foo\endcsname\fi 0.35 +\stoptyping + +And here for an existing command (\type {\relax}): + +\starttyping +\edef\foo{relax} \begincsname\foo\endcsname 0.55 +\cdef\foo{relax} \begincsname\foo\endcsname 0.36 +\edef\foo{relax} \ifcsname\foo\endcsname\fi 0.62 +\cdef\foo{relax} \ifcsname\foo\endcsname\fi 0.36 +\stoptyping + +When I used that trick in for instance some font switching macros it also had +some gain. For instance 200000 times \type {\it} went from 0.60 down to 0.54 +seconds but it is unlikely that in a document one does that many font switches. +\footnote {There are a few more places where constants can gain a little but +those don't add up much.} + +In practice other operations play a role, so here we might also benefit from the +data being in the \CPU\ cache but on the manual I gained a decent .2 seconds. One +can question if on a 8.5 second run this is worth the trouble. However, in this +particular manual we spend 3.5 seconds on font processing, some 1.5 seconds on +the backend and have a unique \METAPOST\ graphics on every page. We spend more +time in \LUA\ than in \TEX ! On 4 seconds \TEX, these .2 seconds is some 2.5 +gain, and it might actually be even more percent wise. + +In case one wonders why I spend time on this, one reason is that the last decade +I was not that impressed by performance gains of a single core and \TEX\ is a +single core process. I also can't afford the latest greatest laptops and +definitely don't want to contribute more e-waste. Also, with \TEX\ and friends +running on virtual machines and competing for resources (memory, \CPU\ and disk +or network drives) any gain is good gain. Of course it is also fun to improve +\LUAMETATEX\ and this string-like property has always bothered me. \footnote {I +did some experiment with a native string register but that made no sense because +then tokenization in other places takes a toll. With the mentioned constants we +don't pay that price.} + +\stopchapter + +\stopcomponent + +% timestamp: Peter Gabriel Live 2023 Amsterdam diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-envelopes.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-envelopes.tex new file mode 100644 index 00000000000..07d2fe168f6 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-envelopes.tex @@ -0,0 +1,914 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-envelopes + +\environment ontarget-style + +\startchapter[title={Pushing the envelope}] + +Here I describe the results of some exploration and experiments by Mikael +Sundqvist and me. We got sidetracked from intersections, arcs and drawing +functions when we noticed some artifacts with envelopes. But what are envelopes +actually? Let us start with a simple path: + +\startbuffer[testpath] +\startMPinclusions + path TestPath ; TestPath := fullcircle xyscaled (10cm,1cm) +\stopMPinclusions +\stopbuffer + +\startbuffer[a] +\startMPcode + draw TestPath withpen pencircle scaled 2mm withcolor darkred ; +\stopMPcode +\stopbuffer + +\startbuffer[b] +\startMPcode + fill TestPath withpen pencircle scaled 2mm withcolor darkred ; +\stopMPcode +\stopbuffer + +\startbuffer[c] +\startMPcode + draw TestPath withpen pensquare scaled 2mm withcolor darkblue ; +\stopMPcode +\stopbuffer + +\startbuffer[d] +\startMPcode + fill TestPath withpen pensquare scaled 2mm withcolor darkblue ; +\stopMPcode +\stopbuffer + +\startbuffer[e] +\startMPcode + fill TestPath withpen pensquare scaled 2mm withcolor darkgreen + withtransparency (1,.5) ; +\stopMPcode +\stopbuffer + +\typebuffer[testpath] + +When we draw this with a circular pen we get this: + +\typebuffer[a] \startlinecorrection \getbuffer[testpath,a] \stoplinecorrection + +Filling gives: + +\typebuffer[b] \startlinecorrection \getbuffer[testpath,b] \stoplinecorrection + +When a \type {pencircle} is used \METAPOST\ delegates the work to the backend +because \POSTSCRIPT\ has a circular pen, otherwise it has to calculate the +to|-|be|-|filled shape itself. The backend has to do some path juggling in the +case of \PDF\ because there a pen transform is different from \POSTSCRIPT. + +\typebuffer[c] \startlinecorrection \getbuffer[testpath,c] \stoplinecorrection + +Here we draw the shape with a square pen while filling gives: + +\typebuffer[d] \startlinecorrection \getbuffer[testpath,d] \stoplinecorrection + +In most cases this works out well but there are some hidden issues. These get +exposed when we use a transparency: + +\typebuffer[e] \startlinecorrection \getbuffer[testpath,e] \stoplinecorrection + +It are these artifacts that we will explore a little. For that we will render +quite some graphics. We could show numerous more examples but when you are a +\CONTEXT\ user you will be able to make plenty yourself by looking at these +examples. + +\startbuffer[e] +\startMPcode + fill fullcircle xyscaled (.8TextWidth,2cm) + withpen pensquare scaled 8mm + withcolor darkgreen + withtransparency (1,.5) ; +\stopMPcode +\stopbuffer + +\typebuffer[e] \startlinecorrection \getbuffer[testpath,e] \stoplinecorrection + +When we were playing with the \type {envelope} primitive we noticed these +artifacts and we spent quite some time looking at the code to see where it comes +from and if we could prevent this. It was then that we realized that the fill +actually also uses these envelopes but that it gets delayed till the shapes are +flushed to the backend. That meant that we could use fills with transparencies +as simple test cases. + +The first thing to get rid of is the weird blob at the right end of the fill in +this example. Not really understanding all what went on, we explored all kind of +shapes and temporarily disabled some of the code in the \METAPOST\ library to see +where it crept in. We decided that touching the code to get rid of for instance +rounding issues or potential direction related side effects made no sense. In the +end the solution was simple: + +\startbuffer[e] +\startMPcode + pen p ; p := makepen(unitsquare rotated eps) ; + fill fullcircle xyscaled (.8TextWidth,2cm) + withpen p scaled 8mm + withcolor darkgreen + withtransparency (1,.5) ; +\stopMPcode +\stopbuffer + +\typebuffer[e] \startlinecorrection \getbuffer[testpath,e] \stoplinecorrection + +We show what the \type {envelope} primitive gives us: + +\startbuffer[e] +\startMPcode + pen p ; p := makepen(unitsquare rotated eps) ; + path e ; e := + envelope (p scaled 8mm) + of + (fullcircle xyscaled (.8TextWidth,2cm)) + ; + draw e + withpen pencircle scaled 2mm + withcolor darkgreen + withtransparency (1,.5) ; + drawpoints e ; +\stopMPcode +\stopbuffer + +\typebuffer[e] \startlinecorrection \getbuffer[testpath,e] \stoplinecorrection + +This looks okay compared to previous the examples but we have only a simple path +here, while the fill actually has two: + +\startbuffer[e] +\startMPcode + pen p ; p := makepen(unitsquare rotated eps) ; + enfill fullcircle xyscaled (.8TextWidth,2cm) + withpen p scaled 8mm + withcolor darkgreen + withtransparency (1,.5) ; +\stopMPcode +\stopbuffer + +\typebuffer[e] \startlinecorrection \getbuffer[testpath,e] \stoplinecorrection + +So how do we get that inner shape? Once you know what a fill actually outputs to +the backend it is easy! There are two envelopes: the normal one and one made from +the reverse path (or in internal \METAPOST\ speak: htap). In the previous example +the \type {enfill} treats the path as a fill but will draw the envelopes instead. +As with \type {eofill}, \type {eoclip} and path accumulators this is a \METAFUN\ +backend related feature but we introduced \type {enfill} as a new one. + +\startbuffer[e] +\startMPcode + pen p ; p := makepen(unitsquare rotated eps) ; + draw + envelope (p scaled 8mm) of + (fullcircle xyscaled (.8TextWidth,2cm)) + withpen pencircle scaled 2mm + withcolor darkgreen + withtransparency (1,.5) ; + draw + envelope (p scaled 8mm) of + reverse (fullcircle xyscaled (.8TextWidth,2cm)) + withpen pencircle scaled 2mm + withcolor darkblue + withtransparency (1,.5) ; +\stopMPcode +\stopbuffer + +\typebuffer[e] \startlinecorrection \getbuffer[testpath,e] \stoplinecorrection + +We're now ready for the real deal but keep in mind that what we show here is the +result of stepwise growing insight combined with adding some features to the +engine that not only makes it possible to illustrate this but also might prove to +be useful. The used primitives will be explained later, for now we just stick +to the results. + +\startMPextensions + def pentest (expr pth, psh, convex, enhance, width) = + image ( + save p, s, w, pp, somepen ; + numeric s ; s := width ; + numeric w ; w := (15/100)*s ; + + path p, e, pp, somepen ; + + p := pth scaled s ; + + % gets rid of bad end condition (rectangle) (introduced close points) + + pp := psh rotated eps ; + + if convex : + pen somepen ; somepen := makepen (pp) ; + else : + nep somepen ; somepen := makenep (pp) ; + fi ; + + if cycle p : fill else : draw fi p + withcolor blue + withpen somepen scaled w + withtransparency (1,.5) + ; + drawarrow p ; + drawpoints p ; + + path ppp ; ppp := pp scaled w; + path qqq ; qqq := convexed ppp; + + for i within p : + drawarrow qqq shifted pathpoint withcolor yellow dashed evenly withpen pencircle scaled 1; + drawarrow ppp shifted pathpoint withcolor white; + drawpoints ppp shifted pathpoint withcolor white ; + endfor ; + + % for i within arcpointlist 50 of p : + % draw ppp shifted pathpoint withcolor white ; + % endfor ; + + defaultscale := .4 ; + e := envelope somepen scaled w of p ; + % e := e scrutinized 0.01 ; + draw e withcolor darkgreen withpen pencircle scaled 1mm; + drawpoints e ; + % drawpointlabels e withcolor green ; + e := envelope somepen scaled w of reverse p ; + % e := e scrutinized 0.01 ; + draw e withcolor yellow withpen pencircle scaled 1mm; + drawpoints e ; + % drawpointlabels e withcolor yellow ; + + if enhance : + e := e scrutinized 0.01 ; + draw convexed e withcolor darkmagenta withpen pencircle scaled 2mm ; + fi ; + + ) + enddef ; +\stopMPextensions + +\startMPextensions + def TestShapesA(expr pth, convex, enhance, dy) = + draw pentest (pth, fullcircle, convex, enhance, .4TextWidth) shifted ( 0, 0) ; + draw pentest (pth, fulldiamond, convex, enhance, .4TextWidth) shifted (.5TextWidth, 0) ; + draw pentest (pth, fulltriangle, convex, enhance, .4TextWidth) shifted ( 0,dy*TextWidth) ; + draw pentest (pth, fullsquare, convex, enhance, .4TextWidth) shifted (.5TextWidth,dy*TextWidth) ; + enddef ; + + def TestShapesB(expr pth, convex, enhance, dy) = + draw pentest (pth, starring(-1/3), convex, enhance, .35TextWidth) shifted ( 0, 0) ; + draw pentest (pth, starring(-1/2), convex, enhance, .35TextWidth) shifted (.5TextWidth, 0) ; + draw pentest (pth, starring(-eps), convex, enhance, .35TextWidth) shifted ( 0,dy*TextWidth) ; + draw pentest (pth, starring(-1/2), convex, enhance, .35TextWidth) shifted (.5TextWidth,dy*TextWidth) ; + enddef ; +\stopMPextensions + +\startplacefigure[reference=fig:A:T:F:1,title={Using four different relatively large pens on a circle.}] + \startMPcode + TestShapesA(fullcircle, true, false, .5) ; + \stopMPcode +\stopplacefigure + +\in {Figure} [fig:A:T:F:1] shows a circle filled (or enveloped) with pens made from +\type {fullcircle}, \type {fulldiamond}, \type {fulltriangle} and \type +{fullsquare}. The paths that we use for the pens are also shown. The outcome can +be puzzling but after going over the code (in the engine) and trying to reason +the logic it becomes clear that the unexpected is mostly due to the fact that +there is no other way to draw the path (read: meet the criteria). + +When looking closely at the results (adding labels to the points and zooming in) +one will notice more side effects. Because we rotate over \type {eps} to get rid +of the weird end situation we can end up with more points than we like and these +are so close to each other that one doesn't notice them. For this we can apply +the scrutinizer: + +\starttyping +e := e scrutinized 0.01 ; +\stoptyping + +When that is done we can wonder if a simplified (inner) path is possible. I tried +a few solutions using the \LUA\ interface while Mikael (as mathematician) +followed the more scientific approach but the results largely depend on the pens +and shapes. + +\startplacefigure[reference=fig:B:T:F:1] + \startMPcode + TestShapesB(fullcircle, true, false, .5) ; + \stopMPcode +\stopplacefigure + +Actually when doing all that we used a more complex pen in several variants. This +is shown in \in {figure} [fig:B:T:F:1]. Notice the dashed lines here. When a pen +is defined there is some checking going on. One is that circular pens get no +treatment at all and just pass through the system. Basically any single point +cycle is considered as elliptical anyway. Then the path turned into a so called +\quote {convex} path. It also showed us the real pen being used. When out of +curiosity I commented that bit of code I noticed that we could achieve +interesting results. The result is that we now have a \type {convexed} primitive. +After all the code was there so it took only a few lines to add this primitive. +In \in {figure} [fig:B:F:F:1] you can see the result of a unconvexed pen. + +\startplacefigure[reference=fig:B:F:F:1] + \startMPcode + TestShapesB(fullcircle, false, false, .5) ; + \stopMPcode +\stopplacefigure + +We can also calculate envelopes of non|-|cyclic paths which is demonstrated in +\in {figure} [fig:B:T:F:2] and \in {figure} [fig:B:F:F:2]. There is however some +trickery involved. Just to make this easier the \METAFUN\ macro package has a +type {starring} macro that makes such a star: + +\starttyping +path p ; p := starring(-1/2) rotated eps ; +\stoptyping + +This star can become a pen: + +\starttyping +pen somepen ; somepen := makepen (pp) ; +\stoptyping + +And as mentioned pens get convexed by default. Even worse, whenever we transform +a pen it gets convexed again. When we fill a shape the pen gets attached to that shape +and the backend will do the enveloping. The easiest way to consistently avoid +convexing was to introduce a new pen type. + +\starttyping +nep somepen ; somepen := makenep (pp) ; +\stoptyping + +The somewhat weird short \type {nep} perfectly fits the bill as in Dutch it means +fake. A pen defined this way stays unconvexed. Actually there is another property +where pens differ from regular paths: they are double linked. In original +\METAPOST\ that back (prev) link uses a field in a knot record that is not used +by pen paths. The path that gets pencilled also abuses one of knot fields for +keeping track of the offset that a point has relative to the current point in the +pen. It was good moment to also make regular paths double linked lists. That +comes at the cost of an extra pointer in the knot record but we could also save +some space by using smaller slots for other fields. Memory is not our biggest +worry anyway. \footnote {Of course adding code is but when looking in more detail +at the code involved it was actually possible to simplify the code a bit so there +we gained}. Double linking meant that there was no need for doing that when +making pens. \footnote {It makes it possible to get points relative to the +current point in iterators over paths that we introduced a while ago, which makes +for high performance path manipulators.} + +\startplacefigure[reference=fig:B:T:F:2] + \startMPcode + TestShapesB((0,0) -- (1/2,1/2) -- (2/2,0), true, false, .35) ; + \stopMPcode +\stopplacefigure + +\startplacefigure[reference=fig:B:F:F:2] + \startMPcode + TestShapesB((0,0) -- (1/2,1/2) -- (2/2,0), false, false, .35) ; + \stopMPcode +\stopplacefigure + +We can apply the \type {convexed} primitive to the inner envelope which is demonstrated +in \in {figure} [fig:B:T:T:3] and \in {figure} [fig:B:F:T:3]. Of course it is debatable +how useful this is but as with all these \METAPOST\ shapes, it has some charm. + +\startplacefigure[reference=fig:B:T:T:3] + \startMPcode + TestShapesB(fullcircle, true, true, .5) ; + \stopMPcode +\stopplacefigure + +\startplacefigure[reference=fig:B:F:T:3] + \startMPcode + TestShapesB(fullcircle, false, true, .5) ; + \stopMPcode +\stopplacefigure + +% \startplacefigure[reference=fig:B:T:F:2] +% \startMPcode +% TestShapesB((0,0) -- (1/2,1/2) -- (2/2,0) -- cycle, true, false) ; +% \stopMPcode +% \stopplacefigure + +% \startplacefigure[reference=fig:B:F:F:2] +% \startMPcode +% TestShapesB((0,0) -- (1/2,1/2) -- (2/2,0) -- cycle, false, false) ; +% \stopMPcode +% \stopplacefigure + +% \startMPpage[offset=1dk] +% enfill fullcircle scaled 2cm withpen makepen(fullsquare) scaled 1pt withcolor darkred ; +% enfill fullcircle scaled 3cm withpen makepen(fullsquare) scaled 1pt withcolor darkblue ; +% enfill reverse fullcircle scaled 1cm withpen makepen(fullsquare) scaled 1pt withcolor darkgreen ; +% \stopMPpage + +% \startMPpage[offset=1dk] +% draw envelope makepen(fullsquare) of ( fullcircle scaled 2cm) withpen pencircle scaled 1pt withcolor darkred ; +% draw envelope makepen(fullsquare) of (reverse fullcircle scaled 3cm) withpen pencircle scaled 1pt withcolor darkblue ; +% draw envelope makepen(reverse fullsquare) of ( fullcircle scaled 1cm) withpen pencircle scaled 1pt withcolor darkgreen ; +% \stopMPpage + +\page + +To what extend does all this influence the output? As long as we don't use +transparencies we're quite okay unless we use a pen size that introduces the more +extreme overshoots. If you think these phenomena only relate to \METAPOST\ +output, you're wrong. Over the past decades I've seen various fonts that exhibit +the same small spikes and other artifacts btu as we often see the shapes at small +sizes it goes unnoticed. A particular sensitive areas is variable fonts where, +when the ranges on which the various dimensions operate are too liberal, you can +also get these effects. After all, glyphs are filled shapes. To that you can also +add the fact that they are single (connected) paths drawn with \type {eofill}. + +The final format a graphics ends up in can be \PDF. Take the following three +shapes and watch the subtle side effect of rotating either the to be drawn shape +or the pen. + +\startbuffer[e] +\startMPcode + fill fullcircle xyscaled (5cm,3cm) + withpen makepen(fullsquare) scaled 2mm + withcolor darkred + withtransparency (1,.5) ; + fill fullcircle xyscaled (5cm,3cm) + shifted (6cm,0) + withpen makepen(fullsquare rotated eps) scaled 2mm + withcolor darkblue + withtransparency (1,.5) ; + fill fullcircle rotated eps xyscaled (5cm,3cm) + shifted (12cm,0) + withpen makepen(fullsquare) scaled 2mm + withcolor darkgreen + withtransparency (1,.5) ; +\stopMPcode +\stopbuffer + +\typebuffer[e] \startlinecorrection \getbuffer[e] \stoplinecorrection + +This produces four filled paths in the \PDF\ file, a normal and a reverse path +per shape. I show the whole output because you can see how some points of the +\quote {inside} curve are sort of duplicated: they have the same coordinates but +can have different control points. + +\starttabulate[|lT|lT|lT|] +\BC \BC inner \BC outer \NC \NR +\BC left \NC 25=26 31=32 35=36 39=40 43=25 \NC \NC \NR +\BC middle \NC \NC 49=50=51 54=55 58=59 62=63 \NC \NR +\BC right \NC 107=108=109 112=113 116=117 120=121 \NC 89=105 \NC \NR +\stoptabulate + +Here is the output. Each combination is between bound by the transparency +operators \type {/Tr1} and \type {/Tr0} and has different colors. + +\startlinenumbering +\starttyping +% mps graphic 1: begin +q +/Tr1 gs +0.625 0 0 rg 0.625 0 0 RG +10 M +1 j + 45.354315 2.83464 m + 45.354315 14.111559 40.874577 24.926605 32.900591 32.900591 c + 24.926605 40.874577 14.111559 45.354315 2.83464 45.354315 c + 2.83464 45.354315 -2.83464 45.354315 -2.83464 45.354315 c + -2.83464 45.354315 l +-14.111559 45.354315 -24.926605 40.874577 -32.900591 32.900591 c +-40.874577 24.926605 -45.354315 14.111559 -45.354315 2.83464 c +-45.354315 2.83464 -45.354315 -2.83464 -45.354315 -2.83464 c +-45.354315 -2.83464 l +-45.354315 -14.111559 -40.874577 -24.926605 -32.900591 -32.900591 c +-24.926605 -40.874577 -14.111559 -45.354315 -2.83464 -45.354315 c +-2.83464 -45.354315 2.83464 -45.354315 2.83464 -45.354315 c +2.83464 -45.354315 l +14.111559 -45.354315 24.926605 -40.874577 32.900591 -32.900591 c +40.874577 -24.926605 45.354315 -14.111559 45.354315 -2.83464 c +45.354315 -2.83464 45.354315 2.83464 45.354315 2.83464 c +45.354315 2.83464 l +h f +39.685035 -2.83464 m +39.685035 -2.83464 45.354315 -2.83464 45.354315 -2.83464 c +45.354315 -2.83464 45.354315 2.83464 45.354315 2.83464 c +45.354315 2.83464 39.685035 2.83464 39.685035 2.83464 c +39.685035 -8.442279 35.205297 -19.257325 27.231311 -27.231311 c +19.257325 -35.205297 8.442279 -39.685035 -2.83464 -39.685035 c +-2.83464 -39.685035 l +-2.83464 -39.685035 2.83464 -39.685035 2.83464 -39.685035 c +-8.442279 -39.685035 -19.257325 -35.205297 -27.231311 -27.231311 c +-35.205297 -19.257325 -39.685035 -8.442279 -39.685035 2.83464 c +-39.685035 2.83464 l +-39.685035 2.83464 -39.685035 -2.83464 -39.685035 -2.83464 c +-39.685035 8.442279 -35.205297 19.257325 -27.231311 27.231311 c +-19.257325 35.205297 -8.442279 39.685035 2.83464 39.685035 c +2.83464 39.685035 l +2.83464 39.685035 -2.83464 39.685035 -2.83464 39.685035 c +8.442279 39.685035 19.257325 35.205297 27.231311 27.231311 c +35.205297 19.257325 39.685035 8.442279 39.685035 -2.83464 c +39.685035 -2.83464 l +h f +/Tr0 gs +0 g 0 G +/Tr1 gs +0 0 0.625 rg 0 0 0.625 RG +158.740139 -2.834616 m +158.740139 -2.834252 l +158.740139 -2.834252 158.740091 2.835028 158.740091 2.835028 c +158.739994 14.111816 154.260267 24.926715 146.286366 32.900615 c +138.31238 40.874601 127.497335 45.354339 116.220416 45.354339 c +116.220052 45.354339 l +116.220052 45.354339 110.550772 45.354291 110.550772 45.354291 c +99.273984 45.354194 88.459085 40.874467 80.485185 32.900566 c +72.511199 24.92658 68.031461 14.111535 68.031461 2.834616 c +68.031461 2.834252 l +68.031461 2.834252 68.031509 -2.835028 68.031509 -2.835028 c +68.031606 -14.111816 72.511333 -24.926715 80.485234 -32.900615 c +88.45922 -40.874601 99.274265 -45.354339 110.551184 -45.354339 c +110.551548 -45.354339 l +110.551548 -45.354339 116.220828 -45.354291 116.220828 -45.354291 c +127.497616 -45.354194 138.312515 -40.874467 146.286415 -32.900566 c +154.260401 -24.92658 158.740139 -14.111535 158.740139 -2.834616 c +h f +153.070811 2.834616 m +153.070811 -8.442303 148.591072 -19.257349 140.617086 -27.231335 c +132.643186 -35.205235 121.828288 -39.684963 110.5515 -39.685059 c +110.5515 -39.685059 116.22078 -39.685011 116.22078 -39.685011 c +116.220416 -39.685011 l +104.943497 -39.685011 94.128451 -35.205272 86.154465 -27.231286 c +78.180565 -19.257386 73.700837 -8.442488 73.700741 2.8343 c +73.700741 2.8343 73.700789 -2.83498 73.700789 -2.83498 c +73.700789 -2.834616 l +73.700789 8.442303 78.180528 19.257349 86.154514 27.231335 c +94.128414 35.205235 104.943312 39.684963 116.2201 39.685059 c +116.2201 39.685059 110.55082 39.685011 110.55082 39.685011 c +110.551184 39.685011 l +121.828103 39.685011 132.643149 35.205272 140.617135 27.231286 c +148.591035 19.257386 153.070763 8.442488 153.070859 -2.8343 c +153.070859 -2.8343 153.070811 2.83498 153.070811 2.83498 c +153.070811 2.834616 l +h f +/Tr0 gs +0 g 0 G +/Tr1 gs +0 0.625 0 rg 0 0.625 0 RG +272.125915 2.835004 m +272.125819 14.111923 267.645988 24.92693 259.671934 32.900848 c +251.697965 40.87468 240.883028 45.354315 229.606241 45.354315 c +229.606241 45.354315 223.936961 45.354315 223.936961 45.354315 c +223.936596 45.354315 l +212.659677 45.354219 201.84467 40.874388 193.870752 32.900334 c +185.89692 24.926365 181.417285 14.111428 181.417285 2.834641 c +181.417285 2.834641 181.417285 -2.834639 181.417285 -2.834639 c +181.417285 -2.835004 l +181.417381 -14.111923 185.897212 -24.92693 193.871266 -32.900848 c +201.845235 -40.87468 212.660172 -45.354315 223.936959 -45.354315 c +223.936959 -45.354315 229.606239 -45.354315 229.606239 -45.354315 c +229.606604 -45.354315 l +240.883523 -45.354219 251.69853 -40.874388 259.672448 -32.900334 c +267.64628 -24.926365 272.125915 -14.111428 272.125915 -2.834641 c +272.125915 -2.834641 272.125915 2.834639 272.125915 2.834639 c +272.125915 2.835004 l +h f +266.456635 -2.834276 m +266.456635 -2.834641 l +266.456635 -2.834641 266.456635 2.834639 266.456635 2.834639 c +266.456635 -8.442148 261.977 -19.257085 254.003168 -27.231054 c +246.02925 -35.205108 235.214243 -39.684939 223.937324 -39.685035 c +223.936959 -39.685035 l +223.936959 -39.685035 229.606239 -39.685035 229.606239 -39.685035 c +218.329452 -39.685035 207.514515 -35.2054 199.540546 -27.231568 c +191.566492 -19.25765 187.086661 -8.442643 187.086565 2.834276 c +187.086565 2.834641 l +187.086565 2.834641 187.086565 -2.834639 187.086565 -2.834639 c +187.086565 8.442148 191.5662 19.257085 199.540032 27.231054 c +207.51395 35.205108 218.328957 39.684939 229.605876 39.685035 c +229.606241 39.685035 l +229.606241 39.685035 223.936961 39.685035 223.936961 39.685035 c +235.213748 39.685035 246.028685 35.2054 254.002654 27.231568 c +261.976708 19.25765 266.456539 8.442643 266.456635 -2.834276 c +h f +/Tr0 gs +0 g 0 G +Q +% mps graphic 1: end +\stoptyping +\stoplinenumbering + +The duplicates differ per variant and as they are effective \type {lineto} +combine with \type {curveto} we can consider removing the \type {lineto}'s. This +can either be done in the backend or we can decide to do that in the \METAPOST\ +library during the export. \footnote {In the end I settled on introducing a move +tolerance in addition to the bend tolerance that we already have in the export. +The default value of \cldcontext {"\letterpercent .6N", metapost . +getmovetolerance ()} removes 14 lines from the above \PDF\ code.} + +The \type {tracingspecs} flag can help us to see what happens deep down when + +envelopes are made. It will show the intermediate path on the console. + +\starttyping +tracingspecs := 1; +path e ; e := envelope (makepen(fullsquare) scaled 2mm) of (fullcircle scaled 3cm) ; +show(e); +\stoptyping + +The intermediate path is reported as: + +\starttyping + % beginning with offset ( 2.83464, 2.83464) + ( 42.51968, 0 ) .. controls ( 42.51968, 11.27742) and ( 38.03908, 22.09160) +.. ( 30.06534, 30.06534) .. controls ( 22.09160, 38.03908) and ( 11.27742, 42.51968) + % counterclockwise to offset (-2.83464, 2.83464) +.. ( 0, 42.51968) .. controls ( 0, 42.51968) and ( 0, 42.51968) +.. ( 0, 42.51968) .. controls (-11.27742, 42.51968) and (-22.09160, 38.03908) +.. (-30.06534, 30.06534) ..controls (-38.03908, 22.09160) and (-42.51968, 11.27742) + % counterclockwise to offset (-2.83464,-2.83464) +.. (-42.51968, 0 ) .. controls (-42.51968, 0 ) and (-42.51968, 0 ) +.. (-42.51968, 0 ) .. controls (-42.51968,-11.27742) and (-38.03908,-22.09160) +.. (-30.06534,-30.06534) .. controls (-22.0916, -38.03908) and (-11.27742,-42.51968) + % counterclockwise to offset ( 2.83464,-2.83464) +.. ( 0, -42.51968) .. controls ( 0, -42.51968) and ( 0, -42.51968) +.. ( 0, -42.51968) .. controls ( 11.27742,-42.51968) and ( 22.0916, -38.03908) +.. ( 30.06534,-30.06534) .. controls ( 38.03908,-22.09160) and ( 42.51968,-11.27742) + % counterclockwise to offset ( 2.83464, 2.83464) +.. ( 42.51968, 0 ) .. controls ( 42.51968, 0 ) and ( 42.51968, 0 ) +.. ( 42.51968, 0 ) +& cycle +\stoptyping + +The result becomes: + +\starttyping + ( 45.35432, 2.83464) .. controls ( 45.35432, 14.11206) and ( 40.87372, 24.92624) +.. ( 32.89998, 32.89998) .. controls ( 24.92624, 40.87372) and ( 14.11206, 45.35432) +.. ( 2.83464, 45.35432) .. controls ( 2.83464, 45.35432) and ( -2.83464, 45.35432) +.. ( -2.83464, 45.35432) .. controls ( -2.83464, 45.35432) and ( -2.83464, 45.35432) +.. ( -2.83464, 45.35432) .. controls (-14.11206, 45.35432) and (-24.92624, 40.87372) +.. (-32.89998, 32.89998) .. controls (-40.87372, 24.92624) and (-45.35432, 14.11206) +.. (-45.35432, 2.83464) .. controls (-45.35432, 2.83464) and (-45.35432, -2.83464) +.. (-45.35432, -2.83464) .. controls (-45.35432, -2.83464) and (-45.35432, -2.83464) +.. (-45.35432, -2.83464) .. controls (-45.35432,-14.11206) and (-40.87372,-24.92624) +.. (-32.89998,-32.89998) .. controls (-24.92624,-40.87372) and (-14.11206,-45.35432) +.. ( -2.83464,-45.35432) .. controls ( -2.83464,-45.35432) and ( 2.83464,-45.35432) +.. ( 2.83464,-45.35432) .. controls ( 2.83464,-45.35432) and ( 2.83464,-45.35432) +.. ( 2.83464,-45.35432) .. controls ( 14.11206,-45.35432) and ( 24.92624,-40.87372) +.. ( 32.89998,-32.89998) .. controls ( 40.87372,-24.92624) and ( 45.35432,-14.11206) +.. ( 45.35432, -2.83464) .. controls ( 45.35432, -2.83464) and ( 45.35432, 2.83464) +.. ( 45.35432, 2.83464) .. controls ( 45.35432, 2.83464) and ( 45.35432, 2.83464) +.. cycle +\stoptyping + +Numerous experiments by Mikael and me lead to the conclusion that both stages can +introduce the duplicate points and that any messing with that during envelop +generation time has negative side effects. However, when we export the path we +can definitely get rid of them. They are harmless but we're talking quality +control here and \TEX\ and \METAPOST\ is all about quality! + +As usual, playing with mechanisms like this gets one wondering about similar cases, +for instance variants of dashing. + +\startbuffer[e] +\startMPcode +vardef dashing (expr pth, shp, stp) = + for i within arcpointlist stp of pth : + shp + rotated angle(pathdirection) + shifted pathpoint + && + endfor nocycle +enddef ; + +path parrA ; parrA := + (0,0) -- (0,-1) -- (2,-1) -- (2,-2) -- (4,0) -- (2,2) -- (2,1) -- (0,1) -- (0,0) +; +path parrB ; parrB := + parrA -- (0,-1) -- (2,-1) -- (2,-2) -- (4,0) +; +path p ; p := fullcircle scaled 2cm ; + +fill (dashing (p, parrA, 25) && cycle) withtransparency (1,.5) ; +draw (dashing (p, parrA, 25) && cycle) withtransparency (1,.5) ; +fill (dashing (p, parrB, 25) && cycle) shifted (3cm,0) withtransparency (1,.5) ; +draw (dashing (p, parrB, 25) && cycle) shifted (3cm,0) withtransparency (1,.5) ; +\stopMPcode +\stopbuffer + +\typebuffer[e] + +In \in {figure} [fig:DASHING:1] we see the result. Of course how well if comes out +depends on the definition but what is special here is that we use the double +ampersand operator. That one will connect the paths without complaining about the +end and being point not colliding. I suppose there was a good reason for making +that a condition in the case of fonts, after all \METAFONT\ is what it came from, +but there is no real reason for it. It is a cheap extension anyway. At the same +time I decided to add a native \quote {direction} operator. The number of extra +bytes in the binary is probably less than what is needed in memory to store the +macro and the advantage is that we save an extra run over the path to reach the +point we're consulting. \footnote {In case you wonder, \ this is how the macro +definition looks like: \typ {vardef direction expr t of p = postcontrol t of p - +precontrol t of p enddef ;}. Because points are searched from from the start +there are two lookups needed. Normally this is no problem but Mikael and I are +playing with really large paths, like those that come from drawing functions.} + +\startplacefigure[reference=fig:DASHING:1,title=A somewhat related rendering.] + \scale[width=\textwidth]{\getbuffer[e]} +\stopplacefigure + +In case you wonder why we need this feature, here is an argument: + +\startbuffer[e] +\startMPcode + path s ; s := fullcircle scaled 4cm ; pickup pencircle scaled 5mm ; + + draw (s shifted (0cm,0) && s shifted (3cm,0) && s shifted (6cm,0)) + withcolor "darkred" withtransparency (1,.5) ; + + currentpicture := currentpicture shifted (-8cm,0) ; + + draw s shifted (0cm,0) + withcolor "darkblue" withtransparency (1,.5) ; + draw s shifted (3cm,0) + withcolor "darkblue" withtransparency (1,.5) ; + draw s shifted (6cm,0) + withcolor "darkblue" withtransparency (1,.5) ; + + currentpicture := currentpicture shifted (-8cm,0) ; + + nodraw s shifted (0cm,0) ; + nodraw s shifted (3cm,0) ; + nodraw s shifted (6cm,0) ; + dodraw origin withcolor "darkgreen" withtransparency (1,.5) ; + +\stopMPcode +\stopbuffer + +\typebuffer[e] + +The results are shown in \in {figure} [fig:DASHING:2]. Which if the alternatives +you prefer also depends on how you generate the shape. The \type {nodraw} variant +for instance can be mixed with calculations without the need to revert to \type +{hide}. + +\startplacefigure[reference=fig:DASHING:1,title=Do you see the difference?] + \scale[width=\textwidth]{\getbuffer[e]} +\stopplacefigure + +\startbuffer[e] +\startMPcode +vardef dashing (expr pth, shp, stp) = + for i within arcpointlist stp of pth : + shp + rotated angle(pathdirection) + shifted pathpoint + && + endfor nocycle +enddef ; + +path e, p ; numeric n ; +e := (0,0) -- (0,-1) -- (2,-1) -- (2,-2) -- (4,0) -- (2,2) -- (2,1) -- (0,1) -- (0,0) ; +n := 10 * bbwidth(e) ; +p := function(1,"x","x/4 + sin(x)",epsed(0.1),epsed(4*pi),0.01) scaled 2cm ; + +fill (dashing (p, e scaled 2.5, n) && cycle) withcolor .6white ; +draw (dashing (p, e scaled 2.5, n) && cycle) withcolor darkgreen ; + +currentpicture := currentpicture shifted (0,-2cm) ; + +n := 20 * bbwidth(e) ; +fill (dashing (p, e, n) && cycle) withcolor .6white ; +draw (dashing (p, e, n) && cycle) withcolor darkblue ; +\stopMPcode +\stopbuffer + +\in {Figure} [fig:DASHING:3] demonstrates how far we've come. Mikaels fancy +arrows nicely follow the shape of the function. Of course you need to make sure +that these arrows are reasonably scaled. The definition of \type {dashing} +demonstrates a few primitives that permits efficient iteration over a path and +\type {arcpointlist} is sort of a path. + +\startplacefigure[reference=fig:DASHING:3,title=Advanced pseudo dashing.] + \scale[width=\textwidth]{\getbuffer[e]} +\stopplacefigure + +\typebuffer[e] + +\stopchapter + +\stopcomponent + +% \startMPpage[offset=1dk] +% path theta, xaxis, yaxis; +% +% xaxis := (-4, 0) -- (5, 0) ; +% yaxis := ( 0,-2) -- (0, 2) ; +% theta := (-3, 0) -- (0, 0) && +% ( 0, 1) -- (3, 1) && +% ( 3,-1) -- (5,-1) ; +% +% draw theta scaled 2cm +% withpen pencircle scaled 2 +% withcolor darkred ; +% +% drawarrow xaxis scaled 2cm ; +% drawarrow yaxis scaled 2cm ; +% \stopMPpage + +% \startMPpage[offset=1dk] +% vardef dashing (expr pth, shp, stp) = +% for i within arcpointlist stp of pth : +% shp +% rotated angle(pathdirection) +% shifted pathpoint +% && +% endfor nocycle +% enddef ; +% +% path e, p ; numeric n ; +% e := (0,0) -- (0,-1) -- (2,-1) -- (2,-2) -- (4,0) -- (2,2) -- (2,1) -- (0,1) -- (0,0) ; +% n := 30 * bbwidth(e) ; % 80 ; +% p := function(1,"x","x/4 + sin(x)",epsed(0.1),epsed(4*pi),0.01) scaled 2cm ; + +% % draw p withpen pencircle scaled .1mm withcolor darkblue ; + +% eofill (dashing (p, e, n) && cycle) withcolor .6white ; % withtransparency (1,.5) ; +% draw (dashing (p, e, n) && cycle) withcolor darkgreen ; % withtransparency (1,.5) ; +% \stopMPpage + +% \startMPpage[offset=1dk] +% path theta, xaxis, yaxis; +% +% xaxis := (-4,0) -- (4,0) ; +% yaxis := (0,-1/4) -- (0,3/2) ; +% theta := (-3,0) -- (0,0) && (0,1) -- (3,1) ; +% +% pickup pencircle scaled 1mm; +% +% drawarrow xaxis scaled 2cm ; +% drawarrow yaxis scaled 2cm ; +% draw theta scaled 2cm withcolor darkred ; +% +% currentpicture := currentpicture shifted (0,5cm) ; +% +% drawarrow xaxis scaled 2cm ; +% drawarrow yaxis scaled 2cm ; +% +% draw (theta && cycle) scaled 2cm withcolor darkyellow ; +% drawpoints (theta && cycle) scaled 2cm withcolor darkyellow ; +% drawpointlabels (theta && cycle) scaled 2cm withcolor darkyellow ; +% fill (theta && cycle) scaled 2cm withcolor "orange" withpen pencircle scaled .5mm; +% +% show(theta ); +% show(theta && cycle); +% +% \stopMPpage + +% \startMPpage[offset=1dk] +% path theta, xaxis, yaxis, thetaA, thetaB ; +% +% xaxis := (-4,0) -- (4,0) ; +% yaxis := (0,-1/4) -- (0,3/2) ; +% +% thetaA := (-3,0) -- (0,0) -- (-2,1) -- cycle ; +% thetaB := ( 0,1) -- (3,1) -- ( 2,0) -- cycle ; +% theta := thetaA && thetaB ; +% +% pickup pencircle scaled 1mm; +% +% drawarrow xaxis scaled 2cm ; +% drawarrow yaxis scaled 2cm ; +% draw theta scaled 2cm withcolor darkred ; +% +% currentpicture := currentpicture shifted (0,5cm) ; +% +% drawarrow xaxis scaled 2cm ; +% drawarrow yaxis scaled 2cm ; +% +% draw (theta && cycle) scaled 2cm withcolor darkyellow ; +% fill (theta && cycle) scaled 2cm withcolor "orange" withpen pencircle scaled .5mm; +% \stopMPpage + +% \startMPpage +% picture q ; q := lmt_outline [ text = "\TEX", kind = "path" ] ; +% path qq ; qq := for i within q : +% if picture i : for j within i : if stroked j : +% pathpart j && +% fi endfor fi +% endfor nocycle ; +% +% path e, p ; numeric n ; +% e := qq shifted - center qq xsized 1mm ; +% n := 30 * bbwidth(e) ; +% p := function(1,"x","x/4 + sin(x)",epsed(0.1),epsed(4*pi),0.01) scaled 2cm ; +% +% draw (dashing (p, e scaled 2.5, n) && cycle) +% withpen pencircle scaled .1 +% withcolor darkgreen +% ; +% +% path e, p ; numeric n ; +% e := qq shifted - center qq xsized .1mm ; +% n := 2000 * bbwidth(e) ; +% p := function(1,"x","x/4 + sin(x)",epsed(0.1),epsed(4*pi),0.01) scaled 2cm ; + +% draw (dashing (p, e scaled 2.5, n) && cycle) +% withpen pencircle scaled .01 +% withcolor darkgreen +% ; +% \stopMPpage diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-gettingridof.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-gettingridof.tex index 75b7f5bc040..d87a8d8c9c3 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-gettingridof.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-gettingridof.tex @@ -118,7 +118,7 @@ we are in r2l mode, just like we look up a smaller variant when we're in compact font mode (a \CONTEXT\ feature). \bgroup -\definefontfeature[mathextra][mathxitsarabic=yes] +\definefontfeature[mathextra][xitsarabic=yes] \switchtobodyfont[bonum] \setupmathematics[bidi=yes,align=righttoleft]\par \setupalign[righttoleft] % @@ -182,7 +182,7 @@ but the results are rewarding. \startformula \scale[s=2]{\dm{ -\widebar{A}__{\myannuity{m}}^^{2}_{x:\annuity{n}}^{1} +\widebar{A}__{\myannuity{m}}^^^{2}_{x:\annuity{n}}^{1} }} \stopformula diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-green.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-green.tex new file mode 100644 index 00000000000..ef570c92095 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-green.tex @@ -0,0 +1,204 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-green + +\environment ontarget-style + +\startchapter[title={Running green}] + +There are a few contradicting developments going on: energy prices sky|-|rocket +and Intel and AMD are competing for the fastest \CPU's where saving energy seems +mostly related to making sure that the many cores running at the same time don't +burn the machine. However, \TEX\ is a single core consumer so throwing lots of +cores into the game is not helping much. You're better served with one very fast +core than many slower ones that accumulate to much horsepower. The later makes +sense when you process video or play games, but that's not what \TEX\ is about, +although it is fun to play with. Of course often multiple cores come in handy, +for instance in the build farm that is used to compile \LUAMETATEX\ and +intermediate \TEXLIVE\ releases: when that gets compiled and we also trigger a +\LUAMETATEX\ build, two times 10 \LINUX\ virtual machines are compiling and one +windows machine that runs four compile jobs at the same time. + +The server that runs the farm is Dell 710 server with dual 5630 Xeon processors, +6 SAS drives each 2GB in (hardware) raid 10, 72 GB memory, redundant power +supplies and 6 network ports. It sits idle for most of the time and consumes +between 250 and 400W. It is part of a redundant setup: dual switches, dual +routers, multiple UPS's, air conditioning, two backup QNAP NAS's, a few low power +machines for distributed continuous incremental backups, etc. The server itself +is a refurbished one, so not the most expensive, but with the Dutch energy prices +of 2022 bound to gas prices, we quickly realized that there was no way we could +keep it up and running. Because we have three such servers (one is turned off and +used as fallback) we started wondering if we could go for a different solution. + +As we recently upgraded the 2013 laptops to refurbished 2018 ones (the latest +models that could use the docking stations that we have), we decided to buy a few +more and test these as replacements for the servers. Of course one has to pimp +these machines a bit: a professional 2TB nvme SSD plus a proper 2.5in SSD as +backup one, 64 GB of memory, a few extra USB3 network cards. The \CPU's are fast +mobile Xeons. We use proxmox as virtual host and that runs fine in such a +configuration. + +Surprisingly, after moving the farm to that setup, which basically boils down to +moving virtual machines, we found that running those parallel compilations +performance wise was quite okay. And the nice thing was that these machines idle +much lower, some 20--30W. The saving is therefore quite noticeable and we decided +to check some more; after all it would be nice if we could bring down the average +power consumption of 1750W down to at least half so that it would match the +output of a few solar panels. Of course it means that one has to ditch perfectly +well working machines which itself is not that environmental friendly but there +is not much to choose here. + +The second machine to be replaced was the one that runs quite some virtual +machines too: the main file server, the mail server, an ftp server, the website, an +rsync host, the squeezebox server that also serves as update test, and various +project related rendering services. All run in their own (OpenSuse) virtual +machine. After installing a similar laptop those were also moved. + +As a side effect, the two backup NAS's were replaced by a single laptop (my 2013 +Dell precision workhorse) running one backup file server, and for an extra +incremental backup (rsnaphot running hourly, daily, weekly and monthly backups is +our friend) a 2013 macbook was turned into a \LINUX\ machine (15W idle with an +internal reused SSD\footnote {For a change that apple machine was easy to update, +and we could even get a new clone battery replacement.} and an external 4GB +disk), two managed switches became one (after all we had less network cables due +to lost redundancy), only one backup power supply (that will be replaced by an +nicer alternative when it breaks down; after all, by using laptops we get power +backup for free). The total consumption went down with at least 1000W. Of course +there is an investment involved and we need to reconfigure the server rack, but +the expectation is that by investing now we get less troubles later (less +gambling on energy). \footnote {We hope to save some 9000 kWh which means that +save at least some 2500\euro\ per year and more when the government will +reinstate its energy tax policy and or prices go further up, which seems to be +the case. Even before the crisis in the Netherlands 5ct/Kwh became fives times +that amount effectively when connection, transportation, energy tax and value +added tax gets added.} + +But, there is still the pending question of what the impact is on the services +that we run. The most demanding ones are the Math4all and Math4mbo: these produce +large files, need many resources (\XML\ and images), and we didn't want to burn +ourselves too much. Now, here is an interesting observation: this service runs +twice as fast on the new infrastructure. But it is hard to explain why. The file +server is on a different machine (so no fast internal network), the \CPU\ is a +bit faster but not that much, the virtual machine is on \SSD, but files are saved +on the file server, which is a two disk \USB3 enclosure connected directly to a +virtual machine that does software raid. The most important difference is that +main memory is much faster and \TEX\ is a memory intense process. From when we +started with \LUATEX\ we do know that memory bandwidth and \CPU\ caches makes a +difference. Maybe the faster floating point handling fo the more modern Xeon also +helps here. + +And that brings me to the following: how do we actually benchmark \TEX ? When you +go on the internet and compare \CPU's most tests are not that comparable to a +\TEX\ run on a single core. One can think of a set of test files, but the problem +there is that when the engine evolves and details in the macro package coding +changes, one looses the comparison with older tests. This is why, when we do such +tests, we always run the same test on the different platforms. Although this +often shows that the gain on newer hardware is seldom what one expects from the +more general benchmarks, one can still be surprised. When we moved to five year +newer laptops the gain was some 30\% for me and 50\% for my colleague. The +difference between his laptop and the slightly more beefed up virtual machine can +be neglected. + +We monitor the power consumption with a youless device connected to the power +meter. When I process the \LUAMETATEX\ manual I see the phase that the machine +sits on go up 20W for a run that takes some 9 seconds. Let's say that we use +180Ws or 0.0006kWh (20.000 runs per kWh). So, compared to the idle power usage of +a server, a single \TEX\ run can be neglected, simply because it is so fast. So, +what is actually the most efficient hardware for a \TEX\ service? I get the +feeling that a decent Intel Atom C3955 16-Core driven machine is quite okay for +that, but I don't have that at hand and last time I checked one could not order +anything anyway. And with prices of hardware going up it's also not something you +try for fun. As comparison to what we have now, testing \TEX\ on an Intel +NUC11ATKC2 could also be interesting (it has an N4505 \CPU). There was a time +when I considered a bunch of raspberry pi's but they no longer are that cheap, +given that you can get them, and adding a case and proper disc enclosure also +adds up. When wrapped in a nice package the pi will probably a couple of times +slower but it then probably also uses less power. These fitlets are also +interesting but again, one can't get them. + +It is kind of fun to play with optimizations that don't really impact the clarity +of the code. One can argue that spending a day on something that saves 0.005 +seconds on a specific run is a waste of time, but of course one has to multiply +that number by a number of runs. Personally I will never gain from it but +nevertheless it can save some energy: imagine a batch of 15000 documents every +day. We then save $15000 * 0.005 * 365 = 27375$ seconds or about 8 hours runtime. +This can still be neglected but what if this is not the only optimization? + +An example of such an optimization is this: + +\starttyping +\advance\somecounter \plusone +\advance\somecounter by \plusone +\stoptyping + +The second one runs faster because there is no push back involved as side effect of +the lack of a keyword, so how about adding this to the engine? + +\starttyping +\advanceby \somecounter \plusone +\advancebyone\somecounter +\stoptyping + +Given the way \LUAMETATEX\ is coded, it only needs a few lines! In this case it +extends the repertoire of primitives so it is visible but we have many other +(similarly small) optimizations that contribute. Again, the average user will not +notice a drop in runtime from 1.5 seconds to 1.45 but when 8 hours become 80 +hours or 800 hours it does become interesting. In energy sensitive 2022 these 800 +hours not only save some \texteuro 400 but also contribute to a lower carbon +footprint! And now imagine how much could be saved on these extensive runs when +we make sure that the style used is optimal? Of course, when we need two runs per +document it starts adding up more. + +Some experiments with a demanding file showed one percent gain (on a 2.7 seconds +run) using the alternative integers, dimensions and advance primitives. However, +using \CONTEXT's compact font mode brought down runtime to 2.0 seconds! So, in +the end it's all very relative. It is worth noticing that the .7 seconds saved on +fonts is sort of constant, which means that accumulated gains elsewhere makes +that .7 seconds more significant as we progress. + +\stopchapter + +% 4 * 7520 precision with Xeons +% 1 * 7600 precision with extreme i7 +% 1 * 2200W dell ups +% 2 * 4K monitor (+ 3 monitors turned off) +% 1 * imac server room xubuntu (turned off) +% 2 * pfsense router (6 port 8 core atom appliances) +% 1 * dell 48 port switch (1 turned off, 1 24 port switch reserve) +% 3 * 720 dell server (turned off) +% 2 * dell 16 port switch +% 2 * dell 8 port switch (1 turned off) +% 1 * raspberry pi farm +% 2 * office printer +% 4 * standby automatic lights +% 2 * tv + cable box (+ 1 turned off) (on ups) +% 2 * hue hub +% 1 * evohome + pump heating system +% 1 * airconditioner (idle blow, 28 degrees threshold) +% 1 * fitlet (serves hue and heating) +% 1 * fritzbox (7590) + 3 repeaters +% 1 * cable modem +% 3 * small UPS +% 3 * distributed backup (old macbook, hp laptop, hp micro server) +% - - some standby things (squeeze boxes etc) +% 32 hue light bulbs +% 6 * cordless phones +% 1 * alarm panel +% 2 * warm water boiler (standby + upping) +% 1 * coffee machine (standby + upping) +% 1 * freezer (standby + upping) +% 1 * refrigerator (standby + upping) +% +% 800-1000W (from 1750-2000) +% +% (upcoming new monitors will save 100W) +% +% aim: 750 during the day, 500 after midnight +% +% 4 solar panels on shed + +% not mentioned: washing machine, dryer, dish washer, several audio sets, +% battery loaders (ebike etc), + +\stopcomponent + diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-introduction.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-introduction.tex index f7ac0a19d4e..c590269b600 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-introduction.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-introduction.tex @@ -87,9 +87,13 @@ the boundary for implementing some of the more intrusive extensions in \LUAMETATEX\ and the follow up on \MPLIB. And once you start along that road small steps become large steps and one can as well be try to be as complete as possible. We've come a long way but eventually arrived at the destination. -Personally I think we got there by not being in a hurry. +Personally I think we got there by not being in a hurry. Even targets that are +(nearly) reached can eventually move, -But even targets that are reached can eventually move, +I want to use this opportunity to thank Karl Berry. When making some of the +stories presented here ready for \TUGBOAT, he not only turns bad English into +good, but also checks and feeds back on what we write. We really appreciate that +and it also motivates us to keep wrapping up. \blank[2*big] diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-jmn.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-jmn.tex new file mode 100644 index 00000000000..93d95047c5a --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-jmn.tex @@ -0,0 +1,245 @@ +% language=us runpath=texruns:manuals/ontarget + +% \profilemacro\scaledfontdimen + +\usebodyfont[antykwa] +\usebodyfont[iwona] +\usebodyfont[kurier] + +\startcomponent ontarget-jmn + +\environment ontarget-style + +\startchapter[title={Supporting math in the JMN collection}] + +\startlines +Hans Hagen, Hasselt NL +Mikael Sundqvist, Lund SV +\stoplines + +\startsubject[title=Introduction] + +In 2022 we overhauled math font support in \CONTEXT, using new functionality in +the \LUAMETATEX\ engine. By that time it had become clear that the \OPENTYPE\ +math font landscape had more or less settled. The Latin Modern fonts as well as +the \TEX gyre fonts don't evolve, so we consider them being frozen. It is also +unlikely that the reference Cambria font will change or become more complete. +More recent math font are modelled as a mixture of Cambria and Latin Modern. + +When we started with \LUATEX\ in \CONTEXT\ we immediately started using \UNICODE\ +math but the lack of proper \UNICODE\ fonts, with the exception of Cambria, +resulted in creating virtual \UNICODE\ math fonts on the fly using the virtual +font features of the \LUATEX. But when the \OPENTYPE\ math fonts came available +that kind of trickery was no longer needed (or at least less preferred). + +That is why we considered dropping the virtual math font mechanism from \LMTX. We +had already dropped \type {tx} (we can use Termes) and \type {px} (better use +Pagella) fonts as well as \TYPEONE\ based Latin Modern. Dropping the commercial +Math Times was a logical next step, also because it has never been tested. The +mixtures of Pagella and Euler were already replaced by using the upgraded tweak +mechanism. + +That left us with Antykwa, Iwona and Kurier, the fonts that the late Janusz +Nowacky vectorized and that came with plenty \OPENTYPE\ text fonts but also with +\TYPEONE\ math companions. And, as we like these fonts, it meant that we had to +come up with a solution. One option was to create proper \OPENTYPE\ math fonts, but +another was to strip down the virtual math font mechanism to just support these +fonts. There is some charm in keeping the \TYPEONE\ fonts, also because it is a +test case for (by now sort of obsolete) \TFM\ metric, \PFB\ outline, encoding and +map files, for which we have code embedded so having a proper test case makes +sense. + +In the end we opted for the second solution so this is what the next sections are +about: supporting \OPENTYPE\ math using \TYPEONE\ fonts. We admit that it took +way more time than a conversion to \OPENTYPE\ math fonts would have, but that is +partly due to the fact that these fonts, and especially Antykwa, have some +characteristic features that we wanted to use. So, in a sense it was also an +esthetics challenge. It also helped that the font was used in realistic and +moderately complex math rendering. We also note that rendering in \LMTX\ is +different (and hopefully better) than in \MKIV\ because we try to benefit from +the upgraded math engine in \LUAMETATEX. + +This exploration is dedicated to Janusz who was one of the characteristic +presenters of fonts at Bacho\TEX\ meetings, who contributed these fonts, and +who in some sense was thereby kick starting the Polish \TEX\ related font +projects. + +\stopsubject + +\startsubject[title=Virtual math] + +We keep this expose simple and only tell what we did, you can look at the \type +{lfg} files and source code to see what magick is done. For the standard Antykwa +we load \typ {LatinModern-Math} first, so we cover all symbols that matter. Next +we stepwise load \typ {rm-anttr.tfm}, \typ {mi-anttri.tfm}, \typ {mi-anttbi.tfm}, +\typ {rm-anttb.tfm}, \typ {sy-anttrz.tfm}, \typ {ex-anttr.tfm}. For each we +specify an encoding vector. Some are loaded multiple times with different +vectors. Because we don't like the slanted curly braces we even load \typ +{AntykwaTorunska-Regular} in order to get the upright ones. This method is not that +different from what we do in \MKIV. + +The specification of a loaded font also can contain a list of (named) characters +that should be ignored, That was one of the new features in the virtual +constructor. We take the math parameters from the fonts where these are +specified, here in the symbols and extension fonts. + +The fonts contain extra snippets of extensibles that one can use to construct +some of these vertical and horizontal stretched symbols on the fly in addition to +what the font metrics already define. Unfortunately some snippets are missing, +like the six pieces that could make up horizontal and vertical bars, for which we +now need to cheat. We considered making a companion font but for now we are in +\quote {as good as we can} emulation mode. + +\stopsubject + +\startsubject[title=The fonts] + +We start out with a skeleton font and in the past we used the \OPENTYPE\ text +font for that. On top of that we overlay a bunch of \TYPEONE\ fonts, and as was +common in those days, the \AMS\ math symbol fonts \type {msa} and \type {msb} +were overlayed last in order to fill in remaining gaps. However, now that we have +a Latin Modern \OPENTYPE\ math font it made more sense to use that as starting +point because it already has all these symbols. + +If we forget about the additional weights and condensed variants, the JMN math +collection has actually not that many fonts. One reason for that is that the +upright roman font, the ones that have an \type {r} near the end of the file +name, in traditional \TEX\ speak \type {rm}, have way more than 255 characters: +it not only has all kind of composed characters, it also has all the extensible +shapes. All is (as usual with \TYPEONE\ fonts) driven by encoding and mapping +files. Fortunately the glyphs names (that we use for filtering) are the same for +the three fonts but there are some more in Antykwa. + +\stopsubject + +\startsubject[title=Challenges] + +The real challenge was Antykwa. This is because it has a distinctive curvature at +the end of sticky parts (like rules and such). The \TEX\ machinery as well as +\OPENTYPE\ math assume rules being used in for instance radicals, fractions, +overbars, underbars and vertical bar fences. + +\startlinecorrection +\scale[width=\textwidth]{\switchtobodyfont[antykwa]\im { + \showglyphs + \mathbin{-} + \mathbin{+} + \mathbin{=} + \mathbin{<} + \mathbin{>} +}} +\stoplinecorrection + +The last three come in not only sizes (aka variants) but also can stretch (aka +extensible). And, them being just rules it is assumes that the \TEX\ engine deals +with that, and as it cannot really do that without characters, the traditional +approach is to use commands that use \TEX\ rules. However, in \CONTEXT\ (\MKIV\ +and \LMTX) we can provide the proper variants and extensible using virtual +shapes, and in \LMTX\ we can even scale as last resort. + +The first two are special. We already could support fractions using dedicated +characters because we played with the fraction builder using for instance arrows +as separator and these are not rules but characters. It was not that much work to +also make that possible for the rule in a radical. The main adaptation was that +we need to center the numerator and denominator of a fraction and the body of a +radical when the character used is wider than requested. + +\startlinecorrection +\scale[height=2cm]{\switchtobodyfont[antykwa]\im { + \showglyphs + \sqrt{x+1} - + \fenced[bar]{ + \frac{1}{x+1} + } +}} +\stoplinecorrection + +Because we have two font models in \CONTEXT, normal and compact, we had to be careful +in defining the virtual shapes and extensibles so that they work in both models. This +has to do with scaling and sharing. + +\stopsubject + +\startsubject[title=Implementation] + +The original virtual math font mechanism worked closely with the math fall back +features, but these have been replaced by tweaks, which means that we lost some +of that. Also, heuristics worked fine on the average but for Antykwa we wanted +more. Therefore some of the built in logic has been moved to the goodie file that +controls the composition. After all, we don't want to hard code specific +solutions in the core. + +Another addition was the use of so called setups bound to a font class so that we +can set up some math machinery features for e.g.\ Antykwa in the goodie file. We +need to bind to a class because we mix a dozen math fonts in one test file and +therefore we need to separate these setups. + +As in regular \OPENTYPE\ math support we ignore the italic correction and translate +it in combinations of proper width and specific kerning. That way we avoid all kind +of issues that we otherwise need to compensate for. + +Because we need to hook extensible characters into the machine for Antykwa its +font typescript file also defines a font class specific setup (of a few lines) to +be applied. This might evolve into a more granular mechanism but for now it works +fine and adds little overhead. + +\stopsubject + +\startsubject[title=Examples] + +We end by showing a few \quotation{real} examples. + +\bgroup\switchtobodyfont[antykwa] +\startformula +\binom{n}{k} = \frac{n!}{k!(n-k)!}\mtp{,} 0 \leq k \leq n\mtp{.} +\stopformula +\egroup + +The parentheses are unchanged, and we believe that using rotation symmetry +instead of mirror symmetry is a brave but interesting choice, and the new +fraction bar fits well with it. The fraction bar also fits well with the equal +sign. + +\bgroup +\switchtobodyfont[antykwa] +\startformula +1 + x + x^2 + \ldots + x^n = \frac{1 - x^{n+1}}{1 - x} +\stopformula +\egroup + +The new vertical bars go well with the brackets, the integral and the solidus. + +\bgroup +\switchtobodyfont[antykwa] +\startformula +\fenced[doublebar]{f}_p = \F3\left[ \int_0^1 \fenced[bar]{f(x)}^p \dd x \right]^{1/p} +\stopformula +\egroup + +The fancy fraction bar and the radical bar have made the arithmetic|-|geometric +mean inequality look more appealing than ever, hasn't it? + +\bgroup +\switchtobodyfont[antykwa] +\startformula + \frac{a_1 + a_2 + \ldots + a_n}{n} \geq \root[n=n]{a_1 a_2 \ldots a_n} +\stopformula +\egroup + +Primes are usually a bit of a challenge: + +\bgroup +\switchtobodyfont[antykwa] +\startformula +f(k+1)-f(k) \alignhere = f'(k)+f''(k)\frac{1}{2}+f'''(\xi_k)\frac{1}{6} + \breakhere = k^p+\frac{p}{2}k^{p-1}+\frac{p(p-1)}{6}\xi_k^{p-2} +\stopformula +\egroup + +And, as expected, multi|-|line formulas also look fine. + +\stopsubject + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-math.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-math.tex index 83aae8bcd4c..08fabc42661 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-math.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-math.tex @@ -1089,9 +1089,9 @@ specific classes at the edges. These options are a bitset and \type {1} means \egroup} \startcombination[nx=3] - {\showglyphs\TestSlack{$f^2 > $}} {} - {\showglyphs\TestSlack{$ > f^^2$}} {} - {\showglyphs\TestSlack{$f^2 > f^^2$}} {} + {\showglyphs\TestSlack{$f^2 > $}} {} + {\showglyphs\TestSlack{$ > f^^^2$}} {} + {\showglyphs\TestSlack{$f^2 > f^^^2$}} {} \stopcombination \stopbuffer @@ -1127,9 +1127,9 @@ example. \egroup} \startcombination[nx=3] - {\showglyphs\TestSlack{$f^2 > $}} {} - {\showglyphs\TestSlack{$ > f^^2$}} {} - {\showglyphs\TestSlack{$f^2 > f^^2$}} {} + {\showglyphs\TestSlack{$f^2 > $}} {} + {\showglyphs\TestSlack{$ > f^^^2$}} {} + {\showglyphs\TestSlack{$f^2 > f^^^2$}} {} \stopcombination \stopbuffer @@ -1992,7 +1992,7 @@ an example of usage: \setmathspacing \mathexperimentalcode \mathexperimentalcode \allmathstyles 20mu \setmathspacing \mathordinarycode \mathexperimentalcode \allmathstyles 20mu -$x^1_2^3_4^^5__6^^7__8$ +$x^1_2^3_4^^^5___6^^^7___8$ \stopbuffer \typebuffer @@ -2102,11 +2102,11 @@ habits. % example: % -% $ \left( x + 1 \right )^1_2^^3__4 $ +% $ \left( x + 1 \right )^1_2^^^3___4 $ % \blank -% $ ( x + 1 )^1_2^^3__4 $ +% $ ( x + 1 )^1_2^^^3___4 $ % \blank -% $ (^^3__4 x + 1 )^1_2 $ +% $ (^^^3___4 x + 1 )^1_2 $ % example: % diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-mathfonts.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-mathfonts.tex new file mode 100644 index 00000000000..98c861d7d6e --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-mathfonts.tex @@ -0,0 +1,1247 @@ +% language=us runpath=texruns:manuals/ontarget + +% musical timestamp: 2022/07/01 while listening to Hania Rani @ https://www.youtube.com/watch?v=sp3B97N67Cw + +% todo apply withprescripts -> to all components + +\usemodule[math-tweaks] + +\startcomponent ontarget-mathfonts + +\environment ontarget-style + +\startchapter[title={Dealing with math fonts}] + +\startsubject[title=Introduction] + +Here we will explain some of the tricks that we apply to math fonts so that they +not only work better with the \LUAMETATEX\ math engine but also look better, at +least in our opinion. We will not show specific fonts because after all, who can +complain about something that comes for free, but you can see whatever we do to +make it work in action in \CONTEXT\ where we setup these fonts. This is also a +summary of what Mikael Sundqvist and I have been doing for a while now: improve +the rendering of math, a rather enjoyable experience, also because we ran into +humorous effects with and properties of fonts. Because we consider ourselves free +from any conventions we could happily explore solution. + +\stopsubject + +\startsubject[title=Fences] + +\startMPdefinitions +path My_left_fence ; My_left_fence := (1,1) -- (0,1) -- (0,-1) -- (1,-1) ; +path My_right_fence ; My_right_fence := (0,1) -- (1,1) -- (1,-1) -- (0,-1) ; +path My_middle_fence ; My_middle_fence := (0,1) -- (0,-1) ; + +path My_right_fence_x ; My_right_fence_x := (0,1) -- (1, 1/2) -- (1,-1/2) -- (0,-1) ; + +path My_left_top ; My_left_top := (1, 1 ) -- (0, 1 ) -- (0, 1/2) ; +path My_left_middle ; My_left_middle := (0, 1/2) -- (0,-1/2) ; +path My_left_bottom ; My_left_bottom := (0,-1/2) -- (0,-1 ) -- (1,-1 ) ; + +path My_right_top ; My_right_top := (0, 1 ) -- (1, 1 ) -- (1, 1/2) ; +path My_right_middle ; My_right_middle := (1, 1/2) -- (1,-1/2) ; +path My_right_bottom ; My_right_bottom := (1,-1/2) -- (1,-1 ) -- (0,-1 ) ; + +path My_right_top_x ; My_right_top_x := (0, 1 ) -- (1, 1/2) ; +path My_right_middle_x ; My_right_middle_x := (1, 1/2) -- (1,-1/2) ; +path My_right_bottom_x ; My_right_bottom_x := (1,-1/2) -- (0,-1 ) ; + +path My_middle_top ; My_middle_top := (0, 1 ) -- (0, 1/2) ; +path My_middle_middle ; My_middle_middle := (0, 1/2) -- (0,-1/2) ; +path My_middle_bottom ; My_middle_bottom := (0,-1/2) -- (0,-1 ) ; + +path My_content ; My_content := fullcircle ; + +vardef My_Fenced (expr left, middle, right, size) = + image ( + draw My_left_fence xyscaled (1,left ) shifted (0,0) withcolor darkgray ; + draw My_content xyscaled (2,size ) shifted (3,0) withcolor darkblue ; + draw My_middle_fence xyscaled (1,middle) shifted (5,0) withcolor darkgray ; + draw My_content xyscaled (2,size ) shifted (7,0) withcolor darkblue ; + if left <> right : + draw My_right_fence_x xyscaled (1,right ) shifted (9,0) withcolor darkgray ; + else : + draw My_right_fence xyscaled (1,right ) shifted (9,0) withcolor darkgray ; + fi ; + ) +enddef ; + +vardef My_Extensibled (expr left, middle, right, size) = + image ( + draw My_left_top xyscaled (1,left ) shifted (0,0) withcolor darkgray ; + draw My_left_middle xyscaled (1,left ) shifted (0,0) withcolor darkgreen ; + draw My_left_bottom xyscaled (1,left ) shifted (0,0) withcolor darkgray ; + drawpoints My_left_middle xyscaled (1,left ) shifted (0,0) withpen pencircle scaled .4 withcolor white ; + drawpoints My_left_top xyscaled (1,left ) shifted (0,0) withpen pencircle scaled .2 withcolor red ; + drawpoints My_left_bottom xyscaled (1,left ) shifted (0,0) withpen pencircle scaled .2 withcolor red ; + draw My_content xyscaled (2,size ) shifted (3,0) withcolor darkblue ; + draw My_middle_top xyscaled (1,middle) shifted (5,0) withcolor darkgray ; + draw My_middle_middle xyscaled (1,middle) shifted (5,0) withcolor darkgreen ; + draw My_middle_bottom xyscaled (1,middle) shifted (5,0) withcolor darkgray ; + drawpoints My_middle_middle xyscaled (1,middle) shifted (5,0) withpen pencircle scaled .4 withcolor white ; + drawpoints My_middle_top xyscaled (1,middle) shifted (5,0) withpen pencircle scaled .2 withcolor red ; + drawpoints My_middle_bottom xyscaled (1,middle) shifted (5,0) withpen pencircle scaled .2 withcolor red ; + draw My_content xyscaled (2,size ) shifted (7,0) withcolor darkblue ; + if left <> right : + draw My_right_top xyscaled (1,right ) shifted (9,0) withcolor darkgray ; + draw My_right_middle xyscaled (1,right ) shifted (9,0) withcolor darkgreen ; + draw My_right_bottom xyscaled (1,right ) shifted (9,0) withcolor darkgray ; + drawpoints My_right_middle xyscaled (1,right ) shifted (9,0) withpen pencircle scaled .4 withcolor white ; + drawpoints My_right_top xyscaled (1,right ) shifted (9,0) withpen pencircle scaled .2 withcolor red ; + drawpoints My_right_bottom xyscaled (1,right ) shifted (9,0) withpen pencircle scaled .2 withcolor red ; + else : + draw My_right_top_x xyscaled (1,right ) shifted (9,0) withcolor darkgray ; + draw My_right_middle_x xyscaled (1,right ) shifted (9,0) withcolor darkgreen ; + draw My_right_bottom_x xyscaled (1,right ) shifted (9,0) withcolor darkgray ; + drawpoints My_right_middle_x xyscaled (1,right ) shifted (9,0) withpen pencircle scaled .4 withcolor white ; + drawpoints My_right_top_x xyscaled (1,right ) shifted (9,0) withpen pencircle scaled .2 withcolor red ; + drawpoints My_right_bottom_x xyscaled (1,right ) shifted (9,0) withpen pencircle scaled .2 withcolor red ; + fi ; + ) +enddef ; +\stopMPdefinitions + +Fences come in two variants: fixed sizes and so called extensibles that are +constructed from recipes that combine snippets that can partially overlap. Fenced +material has an optional symbol at the start, an optional one at the end and zero +or more symbols in the middle. Here we have all three: + +\startlinecorrection +\startMPcode + draw My_Fenced (2,2,2,2) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +Ideally these symbols scale in the same way, depending on the other context. This +means that \TEX\ first has to measure what sits in between but we will not dive +into that. The left and right symbols are normally pairs like parentheses or +braces, but any mix is possible. Ideally a font is designed with this in mind but +unfortunately we see this: + +\startlinecorrection +\startMPcode + draw My_Fenced (2,3,2,2) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +And even this: + +\startlinecorrection +\startMPcode + draw My_Fenced (2,3,2.5,2) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +It might be a side effect of the limited amount fo available slots in traditional +math fonts that also resulted in non consistent sets in \OPENTYPE\ follow|-|ups +and when one fonts does that more follow that approach. + +You can find rendering like this: + +\startlinecorrection +\startMPcode + draw My_Fenced (3,2,3,2) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +and this + +\startlinecorrection +\startMPcode + draw My_Fenced (2,2,2,6) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +because a programmable language like \TEX\ can use some tricks to force sizes: we +just create some local fence which dimension is determined by some invisible +rule. In \LUAMETATEX\ we can actually enforce dimensions and in \CONTEXT\ we can +filter specific sizes. + +So how does this sizing work? A fence character starts out with the normal size +but then a larger one is needed, the math engine will check if there is a larger +variant. An \OPENTYPE\ font can provide these and in the engine that works out as +following a linked list to a next size. When we run out of sizes there can be an +extension recipe present where a fence is made from snippets pasted together. +Normally that goes unnoticed because there is a little overlap between these +snippets. + +\startlinecorrection +\startMPcode + draw My_Extensibled (2,2,2,4) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +A larger fence will simply add more middle pieces, and it will not do as below: + +\startlinecorrection +\startMPcode + draw My_Extensibled (3,3,3,6) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +Because we're talking of a deliberate design you cannot simply scale snippets and +expect them to work out well visually. However, in a pure vertical case one +actually could and in practice all these extensibles have (of course) vertical +bars. Anyway, in the above example the larger middle piece actually is just +several middle pieces overlapping. + +However, as we mentioned, fonts are not always consistent. First of all, when we +run over the (increasing in size) variants we have discrete steps and you're +lucky if a font has more than half a dozen. As soon as we end up with the +extensible the size can be matched well. + +So how do we compensate for misbehavior? There are two parameters in \TEX\ then +determine the matching: \typ {\delimiterfactor} and \typ {\delimitershortfall}. +Plain \TEX\ set them to 901 and 5pt which works okay in most cases. In \CONTEXT\ +we set them to 1000 and 0pt and instead use the parameters \typ +{\UmathDelimiterPercent} and \typ {\UmathDelimiterShortfall} that are bound fo +fonts. In addition to that we use the \typ {nooverflow} keyword with \type +{\Umiddle} which makes sure that we always stay within the size of the outer +fences. That just looks better. + +In addition we can tweak the dimensions of glyphs and apply effects such as +expanding so that we get a bit more consistent visual appearance. We can also +signal that we should ignore sizes larger than a given index. + +The next sequence show what happens in practice when we tell \type {\Umiddle} to +never exceed the requested size. Because we start with stepwise sizes the first +part of this sequence has no matching sizes. At some point we end up at the +extensibles. + +\showmathmiddletweaks + +Its is worth noticing that we tried several alternative approaches. For instance +what happens when we only use extensibles? In that case there will be no fit for +the smaller ones because the at least two parts of an extensible can seldom +completely overlap that much. + +Actually, when we tested that we noticed that even in valid situations there can +be strange overlap. At that time for instance the Lucida fonts had overlapping +artifact in some curly braces which we found out when we tried to nil some of the +larger, odd looking, step variants. Latin modern and some of the gyre fonts had +unexpected jumps to larger sizes which made us decide to make the delimiter +parameters font specific so that we could more easily adapt them: they basically +became part of the math parameters of a font. + +There are also inconsistencies in the perceived widths of glyphs used: often the +bars are too thin. That can be solved by applying effects like scaling +horizontally or vertically and cheating a bit with the dimensions. Another +solution is that we ignore the variants after a certain size and force +extensibles sooner but that of course needs to be tested for unwanted overlaps +too. All these tricks combined make it possible to use math fonts with imperfect +fences more or less reliable. + +\startitemize[packed] +\startitem + Provide an equal amount of fixed size larger variants for all fences: assume + arbitrary pairing. +\stopitem +\startitem + Because fonts have plenty room, provide some ten variants before going + extensible. +\stopitem +\startitem + Try to make the variants and the extensibles similar in look. +\stopitem +\startitem + Ensure that the width of the vertical bar matches the design. +\stopitem +\startitem + Make sure that the odd entries in a extensible recipe don't overlap badly. +\stopitem +\stopitemize + +\stopsubject + +\startsubject[title=Accents] + +When traditional \TEX\ showed up it was not that common to have pre|-|composed +characters so when you needed something with an accept on top the way to go was +to typeset the base character and position the accent on top using either the +\type {\accent} primitive or some macro. It always was a compromise but +eventually fonts with more assembled characters showed up. In \OPENTYPE\ fonts +that operate in the \UNICODE\ domain we have even more characters but even there +characters can be composed. However, anchors that help achieving this are part of +the format. For text we use the mark features and for math we use the top anchor. +Given that, why do we need to tweak it? + +\startMPdefinitions +path My_top_accent ; My_top_accent := (-1/2,0) -- (0,1/4) -- (1/2,0) ; + +path My_content ; My_content := fulldiamond ; + +vardef My_Accent (expr shift, accent, size, slant) = + image ( + path p ; p := My_content + xyscaled (2,size) + slanted slant + ; + draw My_top_accent + xyscaled (1,accent) + shifted (0,2) + withcolor darkgray ; + draw p + withcolor darkblue ; + ) +enddef ; + +vardef My_Accent_X (expr shift, accent, size, slant, rotation) = + image ( + path p ; p := My_content rotated rotation + xyscaled (2,size) + slanted slant + ; + draw My_top_accent + xyscaled (1,accent) + shifted point 2 of p + shifted - (0,-1) + withcolor darkgray ; + draw p + withcolor darkblue ; + ) +enddef ; + +vardef My_Accent_Y (expr shift, accent, size, scale) = + image ( + path p ; p := My_content + xyscaled (2,size) + ; + draw My_top_accent xscaled scale + xyscaled (1,accent) + shifted (0,2) + withcolor darkgray ; + draw p + withcolor darkblue ; + ) +enddef ; + +vardef My_Accent_Z (expr shift, accent, size, scale) = + image ( + path p ; p := My_content + xyscaled (2,size) + ; + path q ; q := My_top_accent + xscaled scale + xyscaled (1,accent) + shifted (0,2) + ; + draw q + withcolor darkgray ; + draw p + withcolor darkblue ; + draw outerboundingbox q + withpen pencircle scaled 1/20 + withcolor darkred ; + draw outerboundingbox p + withpen pencircle scaled 1/20 + withcolor darkred ; + ) +enddef ; +\stopMPdefinitions + +Here we have a base character with an accent on top. The character is upright and +the accent gets positioned in the middle. + +\startlinecorrection +\startMPcode + draw My_Accent (2.5,1,2,0) scaled 5mm ; +\stopMPcode +\stoplinecorrection + +This doesn't work out well if we have a slanted or italic shape: + +\startlinecorrection +\startMPcode + draw My_Accent (2.5,1,2,.2) scaled 5mm ; + draw My_Accent (2.5,1,2,.4) scaled 5mm shifted (2cm,0) ; + draw My_Accent (2.5,1,2,.6) scaled 5mm shifted (4cm,0) ; +\stopMPcode +\stoplinecorrection + +So we need to compensate, for instance like this: + +\startlinecorrection +\startMPcode + draw My_Accent_X (2.5,1,2,.2,0) scaled 5mm ; + draw My_Accent_X (2.5,1,2,.4,0) scaled 5mm shifted (2cm,0) ; + draw My_Accent_X (2.5,1,2,.6,0) scaled 5mm shifted (4cm,0) ; +\stopMPcode +\stoplinecorrection + +However, what does determine the right anchor point? From this example you can +conclude that it is the top of the character. It is probably for that reason why +the semi automated construction of Latin Modern and the Gyre fonts have quite +some anchors that are rather bad: getting the anchors right is more a visual job +than something that can be automated. The topmost point is not really the best +one to focus on. + +\startlinecorrection +\startMPcode + draw My_Accent_X (2.5,1,2,.2,35) scaled 5mm ; + draw My_Accent_X (2.5,1,2,.4,35) scaled 5mm shifted (2cm,0) ; + draw My_Accent_X (2.5,1,2,.6,35) scaled 5mm shifted (4cm,0) ; +\stopMPcode +\stoplinecorrection + +Here the topmost position is very off center. In for instance Latin Modern that +means that on digits like~7 and~4 you get very weird anchoring. And this is why +we have a tweak that just wipes all the anchors from an alphabet: most alphabets +don't need them anyway and the engine will use the center when no anchor is +defined. Just for the record: in traditional \TEX\ engines the horizontal +position is determined by the kern between a so called skew character and the +base character. The font format has no anchor field but it has kerns, so this +trick makes much sense. + +We discussed vertical extensible that grow but horizontally we have accents that +can grow. There are also a few horizontal fences like braces that have +extensibles but we will cover that later. Accents are such that they only have a +fixed set of variants and one problem is that there are often not enough of them. +This means that the engine has to choose one that is reasonable. + +\startlinecorrection +\startMPcode + draw My_Accent_Y (2.5,1,2,1) scaled 5mm ; + draw My_Accent_Y (2.5,1,2,2) scaled 5mm shifted (2cm,0) ; + draw My_Accent_Y (2.5,1,2,2.5) scaled 5mm shifted (4cm,0) ; + draw My_Accent_Y (2.5,1,2,3) scaled 5mm shifted (6cm,0) ; +\stopMPcode +\stoplinecorrection + +In the example above the first two are acceptable but the third and fourth are +not. Just imagine that there is a superscript or subscript involved. Here we +apply another cheat: we lie about the dimensions. A glyph can have left and right +margins that get subtracted when the accent analyzer tries to make a fit which +means that we can sort of enforce the second solution. The \CONTEXT\ font goodie +files set the margins for some problematic characters because (of course) these +are not part of \OPENTYPE\ math fonts. This is an optical issue mostly because the +engine will not easily put a too wide one on top. + +\startlinecorrection +\startMPcode + draw My_Accent_Z (2.5,1.0,2,1) scaled 5mm ; + draw My_Accent_Z (2.5,1.5,2,2) scaled 5mm shifted ( 2cm,0) ; + draw My_Accent_Z (2.5,2.0,2,3) scaled 5mm shifted ( 4cm,0) ; +\stopMPcode +\stoplinecorrection + +Watch how the larger accents also have a larger bounding box. That is all right +but does interfere with a consistent makeup. The solution is simple: we use the +\CONTEXT\ dimension tweak to reposition accents and cheat with their height and +depth to make sure that we get consistent rendering. We need to tweak anyway +because sometimes accents have bad dimensions. The smallest one is actually a +text accent and therefore can have properties that are inconsistent with its +wider variants. This is typically a side effect of the fact that math accents and +text accents are not considered to be different. + +\startitemize[packed] +\startitem + Only add anchors to some (forward leaning!) italic shapes. +\stopitem +\startitem + Make extensibles as much a possible consistent with respect to dimensions. +\stopitem +\stopitemize + +\stopsubject + +\startsubject[title=Kerning] + +In a text font there are two mechanisms that influence the spacing between +individual characters: kerning and italic corrections. In \OPENTYPE\ text fonts +we have a more generalized relative positioning mechanism which can be seen as +kerning. The italic correction well known to \TEX\ users can be implemented as a +positional font feature but very seldom is. + +An \OPENTYPE\ math font has both kerning and italic correction. The kerning at +the left top, left bottom, right top and right bottom of a glyph can be specified +as a staircase and is used to position scripts. The italic correction is bit more +curious and is applied is some cases. Keep in mind that in math a sequence of +alphabetic characters does not make a word but represents a multiplication of +ordinary symbols and thereby specific inter|-|atom spacing rules apply. + +A traditional \TEX\ font has kerns and italic correction and an \OPENTYPE\ font has +staircase kerns and italic correction. For practical (space and time) reasons the +widths of italic shapes in traditional math fonts are such that when you add the +correction they kind of match the bounding box. + +So, one way to suit both kind of fonts is to add the italic correction (often +absent in \OPENTYPE\ glyphs but very present in traditional ones) as well as the +staircase kerns (present in \OPENTYPE\ fonts and unknown to traditional fonts). + +There are however some complications: what if a glyph has both? Which one is to +be preferred? Should we try our luck? Even worse: in the traditional the italic +correction is {\em always} added to the box that wraps a glyph but in some cases +that correction gets removed. \footnote {In \LUAMETATEX\ we never remove but +compensate so that we can track what happens.} But should we also remove a +staircase kern? When we started with \LUAMETATEX\ it was a bit of a gamble +because the specification only showed up later and improved over time. \footnote +{This is true for much of \OPENTYPE\ which has the danger that bugs and side +effects become features. Keep that in mind when you criticize solutions that +early adopters came up with!} + +In \LUATEX\ we often have to code paths. That was done after other attempts to +deal with this weak aspect of fonts worked for one font and not for the other. +For instance at the time of this writing some fonts have italic corrections for +upright characters! In \LUAMETATEX\ that model was changed into a detailed +control model at the font as well as engine level. Later, when Mikael and I went +over the fonts, usage of characters in math, atoms and spacing, we decided to +kick out that detailed control and use more general control mechanisms assuming +that we use \OPENTYPE\ fonts without bad italics. Whenever we had bad ones we +could correct that in a so called font goodie file. In other words: no heuristics +in the engine but fixed fonts. For that we always take Cambria as reference. + +{\em To be considered: should we finally turn italic correction into top and +bottom kerns? Basically: model after Cambria? Then we can kick out code! We just +assume font goodies.} + +\startMPdefinitions +vardef My_Character (expr shape, sx, sy, slant, left, right, side) = + image ( + path p ; p := shape + xyscaled (sx, sy) + slanted slant + ; + draw p + withcolor darkgray ; + draw (outerboundingbox p) leftenlarged side rightenlarged side + withpen pencircle scaled 1/20 + withcolor darkgreen ; + draw (outerboundingbox p) leftenlarged left rightenlarged right + withpen pencircle scaled 1/20 + withcolor darkred ; + ) +enddef ; + +vardef My_Character_K (expr shape, sx, sy, slant, left, right, lt, lb, rt, rb) = + image ( + path p ; p := shape + xyscaled (sx, sy) + slanted slant + ; + draw p + withcolor darkgray ; + draw (outerboundingbox p) leftenlarged left rightenlarged right + withpen pencircle scaled 1/20 + withcolor darkred ; + draw (ulcorner outerboundingbox p) shifted (lt,0) + withpen pencircle scaled 1/2 + withcolor darkgreen ; + draw (llcorner outerboundingbox p) shifted (lb,0) + withpen pencircle scaled 1/2 + withcolor darkgreen ; + draw (urcorner outerboundingbox p) shifted (rt,0) + withpen pencircle scaled 1/2 + withcolor darkgreen ; + draw (lrcorner outerboundingbox p) shifted (rb,0) + withpen pencircle scaled 1/2 + withcolor darkgreen ; + ) +enddef ; +\stopMPdefinitions + +\startlinecorrection +\startMPcode + draw My_Character (fulldiamond, 2, 4, 0, 1/4, 1/4, 0) scaled 5mm ; + draw My_Character (fullcircle, 2, 4, 0, 1/4, 1/4, 0) scaled 5mm shifted (3cm,0) ; + draw My_Character (fullsquare, 2, 4, 0, 1/4, 1/4, 0) scaled 5mm shifted (6cm,0) ; +\stopMPcode +\stoplinecorrection + +Here we have three shapes and as usual they have some space at the left and right. +A text font like Lucida is designed in such a way that no kerns between glyphs +are needed but most text fonts have kerns. These compensate for these average +acceptable side bearings. + +\startlinecorrection +\startMPcode + draw My_Character (fulldiamond, 2, 4, 0.3, 1/4, 1/4, 0) scaled 5mm ; + draw My_Character (fullcircle, 2, 4, 0.3, 1/4, 1/4, 0) scaled 5mm shifted (3cm,0) ; + draw My_Character (fullsquare, 2, 4, 0.3, 1/4, 1/4, 0) scaled 5mm shifted (6cm,0) ; +\stopMPcode +\stoplinecorrection + +In these slanted versions we get wider shapes but not always. For some shapes the +amount of perceived spacing at the left top and right bottom increases and this is +where we start thinking in terms of italic correction: + +\startlinecorrection +\startMPcode + draw My_Character (fulldiamond, 2, 4, 0.3, 1/4, 1/4, 0 ) scaled 5mm ; + draw My_Character (fullcircle, 2, 4, 0.3, 1/4, 1/4, 0 ) scaled 5mm shifted (3cm,0) ; + draw My_Character (fullsquare, 2, 4, 0.3, 1/4, -1/2, 1/4) scaled 5mm shifted (6cm,0) ; + draw My_Character (fullsquare, 2, 4, 0.3, -1/2, -1/2, 1/4) scaled 5mm shifted (9cm,0) ; +\stopMPcode +\stoplinecorrection + +That way, when we put characters next to each other on the average words look +better. But how about math: a superscript should be outside that bounding box and +a subscript inside, assuming that we have a shape like this. It is unfortunate +that the widely used $f$ is the perfect candidate. When using that one as test +case things can look great but kick in a $g$ and it gets worse. The $v$ and $w$ +are also a fertile playground. It is hard to come up with logic that satisfied +all which is why glyph specific engine control was implemented (and later +dropped). In the previous graphic the fourth shape also cheats on the left and +yes, there are some fonts that do just that, which the of course interferes with +prescripts. + +Now think of using shapes in formulas: some are put in sequence, in which case +inter atom spacing is added so there is less danger of touching due to too a +narrow width and \TEX ies somehow accepted that adding thin spaces every now and +then is fine \footnote {We don't think so which is why we came up with a more +granular inter atom spacing mode.} But there's more than sequences: shapes end up +in scripts, as degrees in radicals, above and below fraction rules, as fences and +accents. Just assume the worst possible scenarios! + +In these examples the italic correction at the right is the difference between +the red and green box. There is no left italic correction and that is why \OPENTYPE\ +math (driven by Cambria) has these four sets of kerns. + +\startlinecorrection +\startMPcode + draw My_Character_K (fulldiamond, 2, 4, 0.3, 1/4, 1/4, 1/4, -1/4, 1/2, -1/4) scaled 5mm ; + draw My_Character_K (fullcircle, 2, 4, 0.3, 1/4, 1/4, 1/8, 0, 0, -1/8) scaled 5mm shifted (3cm,0) ; + draw My_Character_K (fullsquare, 2, 4, 0.3, 1/4, 1/4, 1/8, -1/2, 1/2, -1/8) scaled 5mm shifted (6cm,0) ; +\stopMPcode +\stoplinecorrection + +Here we show some possibilities for better anchoring but it will be clear that it +is a compromise. Staircase kerns as in \OPENTYPE\ therefore have a set of kerns +going up or down for not only the base character but also the one that ends up in +a script as that one itself can have a \quote {problematic} shape. + +Our solution to this problem is to tweak dimensions and italic correction of +problematic characters. We also can add four kerns that roughly compensate for +tricky corrections needed. We therefore have more glyph properties than the +official \OPENTYPE\ specification provides (cheaper and easier than staircase +kerns that work on pairs of characters) . But we have more font parameters +anyway, and with \TEX\ being one of the main math renderers and \TEX ies always +being to tune and tweak we think this is okay. It is better to have more control +than to rely on (hard to fight) heuristics. + +We're stuck with the fonts we have and (in the case of \TEX\ fonts) the chosen +traditional approach of dimensions and italic corrections (no staircase kerns) but +the least we can ask is: + +\startitemize[packed] + \startitem + Be consistent in dimensions and italic corrections. Get rid of limitations + imposed by the 8 bit font era: we have plenty slots available and some more + glyph properties as well. And if you compromise: make that clear. + \stopitem + \startitem + Don't just take the old properties but assume that \OPENTYPE\ math fonts + are used in a modern \OPENTYPE\ \TEX\ engine. + \stopitem + \startitem + Assume that any character is used in any combination: that is what made it + hard to satisfy all needs at the engine end. Better play safe. + \stopitem +\stopitemize + +\stopsubject + +\startsubject[title=Scripts and primes] + +We start with showing a few shapes (in \TEX\ speak: nuclei) with a different +perceived spacing and with some items attached to the corners: scripts. + +\startMPdefinitions +vardef My_Character_P (expr shape, sx, sy, slant, left, right, prime, index) = + image ( + path p ; p := shape + xyscaled (sx, sy) + slanted slant + ; + draw p + withcolor darkgray ; + draw (outerboundingbox p) leftenlarged left rightenlarged right + withpen pencircle scaled 1/20 + withcolor darkred ; + draw (fullsquare shifted (ulcorner outerboundingbox p)) shifted (-1,0) + withpen pencircle scaled 1/5 + withcolor darkgreen ; + draw (fullsquare shifted (llcorner outerboundingbox p)) shifted (-1,0) + withpen pencircle scaled 1/5 + withcolor darkgreen ; + if prime: + draw (fullsquare xyscaled(1/2,1) shifted (urcorner outerboundingbox p)) shifted (.75,1/2) + withpen pencircle scaled 1/5 + withcolor darkblue ; + draw (fullsquare shifted (urcorner outerboundingbox p)) shifted (1.75,0) + withpen pencircle scaled 1/5 + withcolor darkgreen ; + else : + draw (fullsquare shifted (urcorner outerboundingbox p)) shifted ( 1,0) + withpen pencircle scaled 1/5 + withcolor darkgreen ; + fi + if index: + draw (fullsquare shifted (lrcorner outerboundingbox p)) shifted (if prime: 3 else : 2 fi,0) + withpen pencircle scaled 1/5 + withcolor darkyellow ; + else : + draw (fullsquare shifted (lrcorner outerboundingbox p)) shifted ( 1,0) + withpen pencircle scaled 1/5 + withcolor darkgreen ; + fi ; + ) +enddef ; +\stopMPdefinitions + +\startlinecorrection +\startMPcode + draw My_Character_P (fulldiamond, 2, 4, 0, 1/4, 1/4, false, false) scaled 5mm ; + draw My_Character_P (fullcircle, 2, 4, 0, 1/4, 1/4, false, false) scaled 5mm shifted ( 5cm,0) ; + draw My_Character_P (fullsquare, 2, 4, 0, 1/4, 1/4, false, false) scaled 5mm shifted (10cm,0) ; +\stopMPcode +\stoplinecorrection + +The green ones represent the super- and sub-, pre- and postscripts. According to what we +discussed previously the anchoring depends on the shape + +\startlinecorrection +\startMPcode + draw My_Character_P (fulldiamond, 2, 4, .3, 1/4, 1/4, false, false) scaled 5mm ; + draw My_Character_P (fullcircle, 2, 4, .3, 1/4, 1/4, false, false) scaled 5mm shifted ( 5cm,0) ; + draw My_Character_P (fullsquare, 2, 4, .3, 1/4, 1/4, false, false) scaled 5mm shifted (10cm,0) ; +\stopMPcode +\stoplinecorrection + +But we will not take that into account here because this time we focus on support +for primes and indices. A prime normally is a narrow character that is positioned +after the nuclues and sits in a similar position as a superscript. When it is +present a subscript doesn't move. Here the blue rectangle represents the prime. + +\startlinecorrection +\startMPcode + draw My_Character_P (fulldiamond, 2, 4, 0, 1/4, 1/4, true, false) scaled 5mm ; + draw My_Character_P (fullcircle, 2, 4, 0, 1/4, 1/4, true, false) scaled 5mm shifted ( 5cm,0) ; + draw My_Character_P (fullsquare, 2, 4, 0, 1/4, 1/4, true, false) scaled 5mm shifted (10cm,0) ; +\stopMPcode +\stoplinecorrection + +An index, here yellow, is a subscript that applies to the whole so that one does +move. We cannot have a subscript and an index at the same time. The prescripts +are not affected by primes and indices other than that the engine has to do more +work in getting it right. + +\startlinecorrection +\startMPcode + draw My_Character_P (fulldiamond, 2, 4, 0, 1/4, 1/4, false, true) scaled 5mm ; + draw My_Character_P (fullcircle, 2, 4, 0, 1/4, 1/4, false, true) scaled 5mm shifted ( 5cm,0) ; + draw My_Character_P (fullsquare, 2, 4, 0, 1/4, 1/4, false, true) scaled 5mm shifted (10cm,0) ; +\stopMPcode +\stoplinecorrection + +Of course we can have primes and indices at the same time. A prime actually belongs to the +nuclues so that combination determines quite a bit of the vertical and horizontal spacing. + +\startlinecorrection +\startMPcode + draw My_Character_P (fulldiamond, 2, 4, 0, 1/4, 1/4, true, true) scaled 5mm ; + draw My_Character_P (fullcircle, 2, 4, 0, 1/4, 1/4, true, true) scaled 5mm shifted ( 5cm,0) ; + draw My_Character_P (fullsquare, 2, 4, 0, 1/4, 1/4, true, true) scaled 5mm shifted (10cm,0) ; +\stopMPcode +\stoplinecorrection + +The problem with primes is that they were never part of the concept and +\OPENTYPE\ math inherited that. Thanks to \UNICODE\ (and the math community not +being convincing enough) we ended up with a prime being equivalent to minutes and +double primes being minutes. The fact that we have triple and quadruple primes as +well as reverse primes is a consequence of not having symbols for sub second +indicators. And even the seconds are overloaded by meaning: time related and +geographical. + +What has this to do with primes? Well, it means that a font has a prime character +that is already positioned at a certain distance from the baseline. But in most +math fonts the script and scriptscript sizes aren't. It looks as if the +assumption is that primes are treated like superscripts. But which one then gets +superscripted at the text level? The text one or the script one? Unfortunately +fonts are somewhat inconsistent in the sizing and positioning of primes and the +math community not being convincing enough. It was a tough decision to make: in +some fonts using the text prime have nice output and in other fonts the script +one. + +So, because in the traditional approach primes had to be manually positioned, be +able deal with super and subscripts the old school approach was to make them +active characters and pick up what follows in order to deal with this situation. +It probably is the main reason why we have a somewhat special active character +mechanism in math mode. In \CONTEXT\ \MKIV\ we followed a different approach, +also because we wanted to deal with collapsing multiple primes to their rightful +\UNICODE\ slot. + +In \LMTX\ and \LUAMETATEX\ we (need to) go a step further because we want proper +inter|-|atom space as well as more fine tuned positioning. Primes became elements +bound to a nucleus! We also wanted to solve this issue once and for all (in +\MKIV\ we has several methods but in \LMTX\ we only have one left). We not only +added a native prime element to nuclei but also introduced font parameters +similar to those of superscripts. Just keep in mind that in \LUAMETATEX\ we don't +need to worry about having a few more fields in a math node. There are not that +many nodes involved and the amount of extra memory used can be neglected. Of +course there is plenty of code added to deal with it so the binary definitely is +larger due to it and the code way more complex. In fact we already introduced +some missing parameters for the spacing related to prescripts. Furthermore we can +tune the prime spacing relative to the scripts. + +In the goodie files you can add fixes that relate to primes and most of them +involved quite a bit of experimental. We can safely say that we spent quite some +prime time on this issue. + +\startitemize[packed] +\startitem + It would be nice if fonts at least has prime shapes that are consistent + because currently script one can look quite different (tilt and shape). +\stopitem +\startitem + Because primes are also minutes and seconds we probably have to accept the + current situation and deal with it in the goodie files forever. +\stopitem +\stopitemize + +\stopsubject + +% Yet another section, this time I got in the mood after listening to Cindy +% Blackman Santana’s "Give The Drummer Some" ... here we go: + +\startsubject[title=Two choices] + +Imagine a situation like this: a sequence of characters with a leading left fence +but nothing at the right. The fence is not really a fence but something that can +grow and have its own super and subscripts, either after it or on top and below. +We leave these scripts (aka limits) out of the discussion. + +\startMPdefinitions +vardef My_Character (expr shape, sx, sy, c) = + image ( + draw + shape xyscaled (sx, sy) + withcolor c ; + ) +enddef ; +\stopMPdefinitions + +\startlinecorrection +\startMPcode + draw My_Character (fulldiamond, 2, 4, darkblue) scaled 5mm ; + for i = 1 upto 5 : + draw My_Character (fullcircle, 2, 2 randomized 1, darkgray ) scaled 5mm shifted (i * 2cm,0) ; + endfor ; +\stopMPcode +\stoplinecorrection + +There is a visual aspect here, which can be illustrated from a variant: + +\startlinecorrection +\startMPcode + draw My_Character (fulldiamond, 2, 4, darkblue) scaled 5mm ; + for i = 1 upto 3 : + draw My_Character (fullcircle, 2, 2 randomized 1, darkgray ) scaled 5mm shifted (i * 2cm,0) ; + endfor ; + draw My_Character (fulldiamond, 2, 6, darkblue) scaled 5mm shifted (9cm,0) ; + for i = 1 upto 3 : + draw My_Character (fullcircle, 2, 3 randomized 1, darkgray ) scaled 5mm shifted (9cm + i * 2cm,0) ; + endfor ; +\stopMPcode +\stoplinecorrection + +One can argue that the larger characters in the second sequence rightfully trigger a larger +blue variant. But for consistency one might actually go for: + +\startlinecorrection +\startMPcode + draw My_Character (fulldiamond, 2, 6, darkblue) scaled 5mm ; + for i = 1 upto 3 : + draw My_Character (fullcircle, 2, 2 randomized 1, darkgray ) scaled 5mm shifted (i * 2cm,0) ; + endfor ; + draw My_Character (fulldiamond, 2, 6, darkblue) scaled 5mm shifted (9cm,0) ; + for i = 1 upto 3 : + draw My_Character (fullcircle, 2, 3 randomized 1, darkgray ) scaled 5mm shifted (9cm + i * 2cm,0) ; + endfor ; +\stopMPcode +\stoplinecorrection + +Now imagine that you only have two choices? When do you go for the larger one? +This situation occurs with so called large operators like integrals and +summations. The original \TEX\ fonts have two sizes of these characters. The +smaller one is used in normal (text) math and the larger one in display math. + +But what if, as in \OPENTYPE\ fonts there are more? There is a font parameter \typ +{DisplayOperatorMinHeight} that tells what size to use (as a minimum) in display +mode. Because the \TEX\ engines never had to make a decision the value of that +variable in the Latin Modern and Gyre fonts is somewhat arbitrary. It is one of +the variables that we need to adapt in the goodie files: we roughly bump from +1300 to 1800 to get what we are accustomed to in display mode. + +So what are these large operators anyway? In traditional \TEX\ they are just +that: larger variants of smaller ones. In \OPENTYPE\ math however, they are +extensibles. That means that when there are more variants and an extensible +recipe it can grow on demand. That conflicts with the expectations of two sizes. + +In order to support these two conflicting demands \LUAMETATEX\ provides so called +left operators that either act upon their own, in which case we talk of \quote +{auto} mode, or they can be told to have a specific size, or they can adapt, in +which case they have the usual bogus right companion that ends the subformula. +And, because they are implemented as fences but are not really fences there are +some provisions for the scripts: they bind to the left fence and not the right +one. + +As side note: when we were experimenting with the usage of these (new) mechanisms +we again ran into the race condition that is imposed by the algorithm that +determines the size of fences: the delimiters target height is either a fraction +of the total height of the sublist or the total height diminished by some +constant amount. In \LUAMETATEX\ we therefore added the already discussed \typ +{\UmathDelimiterPercent} and \typ {\UmathDelimiterShortfall} but these only kick +in when we have a wrapped integral or such. + +\startitemize[packed] +\startitem + We can't be too picky but it would be nice if fonts have \typ + {DisplayOperatorMinHeight} set to a more reasonable value. We have to tweak + most font for this now (and probably forever). +\stopitem +\stopitemize + +\stopsubject + +\startsubject[title=To the point] + +A nice feature of math fonts is that they have so called extensible characters. Fences +can grow vertically and accents horizontally. When we run out of discrete steps in size, +we end up with a recipe that build large characters from snippets as we discussed before. + +The limitations in the size of fonts and the fact that the engine also had to +impose some limits in the amount of used fonts and complexity of their usage made +for some exceptions to the rule and, no pun intended, it might be why \TEX\ has a +concept of rules. Lines over and under something, arrows, fractions and radicals +all use rules. It is interesting to notice that when \OPENTYPE\ fonts showed up +the converted \TEX\ fonts didn't make arrows and bars use the extension +mechanism, thereby forcing the old school construction of them. This doesn't hurt +\CONTEXT\ much because we can implement proper characters using the virtual +character mechanism and we did things different anyway (for instance we can kick +in \METAFUN\ replacements). + +Nevertheless there is this curious in|-|between: radical. It comes in a set of +fixed sized often sloped characters and then switches to an upright one. In all +cases there is that horizontal rule attached that covers the nucleus. There is no +mix of horizontal and vertical extensibles so there is no fancy end of rule +thingie possible (the little hook that we learned to draw at school): it's just a +stupid rule. + +\startlinecorrection +\startMPcode + for i = 1 upto 5 : + draw image ( + draw fullsquare xyscaled(2, 4+i) + withcolor darkblue ; + fill fullsquare xyscaled(1/2, 1/2+i) + shifted (1,2) + withcolor darkblue ; + draw fullsquare xyscaled(1, 1) + shifted (1+i/100,2+i/2+i/100) + withcolor darkgray ; + ) scaled 5mm shifted (i*2cm, 0) ; + endfor ; +\stopMPcode +\stoplinecorrection + +Instead of a rule, these examples show a simple rectangle attached to another +one. The idea is that the center of that small one snaps onto the upper right +corner of the large one. In these examples we show how it looks when that is not +exact. At small sizes it goes unnoticed but at larger ones it becomes visible. +Actually, when you start scaling up math you often see artifacts in shapes, which +makes one wonder if high resolution screens are really used for proofing. + +\startlinecorrection +\startMPcode + for i = 1 upto 5 : + draw image ( + draw fullsquare xyscaled(2, 4+i) + withcolor darkblue ; + draw fullsquare xyscaled(1, 1) + shifted (1+i/100,2+i/2+i/100) + withcolor darkgray ; + ) scaled 5mm shifted (i*2cm, 0) ; + endfor ; +\stopMPcode +\stoplinecorrection + +In the first example the effect is small because we make sure that the right top +corner is square but in the second one we don't do that. Now it really becomes +annoying, even if we remove the small errors in positioning. + +\startlinecorrection +\startMPcode + for i = 1 upto 5 : + draw image ( + draw fullsquare xyscaled(2, 4+i) + withcolor darkblue ; + draw fullsquare xyscaled(1, 1) + shifted (1,2+i/2) + withcolor darkgray ; + ) scaled 5mm shifted (i*2cm, 0) ; + endfor ; +\stopMPcode +\stoplinecorrection + +We have seen different effects. The most common was an inaccurate font dimension +that determines what the height of the rule is. That we can fix in the goodie +file and we do that. Other artifacts were (in the stepwise sizes) characters that +were so sloped that there was not possibility for properly attaching the rule (we +noticed this best when checking the Lucida and Latin Modern fonts): one can cheat +and move a little to the left but the thickness of the sloped line was not enough +for that, so it could qualify as a design error but a design cannot simply be +changed in such case: one has to compromise and assume no scaling (keep in mind +that we scale on screen while on print one has to take a magnifying glass and +reading math that way is not much fun). + +Some of these extensible radicals have rather thin vertical lines but we can +assume that their height is never such that this becomes too annoying. One +complication in designing these shapes is that when one uses a font creator +program it is unlikely to provide a math composer for testing. The same is true +for overlapping the end glyphs of e.g.\ curly braces: the middle piece can get +into the way when we have the smallest extensible and have that one kick in too +soon due to the lack of stepwise sizes. It's hard to check that without an engine +applying them to the extreme cases. + +\startitemize[packed] +\startitem + Benefit from your high resolution screen and zoom in on the results. Take no + risk. +\stopitem +\startitem + Play safe and create an top right corner that has some overlap and already + starts out horizontally. +\stopitem +\startitem + If the design complicates rule attachments, move to an extensible sooner + because that one can have a horizontal attachment point as part of the + design. +\stopitem +\stopitemize + +\startsubject[title=Removing slack] + +In the process of optimizing the spacing we ran into several cases where a bit of +spacing was added that eventually made that the resulting formula had small quite +visible whitespace at the edges. Take for instance the little bit of kerning +between a nuclues and a superscript. + +\startlinecorrection +\startMPcode + draw image ( + draw fullsquare xyscaled(2, 4) + withcolor darkblue ; + draw fullsquare xyscaled(1/2, 1) + shifted (2-1/4,-1.5) + withcolor darkred ; + draw fullsquare xyscaled(1, 1) + shifted (3,2) + withcolor darkgray ; + ) scaled 5mm shifted (2cm, 0) ; +\stopMPcode +\stoplinecorrection + +Normally one can predict this situation but when components are glued together +that are typeset independently the (in this case red) spacing remains. The engine +is capable to remove that kind of slack at the left and right of the formula so +that one gets a proper tight bounding box. There is a bit more logic on board now. + +The fact that all kind of spacing gets added is one of the reasons for the more +granular inter atom spacing: that way we could remove for instance the spacing +added to the left and right of fractions (which is buried in the constructed +box). + +\startitemize[packed] +\startitem + There is not much we can advice here because it doesn't relate to fonts. + However, given that Lucida text fonts have no kerning could make one wonder + to what extend math fonts needs all these compensations. +\stopitem +\startitem + Some of the inter atom|/|script kerning is probably there as safeguard for + italic shapes where staircase kerns are lacking. The question then is how the + related font parameters themselves relate to staircase kerns. We suppose that + this puts some stress on the font designer. +\stopitem +\stopitemize + +\stopsubject + +\page + +\startsubject[title=Initializing fonts] + +\startsubsubject[title=introduction] + +When a math font is initialized there are (as with any font) features applies. +The only official one is the {ssty} feature that defines the substitution sets +for script and scripscript size. In traditional \TEX\ one has to set up multiple +fonts because one can only have 256 characters and because one might want to map +alphabets on the regular \ASCII\ slots. In an \OPENTYPE\ font all these alphabets +are on the same font so basically one can do with three instances per size: text, +script and scriptscript. What actually is done depends on the philosophy of the +macro package but we will not discuss that here. So let's assume three instances +in the default case. In \LUAMETATEX\ we can scale on the fly and therefore we can +stick to one instance: as long as we know what the slots of the (optionally +provided) smaller sizes are. Supporting this had quite some consequences for the +engine as scaling happens all over the place (also think of font parameters) and +we're talking two independent dimensions here: horizontal and vertical sizing. + +In addition to this size related font feature \CONTEXT\ provide some additional +ones (and always had). Some are set up as regular features and some are driven by +the font goodie features which organizes a lot of features under one umbrella. +Font goodies always have been part of \MKIV\ and \LMTX. + +{\em also mention the non tweak related ones} + +\stopsubsubject + +\startsubsubject[title=wipeitalics] + +This tweak wipes the italics from one or more characters, most noticeable upright +characters. Because locating the individual characters took too much time, we +added the option complete alphabets. + +\starttyping +example +\stoptyping + +\stopsubsubject + +\startsubsubject[title=wipeanchors] + +This tweak removes the top anchors from one or more characters, most noticeable +upright characters. As with wiping italics, we often wipe complete alphabets. + +\starttyping +example +\stoptyping + +\stopsubsubject + +\startsubsubject[title=accentdimensions] + +Configure the position of overbar, underbar, overbrace, underbrace, overparent, +underparent, overbracket and underbracket. More? Added 220307. + +\stopsubsubject + +\startsubsubject[title=addrules] + +I think we did not get overbars for some fonts (kpfonts and erewhon come to +mind). + +\stopsubsubject + +\startsubsubject[title=addscripts] + +Maybe something done for Ton? (\typ{math-act}) + +\stopsubsubject + +\startsubsubject[title=checkspacing] + +I don't know how it works. Seems there is not really any settings. But you once +wrote + +\starttyping +$\liminf$ \quad +$\limsup$ \quad [\sixperemspace] \quad +$x\sixperemspace x$ + +\setbox0\hbox{$x\sixperemspace x$} \showbox0 +\stoptyping + +in an email (220118). + +\stopsubsubject + +\startsubsubject[title=dimensions] + +We use this to change anchor points of accents, to raise/lower them, and of +course to change bounding boxes and italic correction for many letters/symbols. +We use it in bonum to resize the whole lower case fraktur alphabet (and maybe +more should be added) + +\stopsubsubject + +\startsubsubject[title=fixprimes] + +Maybe explained elsewhere? But it could belong here. + +\stopsubsubject + +\startsubsubject[title=fixradicals] + +I don't know what it does. Could be: In some fonts the radicals are just +positioned wrongly, and this moves them up/down to have something uniform to work +with. (\typ{math-act}) + +\stopsubsubject + +\startsubsubject[title=kerns] + +A bit like staircase kerning. The \quote{topleft} and \quote{bottomright} come in +handy, in particular the last one when it comes to the position of subscripts. + +\stopsubsubject + +\startsubsubject[title=margins] + +We fake the width of some characters. Useful, for example, not to get too +large/too small accents when using \tex{widehat} (also to get a uniform size over +some alphabets or glyphs that often go togeter). + +\stopsubsubject + +\startsubsubject[title=variants] + +Some fonts (lucida, xits, stixtwo) have calligraphic (chancery) and script +(roundhand) alphabets. Of course not the same as default, and of course not the +same ss0X. + +\stopsubsubject + +\startsubsubject[title=wipecues] + +Only added to cambria and dejavu. Added 220327. I think it has to do with +characters like 2061, 2062 and 2063. From the mails I think it has why does 2061 +render a shape in some fonts so we need an 'wipe char' tweak (basically making it +a zero dimensions symbol) + +\starttyping +\mathspacingmode2 +\showmakeup[mathglue] +$ \sin \Uchar"2061 (y) $ \quad +$ x \Uchar"2062 y $ \quad +$ x \Uchar"2063 y $ \par +$ \sin \mathghost{\Uchar"2061} (y) $ \quad +$ x \mathghost{\Uchar"2062} y $ \quad +$ x \mathghost{\Uchar"2063} y $ \par +\stoptyping + +\stopsubsubject + +\startsubsubject[title=bigslots] + +Fences are chosen automatically to match what they surround. However, in traditional +engines a fenced sub formula won't break across lines. In \CONTEXT\ we have sveral st + +1, 3, 5, 7 that could fit here, if we find a font where the linking is not +present. + +\stopsubsubject + +\startsubsubject[title=parameters] + +I don't know if all of them are parameters that typically moved from document to +font level. + +\stopsubsubject + +\stopsubject + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic-pgc.pdf b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic-pgc.pdf new file mode 100644 index 00000000000..77e20c6fb79 Binary files /dev/null and b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic-pgc.pdf differ diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic.tex new file mode 100644 index 00000000000..26b646625dc --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-nostalgic.tex @@ -0,0 +1,268 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-nostalgic + +\environment ontarget-style + +\startchapter[title={Getting nostalgic}] + +When Mikael and I were playing with \POTRACE\ we eventually ended up by turning +some old rune font defined in \METAFONT\ into a quite useable outline font. In +the process we went from a \TYPETHREE\ to a proper \OPENTYPE\ (\CFF) instance. +When doing this I remembered that in the times of active \PDFTEX\ development, +Thanh, Taco and I played with what we called \PDF\ glyph containers. I had done +experiments with using xforms (small images) as replacement for bitmap characters +but that is not what we want with fonts, so after discussing it with Thanh +\TYPETHREE\ support was extended with a user driven variant. Due to the way +\METAFONT s are defined the results were mixed. Filled shapes could be made to +work but outlines often looked bad and much had to do with the fact that these +fonts were never defined with odd-even rules in mind. So, Taco made a bitmap to +outline program that we could hook in and in the end we had a reasonable +workflow. We're talking of the period 1997 to 1998, some 25 years ago! + +So, when in 2023 we came back to bitmap fonts in the perspective of \LUAMETATEX, +some memories returned but I couldn't find the files or code at that time, which +might relate to the fact that I always start from specifications. However, when +in January 2024 I had to fix some issue with embedding an old \TYPEONE\ font and +after succeeding in that I decided again to search for that old code. This time I +just grep'd the \PDFTEX\ code base (as I had the \TEXLIVE\ git checkout) and I +found back this feature. In the end I had been looking at the wrong \quote +{strings} because it looked like the interface evolved a little. + +The basics are as follows. When we have a file (in \PDFTEX) the \TFM\ blob is +what matters for the frontend. The backend that does the inclusion links that to +a suitable font resource, most likely in \TYPEONE\ format. This is specified in a +map file that also permits specifying an encoding vector. For some reason it is +not possible to map to other font formats other than \TYPEONE\ and \TRUETYPE. No +mapping means that a \PK\ file is used and then we end up in some complicated +semi automatic bitmap generation. + +When I tested how these containers worked out nowadays, once \PDFTEX \footnote +{Version 3.141592653-2.6-1.40.25 and older.} is happy to include a font it will +bark about a missing font resource: it always wants a bitmap. Now, you can +complain about this but I bet no one ever used this 25 year old feature so no one +ever requested a check for a \type {pgc} file. Basically, when such a file is +found instead of a \type{600pk} file, all should be fine, even if that is a zero +length file. Given that the backend actually checks for it and not considers a +container file useable, one can consider it an oversight, or maybe it just got +lost in the \KPSE\ library that manages \PK\ fonts and its generation. + +Anyway, so how does it work? When the backend checks for a glyph container it +expects this: + +\starttyping +\pdffontscale factor +\pdfglyph slot width height depth llx lly urx ury = + % pdf operators +\endglyph +\stoptyping + +One can add a \type {\pdffont} and \type{\endfont} wrapper because \PDFTEX\ only +searches for the mandate scale and one or more glyphs. A simple test then becomes: + +\startitemize[packed] +\startitem + Copy a \TFM\ file to a new name, say \type {cmr10mine.tfm}. +\stopitem +\startitem + Create a bogus \PK\ file, for instance a zero byte \type {cmr10mine.600pk}. +\stopitem +\startitem + Make sure it can be found, I had to set \type {set MISCFONTS=.}. +\stopitem +\startitem + Create a glyph container with suffix \type {pgc} with some valid \PDF\ code. +\stopitem +\stopitemize + +And then use a safe character for testing present in most fonts at the same +position in the used encoding: + +\starttyping +\starttext + \font\test=cmr10mine \test \char 65 % A +\stoptext +\stoptyping + +This should produce something, assuming an entry like: + +\starttyping +\pdffontscale 0.01 +\pdfglyph 65 200 0 0 0 0 200 200 = + 10 M 1 j 1 J 5 w + % outlines + h S +\endglyph +\stoptyping + +Just for completeness, I could find a \PERL\ program on my disk that I wrote at +that time and that has the banner: + +\starttyping +mptopgc 1.01 - pdfTeX / HH 1998 +\stoptyping + +It produces help like: + +\starttyping + --silent use logfile instead of screen (no) + --autorun run MetaPost first (no) + --optimize convert gray into eofill (no) + --ignore ignore gray path (no) + --gray permit the gray operator (no) + --merge substitute gray using glyphs (no) +--magnification set MetaPost mag factor (1) + --rounding alternative rounding offset (0) + --pgcpath pgc path + --tfmpath tfm file path + --tfmtopl ftmtopl binary name (tfmtopl) + --metapost metapost binary name (mpost) +\stoptyping + +But it is a long time since I installed \PERL\ on my laptop so I didn't check it. +I also found a manual that could be updated but I don't see much use for it now. +There is even a \MKII\ \TEX\ file that one can run with \type {pdftex &plain +\input supp-pgc.mkii \MPtoPGC} that produces container files but I didn't test +that either. + +However, what I did test was if it still works. For that I used the following +test file: + +\starttyping +% engine=pdftex + +\startTEXpage[offset=10pt] + +\pdfmapline{texnansi-lmr10 < texnansi.enc} + +\font\test=texnansi-lmr10 \test + +\input tufte + +\stopTEXpage +\stoptyping + +Here I use a normal \TFM\ file because after all we need the metrics. Then I made +an empty \typ {texnansi-lmr10.600pk} so that we can fool the \PK\ generator. Using +Latin Modern files is more convenient. The glyph container file was made by +abusing some features of \LMTX: + +% \disabledirectives[fonts.streams.pack] + +\startitemize + +\startitem + With the module \type {s-fonts-outlines} I made a font sample that as + byproduct generates a file with outline definitions. Basically any attempt to + use an outline in \METAFUN\ will populate the cache. We load the font \type + {lmr10.afm} and it will get the outlines from \type {lmr10.pfb}. Of course + there are more that 256 characters in there but that doesn't matter. +\stopitem + +\startitem + I also generated a \type {texnansi} vector file which can be done from a + normal \TEX\ run using the \LUA\ call \typ {fonts.encodings.load + ("texnansi.enc"))}. It locates and converts a regular \type{enc} into a \LUA\ + representation. I picked up the file from the cache. +\stopitem + +\startitem + From these files I generated a glyph container file \typ {texnansi-lmr10.pgc} + that can be used instead of the \PK\ file. The file \typ {mtx-pgc.lua} is + shown below. +\stopitem + +\startitem + I made sure to set \type {MISCFONTS} to a sensible value because otherwise + the container file is not found (who knows what location strategy is used). +\stopitem + +\stopitemize + +This is the \quote {quick and dirty} conversion file: + +\starttyping +local round = math.round +local concat = table.concat + +local result = { "\\pdffontscale 0.001\n" } +local r = 1 + +local f_pdfglyph = string.formatters["\\pdfglyph %i %i %i %i %i %i %i %i"] +local s_endglyph = "\\endglyph\n" +local f_comment = string.formatters["%% name %s index %i slot %i \n"] + +local shapes = table.load("lmr10-pfb.tma") +local encoding = table.load("texnansi.tma") + +local glyphs = shapes.glyphs +local hash = encoding.hash + +for index=0,#glyphs do + local glyph = glyphs[index] + local segments = glyph.segments or { } + local bounds = glyph.boundingbox or { 0, 0, 0, 0 } + local width = round(glyph.width or 0) + local name = glyph.name + local slotused = hash[name] + if slotused then + local llx, lly = bounds[1], bounds[2] + local urx, ury = bounds[3], bounds[4] + r = r + 1 ; result[r] = f_comment(name,index,slotused) + r = r + 1 ; result[r] = f_pdfglyph(slotused,width,0,0,llx,lly,urx,ury) + if #segments > 0 then + r = r + 1 ; result[r] = "10 M 1 j 1 J 0 w" + for i=1,#segments do + local s = segments[i] + if s[1] ~= "close" then + r = r + 1 ; result[r] = concat(s," ") + end + end + r = r + 1 ; result[r] = "h f*" + end + r = r + 1 ; result[r] = s_endglyph + end +end + +io.savedata("texnansi-lmr10.pgc",concat(result,"\n")) +\stoptyping + +Of course for a proper workflow we need to make this into a real helper script +but here I just want to show the idea. The result is shown in \in {figure} +[fig:pgcresult]. There is however one drawback: because \PDFTEX\ goes via the +\PK\ route using the same font with a different scale will result in an extra +copy while actually we have a scalable \TYPETHREE\ font. It is for that reason +that I will not waste any more time on this. I could provide a patch to deal with +it but changing a long time ago frozen \TEX\ program is tricky because bug(let)s +have become features. + +\startplacefigure[title={This is what we get with glyph containers.},reference=fig:pgcresult] + \externalfigure + [ontarget-nostalgic-pgc.pdf] + [width=\textwidth, + background=color, + backgroundcolor=gray] +\stopplacefigure + +So where does this bring us? Because \MKII\ is frozen and \PDFTEX\ only works +with that version it makes no sense to add some kind of \TYPETHREE\ support. In +\MKIV\ and \MKXL\ we have several mechanisms for creating these fonts anyway. I +cannot comment on use outside \CONTEXT\ but because of the strong connection with +\PK\ fonts being required in order for glyph containers to kick in at all, I +suspect that it's a mostly unknown feature, but one that actually can be made to +work. It could even work better (with respect to file lookup and font scaling) +when it is decoupled from the \PK\ requirements and listen to na map file line +that also signals if the font can be reused. But what worries me a bit more is +that after 25 years I hardly recognize the (reasonable) \PERL\ code and little +manual although it slowly came back. At that I time I could not have predicted +where we are now with respect to \TYPETHREE\ support, which in \LMTX\ is very +much kicking and alive. \footnote {At that time \TYPETHREE\ in the perspective of +\TEX\ always had a bad ring, probably because the many files that were around +with too low resolution bitmap fonts. The \PDF\ readers were not particularly +good in rendering them either. But with outlines this format can be fun!} + +\stopchapter + +\stopcomponent + + diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-profiles.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-profiles.tex new file mode 100644 index 00000000000..8607075710b --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-profiles.tex @@ -0,0 +1,507 @@ +% language=us runpath=texruns:manuals/ontarget + +% timestamp: Scary Pockets with Leland Sklar: https://www.youtube.com/watch?v=1UOVLdPslmo +% around 19 minutes in ... interesting! Hopefully I once see LS live! + +% we can yscale too + +\usebodyfont[modern,10pt] +\usebodyfont[lucida,10pt] +\usebodyfont[pagella,10pt] +\usebodyfont[bonum,10pt] +\usebodyfont[antykwa,10pt] + +\startcomponent ontarget-profiles + +\environment ontarget-style + +\startchapter[title={Profiles}] + +\startsection[title=Introduction] + +Among the typesetting problems that relate to math are inline formulas that have +a bit too much height or depth but not so much as to justify some additional +interline space. For that reason in \CONTEXT\ \MKII\ we have some snapping +features that can be enabled that limit the dimensions. In \MKIV\ a more +extensive profile feature was written (we talked about it at meetings in 2015) +that look at the bottom and top of lines in order to determine if lines can be +moved closer, but in practice snapping and profiling are never really used. In +the end it was more an academic exercise which is not uncommon when it comes to +\TEX\ user demands and practice. + +As part of exploring math micro typography these features surfaced again during +some discussion about weird mechanisms and we actually wondered if we could revive +this now that we also control other aspects of math typesetting in more detail. +One condition is that the overhead is not that high. Users accept some overhead +for protrusion and expansion that relate to horizontal optimization so a little +extra overhead for vertical optimization should not be a problem. + +Of course, as with protrusion and especially expansion, the question is if +readers will notice it. Best would be to set up some experiments but, although +one can argue that research is important, in practice it always boils down to a +visual impression, feel good and, like it or not, exploration, trial and error. +And so a simplified variant of profiling was implemented and applied to a math +intensive math book used in academia. Instead of proper experiments some unaware +bystanders were asked if they noticed a difference and to our surprise that was +the case! And these were not even math students but kids who were more familiar +with children books and phones. That convinced us that we were on the right +track, that we need to explain a little about what we actually do, and that we +should tell users what to look at when this gets applied. + +With an introduction like this, mentioning \quote {research}, \quote {academia}, +\quote {students} and \quote {typography} we're sure that future generations will +be convinced that what is discussed next has a strong fundament so here we go! + +\stopsection + +\startsection[title=A first example] + +We start with a simple example. Because in practice profiling always kicks in +when possible one really need to handcraft an example that can be used for +demonstration: \in {figure} [fig:profile]. + +\definelineprofile[MyLineProfileA][step=1pt,factor=0.125] +\definelineprofile[MyLineProfileB][step=1pt,factor=0.250] +\definelineprofile[MyLineProfileC][step=1pt,factor=1.000] + +\startbuffer + \hsize 7cm + no no no no no no no no no no no no no no no no no \im{x^{2^{A^P}}+x_{2_g}}. no no no no no no no no no no no no no no no no no no no no no no no \im{\frac{1+A^{2^x}}{2+B_2}} no no no no no no no no no no no no no no no no no.\blank + no no no yes yes no no no no no no no no no no no \im{x^{2^{A^P}}+x_{2_g}}. no no no no no no no no yes yes no no no no no no no no no no no no \im{\frac{1+A^{2^x}}{2+B_2}} no no no no no no no no no no no no no no no no no.\par +\stopbuffer + +\startbuffer[set] +\showmakeup[line] +\enabletrackers[profiling.lines.show] +\stopbuffer + +\startbuffer[reset] +\disabletrackers[profiling.lines.show] +\stopbuffer + +\startplacefigure[reference=fig:profile] +\startcombination[2*2] + {\getbuffer[set]\vbox{\hsize7cm\resetlineprofile \getbuffer}\getbuffer[reset]}{\type{no profile}} + {\getbuffer[set]\vbox{\hsize7cm\setlineprofile [MyLineProfileA]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.125}} + {\getbuffer[set]\vbox{\hsize7cm\setlineprofile [MyLineProfileB]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.250}} + {\getbuffer[set]\vbox{\hsize7cm\setlineprofile [MyLineProfileC]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=1.000}} +\stopcombination +\stopplacefigure + +In order to see what happens it is important to understand how \TEX\ sees lines. +Actually, the concept of lines in \TEX\ is rather limited: lines are just +horizontal boxes where the baselines are separated by \type {\baselineskip} and +when the distance is larger than that dimensions a \type {\lineskip} gets added. + +\appendtoks\showmakeup[reset]\to\everybeforeoutput + +\startlines \showmakeup[line] +these are a few +lines of text +where lines have depths +or no real +height at all +\stoplines + +Between all these lines some skip needs to be added: the \type {\baselineskip} +minus the height and depth. If we add struts the lines get the optimal height and +depth so then no skips are inserted: + +\startlines \showmakeup[line] \showstruts +\strut these are a few +\strut lines of text +\strut where lines have depths +\strut or no real +\strut height at all +\stoplines + +When we increase the depth a little, for instance 1.2 times the normal strut depth, +we see that some additional space, the \type {\lineskip} gets added: + +\startlines \showmakeup[line] \showstruts +\strut these {\vrule depth 1.2\strutdp width .25em \relax} are a few +\strut lines of {\vrule depth 1.2\strutdp width .25em \relax} text +\strut where lines have {\vrule depth 1.2\strutdp width .25em \relax} depths +\strut or {\vrule depth 1.2\strutdp width .25em \relax} no real +\strut height at {\vrule depth 1.2\strutdp width .25em \relax} all +\stoplines + +However, there is no real reason to do that here because the +larger rules don't clash with text or other content. So this is what we get when +we pass the \type {profile} option to \type {\setupalign}: + +\def\MyStrut{\vrule depth 1.2\strutdp width .25em \relax} + +\enabletrackers[profiling.lines.show] +\startpacked \setupalign[profile] +\strut these {\MyStrut} are a few \crlf +\strut lines of {\MyStrut} text \crlf +\strut where lines have {\MyStrut} depths \crlf +\strut or {\MyStrut} no real \crlf +\strut height at {\MyStrut} all +\stoppacked +\disabletrackers[profiling.lines.show] + +Profiling works per paragraph, so when we add a \type {\par} in the middle we get +this: + +\enabletrackers[profiling.lines.show] +\startpacked \setupalign[profile] +\strut these {\MyStrut} are a few \crlf +\strut lines of {\MyStrut} text \crlf +\strut where lines have {\MyStrut} depths \par +\strut or {\MyStrut} no real \crlf +\strut height at {\MyStrut} all +\stoppacked +\disabletrackers[profiling.lines.show] + +But, we can actually setup the profiler to look back. Setting up the main +(document) profiler happens with: + +\starttyping +\setuplineprofile + [factor=0.125, % default + paragraph=yes, % default: no + step=0.5\emwidth] % default +\stoptyping + +but as with most \CONTEXT\ mechanisms you can define your own profiler. The step +tells what granularity to use when comparing positions in a line. The factor sets +the threshold for the interline skip. We saw these two differ in the first +example we gave. + +\stopsection + +\startsection[title=Profiled math] + +We will give several examples of math profiling. +In the examples we will switch font to Latin Modern, +since the effect is more visible for that font. +Most of our examples will be \quotation{real} (slightly modified) ones, +but we start with a rather artificial example. Below we have +two occurrences of a fraction. Note that the profiling only kicks +in for the second one. The reason is that on the line above the first +one we only have letters (x) with no depth, while in the second one, +we have added one letter (g) that has depth. + +\startbuffer \hsize 8cm +xxx xxxx xxxx xx xxx xx xx xxx xxxx xxx xx xxx xxx xx xx xxx x xxxxx xxxxx +xxx xxxx xxxx xx xxx xx xx xxx xxxx xxx xx xxx xxx xx xx xxx x xxxxx xxxxx +\im{\frac{1}{2}} xxx xxx xx xx xxx xxxx xxxxxxx xxxx xxxx xxxxx xxx xxxx xxx +xxx xxx xxx xxx xxx xxxx xxxxxx xxxxxxx xxxgxxx xxx xxx xxx xx x xxxxxxx xxx +\im{\frac{1}{2}} xxx xxxx xxxx xx xxx xx xx xxx xxxx xxx xx xxx xxx xx xx +xxx x xxxxx xxxxx.\par +\stopbuffer + +\starttextdisplay +\switchtobodyfont[modern,9pt] +\startcombination[nx=2,ny=1,distance=1cm] + {\getbuffer[set]\vtop{\hsize8cm\resetlineprofile \getbuffer}\getbuffer[reset]}{\type{no profile} } + {\getbuffer[set]\vtop{\hsize8cm\setlineprofile [MyLineProfileA]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.125}} +\stopcombination +\stoptextdisplay + +We next show a simple paragraph where the mechanism gets applied in three out of five line breaks. + +\startbuffer \hsize 8cm +The results of Section 6.3 show that the same phenomenon is encountered when +treating the norms of inverses: \im{\fenced[doublebar][size=0]{B_n^{-1}}_p} +converges to \im{N_p} very fast if \im{N_p > N_p^0}, while the convergence +may be slow if \im{N_p = N_p^0}. As the following proposition reveals, at +least for \im{p = 2} the strict inequality \im{N_2 > N_2^0} is the generic +case.\par +\stopbuffer + +\starttextdisplay +\startcombination[nx=2,ny=1,distance=1cm] + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\resetlineprofile \getbuffer}\getbuffer[reset]}{\type{no profile} } + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\setlineprofile [MyLineProfileA]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.125}} +\stopcombination +\stoptextdisplay + +We have shown the lines and used the helper to show where the profiling +is applied. We show the same example but without these helpers. After +all, this is how we usually see it. + +\starttextdisplay +\startcombination[nx=2,ny=1,distance=1cm] + {\switchtobodyfont[modern,9pt]\vtop{\hsize8cm\resetlineprofile \getbuffer}\getbuffer[reset]}{\type{no profile} } + {\switchtobodyfont[modern,9pt]\vtop{\hsize8cm\setlineprofile [MyLineProfileA]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.125}} +\stopcombination +\stoptextdisplay + +If the paragraph is slightly reformulated, the profiling might change. +Below we show an example where the subscript (p) on the fourth line gets +too close to the superscript (0) on the last line. + +\startbuffer \hsize 8cm +The results of Section 6.3 show that the same phenomenon is encountered when +treating the norms of inverses: \im{\fenced[doublebar][size=0]{B_n^{-1}}_p} +converges to \im{N_p} very fast if \im{N_p > N_p^0}, while the convergence +may be slow if \im{N_p = N_p^0}. +At least for \im{p = 2} the strict inequality \im{N_2 > N_2^0} is the generic +case.\par +\stopbuffer + +\starttextdisplay +\startcombination[nx=2,ny=1,distance=1cm] + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\resetlineprofile \getbuffer}\getbuffer[reset]}{\type{no profile} } + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\setlineprofile [MyLineProfileA]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.125}} +\stopcombination +\stoptextdisplay + +We can configure the amount of space that shall be added with the \type{factor} key. + +% MS: Fixing a shift issue in the one below took one timestamp loop: + +\starttextdisplay +\startcombination[nx=2,ny=1,distance=1cm] + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\setlineprofile [MyLineProfileA]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.125} } + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\setlineprofile [MyLineProfileC]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=1}} +\stopcombination +\stoptextdisplay + +\startbuffer \hsize 8cm +This shows that the sequence \im{(f_n)} is a Cauchy sequence in \im{L^1(\reals)} +and therefore it converges in norm to some \im{\sum_{k=1}^n \hat{f} \in L^1(\reals)}, by +Thereom~2.8.1. On the other hand, by Theorem~2.8.2, there exists an increasing +sequence of positive integers \im{q_n} such that \im{f_{q_n} \to \tilde{f}} +almost everywhere.\par +\stopbuffer + +\starttextdisplay +\startcombination[nx=2,ny=2,distance=1cm] + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\resetlineprofile \getbuffer}\getbuffer[reset]}{\type{no profile} } + {\switchtobodyfont[modern,9pt]\getbuffer[set]\vtop{\hsize8cm\setlineprofile [MyLineProfileA]\getbuffer}\getbuffer[reset]}{\type{step=1pt,factor=0.125}} +\stopcombination +\stoptextdisplay + +\stopsection + +\startsection[title=Line spacing] + +When we enable the line profiler on a 300 page math course with plenty inline +formulas, the number of \quote {corrections} varies a lot with the fonts. Some +simple tests show that Latin Modern, Bonum and EBGaramond get quite some applied, +while Lucida, Dejavu, Antykwa, Erewhon and Libertinus only see a few corrections. +Pagella, Termes and StixTwo end up in the middle. + +The trigger is not always text or math. The course material has quite some +structure, like numbered descriptions. In \CONTEXT\ we use plenty of struts to +make sure that spacing is consistent and the keyword that starts a description +therefore gets them. Normally that is not an issue but when the height of the +next line exceeds the strut height we get a clash and line skip will be added. +One can argue that the strut spoils the typesetting but in general it does more +good than harm, at least in \CONTEXT. It looks like the profiler is quite capable +of getting rid of the cases where it interferes (or more precisely: where it +doesn't run into the next line). + +The reason why we get a line skip added is simple: when the depth of the first +line equals strut depth and the height of the second one equals strut height +we're okay. When one of them is less we're also okay because \TEX\ will adapt the +baseline skip so that it compensated the difference. However, when the first line +has strut depth (due to the present strut) and the second line more than strut +height (resulting for instance from a formula) the lines are considered +overflowing in each other and therefore interline skip gets added. + +When we end up in this situation the profiler can bring down the line skip when +it concludes that the strut is not running into the next line. However when the +formula sits directly below the strut we cannot really determine what is right so +then we just keep the skip. This situation occurs seldom. In many cases struts +are optional so one can always disable them (locally). + +As the mentioned test document uses Lucida as body font, in the three cases where +we actually get a clash, one definitely relates to the strut: the overflow in the +second line occurs close to the right margin and the strut in the first line sits +at the left margin so we can get rid of the line skip, which leave us with only +two cases. However, there is another observation, one that involves the baseline +distance or line height. + +In \CONTEXT\ the ratio between the strut height and depth is 72:28 which works +quite well for most fonts. If we look at Lucida shapes we see that the depth is +normally small so we can actually decide to change that ratio. It is however not +clear how that will influence decisions. Assuming more height will help with for +instance formulas that have superscripts, but an inline integral with subscript +might suffer. For other fonts, like EBGaramond, that have some extremely deep +shapes changing rations won't help anyway. We win here and loose there. + +\startbuffer[text-001] + abcdefghijklmnopqrstuvwxyz + ABCDEFGHIJKLMNOPQRSTUVWXYZ + 1234567890 + ()[]/\{\}\| + .,!?@\#\$\%^&*_-+= +\stopbuffer + +\startbuffer[math-001] + $\int\sum\sqrt{}$ +\stopbuffer + +\startbuffer[math-002] + x_2^2 +\stopbuffer + +\newbox\MyHtDpBoxA +\newbox\MyHtDpBoxB +\newbox\MyHtDpBoxC + +\def\CheckThemA#1% + {\begingroup + \switchtobodyfont[#1,10pt]% + \starttabulate[||r|] + \FL + \BC \rlap{#1} \NC \NC \NR + \FL + \NC strut ht \EQ \the\strutht \NC \NR + \NC strut dp \EQ \the\strutdp \NC \NR + % \NC height \EQ \meaningless\strutheightfactor \NC \NR + % \NC depth \EQ \meaningless\strutdepthfactor \NC \NR + \NC ex \EQ \the\exheight \NC \NR + \LL + \stoptabulate + \endgroup} + +\def\CheckThemB#1% + {\begingroup + \switchtobodyfont[#1,10pt]% + \setbox\MyHtDpBoxA\ruledhpack\bgroup\inlinebuffer[text-001]\egroup + \setbox\MyHtDpBoxB\ruledhpack\bgroup\inlinebuffer[math-001]\egroup + \setbox\MyHtDpBoxC\ruledhpack\bgroup\inlinebuffer[math-002]\egroup + \def\ShowThem##1##2% + {\cldcontext{"\letterpercent 0.2f",\number##1##2/\number\htdp##2} + \NC + \the##1##2% + \NC} + \starttabulate[|r|r|i2r|r|i2r|r|] + \FL + \NS[1][c] \bf text-001 + \NS[1][c] \bf math-001 + \NS[1][c] \bf math-002 +% \rlap{\quad\quad#1} + \NR + \FL + \NC + \ShowThem\ht\MyHtDpBoxA + \ShowThem\ht\MyHtDpBoxB + \ShowThem\ht\MyHtDpBoxC + \NR + \NC + \ShowThem\dp\MyHtDpBoxA + \ShowThem\dp\MyHtDpBoxB + \ShowThem\dp\MyHtDpBoxC + \NR + \LL + \stoptabulate + \endgroup} + +We will look into a few fonts to get a better impression how all this relates. We +will use 10pt sizes. When we compare Lucida, Latin Modern, Bonum and Pagella we +notice that we start out with design sizes that are quite different. + +\CheckThemA{lucida} +\CheckThemA{modern} +\CheckThemA{bonum} +\CheckThemA{pagella} + +This is why we always use ratios (the 0.72 and 0.28) as well as abstract +dimensions like \type {ex} and \type {em} so that we adapt to what the font +provides. Because the default (total) line height is set to \type {2.8ex} we get +larger values in for instance Lucida. + +In the next tables we use three samples, with \type {text-001} being: + +\typebuffer[text-001] + +The two math samples are: + +\typebuffer[math-001] + +and + +\typebuffer[math-002] + +For text the ratios are not that far off the defaults, but for math they start +to differ and the distance becomes larger. For Lucida we get: + +\CheckThemB{lucida} + +Modern gives: + +\CheckThemB{modern} + +And bonum moves in the other direction: + +\CheckThemB{bonum} + +Pagella also differs: + +\CheckThemB{pagella} + +Changing the ratios for the sake of math makes not that much sense because +profiling depends a lot on what math ends up inline. When we looked around a bit +for realistic examples we got the impression that seeing some clash (read: +getting uneven line spacing) might be a reason why small formulas eventually end +up as display. Without mentioning names, we noticed that a reprint of a book +actually got reformatted and when we looked for the slashing formulas in the +original they had become display instead. With proper profiling there is no need +for that. On top of that one can argue that some inline rendering can be done +better anyway, like using skewed fraction instead of ruled ones. Can we predict +that math with many superscripts goes well with a font with relatively high +shapes? As soon as some parenthesis are used we get depth anyway and how likely +is it that math without these is used inline? It also depends on the amount of +math: two lines with superscripted math will drive \TEX\ to use line skip so we +need to profile anyway. For that reason we will not adapt the ratios, just like +we keep the default line spacing. There are of course fonts with extreme heights +(like the Computer Modern Dunhill variant) but no one will use those artistic +variants in a math document. If you want to go fancy and distinctive, Antykwa is +a good choice and that one actually scores pretty good with the defaults! + +\CheckThemA{antykwa} + +\CheckThemB{antykwa} + +\stopsection + +\startsection[title=Conclusion] + +So, should we enable profiling on mixed text|-|math documents or not? One +possible reason for not doing it is that it adds overhead, but in practice it's +not that much compared to processing the rest. It is no problem to find +complaints on the internet about \LUATEX\ performing worse than its ancestors so +if you're in that category: don't use profiling because it sets you back a few +percent runtime. However, when you're a demanding \CONTEXT\ user who mixes in a +lot of math, you might give it a try. It will intercept a couple of cases where +struts (assuming structure is used) trigger a line skip, and it might also catch +a couple of cases where \TEX\ found lines getting too close. Tweaking the \type +{factor} and \type {step} can actually be fun. Because it does influence page +breaks it is not something to be applied last minute. And, talking performance, +this kind of vertical optimization comes cheaper than horizontal optimization +using expansion (hz) and protrusion. + +\stopsection + +\stopchapter + +\stopcomponent + +% \framed[width=7cm,offset=overlay,align={lohi,normal}]{\getbuffer} +% \framed[width=7cm,offset=overlay,align={lohi,normal,profile}]{\getbuffer} + +% maybe add an interline callback ... + +% Test different fonts +% lots: modern, bonum, ebgaramond, +% some: pagella, termes, stixtwo +% few: lucida, dejavu, antykwa, kurier, erewhon, libertinus + +% Strut can force lineheight and depth. + +% antykwa size of vertical bar is maybe too big. Change step? + +% antykwa \Biggl(1+\frac{1}{n}\Biggr)^n + +% cambria, superscripts sit a bit high (we did not change it) + +% the role of font parameters (superscripts... not enough steps in i.e. square roots) + +% dp / ht relation and struts diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-radicals.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-radicals.tex new file mode 100644 index 00000000000..ef2103d349f --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-radicals.tex @@ -0,0 +1,160 @@ +% language=us runpath=texruns:manuals/ontarget + +\startcomponent ontarget-radicals + +\environment ontarget-style + +\startchapter[title={Somewhat radical}] + +Here we will discuss an aspect of radicals, namely how variants get applied. Take +the following situation: + +\startbuffer[one] +\dontleavehmode \glyphscale 4000 +\ruledhbox{\setupmathradical[sqrt][mindepth=0pt,strut=no,leftmargin=0pt]$\sqrt{x+1}$ $\sqrt{x-1}$}\blank +\ruledhbox{\setupmathradical[sqrt][mindepth=0pt,strut=no,leftmargin=0pt]$\sqrt{1+x}$ $\sqrt{1-x}$} +\stopbuffer + +\startbuffer[two] +\dontleavehmode \glyphscale 4000 +\ruledhbox{\setupmathradical[sqrt][mindepth=0pt,strut=no,leftmargin=0pt]$\sqrt{\frac{x+1}{x-1}}$} +\ruledhbox{\setupmathradical[sqrt][mindepth=0pt,strut=no,leftmargin=0pt]$\sqrt{\frac{1+x}{1-x}}$} +\stopbuffer + +\startbuffer[three] +\dontleavehmode \glyphscale 4000 +\ruledhbox{$\sqrt{\frac{x+1}{x-1}}$} +\ruledhbox{$\sqrt{\frac{1+x}{1-x}}$} +\stopbuffer + +\startlinecorrection +\switchtobodyfont[modern-nt]\getbuffer[one] +\stoplinecorrection + +Watch the slight difference in radical heights. Now look at this: + +\startlinecorrection +\switchtobodyfont[modern-nt]\getbuffer[two] +\stoplinecorrection + +Here we need to make sure that we don't run into the slope, because, when we have +a close look at the shapes we see that the radical symbol has a tight bounding +box: + +\startlinecorrection +\showglyphs\switchtobodyfont[modern-nt]\getbuffer[one] +\stoplinecorrection + +In pagella we get: + +\startlinecorrection +\showglyphs\switchtobodyfont[pagella-nt]\getbuffer[two] +\stoplinecorrection + +and in antykwa: + +\startlinecorrection +\showglyphs\switchtobodyfont[antykwa]\getbuffer[two] +\stoplinecorrection + +But now look at this formula: + +\startlinecorrection +\switchtobodyfont[antykwa] +{\showglyphs \showstruts \getbuffer[three]} +{\getbuffer[three]} +\stoplinecorrection + +Here we see several mechanisms in action and for a good reason. First of all we +want similar subformulas (under the symbol) to have compatible radicals. For this +we use special struts so that we always have at least some height. We also +compensate for slight differences in depth by setting a minimum depth. Finally we +add a bit of margin. That last feature moves the content free from the symbols +which means that we can have less distance between the top of the content and the +rule. In many fonts that distance is set to a value that prevents clashes and the +more slope we have, the more opportunity there is to clash. + +When the best fit decision is made for a radical, the effective height of the +content (height plus depth of the box) is incremented by a gap variable. The +standard specifies the \typ {RadicalVerticalGap} as \quotation {Space between the +(ink) top of the expression and the bar over it. Suggested: 1.25 default rule +thickness.} and \typ {RadicalDisplayStyleVerticalGap} as \quotation {Space +between the (ink) top of the expression and the bar over it. Suggested: default +rule thickness plus .25 times x-height.}. These values are actually rather font +dependent because the slope needs to be taken into account; there is also a +visual aspect to it. + +We can't tweak the radical width because the rule has to be attached. If we could +we'd have to do it for every variant. So, instead we set up radical like this: + +\starttyping +\setupmathradical + [strut=height, % only height + leftmargin=.05mq, % fraction of math quad + mindepth=.05mx] % fraction of math x height +\stoptyping + +When deciding what size to use, a list of variants is followed till there is a +match and when we run out of variants an extensible is constructed. Here is the +list of possible sizes in the current font: + +\startbuffer[four] +\startformula + \glyphscale 2000 + \dorecurse {\nofmathvariants "221A} { + \ruledhbox{$\char \getmathvariant #1 "221A \relax$} + \quad + } +\stopformula +\stopbuffer + +\startbuffer[five] +\startformula + \glyphscale 2000 + \dorecurse {\nofmathvariants "221A} { + \setbox\scratchbox\ruledhbox{$\char \getmathvariant #1 "221A$} + \raise\dp\scratchbox\box\scratchbox + \quad + } +\stopformula +\stopbuffer + +\getbuffer[four] + +However, when we don't center around the math axis we get a more distinctive view +on the steps: + +\getbuffer[five] + +It will be clear that the steps can't be too large but there are fonts out there +that behave rather extreme, like Cambria: + +{\switchtobodyfont[cambria-nt] \getbuffer[five]} + +The only way out here is to either inject scaled variants into the list of +possibilities or to simply ignore all except the first one and go straight to the +extensible, so that's what we do, in combination with tweaked parameters and a +margin: + +{\switchtobodyfont[cambria] \getbuffer[five]} + +As with many font parameters (also in text) one sometimes wonder if font designer +test with real examples. There are of course exceptions, for instance the \typ +{ebgaramond} font, but that one goes over the top in other areas. Here one can +also wonder if the upper half of the range makes sense over an extensible. For +consistency one wants steps to be not too small, so that a sequence of radicals +looks simular, but steps larger than for instance the height are probably bad. + +\pushoverloadmode +{\switchtobodyfont[ebgaramond] \let\quad\thinspace \getbuffer[five]} +\popoverloadmode + +So, as with other examples that we give of tweaking math, it is clear that there +is no way around also tweaking radicals, and we're not even talking of the way we +fine tune the positioning of degrees in radicals because that is also a neglected +area in \OPENTYPE\ math fonts. + +\stopchapter + +\stopcomponent + diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-standardize.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-standardize.tex new file mode 100644 index 00000000000..255cba3eba7 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-standardize.tex @@ -0,0 +1,987 @@ +% language=us runpath=texruns:manuals/ontarget + +\setupexternalfigures[directory=screendumps] + +\usebodyfont[antykwa] +\usebodyfont[modern-nt] +\usebodyfont[modern] +\usebodyfont[bonum-nt] +\usebodyfont[bonum] +\usebodyfont[lucida-nt] +\usebodyfont[lucida] +\usebodyfont[erewhon-nt] +\usebodyfont[erewhon] +\usebodyfont[libertinus-nt] +\usebodyfont[libertinus] +\usebodyfont[stixtwo] +\usebodyfont[cambria] + +\hyphenation{prime-shift-up-cramped} + +\startcomponent ontarget-standardize + +\environment ontarget-style + +\startchapter[title={Standardizing math fonts}] + +\startsection[title={Introduction}] + +\CONTEXT\ has always had a good support for the typesetting of mathematics. +\CONTEXT\ \MKII\ uses the \PDFTEX\ engine and hence traditional (\TYPEONE) fonts. +Several math fonts are available, specifically designed to work seamlessly with +\TEX. \CONTEXT\ \MKIV, the successor version, utilizes the \LUATEX\ engine, +providing support not only for traditional fonts but also for \OPENTYPE\ +\UNICODE\ math fonts. Unlike the \XETEX\ engine, which interpreted these new +fonts in a manner similar to traditional \TEX\ fonts, \LUATEX\ adheres more +closely to the (unfortunately somewhat vague) \OPENTYPE\ specification. \footnote +{See \typ{https://learn.microsoft.com/en-us/typography/opentype/spec/math}} When +new fonts appeared, some were more like the traditional fonts, others more like +\OPENTYPE\ \UNICODE\ math fonts. This leads to difficulties in achieving +consistent results across different fonts and might be one reason that the +\UNICODE\ engines are not yet used as much as they probably should. + +In autumn 2021 we started to discuss how to improve the typesetting of \OPENTYPE\ +\UNICODE\ mathematics, and it was natural to go on and do this for the +\LUAMETATEX\ engine, and hence for \CONTEXT\ \LMTX. Since then, we have been +engaging in daily discussions covering finer details such as glyphs, kerning, +accent placement, inter|-|atom spacing (what we refer to as math +microtypography), as well as broader aspects like formula alignment and formula +line breaking (math macrotypography). This article will primarily focus on the +finer details. Specifically, we will explore the various choices we have made +throughout the process. The \OPENTYPE\ \UNICODE\ math specification is +incomplete; some aspects are missing, while others remain ambiguous. This issue +is exacerbated by the varying behaviors of fonts. + +We make runtime changes to fonts, and add a few additional font parameters that +we missed. As a result, we deviate from the standard set by Microsoft (or rather, +we choose to interpret it in our own way) and exercise the freedom to make +runtime changes to font parameters. Regarding this aspect, we firmly believe that +our results often align more closely with the original intentions of the font +designers. Indeed, the existence of \quotation{oddities} in these fonts may be +attributed to the lack of an engine, during their creation, that supported all +the various features, making testing difficult, if not essentially impossible. +Within \CONTEXT\ \LMTX, we have the necessary support, and we can activate +various helpers that allow us to closely examine formulas. Without them our work +would not have been possible. + +Ultimately, we hope and believe that we have made straightforward yet effective +choices, rendering the existing \OPENTYPE\ \UNICODE\ math fonts usable. We hope +that this article might be inspiring and useful for others who aim to achieve +well|-|designed, modern math typesetting. + +\stopsection + +\startsection[title={Traditional vs.\ \OPENTYPE\ math fonts}] + +There is a fundamental difference between traditional \TEX\ math fonts and +\OPENTYPE\ \UNICODE\ fonts. In the traditional approach, a math setup consists of +multiple independent fonts. There is no direct relationship between a math italic +$x$ and an $\hat{\hphantom{x}}$ on top of it. The engine handles the positioning +almost independently of the shapes involved. There can be a shift to the right of +$\hat{x}$ triggered by kerning with a so|-|called skew character but that is it. + +A somewhat loose coupling between fonts is present when we go from a base +character to a larger variant that itself can point to a larger one and +eventually end up at an extensible recipe. But the base character and that +sequence are normally from different fonts. The assumption is that they are +designed as a combination. In an \OPENTYPE\ font, variants and extensibles more +directly relate to a base character. + +Then there is the italic correction which adds kerns between a character and what +follows depending on the situation. It is not, in fact, a true italic correction, +but more a hack where an untrue width is compensated for. A traditional \TEX\ +engine defaults to adding these corrections and selectively removes or +compensates for them. In traditional \TEX\ this fake width helps placing the +subscript properly while the italic correction is added to the advance width when +attaching subscripts and|/|or moving to the next atom. + +In an \OPENTYPE\ font we see these phenomena translated into features. Instead of +many math fonts we have one font. This means that one can have relations between +glyphs, although in practice little of that happens. One example is that a +specific character can have script and scriptscript sizes with a somewhat +different design. Another is that there can be alternate shapes for the same +character, and yet another is substitution of (for instance) dotted characters by +dotless ones. However, from the perspective of features a math font is rather +simple and undemanding. + +Another property is that in an \OPENTYPE\ math font the real widths are used in +combination with optional italic correction when a sequence of characters is +considered text, with the exception of large operators where italic correction is +used for positioning limits on top and below. Instead of abusing italic +corrections this way, a system of staircase kerns in each corner of a shape is +possible. + +Then there are top (but not bottom) anchor positions that, like marks in text +fonts, can be used to position accents on top of base characters or boxes. And +while we talk of accents: they can come with so|-|called flat substitutions for +situations where we want less height. + +All this is driven by a bunch of font parameters that (supposedly) relate to the +design of the font. Some of them concern rules that are being used in +constructing, for instance, fractions and radicals but maybe also for making new +glyphs like extensibles, which is essentially a traditional \TEX\ thing. + +So, when we now look back at the traditional approach we can say that there are +differences in the way a font is set up: widths and italic corrections, staircase +kerns, rules as elements for constructing glyphs, anchoring of accents, +flattening of accents, replacement of dotted characters, selection of smaller +sizes, and font parameters. These differences have been reflected in the way +engines (seem to) deal with \OPENTYPE\ math: one can start with a traditional +engine and map \OPENTYPE\ onto that; one can implement an \OPENTYPE\ engine and, +if needed, map traditional fonts onto the way that works; and of course there can +be some mix of these. + +In practice, when we look at existing fonts, there is only one reference and that +is Cambria. When mapped onto a traditional engine, much can be made to work, but +not all. Then there are fonts that originate in the \TEX\ community and these do +not always work well with an \OPENTYPE\ engine. Other fonts are a mix and work +more or less. The more one looks into details, the clearer it becomes that no +font is perfect and that it is hard to make an engine work well with them. In +\LUAMETATEX\ we can explicitly control many of the choices the math engine makes, +and there are more such choices than with traditional \TEX\ machinery. And +although we can adapt fonts at runtime to suit the possibilities, it is not +pretty. + +This is why we gradually decided on a somewhat different approach: we use the +advantage of having a single font, normalize fonts to what we can reliably +support, and if needed, add to fonts and control the math engine, especially the +various subsystems, with directives that tell it what we want to be done. Let us +discuss a few things that we do when we load a math font. + +\stopsection + +\startsection[title={Getting rid of italic corrections}] + +\OPENTYPE\ math has italic corrections for using characters in text and large +operators (for limits), staircase kerns for combining scripts, and top anchor for +placement of accents. In \LUAMETATEX\ we have access to more features. + +Let's remind ourselves. In a bit more detail, \OPENTYPE\ has: + +\startitemize[packed] +\startitem + \typ An \typ {italic correction} is injected between characters in running + text, but: a sequence of atoms is {\em not} text, they are individually + spaced. +\stopitem +\startitem + An \typ {italic correction} value in large operators that reflects where + limits are attached in display mode; in effect, using the italic + correction as an anchor. +\stopitem +\startitem + \typ {Top anchors} are used to position accents over characters, but + not so much over atoms that are composed from not only characters. +\stopitem +\startitem + \typ {Flat accents} as substitution feature for situations where the height + would become excessive. +\stopitem +\startitem + \typ {Script and scriptscript} as substitution feature for a selection of + characters that are sensitive for scaling down. +\stopitem +\stopitemize + +This somewhat limited view on math character positioning has been extended in +\LUAMETATEX, and we remap the above onto what we consider a bit more reliable, +especially because we can tweak these better. We have: + +\startitemize[packed] +\startitem + \typ {Corner kerns} that make it possible to adjust the horizontal location + of sub- and superscripts and prescripts. +\stopitem +\startitem + Although \typ {flat accents} are an existing feature, we extended them by + providing additional scaling when they are not specified. +\stopitem +\startitem + In addition to script sizes we also have \typ {mirror} as a feature so that + we can provide right to left math typesetting. (This also relates to + dropping in characters from other fonts, like Arabic.) +\stopitem +\startitem + In addition to the \typ {top anchors} we also have \typ {bottom anchors} + in order to properly place bottom accents. These are often + missing, so we need to construct them from available snippets. +\stopitem +\startitem + An additional \typ {extensible italic correction} makes it possible to + better anchor scripts to sloped large operators. This is combined with + keeping track of \typ {corner kerns} that can be specified per character. +\stopitem +\startitem + Characters can have \typ {margins} which makes it possible to more precisely + position accents that would normally overflow the base character and clash + with scripts. These go in all four directions. +\stopitem +\startitem + In order to be able to place the degree in a radical more precisely (read: + not run into the shape when there is more than just a single degree atom) we + have \typ {radical offsets}. +\stopitem +\stopitemize + +There are plenty more tuning options but some are too obscure to mention here. +All high level constructors, like fences, radicals, accents, operators, +fractions, etc.\ can be tuned via optional keyword and key|/|values at the macro +end. + +We eliminate the italic correction in math fonts, instead adding it to the width, +and using a negative bottom right kern. If possible we also set a top and bottom +accent anchor. This happens when we load the font. We also translate the italic +correction on large operators into anchors. As a result, the engine can now +completely ignore italic corrections in favor of proper widths, kerns and +anchors. Let us look at a few examples. + +The italic $f$ is used a lot in mathematics and it is also one of the most +problematic characters. In \TEXGYRE\ Bonum Math the italic f has a narrow +bounding box; the character sticks out on both the left and right. To the right, +this is compensated by a large amount of italic correction. This means that when +one adds sub- and superscripts, it works well. We add italic correction to the +width, and introducing a negative corner kern at the bottom right corner, and +thus the placement of sub- and superscripts is not altered. Look carefully at the +bounding boxes below. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,distance=1es] + \startcontent + \switchtobodyfont[bonum-nt] + \showglyphs + \dm{\setmscale{3}f_0^1} + \stopcontent + \startcaption + \hbox {original} + \stopcaption + \startcontent + \showglyphs + \dm{\setmscale{3}f_0^1} + \stopcontent + \startcaption + \hbox {tweaked} + \stopcaption + \stopcombination +\stopplacefloat + +Compare with Lucida Bright Math, which comes with staircase kerns instead of +italic correction. We convert these kerns into corner kerns. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,distance=5ts] + \startcontent + \switchtobodyfont[lucida-nt] + \showglyphs + \dm{\setmscale{3}f_0^1} + \stopcontent + \startcaption + \hbox {original} + \stopcaption + \startcontent + \switchtobodyfont[lucida] + \showglyphs + \dm{\setmscale{3}f_0^1} + \stopcontent + \startcaption + \hbox {tweaked} + \stopcaption + \stopcombination +\stopplacefloat + +For characters that stick out to the left, we also increase the width and shift +the glyph to ensure that it does not stick out on the left side. This prevents +glyphs from clashing into each other. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,distance=5ts] + \startcontent + \switchtobodyfont[bonum-nt] + \showglyphs + \dm{\setmscale{3}(f)} + \stopcontent + \startcaption + \hbox {original} + \stopcaption + \startcontent + \showglyphs + \dm{\setmscale{3}(f)} + \stopcontent + \startcaption + \hbox {tweaked} + \stopcaption + \stopcombination +\stopplacefloat + +As mentioned, for the integral, one of the most common big operators, the limits +are also placed with help of the italic correction. When the limits go below and +on top, proper bottom and top anchor points are introduced, calculated from the +italic correction. (The difference in size of the integral signs is a side effect +of the font parameter \typ {DisplayOperatorMinHeight} being tweaked, as we'll +discuss more later. \OPENTYPE\ fonts can come with more than two sizes.) + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=3,distance=5ts] + \startcontent + \switchtobodyfont[bonum-nt] + \showglyphs + \dm{\setmscale{1.5}\int_a^b f(x) \dd x} + \stopcontent + \startcaption + original + \stopcaption + \startcontent + \showglyphs + \dm{\setmscale{1.5}\int_a^b f(x) \dd x} + \stopcontent + \startcaption + \hbox {tweaked, nolimits} + \stopcaption + \startcontent + \setupmathematics + [integral=limits] + \showglyphs + \dm{\setmscale{1.5}\int_a^b f(x) \dd x} + \stopcontent + \startcaption + \hbox {tweaked, limits} + \stopcaption + \stopcombination +\stopplacefloat + +Compare these integrals with the summation, that usually does not have any italic +correction bound to it. This means that the new anchor points end up in the +middle of the summation symbol. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,distance=5ts] + \startcontent + \switchtobodyfont[bonum-nt] + \showglyphs + \dm{\setmscale{1.5}\sum_{k=1}^{n}a_k} + \stopcontent + \startcaption + original + \stopcaption + \startcontent + \showglyphs + \dm{\setmscale{1.5}\sum_{k=1}^{n}a_k} + \stopcontent + \startcaption + tweaked + \stopcaption + \stopcombination +\stopplacefloat + +We also introduce some corner kerns in cases where there were neither italic +corrections nor staircase kerns. This is mainly done for delimiters, like +parentheses. We can have a different amount of kerning for the various sizes. +Often the original glyph does not benefit from any kerning, while the variants +and extensibles do. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,distance=5ts] + \startcontent + \switchtobodyfont[bonum-nt] + \showglyphs + \dm{\setmscale{1.5}\left( \frac {1}{1 + x^2} \right)^2} + \stopcontent + \startcaption + original + \stopcaption + \startcontent + \showglyphs + \dm{\setmscale{1.5}\left( \frac {1}{1 + x^2} \right)^2} + \stopcontent + \startcaption + tweaked + \stopcaption + \stopcombination +\stopplacefloat + +Note also the different sizes of the parentheses in the example above. Both +examples are set with \typ {\left(} and \typ {\right)}, but the font parameters +are chosen differently in the tweaked version. Font designers should have used +the opportunity to have more granularity in sizes. Latin Modern Math has four, +many others have steps in between, but there is a lack of consistency. + +\stopsection + +\startsection[title={Converting staircase kerns}] + +We simplify the staircase kerns, which are often somewhat sloppy and seldom +complete (see figure below), into more reliable corner kerns. It's good enough +and looks better on the whole. We also avoid bugs that way. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,ny=1,distance=5TS] + \startcontent + \clip[ny=3,y=2] + {\externalfigure[CambriaItalicV-bottomrightkern][height=3ES]} + \stopcontent + \startcaption + italic V + \stopcaption + \startcontent + \clip[ny=3,y=2] + {\externalfigure[CambriauprightV-bottomrightkern][height=3ES]} + \stopcontent + \startcaption + upright V + \stopcaption + \stopcombination +\stopplacefloat + + +\stopsection + +\startsection[title={Tweaking accents}] + +We ignore the zero dimensions of accents, simply assuming that one cannot know if +the shape is centered or sticks out in a curious way, and therefore use proper +widths with top and bottom anchors derived from the bounding box. We compensate +for negative llx values being abused for positioning. We check for overflows in +the engine. In case of multiple accents, we place the first one anchored over the +character, and center the others on top of it. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=1,distance=5TS] + \startcontent + \switchtobodyfont[bonum] + \showglyphs + \dm{\setmscale{3} \hat{\hat{\hat{f}}}} + \stopcontent + \startcaption + \stopcaption + \stopcombination +\stopplacefloat + +We mentioned in an earlier \TUGBOAT\ article that sometimes anchor points are +just wrong. We have a tweak that resets them (to the middle) that we use for +several fonts and alphabets. + +Some accents, like the hat, can benefit from being scaled. The fonts typically +provide the base size and a few variants. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,ny=1,distance=5TS] + \startcontent + \switchtobodyfont[bonum-nt] + \showglyphs + \dm{\setmscale{3}\widehat[stretch=no]{f+g}} + \stopcontent + \startcaption + original + \stopcaption + \startcontent + \showglyphs + \dm{\setmscale{3}\widehat{f+g}} + \stopcontent + \startcaption + tweaked + \stopcaption + \stopcombination +\stopplacefloat + +The only fonts we have seen that support flattened accents are Stix Two Math +and Cambria Math. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,ny=1,distance=1es] + \startcontent + \switchtobodyfont[stixtwo] + \showglyphs + \dm{\setmscale{3}\hat{a}\hat{A}\hat{C}} + \stopcontent + \startcaption + stix two + \stopcaption + \startcontent + \switchtobodyfont[cambria] + \showglyphs + \dm{\setmscale{3}\hat{a}\hat{A}\hat{C}} + \stopcontent + \startcaption + cambria + \stopcaption + \stopcombination +\stopplacefloat + +If you look carefully, you notice that the hats over the capital letters are not +as tall as the one over the lowercase letter. There is a font parameter \typ +{FlattenedAccentBaseHeight} that is supposed to specify when this effect is +supposed to kick in. Even though other fonts do not use this feature, the +parameter is set, sometimes to strange values (if they were to have the +property). For example, in Garamond Math, the value is 420. + +We introduced a tweak that can fake the flattened accents, and therefore we need +to alter the value of the font parameter to more reasonable values. We +communicated to Daniel Flipo, who maintains several math fonts, that the +parameter was not correctly set in Erewhon math. In fact, it was set such that +the flattened accents were used for some capital letters (C in the example below) +but not for others (A below). He quickly fixed that. The green rules in the +picture have the height of \typ {FlattenedAccentBaseHeight}; it did not need to +be decreased by much. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,distance=5TS] + \startcontent + \externalfigure[erewhonmath][page=1] + \stopcontent + \startcaption + \hbox{Erewhon, not fixed} + \stopcaption + \startcontent + \externalfigure[erewhonmath][page=2] + \stopcontent + \startcaption + \hbox{Erewhon, fixed} + \stopcaption + \stopcombination +\stopplacefloat + +\stopsection + +\startsection[title={Getting rid of rules}] + +We get rid of rules as pseudo-glyphs in extensibles and bars. This also gives +nicer visual integration because flat rules do not always fit in with the rest of +the font. We also added support for this in the few (Polish) Type~1 math fonts +that we still want to support, like Antykwa Toruńska. + +\startplacefloat + [intermezzo] + [location=nonumber] +\startcombination[nx=3,ny=1,distance=5TS] +\startcontent +\switchtobodyfont[modern-nt]% +\setupmathfractions + [strut=no]% +\dm{ + \setmscale{3} + \sqrt{\frac{1+x}{1-x}} +} +\stopcontent +\startcaption +With rule +\stopcaption + +\startcontent +\switchtobodyfont[modern]% +\setupmathfractions + [strut=no]% +\dm{ + \setmscale{3} + \sqrt{\frac{1+x}{1-x}} +} +\stopcontent +\startcaption +With glyph +\stopcaption +\startcontent +\switchtobodyfont[antykwa]% +\setupmathfractions + [strut=no]% +\dm{ + \setmscale{3} + \sqrt{\frac{1+x}{1-x}} +} +\stopcontent +\startcaption +Antykwa +\stopcaption +\stopcombination +\stopplacefloat + +Here is an enlarged example of an Antykwa rule. Latin Modern has rounded corners, +here we see a rather distinctive ending. + +\startlinecorrection +\scale[height=2cm]{\switchtobodyfont[antykwa]\im{\overbar{x^2 + 2x + 2}}} +\stoplinecorrection + +\stopsection + +\startsection[title={Tweaking primes}] + +We make it no secret that we consider primes in math fonts a mess. For some +reason no one could convince the \UNICODE\ people that a \quote {prime} is not a +\quote {minute} (that is, \acro{U+2032 PRIME} is also supposed to be used as the +symbol for minutes); in case you'd like to argue that \quotation {they often look +the same}, that is also true for the Latin and Greek capital \quote {A}. This +lost opportunity means that, as with traditional \TEX\ fonts, we need to fight a +bit with placement. The base character can or cannot be already anchored at some +superscript|-|like position, so that makes it basically unusable. An alternative +assumption might be that one should just use the script size variant as a +superscript, but as we will see below, that assumes that they sit on the baseline +so that we can move it up to the right spot. Add to that the fact that +traditional \TEX\ has no concept of a prime, and we need some kind of juggling +with successive scripts. This is what macro packages end up doing. + +But this is not what we want. In \CONTEXT\ \MKIV\ we already have special +mechanisms for dealing with primes, which include mapping successive primes onto +the multiple characters in \UNICODE, where we actually have individual triple and +quadruple primes and three reverse (real) primes as well. However, primes are now +a native feature, like super- and subscripts, as well as prescripts and indices. +(All examples here are uniformly scaled.) + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=3,ny=6] + \startcontent + \externalfigure[Latinmodernprime][scale=200] + \stopcontent + \startcaption + lm + \stopcaption + \startcontent + \externalfigure[Latinmodernprimest][scale=200] + \stopcontent + \startcaption + st + \stopcaption + \startcontent + \externalfigure[Latinmodernprimests][scale=200] + \stopcontent + \startcaption + sts + \stopcaption + \startcontent + \externalfigure[Lucidaprime][scale=200] + \stopcontent + \startcaption + lucida + \stopcaption + \startcontent + \stopcontent + \startcaption + \stopcaption + \startcontent + \externalfigure[Lucidaprimessty][scale=200] + \stopcontent + \startcaption + ssty + \stopcaption + \startcontent + \externalfigure[Erewhonprime][scale=200] + \stopcontent + \startcaption + erewhon + \stopcaption + \startcontent + \externalfigure[Erewhonprimest][scale=200] + \stopcontent + \startcaption + st + \stopcaption + \startcontent + \externalfigure[Erewhonprimesst][scale=200] + \stopcontent + \startcaption + sst + \stopcaption + \startcontent + \externalfigure[Libertinusprime][scale=200] + \stopcontent + \startcaption + libertinus + \stopcaption + \startcontent + \externalfigure[Libertinusprimessty1][scale=200] + \stopcontent + \startcaption + ssty1 + \stopcaption + \startcontent + \stopcontent + \startcaption + \stopcaption + \stopcombination +\stopplacefloat + +Because primes are now a native feature, we also have new font parameters \typ +{PrimeShiftUp} and \typ {PrimeShiftUpCramped}, similar to \typ +{SuperscriptShiftUp} and \typ {SuperscriptShiftUpCramped}, which add a horizontal +axis where the primes are placed. There is also a \typ {fixprimes} tweak that we +can use to scale and fix the glyph itself. Below, we see how very different the +primes from different fonts look (all examples are uniformly scaled), and then +examples comparing the original and tweaked primes. + +\startbuffer +\dm{\setmscale{2}f'(x) + e^{f'(x)}} +\stopbuffer + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=2,ny=4,distance=2ts] + \startcontent + \switchtobodyfont[modern-nt] + \getbuffer + \stopcontent + \startcaption + lm original + \stopcaption + \startcontent + \switchtobodyfont[modern] + \getbuffer + \stopcontent + \startcaption + lm tweaked + \stopcaption + \startcontent + \switchtobodyfont[lucida-nt] + \getbuffer + \stopcontent + \startcaption + lucida original + \stopcaption + \startcontent + \switchtobodyfont[lucida] + \getbuffer + \stopcontent + \startcaption + lucida tweaked + \stopcaption + \startcontent + \switchtobodyfont[erewhon-nt] + \getbuffer + \stopcontent + \startcaption + erewhon original + \stopcaption + \startcontent + \switchtobodyfont[erewhon] + \getbuffer + \stopcontent + \startcaption + erewhon tweaked + \stopcaption + \startcontent + \switchtobodyfont[libertinus-nt] + \getbuffer + \stopcontent + \startcaption + libertinus original + \stopcaption + \startcontent + \switchtobodyfont[libertinus] + \getbuffer + \stopcontent + \startcaption + libertinus tweaked + \stopcaption + \stopcombination +\stopplacefloat + +\stopsection + +\startsection[title={Font parameters}] + +We add some font parameters, ignore some existing ones, and fix at runtime those +that look to be suboptimal. We have no better method than looking at examples, so +parameters might be fine|-|tuned further in the future. + +We have already mentioned that we have a few new parameters, \typ {PrimeShiftUp} +and \typ {PrimeShiftUpCramped}, to position primes on their own axis, independent +of the superscripts. They are also chosen to always be placed outside +superscripts, so the inputs \typ {$f'^2$} and \typ {$f^2'$} both result in +$f^2'$. Authors should use parentheses in order to avoid confusion. + +\startplacefloat + [intermezzo] + [location=nonumber] + \startcombination[nx=1,ny=3] + \startcontent + \externalfigure[latex-pdfpowers-crop][scale=1.2*2400] + \stopcontent + \startcaption + \stopcaption + \startcontent + \externalfigure[latex-luapowers-crop][scale=1.2*2400] + \stopcontent + \startcaption + \stopcaption + \startcontent + \externalfigure[230430-3-crop][scale=1.2*2000] + \stopcontent + \startcaption + \stopcaption + \stopcombination +\stopplacefloat + +Let us briefly mention the other parameters. These are the adapted parameters for +\TeX\ Gyre Bonum: + +\starttyping +AccentTopShiftUp = -15 +FlattenedAccentTopShiftUp = -15 +AccentBaseDepth = 50 +DelimiterPercent = 90 +DelimiterShortfall = 400 +DisplayOperatorMinHeight = 1900 +SubscriptShiftDown = 201 +SuperscriptShiftUp = 364 +SubscriptShiftDownWithSuperscript = "1.4*SubscriptShiftDown" +PrimeShiftUp = "1.25*SuperscriptShiftUp" +PrimeShiftUpCramped = "1.25*SuperscriptShiftUp" +\stoptyping + +Some of these are not in \OPENTYPE. We can set up much more, but it depends on +the font what is needed, and also on user demands. + +We have noticed that many font designers seem to have had problems setting some +of the values; for example, \typ {DisplayOperatorMinHeight} seems to be off in +many fonts. + +\stopsection + +\startsection[title={Profiling}] + +Let us end with profiling, which is only indirectly related to the tweaking of +the fonts. Indeed, font parameters control the vertical positioning of sub- and +superscripts. If not carefully set, they might force a non-negative \tex { +lineskip} where not necessary. In the previous section we showed how these +parameters were tweaked for Bonum. + +Sometimes formulas are too high (or have a too large depth) for the line, and so +a \tex {lineskip} is added so that the lines do not clash. If the lowest part of +the top line (typically caused by the depth) and the tallest part of the bottom +line (caused by the height) are not close to each other on the line, one might +argue that this \tex {lineskip} does not have to be added, or at least with +reduced amount. This is possible to achieve by adding \typ +{\setupalign[profile]}. Let us look at one example. + +\startbuffer[annals] +So the question is: how good an approximation to \im {\sigma} is \im {\sigma * W +\phi}? But the attentive reader will realize that we have already answered this +question in the course of proving the sharp Gårding inequality. Indeed, suppose +\im{\phi \in \mathcal{S}} is even and \im {\fenced[doublebar]{\phi}_2 = 1}, and +set \im {\phi^a(x) = a^{n/4} \phi (a^{1/2}x)}. Then we have shown (cf.\ Remark +(2.89)) that \im {\sigma - \sigma * W\phi^a \in S_{\rho, \delta}^{m-(\rho- +\delta)}} whenever \im {\sigma \in S_{\rho, \delta}^m} is supported in a set +where \im {\langle \xi \rangle^{\rho + \delta} \approx a}. +\stopbuffer + +\starttextdisplay +\bgroup +\switchtobodyfont[modern]%23cm +\startcombination[nx=1,ny=2] +\startcontent +\vtop{\hsize 14cm\relax% +\showmakeup[line] +\getbuffer[annals]} +\stopcontent +\startcaption +No profiling +\stopcaption +\startcontent +\vtop{\hsize 14cm\relax% +\setupalign[profile] +\showmakeup[line] +\enabletrackers[profiling.lines.show] +\getbuffer[annals]} +\stopcontent +\startcaption +Profiling +\stopcaption +\stopcombination +\egroup +\stoptextdisplay + +In the above paragraphs we enabled a helper that shows us where the profiling +feature kicks in. We also show the lines (\typ {\showmakeup[line]}). Below we +show the example without those helpers. You can judge for yourself which one you +prefer. + +\starttextdisplay +\bgroup +\switchtobodyfont[modern] +\startcombination[nx=1,ny=2] +\startcontent +\vtop{\hsize 14cm\relax% +\getbuffer[annals]} +\stopcontent +\startcaption +No profiling +\stopcaption +\startcontent +\vtop{\hsize 14cm\relax% +\setupalign[profile] +\disabletrackers[profiling.lines.show] +\getbuffer[annals]} +\stopcontent +\startcaption +Profiling +\stopcaption +\stopcombination +\egroup +\stoptextdisplay + +It is worth emphasizing that, contrary to what one might believe at first, the +profiling does not substantially affect the compilation time. On a 300-page math +book we tried, which usually compiles in about 10 seconds, profiling did not add +more than 0.5 seconds. The same observation holds for the other math tweaks we +have mentioned: the overhead is negligible. + +\stopsection + +\startsection[title={Conclusions}] + +All these tweaks can be overloaded per glyph if needed; for some fonts, we indeed +do this, in so|-|called goodie files. The good news is that by doing all this we +present the engine with a font that is consistent, which also means that we can +more easily control the typeset result in specific circumstances. + +The reader may wonder how we ended up with this somewhat confusing state of +affairs in the font world. Here are some possible reasons. There is only one +reference font, Cambria, and that uses its reference word processor renderer, +Word. Then came \XETEX\ that as far as we know maps \OPENTYPE\ math onto a +traditional \TEX\ engine, so when fonts started coming from the \TEX\ crowd, +traditional dimensions and parameters sort of fit in. When \LUATEX\ showed up, it +started from the other end: \OPENTYPE. That works well with the reference font +but less so with that ones coming from \TEX. Eventually more fonts showed up, and +it's not clear how these got tested because some lean towards the traditional and +others towards the reference fonts. And, all in all, these fonts mostly seem to +be rather untested in real (more complex) math. + +The more we looked into the specific properties of \OPENTYPE\ math fonts and +rendering, the more we got the feeling that it was some hybrid of what \TEX\ does +(with fonts) and ultimately desired behavior. That works well with Cambria and a +more or less frozen approach in a word processor, but doesn't suit well with +\TEX. Bits and pieces are missing, which could have been added from the +perspective of generalization and imperfections in \TEX\ as well. Lessons learned +from decades of dealing with math in macros and math fonts were not reflected in +the \OPENTYPE\ fonts and approach, which is of course understandable as +\OPENTYPE\ math never especially aimed at \TEX. But that also means that at some +point one has to draw conclusions and make decisions, which is what we do in +\CONTEXT, \LUAMETATEX\ and the runtime|-|adapted fonts. And it gives pretty good +and reliable results. + +\stopsection + +\stopchapter + +\stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-style.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-style.tex index eac3ffe3183..515bc1123ec 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-style.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget-style.tex @@ -5,8 +5,6 @@ \usemodule[abbreviations-smallcaps] \usemodule[scite] -\enableexperiments[fonts.compact] - \logo [LUAMETATEX] {LuaMeta\TeXsuffix} \setupbodyfont[plex,10pt] % not that ok for titling @@ -57,7 +55,8 @@ [tolerant,stretch] \setuptyping - [color=maincolor] + [color=maincolor, + align=hangright] \setuptype [color=maincolor] diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget.tex b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget.tex index 888a73f4198..3129a53e7d9 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/ontarget/ontarget.tex @@ -27,7 +27,32 @@ \component ontarget-gettingridof \component ontarget-registers \component ontarget-fairphone + \component ontarget-green + \component ontarget-jmn + \component ontarget-profiles + \component ontarget-envelopes + \component ontarget-mathfonts % \component ontarget-mathsizes + \component ontarget-constants + \component ontarget-active + \component ontarget-accuracy + \component ontarget-mathcharacters + \component ontarget-standardize + \component ontarget-radicals + \component ontarget-bars + % \component ontarget-rules.tex + % \component ontarget-bitmaps.tex + % \component ontarget-rivers.tex + % \component ontarget-inclusion.tex + % \component ontarget-signing.tex + % \component ontarget-authentic.tex + % \component ontarget-dimensions + % \component ontarget-pagestreams + % \component ontarget-mathml + \component ontarget-nostalgic \stopbodymatter \stopdocument + +% ontarget-wrapup.tex +% ontarget-done.tex diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge-testfiles.zip b/Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge-testfiles.zip new file mode 100644 index 00000000000..e0148f8f625 Binary files /dev/null and b/Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge-testfiles.zip differ diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge.tex b/Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge.tex new file mode 100644 index 00000000000..26acefe82c9 --- /dev/null +++ b/Master/texmf-dist/doc/context/sources/general/manuals/pdfmerge/pdfmerge.tex @@ -0,0 +1,604 @@ +% language=us runpath=texruns:manuals/pdfmerge + +% The font merge feature is also availble in \MKIV\ where it is an experiment and +% some cleanup is also there. In \LMTX\ it's more mature. Thanks to the competent +% Team Ramkumar (including Syabil and Fish) for providing input, testing this +% extensively, and feed back. + +% \nopdfcompression + +\usemodule[abbreviations-logos] + +\setupbodyfont + [bonum,10pt] + +\setuplayout + [topspace=.05ph, + bottomspace=.05ph, + backspace=.05ph, + header=.05 ph, + footer=0pt, + width=middle, + height=middle] + +\setupwhitespace + [big] + +\setuphead + [chapter] + [style=\bfc, + headerstate=high, + interaction=all] + +\setuphead + [section] + [style=\bfb] + +\setuphead + [subsection] + [style=\bfa] + +\setuphead + [subsubsection] + [style=\bf, + after=] + +\setuplist + [interaction=all] + +\setuptyping + [color=darkyellow] + +\enabletrackers[graphics.fonts] +\enabletrackers[graphics.fixes] + +\startdocument + [title=PDFmerge, + author=Hans Hagen] + +\startMPpage + fill Page withcolor "darkyellow" ; + + picture p[] ; + + p1 := image ( draw textext.ulft("PDF") + ysized 4cm + shifted lrcorner Page + withcolor "white" + ; ); + p2 := image ( draw textext.ulft("\strut merging, embedding, fixing") + xsized bbwidth p[1] + shifted lrcorner Page + withcolor "lightgray" + ; ); + p3 := image ( draw textext.ulft("\strut and messing a bit around") + xsized bbwidth p[1] + shifted lrcorner Page + withcolor "lightgray" + ; ); + p4 := image ( draw textext.ulft("\strut in context lmtx") + xsized bbwidth p[1] + shifted lrcorner Page + withcolor "lightgray" + ; ); + draw p[4] shifted (-1cm,1cm) ; + draw p[3] shifted (-1cm,1cm+bbheight(p4)+0cm) ; + draw p[2] shifted (-1cm,1cm+bbheight(p3)+bbheight(p4)+0cm) ; + p[1] := p[1] shifted (-1cm,1cm+bbheight(p2)+bbheight(p3)+bbheight(p4)+15mm); + save dy ; dy := 0 ; + for i=0 upto 7 : + p[1] := p[1] yscaled (1-i/80) ; + draw p[1] + shifted (0,dy) + withtransparency (1,.8-i/10) ; + dy := dy + .6*bbheight(p[1]) ; + endfor ; +\stopMPpage + +\startluacode + backends.registered.pdf.codeinjections.registercompactor { + name = "preset:mine", + identify = { + content = true, + resources = true, + page = true, + }, +-- embed = { +-- type0 = true, +-- truetype = true, +-- type1 = true, +-- }, + merge = { + type0 = true, -- check if a..z A..Z 0..9 + truetype = true, + type1 = true, + LMTX = true, + }, + strip = { +-- group = true, +-- extgstate = true, + marked = true, + }, +-- reduce = { +-- color = true, +-- rgb = true, +-- cmyk = true, +-- }, +-- convert = { +-- rgb = true, +-- cmyk = true, +-- }, +-- add = { +-- cidset, -- when missing or even fix +-- }, + recolor = { + viagray = { 1, 0, 0 }, +-- viagray = { 0, 1, 0 }, +-- viagray = { 0, 1, 0, .5 }, +-- viagray = { .75 }, + } + } +\stopluacode + +\starttext + +The three graphic formats that make most sense for inclusion in \PDF\ are \PNG, +\JPG, and \PDF. The easiest if these is \JPG\ because basically the binary blob +get transferred to the result file. A \PNG\ graphic might need more work because +what actually is supported is basic \PNG\ inclusion. It means that often the +image data has to be unpacked and split into \PDF\ counterparts that get +embedded. The \PDF\ format is quite convenient because basically we only need to +copy the used objects to the result, so when those object are for instance \PNG\ +encoded images, we gain runtime, but when we're talking pages of documents it +might take some more. Nevertheless, in practice it is still quite efficient. + +Here we focus on \PDF\ inclusion where we have sereral scenarios to deal with: + +\startitemize[packed] + \startitem + A straightforward inclusion of a single page \PDF\ file. + \stopitem + \startitem + Inclusion of a specific page from a \PDF\ file. + \stopitem + \startitem + Inclusion of several pages from a \PDF\ file. + \stopitem + \startitem + Inclusion of one or more pages from several \PDF\ files. + \stopitem +\stopitemize + +To this we can add: + +\startitemize + \startitem + Inclusion of one or more pages from \PDF\ files that are generated + independently (subruns) for instance in the process of writing a manual + about something \CONTEXT. Think of externaly processed buffers. + \stopitem +\stopitemize + +When we include more than one page from a file, we only need to embed shared +objects once. Of course it demands some object management but that has to be done +anyway. We could share objects across files but that demands more memory and +runtime and the saving are likely to be small, with one exception: fonts. It +would be nice if we can embed missing fonts and also merge fonts that are the +same. This can make the result much smaller, especially when we're talking of +including examples of typesetting in a manual that uses the same fonts. + +Another aspect of inclusion is the quality of the to be embedded page. Here you +can think of errors in the page stream, color spaces that don't match, missing +properties, invalid metadata, etc. Often there's not much we can do about it, but +sometimes we can. However, it has to happen under user control and the outcome +has to be checked, although often a visual check is good enough. + +The \type {compact} parameter of \type {\externalfigure} controls the embedding +of \PDF\ content. When set to \quote {yes} it will merge fonts but only when the +file is produced by \CONTEXT\ \LMTX. The reason for not checking all fonts by +default comes from the fact that references from the page stream to glyphs in the +font depend on the application that made the \PDF. In some cases the mapping is +using the original glyph index, but one can never be sure. Using the \type +{tounicode} map to go from page stream index to glyph index is also not reliable +because multiple glyphs can have the same \UNICODE\ slot and when font features +are applied (say small caps) you actually don't know that. + +The mentioned \type {yes} option is a preset that has been defined like: + +\starttyping +\startluacode +graphics.registerpdfcompactor ( "yes", { + merge = { + lmtx = true, + }, +} ) +\stopluacode +\stoptyping + +Another preset is \type {merge}: + +\starttyping +\startluacode +graphics.registerpdfcompactor ( "merge", { + merge = { + type0 = true, + truetype = true, + type1 = true, + lmtx = true, + }, +} ) +\stopluacode +\stoptyping + +Currently we don't support \TYPETHREE\ optimization. It is doable but probably +not worth the effort. + +We can also force embedding of fonts that are not included in the document that +we get the page from. This is unlikely unless you have old documents. + +\starttyping +embed = { + type0 = true, + truetype = true, + type1 = true, +} +\stoptyping + +References to glyphs in the page stream use an eight bit string encoding or an +hexadecimal byte pairs. Depending on the font type we have upto 256 references +(using one character or two hex bytes) or at most 65536 references (using two +characters or 4 hex bytes). We normalize everything to hex encoding. That way we +get rid of the ugly escapes and exceptions in page stream glyph string. + +There are two trackers: + +\starttyping +\enabletrackers[graphics.fonts] +\enabletrackers[graphics.fixes] +\stoptyping + +The first one reports what is done with fonts. When embedding of merging is not +possible you can try to remap the found font onto one on your system. Here are +some examples: + +\starttyping +graphics.registerpdffont { + source = "arial", + target = "file:arial.ttf", +} +graphics.registerpdffont { + source = "arial-bold", + target = "file:arialbd.ttf", +} +graphics.registerpdffont { + source = "arial,bold", + target = "file:arialbd.ttf", +} +graphics.registerpdffont { + source = "helvetica", + target = "file:arial.ttf", + -- unicode = true, +} +graphics.registerpdffont { + source = "helvetica-bold", + target = "file:arialbd.ttf", + -- unicode = true, +} +graphics.registerpdffont { + source = "courier", + target = "file:cour.ttf", +} +graphics.registerpdffont { + source = "ms-pgothic", + unicode = true, -- via unicode (false for composite) +} +\stoptyping + +The \type {unicode} key needed when you get rubish due to the indices in the page +stream being different from glyph indices in the used font. In that case we go +via the \type {tounicode} vector which works ok for the average simple document +not using special font features. There is some trial and error involved but that +is probably worth the effort when you have to manipulate many documents. + +There are two activities when we compact: fonts and content. When content is +handled additional parsing of the page stream has to happen. What gets processed +it determined by the \type {identify} table: + +\starttyping +identify = { + content = true, + resources = true, + page = true, +} +\stoptyping + +although this is equivalent: + +\starttyping +identify = "all" +\stoptyping + +As a proof of concept we can recolor an included file. Of course this assumes +a rather simple use of color. Here is an example: + +\startbuffer[demo-1] +\startluacode + graphics.registerpdfcompactor ( "preset:demo-1", { + identify = { + content = true, + resources = true, + page = true, + }, + merge = { + type0 = true, + truetype = true, + type1 = true, + lmtx = true, + }, + recolor = { + viagray = { 1, 0, 0 }, + -- viagray = { 0, 1, 0 }, + -- viagray = { 0, 1, 0, .5 }, + -- viagray = { .75 }, + } + } ) +\stopluacode +\setupexternalfigures[compact=preset:demo-1] +\startTEXpage + \startcombination[3*4] + {\externalfigure[test-000.pdf][frame=on]} {\LUAMETATEX\ 0} + {\externalfigure[test-001.pdf][frame=on]} {\LUATEX\ 1} + {\externalfigure[test-002.pdf][frame=on]} {\LUATEX\ 2} + {\externalfigure[test-003.pdf][frame=on,page=1]} {\LUATEX\ 3.1} + {\externalfigure[test-003.pdf][frame=on,page=2]} {\LUATEX\ 3.2} + {\externalfigure[test-003.pdf][frame=on,page=3]} {\LUATEX\ 3.3} + {\externalfigure[test-004.pdf][frame=on,page=1]} {\PDFTEX\ 4.1} + {\externalfigure[test-004.pdf][frame=on,page=2]} {\PDFTEX\ 4.2} + {\externalfigure[test-004.pdf][frame=on,page=3]} {\PDFTEX\ 4.3} + {\externalfigure[test-005.pdf][frame=on,page=1]} {\PDFTEX\ 4.1} + {\externalfigure[test-005.pdf][frame=on,page=2]} {\PDFTEX\ 5.2} + {\externalfigure[test-005.pdf][frame=on,page=3]} {\PDFTEX\ 5.3} + \stopcombination +\stopTEXpage +\stopbuffer + +\typebuffer[demo-1] + +In \in {figure} [fig:compact-1] we make a single page document that embeds 12 +pages from six files made by several engines. The six files have a total of about +114K but the single page combination is only 19K. The test files are: + +\typefile{test-000} + +So this one is an \LMTX\ produced file. The next two files: + +\typefile{test-001} + +and + +\typefile{test-002} + +are done by \LUATEX\ with \MKIV\ and + +\typefile{test-003} + +as well as + +\typefile{test-004} + +and + +\typefile{test-005} + +are typeset with \PDFTEX\ and \MKII\ so they have the \TYPEONE\ instead of the +\OPENTYPE\ Latin Modern file embedded (in fact, the \MKII\ and \MKIV\ files use +the twelve point variant and \LMTX\ the upscaled ten point, so if those were the +same we would have an even smaller final file. + +\startplacefigure[title={An example of content manipulation.},reference=fig:compact-1] + \typesetbuffer[demo-1][compact=yes] +\stopplacefigure + +A useful manipulation is removing tags. The fact that the content is tagged +doesn't mean that tagging has any use, certainly not if it relates to editing +specific for some application. Maybe at some point I'll add a retagging option +but for now we just strip: + +\starttyping +strip = { + marked = true, + -- group = true, + -- extgstate = true, +} +\stoptyping + +The other two are sort of special and might be needed too, especially when for +instance the states are just there because the producer wasn't clever enough +to leave them out when not applicable. + +It happens that producers use color while actually gray scales are meant. In that +case one can use these: + +\starttyping +reduce = { + color = true, -- both rgb and cmyk + rgb = true, + cmyk = true, +} +\stoptyping + +Using a gray scale is more efficient and in the case of \CMYK\ a sloppy \typ {.5 +.5 .5 0 K} quite likely is meant to be \typ {0 0 0 0.5 K} or just \typ {.5 G}. + +Remapping \RGB\ to \CMYK\ (or gray if applicable) is done with: + +\starttyping +convert = { + rgb = true, + -- cmyk = true, +} +\stoptyping + +and of course one can also remap \CMYK\ to \RGB. + +% \setupexternalfigures[compact=preset:mine] + +% test \type {test} + +% \startTEXpage \externalfigure[test-000.pdf]\stopTEXpage % luametatex +% \startTEXpage \externalfigure[test-001.pdf]\stopTEXpage % luatex +% \startTEXpage \externalfigure[test-002.pdf]\stopTEXpage % luatex +% \dorecurse{3}{ +% \startTEXpage \externalfigure[test-003.pdf][page=#1]\stopTEXpage % luatex +% } +% \dorecurse{3}{ +% \startTEXpage \externalfigure[test-004.pdf][page=#1]\stopTEXpage % pdftex +% } +% \dorecurse{3}{ +% \startTEXpage \externalfigure[test-005.pdf][page=#1]\stopTEXpage % pdftex +% } + +% -- add = { +% -- cidset, -- when missing or even fix +% -- }, + +I want to stress that manipulating the content stream has some limitations. For +instance because objects are shared including a page a second time will reuse the +already converted page. However, you can try the next trick: + +\startbuffer[demo-2] +\startluacode + graphics.registerpdfcompactor ( "preset:demo-2", { + identify = "all", + merge = { lmtx = true }, + recolor = { viagray = { 0, 1, 0 } }, + } ) + graphics.registerpdfcompactor ( "preset:demo-3", { + identify = "all", + merge = { lmtx = true }, + recolor = { viagray = { 0, 0, 1 } }, + } ) + +\stopluacode +\setupexternalfigures[compact=preset:demo-1] +\startTEXpage + \startcombination[2*1] + {\externalfigure + [test-000.pdf] + [frame=on,compact=preset:demo-2,width=6cm,object=no,arguments=1]} + {demo-2} + {\externalfigure + [test-000.pdf] + [frame=on,compact=preset:demo-3,width=6cm,object=no,arguments=2]} + {demo-3} + \stopcombination +\stopTEXpage +\stopbuffer + +\typebuffer[demo-2] + +In \in {figure} [fig:compact-2] we see that indeed a different compactor is used. +We need to disable sharing by setting \type {object} to \type {no}. However, this +will still share some but we abuse the arguments key to create a different +sharing hash (normally that key is used to pass arguments to converters). + +\startplacefigure[title={An example of manipulation content twice.},reference=fig:compact-2] + \typesetbuffer[demo-2][compact=yes] +\stopplacefigure + +I cases where color conversion is problematic (or critical) you can remap +specific colors. Especially \CMYK\ is sensitive for conversion because there we +have four color components while in \RGB\ we have only three. Also watching on a +display (\RGB) is different from looking at a print (\CMYK) and who knows what +transfer function gets applied in the former. Here is how remapping works: + +\starttyping +local cmykmap = { + { 100, 100, 55, 0, 57, 0, 22, 40.8 } +} +graphics.registerpdfcompactor ( "preset:demo-5", { + identify = "all", + merge = { lmtx = true }, + convert = { cmyk = cmykmap }, +} ) +\stoptyping + +Here the entries in a \CMYK\ map are: + +\starttyping + { factor, c, m, y, k, r, g, b } +\stoptyping + +In this case values are multiplied by 100 which makes sure that we catch rounding +errors in the \PDF\ definitions. Keep in mind that colors in many applications +have at most 256 values per component. Also, even quality \LCD\ displays can use +less than eight bits per component. + +\startbuffer[demo-3] +\startluacode + local cmykmap = { + { 100, 100, 55, 0, 57, 0, 22, 40.8 } -- factor, c, m, y, k, r, g, b + } + graphics.registerpdfcompactor ( "preset:demo-4", { + identify = "all", + merge = { lmtx = true }, + convert = { cmyk = true }, + } ) + graphics.registerpdfcompactor ( "preset:demo-5", { + identify = "all", + merge = { lmtx = true }, + convert = { cmyk = cmykmap }, + } ) +\stopluacode +\setupexternalfigures[compact=preset:demo-1] +\startTEXpage + \startcombination[2*1] + {\externalfigure + [test-006.pdf] + [frame=on,compact=preset:demo-4,width=6cm,object=no,arguments=3]} + {demo-4} + {\externalfigure + [test-006.pdf] + [frame=on,compact=preset:demo-5,width=6cm,object=no,arguments=4]} + {demo-5} + \stopcombination +\stopTEXpage +\stopbuffer + +In \in {figure} [fig:compact-3] we show an example. The file used looks like: + +\typefile{test-006.tex} + +\startplacefigure[title={An example of remapping colors.},reference=fig:compact-3] + \typesetbuffer[demo-3][compact=yes] +\stopplacefigure + +I want to stress that you need to check the outcome. Often a visual check is +enough. Extending the compactor beyond what \MKIV\ provided was to a large extend +facilitated by a cooperation with Tan, Syabil M. and Ser, Zheng Y. of \quote +{Team Ramkumar} who did extensive testing and gave enjoyable feedback. In the +process a test script was made that can help with experiments. We assume that +\type {qpdf}, \type {mutool} and \type {graphicmagic} abd \type {verapdf} are +installed. + +\starttyping +mtxrun --script fixpdf --uncompress foo +mtxrun --script fixpdf --convert --compactor=preset:test foo +mtxrun --script fixpdf --validate foo +mtxrun --script fixpdf --check foo +mtxrun --script fixpdf --compare --resolution=300 foo +\stoptyping + +Here we produce an uncompressed version (so that we can see what we deal with), +convert the original into a new one, validate (and check the outcome) and create +a version for visual comparison. It's just an example of usage and here the focus +was on fixing existing documents (six digit numbers so the workflow needs to be +carefully checked) and not so much on single page inclusion. + +\startlines +Hans Hagen +Hasselt NL +January 2024 +\stoplines + +\stopdocument diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/primitives/primitives.tex b/Master/texmf-dist/doc/context/sources/general/manuals/primitives/primitives.tex index f759b79b84d..48943407d53 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/primitives/primitives.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/primitives/primitives.tex @@ -1,9 +1,17 @@ % language=us runpath=texruns:manuals/primitives +\setupexternalfigures + [location={default,global}] + +\enableexperiments[fonts.compact] +\enableexperiments[fonts.accurate] +% \tracepositions + % The usual time stamp. This written while listening intermized to Fish (just ran % into), Lazulli (some yt videos too, looking forward to a next live act) and % because this all is boring checking out Sarah Coopers channel for new DT syncs -% every few hours. +% every few hours. (Picking up writing this manual in 2023 makes me realize how +% time flies.) % When you feel unhappy about the lack of detail in this manual, just keep in mind % that you cannot really demand anything from volunteers: just hope for more (or @@ -13,10 +21,24 @@ % % Hans Hagen | j.hagen @ xs4all . nl | ntg-context @ ntg . nl +% iflastnamedcs +% ignorerest + +% \enableexperiments[fonts.compact] + +\usemodule[system-syntax] +\usemodule[system-units] \usemodule[article-basic] \usemodule[abbreviations-logos] \usemodule[scite] +\setupinteraction + [state=start, + color=, + contrastcolor=, + style=, + contraststyle=] + \definecolor[maincolor][darkblue] \definecolor[primcolor][darkblue] \definecolor[nonecolor][darkgray] @@ -33,13 +55,14 @@ \definehead [newprimitive] - [section] + [subsection] [color=maincolor] \definehead [oldprimitive] - [section] - [color=nonecolor] + [subsection] + [%color=nonecolor, + color=\ifcstok{\structureuservariable{obsolete}}{yes}darkred\else nonecolor\fi] \setuplist [newprimitive] @@ -52,7 +75,13 @@ % We use the next one because we want to check what has been done. In a document % like this using \type {\foo} makes more sense. -\protected\def\prm#1{\doifmode{*bodypart}{\index{\tex{#1}}}\tex{#1}} +\protected\def\prm#1% +% {\doifmode{*bodypart}{\index{\tex{#1}}}\tex{#1}} +% {\ifmode{*bodypart}\index{\tex{#1!\string#1!}}\fi\tex{#1}} + {\ifmode{*bodypart}\index{\tex{#1}}\fi\tex{#1}} + +\protected\def\stx#1% + {\ctxlua{moduledata.engine.specification("#1")}} % only for checking % This is why we need to tag bodymatter. @@ -88,21 +117,24 @@ have been promoted to core primitives that no longer have a \type {pdf} prefix. Then there are lots of new primitives, some introduce new concepts, some are a side effect of for instance new math font technologies, and then there are those that are handy extensions to the macro language. The \LUAMETATEX\ engine drops -quite some primitives, like those related to \PDFTEX\ specific font or backend +quite some primitives, like those related to \PDFTEX\ specific f(r)ont or backend features. It also adds some new primitives, mostly concerning the macro language. We also discuss the primitives that fit into the macro programming scope that are present in traditional \TEX\ and \ETEX\ but there are for sure better of -descriptions out there already. Primitives that relate to typesetting, like those +explanations out there already. Primitives that relate to typesetting, like those controlling math, fonts, boxes, attributes, directions, catcodes, \LUA\ -(functions) etc are not discussed here. +(functions) etc are not discussed or discussed in less detail here. There are for instance primitives to create aliases to low level registers like counters and dimensions, as well as other (semi|-|numeric) quantities like characters, but normally these are wrapped into high level macros so that definitions can't clash too much. Numbers, dimensions etc can be advanced, multiplied and divided and there is a simple expression mechanism to deal with -them. These are not discussed here. +them. We don't go into these details here: it's mostly an overview of what the +engine provides. If you are new to \TEX, you need to play a while with its mixed +bag of typesetting and programming features in order to understand the difference +between this macro language and other languages you might be familiar with. \startcolumns \placelist @@ -115,2950 +147,12314 @@ In this document the section titles that discuss the \color [nonecolor] {origina [primcolor] {\LUATEX\ and \LUAMETATEX\ primitives}. Primitives that extend typesetting related functionality, provide control over -subsystems (like math), allocate additional datatypes and resources, deal with -fonts and languages, manipulate boxes and glyphs, etc.\ are not discussed here. -In this document we concentrate on the programming aspects. - -% \startalign[verytolerant,stretch] -% To be described here: \typ {enforced}, \typ {immutable}, \typ {instance}, -% \typ {aliased}, \typ {mutable}, \typ {overloaded}, \typ {overloadmode}, \typ -% {tolerant}, \typ {permanent}, \typ {ifflags}, \typ {ifinsert}, \typ -% {ifmathparameter}, \typ {ifmathstyle}, \typ {ifparameter}, \typ -% {ifparameters}, \typ {ignorearguments}, \typ {ignorepars}, \typ -% {parametercount}, \typ {lastchkdim}, \typ {lastchknum}. -% -% Of a different order: \typ {adjustspacing}, \typ {adjustspacingshrink}, \typ -% {adjustspacingstep}, \typ {adjustspacingstretch}, \typ {attribute}, \typ -% {attributedef}, \typ {automaticdiscretionary}, \typ {automatichyphenpenalty}, -% \typ {automigrationmode}, \typ {boundary}, \typ {boxattribute}, \typ -% {boxdirection}, \typ {boxorientation}, \typ {boxtotal}, \typ {boxxmove}, \typ -% {boxxoffset}, \typ {boxymove}, \typ {boxyoffset}, \typ {catcodetable}, \typ -% {clearmarks}, \typ {crampeddisplaystyle}, \typ {crampedscriptscriptstyle}, \typ -% {crampedscriptstyle}, \typ {crampedtextstyle}, \typ {directlua}, \typ {efcode}, -% \typ {everybeforepar}, \typ {everytab}, \typ {exceptionpenalty}, \typ -% {explicitdiscretionary}, \typ {explicithyphenpenalty}, \typ {firstvalidlanguage}, -% \typ {fontid}, \typ {fontmathcontrol}, \typ {fontspecifiedsize}, \typ -% {fonttextcontrol}, \typ {formatname}, \typ {gleaders}, \typ {gluespecdef}, \typ -% {glyphdatafield}, \typ {glyphoptions}, \typ {glyphscale}, \typ -% {glyphscriptfield}, \typ {glyphscriptscale}, \typ {glyphscriptscriptscale}, \typ -% {glyphstatefield}, \typ {glyphtextscale}, \typ {glyphxoffset}, \typ -% {glyphxscale}, \typ {glyphyoffset}, \typ {glyphyscale}, \typ {hccode}, \typ -% {hjcode}, \typ {hpack}, \typ {hyphenationmin}, \typ {hyphenationmode}, \typ -% {initcatcodetable}, \typ {insertbox},\typ {insertcopy}, \typ {insertdepth}, \typ -% {insertdistance}, \typ {insertheight}, \typ {insertheights}, \typ {insertlimit}, -% \typ {insertmode}, \typ {insertmultiplier}, \typ {insertprogress}, \typ -% {insertunbox}, \typ {insertuncopy}, \typ {insertwidth}, \typ {lastnodesubtype}, -% \typ {leftmarginkern}, \typ {letcharcode}, \typ {linedirection}, \typ {linepar}, -% \typ {localbrokenpenalty}, \typ {localinterlinepenalty}, \typ {lpcode}, \typ -% {luabytecode}, \typ {luabytecodecall}, \typ {luacopyinputnodes}, \typ {luadef}, -% \typ {luaescapestring}, \typ {luafunction}, \typ {luafunctioncall}, \typ -% {luatexbanner}, \typ {luatexrevision}, \typ {luatexversion}, \typ -% {mathcontrolmode}, \typ {mathdelimitersmode}, \typ {mathdirection}, \typ -% {mathdisplayskipmode}, \typ {matheqnogapstep}, \typ {mathflattenmode}, \typ -% {mathfontcontrol}, \typ {mathitalicsmode}, \typ {mathnolimitsmode}, \typ -% {mathpenaltiesmode}, \typ {mathrulesfam}, \typ {mathrulesmode}, \typ -% {mathrulethicknessmode}, \typ {mathscale}, \typ {mathscriptboxmode}, \typ -% {mathscriptcharmode}, \typ {mathscriptsmode}, \typ {mathstyle}, \typ -% {mathsurroundmode}, \typ {mathsurroundskip}, \typ {mugluespecdef}, \typ -% {noaligned}, \typ {noboundary}, \typ {nohrule}, \typ {normalizelinemode}, \typ -% {nospaces}, \typ {novrule}, \typ {numericscale}, \typ {numexpression}, \typ -% {outputbox}, \typ {parattribute}, \typ {pardirection}, \typ {postexhyphenchar}, -% \typ {posthyphenchar}, \typ {prebinoppenalty}, \typ {predisplaygapfactor}, \typ -% {preexhyphenchar}, \typ {prehyphenchar}, \typ {prerelpenalty}, \typ -% {protrudechars}, \typ {protrusionboundary}, \typ {pxdimen}, \typ {quitvmode}, -% \typ {retokenize}, \typ {rightmarginkern}, \typ {rpcode}, \typ -% {savecatcodetable}, \typ {scantextokens}, \typ {semiexpanded}, \typ {setfontid}, -% \typ {snapshotpar}, \typ {supmarkmode}, \typ {textdirection}, \typ -% {thewithoutunit}, \typ {tpack}, \typ {tracingexpressions}, \typ {tracingfonts}, -% \typ {tracinghyphenation}, \typ {tracingmath}, \typ {undent}, \typ {vpack}, \typ -% {wordboundary}, \typ {wrapuppar}. -% \stopalign -% +subsystems (like math), allocate additional data types and resources, deal with +fonts and languages, manipulate boxes and glyphs, etc.\ are hardly discussed +here, only mentioned. Math for instance is a topic of its own. In this document +we concentrate on the programming aspects. + +Most of the new primitives are discussed in specific manuals and often also +original primitives are covered there but the best explanations of the +traditional primitives can be found in The \TEX book by Donald Knuth and \TEX\ by +Topic from Victor Eijkhout. I see no need to try to improve on those. + % {\em Some new primitives in this list might be forgotten or already became % obsolete. Let me know if you run into one.} \stopsubject -\page - % When writing this manual I also decided to merge some of the condition related % code so that it dealt a bit more natural with the newer features. A usual side % effects if writing manuals. -\startoldprimitive[title={\prm {meaning}}] - -We start with a primitive that will be used in the following sections. The -reported meaning can look a bit different than the one reported by other engines -which is a side effect of additional properties and more extensive argument -parsing. +\startsubject[title=Primitives] -\startbuffer -\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaning\foo -\stopbuffer +\startoldprimitive[title={\prm {}}] -\typebuffer \getbuffer +This original \TEX\ primitive is equivalent to the more verbose \prm +{explicitspace}. \stopoldprimitive -\startnewprimitive[title={\prm {meaningless}}] +\startoldprimitive[title={\prm {-}}] -This one reports a bit less than \prm {meaning}. +This original \TEX\ primitive is equivalent to the more verbose \prm +{explicitdiscretionary}. -\startbuffer -\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningless\foo -\stopbuffer +\stopoldprimitive -\typebuffer \getbuffer +\startoldprimitive[title={\prm {/}}] -\stopnewprimitive +This original \TEX\ primitive is equivalent to the more verbose \prm +{explicititaliccorrection}. -\startnewprimitive[title={\prm {meaningfull}}] +\stopoldprimitive -This one reports a bit more than \prm {meaning}. +% \startnewprimitive[title={\prm {Uabove}}] +% \stopnewprimitive -\startbuffer -\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningfull\foo -\stopbuffer +% \startnewprimitive[title={\prm {Uabovewithdelims}}] +% \stopnewprimitive -\typebuffer \getbuffer +% \startnewprimitive[title={\prm {Uatop}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Uatopwithdelims}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {meaningasis}}] +% \startnewprimitive[title={\prm {Udelcode}}] +% \stopnewprimitive -Although it is not really round trip with the original due to information -being lost this primitive tries to return an equivalent definition. +% \startnewprimitive[title={\prm {Udelimited}}] +% \stopnewprimitive -\startbuffer -\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningasis\foo -\stopbuffer +% \startnewprimitive[title={\prm {Udelimiter}}] +% \stopnewprimitive -\typebuffer \getbuffer +% \startnewprimitive[title={\prm {Udelimiterover}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Udelimiterunder}}] +% \stopnewprimitive -% \startoldprimitive[title={\prm {par}}] -% \stopoldprimitive -% -% \startoldprimitive[title={\prm {linepar}}] -% \stopoldprimitive +% \startnewprimitive[title={\prm {Uhextensible}}] +% \stopnewprimitive -\startoldprimitive[title={\prm {afterassignment}}] +% \startnewprimitive[title={\prm {Uleft}}] +% \stopnewprimitive -The token following \prm {afterassignment}, a traditional \TEX\ primitive, is -saved and gets injected (and then expanded) after a following assignment took -place. +% \startnewprimitive[title={\prm {Umathaccent}}] +% \stopnewprimitive -\startbuffer -\afterassignment !\def\MyMacro {}\quad -\afterassignment !\let\MyMacro ?\quad -\afterassignment !\scratchcounter 123\quad -\afterassignment !% -\afterassignment ?\advance\scratchcounter by 1 -\stopbuffer +% \startnewprimitive[title={\prm {Umathaccentbasedepth}}] +% \stopnewprimitive -\typebuffer +% \startnewprimitive[title={\prm {Umathaccentbaseheight}}] +% \stopnewprimitive -The \prm {afterassignment}s are not accumulated, the last one wins: +% \startnewprimitive[title={\prm {Umathaccentbottomovershoot}}] +% \stopnewprimitive -{\getbuffer} +% \startnewprimitive[title={\prm {Umathaccentbottomshiftdown}}] +% \stopnewprimitive -\stopoldprimitive +% \startnewprimitive[title={\prm {Umathaccentextendmargin}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {afterassigned}}] +% \startnewprimitive[title={\prm {Umathaccentsuperscriptdrop}}] +% \stopnewprimitive -The \prm {afterassignment} primitive stores a token to be injected (and thereby -expanded) after an assignment has happened. Unlike \prm {aftergroup}, multiple -calls are not accumulated, and changing that would be too incompatible. This is -why we have \prm {afterassigned}, which can be used to inject a bunch of -tokens. But in order to be consistent this one is also not accumulative. +% \startnewprimitive[title={\prm {Umathaccentsuperscriptpercent}}] +% \stopnewprimitive -\startbuffer -\afterassigned{done}% -\afterassigned{{\bf done}}% -\scratchcounter=123 -\stopbuffer +% \startnewprimitive[title={\prm {Umathaccenttopovershoot}}] +% \stopnewprimitive -\typebuffer +% \startnewprimitive[title={\prm {Umathaccenttopshiftup}}] +% \stopnewprimitive -results in: \inlinebuffer\ being typeset. +% \startnewprimitive[title={\prm {Umathaccentvariant}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathadapttoleft}}] +% \stopnewprimitive -\startoldprimitive[title={\prm {aftergroup}}] +% \startnewprimitive[title={\prm {Umathadapttoright}}] +% \stopnewprimitive -The traditional \TEX\ \prm {aftergroup} primitive stores the next token and -expands that after the group has been closed. +% \startnewprimitive[title={\prm {Umathaxis}}] +% \stopnewprimitive -\startbuffer -before{ ! \aftergroup a\aftergroup f\aftergroup t\aftergroup e\aftergroup r} -\stopbuffer +% \startnewprimitive[title={\prm {Umathbottomaccentvariant}}] +% \stopnewprimitive -Multiple \prm {aftergroup}s are combined: +% \startnewprimitive[title={\prm {Umathchar}}] +% \stopnewprimitive -\typebuffer +% \startnewprimitive[title={\prm {Umathchardef}}] +% \stopnewprimitive -\getbuffer +% \startnewprimitive[title={\prm {Umathcode}}] +% \stopnewprimitive -\stopoldprimitive +% \startnewprimitive[title={\prm {Umathconnectoroverlapmin}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {aftergrouped}}] +% \startnewprimitive[title={\prm {Umathdegreevariant}}] +% \stopnewprimitive -The in itself powerful \prm {aftergroup} primitives works quite well, even -if you need to do more than one thing: you can either use it multiple times, or -you can define a macro that does multiple things and apply that after the group. -However, you can avoid that by using this primitive which takes a list of tokens. +% \startnewprimitive[title={\prm {Umathdelimiterextendmargin}}] +% \stopnewprimitive -\startbuffer -regular -\bgroup -\aftergrouped{regular}% -\bf bold -\egroup -\stopbuffer +% \startnewprimitive[title={\prm {Umathdelimiterovervariant}}] +% \stopnewprimitive -\typebuffer +% \startnewprimitive[title={\prm {Umathdelimiterpercent}}] +% \stopnewprimitive -Because it happens after the group, we're no longer typesetting in bold. +% \startnewprimitive[title={\prm {Umathdelimitershortfall}}] +% \stopnewprimitive -{\getbuffer} +% \startnewprimitive[title={\prm {Umathdelimiterundervariant}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathdenominatorvariant}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {atendofgroup}}] +% \startnewprimitive[title={\prm {Umathdictdef}}] +% \stopnewprimitive -The token provided will be injected just before the group ends. Because -these tokens are collected, you need to be aware of possible interference -between them. However, normally this is managed by the macro package. +% \startnewprimitive[title={\prm {Umathexheight}}] +% \stopnewprimitive -\startbuffer -\bgroup -\atendofgroup\unskip -\atendofgroup )% -(but it works okay -\egroup -\stopbuffer +% \startnewprimitive[title={\prm {Umathextrasubpreshift}}] +% \stopnewprimitive -\typebuffer +% \startnewprimitive[title={\prm {Umathextrasubprespace}}] +% \stopnewprimitive -Of course these effects can also be achieved by combining (extra) grouping with -\prm {aftergroup} calls, so this is more a convenience primitives than a real -necessity: {\inlinebuffer}, as proven here. +% \startnewprimitive[title={\prm {Umathextrasubshift}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathextrasubspace}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {atendofgrouped}}] +% \startnewprimitive[title={\prm {Umathextrasuppreshift}}] +% \stopnewprimitive -This is the multi token variant of \prm {atendofgroup}. Of course the next -example is somewhat naive when it comes to spacing and so, but it shows the -purpose. +% \startnewprimitive[title={\prm {Umathextrasupprespace}}] +% \stopnewprimitive -\startbuffer -\bgroup -\atendofgrouped{\bf QED}% -\atendofgrouped{ (indeed)}% -This sometimes looks nicer. -\egroup -\stopbuffer +% \startnewprimitive[title={\prm {Umathextrasupshift}}] +% \stopnewprimitive -\typebuffer +% \startnewprimitive[title={\prm {Umathextrasupspace}}] +% \stopnewprimitive -Multiple invocations are accumulated: {\inlinebuffer}. +% \startnewprimitive[title={\prm {Umathflattenedaccentbasedepth}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathflattenedaccentbaseheight}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {toksapp}}] +% \startnewprimitive[title={\prm {Umathflattenedaccentbottomshiftdown}}] +% \stopnewprimitive -One way to append something to a token list is the following: +% \startnewprimitive[title={\prm {Umathflattenedaccenttopshiftup}}] +% \stopnewprimitive -\starttyping -\scratchtoks\expandafter{\the\scratchtoks more stuff} -\stoptyping +% \startnewprimitive[title={\prm {Umathfractiondelsize}}] +% \stopnewprimitive -This works all right, but it involves a copy of what is already in \type -{\scratchtoks}. This is seldom a real issue unless we have large token lists and -many appends. This is why \LUATEX\ introduced: +% \startnewprimitive[title={\prm {Umathfractiondenomdown}}] +% \stopnewprimitive -\starttyping -\toksapp\scratchtoks{more stuff} -\toksapp\scratchtoksone\scratchtokstwo -\stoptyping +% \startnewprimitive[title={\prm {Umathfractiondenomvgap}}] +% \stopnewprimitive -At some point, when working on \LUAMETATEX, I realized that primitives like this -one and the next appenders and prependers to be discussed were always on the -radar of Taco and me. Some were even implemented in what we called \type {eetex}: -extended \ETEX, and we even found back the prototypes, dating from pre|-|\PDFTEX\ -times. +% \startnewprimitive[title={\prm {Umathfractionnumup}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathfractionnumvgap}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {etoksapp}}] +% \startnewprimitive[title={\prm {Umathfractionrule}}] +% \stopnewprimitive -A variant of \prm {toksapp} is the following: it expands the to be appended -content. +% \startnewprimitive[title={\prm {Umathfractionvariant}}] +% \stopnewprimitive -\starttyping -\def\temp{more stuff} -\etoksapp\scratchtoks{some \temp} -\stoptyping +% \startnewprimitive[title={\prm {Umathhextensiblevariant}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathlimitabovebgap}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {tokspre}}] +% \startnewprimitive[title={\prm {Umathlimitabovekern}}] +% \stopnewprimitive -Where appending something is easy because of the possible \prm {expandafter} -trickery a prepend would involve more work, either using temporary token -registers and|/|or using a mixture of the (no)expansion added by \ETEX, but all -are kind of inefficient and cumbersome. +% \startnewprimitive[title={\prm {Umathlimitabovevgap}}] +% \stopnewprimitive -\starttyping -\tokspre\scratchtoks{less stuff} -\tokspre\scratchtoksone\scratchtokstwo -\stoptyping +% \startnewprimitive[title={\prm {Umathlimitbelowbgap}}] +% \stopnewprimitive -This prepends the token list that is provided. +% \startnewprimitive[title={\prm {Umathlimitbelowkern}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathlimitbelowvgap}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {etokspre}}] +% \startnewprimitive[title={\prm {Umathlimits}}] +% \stopnewprimitive -A variant of \prm {tokspre} is the following: it expands the to be prepended -content. +% \startnewprimitive[title={\prm {Umathnoaxis}}] +% \stopnewprimitive -\starttyping -\def\temp{less stuff} -\etokspre\scratchtoks{a bit \temp} -\stoptyping +% \startnewprimitive[title={\prm {Umathnolimits}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathnolimitsubfactor}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {gtoksapp}}] +% \startnewprimitive[title={\prm {Umathnolimitsupfactor}}] +% \stopnewprimitive -This is the global variant of \prm {toksapp}. +% \startnewprimitive[title={\prm {Umathnumeratorvariant}}] +% \stopnewprimitive -\stopnewprimitive +% \startnewprimitive[title={\prm {Umathopenupdepth}}] +% \stopnewprimitive -\startnewprimitive[title={\prm {xtoksapp}}] +% \startnewprimitive[title={\prm {Umathopenupheight}}] +% \stopnewprimitive -This is the global variant of \prm {etoksapp}. +% \startnewprimitive[title={\prm {Umathoperatorsize}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverbarkern}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverbarrule}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverbarvgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverdelimiterbgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverdelimitervariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverdelimitervgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverlayaccentvariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathoverlinevariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathphantom}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathpresubshiftdistance}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathpresupshiftdistance}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathprimeraise}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathprimeraisecomposed}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathprimeshiftdrop}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathprimeshiftup}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathprimespaceafter}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathprimevariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathprimewidth}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathquad}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicaldegreeafter}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicaldegreebefore}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicaldegreeraise}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicalextensibleafter}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicalextensiblebefore}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicalkern}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicalrule}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicalvariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathradicalvgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathruledepth}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathruleheight}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathskeweddelimitertolerance}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathskewedfractionhgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathskewedfractionvgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsource}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathspaceafterscript}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathspacebeforescript}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathspacebetweenscript}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathstackdenomdown}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathstacknumup}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathstackvariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathstackvgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubscriptsnap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubscriptvariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubshiftdistance}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubshiftdown}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubshiftdrop}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubsupshiftdown}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubsupvgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsubtopmax}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsupbottommin}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsuperscriptsnap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsuperscriptvariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsupshiftdistance}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsupshiftdrop}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsupshiftup}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathsupsubbottommax}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathtopaccentvariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathunderbarkern}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathunderbarrule}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathunderbarvgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathunderdelimiterbgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathunderdelimitervariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathunderdelimitervgap}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathunderlinevariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathuseaxis}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathvextensiblevariant}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathvoid}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathxscale}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umathyscale}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Umiddle}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uoperator}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uover}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uoverdelimiter}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uoverwithdelims}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uradical}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uright}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uroot}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Urooted}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uskewed}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uskewedwithdelims}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustartdisplaymath}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustartmath}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustartmathmode}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustopdisplaymath}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustopmath}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustopmathmode}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustretched}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Ustretchedwithdelims}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uunderdelimiter}}] +% \stopnewprimitive + +% \startnewprimitive[title={\prm {Uvextensible}}] +% \stopnewprimitive + +\startoldprimitive[title={\prm {above}}][obsolete=yes] + +This is a variant of \prm {over} that doesn't put a rule in between. + +\stopoldprimitive + +\startoldprimitive[title={\prm {abovedisplayshortskip}}] + +The glue injected before a display formula when the line above it is not +overlapping with the formula. Watch out for interference with \prm +{baselineskip}. It can be controlled by \prm {displayskipmode}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {abovedisplayskip}}] + +The glue injected before a display formula. Watch out for interference with +\prm {baselineskip}. It can be controlled by \prm {displayskipmode}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {abovewithdelims}}][obsolete=yes] + +This is a variant of \prm {atop} but with delimiters. It has a more advanced +upgrade in \prm {Uabovewithdelims}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {accent}}][obsolete=yes] + +This primitive is kind of obsolete in wide engines and takes two arguments: the +indexes of an accent and a base character. + +\stopoldprimitive + +\startnewprimitive[title={\prm {additionalpageskip}}] + +This quantity will be added to the current page goal, stretch and shrink after +which it will be set to zero. + +\stopnewprimitive + +\startoldprimitive[title={\prm {adjdemerits}}] + +When \TEX\ considers to lines to be incompatible it will add this penalty to its +verdict when considering this breakpoint. + +\stopoldprimitive + +\startnewprimitive[title={\prm {adjustspacing}}] + +This parameter controls expansion (hz). A value~2 expands glyphs and font kerns +and a value of~3 only glyphs. Expansion of kerns can have side effects when they +are used for positioning by \OPENTYPE\ features. + +\stopnewprimitive + +\startnewprimitive[title={\prm {adjustspacingshrink}}] + +When set to a non zero value this overloads the shrink maximum in a font when +expansion is applied. This is then the case for all fonts. + +\stopnewprimitive + +\startnewprimitive[title={\prm {adjustspacingstep}}] + +When set to a non zero value this overloads the expansion step in a font when +expansion is applied. This is then the case for all fonts. + +\stopnewprimitive + +\startnewprimitive[title={\prm {adjustspacingstretch}}] + +When set to a non zero value this overloads the stretch maximum in a font when +expansion is applied. This is then the case for all fonts. + +\stopnewprimitive + +\startoldprimitive[title={\prm {advance}}] + +Advances the given register by an also given value: + +\starttyping +\advance\scratchdimen 10pt +\advance\scratchdimen by 3pt +\advance\scratchcounterone \zerocount +\advance\scratchcounterone \scratchcountertwo +\stoptyping + +The \type {by} keyword is optional. + +\stopoldprimitive + +\startnewprimitive[title={\prm {advanceby}}] + +This is slightly more efficient variant of \prm {advance} that doesn't look for +\type {by} and therefore, if one is missing, doesn't need to push back the last +seen token. Using \prm {advance} with \type {by} is nearly as efficient but takes +more tokens. + +\stopnewprimitive + +\startnewprimitive[title={\prm {afterassigned}}] + +The \prm {afterassignment} primitive stores a token to be injected (and thereby +expanded) after an assignment has happened. Unlike \prm {aftergroup}, multiple +calls are not accumulated, and changing that would be too incompatible. This is +why we have \prm {afterassigned}, which can be used to inject a bunch of +tokens. But in order to be consistent this one is also not accumulative. + +\startbuffer +\afterassigned{done}% +\afterassigned{{\bf done}}% +\scratchcounter=123 +\stopbuffer + +\typebuffer + +results in: \inlinebuffer\ being typeset. + +\stopnewprimitive + +\startoldprimitive[title={\prm {afterassignment}}] + +The token following \prm {afterassignment}, a traditional \TEX\ primitive, is +saved and gets injected (and then expanded) after a following assignment took +place. + +\startbuffer +\afterassignment !\def\MyMacro {}\quad +\afterassignment !\let\MyMacro ?\quad +\afterassignment !\scratchcounter 123\quad +\afterassignment !% +\afterassignment ?\advance\scratchcounter by 1 +\stopbuffer + +\typebuffer + +The \prm {afterassignment}s are not accumulated, the last one wins: + +{\getbuffer} + +\stopoldprimitive + +\startoldprimitive[title={\prm {aftergroup}}] + +The traditional \TEX\ \prm {aftergroup} primitive stores the next token and +expands that after the group has been closed. + +\startbuffer +before{ ! \aftergroup a\aftergroup f\aftergroup t\aftergroup e\aftergroup r} +\stopbuffer + +Multiple \prm {aftergroup}s are combined: + +\typebuffer + +\getbuffer + +\stopoldprimitive + +\startnewprimitive[title={\prm {aftergrouped}}] + +The in itself powerful \prm {aftergroup} primitives works quite well, even +if you need to do more than one thing: you can either use it multiple times, or +you can define a macro that does multiple things and apply that after the group. +However, you can avoid that by using this primitive which takes a list of tokens. + +\startbuffer +regular +\bgroup +\aftergrouped{regular}% +\bf bold +\egroup +\stopbuffer + +\typebuffer + +Because it happens after the group, we're no longer typesetting in bold. + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {aliased}}] + +This primitive is part of the overload protection subsystem where control sequences +can be tagged. + +\startbuffer +\permanent\def\foo{FOO} + \let\ofo\foo +\aliased \let\oof\foo + +\meaningasis\foo +\meaningasis\ofo +\meaningasis\oof +\stopbuffer + +\typebuffer + +gives: + +\startlines \tt +\getbuffer +\stoplines + +When a something is \prm {let} the \quote {permanent}, \quote {primitive} and +\quote {immutable} flags are removed but the \prm {aliased} prefix retains +them. + +\startbuffer +\let\relaxed\relax + +\meaningasis\relax +\meaningasis\relaxed +\stopbuffer + +\typebuffer + +So in this example the \type {\relaxed} alias is not flagged as primitive: + +\startlines \tt +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {aligncontent}}] + +This is equivalent to a hash in an alignment preamble. Contrary to \prm +{alignmark} there is no need to duplicate inside a macro definition. + +\stopnewprimitive + +\startnewprimitive[title={\prm {alignmark}}] + +When you have the \type {#} not set up as macro parameter character cq.\ align +mark, you can use this primitive instead. The same rules apply with respect to +multiple such tokens in (nested) macros and alignments. + +\stopnewprimitive + +\startnewprimitive[title={\prm {alignmentcellsource}}] + +This sets the source id (a box property) of the current alignment cell. + +\stopnewprimitive + +\startnewprimitive[title={\prm {alignmentwrapsource}}] + +This sets the source id (a box property) of the current alignment row (in a \prm +{halign}) or column (in a \prm {valign}). + +\stopnewprimitive + +\startnewprimitive[title={\prm {aligntab}}] + +When you have the \type {&} not set up as align tab, you can use this primitive +instead. The same rules apply with respect to multiple such tokens in (nested) +macros and alignments. + +\stopnewprimitive + +\startnewprimitive[title={\prm {allcrampedstyles}}] + +A symbolic representation of \prm {crampeddisplaystyle}, \prm {crampedtextstyle}, +\prm {crampedscriptstyle} and \prm {crampedscriptscriptstyle}; integer +representation: \the\allcrampedstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {alldisplaystyles}}] + +A symbolic representation of \prm {displaystyle} and \prm {crampeddisplaystyle}; +integer representation: \the\alldisplaystyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {allmainstyles}}] + +A symbolic representation of \prm {displaystyle}, \prm {crampeddisplaystyle}, +\prm {textstyle} and \prm {crampedtextstyle}; integer representation: +\the\allmainstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {allmathstyles}}] + +A symbolic representation of \prm {displaystyle}, \prm {crampeddisplaystyle}, +\prm {textstyle}, \prm {crampedtextstyle}, \prm {scriptstyle}, \prm +{crampedscriptstyle}, \prm {scriptscriptstyle} and \prm +{crampedscriptscriptstyle}; integer representation: \the\allmathstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {allscriptscriptstyles}}] + +A symbolic representation of \prm {scriptscriptstyle} and \prm +{crampedscriptscriptstyle}; integer representation: \the\allscriptscriptstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {allscriptstyles}}] + +A symbolic representation of \prm {scriptstyle} and \prm {crampedscriptstyle}; +integer representation: \the\allscriptstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {allsplitstyles}}] + +A symbolic representation of \prm {displaystyle} and \prm {textstyle} but not +\prm {scriptstyle} and \prm {scriptscriptstyle}: set versus reset; integer +representation: \the\allsplitstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {alltextstyles}}] + +A symbolic representation of \prm {textstyle} and \prm {crampedtextstyle}; +integer representation: \the\alltextstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {alluncrampedstyles}}] + +A symbolic representation of \prm {displaystyle}, \prm {textstyle}, \prm +{scriptstyle} and \prm {scriptscriptstyle}; integer representation: +\the\alluncrampedstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {allunsplitstyles}}] + +A symbolic representation of \prm {scriptstyle} and \prm {scriptscriptstyle}; integer +representation: \the\allunsplitstyles. + +\stopnewprimitive + +\startnewprimitive[title={\prm {amcode}}] +\stopnewprimitive + +\startnewprimitive[title={\prm {associateunit}}] + +The \TEX\ engine comes with some build in units, like \type {pt} (fixed) and +\type {em} (adaptive). On top of that a macro package can add additional units, which is +what we do in \CONTEXT. In \in {figure} [fig:units] we show the current repertoire. + +\startplacefigure[title=Available units,reference=fig:units] + \showunitsmap[tight] + \showunitsmaplegend +\stopplacefigure + +When this primitive is used in a context where a number is expected it returns the origin +of the unit (in the color legend running from 1 upto 4). A new unit is defined as: + +\starttyping +\newdimen\MyDimenZA \MyDimenZA=10pt + +\protected\def\MyDimenAB{\dimexpr\hsize/2\relax} + +\associateunit za \MyDimenZA +\associateunit zb \MyMacroZB +\stoptyping + +Possible associations are: macros that expand to a dimension, internal dimension +registers, register dimensions (\prm {dimendef}, direct dimensions (\prm +{dimensiondef}) and \LUA\ functions that return a dimension. + +One can run into scanning ahead issues where \TEX\ expects a unit and a user unit +gets expanded. This is why for instance in \CONTEXT\ we define the \type{ma} unit +as: + +\starttyping +\protected\def\mathaxisunit{\scaledmathaxis\mathstyle\norelax} + +\associateunit ma \mathaxisunit % or \newuserunit \mathaxisunit ma +\stoptyping + +So that it can be used in rule specifications that themselves look ahead for +keywords and therefore are normally terminated by a \prm {relax}. Adding the +extra \prm {norelax} will make the scanner see one that doesn't get fed back into +the input. Of course a macro package has to manage extra units in order to avoid +conflicts. + +\stopnewprimitive + +\startnewprimitive[title={\prm {atendoffile}}] + +The \prm {everyeof} primitive is kind of useless because you don't know if a file +(which can be a tokenlist processed as pseudo file) itself includes a file, which +then results in nested application of this token register. One way around this is: + +\startbuffer +\atendoffile\SomeCommand +\stopbuffer + +\typebuffer + +This acts on files the same way as \prm {atendofgroup} does. Multiple calls will +be accumulated and are bound to the current file. + +\stopnewprimitive + +\startnewprimitive[title={\prm {atendoffiled}}] + +This is the multi token variant of \prm {atendoffile}. Multiple invocations are +accumulated and by default prepended to the existing list. As with grouping this +permits proper nesting. You can force an append by the optional keyword {reverse}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {atendofgroup}}] + +The token provided will be injected just before the group ends. Because +these tokens are collected, you need to be aware of possible interference +between them. However, normally this is managed by the macro package. + +\startbuffer +\bgroup +\atendofgroup\unskip +\atendofgroup )% +(but it works okay +\egroup +\stopbuffer + +\typebuffer + +Of course these effects can also be achieved by combining (extra) grouping with +\prm {aftergroup} calls, so this is more a convenience primitives than a real +necessity: {\inlinebuffer}, as proven here. + +\stopnewprimitive + +\startnewprimitive[title={\prm {atendofgrouped}}] + +This is the multi token variant of \prm {atendofgroup}. Of course the next +example is somewhat naive when it comes to spacing and so, but it shows the +purpose. + +\startbuffer +\bgroup +\atendofgrouped{\bf QED}% +\atendofgrouped{ (indeed)}% +This sometimes looks nicer. +\egroup +\stopbuffer + +\typebuffer + +Multiple invocations are accumulated: {\inlinebuffer}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {atop}}][obsolete=yes] + +This one stack two math elements on top of each other, like a fraction but with +no rule. It has a more advanced upgrade in \prm {Uatop}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {atopwithdelims}}][obsolete=yes] + +This is a variant of \prm {atop} but with delimiters. It has a more advanced +upgrade in \prm {Uatopwithdelims}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {attribute}}] + +The following sets an attribute(register) value: + +\starttyping +\attribute 999 = 123 +\stoptyping + +An attribute is unset by assigning \the \attributeunsetvalue\ to it. A user needs +to be aware of attributes being used now and in the future of a macro package and +setting them this way is very likely going to interfere. + +\stopnewprimitive + +\startnewprimitive[title={\prm {attributedef}}] + +This primitive can be used to relate a control sequence to an attribute register +and can be used to implement a mechanism for defining unique ones that won't +interfere. As with other registers: leave management to the macro package in +order to avoid unwanted side effects! + +\stopnewprimitive + +\startnewprimitive[title={\prm {automaticdiscretionary}}] + +This is an alias for the automatic hyphen trigger \type {-}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {automatichyphenpenalty}}] + +The penalty injected after an automatic discretionary \type {-}, when \prm +{hyphenationmode} enables this. + +\stopnewprimitive + +\startnewprimitive[title={\prm {automigrationmode}}] + +This bitset determines what will bubble up to an outer level: + +\getbuffer[engine:syntax:automigrationcodes] + +The current value is {\tttf 0x\tohexadecimal\automigrationmode}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {autoparagraphmode}}] + +A paragraph can be triggered by an empty line, a \prm {par} token or an +equivalent of it. This parameter controls how \type {\par} is interpreted in +different scenarios: + +\getbuffer[engine:syntax:autoparagraphcodes] + +The current value is {\tttf 0x\tohexadecimal\autoparagraphmode} and setting it to +a non|-|zero value can have consequences for mechanisms that expect otherwise. +The text option uses the same code as an empty line. The macro option checks a +token in a macro preamble against the frozen \prm {\par} token. The last option +ignores the par token. + +\stopnewprimitive + +\startoldprimitive[title={\prm {badness}}] + +This one returns the last encountered badness value. + +\stopoldprimitive + +\startoldprimitive[title={\prm {baselineskip}}] + +This is the maximum glue put between lines. The depth of the previous and height +of the next line are substracted. + +\stopoldprimitive + +\startoldprimitive[title={\prm {batchmode}}] + +This command disables (error) messages which can safe some runtime in situations +where \TEX's character|-|by|-|character log output impacts runtime. It only makes +sense in automated workflows where one doesn't look at the log anyway. + +\stopoldprimitive + +\startnewprimitive[title={\prm {begincsname}}] + +The next code creates a control sequence token from the given serialized tokens: + +\starttyping +\csname mymacro\endcsname +\stoptyping + +When \type {\mymacro} is not defined a control sequence will be created with the +meaning \prm {relax}. A side effect is that a test for its existence might fail +because it now exists. The next sequence will {\em not} create an controil +sequence: + +\starttyping +\begincsname mymacro\endcsname +\stoptyping + +This actually is kind of equivalent to: + +\starttyping +\ifcsname mymacro\endcsname + \csname mymacro\endcsname +\fi +\stoptyping + +\stopnewprimitive + +\startoldprimitive[title={\prm {begingroup}}] + +This primitive starts a group and has to be ended with \prm {endgroup}. See \prm +{beginsimplegroup} for more info. + +\stopoldprimitive + +\startnewprimitive[title={\prm {beginlocalcontrol}}] + +Once \TEX\ is initialized it will enter the main loop. In there certain commands +trigger a function that itself can trigger further scanning and functions. In +\LUAMETATEX\ we can have local main loops and we can either enter it from the +\LUA\ end (which we don't discuss here) or at the \TEX\ end using this primitive. + +\startbuffer +\scratchcounter100 + +\edef\whatever{ + a + \beginlocalcontrol + \advance\scratchcounter 10 + b + \endlocalcontrol + \beginlocalcontrol + c + \endlocalcontrol + d + \advance\scratchcounter 10 +} + +\the\scratchcounter +\whatever +\the\scratchcounter +\stopbuffer + +\typebuffer + +A bit of close reading probably gives an impression of what happens here: + +{\getbuffer} + +The local loop can actually result in material being injected in the current node +list. However, where normally assignments are not taking place in an \prm +{edef}, here they are applied just fine. Basically we have a local \TEX\ job, be +it that it shares all variables with the parent loop. + +\stopnewprimitive + +\startnewprimitive[title={\prm {beginmathgroup}}] + +In math mode grouping with \prm {begingroup} and \prm {endgroup} in some cases +works as expected, but because the math input is converted in a list that gets +processed later some settings can become persistent, like changes in style or +family. The engine therefore provides the alternatives \prm {beginmathgroup} and +\prm {endmathgroup} that restore some properties. + +\stopnewprimitive + +\startnewprimitive[title={\prm {beginsimplegroup}}] + +The original \TEX\ engine distinguishes two kind of grouping that at the user end +show up as: + +\starttyping +\begingroup \endgroup +\bgroup \egroup { } +\stoptyping + +where the last two pairs are equivalent unless the scanner explicitly wants to see a +left and|/|or right brace and not an equivalent. For the sake of simplify we use +the aliases here. It is not possible to mix these pairs, so: + +\starttyping +\bgroup xxx\endgroup +\begingroup xxx\egroup +\stoptyping + +will in both cases issue an error. This can make it somewhat hard to write generic +grouping macros without somewhat dirty trickery. The way out is to use the generic +group opener \prm {beginsimplegroup}. + +Internally \LUAMETATEX\ is aware of what group it currently is dealing with and +there we distinguish: + +\starttabulate[||||] +\NC simple group \NC \type {\bgroup} \NC \type {\egroup} \NC \NR +\NC semi simple group \NC \type {\begingroup} \NC \type {\endgroup} \type {\endsimplegroup} \NC \NR +\NC also simple group \NC \type {\beginsimplegroup} \NC \type {\egroup} \type {\endgroup} \type {\endsimplegroup} \NC \NR +\NC math simple group \NC \type {\beginmathgroup} \NC \type {\endmathgroup} \NC \NR +\stoptabulate + +This means that you can say: + +\starttyping +\beginsimplegroup xxx\endsimplegroup +\beginsimplegroup xxx\endgroup +\beginsimplegroup xxx\egroup +\stoptyping + +So a group started with \prm {beginsimplegroup} can be finished in three ways +which means that the user (or calling macro) doesn't have take into account what +kind of grouping was used to start with. Normally usage of this primitive is +hidden in macros and not something the user has to be aware of. + +\stopnewprimitive + +\startoldprimitive[title={\prm {belowdisplayshortskip}}] + +The glue injected aftter a display formula when the line above it is not +overlapping with the formula (\TEX\ can't look ahead). Watch out for interference +with \prm {baselineskip}. It can be controlled by \prm {displayskipmode}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {belowdisplayskip}}] + +The glue injected after a display formula. Watch out for interference with \prm +{baselineskip}. It can be controlled by \prm {displayskipmode}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {binoppenalty}}][obsolete=yes] + +This internal quantity is a compatibility feature because normally we will use +the inter atom spacing variables. + +\stopoldprimitive + +\startoldprimitive[title={\prm {botmark}}][obsolete=yes] + +This is a reference to the last mark on the current page, it gives back tokens. + +\stopoldprimitive + +\startoldprimitive[title={\prm {botmarks}}] + +This is a reference to the last mark with the given id (a number) on the current +page, it gives back tokens. + +\stopoldprimitive + +\startnewprimitive[title={\prm {boundary}}] + +Boundaries are signals added to he current list. This primitive injects a user +boundary with the given (integer) value. Such a boundary can be consulted at the +\LUA\ end or with \prm {lastboundary}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {box}}] + +This is the box register accessor. While other registers have one property a box +has many, like \prm {wd}, \prm {ht} and \prm {dp}. This primitive returns the box +and resets the register. + +\stopoldprimitive + +\startnewprimitive[title={\prm {boxadapt}}] + +Adapting will recalculate the dimensions with a scale factor for the glue: + +\startbuffer +\setbox 0 \hbox {test test test} +\setbox 2 \hbox {\red test test test} \boxadapt 0 200 +\setbox 4 \hbox {\blue test test test} \boxadapt 0 -200 +\ruledhbox{\box0} \vskip-\lineheight +\ruledhbox{\box0} \vskip-\lineheight +\ruledhbox{\box0} +\stopbuffer + +\typebuffer + +Like \prm {boxfreeze} and \prm {boxrepack} this primitive has been introduced for +experimental usage, although we do use some in production code. + +\getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxanchor}}] + +This feature is part of an (experimental) mechanism that relates boxes. The +engine just tags a box and it is up to the macro package to deal with it. + +\startbuffer +\setbox0\hbox anchor "01010202 {test}\tohexadecimal\boxanchor0 +\stopbuffer + +\typebuffer + +This gives: \inlinebuffer. Of course this feature is very macro specific and +should not be used across macro packages without coordination. An anchor has +two parts each not exceeding \type {0x0FFF}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxanchors}}] + +This feature is part of an (experimental) mechanism that relates boxes. The +engine just tags a box and it is up to the macro package to deal with it. + +\startbuffer +\setbox0\hbox anchors "0101 "0202 {test}\tohexadecimal\boxanchors0 +\stopbuffer + +\typebuffer + +This gives: \inlinebuffer. Of course this feature is very macro specific and +should not be used across macro packages without coordination. An anchor has +two parts each not exceeding \type {0x0FFF}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxattribute}}] + +Every node, and therefore also every box gets the attributes set that are +active at the moment of creation. Additional attributes can be set too: + +\startbuffer +\darkred +\setbox0\hbox attr 9999 1 {whatever} +\the\boxattribute 0 \colorattribute +\the\boxattribute 0 9998 +\the\boxattribute 0 9999 +\stopbuffer + +\typebuffer + +A macro package should make provide a way define attributes that don't clash the +ones it needs itself, like, in \CONTEXT, the ones that can set a color + +\startlines \getbuffer \stoplines + +The number \the\attributeunsetvalue\ (\tohexadecimal\attributeunsetvalue) +indicates an unset attribute. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxdirection}}] + +The direction of a box defaults to \type {l2r} but can be explicitly set: + +\startbuffer +\setbox0\hbox direction 1 {this is a test}\textdirection1 +\setbox2\hbox direction 0 {this is a test}\textdirection0 +\the\boxdirection0: \box0 +\the\boxdirection2: \box2 +\stopbuffer + +\typebuffer + +The \prm {textdirection} does not influence the box direction: + +\startlines \getbuffer \stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxfinalize}}] + +This is special version of \prm {boxfreeze} which we demonstrate +with an example: + +\startbuffer[setthem] +\setbox0\ruledvbox to 3cm{\hsize 2cm test\vskip10pt plus 10pt test} +\setbox2\copy0\setbox4\copy0\setbox6\copy0\setbox8\copy0 +\stopbuffer + +\startbuffer[usethem] +\boxlimitate 0 0 % don't recurse +\boxfreeze 2 0 % don't recurse +\boxfinalize 4 500 % scale glue multiplier by .50 +\boxfinalize 6 250 % scale glue multiplier by .25 +\boxfinalize 8 100 % scale glue multiplier by .10 + +\hpack\bgroup + \copy0\quad\copy2\quad\copy4\quad\copy6\quad\copy8 +\egroup +\stopbuffer + +\typebuffer[usethem] + +where the boxes are populated with: + +\typebuffer[setthem] + +\startlinecorrection +\getbuffer[setthem,usethem] +\stoplinecorrection + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxfreeze}}] + +Glue in a box has a fixed component that will always be used and stretch and +shrink that kicks in when needed. The effective value (width) of the glue is +driven by some box parameters that are set by the packaging routine. This is why +we can unbox: the original value is kept. It is the backend that calculates the +effective value. Te \prm {boxfreeze} primitive can do the same: turn the flexible +glue into a fixed one. + +\startbuffer +\setbox 0 \hbox to 6cm {\hss frost} +\setbox 2 \hbox to 6cm {\hss frost} +\boxfreeze 2 0 +\ruledhbox{\unhbox 0} +\ruledhbox{\unhbox 2} +\stopbuffer + +\typebuffer + +The second parameter to \prm {boxfreeze} determines recursion. We don't recurse +here so just freeze the outer level: + +\getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxgeometry}}] + +A box can have an orientation, offsets and|/|or anchors. These are stored +independently but for efficiency reasons we register if one or more of these +properties is set. This primitive accesses this state; it is a bitset: + +\getbuffer[engine:syntax:listgeometrycodes] + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxlimit}}] + +This primitive will freeze the glue in a box but only when there is glue marked +with the limit option. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxlimitate}}] + +This primitive will freeze the glue in a box. It takes two arguments, a box +number and an number that when set to non|-|zero will recurse into nested lists. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxlimitmode}}] + +This variable controls if boxes with glue marked \quote {limit} will be checked +and frozen. + +\stopnewprimitive + +\startoldprimitive[title={\prm {boxmaxdepth}}] + +You can limit the depth of boxes being constructed. It's one of these parameters +that should be used with care because when that box is filled nested boxes can be +influenced. + +\stopoldprimitive + +\startnewprimitive[title={\prm {boxorientation}}] + +The orientation field can take quite some values and is discussed in one of the low level +\CONTEXT\ manuals. Some properties are dealt with in the \TEX\ engine because they +influence dimensions but in the end it is the backend that does the work. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxrepack}}] + +When a box of to wide or tight we can tweak it a bit with this primitive. The +primitive expects a box register and a dimension, where a positive number adds +and a negatie subtracts from the current box with. + +\startbuffer +\setbox 0 \hbox {test test test} +\setbox 2 \hbox {\red test test test} \boxrepack0 +.2em +\setbox 4 \hbox {\green test test test} \boxrepack0 -.2em +\ruledhbox{\box0} \vskip-\lineheight +\ruledhbox{\box0} \vskip-\lineheight +\ruledhbox{\box0} +\stopbuffer + +\typebuffer + +\getbuffer + +We can also use this primitive to check the natural dimensions of a box: + +\startbuffer +\setbox 0 \hbox spread 10pt {test test test} +\ruledhbox{\box0} (\the\boxrepack0,\the\wd0) +\stopbuffer + +\typebuffer + +In this context only one argument is expected. + +\getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxshift}}] + +Returns or sets how much the box is shifted: up or down in horizontally mode, left or +right in vertical mode. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxshrink}}] + +Returns the amount of shrink found (applied) in a box: + +\startbuffer +\setbox0\hbox to 4em {m m m m} +\the\boxshrink0 +\stopbuffer + +\typebuffer + +gives: \inlinebuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxsource}}] + +This feature is part of an (experimental) mechanism that relates boxes. The +engine just tags a box and it is up to the macro package to deal with it. + +\startbuffer +\setbox0\hbox source 123 {m m m m} +\the\boxsource0 +\stopbuffer + +\typebuffer + +This gives: \inlinebuffer. Of course this feature is very macro specific and +should not be used across macro packages without coordination. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxstretch}}] + +Returns the amount of stretch found (applied) in a box: + +\startbuffer +\setbox0\hbox to 6em {m m m m} +\the\boxstretch0 +\stopbuffer + +\typebuffer + +gives: \inlinebuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxtarget}}] + +This feature is part of an (experimental) mechanism that relates boxes. The +engine just tags a box and it is up to the macro package to deal with it. + +\startbuffer +\setbox0\hbox source 123 {m m m m} +\the\boxsource0 +\stopbuffer + +\typebuffer + +This gives: \inlinebuffer. Of course this feature is very macro specific and +should not be used across macro packages without coordination. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxtotal}}] + +Returns the total of height and depth of the given box. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxvadjust}}] + +When used as query this returns a bitset indicating the associated adjust and +migration (marks and inserts) data: + +\starttabulate[|T|l|] +\NC 0x1 \NC pre adjusted \NC \NR +\NC 0x2 \NC post adjusted \NC \NR +\NC 0x4 \NC pre migrated \NC \NR +\NC 0x8 \NC post migrated \NC \NR +\stoptabulate\ + +When used as a setter it directly adds adjust data to the box and it accepts the +same keywords as \prm {vadjust}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxxmove}}] + +This will set the vertical offset and adapt the dimensions accordingly. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxxoffset}}] + +Returns or sets the horizontal offset of the given box. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxymove}}] + +This will set the vertical offset and adapt the dimensions accordingly. + +\stopnewprimitive + +\startnewprimitive[title={\prm {boxyoffset}}] + +Returns or sets the vertical offset of the given box. + +\stopnewprimitive + +\startoldprimitive[title={\prm {brokenpenalty}}] + +This penalty is added after a line that ends with a hyphen; it can help to +discourage a page break (or split in a box). + +\stopoldprimitive + +\startoldprimitive[title={\prm {catcode}}] + +Every character can be put in a category, but this is typically +something that the macro package manages because changes can affect +behavior. Also, once passed as an argument, the catcode of a character +is frozen. There are 16 different values: + +\starttabulate[|l|c|l|c|] +\NC \type {\escapecatcode } \NC \the\escapecatcode +\NC \type {\begingroupcatcode } \NC \the\begingroupcatcode \NC \NR +\NC \type {\endgroupcatcode } \NC \the\endgroupcatcode +\NC \type {\mathshiftcatcode } \NC \the\mathshiftcatcode \NC \NR +\NC \type {\alignmentcatcode } \NC \the\alignmentcatcode +\NC \type {\endoflinecatcode } \NC \the\endoflinecatcode \NC \NR +\NC \type {\parametercatcode } \NC \the\parametercatcode +\NC \type {\superscriptcatcode} \NC \the\superscriptcatcode \NC \NR +\NC \type {\subscriptcatcode } \NC \the\subscriptcatcode +\NC \type {\ignorecatcode } \NC \the\ignorecatcode \NC \NR +\NC \type {\spacecatcode } \NC \the\spacecatcode +\NC \type {\lettercatcode } \NC \the\lettercatcode \NC \NR +\NC \type {\othercatcode } \NC \the\othercatcode +\NC \type {\activecatcode } \NC \the\activecatcode \NC \NR +\NC \type {\commentcatcode } \NC \the\commentcatcode +\NC \type {\invalidcatcode } \NC \the\invalidcatcode \NC \NR +\stoptabulate + +The first column shows the constant that \CONTEXT\ provides and the +name indicates the purpose. Here are two examples: + +\starttyping +\catcode123=\begingroupcatcode +\catcode125=\endgroupcatcode +\stoptyping + +\stopoldprimitive + +\startnewprimitive[title={\prm {catcodetable}}] + +The catcode table with the given index will become active. + +\stopnewprimitive + +\startnewprimitive[title={\prm {cdef}}] + +This primitive is like \prm {edef} but in some usage scenarios is slightly +more efficient because (delayed) expansion is ignored which in turn saves +building a temporary token list. + +\startbuffer +\edef\FooA{this is foo} \meaningfull\FooA\crlf +\cdef\FooB{this is foo} \meaningfull\FooB\par +\stopbuffer + +\typebuffer {\tttf \getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {cdefcsname}}] + +This primitive is like \prm {edefcsame} but in some usage scenarios is slightly +more efficient because (delayed) expansion is ignored which in turn saves +building a temporary token list. + +\startbuffer +\edefcsname FooA\endcsname{this is foo} \meaningasis\FooA\crlf +\cdefcsname FooB\endcsname{this is foo} \meaningasis\FooB\par +\stopbuffer + +\typebuffer {\tttf \getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {cfcode}}] + +This primitive is a companion to \prm {efcode} and sets the compression factor. +It takes three values: font, character code, and factor. + +\stopnewprimitive + +\startoldprimitive[title={\prm {char}}] + +This appends a character with the given index in the current font. + +\stopoldprimitive + +\startoldprimitive[title={\prm {chardef}}] + +The following definition relates a control sequence to a specific character: + +\starttyping +\chardef\copyrightsign"A9 +\stoptyping + +However, because in a context where a number is expected, such a \prm {chardef} +is seen as valid number, there was a time when this primitive was used to define +constants without overflowing the by then limited pool of count registers. In +\ETEX\ aware engines this was less needed, and in \LUAMETATEX\ we have \prm +{integerdef} as a more natural candidate. + +\stopoldprimitive + +\startoldprimitive[title={\prm {cleaders}}] + +See \prm {gleaders} for an explanation. + +\stopoldprimitive + +\startnewprimitive[title={\prm {clearmarks}}] + +This primitive is an addition to the multiple marks mechanism that originates in +\ETEX\ and reset the mark registers of the given category (a number). + +\stopnewprimitive + +\startoldprimitive[title={\prm {clubpenalties}}] + +This is an array of penalty put before the first lines in a paragraph. High values +discourage (or even prevent) a lone line at the end of a page. This +command expects a count value indicating the number of entries that will follow. +The first entry is ends up after the first line. + +\stopoldprimitive + +\startoldprimitive[title={\prm {clubpenalty}}] + +This is the penalty put before a club line in a paragraph. High values discourage +(or even prevent) a lone line at the end of a next page. + +\stopoldprimitive + +\startnewprimitive[title={\prm {constant}}] + +This prefix tags a macro (without arguments) as being constant. The main +consequence is that in some cases expansion gets delayed which gives a little +performance boost and less (temporary) memory usage, for instance in \type +{\csname} like scenarios. + +\stopnewprimitive + +\startnewprimitive[title={\prm {constrained}}] + +See previous section about \prm {retained}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {copy}}] + +This is the box register accessor that returns a copy of the box. + +\stopoldprimitive + +\startnewprimitive[title={\prm {copymathatomrule}}] + +This copies the rule bitset from the parent class (second argument) to the target +class (first argument). The bitset controls the features that apply to atoms. + +\stopnewprimitive + +\startnewprimitive[title={\prm {copymathparent}}] + +This binds the given class (first argument) to another class (second argument) so +that one doesn't need to define all properties. + +\stopnewprimitive + +\startnewprimitive[title={\prm {copymathspacing}}] + +This copies an class spacing specification to another one, so in + +\starttyping +\copymathspacing 34 2 +\stoptyping + +class 34 (a user one) get the spacing from class 2 (binary). + +\stopnewprimitive + +\startoldprimitive[title={\prm {count}}] + +This accesses a count register by index. This is kind of \quote {not done} unless +you do it local and make sure that it doesn't influence macros that you call. + +\starttyping +\count4023=10 +\stoptyping + +In standard \TEX\ the first 10 counters are special because they get reported to +the console, and \type {\count0} is then assumed to be the page counter. + +\stopoldprimitive + +\startoldprimitive[title={\prm {countdef}}] + +This primitive relates a control sequence to a count register. Compare this to +the example in the previous section. + +\starttyping +\countdef\MyCounter4023 +\MyCounter=10 +\stoptyping + +However, this is also \quote {not done}. Instead one should use the allocator that +the macro package provides. + +\starttyping +\newcount\MyCounter +\MyCounter=10 +\stoptyping + +In \LUAMETATEX\ we also have integers that don't rely on registers. These are +assigned by the primitive \prm {integerdef}: + +\starttyping +\integerdef\MyCounterA 10 +\stoptyping + +Or better \type {\newinteger}. + +\starttyping +\newinteger\MyCounterB +\MyCounterN10 +\stoptyping + +There is a lowlevel manual on registers. + +\stopoldprimitive + +\startoldprimitive[title={\prm {cr}}] + +This ends a row in an alignment. It also ends an alignment preamble. +\stopoldprimitive + +\startnewprimitive[title={\prm {crampeddisplaystyle}}] + +A less spacy alternative of \prm {displaystyle}; integer representation: +\the\scriptstyle. + +\stopnewprimitive + +\startnewprimitive[title={\prm {crampedscriptscriptstyle}}] + +A less spacy alternative of \prm {scriptscriptstyle}; integer representation: +\the\scriptscriptstyle. + +\stopnewprimitive + +\startnewprimitive[title={\prm {crampedscriptstyle}}] + +A less spacy alternative of \prm {scriptstyle}; integer representation: +\the\scriptstyle. + +\stopnewprimitive + +\startnewprimitive[title={\prm {crampedtextstyle}}] + +A less spacy alternative of \prm {textstyle}; integer representation: +\the\textstyle. + +\stopnewprimitive + +\startoldprimitive[title={\prm {crcr}}] + +This ends a row in an alignment when it hasn't ended yet. + +\stopoldprimitive + +\startnewprimitive[title={\prm {csactive}}] + +Because \LUATEX\ (and \LUAMETATEX) are \UNICODE\ engines active characters are +implemented a bit differently. They don't occupy a eight bit range of characters +but are stored as control sequence with a special prefix \type {U+FFFF} which +never shows up in documents. The \prm {csstring} primitive injects the name of a +control sequence without leading escape character, the \prm {csactive} injects +the internal name of the following (either of not active) character. As we cannot +display the prefix: \type {\csactive~} will inject the \UTF\ sequences for \type +{U+FFFF} and \type {U+007E}, so here we get the bytes \type {EFBFBF7E}. Basically +the next token is preceded by \prm {string}, so when you don't provide a +character you are in for a surprise. + +\stopnewprimitive + +\startoldprimitive[title={\prm {csname}}] + +This original \TEX\ primitive starts the construction of a control sequence +reference. It does a lookup and when no sequence with than name is found, it will +create a hash entry and defaults its meaning to \prm {relax}. + +\starttyping +\csname letters and other characters\endcsname +\stoptyping + +\stopoldprimitive + +\startnewprimitive[title={\prm {csstring}}] + +This primitive returns the name of the control sequence given without the leading +escape character (normally a backslash). Of course you could strip that character +with a simple helper but this is more natural. + +\startbuffer +\csstring\mymacro +\stopbuffer + +\typebuffer + +We get the name, not the meaning: {\tt \inlinebuffer}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {currentgrouplevel}}] + +\startbuffer +[\the\currentgrouplevel] \bgroup + [\the\currentgrouplevel] \bgroup + [\the\currentgrouplevel] + \egroup [\the\currentgrouplevel] +\egroup [\the\currentgrouplevel] +\stopbuffer + +The next example gives: \inlinebuffer. + +\typebuffer + +\stopoldprimitive + +\startoldprimitive[title={\prm {currentgrouptype}}] + +\startbuffer +[\the\currentgrouptype] \bgroup + [\the\currentgrouptype] \begingroup + [\the\currentgrouptype] + \endgroup [\the\currentgrouptype] + [\the\currentgrouptype] \beginmathgroup + [\the\currentgrouptype] + \endmathgroup [\the\currentgrouptype] +[\the\currentgrouptype] \egroup +\stopbuffer + +The next example gives: \inlinebuffer. + +\typebuffer + +The possible values depend in the engine and for \LUAMETATEX\ they are: + +\startluacode +context.startcolumns { n = 4 } +context.starttabulate { "|r|l|" } +for i=0,#tex.groupcodes do + context.NC() context(i) + context.NC() context(tex.groupcodes[i]) + context.NC() context.NR() +end +context.stoptabulate() +context.stopcolumns() +\stopluacode + +\stopoldprimitive + +\startoldprimitive[title={\prm {currentifbranch}}] + +\startbuffer +[\the\currentifbranch] \iftrue + [\the\currentifbranch] \iffalse + [\the\currentifbranch] + \else + [\the\currentifbranch] + \fi [\the\currentifbranch] +\fi [\the\currentifbranch] +\stopbuffer + +The next example gives: \inlinebuffer. + +\typebuffer + +So when in the \quote {then} branch we get plus one and when in the \quote {else} +branch we end up with a minus one. + +\stopoldprimitive + +\startoldprimitive[title={\prm {currentiflevel}}] + +\startbuffer +[\the\currentiflevel] \iftrue + [\the\currentiflevel]\iftrue + [\the\currentiflevel] \iftrue + [\the\currentiflevel] + \fi [\the\currentiflevel] + \fi [\the\currentiflevel] +\fi [\the\currentiflevel] +\stopbuffer + +The next example gives: \inlinebuffer. + +\typebuffer + +\stopoldprimitive + +\startoldprimitive[title={\prm {currentiftype}}] + +\startbuffer +[\the\currentiftype] \iftrue + [\the\currentiftype]\iftrue + [\the\currentiftype] \iftrue + [\the\currentiftype] + \fi [\the\currentiftype] + \fi [\the\currentiftype] +\fi [\the\currentiftype] +\stopbuffer + +The next example gives: \inlinebuffer. + +\typebuffer + +The values are engine dependent: + +\startluacode +local t = tex.getiftypes() +context.startcolumns { n = 5 } +context.starttabulate { "|r|l|" } +for i=0,#tex.groupcodes do + context.NC() context(i) + context.NC() context(t[i]) + context.NC() context.NR() +end +context.stoptabulate() +context.stopcolumns() +\stopluacode + +\stopoldprimitive + +\startnewprimitive[title={\prm {currentloopiterator}}] + +Here we show the different expanded loop variants: + +\startbuffer +\edef\testA{\expandedloop 1 10 1{!}} +\edef\testB{\expandedrepeat 10 {!}} +\edef\testC{\expandedendless {\ifnum\currentloopiterator>10 \quitloop\else !\fi}} +\edef\testD{\expandedendless {\ifnum#I>10 \quitloop\else !\fi}} +\stopbuffer + +\typebuffer \getbuffer + +All these give the same result: + +\startlines \tt +\meaningasis\testA +\meaningasis\testB +\meaningasis\testC +\meaningasis\testD +\stoplines + +The \type {#I} is a shortcut to the current loop iterator; other shortcuts are +\type {#P} for the parent iterator value and \type {#G} for the grand parent. + +\stopnewprimitive + +\startnewprimitive[title={\prm {currentloopnesting}}] + +This integer reports how many nested loops are currently active. Of course in +practice the value only has meaning when you know at what outer level your nested +loop started. + +\stopnewprimitive + +\startnewprimitive[title={\prm {currentmarks}}] + +Marks only get updated when a page is split off or part of a box using \prm +{vsplit} gets wrapped up. This primitive gives access to the current value of a +mark and takes the number of a mark class. + +\stopnewprimitive + +\startoldprimitive[title={\prm {currentstacksize}}] + +This is more diagnostic feature than a useful one but we show it anyway. There is +some basic overhead when we enter a group: + +\startbuffer +\bgroup [\the\currentstacksize] + \bgroup [\the\currentstacksize] + \bgroup [\the\currentstacksize] + [\the\currentstacksize] \egroup + [\the\currentstacksize] \egroup +[\the\currentstacksize] \egroup +\stopbuffer + +\typebuffer \getbuffer + +As soon as we define something or change a value, the stack gets populated by +information needed for recovery after the group ends. + +\startbuffer +\bgroup [\the\currentstacksize] + \scratchcounter 1 + \bgroup [\the\currentstacksize] + \scratchdimen 1pt + \scratchdimen 2pt + \bgroup [\the\currentstacksize] + \scratchcounter 2 + \scratchcounter 3 + [\the\currentstacksize] \egroup + [\the\currentstacksize] \egroup +[\the\currentstacksize] \egroup +\stopbuffer + +\typebuffer \getbuffer + +The stack also keeps some state information, for instance when a box is being +built. In \LUAMETATEX\ that is is quite a bit more than in other engines but it +is compensated by more efficient save stack handling elsewhere. + +\startbuffer +\hbox \bgroup [\the\currentstacksize] + \hbox \bgroup [\the\currentstacksize] + \hbox \bgroup [\the\currentstacksize] + [\the\currentstacksize] \egroup + [\the\currentstacksize] \egroup +[\the\currentstacksize] \egroup +\stopbuffer + +\typebuffer \getbuffer + +\stopoldprimitive + +\startoldprimitive[title={\prm {day}}] + +This internal number starts out with the day that the job started. + +\stopoldprimitive + +\startnewprimitive[title={\prm {dbox}}] + +A \prm {dbox} is just a \prm {vbox} (baseline at the bottom) but it has the +property \quote {dual baseline} which means that is some cases it will behave +like a \prm {vtop} (baseline at the top) too. Like: + +\ruledhbox\bgroup \showstruts + \ruleddbox {\hsize 3cm \strut dbox \par \strut dbox \par\strut dbox } + \ruledvbox {\hsize 3cm \strut vbox \par \strut vbox \par\strut vbox } + \ruledvtop {\hsize 3cm \strut vtop \par \strut vtop \par\strut vtop } + \ruledvcenter{\hsize 3cm \strut vcenter \par \strut vcenter \par\strut vcenter}% +\egroup + +A \type {\dbox} behaves like a \type {\vtop} when it's appended to a vertical list which +means that the height of the first box or rule determines the (base)line correction that +gets applied. + +% This example is taken from lowlevel-boxes: + +\startlinecorrection +\startcombination [nx=3,ny=1,location=top] + {\vbox \bgroup \hsize .3\textwidth + \small\small \setupalign[tolerant,stretch] \dontcomplain + xxxxxxxxxxxxxxxx\par + \ruledvbox{\samplefile{ward}}\par + xxxxxxxxxxxxxxxx\par + \egroup} {\type {\vbox}} + {\vbox \bgroup \hsize .3\textwidth + \small\small \setupalign[tolerant,stretch] \dontcomplain + xxxxxxxxxxxxxxxx\par + \ruledvtop{\samplefile{ward}}\par + xxxxxxxxxxxxxxxx\par + \egroup} {\type {\vtop}} + {\vbox \bgroup \hsize .3\textwidth + \small\small \setupalign[tolerant,stretch] \dontcomplain + xxxxxxxxxxxxxxxx\par + \ruleddbox{\samplefile{ward}}\par + xxxxxxxxxxxxxxxx\par + \egroup} {\type {\dbox}} +\stopcombination +\stoplinecorrection + +\stopnewprimitive + +\startoldprimitive[title={\prm {deadcycles}}] + +This counter is incremented every time the output routine is entered. When \prm +{maxdeadcycles} is reached \TEX\ will issue an error message, so you'd better +reset its value when a page is done. + +\stopoldprimitive + +\startoldprimitive[title={\prm {def}}] + +This is the main definition command, as in: + +\starttyping +\def\foo{l me} +\stoptyping + +with companions like \prm {gdef}, \prm {edef}, \prm {xdef}, etc. and variants +like: + +\starttyping +\def\foo#1{... #1...} +\stoptyping + +where the hash is used in the preamble and for referencing. More about that can +be found in the low level manual about macros. + +\stopoldprimitive + +\startoldprimitive[title={\prm {defaulthyphenchar}}][obsolete=yes] + +When a font is loaded its hyphen character is set to this value. It can be +changed afterwards. However, in \LUAMETATEX\ font loading is under \LUA\ control +so these properties can be set otherwise. + +\stopoldprimitive + +\startoldprimitive[title={\prm {defaultskewchar}}][obsolete=yes] + +When a font is loaded its skew character is set to this value. It can be changed +afterwards. However, in \LUAMETATEX\ font loading is under \LUA\ control so these +properties can be set otherwise. Also, \OPENTYPE\ math fonts have top anchor +instead. + +\stopoldprimitive + +\startnewprimitive[title={\prm {defcsname}}] + +We now get a series of log clutter avoidance primitives. It's fine if you argue +that they are not really needed, just don't use them. + +\starttyping +\expandafter\def\csname MyMacro:1\endcsname{...} + \defcsname MyMacro:1\endcsname{...} +\stoptyping + +The fact that \TEX\ has three (expanded and global) companions can be seen as a +signal that less verbosity makes sense. It's just that macro packages use plenty +of \prm {csname}'s. + +\stopnewprimitive + +\startnewprimitive[title={\prm {deferred}}] + +This is mostly a compatibility prefix and it can be checked at the \LUA\ end when +there is a \LUA\ based assignment going on. It is the counterpart of \prm +{immediate}. In the traditional engines a \prm {write} is normally deferred +(turned into a node) and can be handled \prm {immediate}, while a \prm {special} +does the opposite. + +\stopnewprimitive + +\startoldprimitive[title={\prm {delcode}}][obsolete=yes] + +This assigns delimiter properties to an eight bit character so it has little use +in an \OPENTYPE\ math setup. WHen the assigned value is hex encoded, the first +byte denotes the small family, then we have two bytes for the small index, +followed by three similar bytes for the large variant. + +\stopoldprimitive + +\startoldprimitive[title={\prm {delimiter}}][obsolete=yes] + +This command inserts a delimiter with the given specification. In \OPENTYPE\ math +we use a different command so it is unlikely that this primitive is used in +\LUAMETATEX. It takes a number that can best be coded hexadecimal: one byte for +the class, one for the small family, two for the small index, one for the large +family and two for the large index. This demonstrates that it can't handle wide +fonts. Also, in \OPENTYPE\ math fonts the larger sizes and extensible come from +the same font as the small symbol. On top of that, in \LUAMETATEX\ we have more +classes than fit in a byte. + +\stopoldprimitive + +\startoldprimitive[title={\prm {delimiterfactor}}][obsolete=yes] + +This is one of the parameters that determines the size of a delimiter: at least +this factor times the formula height divided by 1000. In \OPENTYPE\ math +different properties and strategies are used. + +\stopoldprimitive + +\startoldprimitive[title={\prm {delimitershortfall}}][obsolete=yes] + +This is one of the parameters that determines the size of a delimiter: at least +the formula height minus this parameter. In \OPENTYPE\ math different properties +and strategies are used. + +\stopoldprimitive + +\startnewprimitive[title={\prm {detokened}}] + +The following token will be serialized into characters with category \quote +{other}. + +\startbuffer +\toks0{123} +\def\foo{let's be \relax'd} +\def\oof#1{let's see #1} +\detokened\toks0 +\detokened\foo +\detokened\oof +\detokened\setbox +\detokened X +\stopbuffer + +\typebuffer + +Gives: + +\startlines\tt +\getbuffer +\stoplines + +Macros with arguments are not shown. + +\stopnewprimitive + +\startoldprimitive[title={\prm {detokenize}}] + +This \ETEX\ primitive turns the content of the provides list will become +characters, kind of verbatim. + +\startbuffer +\expandafter\let\expandafter\temp\detokenize{1} \meaning\temp +\expandafter\let\expandafter\temp\detokenize{A} \meaning\temp +\stopbuffer + +\typebuffer + +\startlines \tttf \getbuffer \stoplines + +\stopoldprimitive + +\startnewprimitive[title={\prm {detokenized}}] + +The following (single) token will be serialized into characters with category +\quote {other}. + +\startbuffer +\toks0{123} +\def\foo{let's be \relax'd} +\def\oof#1{let's see #1} +\detokenized\toks0 +\detokenized\foo +\detokenized\oof +\detokenized\setbox +\detokenized X +\stopbuffer + +\typebuffer + +Gives: + +\startlines\tt +\getbuffer +\stoplines + +It is one of these new primitives that complement others like \prm {detokened} +and such, and they are often mostly useful in experiments of some low level +magic, which made them stay. + +\stopnewprimitive + +\startoldprimitive[title={\prm {dimen}}] + +Like \prm {count} this is a register accessor which is described in more +detail in a low level manual. + +\starttyping +\dimen0=10pt +\stoptyping + +While \TEX\ has some assumptions with respect to the first ten count registers +(as well as the one that holds the output, normally 255), all dimension registers +are treated equal. However, you need to be aware of clashes with other usage. +Therefore you can best use the predefined scratch registers or define dedicate +ones with the \type {\newdimen} macro. + +\stopoldprimitive + +\startoldprimitive[title={\prm {dimendef}}] + +This primitive is used by the \type {\newdimen} macro when it relates a control +sequence with a specific register. Only use it when you know what you're doing. + +\stopoldprimitive + +\startnewprimitive[title={\prm {dimensiondef}}] + +A variant of \prm {integerdef} is: + +\starttyping +\dimensiondef\MyDimen = 1234pt +\stoptyping + +The properties are comparable to the ones described in the section \prm +{integerdef}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {dimexpr}}] + +This primitive is similar to of \prm {numexpr} but operates on dimensions +instead. Integer quantities are interpreted as dimensions in scaled points. + +\startbuffer +\the\dimexpr (1pt + 2pt - 5pt) * 10 / 2 \relax +\stopbuffer + +\typebuffer + +gives: \inlinebuffer. You can mix in symbolic integers and dimensions. This doesn't work: + +\startbuffer +\the\dimexpr 10 * (1pt + 2pt - 5pt) / 2 \relax +\stopbuffer + +because the engine scans for a dimension and only for an integer (or equivalent) +after a \type {*} or \type {/}. + + +\stopoldprimitive + +\startnewprimitive[title={\prm {dimexpression}}] + +This command is like \prm {numexpression} but results in a dimension instead of +an integer. Where \prm {dimexpr} doesn't like \typ {2 * 10pt} this expression +primitive is quite happy with it. + +\stopnewprimitive + +\startnewprimitive[title={\prm {directlua}}] + +This is the low level interface to \LUA: + +\startbuffer +\directlua { tex.print ("Greetings from the lua end!") } +\stopbuffer + +Gives: \quotation {\inlinebuffer} as expected. In \LUA\ we have access to all +kind of internals of the engine. In \LUAMETATEX\ the interfaces have been +polished and extended compared to \LUATEX. Although many primitives and +mechanisms were added to the \TEX\ frontend, the main extension interface remains +\LUA. More information can be found in documents that come with \CONTEXT, in +presentations and in articles. + +\stopnewprimitive + +\startoldprimitive[title={\prm {discretionary}}] + +The three snippets given with this command determine the pre, post and replace +component of the injected discretionary node. The \type {penalty} keyword permits +setting a penalty with this node. The \type {postword} keyword indicates that +this discretionary starts a word, and \type {preword} ends it. With \type {break} +the line break algorithm will prefer a pre or post component over a replace, and +with \type {nobreak} replace will win over pre. With \type {class} you can set a +math class that will determine spacing and such for discretionaries used in math +mode. + +\stopoldprimitive + +\startnewprimitive[title={\prm {discretionaryoptions}}] + +Processing of discretionaries is controlled by this bitset: + +\getbuffer[engine:syntax:discoptioncodes] + +These can also be set on \prm {discretionary} using the \type {options} key. + +\stopnewprimitive + +\startoldprimitive[title={\prm {displayindent}}] + +The \prm {displaywidth}, \prm {displayindent} and \prm {predisplaysize} +parameters are set by the line break routine (but can be adapted by the user), so +that mid|-|par display formula can adapt itself to hanging indentation and par +shapes. I order to calculate thee values and adapt the line break state +afterwards such a display formula is assumed to occupy three lines, so basically +a rather compact formula. + +\stopoldprimitive + +\startoldprimitive[title={\prm {displaylimits}}] + +By default in math display mode limits are place on top while in inline mode they +are placed like scripts, after the operator. Placement can be forced with the +\prm {limits} and \prm {nolimits} modifiers (after the operator). Because there +can be multiple of these in a row there is \prm {displaylimits} that forces the +default placement, so effectively it acts here as a reset modifier. + +\stopoldprimitive + +\startoldprimitive[title={\prm {displaystyle}}] + +One of the main math styles; integer representation: \the\displaystyle. + +\stopoldprimitive + +\startoldprimitive[title={\prm {displaywidowpenalties}}] + +This is a math specific variant of \prm {widowpenalties}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {displaywidowpenalty}}] + +This is a math specific variant of \prm {widowpenalty}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {displaywidth}}] + +This parameter determines the width of the formula and normally defaults to the +\prm {hsize} unless we are in the middle of a paragraph in which case it is +compensated for hanging indentation or the par shape. + +\stopoldprimitive + +\startoldprimitive[title={\prm {divide}}] + +The \prm {divide} operation can be applied to integers, dimensions, float, +attribute and glue quantities. There are subtle rounding differences between +the divisions in expressions and \prm {divide}: + +\starttabulate +\NC \type {\scratchcounter1049 \numexpr\scratchcounter/ 10\relax} +\EQ \scratchcounter1049 \the\numexpr\scratchcounter/ 10\relax +\NC \NR +\NC \type {\scratchcounter1049 \numexpr\scratchcounter: 10\relax} +\EQ \scratchcounter1049 \the\numexpr\scratchcounter: 10\relax +\NC \NR +\NC \type {\scratchcounter1049 \divide\scratchcounter by 10} +\EQ \scratchcounter1049 \divide\scratchcounter by 10 + \the\scratchcounter +\NC \NR +\stoptabulate + +The \type {:} divider in \prm {dimexpr} is something that we introduced in +\LUATEX. + +\stopoldprimitive + +\startnewprimitive[title={\prm {divideby}}] + +This is slightly more efficient variant of \prm {divide} that doesn't look for +\type {by}. See previous section. + +\stopnewprimitive + +\startnewprimitive[title={\prm {doubleadjdemerits}}] + +This penalty will be added to the penalty assigned to a breakpoint that results +in two incompatible lines (in \LUAMETATEX\ we can be more granular with respect +to compatible lines and this concerns a larger delta). + +\stopnewprimitive + +\startoldprimitive[title={\prm {doublehyphendemerits}}] + +This penalty will be added to the penalty assigned to a breakpoint that results +in two lines ending with a hyphen. + +\stopoldprimitive + +\startoldprimitive[title={\prm {dp}}] + +Returns the depth of the given box. + +\stopoldprimitive + +\startnewprimitive[title={\prm {dpack}}] + +This does what \prm {dbox} does but without callback overhead. + +\stopnewprimitive + +\startnewprimitive[title={\prm {dsplit}}] + +This is the dual baseline variant of \prm {vsplit} (see \prm {dbox} for what that +means). + +\stopnewprimitive + +\startoldprimitive[title={\prm {dump}}] + +This finishes an (ini) run and dumps a format (basically the current state of the +engine). + +\stopoldprimitive + +\startoldprimitive[title={\prm {edef}}] + +This is the expanded version of \prm {def}. + +\startbuffer +\def \foo{foo} \meaning\foo +\def \ofo{\foo\foo} \meaning\ofo +\edef\oof{\foo\foo} \meaning\oof +\stopbuffer + +\typebuffer + +Because \type {\foo} is unprotected it will expand inside the body definition: + +\startlines \tt +\getbuffer +\stoplines + +\stopoldprimitive + +\startnewprimitive[title={\prm {edefcsname}}] + +This is the companion of \prm {edef}: + +\starttyping +\expandafter\edef\csname MyMacro:1\endcsname{...} + \edefcsname MyMacro:1\endcsname{...} +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {edivide}}] + +When expressions were introduced the decision was made to round the divisions which is +incompatible with the way \prm {divide} works. The expression scanners in \LUAMETATEX\ +compensates that by providing a \type {:} for integer division. The \prm {edivide} does +the opposite: it rounds the way expressions do. + +\startbuffer +\the\dimexpr .4999pt : 2 \relax =.24994pt +\the\dimexpr .4999pt / 2 \relax =.24995pt +\scratchdimen.4999pt \divide \scratchdimen 2 \the\scratchdimen=.24994pt +\scratchdimen.4999pt \edivide\scratchdimen 2 \the\scratchdimen=.24995pt + +\the\numexpr 1001 : 2 \relax =500 +\the\numexpr 1001 / 2 \relax =501 +\scratchcounter1001 \divide \scratchcounter 2 \the\scratchcounter=500 +\scratchcounter1001 \edivide\scratchcounter 2 \the\scratchcounter=501 +\stopbuffer + +\typebuffer + +Keep in mind that with dimensions we have a fractional part so we actually +rounding applies to the fraction. For that reason we also provide \prm {rdivide}. + +\startlines +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {edivideby}}] + +This the \type {by}|-|less variant of \prm {edivide}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {efcode}}] + +This primitive originates in \PDFTEX\ and can be used to set the expansion factor +of a glyph (characters). This primitive is obsolete because the values can be set +in the font specification that gets passed via \LUA\ to \TEX. Keep in mind that +setting font properties at the \TEX\ end is a global operation and can therefore +influence related fonts. In \LUAMETATEX\ the \prm {cf} code can be used to +specify the compression factor independent from the expansion factor. The +primitive takes three values: font, character code, and factor. + +\stopnewprimitive + +\startoldprimitive[title={\prm {else}}] + +This traditional primitive is part of the condition testing mechanism. When a +condition matches, \TEX\ will continue till it sees an \prm {else} or \prm +{or} or \prm {orelse} (to be discussed later). It will then do a fast skipping +pass till it sees an \prm {fi}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {emergencyextrastretch}}] + +This is one of the extended parbuilder parameters. You can you it so temporary +increase the permitted stretch without knowing or messing with the normal value. + +\stopoldprimitive + +\startnewprimitive[title={\prm {emergencyleftskip}}] + +This is one of the extended parbuilder parameters (playground). It permits going +ragged left in case of a too bad result. + +\stopnewprimitive + +\startnewprimitive[title={\prm {emergencyrightskip}}] + +This is one of the extended parbuilder parameters (playground). It permits going +ragged right in case of a too bad result. + +\stopnewprimitive + +\startoldprimitive[title={\prm {emergencystretch}}] + +When set the par builder will run a third pass in order to fit the set criteria. + +\stopoldprimitive + +\startoldprimitive[title={\prm {end}}] + +This ends a \TEX\ run, unless of course this primitive is redefined. + +\stopoldprimitive + +\startoldprimitive[title={\prm {endcsname}}] + +This primitive is used in combination with \prm {csname}, \prm {ifcsname} and +\prm {begincsname} where its end the scanning for the to be constructed control +sequence token. + +\stopoldprimitive + +\startoldprimitive[title={\prm {endgroup}}] + +This is the companion of the \prm {begingroup} primitive that opens a group. See +\prm {beginsimplegroup} for more info. + +\stopoldprimitive + +\startoldprimitive[title={\prm {endinput}}] + +The engine can be in different input modes: reading from file, reading from a +token list, expanding a macro, processing something that comes back from \LUA, +etc. This primitive quits reading from file: + +\startbuffer +this is seen +\endinput +here we're already quit +\stopbuffer + +\typebuffer + +There is a catch. This is what the above gives: + +\getbuffer + +but how about this: + +\startbuffer +this is seen +before \endinput after +here we're already quit +\stopbuffer + +\typebuffer + +Here we get: + +\getbuffer + +Because a token list is one line, the following works okay: + +\starttyping +\def\quitrun{\ifsomething \endinput \fi} +\stoptyping + +but in a file you'd have to do this when you quit in a conditional: + +\starttyping +\ifsomething + \expandafter \endinput +\fi +\stoptyping + +While the one|-|liner works as expected: + +\starttyping +\ifsomething \endinput \fi +\stoptyping + +\stopoldprimitive + +\startoldprimitive[title={\prm {endlinechar}}] + +This is an internal integer register. When set to positive value the character +with that code point will be appended to the line. The current value is \the +\endlinechar. Here is an example: + +\startbuffer +\endlinechar\hyphenasciicode +line 1 +line 2 +\stopbuffer + +\typebuffer + +\start \getbuffer \stop + +If the character is active, the property is honored and the command kicks in. The +maximum value is 127 (the maximum character code a single byte \UTF\ character +can carry.) + +\stopoldprimitive + +\startnewprimitive[title={\prm {endlocalcontrol}}] + +See \prm {beginlocalcontrol}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {endmathgroup}}] + +This primitive is the counterpart of \prm {beginmathgroup}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {endsimplegroup}}] + +This one ends a simple group, see \prm {beginsimplegroup} for an explanation +about grouping primitives. + +\stopnewprimitive + +\startnewprimitive[title={\prm {enforced}}] + +The engine can be set up to prevent overloading of primitives and macros defined +as \prm {permanent} or \prm {immutable}. However, a macro package might want +to get around this in controlled situations, which is why we have a \prm +{enforced} prefix. This prefix in interpreted differently in so called \quote +{ini} mode when macro definitions can be dumped in the format. Internally they +get an \type {always} flag as indicator that in these places an overload is +possible. + +\starttyping +\permanent\def\foo{original} + +\def\oof {\def\foo{fails}} +\def\oof{\enforced\def\foo{succeeds}} +\stoptyping + +Of course this only has an effect when overload protection is enabled. + +\stopnewprimitive + +\startoldprimitive[title={\prm {eofinput}}] + +This is a variant on \prm {input} that takes a token list as first argument. That +list is expanded when the file ends. It has companion primitives \prm +{atendoffile} (single token) and \prm {atendoffiled} (multiple tokens). + +\stopoldprimitive + +\startoldprimitive[title={\prm {eqno}}] + +This primitive stores the (typeset) content (presumably a number) and when the +display formula is wrapped that number will end up right of the formula. + +\stopoldprimitive + +\startoldprimitive[title={\prm {errhelp}}] + +This is additional help information to \prm {errmessage} that triggers an error +and shows a message. + +\stopoldprimitive + +\startoldprimitive[title={\prm {errmessage}}] + +This primitive expects a token list and shows its expansion on the console +and|/|or in the log file, depending on how \TEX\ is configured. After that it +will enter the error state and either goes on or waits for input, again depending +on how \TEX\ is configured. For the record: we don't use this primitive in +\CONTEXT. + +\stopoldprimitive + +\startoldprimitive[title={\prm {errorcontextlines}}] + +This parameter determines the number on lines shown when an error is triggered. + +\stopoldprimitive + +\startoldprimitive[title={\prm {errorstopmode}}] + +This directive stops at every opportunity to interact. In \CONTEXT\ we overload +the actions in a callback and quit the run because we can assume that a +successful outcome is unlikely. + +\stopoldprimitive + +\startoldprimitive[title={\prm {escapechar}}] + +This internal integer has the code point of the character that get prepended to a +control sequence when it is serialized (for instance in tracing or messages). + +\stopoldprimitive + +\startnewprimitive[title={\prm {etoks}}] + +This assigns an expanded token list to a token register: + +\starttyping +\def\temp{less stuff} +\etoks\scratchtoks{a bit \temp} +\stoptyping + +The orginal value of the register is lost. + +\stopnewprimitive + +\startnewprimitive[title={\prm {etoksapp}}] + +A variant of \prm {toksapp} is the following: it expands the to be appended +content. + +\starttyping +\def\temp{more stuff} +\etoksapp\scratchtoks{some \temp} +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {etokspre}}] + +A variant of \prm {tokspre} is the following: it expands the to be prepended +content. + +\starttyping +\def\temp{less stuff} +\etokspre\scratchtoks{a bit \temp} +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {eufactor}}] + +When we introduced the \type {es} (2.5cm) and \type {ts} (2.5mm) units as metric +variants of the \type {in} we also added the \type {eu} factor. One \type {eu} +equals one tenth of a \type {es} times the \prm {eufactor}. The \type {ts} is a +convenient offset in test files, the \type {es} a convenient ones for layouts and +image dimensions and the \type {eu} permits definitions that scale nicely without +the need for dimensions. They also were a prelude to what later became possible +with \prm {associateunit}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {everybeforepar}}] + +This token register is expanded before a paragraph is triggered. The reason for +triggering is available in \prm {lastpartrigger}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {everycr}}] + +This token list gets expanded when a row ends in an alignment. Normally it will +use \prm {noalign} as wrapper + +\startbuffer +{\everycr{\noalign{H}} \halign{#\cr test\cr test\cr}} +{\everycr{\noalign{V}} \hsize 4cm \valign{#\cr test\cr test\cr}} +\stopbuffer + +\typebuffer + +Watch how the \prm {cr} ending the preamble also get this treatment: + +\getbuffer + +\stopoldprimitive + +\startoldprimitive[title={\prm {everydisplay}}] + +This token list gets expanded every time we enter display mode. It is a companion +of \prm {everymath}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {everyeof}}] + +The content of this token list is injected when a file ends but it can only be +used reliably when one is really sure that no other file is loaded in the +process. So in the end it is of no real use in a more complex macro package. + +\stopoldprimitive + +\startoldprimitive[title={\prm {everyhbox}}] + +This token list behaves similar to \prm {everyvbox} so look there for an +explanation. + +\stopoldprimitive + +\startoldprimitive[title={\prm {everyjob}}] + +This token list register is injected at the start of a job, or more precisely, +just before the main control loop starts. + +\stopoldprimitive + +\startoldprimitive[title={\prm {everymath}}] + +Often math needs to be set up independent from the running text and this token +list can be used to do that. There is also \prm {everydisplay}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {everymathatom}}] + +When a math atom is seen this tokenlist is expanded before content is processed +inside the atom body. + +\stopnewprimitive + +\startoldprimitive[title={\prm {everypar}}] + +When a paragraph starts this tokenlist is expanded before content is processed. + +\stopoldprimitive + +\startnewprimitive[title={\prm {everytab}}] + +This token list gets expanded every time we start a table cell in \prm {halign} or +\prm {valign}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {everyvbox}}] + +This token list gets expanded every time we start a vertical box. Like \prm +{everyhbox} this is not that useful unless you are certain that there are no +nested boxes that don't need this treatment. Of course you can wipe this register +in this expansion, like: + +\starttyping +\everyvbox{\kern10pt\everyvbox{}} +\stoptyping + +\stopoldprimitive + +\startnewprimitive[title={\prm {exceptionpenalty}}] + +In exceptions we can indicate a penalty by \type {[digit]} in which case a +penalty is injected set by this primitive, multiplied by the digit. + +\stopnewprimitive + +\startoldprimitive[title={\prm {exhyphenchar}}] + +The character that is used as pre component of the related discretionary. + +\stopoldprimitive + +\startoldprimitive[title={\prm {exhyphenpenalty}}] + +The penalty injected after \type {-} or \type {\-} unless \prm {hyphenationmode} +is set to force the dedisated penalties. + +\stopoldprimitive + +\startnewprimitive[title={\prm {expand}}] + +Beware, this is not a prefix but a directive to ignore the protected characters of +the following macro. + +\startbuffer +\protected \def \testa{\the\scratchcounter} + \edef\testb{\testa} + \edef\testc{\expand\testa} +\stopbuffer + +\typebuffer + +The meaning of the three macros is: + +\startlines \getbuffer \tttf +\meaningfull\testa +\meaningfull\testb +\meaningfull\testc +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandactive}}] + +This a bit of an outlier and mostly there for completeness. + +\startbuffer + \meaningasis~ +\edef\foo{~} \meaningasis\foo +\edef\foo{\expandactive~} \meaningasis\foo +\stopbuffer + +\typebuffer + +There seems to be no difference but the real meaning of the first \type {\foo} is +\quote {active character 126} while the second \type {\foo} \quote {protected +call ~} is. + +% \showluatokens\foo + +\startlines +\getbuffer +\stoplines + +Of course the definition of the active tilde is \CONTEXT\ specific and situation +dependent. + +\stopnewprimitive + +\startoldprimitive[title={\prm {expandafter}}] + +This original \TEX\ primitive stores the next token, does a one level expansion +of what follows it, which actually can be an not expandable token, and +reinjects the stored token in the input. Like: + +\starttyping +\expandafter\let\csname my weird macro name\endcsname{m w m n} +\stoptyping + +Without \prm {expandafter} the \prm {csname} primitive would have been let to +the left brace (effectively then a begin group). Actually in this particular case +the control sequence with the weird name is injected and when it didn't yet exist +it will get the meaning \prm {relax} so we sort of have two assignments in a +row then. + +\stopoldprimitive + +\startnewprimitive[title={\prm {expandafterpars}}] + +Here is another gobbler: the next token is reinjected after following spaces +and par tokens have been read. So: + +\startbuffer +[\expandafterpars 1 2] +[\expandafterpars 3 +4] +[\expandafterpars 5 + +6] +\stopbuffer + +\typebuffer + +gives us: \inlinebuffer, because empty lines are like \prm {par} and therefore +ignored. + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandafterspaces}}] + +This is a gobbler: the next token is reinjected after following spaces have been +read. Here is a simple example: + +\startbuffer +[\expandafterspaces 1 2] +[\expandafterspaces 3 +4] +[\expandafterspaces 5 + +6] +\stopbuffer + +\typebuffer + +We get this typeset: \inlinebuffer, because a newline normally is configured to be +a space (and leading spaces in a line are normally being ingored anyway). + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandcstoken}}] + +The rationale behind this primitive is that when we \prm {let} a single token +like a character it is hard to compare that with something similar, stored in a +macro. This primitive pushes back a single token alias created by \prm {let} +into the input. + +\startbuffer +\let\tempA + \meaning\tempA + +\let\tempB X \meaning\tempB \crlf +\let\tempC $ \meaning\tempC \par + +\edef\temp {\tempA} \doifelse{\temp}{+}{Y}{N} \meaning\temp \crlf +\edef\temp {\tempB} \doifelse{\temp}{X}{Y}{N} \meaning\temp \crlf +\edef\temp {\tempC} \doifelse{\temp}{X}{Y}{N} \meaning\temp \par + +\edef\temp{\expandcstoken\tempA} \doifelse{\temp}{+}{Y}{N} \meaning\temp \crlf +\edef\temp{\expandcstoken\tempB} \doifelse{\temp}{X}{Y}{N} \meaning\temp \crlf +\edef\temp{\expandcstoken\tempC} \doifelse{\temp}{$}{Y}{N} \meaning\temp \par + +\doifelse{\expandcstoken\tempA}{+}{Y}{N} +\doifelse{\expandcstoken\tempB}{X}{Y}{N} +\doifelse{\expandcstoken\tempC}{$}{Y}{N} \par +\stopbuffer + +\typebuffer + +The meaning of the \prm {let} macros shows that we have a shortcut to a +character with (in this case) catcode letter, other (here \quote {other +character} gets abbreviated to \quote {character}), math shift etc. + +\start \tttf \getbuffer \stop + +Here we use the \CONTEXT\ macro \type {\doifelse} which can be implemented in +different ways, but the only property relevant to the user is that the expanded +content of the two arguments is compared. + +\stopnewprimitive + +\startnewprimitive[title={\prm {expanded}}] + +This primitive complements the two expansion related primitives mentioned in the +previous two sections. This time the content will be expanded and then pushed +back into the input. Protected macros will not be expanded, so you can use this +primitive to expand the arguments in a call. In \CONTEXT\ you need to use \type +{\normalexpanded} because we already had a macro with that name. We give some +examples: + +\startbuffer +\def\A{!} + \def\B#1{\string#1} \B{\A} + \def\B#1{\string#1} \normalexpanded{\noexpand\B{\A}} +\protected\def\B#1{\string#1} \B{\A} +\stopbuffer + +\typebuffer \startlines\getbuffer\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandedafter}}] + +The following two lines are equivalent: + +\startbuffer +\def\foo{123} +\expandafter[\expandafter[\expandafter\secondofthreearguments\foo]] +\expandedafter{[[\secondofthreearguments}\foo]] +\stopbuffer + +\typebuffer + +In \CONTEXT\ \MKIV\ the number of times that one has multiple \prm {expandafter}s +is much larger than in \CONTEXT\ \LMTX\ thanks to some of the new features in +\LUAMETATEX, and this primitive is not really used yet in the core code. + +\startlines\getbuffer\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandeddetokenize}}] + +This is a companion to \prm {detokenize} that expands its argument: + +\startbuffer +\def\foo{12#H3} +\def\oof{\foo} +\detokenize {\foo} \detokenize {\oof} +\expandeddetokenize{\foo} \expandeddetokenize{\oof} +\edef\ofo{\expandeddetokenize{\foo}} \meaningless\ofo +\edef\ofo{\expandeddetokenize{\oof}} \meaningless\ofo +\stopbuffer + +\typebuffer + +This is a bit more convenient than + +\starttyping +\detokenize \expandafter {\normalexpanded {\foo}} +\stoptyping + +kind of solutions. We get: + +\startlines +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandedendless}}] + +This one loops forever but because the loop counter is not set you need to find a +way to quit it. + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandedloop}}] + +This variant of the previously introduced \prm {localcontrolledloop} doesn't +enter a local branch but immediately does its work. This means that it can be +used inside an expansion context like \prm {edef}. + +\startbuffer +\edef\whatever + {\expandedloop 1 10 1 + {\scratchcounter=\the\currentloopiterator\relax}} + +\meaningasis\whatever +\stopbuffer + +\typebuffer + +\start \veryraggedright \tt\tfx \getbuffer \stop \blank + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandedrepeat}}] + +This one takes one instead of three arguments which is sometimes more +convenient. + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandparameter}}] + +This primitive is a predecessor of \prm {parameterdef} so we stick to a simple +example. + +\startbuffer +\def\foo#1#2% + {\integerdef\MyIndexOne\parameterindex\plusone % 1 + \integerdef\MyIndexTwo\parameterindex\plustwo % 2 + \oof{P}\oof{Q}\oof{R}\norelax} + +\def\oof#1% + {<1:\expandparameter\MyIndexOne><1:\expandparameter\MyIndexOne>% + #1% + <2:\expandparameter\MyIndexTwo><2:\expandparameter\MyIndexTwo>} + +\foo{A}{B} +\stopbuffer + +\typebuffer + +In principle the whole parameter stack can be accessed but often +one never knows if a specific macro is called nested. The original +idea behind this primitive was tracing but it can also be used to +avoid passing parameters along a chain of calls. + +\getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandtoken}}] + +This primitive creates a token with a specific combination of catcode and +character code. Because it assumes some knowledge of \TEX\ we can show it +using some \prm {expandafter} magic: + +\startbuffer +\expandafter\let\expandafter\temp\expandtoken 11 `X \meaning\temp +\expandafter\let\expandafter\temp\expandtoken 12 `X \meaning\temp +\stopbuffer + +\typebuffer + +The meanings are: + +\startlines \tttf \getbuffer \stoplines + +Using other catcodes is possible but the results of injecting them into the input +directly (or here by injecting \type {\temp}) can be unexpected because of what +\TEX\ expects. You can get messages you normally won't get, for instance about +unexpected alignment interference, which is a side effect of \TEX\ using some +catcode|/|character combinations as signals and there is no reason to change +those internals. That said: + +\startbuffer +\xdef\tempA{\expandtoken 9 `X} \meaning\tempA +\xdef\tempB{\expandtoken 10 `X} \meaning\tempB +\xdef\tempC{\expandtoken 11 `X} \meaning\tempC +\xdef\tempD{\expandtoken 12 `X} \meaning\tempD +\stopbuffer + +\typebuffer + +are all valid and from the meaning you cannot really deduce what's in there: + +\startlines \tttf \getbuffer \stoplines % grouped therefore xdef + +But you can be assured that: + +\startbuffer +[AB: \ifx\tempA\tempB Y\else N\fi] +[AC: \ifx\tempA\tempC Y\else N\fi] +[AD: \ifx\tempA\tempD Y\else N\fi] +[BC: \ifx\tempB\tempC Y\else N\fi] +[BD: \ifx\tempB\tempD Y\else N\fi] +[CD: \ifx\tempC\tempD Y\else N\fi] +\stopbuffer + +\typebuffer + +makes clear that they're different: \inlinebuffer, and in case you wonder, the +characters with catcode 10 are spaces, while those with code 9 are ignored. + +\stopnewprimitive + +\startnewprimitive[title={\prm {expandtoks}}] + +This is a more efficient equivalent of \prm {the} applied to a token register, +so: + +\startbuffer +\scratchtoks{just some tokens} +\edef\TestA{[\the \scratchtoks]} +\edef\TestB{[\expandtoks\scratchtoks]} +[\the \scratchtoks] [\TestA] \meaning\TestA +[\expandtoks\scratchtoks] [\TestB] \meaning\TestB +\stopbuffer + +\typebuffer + +does the expected: + +\startlines +\getbuffer +\stoplines + +The \prm {expandtoken} primitive avoid a copy into the input when there is no +need for it. + +\stopnewprimitive + +\startnewprimitive[title={\prm {explicitdiscretionary}}] + +This is the verbose alias for one of \TEX's single character control sequences: +\type {\-}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {explicithyphenpenalty}}] + +The penalty injected after an automatic discretionary \type {\-}, when \prm +{hyphenationmode} enables this. + +\stopnewprimitive + +\startnewprimitive[title={\prm {explicititaliccorrection}}] + +This is the verbose alias for one of \TEX's single character control sequences: +\type {\/}. Italic correction is a character property specific to \TEX\ and the +concept is not present in modern font technologies. There is a callback that +hooks into this command so that a macro package can provide its own solution +to this (or alternatively it can assign values to the italic correction field. + +\stopnewprimitive + +\startnewprimitive[title={\prm {explicitspace}}] + +This is the verbose alias for one of \TEX's single character control sequences: +\type {\ }. A space is inserted with properties according the space related +variables. There is look|-|back involved in order to deal with space factors. + +When \prm {nospaces} is set to~1 no spaces are inserted, when its value is~2 a +zero space is inserted. + +\stopnewprimitive + +\startoldprimitive[title={\prm {fam}}] + +In a numeric context it returns the current family number, otherwise it sets the +given family. The number of families in a traditional engine is 16, in \LUATEX\ +it is 256 and in \LUAMETATEX\ we have at most \cldcontext {tex . magicconstants . +max_n_of_math_families} families. A future version can lower that number when we +need more classes. + +\stopoldprimitive + +\startoldprimitive[title={\prm {fi}}] + +This traditional primitive is part of the condition testing mechanism and ends a +test. So, we have: + +\starttyping +\ifsomething ... \else ... \fi +\ifsomething ... \or ... \or ... \else ... \fi +\ifsomething ... \orelse \ifsometing ... \else ... \fi +\ifsomething ... \or ... \orelse \ifsometing ... \else ... \fi +\stoptyping + +The \prm {orelse} is new in \LUAMETATEX\ and a continuation like we find in +other programming languages (see later section). + +\stopoldprimitive + +\startoldprimitive[title={\prm {finalhyphendemerits}}] + +This penalty will be added to the penalty assigned to a breakpoint when that +break results in a pre|-|last line ending with a hyphen. + +\stopoldprimitive + +\startoldprimitive[title={\prm {firstmark}}][obsolete=yes] + +This is a reference to the first mark on the (split off) page, it gives back +tokens. + +\stopoldprimitive + +\startoldprimitive[title={\prm {firstmarks}}] + +This is a reference to the first mark with the given id (a number) on the (split +off) page, it gives back tokens. + +\stopoldprimitive + +\startnewprimitive[title={\prm {firstvalidlanguage}}] + +Language id's start at zero, which makes it the first valid language. You can set +this parameter to indicate the first language id that is actually a language. The +current value is \the \firstvalidlanguage, so lower values will not trigger +hyphenation. + +\stopnewprimitive + +\startnewprimitive[title={\prm {float}}] + +In addition to integers and dimensions, which are fixed 16.16 integer floats we +also have \quote {native} floats, based on 32 bit posit unums. + +\startbuffer +\float0 = 123.456 \the\float0 +\float2 = 123.456 \the\float0 +\advance \float0 by 123.456 \the\float0 +\advance \float0 by \float2 \the\float0 +\divideby\float0 3 \the\float0 +\stopbuffer + +\typebuffer + +They come with the same kind of support as the other numeric data types: + +\startlines \getbuffer \stoplines + +\startbuffer +\dimen00 = 123.456pt \the\dimen0 +\dimen02 = 123.456pt \the\dimen0 +\advance \dimen0 by 123.456pt \the\dimen0 +\advance \dimen0 by \dimen2 \the\dimen0 +\divideby\dimen0 3 \the\dimen0 +\stopbuffer + +We leave the subtle differences between floats and dimensions to the user to +investigate: + +\typebuffer + +The nature of posits is that they are more accurate around zero (or smaller +numbers in general). + +\startlines \getbuffer \stoplines + +This also works: + +\startbuffer +\float0=123.456e4 +\float2=123.456 \multiply\float2 by 10000 +\the\float0 +\the\float2 +\stopbuffer + +\typebuffer + +The values are (as expected) the same: + +\startlines \getbuffer \stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {floatdef}}] + +This primitive defines a symbolic (macro) alias to a float register, just like +\prm {countdef} and friends do. + +\stopnewprimitive + +\startnewprimitive[title={\prm {floatexpr}}] + +This is the companion of \prm {numexpr}, \prm {dimexpr} etc. + +\startbuffer +\scratchcounter 200 +\the \floatexpr 123.456/456.123 \relax +\the \floatexpr 1.2*\scratchcounter \relax +\the \floatexpr \scratchcounter/3 \relax +\number\floatexpr \scratchcounter/3 \relax +\stopbuffer + +\typebuffer + +Watch the difference between \prm {the} and \prm {number}: + +\startlines \getbuffer \stoplines + +\stopnewprimitive + +\startoldprimitive[title={\prm {floatingpenalty}}] + +When an insertion is split (across pages) this one is added to to accumulated +\prm {insertpenalties}. In \LUAMETATEX\ this penalty can be stored per insertion +class. + +\stopoldprimitive + +\startnewprimitive[title={\prm {flushmarks}}] + +This primitive is an addition to the multiple marks mechanism that originates in +\ETEX\ and inserts a reset signal for the mark given category that will perform a +clear operation (like \prm {clearmarks} which operates immediately). + +\stopnewprimitive + +\startoldprimitive[title={\prm {font}}] + +This primitive is either a symbolic reference to the current font or in the +perspective of an assignment is used to trigger a font definitions with a given +name (\type {cs}) and specification. In \LUAMETATEX\ the assignment will trigger +a callback that then handles the definition; in addition to the filename an +optional size specifier is checked (\type {at} or \type {scaled}). + +In \LUAMETATEX\ {\em all} font loading is delegated to \LUA, and there is no +loading code built in the engine. Also, instead of \prm {font} in \CONTEXT\ one +uses dedicated and more advanced font definition commands. + +\stopoldprimitive + +\startnewprimitive[title={\prm {fontcharba}}] + +Fetches the bottom anchor of a character in the given font, so: + +\startbuffer +\the\fontcharba\textfont0 "222B +\stopbuffer + +results in: \inlinebuffer. However, this anchor is only available when it is set +and it is not part of \OPENTYPE; it is something that \CONTEXT\ provides for math +fonts. + +\stopnewprimitive + +\startoldprimitive[title={\prm {fontchardp}}] + +Fetches the depth of a character in the given font, so: + +\startbuffer +\the\fontchardp\font`g +\stopbuffer + +results in: \inlinebuffer. + +\stopoldprimitive + +\startoldprimitive[title={\prm {fontcharht}}] + +Fetches the width of a character in the given font, so: + +\startbuffer +\the\fontcharht\font`g +\stopbuffer + +results in: \inlinebuffer. + +\stopoldprimitive + +\startoldprimitive[title={\prm {fontcharic}}] + +Fetches the italic correction of a character in the given font, but because it is +not an \OPENTYPE\ property it is unlikely to return something useful. Although +math fonts have such a property in \CONTEXT\ we deal with it differently. + +\stopoldprimitive + +\startnewprimitive[title={\prm {fontcharta}}] + +Fetches the top anchor of a character in the given font, so: + +\startbuffer +\the\fontcharba\textfont0 "222B +\stopbuffer + +results in: \inlinebuffer. This is a specific property of math characters because +in text mark anchoring is driven by a feature. + +\stopnewprimitive + +\startoldprimitive[title={\prm {fontcharwd}}] + +Fetches the width of a character in the given font, so: + +\startbuffer +\the\fontcharwd\font`g +\stopbuffer + +results in: \inlinebuffer. + +\stopoldprimitive + +\startoldprimitive[title={\prm {fontdimen}}][obsolete=yes] + +A traditional \TEX\ font has a couple of font specific dimensions, we only +mention the seven that come with text fonts: + +\startitemize[n,packed] +\startitem + The slant (slope) is an indication that we have an italic shape. The value + divided by 65.536 is a fraction that can be compared with for instance the + \type {slanted} operator in \METAPOST. It is used for positioning accents, so + actually not limited to oblique fonts (just like italic correction can be a + property of any character). It is not relevant in the perspective of + \OPENTYPE\ fonts where we have glyph specific top and bottom anchors. +\stopitem +\startitem + Unless is it overloaded by \prm {spaceskip} this determines the space between + words (or actually anything separated by a space). +\stopitem +\startitem + This is the stretch component of \prm {fontdimen}~2(space). +\startitem + This is the shrink component of \prm {fontdimen}~2(space). +\stopitem +\startitem + The so called ex|-|height is normally the height of the \quote {x} and is + also accessible as \type {em} unit. +\stopitem +\startitem + The so called em|-|width or in \TEX\ speak quad width is about the with of an + \quote {M} but in many fonts just matches the font size. It is also + accessible as \type {em} unit. +\stopitem +\startitem + This is a very \TEX\ specific property also known as extra space. It gets + {\em added} to the regular space after punctuation when \prm {spacefactor} is + 2000 or more. It can be overloaded by \prm {xspaceskip}. +\stopitem +\stopitemize + +This primitive expects a a number and a font identifier. Setting a font dimension +is a global operation as it directly pushes the value in the font resource. + +\stopoldprimitive + +\startnewprimitive[title={\prm {fontid}}] + +Returns the (internal) number associated with the given font: + +\startbuffer +{\bf \xdef\MyFontA{\the\fontid\font}} +{\sl \xdef\MyFontB{\setfontid\the\fontid\font}} +\stopbuffer + +\typebuffer \getbuffer + +with: + +\startbuffer +test {\setfontid\MyFontA test} test {\MyFontB test} test +\stopbuffer + +\typebuffer + +gives: \inlinebuffer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontmathcontrol}}] + +The \prm {mathfontcontrol} parameter controls how the engine deals with specific +font related properties and possibilities. It is set at the \TEX\ end. It makes +it possible to fine tune behavior in this mixed traditional and not perfect +\OPENTYPE\ math font arena. One can also set this bitset when initializing +(loading) the font (at the \LUA\ end) and the value set there is available in +\prm {fontmathcontrol}. The bits set in the font win over those in \prm +{mathfontcontrol}. There are a few cases where we set these options in the (so +called) goodie files. For instance we ignore font kerns in Libertinus, Antykwa +and some more. + +\starttabulate[|l|rT|] +\NC modern \NC \bgroup\switchtobodyfont [modern]\normalexpanded{\egroup 0x\tohexadecimal\fontmathcontrol\textfont\fam} \NC \NR +\NC pagella \NC \bgroup\switchtobodyfont [pagella]\normalexpanded{\egroup 0x\tohexadecimal\fontmathcontrol\textfont\fam} \NC \NR +\NC antykwa \NC \bgroup\switchtobodyfont [antykwa]\normalexpanded{\egroup 0x\tohexadecimal\fontmathcontrol\textfont\fam} \NC \NR +\NC libertinus \NC \bgroup\switchtobodyfont[libertinus]\normalexpanded{\egroup 0x\tohexadecimal\fontmathcontrol\textfont\fam} \NC \NR +\stoptabulate + +\stopnewprimitive + +\startoldprimitive[title={\prm {fontname}}] + +Depending on how the font subsystem is implemented this gives some information +about the used font: + +\startbuffer +{\tf \fontname\font} +{\bf \fontname\font} +{\sl \fontname\font} +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +\stopoldprimitive + +\startnewprimitive[title={\prm {fontspecdef}}] + +This primitive creates a reference to a specification that when triggered will +change multiple parameters in one go. + +\starttyping +\fontspecdef\MyFontSpec + \fontid\font + scale 1200 + xscale 1100 + yscale 800 + weight 200 + slant 500 +\relax +\stoptyping + +is equivalent to: + +\starttyping +\fontspecdef\MyFontSpec + \fontid\font + all 1200 1100 800 200 500 +\relax +\stoptyping + +while + +\starttyping +\fontspecdef\MyFontSpec + \fontid\font + all \glyphscale \glyphxscale \glyphyscale \glyphslant \glyphweight +\relax +\stoptyping + +is the same as + +\starttyping +\fontspecdef\MyFontSpec + \fontid\font +\relax +\stoptyping + +The engine adapts itself to these glyph parameters but when you access certain +quantities you have to make sure that you use the scaled ones. The same is true +at the \LUA\ end. This is somewhat fundamental in the sense that when one uses +these sort of dynamic features one also need to keep an eye on code that uses +font specific dimensions. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecid}}] + +Internally a font reference is a number and this primitive returns the number of +the font bound to the specification. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecifiedname}}] + +Depending on how the font subsystem is implemented this gives some information +about the (original) definition of the used font: + +\startbuffer +{\tf \fontspecifiedname\font} +{\bf \fontspecifiedname\font} +{\sl \fontspecifiedname\font} +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecifiedsize}}] + +Depending on how the font subsystem is implemented this gives some information +about the (original) size of the used font: + +\startbuffer +{\tf \the\fontspecifiedsize\font : \the\glyphscale} +{\bfa \the\fontspecifiedsize\font : \the\glyphscale} +{\slx \the\fontspecifiedsize\font : \the\glyphscale} +\stopbuffer + +\typebuffer + +Depending on how the font system is setup, this is not the real value that is +used in the text because we can use for instance \prm {glyphscale}. So the next +lines depend on what font mode this document is typeset. + +\startlines +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecscale}}] + +This returns the scale factor of a fontspec where as usual 1000 means scaling +by~1. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecslant}}] + +This returns the slant factor of a font specification, usually between zero and +1000 with 1000 being maximum slant. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecweight}}] + +This returns the weight of the font specification. Reasonable values are between +zero and 500. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecxscale}}] + +This returns the scale factor of a font specification where as usual 1000 means +scaling by~1. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fontspecyscale}}] + +This returns the scale factor of a font specification where as usual 1000 means +scaling by~1. + +\stopnewprimitive + +\startnewprimitive[title={\prm {fonttextcontrol}}] + +This returns the text control flags that are set on the given font, here {\tttf +0x\tohexadecimal \fonttextcontrol \font}. Bits that can be set are: + +\getbuffer[engine:syntax:textcontrolcodes] + +\stopnewprimitive + +\startnewprimitive[title={\prm {forcedleftcorrection}}] + +This is a callback driven left correction signal similar to italic corrections. + +\stopnewprimitive + +\startnewprimitive[title={\prm {forcedrightcorrection}}] + +This is a callback driven right correction signal similar to italic corrections. + +\stopnewprimitive + +\startnewprimitive[title={\prm {formatname}}] + +It is in the name: {\tttf \filenameonly {\formatname}}, but we cheat here by only +showing the filename and not the full path, which in a \CONTEXT\ setup can span +more than a line in this paragraph. + +\stopnewprimitive + +\startnewprimitive[title={\prm {frozen}}] + +You can define a macro as being frozen: + +\starttyping +\frozen\def\MyMacro{...} +\stoptyping + +When you redefine this macro you get an error: + +\starttyping +! You can't redefine a frozen macro. +\stoptyping + +This is a prefix like \prm {global} and it can be combined with other prefixes. +\footnote {The \prm {outer} and \prm {long} prefixes are no|-|ops in +\LUAMETATEX\ and \LUATEX\ can be configured to ignore them.} + +\stopnewprimitive + +\startnewprimitive[title={\prm {futurecsname}}] + +In order to make the repertoire of \type {def}, \type {let} and \type {futurelet} +primitives complete we also have: + +\starttyping +\futurecsname MyMacro:1\endcsname\MyAction +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {futuredef}}] + +We elaborate on the example of using \prm {futurelet} in the previous section. +Compare that one with the next: + +\startbuffer +\def\MySpecialToken{[} +\def\DoWhatever{\ifx\NextToken\MySpecialToken YES\else NOP\fi : } +\futurelet\NextToken\DoWhatever [A]\crlf +\futurelet\NextToken\DoWhatever (A)\par +\stopbuffer + +\typebuffer + +This time we get: + +{\getbuffer} + +It is for that reason that we now also have \prm {futuredef}: + +\startbuffer +\def\MySpecialToken{[} +\def\DoWhatever{\ifx\NextToken\MySpecialToken YES\else NOP\fi : } +\futuredef\NextToken\DoWhatever [A]\crlf +\futuredef\NextToken\DoWhatever (A)\par +\stopbuffer + +\typebuffer + +So we're back to what we want: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {futureexpand}}] + +This primitive can be used as an alternative to a \prm {futurelet} approach, +which is where the name comes from. \footnote {In the engine primitives +that have similar behavior are grouped in commands that are then dealt with +together, code wise.} + +\startbuffer +\def\variantone<#1>{(#1)} +\def\varianttwo#1{[#1]} +\futureexpand<\variantone\varianttwo +\futureexpand<\variantone\varianttwo{two} +\stopbuffer + +\typebuffer + +So, the next token determines which of the two variants is taken: + +{\getbuffer} + +Because we look ahead there is some magic involved: spaces are ignored but when +we have no match they are pushed back into the input. The next variant +demonstrates this: + +\startbuffer +\def\variantone<#1>{(#1)} +\def\varianttwo{} +\def\temp{\futureexpand<\variantone\varianttwo} +[\temp ] +[\temp {two}] +[\expandafter\temp\space ] +[\expandafter\temp\space {two}] +\stopbuffer + +\typebuffer + +This gives us: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {futureexpandis}}] + +We assume that the previous section is read. This variant will not push back +spaces, which permits a consistent approach i.e.\ the user can assume that macro +always gobbles the spaces. + +\startbuffer +\def\variantone<#1>{(#1)} +\def\varianttwo{} +\def\temp{\futureexpandis<\variantone\varianttwo} +[\temp ] +[\temp {two}] +[\expandafter\temp\space ] +[\expandafter\temp\space {two}] +\stopbuffer + +\typebuffer + +So, here no spaces are pushed back. This \type {is} in the name of this primitive +means \quote {ignore spaces}, but having that added to the name would have made +the primitive even more verbose (after all, we also don't have \type +{\expandeddef} but \prm {edef} and no \type {\globalexpandeddef} but \prm +{xdef}. + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {futureexpandisap}}] + +This primitive is like the one in the previous section but also ignores par +tokens, so \type {isap} means \quote {ignore spaces and paragraphs}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {futurelet}}] + +The original \TEX\ primitive \prm {futurelet} can be used to create an alias to a next token, +push it back into the input and then expand a given token. + +\startbuffer +\let\MySpecialTokenL[ +\let\MySpecialTokenR] % nicer for checker +\def\DoWhatever{\ifx\NextToken\MySpecialTokenL YES\else NOP\fi : } +\futurelet\NextToken\DoWhatever [A]\crlf +\futurelet\NextToken\DoWhatever (A)\par +\stopbuffer + +\typebuffer + +This is typically the kind of primitive that most users will never use because it +expects a sane follow up handler (here \type {\DoWhatever}) and therefore is +related to user interfacing. + +{\getbuffer} + +\stopoldprimitive + +\startoldprimitive[title={\prm {gdef}}] + +The is the global companion of \prm {def}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {gdefcsname}}] + +As with standard \TEX\ we also define global ones: + +\starttyping +\expandafter\gdef\csname MyMacro:1\endcsname{...} + \gdefcsname MyMacro:1\endcsname{...} +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {givenmathstyle}}] + +This primitive expects a math style and returns it when valid or otherwise issues +an error. + +\stopnewprimitive + +\startnewprimitive[title={\prm {gleaders}}] + +Leaders are glue with special property: a box, rule of (in \LUAMETATEX) glyph, like: + +\startlines +x\leaders \glyph `M \hfill x +xx\leaders \glyph `M \hfill xx + +x\cleaders \glyph `M \hfill x +xx\cleaders \glyph `M \hfill xx + +x\xleaders \glyph `M \hfill x +xx\xleaders \glyph `M \hfill xx + +x\gleaders \glyph `M \hfill x +xx\gleaders \glyph `M \hfill xx +\stoplines + +Leaders fill the available space. The \prm {leaders} command starts at the left +edge and stops when there is no more space. The blobs get centered when we use +\prm {cleaders}: excess space is distributed before and after a blob while \prm +{xleaders} also puts space between the blobs. + +When a rule is given the advance (width or height and depth) is ignored, so these +are equivalent. + +\starttyping +x\leaders \hrule \hfill x +x\leaders \hrule width 1cm \hfill x +\stoptyping + +When a box is used one will normally have some alignment in that box. + +\starttyping +x\leaders \hbox {\hss.\hss} \hfill x +x\leaders \hbox {\hss.\hss} \hskip 6cm \relax x +\stoptyping + +The reference point is the left edge of the current (outer) box and the effective +glue (when it has stretch or shrink) depends on that box. The \prm {gleaders} +variant takes the page as reference. That makes it possible to \quote {align} +across boxes. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glet}}] + +This is the global companion of \prm {let}. The fact that it is not an original +primitive is probably due to the expectation for it not it not being used (as) +often (as in \CONTEXT). + +\stopnewprimitive + +\startnewprimitive[title={\prm {gletcsname}}] + +Naturally \LUAMETATEX\ also provides a global variant: + +\starttyping +\expandafter\global\expandafter\let\csname MyMacro:1\endcsname\relax +\expandafter \glet\csname MyMacro:1\endcsname\relax + \gletcsname MyMacro:1\endcsname\relax +\stoptyping + +So, here we save even more. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glettonothing}}] + +This is the global companion of \prm {lettonothing}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {global}}] + +This is one of the original prefixes that can be used when we define a macro of +change some register. + +\starttyping +\bgroup + \def\MyMacroA{a} +\global\def\MyMacroB{a} + \gdef\MyMacroC{a} +\egroup +\stoptyping + +The macro defined in the first line is forgotten when the groups is left. The +second and third definition are both global and these definitions are retained. + +\stopoldprimitive + +\startoldprimitive[title={\prm {globaldefs}}] + +When set to a positive value, this internal integer will force all definitions to +be global, and in a complex macro package that is not something a user will do +unless it is very controlled. + +\stopoldprimitive + +\startoldprimitive[title={\prm {glueexpr}}] + +This is a more extensive variant of \prm {dimexpr} that also handles the optional +stretch and shrink components. + +\stopoldprimitive + +\startoldprimitive[title={\prm {glueshrink}}] + +This returns the shrink component of a glue quantity. The result is a dimension +so you need to apply \prm {the} when applicable. + +\stopoldprimitive + +\startoldprimitive[title={\prm {glueshrinkorder}}] + +This returns the shrink order of a glue quantity. The result is a integer so you +need to apply \prm {the} when applicable. + +\stopoldprimitive + +\startnewprimitive[title={\prm {gluespecdef}}] + +A variant of \prm {integerdef} and \prm {dimensiondef} is: + +\starttyping +\gluespecdef\MyGlue = 3pt plus 2pt minus 1pt +\stoptyping + +The properties are comparable to the ones described in the previous sections. + +\stopnewprimitive + +\startoldprimitive[title={\prm {gluestretch}}] + +This returns the stretch component of a glue quantity. The result is a dimension +so you need to apply \prm {the} when applicable. + +\stopoldprimitive + +\startoldprimitive[title={\prm {gluestretchorder}}] + +This returns the stretch order of a glue quantity. The result is a integer so you +need to apply \prm {the} when applicable. + +\stopoldprimitive + +\startoldprimitive[title={\prm {gluetomu}}] + +The sequence \typ {\the \gluetomu 20pt plus 10pt minus 5pt} gives \the \gluetomu +20pt plus 10pt minus 5pt. + +\stopoldprimitive + +\startnewprimitive[title={\prm {glyph}}] + +This is a more extensive variant of \prm {char} that permits setting some +properties if the injected character node. + +\startbuffer +\ruledhbox{\glyph + scale 2000 xscale 9000 yscale 1200 + slant 700 weight 200 + xoffset 10pt yoffset -5pt left 10pt right 20pt + 123} +\quad +\ruledhbox{\glyph + scale 2000 xscale 9000 yscale 1200 + slant 700 weight 200 + 125} +\stopbuffer + +\typebuffer + +In addition one can specify \type {font} (symbol), \type {id} (valid font id +number), an \type {options} (bit set) and \type {raise}. + +\startlinecorrection +\dontleavehmode\getbuffer +\stoplinecorrection + +When no parameters are set, the current ones are used. More details and examples +of usage can be found in the \CONTEXT\ distribution. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphdatafield}}] + +The value of this parameter is assigned to data field in glyph nodes that get +injected. It has no meaning in itself but can be used at the \LUA\ end. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphoptions}}] + +The value of this parameter is assigned to the options field in glyph nodes that +get injected. + +\startcolumns +\getbuffer[engine:syntax:glyphoptions] +\stopcolumns + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphscale}}] + +An integer parameter defining the current glyph scale, assigned to glyphs +(characters) inserted into the current list. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphscriptfield}}] + +The value of this parameter is assigned to script field in glyph nodes that get +injected. It has no meaning in itself but can be used at the \LUA\ end. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphscriptscale}}] + +This multiplier is applied to text font and glyph dimension properties when script +style is used. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphscriptscriptscale}}] + +This multiplier is applied to text font and glyph dimension properties when +script script style is used. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphslant}}] + +An integer parameter defining the current glyph slant, assigned to glyphs +(characters) inserted into the current list. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphstatefield}}] + +The value of this parameter is assigned to script state in glyph nodes that get +injected. It has no meaning in itself but can be used at the \LUA\ end. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphtextscale}}] + +This multiplier is applied to text font and glyph dimension properties when text +style is used. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphweight}}] + +An integer parameter defining the current glyph weight, assigned to glyphs +(characters) inserted into the current list. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphxoffset}}] + +An integer parameter defining the current glyph x offset, assigned to glyphs +(characters) inserted into the current list. Normally this will only be set when +one explicitly works with glyphs and defines a specific sequence. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphxscale}}] + +An integer parameter defining the current glyph x scale, assigned to glyphs +(characters) inserted into the current list. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphxscaled}}] + +This primitive returns the given dimension scaled by the \prm {glyphscale} and +\prm {glyphxscale}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphyoffset}}] + +An integer parameter defining the current glyph x offset, assigned to glyphs +(characters) inserted into the current list. Normally this will only be set when +one explicitly works with glyphs and defines a specific sequence. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphyscale}}] + +An integer parameter defining the current glyph y scale, assigned to glyphs +(characters) inserted into the current list. + +\stopnewprimitive + +\startnewprimitive[title={\prm {glyphyscaled}}] + +This primitive returns the given dimension scaled by the \prm {glyphscale} and +\prm {glyphyscale}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {gtoksapp}}] + +This is the global variant of \prm {toksapp}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {gtokspre}}] + +This is the global variant of \prm {tokspre}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {halign}}] + +This command starts horizontally aligned material. Macro packages use this +command in table mechanisms and math alignments. It starts with a preamble +followed by entries (rows and columns). + +\stopoldprimitive + +\startoldprimitive[title={\prm {hangafter}}] + +This parameter tells the par builder when indentation specified with \prm +{hangindent} starts. A negative value does the opposite and starts indenting +immediately. So, a value of $-2$ will make the first two lines indent. + +\stopoldprimitive + +\startoldprimitive[title={\prm {hangindent}}] + +This parameter relates to \prm {hangafter} and sets the amount of indentation. +When larger than zero indentation happens left, otherwise it starts at the right +edge. + +\stopoldprimitive + +\startoldprimitive[title={\prm {hbadness}}] + +This sets the threshold for reporting a horizontal badness value, its current +value is \the \badness. + +\stopoldprimitive + +\startoldprimitive[title={\prm {hbox}}] + +This constructs a horizontal box. There are a lot of optional parameters so more +details can be found in dedicated manuals. When the content is packed a callback +can kick in that can be used to apply for instance font features. + +\stopoldprimitive + +\startnewprimitive[title={\prm {hccode}}] + +The \TEX\ engine is good at hyphenating but traditionally that has been limited +to hyphens. Some languages however use different characters. You can set up a +different \prm {hyphenchar} as well as pre and post characters, but there's also +a dedicated code for controlling this. + +\startbuffer +\hccode"2013 "2013 + +\hsize 50mm test\char"2013test\par +\hsize 1mm test\char"2013test\par + +\hccode"2013 `! + +\hsize 50mm test\char"2013test\par +\hsize 1mm test\char"2013test\par +\stopbuffer + +\typebuffer + +This example shows that we can mark a character as hyphen|-|like but also can +remap it to something else: + +\startpacked \getbuffer \stoppacked + +\stopnewprimitive + +\startoldprimitive[title={\prm {hfil}}] + +This is a shortcut for \typ {\hskip plus 1 fil} (first order filler). + +\stopoldprimitive + +\startoldprimitive[title={\prm {hfill}}] + +This is a shortcut for \typ {\hskip plus 1 fill} (second order filler). + +\stopoldprimitive + +\startoldprimitive[title={\prm {hfilneg}}] + +This is a shortcut for \typ {\hskip plus - 1 fil} so it can compensate \prm +{hfil}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {hfuzz}}] + +This dimension sets the threshold for reporting horizontal boxes that are under- +or overfull. The current value is \the \hfuzz. + +\stopoldprimitive + +\startnewprimitive[title={\prm {hjcode}}] + +The so called lowercase code determines if a character is part of a +to|-|be|-|hyphenated word. In \LUATEX\ we introduced the \quote {hyphenation +justification} code as replacement. When a language is saved and no \prm {hjcode} +is set the \prm {lccode} is used instead. This code serves a second purpose. When +the assigned value is greater than 0 but less than 32 it indicated the to be used +length when checking for left- and righthyphenmin. For instance it make sense to +set the code to~2 for characters like œ. + +\stopnewprimitive + +\startoldprimitive[title={\prm {hkern}}] + +This primitive is like \prm {kern} but will force the engine into horizontal mode +if it isn't yet. + +\stopoldprimitive + +\startnewprimitive[title={\prm {hmcode}}] + +The \type {hm} stands for \quote {hyphenation math}. When bit~1 is set the +characters will be repeated on the next line after a break. The second bit +concerns italic correction but is of little relevance now that we moved to a +different model in \CONTEXT. Here are some examples, we also show an example of +\prm {mathdiscretionary} because that is what this code triggers: + +\startbuffer +test $ \dorecurse {50} { + a \discretionary class 2 {$\darkred +$}{$\darkgreen +$}{$\darkblue +$} +} b$ + +test $ a \mathdiscretionary class 1 {-}{-}{-} b$ + +\bgroup + \hmcode"002B=1 % + + \hmcode"002D=1 % - + \hmcode"2212=1 % - + test $ \dorecurse{50}{a + b - } c$ +\egroup +\stopbuffer + +\typebuffer + +{\setuptolerance[verytolerant,stretch]\getbuffer} + +\stopnewprimitive + +\startoldprimitive[title={\prm {holdinginserts}}] + +When set to a positive value inserts will be kept in the stream and not moved to +the insert registers. + +\stopoldprimitive + +\startnewprimitive[title={\prm {holdingmigrations}}] + +When set to a positive value marks (and adjusts) will be kept in the stream and +not moved to the outer level or related registers. + +\stopnewprimitive + +\startnewprimitive[title={\prm {hpack}}] + +This primitive is like \prm {hbox} but without the callback overhead. + +\stopnewprimitive + +\startnewprimitive[title={\prm {hpenalty}}] + +This primitive is like \prm {penalty} but will force the engine into horizontal +mode if it isn't yet. + +\stopnewprimitive + +\startoldprimitive[title={\prm {hrule}}] + +This creates a horizontal rule. Unless the width is set it will stretch to fix +the available width. In addition to the traditional \type {width}, \type {height} +and \type {depth} specifiers some more are accepted. These are discussed in other +manuals. To give an idea: + +\startbuffer +h\hrule width 10mm height 2mm depth 1mm \relax rule +h\hrule width 10mm height 2mm depth 1mm xoffset 30mm yoffset -10mm \relax rule +v\vrule width 10mm height 2mm depth 1mm \relax rule +v\vrule width 10mm height 2mm depth 1mm xoffset 30mm yoffset 10mm \relax rule +\stopbuffer + +\typebuffer + +The \prm {relax} stops scanning and because we have more keywords we get a +different error report than in traditional \TEX\ when a lookahead confuses the +engine. On separate lines we get the following. + +\startlines +\getbuffer +\stoplines + +\stopoldprimitive + +\startoldprimitive[title={\prm {hsize}}] + +This sets (or gets) the current horizontal size. + +\startbuffer +\hsize 40pt \setbox0\vbox{x} hsize: \the\wd0 +\setbox0\vbox{\hsize 40pt x} hsize: \the\wd0 +\stopbuffer + +\typebuffer + +In both cases we get the same size reported but the first one will also influence +the current paragraph when used ungrouped. + +\startlines +\getbuffer +\stoplines + +\stopoldprimitive + +\startoldprimitive[title={\prm {hskip}}] + +The given glue is injected in the horizontal list. If possible horizontal mode is +entered. + +\stopoldprimitive + +\startoldprimitive[title={\prm {hss}}] + +\startbuffer +x\hbox to 0pt{\hskip 0pt plus 1 fil minus 1 fil\relax test}x +x\hbox to 0pt{\hss test}x +x\hbox to 0pt{test\hskip 0pt plus 1 fil minus 1 fil\relax}x +x\hbox to 0pt{test\hss}x +\stopbuffer + +In traditional \TEX\ glue specifiers are shared. This makes a lot of sense when +memory has to be saved. For instance spaces in a paragraph of text are often the +same and a glue specification has at least an amount, stretch, shrink, stretch +order and shrink order field plus a leader pointer; in \LUAMETATEX\ we have even +more fields. In \LUATEX\ these shared (and therefore referenced) glue spec nodes +became just copies. + +\typebuffer + +The \prm {hss} primitives injects a glue node with one order stretch and one +order shrink. In traditional \TEX\ this is a reference to a shared specification, +and in \LUATEX\ just a copy of a predefined specifier. The only gain is now in +tokens because one could just be explicit or use a glue register with that value +because we have plenty glue registers. + +\startlines +\getbuffer +\stoplines + +We could have this: + +\starttyping +\permanent\protected\untraced\def\hss + {\hskip0pt plus 1 fil minus 1 fil\relax} +\stoptyping + +or this: + +\starttyping +\gluespecdef\hssglue 0pt plus 1 fil minus 1 fil + +\permanent\protected\untraced\def\hss + {\hskip\hssglue} +\stoptyping + +but we just keep the originals around. + +\stopoldprimitive + +\startoldprimitive[title={\prm {ht}}] + +Returns the height of the given box. + +\stopoldprimitive + +\startoldprimitive[title={\prm {hyphenation}}] + +The list passed to this primitive contains hyphenation exceptions that get bound +to the current language. In \LUAMETATEX\ this can be managed at the \LUA\ end. +Exceptions are not stored in the format file. + +\stopoldprimitive + +\startnewprimitive[title={\prm {hyphenationmin}}] + +This property (that also gets bond to the current language) sets the minimum +length of a word that gets hyphenated. + +\stopnewprimitive + +% \startnewprimitive[title={\prm {hyphenationmode}}] +% \stopnewprimitive + +\startoldprimitive[title={\prm {hyphenchar}}] + +This is one of the font related primitives: it returns the number of the hyphen +set in the given font. + +\stopoldprimitive + +\startoldprimitive[title={\prm {hyphenpenalty}}] + +Discretionary nodes have a related default penalty. The \prm {hyphenpenalty} is +injected after a regular discretionary, and \prm {exhyphenpenalty} after \type +{\-} or \type {-}. The later case is called an automatic discretionary. In +\LUAMETATEX\ we have two extra penalties: \prm {explicithyphenpenalty} and \prm +{automatichyphenpenalty} and these are used when the related bits are set in \prm +{hyphenationmode}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {if}}] + +This traditional \TEX\ conditional checks if two character codes are the same. In +order to understand unexpanded results it is good to know that internally \TEX\ +groups primitives in a way that serves the implementation. Each primitive has a +command code and a character code, but only for real characters the name +character code makes sense. This condition only really tests for character codes +when we have a character, in all other cases, the result is true. + +\startbuffer +\def\A{A}\def\B{B} \chardef\C=`C \chardef\D=`D \def\AA{AA} + +[\if AA YES \else NOP \fi] [\if AB YES \else NOP \fi] +[\if \A\B YES \else NOP \fi] [\if \A\A YES \else NOP \fi] +[\if \C\D YES \else NOP \fi] [\if \C\C YES \else NOP \fi] +[\if \count\dimen YES \else NOP \fi] [\if \AA\A YES \else NOP \fi] + +\stopbuffer + +\typebuffer + +The last example demonstrates that the tokens get expanded, which is why +we get the extra \type {A}: + +{\getbuffer} + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifabsdim}}] + +This test will negate negative dimensions before comparison, as in: + +\startbuffer +\def\TestA#1{\ifdim #1<2pt too small\orelse\ifdim #1>4pt too large\else okay\fi} +\def\TestB#1{\ifabsdim#1<2pt too small\orelse\ifabsdim#1>4pt too large\else okay\fi} + +\TestA {1pt}\quad\TestA {3pt}\quad\TestA {5pt}\crlf +\TestB {1pt}\quad\TestB {3pt}\quad\TestB {5pt}\crlf +\TestB{-1pt}\quad\TestB{-3pt}\quad\TestB{-5pt}\par +\stopbuffer + +\typebuffer + +So we get this: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifabsfloat}}] + +This test will negate negative floats before comparison, as in: + +\startbuffer +\def\TestA#1{\iffloat #1<2.46 small\orelse\iffloat #1>4.68 large\else medium\fi} +\def\TestB#1{\ifabsfloat#1<2.46 small\orelse\ifabsfloat#1>4.68 large\else medium\fi} + +\TestA {1.23}\quad\TestA {3.45}\quad\TestA {5.67}\crlf +\TestB {1.23}\quad\TestB {3.45}\quad\TestB {5.67}\crlf +\TestB{-1.23}\quad\TestB{-3.45}\quad\TestB{-5.67}\par +\stopbuffer + +\typebuffer + +So we get this: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifabsnum}}] + +This test will negate negative numbers before comparison, as in: + +\startbuffer +\def\TestA#1{\ifnum #1<100 too small\orelse\ifnum #1>200 too large\else okay\fi} +\def\TestB#1{\ifabsnum#1<100 too small\orelse\ifabsnum#1>200 too large\else okay\fi} + +\TestA {10}\quad\TestA {150}\quad\TestA {210}\crlf +\TestB {10}\quad\TestB {150}\quad\TestB {210}\crlf +\TestB{-10}\quad\TestB{-150}\quad\TestB{-210}\par +\stopbuffer + +\typebuffer + +Here we get the same result each time: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifarguments}}] + +This is a variant of \prm {ifcase} were the selector is the number of arguments +picked up. For example: + +\startbuffer +\def\MyMacro#1#2#3{\ifarguments\0\or1\or2\or3\else ?\fi} \MyMacro{A}{B}{C} +\def\MyMacro#1#0#3{\ifarguments\0\or1\or2\or3\else ?\fi} \MyMacro{A}{B}{C} +\def\MyMacro#1#-#2{\ifarguments\0\or1\or2\or3\else ?\fi} \MyMacro{A}{B}{C}\par +\stopbuffer + +\typebuffer + +Watch the non counted, ignored, argument in the last case. Normally this test will +be used in combination with \prm {ignorearguments}. + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifboolean}}] + +This tests a number (register or equivalent) and any nonzero value represents +\type {true}, which is nicer than using an \type {\unless \ifcase}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {ifcase}}] + +This numeric \TEX\ conditional takes a counter (literal, register, shortcut to a +character, internal quantity) and goes to the branch that matches. + +\startbuffer +\ifcase 3 zero\or one\or two\or three\or four\else five or more\fi +\stopbuffer + +\typebuffer + +Indeed: \inlinebuffer\ equals three. In later sections we will see some +\LUAMETATEX\ primitives that behave like an \prm {ifcase}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifcat}}] + +Another traditional \TEX\ primitive: what happens with what gets read in depends +on the catcode of a character, think of characters marked to start math mode, or +alphabetic characters (letters) versus other characters (like punctuation). + +\startbuffer +\def\A{A}\def\B{,} \chardef\C=`C \chardef\D=`, \def\AA{AA} + +[\ifcat $! YES \else NOP \fi] [\ifcat () YES \else NOP \fi] +[\ifcat AA YES \else NOP \fi] [\ifcat AB YES \else NOP \fi] +[\ifcat \A\B YES \else NOP \fi] [\ifcat \A\A YES \else NOP \fi] +[\ifcat \C\D YES \else NOP \fi] [\ifcat \C\C YES \else NOP \fi] +[\ifcat \count\dimen YES \else NOP \fi] [\ifcat \AA\A YES \else NOP \fi] +\stopbuffer + +\typebuffer + +Close reading is needed here: + +{\getbuffer} + +This traditional \TEX\ condition as a well as the one in the previous section are +hardly used in \CONTEXT, if only because they expand what follows and we seldom +need to compare characters. + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifchkdim}}] + +A variant on the checker in the previous section is a dimension checker: + +\startbuffer +\ifchkdim oeps \or okay\else error\fi\quad +\ifchkdim 12 \or okay\else error\fi\quad +\ifchkdim 12pt \or okay\else error\fi\quad +\ifchkdim 12pt or more\or okay\else error\fi +\stopbuffer + +\typebuffer + +We get: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifchkdimension}}] + +COntrary to \prm {ifchkdim} this test doesn't accept trailing crap: + +\startbuffer +\ifchkdimension oeps \or okay\else error\fi\quad +\ifchkdimension 12 \or okay\else error\fi\quad +\ifchkdimension 12pt \or okay\else error\fi\quad +\ifchkdimension 12pt or more\or okay\else error\fi +\stopbuffer + +\typebuffer + +reports: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifchknum}}] + +In \CONTEXT\ there are quite some cases where a variable can have a number or a +keyword indicating a symbolic name of a number or maybe even some special +treatment. Checking if a valid number is given is possible to some extend, but a +native checker makes much sense too. So here is one: + +\startbuffer +\ifchknum oeps \or okay\else error\fi\quad +\ifchknum 12 \or okay\else error\fi\quad +\ifchknum 12pt \or okay\else error\fi\quad +\ifchknum 12pt or more\or okay\else error\fi +\stopbuffer + +\typebuffer + +The result is as expected: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifchknumber}}] + +This check is more restrictive than \prm {ifchknum} discussed in the previous +section: + +\startbuffer +\ifchknumber oeps \or okay\else error\fi\quad +\ifchknumber 12 \or okay\else error\fi\quad +\ifchknumber 12pt \or okay\else error\fi\quad +\ifchknumber 12pt or more\or okay\else error\fi +\stopbuffer + +\typebuffer + +Here we get: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifcmpdim}}] + +This conditional compares two dimensions and the resulting \prm {ifcase} +reflects their relation: + +\startbuffer +[1pt 2pt : \ifcmpdim 1pt 2pt less\or equal\or more\fi]\quad +[1pt 1pt : \ifcmpdim 1pt 1pt less\or equal\or more\fi]\quad +[2pt 1pt : \ifcmpdim 2pt 1pt less\or equal\or more\fi] +\stopbuffer + +\typebuffer + +This gives: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifcmpnum}}] + +This conditional compares two numbers and the resulting \prm {ifcase} reflects +their relation: + +\startbuffer +[1 2 : \ifcmpnum 1 2 less\or equal\or more\fi]\quad +[1 1 : \ifcmpnum 1 1 less\or equal\or more\fi]\quad +[2 1 : \ifcmpnum 2 1 less\or equal\or more\fi] +\stopbuffer + +\typebuffer + +This gives: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifcondition}}] + +The conditionals in \TEX\ are hard coded as primitives and although it might +look like \type {\newif} creates one, it actually just defined three macros. + +\startbuffer +\newif\ifMyTest +\meaning\MyTesttrue \crlf +\meaning\MyTestfalse \crlf +\meaning\ifMyTest \crlf \MyTesttrue +\meaning\ifMyTest \par +\stopbuffer + +\typebuffer {\tttf \getbuffer} + +This means that when you say: + +\starttyping +\ifMytest ... \else ... \fi +\stoptyping + +You actually have one of: + +\starttyping +\iftrue ... \else ... \fi +\iffalse ... \else ... \fi +\stoptyping + +and because these are proper conditions nesting them like: + +\starttyping +\ifnum\scratchcounter > 0 \ifMyTest A\else B\fi \fi +\stoptyping + +will work out well too. This is not true for macros, so for instance: + +\starttyping +\scratchcounter = 1 +\unexpanded\def\ifMyTest{\iftrue} +\ifnum\scratchcounter > 0 \ifMyTest A\else B\fi \fi +\stoptyping + +will make a run fail with an error (or simply loop forever, depending on your +code). This is where \prm {ifcondition} enters the picture: + +\starttyping +\def\MyTest{\iftrue} \scratchcounter0 +\ifnum\scratchcounter > 0 + \ifcondition\MyTest A\else B\fi +\else + x +\fi +\stoptyping + +This primitive is seen as a proper condition when \TEX\ is in \quotation {fast +skipping unused branches} mode but when it is expanding a branch, it checks if +the next expanded token is a proper tests and if so, it deals with that test, +otherwise it fails. The main condition here is that the \type {\MyTest} macro +expands to a proper true or false test, so, a definition like: + +\starttyping +\def\MyTest{\ifnum\scratchcounter<10 } +\stoptyping + +is also okay. Now, is that neat or not? + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifcramped}}] + +Depending on the given math style this returns true of false: + +\startbuffer +\ifcramped\mathstyle no \fi +\ifcramped\crampedtextstyle yes \fi +\ifcramped\textstyle no \fi +\ifcramped\displaystyle yes \fi +\stopbuffer + +\typebuffer + +gives: \inlinebuffer. + +\stopnewprimitive + +\startoldprimitive[title={\prm {ifcsname}}] + +This is an \ETEX\ conditional that complements the one on the previous section: + +\starttyping +\expandafter\ifx\csname MyMacro\endcsname\relax ... \else ... \fi + \ifcsname MyMacro\endcsname ... \else ... \fi +\stoptyping + +Here the first one has the side effect of defining the macro and defaulting it to +\prm {relax}, while the second one doesn't do that. Just think of checking a +few million different names: the first one will deplete the hash table and +probably string space too. + +In \LUAMETATEX\ the construction stops when there is no letter or other character +seen (\TEX\ expands on the go so expandable macros are dealt with). Instead of an +error message, the match is simply false and all tokens till the \prm +{endcsname} are gobbled. + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifcstok}}] + +A variant on the primitive mentioned in the previous section is one that +operates on lists and macros: + +\startbuffer[a] +\def\a{a} \def\b{b} \def\c{a} +\stopbuffer + +\typebuffer[a] + +\startbuffer[b] +\ifcstok\a\b Y\else N\fi\space +\ifcstok\a\c Y\else N\fi\space +\ifcstok{\a}\c Y\else N\fi\space +\ifcstok{a}\c Y\else N\fi +\stopbuffer + +This: + +\typebuffer[b] + +{\getbuffer[a]will give us: \inlinebuffer[b].} + +\stopnewprimitive + +\startoldprimitive[title={\prm {ifdefined}}] + +In traditional \TEX\ checking for a macro to exist was a bit tricky and therefore +\ETEX\ introduced a convenient conditional. We can do this: + +\starttyping +\ifx\MyMacro\undefined ... \else ... \fi +\stoptyping + +but that assumes that \type {\undefined} is indeed undefined. Another test often +seen was this: + +\starttyping +\expandafter\ifx\csname MyMacro\endcsname\relax ... \else ... \fi +\stoptyping + +Instead of comparing with \type {\undefined} we need to check with \prm {relax} +because the control sequence is defined when not yet present and defaults to +\prm {relax}. This is not pretty. + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifdim}}] + +Dimensions can be compared with this traditional \TEX\ primitive. + +\startbuffer +\scratchdimen=1pt \scratchcounter=65536 + +\ifdim\scratchdimen=\scratchcounter sp YES \else NOP\fi +\ifdim\scratchdimen=1 pt YES \else NOP\fi +\stopbuffer + +\typebuffer + +The units are mandate: + +{\getbuffer} + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifdimexpression}}] + +The companion of the previous primitive is: + +\startbuffer +\ifdimexpression 10pt > 10bp \relax + do-something +\fi +\stopbuffer + +This matches when the result is non zero, and you can mix calculations and tests +as with normal expressions. Contrary to the number variant units can be used and +precision kicks in. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifdimval}}] + +This conditional is a variant on \prm {ifchkdim} and provides some more +detailed information about the value: + +\startbuffer +[-12pt : \ifdimval-12pt\or negative\or zero\or positive\else error\fi]\quad +[0pt : \ifdimval 0pt\or negative\or zero\or positive\else error\fi]\quad +[12pt : \ifdimval 12pt\or negative\or zero\or positive\else error\fi]\quad +[oeps : \ifdimval oeps\or negative\or zero\or positive\else error\fi] +\stopbuffer + +\typebuffer + +This gives: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifempty}}] + +This conditional checks if a control sequence is empty: + +\starttyping +is \ifempty\MyMacro \else not \fi empty +\stoptyping + +It is basically a shortcut of: + +\starttyping +is \ifx\MyMacro\empty \else not \fi empty +\stoptyping + +with: + +\starttyping +\def\empty{} +\stoptyping + +Of course this is not empty at all: + +\starttyping +\def\notempty#1{} +\stoptyping + +\stopnewprimitive + +\startoldprimitive[title={\prm {iffalse}}] + +Here we have a traditional \TEX\ conditional that is always false (therefore the +same is true for any macro that is \prm {let} to this primitive). + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifflags}}] + +This test primitive relates to the various flags that one can set on a control +sequence in the perspective of overload protection and classification. + +\startbuffer +\protected\untraced\tolerant\def\foo[#1]{...#1...} +\permanent\constant \def\oof{okay} +\stopbuffer + +\typebuffer + +\start \getbuffer +\starttabulate[|l|c|c|l|c|c|] +\FL +\NC flag \NC \type {\foo} \NC \type {\oof} +\NC flag \NC \type {\foo} \NC \type {\oof} \NC \NR +\ML +\NC frozen \NC \ifflags\foo\frozen Y\else N\fi \NC \ifflags\oof\frozen Y\else N\fi +\NC permanent \NC \ifflags\foo\permanent Y\else N\fi \NC \ifflags\oof\permanent Y\else N\fi \NC \NR +\NC immutable \NC \ifflags\foo\immutable Y\else N\fi \NC \ifflags\oof\immutable Y\else N\fi +\NC mutable \NC \ifflags\foo\mutable Y\else N\fi \NC \ifflags\oof\mutable Y\else N\fi \NC \NR +\NC noaligned \NC \ifflags\foo\noaligned Y\else N\fi \NC \ifflags\oof\noaligned Y\else N\fi +\NC instance \NC \ifflags\foo\instance Y\else N\fi \NC \ifflags\oof\instance Y\else N\fi \NC \NR +\NC untraced \NC \ifflags\foo\untraced Y\else N\fi \NC \ifflags\oof\untraced Y\else N\fi +\NC global \NC \ifflags\foo\global Y\else N\fi \NC \ifflags\oof\global Y\else N\fi \NC \NR +\NC tolerant \NC \ifflags\foo\tolerant Y\else N\fi \NC \ifflags\oof\tolerant Y\else N\fi +\NC constant \NC \ifflags\foo\constant Y\else N\fi \NC \ifflags\oof\constant Y\else N\fi \NC \NR +\NC protected \NC \ifflags\foo\protected Y\else N\fi \NC \ifflags\oof\protected Y\else N\fi +\NC semiprotected \NC \ifflags\foo\semiprotected Y\else N\fi \NC \ifflags\oof\semiprotected Y\else N\fi \NC \NR +\LL +\stoptabulate +\stop + +Instead of checking against a prefix you can test against a bitset made from: + +\startluacode +context.starttabulate { "|r|l|r|l|r|l|r|l|" } +local n = 4 +for k, v in table.sortedhash(tex.flagcodes) do + if tonumber(k) then + n = n - 1 + context.NC() context("0x%X",k) + context.NC() context(v) + if n == 0 then + context.NC() + context.NR() + n = 4 + end + end +end +context.stoptabulate() +\stopluacode + +\stopnewprimitive + +\startnewprimitive[title={\prm {iffloat}}] + +This test does for floats what \prm {ifnum}, \prm {ifdim} do for numbers and +dimensions: comparing two of them. + +\stopnewprimitive + +\startoldprimitive[title={\prm {iffontchar}}] + +This is an \ETEX\ conditional. It takes a font identifier and a character number. +In modern fonts simply checking could not be enough because complex font features +can swap in other ones and their index can be anything. Also, a font mechanism +can provide fallback fonts and characters, so don't rely on this one too much. It +just reports true when the font passed to the frontend has a slot filled. + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifhaschar}}] + +This one is a simplified variant of the above: + +\startbuffer +\ifhaschar !{this ! works} yes \else no \fi +\stopbuffer + +\typebuffer + +and indeed we get: \inlinebuffer ! Of course the spaces in this this example +code are normally not present in such a test. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifhastok}}] + +This conditional looks for occurrences in token lists where each argument has to +be a proper list. + +\startbuffer +\def\scratchtoks{x} + +\ifhastoks{yz} {xyz} Y\else N\fi\quad +\ifhastoks\scratchtoks {xyz} Y\else N\fi +\stopbuffer + +\typebuffer + +We get: + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifhastoks}}] + +This test compares two token lists. When a macro is passed it's meaning +gets used. + +\startbuffer +\def\x {x} +\def\xyz{xyz} + +(\ifhastoks {x} {xyz}Y\else N\fi)\quad +(\ifhastoks {\x} {xyz}Y\else N\fi)\quad +(\ifhastoks \x {xyz}Y\else N\fi)\quad +(\ifhastoks {y} {xyz}Y\else N\fi)\quad +(\ifhastoks {yz} {xyz}Y\else N\fi)\quad +(\ifhastoks {yz} {\xyz}Y\else N\fi) +\stopbuffer + +\typebuffer {\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifhasxtoks}}] + +This primitive is like the one in the previous section but this time the +given lists are expanded. + +\startbuffer +\def\x {x} +\def\xyz{\x yz} + +(\ifhasxtoks {x} {xyz}Y\else N\fi)\quad +(\ifhasxtoks {\x} {xyz}Y\else N\fi)\quad +(\ifhastoks \x {xyz}Y\else N\fi)\quad +(\ifhasxtoks {y} {xyz}Y\else N\fi)\quad +(\ifhasxtoks {yz} {xyz}Y\else N\fi)\quad +(\ifhasxtoks {yz} {\xyz}Y\else N\fi) +\stopbuffer + +\typebuffer {\getbuffer} + +This primitive has some special properties. + +\startbuffer +\edef\+{\expandtoken 9 `+} + +\ifhasxtoks {xy} {xyz}Y\else N\fi\quad +\ifhasxtoks {x\+y} {xyz}Y\else N\fi +\stopbuffer + +\typebuffer + +Here the first argument has a token that has category code \quote {ignore} which +means that such a character will be skipped when seen. So the result is: + +{\getbuffer} + +This permits checks like these: + +\startbuffer +\edef\,{\expandtoken 9 `,} + +\ifhasxtoks{\,x\,} {,x,y,z,}Y\else N\fi\quad +\ifhasxtoks{\,y\,} {,x,y,z,}Y\else N\fi\quad +\ifhasxtoks{\,z\,} {,x,y,z,}Y\else N\fi\quad +\ifhasxtoks{\,x\,} {,xy,z,}Y\else N\fi +\stopbuffer + +\typebuffer + +I admit that it needs a bit of a twisted mind to come up with this, but it works +ok: + +{\getbuffer} + +\stopnewprimitive + +\startoldprimitive[title={\prm {ifhbox}}] + +This traditional conditional checks if a given box register or internal box +variable represents a horizontal box, + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifhmode}}] + +This traditional conditional checks we are in (restricted) horizontal mode. + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifinalignment}}] + +As the name indicates, this primitive tests for being in an alignment. Roughly +spoken, the engine is either in a state of align, handling text or dealing with +math. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifincsname}}] + +This conditional is sort of obsolete and can be used to check if we're inside a +\prm {csname} or \prm {ifcsname} construction. It's not used in \CONTEXT. + +\stopnewprimitive + +\startoldprimitive[title={\prm {ifinner}}] + +This traditional one can be confusing. It is true when we are in restricted +horizontal mode (a box), internal vertical mode (a box), or inline math mode. + +\startbuffer +test \ifhmode \ifinner INNER\fi HMODE\fi\crlf +\hbox{test \ifhmode \ifinner INNER \fi HMODE\fi} \par + +\ifvmode \ifinner INNER\fi VMODE \fi\crlf +\vbox{\ifvmode \ifinner INNER \fi VMODE\fi} \crlf +\vbox{\ifinner INNER \ifvmode VMODE \fi \fi} \par +\stopbuffer + +\typebuffer + +Watch the last line: because we typeset \type {INNER} we enter horizontal mode: + +{\getbuffer} + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifinsert}}] + +This is the equivalent of \prm {ifvoid} for a given insert class. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifintervaldim}}] + +This conditional is true when the intervals around the values of two dimensions +overlap. The first dimension determines the interval. + +\startbuffer +[\ifintervaldim1pt 20pt 21pt \else no \fi overlap] +[\ifintervaldim1pt 18pt 20pt \else no \fi overlap] +\stopbuffer + +\typebuffer + +So here: \inlinebuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifintervalfloat}}] + +This one does with floats what we described under \prm {ifintervaldim}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifintervalnum}}] + +This one does with integers what we described under \prm {ifintervaldim}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {iflastnamedcs}}] + +When a \prm {csname} is constructed and succeeds the last one is remembered and +can be accessed with \prm {lastnamedcs}. It can however be an undefined one. That +state can be checked with this primitive. Of course it also works with the \prm +{ifcsname} and \prm {begincsname} variants. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifmathparameter}}] + +This is an \prm {ifcase} where the value depends on if the given math parameter +is zero, (\type {0}), set (\type {1}), or unset (\type {2}). + +\starttyping +\ifmathparameter\Umathpunctclosespacing\displaystyle + zero \or + nonzero \or + unset \fi +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifmathstyle}}] + +This is a variant of \prm {ifcase} were the number is one of the seven possible +styles: display, text, cramped text, script, cramped script, script script, +cramped script script. + +\starttyping +\ifmathstyle + display +\or + text +\or + cramped text +\else + normally smaller than text +\fi +\stoptyping + +\stopnewprimitive + +\startoldprimitive[title={\prm {ifmmode}}] + +This traditional conditional checks we are in (inline or display) math mode mode. + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifnum}}] + +This is a frequently used conditional: it compares two numbers where a number is +anything that can be seen as such. + +\startbuffer +\scratchcounter=65 \chardef\A=65 + +\ifnum65=`A YES \else NOP\fi +\ifnum\scratchcounter=65 YES \else NOP\fi +\ifnum\scratchcounter=\A YES \else NOP\fi +\stopbuffer + +\typebuffer + +Unless a number is an unexpandable token it ends with a space or \prm {relax}, +so when you end up in the true branch, you'd better check if \TEX\ could +determine where the number ends. + +{\getbuffer} + +% When comparing integers, definitions (for instance characters) that can be seen +% as such, or any converter that produces a number (like the \type {`} or \prm +% {number} the usual \type {=}, \type {<} or \type {>} can be used. However, in +% \LUAMETATEX\ you can negate such a comparison by \type {!}: \type {!=}, \type +% {!<} or \type {!>}. Successive \type {!} toggle the negation state. + +On top of these \ASCII\ combinations, the engine also accepts some \UNICODE\ +characters. This brings the full repertoire to: + +\starttabulate[|l|cT|cT|l|] +\FL +\BC character \BC \BC \BC operation \NC \NR +\ML +\NC \type {0x003C} \NC $\Uchar"003C$ \NC \NC less \NC \NR +\NC \type {0x003D} \NC $\Uchar"003D$ \NC \NC equal \NC \NR +\NC \type {0x003E} \NC $\Uchar"003E$ \NC \NC more \NC \NR +\NC \type {0x2208} \NC $\Uchar"2208$ \NC \NC element of \NC \NR +\NC \type {0x2209} \NC $\Uchar"2209$ \NC \NC not element of \NC \NR +\NC \type {0x2260} \NC $\Uchar"2260$ \NC != \NC not equal \NC \NR +\NC \type {0x2264} \NC $\Uchar"2264$ \NC !> \NC less equal \NC \NR +\NC \type {0x2265} \NC $\Uchar"2265$ \NC !< \NC greater equal \NC \NR +\NC \type {0x2270} \NC $\Uchar"2270$ \NC \NC not less equal \NC \NR +\NC \type {0x2271} \NC $\Uchar"2271$ \NC \NC not greater equal \NC \NR +\LL +\stoptabulate + +This also applied to \prm {ifdim} although in the case of element we discard the +fractional part (read: divide the numeric representation by 65536). + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifnumexpression}}] + +Here is an example of a conditional using expressions: + +\startbuffer +\ifnumexpression (\scratchcounterone > 5) and (\scratchcountertwo > 5) \relax + do-something +\fi +\stopbuffer + +This matches when the result is non zero, and you can mix calculations and tests +as with normal expressions. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifnumval}}] + +This conditional is a variant on \prm {ifchknum}. This time we get +some more detail about the value: + +\startbuffer +[-12 : \ifnumval -12\or negative\or zero\or positive\else error\fi]\quad +[0 : \ifnumval 0\or negative\or zero\or positive\else error\fi]\quad +[12 : \ifnumval 12\or negative\or zero\or positive\else error\fi]\quad +[oeps : \ifnumval oeps\or negative\or zero\or positive\else error\fi] +\stopbuffer + +\typebuffer + +This gives: + +{\getbuffer} + +\stopnewprimitive + +\startoldprimitive[title={\prm {ifodd}}] + +One reason for this condition to be around is that in a double sided layout we +need test for being on an odd or even page. It scans for a number the same was +as other primitives, + +\startbuffer +\ifodd65 YES \else NO\fi & +\ifodd`B YES \else NO\fi . +\stopbuffer + +\typebuffer + +So: {\inlinebuffer} + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifparameter}}] + +In a macro body \type {#1} is a reference to a parameter. You can check if one is +set using a dedicated parameter condition: + +\startbuffer +\tolerant\def\foo[#1]#*[#2]% + {\ifparameter#1\or one\else no one\fi\enspace + \ifparameter#2\or two\else no two\fi\emspace} + +\foo +\foo[1] +\foo[1][2] +\stopbuffer + +\typebuffer + +We get: + +\getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifparameters}}] + +This is equivalent to an \prm {ifcase} with as value the number of parameters +passed to the current macro. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifrelax}}] + +This is a convenient shortcut for \typ {\ifx\relax} and the motivation for adding +this one is (as with some others) to get less tracing. + +\stopnewprimitive + +\startnewprimitive[title={\prm {iftok}}] + +When you want to compare two arguments, the usual way to do this is the +following: + +\starttyping +\edef\tempA{#1} +\edef\tempb{#2} +\ifx\tempA\tempB + the same +\else + different +\fi +\stoptyping + +This works quite well but the fact that we need to define two macros can be +considered a bit of a nuisance. It also makes macros that use this method to be +not so called \quote {fully expandable}. The next one avoids both issues: + +\starttyping +\iftok{#1}{#2} + the same +\else + different +\fi +\stoptyping + +Instead of direct list you can also pass registers, so given: + +\startbuffer[a] +\scratchtoks{a}% +\toks0{a}% +\stopbuffer + +\typebuffer[a] + +This: + +\startbuffer[b] +\iftok 0 \scratchtoks Y\else N\fi\space +\iftok{a}\scratchtoks Y\else N\fi\space +\iftok\scratchtoks\scratchtoks Y\else N\fi +\stopbuffer + +\typebuffer[b] + +{\getbuffer[a]gives: \inlinebuffer[b].} + +\stopnewprimitive + +\startoldprimitive[title={\prm {iftrue}}] + +Here we have a traditional \TEX\ conditional that is always true (therefore the +same is true for any macro that is \prm {let} to this primitive). + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifvbox}}] + +This traditional conditional checks if a given box register or internal box +variable represents a vertical box, + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifvmode}}] + +This traditional conditional checks we are in (internal) vertical mode. + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifvoid}}] + +This traditional conditional checks if a given box register or internal box +variable has any content. + +\stopoldprimitive + +\startoldprimitive[title={\prm {ifx}}] + +We use this traditional \TEX\ conditional a lot in \CONTEXT. Contrary to \prm {if} +the two tokens that are compared are not expanded. This makes it possible to compare +the meaning of two macros. Depending on the need, these macros can have their content +expanded or not. A different number of parameters results in false. + +Control sequences are identical when they have the same command code and +character code. Because a \prm {let} macro is just a reference, both let macros +are the same and equal to \prm {relax}: + +\starttyping +\let\one\relax \let\two\relax +\stoptyping + +The same is true for other definitions that result in the same (primitive) or +meaning encoded in the character field (think of \prm {chardef}s and so). + +\stopoldprimitive + +\startnewprimitive[title={\prm {ifzerodim}}] + +This tests for a dimen (dimension) being zero so we have: + +\starttyping +\ifdim=0pt +\ifzerodim +\ifcase +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifzerofloat}}] + +As the name indicated, this tests for a zero float value. + +\startbuffer +[\scratchfloat\zerofloat \ifzerofloat\scratchfloat \else not \fi zero] +[\scratchfloat\plusone \ifzerofloat\scratchfloat \else not \fi zero] +[\scratchfloat 0.01 \ifzerofloat\scratchfloat \else not \fi zero] +[\scratchfloat 0.0e0 \ifzerofloat\scratchfloat \else not \fi zero] +[\scratchfloat \zeropoint\ifzerofloat\scratchfloat \else not \fi zero] +\stopbuffer + +\typebuffer + +So: \inlinebuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {ifzeronum}}] + +This tests for a number (integer) being zero so we have these variants now: + +\starttyping +\ifnum=0 +\ifzeronum +\ifcase +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {ignorearguments}}] + +This primitive will quit argument scanning and start expansion of the body of a +macro. The number of grabbed arguments can be tested as follows: + +\startbuffer +\def\MyMacro[#1][#2][#3]% + {\ifarguments zero\or one\or two\or three \else hm\fi} + +\MyMacro \ignorearguments \quad +\MyMacro [1]\ignorearguments \quad +\MyMacro [1][2]\ignorearguments \quad +\MyMacro [1][2][3]\ignorearguments \par +\stopbuffer + +\typebuffer + +{\getbuffer} + +{\em Todo: explain optional delimiters.} + +\stopnewprimitive + +\startnewprimitive[title={\prm {ignoredepthcriterion}}] + +When setting the \prm {prevdepth} (either by \TEX\ or by the current user) of the +current vertical list the value 1000pt is a signal for special treatment of the +skip between \quote {lines}. There is an article on that in the distribution. It +also demonstrates that \prm {ignoredepthcriterion} can be used to change this +special signal, just in case it is needed. + +\stopnewprimitive + +\startnewprimitive[title={\prm {ignorenestedupto}}] + +This primitive gobbles following tokens and can deal with nested \quote +{environments}, for example: + +\startbuffer +\def\startfoo{\ignorenestedupto\startfoo\stopfoo} + +(before +\startfoo + test \startfoo test \stopfoo + {test \startfoo test \stopfoo} +\stopfoo +after) +\stopbuffer + +\typebuffer + +delivers: + +\getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {ignorepars}}] + +This is a variant of \prm {ignorespaces}: following spaces {\em and} \type +{\par} equivalent tokens are ignored, so for instance: + +\startbuffer +one + \ignorepars + +two = \ignorepars \par +three +\stopbuffer + +\typebuffer + +renders as: \inlinebuffer. Traditionally \TEX\ has been sensitive to \prm {par} +tokens in some of its building blocks. This has to do with the fact that it could +indicate a runaway argument which in the times of slower machines and terminals +was best to catch early. In \LUAMETATEX\ we no longer have long macros and the +mechanisms that are sensitive can be told to accept \prm {par} tokens (and +\CONTEXT\ set them such that this is the case). + +\stopnewprimitive + +\startnewprimitive[title={\prm {ignorerest}}] + +An example shows what this primitive does: + +\startbuffer +\tolerant\def\foo[#1]#*[#2]% + {1234 + \ifparameter#1\or\else + \expandafter\ignorerest + \fi + /#1/ + \ifparameter#2\or\else + \expandafter\ignorerest + \fi + /#2/ } + +\foo test \foo[456] test \foo[456][789] test +\stopbuffer + +\typebuffer + +As this likely makes most sense in conditionals you need to make sure the current +state is properly finished. Because \prm {expandafter} bumps the input state, +here we actually quit two levels; this is because so called \quote {backed up +text} is intercepted by this primitive. + +\getbuffer + +\stopnewprimitive + +\startoldprimitive[title={\prm {ignorespaces}}] + +This traditional \TEX\ primitive signals the scanner to ignore the following +spaces, if any. We mention it because we show a companion in the next section. + +\stopoldprimitive + +\startnewprimitive[title={\prm {ignoreupto}}] + +This ignores everything upto the given token, so + +\startbuffer +\ignoreupto \foo not this but\foo only this +\stopbuffer + +\typebuffer + +will give: \inlinebuffer . + +\stopnewprimitive + +\startoldprimitive[title={\prm {immediate}}] + +This one has no effect unless you intercept it at the \LUA\ end and act upon it. +In original \TEX\ immediate is used in combination with read from and write to +file operations. So, this is an old primitive with a new meaning. + +\stopoldprimitive + +\startnewprimitive[title={\prm {immutable}}] + +This prefix flags what follows as being frozen and is usually applied to for +instance \prm {integerdef}'d control sequences. In that respect is is like \prm +{permanent} but it makes it possible to distinguish quantities from macros. + +\stopnewprimitive + +\startoldprimitive[title={\prm {indent}}] + +In engines other than \LUAMETATEX\ a paragraph starts with an indentation box. +The width of that (empty) box is determined by \prm {parindent}. In \LUAMETATEX\ +we can use a dedicated indentation skip instead (as part of paragraph +normalization). An indentation can be zero'd with \prm {undent}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {indexofcharacter}}] + +This primitive is more versatile variant of the backward quote operator, so +instead of: + +\starttyping +\number`| +\number`~ +\number`\a +\number`\q +\stoptyping + +you can say: + +\starttyping +\the\indexofcharacter | +\the\indexofcharacter ~ +\the\indexofcharacter \a +\the\indexofcharacter \q +\stoptyping + +In both cases active characters and unknown single character control sequences +are valid. In addition this also works: + +\starttyping +\chardef \foo 128 +\mathchardef\oof 130 + +\the\indexofcharacter \foo +\the\indexofcharacter \oof +\stoptyping + +An important difference is that \prm {indexofcharacter} returns an integer and +not a serialized number. A negative value indicates no valid character. + +\stopnewprimitive + +\startnewprimitive[title={\prm {indexofregister}}] + +You can use this instead of \prm {number} for determining the index of a register +but it also returns a number when a register value is seen. The result is an +integer, not a serialized number. + +\stopnewprimitive + +\startnewprimitive[title={\prm {inherited}}] + +When this prefix is used in a definition using \prm {let} the target will inherit +all the properties of the source. + +\stopnewprimitive + +\startnewprimitive[title={\prm {initcatcodetable}}] + +This initializes the catcode table with the given index. + +\stopnewprimitive + +\startnewprimitive[title={\prm {initialpageskip}}] + +When a page starts the value of this register are used to initialize \prm +{pagetotal}, \prm {pagestretch} and \prm {pageshrink}. This make nicer code than +using a \prm {topskip} with weird values. + +\stopnewprimitive + +\startnewprimitive[title={\prm {initialtopskip}}] + +When set this one will be used instead of \prm {topskip}. The rationale is that +the \prm {topskip} is often also used for side effects and compensation. + +\stopnewprimitive + +\startoldprimitive[title={\prm {input}}] + +There are several ways to use this primitive: + +\starttyping +\input test +\input {test} +\input "test" +\input 'test' +\stoptyping + +When no suffix is given, \TEX\ will assume the suffix is \type {.tex}. The second +one is normally used. + +\stopoldprimitive + +\startoldprimitive[title={\prm {inputlineno}}] + +This integer holds the current linenumber but it is not always reliable. + +\stopoldprimitive + +\startoldprimitive[title={\prm {insert}}] + +This stores content in the insert container with the given index. In \LUAMETATEX\ +inserts bubble up to outer boxes so we don't have the \quote {deeply buried +insert issue}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {insertbox}}] + +This is the accessor for the box (with results) of an insert with the given +index. This is equivalent to the \prm {box} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertcopy}}] + +This is the accessor for the box (with results) of an insert with the given +index. It makes a copy so the original is kept. This is equivalent to a \prm +{copy} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertdepth}}] + +This is the (current) depth of the inserted material with the given index. It is +comparable to the \prm {dp} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertdistance}}] + +This is the space before the inserted material with the given index. This is +equivalent to \prm {glue} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertheight}}] + +This is the (current) depth of the inserted material with the given index. It is +comparable to the \prm {ht} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertheights}}] + +This is the combined height of the inserted material. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertlimit}}] + +This is the maximum height that the inserted material with the given index can +get. This is equivalent to \prm {dimen} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertmaxdepth}}] + +This is the maximum depth that the inserted material with the given index can +get. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertmode}}] + +In traditional \TEX\ inserts are controlled by a \prm {box}, \prm {dimen}, \prm +{glue} and \prm {count} register with the same index. The allocators have to take +this into account. When this primitive is set to one a different model is +followed with its own namespace. There are more abstract accessors to interface +to this. \footnote {The old model might be removed at some point.} + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertmultiplier}}] + +This is the height (contribution) multiplier for the inserted material with the +given index. This is equivalent to \prm {count} in the traditional method. + +\stopnewprimitive + +\startoldprimitive[title={\prm {insertpenalties}}] + +This dual purpose internal counter holds the sum of penalties for insertions that +got split. When we're the output routine in reports the number of insertions that +is kept in store. + +\stopoldprimitive + +\startnewprimitive[title={\prm {insertpenalty}}] + +This is the insert penalty associated with the inserted material with the given +index. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertprogress}}] + +This returns the current accumulated insert height of the insert with the given +index. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertstorage}}] + +The value passed will enable (one) or disable (zero) the insert with the given +index. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertstoring}}] + +The value passed will enable (one) or disable (zero) inserts. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertunbox}}] + +This is the accessor for the box (with results) of an insert with the given +index. It makes a copy so the original is kept. The content is unpacked and +injected. This is equivalent to an \prm {unvbox} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertuncopy}}] + +This is the accessor for the box (with results) of an insert with the given +index. It makes a copy so the original is kept. The content is unpacked and +injected. This is equivalent to the \prm {unvcopy} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {insertwidth}}] + +This is the (current) width of the inserted material with the given index. It is +comparable to the \prm {wd} in the traditional method. + +\stopnewprimitive + +\startnewprimitive[title={\prm {instance}}] + +This prefix flags a macro as an instance which is mostly relevant when a macro +package want to categorize macros. + +\stopnewprimitive + +\startnewprimitive[title={\prm {integerdef}}] + +You can alias to a count (integer) register with \prm {countdef}: + +\starttyping +\countdef\MyCount134 +\stoptyping + +Afterwards the next two are equivalent: + +\starttyping +\MyCount = 99 +\count1234 = 99 +\stoptyping + +where \type {\MyCount} can be a bit more efficient because no index needs to be +scanned. However, in terms of storage the value (here 99) is always in the register +so \type {\MyCount} has to get there. This indirectness has the benefit that directly +setting the value is reflected in the indirect accessor. + +\starttyping +\integerdef\MyCount = 99 +\stoptyping + +This primitive also defines a numeric equivalent but this time the number is stored +with the equivalent. This means that: + +\starttyping +\let\MyCopyOfCount = \MyCount +\stoptyping + +will store the {\em current} value of \type {\MyCount} in \type {\MyCopyOfCount} and +changing either of them is not reflected in the other. + +The usual \prm {advance}, \prm {multiply} and \prm {divide} can be used with these +integers and they behave like any number. But compared to registers they are actually +more a constant. + +\stopnewprimitive + +\startoldprimitive[title={\prm {interactionmode}}] + +This internal integer can be used to set or query the current interaction mode: + +\starttabulate[||||] +\NC \type {\batchmode } \NC \the\batchmodecode \NC omits all stops and terminal output \NC \NR +\NC \type {\nonstopmode } \NC \the\nonstopmodecode \NC omits all stops \NC \NR +\NC \type {\scrollmode } \NC \the\scrollmodecode \NC omits error stops \NC \NR +\NC \type {\errorstopmode} \NC \the\errorstopmodecode \NC stops at every opportunity to interact \NC \NR +\stoptabulate + +% In \LUAMETATEX, for consistency, we have enabled these four as integers after +% \prm {the} but we can also decide to remove them and do this. So we leave this +% as an undocumented feature. It could have been an \ETEX\ way of abstracting the +% numeric values. +% +% \untraced\permanent\protected\def\batchmode {\interactionmode\batchmodecode} +% \untraced\permanent\protected\def\nonstopmode {\interactionmode\nonstopmodecode} +% \untraced\permanent\protected\def\scrollmode {\interactionmode\scrollmodecode} +% \untraced\permanent\protected\def\errorstopmode{\interactionmode\errorstopmodecode} + +\stopoldprimitive + +\startoldprimitive[title={\prm {interlinepenalties}}] + +This is a more granular variant of \prm {interlinepenalty}: an array of penalties +to be put between successive line from the start of a paragraph. The list starts +with the number of penalties that gets passed. + +\stopoldprimitive + +\startoldprimitive[title={\prm {interlinepenalty}}] + +This is the penalty that is put between lines. + +\stopoldprimitive + +\startoldprimitive[title={\prm {jobname}}] + +This gives the current job name without suffix: {\tttf \jobname}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {kern}}] + +A kern is injected with the given dimension. For variants that switch to a mode +we have \prm {hkern} and \prm {vkern}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {language}}] + +Sets (or returns) the current language, a number. In \LUATEX\ and \LUAMETATEX\ +the current language is stored in the glyph nodes. + +\stopoldprimitive + +\startnewprimitive[title={\prm {lastarguments}}] + +\startbuffer +\def\MyMacro #1{\the\lastarguments (#1) } \MyMacro{1} \crlf +\def\MyMacro #1#2{\the\lastarguments (#1) (#2)} \MyMacro{1}{2} \crlf +\def\MyMacro#1#2#3{\the\lastarguments (#1) (#2) (#3)} \MyMacro{1}{2}{3} \par + +\def\MyMacro #1{(#1) \the\lastarguments} \MyMacro{1} \crlf +\def\MyMacro #1#2{(#1) (#2) \the\lastarguments} \MyMacro{1}{2} \crlf +\def\MyMacro#1#2#3{(#1) (#2) (#3) \the\lastarguments} \MyMacro{1}{2}{3} \par +\stopbuffer + +\typebuffer + +The value of \prm {lastarguments} can only be trusted in the expansion until +another macro is seen and expanded. For instance in these examples, as soon as a +character (like the left parenthesis) is seen, horizontal mode is entered and +\prm {everypar} is expanded which in turn can involve macros. You can see that +in the second block (that is: unless we changed \prm {everypar} in the +meantime). + +{\getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {lastatomclass}}] + +This returns the class number of the last atom seen in the math input parser. + +\stopnewprimitive + +\startnewprimitive[title={\prm {lastboundary}}] + +This primitive looks back in the list for a user boundary injected with \prm +{boundary} and when seen it returns that value or otherwise zero. + +\stopnewprimitive + +\startoldprimitive[title={\prm {lastbox}}] + +When issued this primitive will, if possible, pull the last box from the current +list. + +\stopoldprimitive + +\startnewprimitive[title={\prm {lastchkdimension}}] + +When the last check for a dimension with \prm {ifchkdimension} was successful +this primitive returns the value. + +\stopnewprimitive + +\startnewprimitive[title={\prm {lastchknumber}}] + +When the last check for an integer with \prm {ifchknumber} was successful this +primitive returns the value. + +\stopnewprimitive + +\startoldprimitive[title={\prm {lastkern}}] + +This returns the last kern seen in the list (if possible). + +\stopoldprimitive + +\startnewprimitive[title={\prm {lastleftclass}}] + +This variable registers the first applied math class in a formula. + +\stopnewprimitive + +\startoldprimitive[title={\prm {lastlinefit}}] + +The \ETEX\ manuals explains this parameter in detail but in practice it is enough +to know that when set to 1000 spaces in the last line might match those in the +previous line. Basically it counters the strong push of a \prm {parfillskip}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {lastloopiterator}}] + +In addition to \prm {currentloopiterator} we have a variant that stores the value +in case an unexpanded loop is used: + +\startbuffer +\localcontrolledrepeat 8 { [\the\currentloopiterator\eq\the\lastloopiterator] } +\expandedrepeat 8 { [\the\currentloopiterator\eq\the\lastloopiterator] } +\unexpandedrepeat 8 { [\the\currentloopiterator\ne\the\lastloopiterator] } +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {lastnamedcs}}] + +The example code in the previous section has some redundancy, in the sense that +there to be looked up control sequence name \type {mymacro} is assembled twice. +This is no big deal in a traditional eight bit \TEX\ but in a \UNICODE\ engine +multi|-|byte sequences demand some more processing (although it is unlikely that +control sequences have many multi|-|byte \UTF8\ characters). + +\starttyping +\ifcsname mymacro\endcsname + \csname mymacro\endcsname +\fi +\stoptyping + +Instead we can say: + +\starttyping +\ifcsname mymacro\endcsname + \lastnamedcs +\fi +\stoptyping + +Although there can be some performance benefits another advantage is that it uses +less tokens and parsing. It might even look nicer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {lastnodesubtype}}] + +When possible this returns the subtype of the last node in the current node list. +Possible values can be queried (for each node type) via \LUA\ helpers. + +\stopnewprimitive + +\startoldprimitive[title={\prm {lastnodetype}}] + +When possible this returns the type of the last node in the current node list. +Possible values can be queried via \LUA\ helpers. + +\stopoldprimitive + +\startnewprimitive[title={\prm {lastpageextra}}] + +This reports the last applied (permitted) overshoot. + +\stopnewprimitive + +\startnewprimitive[title={\prm {lastparcontext}}] + +When a paragraph is wrapped up the reason is reported by this state variable. +Possible values are: + +\startcolumns[n=4] +\getbuffer[engine:syntax:parcontextcodes] +\stopcolumns + +\stopnewprimitive + +\startnewprimitive[title={\prm {lastpartrigger}}] + +There are several reasons for entering a paragraphs and some are automatic and +triggered by other commands that force \TEX\ into horizontal mode. + +\startcolumns[n=4] +\getbuffer[engine:syntax:partriggercodes] +\stopcolumns + +\stopnewprimitive + +\startoldprimitive[title={\prm {lastpenalty}}] + +This returns the last penalty seen in the list (if possible). + +\stopoldprimitive + +\startnewprimitive[title={\prm {lastrightclass}}] + +This variable registers the last applied math class in a formula. + +\stopnewprimitive + +\startoldprimitive[title={\prm {lastskip}}] + +This returns the last glue seen in the list (if possible). + +\stopoldprimitive + +\startoldprimitive[title={\prm {lccode}}] + +When the \prm {lowercase} operation is applied the lowercase code of a character +is used for the replacement. This primitive is used to set that code, so it +expects two character number. The code is also used to determine what characters +make a word suitable for hyphenation, although in \LUATEX\ we introduced the \prm +{hj} code for that. + +\stopoldprimitive + +\startoldprimitive[title={\prm {leaders}}] + +See \prm {gleaders} for an explanation. + +\stopoldprimitive + +\startoldprimitive[title={\prm {left}}] + +Inserts the given delimiter as left fence in a math formula. + +\stopoldprimitive + +\startoldprimitive[title={\prm {lefthyphenmin}}] + +This is the minimum number of characters after the last hyphen in a hyphenated +word. + +\stopoldprimitive + +\startnewprimitive[title={\prm {leftmarginkern}}] + +The dimension returned is the protrusion kern that has been added (if at all) +to the left of the content in the given box. + +\stopnewprimitive + +\startoldprimitive[title={\prm {leftskip}}] + +This skip will be inserted at the left of every line. + +\stopoldprimitive + +\startoldprimitive[title={\prm {leqno}}] + +This primitive stores the (typeset) content (presumably a number) and when the +display formula is wrapped that number will end up left of the formula. + +\stopoldprimitive + +\startoldprimitive[title={\prm {let}}] + +Where a \prm {def} creates a new macro, either or not with argument, a \prm {let} +creates an alias. You are not limited to aliasing macros, basically everything +can be aliased. + +\stopoldprimitive + +\startnewprimitive[title={\prm {letcharcode}}] + +Assigning a meaning to an active character can sometimes be a bit cumbersome; +think of using some documented uppercase magic that one tends to forget as it's +used only a few times and then never looked at again. So we have this: + +\startbuffer +{\letcharcode 65 1 \catcode 65 13 A : \meaning A}\crlf +{\letcharcode 65 2 \catcode 65 13 A : \meaning A}\par +\stopbuffer + +\typebuffer + +here we define \type {A} as an active charcter with meaning \type {1} in the +first line and \type {2} in the second. + +{\tttf \getbuffer} + +Normally one will assign a control sequence: + +\startbuffer +{\letcharcode 66 \bf \catcode 66 13 {B bold}: \meaning B}\crlf +{\letcharcode 73 \it \catcode 73 13 {I italic}: \meaning I}\par +\stopbuffer + +\typebuffer + +Of course \type {\bf} and \type {\it} are \CONTEXT\ specific commands: + +{\tttf \getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {letcsname}}] + +It is easy to see that we save two tokens when we use this primitive. As with the +\type {..defcs..} variants it also saves a push back of the composed macro name. + +\starttyping +\expandafter\let\csname MyMacro:1\endcsname\relax + \letcsname MyMacro:1\endcsname\relax +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {letfrozen}}] + +You can explicitly freeze an unfrozen macro: + +\starttyping +\def\MyMacro{...} +\letfrozen\MyMacro +\stoptyping + +A redefinition will now give: + +\starttyping +! You can't redefine a frozen macro. +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {letmathatomrule}}] + +You can change the class for a specific style. This probably only makes sense +for user classes. It's one of those features that we used when experimenting +with more control. + +\starttyping +\letmathatomrule 4 = 4 4 0 0 +\letmathatomrule 5 = 5 5 0 0 +\stoptyping + +This changes the classes~4 and~5 into class~ 0 in the two script styles and keeps +them the same in display and text. We leave it to the reader to ponder how useful +this is. + +\stopnewprimitive + +\startnewprimitive[title={\prm {letmathparent}}] + +This primitive takes five arguments: the target class, and four classes that +determine the pre penalty class, post penalty class, options class and a dummy +class for future use. + +\stopnewprimitive + +\startnewprimitive[title={\prm {letmathspacing}}] + +By default inter|-|class spacing inherits from the ordinary class but you can +remap specific combinations is you want: + +\starttyping +\letmathspacing \mathfunctioncode + \mathordinarycode \mathordinarycode + \mathordinarycode \mathordinarycode +\stoptyping + +The first value is the target class, and the nest four tell how it behaves in +display, text, script and script script style. Here \typ {\mathfunctioncode} is a +\CONTEXT\ specific class (\the\mathfunctioncode), one of the many. + +\stopnewprimitive + +\startnewprimitive[title={\prm {letprotected}}] + +Say that you have these definitions: + +\startbuffer + \def \MyMacroA{alpha} +\protected \def \MyMacroB{beta} + \edef \MyMacroC{\MyMacroA\MyMacroB} +\letprotected \MyMacroA + \edef \MyMacroD{\MyMacroA\MyMacroB} +\meaning \MyMacroC\crlf +\meaning \MyMacroD\par +\stopbuffer + +\typebuffer + +The typeset meaning in this example is: + +{\tttf \getbuffer} + +\stopnewprimitive + +\startnewprimitive[title={\prm {lettolastnamedcs}}] + +The \prm {lastnamedcs} primitive is somewhat special as it is a (possible) +reference to a control sequence which is why we have a dedicated variant of +\prm {let}. + +\startbuffer +\csname relax\endcsname\let \foo\lastnamedcs \meaning\foo +\csname relax\endcsname\expandafter\let\expandafter \oof\lastnamedcs \meaning\oof +\csname relax\endcsname\lettolastnamedcs \ofo \meaning\ofo +\stopbuffer + +\typebuffer % we need oneliners because intermediate csnames kick in + +These give the following where the first one obviously is not doing what we want +and the second one is kind of cumbersome. + +\startlines +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {lettonothing}}] + +This one let's a control sequence to nothing. Assuming that \type {\empty} +is indeed empty, these two lines are equivalent. + +\starttyping +\let \foo\empty +\lettonothing\oof +\stoptyping + +\stopnewprimitive + +\startoldprimitive[title={\prm {limits}}] + +This is a modifier: it flags the previous math atom to have its scripts above and +below the (summation, product, integral etc.) symbol. In \LUAMETATEX\ this can be +any atom (that is: any class). In display mode the location defaults to above and +below. + +Like any modifier it looks back for a math specific element. This means that the +following will work well: + +\starttyping +\sum \limits ^2 _3 +\sum ^2 \limits _3 +\sum ^2 _3 \limits +\sum ^2 _3 \limits \nolimits \limits +\stoptyping + +because scripts are bound to these elements so looking back just sees the element. + +\stopoldprimitive + +\startnewprimitive[title={\prm {linebreakcriterion}}] + +The par builder has a concept of \quote {compatible} lines, and has categories +for that: loose, decent and tight. In \LUAMETATEX\ we also have semi|-|loose and +semi|-|tight as intermediate categories. This parameter can set the ranges for +those, using four double bytes: + +\starttabulate[|T|l|c|] +\NC 0x7F000000 \NC semi tight \NC 12 \NC \NR +\NC 0x007F0000 \NC decent \NC 12 \NC \NR +\NC 0x00007F00 \NC semi loose \NC 12 \NC \NR +\NC 0x0000007F \NC loose \NC 99 \NC \NR +\stoptabulate + +The (decimal) default values are given in the last column. Don't expect a big +influence from changing these and this option is mostly a side effect of +experiments. + +\stopnewprimitive + +\startnewprimitive[title={\prm {linebreakoptional}}] + +This selects the optional text range that is to be used. Optional content is +marked with {optionalboundary} nodes. + +\stopnewprimitive + +\startnewprimitive[title={\prm {linebreakpasses}}] + +When set to a positive value it will apply additional line break runs defined +with \prm {parpasses} until the criteria set in there are met. When set to~$-1$ +it will signal a final pass + +\stopnewprimitive + +\startnewprimitive[title={\prm {linedirection}}] + +This sets the text direction (1 for \type {r2l}) to the given value but keeps +preceding glue into the range. + +\stopnewprimitive + +\startoldprimitive[title={\prm {linepenalty}}] + +Every line gets this penalty attached, so normally it is a small value, like +here: \the \linepenalty. + +\stopoldprimitive + +\startoldprimitive[title={\prm {lineskip}}] + +This is the amount of glue that gets added when the distance between lines falls +below \prm {lineskiplimit}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {lineskiplimit}}] + +When the distance between two lines becomes less than \prm {lineskiplimit} a \prm +{lineskip} glue item is added. + +\startbuffer +\ruledvbox{ + \lineskiplimit 0pt \lineskip3pt \baselineskip0pt + \ruledhbox{line 1} + \ruledhbox{line 2} + \ruledhbox{\tx line 3} +} +\stopbuffer + +\typebuffer + +Normally the \prm {baselineskip} kicks in first but here we've set that to zero, +so we get two times a 3pt glue injected. + +\startlocallinecorrection +\getbuffer +\stoplocallinecorrection + +\stopoldprimitive + +% \startnewprimitive[title={\prm {localbrokenpenalty}}] +% \stopnewprimitive + +\startnewprimitive[title={\prm {localcontrol}}] + +This primitive takes a single token: + +\startbuffer +\edef\testa{\scratchcounter123 \the\scratchcounter} +\edef\testc{\testa \the\scratchcounter} +\edef\testd{\localcontrol\testa \the\scratchcounter} +\stopbuffer + +\typebuffer + +The three meanings are: + +\start \getbuffer +\starttabulate[|T|T|] +\NC \string\testa \NC \meaning\testa \NC \NR +\NC \string\testc \NC \meaning\testc \NC \NR +\NC \string\testd \NC \meaning\testd \NC \NR +\stoptabulate +\stop + +The \prm {localcontrol} makes that the following token gets expanded so we don't +see the yet to be expanded assignment show up in the macro body. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localcontrolled}}] + +The previously described local control feature comes with two extra helpers. The +\prm {localcontrolled} primitive takes a token list and wraps this into a local +control sidetrack. For example: + +\startbuffer +\edef\testa{\scratchcounter123 \the\scratchcounter} +\edef\testb{\localcontrolled{\scratchcounter123}\the\scratchcounter} +\stopbuffer + +\typebuffer + +The two meanings are: + +\start \getbuffer +\starttabulate[|T|T|] +\NC \string\testa \NC \meaningfull\testa \NC \NR +\NC \string\testb \NC \meaningfull\testb \NC \NR +\stoptabulate +\stop + +The assignment is applied immediately in the expanded definition. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localcontrolledendless}}] + +As the name indicates this will loop forever. You need to explicitly quit the +loop with \prm {quitloop} or \prm {quitloopnow}. The first quitter aborts the +loop at the start of a next iteration, the second one tries to exit immediately, +but is sensitive for interference with for instance nested conditionals. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localcontrolledloop}}] + +As with more of the primitives discussed here, there is a manual in the \quote +{lowlevel} subset that goes into more detail. So, here a simple example has to +do: + +\startbuffer +\localcontrolledloop 1 100 1 {% + \ifnum\currentloopiterator>6\relax + \quitloop + \else + [\number\currentloopnesting:\number\currentloopiterator] + \localcontrolledloop 1 8 1 {% + (\number\currentloopnesting:\number\currentloopiterator) + }\par + \fi +} +\stopbuffer + +\typebuffer + +Here we see the main loop primitive being used nested. The code shows how we can +\prm {quitloop} and have access to the \prm {currentloopiterator} as well as the +nesting depth \prm {currentloopnesting}. + +\startpacked \getbuffer \stoppacked + +Be aware of the fact that \prm {quitloop} will end the loop at the {\em next} +iteration so any content after it will show up. Normally this one will be issued +in a condition and we want to end that properly. Also keep in mind that because +we use local control (a nested \TEX\ expansion loop) anything you feed back can +be injected out of order. + +The three numbers can be separated by an equal sign which is a trick to avoid +look ahead issues that can result from multiple serialized numbers without spaces +that indicate the end of sequence of digits. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localcontrolledrepeat}}] + +This one takes one instead three arguments which looks a bit better +in simple looping. + +\stopnewprimitive + +% \startnewprimitive[title={\prm {localinterlinepenalty}}] +% \stopnewprimitive + +\startnewprimitive[title={\prm {localleftbox}}] + +This sets the box that gets injected at the left of every line. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localleftboxbox}}] + +This returns the box set with \prm {localleftbox}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localmiddlebox}}] + +This sets the box that gets injected at the left of every line but its width +is ignored. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localmiddleboxbox}}] + +This returns the box set with \prm {localmiddlebox}. + +\stopnewprimitive + +% \startnewprimitive[title={\prm {localpretolerance}}] +% \stopnewprimitive + +\startnewprimitive[title={\prm {localrightbox}}] + +This sets the box that gets injected at the right of every line. + +\stopnewprimitive + +\startnewprimitive[title={\prm {localrightboxbox}}] + +This returns the box set with \prm {localrightbox}. + +\stopnewprimitive + +% \startnewprimitive[title={\prm {localtolerance}}] +% \stopnewprimitive + +\startoldprimitive[title={\prm {long}}][obsolete=yes] + +This original prefix gave the macro being defined the property that it could not +have \prm {par} (or the often equivalent empty lines) in its arguments. It was +mostly a protection against a forgotten right curly brace, resulting in a so called +run|-|away argument. That mattered on a paper terminal or slow system where such a +situation should be catched early. In \LUATEX\ it was already optional, and in +\LUAMETATEX\ we dropped this feature completely (so that we could introduce others). + +\stopoldprimitive + +\startoldprimitive[title={\prm {looseness}}] + +The number fo lines in the current paragraph will be increased by given number of +lines. For this to succeed there need to be enough stretch in the spacing to make +that happen. There is some wishful thinking involved. + +\stopoldprimitive + +\startoldprimitive[title={\prm {lower}}] + +This primitive takes two arguments, a dimension and a box. The box is moved down. +The operation only succeeds in horizontal mode. + +\stopoldprimitive + +\startoldprimitive[title={\prm {lowercase}}] + +This token processor converts character tokens to their lowercase counterparts as +defined per \prm {lccode}. In order to permit dirty tricks active characters are +also processed. We don't really use this primitive in \CONTEXT, but for +consistency we let it respond to \prm {expand}: \footnote {Instead of providing +\type {\lowercased} and \type {\uppercased} primitives that would clash with +macros anyway.} + +\startbuffer +\edef \foo {\lowercase{tex TeX \TEX}} \meaningless\foo +\lowercase{\edef\foo {tex TeX \TEX}} \meaningless\foo +\edef \foo{\expand\lowercase{tex TeX \TEX}} \meaningless\foo +\stopbuffer + +\typebuffer + +Watch how \prm {lowercase} is not expandable but can be forced to. Of course, as +the logo macro is protected the \TEX\ logo remains mixed case. + +\startlines +\getbuffer +\stoplines + +\stopoldprimitive + +\startnewprimitive[title={\prm {lpcode}}] + +This one can be used to set the left protrusion factor of a glyph in a font and +takes three arguments: font, character code and factor. It is kind of obsolete +because we can set up vectors at definition time and tweaking from \TEX\ can have +side effects because it globally adapts the font. + +\stopnewprimitive + +\startnewprimitive[title={\prm {luabytecode}}] + +This behaves like \prm {luafunction} but here the number is a byte code register. +These bytecodes are in the \typ {lua.bytecode} array. + +\stopnewprimitive + +\startnewprimitive[title={\prm {luabytecodecall}}] + +This behaves like \prm {luafunctioncall} but here the number is a byte code +register. These bytecodes are in the \typ {lua.bytecode} array. + +\stopnewprimitive + +\startnewprimitive[title={\prm {luacopyinputnodes}}] + +When set to a positive value this will ensure that when nodes are printed from +\LUA\ to \TEX\ copies are used. + +\stopnewprimitive + +\startnewprimitive[title={\prm {luadef}}] + +% \edef\foocode{\ctxlua{ +% context( +% context.functions.register( +% function() context("!") end +% ) +% ) +% }} + +This command relates a (user) command to a \LUA\ function registered in the \typ +{lua.lualib_get_functions_table()}, so after: + +\starttyping +\luadef\foo123 +\stoptyping + +the \type {\foo} command will trigger the function at index 123. Of course a +macro package has to make sure that these definitions are unique. \footnote +{Plain \TEX\ established a norm for allocating registers, like \typ {\newdimen} +but there is no such convention for \LUA\ functions.} + +This command is accompanied by \prm {luafunctioncall} and +\prm {luafunction}. When we have funciton 123 defined as + +\starttyping +function() tex.sprint("!") end +\stoptyping + +the following: + +\starttyping +(\luafunctioncall \foocode ?) +(\normalluafunction\foocode ?) +(\foo ?) +\stoptyping + +gives three times \type {(!?)}. But this: + +\starttyping +\edef\oof{\foo } \meaning\oof % protected +\edef\oof{\luafunctioncall \foocode} \meaning\oof % protected +\edef\oof{\normalluafunction\foocode} \meaning\oof % expands +\stoptyping + +returns: + +\starttyping +macro:! +macro:\luafunctioncall 1740 +macro:! +\stoptyping + +Because the definition command is like any other + +\starttyping +\permanent\protected\luadef\foo123 +\stoptyping + +boils down to: + +\starttyping +permanent protected luacall 123 +\stoptyping + +\stopnewprimitive + +\startnewprimitive[title={\prm {luaescapestring}}] + +This command converts the given (token) list into something that is acceptable +for \LUA. It is inherited from \LUATEX\ and not used in \CONTEXT. + +\startbuffer +\directlua { tex.print ("\luaescapestring {{\tt This is a "test".}}") } +\stopbuffer + +\typebuffer + +Results in: \inlinebuffer\space (Watch the grouping.) + +\stopnewprimitive + +\startnewprimitive[title={\prm {luafunction}}] + +The integer passed to this primitive is the index in the table returned by \typ +{lua.lualib_get_functions_table()}. Of course a macro package has to provide +reliable management for this. This is a so called convert command so it expands +in an expansion context (like an \prm {edef}). + +\stopnewprimitive + +\startnewprimitive[title={\prm {luafunctioncall}}] + +The integer passed to this primitive is the index in the table returned by \typ +{lua.lualib_get_functions_table()}. Of course a macro package has to provide +reliable management for this. This primitive doesn't expand in an expansion +context (like an \prm {edef}). + +\stopnewprimitive + +\startnewprimitive[title={\prm {luatexbanner}}] + +This gives: {\tttf \luatexbanner}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {luatexrevision}}] + +This is an integer. The current value is: {\tttf \number\luatexrevision}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {luatexversion}}] + +This is an integer. The current value is: {\tttf \number\luatexversion}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mark}}][obsolete=yes] + +The given token list is stored in a node in the current list and might become +content of \prm {topmark}, \prm {botmark} or \prm {firstmark} when a page split +off, or in the case of a box split in \prm {splitbotmark} or \prm +{splitfirstmark}. In \LUAMETATEX\ deeply burried marks bubbly up to an outer box +level. + +\stopoldprimitive + +\startoldprimitive[title={\prm {marks}}] + +This command is similar to \prm {mark} but first expects a number of a mark +register. Multiple marks were introduced in \ETEX. + +\stopoldprimitive + +\startoldprimitive[title={\prm {mathaccent}}][obsolete=yes] + +This takes a number and a math object to put the accent on. The four byte number +has a dummy class byte, a family byte and two index bytes. It is replaced by \prm +{Umathaccent} that handles wide fonts. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathatom}}] + +This operation wraps following content in a atom with the given class. It is part +of \LUAMETATEX's extended math support. There are three class related +key|/|values: \type {class}, \typ {leftclass} and \typ {rightclass} (or \type +{all} for all of them). When none is given this command expects a class number +before scanning the content. The \type {options} key expects a bitset but there +are also direct option keys, like \type {limits}, \typ {nolimits}, \type +{unpack}, \type {unroll}, \type {single}, \type {nooverflow}, \type {void} and +\type {phantom}. A \type {source} id can be set, one or more \type {attr} +assigned, and for specific purposes \typ {textfont} and \typ {mathfont} +directives are accepted. Features like this are discussed in dedicated manuals. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathatomglue}}] + +This returns the glue that will be inserted between two atoms of a given class +for a specific style. + +\startbuffer +\the\mathatomglue \textstyle 1 1 +\the\mathatomglue \textstyle 0 2 +\the\mathatomglue \scriptstyle 1 1 +\the\mathatomglue \scriptstyle 0 2 +\stopbuffer + +\typebuffer + +\startlines \tttf +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathatomskip}}] + +\startbuffer +$x x$ +$x \mathatomskip \textstyle 1 1 x$ +$x \mathatomskip \textstyle 0 2 x$ +$x \mathatomskip \scriptstyle 1 1 x$ +$x \mathatomskip \scriptstyle 0 2 x$ +\stopbuffer + +This injects a glue with the given style and class pair specification: +\inlinebuffer. + +\typebuffer + + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathbackwardpenalties}}] + +See \prm {mathforwardpenalties} for an explanation. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathbeginclass}}] + +This variable can be set to signal the class that starts the formula (think of an +imaginary leading atom). + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathbin}}] + +This operation wraps following content in a atom with class \quote {binary}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathboundary}}] + +This primitive is part of an experiment with granular penalties in math. When set +nested fences will use the \prm {mathdisplaypenaltyfactor} or \prm +{mathinlinepenaltyfactor} to increase nested penalties. A bit more control is +possible with \prm {mathboundary}: + +\starttabulate[||||] +\NC 0 \NC begin \NC factor 1000 \NC \NR +\NC 1 \NC end \NC factor 1000 \NC \NR +\NC 2 \NC begin \NC given factor \NC \NR +\NC 3 \NC end \NC given factor \NC \NR +\stoptabulate + +These will be used when the mentioned factors are zero. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathchar}}][obsolete=yes] + +Replaced by \prm {Umathchar} this old one takes a four byte number: one byte for +the class, one for the family an two for the index. The specified character is +appended to to the list. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathcharclass}}] + +Returns the slot (in the font) of the given math character. + +\startbuffer +\the\mathcharclass\Umathchar 4 2 123 +\stopbuffer + +\typebuffer + +The first passed number is the class, so we get: \inlinebuffer. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathchardef}}][obsolete=yes] + +Replaced by \prm {Umathchardef} this primitive relates a control sequence with a +four byte number: one byte for the class, one for the family an two for the +index. The defined command will insert that character. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathcharfam}}] + +Returns the family number of the given math character. + +\startbuffer +\the\mathcharfam\Umathchar 4 2 123 +\stopbuffer + +\typebuffer + +The second passed number is the family, so we get: \inlinebuffer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathcharslot}}] + +Returns the slot (or index in the font) of the given math character. + +\startbuffer +\the\mathcharslot\Umathchar 4 2 123 +\stopbuffer + +\typebuffer + +The third passed number is the slot, so we get: \inlinebuffer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathcheckfencesmode}}] + +When set to a positive value there will be no warning if a right fence (\prm +{right} or \prm {Uright}) is missing. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathchoice}}] + +This command expects four subformulas, for display, text, script and scriptscript +and it will eventually use one of them depending on circumstances later on. Keep +in mind that a formula is first scanned and when that is finished the analysis +and typesetting happens. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathclass}}] + +There are build in classes and user classes. The first possible user class is +\cldcontext {tex . magicconstants . mathfirstuserclass} and the last one is +\cldcontext {tex . magicconstants . mathlastuserclass}. You can better not touch +the special classes \quote {all} (\number \mathallcode), \quote {begin} (\number +\mathbegincode) and \quote {end} (\number \mathendcode). The basic 8 classes that +original \TEX\ provides are of course also present in \LUAMETATEX. In addition we +have some that relate to constructs that the engine builds. + +\starttabulate[|l|l|T|l|] +\FL +\NC ordinary \NC ord \NC \the\mathordinarycode \NC the default \NR +\NC operator \NC op \NC \the\mathoperatorcode \NC small and large operators \NC \NR +\NC binary \NC bin \NC \the\mathbinarycode \NC \NC \NR +\NC relation \NC rel \NC \the\mathrelationcode \NC \NC \NR +\NC open \NC \NC \the\mathopencode \NC \NC \NR +\NC close \NC \NC \the\mathclosecode \NC \NC \NR +\NC punctuation \NC punct \NC \the\mathpunctuationcode \NC \NC \NR +\NC variable \NC \NC \the\mathvariablecode \NC adapts to the current family \NC \NR +\NC active \NC \NC \the\mathactivecode \NC character marked as such becomes active \NR +\NC inner \NC \NC \the\mathinnercode \NC this class is not possible for characters \NR +\ML +\NC under \NC \NC \the\mathundercode \NC \NC \NR +\NC over \NC \NC \the\mathovercode \NC \NC \NR +\NC fraction \NC \NC \the\mathfractioncode \NC \NC \NR +\NC radical \NC \NC \the\mathradicalcode \NC \NC \NR +\NC middle \NC \NC \the\mathmiddlecode \NC \NC \NR +\NC accent \NC \NC \the\mathaccentcode \NC \NC \NR +\NC fenced \NC \NC \the\mathfencedcode \NC \NC \NR +\NC ghost \NC \NC \the\mathghostcode \NC \NC \NR +\NC vcenter \NC \NC \the\mathvcentercode \NC \NC \NR +\LL +\stoptabulate + +There is no standard for user classes but \CONTEXT\ users should be aware of +quite some additional ones that are set up. The engine initialized the default +properties of classes (spacing, penalties, etc.) the same as original \TEX. + +Normally characters have class bound to them but you can (temporarily) overload +that one. The \prm {mathclass} primitive expects a class number and a valid +character number or math character and inserts the symbol as if it were of the +given class; so the original class is replaced. + +\startbuffer +\ruledhbox{$(x)$} and \ruledhbox{$\mathclass 1 `(x\mathclass 1 `)$} +\stopbuffer + +\typebuffer + +Changing the class is likely to change the spacing, compare \inlinebuffer. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathclose}}] + +This operation wraps following content in a atom with class \quote {close}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {mathcode}}][obsolete=yes] + +This maps a character to one in a family: the assigned value has one byte for the +class, one for the family and two for the index. It has little use in an +\OPENTYPE\ math setup. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathdictgroup}}] + +This is an experimental feature that in due time will be explored in \CONTEXT. It +currently has no consequences for rendering. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathdictionary}}] + +This is an experimental feature that in due time will be explored in \CONTEXT. It +currently has no consequences for rendering. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathdictproperties}}] + +This is an experimental feature that in due time will be explored in \CONTEXT. It +currently has no consequences for rendering. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathdirection}}] + +When set to 1 this will result in \type {r2l} typeset math formulas but of course +you then also need to set up math accordingly (which is the case in \CONTEXT). + +\stopnewprimitive + +% \startnewprimitive[title={\prm {mathdiscretionary}}] +% \stopnewprimitive + +\startnewprimitive[title={\prm {mathdisplaymode}}] + +Display mode is entered with two dollars (other characters can be used but the +dollars are a convention). Mid paragraph display formulas get a different +treatment with respect to the width and indentation than stand alone. When \prm +{mathdisplaymode} is larger than zero the double dollars (or equivalents) will +behave as inline formulas starting out in \prm {displaystyle} and with \prm +{everydisplay} expanded. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathdisplaypenaltyfactor}}] + +This one is simular to \prm {mathinlinepenaltyfactor} but is used when we're in +display style. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathdisplayskipmode}}] + +A display formula is preceded and followed by vertical glue specified by +\prm{abovedisplayskip} and \prm {belowdisplayskip} or \prm +{abovedisplayshortskip} and \prm {belowdisplayshortskip}. Spacing \quote {above} +is always inserted, even when zero, but the spacing \quote {below} is only +inserted when it is non|-|zero. There's also \prm {baselineskip} involved. The +way spacing is handled can be influenced with \prm {mathdisplayskipmode}, which +takes the following values: + +\starttabulate[|c|l|] +\NC 0 \NC does the same as any \TEX\ engine \NC \NR +\NC 1 \NC idem \NC \NR +\NC 2 \NC only insert spacing when it is not zero \NC \NR +\NC 3 \NC never insert spacing \NC \NR +\stoptabulate + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathdoublescriptmode}}] + +When this parameter has a negative value double scripts trigger an error, so with +\prm {superscript}, \prm {nosuperscript}, \prm {shiftedsuperscript}, \prm +{superprescript}, \prm {nosuperprescript}, \prm {shiftedsuperprescript}, \prm +{subscript}, \prm {nosubscript}, \prm {shiftedsubscript}, \prm {subprescript}, +\prm {nosubprescript}, \prm {shiftedsubprescript} and \prm {primescript}, as well +as their (multiple) \type {_} and \type {^} aliases. + +A value of zero does the normal and inserts a dummy atom (basically a \type {{}}) +but a positive value is more interesting. Compare these: + +\startbuffer +{\mathdoublescriptmode 0 $x_x_x$} +{\mathdoublescriptmode"000000 $x_x_x$} +{\mathdoublescriptmode"030303 $x_x_x$} +{$x_x_x$} +\stopbuffer + +\typebuffer + +The three pairs of bytes indicate the main class, left side class and right side +class of the inserted atom, so we get this: \inlinebuffer. The last line gives +what \CONTEXT\ is configured for. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathendclass}}] + +This variable can be set to signal the class that ends the formula (think of an +imaginary trailing atom). + +\stopnewprimitive + +\startnewprimitive[title={\prm {matheqnogapstep}}] + +The display formula number placement heuristic puts the number on the same line +when there is place and then separates it by a quad. In \LUATEX\ we decided to +keep that quantity as it can be tight into the math font metrics but introduce +a multiplier \prm {matheqnogapstep} that defaults to 1000. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathfontcontrol}}] + +This bitset controls how the math engine deals with fonts, and provides a way +around dealing with inconsistencies in the way they are set up. The \prm +{fontmathcontrol} makes it possible to bind options ot a specific math font. In +practice, we just set up the general approach which ii possible because we +normalize the math fonts and \quote {fix} issues at runtime. + +\getbuffer[engine:syntax:mathcontrolcodes] + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathforwardpenalties}}] + +Inline math can have multiple atoms and constructs and one can configure the +penalties between then bases on classes. In addition it is possible to configure +additional penalties starting from the beginning or end using \prm +{mathforwardpenalties} and \prm {mathbackwardpenalties}. This is one the features +that we added in the perspective of breaking paragraphs heavy on math into lines. +It not that easy to come up with useable values. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathgluemode}}] + +We can influence the way math glue is handled. By default stretch and shrink is applied but +this variable can be used to change that. The limit option ensures that the stretch and shrink +doesn't go beyond their natural values. + +\getbuffer[engine:syntax:mathgluecodes] + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathgroupingmode}}] + +Normally a \type {{}} or \type {\bgroup}|-|\type {\egroup} pair in math create a +math list. However, users are accustomed to using it also for grouping and then a +list being created might not be what a user wants. As an alternative to the more +verbose \prm {begingroup}|-|\prm {endgroup} or even less sensitive \prm +{beginmathgroup}|-|\prm {endmathgroup} you can set the math grouping mode to a +non zero value which makes curly braces (and the aliases) behave as expected. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathinlinepenaltyfactor}}] + +A math formula can have nested (sub)formulas and one might want to discourage a +line break inside those. If this value is non zero it becomes a mulitiplier, so a +value of 1000 will make an inter class penalty of 100 into 200 when at nesting +level 2 and 500 when at level 5. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathinner}}] + +This operation wraps following content in a atom with class \quote {inner}. In +\LUAMETATEX\ we have more classes and this general wrapper one is therefore kind +of redundant. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathleftclass}}] + +When set this class will be used when a formula starts. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathlimitsmode}}] + +When this parameter is set to a value larger than zero real dimensions are used +and longer limits will not stick out, which is a traditional \TEX\ feature. We +could have more advanced control but this will do. + +\startbuffer +\dontleavehmode +\ruledhbox{\dm{\left|\integral^{!!!!!!!!!!!}\right|}} +\ruledhbox{\dm{\left|\integral^{!!!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!!} \right|}} +\ruledhbox{\dm{\left|\integral^{!} \right|}} +\blank +\dontleavehmode +\ruledhbox{\dm{\left|\integral_{!!!!!!!!!!!}\right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!} \right|}} +\blank +\dontleavehmode +\ruledhbox{\dm{\left|\integral_{!} ^{!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!!}^{!} \right|}} +\ruledhbox{\dm{\left|\integral_{!} ^{!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!} ^{!!!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!!}^{!!!!!!!!!} \right|}} +\ruledhbox{\dm{\left|\integral_{!!!!!!!}^{!!!!!!!!!!!!!!!}\right|}} +\ruledhbox{\dm{\left|\integral^{\mtext{for demanding}}_{\mtext{integral freaks}}\right|}} +\stopbuffer + +Compare the zero setting: + +{\switchtobodyfont[modern]\setupmathoperators[integral][method=limits]\mathlimitsmode 0 \getbuffer} + +with the positive variant: + +{\switchtobodyfont[modern]\setupmathoperators[integral][method=limits]\mathlimitsmode 1 \getbuffer} + +Here we switched to Latin Modern because it's font dependent how serious this +issue is. In Pagella all is fine in both modes. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathmainstyle}}] + +This inspector returns the outermost math style (contrary to \prm {mathstyle}), +as we can see in the next examples where use these snippets: + +\startbuffer +\def\foo{(\the\mathmainstyle,\the\mathstyle)} +\def\oof{\sqrt[\foo]{\foo}} +\def\ofo{\frac{\foo}{\foo}} +\def\fof{\mathchoice{\foo}{\foo}{\foo}{\foo}} +\stopbuffer + +\typebuffer \getbuffer + +When we use the regular math triggers we get this: + +\startbuffer +$\displaystyle \foo + \oof + \ofo$ +$\textstyle \foo + \oof + \ofo$ +$\displaystyle \foo + \fof$ +$\textstyle \foo + \fof$ +$\scriptstyle \foo + \fof$ +$\scriptscriptstyle\foo + \fof$ +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +But we can also do this: + +\startbuffer +\Ustartmathmode \displaystyle \foo + \oof + \ofo \Ustopmathmode +\Ustartmathmode \textstyle \foo + \oof + \ofo \Ustopmathmode +\Ustartmathmode \displaystyle \foo + \fof \Ustopmathmode +\Ustartmathmode \textstyle \foo + \fof \Ustopmathmode +\Ustartmathmode \scriptstyle \foo + \fof \Ustopmathmode +\Ustartmathmode \scriptscriptstyle\foo + \fof \Ustopmathmode +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathnolimitsmode}}] + +This parameter influences the placement of scripts after an operator. The reason +we have this lays in the fact that traditional \TEX\ uses italic correction and +\OPENTYPE\ math does the same but fonts are not consistent in how they set this +up. Actually, in \OPENTYPE\ math it's the only reason that there is italic +correction. Say that we have a shift $\delta$ determined by the italic correction: + +\starttabulate[|c|c|c|] +\BC mode \BC top \BC bottom \NC \NR +\NC $0$ \NC $0$ \NC $-\delta$ \NC \NR +\NC $1$ \NC $\delta\times f_t$ \NC $\delta\times f_b$ \NC \NR +\NC $2$ \NC $0$ \NC $0$ \NC \NR +\NC $3$ \NC $0$ \NC $-\delta/2$ \NC \NR +\NC $4$ \NC $\delta/2$ \NC $-\delta/2$ \NC \NR +\NC $>15$ \NC $0$ \NC $-n\times\delta/1000$ \NC \NR +\stoptabulate + +Mode~1 uses two font parameters: $f_b$: \prm {Umathnolimitsubfactor} and $f_t$: +\prm {Umathnolimitsupfactor}. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathop}}] + +This operation wraps following content in a atom with class \quote {operator}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {mathopen}}] + +This operation wraps following content in a atom with class \quote {open}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {mathord}}] + +This operation wraps following content in a atom with class \quote {ordinary}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathparentstyle}}] + +This inspector returns the math style used in a construct, so is is either +equivalent to \prm {mathmainstyle} or a nested \prm {mathstyle}. For instance +in a nested fraction we get this (in \CONTEXT) in display formulas: + +\def\foo{(\the\mathmainstyle,\the\mathparentstyle,\the\mathstyle)} + +\dm{ + \frac{\frac{\foo}{\foo}}{\frac{\foo}{\foo}} + \foo +} + +but this in inline formulas: + +\im{ + \frac{\frac{\foo}{\foo}}{\frac{\foo}{\foo}} + \foo +} + +where the first element in a nested fraction. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathpenaltiesmode}}] + +Normally the \TEX\ math engine only inserts penalties when in textstyle. You can +force penalties in displaystyle with this parameter. In inline math we always +honor penalties, with mode~0 and mode~1 we get this: + +\pushoverloadmode + +\startlines +{\mathpenaltiesmode=0 \let\mathpenaltiesmode\scratchcounter $\showmakeup[hpenalty]x+2x=0$} +{\mathpenaltiesmode=1 \let\mathpenaltiesmode\scratchcounter $\showmakeup[hpenalty]x+2x=1$} +\stoplines + +However in \CONTEXT, where all is done in inline math mode, we set this this +parameter to~1, otherwise we wouldn't get these penalties, as shown next: + +{\mathpenaltiesmode=0 \let\mathpenaltiesmode\scratchcounter \startformula \showmakeup[hpenalty]x+2x=0 \stopformula} +{\mathpenaltiesmode=1 \let\mathpenaltiesmode\scratchcounter \startformula \showmakeup[hpenalty]x+2x=1 \stopformula} + +\popoverloadmode + +If one uses a callback it is possible to force penalties from there too. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathpretolerance}}] + +This is used instead of \prm {pretolerance} when a breakpoint is calculated when +a math formula starts. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathpunct}}] + +This operation wraps following content in a atom with class \quote {punctuation}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {mathrel}}] + +This operation wraps following content in a atom with class \quote {relation}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathrightclass}}] + +When set this class will be used when a formula ends. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathrulesfam}}] + +When set, this family will be used for setting rule properties in fractions, +under and over. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathrulesmode}}] + +When set to a non zero value rules (as in fractions and radicals) will be based +on the font parameters in the current family. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathscale}}] + +In \LUAMETATEX\ we can either have a family of three (text, script and +scriptscript) fonts or we can use one font that we scale and where we also pass +information about alternative shapes for the smaller sizes. When we use this +more compact mode this primitive reflects the scale factor used. + +\startbuffer +\im { + \textstyle \the\mathscale\textfont \fam\enspace + \scriptstyle \the\mathscale\scriptfont \fam\enspace + \scriptscriptstyle\the\mathscale\scriptscriptfont\fam\enspace + \textstyle \the\mathscale\textfont \fam\enspace + \scriptstyle \the\mathscale\textfont \fam\enspace + \scriptscriptstyle\the\mathscale\textfont \fam + +} +\stopbuffer + +What gets reported depends on how math is implemented, where in \CONTEXT\ we can +have either normal or compact mode: \inlinebuffer. In compact mode we have the +same font three times so then it doesn't matter which of the three is passed. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathscriptsmode}}] + +There are situations where you don't want \TEX\ to be clever and optimize the +position of super- and subscripts by shifting. This parameter can be used to +influence this. + +\startlinecorrection +\startcombination[3*2] + {\startoverlay + {\ruledhbox {\mathscriptsmode 0 0: $x^2_2 + y^x_x + z_2 + w^2$}} + {\ruledhbox{\red \mathscriptsmode 1 1: $x^2_2 + y^x_x + z_2 + w^2$}} + \stopoverlay} {} + {\startoverlay + {\ruledhbox {\mathscriptsmode 0 0: $x^2_2 + y^x_x + z_2 + w^2$}} + {\ruledhbox{\red \mathscriptsmode 2 2: $x^2_2 + y^x_x + z_2 + w^2$}} + \stopoverlay} {} + {\startoverlay + {\ruledhbox {\mathscriptsmode 1 1: $x^2_2 + y^x_x + z_2 + w^2$}} + {\ruledhbox{\red \mathscriptsmode 2 2: $x^2_2 + y^x_x + z_2 + w^2$}} + \stopoverlay} {} + {\startoverlay + {\ruledhbox {\mathscriptsmode 0 0: $x^f_f + y^x_x + z_f + w^f$}} + {\ruledhbox{\red \mathscriptsmode 1 1: $x^f_f + y^x_x + z_f + w^f$}} + \stopoverlay} {1 over 0} + {\startoverlay + {\ruledhbox {\mathscriptsmode 0 0: $x^f_f + y^x_x + z_f + w^f$}} + {\ruledhbox{\red \mathscriptsmode 2 2: $x^f_f + y^x_x + z_f + w^f$}} + \stopoverlay} {2 over 0} + {\startoverlay + {\ruledhbox {\mathscriptsmode 1 1: $x^f_f + y^x_x + z_f + w^f$}} + {\ruledhbox{\red \mathscriptsmode 2 2: $x^f_f + y^x_x + z_f + w^f$}} + \stopoverlay} {2 over 1} +\stopcombination +\stoplinecorrection + +The next table shows what parameters kick in when: + +\starttabulate[|l|l|l|p|] +\NC \BC or (1) \BC and (2) \BC otherwise \NC \NR +\BC super \NC sup shift up \NC sup shift up \NC sup shift up, + sup bot min \NC \NR +\BC sub \NC sub shift down \NC sub sup shift down \NC sub shift down, + sub top max \NC \NR +\BC both \NC sub shift down \NC sub sup shift down \NC sub sup shift down, + sub sup vgap, + sup sub bot max \NC \NR +\stoptabulate + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathslackmode}}] + +When positive this parameter will make sure that script spacing is discarded when +there is no reason to add it. + +\startlinecorrection +\startcombination[nx=3,ny=1] + {\mathslackmode0 + \ruledhbox{$\setmscale{3}x^2 + x^2$}\space + \ruledhbox{$\setmscale{3}x^2$}} + {disabled (0)} + {\mathslackmode1 + \ruledhbox{$\setmscale{3}x^2 + x^2$}\space + \ruledhbox{$\setmscale{3}x^2$}} + {enabled (1)} + {\startoverlay + {\mathslackmode0 \ruledhbox{$\setmscale{3}x^2 + x^2$}} + {\mathslackmode1 \red\ruledhbox{$\setmscale{3}x^2 + x^2$}} + \stopoverlay + \space + \startoverlay + {\mathslackmode0 \ruledhbox{$\setmscale{3}x^2$}} + {\mathslackmode1 \red\ruledhbox{$\setmscale{3}x^2$}} + \stopoverlay} + {{\red enabled} over disabled} +\stopcombination +\stoplinecorrection + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathspacingmode}}] + +Zero inter|-|class glue is not injected but setting this parameter to a positive +value bypasses that check. This can be handy when checking (tracing) how (and +what) spacing is applied. Keep in mind that glue in math is special in the sense +that it is not a valid breakpoint. Line breaks in (inline) math are driven by +penalties. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathstack}}] + +There are a few commands in \TEX\ that can behave confusing due to the way they +are scanned. Compare these: + +\starttyping +$ 1 \over 2 $ +$ 1 + x \over 2 + x$ +$ {1 + x} \over {2 + x}$ +$ {{1 + x} \over {2 + x}}$ +\stoptyping + +A single $1$ is an atom as is the curly braced ${1 + x}$. The two arguments to +\prm {over} eventually will get typeset in the style that this fraction +constructor uses for the numerator and denominator but on might actually also +like to relate that to the circumstances. It is comparable to using a \prm +{mathchoice}. In order not to waste runtime on four variants, which itself can have +side effects, for instance when counters are involved, \LUATEX\ introduced +\prm {mathstack}, used like: + +\starttyping +$\mathstack {1 \over 2}$ +\stoptyping + +This \prm {mathstack} command will scan the next brace and opens a new math group +with the correct (in this case numerator) math style. The \prm {mathstackstyle} +primitive relates to this feature that defaults to \quote {smaller unless already +scriptscript}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathstackstyle}}] + +This returns the (normally) numerator style but the engine can be configured to +default to another style. Although all these in the original \TEX\ engines hard +coded style values can be changed in \LUAMETATEX\ it is unlikely to happen. So +this primitive will normally return the (current) style \quote {smaller unless +already scriptscript}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathstyle}}] + +This returns the current math style, so \type {$\the \mathstyle$} gives $\the +\mathstyle$. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathstylefontid}}] + +This returns the font id (a number) of a style|/|family combination. What you get +back depends on how a macro package implements math fonts. + +\startbuffer +(\the\mathstylefontid\textstyle \fam) +(\the\mathstylefontid\scriptstyle \fam) +(\the\mathstylefontid\scriptscriptstyle\fam) +\stopbuffer + +\typebuffer + +In \CONTEXT\ gives: \inlinebuffer. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mathsurround}}] + +The kern injected before and after an inline math formula. In practice it will be +set to zero, if only because otherwise nested math will also get that space +added. We also have \prm {mathsurroundskip} which, when set, takes precedence. +Spacing is controlled by \prm {mathsurroundmode}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mathsurroundmode}}] + +The possible ways to control spacing around inline math formulas in other manuals +and mostly serve as playground. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathsurroundskip}}] + +When set this one wins over \prm {mathsurround}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {maththreshold}}] + +This is a glue parameter. The amount determines what happens: when it is non zero +and the inline formula is less than that value it will become a special kind of +box that can stretch and|/| or shrink within the given specification. The par +builder will use these stretch and|/| or shrink components but it is up to one of +the \LUA\ callbacks to deal with the content eventually (if at all). As this is +somewhat specialized, more details can be found on \CONTEXT\ documentation. + +\stopnewprimitive + +\startnewprimitive[title={\prm {mathtolerance}}] + +This is used instead of \prm {tolerance} when a breakpoint is calculated when a +math formula starts. + +\stopnewprimitive + +\startoldprimitive[title={\prm {maxdeadcycles}}] + +When the output routine is called this many times and no page is shipped out an +error will be triggered. You therefore need to reset its companion counter \prm +{deadcycles} if needed. Keep in mind that \LUAMETATEX\ has no real \prm {shipout} +because providing a backend is up to the macro package. + +\stopoldprimitive + +\startoldprimitive[title={\prm {maxdepth}}] + +The depth of the page is limited to this value. + +\stopoldprimitive + +\startoldprimitive[title={\prm {meaning}}] + +We start with a primitive that will be used in the following sections. The +reported meaning can look a bit different than the one reported by other engines +which is a side effect of additional properties and more extensive argument +parsing. + +\startbuffer +\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaning\foo +\stopbuffer + +\typebuffer \getbuffer + +\stopoldprimitive + +\startnewprimitive[title={\prm {meaningasis}}] + +Although it is not really round trip with the original due to information +being lost this primitive tries to return an equivalent definition. + +\startbuffer +\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningasis\foo +\stopbuffer + +\typebuffer \getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {meaningful}}] + +This one reports a bit less than \prm {meaningful}. + +\startbuffer +\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningful\foo +\stopbuffer + +\typebuffer \getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {meaningfull}}] + +This one reports a bit more than \prm {meaning}. + +\startbuffer +\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningfull\foo +\stopbuffer + +\typebuffer \getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {meaningles}}] + +This one reports a bit less than \prm {meaningless}. + +\startbuffer +\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningles\foo +\stopbuffer + +\typebuffer \getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {meaningless}}] + +This one reports a bit less than \prm {meaning}. + +\startbuffer +\tolerant\permanent\protected\gdef\foo[#1]#*[#2]{(#1)(#2)} \meaningless\foo +\stopbuffer + +\typebuffer \getbuffer + +\stopnewprimitive + +\startoldprimitive[title={\prm {medmuskip}}] + +A predefined mu skip register that can be used in math (inter atom) spacing. The +current value is {\tt \the\medmuskip}. In traditional \TEX\ most inter atom +spacing is hard coded using the predefined registers. + +\stopoldprimitive + +\startoldprimitive[title={\prm {message}}] + +Prints the serialization of the (tokenized) argument to the log file and|/|or +console. + +\stopoldprimitive + +\startoldprimitive[title={\prm {middle}}] + +Inserts the given delimiter as middle fence in a math formula. In \LUAMETATEX\ it +is a full blown fence and not (as in \ETEX) variation of \prm {open}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {mkern}}] + +This one injects a kern node in the current (math) list and expects a value in so +called mu units. + +\stopoldprimitive + +\startoldprimitive[title={\prm {month}}] + +This internal number starts out with the month that the job started. + +\stopoldprimitive + +\startoldprimitive[title={\prm {moveleft}}] + +This primitive takes two arguments, a dimension and a box. The box is moved to +the left. The operation only succeeds in vertical mode. + +\stopoldprimitive + +\startoldprimitive[title={\prm {moveright}}] + +This primitive takes two arguments, a dimension and a box. The box is moved to +the right. The operation only succeeds in vertical mode. + +\stopoldprimitive + +\startoldprimitive[title={\prm {mskip}}] + +The given math glue (in \type {mu} units) is injected in the horizontal list. For +this to succeed we need to be in math mode. + +\stopoldprimitive + +\startoldprimitive[title={\prm {muexpr}}] + +This is a companion of \prm {glueexpr} so it handles the optional stretch and +shrink components. Here math units (\type {mu}) are expected. + +\stopoldprimitive + +\startnewprimitive[title={\prm {mugluespecdef}}] + +A variant of \prm {gluespecdef} that expects \type {mu} units is: + +\starttyping +\mugluespecdef\MyGlue = 3mu plus 2mu minus 1mu +\stoptyping + +The properties are comparable to the ones described in the previous sections. + +\stopnewprimitive + +\startoldprimitive[title={\prm {multiply}}] + +The given quantity is multiplied by the given integer (that can be preceded by +the keyword \quote {by}, like: + +\starttyping +\scratchdimen=10pt \multiply\scratchdimen by 3 +\stoptyping + +\stopoldprimitive + +\startnewprimitive[title={\prm {multiplyby}}] + +This is slightly more efficient variant of \prm {multiply} that doesn't look for +\type {by}. See previous section. + +\stopnewprimitive + +\startoldprimitive[title={\prm {muskip}}] + +This is the accessor for an indexed muskip (muglue) register. + +\stopoldprimitive + +\startoldprimitive[title={\prm {muskipdef}}] + +This command associates a control sequence with a muskip (math skip) register +(accessed by number). + +\stopoldprimitive + +\startnewprimitive[title={\prm {mutable}}] + +This prefix flags what follows can be adapted and is not subjected to overload +protection. + +\stopnewprimitive + +\startoldprimitive[title={\prm {mutoglue}}] + +The sequence \typ {\the \mutoglue 20mu plus 10mu minus 5mu} gives \the \mutoglue +20mu plus 10mu minus 5mu. + +\stopoldprimitive + +\startnewprimitive[title={\prm {nestedloopiterator}}] + +This is one of the accessors of loop iterators: + +\startbuffer +\expandedrepeat 2 {% + \expandedrepeat 3 {% + (n=\the\nestedloopiterator 1, + p=\the\previousloopiterator1, + c=\the\currentloopiterator) + }% +}% +\stopbuffer + +\typebuffer + +Gives: + +\getbuffer + +Where a nested iterator starts relative to innermost loop, the previous one is +relative to the outer loop (which is less predictable because we can already be +in a loop). + +\stopnewprimitive + +\startoldprimitive[title={\prm {newlinechar}}] + +When something is printed to one of the log channels the character with this code +will trigger a linebreak. That also resets some counters that deal with +suppressing redundant ones and possible indentation. Contrary to other engines +\LUAMETATEX\ doesn't bother about the length of lines. + +\stopoldprimitive + +\startoldprimitive[title={\prm {noalign}}] + +The token list passed to this primitive signals that we don't enter a table row +yet but for instance in a \prm {halign} do something between the lines: some +calculation or injecting inter-row material. In \LUAMETATEX\ this primitive can +be used nested. + +\stopoldprimitive + +\startnewprimitive[title={\prm {noaligned}}] + +The alignment mechanism is kind of special when it comes to expansion because it +has to look ahead for a \prm {noalign}. This interferes with for instance +protected macros, but using this prefix we get around that. Among the reasons to +use protected macros inside an alignment is that they behave better inside for +instance \prm {expanded}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {noatomruling}}] + +Spacing in math is based on classes and this primitive inserts a signal that +there is no ruling in place here. Basically we have a zero skip glue tagged as +non breakable because in math mode glue is not a valid breakpoint unless we have +configured inter|-|class penalties. + +\stopnewprimitive + +\startnewprimitive[title={\prm {noboundary}}] + +This inserts a boundary node with no specific property. It can still serve as +boundary but is not interpreted in special ways, like the others. + +\stopnewprimitive + +\startoldprimitive[title={\prm {noexpand}}] + +This prefix prevents expansion in a context where expansion happens. Another way +to prevent expansion is to define a macro as \prm {protected}. + +\startbuffer + \def\foo{foo} \edef\oof{we expanded \foo} \meaning\oof + \def\foo{foo} \edef\oof{we keep \noexpand\foo} \meaning\oof +\protected\def\foo{foo} \edef\oof{we keep \foo} \meaning\oof +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +\stopoldprimitive + +\startnewprimitive[title={\prm {nohrule}}] + +This is a rule but flagged as empty which means that the dimensions kick in as +for a normal rule but the backend can decide not to show it. + +\stopnewprimitive + +\startoldprimitive[title={\prm {noindent}}] + +This starts a paragraph. In \LUATEX\ (and \LUAMETATEX) a paragraph starts with a +so called par node (see \prm {indent} on how control that. After that comes +either \prm {parindent} glue or a horizontal box. The \prm {indent} makes gives +them some width, while \prm {noindent} keeps that zero. + +\stopoldprimitive + +\startoldprimitive[title={\prm {nolimits}}] + +This is a modifier: it flags the previous math atom to have its scripts after the +the atom (contrary to \prm {limits}. In \LUAMETATEX\ this can be any atom (that +is: any class). In display mode the location defaults to above and below. + +\stopoldprimitive + +\startoldprimitive[title={\prm {nonscript}}] + +This prevents \TEX\ from adding inter|-|atom glue at this spot in script or +scriptscript mode. It actually is a special glue itself that serves as signal. + +\stopoldprimitive + +\startoldprimitive[title={\prm {nonstopmode}}] + +This directive omits all stops. + +\stopoldprimitive + +\startnewprimitive[title={\prm {norelax}}] + +The rationale for this command can be shown by a few examples: + +\startbuffer +\dimen0 1pt \dimen2 1pt \dimen4 2pt +\edef\testa{\ifdim\dimen0=\dimen2\norelax N\else Y\fi} +\edef\testb{\ifdim\dimen0=\dimen2\relax N\else Y\fi} +\edef\testc{\ifdim\dimen0=\dimen4\norelax N\else Y\fi} +\edef\testd{\ifdim\dimen0=\dimen4\relax N\else Y\fi} +\edef\teste{\norelax} +\stopbuffer + +\typebuffer + +The five meanings are: + +\start \getbuffer \starttabulate[|T|T|] +\NC \string\testa \NC \meaning\testa \NC \NR +\NC \string\testb \NC \meaning\testb \NC \NR +\NC \string\testc \NC \meaning\testc \NC \NR +\NC \string\testd \NC \meaning\testd \NC \NR +\NC \string\teste \NC \meaning\teste \NC \NR +\stoptabulate \stop + +So, the \prm {norelax} acts like \prm {relax} but is not pushed back as +usual (in some cases). + +\stopnewprimitive + +\startnewprimitive[title={\prm {normalizelinemode}}] + +The \TEX\ engine was not designed to be opened up, and therefore the result of +the linebreak effort can differ depending on the conditions. For instance not +every line gets the left- or rightskip. The first and last lines have some unique +components too. When \LUATEX\ made it possible too get the (intermediate) result +manipulating the result also involved checking what one encountered, for instance +glue and its origin. In \LUAMETATEX\ we can normalize lines so that they have for +instance balanced skips. + +\startcolumns[n=2] +\getbuffer[engine:syntax:normalizelinecodes] +\stopcolumns + +The order in which the skips get inserted when we normalize is as follows: + +\starttabulate +\NC \prm {lefthangskip} \NC the hanging indentation (or zero) \NC \NR +\NC \prm {leftskip} \NC the value even when zero \NC \NR +\NC \prm {parfillleftskip} \NC only on the last line \NC \NR +\NC \prm {parinitleftskip} \NC only on the first line \NC \NR +\NC \prm {indentskip} \NC the amount of indentation \NC \NR +\NC \unknown \NC the (optional) content \NC \NR +\NC \prm {parinitrightskip} \NC only on the first line \NC \NR +\NC \prm {parfillrightskip} \NC only on the last line \NC \NR +\NC \prm {correctionskip} \NC the correction needed to stay within the \prm {hsize} \NC \NR +\NC \prm {rightskip} \NC the value even when zero \NC \NR +\NC \prm {righthangskip} \NC the hanging indentation (or zero) \NC \NR +\stoptabulate + +The init and fill skips can both show up when we have a single line. The +correction skip replaces the traditional juggling with the right skip and shift +of the boxed line. + +For now we leave the other options to your imagination. Some of these can be +achieved by callbacks (as we did in older versions of \CONTEXT) but having the +engine do the work we get a better performance. + +\stopnewprimitive + +\startnewprimitive[title={\prm {normalizeparmode}}] + +For now we just mention the few options available. It is also worth mentioning that +\LUAMETATEX\ tries to balance the direction nodes. + +\startcolumns[n=2] +\getbuffer[engine:syntax:normalizeparcodes] +\stopcolumns + +\stopnewprimitive + +\startnewprimitive[title={\prm {nospaces}}] + +When \prm {nospaces} is set to~1 no spaces are inserted, when its value is~2 a +zero space is inserted. The default value is~0 which means that spaces become +glue with properties depending on the font, specific parameters and|/|or space +factors determined preceding characters. + +\stopnewprimitive + +\startnewprimitive[title={\prm {nosubprescript}}] + +This processes the given script in the current style, so: + +\startbuffer +$ x___2 + x\nosubprescript{2} + x\subprescript{2} $ +\stopbuffer + +comes out as: \inlinebuffer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {nosubscript}}] + +This processes the given script in the current style, so: + +\startbuffer +$ x_2 + x\nosubscript{2} + x\subscript{2} $ +\stopbuffer + +comes out as: \inlinebuffer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {nosuperprescript}}] + +This processes the given script in the current style, so: + +\startbuffer +$ x^^^2 + x\nosuperprescript{2} + x\superprescript{2} $ +\stopbuffer + +comes out as: \inlinebuffer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {nosuperscript}}] + +This processes the given script in the current style, so: + +\startbuffer +$ x^2 + x\nosuperprescript{2} + x\superprescript{2} $ +\stopbuffer + +comes out as: \inlinebuffer. + +\stopnewprimitive + +\startnewprimitive[title={\prm {novrule}}] + +This is a rule but flagged as empty which means that the dimensions kick in as +for a normal rule but the backend can decide not to show it. + +\stopnewprimitive + +\startoldprimitive[title={\prm {nulldelimiterspace}}] + +In fenced math delimiters can be invisible in which case this parameter +determines the amount of space (width) that ghost delimiter takes. + +\stopoldprimitive + +\startoldprimitive[title={\prm {nullfont}}] + +This a symbolic reference to a font with no glyphs and a minimal set of font +dimensions. + +\stopoldprimitive + +\startoldprimitive[title={\prm {number}}] + +This \TEX\ primitive serializes the next token into a number, assuming that it +is indeed a number, like + +\starttyping +\number`A +\number65 +\number\scratchcounter +\stoptyping + +For counters and such the \prm {the} primitive does the same, but when you're +not sure if what follows is a verbose number or (for instance) a counter the +\prm {number} primitive is a safer bet, because \type {\the 65} will not work. + +\stopoldprimitive + +\startnewprimitive[title={\prm {numericscale}}] + +This primitive can best be explained by a few examples: + +\startbuffer +\the\numericscale 1323 +\the\numericscale 1323.0 +\the\numericscale 1.323 +\the\numericscale 13.23 +\stopbuffer + +\typebuffer + +In several places \TEX\ uses a scale but due to the lack of floats it then uses +1000 as 1.0 replacement. This primitive can be used for \quote {real} scales: + +\startlines \getbuffer \stoplines + +\stopnewprimitive + +\startnewprimitive[title={\prm {numericscaled}}] + +This is a variant if \prm {numericscale}: + +\startbuffer +\scratchcounter 1000 +\the\numericscaled 1323 \scratchcounter +\the\numericscaled 1323.0 \scratchcounter +\the\numericscaled 1.323 \scratchcounter +\the\numericscaled 13.23 \scratchcounter +\stopbuffer + +\typebuffer + +The second number gets multiplied by the first fraction: + +\startlines \getbuffer \stoplines + +\stopnewprimitive + +\startoldprimitive[title={\prm {numexpr}}] + +This primitive was introduced by \ETEX\ and supports a simple expression syntax: + +\startbuffer +\the\numexpr 10 * (1 + 2 - 5) / 2 \relax +\stopbuffer + +\typebuffer + +gives: \inlinebuffer. You can mix in symbolic integers and dimensions. + +\stopoldprimitive + +\startnewprimitive[title={\prm {numexpression}}] + +The normal \prm {numexpr} primitive understands the \type {+}, \type {-}, \type +{*} and \type {/} operators but in \LUAMETATEX\ we also can use \type {:} for a +non rounded integer division (think of \LUA's \type {//}). if you want more than +that, you can use the new expression primitive where you can use the following +operators. + +\starttabulate[||cT|cT|] +\BC add \NC + \NC \NC \NR +\BC subtract \NC - \NC \NC \NR +\BC multiply \NC * \NC \NC \NR +\BC divide \NC / : \NC \NC \NR +\BC mod \NC \letterpercent \NC mod \NC \NR +\BC band \NC & \NC band \NC \NR +\BC bxor \NC ^ \NC bxor \NC \NR +\BC bor \NC \letterbar \space v \NC bor \NC \NR +\BC and \NC && \NC and \NC \NR +\BC or \NC \letterbar\letterbar \NC or \NC \NR +\BC setbit \NC \NC bset \NC \NR +\BC resetbit \NC \NC breset \NC \NR +\BC left \NC << \NC \NC \NR +\BC right \NC >> \NC \NC \NR +\BC less \NC < \NC \NC \NR +\BC lessequal \NC <= \NC \NC \NR +\BC equal \NC = == \NC \NC \NR +\BC moreequal \NC >= \NC \NC \NR +\BC more \NC > \NC \NC \NR +\BC unequal \NC <> != \lettertilde = \NC \NC \NR +\BC not \NC ! \lettertilde \NC not \NC \NR +\stoptabulate + +An example of the verbose bitwise operators is: + +\starttyping +\scratchcounter = \numexpression + "00000 bor "00001 bor "00020 bor "00400 bor "08000 bor "F0000 +\relax +\stoptyping + +In the table you might have notices that some operators have equivalents. This +makes the scanner a bit less sensitive for catcode regimes. + +When \prm {tracingexpressions} is set to one or higher the intermediate \quote +{reverse polish notation} stack that is used for the calculation is shown, for +instance: + +\starttyping +4:8: {numexpression rpn: 2 5 > 4 5 > and} +\stoptyping + +When you want the output on your console, you need to say: + +\starttyping +\tracingexpressions 1 +\tracingonline 1 +\stoptyping + +\stopnewprimitive + +\startoldprimitive[title={\prm {omit}}] + +This primitive cancels the template set for the upcoming cell. Often it is used +in combination with \prm {span}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {optionalboundary}}] + +This boundary is used to mark optional content. An positive \prm +{optionalboundary} starts a range and a zero one ends it. Nesting is not +supported. Optional content is considered when an additional paragraph pass +enables it as part of its recipe. + +\stopnewprimitive + +\startoldprimitive[title={\prm {or}}] + +This traditional primitive is part of the condition testing mechanism and relates +to an \prm {ifcase} test (or a similar test to be introduced in later +sections). Depending on the value, \TEX\ will do a fast scanning till the right +\prm {or} is seen, then it will continue expanding till it sees a \prm {or} +or \prm {else} or \prm {orelse} (to be discussed later). It will then do a +fast skipping pass till it sees an \prm {fi}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {orelse}}] + +This primitive provides a convenient way to flatten your conditional tests. So +instead of + +\starttyping +\ifnum\scratchcounter<-10 + too small +\else\ifnum\scratchcounter>10 + too large +\else + just right +\fi\fi +\stoptyping + +You can say this: + +\starttyping +\ifnum\scratchcounter<-10 + too small +\orelse\ifnum\scratchcounter>10 + too large +\else + just right +\fi +\stoptyping + +You can mix tests and even the case variants will work in most cases \footnote {I +just play safe because there are corner cases that might not work yet.} + +\starttyping +\ifcase\scratchcounter zero +\or one +\or two +\orelse\ifnum\scratchcounter<10 less than ten +\else ten or more +\fi +\stoptyping + +Performance wise there are no real benefits although in principle there is a bit +less housekeeping involved than with nested checks. However you might like this: + +\starttyping +\ifnum\scratchcounter<-10 + \expandafter\toosmall +\orelse\ifnum\scratchcounter>10 + \expandafter\toolarge +\else + \expandafter\justright +\fi +\stoptyping + +over: + +\starttyping +\ifnum\scratchcounter<-10 + \expandafter\toosmall +\else\ifnum\scratchcounter>10 + \expandafter\expandafter\expandafter\toolarge +\else + \expandafter\expandafter\expandafter\justright +\fi\fi +\stoptyping + +or the more \CONTEXT\ specific: + +\starttyping +\ifnum\scratchcounter<-10 + \expandafter\toosmall +\else\ifnum\scratchcounter>10 + \doubleexpandafter\toolarge +\else + \doubleexpandafter\justright +\fi\fi +\stoptyping + +But then, some \TEX ies like complex and obscure code and throwing away working +old code that took ages to perfect and get working and also showed that one +masters \TEX\ might hurt. + +\stopnewprimitive + +\startnewprimitive[title={\prm {orphanpenalties}}] + +This an (single entry) array parameter: first the size is given followed by that +amount of penalties. These penalties are injected before spaces, going backward +from the end of a paragraph. When we see a math node with a penalty set then we +take the max and jump over a (preceding) skip. + +\stopnewprimitive + +\startnewprimitive[title={\prm {orphanpenalty}}] + +This penalty is inserted before the last space in a paragraph, unless \prm +{orphanpenalties} mandates otherwise. + +\stopnewprimitive + +\startnewprimitive[title={\prm {orunless}}] + +This is the negated variant of \prm {orelse} (prefixing that one with \tex +{unless} doesn't work well. + +\stopnewprimitive + +\startoldprimitive[title={\prm {outer}}][obsolete=yes] + +An outer macro is one that can only be used at the outer level. This property is +no longer supported. Like \prm {long}, the \prm {outer} prefix is now an +no|-|op (and we don't expect this to have unfortunate side effects). + +\stopoldprimitive + +\startoldprimitive[title={\prm {output}}] + +This token list register holds the code that will be expanded when \TEX\ enters +the output routine. That code is supposed to do something with the content in +the box with number \prm {outputbox}. By default this is box 255 but that can be +changed with \prm {outputbox}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {outputbox}}] + +This is where the split off page contend ends up when the output routine is +triggered. + +\stopnewprimitive + +\startoldprimitive[title={\prm {outputpenalty}}] + +This is the penalty that triggered the output routine. + +\stopoldprimitive + +\startoldprimitive[title={\prm {over}}][obsolete=yes] + +This math primitive is actually a bit of a spoiler for the parser as it is one of +the few that looks back. The \prm {Uover} variant is different and takes two +arguments. We leave it to the user to predicts the results of: + +\starttyping +$ {1} \over {x} $ +$ 1 \over x $ +$ 12 \over x / y $ +$ a + 1 \over {x} $ +\stoptyping + +and: + +\starttyping +$ \textstyle 1 \over x $ +$ {\textstyle 1} \over x $ +$ \textstyle {1 \over x} $ +\stoptyping + +It's one of the reasons why macro packages provide \type {\frac}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {overfullrule}}] + +When an overfull box is encountered a rule can be shown in the margin and this +parameter sets its width. For the record: \CONTEXT\ does it different. + +\stopoldprimitive + +\startoldprimitive[title={\prm {overline}}] + +This is a math specific primitive that draws a line over the given content. It is +a poor mans replacement for a delimiter. The thickness is set with \prm +{Umathoverbarrule}, the distance between content and rule is set by \prm +{Umathoverbarvgap} and \prm {Umathoverbarkern} is added above the rule. The style +used for the content under the rule can be set with \prm {Umathoverlinevariant}. + +Because \CONTEXT\ set up math in a special way, the following example: + +\startbuffer[demo] +\normaloverline { + \blackrule[color=red, height=1ex,depth=0ex,width=2cm]% + \kern-2cm + \blackrule[color=blue,height=0ex,depth=.5ex,width=2cm] + x + x +} +\stopbuffer + +\typebuffer[demo] + +gives: \ruledhbox {$\getbuffer[demo]$}, while: + +\startbuffer[setup] +\mathfontcontrol\zerocount +\Umathoverbarkern\allmathstyles10pt +\Umathoverbarvgap\allmathstyles5pt +\Umathoverbarrule\allmathstyles2.5pt +\Umathoverlinevariant\textstyle\scriptstyle +\stopbuffer + +\typebuffer[setup] + +gives this: \ruledhbox {$\getbuffer[setup,demo]$}. We have to disable the related +\prm {mathfontcontrol} bits because otherwise the thickness is taken from the font. The +variant is just there to overload the (in traditional \TEX\ engines) default. + +\stopoldprimitive + +\startnewprimitive[title={\prm {overloaded}}] + +This prefix can be used to overload a frozen macro. + +\stopnewprimitive + +\startnewprimitive[title={\prm {overloadmode}}] + +The overload protection mechanism can be used to prevent users from redefining +a control sequence. The mode can have several values, the higher the more strict +we are: + +\starttabulate[||||||||] + \NC \NC \NC immutable \NC permanent \NC primitive \NC frozen \NC instance \NC \NR + \NC 1 \NC warning \NC + \NC + \NC + \NC \NC \NC \NR + \NC 2 \NC error \NC + \NC + \NC + \NC \NC \NC \NR + \NC 3 \NC warning \NC + \NC + \NC + \NC + \NC \NC \NR + \NC 4 \NC error \NC + \NC + \NC + \NC + \NC \NC \NR + \NC 5 \NC warning \NC + \NC + \NC + \NC + \NC + \NC \NR + \NC 6 \NC error \NC + \NC + \NC + \NC + \NC + \NC \NR +\stoptabulate + +When you set a high error value, you can of course temporary lower or even zero +the mode. In \CONTEXT\ all macros and quantities are tagged so there setting the +mode to~6 gives a proper protection against overloading. We need to zero the mode +when we load for instance tikz, so when you use that generic package, you loose +some. + +\stopnewprimitive + +\startnewprimitive[title={\prm {overshoot}}] + +This primitive is a companion to \prm {badness} and reports how much a box +overflows. + +\startbuffer +\setbox0\hbox to 1em {mmm} \the\badness\quad\the\overshoot +\setbox0\hbox {mm} \the\badness\quad\the\overshoot +\setbox0\hbox to 3em {m} \the\badness\quad\the\overshoot +\stopbuffer + +\typebuffer + +This reports: + +\startlines +\getbuffer +\stoplines + +When traditional \TEX\ wraps up the lines in a paragraph it uses a mix of shift +(a box property) to position the content suiting the hanging indentation and|/|or +paragraph shape, and fills up the line using right skip glue, also in order to +silence complaints in packaging. In \LUAMETATEX\ the lines can be normalized so +that they all have all possible skips to the left and right (even if they're +zero). The \prm {overshoot} primitive fits into this picture and is present as a +compensation glue. This all fits better in a situation where the internals are +opened up via \LUA. + +\stopnewprimitive + +\startoldprimitive[title={\prm {overwithdelims}}][obsolete=yes] + +This is a variant of \prm {over} but with delimiters. It has a more advanced +upgrade in \prm {Uoverwithdelims}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {pageboundary}}] + +In order to avoid side effects of triggering the page builder with a specific +penalty we can use this primitive which expects a value that actually gets +inserted as zero penalty before triggering the page builder callback. Think of +adding a no|-|op to the contribution list. We fake a zero penalty so that all +gets processed. The main rationale is that we get a better indication of what we +do. Of course a callback can remove this node so that it is never seen. +Triggering from the callback is not doable. Consider this experimental code +(which is actually used in \CONTEXT\ anyway). + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagedepth}}] + +This page property holds the depth of the page. + +\stopnewprimitive + +\startoldprimitive[title={\prm {pagediscards}}] + +The left|-|overs after a page is split of the main vertical list when glue and +penalties are normally discarded. The discards can be pushed back in (for +instance) trial runs. + +\stopoldprimitive + +\startnewprimitive[title={\prm {pageexcess}}] + +This page property hold the amount of overflow when a page break occurs. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pageextragoal}}] + +This (experimental) dimension will be used when the page overflows but a bit of +overshoot is considered okay. + +\stopnewprimitive + +\startoldprimitive[title={\prm {pagefilllstretch}}] + +The accumulated amount of third order stretch on the current page. + +\stopoldprimitive + +\startoldprimitive[title={\prm {pagefillstretch}}] + +The accumulated amount of second order stretch on the current page. + +\stopoldprimitive + +\startoldprimitive[title={\prm {pagefilstretch}}] + +The accumulated amount of first order stretch on the current page. + +\stopoldprimitive + +\startnewprimitive[title={\prm {pagefistretch}}] + +The accumulated amount of zero order stretch on the current page. + +\stopnewprimitive + +\startoldprimitive[title={\prm {pagegoal}}] + +The target height of a page (the running text). This value will be decreased by +the height of inserts something to keep into mind when messing around with this +and other (pseudo) page related parameters like \prm {pagetotal}. + +\stopoldprimitive + +\startnewprimitive[title={\prm {pagelastdepth}}] + +The accumulated depth of the current page. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagelastfilllstretch}}] + +The accumulated amount of third order stretch on the current page. Contrary to +\prm {pagefilllstretch} this is the really contributed amount, not the upcoming. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagelastfillstretch}}] + +The accumulated amount of second order stretch on the current page. Contrary to +\prm {pagefillstretch} this is the really contributed amount, not the upcoming. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagelastfilstretch}}] + +The accumulated amount of first order stretch on the current page. Contrary to +\prm {pagefilstretch} this is the really contributed amount, not the upcoming. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagelastfistretch}}] + +The accumulated amount of zero order stretch on the current page. Contrary to +\prm {pagefistretch} this is the really contributed amount, not the upcoming. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagelastheight}}] + +The accumulated height of the current page. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagelastshrink}}] + +The accumulated amount of shrink on the current page. Contrary to \prm +{pageshrink} this is the really contributed amount, not the upcoming. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pagelaststretch}}] + +The accumulated amount of stretch on the current page. Contrary to \prm +{pagestretch} this is the really contributed amount, not the upcoming. + +\stopnewprimitive + +\startoldprimitive[title={\prm {pageshrink}}] + +The accumulated amount of shrink on the current page. + +\stopoldprimitive + +\startoldprimitive[title={\prm {pagestretch}}] + +The accumulated amount of stretch on the current page. + +\stopoldprimitive + +\startoldprimitive[title={\prm {pagetotal}}] + +The accumulated page total (height) of the current page. + +\stopoldprimitive + +\startnewprimitive[title={\prm {pagevsize}}] + +This parameter, when set, is used as the target page height. This lessens the +change of \prm {vsize} interfering. + +\stopnewprimitive + +\startoldprimitive[title={\prm {par}}] + +This is the explicit \quote {finish paragraph} command. Internally we distinguish +a par triggered by a new line, as side effect of another primitive or this \prm +{par} command. + +\stopoldprimitive + +\startnewprimitive[title={\prm {parametercount}}] + +The number of parameters passed to the current macro. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parameterdef}}] + +Here is an example of binding a variable to a parameter. The alternative is of +course to use an \prm {edef}. + +\startbuffer +\def\foo#1#2% + {\parameterdef\MyIndexOne\plusone % 1 + \parameterdef\MyIndexTwo\plustwo % 2 + \oof{P}\oof{Q}\oof{R}\norelax} + +\def\oof#1% + {<1:\MyIndexOne><1:\MyIndexOne>% + #1% + <2:\MyIndexTwo><2:\MyIndexTwo>} + +\foo{A}{B} +\stopbuffer + +\typebuffer + +The outcome is: + +\getbuffer + +\stopnewprimitive + +\startnewprimitive[title={\prm {parameterindex}}] + +This gives the zero based position on the parameter stack. One reason for +introducing \prm {parameterdef} is that the position remains abstract so there we +don't need to use \prm {parameterindex}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parametermark}}] + +This is an equivalent for \type {#}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parametermode}}] + +Setting this internal integer to a positive value (best use~1 because future +versions might use bit set) will enable the usage of \type {#} for escaped in the +main text and body of macros. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parattribute}}] + +This primitive takes an attribute index and value and sets that attribute on the +current paragraph. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pardirection}}] + +This set the text direction for the whole paragraph which in the case of \type +{r2l} (1) makes the right edge the starting point. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parfillleftskip}}] + +The glue inserted at the start of the last line. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parfillrightskip}}] + +The glue inserted at the end of the last line (aka \prm {parfillskip}). + +\stopnewprimitive + +\startoldprimitive[title={\prm {parfillskip}}] + +The glue inserted at the end of the last line. + +\stopoldprimitive + +\startoldprimitive[title={\prm {parindent}}] + +The amount of space inserted at the start of the first line. When bit \tobit +\parindentskipnormalizecode\ is set in \prm {normalizelinemode} a glue is +inserted, otherwise an empty \prm {hbox} with the given width is inserted. + +\stopoldprimitive + +\startnewprimitive[title={\prm {parinitleftskip}}] + +The glue inserted at the start of the first line. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parinitrightskip}}] + +The glue inserted at the end of the first line. + +\stopnewprimitive + +\startnewprimitive[title={\prm {parpasses}}] + +Specifies one or more recipes for additional second linebreak passes. Examples +can be found in the \CONTEXT\ distribution. + +\stopnewprimitive + +\startoldprimitive[title={\prm {parshape}}] + +Stores a shape specification. The first argument is the length of the list, +followed by that amount of indentation|-|width pairs (two dimensions). + +\stopoldprimitive + +\startoldprimitive[title={\prm {parshapedimen}}] + +This oddly named (\ETEX) primitive returns the width component (dimension) of the +given entry (an integer). Obsoleted by \prm {parshapewidth}. + +\stopoldprimitive + +\startoldprimitive[title={\prm {parshapeindent}}] + +Returns the indentation component (dimension) of the given entry (an integer). + +\stopoldprimitive + +\startoldprimitive[title={\prm {parshapelength}}] + +Returns the number of entries (an integer). + +\stopoldprimitive + +\startnewprimitive[title={\prm {parshapewidth}}] + +Returns the width component (dimension) of the given entry (an integer). + +\stopnewprimitive + +\startoldprimitive[title={\prm {parskip}}] + +This is the amount of glue inserted before a new paragraph starts. + +\stopoldprimitive + +\startoldprimitive[title={\prm {patterns}}] + +The argument to this primitive contains hyphenation patterns that are bound to +the current language. In \LUATEX\ and \LUAMETATEX\ we can also manage this at the +\LUA\ end. In \LUAMETATEX\ we don't store patterns in te format file + +\stopoldprimitive + +\startoldprimitive[title={\prm {pausing}}][obsolete=yes] + +In \LUAMETATEX\ this variable is ignored but in other engines it can be used to +single step thought the input file by setting it to a positive value. + +\stopoldprimitive + +\startoldprimitive[title={\prm {penalty}}] + +The given penalty (a number) is inserted at the current spot in the horizontal or +vertical list. We also have \prm {vpenalty} and \prm {hpenalty} that first change +modes. + +\stopoldprimitive + +\startnewprimitive[title={\prm {permanent}}] + +This is one of the prefixes that is part of the overload protection mechanism. It +is normally used to flag a macro as being at the same level as a primitive: don't +touch it. primitives are flagged as such but that property cannot be set on +regular macros. The similar \prm {immutable} flag is normally used for variables. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pettymuskip}}] + +A predefined mu skip register that can be used in math (inter atom) spacing. The +current value is {\tt \the\pettymuskip}. This one complements \prm {thinmuskip}, +\prm {medmuskip}, \prm {thickmuskip} and the new \prm {tinymuskip}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {positdef}}] + +The engine uses 32 bit integers for various purposes and has no (real) concept of +a floating point quantity. We get around this by providing a floating point data +type based on 32 bit unums (posits). These have the advantage over native floats +of more precision in the lower ranges but at the cost of a software +implementation. + +The \prm {positdef} primitive is the floating point variant of \prm {integerdef} +and \prm {dimensiondef}: an efficient way to implement named quantities other +than registers. + +\startbuffer +\positdef \MyFloatA 5.678 +\positdef \MyFloatB 567.8 +[\the\MyFloatA] [\todimension\MyFloatA] [\tointeger\MyFloatA] +[\the\MyFloatB] [\todimension\MyFloatB] [\tointeger\MyFloatB] +\stopbuffer + +\typebuffer + +For practical reasons we can map posit (or float) onto an integer or dimension: + +\startlines +\getbuffer +\stoplines + +% {\em I might eventually decide to go for 32 bit floats but it all depends on how +% unums evolve cq. become native to \CCODE.} + +\stopnewprimitive + +\startoldprimitive[title={\prm {postdisplaypenalty}}] + +This is the penalty injected after a display formula. + +\stopoldprimitive + +\startnewprimitive[title={\prm {postexhyphenchar}}] + +This primitive expects a language number and a character code. A negative +character code is equivalent to ignore. In case of an explicit discretionary the +character is injected at the beginning of a new line. \stopnewprimitive -\startnewprimitive[title={\prm {gtokspre}}] +\startnewprimitive[title={\prm {posthyphenchar}}] -This is the global variant of \prm {tokspre}. +This primitive expects a language number and a character code. A negative +character code is equivalent to ignore. In case of an automatic discretionary the +character is injected at the beginning of a new line. \stopnewprimitive -\startnewprimitive[title={\prm {xtokspre}}] +\startnewprimitive[title={\prm {postinlinepenalty}}] -This is the global variant of \prm {etokspre}. +When set this penalty is inserted after an inline formula unless we have a short +formula and \prm {postshortinlinepenalty} is set. \stopnewprimitive -\startoldprimitive[title={\prm {csname}}] +\startnewprimitive[title={\prm {postshortinlinepenalty}}] -This original \TEX\ primitive starts the construction of a control sequence -reference. It does a lookup and when no sequence with than name is found, it will -create a hash entry and defaults its meaning to \prm {relax}. +When set this penalty is inserted after a short inline formula. The criterium is +set by \prm {shortinlinemaththreshold} but only applied when it is enabled for +the class involved. -\starttyping -\csname letters and other characters\endcsname -\stoptyping +\stopnewprimitive + +\startnewprimitive[title={\prm {prebinoppenalty}}] + +This internal quantity is a compatibility feature because normally we will use +the inter atom spacing variables. + +\stopnewprimitive + +\startoldprimitive[title={\prm {predisplaydirection}}] + +This is the direction that the math sub engine will take into account when +dealing with right to left typesetting. \stopoldprimitive -\startoldprimitive[title={\prm {endcsname}}] +\startnewprimitive[title={\prm {predisplaygapfactor}}] -This primitive is used in combination with \prm {csname}, \prm {ifcsname} and -\prm {begincsname} where its end the scanning for the to be constructed control -sequence token. +The heuristics related to determine if the previous line in a formula overlaps +with a (display) formula are hard coded but in \LUATEX\ to be two times the quad +of the current font. This parameter is a multiplier set to 2000 and permits you +to change the overshoot in this heuristic. + +\stopnewprimitive + +\startoldprimitive[title={\prm {predisplaypenalty}}] + +This is the penalty injected before a display formula. \stopoldprimitive -\startnewprimitive[title={\prm {begincsname}}] +\startoldprimitive[title={\prm {predisplaysize}}] -The next code creates a control sequence token from the given serialized tokens: +This parameter holds the length of the last line in a paragraph when a display +formula is part of it. -\starttyping -\csname mymacro\endcsname -\stoptyping +\stopoldprimitive -When \type {\mymacro} is not defined a control sequence will be created with the -meaning \prm {relax}. A side effect is that a test for its existence might fail -because it now exists. The next sequence will {\em not} create an controil -sequence: +\startnewprimitive[title={\prm {preexhyphenchar}}] -\starttyping -\begincsname mymacro\endcsname -\stoptyping +This primitive expects a language number and a character code. A negative +character code is equivalent to ignore. In case of an explicit discretionary the +character is injected at the end of the line. -This actually is kind of equivalent to: +\stopnewprimitive -\starttyping -\ifcsname mymacro\endcsname - \csname mymacro\endcsname -\fi -\stoptyping +\startnewprimitive[title={\prm {prehyphenchar}}] + +This primitive expects a language number and a character code. A negative +character code is equivalent to ignore. In case of an automatic discretionary the +character is injected at the end of the line. \stopnewprimitive -\startnewprimitive[title={\prm {lastnamedcs}}] +\startnewprimitive[title={\prm {preinlinepenalty}}] -The example code in the previous section has some redundancy, in the sense that -there to be looked up control sequence name \type {mymacro} is assembled twice. -This is no big deal in a traditional eight bit \TEX\ but in a \UNICODE\ engine -multi|-|byte sequences demand some more processing (although it is unlikely that -control sequences have many multi|-|byte \UTF8\ characters). +When set this penalty is inserted before an inline formula unless we have a short +formula and \prm {preshortinlinepenalty} is set. -\starttyping -\ifcsname mymacro\endcsname - \csname mymacro\endcsname -\fi -\stoptyping +\stopnewprimitive -Instead we can say: +\startnewprimitive[title={\prm {prerelpenalty}}] -\starttyping -\ifcsname mymacro\endcsname - \lastnamedcs -\fi -\stoptyping +This internal quantity is a compatibility feature because normally we will use +the inter atom spacing variables. -Although there can be some performance benefits another advantage is that it uses -less tokens and parsing. It might even look nicer. +\stopnewprimitive + +\startnewprimitive[title={\prm {preshortinlinepenalty}}] + +When set this penalty is inserted before a short inline formula. The criterium is +set by \prm {shortinlinemaththreshold} but only applied when it is enabled for +the class involved. \stopnewprimitive -\startnewprimitive[title={\prm {futureexpand}}] +\startoldprimitive[title={\prm {pretolerance}}] -This primitive can be used as an alternative to a \prm {futurelet} approach, -which is where the name comes from. \footnote {In the engine primitives -that have similar behavior are grouped in commands that are then dealt with -together, code wise.} +When the badness of a line in a paragraph exceeds this value a second linebreak +pass will be enabled. -\startbuffer -\def\variantone<#1>{(#1)} -\def\varianttwo#1{[#1]} -\futureexpand<\variantone\varianttwo -\futureexpand<\variantone\varianttwo{two} -\stopbuffer +\stopoldprimitive -\typebuffer +\startoldprimitive[title={\prm {prevdepth}}] -So, the next token determines which of the two variants is taken: +The depth of current list. It can also be set to special (signal) values in order +to inhibit line corrections. It is not an internal dimension but a (current) list +property. -{\getbuffer} +\stopoldprimitive -Because we look ahead there is some magic involved: spaces are ignored but when -we have no match they are pushed back into the input. The next variant -demonstrates this: +\startoldprimitive[title={\prm {prevgraf}}] + +The number of lines in a previous paragraph. + +\stopoldprimitive + +\startnewprimitive[title={\prm {previousloopiterator}}] \startbuffer -\def\variantone<#1>{(#1)} -\def\varianttwo{} -\def\temp{\futureexpand<\variantone\varianttwo} -[\temp ] -[\temp {two}] -[\expandafter\temp\space ] -[\expandafter\temp\space {two}] +\edef\testA{ + \expandedrepeat 2 {% + \expandedrepeat 3 {% + (\the\previousloopiterator1:\the\currentloopiterator) + }% + }% +} +\edef\testB{ + \expandedrepeat 2 {% + \expandedrepeat 3 {% + (#P:#I) % #G is two levels up + }% + }% +} \stopbuffer -\typebuffer +\typebuffer \getbuffer -This gives us: +These give the same result: -{\getbuffer} +\startlines \tt +\meaningasis\testA +\meaningasis\testB +\stoplines + +The number indicates the number of levels we go up the loop chain. \stopnewprimitive -\startnewprimitive[title={\prm {futureexpandis}}] +\startnewprimitive[title={\prm {primescript}}] -We assume that the previous section is read. This variant will not push back -spaces, which permits a consistent approach i.e.\ the user can assume that macro -always gobbles the spaces. +This is a math script primitive dedicated to primes (which are somewhat +troublesome on math). It complements the six script primitives (like \prm +{subscript} and \prm {presuperscript}). + +\stopnewprimitive + +\startoldprimitive[title={\prm {protected}}] + +A protected macro is one that doesn't get expanded unless it is time to do so. +For instance, inside an \prm {edef} it just stays what it is. It often makes +sense to pass macros as|-|is to (multi|-|pass) file (for tables of contents). + +In \CONTEXT\ we use either \prm {protected} or \prm {unexpanded} because the +later was the command we used to achieve the same results before \ETEX\ +introduced this protection primitive. Originally the \prm {protected} macro was +also defined but it has been dropped. + +\stopoldprimitive + +\startnewprimitive[title={\prm {protecteddetokenize}}] + +This is a variant of \prm {protecteddetokenize} that uses some escapes encoded as +body parameters, like \type {#H} for a hash. + +\stopnewprimitive + +\startnewprimitive[title={\prm {protectedexpandeddetokenize}}] + +This is a variant of \prm {expandeddetokenize} that uses some escapes encoded as +body parameters, like \type {#H} for a hash. + +\stopnewprimitive + +\startnewprimitive[title={\prm {protrudechars}}] + +This variable controls protrusion (into the margin). A value~2 is comparable with +other engines, while a value of~3 does a bit more checking when we're doing +right|-|to|-|left typesetting. + +\stopnewprimitive + +\startnewprimitive[title={\prm {protrusionboundary}}] + +This injects a boundary with the given value: + +\getbuffer[engine:syntax:protrusionboundarycodes] + +This signal makes the protrusion checker skip over a node. + +\stopnewprimitive + +\startnewprimitive[title={\prm {pxdimen}}] + +The current numeric value of this dimension is \tointeger \pxdimen, \todimension +\pxdimen: one \type {bp}. We kept it around because it was introduced in \PDFTEX\ +and made it into \LUATEX, where it relates to the resolution of included images. +In \CONTEXT\ it is not used. + +\stopnewprimitive + +\startnewprimitive[title={\prm {quitloop}}] + +There are several loop primitives and they can be quit with \prm {quitloop} at +the next the {\em next} iteration. An immediate quit is possible with \prm +{quitloopnow}. An example is given with \prm {localcontrolledloop}. + +\stopnewprimitive + +\startnewprimitive[title={\prm {quitloopnow}}] + +There are several loop primitives and they can be quit with \prm {quitloopnow} +at the spot. + +\stopnewprimitive + +\startnewprimitive[title={\prm {quitvmode}}] + +This primitive forces horizontal mode but has no side effects when we're already +in that mode. + +\stopnewprimitive + +\startoldprimitive[title={\prm {radical}}][obsolete=yes] + +This old school radical constructor is replaced by \prm {Uradical}. It takes a +number where the first byte is the small family, the next two index of this +symbol from that family, and the next three the family and index of the first +larger variant. + +\stopoldprimitive + +\startoldprimitive[title={\prm {raise}}] + +This primitive takes two arguments, a dimension and a box. The box is moved up. +The operation only succeeds in horizontal mode. + +\stopoldprimitive + +\startnewprimitive[title={\prm {rdivide}}] + +This is variant of \prm {divide} that rounds the result. For integers the result +is the same as \prm {edivide}. \startbuffer -\def\variantone<#1>{(#1)} -\def\varianttwo{} -\def\temp{\futureexpandis<\variantone\varianttwo} -[\temp ] -[\temp {two}] -[\expandafter\temp\space ] -[\expandafter\temp\space {two}] +\the\dimexpr .4999pt : 2 \relax =.24994pt +\the\dimexpr .4999pt / 2 \relax =.24995pt +\scratchdimen.4999pt \divide \scratchdimen 2 \the\scratchdimen =.24994pt +\scratchdimen.4999pt \edivide\scratchdimen 2 \the\scratchdimen =.24995pt +\scratchdimen 4999pt \rdivide\scratchdimen 2 \the\scratchdimen =2500.0pt +\scratchdimen 5000pt \rdivide\scratchdimen 2 \the\scratchdimen =2500.0pt + +\the\numexpr 1001 : 2 \relax =500 +\the\numexpr 1001 / 2 \relax =501 +\scratchcounter1001 \divide \scratchcounter 2 \the\scratchcounter=500 +\scratchcounter1001 \edivide\scratchcounter 2 \the\scratchcounter=501 +\scratchcounter1001 \rdivide\scratchcounter 2 \the\scratchcounter=501 \stopbuffer \typebuffer -So, here no spaces are pushed back. This \type {is} in the name of this primitive -means \quote {ignore spaces}, but having that added to the name would have made -the primitive even more verbose (after all, we also don't have \type -{\expandeddef} but \prm {edef} and no \type {\globalexpandeddef} but \prm -{xdef}. +\startlines +\getbuffer +\stoplines -{\getbuffer} +\stopnewprimitive + +\startnewprimitive[title={\prm {rdivideby}}] + +This is the \type {by}|-|less companion to \prm {rdivide}. \stopnewprimitive -\startnewprimitive[title={\prm {futureexpandisap}}] +\startnewprimitive[title={\prm {realign}}] -This primitive is like the one in the previous section but also ignores par -tokens, so \type {isap} means \quote {ignore spaces and paragraphs}. +Where \prm {omit} suspends a preamble template, this one overloads is for the +current table cell. It expects two token lists as arguments. \stopnewprimitive -\startoldprimitive[title={\prm {expandafter}}] +\startoldprimitive[title={\prm {relax}}] -This original \TEX\ primitive stores the next token, does a one level expansion -of what follows it, which actually can be an not expandable token, and -reinjects the stored token in the input. Like: +This primitive does nothing and is often used to end a verbose number or +dimension in a comparison, for example: \starttyping -\expandafter\let\csname my weird macro name\endcsname{m w m n} +\ifnum \scratchcounter = 123\relax \stoptyping -Without \prm {expandafter} the \prm {csname} primitive would have been let to -the left brace (effectively then a begin group). Actually in this particular case -the control sequence with the weird name is injected and when it didn't yet exist -it will get the meaning \prm {relax} so we sort of have two assignments in a -row then. +which prevents a lookahead. A variant would be: + +\starttyping +\ifnum \scratchcounter = 123 % +\stoptyping + +assuming that spaces are not ignored. Another application is finishing +an expression like \prm {numexpr} or \prm {dimexpr}. I is also used +to prevent lookahead in cases like: + +\starttyping +\vrule height 3pt depth 2pt width 5pt\relax +\hskip 5pt plus 3pt minus 2pt\relax +\stoptyping + +Because \prm {relax} is not expandable the following: + +\startbuffer +\edef\foo{\relax} \meaningfull\foo +\edef\oof{\norelax} \meaningfull\oof +\stopbuffer + +\typebuffer + +gives this: + +\startlines +\getbuffer +\stoplines + +A \prm {norelax} disappears here but in the previously mentioned scenarios +it has the same function as \prm {relax}. It will not be pushed back either +in cases where a lookahead demands that. \stopoldprimitive -\startnewprimitive[title={\prm {expandafterspaces}}] +\startoldprimitive[title={\prm {relpenalty}}] -This is a gobbler: the next token is reinjected after following spaces have been -read. Here is a simple example: +This internal quantity is a compatibility feature because normally we will use +the inter atom spacing variables. + +\stopoldprimitive + +\startnewprimitive[title={\prm {resetmathspacing}}] + +This initializes all parameters to their initial values. + +\stopnewprimitive + +\startnewprimitive[title={\prm {restorecatcodetable}}] + +This is an experimental feature that should be used with care. The next example +shows usage. It was added when debugging and exploring a side effect. + +\starttyping +\tracingonline1 + +\bgroup + + \catcode`6 = 11 \catcode`7 = 11 + + \bgroup + + \tracingonline1 + + current: \the\catcodetable + + original: \the\catcode`6\quad \the\catcode`7 + + \catcode`6 = 11 \catcode`7 = 11 + + \showcodestack\catcode + + assigned: \the\catcode`6\quad \the\catcode`7 + + \showcodestack\catcode + + \catcodetable\ctxcatcodes switched: \the\catcodetable + + stored: \the\catcode`6\quad \the\catcode`7 + + \showcodestack\catcode + + \restorecatcodetable\ctxcatcodes + + \showcodestack\catcode + + restored: \the\catcode`6\quad \the\catcode`7 -\startbuffer -[\expandafterspaces 1 2] -[\expandafterspaces 3 -4] -[\expandafterspaces 5 + \showcodestack\catcode -6] -\stopbuffer + \egroup -\typebuffer + \catcodetable\ctxcatcodes -We get this typeset: \inlinebuffer, because a newline normally is configured to be -a space (and leading spaces in a line are normally being ingored anyway). + inner: \the\catcode`6\quad\the\catcode`7 -\stopnewprimitive +\egroup -\startnewprimitive[title={\prm {expandafterpars}}] +outer: \the\catcode`6\quad\the\catcode`7 +\stoptyping -Here is another gobbler: the next token is reinjected after following spaces -and par tokens have been read. So: +In \CONTEXT\ this typesets: -\startbuffer -[\expandafterpars 1 2] -[\expandafterpars 3 -4] -[\expandafterpars 5 +\starttyping +current: 9 +original: 11 11 +assigned: 11 11 +switched: 9 +stored: 11 11 +restored: 12 12 +inner: 11 11 +outer; 12 12 +\stoptyping -6] -\stopbuffer +and on the console we see: -\typebuffer +\starttyping +3:3: [codestack 1, size 3] +3:3: [1: level 2, code 54, value 12] +3:3: [2: level 2, code 55, value 12] +3:3: [3: level 3, code 54, value 11] +3:3: [4: level 3, code 55, value 11] +3:3: [codestack 1 bottom] +3:3: [codestack 1, size 3] +3:3: [1: level 2, code 54, value 12] +3:3: [2: level 2, code 55, value 12] +3:3: [3: level 3, code 54, value 11] +3:3: [4: level 3, code 55, value 11] +3:3: [codestack 1 bottom] +3:3: [codestack 1, size 3] +3:3: [1: level 2, code 54, value 12] +3:3: [2: level 2, code 55, value 12] +3:3: [3: level 3, code 54, value 11] +3:3: [4: level 3, code 55, value 11] +3:3: [codestack 1 bottom] +3:3: [codestack 1, size 7] +3:3: [1: level 2, code 54, value 12] +3:3: [2: level 2, code 55, value 12] +3:3: [3: level 3, code 54, value 11] +3:3: [4: level 3, code 55, value 11] +3:3: [5: level 3, code 55, value 11] +3:3: [6: level 3, code 54, value 11] +3:3: [7: level 3, code 55, value 11] +3:3: [8: level 3, code 54, value 11] +3:3: [codestack 1 bottom] +3:3: [codestack 1, size 7] +3:3: [1: level 2, code 54, value 12] +3:3: [2: level 2, code 55, value 12] +3:3: [3: level 3, code 54, value 11] +3:3: [4: level 3, code 55, value 11] +3:3: [5: level 3, code 55, value 11] +3:3: [6: level 3, code 54, value 11] +3:3: [7: level 3, code 55, value 11] +3:3: [8: level 3, code 54, value 11] +3:3: [codestack 1 bottom] +\stoptyping -gives us: \inlinebuffer, because empty lines are like \prm {par} and therefore -ignored. +So basically \prm {restorecatcodetable} brings us (temporarily) back to the +global settings. \stopnewprimitive -\startnewprimitive[title={\prm {expandtoken}}] +\startnewprimitive[title={\prm {retained}}] -This primitive creates a token with a specific combination of catcode and -character code. Because it assumes some knowledge of \TEX\ we can show it -using some \prm {expandafter} magic: +When a value is assigned inside a group \TEX\ pushes the current value on the save +stack in order to be able to restore the original value after the group has ended. You +can reach over a group by using the \prm {global} prefix. A mix between local and +global assignments can be achieved with the \prm {retained} primitive. -\startbuffer -\expandafter\let\expandafter\temp\expandtoken 11 `X \meaning\temp -\expandafter\let\expandafter\temp\expandtoken 12 `X \meaning\temp +\newdimension\MyDim + +\startbuffer[one] +\MyDim 15pt \bgroup \the\MyDim \space +\bgroup + \bgroup + \bgroup \advance\MyDim10pt \the\MyDim \egroup\space + \bgroup \advance\MyDim10pt \the\MyDim \egroup\space + \egroup + \bgroup + \bgroup \advance\MyDim10pt \the\MyDim \egroup\space + \bgroup \advance\MyDim10pt \the\MyDim \egroup\space + \egroup +\egroup +\egroup \the\MyDim \stopbuffer -\typebuffer +\startbuffer[two] +\MyDim 15pt \bgroup \the\MyDim \space +\bgroup + \bgroup + \bgroup \global\advance\MyDim10pt \the\MyDim \egroup\space + \bgroup \global\advance\MyDim10pt \the\MyDim \egroup\space + \egroup + \bgroup + \bgroup \global\advance\MyDim10pt \the\MyDim \egroup\space + \bgroup \global\advance\MyDim10pt \the\MyDim \egroup\space + \egroup +\egroup +\egroup \the\MyDim +\stopbuffer -The meanings are: +\startbuffer[three] +\MyDim 15pt \bgroup \the\MyDim \space + \constrained\MyDim\zeropoint + \bgroup + \bgroup \retained\advance\MyDim10pt \the\MyDim \egroup\space + \bgroup \retained\advance\MyDim10pt \the\MyDim \egroup\space + \egroup + \bgroup + \bgroup \retained\advance\MyDim10pt \the\MyDim \egroup\space + \bgroup \retained\advance\MyDim10pt \the\MyDim \egroup\space + \egroup +\egroup \the\MyDim +\stopbuffer -\startlines \tttf \getbuffer \stoplines +\typebuffer[one,two,three] -Using other catcodes is possible but the results of injecting them into the input -directly (or here by injecting \type {\temp}) can be unexpected because of what -\TEX\ expects. You can get messages you normally won't get, for instance about -unexpected alignment interference, which is a side effect of \TEX\ using some -catcode|/|character combinations as signals and there is no reason to change -those internals. That said: +These lines result in: -\startbuffer -\edef\tempA{\expandtoken 9 `X} \meaning\tempA -\edef\tempB{\expandtoken 10 `X} \meaning\tempB -\edef\tempC{\expandtoken 11 `X} \meaning\tempC -\edef\tempD{\expandtoken 12 `X} \meaning\tempD -\stopbuffer +\startlines +\hbox{\getbuffer[one]} +\hbox{\getbuffer[two]} +\hbox{\getbuffer[three]} +\stoplines -\typebuffer +Because \LUAMETATEX\ avoids redundant stack entries and reassignments this +mechanism is a bit fragile but the \prm {constrained} prefix makes sure that we +do have a stack entry. If it is needed depends on the usage pattern. -are all valid and from the meaning you cannot really deduce what's in there: +\stopnewprimitive -\startlines \tttf \getbuffer \stoplines +\startnewprimitive[title={\prm {retokenized}}] -But you can be assured that: +This is a companion of \prm {tokenized} that accepts a catcode table, so the +whole repertoire is: \startbuffer -[AB: \ifx\tempA\tempB Y\else N\fi] -[AC: \ifx\tempA\tempC Y\else N\fi] -[AD: \ifx\tempA\tempD Y\else N\fi] -[BC: \ifx\tempB\tempC Y\else N\fi] -[BD: \ifx\tempB\tempD Y\else N\fi] -[CD: \ifx\tempC\tempD Y\else N\fi] +\tokenized {test $x$ test: current} +\tokenized catcodetable \ctxcatcodes {test $x$ test: context} +\tokenized catcodetable \vrbcatcodes {test $x$ test: verbatim} +\retokenized \ctxcatcodes {test $x$ test: context} +\retokenized \vrbcatcodes {test $x$ test: verbatim} \stopbuffer \typebuffer -makes clear that they're different: \inlinebuffer, and in case you wonder, the -characters with catcode 10 are spaces, while those with code 9 are ignored. +Here we pass the numbers known to \CONTEXT\ and get: + +\startlines +\getbuffer +\stoplines \stopnewprimitive -\startnewprimitive[title={\prm {expandcstoken}}] +\startoldprimitive[title={\prm {right}}] -The rationale behind this primitive is that when we \prm {let} a single token -like a character it is hard to compare that with something similar, stored in a -macro. This primitive pushes back a single token alias created by \prm {let} -into the input. +Inserts the given delimiter as right fence in a math formula. -\startbuffer -\let\tempA + \meaning\tempA +\stopoldprimitive -\let\tempB X \meaning\tempB \crlf -\let\tempC $ \meaning\tempC \par +\startoldprimitive[title={\prm {righthyphenmin}}] -\edef\temp {\tempA} \doifelse{\temp}{+}{Y}{N} \meaning\temp \crlf -\edef\temp {\tempB} \doifelse{\temp}{X}{Y}{N} \meaning\temp \crlf -\edef\temp {\tempC} \doifelse{\temp}{X}{Y}{N} \meaning\temp \par +This is the minimum number of characters before the first hyphen in a hyphenated +word. -\edef\temp{\expandcstoken\tempA} \doifelse{\temp}{+}{Y}{N} \meaning\temp \crlf -\edef\temp{\expandcstoken\tempB} \doifelse{\temp}{X}{Y}{N} \meaning\temp \crlf -\edef\temp{\expandcstoken\tempC} \doifelse{\temp}{$}{Y}{N} \meaning\temp \par +\stopoldprimitive -\doifelse{\expandcstoken\tempA}{+}{Y}{N} -\doifelse{\expandcstoken\tempB}{X}{Y}{N} -\doifelse{\expandcstoken\tempC}{$}{Y}{N} \par -\stopbuffer +\startnewprimitive[title={\prm {rightmarginkern}}] -\typebuffer +The dimension returned is the protrusion kern that has been added (if at all) to +the left of the content in the given box. -The meaning of the \prm {let} macros shows that we have a shortcut to a -character with (in this case) catcode letter, other (here \quote {other -character} gets abbreviated to \quote {character}), math shift etc. +\stopnewprimitive -\start \tttf \getbuffer \stop +\startoldprimitive[title={\prm {rightskip}}] -Here we use the \CONTEXT\ macro \type {\doifelse} which can be implemented in -different ways, but the only property relevant to the user is that the expanded -content of the two arguments is compared. +This skip will be inserted at the right of every line. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {expand}}] +\startoldprimitive[title={\prm {romannumeral}}] -Normally a protected macro will not be expanded inside for instance an \prm -{edef} but there is a way out: \footnote {This primitive is dedicated to Hans vd -Meer who was playing with the unprotected version of \type {\doifelse} and -wondered about the reason for it not being expandable in the first place.} +This converts a number into a sequence of characters representing a roman +numeral. Because the Romans had no zero, a zero will give no output, a fact that +is sometimes used for hacks and showing off ones macro coding capabilities. A +large number will for sure result in a long string because after thousand we +start duplicating. -\startbuffer -\edef\temp {\doifelse{a}{b}{c}{d}} \meaning\temp \crlf -\edef\temp{\expand\doifelse{a}{b}{c}{d}} \meaning\temp \par -\stopbuffer +\stopoldprimitive -\typebuffer +\startnewprimitive[title={\prm {rpcode}}] -In the second case, the \type {\doifelse} command {\em is} expanded, but keep in mind -that this only makes sense when the body of such a macro is expandable. This is the -case in \CONTEXT\ \LMTX, but not in \MKIV. +This is the companion of \prm {lpcode} (see there) and also takes three +arguments: font, character code and factor. -{\getbuffer} +\stopnewprimitive + +\startnewprimitive[title={\prm {savecatcodetable}}] + +This primitive stores the currently set catcodes in the current table. \stopnewprimitive -\startoldprimitive[title={\prm {ignorespaces}}] +\startoldprimitive[title={\prm {savinghyphcodes}}] -This traditional \TEX\ primitive signals the scanner to ignore the following -spaces, if any. We mention it because we show a companion in the next section. +When set to non|-|zero, this will trigger the setting of \prm {hjcode}s from \prm +{lccode}s for the current font. These codes determine what characters are taken +into account when hyphenating words. \stopoldprimitive -\startnewprimitive[title={\prm {ignorepars}}] +\startoldprimitive[title={\prm {savingvdiscards}}] -This is a variant of \prm {ignorespaces}: following spaces {\em and} \type -{\par} equivalent tokens are ignored, so for instance: +When set to a positive value the page builder will store the discarded items +(like glues) so that they can later be retrieved and pushed back if needed with +\prm {pagediscards} or \prm {splitdiscards}. -\startbuffer -one + \ignorepars +\stopoldprimitive -two = \ignorepars \par -three -\stopbuffer +\startnewprimitive[title={\prm {scaledemwidth}}] -\typebuffer +Returns the current (font specific) emwidth scaled according to \prm {glyphscale} +and \prm {glyphxscale}. -renders as: \inlinebuffer. Traditionally \TEX\ has been sensitive to \prm {par} -tokens in some of its building blocks. This has to do with the fact that it could -indicate a runaway argument which in the times of slower machines and terminals -was best to catch early. In \LUAMETATEX\ we no longer have long macros and the -mechanisms that are sensitive can be told to accept \prm {par} tokens (and -\CONTEXT\ set them such that this is the case). +\stopnewprimitive + +\startnewprimitive[title={\prm {scaledexheight}}] + +Returns the current (font specific) exheight scaled according to \prm {glyphscale} +and \prm {glyphyscale}. \stopnewprimitive -\startnewprimitive[title={\prm {ignorearguments}}] +\startnewprimitive[title={\prm {scaledextraspace}}] -This primitive will quit argument scanning and start expansion of the body of a -macro. The number of grabbed arguments can be tested as follows: +Returns the current (font specific) extra space value scaled according to \prm +{glyphscale} and \prm {glyphxscale}. -\startbuffer -\def\MyMacro[#1][#2][#3]% - {\ifarguments zero\or one\or two\or three \else hm\fi} +\stopnewprimitive -\MyMacro \ignorearguments \quad -\MyMacro [1]\ignorearguments \quad -\MyMacro [1][2]\ignorearguments \quad -\MyMacro [1][2][3]\ignorearguments \par -\stopbuffer +\startnewprimitive[title={\prm {scaledfontcharba}}] -\typebuffer +Returns the bottom accent position of the given font|-|character pair scaled +according to \prm {glyphscale} and \prm {glyphyscale}. -{\getbuffer} +\stopnewprimitive -{\em Todo: explain optional delimiters.} +\startnewprimitive[title={\prm {scaledfontchardp}}] + +Returns the depth of the given font|-|character pair scaled according to \prm +{glyphscale} and \prm {glyphyscale}. \stopnewprimitive -\startnewprimitive[title={\prm {lastarguments}}] +\startnewprimitive[title={\prm {scaledfontcharht}}] -\startbuffer -\def\MyMacro #1{\the\lastarguments (#1) } \MyMacro{1} \crlf -\def\MyMacro #1#2{\the\lastarguments (#1) (#2)} \MyMacro{1}{2} \crlf -\def\MyMacro#1#2#3{\the\lastarguments (#1) (#2) (#3)} \MyMacro{1}{2}{3} \par +Returns the height of the given font|-|character pair scaled according to \prm +{glyphscale} and \prm {glyphyscale}. -\def\MyMacro #1{(#1) \the\lastarguments} \MyMacro{1} \crlf -\def\MyMacro #1#2{(#1) (#2) \the\lastarguments} \MyMacro{1}{2} \crlf -\def\MyMacro#1#2#3{(#1) (#2) (#3) \the\lastarguments} \MyMacro{1}{2}{3} \par -\stopbuffer +\stopnewprimitive -\typebuffer +\startnewprimitive[title={\prm {scaledfontcharic}}] -The value of \prm {lastarguments} can only be trusted in the expansion until -another macro is seen and expanded. For instance in these examples, as soon as a -character (like the left parenthesis) is seen, horizontal mode is entered and -\prm {everypar} is expanded which in turn can involve macros. You can see that -in the second block (that is: unless we changed \prm {everypar} in the -meantime). +Returns the italic correction of the given font|-|character pair scaled according +to \prm {glyphscale} and \prm {glyphxscale}. This property is only real for +traditional fonts. -{\getbuffer} +\stopnewprimitive + +\startnewprimitive[title={\prm {scaledfontcharta}}] + +Returns the top accent position of the given font|-|character pair scaled +according to \prm {glyphscale} and \prm {glyphxscale}. \stopnewprimitive -\startoldprimitive[title={\prm {scantokens}}] +\startnewprimitive[title={\prm {scaledfontcharwd}}] -Just forget about this \ETEX\ primnitive, just take the one in the next section. +Returns width of the given font|-|character pair scaled according to \prm +{glyphscale} and \prm {glyphxscale}. -\stopoldprimitive +\stopnewprimitive -\startnewprimitive[title={\prm {scantextokens}}] +\startnewprimitive[title={\prm {scaledfontdimen}}] -This primitive scans the input as if it comes from a file. In the next examples -the \prm {detokenize} primitive turns tokenized code into verbatim code that is -similar to what is read from a file. +Returns value of a (numeric) font dimension of the given font|-|character pair +scaled according to \prm {glyphscale} and \prm {glyphxscale} and|/|or \prm +{glyphyscale}. -\startbuffer -\edef\whatever{\detokenize{This is {\bf bold} and this is not.}} -\detokenize {This is {\bf bold} and this is not.}\crlf -\scantextokens{This is {\bf bold} and this is not.}\crlf -\scantextokens{\whatever}\crlf -\scantextokens\expandafter{\whatever}\par -\stopbuffer +\stopnewprimitive -\typebuffer +\startnewprimitive[title={\prm {scaledinterwordshrink}}] -This primitive does not have the end|-|of|-|file side effects of its precursor -\prm {scantokens}. +Returns the current (font specific) shrink of a space value scaled according to +\prm {glyphscale} and \prm {glyphxscale}. -{\getbuffer} +\stopnewprimitive + +\startnewprimitive[title={\prm {scaledinterwordspace}}] + +Returns the current (font specific) space value scaled according to \prm +{glyphscale} and \prm {glyphxscale}. \stopnewprimitive -\startoldprimitive[title={\prm {number}}] +\startnewprimitive[title={\prm {scaledinterwordstretch}}] -This \TEX\ primitive serializes the next token into a number, assuming that it -is indeed a number, like +Returns the current (font specific) stretch of a space value scaled according to +\prm {glyphscale} and \prm {glyphxscale}. -\starttyping -\number`A -\number65 -\number\scratchcounter -\stoptyping +\stopnewprimitive -For counters and such the \prm {the} primitive does the same, but when you're -not sure if what follows is a verbose number or (for instance) a counter the -\prm {number} primitive is a safer bet, because \type {\the 65} will not work. +\startnewprimitive[title={\prm {scaledmathaxis}}] -\stopoldprimitive +This primitive returns the math axis of the given math style. It's a dimension. -\startnewprimitive[title={\prm {tointeger}}] +\stopnewprimitive -\startbuffer -\scratchcounter = 1234 \tointeger\scratchcounter -\stopbuffer +\startnewprimitive[title={\prm {scaledmathemwidth}}] -The following code gives this: {\nospacing\inlinebuffer} and is equivalent to -\prm {number}. +Returns the emwidth of the given style scaled according to \prm {glyphscale} and +\prm {glyphxscale}. -\typebuffer +\stopnewprimitive + +\startnewprimitive[title={\prm {scaledmathexheight}}] + +Returns the exheight of the given style scaled according to \prm {glyphscale} and +\prm {glyphyscale}. \stopnewprimitive -\startnewprimitive[title={\prm {tohexadecimal}}] +\startnewprimitive[title={\prm {scaledmathstyle}}] + +This command inserts a signal in the math list that tells how to scale the (upcoming) +part of the formula. \startbuffer -\scratchcounter = 1234 \tohexadecimal\scratchcounter +$ x + {\scaledmathstyle900 x} + x$ \stopbuffer -The following code gives this: {\nospacing\inlinebuffer} with uppercase letters. - \typebuffer +We get: \inlinebuffer. Of course using this properly demands integration in the macro +packages font system. + \stopnewprimitive -\startnewprimitive[title={\prm {todimension}}] +\startnewprimitive[title={\prm {scaledslantperpoint}}] + +This primitive is equivalent to \typ {\scaledfontdimen1\font} where \quote +{scaled} means that we multiply by the glyph scales. + +\stopnewprimitive + +\startnewprimitive[title={\prm {scantextokens}}] + +This primitive scans the input as if it comes from a file. In the next examples +the \prm {detokenize} primitive turns tokenized code into verbatim code that is +similar to what is read from a file. \startbuffer -\scratchdimen = 1234pt \todimension\scratchdimen +\edef\whatever{\detokenize{This is {\bf bold} and this is not.}} +\detokenize {This is {\bf bold} and this is not.}\crlf +\scantextokens{This is {\bf bold} and this is not.}\crlf +\scantextokens{\whatever}\crlf +\scantextokens\expandafter{\whatever}\par \stopbuffer -The following code gives this: {\nospacing\inlinebuffer} and like its numeric -counterparts accepts anything that resembles a number this one goes beyond -(user, internal or pseudo) registers values too. - \typebuffer +This primitive does not have the end|-|of|-|file side effects of its precursor +\prm {scantokens}. + +{\getbuffer} + \stopnewprimitive -\startnewprimitive[title={\prm {toscaled}}] +\startoldprimitive[title={\prm {scantokens}}] -\startbuffer -\scratchdimen = 1234pt \toscaled\scratchdimen -\stopbuffer +Just forget about this \ETEX\ primitive, just take the one in the next section. + +\stopoldprimitive -The following code gives this: {\nospacing\inlinebuffer} is similar to \prm -{todimension} but omits the \type {pt} so that we don't need to revert to some -nasty stripping code. +\startoldprimitive[title={\prm {scriptfont}}] -\typebuffer +This primitive is like \prm {font} but with a family number as (first) argument +so it is specific for math. It is the middle one of the three family members; its +relatives are \prm {textfont} and \prm {scriptscriptfont}. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {tosparsedimension}}] +\startoldprimitive[title={\prm {scriptscriptfont}}] -\startbuffer -\scratchdimen = 1234pt \tosparsedimension\scratchdimen -\stopbuffer +This primitive is like \prm {font} but with a family number as (first) argument +so it is specific for math. It is the smallest of the three family members; its +relatives are \prm {textfont} and \prm {scriptfont}. -The following code gives this: {\nospacing\inlinebuffer} where \quote {sparse} -indicates that redundant trailing zeros are not shown. +\stopoldprimitive -\typebuffer +\startoldprimitive[title={\prm {scriptscriptstyle}}] -\stopnewprimitive +One of the main math styles, normally one size smaller than \prm {scriptstyle}: +integer representation: \the\scriptscriptstyle. -\startnewprimitive[title={\prm {tosparsescaled}}] +\stopoldprimitive -\startbuffer -\scratchdimen = 1234pt \tosparsescaled\scratchdimen -\stopbuffer +\startoldprimitive[title={\prm {scriptspace}}][obsolete=yes] -The following code gives this: {\nospacing\inlinebuffer} where \quote {sparse} -means that redundant trailing zeros are omitted. +The math engine will add this amount of space after subscripts and superscripts. +It can be seen as compensation for the often too small widths of characters (in +the traditional engine italic correction is used too). It prevents scripts from +running into what follows. -\typebuffer +\stopoldprimitive -\stopnewprimitive +\startnewprimitive[title={\prm {scriptspaceafterfactor}}] -\startoldprimitive[title={\prm {numericscale}}] +This is a (1000 based) multiplier for \prm {Umathspaceafterscript}. -This primitive can best be explained by a few examples: +\stopnewprimitive -\startbuffer -\the\numericscale 1323 -\the\numericscale 1323.0 -\the\numericscale 1.323 -\the\numericscale 13.23 -\stopbuffer +\startnewprimitive[title={\prm {scriptspacebeforefactor}}] -\typebuffer +This is a (1000 based) multiplier for \prm {Umathspacebeforescript}. -In several places \TEX\ uses a scale but due to the lack of floats it then uses -1000 as 1.0 replacement. This primitive can be used for \quote {real} scales and -the period signals this: +\stopnewprimitive -\startlines \getbuffer \stoplines +\startnewprimitive[title={\prm {scriptspacebetweenfactor}}] -When there is a period (indicating the fraction) the result is an integer (count) -that has the multiplier 1000 applied. +This is a (1000 based) multiplier for \prm {Umathspacebetweenscript}. \stopnewprimitive -\startoldprimitive[title={\prm {string}}] +\startoldprimitive[title={\prm {scriptstyle}}] -We mention this original primitive because of the one in the next section. It -expands the next token or control sequence as if it was just entered, so normally -a control sequence becomes a backslash followed by characters and a space. +One of the main math styles, normally one size smaller than \prm {displaystyle} +and \prm {textstyle}; integer representation: \the\scriptstyle. \stopoldprimitive -\startnewprimitive[title={\prm {csstring}}] +\startoldprimitive[title={\prm {scrollmode}}] -This primitive returns the name of the control sequence given without the leading -escape character (normally a backslash). Of course you could strip that character -with a simple helper but this is more natural. + This directive omits error stops. -\startbuffer -\csstring\mymacro -\stopbuffer +\stopoldprimitive -\typebuffer +\startnewprimitive[title={\prm {semiexpand}}] -We get the name, not the meaning: {\tt \inlinebuffer}. +This command expands the next macro when it is protected with \prm +{semprotected}. See that primitive there for an example. \stopnewprimitive -\startoldprimitive[title={\prm {unexpanded}}] +\startnewprimitive[title={\prm {semiexpanded}}] -This is an \ETEX\ enhancement. The content will not be expanded in a context -where expansion is happening, like in an \prm {edef}. In \CONTEXT\ you need to -use \type {\normalunexpanded} because we already had a macro with that name. +This command expands the tokens in the given list including the macros protected +by with \prm {semprotected}. See that primitive there for an example. + +\stopnewprimitive + +\startnewprimitive[title={\prm {semiprotected}}] \startbuffer -\def \A{!} \meaning\A -\def \B{?} \meaning\B -\edef\C{\A\B} \meaning\C -\edef\C{\normalunexpanded{\A}\B} \meaning\C -\stopbuffer + \def\TestA{A} +\semiprotected\def\TestB{B} + \protected\def\TestC{C} -\typebuffer +\edef\TestD{\TestA \TestB \TestC} +\edef\TestE{\TestA\semiexpand\TestB\semiexpand\TestC} +\edef\TestF{\TestA\expand \TestB\expand \TestC} -\startlines \tttf \getbuffer \stoplines +\edef\TestG{\normalexpanded {\TestA\TestB\TestC}} +\edef\TestH{\normalsemiexpanded{\TestA\TestB\TestC}} +\stopbuffer -\stopoldprimitive +The working of this prefix can best be explained with an example. We define a few +macros first: -\startoldprimitive[title={\prm {detokenize}}] +\typebuffer \getbuffer -This \ETEX\ primitive turns the content of the provides list will become -characters, kind of verbatim. +The meaning of the macros that are made from the other three are: \startbuffer -\expandafter\let\expandafter\temp\detokenize{1} \meaning\temp -\expandafter\let\expandafter\temp\detokenize{A} \meaning\temp +\meaningless\TestD +\meaningless\TestE +\meaningless\TestF +\meaningless\TestG +\meaningless\TestH \stopbuffer -\typebuffer +Here we use the \type {\normal..} variants because (currently) we still have the +macro with the \type {\expanded} in the \CONTEXT\ core. \startlines \tttf \getbuffer \stoplines -\stopoldprimitive - -\startnewprimitive[title={\prm {tokenized}}] +\stopnewprimitive -Just as \prm {expanded} has a counterpart \prm {unexpanded}, it makes sense to give -\prm {detokenize} a companion: +\startoldprimitive[title={\prm {setbox}}] -\startbuffer -\edef\foo{\detokenize{\inframed{foo}}} -\edef\oof{\detokenize{\inframed{oof}}} +This important primitive is used to set a box register. It expects a number and a +box, like \prm {hbox} or \prm {box}. There is no \type {\boxdef} primitive +(analogue to other registers) because it makes no sense but numeric registers or +equivalents are okay as register value. -\meaning\foo \crlf \dontleavehmode\foo +\stopoldprimitive -\edef\foo{\tokenized{\foo\foo}} +\startnewprimitive[title={\prm {setdefaultmathcodes}}] -\meaning\foo \crlf \dontleavehmode\foo +This sets the math codes of upper- and lowercase alphabet and digits and the +delimiter code of the period. It's not so much a useful feature but more just an +accessor to the internal initializer. -\dontleavehmode\tokenized{\foo\oof} -\stopbuffer +\stopnewprimitive -\typebuffer {\tttf \getbuffer} +\startnewprimitive[title={\prm {setfontid}}] -This primitive is similar to: +Internally a font instance has a number and this number is what gets assigned to +a glyph node. You can get the number with \prm {fontid} an set it with \prm +{setfontid}. \starttyping -\def\tokenized#1{\scantextokens\expandafter{\normalexpanded{#1}}} +\setfontid\fontid\font \stoptyping -and should be more efficient, not that it matters much as we don't use it that -much (if at all). +The code above shows both primitives and effectively does nothing useful but +shows the idea. \stopnewprimitive -\startnewprimitive[title={\prm {expanded}}] - -This primitive complements the two expansion related primitives mentioned in the -previous two sections. This time the content will be expanded and then pushed -back into the input. Protected macros will not be expanded, so you can use this -primitive to expand the arguments in a call. In \CONTEXT\ you need to use \type -{\normalexpanded} because we already had a macro with that name. We give some -examples: - -\startbuffer -\def\A{!} - \def\B#1{\string#1} \B{\A} \crlf - \def\B#1{\string#1} \normalexpanded{\noexpand\B{\A}} \crlf -\protected\def\B#1{\string#1} \B{\A} \par -\stopbuffer +\startoldprimitive[title={\prm {setlanguage}}] -\typebuffer {\getbuffer} +In \LUATEX\ and \LUAMETATEX\ this is equivalent to \prm {language} because we +carry the language in glyph nodes instead of putting triggers in the list. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {numexpression}}] +\startnewprimitive[title={\prm {setmathatomrule}}] -The normal \prm {numexpr} primitive understands the \type {+}, \type {-}, \type -{*} and \type {/} operators but in \LUAMETATEX\ we also can use \type {:} for a -non rounded integer division (think of \LUA's \type {//}). if you want more than -that, you can use the new expression primitive where you can use the following -operators. +The math engine has some built in logic with respect to neighboring atoms that +change the class. The following combinations are intercepted and remapped: -\starttabulate[||cT|cT|] -\BC add \NC + \NC \NC \NR -\BC subtract \NC - \NC \NC \NR -\BC multiply \NC * \NC \NC \NR -\BC divide \NC / : \NC \NC \NR -\BC mod \NC \letterpercent \NC mod \NC \NR -\BC band \NC & \NC band \NC \NR -\BC bxor \NC ^ \NC bxor \NC \NR -\BC bor \NC \letterbar \space v \NC bor \NC \NR -\BC and \NC && \NC and \NC \NR -\BC or \NC \letterbar\letterbar \NC or \NC \NR -\BC setbit \NC \NC bset \NC \NR -\BC resetbit \NC \NC breset \NC \NR -\BC left \NC << \NC \NC \NR -\BC right \NC >> \NC \NC \NR -\BC less \NC < \NC \NC \NR -\BC lessequal \NC <= \NC \NC \NR -\BC equal \NC = == \NC \NC \NR -\BC moreequal \NC >= \NC \NC \NR -\BC more \NC > \NC \NC \NR -\BC unequal \NC <> != \lettertilde = \NC \NC \NR -\BC not \NC ! \lettertilde \NC not \NC \NR +\starttabulate[|c|c|c|c|] +\BC old first \BC old second \NC new first \NC new second \NC \NR +\ML +\NC begin \NC binary \NC ordinary \NC ordinary \NC \NR +\NC \NC \NC \NC \NC \NR +\NC operator \NC binary \NC operator \NC ordinary \NC \NR +\NC open \NC binary \NC open \NC ordinary \NC \NR +\NC punctuation \NC binary \NC punctuation \NC ordinary \NC \NR +\NC \NC \NC \NC \NC \NR +\NC binary \NC end \NC ordinary \NC ordinary \NC \NR +\NC binary \NC binary \NC binary \NC ordinary \NC \NR +\NC binary \NC close \NC ordinary \NC close \NC \NR +\NC binary \NC punctuation \NC ordinary \NC punctuation \NC \NR +\NC binary \NC relation \NC ordinary \NC relation \NC \NR +\NC \NC \NC \NC \NC \NR +\NC relation \NC binary \NC relation \NC ordinary \NC \NR +\NC relation \NC close \NC ordinary \NC close \NC \NR +\NC relation \NC punctuation \NC ordinary \NC punctuation \NC \NR \stoptabulate -An example of the verbose bitwise operators is: +You can change this logic if needed, for instance: \starttyping -\scratchcounter = \numexpression - "00000 bor "00001 bor "00020 bor "00400 bor "08000 bor "F0000 -\relax +\setmathatomrule 1 2 \allmathstyles 1 1 \stoptyping -In the table you might have notices that some operators have equivalents. This -makes the scanner a bit less sensitive for catcode regimes. +Keep in mind that the defaults are what users expect. You might set them up for +additional classes that you define but even then you probably clone an existing +class and patch its properties. Most extra classes behave like ordinary anyway. -When \prm {tracingexpressions} is set to one or higher the intermediate \quote -{reverse polish notation} stack that is used for the calculation is shown, for -instance: +\stopnewprimitive -\starttyping -4:8: {numexpression rpn: 2 5 > 4 5 > and} -\stoptyping +\startnewprimitive[title={\prm {setmathdisplaypostpenalty}}] -When you want the output on your console, you need to say: +This penalty is inserted after an item of a given class but only in inline math +when display style is used, for instance: \starttyping -\tracingexpressions 1 -\tracingonline 1 +\setmathdisplayprepenalty 2 750 \stoptyping \stopnewprimitive -\startnewprimitive[title={\prm {dimexpression}}] - -This command is like \prm {numexpression} but results in a dimension instead of -an integer. Where \prm {dimexpr} doesn't like \typ {2 * 10pt} this expression -primitive is quite happy with it. - -\stopnewprimitive - -\startoldprimitive[title={\prm {if}}] +\startnewprimitive[title={\prm {setmathdisplayprepenalty}}] -This traditional \TEX\ conditional checks if two character codes are the same. In -order to understand unexpanded results it is good to know that internally \TEX\ -groups primitives in a way that serves the implementation. Each primitive has a -command code and a character code, but only for real characters the name -character code makes sense. This condition only really tests for character codes -when we have a character, in all other cases, the result is true. +This penalty is inserted before an item of a given class but only in inline math +when display style is used, for instance: -\startbuffer -\def\A{A}\def\B{B} \chardef\C=`C \chardef\D=`D \def\AA{AA} +\starttyping +\setmathdisplayprepenalty 2 750 +\stoptyping -[\if AA YES \else NOP \fi] [\if AB YES \else NOP \fi] -[\if \A\B YES \else NOP \fi] [\if \A\A YES \else NOP \fi] -[\if \C\D YES \else NOP \fi] [\if \C\C YES \else NOP \fi] -[\if \count\dimen YES \else NOP \fi] [\if \AA\A YES \else NOP \fi] +\stopnewprimitive -\stopbuffer +\startnewprimitive[title={\prm {setmathignore}}] -\typebuffer +You can flag a math parameter to be ignored, like: -The last example demonstrates that the tokens get expanded, which is why -we get the extra \type {A}: +\starttyping +\setmathignore \Umathxscale 2 +\setmathignore \Umathyscale 2 +\setmathignore \Umathspacebeforescript 1 +\setmathignore \Umathspacebetweenscript 1 +\setmathignore \Umathspaceafterscript 1 +\stoptyping -{\getbuffer} +A value of two will not initialize the variable, so its old value (when set) is +kept. This is somewhat experimental and more options might show up. -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {ifcat}}] +\startnewprimitive[title={\prm {setmathoptions}}] -Another traditional \TEX\ primitive: what happens with what gets read in depends -on the catcode of a character, think of characters marked to start math mode, or -alphabetic characters (letters) versus other characters (like punctuation). +This primitive expects a class (number) and a bitset. -\startbuffer -\def\A{A}\def\B{,} \chardef\C=`C \chardef\D=`, \def\AA{AA} +\testpage[2] -[\ifcat $! YES \else NOP \fi] [\ifcat () YES \else NOP \fi] -[\ifcat AA YES \else NOP \fi] [\ifcat AB YES \else NOP \fi] -[\ifcat \A\B YES \else NOP \fi] [\ifcat \A\A YES \else NOP \fi] -[\ifcat \C\D YES \else NOP \fi] [\ifcat \C\C YES \else NOP \fi] -[\ifcat \count\dimen YES \else NOP \fi] [\ifcat \AA\A YES \else NOP \fi] -\stopbuffer +\startcolumns +\getbuffer[engine:syntax:classoptioncodes] % weird: one liner at end of page +\stopcolumns -\typebuffer +\stopnewprimitive -Close reading is needed here: +\startnewprimitive[title={\prm {setmathpostpenalty}}] -{\getbuffer} +This penalty is inserted after an item of a given class but only in inline math +when text, script or scriptscript style is used, for instance: -This traditional \TEX\ condition as a well as the one in the previous section are -hardly used in \CONTEXT, if only because they expand what follows and we seldom -need to compare characters. +\starttyping +\setmathpostpenalty 2 250 +\stoptyping -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {ifnum}}] +\startnewprimitive[title={\prm {setmathprepenalty}}] -This is a frequently used conditional: it compares two numbers where a number is -anything that can be seen as such. +This penalty is inserted before an item of a given class but only in inline math +when text, script or scriptscript style is used, for instance: -\startbuffer -\scratchcounter=65 \chardef\A=65 +\starttyping +\setmathprepenalty 2 250 +\stoptyping -\ifnum65=`A YES \else NOP\fi -\ifnum\scratchcounter=65 YES \else NOP\fi -\ifnum\scratchcounter=\A YES \else NOP\fi -\stopbuffer +\stopnewprimitive -\typebuffer +\startnewprimitive[title={\prm {setmathspacing}}] -Unless a number is an unexpandable token it ends with a space or \prm {relax}, -so when you end up in the true branch, you'd better check if \TEX\ could -determine where the number ends. +More details about this feature can be found in \CONTEXT\ but it boils down to +registering what spacing gets inserted between a pair of classes. It can be +defined per style or for a set of styles, like: -{\getbuffer} +\starttyping +\inherited\setmathspacing + \mathimplicationcode \mathbinarycode + \alldisplaystyles \thickermuskip +\inherited\setmathspacing + \mathradicalcode \mathmiddlecode + \allunsplitstyles \pettymuskip +\stoptyping -% When comparing integers, definitions (for instance characters) that can be seen -% as such, or any converter that produces a number (like the \type {`} or \prm -% {number} the usual \type {=}, \type {<} or \type {>} can be used. However, in -% \LUAMETATEX\ you can negate such a comparison by \type {!}: \type {!=}, \type -% {!<} or \type {!>}. Successive \type {!} toggle the negation state. +Here the \prm {inherited} prefix signals that a change in for instance \prm +{pettymuskip} is reflected in this spacing pair. In \CONTEXT\ there is a lot of +granularity with respect to spacing and it took years of experimenting (and +playing with examples) to get at the current stage. In general users are not +invited to mess around too much with these values, although changing the bound +registers (here \prm {pettymuskip} and \type {thickermuskip}) is no problem as it +consistently makes related spacing pairs follow. -On top of these \ASCII\ combinations, the engine also accepts some \UNICODE\ -characters. This brings the full repertoire to: +\stopnewprimitive -\starttabulate[|l|cT|cT|l|] -\FL -\BC character \BC \BC \BC operation \NC \NR -\ML -\NC \type {0x003C} \NC $\Uchar"003C$ \NC \NC less \NC \NR -\NC \type {0x003D} \NC $\Uchar"003D$ \NC \NC equal \NC \NR -\NC \type {0x003E} \NC $\Uchar"003E$ \NC \NC more \NC \NR -\NC \type {0x2208} \NC $\Uchar"2208$ \NC \NC element of \NC \NR -\NC \type {0x2209} \NC $\Uchar"2209$ \NC \NC not element of \NC \NR -\NC \type {0x2260} \NC $\Uchar"2260$ \NC != \NC not equal \NC \NR -\NC \type {0x2264} \NC $\Uchar"2264$ \NC !> \NC less equal \NC \NR -\NC \type {0x2265} \NC $\Uchar"2265$ \NC !< \NC greater equal \NC \NR -\NC \type {0x2270} \NC $\Uchar"2270$ \NC \NC not less equal \NC \NR -\NC \type {0x2271} \NC $\Uchar"2271$ \NC \NC not greater equal \NC \NR -\LL -\stoptabulate +\startoldprimitive[title={\prm {sfcode}}] -This also applied to \prm {ifdim} although in the case of element we discard the -fractional part (read: divide the numeric representation by 65536). +You can set a space factor on a character. That factor is used when a space +factor is applied (as part of spacing). It is (mostly) used for adding a +different space (glue) after punctuation. In some languages different punctuation +has different factors. \stopoldprimitive -\startoldprimitive[title={\prm {ifdim}}] - -Dimensions can be compared with this traditional \TEX\ primitive. +\startnewprimitive[title={\prm {shapingpenaltiesmode}}] -\startbuffer -\scratchdimen=1pt \scratchcounter=65536 +Shaping penalties are inserted after the lines of a \prm {parshape} and +accumulate according to this mode, a bitset of: -\ifdim\scratchdimen=\scratchcounter sp YES \else NOP\fi -\ifdim\scratchdimen=1 pt YES \else NOP\fi -\stopbuffer +\getbuffer[engine:syntax:shapingpenaltiescodes] -\typebuffer +\stopnewprimitive -The units are mandate: +\startnewprimitive[title={\prm {shapingpenalty}}] -{\getbuffer} +In order to prevent a \prm {parshape} to break in unexpected ways we can add a +dedicated penalty, specified by this parameter. -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {ifodd}}] +\startnewprimitive[title={\prm {shiftedsubprescript}}] -One reason for this condition to be around is that in a double sided layout we -need test for being on an odd or even page. It scans for a number the same was -as other primitives, +This primitive (or \type {____}) puts a flag on the script but renders +the same: \startbuffer -\ifodd65 YES \else NO\fi & -\ifodd`B YES \else NO\fi . +$ + x \shiftedsuperprescript{2} \subprescript {2} + + x \superprescript {2} \shiftedsubprescript{2} + + x \superprescript {2} ____ {2} = + x \superprescript {2} \subprescript {2} +$ \stopbuffer \typebuffer -So: {\inlinebuffer} +Gives: \inlinebuffer. -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {ifvmode}}] +\startnewprimitive[title={\prm {shiftedsubscript}}] -This traditional conditional checks we are in (internal) vertical mode. +This primitive (or \type {__}) puts a flag on the script but renders +the same: -\stopoldprimitive +\startbuffer +$ + x \shiftedsuperscript{2} \subscript {2} + + x \superscript {2} \shiftedsubscript{2} + + x \superscript {2} __ {2} = + x \superscript {2} \subscript {2} +$ +\stopbuffer -\startoldprimitive[title={\prm {ifhmode}}] +\typebuffer -This traditional conditional checks we are in (restricted) horizontal mode. +Gives: \inlinebuffer. -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {ifmmode}}] +\startnewprimitive[title={\prm {shiftedsuperprescript}}] -This traditional conditional checks we are in (inline or display) math mode mode. +This primitive (or \type {^^^^}) puts a flag on the script but renders +the same: -\stopoldprimitive +\startbuffer +$ + x \shiftedsuperprescript{2} \subprescript {2} + + x ^^^^ {2} \subprescript {2} + + x \superprescript {2} \shiftedsubprescript{2} = + x \superprescript {2} \subprescript {2} +$ +\stopbuffer -\startoldprimitive[title={\prm {ifinner}}] +\typebuffer -This traditional one can be confusing. It is true when we are in restricted -horizontal mode (a box), internal vertical mode (a box), or inline math mode. +Gives: \inlinebuffer. -\startbuffer -test \ifhmode \ifinner INNER\fi HMODE\fi\crlf -\hbox{test \ifhmode \ifinner INNER \fi HMODE\fi} \par +\stopnewprimitive -\ifvmode \ifinner INNER\fi VMODE \fi\crlf -\vbox{\ifvmode \ifinner INNER \fi VMODE\fi} \crlf -\vbox{\ifinner INNER \ifvmode VMODE \fi \fi} \par +\startnewprimitive[title={\prm {shiftedsuperscript}}] + +This primitive (or \type {^^}) puts a flag on the script but renders +the same: + +\startbuffer +$ + x \shiftedsuperscript{2} \subscript {2} + + x ^^ {2} \subscript {2} + + x \superscript {2} \shiftedsubscript{2} = + x \superscript {2} \subscript {2} +$ \stopbuffer \typebuffer -Watch the last line: because we typeset \type {INNER} we enter horizontal mode: +Gives: \inlinebuffer. -{\getbuffer} +\stopnewprimitive + +\startoldprimitive[title={\prm {shipout}}][obsolete=yes] + +Because there is no backend, this is not supposed to be used. As in traditional +\TEX\ a box is grabbed but instead of it being processed it gets shown and then +wiped. There is no real benefit of turning it into a callback. \stopoldprimitive -\startoldprimitive[title={\prm {ifvoid}}] +\startnewprimitive[title={\prm {shortinlinemaththreshold}}] -This traditional conditional checks if a given box register or internal box -variable has any content. +This parameter determines when an inline formula is considered to be short. This +criterium is used for for \prm {preshortinlinepenalty} and \prm +{postshortinlinepenalty}. -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {ifhbox}}] +\startnewprimitive[title={\prm {shortinlineorphanpenalty}}] -This traditional conditional checks if a given box register or internal box -variable represents a horizontal box, +Short formulas at the end of a line are normally not followed by something other +than punctuation. This penalty will discourage a break before a short inline +formula. In practice one can set this penalty to e.g. a relatively low 200 to get +the desired effect. -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {ifvbox}}] +\startoldprimitive[title={\prm {show}}] -This traditional conditional checks if a given box register or internal box -variable represents a vertical box, +Prints to the console (and/or log) what the token after +it represents. \stopoldprimitive -\startoldprimitive[title={\prm {ifx}}] +\startoldprimitive[title={\prm {showbox}}] -We use this traditional \TEX\ conditional a lot in \CONTEXT. Contrary to \prm {if} -the two tokens that are compared are not expanded. This makes it possible to compare -the meaning of two macros. Depending on the need, these macros can have their content -expanded or not. A different number of parameters results in false. +The given box register is shown in the log and on te console (depending on \prm +{tracingonline}. How much is shown depends on \prm {showboxdepth} and \prm +{showboxbreadth}. In \LUAMETATEX\ we show more detailed information than in the +other engines; some specific information is provided via callbacks. -Control sequences are identical when they have the same command code and -character code. Because a \prm {let} macro is just a reference, both let macros -are the same and equal to \prm {relax}: +\stopoldprimitive -\starttyping -\let\one\relax \let\two\relax -\stoptyping +\startoldprimitive[title={\prm {showboxbreadth}}] -The same is true for other definitions that result in the same (primitive) or -meaning encoded in the character field (think of \prm {chardef}s and so). +This primitives determine how much of a box is shown when asked for or when +tracing demands it. \stopoldprimitive -\startoldprimitive[title={\prm {ifeof}}] +\startoldprimitive[title={\prm {showboxdepth}}] -This traditional conditional checks if current pointer into the the file bound to -the given index is past the end of file. The read and write channels are not -really used in \CONTEXT: in \MKII\ we only had one file for all multi|-|pass -data, and in \MKIV\ all file related stuff is dealt with in \LUATEX. +This primitives determine how deep tracing a box goes into the box. Some boxes, +like the ones that has the assembled page. \stopoldprimitive -\startoldprimitive[title={\prm {iftrue}}] +\startnewprimitive[title={\prm {showcodestack}}] -Here we have a traditional \TEX\ conditional that is always true (therefore the -same is true for any macro that is \prm {let} to this primitive). +This inspector is only useful for low level debugging and reports the current +state of for instance the current catcode table: \typ {\showcodestack \catcode}. +See \prm {restorecatcodes} for an example. + +\stopnewprimitive + +\startoldprimitive[title={\prm {showgroups}}] + +This primitive reports the group nesting. At this spot we have a not so +impressive nesting: + +\starttyping +2:3: simple group entered at line 9375: +1:3: semisimple group: \begingroup +0:3: bottomlevel +\stoptyping \stopoldprimitive -\startoldprimitive[title={\prm {iffalse}}] +\startoldprimitive[title={\prm {showifs}}] -Here we have a traditional \TEX\ conditional that is always false (therefore the -same is true for any macro that is \prm {let} to this primitive). +This primitive will show the conditional stack in the log file or on the console +(assuming \prm {tracingonline} being non|-|zero). The shown data is different +from other engines because we have more conditionals and also support a more flat +nesting model \stopoldprimitive -\startoldprimitive[title={\prm {ifcase}}] +\startoldprimitive[title={\prm {showlists}}] -This numeric \TEX\ conditional takes a counter (literal, register, shortcut to a -character, internal quantity) and goes to the branch that matches. +This shows the currently built list. -\startbuffer -\ifcase 3 zero\or one\or two\or three\or four\else five or more\fi -\stopbuffer +\stopoldprimitive -\typebuffer +\startoldprimitive[title={\prm {shownodedetails}}] -Indeed: \inlinebuffer\ equals three. In later sections we will see some -\LUAMETATEX\ primitives that behave like an \prm {ifcase}. +When set to a positive value more details will be shown of nodes when applicable. +Values larger than one will also report attributes. What gets shown depends on +related callbacks being set. \stopoldprimitive -\startoldprimitive[title={\prm {ifdefined}}] +\startoldprimitive[title={\prm {showstack}}] -In traditional \TEX\ checking for a macro to exist was a bit tricky and therefore -\ETEX\ introduced a convenient conditional. We can do this: +This tracer is only useful for low level debugging of macros, for instance when +you run out of save space or when you encounter a performance hit. \starttyping -\ifx\MyMacro\undefined ... \else ... \fi + test\scratchcounter0 \showstack + {test\scratchcounter1 \showstack} +{{test\scratchcounter1 \showstack}} \stoptyping -but that assumes that \type {\undefined} is indeed undefined. Another test often -seen was this: +reports \starttyping -\expandafter\ifx\csname MyMacro\endcsname\relax ... \else ... \fi +1:3: [savestack size 0] +1:3: [savestack bottom] + +2:3: [savestack size 2] +2:3: [1: restore, level 1, cs \scratchcounter=integer 1] +2:3: [0: boundary, group 'bottomlevel', boundary 0, attrlist 3600, line 0] +2:3: [savestack bottom] + +3:3: [savestack size 3] +3:3: [2: restore, level 1, cs \scratchcounter=integer 1] +3:3: [1: boundary, group 'simple', boundary 0, attrlist 3600, line 12] +3:3: [0: boundary, group 'bottomlevel', boundary 0, attrlist 3600, line 0] +3:3: [savestack bottom] \stoptyping -Instead of comparing with \type {\undefined} we need to check with \prm {relax} -because the control sequence is defined when not yet present and defaults to -\prm {relax}. This is not pretty. - -\stopoldprimitive +while -\startoldprimitive[title={\prm {ifcsname}}] +\starttyping + test\scratchcounter1 \showstack + {test\scratchcounter1 \showstack} +{{test\scratchcounter1 \showstack}} +\stoptyping -This is an \ETEX\ conditional that complements the one on the previous section: +shows this: \starttyping -\expandafter\ifx\csname MyMacro\endcsname\relax ... \else ... \fi - \ifcsname MyMacro\endcsname ... \else ... \fi -\stoptyping +1:3: [savestack size 0] +1:3: [savestack bottom] -Here the first one has the side effect of defining the macro and defaulting it to -\prm {relax}, while the second one doesn't do that. Juts think of checking a -few million different names: the first one will deplete the hash table and -probably string space too. +2:3: [savestack size 1] +2:3: [0: boundary, group 'bottomlevel', boundary 0, attrlist 3600, line 0] +2:3: [savestack bottom] -In \LUAMETATEX\ the construction stops when there is no letter or other character -seen (\TEX\ expands on the go so expandable macros are dealt with). Instead of an -error message, the match is simply false and all tokens till the \prm -{endcsname} are gobbled. +3:3: [savestack size 2] +3:3: [1: boundary, group 'simple', boundary 0, attrlist 3600, line 16] +3:3: [0: boundary, group 'bottomlevel', boundary 0, attrlist 3600, line 0] +3:3: [savestack bottom] +\stoptyping + +Because in the second example the value of \type {\scratchcounter} doesn't really +change inside the group there is no need for a restore entry on the stack. In +\LUAMETATEX\ there are checks for that so that we consume less stack space. We +also store some states (like the line number and current attribute list pointer) +in a stack boundary. \stopoldprimitive -\startoldprimitive[title={\prm {iffontchar}}] +\startoldprimitive[title={\prm {showthe}}] -This is an \ETEX\ conditional. It takes a font identifier and a character number. -In modern fonts simply checking could not be enough because complex font features -can swap in other ones and their index can be anything. Also, a font mechanism -can provide fallback fonts and characters, so don't rely on this one too much. It -just reports true when the font passed to the frontend has a slot filled. +Prints to the console (and/or log) the value of token after it. \stopoldprimitive -\startnewprimitive[title={\prm {ifincsname}}] - -This conditional is sort of obsolete and can be used to check if we're inside a -\prm {csname} or \prm {ifcsname} construction. It's not used in \CONTEXT. +\startoldprimitive[title={\prm {showtokens}}] -\stopnewprimitive +This command expects a (balanced) token list, like -\startnewprimitive[title={\prm {ifabsnum}}] +\starttyping +\showtokens{a few tokens} +\stoptyping -This test will negate negative numbers before comparison, as in: +Depending on what you want to see you need to expand: -\startbuffer -\def\TestA#1{\ifnum #1<100 too small\orelse\ifnum #1>200 too large\else okay\fi} -\def\TestB#1{\ifabsnum#1<100 too small\orelse\ifabsnum#1>200 too large\else okay\fi} +\starttyping +\showtokens\expandafter{\the\everypar} +\stoptyping -\TestA {10}\quad\TestA {150}\quad\TestA {210}\crlf -\TestB {10}\quad\TestB {150}\quad\TestB {210}\crlf -\TestB{-10}\quad\TestB{-150}\quad\TestB{-210}\par -\stopbuffer +which is equivalent to \typ {\showthe \everypar}. It is an \ETEX\ extension. -\typebuffer +\stopoldprimitive -Here we get the same result each time: +\startnewprimitive[title={\prm {singlelinepenalty}}] -{\getbuffer} +This is a penalty that gets injected before a paragraph that has only one line. +It is a one|-|shot parameter, so like \prm {looseness} it only applies to the +upcoming (or current) paragraph. \stopnewprimitive -\startnewprimitive[title={\prm {ifabsdim}}] +\startoldprimitive[title={\prm {skewchar}}][obsolete=yes] -This test will negate negative dimensions before comparison, as in: +This is an (imaginary) character that is used in math fonts. The kerning pair +between this character and the current one determines the top anchor of a +possible accent. In \OPENTYPE\ there is a dedicated character property for this +(but for some reason not for the bottom anchor). -\startbuffer -\def\TestA#1{\ifdim #1<2pt too small\orelse\ifdim #1>4pt too large\else okay\fi} -\def\TestB#1{\ifabsdim#1<2pt too small\orelse\ifabsdim#1>4pt too large\else okay\fi} +\stopoldprimitive -\TestA {1pt}\quad\TestA {3pt}\quad\TestA {5pt}\crlf -\TestB {1pt}\quad\TestB {3pt}\quad\TestB {5pt}\crlf -\TestB{-1pt}\quad\TestB{-3pt}\quad\TestB{-5pt}\par -\stopbuffer +\startoldprimitive[title={\prm {skip}}] -\typebuffer +This is the accessor for an indexed skip (glue) register. -So we get this: +\stopoldprimitive -{\getbuffer} +\startoldprimitive[title={\prm {skipdef}}] -\stopnewprimitive +This command associates a control sequence with a skip register (accessed by number). -\startnewprimitive[title={\prm {ifzerodim}}] +\stopoldprimitive -This tests for a dimen (dimension) being zero so we have: +\startnewprimitive[title={\prm {snapshotpar}}] + +There are many parameters involved in typesetting a paragraph. One complication +is that parameters set in the middle might have unpredictable consequences due to +grouping, think of: \starttyping -\ifdim=0pt -\ifzerodim -\ifcase +text text text text \par +text {text text } text \par \stoptyping -\stopnewprimitive +This makes in traditional \TEX\ because there is no state related to the current +paragraph. But in \LUATEX\ we have the initial so called par node that remembers +the direction as well as local boxes. In \LUAMETATEX\ we store way more when this +node is created. That means that later settings no longer replace the stored ones. -\startnewprimitive[title={\prm {ifzeronum}}] +The \prm {snapshotpar} takes a bitset that determine what stored parameters get +updated to the current values. -This tests for a number (integer) being zero so we have these variants now: +\startcolumns[n=3] +\getbuffer[engine:syntax:frozenparcodes] +\stopcolumns -\starttyping -\ifnum=0pt -\ifzeronum -\ifcase -\stoptyping +One such value covers multiple values, so for instance \type {skip} is good for +storing the current \prm {leftskip} and \prm {rightskip} values. More about this +feature can be found in the \CONTEXT\ documentation. + +The list of parameters that gets reset after a paragraph is longer than for +\PDFTEX\ and \LUAMETATEX: \prm {emergencyleftskip}, \prm {emergencyrightskip}, \prm +{hangafter}, \prm {hangindent}, \prm {interlinepenalties}, \prm +{localbrokenpenalty}, \prm {localinterlinepenalty}, \prm {localpretolerance}, +\prm {localtolerance}, \prm {looseness}, \prm {parshape} and \prm +{singlelinepenalty}. \stopnewprimitive -\startnewprimitive[title={\prm {ifchknum}}] +\startoldprimitive[title={\prm {spacefactor}}] -In \CONTEXT\ there are quite some cases where a variable can have a number or a -keyword indicating a symbolic name of a number or maybe even some special -treatment. Checking if a valid number is given is possible to some extend, but a -native checker makes much sense too. So here is one: +The space factor is a somewhat complex feature. When during scanning a character +is appended that has a \prm {sfcode} other than 1000, that value is saved. When +the time comes to insert a space triggered glue, and that factor is 2000 or more, +and when \prm {xspaceskip} is nonzero, that value is used and we're done. -\startbuffer -\ifchknum oeps\or okay\else error\fi\quad -\ifchknum 12 \or okay\else error\fi\quad -\ifchknum 12pt\or okay\else error\fi -\stopbuffer +If these criteria are not met, and \prm {spaceskip} is nonzero, that value is +used, otherwise the space value from the font is used. Now, it if the space factor +is larger than 2000 the extra space value from the font is added to the set value. +Next the engine is going to tweak the stretch and shrink if that value and in +\LUAMETATEX\ that can be done in different ways, depending on \prm {spacefactormode}, +\prm {spacefactorstretchlimit} and \prm {spacefactorshrinklimit}. -\typebuffer +First the stretch. When the set limit is 1000 or more and the saved space factor +is also 1000 or more, we multiply the stretch by the limit, otherwise the saved +space factor is used. -The result is as expected: +Shrink is done differently. When the shrink limit and space factor are both 1000 +or more, we will scale the shrink component by the limit, otherwise we multiply +by the saved space factor but here we have three variants, determined by the +value of \prm {spacefactormode}. -{\getbuffer} +In the first case, when the limit kicks in, a mode value~1 will multiply by limit +and divides by 1000. A value of~2 multiplies by 2000 and divides by the limit. +Other mode values multiply by 1000 and divide by the limit. When the limit is not +used, the same happens but with the saved space factor. -\stopnewprimitive +If this sounds complicated, here is what regular \TEX\ does: stretch is +multiplied by the factor and divided by 1000 while shrink is multiplied by 1000 +and divided by the saved factor. The (new) mode driven alternatives are the +result of extensive experiments done in the perspective of enhancing the +rendering of inline math as well as additional par builder passes. For sure +alternative strategies are possible and we can always add more modes. -\startnewprimitive[title={\prm {ifchkdim}}] +A better explanation of the default strategy around spaces can be found in (of +course) The \TEX book and \TEX\ by Topic. -A variant on the checker in the previous section is a dimension checker: +\stopoldprimitive -\startbuffer -\ifchkdim oeps\or okay\else error\fi\quad -\ifchkdim 12 \or okay\else error\fi\quad -\ifchkdim 12pt\or okay\else error\fi -\stopbuffer +\startnewprimitive[title={\prm {spacefactormode}}] -\typebuffer +Its setting determines the way the glue components (currently only shrink) adapts +itself to the current space factor (determined by by the character preceding a +space). -We get: +\stopnewprimitive -{\getbuffer} +\startnewprimitive[title={\prm {spacefactorshrinklimit}}] + +This limit is used when \prm {spacefactormode} is set. See \prm {spacefactor} for a +bit more explanation. \stopnewprimitive -\startnewprimitive[title={\prm {ifcmpnum}}] +\startnewprimitive[title={\prm {spacefactorstretchlimit}}] -This conditional compares two numbers and the resulting \prm {ifcase} reflects -their relation: +This limit is used when \prm {spacefactormode} is set. See \prm {spacefactor} for a +bit more explanation. -\startbuffer -[1 2 : \ifcmpnum 1 2 less\or equal\or more\fi]\quad -[1 1 : \ifcmpnum 1 1 less\or equal\or more\fi]\quad -[2 1 : \ifcmpnum 2 1 less\or equal\or more\fi] -\stopbuffer +\stopnewprimitive -\typebuffer +\startoldprimitive[title={\prm {spaceskip}}] -This gives: +Normally the glue inserted when a space is encountered is taken from the font but +this parameter can overrule that. -{\getbuffer} +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {span}}] -\startnewprimitive[title={\prm {ifcmpdim}}] +This primitive combined two upcoming cells into one. Often it is used in +combination with \prm {omit}. However, in the preamble it forces the next token +to be expanded, which means that nested \prm {tabskips} and align content markers +are seen. -This conditional compares two dimensions and the resulting \prm {ifcase} -reflects their relation: +\stopoldprimitive -\startbuffer -[1pt 2pt : \ifcmpdim 1pt 2pt less\or equal\or more\fi]\quad -[1pt 1pt : \ifcmpdim 1pt 1pt less\or equal\or more\fi]\quad -[2pt 1pt : \ifcmpdim 2pt 1pt less\or equal\or more\fi] -\stopbuffer +\startoldprimitive[title={\prm {splitbotmark}}][obsolete=yes] -\typebuffer +This is a reference to the last mark on the currently split off box, it gives +back tokens. -This gives: +\stopoldprimitive -{\getbuffer} +\startoldprimitive[title={\prm {splitbotmarks}}] -\stopnewprimitive +This is a reference to the last mark with the given id (a number) on the +currently split off box, it gives back tokens. -\startnewprimitive[title={\prm {ifnumval}}] +\stopoldprimitive -This conditional is a variant on \prm {ifchknum}. This time we get -some more detail about the value: +\startoldprimitive[title={\prm {splitdiscards}}] + +When a box is split off, items like glue are discarded. This internal register +keeps the that list so that it can be pushed back if needed. + +\stopoldprimitive + +\startoldprimitive[title={\prm {splitfirstmark}}][obsolete=yes] + +This is a reference to the first mark on the currently split off box, it gives +back tokens. + +\stopoldprimitive -\startbuffer -[-12 : \ifnumval -12\or negative\or zero\or positive\else error\fi]\quad -[0 : \ifnumval 0\or negative\or zero\or positive\else error\fi]\quad -[12 : \ifnumval 12\or negative\or zero\or positive\else error\fi]\quad -[oeps : \ifnumval oeps\or negative\or zero\or positive\else error\fi] -\stopbuffer +\startoldprimitive[title={\prm {splitfirstmarks}}] -\typebuffer +This is a reference to the first mark with the given id (a number) on the +currently split off box, it gives back tokens. -This gives: +\stopoldprimitive -{\getbuffer} +\startoldprimitive[title={\prm {splitmaxdepth}}] -\stopnewprimitive +The depth of the box that results from a \prm {vsplit}. -\startnewprimitive[title={\prm {ifdimval}}] +\stopoldprimitive -This conditional is a variant on \prm {ifchkdim} and provides some more -detailed information about the value: +\startoldprimitive[title={\prm {splittopskip}}] -\startbuffer -[-12pt : \ifdimval-12pt\or negative\or zero\or positive\else error\fi]\quad -[0pt : \ifdimval 0pt\or negative\or zero\or positive\else error\fi]\quad -[12pt : \ifdimval 12pt\or negative\or zero\or positive\else error\fi]\quad -[oeps : \ifdimval oeps\or negative\or zero\or positive\else error\fi] -\stopbuffer +This is the amount of glue that is added to the top of a (new) split of part of a +box when \prm {vsplit} is applied. -\typebuffer +\stopoldprimitive -This gives: +\startnewprimitive[title={\prm {srule}}] -{\getbuffer} +This inserts a rule with no width. When a \type {font} and a \type {char} are +given the height and depth of that character are taken. Instead of a font \type +{fam} is also accepted so that we can use it in math mode. \stopnewprimitive -\startnewprimitive[title={\prm {iftok}}] +\startoldprimitive[title={\prm {string}}] -When you want to compare two arguments, the usual way to do this is the -following: +We mention this original primitive because of the one in the next section. It +expands the next token or control sequence as if it was just entered, so normally +a control sequence becomes a backslash followed by characters and a space. -\starttyping -\edef\tempA{#1} -\edef\tempb{#2} -\ifx\tempA\tempB - the same -\else - different -\fi -\stoptyping +\stopoldprimitive -This works quite well but the fact that we need to define two macros can be -considered a bit of a nuisance. It also makes macros that use this method to be -not so called \quote {fully expandable}. The next one avoids both issues: +\startnewprimitive[title={\prm {subprescript}}] -\starttyping -\iftok{#1}{#2} - the same -\else - different -\fi -\stoptyping +Instead of three or four characters with catcode \the\subscriptcatcode\ (\type +{__} or \type {____}) this primitive can be used. It will add the following +argument as lower left script to the nucleus. -Instead of direct list you can also pass registers, so given: +\stopnewprimitive -\startbuffer[a] -\scratchtoks{a}% -\toks0{a}% -\stopbuffer +\startnewprimitive[title={\prm {subscript}}] -\typebuffer[a] +Instead of one or two characters with catcode \the\superscriptcatcode\ (\type {_} +or \type {__}) this primitive can be used. It will add the following argument as +upper left script to the nucleus. -This: +\stopnewprimitive -\startbuffer[b] -\iftok 0 \scratchtoks Y\else N\fi\space -\iftok{a}\scratchtoks Y\else N\fi\space -\iftok\scratchtoks\scratchtoks Y\else N\fi -\stopbuffer +\startnewprimitive[title={\prm {superprescript}}] -\typebuffer[b] +Instead of three or four characters with catcode \the\superscriptcatcode\ (\type +{^^^} or \type {^^^^}) this primitive can be used. It will add the following +argument as upper left script to the nucleus. -{\getbuffer[a]gives: \inlinebuffer[b].} +\stopnewprimitive + +\startnewprimitive[title={\prm {superscript}}] + +Instead of one or two character with catcode \the\superscriptcatcode\ (\type {^} +or \type {^^})this primitive can be used. It will add the following argument as +upper right script to the nucleus. \stopnewprimitive -\startnewprimitive[title={\prm {ifcstok}}] +\startnewprimitive[title={\prm {supmarkmode}}] -A variant on the primitive mentioned in the previous section is one that -operates on lists and macros: +As in other languages, \TEX\ has ways to escape characters and get whatever +character needed into the input. By default multiple \type {^} are used for this. +The dual \type {^^} variant is a bit weird as it is not continuous but \type +{^^^^} and \type {^^^^^^} provide four or six byte hexadecimal references ot +characters. The single \type {^} is also used for superscripts but because we +support prescripts and indices we get into conflicts with the escapes. -\startbuffer[a] -\def\a{a} \def\b{b} \def\c{a} +When this internal quantity is set to zero, multiple \type {^}'s are interpreted +in the input and produce characters. Other values disable the multiple parsing in +text and|/|or math mode: + +\startbuffer +\normalsupmarkmode0 $ X^58 \quad X^^58 $ ^^58 +\normalsupmarkmode1 $ X^58 \quad X^^58 $ ^^58 +\normalsupmarkmode2 $ X^58 \quad X^^58 $ % ^^58 : error \stopbuffer -\typebuffer[a] +\typebuffer -\startbuffer[b] -\ifcstok\a\b Y\else N\fi\space -\ifcstok\a\c Y\else N\fi\space -\ifcstok{\a}\c Y\else N\fi\space -\ifcstok{a}\c Y\else N\fi -\stopbuffer +In \CONTEXT\ we default to one but also have the \prm {catcode} set to \the +\catcode`^ and the \prm {amcode} to \the \amcode `^. -This: +\startlines +\catcode`^=\superscriptcatcode % to make sure we handle it in math +\amcode `^=\superscriptcatcode +\getbuffer +\stoplines -\typebuffer[b] +\stopnewprimitive -{\getbuffer[a]will give us: \inlinebuffer[b].} +\startnewprimitive[title={\prm {swapcsvalues}}] + +Because we mention some \type {def} and \type {let} primitives here, it makes +sense to also mention a primitive that will swap two values (meanings). This one +has to be used with care. Of course that what gets swapped has to be of the same +type (or at least similar enough not to cause issues). Registers for instance +store their values in the token, but as soon as we are dealing with token lists +we also need to keep an eye on reference counting. So, to some extend this is +an experimental feature. \stopnewprimitive -\startnewprimitive[title={\prm {ifcondition}}] +\startnewprimitive[title={\prm {tabsize}}] -The conditionals in \TEX\ are hard coded as primitives and although it might -look like \type {\newif} creates one, it actually just defined three macros. +This primitive can be used in the preamble of an alignment and sets the size of +a column, as in: \startbuffer -\newif\ifMyTest -\meaning\MyTesttrue \crlf -\meaning\MyTestfalse \crlf -\meaning\ifMyTest \crlf \MyTesttrue -\meaning\ifMyTest \par +\halign{% + \aligncontent \aligntab + \aligncontent\tabsize 3cm \aligntab + \aligncontent \aligntab + \aligncontent\tabsize 0cm \cr + 1 \aligntab 111\aligntab 1111\aligntab 11\cr + 222\aligntab 2 \aligntab 2222\aligntab 22\cr +} \stopbuffer -\typebuffer {\tttf \getbuffer} - -This means that when you say: +\typebuffer -\starttyping -\ifMytest ... \else ... \fi -\stoptyping +As with \prm {tabskip} you need to reset the value explicitly, so that is why we +get two wide columns: -You actually have one of: +\blank {\showboxes \getbuffer} \blank -\starttyping -\iftrue ... \else ... \fi -\iffalse ... \else ... \fi -\stoptyping +\stopnewprimitive -and because these are proper conditions nesting them like: +\startoldprimitive[title={\prm {tabskip}}] -\starttyping -\ifnum\scratchcounter > 0 \ifMyTest A\else B\fi \fi -\stoptyping +This traditional primitive can be used in the preamble of an alignment and sets the +space added between columns, for example: -will work out well too. This is not true for macros, so for instance: +\startbuffer +\halign{% + \aligncontent \aligntab + \aligncontent\tabskip 3cm \aligntab + \aligncontent \aligntab + \aligncontent\tabskip 0cm \cr + 1 \aligntab 111\aligntab 1111\aligntab 11\cr + 222\aligntab 2 \aligntab 2222\aligntab 22\cr +} +\stopbuffer -\starttyping -\scratchcounter = 1 -\unexpanded\def\ifMyTest{\iftrue} -\ifnum\scratchcounter > 0 \ifMyTest A\else B\fi \fi -\stoptyping +\typebuffer -will make a run fail with an error (or simply loop forever, depending on your -code). This is where \prm {ifcondition} enters the picture: +You need to reset the skip explicitly, which is why we get it applied twice here: -\starttyping -\def\MyTest{\iftrue} \scratchcounter0 -\ifnum\scratchcounter > 0 - \ifcondition\MyTest A\else B\fi -\else - x -\fi -\stoptyping +\blank {\showboxes \getbuffer} \blank -This primitive is seen as a proper condition when \TEX\ is in \quotation {fast -skipping unused branches} mode but when it is expanding a branch, it checks if -the next expanded token is a proper tests and if so, it deals with that test, -otherwise it fails. The main condition here is that the \type {\MyTest} macro -expands to a proper true or false test, so, a definition like: +\stopoldprimitive -\starttyping -\def\MyTest{\ifnum\scratchcounter<10 } -\stoptyping +\startnewprimitive[title={\prm {textdirection}}] -is also okay. Now, is that neat or not? +This set the text direction to \type {l2r} (0) or \type {r2l} (1). It also +triggers additional checking for balanced flipping in node lists. \stopnewprimitive -\startnewprimitive[title={\prm {iffrozen}}] - -This conditional checks if a control sequence is frozen: +\startoldprimitive[title={\prm {textfont}}] -\starttyping -is \iffrozen\MyMacro \else not \fi frozen -\stoptyping +This primitive is like \prm {font} but with a family number as (first) argument +so it is specific for math. It is the largest one of the three family members; its +relatives are \prm {scriptfont} and \prm {scriptscriptfont}. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {ifprotected}}] +\startoldprimitive[title={\prm {textstyle}}] -This conditional checks if a control sequence is protected: +One of the main math styles; integer representation: \the\textstyle. -\starttyping -is \ifprotected\MyMacro \else not \fi protected -\stoptyping +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {the}}] -\startnewprimitive[title={\prm {ifusercmd}}] +The \prm {the} primitive serializes the following token, when applicable: +integers, dimensions, token registers, special quantities, etc. The catcodes of +the result will be according to the current settings, so in \type {\the \dimen0}, +the \type {pt} will have catcode \quote {letter} and the number and period will +become \quote {other}. -This conditional checks if a control sequence is not one of the primitives: +\stopoldprimitive -\starttyping -is \ifusercmd\MyMacro \else not \fi a primitive -\stoptyping +\startnewprimitive[title={\prm {thewithoutunit}}] -It is not always possible to determine this but it should work okay for regular -macros, register allocations and character definitions. +The \prm{the} primitive, when applied to a dimension variable, adds a \type {pt} +unit. because dimensions are the only traditional unit with a fractional part +they are sometimes used as pseudo floats in which case \prm {thewithoutunit} can +be used to avoid the unit. This is more convenient than stripping it off +afterwards (via an expandable macro). \stopnewprimitive -\startnewprimitive[title={\prm {ifrelax}}] - -This is a convenient shortcut for \typ {\ifx\relax} and the motivation for adding -this one is (as with some others) to get less tracing. +\startoldprimitive[title={\prm {thickmuskip}}] -\stopnewprimitive +A predefined mu skip register that can be used in math (inter atom) spacing. The +current value is {\tt \the\thickmuskip}. In traditional \TEX\ most inter atom +spacing is hard coded using the predefined registers. -\startnewprimitive[title={\prm {ifempty}}] +\stopoldprimitive -This conditional checks if a control sequence is empty: +\startoldprimitive[title={\prm {thinmuskip}}] -\starttyping -is \ifempty\MyMacro \else not \fi empty -\stoptyping +A predefined mu skip register that can be used in math (inter atom) spacing. The +current value is {\tt \the\thinmuskip}. In traditional \TEX\ most inter atom +spacing is hard coded using the predefined registers. -It is basically a shortcut of: +\stopoldprimitive -\starttyping -is \ifx\MyMacro\empty \else not \fi empty -\stoptyping +\startoldprimitive[title={\prm {time}}] -with: +This internal number starts out with minute (starting at midnight) that the job +started. -\starttyping -\def\empty{} -\stoptyping +\stopoldprimitive -Of course this is not empty at all: +\startnewprimitive[title={\prm {tinymuskip}}] -\starttyping -\def\notempty#1{} -\stoptyping +A predefined mu skip register that can be used in math (inter atom) spacing. The +current value is {\tt \the\tinymuskip}. This one complements \prm {thinmuskip}, +\prm {medmuskip}, \prm {thickmuskip} and the new \prm {pettymuskip} \stopnewprimitive -\startnewprimitive[title={\prm {ifboolean}}] +\startnewprimitive[title={\prm {tocharacter}}] -This tests a number (register or equivalent) and any nonzero value represents -\type {true}, which is nicer than using an \type {\unless \ifcase}. +The given number is converted into an \UTF-8 sequence. In \LUATEX\ this one is +named \type {\Uchar}. \stopnewprimitive -\startnewprimitive[title={\prm {ifmathparameter}}] +\startnewprimitive[title={\prm {todimension}}] -This is an \prm {ifcase} where the value depends on if the given math parameter -is zero, (\type {0}), set (\type {1}), or unset (\type {2}). +\startbuffer +\scratchdimen = 1234pt \todimension\scratchdimen +\stopbuffer -\starttyping -\ifmathparameter\Umathpunctclosespacing\displaystyle - zero \or - nonzero \or - unset \fi -\stoptyping +The following code gives this: {\nospacing\inlinebuffer} and like its numeric +counterparts accepts anything that resembles a number this one goes beyond +(user, internal or pseudo) registers values too. + +\typebuffer \stopnewprimitive -\startnewprimitive[title={\prm {ifmathstyle}}] +\startnewprimitive[title={\prm {tohexadecimal}}] -This is a variant of \prm {ifcase} were the number is one of the seven possible -styles: display, text, cramped text, script, cramped script, script script, -cramped script script. +\startbuffer +\scratchcounter = 1234 \tohexadecimal\scratchcounter +\stopbuffer -\starttyping -\ifmathstyle - display -\or - text -\or - cramped text -\else - normally smaller than text -\fi -\stoptyping +The following code gives this: {\nospacing\inlinebuffer} with uppercase letters. -\stopnewprimitive +\typebuffer -\startnewprimitive[title={\prm {ifarguments}}] +\stopnewprimitive -This is a variant of \prm {ifcase} were the selector is the number of arguments -picked up. For example: +\startnewprimitive[title={\prm {tointeger}}] \startbuffer -\def\MyMacro#1#2#3{\ifarguments\0\or1\or2\or3\else ?\fi} \MyMacro{A}{B}{C} -\def\MyMacro#1#0#3{\ifarguments\0\or1\or2\or3\else ?\fi} \MyMacro{A}{B}{C} -\def\MyMacro#1#-#2{\ifarguments\0\or1\or2\or3\else ?\fi} \MyMacro{A}{B}{C}\par +\scratchcounter = 1234 \tointeger\scratchcounter \stopbuffer +The following code gives this: {\nospacing\inlinebuffer} and is equivalent to +\prm {number}. + \typebuffer -Watch the non counted, ignored, argument in the last case. Normally this test will -be used in combination with \prm {ignorearguments}. +\stopnewprimitive -{\getbuffer} +\startnewprimitive[title={\prm {tokenized}}] + +Just as \prm {expanded} has a counterpart \prm {unexpanded}, it makes sense to give +\prm {detokenize} a companion: -\stopnewprimitive +\startbuffer +\edef\foo{\detokenize{\inframed{foo}}} +\edef\oof{\detokenize{\inframed{oof}}} -\startnewprimitive[title={\prm {ifhastok}}] +\meaning\foo \crlf \dontleavehmode\foo -This conditional looks for occurrences in token lists where each argument has to -be a proper list. +\edef\foo{\tokenized{\foo\foo}} -\startbuffer -\def\scratchtoks{x} +\meaning\foo \crlf \dontleavehmode\foo -\ifhastoks{yz} {xyz} Y\else N\fi\quad -\ifhastoks\scratchtoks {xyz} Y\else N\fi +\dontleavehmode\tokenized{\foo\oof} \stopbuffer -\typebuffer +\typebuffer {\tttf \getbuffer} -We get: +This primitive is similar to: -{\getbuffer} +\starttyping +\def\tokenized#1{\scantextokens\expandafter{\normalexpanded{#1}}} +\stoptyping + +and should be more efficient, not that it matters much as we don't use it that +much (if at all). \stopnewprimitive -\startnewprimitive[title={\prm {ifhastoks}}] +\startoldprimitive[title={\prm {toks}}] -This test compares two token lists. When a macro is passed it's meaning -gets used. +This is the accessor of a token register so it expects a number or \prm +{toksdef}'d macro. -\startbuffer -\def\x {x} -\def\xyz{xyz} +\stopoldprimitive -(\ifhastoks {x} {xyz}Y\else N\fi)\quad -(\ifhastoks {\x} {xyz}Y\else N\fi)\quad -(\ifhastoks \x {xyz}Y\else N\fi)\quad -(\ifhastoks {y} {xyz}Y\else N\fi)\quad -(\ifhastoks {yz} {xyz}Y\else N\fi)\quad -(\ifhastoks {yz} {\xyz}Y\else N\fi) -\stopbuffer +\startnewprimitive[title={\prm {toksapp}}] -\typebuffer {\getbuffer} +One way to append something to a token list is the following: -\stopnewprimitive +\starttyping +\scratchtoks\expandafter{\the\scratchtoks more stuff} +\stoptyping -\startnewprimitive[title={\prm {ifhasxtoks}}] +This works all right, but it involves a copy of what is already in \type +{\scratchtoks}. This is seldom a real issue unless we have large token lists and +many appends. This is why \LUATEX\ introduced: -This primitive is like the one in the previous section but this time the -given lists are expanded. +\starttyping +\toksapp\scratchtoks{more stuff} +\toksapp\scratchtoksone\scratchtokstwo +\stoptyping -\startbuffer -\def\x {x} -\def\xyz{\x yz} +At some point, when working on \LUAMETATEX, I realized that primitives like this +one and the next appenders and prependers to be discussed were always on the +radar of Taco and me. Some were even implemented in what we called \type {eetex}: +extended \ETEX, and we even found back the prototypes, dating from pre|-|\PDFTEX\ +times. -(\ifhasxtoks {x} {xyz}Y\else N\fi)\quad -(\ifhasxtoks {\x} {xyz}Y\else N\fi)\quad -(\ifhastoks \x {xyz}Y\else N\fi)\quad -(\ifhasxtoks {y} {xyz}Y\else N\fi)\quad -(\ifhasxtoks {yz} {xyz}Y\else N\fi)\quad -(\ifhasxtoks {yz} {\xyz}Y\else N\fi) -\stopbuffer +\stopnewprimitive -\typebuffer {\getbuffer} +\startoldprimitive[title={\prm {toksdef}}] -This primitive has some special properties. +The given name (control sequence) will be bound to the given token register (a +number). Often this primitive is hidden in a high level macro that manages +allocation. -\startbuffer -\edef\+{\expandtoken 9 `+} +\stopoldprimitive -\ifhasxtoks {xy} {xyz}Y\else N\fi\quad -\ifhasxtoks {x\+y} {xyz}Y\else N\fi -\stopbuffer +\startnewprimitive[title={\prm {tokspre}}] -\typebuffer +Where appending something is easy because of the possible \prm {expandafter} +trickery a prepend would involve more work, either using temporary token +registers and|/|or using a mixture of the (no)expansion added by \ETEX, but all +are kind of inefficient and cumbersome. -Here the first argument has a token that has category code \quote {ignore} which -means that such a character will be skipped when seen. So the result is: +\starttyping +\tokspre\scratchtoks{less stuff} +\tokspre\scratchtoksone\scratchtokstwo +\stoptyping -{\getbuffer} +This prepends the token list that is provided. -This permits checks like these: +\stopnewprimitive -\startbuffer -\edef\,{\expandtoken 9 `,} +\startoldprimitive[title={\prm {tolerance}}] -\ifhasxtoks{\,x\,} {,x,y,z,}Y\else N\fi\quad -\ifhasxtoks{\,y\,} {,x,y,z,}Y\else N\fi\quad -\ifhasxtoks{\,z\,} {,x,y,z,}Y\else N\fi\quad -\ifhasxtoks{\,x\,} {,xy,z,}Y\else N\fi -\stopbuffer +When the par builder runs into a line with a badness larger than this value and +when \prm {emergencystretch} is set a third pass is enabled. In \LUAMETATEX\ we +can have more than one second pass and there are more parameters that influence +the process. -\typebuffer +\stopoldprimitive -I admit that it needs a bit of a twisted mind to come up with this, but it works -ok: +\startnewprimitive[title={\prm {tolerant}}] -{\getbuffer} +This prefix tags the following macro as being tolerant with respect to the +expected arguments. It only makes sense when delimited arguments are used or when +braces are mandate. -\stopnewprimitive +\startbuffer +\tolerant\def\foo[#1]#*[#2]{(#1)(#2)} +\stopbuffer -\startnewprimitive[title={\prm {ifhaschar}}] +\typebuffer \getbuffer -This one is a simplified variant of the above: +This definition makes \type {\foo} tolerant for various calls: \startbuffer -\ifhaschar !{this ! works} yes \else no \fi +\foo \foo[1] \foo [1] \foo[1] [2] \foo [1] [2] \stopbuffer \typebuffer -and indeed we get: \inlinebuffer ! Of course the spaces in this this example -code are normally not present in such a test. +these give: \inlinebuffer. The spaces after the first call disappear because the +macro name parser gobbles it, while in the second case the \type {#*} gobbles +them. Here is a variant: -\stopnewprimitive +\startbuffer +\tolerant\def\foo[#1]#,[#2]{!#1!#2!} -\startnewprimitive[title={\prm {ifnumexpression}}] +\foo[?] x +\foo[?] [?] x -Here is an example of a conditional using expressions: +\tolerant\def\foo[#1]#*[#2]{!#1!#2!} -\startbuffer -\ifnumexpression (\scratchcounterone > 5) and (\scratchcountertwo > 5) \relax - do-something -\fi +\foo[?] x +\foo[?] [?] x \stopbuffer -This matches when the result is non zero, and you can mix calculations and tests -as with normal expressions. +\typebuffer -\stopnewprimitive +We now get the following: -\startnewprimitive[title={\prm {ifdimexpression}}] +\getbuffer -The companion of the previous primitive is: +Here the \type {#,} remembers that spaces were gobbles and they will be put back +when there is no further match. These are just a few examples of this tolerant +feature. More details can be found in the lowlevel manuals. -\startbuffer -\ifdimexpression 10pt > 10bp \relax - do-something -\fi -\stopbuffer +\stopnewprimitive -This matches when the result is non zero, and you can mix calculations and tests -as with normal expressions. Contrary to the number variant units can be used and -precision kicks in. +\startnewprimitive[title={\prm {tomathstyle}}] + +Internally math styles are numbers, where \prm {displaystyle} is \tomathstyle +\displaystyle \space and \prm {crampedscriptscriptstyle} is \tomathstyle +\crampedscriptscriptstyle. You can convert the verbose style to a number with +\prm {tomathstyle}. \stopnewprimitive -\startoldprimitive[title={\prm {else}}] +\startoldprimitive[title={\prm {topmark}}][obsolete=yes] -This traditional primitive is part of the condition testing mechanism. When a -condition matches, \TEX\ will continue till it sees an \prm {else} or \prm -{or} or \prm {orelse} (to be discussed later). It will then do a fast skipping -pass till it sees an \prm {fi}. +This is a reference to the last mark on the previous (split off) page, it gives +back tokens. \stopoldprimitive -\startoldprimitive[title={\prm {or}}] +\startoldprimitive[title={\prm {topmarks}}] -This traditional primitive is part of the condition testing mechanism and relates -to an \prm {ifcase} test (or a similar test to be introduced in later -sections). Depending on the value, \TEX\ will do a fast scanning till the right -\prm {or} is seen, then it will continue expanding till it sees a \prm {or} -or \prm {else} or \prm {orelse} (to be discussed later). It will then do a -fast skipping pass till it sees an \prm {fi}. +This is a reference to the last mark with the given id (a number) on the previous +page, it gives back tokens. \stopoldprimitive -\startoldprimitive[title={\prm {fi}}] - -This traditional primitive is part of the condition testing mechanism and ends a -test. So, we have: - -\starttyping -\ifsomething ... \else ... \fi -\ifsomething ... \or ... \or ... \else ... \fi -\ifsomething ... \orelse \ifsometing ... \else ... \fi -\ifsomething ... \or ... \orelse \ifsometing ... \else ... \fi -\stoptyping +\startoldprimitive[title={\prm {topskip}}] -The \prm {orelse} is new in \LUAMETATEX\ and a continuation like we find in -other programming languages (see later section). +This is the amount of glue that is added to the top of a (new) page. \stopoldprimitive -\startoldprimitive[title={\prm {unless}}] - -This \ETEX\ prefix will negate the test (when applicable). - -\starttyping - \ifx\one\two YES\else NO\fi -\unless\ifx\one\two NO\else YES\fi -\stoptyping +\startnewprimitive[title={\prm {toscaled}}] -This primitive is hardly used in \CONTEXT\ and we probably could get rid of these -few cases. +\startbuffer +\scratchdimen = 1234pt \toscaled\scratchdimen +\stopbuffer -\stopoldprimitive +The following code gives this: {\nospacing\inlinebuffer} is similar to \prm +{todimension} but omits the \type {pt} so that we don't need to revert to some +nasty stripping code. -\startnewprimitive[title={\prm {orelse}}] +\typebuffer -This primitive provides a convenient way to flatten your conditional tests. So -instead of +\stopnewprimitive -\starttyping -\ifnum\scratchcounter<-10 - too small -\else\ifnum\scratchcounter>10 - too large -\else - just right -\fi\fi -\stoptyping +\startnewprimitive[title={\prm {tosparsedimension}}] -You can say this: +\startbuffer +\scratchdimen = 1234pt \tosparsedimension\scratchdimen +\stopbuffer -\starttyping -\ifnum\scratchcounter<-10 - too small -\orelse\ifnum\scratchcounter>10 - too large -\else - just right -\fi -\stoptyping +The following code gives this: {\nospacing\inlinebuffer} where \quote {sparse} +indicates that redundant trailing zeros are not shown. -You can mix tests and even the case variants will work in most cases \footnote {I -just play safe because there are corner cases that might not work yet.} +\typebuffer -\starttyping -\ifcase\scratchcounter zero -\or one -\or two -\orelse\ifnum\scratchcounter<10 less than ten -\else ten or more -\fi -\stoptyping +\stopnewprimitive -Performance wise there are no real benefits although in principle there is a bit -less housekeeping involved than with nested checks. However you might like this: +\startnewprimitive[title={\prm {tosparsescaled}}] -\starttyping -\ifnum\scratchcounter<-10 - \expandafter\toosmall -\orelse\ifnum\scratchcounter>10 - \expandafter\toolarge -\else - \expandafter\justright -\fi -\stoptyping +\startbuffer +\scratchdimen = 1234pt \tosparsescaled\scratchdimen +\stopbuffer -over: +The following code gives this: {\nospacing\inlinebuffer} where \quote {sparse} +means that redundant trailing zeros are omitted. -\starttyping -\ifnum\scratchcounter<-10 - \expandafter\toosmall -\else\ifnum\scratchcounter>10 - \expandafter\expandafter\expandafter\toolarge -\else - \expandafter\expandafter\expandafter\justright -\fi\fi -\stoptyping +\typebuffer -or the more \CONTEXT\ specific: +\stopnewprimitive -\starttyping -\ifnum\scratchcounter<-10 - \expandafter\toosmall -\else\ifnum\scratchcounter>10 - \doubleexpandafter\toolarge -\else - \doubleexpandafter\justright -\fi\fi -\stoptyping +\startnewprimitive[title={\prm {tpack}}] -But then, some \TEX ies like complex and obscure code and throwing away working -old code that took ages to perfect and get working and also showed that one -masters \TEX\ might hurt. +This primitive is like \prm {vtop} but without the callback overhead. \stopnewprimitive -\startnewprimitive[title={\prm {orunless}}] +\startnewprimitive[title={\prm {tracingadjusts}}] -This is the negated variant of \prm {orelse} (prefixing that one with \tex -{unless} doesn't work well. +In \LUAMETATEX\ the adjust feature has more functionality and also is carried +over. When set to a positive values \prm {vadjust} processing reports details. +The higher the number, the more you'll get. \stopnewprimitive -\startoldprimitive[title={\prm {futurelet}}] +\startnewprimitive[title={\prm {tracingalignments}}] -The original \TEX\ primitive \prm {futurelet} can be used to create an alias to a next token, -push it back into the input and then expand a given token. +When set to a positive value the alignment mechanism will keep you informed about +what is done in various stages. Higher values unleash more information, including +what callbacks kick in. -\startbuffer -\let\MySpecialToken[ -\def\DoWhatever{\ifx\NextToken\MySpecialToken YES\else NOP\fi : } -\futurelet\NextToken\DoWhatever [A]\crlf -\futurelet\NextToken\DoWhatever (A)\par -\stopbuffer +\stopnewprimitive -\typebuffer +\startoldprimitive[title={\prm {tracingassigns}}] -This is typically the kind of primitive that most users will never use because it -expects a sane follow up handler (here \type {\DoWhatever}) and therefore is -related to user interfacing. +When set to a positive values assignments to parameters and variables are +reported on the console and|/|or in the log file. Because \LUAMETATEX\ avoids +redundant assignments these don't get reported. -{\getbuffer} +\stopoldprimitive + +\startoldprimitive[title={\prm {tracingcommands}}] + +When set to a positive values the commands (primitives) are reported on the console +and|/|or in the log file. \stopoldprimitive -\startnewprimitive[title={\prm {futuredef}}] +\startnewprimitive[title={\prm {tracingexpressions}}] -We elaborate on the example of using \prm {futurelet} in the previous section. -Compare that one with the next: +The extended expression commands like \prm {numexpression} and \prm +{dimexpression} can be traced by setting this parameter to a positive value. -\startbuffer -\def\MySpecialToken{[} -\def\DoWhatever{\ifx\NextToken\MySpecialToken YES\else NOP\fi : } -\futurelet\NextToken\DoWhatever [A]\crlf -\futurelet\NextToken\DoWhatever (A)\par -\stopbuffer +\stopnewprimitive -\typebuffer +\startnewprimitive[title={\prm {tracingfullboxes}}] -This time we get: +When set to a positive value the box will be shown in case of an overfull box. +When a quality callback is set this will not happen as all reporting is then +delegated. -{\getbuffer} +\stopnewprimitive -It is for that reason that we now also have \prm {futuredef}: +\startoldprimitive[title={\prm {tracinggroups}}] -\startbuffer -\def\MySpecialToken{[} -\def\DoWhatever{\ifx\NextToken\MySpecialToken YES\else NOP\fi : } -\futuredef\NextToken\DoWhatever [A]\crlf -\futuredef\NextToken\DoWhatever (A)\par -\stopbuffer +When set to a positive values grouping is reported on the console and|/|or in the +log file. -\typebuffer +\stopoldprimitive -So we're back to what we want: +\startnewprimitive[title={\prm {tracinghyphenation}}] -{\getbuffer} +When set to a positive values the hyphenation process is reported on the console +and|/|or in the log file. \stopnewprimitive -\startnewprimitive[title={\prm {futurecsname}}] +\startoldprimitive[title={\prm {tracingifs}}] -In order to make the repertoire of \type {def}, \type {let} and \type {futurelet} -primitives complete we also have: +When set some details of what gets tested and what results are seen is reported. -\starttyping -\futurecsname MyMacro:1\endcsname\MyAction -\stoptyping +\stopoldprimitive + +\startnewprimitive[title={\prm {tracinginserts}}] + +A positive value enables tracing where values larger than~1 will report more +details. \stopnewprimitive -\startnewprimitive[title={\prm {letcharcode}}] +\startnewprimitive[title={\prm {tracinglevels}}] -Assigning a meaning to an active character can sometimes be a bit cumbersome; -think of using some documented uppercase magic that one tends to forget as it's -used only a few times and then never looked at again. So we have this: +The lines in a log file can be prefixed with some details, depending on the bits +set: -\startbuffer -{\letcharcode 65 1 \catcode 65 13 A : \meaning A}\crlf -{\letcharcode 65 2 \catcode 65 13 A : \meaning A}\par -\stopbuffer +\starttabulate[|T|l|] +\NC 0x1 \NC current group \NC \NR +\NC 0x2 \NC current input \NC \NR +\NC 0x4 \NC catcode table \NC \NR +\stoptabulate -\typebuffer +\stopnewprimitive -here we define \type {A} as an active charcter with meaning \type {1} in the -first line and \type {2} in the second. +\startnewprimitive[title={\prm {tracinglists}}] -{\tttf \getbuffer} +At various stages the lists being processed can be shown. This is mostly an +option for developers. -Normally one will assign a control sequence: +\stopnewprimitive -\startbuffer -{\letcharcode 66 \bf \catcode 66 13 {B bold}: \meaning B}\crlf -{\letcharcode 73 \it \catcode 73 13 {I italic}: \meaning I}\par -\stopbuffer +\startoldprimitive[title={\prm {tracinglostchars}}] -\typebuffer +When set to one characters not present in a font will be reported in the log +file, a value of two will also report this on the console. -Of course \type {\bf} and \type {\it} are \CONTEXT\ specific commands: +\stopoldprimitive -{\tttf \getbuffer} +\startoldprimitive[title={\prm {tracingmacros}}] + +This parameter controls reporting of what macros are seen and expanded. + +\stopoldprimitive + +\startnewprimitive[title={\prm {tracingmarks}}] + +Marks are information blobs that track states that can be queried when a page is +handled over to the shipout routine. They travel through the system in a bit +different than traditionally: like like adjusts and inserts deeply buried ones +bubble up to outer level boxes. This parameters controls what progress gets +reported. \stopnewprimitive -\startoldprimitive[title={\prm {global}}] +\startnewprimitive[title={\prm {tracingmath}}] -This is one of the original prefixes that can be used when we define a macro of -change some register. +The higher the value, the more information you will get about the various stages +in rendering math. Because tracing of nodes is rather verbose you need to know a +bit what this engine does. Conceptually there are differences between the +\LUAMETATEX\ and traditional engine, like more passes, inter-atom spacing, +different low level mechanisms. This feature is mostly meant for developers who +tweak the many available parameters. -\starttyping -\bgroup - \def\MyMacroA{a} -\global\def\MyMacroB{a} - \gdef\MyMacroC{a} -\egroup -\stoptyping +\stopnewprimitive -The macro defined in the first line is forgotten when the groups is left. The -second and third definition are both global and these definitions are retained. +\startoldprimitive[title={\prm {tracingnesting}}] + +A positive value triggers log messages about the current level. \stopoldprimitive -\startoldprimitive[title={\prm {long}}] +\startnewprimitive[title={\prm {tracingnodes}}] -This original prefix gave the macro being defined the property that it could not -have \prm {par} (or the often equivalent empty lines) in its arguments. It was -mostly a protection against a forgotten right curly brace, resulting in a so called -run|-|away argument. That mattered on a paper terminal or slow system where such a -situation should be catched early. In \LUATEX\ it was already optional, and in -\LUAMETATEX\ we dropped this feature completely (so that we could introduce others). +When set to a positive value more details about nodes (in boxes) will be +reported. Because this is also controlled by callbacks what gets reported is +macro package dependent. -\stopoldprimitive +\stopnewprimitive -\startoldprimitive[title={\prm {outer}}] +\startoldprimitive[title={\prm {tracingonline}}] -An outer macro is one that can only be used at the outer level. This property is -no longer supported. Like \prm {long}, the \prm {outer} prefix is now an -no|-|op (and we don't expect this to have unfortunate side effects). +The engine has two output channels: the log file and the console and by default +most tracing (when enabled) goes to the log file. When this parameter is set to a +positive value tracing will also happen in the console. Messages from the \LUA\ +end can be channeled independently. \stopoldprimitive -\startoldprimitive[title={\prm {protected}}] +\startoldprimitive[title={\prm {tracingoutput}}] -A protected macro is one that doesn't get expanded unless it is time to do so. -For instance, inside an \prm {edef} it just stays what it is. It often makes -sense to pass macros as|-|is to (multi|-|pass) file (for tables of contents). +Values larger than one result in some information about what gets passed to the +output routine. -In \CONTEXT\ we use either \prm {protected} or \prm {unexpanded} because the -later was the command we used to achieve the same results before \ETEX\ -introduced this protection primitive. Originally the \prm {protected} macro was -also defined but it has been dropped. +\stopoldprimitive + +\startoldprimitive[title={\prm {tracingpages}}] + +Values larger than one result in some information about the page building +process. In \LUAMETATEX\ there is more info for higher values. \stopoldprimitive -\startnewprimitive[title={\prm {expand}}] +\startoldprimitive[title={\prm {tracingparagraphs}}] -Beware, this is not a prefix but a directive to ignore the protected characters of -the following macro. +Values larger than one result in some information about the par building process. +In \LUAMETATEX\ there is more info for higher values. -\startbuffer -\protected \def \testa{\the\scratchcounter} - \edef\testb{\testa} - \edef\testc{\expand\testa} -\stopbuffer +\stopoldprimitive -\typebuffer +\startnewprimitive[title={\prm {tracingpasses}}] -The meaning of the three macros is: +In \LUAMETATEX\ you can configure additional second stage par builder passes and +this parameter controls what gets reported on the console and|/|or in the log +file. -\startlines \getbuffer \tttf -\meaningfull\testa -\meaningfull\testb -\meaningfull\testc -\stoplines +\stopnewprimitive + +\startnewprimitive[title={\prm {tracingpenalties}}] + +This setting triggers reporting of actions due to special penalties in the +page builder. \stopnewprimitive -\startnewprimitive[title={\prm {untraced}}] +\startoldprimitive[title={\prm {tracingrestores}}] -Related to the meaning providers is the \prm {untraced} prefix. It marks a macro -as to be reported by name only. It makes the macro look like a primitive. +When set to a positive values (re)assignments after grouping to parameters and +variables are reported on the console and|/|or in the log file. Because +\LUAMETATEX\ avoids redundant assignments these don't get reported. -\starttyping - \def\foo{} -\untraced\def\oof{} +\stopoldprimitive -\scratchtoks{\foo\foo\oof\oof} +\startoldprimitive[title={\prm {tracingstats}}] -\tracingall \the\scratchtoks \tracingnone -\stoptyping +This parameter is a dummy in \LUAMETATEX. There are anyway some statistic +reported when the format is made but for a regular run it is up to the macro +package to come up with useful information. -This will show up in the log as follows: +\stopoldprimitive -\starttyping -1:4: {\the} -1:5: \foo -> -1:5: \foo -> -1:5: \oof -1:5: \oof -\stoptyping +\startnewprimitive[title={\prm {tsplit}}] -This is again a trick to avoid too much clutter in a log. Often it doesn't matter -to users what the meaning of a macro is (if they trace at all). \footnote {An -earlier variant could also hide the expansion completely but that was just -confusing.} +This splits like \prm {vsplit} but it returns a \prm {vtop} box instead. -\startoldprimitive[title={\prm {immediate}}] +\stopnewprimitive -This one has no effect unless you intercept it at the \LUA\ end and act upon it. -In original \TEX\ immediate is used in combination with read from and write to -file operations. So, this is an old primitive with a new meaning. +\startoldprimitive[title={\prm {uccode}}] + +When the \prm {uppercase} operation is applied the uppercase code of a character +is used for the replacement. This primitive is used to set that code, so it +expects two character number. \stopoldprimitive -\startnewprimitive[title={\prm {frozen}}] +\startoldprimitive[title={\prm {uchyph}}] -You can define a macro as being frozen: +When set to a positive number words that start with a capital will be hyphenated. -\starttyping -\frozen\def\MyMacro{...} -\stoptyping +\stopoldprimitive -When you redefine this macro you get an error: +\startnewprimitive[title={\prm {uleaders}}] -\starttyping -! You can't redefine a frozen macro. -\stoptyping +This leader adapts itself after a paragraph has been typeset. Here are a few +examples: -This is a prefix like \prm {global} and it can be combined with other prefixes. -\footnote {The \prm {outer} and \prm {long} prefixes are no|-|ops in -\LUAMETATEX\ and \LUATEX\ can be configured to ignore them.} +\startbuffer +test \leaders \hbox {x}\hfill\ test +test \uleaders \hbox{x x x x}\hfill\ test +test \hbox{x x x x}\hskip 3cm plus 1cm\ test +test \uleaders \hbox{x x x x}\hskip 3cm plus 1cm\ test +\stopbuffer + +\typebuffer + +When an \prm {uleaders} is used the glue in the given box will be adapted to the +available space. + +\startlines \getbuffer \stoplines + +\startsetups adaptive:test + \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset -\usedadaptivedepth \bgroup + \externalfigure + [cow.pdf] + [width=\usedadaptivewidth, + height=\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax]% + \egroup +\stopsetups + +Optionally the \type {callback} followed by a number can be given, in which case +a callback kicks in that gets that the node, a group identifier, and the number +passed. It permits (for instance) adaptive graphics: \dostepwiserecurse {1} {100} {5} +{\hbox {#1=\romannumerals{#1}} {\adaptivebox [strut=yes, setups=adaptive:test]{}} }. \stopnewprimitive -\startnewprimitive[title={\prm {letfrozen}}] +\startoldprimitive[title={\prm {unboundary}}] -You can explicitly freeze an unfrozen macro: +When possible a preceding boundary node will be removed. -\starttyping -\def\MyMacro{...} -\letfrozen\MyMacro -\stoptyping +\stopoldprimitive -A redefinition will now give: +\startnewprimitive[title={\prm {undent}}] -\starttyping -! You can't redefine a frozen macro. -\stoptyping +When possible the already added indentation will be removed. \stopnewprimitive -\startnewprimitive[title={\prm {unletfrozen}}] +\startoldprimitive[title={\prm {underline}}] -A frozen macro cannot be redefined: you get an error. But as nothing in \TEX\ is set -in stone, you can do this: +This is a math specific primitive that draws a line under the given content. It +is a poor mans replacement for a delimiter. The thickness is set with \prm +{Umathunderbarrule}, the distance between content and rule is set by \prm +{Umathunderbarvgap} and \prm {Umathunderbarkern} is added above the rule. The +style used for the content under the rule can be set with \prm +{Umathunderlinevariant}. See \prm {overline} for what these parameters do. -\starttyping -\frozen\def\MyMacro{...} -\unletfrozen\MyMacro -\stoptyping +\stopoldprimitive -and \type {\MyMacro} is no longer protected from overloading. It is still -undecided to what extend \CONTEXT\ will use this feature. +\startoldprimitive[title={\prm {unexpanded}}] + +This is an \ETEX\ enhancement. The content will not be expanded in a context +where expansion is happening, like in an \prm {edef}. In \CONTEXT\ you need to +use \prm {normalunexpanded} because we already had a macro with that name. + +\startbuffer +\def \A{!} \meaning\A +\def \B{?} \meaning\B +\edef\C{\A\B} \meaning\C +\edef\C{\normalunexpanded{\A}\B} \meaning\C +\stopbuffer + +\typebuffer + +\startlines \tttf \getbuffer \stoplines + +\stopoldprimitive + +\startnewprimitive[title={\prm {unexpandedendless}}] + +This one loops forever so you need to quit explicitly. \stopnewprimitive -\startnewprimitive[title={\prm {letprotected}}] +\startnewprimitive[title={\prm {unexpandedloop}}] -Say that you have these definitions: +As follow up on \prm {expandedloop} we now show its counterpart: \startbuffer - \def \MyMacroA{alpha} -\protected \def \MyMacroB{beta} - \edef \MyMacroC{\MyMacroA\MyMacroB} -\letprotected \MyMacroA - \edef \MyMacroD{\MyMacroA\MyMacroB} -\meaning \MyMacroC\crlf -\meaning \MyMacroD\par +\edef\whatever + {\unexpandedloop 1 10 1 + {\scratchcounter=\the\currentloopiterator\relax}} + +\meaningasis\whatever \stopbuffer \typebuffer -The typeset meaning in this example is: +\start \veryraggedright \tt\tfx \getbuffer \stop \blank -{\tttf \getbuffer} +The difference between the (un)expanded loops and a local controlled +one is shown here. Watch the out of order injection of \type {A}'s. -\stopnewprimitive +\startbuffer +\edef\TestA{\localcontrolledloop 1 5 1 {A}} % out of order +\edef\TestB{\expandedloop 1 5 1 {B}} +\edef\TestC{\unexpandedloop 1 5 1 {C\relax}} +\stopbuffer -\startnewprimitive[title={\prm {unletprotected}}] +\typebuffer \getbuffer -The complementary operation of \prm {letprotected} can be used to unprotect -a macro, so that it gets expandable. +We show the effective definition as well as the outcome of using them \startbuffer - \def \MyMacroA{alpha} -\protected \def \MyMacroB{beta} - \edef \MyMacroC{\MyMacroA\MyMacroB} -\unletprotected \MyMacroB - \edef \MyMacroD{\MyMacroA\MyMacroB} -\meaning \MyMacroC\crlf -\meaning \MyMacroD\par -\stopbuffer +\meaningasis\TestA +\meaningasis\TestB +\meaningasis\TestC -\typebuffer +A: \TestA +B: \TestB +C: \TestC +\stopbuffer -Compare this with the example in the previous section: +\typebuffer \startlines \tttf \getbuffer \stoplines -{\tttf \getbuffer} +Watch how because it is empty \type {\TestA} has become a constant macro because +that's what deep down empty boils down to. \stopnewprimitive -% \startnewprimitive[title={\prm {letdatacode}}] -% {\em Todo.} -% \stopnewprimitive +\startnewprimitive[title={\prm {unexpandedrepeat}}] -\startnewprimitive[title={\prm {beginlocalcontrol}}] +This one takes one instead of three arguments which looks better in simple loops. -Once \TEX\ is initialized it will enter the main loop. In there certain commands -trigger a function that itself can trigger further scanning and functions. In -\LUAMETATEX\ we can have local main loops and we can either enter it from the -\LUA\ end (which we don't discuss here) or at the \TEX\ end using this primitive. +\stopnewprimitive -\startbuffer -\scratchcounter100 +\startoldprimitive[title={\prm {unhbox}}] -\edef\whatever{ - a - \beginlocalcontrol - \advance\scratchcounter 10 - b - \endlocalcontrol - \beginlocalcontrol - c - \endlocalcontrol - d - \advance\scratchcounter 10 -} +A box is a packaged list and once packed travels through the system as a single +object with properties, like dimensions. This primitive injects the original list +and discards the wrapper. -\the\scratchcounter -\whatever -\the\scratchcounter -\stopbuffer +\stopoldprimitive -\typebuffer +\startoldprimitive[title={\prm {unhcopy}}] -A bit of close reading probably gives an impression of what happens here: +This is like \prm {unhbox} but keeps the original. It is one of the more costly +operations. -{\getbuffer} +\stopoldprimitive -The local loop can actually result in material being injected in the current node -list. However, where normally assignments are not taking place in an \prm -{edef}, here they are applied just fine. Basically we have a local \TEX\ job, be -it that it shares all variables with the parent loop. +\startnewprimitive[title={\prm {unhpack}}] + +This primitive is like \prm {unhbox} but without the callback overhead. \stopnewprimitive -\startnewprimitive[title={\prm {endlocalcontrol}}] +\startoldprimitive[title={\prm {unkern}}] - See previous section. +This removes the last kern, if possible. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {localcontrolled}}] +\startoldprimitive[title={\prm {unless}}] -The previously described local control feature comes with two extra helpers. The -\prm {localcontrolled} primitive takes a token list and wraps this into a local -control sidetrack. For example: +This \ETEX\ prefix will negate the test (when applicable). -\startbuffer -\edef\testa{\scratchcounter123 \the\scratchcounter} -\edef\testb{\localcontrolled{\scratchcounter123}\the\scratchcounter} -\stopbuffer +\starttyping + \ifx\one\two YES\else NO\fi +\unless\ifx\one\two NO\else YES\fi +\stoptyping -\typebuffer +This primitive is hardly used in \CONTEXT\ and we probably could get rid of these +few cases. -The two meanings are: +\stopoldprimitive -\start \getbuffer -\starttabulate[|T|T|] -\NC \string\testa \NC \meaningfull\testa \NC \NR -\NC \string\testb \NC \meaningfull\testb \NC \NR -\stoptabulate -\stop +\startnewprimitive[title={\prm {unletfrozen}}] -The assignment is applied immediately in the expanded definition. +A frozen macro cannot be redefined: you get an error. But as nothing in \TEX\ is set +in stone, you can do this: + +\starttyping +\frozen\def\MyMacro{...} +\unletfrozen\MyMacro +\stoptyping + +and \type {\MyMacro} is no longer protected from overloading. It is still +undecided to what extend \CONTEXT\ will use this feature. \stopnewprimitive -\startnewprimitive[title={\prm {localcontrol}}] +\startnewprimitive[title={\prm {unletprotected}}] -This primitive takes a single token: +The complementary operation of \prm {letprotected} can be used to unprotect +a macro, so that it gets expandable. \startbuffer -\edef\testa{\scratchcounter123 \the\scratchcounter} -\edef\testc{\testa \the\scratchcounter} -\edef\testd{\localcontrol\testa \the\scratchcounter} + \def \MyMacroA{alpha} +\protected \def \MyMacroB{beta} + \edef \MyMacroC{\MyMacroA\MyMacroB} +\unletprotected \MyMacroB + \edef \MyMacroD{\MyMacroA\MyMacroB} +\meaning \MyMacroC\crlf +\meaning \MyMacroD\par \stopbuffer \typebuffer -The three meanings are: - -\start \getbuffer -\starttabulate[|T|T|] -\NC \string\testa \NC \meaning\testa \NC \NR -\NC \string\testc \NC \meaning\testc \NC \NR -\NC \string\testd \NC \meaning\testd \NC \NR -\stoptabulate -\stop +Compare this with the example in the previous section: -The \prm {localcontrol} makes that the following token gets expanded so we don't -see the yet to be expanded assignment show up in the macro body. +{\tttf \getbuffer} \stopnewprimitive -\startnewprimitive[title={\prm {alignmark}}] +\startoldprimitive[title={\prm {unpenalty}}] -When you have the \type {#} not set up as macro parameter character cq.\ align -mark, you can use this primitive instead. The same rules apply with respect to -multiple such tokens in (nested) macros and alignments. +This removes the last penalty, if possible. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {aligntab}}] +\startoldprimitive[title={\prm {unskip}}] -When you have the \type {&} not set up as align tab, you can use this primitive -instead. The same rules apply with respect to multiple such tokens in (nested) -macros and alignments. +This removes the last glue, if possible. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {defcsname}}] +\startnewprimitive[title={\prm {untraced}}] -We now get a series of log clutter avoidance primitives. It's fine if you argue -that they are not really needed, just don't use them. +Related to the meaning providers is the \prm {untraced} prefix. It marks a macro +as to be reported by name only. It makes the macro look like a primitive. \starttyping -\expandafter\def\csname MyMacro:1\endcsname{...} - \defcsname MyMacro:1\endcsname{...} -\stoptyping - -The fact that \TEX\ has three (expanded and global) companions can be seen as a -signal that less verbosity makes sense. It's just that macro packages use plenty -of \prm {csname}'s. + \def\foo{} +\untraced\def\oof{} -\stopnewprimitive +\scratchtoks{\foo\foo\oof\oof} -\startnewprimitive[title={\prm {edefcsname}}] +\tracingall \the\scratchtoks \tracingnone +\stoptyping -This is the companion of \prm {edef}: +This will show up in the log as follows: \starttyping -\expandafter\edef\csname MyMacro:1\endcsname{...} - \edefcsname MyMacro:1\endcsname{...} +1:4: {\the} +1:5: \foo -> +1:5: \foo -> +1:5: \oof +1:5: \oof \stoptyping +This is again a trick to avoid too much clutter in a log. Often it doesn't matter +to users what the meaning of a macro is (if they trace at all). \footnote {An +earlier variant could also hide the expansion completely but that was just +confusing.} + \stopnewprimitive -\startnewprimitive[title={\prm {gdefcsname}}] +\startoldprimitive[title={\prm {unvbox}}] -As with standard \TEX\ we also define global ones: +A box is a packaged list and once packed travels through the system as a single +object with properties, like dimensions. This primitive injects the original list +and discards the wrapper. -\starttyping -\expandafter\gdef\csname MyMacro:1\endcsname{...} - \gdefcsname MyMacro:1\endcsname{...} -\stoptyping +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {unvcopy}}] -\startnewprimitive[title={\prm {xdefcsname}}] +This is like \prm {unvbox} but keeps the original. It is one of the more costly +operations. -This is the companion of \prm {xdef}: +\stopoldprimitive -\starttyping -\expandafter\xdef\csname MyMacro:1\endcsname{...} - \xdefcsname MyMacro:1\endcsname{...} -\stoptyping +\startnewprimitive[title={\prm {unvpack}}] + +This primitive is like \prm {unvbox} but without the callback overhead. \stopnewprimitive -\startnewprimitive[title={\prm {glet}}] +\startoldprimitive[title={\prm {uppercase}}] -This is the global companion of \prm {let}. The fact that it is not an original -primitive is probably due to the expectation for it not it not being used (as) -often (as in \CONTEXT). +See its counterpart \prm {lowercase} for an explanation. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {letcsname}}] +\startoldprimitive[title={\prm {vadjust}}] -It is easy to see that we save two tokens when we use this primitive. As with the -\type {..defcs..} variants it also saves a push back of the composed macro name. +This injects a node that stores material that will injected before or after the +line where it has become part of. In \LUAMETATEX\ there are more features, driven +by keywords. -\starttyping -\expandafter\let\csname MyMacro:1\endcsname\relax - \letcsname MyMacro:1\endcsname\relax -\stoptyping +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {valign}}] -\startnewprimitive[title={\prm {gletcsname}}] +This command starts vertically aligned material. Its counterpart \prm {halign} is +used more frequently. Most macro packages provide wrappers around these commands. +First one specifies a preamble which is then followed by entries (rows and +columns). -Naturally \LUAMETATEX\ also provides a global variant: +\stopoldprimitive -\starttyping -\expandafter\global\expandafter\let\csname MyMacro:1\endcsname\relax -\expandafter \glet\csname MyMacro:1\endcsname\relax - \gletcsname MyMacro:1\endcsname\relax -\stoptyping +\startnewprimitive[title={\prm {variablefam}}] -So, here we save even more. +In traditional \TEX\ sets the family of what are considered variables (class 7) +to the current family (which often means that they adapt to the current alphabet) +and then injects a math character of class ordinary. This parameter can be used +to obey the given class when the family set for a character is the same as this +parameter. So we then use the given class with the current family. It is mostly +there for compatibility with \LUATEX\ and experimenting (outside \CONTEXT). \stopnewprimitive -\startnewprimitive[title={\prm {cdef}}] - -This primitive is like \prm {edef} but in some usage scenarios is slightly -more efficient because (delayed) expansion is ignored which in turn saves -building a temporary token list. +\startoldprimitive[title={\prm {vbadness}}] -\startbuffer -\edef\FooA{this is foo} \meaningfull\FooA\crlf -\cdef\FooB{this is foo} \meaningfull\FooB\par -\stopbuffer +This sets the threshold for reporting a (vertical) badness value, its current +value is \the \badness. -\typebuffer {\tttf \getbuffer} +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {vbox}}] -\startnewprimitive[title={\prm {cdefcsname}}] +This creates a vertical box. In the process callbacks can be triggered that can +preprocess the content, influence line breaking as well as assembling the +resulting paragraph. More can be found in dedicated manuals. The baseline is +at the bottom. -This primitive is like \prm {edefcsame} but in some usage scenarios is slightly -more efficient because (delayed) expansion is ignored which in turn saves -building a temporary token list. +\stopoldprimitive -\startbuffer -\edefcsname FooA\endcsname{this is foo} \meaningasis\FooA\crlf -\cdefcsname FooB\endcsname{this is foo} \meaningasis\FooB\par -\stopbuffer +\startoldprimitive[title={\prm {vcenter}}] -\typebuffer {\tttf \getbuffer} +In traditional \TEX\ this box packer is only permitted in math mode but in +\LUAMETATEX\ it also works in text mode. The content is centered in the vertical +box. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {lettonothing}}] +\startoldprimitive[title={\prm {vfil}}] -This one let's a control sequence to nothing. Assuming that \tex {empty} -is indeed empty, these two lines are equivalent. +This is a shortcut for \typ {\vskip plus 1 fil} (first order filler). -\starttyping -\let \foo\empty -\lettonothing\oof -\stoptyping +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {vfill}}] -\startnewprimitive[title={\prm {glettonothing}}] +This is a shortcut for \typ {\vskip plus 1 fill} (second order filler). -This is the global companion of \prm {lettonothing}. +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {vfilneg}}] -\startnewprimitive[title={\prm {norelax}}] +This is a shortcut for \typ {\vskip plus - 1 fil} so it can compensate \prm +{vfil}. -The rationale for this command can be shown by a few examples: +\stopoldprimitive -\startbuffer -\dimen0 1pt \dimen2 1pt \dimen4 2pt -\edef\testa{\ifdim\dimen0=\dimen2\norelax N\else Y\fi} -\edef\testb{\ifdim\dimen0=\dimen2\relax N\else Y\fi} -\edef\testc{\ifdim\dimen0=\dimen4\norelax N\else Y\fi} -\edef\testd{\ifdim\dimen0=\dimen4\relax N\else Y\fi} -\edef\teste{\norelax} -\stopbuffer +\startoldprimitive[title={\prm {vfuzz}}] -\typebuffer +This dimension sets the threshold for reporting vertical boxes that are under- or +overfull. The current value is \the \vfuzz. -The five meanings are: +\stopoldprimitive -\start \getbuffer \starttabulate[|T|T|] -\NC \string\testa \NC \meaning\testa \NC \NR -\NC \string\testb \NC \meaning\testb \NC \NR -\NC \string\testc \NC \meaning\testc \NC \NR -\NC \string\testd \NC \meaning\testd \NC \NR -\NC \string\teste \NC \meaning\teste \NC \NR -\stoptabulate \stop +\startnewprimitive[title={\prm {virtualhrule}}] -So, the \prm {norelax} acts like \prm {relax} but is not pushed back as -usual (in some cases). +This is a horizontal rule with zero dimensions from the perspective of the +frontend but the backend can access them as set. \stopnewprimitive -\startnewprimitive[title={\prm {swapcsvalues}}] +\startnewprimitive[title={\prm {virtualvrule}}] -Because we mention some \type {def} and \type {let} primitives here, it makes -sense to also mention a primitive that will swap two values (meanings). This one -has to be used with care. Of course that what gets swapped has to be of the same -type (or at least similar enough not to cause issues). Registers for instance -store their values in the token, but as soon as we are dealing with token lists -we also need to keep an eye on reference counting. So, to some extend this is -an experimental feature. +This is a vertical rule with zero dimensions from the perspective of the frontend +but the backend can access them as set. \stopnewprimitive -\startnewprimitive[title={\prm {integerdef}}] +\startoldprimitive[title={\prm {vkern}}] -You can alias to a count (integer) register with \prm {countdef}: +This primitive is like \prm {kern} but will force the engine into vertical mode +if it isn't yet. -\starttyping -\countdef\MyCount134 -\stoptyping +\stopoldprimitive -Afterwards the next two are equivalent: +\startnewprimitive[title={\prm {vpack}}] -\starttyping -\MyCount = 99 -\count1234 = 99 -\stoptyping +This primitive is like \prm {vbox} but without the callback overhead. -where \type {\MyCount} can be a bit more efficient because no index needs to be -scanned. However, in terms of storage the value (here 99) is always in the register -so \type {\MyCount} has to get there. This indirectness has the benefit that directly -setting the value is reflected in the indirect accessor. +\stopnewprimitive -\starttyping -\integerdef\MyCount = 99 -\stoptyping +\startnewprimitive[title={\prm {vpenalty}}] -This primitive also defines a numeric equivalent but this time the number is stored -with the equivalent. This means that: +This primitive is like \prm {penalty} but will force the engine into vertical +mode if it isn't yet. -\starttyping -\let\MyCopyOfCount = \MyCount -\stoptyping +\stopnewprimitive -will store the {\em current} value of \type {\MyCount} in \type {\MyCopyOfCount} and -changing either of them is not reflected in the other. +\startoldprimitive[title={\prm {vrule}}] -The usual \prm {advance}, \prm {multiply} and \prm {divide} can be used with these -integers and they behave like any number. But compared to registers they are actually -more a constant. +This creates a vertical rule. Unless the height and depth are set they will +stretch to fix the available space. In addition to the traditional \type {width}, +\type {height} and \type {depth} specifiers some more are accepted. These are +discussed in other manuals. See \prm {hrule} for a simple example. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {dimensiondef}}] +\startoldprimitive[title={\prm {vsize}}] -A variant of \prm {integerdef} is: +This sets (or gets) the current vertical size. While setting the \prm {hsize} +inside a \prm {vbox} has consequences, setting the \prm {vsize} mostly makes +sense at the outer level (the page). -\starttyping -\dimensiondef\MyDimen = 1234pt -\stoptyping +\stopoldprimitive -The properties are comparable to the ones described in the section \prm -{integerdef}. +\startoldprimitive[title={\prm {vskip}}] -\stopnewprimitive +The given glue is injected in the vertical list. If possible vertical mode is +entered. -\startnewprimitive[title={\prm {gluespecdef}}] +\stopoldprimitive -A variant of \prm {integerdef} and \prm {dimensiondef} is: +\startoldprimitive[title={\prm {vsplit}}] -\starttyping -\gluespecdef\MyGlue = 3pt plus 2pt minus 1pt -\stoptyping +This operator splits a given amount from a vertical box. In \LUAMETATEX\ we can +split \type {to} but also \type {upto}, so that we don't have to repack the +result in order to see how much is actually in there. -The properties are comparable to the ones described in the previous sections. +\stopoldprimitive -\stopnewprimitive +\startoldprimitive[title={\prm {vss}}] -\startnewprimitive[title={\prm {mugluespecdef}}] +This is the vertical variant of \prm {hss}. See there for what it means. -A variant of \prm {gluespecdef} that expects \type {mu} units is: +\stopoldprimitive -\starttyping -\mugluespecdef\MyGlue = 3mu plus 2mu minus 1mu -\stoptyping +\startoldprimitive[title={\prm {vtop}}] -The properties are comparable to the ones described in the previous sections. +This creates a vertical box. In the process callbacks can be triggered that can +preprocess the content, influence line breaking as well as assembling the +resulting paragraph. More can be found in dedicated manuals. The baseline is +at the top. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {advanceby}}] +\startoldprimitive[title={\prm {wd}}] -This is slightly more efficient variant of \prm {advance} that doesn't look for -\type {by} and therefore, if one is missing, doesn't need to push back the last -seen token. Using \prm {advance} with \type {by} is nearly as efficient but takes -more tokens. +Returns the width of the given box. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {multiplyby}}] +\startoldprimitive[title={\prm {widowpenalties}}] -This is slightly more efficient variant of \prm {multiply} that doesn't look for -\type {by}. See previous section. +This is an array of penalty put before the last lines in a paragraph. High values +discourage (or even prevent) a lone line at the beginning of a next page. This +command expects a count value indicating the number of entries that will follow. +The first entry is ends up before the last line. -\stopnewprimitive +\stopoldprimitive -\startnewprimitive[title={\prm {divideby}}] +\startoldprimitive[title={\prm {widowpenalty}}] -This is slightly more efficient variant of \prm {divide} that doesn't look for -\type {by}. See previous section. +This is the penalty put before a widow line in a paragraph. High values +discourage (or even prevent) a lone line at the beginning of a next page. + +\stopoldprimitive + +\startnewprimitive[title={\prm {wordboundary}}] + +The hypenation routine has to decide where a word begins and ends. If you want to +make sure that there is a proper begin or end of a word you can inject this +boundary. \stopnewprimitive -\startnewprimitive[title={\prm {localcontrolledloop}}] +\startnewprimitive[title={\prm {wrapuppar}}] -As with more of the primitives discussed here, there is a manual in the \quote -{lowlevel} subset that goes into more detail. So, here a simple example has to -do: +What this primitive does can best be shown with an example: \startbuffer -\localcontrolledloop 1 100 1 {% - \ifnum\currentloopiterator>6\relax - \quitloop - \else - [\number\currentloopnesting:\number\currentloopiterator] - \localcontrolledloop 1 8 1 {% - (\number\currentloopnesting:\number\currentloopiterator) - }\par - \fi -} +some text\wrapuppar{one} and some\wrapuppar{two} more \stopbuffer \typebuffer -Here we see the main loop primitive being used nested. The code shows how we can -\prm {quitloop} and have access to the \prm {currentloopiterator} as well as the -nesting depth \prm {currentloopnesting}. - -\startpacked \getbuffer \stoppacked +We get: -Be aware of the fact that \prm {quitloop} will end the loop at the {\em next} -iteration so any content after it will show up. Normally this one will be issued -in a condition and we want to end that properly. Also keep in mind that because -we use local control (a nested \TEX\ expansion loop) anything you feed back can -be injected out of order. +\blank \getbuffer \blank -The three numbers can be separated by an equal sign which is a trick to avoid -look ahead issues that can result from multiple serialized numbers without spaces -that indicate the end of sequence of digits. +So, it is a complementary command to \prm {everypar}. It can only be issued +inside a paragraph. \stopnewprimitive -\startnewprimitive[title={\prm {expandedloop}}] +\startoldprimitive[title={\prm {xdef}}] -This variant of the previously introduced \prm {localcontrolledloop} doesn't -enter a local branch but immediately does its work. This means that it can be -used inside an expansion context like \prm {edef}. +This is an alternative for \type {\global \edef}: -\startbuffer -\edef\whatever - {\expandedloop 1 10 1 - {\scratchcounter=\the\currentloopiterator\relax}} +\starttyping +\xdef\MyMacro{...} +\stoptyping -\meaningasis\whatever -\stopbuffer +\stopoldprimitive -\typebuffer +\startnewprimitive[title={\prm {xdefcsname}}] -\start \veryraggedright \tt\tfx \getbuffer \stop \blank +This is the companion of \prm {xdef}: -The next section shows a companion primitive. +\starttyping +\expandafter\xdef\csname MyMacro:1\endcsname{...} + \xdefcsname MyMacro:1\endcsname{...} +\stoptyping \stopnewprimitive -\startnewprimitive[title={\prm {unexpandedloop}}] +\startoldprimitive[title={\prm {xleaders}}] -As follow up on \prm {expandedloop} we now show its counterpart: +See \prm {gleaders} for an explanation. -\startbuffer -\edef\whatever - {\unexpandedloop 1 10 1 - {\scratchcounter=\the\currentloopiterator\relax}} +\stopoldprimitive -\meaningasis\whatever -\stopbuffer +\startoldprimitive[title={\prm {xspaceskip}}] -\typebuffer +Normally the glue inserted when a space is encountered after a character with a +space factor other than 1000 is taken from the font (fontdimen 7) unless this +parameter is set in which case its value is added. -\start \veryraggedright \tt\tfx \getbuffer \stop \blank +\stopoldprimitive -The difference between the (un)expanded loops and a local controlled -one is shown here. Watch the out of order injection of \type {A}'s. +\startnewprimitive[title={\prm {xtoks}}] -\startbuffer -\edef\TestA{\localcontrolledloop 1 5 1 {A}} % out of order -\edef\TestB{\expandedloop 1 5 1 {B}} -\edef\TestC{\unexpandedloop 1 5 1 {C\relax}} -\stopbuffer +This is the global variant of \prm {etoks}. -\typebuffer \getbuffer +\stopnewprimitive -We show the effective definition as well as the outcome of using them +\startnewprimitive[title={\prm {xtoksapp}}] -\startbuffer -\meaningasis\TestA -\meaningasis\TestB -\meaningasis\TestC +This is the global variant of \prm {etoksapp}. -A: \TestA -B: \TestB -C: \TestC -\stopbuffer +\stopnewprimitive -\typebuffer \startlines \tttf \getbuffer \stoplines +\startnewprimitive[title={\prm {xtokspre}}] -Watch how because it is empty \type {\TestA} has become a constant macro because -that's what deep down empty boils down to. +This is the global variant of \prm {etokspre}. \stopnewprimitive +\startoldprimitive[title={\prm {year}}] + +This internal number starts out with the year that the job started. + +\stopoldprimitive + +\stopsubject + \startsubject[title=Obsolete] The \LUAMETATEX\ engine has more than its \LUATEX\ ancestor but it also has less. @@ -3122,6 +12518,27 @@ sort of used the same trick so there isn't much to gain and it was less generic \page + +\definehead + [Syntax] + [subsection] +% [style=\tta\bf, +% numberwidth=2fs, +% after=\blank\startpacked, +% aftersection=\stoppacked] + +\startsubject[title=Syntax] + +\startpagecolumns[page=no] + \startluacode + moduledata.engine.allspecifications() + \stopluacode +\stoppagecolumns + +\stopsubject + +\page + % % It doesn't make sense to typeset this, also because it makes me feel old. % % \startsubject[title=A few notes on extensions] % ,placeholder=todo] @@ -3286,7 +12703,7 @@ that is where it's made for. And this manual might help understand its users why where and how the low level code differs between \MKII, \MKIV\ and \LMTX. Can we expect more new primitives than the ones introduced here? Given the amount -of time I spend on experimenting and considering what made sense and what not, +of time I spent on experimenting and considering what made sense and what not, the answer probably is \quotation {no}, or at least \quotation {not that much}. As in the past no user ever requested the kind of primitives that were added, I don't expect users to come up with requests in the future either. Of course, @@ -3294,6 +12711,17 @@ those more closely related to \CONTEXT\ development look at it from the other end. Because it's there where the low level action really is, demands might still evolve. +Basically there are wo areas where the engine can evolve: the programming part +and the rendering. In this manual we focus on the programming and writing the +manual sort of influences how details get filled in. Rendering in more complex +because there heuristics and usage plays a more dominant role. Good examples are +the math, par and page builder. They were extended and features were added over +time but improved rendering came later. Not all extensions are critical, some are +there (and got added) in order to write more readable code but there is only so +much one can do in that area. Occasionally a feature pops up that is a side +effect of a challenge. No matter what gets added it might not affect complexity +too much and definitely not impact performance significantly! + Hans Hagen \crlf Hasselt NL \stopsubject @@ -3308,17 +12736,21 @@ Hans Hagen \crlf Hasselt NL local primitives = token.getprimitives() local luametatex = { } local indexed = { } + local everything = { } for i=1,#primitives do - local p = primitives[i] - if p[4] == 4 then - local name = p[3] - if find(name,"U") or find (name,"math") then + local prim = primitives[i] + local name = prim[3] + if prim[4] == 4 then + if find(name,"U") or find(name,"math") then -- ignore luametatex[name] = nil + everything[name] = false else luametatex[name] = false end + else + everything[name] = true end end @@ -3331,13 +12763,14 @@ Hans Hagen \crlf Hasselt NL luametatex[name] = true end indexed[name] = true + everything[name] = nil end end end collect(structures.registers.collected and structures.registers.collected.index) - context("To be checked primitives:") + context.startsubject { title = "To be checked primitives (new)" } context.blank() context.startcolumns { n = 2 } @@ -3349,9 +12782,51 @@ Hans Hagen \crlf Hasselt NL end end context.stopcolumns() + + context.page() + + context.stopsubject() + + everything[""] = nil + everything[" "] = nil + + context.startsubject { title = "To be checked primitives (math)" } + + context.blank() + context.startcolumns { n = 2 } + for k, v in table.sortedhash(everything) do + if not v then + context.dontleavehmode() + context.type(k) + context.crlf() + end + end + context.stopcolumns() + + context("Many primitives starting with \\type{Umath} are math parameters that are discussed elsewhere, if at all.") + + context.page() + + context.stopsubject() + + context.startsubject { title = "To be checked primitives (old)" } + context.blank() + context.startcolumns { n = 2 } + for k, v in table.sortedhash(everything) do + if v then + context.dontleavehmode() + context.type(k) + context.crlf() + end + end + context.stopcolumns() + + context.page() + + context.stopsubject() - context("Indexed primitives:") + context.startsubject { title = "Indexed primitives" } context.blank() context.startcolumns { n = 2 } @@ -3367,18 +12842,25 @@ Hans Hagen \crlf Hasselt NL context.crlf() end context.stopcolumns() - context.blank() + context.page() + + context.stopsubject() end \stopluacode -% \startmode[atpragma] -% \startluacode -% context.page() -% document.CheckCompleteness() -% \stopluacode -% \stopmode +\startmode[atpragma] + \startluacode + context.page() + document.CheckCompleteness() + \stopluacode + +% Run \type {s-system-syntax.mkxl} for a complete overview of the \LUAMETATEX\ +% primitives. +\stopmode \stopbodymatter \stoptext + +% disk and math options: orphaned diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-graphics.tex b/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-graphics.tex index 2246c1c885d..9c6fb232dd4 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-graphics.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-graphics.tex @@ -198,6 +198,42 @@ images it might make sense to have a final run with a higher compress level. The \stopsection +\startsection[title=Remote] + +You can include images from a remote location using a \URL\ specification. + +\starttyping +\externalfigure[https://www.pragma-ade.com/logo-ade.png] % via curl +\externalfigure[http://www.pragma-ade.com/logo-ade.png] % via socket +\stoptyping + +Normally the socket library will be used for \type {http} and Curl for \type +{https}. Images are cached and there is some threshold that makes sure that we +don't keep fetching. You can set the threshold to zero seconds to avoid that: + +\starttyping +\enabledirectives[schemes.threshold=0] +\stoptyping + +In \LMTX\ there are some more options: + +\starttyping +\enabledirectives[schemes.inmemory] +\enabledirectives[schemes.uselibrary] +\stoptyping + +The first option avoid storing an image in a file and therefore consumes a bit +more memory and the second one tries to use the Curl library instead of calling +the program. If you want ot see what is going on you can use: + +\starttyping +\enabletrackers[resolvers.schemes] +\enabletrackers[graphics.locating] +\enabletrackers[resolvers.virtual] +\stoptyping + +\stopsection + \stopchapter \stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-parallel.tex b/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-parallel.tex index 006088c2cb0..2690089fd1a 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-parallel.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/workflows/workflows-parallel.tex @@ -6,9 +6,9 @@ \startchapter[title={Parallel processing}] -% \startsection[title={Introduction}] +\startsection[title={Introduction}] -% \stopsection +\stopsection This is just a small intermezzo. Mid April 2020 Mojca asked on the mailing list how to best compile 5000 files, based on a template. The answer depends on the workflow @@ -115,6 +115,123 @@ This permits a management script to check if a run is done. Before starting a ru (in a separate process) the script can write that file and by just checking if it is still there, the management script can decide when a next run can be started. +\stopsection + +\startsection[title={Solution}] + +Mid 2023 the test suite had some 1900 files and whenever the engine or \CONTEXT\ +is adapted that collection of files is processed. Although one can test for +regression the main reason for doing this is to check if any of these documents +fails, which can happen due to some typo in an upgrade. We also want to see if +there is a change in performance. However, for a single run it takes some 1350 +seconds (on my current development laptop), when two runs are needed we end up as +2500 seconds. Of course a modern machine would likely bring that down to some 700 +seconds but there is only so much one can spend on hardware. + +Because \TEX\ is a single core process, the question is \quotation{Can we use +more than one core?} and the answer is \quotation {Of course we can}. Running the +test suite is managed by a (\LUA) script and one of its tasks is to traverse the +tree of files and register success or failure so that at the end we get an +overview. Parallelizing the process can be done in two ways: we divide the whole +batch in several smaller batches where each batch is processed at the same time. +Alternatively we can have one process that runs files in different threads (sort +of). + +That second option is what we prefer and the runtime results of that one are as +follows. We run on a four core mobile Xeon 1505 (with hyperthreading enabled): + +\starttabulate[|r|r|] +\NC 6 \NC 800 \NC \NR +\BC 8 \BC 700 \NC \NR +\NC 12 \NC 650 \NC \NR +\NC 16 \NC 600 \NC \NR +\stoptabulate + +As a comparison, running multiple batches in parallel gives (in seconds): + +\starttabulate[|r|r|] +\NC 4 \NC 550 \NC \NR +\NC 6 \NC 540 \NC \NR +\stoptabulate + +In the end I settled for the 8 runs in parallel, just because the machine ran +less hot (and thereby less noisy) and one can still do plenty other things during +that run. When one pipes the output to the terminal the graphic processor is also +kept busy (some 50 percent for the built|-|in graphics). + +So how does that benefit users? A variant of this feature is now available in the +\CONTEXT\ runner. Of course you could always do this: + +\starttyping +context test1.tex test2.tex test3.tex test4.tex +\stoptyping + +Here the files are processed in sequence. But you can now get a better +performance: + +\starttyping +context --parallel test1.tex test2.tex test3.tex test4.tex +\stoptyping + +In case every test file needs different command line arguments you can do this +instead: + +\starttyping +context --parallellist test.cmd +\stoptyping + +Where (on \MSWINDOWS) that file can look like: + +\starttyping +context test1 --result=test-1 +context test2 --result=test-2 +context test3 --result=test-3 +context test4 --result=test-4 +\stoptyping + +Here the runner will just take the lines that start with \type {context} which +means that you can still run that command file directly. + +By default the output is suppressed unless you pass \type {--terminal} as in: + +\starttyping +context --parallel --terminal test1.tex test2.tex test3.tex test4.tex +\stoptyping + +The only drawback in this parallel approach is that when one run stalls its +output (for instance because some huge graphic is rendered) the others will wait +a bit, just because we cycle through the runs. It also depends how console +buffering is set up. In practice this will not have much impact. + +If you use the same input file with different output, you can use this setup: + +\starttyping +context test-1 --mode=m-1 --forceinput=test +context test-2 --mode=m-2 --forceinput=test +context test-3 --mode=m-3 --forceinput=test +context test-5 --mode=m-5 --forceinput=test +context test-5 --mode=m-5 --forceinput=test +context test-6 --mode=m-6 --forceinput=test +\stoptyping + +Here the so called jobname will be the given filename \type {test-*} while thee +input will come from \type {test.tex}. Using the same input files with a result +specification doesn't work here because the multi|-|pass data file(s) and +intermediate result will clash. Running on dedicated subpath could work out but +has its own complications (creation, cleanup, moving results) and would therefore +be more fragile. + +An example of running files in a tree, like those in the test suite is: + +\starttyping +context --parallel --pattern=**/whatever*.tex +\stoptyping + +The files will be processed the directory where the file is found. When there is +an error the filename will be reported at the end of the run. + +\stopsection + \stopchapter \stopcomponent diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex b/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex index db36c93491c..362e5b6e75c 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex @@ -19,6 +19,8 @@ \useMPlibrary[punk] + \usetypescript[punk] + \definefont[PunkSmall][Serif*punkrandom @ 18pt] \definefont[PunkLarge][Serif*punkrandom @ 90pt] diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv.tex b/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv.tex index bf3df9c2d35..7ecfb220ef0 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/xml/xml-mkiv.tex @@ -1,5 +1,7 @@ % language=us runpath=texruns:manuals/xml +% engine=luatex + % author : Hans Hagen % copyright : ConTeXt Development Team % license : Creative Commons Attribution ShareAlike 4.0 International diff --git a/Master/texmf-dist/doc/man/man1/context.1 b/Master/texmf-dist/doc/man/man1/context.1 index 9a36d403c2b..150517dda7c 100644 --- a/Master/texmf-dist/doc/man/man1/context.1 +++ b/Master/texmf-dist/doc/man/man1/context.1 @@ -1,4 +1,4 @@ -.TH "mtx-context" "1" "01-01-2023" "version 1.04" "ConTeXt Process Management" +.TH "mtx-context" "1" "01-01-2024" "version 1.05" "ConTeXt Process Management" .SH NAME mtx-context - ConTeXt Process Management .SH SYNOPSIS @@ -63,7 +63,7 @@ set tracker variables (show list with --showtrackers) set directive variables (show list with --showdirectives) .TP .B --silent=list -disable logcatgories (show list with --showlogcategories) +disable logcategories (show list with --showlogcategories) .TP .B --strip strip Lua code (only meant for production where no errors are expected) @@ -83,6 +83,9 @@ don't create a dummy file (can confuse pdf viewers that keep file in view) .B --purgeresult purge result file before run .TP +.B --find=string +search for the given pattern in the documentation sources +.TP .B --forcexml force xml stub .TP @@ -154,6 +157,12 @@ assume given file present elsewhere .TP .B --nofile use dummy file as jobname +.TP +.B --forceinput +use this file as input file instead of the given one +.TP +.B --expert +show some more options .SH OPTIONS: EXPERT .TP .B --touch @@ -177,6 +186,9 @@ keep previous pdf files (jobname-pdf-keep.tmp) .B --keeplog keep previous log files (jobname-log-[run].tmp) .TP +.B --notuc +don't write a tuc file +.TP .B --lmtx force lmtx mode (when available) .TP @@ -211,6 +223,12 @@ process file with texexec .B --pipe do not check for file and enter scroll mode (--dummyfile=whatever.tmp) .TP +.B --parallel +process multiple files at the same time (you can specify a number of processes, default: 8) +.TP +.B --parallellist +process commands in this file (lines that start with 'context') +.TP .B --sandbox process file in a limited environment .TP diff --git a/Master/texmf-dist/doc/man/man1/context.man1.pdf b/Master/texmf-dist/doc/man/man1/context.man1.pdf index 15d28b40564..5b25654066a 100644 Binary files a/Master/texmf-dist/doc/man/man1/context.man1.pdf and b/Master/texmf-dist/doc/man/man1/context.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/luatools.1 b/Master/texmf-dist/doc/man/man1/luatools.1 deleted file mode 100644 index 58de54abfa2..00000000000 --- a/Master/texmf-dist/doc/man/man1/luatools.1 +++ /dev/null @@ -1,78 +0,0 @@ -.TH "luatools" "1" "01-01-2023" "version 1.35" "ConTeXt TDS Management Tool (aka luatools)" -.SH NAME - luatools - ConTeXt TDS Management Tool (aka luatools) -.SH SYNOPSIS -.B luatools [ -.I OPTIONS ... -.B ] [ -.I FILENAMES -.B ] -.SH DESCRIPTION -.B ConTeXt TDS Management Tool (aka luatools) -.SH OPTIONS -.TP -.B --generate -generate file database -.TP -.B --variables -show configuration variables -.TP -.B --configurations -show configuration order -.TP -.B --expand-braces -expand complex variable -.TP -.B --expand-path -expand variable (resolve paths) -.TP -.B --expand-var -expand variable (resolve references) -.TP -.B --show-path -show path expansion of ... -.TP -.B --var-value -report value of variable -.TP -.B --find-file -report file location -.TP -.B --find-path -report path of file -.TP -.B --make -[or --ini] make luatex format -.TP -.B --run -[or --fmt] run luatex format -.TP -.B --compile -assemble and compile lua inifile -.TP -.B --verbose -give a bit more info -.TP -.B --all -show all found files -.TP -.B --format=str -filter cf format specification (default 'tex', use 'any' for any match) -.TP -.B --pattern=str -filter variables -.TP -.B --trackers=list -enable given trackers -.SH AUTHOR -More information about ConTeXt and the tools that come with it can be found at: - - -.B "maillist:" -ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context - -.B "webpage:" -http://www.pragma-ade.nl / http://tex.aanhet.net - -.B "wiki:" -http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/luatools.man1.pdf b/Master/texmf-dist/doc/man/man1/luatools.man1.pdf deleted file mode 100644 index 65b6508dd9d..00000000000 Binary files a/Master/texmf-dist/doc/man/man1/luatools.man1.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-babel.1 b/Master/texmf-dist/doc/man/man1/mtx-babel.1 index 851c17a7ac4..293ef2d959c 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-babel.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-babel.1 @@ -1,4 +1,4 @@ -.TH "mtx-babel" "1" "01-01-2023" "version 1.20" "Babel Input To UTF Conversion" +.TH "mtx-babel" "1" "01-01-2024" "version 1.20" "Babel Input To UTF Conversion" .SH NAME mtx-babel - Babel Input To UTF Conversion .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf index 02fb444491f..6cf469e98f5 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-base.1 b/Master/texmf-dist/doc/man/man1/mtx-base.1 index 4a5133c13cf..b25656de69e 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-base.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-base.1 @@ -1,4 +1,4 @@ -.TH "mtx-base" "1" "01-01-2023" "version 1.35" "ConTeXt TDS Management Tool (aka luatools)" +.TH "mtx-base" "1" "01-01-2024" "version 1.35" "ConTeXt TDS Management Tool (aka luatools)" .SH NAME mtx-base - ConTeXt TDS Management Tool (aka luatools) .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf index 8c21ce6b9ec..bba56079620 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-bibtex.1 b/Master/texmf-dist/doc/man/man1/mtx-bibtex.1 index 79aeb0ff73a..5c18226b76b 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-bibtex.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-bibtex.1 @@ -1,4 +1,4 @@ -.TH "mtx-bibtex" "1" "01-01-2023" "version 1.00" "bibtex helpers" +.TH "mtx-bibtex" "1" "01-01-2024" "version 1.00" "bibtex helpers" .SH NAME mtx-bibtex - bibtex helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf index 32aa787d6a3..5f6055f658c 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-cache.1 b/Master/texmf-dist/doc/man/man1/mtx-cache.1 index ab1b1293c26..fb8949e517e 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-cache.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-cache.1 @@ -1,4 +1,4 @@ -.TH "mtx-cache" "1" "01-01-2023" "version 1.01" "ConTeXt & MetaTeX Cache Management" +.TH "mtx-cache" "1" "01-01-2024" "version 1.01" "ConTeXt & MetaTeX Cache Management" .SH NAME mtx-cache - ConTeXt & MetaTeX Cache Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf index b6f32c15efa..b42eeb8832d 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-chars.1 b/Master/texmf-dist/doc/man/man1/mtx-chars.1 index 059d419e252..04bbcd3fb10 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-chars.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-chars.1 @@ -1,4 +1,4 @@ -.TH "mtx-chars" "1" "01-01-2023" "version 0.10" "MkII Character Table Generators" +.TH "mtx-chars" "1" "01-01-2024" "version 0.10" "MkII Character Table Generators" .SH NAME mtx-chars - MkII Character Table Generators .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf index 76d57b5f178..517a497864e 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-check.1 b/Master/texmf-dist/doc/man/man1/mtx-check.1 index d41ba5c45cb..d81161cae42 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-check.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-check.1 @@ -1,4 +1,4 @@ -.TH "mtx-check" "1" "01-01-2023" "version 0.10" "Basic ConTeXt Syntax Checking" +.TH "mtx-check" "1" "01-01-2024" "version 0.10" "Basic ConTeXt Syntax Checking" .SH NAME mtx-check - Basic ConTeXt Syntax Checking .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf index 2020dac401a..c42c97212e5 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-colors.1 b/Master/texmf-dist/doc/man/man1/mtx-colors.1 index e072c8eda54..df4cbd19d45 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-colors.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-colors.1 @@ -1,4 +1,4 @@ -.TH "mtx-colors" "1" "01-01-2023" "version 0.10" "ConTeXt Color Management" +.TH "mtx-colors" "1" "01-01-2024" "version 0.10" "ConTeXt Color Management" .SH NAME mtx-colors - ConTeXt Color Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf index 805b63c820f..74ef5276508 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-context.1 b/Master/texmf-dist/doc/man/man1/mtx-context.1 index 9a36d403c2b..150517dda7c 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-context.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-context.1 @@ -1,4 +1,4 @@ -.TH "mtx-context" "1" "01-01-2023" "version 1.04" "ConTeXt Process Management" +.TH "mtx-context" "1" "01-01-2024" "version 1.05" "ConTeXt Process Management" .SH NAME mtx-context - ConTeXt Process Management .SH SYNOPSIS @@ -63,7 +63,7 @@ set tracker variables (show list with --showtrackers) set directive variables (show list with --showdirectives) .TP .B --silent=list -disable logcatgories (show list with --showlogcategories) +disable logcategories (show list with --showlogcategories) .TP .B --strip strip Lua code (only meant for production where no errors are expected) @@ -83,6 +83,9 @@ don't create a dummy file (can confuse pdf viewers that keep file in view) .B --purgeresult purge result file before run .TP +.B --find=string +search for the given pattern in the documentation sources +.TP .B --forcexml force xml stub .TP @@ -154,6 +157,12 @@ assume given file present elsewhere .TP .B --nofile use dummy file as jobname +.TP +.B --forceinput +use this file as input file instead of the given one +.TP +.B --expert +show some more options .SH OPTIONS: EXPERT .TP .B --touch @@ -177,6 +186,9 @@ keep previous pdf files (jobname-pdf-keep.tmp) .B --keeplog keep previous log files (jobname-log-[run].tmp) .TP +.B --notuc +don't write a tuc file +.TP .B --lmtx force lmtx mode (when available) .TP @@ -211,6 +223,12 @@ process file with texexec .B --pipe do not check for file and enter scroll mode (--dummyfile=whatever.tmp) .TP +.B --parallel +process multiple files at the same time (you can specify a number of processes, default: 8) +.TP +.B --parallellist +process commands in this file (lines that start with 'context') +.TP .B --sandbox process file in a limited environment .TP diff --git a/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf index e6d1a186400..eb1e7016699 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-convert.1 b/Master/texmf-dist/doc/man/man1/mtx-convert.1 new file mode 100644 index 00000000000..6f00ee01e0b --- /dev/null +++ b/Master/texmf-dist/doc/man/man1/mtx-convert.1 @@ -0,0 +1,42 @@ +.TH "mtx-convert" "1" "01-01-2024" "version 0.10" "ConTeXT Graphic Conversion Helpers" +.SH NAME + mtx-convert - ConTeXT Graphic Conversion Helpers +.SH SYNOPSIS +.B mtxrun --script convert [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXT Graphic Conversion Helpers +.SH OPTIONS +.TP +.B --convertall +convert all graphics on path +.TP +.B --inputpath=string +original graphics path +.TP +.B --outputpath=string +converted graphics path +.TP +.B --watch +watch folders +.TP +.B --force +force conversion (even if older) +.TP +.B --delay +time between sweeps +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-convert.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-convert.man1.pdf new file mode 100644 index 00000000000..da9e3b7d848 Binary files /dev/null and b/Master/texmf-dist/doc/man/man1/mtx-convert.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-ctan.1 b/Master/texmf-dist/doc/man/man1/mtx-ctan.1 new file mode 100644 index 00000000000..8f1edd6c621 --- /dev/null +++ b/Master/texmf-dist/doc/man/man1/mtx-ctan.1 @@ -0,0 +1,36 @@ +.TH "mtx-ctan" "1" "01-01-2024" "version 1.00" "Dealing with CTAN" +.SH NAME + mtx-ctan - Dealing with CTAN +.SH SYNOPSIS +.B mtxrun --script ctan [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B Dealing with CTAN +.SH OPTIONS +.TP +.B --packages +list available packages [--field=key|name|caption] +.TP +.B --topics +list available topics [--field=key|name|details] +.TP +.B --details +show details about package +.TP +.B --pattern=string +use this pattern, otherwise first argument +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-ctan.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-ctan.man1.pdf new file mode 100644 index 00000000000..bac80e8e6f5 Binary files /dev/null and b/Master/texmf-dist/doc/man/man1/mtx-ctan.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-dvi.1 b/Master/texmf-dist/doc/man/man1/mtx-dvi.1 index 6719dc72c9a..fec258b7399 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-dvi.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-dvi.1 @@ -1,4 +1,4 @@ -.TH "mtx-dvi" "1" "01-01-2023" "version 0.01" "ConTeXt DVI Helpers" +.TH "mtx-dvi" "1" "01-01-2024" "version 0.01" "ConTeXt DVI Helpers" .SH NAME mtx-dvi - ConTeXt DVI Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-dvi.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-dvi.man1.pdf index 2be5a748d93..aa1605b50a6 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-dvi.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-dvi.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-epub.1 b/Master/texmf-dist/doc/man/man1/mtx-epub.1 index 3b53984c7b8..2b4767d2b20 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-epub.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-epub.1 @@ -1,4 +1,4 @@ -.TH "mtx-epub" "1" "01-01-2023" "version 1.10" "ConTeXt EPUB Helpers" +.TH "mtx-epub" "1" "01-01-2024" "version 1.10" "ConTeXt EPUB Helpers" .SH NAME mtx-epub - ConTeXt EPUB Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf index 0ed71e68bfb..5957537e75a 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-evohome.1 b/Master/texmf-dist/doc/man/man1/mtx-evohome.1 index c415c5425a0..c366a7da6eb 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-evohome.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-evohome.1 @@ -1,4 +1,4 @@ -.TH "mtx-evohome" "1" "01-01-2023" "version 1.00" "Evohome Fetcher" +.TH "mtx-evohome" "1" "01-01-2024" "version 1.00" "Evohome Fetcher" .SH NAME mtx-evohome - Evohome Fetcher .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-evohome.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-evohome.man1.pdf index 65e18a4219a..dfb27f1e2fe 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-evohome.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-evohome.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-fcd.1 b/Master/texmf-dist/doc/man/man1/mtx-fcd.1 index 12ac2cd3b74..de6e98c0073 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-fcd.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-fcd.1 @@ -1,4 +1,4 @@ -.TH "mtx-fcd" "1" "01-01-2023" "version 1.00" "Fast Directory Change" +.TH "mtx-fcd" "1" "01-01-2024" "version 1.00" "Fast Directory Change" .SH NAME mtx-fcd - Fast Directory Change .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf index f12fc84c794..27e796fb05b 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-fixpdf.1 b/Master/texmf-dist/doc/man/man1/mtx-fixpdf.1 new file mode 100644 index 00000000000..24cc85aa0f6 --- /dev/null +++ b/Master/texmf-dist/doc/man/man1/mtx-fixpdf.1 @@ -0,0 +1,57 @@ +.TH "mtx-tools" "1" "01-01-2024" "version 1.01" "Some File Related Goodies" +.SH NAME + mtx-tools - Some File Related Goodies +.SH SYNOPSIS +.B mtxrun --script tools [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B Some File Related Goodies +.SH OPTIONS +.TP +.B --uncompress +uncompress using qpdf +.TP +.B --validate +validate using verapdf +.TP +.B --check +check verification result +.TP +.B --convert +convert using context +.TP +.B --compare +compare result with original +.TP +.B --compactor +use given compactor +.TP +.B --standard +use given standard +.TP +.B --pattern +processs files according to pattern +.TP +.B --silent +suppress messages +.TP +.B --once +run only once +.TP +.B --resolution +use this resolution when comparing +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-fixpdf.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-fixpdf.man1.pdf new file mode 100644 index 00000000000..116cddb2c17 Binary files /dev/null and b/Master/texmf-dist/doc/man/man1/mtx-fixpdf.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-flac.1 b/Master/texmf-dist/doc/man/man1/mtx-flac.1 index f6981986548..8fe33278614 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-flac.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-flac.1 @@ -1,4 +1,4 @@ -.TH "mtx-flac" "1" "01-01-2023" "version 0.10" "ConTeXt Flac Helpers" +.TH "mtx-flac" "1" "01-01-2024" "version 0.10" "ConTeXt Flac Helpers" .SH NAME mtx-flac - ConTeXt Flac Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf index 937f70e2612..82e75a3385e 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-fonts.1 b/Master/texmf-dist/doc/man/man1/mtx-fonts.1 index 16cd7f068f0..656d70d27c7 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-fonts.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-fonts.1 @@ -1,4 +1,4 @@ -.TH "mtx-fonts" "1" "01-01-2023" "version 1.00" "ConTeXt Font Database Management" +.TH "mtx-fonts" "1" "01-01-2024" "version 1.00" "ConTeXt Font Database Management" .SH NAME mtx-fonts - ConTeXt Font Database Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf index 249e7d091cf..1be3a90b237 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-grep.1 b/Master/texmf-dist/doc/man/man1/mtx-grep.1 index 5114ec7e21e..16eddae3690 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-grep.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-grep.1 @@ -1,4 +1,4 @@ -.TH "mtx-grep" "1" "01-01-2023" "version 0.10" "Simple Grepper" +.TH "mtx-grep" "1" "01-01-2024" "version 0.10" "Simple Grepper" .SH NAME mtx-grep - Simple Grepper .SH SYNOPSIS @@ -20,6 +20,9 @@ count matches only .B --nocomment skip lines that start with %% or # .TP +.B --noattic +skip files that hh considers irrelevant +.TP .B --n show at most n matches .TP diff --git a/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf index 8f1364766ba..7761c058341 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-install-modules.1 b/Master/texmf-dist/doc/man/man1/mtx-install-modules.1 new file mode 100644 index 00000000000..3adb4f3ba04 --- /dev/null +++ b/Master/texmf-dist/doc/man/man1/mtx-install-modules.1 @@ -0,0 +1,39 @@ +.TH "mtx-install" "1" "01-01-2024" "version 2.01" "ConTeXt Installer" +.SH NAME + mtx-install - ConTeXt Installer +.SH SYNOPSIS +.B mtxrun --script install [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXt Installer +.SH OPTIONS +.TP +.B --list +list modules +.TP +.B --installed +list installed modules +.TP +.B --install +install modules +.TP +.B --uninstall +uninstall modules +.TP +.B --module +install (zip) file(s) +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-install-modules.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-install-modules.man1.pdf new file mode 100644 index 00000000000..f56b33242a0 Binary files /dev/null and b/Master/texmf-dist/doc/man/man1/mtx-install-modules.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-install.1 b/Master/texmf-dist/doc/man/man1/mtx-install.1 new file mode 100644 index 00000000000..bb99a481402 --- /dev/null +++ b/Master/texmf-dist/doc/man/man1/mtx-install.1 @@ -0,0 +1,54 @@ +.TH "mtx-install" "1" "01-01-2024" "version 2.01" "ConTeXt Installer" +.SH NAME + mtx-install - ConTeXt Installer +.SH SYNOPSIS +.B mtxrun --script install [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXt Installer +.SH OPTIONS +.TP +.B --platform=string +platform +.TP +.B --server=string +repository url (rsync://contextgarden.net) +.TP +.B --modules=string +extra modules (can be list or 'all') +.TP +.B --fonts=string +additional fonts (can be list or 'all') +.TP +.B --goodies=string +extra binaries (like scite and texworks) +.TP +.B --install +install context +.TP +.B --update +update context +.TP +.B --erase +wipe the cache +.TP +.B --identify +create list of files +.TP +.B --secure +use curl for https +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-install.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-install.man1.pdf new file mode 100644 index 00000000000..fba8daa4ce8 Binary files /dev/null and b/Master/texmf-dist/doc/man/man1/mtx-install.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-interface.1 b/Master/texmf-dist/doc/man/man1/mtx-interface.1 index f8aa9020642..a906a1a1c38 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-interface.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-interface.1 @@ -1,4 +1,4 @@ -.TH "mtx-interface" "1" "01-01-2023" "version 0.13" "ConTeXt Interface Related Goodies" +.TH "mtx-interface" "1" "01-01-2024" "version 0.13" "ConTeXt Interface Related Goodies" .SH NAME mtx-interface - ConTeXt Interface Related Goodies .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf index 0ddac1f7e24..814c8e3e59b 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-kpse.1 b/Master/texmf-dist/doc/man/man1/mtx-kpse.1 new file mode 100644 index 00000000000..6690cbdd479 --- /dev/null +++ b/Master/texmf-dist/doc/man/man1/mtx-kpse.1 @@ -0,0 +1,61 @@ +.TH "mtx-kpse" "1" "01-01-2024" "version 1.00" "ConTeXt KPSE checking utility" +.SH NAME + mtx-kpse - ConTeXt KPSE checking utility +.SH SYNOPSIS +.B mtxrun --script kpse [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXt KPSE checking utility +.SH OPTIONS: BASIC +.TP +.B --progname +mandate, set the program name (e.g. pdftex) +.TP +.B --findfile +report the fully qualified path of the given file +.TP +.B --findfiles +report a list of all full names of the given file +.TP +.B --expandpath +expand the given path variable +.TP +.B --expandvar +expand a variable +.TP +.B --expandbraces +expand a complex variable specification +.TP +.B --varvalue +show the value of a variable +.TP +.B --readablefile +report if a file is readable +.TP +.B --filetypes +list all supported formats +.SH OPTIONS: ADDITIONAL +.TP +.B --format +format type +.TP +.B --path +path variable +.TP +.B --split +split result in lines +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-kpse.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-kpse.man1.pdf new file mode 100644 index 00000000000..19c5219a581 Binary files /dev/null and b/Master/texmf-dist/doc/man/man1/mtx-kpse.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-metapost.1 b/Master/texmf-dist/doc/man/man1/mtx-metapost.1 index 265a203e421..338ee9fa322 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-metapost.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-metapost.1 @@ -1,4 +1,4 @@ -.TH "mtx-metapost" "1" "01-01-2023" "version 0.10" "MetaPost to PDF processor" +.TH "mtx-metapost" "1" "01-01-2024" "version 0.10" "MetaPost to PDF processor" .SH NAME mtx-metapost - MetaPost to PDF processor .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf index e003e758434..acc99331dea 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-modules.1 b/Master/texmf-dist/doc/man/man1/mtx-modules.1 index 11629fedef9..5d9e481a105 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-modules.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-modules.1 @@ -1,4 +1,4 @@ -.TH "mtx-modules" "1" "01-01-2023" "version 1.00" "ConTeXt Module Documentation Generators" +.TH "mtx-modules" "1" "01-01-2024" "version 1.00" "ConTeXt Module Documentation Generators" .SH NAME mtx-modules - ConTeXt Module Documentation Generators .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf index 92ea7abe9d5..39032da12f9 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-package.1 b/Master/texmf-dist/doc/man/man1/mtx-package.1 index 33ce616ed1e..38ea0271be8 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-package.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-package.1 @@ -1,4 +1,4 @@ -.TH "mtx-package" "1" "01-01-2023" "version 0.10" "Distribution Related Goodies" +.TH "mtx-package" "1" "01-01-2024" "version 0.10" "Distribution Related Goodies" .SH NAME mtx-package - Distribution Related Goodies .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf index 4754c1ec0d2..12e4da52d00 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-patterns.1 b/Master/texmf-dist/doc/man/man1/mtx-patterns.1 index 771c86f0a9c..8f652546524 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-patterns.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-patterns.1 @@ -1,4 +1,4 @@ -.TH "mtx-patterns" "1" "01-01-2023" "version 0.20" "ConTeXt Pattern File Management" +.TH "mtx-patterns" "1" "01-01-2024" "version 0.20" "ConTeXt Pattern File Management" .SH NAME mtx-patterns - ConTeXt Pattern File Management .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf index f10dc7a6fa8..cebcb5ccc50 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-pdf.1 b/Master/texmf-dist/doc/man/man1/mtx-pdf.1 index 222261a8184..0c5dff19f45 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-pdf.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-pdf.1 @@ -1,4 +1,4 @@ -.TH "mtx-pdf" "1" "01-01-2023" "version 0.10" "ConTeXt PDF Helpers" +.TH "mtx-pdf" "1" "01-01-2024" "version 0.10" "ConTeXt PDF Helpers" .SH NAME mtx-pdf - ConTeXt PDF Helpers .SH SYNOPSIS @@ -17,6 +17,9 @@ show some info about the given file .B --metadata show metadata xml blob .TP +.B --formdata +show formdata +.TP .B --pretty replace newlines in metadata .TP @@ -24,10 +27,19 @@ replace newlines in metadata show used fonts (--detail) .TP .B --object -show object"/> +show object .TP .B --links -show links"/> +show links +.TP +.B --sign +sign document (assumes signature template) +.TP +.B --verify +verify document +.TP +.B --detail +print detail to the console .SH AUTHOR More information about ConTeXt and the tools that come with it can be found at: diff --git a/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf index 3f2e59b4d47..3731ed523f2 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-plain.1 b/Master/texmf-dist/doc/man/man1/mtx-plain.1 index c1af287c71c..00512ab3cb4 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-plain.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-plain.1 @@ -1,4 +1,4 @@ -.TH "mtx-plain" "1" "01-01-2023" "version 1.00" "Plain TeX Runner" +.TH "mtx-plain" "1" "01-01-2024" "version 1.00" "Plain TeX Runner" .SH NAME mtx-plain - Plain TeX Runner .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf index 5603f1788d0..4faa1241a81 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-profile.1 b/Master/texmf-dist/doc/man/man1/mtx-profile.1 index 13067b503fd..a5b220cd604 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-profile.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-profile.1 @@ -1,4 +1,4 @@ -.TH "mtx-profile" "1" "01-01-2023" "version 1.00" "ConTeXt MkIV LuaTeX Profiler" +.TH "mtx-profile" "1" "01-01-2024" "version 1.00" "ConTeXt MkIV LuaTeX Profiler" .SH NAME mtx-profile - ConTeXt MkIV LuaTeX Profiler .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf index cc15dd3f4ed..e912d53ce70 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-rsync.1 b/Master/texmf-dist/doc/man/man1/mtx-rsync.1 index b9e5002354c..8acda886e67 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-rsync.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-rsync.1 @@ -1,4 +1,4 @@ -.TH "mtx-rsync" "1" "01-01-2023" "version 0.10" "Rsync Helpers" +.TH "mtx-rsync" "1" "01-01-2024" "version 0.10" "Rsync Helpers" .SH NAME mtx-rsync - Rsync Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf index ec60838857d..9a1d42442a4 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-scite.1 b/Master/texmf-dist/doc/man/man1/mtx-scite.1 index 3de8ea5876a..c429bf12b56 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-scite.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-scite.1 @@ -1,4 +1,4 @@ -.TH "mtx-scite" "1" "01-01-2023" "version 1.00" "Scite Helper Script" +.TH "mtx-scite" "1" "01-01-2024" "version 1.00" "Scite Helper Script" .SH NAME mtx-scite - Scite Helper Script .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf index f8f9fec81bd..2ba6b19388f 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-server.1 b/Master/texmf-dist/doc/man/man1/mtx-server.1 index 5fa9da9cafa..50eea81f111 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-server.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-server.1 @@ -1,4 +1,4 @@ -.TH "mtx-server" "1" "01-01-2023" "version 0.10" "Simple Webserver For Helpers" +.TH "mtx-server" "1" "01-01-2024" "version 0.10" "Simple Webserver For Helpers" .SH NAME mtx-server - Simple Webserver For Helpers .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf index b5012931231..9451c031961 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-spell.1 b/Master/texmf-dist/doc/man/man1/mtx-spell.1 index 578fde17dc2..ffe3850011e 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-spell.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-spell.1 @@ -1,4 +1,4 @@ -.TH "mtx-spell" "1" "01-01-2023" "version 0.10" "ConTeXt Word Filtering" +.TH "mtx-spell" "1" "01-01-2024" "version 0.10" "ConTeXt Word Filtering" .SH NAME mtx-spell - ConTeXt Word Filtering .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-spell.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-spell.man1.pdf index 0ccdc4a80bd..e22fa499824 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-spell.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-spell.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-synctex.1 b/Master/texmf-dist/doc/man/man1/mtx-synctex.1 new file mode 100644 index 00000000000..dae4ab761a1 --- /dev/null +++ b/Master/texmf-dist/doc/man/man1/mtx-synctex.1 @@ -0,0 +1,39 @@ +.TH "mtx-synctex" "1" "01-01-2024" "version 1.01" "SyncTeX Checker" +.SH NAME + mtx-synctex - SyncTeX Checker +.SH SYNOPSIS +.B mtxrun --script synctex [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B SyncTeX Checker +.SH OPTIONS +.TP +.B --edit +open file at line: --line=.. --editor=.. sourcefile +.TP +.B --list +show all areas: synctexfile +.TP +.B --goto +open file at position: --page=.. --x=.. --y=.. [--tolerance=] --editor=.. synctexfile +.TP +.B --report +show (tex) file and line: [--direct] --page=.. --x=.. --y=.. [--tolerance=] --console synctexfile +.TP +.B --find +find (pdf) page and box: [--direct] --file=.. --line=.. synctexfile +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-synctex.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-synctex.man1.pdf new file mode 100644 index 00000000000..d1750e588cd Binary files /dev/null and b/Master/texmf-dist/doc/man/man1/mtx-synctex.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-texworks.1 b/Master/texmf-dist/doc/man/man1/mtx-texworks.1 index 0416a11b65d..7ea913aca72 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-texworks.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-texworks.1 @@ -1,4 +1,4 @@ -.TH "mtx-texworks" "1" "01-01-2023" "version 1.00" "TeXworks Startup Script" +.TH "mtx-texworks" "1" "01-01-2024" "version 1.00" "TeXworks Startup Script" .SH NAME mtx-texworks - TeXworks Startup Script .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf index a701da1af97..f1df0606d19 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-timing.1 b/Master/texmf-dist/doc/man/man1/mtx-timing.1 deleted file mode 100644 index 31b2671c99b..00000000000 --- a/Master/texmf-dist/doc/man/man1/mtx-timing.1 +++ /dev/null @@ -1,33 +0,0 @@ -.TH "mtx-timing" "1" "01-01-2023" "version 0.10" "ConTeXt Timing Tools" -.SH NAME - mtx-timing - ConTeXt Timing Tools -.SH SYNOPSIS -.B mtxrun --script timing [ -.I OPTIONS ... -.B ] [ -.I FILENAMES -.B ] -.SH DESCRIPTION -.B ConTeXt Timing Tools -.SH OPTIONS -.TP -.B --xhtml -make xhtml file -.TP -.B --launch -launch after conversion -.TP -.B --remove -remove after launching -.SH AUTHOR -More information about ConTeXt and the tools that come with it can be found at: - - -.B "maillist:" -ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context - -.B "webpage:" -http://www.pragma-ade.nl / http://tex.aanhet.net - -.B "wiki:" -http://contextgarden.net diff --git a/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf deleted file mode 100644 index 845cdbf98b8..00000000000 Binary files a/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-tools.1 b/Master/texmf-dist/doc/man/man1/mtx-tools.1 index 10751133d80..54f21ddede6 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-tools.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-tools.1 @@ -1,4 +1,4 @@ -.TH "mtx-tools" "1" "01-01-2023" "version 1.01" "Some File Related Goodies" +.TH "mtx-tools" "1" "01-01-2024" "version 1.01" "Some File Related Goodies" .SH NAME mtx-tools - Some File Related Goodies .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf index d2f4d310ab5..3ebdf0c7412 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-unicode.1 b/Master/texmf-dist/doc/man/man1/mtx-unicode.1 index 651a4c07627..bebbba61e53 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-unicode.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-unicode.1 @@ -1,4 +1,4 @@ -.TH "mtx-unicode" "1" "01-01-2023" "version 1.02" "Checker for char-dat.lua" +.TH "mtx-unicode" "1" "01-01-2024" "version 1.02" "Checker for char-dat.lua" .SH NAME mtx-unicode - Checker for char-dat.lua .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-unicode.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-unicode.man1.pdf index c6177b30ebe..e39f009a375 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-unicode.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-unicode.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-unzip.1 b/Master/texmf-dist/doc/man/man1/mtx-unzip.1 index 59725ff8376..7e2c32a06a1 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-unzip.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-unzip.1 @@ -1,4 +1,4 @@ -.TH "mtx-unzip" "1" "01-01-2023" "version 0.10" "Simple Unzipper" +.TH "mtx-unzip" "1" "01-01-2024" "version 0.10" "Simple Unzipper" .SH NAME mtx-unzip - Simple Unzipper .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf index b199828bb5c..5809d89393c 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-update.1 b/Master/texmf-dist/doc/man/man1/mtx-update.1 index 83079fb4013..a3398717d4e 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-update.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-update.1 @@ -1,4 +1,4 @@ -.TH "mtx-update" "1" "01-01-2023" "version 1.03" "ConTeXt Minimals Updater" +.TH "mtx-update" "1" "01-01-2024" "version 1.03" "ConTeXt Minimals Updater" .SH NAME mtx-update - ConTeXt Minimals Updater .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf index 4ac1a4495ae..c3dc6e8d401 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-vscode.1 b/Master/texmf-dist/doc/man/man1/mtx-vscode.1 index df9c4f9baaa..f125b36c6af 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-vscode.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-vscode.1 @@ -1,4 +1,4 @@ -.TH "mtx-vscode" "1" "01-01-2023" "version 1.00" "vscode extension generator" +.TH "mtx-vscode" "1" "01-01-2024" "version 1.00" "vscode extension generator" .SH NAME mtx-vscode - vscode extension generator .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-vscode.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-vscode.man1.pdf index 88c5e56723b..02a1a7edcb1 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-vscode.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-vscode.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-watch.1 b/Master/texmf-dist/doc/man/man1/mtx-watch.1 index 8ca17920e66..5049b1f5a89 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-watch.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-watch.1 @@ -1,4 +1,4 @@ -.TH "mtx-watch" "1" "01-01-2023" "version 1.00" "ConTeXt Request Watchdog" +.TH "mtx-watch" "1" "01-01-2024" "version 1.00" "ConTeXt Request Watchdog" .SH NAME mtx-watch - ConTeXt Request Watchdog .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf index 0f7a07fe999..d6c92a11f91 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-youless.1 b/Master/texmf-dist/doc/man/man1/mtx-youless.1 index 0f53b233ba4..e54fd1dd32b 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-youless.1 +++ b/Master/texmf-dist/doc/man/man1/mtx-youless.1 @@ -1,4 +1,4 @@ -.TH "mtx-youless" "1" "01-01-2023" "version 1.100" "youless Fetcher" +.TH "mtx-youless" "1" "01-01-2024" "version 1.100" "youless Fetcher" .SH NAME mtx-youless - youless Fetcher .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf index 5e871aa578c..f85f3634329 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtxrun.1 b/Master/texmf-dist/doc/man/man1/mtxrun.1 index 644ceefd1e2..29eeb28cc80 100644 --- a/Master/texmf-dist/doc/man/man1/mtxrun.1 +++ b/Master/texmf-dist/doc/man/man1/mtxrun.1 @@ -1,4 +1,4 @@ -.TH "mtxrun" "1" "01-01-2023" "version 1.33" "ConTeXt TDS Runner Tool" +.TH "mtxrun" "1" "01-01-2024" "version 1.33" "ConTeXt TDS Runner Tool" .SH NAME mtxrun - ConTeXt TDS Runner Tool .SH SYNOPSIS diff --git a/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf b/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf index 5b7e4e1a3db..aa4f1e9b6eb 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf differ diff --git a/Master/texmf-dist/fonts/map/luatex/context/demo-font.lum b/Master/texmf-dist/fonts/map/luatex/context/demo-font.lum new file mode 100644 index 00000000000..0beca031baa --- /dev/null +++ b/Master/texmf-dist/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/Master/texmf-dist/metapost/context/base/mpxl/mp-cont.mpxl b/Master/texmf-dist/metapost/context/base/mpxl/mp-cont.mpxl index a636a8dd618..fc6af045a7c 100644 --- a/Master/texmf-dist/metapost/context/base/mpxl/mp-cont.mpxl +++ b/Master/texmf-dist/metapost/context/base/mpxl/mp-cont.mpxl @@ -126,6 +126,8 @@ newscriptindex mfid_VSize ; mfid_VSize := scriptindex "VSize" newscriptindex mfid_EmWidth ; mfid_EmWidth := scriptindex "EmWidth" ; vardef EmWidth = runscript mfid_EmWidth enddef ; newscriptindex mfid_ExHeight ; mfid_ExHeight := scriptindex "ExHeight" ; vardef ExHeight = runscript mfid_ExHeight enddef ; +newscriptindex mfid_uunit ; mfid_uunit := scriptindex "uunit" ; vardef uu = runscript mfid_uunit enddef ; + immutable % permanent BaseLineSkip, LineHeight, BodyFontSize, TopSkip, StrutHeight, StrutDepth, CurrentWidth, CurrentHeight, HSize, VSize, EmWidth, ExHeight ; diff --git a/Master/texmf-dist/metapost/context/base/mpxl/mp-lmtx.mpxl b/Master/texmf-dist/metapost/context/base/mpxl/mp-lmtx.mpxl index e2a5b6fd1d5..7f64a4d929e 100644 --- a/Master/texmf-dist/metapost/context/base/mpxl/mp-lmtx.mpxl +++ b/Master/texmf-dist/metapost/context/base/mpxl/mp-lmtx.mpxl @@ -2677,6 +2677,9 @@ presetparameters "glyphshape" [ baseline = false, usedline = true, usedbox = true, + italic = false, + accent = false, + dimensions = false, ] ; def lmt_glyphshape = applyparameters "glyphshape" "lmt_do_glyphshape" enddef ; @@ -2697,35 +2700,194 @@ vardef glyphshape_height = lua.mp.lmt_glyphshape_height() enddef ; vardef glyphshape_depth = lua.mp.lmt_glyphshape_depth() enddef ; vardef glyphshape_italic = lua.mp.lmt_glyphshape_italic() enddef ; vardef glyphshape_accent = lua.mp.lmt_glyphshape_accent() enddef ; +vardef glyphshape_llx = lua.mp.lmt_glyphshape_llx() enddef ; + +% vardef glyphshape_dimensions = +% unitsquare +% xscaled glyphshape_width +% yscaled (glyphshape_height - glyphshape_depth) +% shifted (glyphshape_llx,glyphshape_depth) +% enddef ; + +vardef glyphshape_usedaccent = + (glyphshape_llx+glyphshape_accent,0.8*glyphshape_height) -- + (glyphshape_llx+glyphshape_accent,1.2*glyphshape_height) +enddef ; + +vardef glyphshape_useditalic = + (glyphshape_llx+glyphshape_width + glyphshape_italic,glyphshape_depth) -- + (glyphshape_llx+glyphshape_width + glyphshape_italic,glyphshape_height) +enddef ; vardef lmt_do_glyphshape = image ( pushparameters "glyphshape" ; - lua.mp.lmt_glyphshape_start(getparameter "id", getparameter "character") ; + glyphshape_start(getparameter "id", getparameter "character") ; if getparameter "shape" : - draw for i=1 upto lua.mp.lmt_glyphshape_n() : - lua.mp.lmt_glyphshape_path(i) && + draw for i=1 upto glyphshape_n : + glyphshape_path(i) && endfor cycle ; fi ; +% if getparameter "dimensions" : +% draw +% glyphshape_dimensions +% withcolor red; +% ; if getparameter "boundingbox" : draw - lua.mp.lmt_glyphshape_boundingbox() + glyphshape_boundingbox withcolor red ; fi ; - if getparameter "usedline" : + if getparameter "usedbox" : draw - lua.mp.lmt_glyphshape_usedline() + glyphshape_usedbox + withcolor blue + ; + if getparameter "usedline" : + draw + glyphshape_usedline + withcolor blue + ; + fi ; + fi ; + if (getparameter "accent") and (glyphshape_accent <> 0) : + draw glyphshape_usedaccent withcolor green ; fi ; - if getparameter "usedbox" : - draw - lua.mp.lmt_glyphshape_usedbox() - withcolor blue + if (getparameter "italic") and (glyphshape_italic <> 0) : + draw glyphshape_useditalic + withcolor green ; fi ; - lua.mp.lmt_glyphshape_stop() ; +% drawdot (glyphshape_width,0) ; +% drawdot (glyphshape_llx,0) ; + glyphshape_stop ; popparameters ; ) enddef ; + +% experimental: + +numeric last_potraced_count ; +numeric last_potraced_width ; +numeric last_potraced_height ; +numeric last_potraced_xsize ; +numeric last_potraced_ysize ; +numeric last_potraced_xoffset ; +numeric last_potraced_yoffset ; + +path last_potraced_bounds ; last_potraced_bounds := origin -- cycle ; +path last_potraced_sized ; last_potraced_sized := origin -- cycle ; + +pair last_potraced_offset ; last_potraced_offset := origin; + +presetparameters "potraced" [ + bytes = "", + width = 0, + height = 0, + nx = 1, + ny = 1, + explode = false, + swap = false, + value = "1", + optimize = false, % opticurve + threshold = 1, % alphamax + policy = "minority", % turnpolicy + tolerance = 0.2, % opttolerance + size = 2, % turdsize + % stringname = "", + % filename = "", + criterium = 127, + alternative = "path", % draw fill -> picture + polygon = false, +] ; + +numeric n_lmt_potraced ; n_lmt_potraced := 0 ; + +def lmt_potraced = applyparameters "potraced" "lmt_do_potraced" enddef ; + +vardef lmt_do_potraced = + if n_lmt_potraced = 0 : + lmt_do_startpotraced ; + lua.mp.lmt_step_potrace() + hide ( + lmt_do_steppotraced ; + lmt_do_stoppotraced ; + ) + else : + lua.mp.lmt_step_potrace() + hide ( + lmt_do_steppotraced ; + ) + fi +enddef ; + +def lmt_startpotraced = applyparameters "potraced" "lmt_do_startpotraced" enddef ; +def lmt_stoppotraced = lmt_do_stoppotraced enddef ; + +def lmt_do_startpotraced = + if n_lmt_potraced = 0 : + n_lmt_potraced := n_lmt_potraced + 1 ; + pushparameters "potraced" ; + lua.mp.lmt_start_potrace() ; + fi +enddef ; + +def lmt_do_stoppotraced = + if n_lmt_potraced = 1 : + n_lmt_potraced := n_lmt_potraced - 1 ; + lua.mp.lmt_stop_potrace() ; + popparameters ; + fi +enddef ; + +vardef lmt_do_steppotraced = + last_potraced_count := getparameter("count") ; + last_potraced_width := getparameter("width") ; + last_potraced_height := getparameter("height") ; + last_potraced_xsize := getparameter("xsize"); + last_potraced_ysize := getparameter("ysize"); + last_potraced_xoffset := getparameter("xoffset"); + last_potraced_yoffset := getparameter("yoffset"); + last_potraced_bounds := unitsquare xscaled last_potraced_width yscaled last_potraced_height ; + last_potraced_sized := unitsquare xscaled last_potraced_xsize yscaled last_potraced_ysize ; + last_potraced_offset := (last_potraced_xoffset,-(last_potraced_ysize - last_potraced_yoffset)) ; +enddef ; + +def lmt_showrivers(expr stepsize, width, height, showpolygon) = + picture q ; q := image ( + lmt_startpotraced [ + stringname = "profile", + threshold = .5, + ] ; + % draw lmt_potraced [ + % size = 1, + % index = 1, + % ] withcolor "middleyellow" ; + % draw lmt_potraced [ + % size = 1, + % index = 2, + % ] withcolor "middlegray" ; + fill lmt_potraced [ + size = 1, + first = 3, + polygon = showpolygon, + ] withcolor "middlegreen" ; + fill lmt_potraced [ + size = 3, + first = 3, + polygon = showpolygon, + ] withcolor "middleblue" ; + fill lmt_potraced [ + size = stepsize, + first = 3, + polygon = showpolygon, + ] withcolor "middlered" ; + lmt_stoppotraced ; + ) ; + + setbounds q to last_potraced_bounds enlarged (-2,-2) ; + draw q xysized (width,height) ; +enddef; diff --git a/Master/texmf-dist/metapost/context/base/mpxl/mp-tool.mpxl b/Master/texmf-dist/metapost/context/base/mpxl/mp-tool.mpxl index adc2d15106d..d2d9699f02d 100644 --- a/Master/texmf-dist/metapost/context/base/mpxl/mp-tool.mpxl +++ b/Master/texmf-dist/metapost/context/base/mpxl/mp-tool.mpxl @@ -676,8 +676,8 @@ vardef mfun_tool_striped_angle(expr option, p, asked_angle, asked_gap) text extr maximum := max (xpart llcorner mask, xpart urcorner mask, ypart llcorner mask, ypart urcorner mask) ; minimum := min (xpart llcorner mask, xpart urcorner mask, ypart llcorner mask, ypart urcorner mask) ; % a hack: -maximum := maximum + max(xpart urcorner shape, ypart urcorner shape); -minimum := minimum - max(xpart urcorner shape, ypart urcorner shape); + maximum := maximum + max(xpart urcorner shape, ypart urcorner shape); + minimum := minimum - max(xpart urcorner shape, ypart urcorner shape); % pattern := image ( if isinner : @@ -1812,33 +1812,44 @@ def drawcontrollines expr c = path temp_c ; temp_c := c ; mfun_draw_controlline def drawpointlabels expr c = path temp_c ; temp_c := c ; mfun_draw_pointlabels enddef ; def mfun_draw_points text t = -% for i=0 upto length(temp_c) if cycle temp_c : -1 fi : -% normaldraw point i of temp_c mfun_opt_pnt t ; -% endfor ; for i within temp_c : normaldraw pathpoint mfun_opt_pnt t ; endfor ; enddef; -def mfun_draw_controlpoints text t = -% for i=0 upto length(temp_c) : -% normaldraw precontrol i of temp_c mfun_opt_ctr t ; -% normaldraw postcontrol i of temp_c mfun_opt_ctr t ; +% def mfun_draw_controlpoints text t = +% for i within temp_c : +% normaldraw pathprecontrol t mfun_opt_ctr t ; +% normaldraw pathpostcontrol t mfun_opt_ctr t ; % endfor ; +% enddef; + +% def mfun_draw_controllines text t = +% for i within temp_c : +% normaldraw pathpoint -- pathprecontrol t mfun_opt_lin t ; +% normaldraw pathpoint -- pathpostcontrol t mfun_opt_lin t ; +% endfor ; +% enddef; + +def mfun_draw_controlpoints text t = for i within temp_c : - normaldraw pathprecontrol t mfun_opt_ctr t ; - normaldraw pathpostcontrol t mfun_opt_ctr t ; + if (pathstate == 0) or (pathstate == 2) : + normaldraw pathprecontrol t mfun_opt_ctr t ; + fi ; + if (pathstate == 0) or (pathstate == 1) : + normaldraw pathpostcontrol t mfun_opt_ctr t ; + fi ; endfor ; enddef; def mfun_draw_controllines text t = -% for i=0 upto length(temp_c) : -% normaldraw point i of temp_c -- precontrol i of temp_c mfun_opt_lin t ; -% normaldraw point i of temp_c -- postcontrol i of temp_c mfun_opt_lin t ; -% endfor ; for i within temp_c : - normaldraw pathpoint -- pathprecontrol t mfun_opt_lin t ; - normaldraw pathpoint -- pathpostcontrol t mfun_opt_lin t ; + if (pathstate == 0) or (pathstate == 2) : + normaldraw pathpoint -- pathprecontrol t mfun_opt_lin t ; + fi ; + if (pathstate == 0) or (pathstate == 1) : + normaldraw pathpoint -- pathpostcontrol t mfun_opt_lin t ; + fi ; endfor ; enddef; diff --git a/Master/texmf-dist/scripts/context/lua/mtx-context.lua b/Master/texmf-dist/scripts/context/lua/mtx-context.lua index 2991dbcc42c..1030e7a23b5 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-context.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-context.lua @@ -1,5 +1,3 @@ --- 8dec23 --socket added to restart per akira/hans (mail of 7dec23). - if not modules then modules = { } end modules['mtx-context'] = { version = 1.001, comment = "companion to mtxrun.lua", @@ -13,7 +11,7 @@ if not modules then modules = { } end modules['mtx-context'] = { local type, next, tostring, tonumber = type, next, tostring, tonumber local format, gmatch, match, gsub, find = string.format, string.gmatch, string.match, string.gsub, string.find -local quote, validstring, splitstring = string.quote, string.valid, string.split +local quote, validstring, splitstring, splitlines = string.quote, string.valid, string.split, string.splitlines local sort, concat, insert, sortedhash, tohash = table.sort, table.concat, table.insert, table.sortedhash, table.tohash local settings_to_array = utilities.parsers.settings_to_array local appendtable = table.append @@ -35,9 +33,13 @@ local removefile = os.remove local renamefile = os.rename local formatters = string.formatters +local starttiming = statistics.starttiming +local stoptiming = statistics.stoptiming +local elapsedtime = statistics.elapsedtime + local application = logs.application { name = "mtx-context", - banner = "ConTeXt Process Management 1.04", + banner = "ConTeXt Process Management 1.06", -- helpinfo = helpinfo, -- table with { category_a = text_1, category_b = text_2 } or helpstring or xml_blob helpinfo = "mtx-context.xml", } @@ -472,7 +474,7 @@ end local pdfview -- delayed local function pdf_open(name,method) - statistics.starttiming("pdfview") + starttiming("pdfview") pdfview = pdfview or dofile(resolvers.findfile("l-pdfview.lua","tex")) pdfview.setmethod(method) report(pdfview.status()) @@ -481,12 +483,12 @@ local function pdf_open(name,method) pdfname = name .. ".pdf" -- agressive end pdfview.open(pdfname) - statistics.stoptiming("pdfview") - report("pdfview overhead: %s seconds",statistics.elapsedtime("pdfview")) + stoptiming("pdfview") + report("pdfview overhead: %s seconds",elapsedtime("pdfview")) end local function pdf_close(name,method) - statistics.starttiming("pdfview") + starttiming("pdfview") pdfview = pdfview or dofile(resolvers.findfile("l-pdfview.lua","tex")) pdfview.setmethod(method) local pdfname = filenewsuffix(name,"pdf") @@ -495,7 +497,7 @@ local function pdf_close(name,method) end pdfname = name .. ".pdf" -- agressive pdfview.close(pdfname) - statistics.stoptiming("pdfview") + stoptiming("pdfview") end -- result file handling @@ -613,17 +615,20 @@ local function flags_to_string(flags,prefix) -- context flags get prepended by c: ... this will move to the sbx module local t = { } for k, v in table.sortedhash(flags) do + local p if prefix then - k = format("c:%s",k) + p = format("c:%s",k) + else + p = k end if not v or v == "" or v == '""' then -- no need to flag false elseif v == true then - t[#t+1] = format('--%s',k) + t[#t+1] = format('--%s',p) elseif type(v) == "string" then - t[#t+1] = format('--%s=%s',k,quote(v)) + t[#t+1] = format('--%s=%s',p,quote(v)) else - t[#t+1] = format('--%s=%s',k,tostring(v)) + t[#t+1] = format('--%s=%s',p,tostring(v)) end end return concat(t," ") @@ -696,6 +701,7 @@ function scripts.context.run(ctxdata,filename) local a_jithash = getargument("jithash") local a_permitloadlib = getargument("permitloadlib") local a_texformat = getargument("texformat") + local a_notuc = getargument("notuc") local a_keeptuc = getargument("keeptuc") local a_keeplog = getargument("keeplog") local a_keeppdf = getargument("keeppdf") @@ -910,6 +916,8 @@ function scripts.context.run(ctxdata,filename) -- local directives = { } -- + -- todo: handle these at the tex end + -- if a_nodates then directives[#directives+1] = format("backend.date=%s",type(a_nodates) == "string" and a_nodates or "no") end @@ -922,6 +930,11 @@ function scripts.context.run(ctxdata,filename) directives[#directives+1] = format("system.profile=%s",tonumber(a_profile) or 0) end -- + -- if a_notuc then + -- removefile(fileaddsuffix(jobname,"tuc")) + -- directives[#directives+1] = "job.save=no" -- handled at tex end + -- end + -- for i=1,#synctex_runfiles do removefile(fileaddsuffix(jobname,synctex_runfiles[i])) end @@ -1207,10 +1220,10 @@ do -- more or less copied from mtx-plain.lua: local function engine(texengine,texformat) local command = string.format('%s --ini --etex --8bit %s \\dump',texengine,fileaddsuffix(texformat,"mkii")) if environment.arguments.silent then - statistics.starttiming() + starttiming() local command = format("%s > temp.log",command) local result = os.execute(command) - local runtime = statistics.stoptiming() + local runtime = stoptiming() if result ~= 0 then print(format("%s silent make > fatal error when making format %q",texengine,texformat)) -- we use a basic print else @@ -1249,7 +1262,7 @@ do -- more or less copied from mtx-plain.lua: fmtpathspec = "." end end - fmtpathspec = string.splitlines(fmtpathspec)[1] or fmtpathspec + fmtpathspec = splitlines(fmtpathspec)[1] or fmtpathspec fmtpathspec = fmtpathspec and file.splitpath(fmtpathspec) local fmtpath = nil if fmtpathspec then @@ -1728,6 +1741,189 @@ function scripts.context.extra() end end +-- experiment + +do + + local popen = io.popen + local close = io.close + ----- read = io.read + local gobble = io.gobble or function(f) f:read("l") end + ----- clock = os.clock + local ticks = lua.getpreciseticks + local seconds = lua.getpreciseseconds + + local f_runner = formatters['context %s "%s"'] + local f_command = formatters['%s %s'] + + function scripts.context.parallel() + if getargument("pattern") then + environment.files = dir.glob(getargument("pattern")) + end + local files = environment.files + local total = files and #files or 0 + local list = nil + if getargument("parallellist") then + list = { } + for i=1,#files do + -- could be an lpeg + local name = files[i] + local data = splitlines(io.loaddata(name) or "") + if data then + for i=1,#data do + local line = data[i] + if string.find(line,"^context ") then + list[#list+1] = line + end + end + end + end + files = list + total = #list + end + if not list and total == 1 then + -- Beware: "--parallel" and "--terminal" are passed to the single run but this + -- is normally harmless. + scripts.context.autoctx() + elseif total > 0 then + local results = { } + local start = starttiming("parallel") + local terminal = environment.argument("terminal") + local runners = tonumber(environment.argument("parallel")) or 8 + local process = { } + local count = 0 + -- a hack + local passthese = environment.arguments_after + for i=1,#passthese do + local a = passthese[i] + if string.find(a,"^%-%-parallel") or string.find(a,"^%-%-terminal") or not find(a,"^%-%-") then + passthese[i] = "" + end + end + passthese = table.unique(passthese) + -- end of hack + local arguments = environment.reconstructcommandline(passthese) + local whattodo = list and "command" or "filename" + while true do + local done = false + for i=1,runners do + local pi = process[i] + if pi then + local s + if terminal then + s = pi.handle:read("l") + if s then + done = true + report("%02i : %s",i,s) + goto done + end + else + s = gobble(pi.handle) + if s then + done = true + goto done + end + end + if not s then + local r, detail, n = close(pi.handle) + stoptiming(pi.timer) + pi.result = (not r or n > 0) and "error" or "done" + pi.time = elapsedtime(pi.timer) + pi.handle = nil + pi.timer = nil + if terminal then + report() + end + report("process %02i, index %02i, %s %a, status %a, runtime %0.3f",i,pi.count,whattodo,pi.filename,pi.result,pi.time) + if terminal then + report() + end + process[i] = false + results[pi.count] = pi + end + end + count = count + 1 + if count > total then + -- we're done + else + local timer = "parallel:" .. i + local filename = files[count] + local dirname = file.dirname(filename) + local basename = file.basename(filename) + if dirname ~= "." and dirname ~= "./" then + dir.push(dirname) + end + local command = list and f_command(basename,arguments) or f_runner(arguments,basename) + starttiming(timer) + local result = popen(command) + if dirname ~= "." then + dir.pop() + end + local status = nil + if result then + process[i] = { + handle = result, + result = "start", + filename = filename, + count = count, + time = 0, + timer = timer, + } + status = process[i] + else + status = { + result = "error", + count = count, + filename = filename, + time = 0, + } + stoptiming(timer) + end + results[count] = status + if terminal then + report() + end + report("process %02i, index %02i, %s %a, status %a",i,status.count,whattodo,status.filename,status.result) + if terminal then + report() + end + done = true + end + ::done:: + end + if not done then + break + end + end + stoptiming("parallel") + results.runtime = elapsedtime("parallel") + report() + report("files: %i, runtime: %s",total,results.runtime) + report() + local errors = { } + for i=1,total do + local ri = results[i] + local result = ri.result + local filename = ri.filename + if result == "error" then + errors[#errors+1] = filename + end + report("index %02i, %s %a, status %a, runtime %0.3f ",ri.count,whattodo,filename,result,ri.time) + end + if #errors > 0 then + report() + report("errors in:") + report() + for i=1,#errors do + report(" %s",errors[i]) + end + end + report() + end + end + +end + -- todo: we need to do a dummy run local function showsetter() @@ -1748,6 +1944,35 @@ function scripts.context.logcategories() scripts.context.run() end +function scripts.context.find(pattern) + if pattern ~= "" then + local found = resolvers.findfile("luametatex.tex") + if found and found ~= "" then + for i=1,6 do + found = file.pathpart(found) + end + end + local files = dir.glob(found.."**.tex") + for i=1,#files do + local f = files[i] + local d = io.loaddata(f) + if find(d,pattern) then + local l = splitlines(d) + report(f) + report("") + for i=1,#l do + if find(l[i],pattern) then + report("%5i %s",i,l[i]) + end + end + report("") + end + end + else + report("there is nothing to search for") + end +end + function scripts.context.timed(action) statistics.timed(action,true) end @@ -1817,7 +2042,9 @@ else multipass_forcedruns = tonumber(getargument("forcedruns")) or nil end -if getargument("run") then +if getargument("parallel") or getargument("parallellist") then + scripts.context.timed(scripts.context.parallel) +elseif getargument("run") then scripts.context.timed(scripts.context.autoctx) elseif getargument("make") then scripts.context.timed(function() scripts.context.make() end) @@ -1832,7 +2059,7 @@ elseif getargument("touch") then scripts.context.touch() elseif getargument("pages") then scripts.context.pages() -elseif getargument("expert") then +elseif getargument("expert") then -- or getargument("special") then application.help("expert", "special") elseif getargument("showmodules") or getargument("modules") then scripts.context.modules() @@ -1856,6 +2083,15 @@ elseif getargument("showdirectives") or getargument("directives") == true then elseif getargument("showlogcategories") then scripts.context.logcategories() elseif environment.filenames[1] or getargument("nofile") then + -- -- + -- -- How compatible is this ... we might want to resolve the wildcard at the TeX, so + -- -- we just keep this as unsuported feature (but at least we know of this case): + -- + -- if not getargument("pattern") and find(environment.filenames[1],"%*") then + -- environment.filenames = dir.glob(environment.filenames[1]) + -- -- setargument("pattern",dir.glob(environment.filenames[1])) + -- end + -- scripts.context.timed(scripts.context.autoctx) elseif getargument("pipe") then scripts.context.timed(scripts.context.pipe) @@ -1865,6 +2101,9 @@ elseif getargument("purge") then elseif getargument("purgeall") then -- only when no filename given, supports --pattern scripts.context.purge(true,nil,true) +elseif getargument("find") then + -- context --find="%\framed" + scripts.context.find(getargument("find")) elseif getargument("pattern") then environment.filenames = dir.glob(getargument("pattern")) scripts.context.timed(scripts.context.autoctx) diff --git a/Master/texmf-dist/scripts/context/lua/mtx-context.xml b/Master/texmf-dist/scripts/context/lua/mtx-context.xml index bf341c21a9f..bd585a703de 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-context.xml +++ b/Master/texmf-dist/scripts/context/lua/mtx-context.xml @@ -4,7 +4,7 @@ mtx-context ConTeXt Process Management - 1.04 + 1.05 external helpinfo file @@ -68,7 +68,7 @@ set directive variables (show list with ) - disable logcatgories (show list with ) + disable logcategories (show list with ) strip Lua code (only meant for production where no errors are expected) @@ -88,6 +88,9 @@ purge result file before run + + search for the given pattern in the documentation sources + @@ -177,9 +180,17 @@ assume given file present elsewhere - + use dummy file as jobname + + use this file as input file instead of the given one + + + + + show some more options + @@ -208,6 +219,9 @@ keep previous log files (jobname-log-[run].tmp) + + don't write a tuc file + force lmtx mode (when available) @@ -252,6 +266,14 @@ do not check for file and enter scroll mode (=whatever.tmp) + + + process multiple files at the same time (you can specify a number of processes, default: 8) + + + process commands in this file (lines that start with 'context') + + process file in a limited environment diff --git a/Master/texmf-dist/scripts/context/lua/mtx-convert.lua b/Master/texmf-dist/scripts/context/lua/mtx-convert.lua index 61ce1504072..c24d77262e1 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-convert.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-convert.lua @@ -172,10 +172,10 @@ end if environment.arguments.convertall then convert.convertall() -elseif environment.files[1] then - convert.convertgiven() elseif environment.argument("exporthelp") then application.export(environment.argument("exporthelp"),environment.files[1]) +elseif environment.files[1] then + convert.convertgiven() else application.help() end diff --git a/Master/texmf-dist/scripts/context/lua/mtx-ctan.lua b/Master/texmf-dist/scripts/context/lua/mtx-ctan.lua index 6de51caa3ce..7603e363bd3 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-ctan.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-ctan.lua @@ -141,6 +141,7 @@ end local function checkedpattern(pattern) if pattern then + pattern = string.topattern(pattern,true) return lower(shaped(pattern)) end end @@ -291,7 +292,7 @@ scripts.ctan.topics = json and found[#found+1] = { key or name, details } end else - if strfound(pattern,name) or strfound(pattern,details) then + if strfound(pattern,key or name) or strfound(pattern,details) then found[#found+1] = { key or name, details } end end diff --git a/Master/texmf-dist/scripts/context/lua/mtx-fixpdf.lua b/Master/texmf-dist/scripts/context/lua/mtx-fixpdf.lua new file mode 100644 index 00000000000..78949a69d22 --- /dev/null +++ b/Master/texmf-dist/scripts/context/lua/mtx-fixpdf.lua @@ -0,0 +1,203 @@ +if not modules then modules = { } end modules ['mtx-fixpdf'] = { + 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" +} + +local find, lower = string.find, string.lower +local formatters = string.formatters +local nameonly, suffix = file.nameonly, file.suffix + +local helpinfo = [[ + + + + mtx-tools + Some File Related Goodies + 1.01 + + + + + uncompress using qpdf + validate using verapdf + check verification result + convert using context + compare result with original + use given compactor + use given standard + + + processs files according to pattern + suppress messages + run only once + use this resolution when comparing + + + + +]] + +local application = logs.application { + name = "mtx-fixpdfs", + banner = "Making PDF files more compliant", + helpinfo = helpinfo, +} + +local report = application.report +local writeln = (logs and logs.writer) or (texio and texio.write_nl) or print + +scripts = scripts or { } +scripts.fixpdf = scripts.fixpdf or { } + +local function getfiles() + local pattern = environment.arguments.pattern + if pattern then + return dir.glob(pattern) or { } + else + return environment.files + end +end + +local function validfile(filename) + name = nameonly(filename) + return suffix(filename) == "pdf" and not find(name,"%-out$") and not find(name,"%-uncompressed$") and name or false +end + +function scripts.fixpdf.uncompress() + local files = environment.files + for i=1,#files do + local name = validfile(files[i]) + if name then + local command = formatters["qpdf --stream-data=uncompress --object-streams=disable %s.pdf %s-uncompressed.pdf"](name,name) + report("uncompressing %s.pdf -> %s-uncompressed.pdf",name,name) + os.execute(command) + end + end +end + +function scripts.fixpdf.validate() + local files = getfiles() + for i=1,#files do + local name = validfile(files[i]) + if name then + local command = formatters["verapdf %s-out.pdf > %s-out.txt"](name,name) + report("validating %s-out.pdf -> %s-out.txt",name,name) + os.execute(command) + end + end +end + +function scripts.fixpdf.check() + local files = getfiles() + for i=1,#files do + local name = validfile(files[i]) + if name then + local data = io.loaddata(formatters["%s-out.txt"](name)) + local atad = data and lower(data) + local t = { } + local compliant = atad and find(atad,"pdf file is compliant with validation profile requirements") + local hasmasks = atad and find(atad,"smask") + local fontissue = atad and find(atad,"errormessage.*font") + if compliant then + t = { "okay" } + else + if fontissue then + t[#t+1] = "font" + end + if hasmasks then + t[#t+1] = "mask" + end + end + if #t == 0 then + t = { "issue" } + end + report("checking %s-out.pdf : % t",name,t) + end + end +end + +function scripts.fixpdf.convert() + local files = getfiles() + local compactor = environment.arguments.compactor + local standard = environment.arguments.standard + local silent = environment.arguments.silent and "--batch --silent" or "" + local once = environment.arguments.silent and "--once " or "" + local nocompression = environment.arguments.nocompression and "--nocompression" or "" + local extrastyle = environment.arguments.extrastyle or "" + if type(compactor) ~= "string" then + compactor = "yes" + end + if type(standard) ~= "string" then + standard = "PDF/A-1a:2005" + end + for i=1,#files do + local name = validfile(files[i]) + if name then + -- "--batch --silent --once" can speed up if needed + local command = formatters["context --global s-pdf-fix.mkxl --compactor=%s --extrastyle=%s --standard=%s %s %s %s --pdffile=%s.pdf --result=%s-out"](compactor,extrastyle,standard,once,silent,nocompression,name,name) + report("converting %s.pdf -> %s-out.pdf",name,name) + os.execute(command) + end + end +end + +function scripts.fixpdf.compare() + local files = getfiles() + local resolution = tonumber(environment.arguments.resolution) or 72 + local tempdir = "temp-compare" + local workdir = lfs.currentdir() + dir.makedirs(tempdir) + if lfs.chdir(tempdir) then + for i=1,#files do + local name = validfile(files[i]) + if name then + local files = dir.glob("*.png") + for i=1,#files do + os.remove(files[i]) + end + print(oldname) + local command = string.format('mutool draw -c gray -o temp-old-%%d.png -r %i -A 0/0 -N ../%s.pdf',resolution,name) + print(command) + os.execute(command) + print(newname) + local command = string.format('mutool draw -c gray -o temp-new-%%d.png -r %i -A 0/0 -N ../%s-out.pdf',resolution,name) + print(command) + os.execute(command) + local files = dir.glob(string.format("temp-new-*.png",newpngname)) + for i=1,#files do + local command = string.format('gm compare -colorspace gray -highlight-color red -file temp-diff-%i.png temp-old-%i.png temp-new-%i.png',i,i,i) + print(command) + os.execute(command) + end + os.remove("context-extra.pdf") + command = string.format('context --extra=convert --pattern="temp-diff-*.png" --once --purgeall --result=%s-compare',name) + print(command) + os.execute(command) + local files = dir.glob("*.png") + for i=1,#files do + os.remove(files[i]) + end + -- we keep the file on temp-compare + end + end + end +end + +if environment.argument("uncompress") then + scripts.fixpdf.uncompress() +elseif environment.argument("validate") then + scripts.fixpdf.validate() +elseif environment.argument("check") then + scripts.fixpdf.check() +elseif environment.argument("convert") then + scripts.fixpdf.convert() +elseif environment.argument("compare") then + scripts.fixpdf.compare() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) +else + application.help() +end diff --git a/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua b/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua index 746a010c8a2..3d43e9fc49b 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua @@ -16,7 +16,10 @@ local lower, gsub = string.lower, string.gsub local concat = table.concat local write_nl = (logs and logs.writer) or (texio and texio.write_nl) or print -local otlversion = 3.133 +local versions = { + otl = 3.140, + one = 1.520, +} local helpinfo = [[ @@ -288,14 +291,19 @@ local function showfeatures(tag,specification) for f,ff in table.sortedhash(data) do local done = false for s, ss in table.sortedhash(ff) do - if s == "*" then s = "all" end - if ss ["*"] then ss["*"] = nil ss.all = true end + local s = s == "*" and all or s + if ss["*"] then + ss["*"] = nil + ss.all = true + end + local name if done then - f = "" + name = "" else done = true + name = f end - report(" %-8s %-8s %-8s",f,s,concat(table.sortedkeys(ss), " ")) -- todo: padd 4 + report(" %-8s %-8s %-8s",name,s,concat(table.sortedkeys(ss), " ")) -- todo: padd 4 end end end @@ -471,10 +479,22 @@ end function scripts.fonts.unpack() local name = removesuffix(basename(givenfiles[1] or "")) if name and name ~= "" then - local cacheid = getargument("cache") or "otl" - local cache = containers.define("fonts", cacheid, otlversion, true) -- cache is temp - local cleanname = containers.cleanname(name) - local data = containers.read(cache,cleanname) + local cacheid = false + local cache = false + local cleanname = false + local data = false + local list = { getargument("cache") or false, "otl", "one" } + for i=1,#list do + cacheid = list[i] + if cacheid then + cache = containers.define("fonts", cacheid, versions[cacheid], true) -- cache is temp + cleanname = containers.cleanname(name) + data = containers.read(cache,cleanname) + if data then + break + end + end + end if data then local savename = addsuffix(cleanname .. "-unpacked","tma") report("fontsave, saving data in %s",savename) diff --git a/Master/texmf-dist/scripts/context/lua/mtx-grep.lua b/Master/texmf-dist/scripts/context/lua/mtx-grep.lua index e4a2a8d2f07..ae27e9d734e 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-grep.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-grep.lua @@ -23,6 +23,7 @@ local helpinfo = [[ search for pattern (optional) count matches only skip lines that start with %% or # + skip files that hh considers irrelevant show at most n matches only show first match return the match (if it is one) @@ -81,33 +82,41 @@ function scripts.grep.find(pattern, files, offset) local nofmatches, noffiles, nofmatchedfiles = 0, 0, 0 local n, m, check = 0, 0, nil local name = "" + local noattic = environment.argument("noattic") local count = environment.argument("count") local nocomment = environment.argument("nocomment") local max = tonumber(environment.argument("n")) or (environment.argument("first") and 1) or false local domatch = environment.argument("match") + -- for me: + local function skip(name) + return noattic and (find(name,"attic") or find(name,"backup") or find(name,"old") or find(name,"keep") or find(name,"install") or find(name,"texmf")) + end + -- if environment.argument("xml") then for i=offset or 1, #files do local globbed = dir.glob(files[i]) for i=1,#globbed do name = globbed[i] - local data = xml.load(name) - if data and not data.error then - n, m, noffiles = 0, 0, noffiles + 1 - if count then - for c in xml.collected(data,pattern) do - m = m + 1 - end - if m > 0 then - nofmatches = nofmatches + m - nofmatchedfiles = nofmatchedfiles + 1 - write_nl(format("%5i %s",m,name)) - io.flush() - end - else - for c in xml.collected(data,pattern) do - m = m + 1 - if not max or m <= max then - write_nl(format("%s: %s",name,xml.tostring(c))) + if not skip(name) then + local data = xml.load(name) + if data and not data.error then + n, m, noffiles = 0, 0, noffiles + 1 + if count then + for c in xml.collected(data,pattern) do + m = m + 1 + end + if m > 0 then + nofmatches = nofmatches + m + nofmatchedfiles = nofmatchedfiles + 1 + write_nl(format("%5i %s",m,name)) + io.flush() + end + else + for c in xml.collected(data,pattern) do + m = m + 1 + if not max or m <= max then + write_nl(format("%s: %s",name,xml.tostring(c))) + end end end end @@ -173,7 +182,7 @@ function scripts.grep.find(pattern, files, offset) local globbed = dir.glob(files[i]) for i=1,#globbed do name = globbed[i] - if not find(name,"/%.") then + if not find(name,"/%.") and not skip(name) then local data = io.loaddata(name) if data then n, m, noffiles = 0, 0, noffiles + 1 diff --git a/Master/texmf-dist/scripts/context/lua/mtx-install-modules.lua b/Master/texmf-dist/scripts/context/lua/mtx-install-modules.lua new file mode 100644 index 00000000000..1fa9396d653 --- /dev/null +++ b/Master/texmf-dist/scripts/context/lua/mtx-install-modules.lua @@ -0,0 +1,373 @@ +if not modules then modules = { } end modules ['mtx-install-modules'] = { + version = 1.234, + comment = "companion to mtxrun.lua", + author = "Hans Hagen", + copyright = "ConTeXt Development Team", + license = "see context related readme files" +} + +-- Installing tikz is a bit tricky because there are many packages involved and it's +-- sort of impossible to derive from the names what to include in the installation. +-- I tried to use the ctan scrips we ship but there is no way to reliably derive a +-- set from the topics or packages using the web api (there are also some +-- inconsistencies between the json and xml interfaces that will not be fixed). A +-- wildcard pull of everything tikz/pgf is likely to fail or at least gives files we +-- don't want and/or need, the solution is to be specific. +-- +-- After that was implemented the script changed name and now also installs the +-- third party modules. +-- +-- We use curl and not the built in socket library because all kind of ssl and +-- redirection can kick in and who know how it evolves. +-- +-- We use the context unzipper because we cannot be sure if unzip is present on the +-- system. In many cases windows, linux and osx installations lack it by default. +-- +-- This script should be run in the tex root where there is also a texmf-context sub +-- directory; it will quit otherwise. The modules path will be created when absent. +-- +-- Maybe some day we can get the modules from ctan but then we need a consistent +-- names and such. + +local find = string.find + +local helpinfo = [[ + + + + mtx-install + ConTeXt Installer + 2.01 + + + + + list modules + list installed modules + install modules + uninstall modules + install (zip) file(s) + + + + + + Examples + + mtxrun --script install-modules --list + + + mtxrun --script install-modules --install filter letter + mtxrun --script install-modules --install tikz + mtxrun --script install-modules --install --all + + + mtxrun --script install-modules --install --module t-letter.zip + mtxrun --script install-modules --uninstall --module t-letter.zip + + + mtxrun --script install-modules --installed + + + + +]] + +local application = logs.application { + name = "mtx-install-modules", + banner = "ConTeXt Module Installer 1.00", + helpinfo = helpinfo, +} + +local report = application.report + +scripts = scripts or { } +scripts.modules = scripts.modules or { } + +local okay, curl = pcall(require,"libs-imp-curl") + +local fetched = curl and curl.fetch and function(str) + local data, message = curl.fetch { + url = str, + followlocation = true, + sslverifyhost = false, + sslverifypeer = false, + } + if not data then + report("some error: %s",message) + end + return data +end or function(str) + -- So, no redirect to http, which means that we cannot use the built in socket + -- library. What if the client is happy with http? + local data = os.resultof("curl -sSL " .. str) + return data +end + +-- We use some abstraction: + +local urls = { + ctan = "https://mirrors.ctan.org/install", + modules = "https://modules.contextgarden.net/dl" +} + +-- Some package this in the root which is asking for conflicts. + +-- local badones = { +-- -- "LICENSE", +-- -- "README", +-- -- "README.md", +-- -- "VERSION", +-- } + +local tmpzipfile = "temp.zip" +local checkdir = "texmf-context" +local targetdir = "texmf-modules" +local basefile = "mtx-install-imp-modules.lua" +local lists = false + +-- local lists = { +-- ["tikz"] = { +-- url = "ctan", +-- zips = { }, -- table of zip files +-- wipes = { }, -- (nested) table of delete patterns +-- }, +-- ["filter"] = { +-- url = "modules", +-- zips = { "t-filter.zip" } +-- }, +-- } + +local function loadlists() + if not lists then + lists = { } + local mainfile = resolvers.findfile(basefile) + if mainfile and mainfile ~= "" then + local path = file.pathpart(mainfile) + local files = dir.glob((path == "" and "." or path) .. "/mtx-install-imp*.lua") + for i=1,#files do + local name = files[i] + local data = table.load(name) + if data then + local entries = data.lists + if entries then + report("loading entries from file %a",name) + for entry, data in table.sortedhash(entries) do + if lists[entry] then + report("entry %a already set from %a",entry,name) + else + lists[entry] = data + end + end + else + report("no entries in file %a",name) + end + end + end + else + report("base file %a is not found",basefile) + end + report() + end +end + +local function validate(n) + return not ( + find(n,"latex") + or find(n,"lualatex") + or find(n,"plain") + or find(n,"optex") + -- or find(n,"luatex") + -- or find(n,"pdftex") + ) +end + +local function install(list,wipe) + if type(list) ~= "table" then + report("unknown specification") + end + local zips = list.zips + local wipes = list.wipes + if type(zips) ~= "table" then + report("incomplete specification") + else + -- report("installing into %a",targetdir) + for i=1,#zips do + local remote = list.url + local where = zips[i] + local hash = file.addsuffix(sha2.HASH256(where),"tma") + local data = table.load(hash) + if data then + local name = data.name + local list = data.list + if name and list then + report() + report("removing %i old files for %a",#list,name) + report() + for i=1,#list do + os.remove(list[i]) + end + end + end + if not wipe then + if remote then + where = (urls[remote] or remote) .. "/" .. where + end + local data = fetched(where) + if string.find(data,"^PK") then + io.savedata(tmpzipfile,data) + report("from %a",where) + report("into %a",targetdir) + local done = utilities.zipfiles.unzipdir { + zipname = tmpzipfile, + path = ".", + verbose = "steps", + collect = true, + validate = validate, + } + table.save(hash,{ name = where, list = done }) + os.remove(tmpzipfile) + else + report("unknown %a",where) + end + end + end + + local function wiper(wipes) + for i=1,#wipes do + local s = wipes[i] + if type(s) == "table" then + wiper(s) + elseif type(s) == "string" then + local t = dir.glob(s) + report("wiping %i files in %a",#t,s) + for i=1,#t do +-- report("wiping %a",t[i]) + os.remove(t[i]) + end + end + end + end + + if type(wipes) == "table" then + wiper(wipes) + end + end +end + +function scripts.modules.list() + loadlists() + for k, v in table.sortedhash(lists) do + report("%-20s: %-36s : % t",k,urls[v.url],v.zips) + end +end + +function scripts.modules.installed() + local files = dir.glob(targetdir .. "/*.tma") + if files then + for i=1,#files do + local data = table.load(files[i]) + if data then + local name = data.name + local list = data.list + if name and list then + report("%4i : %s",#list,name) + end + end + end + end +end + +function scripts.modules.install(wipe) + local curdir = dir.current() + local done = false + if not lfs.isdir(checkdir) then + report("unknown subdirectory %a",checkdir) + elseif not dir.mkdirs(targetdir) then + report("unable to create %a",targetdir) + elseif not lfs.chdir(targetdir) then + report("unable to go into %a",targetdir) + elseif environment.argument("module") or environment.argument("modules") then + local files = environment.files + if #files == 0 then + report("no archive names provided") + else + for i=1,#files do + local name = files[i] + if url.hasscheme(name) then + install({ url = false, zips = { file.addsuffix(name,"zip") } }, wipe) + else + loadlists() + install({ url = "modules", zips = { file.addsuffix(name,"zip") } }, wipe) + end + end + done = files + end + else + loadlists() + local files = environment.argument("all") and table.sortedkeys(lists) or environment.files + if #files == 0 then + report("no module names provided") + else + for i=1,#files do + local name = files[i] + local list = lists[name] + if list then + install(list,wipe) + end + end + done = files + end + end + if done then + -- + -- for i=1,#badones do + -- os.remove(badones[i]) + -- end + local okay = false + local files = dir.glob("*") + for i=1,#files do + local name = files[i] + if file.suffix(name) == "tma" then + -- keep it + else + if not okay then + report() + okay = true + end + report("removed %a",name) + os.remove(name) + end + end + -- + report() + report("renewing file database") + report() + resolvers.renewcache() + resolvers.load() + report() + report("installed: % t",done) + report() + end + lfs.chdir(curdir) +end + +function scripts.modules.uninstall() + scripts.modules.install(true) +end + +if environment.argument("list") then + scripts.modules.list() +elseif environment.argument("installed") then + scripts.modules.installed() +elseif environment.argument("install") then + scripts.modules.install() +elseif environment.argument("uninstall") then + scripts.modules.uninstall() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) +else + application.help() + report("") +end + diff --git a/Master/texmf-dist/scripts/context/lua/mtx-install-tikz.lua b/Master/texmf-dist/scripts/context/lua/mtx-install-tikz.lua deleted file mode 100644 index 74a2922418a..00000000000 --- a/Master/texmf-dist/scripts/context/lua/mtx-install-tikz.lua +++ /dev/null @@ -1,162 +0,0 @@ -if not modules then modules = { } end modules ['mtx-install-tikz'] = { - version = 1.234, - comment = "companion to mtxrun.lua", - author = "Hans Hagen", - copyright = "ConTeXt Development Team", - license = "see context related readme files" -} - --- Installing tikz is a bit tricky because there are many packages involved and it's --- sort of impossible to derive from the names what to include in the installation. --- I tried to use the ctan scrips we ship but there is no way to reliably derive a --- set from the topics or packages using the web api (there are also some --- inconsistencies between the jkson and xml interfaces that will not be fixed). A --- wildcard pull of everything tikz/pgf is likely to fail or at least gives files we --- don't want and/or need, the solution is to be specific. --- --- We use curl and not the built in socket library because all kind of ssl and --- redirection can kick in and who know how it evolves. --- --- We use the context unzipper because we cannot be sure if unzip is present on the --- system. In many cases windows, linux and osx installations lack it by default. --- --- This script has no help info etc as it's a rather dumb downloader. One can always --- do a better job than this suboptimal quick hack. Let me know if I forget to wipe --- something. --- --- mtxrun --script install-tikz --- --- It should be run in the tex root and will quit when there is no texmf-context --- path found. The modules path will be created when absent. - -local okay, curl = pcall(require,"libs-imp-curl") - -local fetched = curl and curl.fetch and function(str) - local data, message = curl.fetch { - url = str, - followlocation = true, - sslverifyhost = false, - sslverifypeer = false, - } - if not data then - report("some error: %s",message) - end - return data -end or function(str) - -- So, no redirect to http, which means that we cannot use the built in socket - -- library. What if the client is happy with http? - local data = os.resultof("curl -sSL " .. str) - return data -end - -local ctanurl = "https://mirrors.ctan.org/install" -local tmpzipfile = "temp.zip" -local checkdir = "texmf-context" -local targetdir = "texmf-modules" - -local report = logs.reporter("install") - -scripts = scripts or { } -scripts.ctan = scripts.ctan or { } - -function scripts.ctan.install(list) - if type(list) ~= "table"then - report("unknown specification") - end - local zips = list.zips - local wipes = list.wipes - if type(zips) ~= "table" or type(wipes) ~= "table" then - report("incomplete specification") - elseif not lfs.isdir(checkdir) then - report("unknown subdirectory %a",checkdir) - elseif not dir.mkdirs(targetdir) then - report("unable to create %a",targetdir) - elseif not lfs.chdir(targetdir) then - report("unable to go into %a",targetdir) - else - report("installing into %a",targetdir) - for i=1,#zips do - local where = ctanurl .. "/" .. zips[i] - local data = fetched(where) - if string.find(data,"^PK") then - io.savedata(tmpzipfile,data) - report("from %a",where) - report("into %a",targetdir) - utilities.zipfiles.unzipdir { - zipname = tmpzipfile, - path = ".", - verbose = "steps", - } - os.remove(tmpzipfile) - else - report("unknown %a",where) - end - end - - local function wiper(wipes) - for i=1,#wipes do - local s = wipes[i] - if type(s) == "table" then - wiper(s) - elseif type(s) == "string" then - local t = dir.glob(s) - report("wiping %i files in %a",#t,s) - for i=1,#t do - os.remove(t[i]) - end - end - end - end - - wiper(wipes) - - report("renewing file database") - resolvers.renewcache() - resolvers.load() - end -end - -local function wipers(s) - return { - "tex/context/third/" ..s.. "/**", - "doc/context/third/" ..s.. "/**", - "source/context/third/" ..s.. "/**", - - "tex/context/" ..s.. "/**", - "doc/context/" ..s.. "/**", - "source/context/" ..s.. "/**", - - "scripts/" ..s.. "/**", - } -end - -local defaults = { - "tex/latex/**", - "tex/plain/**", - - "doc/latex/**", - "doc/plain/**", - "doc/generic/**", - - "source/latex/**", - "source/plain/**", - "source/generic/**", -} - -local lists = { - tikz = { - zips = { - "graphics/pgf/base/pgf.tds.zip", - "graphics/pgf/contrib/pgfplots.tds.zip", - "graphics/pgf/contrib/circuitikz.tds.zip", - }, - wipes = { - wipers("pgf"), - wipers("pgfplots"), - wipers("circuitikz"), - defaults, - } - }, -} - -scripts.ctan.install(lists.tikz) diff --git a/Master/texmf-dist/scripts/context/lua/mtx-install.lua b/Master/texmf-dist/scripts/context/lua/mtx-install.lua index 4b590128245..d66278dc83f 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-install.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-install.lua @@ -40,14 +40,15 @@ local gsub, find, escapedpattern = string.gsub, string.find, string.escapedpatte local round = math.round local savetable, loadtable, sortedhash = table.save, table.load, table.sortedhash local copyfile, joinfile, filesize, dirname, addsuffix, basename = file.copy, file.join, file.size, file.dirname, file.addsuffix, file.basename -local isdir, isfile, walkdir, pushdir, popdir, currentdir = lfs.isdir, lfs.isfile, lfs.dir, lfs.chdir, dir.push, dir.pop, currentdir +local isdir, isfile, walkdir, pushdir, popdir, currentdir = lfs.isdir, lfs.isfile, lfs.dir, dir.push, dir.pop, dir.current local mkdirs, globdir = dir.mkdirs, dir.glob local osremove, osexecute, ostype, resultof = os.remove, os.execute, os.type, os.resultof -local savedata = io.savedata +local savedata, loaddata = io.savedata, io.loaddata local formatters = string.formatters local httprequest = socket.http.request -local usecurl = false +local usecurl = false +local protocol = "http" local function checkcurl() local s = resultof("curl --version") @@ -63,7 +64,11 @@ local function fetch(url) data, detail = httprequest(url) end if type(data) ~= "string" then - data = false + data = false + detail = "download failed" + elseif #data == 0 then + data = false + detail = "download failed, zero length" elseif #data < 2048 then local n, t = find(data,"%s*%s*(%d+)%s(.-)") if tonumber(n) then @@ -100,36 +105,33 @@ local texformats = { local platforms = { ["mswin"] = "mswin", - ["windows"] = "mswin", + -- ["windows"] = "mswin", ["win32"] = "mswin", ["win"] = "mswin", - ["arm32"] = "windows-arm32", - ["windows-arm32"] = "windows-arm32", -- - ["mswin-64"] = "win64", + ["windows"] = "win64", ["windows-64"] = "win64", ["win64"] = "win64", - ["arm64"] = "windows-arm64", - ["windows-arm64"] = "windows-arm64", -- ["linux"] = "linux", ["linux-32"] = "linux", ["linux32"] = "linux", -- + -- ["linux"] = "linux-64", ["linux-64"] = "linux-64", ["linux64"] = "linux-64", -- - ["linuxmusl-64"] = "linuxmusl", ["linuxmusl"] = "linuxmusl", + ["linuxmusl-64"] = "linuxmusl-64", -- - ["linux-armhf"] = "linux-armhf", + -- ["linux-armhf"] = "linux-armhf", -- - ["openbsd"] = "openbsd7.3", - ["openbsd-i386"] = "openbsd7.3", - ["openbsd-amd64"] = "openbsd7.3-amd64", + ["openbsd"] = "openbsd-amd64", + -- ["openbsd-i386"] = "openbsd7.3", + ["openbsd-amd64"] = "openbsd-amd64", -- - ["freebsd"] = "freebsd", - ["freebsd-i386"] = "freebsd", + ["freebsd"] = "freebsd-amd64", + -- ["freebsd-i386"] = "freebsd", ["freebsd-amd64"] = "freebsd-amd64", -- -- ["kfreebsd"] = "kfreebsd-i386", @@ -151,6 +153,7 @@ local platforms = { -- ["macosx"] = "osx-64", ["osx"] = "osx-64", + ["osx-intel"] = "osx-64", ["osx-64"] = "osx-64", ["osx-arm"] = "osx-arm64", ["osx-arm64"] = "osx-arm64", @@ -187,7 +190,7 @@ function install.identify() local name = files[i] local size = filesize(name) local base = gsub(name,pattern,"") - local data = io.loaddata(name) + local data = loaddata(name) if data and #data > 0 then local stamp = hashdata(data) details[i] = { base, size, stamp } @@ -218,6 +221,8 @@ function install.identify() date = os.date("%Y-%m-%d"), }) + os.exit() + end local function disclaimer() @@ -245,15 +250,15 @@ function install.update() return ok end - local function download(what,url,target,total,done,oldhash) + local function download(what,url,target,total,done,hash) local data = fetch(url .. "/" .. target) - if data then + if type(data) == "string" and #data > 0 then if total and done then report("%-8s : %3i %% : %8i : %s",what,round(100*done/total),#data,target) else report("%-8s : %8i : %s",what,#data,target) end - if oldhash and oldhash ~= hashdata(data) then + if hash and hash ~= hashdata(data) then return "different hash value" elseif not validdir(dirname(target)) then return "wrong target directory" @@ -336,8 +341,9 @@ function install.update() report("fetching %a",zipurl) local zipdata = fetch(zipurl) if zipdata then - io.savedata(zipfile,zipdata) + savedata(zipfile,zipdata) else + osremove(zipfile) zipfile = false end end @@ -353,6 +359,7 @@ function install.update() path = ".", -- verbose = true, verbose = "steps", + collect = true, -- sort of a check } if utilities.zipfiles.unzipdir(specification) then @@ -361,7 +368,6 @@ function install.update() else osremove(zipfile) end - end count = #new @@ -379,7 +385,10 @@ function install.update() local target = joinfile(tree,name) done = done + size if not skiplist or not skiplist[basename(name)] then - download("new",url,target,total,done) + local message = download("new",url,target,total,done) + if message then + report("%s",message) + end else report("skipping %s",target) end @@ -490,7 +499,7 @@ function install.update() for i=1,#list do local host = list[i] - local data, status, detail = fetch("http://" .. host .. "/" .. instance .. "/tex/status.tma") + local data, status, detail = fetch(protocol .. "://" .. host .. "/" .. instance .. "/tex/status.tma") if status == 200 and type(data) == "string" then local t = loadstring(data) if type(t) == "function" then @@ -508,7 +517,7 @@ function install.update() return end - local url = "http://" .. server .. "/" .. instance .. "/" + local url = protocol .. "://" .. server .. "/" .. instance .. "/" local texmfplatform = "texmf-" .. platform @@ -557,8 +566,8 @@ function install.update() local cdir = currentdir() local pdir = pushdir(binpath) - report("current : %S",cdir) - report("target : %S",pdir) + report("current : %S",cdir or "") + report("target : %S",pdir or "") if pdir ~= cdir then @@ -634,22 +643,45 @@ function install.update() report("") report("update, done") + +end + +function install.modules() + report("--modules in not yet implemented") +end + +function install.fonts() + report("--fonts in not yet implemented") +end + +function install.goodies() + report("--goodies in not yet implemented") end if environment.argument("secure") then usecurl = checkcurl() - if not usecurl then + if usecurl then + protocol = "https" + else report("no curl installed, quitting") os.exit() end end +io.output():setvbuf("no") + if environment.argument("identify") then install.identify() elseif environment.argument("install") then install.update() elseif environment.argument("update") then install.update() +elseif environment.argument("modules") then + install.modules() +elseif environment.argument("fonts") then + install.fonts() +elseif environment.argument("goodies") then + install.goodies() elseif environment.argument("exporthelp") then application.export(environment.argument("exporthelp"),environment.files[1]) else @@ -657,3 +689,4 @@ else report("") disclaimer() end + diff --git a/Master/texmf-dist/scripts/context/lua/mtx-kpse.lua b/Master/texmf-dist/scripts/context/lua/mtx-kpse.lua index 7542751ac5f..663d10383fe 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-kpse.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-kpse.lua @@ -77,13 +77,6 @@ local argument = environment.argument local files = environment.files local target = files[1] -if argument("progname") or argument("programname") then - kpse.set_program_name(argument("progname")) -else - application.help() - return -end - local function printtable(result) if type(result) == "table" then for i=1,#result do @@ -94,7 +87,15 @@ end if argument("exporthelp") then application.export(environment.argument("exporthelp"),target) -elseif argument("filetypes") or argument("formats") then + return +elseif argument("progname") or argument("programname") then + kpse.set_program_name(argument("progname")) +else + application.help() + return +end + +if argument("filetypes") or argument("formats") then print(table.concat(kpse.get_file_types()," ")) elseif type(target) == "string" and target ~= "" then if argument("findfiles") or argument("find-files") then diff --git a/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua b/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua index 7f5c1c55629..648ec8aa95e 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua @@ -121,9 +121,9 @@ scripts.patterns.list = { { "hr", "hyph-hr", "croatian" }, -- { "??", "hyph-hsb", "upper sorbian" }, { "hu", "hyph-hu", "hungarian" }, - -- { "hy", "hyph-hy", "armenian" }, + { "hy", "hyph-hy", "armenian" }, -- { "??", "hyph-ia", "interlingua" }, - -- { "??", "hyph-id", "indonesian" }, + { "id", "hyph-id", "indonesian" }, { "is", "hyph-is", "icelandic" }, { "it", "hyph-it", "italian" }, -- { "??", "hyph-kmr", "kurmanji" }, diff --git a/Master/texmf-dist/scripts/context/lua/mtx-pdf.lua b/Master/texmf-dist/scripts/context/lua/mtx-pdf.lua index 05973d2365d..53ba7cb93c7 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-pdf.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-pdf.lua @@ -25,16 +25,23 @@ local helpinfo = [[ show some info about the given file show metadata xml blob + show formdata replace newlines in metadata - show used fonts ( - show object"/> - show links"/> + show used fonts () + show object + show links + sign document (assumes signature template) + verify document + print detail to the console mtxrun --script pdf --info foo.pdf mtxrun --script pdf --metadata foo.pdf mtxrun --script pdf --metadata --pretty foo.pdf mtxrun --script pdf --stream=4 foo.pdf + mtxrun --script pdf --sign --certificate=somesign.pem --password=test --uselibrary somefile + mtxrun --script pdf --verify --certificate=somesign.pem --password=test --uselibrary somefile + mtxrun --script pdf --detail=nofpages somefile @@ -55,9 +62,11 @@ elseif CONTEXTLMTXMODE then dofile(resolvers.findfile("util-dim.lua","tex")) dofile(resolvers.findfile("lpdf-ini.lmt","tex")) dofile(resolvers.findfile("lpdf-pde.lmt","tex")) + dofile(resolvers.findfile("lpdf-sig.lmt","tex")) else dofile(resolvers.findfile("lpdf-pde.lua","tex")) end +dofile(resolvers.findfile("util-jsn.lua","tex")) scripts = scripts or { } scripts.pdf = scripts.pdf or { } @@ -68,13 +77,13 @@ local function loadpdffile(filename) if not filename or filename == "" then report("no filename given") elseif not lfs.isfile(filename) then - report("unknown file '%s'",filename) + report("unknown file %a",filename) else - local pdffile = lpdf.epdf.load(filename) + local pdffile = lpdf.epdf.load(filename) if pdffile then return pdffile else - report("no valid pdf file '%s'",filename) + report("no valid pdf file %a",filename) end end end @@ -82,10 +91,10 @@ end function scripts.pdf.info(filename) local pdffile = loadpdffile(filename) if pdffile then - local catalog = pdffile.Catalog - local info = pdffile.Info - local pages = pdffile.pages - local nofpages = pdffile.nofpages + local catalog = pdffile.Catalog + local info = pdffile.Info + local pages = pdffile.pages + local nofpages = pdffile.nofpages local unset = "" @@ -130,7 +139,7 @@ function scripts.pdf.info(filename) -- if details then local annotations = 0 - for i=1, nofpages do + for i=1,nofpages do local page = pages[i] local a = page.Annots if a then @@ -167,6 +176,189 @@ function scripts.pdf.info(filename) end end +function scripts.pdf.detail(filename,detail) + if detail == "pages" or detail == "nofpages" then + local pdffile = loadpdffile(filename) + print(pdffile and pdffile.nofpages or 0) + end +end + +local function flagstoset(flag,flags) + local t = { } + if flags then + for k, v in next, flags do + if (flag & v) ~= 0 then + t[k] = true + end + end + end + return t +end + +function scripts.pdf.formdata(filename,save) + local pdffile = loadpdffile(filename) + if pdffile then + local widgets = pdffile.widgets + if widgets then + local results = { { "type", "name", "value" } } + for i=1,#widgets do + local annotation = widgets[i] + local parent = annotation.Parent or { } + local name = annotation.T or parent.T + local what = annotation.FT or parent.FT + if name and what then + local value = annotation.V and tostring(annotation.V) or "" + if value and value ~= "" then + local wflags = flagstoset(annotation.Ff or parent.Ff or 0, widgetflags) + if what == "Tx" then + if wflags.MultiLine then + wflags.MultiLine = nil + what = "text" + else + what = "line" + end + local default = annotation.V or "" + elseif what == "Btn" then + if wflags.Radio or wflags.RadiosInUnison then + what = "radio" + elseif wflags.PushButton then + what = "push" + else + what = "check" + end + elseif what == "Ch" then + -- F Ff FT Opt T | AA OC (rest follows) + if wflags.PopUp then + wflags.PopUp = nil + if wflags.Edit then + what = "combo" + else + what = "popup" + end + else + what = "choice" + end + elseif what == "Sig" then + what = "signature" + else + what = nil + end + if what then + results[#results+1] = { what, name, value } + end + end + end + end + if save then + local values = { } + for i=2,#results do + local result= results[i] + values[#values+1] = { + type = result[1], + name = result[2], + value = result[3], + } + end + local data = { + filename = filename, + values = values, + } + local name = file.nameonly(filename) .. "-formdata" + if save == "json" then + name = file.addsuffix(name,"json") + io.savedata(name,utilities.json.tojson(data)) + elseif save then + name = file.addsuffix(name,"lua") + table.save(name,data) + end + report("") + report("%i widgets found, %i values saved in %a",#widgets,#results-1,name) + report("") + end + utilities.formatters.formatcolumns(results) + report(results[1]) + report("") + for i=2,#results do + report(results[i]) + end + report("") + end + end +end + +function scripts.pdf.signature(filename,save) + local pdffile = loadpdffile(filename) + if pdffile then + local widgets = pdffile.widgets + if widgets then + for i=1,#widgets do + local annotation = widgets[i] + local parent = annotation.Parent or { } + local name = annotation.T or parent.T + local what = annotation.FT or parent.FT + if what == "Sig" then + local value = annotation.V + if value then + local contents = tostring(value.Contents) or "" + report("") + if save then + local name = file.nameonly(filename) .. "-signature.bin" + report("signature saved in %a",name) + io.savedata(name,string.tobytes(contents)) + else + report("signature: %s",contents) + end + report("") + return + end + end + end + end + report("there is no signature") + end +end + +function scripts.pdf.sign(filename,save) + local pdffile = file.addsuffix(filename,"pdf") + if not lfs.isfile(pdffile) then + report("invalid pdf file %a",pdffile) + return + end + local certificate = environment.argument("certificate") + local password = environment.argument("password") + if type(certificate) ~= "string" or type(password) ~= "string" then + report("provide --certificate and --password") + return + end + lpdf.sign { + filename = pdffile, + certificate = certificate, + password = password, + purge = environment.argument("purge"), + uselibrary = environment.argument("uselibrary"), + } +end + +function scripts.pdf.verify(filename,save) + local pdffile = file.addsuffix(filename,"pdf") + if not lfs.isfile(pdffile) then + report("invalid pdf file %a",pdffile) + return + end + local certificate = environment.argument("certificate") + local password = environment.argument("password") + if type(certificate) ~= "string" or type(password) ~= "string" then + report("provide --certificate and --password") + return + end + lpdf.verify { + filename = pdffile, + certificate = certificate, + password = password, + uselibrary = environment.argument("uselibrary"), + } +end + function scripts.pdf.metadata(filename,pretty) local pdffile = loadpdffile(filename) if pdffile then @@ -187,7 +379,7 @@ end local expanded = lpdf.epdf.expanded local function getfonts(pdffile) - local usedfonts = { } + local usedfonts = { } local function collect(where,tag) local resources = where.Resources @@ -196,6 +388,9 @@ local function getfonts(pdffile) if fontlist then for k, v in expanded(fontlist) do usedfonts[tag and (tag .. "." .. k) or k] = v + if v.Subtype == "Type3" then + collect(v,tag and (tag .. "." .. k) or k) + end end end local objects = resources.XObject @@ -214,6 +409,8 @@ local function getfonts(pdffile) return usedfonts end +-- todo: fromunicode16 + local function getunicodes(font) local cid = font.ToUnicode if cid then @@ -228,9 +425,9 @@ local function getunicodes(font) setmetatableindex(counts, function(t,k) t[k] = 0 return 0 end) for s in gmatch(cid,"beginbfrange%s*(.-)%s*endbfrange") do for first, last, offset in gmatch(s,"<([^>]+)>%s+<([^>]+)>%s+<([^>]+)>") do - first = tonumber(first,16) - last = tonumber(last,16) - offset = tonumber(offset,16) + local first = tonumber(first,16) + local last = tonumber(last,16) + local offset = tonumber(offset,16) offset = offset - first for i=first,last do local c = i + offset @@ -267,7 +464,7 @@ function scripts.pdf.fonts(filename) indices = getunicodes(v) local codes = { } local chars = { } - local freqs = { } + -- local freqs = { } local names = { } if counts then codes = sortedkeys(counts) @@ -276,10 +473,10 @@ function scripts.pdf.fonts(filename) if k > 32 then local c = utfchar(k) chars[i] = c - freqs[i] = format("U+%05X %s %s",k,counts[k] > 1 and "+" or " ", c) + -- freqs[i] = format("U+%05X %s %s",k,counts[k] > 1 and "+" or " ", c) else chars[i] = k == 32 and "SPACE" or format("U+%03X",k) - freqs[i] = format("U+%05X %s --",k,counts[k] > 1 and "+" or " ") + -- freqs[i] = format("U+%05X %s --",k,counts[k] > 1 and "+" or " ") end end if basefont and unicode then @@ -302,20 +499,40 @@ function scripts.pdf.fonts(filename) end end end + if not basefont then + local fontdescriptor = v.FontDescriptor + if fontdescriptor then + basefont = fontdescriptor.FontName + end + end found[k] = { basefont = basefont or "no basefont", encoding = (d and "custom n=" .. #d) or "no encoding", subtype = subtype or "no subtype", - unicode = tounicode and "unicode" or "no vector", + unicode = unicode and "unicode" or "no vector", chars = chars, codes = codes, - freqs = freqs, + -- freqs = freqs, names = names, } end + local haschar = false + + local list = { } + for k, v in next, found do + local s = string.gsub(k,"(%d+)",function(s) return string.format("%05i",tonumber(s)) end) + list[s] = { k, v } + if #v.chars > 0 then + haschar = true + end + end + if details then for k, v in sortedhash(found) do +-- for s, f in sortedhash(list) do +-- local k = f[1] +-- local v = f[2] report("id : %s", k) report("basefont : %s", v.basefont) report("encoding : % t", v.names) @@ -335,16 +552,17 @@ function scripts.pdf.fonts(filename) report("") end else - local haschar = false - for k, v in sortedhash(found) do - if #v.chars > 0 then - haschar = true - break - end - end local results = { { "id", "basefont", "encoding", "subtype", "unicode", haschar and "characters" or nil } } - for k, v in sortedhash(found) do - results[#results+1] = { k, v.basefont, v.encoding, v.subtype, v.unicode, haschar and concat(v.chars," ") or nil } + local shared = { } + for s, f in sortedhash(list) do + local k = f[1] + local v = f[2] + local basefont = v.basefont + local characters = shared[basefont] or (haschar and concat(v.chars," ")) or nil + results[#results+1] = { k, v.basefont, v.encoding, v.subtype, v.unicode, characters } + if not shared[basefont] then + shared[basefont] = "shared with " .. k + end end utilities.formatters.formatcolumns(results) report(results[1]) @@ -382,43 +600,65 @@ function scripts.pdf.links(filename,asked) local reverse = swapped(pages) + local function banner(pagenumber) + report("") + report("annotations @ page %i",pagenumber) + report("") + end + local function show(pagenumber) local page = pages[pagenumber] local annots = page.Annots if annots then - report("") - report("annotations @ page %i",pagenumber) - report("") + local done = false for i=1,#annots do - local annot = annots[i] - if annot.Subtype == "Link" then - local A = annot.A - if A then - local S = A.S - local D = A.D - if S == "GoTo" then - if D then + local annotation = annots[i] + local a = annotation.A + if not a then + local d = annotation.Dest + if d then + a = { S = "GoTo", D = d } -- no need for a dict + end + end + if a then + local S = a.S + if S == "GoTo" then + local D = a.D + if D then + local D1 = D[1] + local R1 = reverse[D1] + if not done then + banner(pagenumber) + done = true + end + if tonumber(R1) then + report("intern, page % 4i",R1 or 0) + else + report("intern, name %s",tostring(D1)) + end + end + elseif S == "GoToR" then + local D = a.D + if D then + local F = A.F + if F then local D1 = D[1] - local R1 = reverse[D1] - if tonumber(R1) then - report("intern, page % 4i",R1 or 0) - else - report("intern, name %s",tostring(D1)) + if not done then + banner(pagenumber) + done = true end - end - elseif S == "GoToR" then - if D then - local F = A.F - if F then - local D1 = D[1] - if tonumber(D1) then - report("extern, page % 4i, file %s",D1 + 1,F) - else - report("extern, page % 4i, file %s, name %s",0,F,D[1]) - end + if tonumber(D1) then + report("extern, page % 4i, file %s",D1 + 1,F) + else + report("extern, page % 4i, file %s, name %s",0,F,D[1]) end end end + elseif S == "URI" then + local URI = a.URI + if URI then + report("extern, uri %a",URI) + end end end end @@ -483,12 +723,22 @@ elseif environment.argument("info") then scripts.pdf.info(filename) elseif environment.argument("metadata") then scripts.pdf.metadata(filename,environment.argument("pretty")) +elseif environment.argument("formdata") then + scripts.pdf.formdata(filename,environment.argument("save")) elseif environment.argument("fonts") then scripts.pdf.fonts(filename) elseif environment.argument("object") then scripts.pdf.object(filename,tonumber(environment.argument("object"))) elseif environment.argument("links") then scripts.pdf.links(filename,tonumber(environment.argument("page"))) +elseif environment.argument("signature") then + scripts.pdf.signature(filename,environment.argument("save")) +elseif environment.argument("sign") then + scripts.pdf.sign(filename) +elseif environment.argument("detail") then + scripts.pdf.detail(filename,environment.argument("detail")) +elseif environment.argument("verify") then + scripts.pdf.verify(filename) elseif environment.argument("exporthelp") then application.export(environment.argument("exporthelp"),filename) else diff --git a/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-fonttest.lua b/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-fonttest.lua index d5437587b2b..f1146b95f01 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-fonttest.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-server-ctx-fonttest.lua @@ -541,15 +541,20 @@ local function show_font(currentfont,detail) for f,ff in table.sortedhash(data) do local done = false for s, ss in table.sortedhash(ff) do - if s == "*" then s = "all" end - if ss ["*"] then ss["*"] = nil ss.all = true end + local s = s == "*" and "all" or s + if ss ["*"] then + ss["*"] = nil + ss.all = true + end + local name if done then - f = "" + name = "" else done = true + name = f end - local title = fonts.handlers.otf.tables.features[f] or "" - result[#result+1] = formatters["%s  %s  %s  %s  "](title,f,s,concat(table.sortedkeys(ss)," ")) + local title = fonts.handlers.otf.tables.features[name] or "" + result[#result+1] = formatters["%s  %s  %s  %s  "](title,name,s,concat(table.sortedkeys(ss)," ")) end end result[#result+1] = "" diff --git a/Master/texmf-dist/scripts/context/lua/mtx-server.lua b/Master/texmf-dist/scripts/context/lua/mtx-server.lua index 4f7b9b5919a..85373a5a0b2 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-server.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-server.lua @@ -287,6 +287,7 @@ end handlers.luc = handlers.lua handlers.html = handlers.htm +handlers.pdf = handlers.generic local indices = { "index.htm", "index.html" } local portnumber = 8088 diff --git a/Master/texmf-dist/scripts/context/lua/mtx-synctex.lua b/Master/texmf-dist/scripts/context/lua/mtx-synctex.lua index f94a9605f3b..00e43f8703c 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-synctex.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-synctex.lua @@ -123,7 +123,7 @@ local function findlocation(filename,page,xpos,ypos) if find(line,"^}") then break else - -- we only look at positive cases + -- we only look at positive cases / could be sped up but it is not critical local f, l, x, y, w, h, d = match(line,"^h(.-),(.-):(.-),(.-):(.-),(.-),(.-)$") if f and f ~= 0 then x = tonumber(x) @@ -284,6 +284,8 @@ local function findlocation(filename,page,xpos,ypos,tolerance) locate( s,-s) if fi ~= 0 then tl = s ; goto done end locate(-s, s) if fi ~= 0 then tl = s ; goto done end locate(-s,-s) if fi ~= 0 then tl = s ; goto done end + locate( 0, s) if fi ~= 0 then tl = s ; goto done end + locate( 0,-s) if fi ~= 0 then tl = s ; goto done end end break else diff --git a/Master/texmf-dist/scripts/context/lua/mtx-unicode.lua b/Master/texmf-dist/scripts/context/lua/mtx-unicode.lua index ad42797b70d..cc58036703b 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-unicode.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-unicode.lua @@ -92,7 +92,7 @@ local application = logs.application { } local gmatch, match, gsub, find, lower, upper, format = string.gmatch, string.match, string.gsub, string.find, string.lower, string.upper, string.format -local concat, sort = table.concat, table.sort +local concat, sort, sortedhash = table.concat, table.sort, table.sortedhash local split, splitlines, strip = string.split, string.splitlines, string.strip local are_equal = table.are_equal local tonumber, tostring, rawget = tonumber, tostring, rawget @@ -424,13 +424,13 @@ function scripts.unicode.update() if l or r then mathextensible = 'm' -- mixed else - mathextensible = "u" -- up + mathextensible = "u" -- up end elseif d then if l or r then mathextensible = 'm' -- mixed else - mathextensible = "d" -- down + mathextensible = "d" -- down end elseif l and r then mathextensible = "h" -- horizontal @@ -449,7 +449,7 @@ function scripts.unicode.update() end end -- we need the hash .. add missing specials - for unicode, data in table.sortedhash(characterdata) do + for unicode, data in sortedhash(characterdata) do if not data.specials or data.comment and find(data.comment,"check special") then local description = data.description local b, m = match(description,"^(.+) WITH (.+)$") @@ -609,7 +609,7 @@ function scripts.unicode.load() index = splitindex(textdata.index), } -- - for k, v in table.sortedhash(textfiles) do + for k, v in sortedhash(textfiles) do report("using: %s",v) end return true @@ -673,7 +673,18 @@ end function scripts.unicode.save(filename) if preamble then - local data = table.serialize(characters.data,"characters.data", { hexify = true, noquotes = true }) + -- for k, v in next, characters.data do + -- v.adobename = nil + -- end + -- + characters.data[0x1FE3].uccode={ 0x3C5, 0x308, 0x301 } + characters.data[0x1FD3].uccode={ 0x3B9, 0x308, 0x301 } + characters.data[0x00DF].uccode={ 0x53, 0x53 } + -- + local data = table.serialize(characters.data,"characters.data", { + hexify = true, + noquotes = true, + }) data = gsub(data, "%{%s+%[0xFE0E%]=\"text style\",%s+%[0xFE0F%]=\"emoji style\",%s+%}", "variants_emoji" @@ -779,7 +790,7 @@ function scripts.unicode.extras() -- old code -- v.synonym = nil -- v.synonyms = nil -- end - for k, v in table.sortedhash(index) do + for k, v in sortedhash(index) do local d = data[v] if d and d.description ~= upper(k) then local synonyms = d.synonyms @@ -803,6 +814,53 @@ function scripts.unicode.extras() -- old code end end end +-- -- +-- for name, block in sortedhash(characters.blocks) do +-- if block.math then +-- local isalphabet = find(name,"lowercase") or find(name,"uppercase") or find(name,"letterlike") +-- for unicode=block.first,block.last do +-- local c = data[unicode] +-- if c.mathspec and #c.mathspec == 0 then +-- c.mathspec = { c.mathspec } +-- end +-- if c.mathclass then +-- if isalphabet and c.mathclass ~= "variable" then +-- report("CHECK %C : %s",unicode,c.description) +-- end +-- elseif c.mathspec then +-- -- skip +-- else +-- report("%s : %C : %s",name,unicode,c.description) +-- if isalphabet then +-- c.mathclass = "variable" +-- end +-- end +-- end +-- local gaps = block.gaps +-- if gaps then +-- for gap, unicode in sortedhash(gaps) do +-- local c = data[u] +-- if c.mathspec and #c.mathspec == 0 then +-- c.mathspec = { c.mathspec } +-- end +-- if c.mathclass then +-- if isalphabet and c.mathclass ~= "variable" then +-- report("CHECK %C : %s",gap,c.description) +-- end +-- -- skip +-- elseif c.mathspec then +-- -- skip +-- else +-- report("%s : %U -> %C : %s",name,gap,unicode,c.description) +-- if isalphabet then +-- c.mathclass = "variable" +-- end +-- end +-- end +-- end +-- end +-- end + end do @@ -907,7 +965,7 @@ else scripts.unicode.save("char-def-new.lua") scripts.unicode.emoji("char-emj-new.lua") report("saved file %a","char-def-new.lua") - report("saved file %a (current 14.0, check for updates, see above!)","char-emj-new.lua") + report("saved file %a (current 15.1, check for updates, see above!)","char-emj-new.lua") else report("nothing to do") end diff --git a/Master/texmf-dist/scripts/context/lua/mtx-update.lua b/Master/texmf-dist/scripts/context/lua/mtx-update.lua index 19e3e686581..7989bd7d46a 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-update.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-update.lua @@ -158,12 +158,12 @@ update.goodies = { } update.platforms = { - ["mswin"] = "mswin", - ["windows"] = "mswin", - ["win32"] = "mswin", - ["win"] = "mswin", + -- ["mswin"] = "mswin", + -- ["windows"] = "mswin", + -- ["win32"] = "mswin", + -- ["win"] = "mswin", -- - ["mswin-64"] = "win64", + ["windows"] = "win64", ["windows-64"] = "win64", ["win64"] = "win64", -- @@ -171,19 +171,21 @@ update.platforms = { ["linux-32"] = "linux", ["linux32"] = "linux", -- + -- ["linux"] = "linux-64", ["linux-64"] = "linux-64", ["linux64"] = "linux-64", -- + ["linuxmusl"] = "linuxmusl", ["linuxmusl-64"] = "linuxmusl-64", -- - ["linux-armhf"] = "linux-armhf", + -- ["linux-armhf"] = "linux-armhf", -- - ["openbsd"] = "openbsd7.3", - ["openbsd-i386"] = "openbsd7.3", - ["openbsd-amd64"] = "openbsd7.3-amd64", + ["openbsd"] = "openbsd-amd64", + -- ["openbsd-i386"] = "openbsd7.3", + ["openbsd-amd64"] = "openbsd-amd64", -- - ["freebsd"] = "freebsd", - ["freebsd-i386"] = "freebsd", + ["freebsd"] = "freebsd-amd64", + -- ["freebsd-i386"] = "freebsd", ["freebsd-amd64"] = "freebsd-amd64", -- -- ["kfreebsd"] = "kfreebsd-i386", @@ -205,6 +207,7 @@ update.platforms = { -- ["macosx"] = "osx-64", ["osx"] = "osx-64", + ["osx-intel"] = "osx-64", ["osx-64"] = "osx-64", ["osx-arm"] = "osx-arm64", ["osx-arm64"] = "osx-arm64", @@ -218,8 +221,8 @@ update.platforms = { } local windowsplatform = { - ["mswin"] = true, - ["win32"] = true, + ["mswin"] = true, -- hm + ["win32"] = true, -- hm ["win64"] = true, } @@ -682,15 +685,11 @@ if scripts.savestate then -- states.set("formats.metafun", true) for r in gmatch(environment.argument("extras") or "","([^, ]+)") do -- for old times sake - if r ~= "all" and not find(r,"^[a-z]%-") then - r = "t-" .. r - end + local r = (r ~= "all" and not find(r,"^[a-z]%-") and ("t-" .. r)) or r states.set("modules." .. r, true) end for r in gmatch(environment.argument("modules") or "","([^, ]+)") do - if r ~= "all" and not find(r,"^[a-z]%-") then - r = "t-" .. r - end + local r = (r ~= "all" and not find(r,"^[a-z]%-") and ("t-" .. r)) or r states.set("modules." .. r, true) end for r in gmatch(environment.argument("fonts") or "","([^, ]+)") do diff --git a/Master/texmf-dist/scripts/context/lua/mtx-watch.lua b/Master/texmf-dist/scripts/context/lua/mtx-watch.lua index 7815dafdd7a..e46bb39fdad 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-watch.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-watch.lua @@ -91,7 +91,7 @@ local function glob(files,path) -- some day: sort by name (order prefix) and ati if name:find("^%.") then -- skip . and .. else - name = path .. "/" .. name + local name = path .. "/" .. name local a = lfsattributes(name) if not a then -- weird diff --git a/Master/texmf-dist/scripts/context/lua/mtxrun.lua b/Master/texmf-dist/scripts/context/lua/mtxrun.lua index 8c28a90e38a..59bc6e65928 100644 --- a/Master/texmf-dist/scripts/context/lua/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/lua/mtxrun.lua @@ -1,6 +1,4 @@ #!/usr/bin/env texlua --- 8dec23 --socket added to runners.applications lua and luc per hans --- (mail of 7dec23). if not modules then modules = { } end modules ['mtxrun'] = { version = 1.001, @@ -2143,7 +2141,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 41758, stripped down to: 22643 +-- original size: 42643, stripped down to: 23053 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -2435,19 +2433,22 @@ local function copy(t,tables) tables[t]=tcopy end for i,v in next,t do + local k if type(i)=="table" then if tables[i] then - i=tables[i] + k=tables[i] else - i=copy(i,tables) + k=copy(i,tables) end + else + k=i end if type(v)~="table" then - tcopy[i]=v + tcopy[k]=v elseif tables[v] then - tcopy[i]=tables[v] + tcopy[k]=tables[v] else - tcopy[i]=copy(v,tables) + tcopy[k]=copy(v,tables) end end local mt=getmetatable(t) @@ -2644,7 +2645,11 @@ local function do_serialize(root,name,depth,level,indexed) elseif tv=="number" then if tk=="number" then if hexify then - handle(format("%s [0x%X]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [0x%X]=%q,",depth,k,v)) + else + handle(format("%s [0x%X]=%s,",depth,k,v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k,v)) else @@ -2652,7 +2657,11 @@ local function do_serialize(root,name,depth,level,indexed) end elseif tk=="boolean" then if hexify then - handle(format("%s [%s]=0x%X,",depth,k and "true" or "false",v)) + if accurate then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + else + handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) else @@ -2661,7 +2670,11 @@ local function do_serialize(root,name,depth,level,indexed) elseif tk~="string" then elseif noquotes and not reserved[k] and lpegmatch(propername,k) then if hexify then - handle(format("%s %s=0x%X,",depth,k,v)) + if accurate then + handle(format("%s %s=%q,",depth,k,v)) + else + handle(format("%s %s=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s %s=%q,",depth,k,v)) else @@ -2669,7 +2682,11 @@ local function do_serialize(root,name,depth,level,indexed) end else if hexify then - handle(format("%s [%q]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [%q]=%q,",depth,k,v)) + else + handle(format("%s [%q]=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s [%q]=%q,",depth,k,v)) else @@ -3850,7 +3867,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 20585, stripped down to: 10701 +-- original size: 20686, stripped down to: 10791 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -3990,6 +4007,8 @@ os.type=os.type or (io.pathseparator==";" and "windows") or "unix" os.name=os.name or (os.type=="windows" and "mswin" ) or "linux" if os.type=="windows" then os.libsuffix,os.binsuffix,os.binsuffixes='dll','exe',{ 'exe','cmd','bat' } +elseif os.name=="macosx" then + os.libsuffix,os.binsuffix,os.binsuffixes='dylib','',{ '' } else os.libsuffix,os.binsuffix,os.binsuffixes='so','',{ '' } end @@ -6585,7 +6604,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 46322, stripped down to: 24128 +-- original size: 46976, stripped down to: 24530 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6779,6 +6798,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -6787,6 +6807,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) @@ -7463,6 +7484,7 @@ end strings.formatters.add=add patterns.xmlescape=Cs((P("<")/"<"+P(">")/">"+P("&")/"&"+P('"')/"""+anything)^0) patterns.texescape=Cs((C(S("#$%\\{}"))/"\\%1"+anything)^0) +patterns.ctxescape=Cs((C(S("#$%\\{}|"))/"\\%1"+anything)^0) patterns.luaescape=Cs(((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0) patterns.luaquoted=Cs(Cc('"')*((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0*Cc('"')) add(formatters,"xml",[[lpegmatch(xmlescape,%s)]],{ xmlescape=patterns.xmlescape }) @@ -7533,6 +7555,20 @@ do return cache[s] end end +if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then + local t={ + ["#"]="#H", + ["\n"]="#L", + ['"']="#Q", + ["\r"]="#R", + [" "]="#S", + ["\t"]="#T", + ["\\"]="#X", + } + function string.texhashed(s) + return (gsub(s,".",t)) + end +end end -- of closure @@ -9349,7 +9385,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-prs"] = package.loaded["util-prs"] or true --- original size: 25716, stripped down to: 16805 +-- original size: 26298, stripped down to: 17137 if not modules then modules={} end modules ['util-prs']={ version=1.001, @@ -9645,7 +9681,17 @@ hashes.settings_to_set=table.setmetatableindex(function(t,k) t[k]=v return v end) -getmetatable(hashes.settings_to_set).__mode="kv" +function parsers.settings_to_set(str) + return str and lpegmatch(pattern,str) or {} +end +local pattern=Ct((C((1-S(", "))^1)*S(", ")^0)^1) +hashes.settings_to_list=table.setmetatableindex(function(t,k) + local v=k and lpegmatch(pattern,k) or {} + t[k]=v + return v +end) +getmetatable(hashes.settings_to_set ).__mode="kv" +getmetatable(hashes.settings_to_list).__mode="kv" function parsers.simple_hash_to_string(h,separator) local t={} local tn=0 @@ -9667,7 +9713,7 @@ local splitter=lpeg.tsplitat(" ") function parsers.options_to_array(str) return str and lpegmatch(splitter,str) or {} end -local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C(digit^1*lparent*(noparent+nestedparents)^1*rparent)+C((nestedbraces+(1-comma))^1) +local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C(digit^1*lparent*(noparent+nestedparents)^1*rparent)+C((nestedbraces+(1-comma))^1)+Cc("") local pattern_a=spaces*Ct(value*(separator*value)^0) local function repeater(n,str) if not n then @@ -9689,7 +9735,7 @@ local function repeater(n,str) end end end -local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+(C(digit^1)/tonumber*lparent*Cs((noparent+nestedparents)^1)*rparent)/repeater+C((nestedbraces+(1-comma))^1) +local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+(C(digit^1)/tonumber*lparent*Cs((noparent+nestedparents)^1)*rparent)/repeater+C((nestedbraces+(1-comma))^1)+Cc("") local pattern_b=spaces*Ct(value*(separator*value)^0) function parsers.settings_to_array_with_repeat(str,expand) if expand then @@ -11903,7 +11949,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-soc-imp-http"] = package.loaded["util-soc-imp-http"] or true --- original size: 12624, stripped down to: 9598 +-- original size: 13055, stripped down to: 9818 local tostring,tonumber,setmetatable,next,type=tostring,tonumber,setmetatable,next,type @@ -11955,7 +12001,7 @@ local function receiveheaders(sock,headers) while line~="" do local name,value=skipsocket(2,find(line,"^(.-):%s*(.*)")) if not (name and value) then - return nil,"malformed reponse headers" + return nil,"malformed response headers" end name=lower(name) line,err=sock:receive("*l") @@ -12058,9 +12104,13 @@ function methods.sendbody(self,headers,source,step) end function methods.receivestatusline(self) local try=self.try - local status=try(self.c:receive(5)) + local status,err=try(self.c:receive(5)) if status~="HTTP/" then - return nil,status + if err=="timeout" then + return 408 + else + return nil,status + end end status=try(self.c:receive("*l",status)) local code=skipsocket(2,find(status,"HTTP/%d*%.%d* (%d%d%d)")) @@ -12165,7 +12215,7 @@ local function adjustrequest(originalrequest) end return request end -local maxredericts=4 +local maxredericts=5 local validredirects={ [301]=true,[302]=true,[303]=true,[307]=true } local validmethods={ [false]=true,GET=true,HEAD=true } local function shouldredirect(request,code,headers) @@ -12184,7 +12234,8 @@ local function shouldredirect(request,code,headers) local method=request.method local redirect=request.redirect local redirects=request.nredirects or 0 - return redirect and validredirects[code] and validmethods[method] and redirects<=maxredericts + local maxredirects=request.maxredirects or maxredirects + return redirect and validredirects[code] and validmethods[method] and redirects<=maxredirects end local function shouldreceivebody(request,code) if request.method=="HEAD" then @@ -12207,6 +12258,7 @@ tredirect=function(request,location) headers=request.headers, proxy=request.proxy, nredirects=(request.nredirects or 0)+1, + maxredirects=request.maxredirects or maxredirects, create=request.create, } if not headers then @@ -12229,10 +12281,13 @@ trequest=function(originalrequest) local code,status=connection:receivestatusline() if not code then connection:receive09body(status,request.sink,request.step) + connection:close() return 1,200 + elseif code==408 then + return 1,code end while code==100 do - headers=connection:receiveheaders() + connection:receiveheaders() code,status=connection:receivestatusline() end headers=connection:receiveheaders() @@ -12285,7 +12340,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-soc-imp-ftp"] = package.loaded["util-soc-imp-ftp"] or true --- original size: 10357, stripped down to: 8548 +-- original size: 10345, stripped down to: 8538 local setmetatable,type,next=setmetatable,type,next @@ -12396,7 +12451,7 @@ function methods.port(self,address,port) local tp=self.tp self.pasvt=nil if not address then - address,port=try(tp:getsockname()) + address=try(tp:getsockname()) self.server=try(bindsocket(address,0)) address,port=try(self.server:getsockname()) try(self.server:settimeout(ftp.TIMEOUT)) @@ -12413,7 +12468,7 @@ function methods.eprt(self,family,address,port) local tp=self.tp self.pasvt=nil if not address then - address,port=try(tp:getsockname()) + address=try(tp:getsockname()) self.server=try(bindsocket(address,0)) address,port=try(self.server:getsockname()) try(self.server:settimeout(ftp.TIMEOUT)) @@ -12897,7 +12952,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-set"] = package.loaded["trac-set"] or true --- original size: 14568, stripped down to: 9644 +-- original size: 14574, stripped down to: 9650 if not modules then modules={} end modules ['trac-set']={ version=1.001, @@ -12982,10 +13037,10 @@ local function set(t,what,newvalue) else value=is_boolean(value,value,true) end - w=topattern(w,true,true) + local p=topattern(w,true,true) for name,functions in sortedhash(data) do if done[name] then - elseif find(name,w) then + elseif find(name,p) then done[name]=true for i=1,#functions do functions[i](value) @@ -13267,7 +13322,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-log"] = package.loaded["trac-log"] or true --- original size: 16017, stripped down to: 11045 +-- original size: 16046, stripped down to: 11072 if not modules then modules={} end modules ['trac-log']={ version=1.001, @@ -13282,6 +13337,7 @@ local concat,insert,remove=table.concat,table.insert,table.remove local topattern=string.topattern local utfchar=utf.char local datetime=os.date +local sleep=os.sleep local openfile=io.open local write_nl=print local write=io.write @@ -13554,9 +13610,9 @@ local function setblocked(category,value) if v then v.state=value else - c=topattern(c,true,true) + local p=topattern(c,true,true) for k,v in next,data do - if find(k,c) then + if find(k,p) then v.state=value end end @@ -14156,7 +14212,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lua"] = package.loaded["util-lua"] or true --- original size: 7149, stripped down to: 4997 +-- original size: 7166, stripped down to: 5009 if not modules then modules={} end modules ['util-lua']={ version=1.001, @@ -14190,6 +14246,7 @@ luautilities.suffixes={ tma="tma", tmc=(CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 and "tmd") or (jit and "tmb") or "tmc", lua="lua", + lmt="lmt", luc=(CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 and "lud") or (jit and "lub") or "luc", lui="lui", luv="luv", @@ -14334,7 +14391,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-deb"] = package.loaded["util-deb"] or true --- original size: 10593, stripped down to: 7102 +-- original size: 10416, stripped down to: 7076 if not modules then modules={} end modules ['util-deb']={ version=1.001, @@ -14499,10 +14556,7 @@ function debugger.showstats(printer,threshold) realtime=realtime+real end totaltime=totaltime+total - if line<0 then - line=0 - end - dataset[#dataset+1]={ real,total,count,name,source,line } + dataset[#dataset+1]={ real,total,count,name,source,line<0 and 0 or line } end end end @@ -15498,7 +15552,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-env"] = package.loaded["util-env"] or true --- original size: 9738, stripped down to: 5531 +-- original size: 10014, stripped down to: 5102 if not modules then modules={} end modules ['util-env']={ version=1.001, @@ -15513,22 +15567,7 @@ local unquoted,quoted,optionalquoted=string.unquoted,string.quoted,string.option local concat,insert,remove=table.concat,table.insert,table.remove environment=environment or {} local environment=environment -local setlocale=os.setlocale -setlocale(nil,nil) -local report=logs.reporter("system") -function os.setlocale(a,b) - if a or b then - if report then - report() - report("You're messing with os.locale in a supposedly locale neutral enviroment. From") - report("now on are on your own and without support. Crashes or unexpected side effects") - report("can happen but don't bother the luatex and context developer team with it.") - report() - report=nil - end - setlocale(a,b) - end -end +os.setlocale(nil,nil) function os.setlocale() end local validengines=allocate { ["luatex"]=true, ["luajittex"]=true, @@ -15606,7 +15645,8 @@ function environment.setargument(name,value) environment.arguments[name]=value end function environment.getargument(name,partial) - local arguments,sortedflags=environment.arguments,environment.sortedflags + local arguments=environment.arguments + local sortedflags=environment.sortedflags if arguments[name] then return arguments[name] elseif partial then @@ -15713,7 +15753,7 @@ do -- create closure to overcome 200 locals limit package.loaded["luat-env"] = package.loaded["luat-env"] or true --- original size: 6267, stripped down to: 4115 +-- original size: 6293, stripped down to: 4141 if not modules then modules={} end modules ['luat-env']={ version=1.001, @@ -15786,7 +15826,7 @@ local function strippable(filename) return false end end -function environment.luafilechunk(filename,silent,macros) +function environment.luafilechunk(filename,silent,macros,optional) filename=file.replacesuffix(filename,"lua") local fullname=environment.luafile(filename) if fullname and fullname~="" then @@ -15796,7 +15836,7 @@ function environment.luafilechunk(filename,silent,macros) end return data else - if not silent then + if not optional and not silent then report_lua("unknown file %a",filename) end return nil @@ -15878,7 +15918,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-zip"] = package.loaded["util-zip"] or true --- original size: 23730, stripped down to: 14293 +-- original size: 33051, stripped down to: 16324 if not modules then modules={} end modules ['util-zip']={ version=1.001, @@ -15904,11 +15944,13 @@ end local files=utilities.files local openfile=files.open local closefile=files.close +local getsize=files.size local readstring=files.readstring local readcardinal2=files.readcardinal2le local readcardinal4=files.readcardinal4le local setposition=files.setposition local getposition=files.getposition +local skipbytes=files.skip local band=bit32.band local rshift=bit32.rshift local lshift=bit32.lshift @@ -15931,6 +15973,55 @@ local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist do handle=openfile(name,0), } end + local function update(handle,data) + position=data.offset + setposition(handle,position) + local signature=readstring(handle,4) + if signature=="PK\3\4" then + local version=readcardinal2(handle) + local flag=readcardinal2(handle) + local method=readcardinal2(handle) + skipbytes(handle,4) + local crc32=readcardinal4(handle) + local compressed=readcardinal4(handle) + local uncompressed=readcardinal4(handle) + local namelength=readcardinal2(handle) + local extralength=readcardinal2(handle) + local filename=readstring(handle,namelength) + local descriptor=band(flag,8)~=0 + local encrypted=band(flag,1)~=0 + local acceptable=method==0 or method==8 + local skipped=0 + local size=0 + if encrypted then + size=readcardinal2(handle) + skipbytes(handle,size) + skipped=skipped+size+2 + skipbytes(8) + skipped=skipped+8 + size=readcardinal2(handle) + skipbytes(handle,size) + skipped=skipped+size+2 + size=readcardinal4(handle) + skipbytes(handle,size) + skipped=skipped+size+4 + size=readcardinal2(handle) + skipbytes(handle,size) + skipped=skipped+size+2 + end + if acceptable then + if filename~=data.filename then + else + position=position+30+namelength+extralength+skipped + data.position=position + return position + end + else + end + end + data.position=false + return false + end local function collect(z) if not z.list then local list={} @@ -15938,72 +16029,68 @@ local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist do local position=0 local index=0 local handle=z.handle - while true do - setposition(handle,position) - local signature=readstring(handle,4) - if signature=="PK\3\4" then - local version=readcardinal2(handle) - local flag=readcardinal2(handle) - local method=readcardinal2(handle) - local filetime=readcardinal2(handle) - local filedate=readcardinal2(handle) - local crc32=readcardinal4(handle) - local compressed=readcardinal4(handle) - local uncompressed=readcardinal4(handle) - local namelength=readcardinal2(handle) - local extralength=readcardinal2(handle) - local filename=readstring(handle,namelength) - local descriptor=band(flag,8)~=0 - local encrypted=band(flag,1)~=0 - local acceptable=method==0 or method==8 - local skipped=0 - local size=0 - if encrypted then - size=readcardinal2(handle) - skipbytes(size) - skipped=skipped+size+2 - skipbytes(8) - skipped=skipped+8 - size=readcardinal2(handle) - skipbytes(size) - skipped=skipped+size+2 - size=readcardinal4(handle) - skipbytes(size) - skipped=skipped+size+4 - size=readcardinal2(handle) - skipbytes(size) - skipped=skipped+size+2 - end - position=position+30+namelength+extralength+skipped - if descriptor then - setposition(handle,position+compressed) - crc32=readcardinal4(handle) - compressed=readcardinal4(handle) - uncompressed=readcardinal4(handle) - end - if acceptable then - index=index+1 - local data={ - filename=filename, - index=index, - position=position, - method=method, - compressed=compressed, - uncompressed=uncompressed, - crc32=crc32, - encrypted=encrypted, - } - hash[filename]=data - list[index]=data - else + local size=getsize(handle) + for i=size-4,size-64*1024,-1 do + setposition(handle,i) + local enddirsignature=readcardinal4(handle) + if enddirsignature==0x06054B50 then + local thisdisknumber=readcardinal2(handle) + local centraldisknumber=readcardinal2(handle) + local thisnofentries=readcardinal2(handle) + local totalnofentries=readcardinal2(handle) + local centralsize=readcardinal4(handle) + local centraloffset=readcardinal4(handle) + local commentlength=readcardinal2(handle) + local comment=readstring(handle,length) + if size-i>=22 then + if thisdisknumber==centraldisknumber then + setposition(handle,centraloffset) + while true do + if readcardinal4(handle)==0x02014B50 then + skipbytes(handle,4) + local flag=readcardinal2(handle) + local method=readcardinal2(handle) + skipbytes(handle,4) + local crc32=readcardinal4(handle) + local compressed=readcardinal4(handle) + local uncompressed=readcardinal4(handle) + local namelength=readcardinal2(handle) + local extralength=readcardinal2(handle) + local commentlength=readcardinal2(handle) + skipbytes(handle,8) + local headeroffset=readcardinal4(handle) + local filename=readstring(handle,namelength) + skipbytes(handle,extralength+commentlength) + local descriptor=band(flag,8)~=0 + local encrypted=band(flag,1)~=0 + local acceptable=method==0 or method==8 + if acceptable then + index=index+1 + local data={ + filename=filename, + index=index, + position=nil, + method=method, + compressed=compressed, + uncompressed=uncompressed, + crc32=crc32, + encrypted=encrypted, + offset=headeroffset, + } + hash[filename]=data + list[index]=data + end + else + break + end + end + end + break end - position=position+compressed - else - break end - z.list=list - z.hash=hash end + z.list=list + z.hash=hash end end function getziplist(z) @@ -16042,7 +16129,10 @@ local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist do local handle=z.handle local position=data.position local compressed=data.compressed - if compressed>0 then + if position==nil then + position=update(handle,data) + end + if position and compressed>0 then setposition(handle,position) local result=readstring(handle,compressed) if data.method==8 then @@ -16253,8 +16343,10 @@ if xzip then closezip(zipf) end end - local function unzipdir(zipname,path,verbose) + local function unzipdir(zipname,path,verbose,collect,validate) if type(zipname)=="table" then + validate=zipname.validate + collect=zipname.collect verbose=zipname.verbose path=zipname.path zipname=zipname.zipname @@ -16275,34 +16367,47 @@ if xzip then local done=0 local steps=verbose=="steps" local time=steps and osclock() + if collect then + collect={} + else + collect=false + end for i=1,count do local l=list[i] local n=l.filename - local d=unzipfile(z,n) - if d then - local p=filejoin(path,n) - if mkdirs(dirname(p)) then - if steps then - total=total+#d - done=done+1 - if done>=step then - done=0 - logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time)) + if not validate or validate(n) then + local d=unzipfile(z,n) + if d then + local p=filejoin(path,n) + if mkdirs(dirname(p)) then + if steps then + total=total+#d + done=done+1 + if done>=step then + done=0 + logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time)) + end + elseif verbose then + logwriter(n) + end + savedata(p,d) + if collect then + collect[#collect+1]=p end - elseif verbose then - logwriter(n) end - savedata(p,d) + else + logwriter(format("problem with file %s",n)) end else - logwriter(format("problem with file %s",n)) end end if steps then logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",count,count,total,osclock()-time)) end closezipfile(z) - return true + if collect then + return collect + end else closezipfile(z) end @@ -16440,7 +16545,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 62221, stripped down to: 36225 +-- original size: 62465, stripped down to: 36432 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -16824,8 +16929,13 @@ do [ [[}]] ]="&U+7D;", [ [[~]] ]="&U+7E;", } - local privates_n={ + local privates_n={ } + utilities.storage.mark(privates_u) + utilities.storage.mark(privates_p) + utilities.storage.mark(privates_s) + utilities.storage.mark(privates_x) + utilities.storage.mark(privates_n) local escaped=utf.remapper(privates_u,"dynamic") local unprivatized=utf.remapper(privates_p,"dynamic") local unspecialized=utf.remapper(privates_s,"dynamic") @@ -17549,7 +17659,11 @@ local f_attribute=formatters['%s=%q'] local function verbose_element(e,handlers,escape) local handle=handlers.handle local serialize=handlers.serialize - local ens,etg,eat,edt,ern=e.ns,e.tg,e.at,e.dt,e.rn + local ens=e.ns + local etg=e.tg + local eat=e.at + local edt=e.dt + local ern=e.rn local ats=eat and next(eat) and {} if ats then local n=0 @@ -17921,7 +18035,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-lpt"] = package.loaded["lxml-lpt"] or true --- original size: 54589, stripped down to: 31258 +-- original size: 54738, stripped down to: 31395 if not modules then modules={} end modules ['lxml-lpt']={ version=1.001, @@ -18925,9 +19039,11 @@ expressions.print=function(...) print(...) return true end -expressions.find=find -expressions.upper=upper -expressions.lower=lower +expressions.find=function(str,...) + return str and find(str,...) +end +expressions.upper=function(str) return str and upper(str) or "" end +expressions.lower=function(str) return str and lower(str) or "" end expressions.number=tonumber expressions.boolean=toboolean function expressions.contains(str,pattern) @@ -21053,7 +21169,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-exp"] = package.loaded["data-exp"] or true --- original size: 18179, stripped down to: 10432 +-- original size: 18185, stripped down to: 10438 if not modules then modules={} end modules ['data-exp']={ version=1.001, @@ -21135,10 +21251,10 @@ local function splitpathexpr(str,newlist,validate) str=lpegmatch(stripper_1,str) if validate then for s in gmatch(str,"[^,]+") do - s=validate(s) - if s then + local v=validate(s) + if v then n=n+1 - t[n]=s + t[n]=v end end else @@ -21461,7 +21577,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-env"] = package.loaded["data-env"] or true --- original size: 9501, stripped down to: 6413 +-- original size: 9758, stripped down to: 6523 if not modules then modules={} end modules ['data-env']={ version=1.001, @@ -21475,6 +21591,7 @@ local next,rawget=next,rawget local resolvers=resolvers local allocate=utilities.storage.allocate local setmetatableindex=table.setmetatableindex +local sortedhash=table.sortedhash local suffixonly=file.suffixonly local formats=allocate() local suffixes=allocate() @@ -21576,7 +21693,7 @@ local relations=allocate { lua={ names={ "lua" }, variable='LUAINPUTS', - suffixes={ luasuffixes.lua,luasuffixes.luc,luasuffixes.tma,luasuffixes.tmc }, + suffixes={ luasuffixes.lmt,luasuffixes.lua,luasuffixes.luc,luasuffixes.tma,luasuffixes.tmc }, usertype=true, }, lib={ @@ -21677,8 +21794,8 @@ local relations=allocate { } resolvers.relations=relations function resolvers.updaterelations() - for category,categories in next,relations do - for name,relation in next,categories do + for category,categories in sortedhash(relations) do + for name,relation in sortedhash(categories) do local rn=relation.names local rv=relation.variable if rn and rv then @@ -21691,7 +21808,9 @@ function resolvers.updaterelations() suffixes[rni]=rs for i=1,#rs do local rsi=rs[i] - suffixmap[rsi]=rni + if not suffixmap[rsi] then + suffixmap[rsi]=rni + end end end end @@ -22283,7 +22402,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-res"] = package.loaded["data-res"] or true --- original size: 70711, stripped down to: 44839 +-- original size: 70699, stripped down to: 45019 if not modules then modules={} end modules ['data-res']={ version=1.001, @@ -22348,18 +22467,37 @@ local criticalvars={ "TEXMF", "TEXOS", } -if environment.default_texmfcnf then - resolvers.luacnfspec="home:texmf/web2c;"..environment.default_texmfcnf -else +do local texroot=environment.texroot - resolvers.luacnfspec="home:texmf/web2c;selfautoparent:/texmf-local/web2c;selfautoparent:/texmf-context/web2c;selfautoparent:/texmf/web2c" - if texroot and isdir(texroot.."/texmf-context") then + resolvers.luacnfspec={ + "home:texmf/web2c", + "selfautoparent:/texmf-local/web2c", + "selfautoparent:/texmf-context/web2c", + "selfautoparent:/texmf/web2c", + } + if environment.default_texmfcnf then + resolvers.luacnfspec={ + "home:texmf/web2c", + environment.default_texmfcnf, + } + elseif texroot and isdir(texroot.."/texmf-context") then elseif texroot and isdir(texroot.."/texmf-dist") then - resolvers.luacnfspec="home:texmf/web2c;selfautoparent:/texmf-local/web2c;selfautoparent:/texmf-dist/web2c;selfautoparent:/texmf/web2c" + resolvers.luacnfspec={ + "home:texmf/web2c", + "selfautoparent:/texmf-local/web2c", + "selfautoparent:", + "selfautoparent:/texmf-dist/web2c", + "selfautoparent:/texmf/web2c", + } elseif ostype~="windows" and isdir("/etc/texmf/web2c") then - resolvers.luacnfspec="home:texmf/web2c;/etc/texmf/web2c;selfautodir:/share/texmf/web2c" + resolvers.luacnfspec={ + "home:texmf/web2c", + "/etc/texmf/web2c", + "selfautodir:/share/texmf/web2c", + } else end + resolvers.luacnfspec=concat(resolvers.luacnfspec,";") end local unset_variable="unset" local formats=resolvers.formats @@ -23200,7 +23338,7 @@ end local preparetreepattern=Cs((P(".")/"%%."+P("-")/"%%-"+P(1))^0*Cc("$")) local collect_instance_files local function find_analyze(filename,askedformat,allresults) - local filetype='' + local filetype="" local filesuffix=suffixonly(filename) local wantedfiles={} wantedfiles[#wantedfiles+1]=filename @@ -23208,7 +23346,7 @@ local function find_analyze(filename,askedformat,allresults) if filesuffix=="" or not suffixmap[filesuffix] then local defaultsuffixes=resolvers.defaultsuffixes for i=1,#defaultsuffixes do - local forcedname=filename..'.'..defaultsuffixes[i] + local forcedname=filename.."."..defaultsuffixes[i] wantedfiles[#wantedfiles+1]=forcedname filetype=formatofsuffix(forcedname) if trace_locating then @@ -23552,7 +23690,8 @@ collect_instance_files=function(filename,askedformat,allresults) local result={} local status={} local done={} - for k,r in next,results do + for k=1,#results do + local r=results[k] local method,list=r[1],r[2] if method and list then for i=1,#list do @@ -25750,7 +25889,7 @@ do -- create closure to overcome 200 locals limit package.loaded["luat-sta"] = package.loaded["luat-sta"] or true --- original size: 5703, stripped down to: 2321 +-- original size: 5608, stripped down to: 2321 if not modules then modules={} end modules ['luat-sta']={ version=1.001, @@ -26140,8 +26279,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1037585 --- stripped bytes : 408686 +-- original bytes : 1050273 +-- stripped bytes : 417643 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs-mkiv/unix/contextjit b/Master/texmf-dist/scripts/context/stubs-mkiv/unix/contextjit deleted file mode 100755 index d1374801b2e..00000000000 --- a/Master/texmf-dist/scripts/context/stubs-mkiv/unix/contextjit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -luajittex --luaonly `kpsewhich mtxrun.lua` --script context "$@" diff --git a/Master/texmf-dist/scripts/context/stubs-mkiv/unix/luatools b/Master/texmf-dist/scripts/context/stubs-mkiv/unix/luatools deleted file mode 100755 index c17b483be53..00000000000 --- a/Master/texmf-dist/scripts/context/stubs-mkiv/unix/luatools +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -mtxrun --script base "$@" diff --git a/Master/texmf-dist/scripts/context/stubs-mkiv/unix/mtxrunjit b/Master/texmf-dist/scripts/context/stubs-mkiv/unix/mtxrunjit deleted file mode 100755 index 06cd8a8acbb..00000000000 --- a/Master/texmf-dist/scripts/context/stubs-mkiv/unix/mtxrunjit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -luajittex --luaonly `kpsewhich mtxrun.lua` "$@" diff --git a/Master/texmf-dist/scripts/context/stubs-mkiv/win64/contextjit.cmd b/Master/texmf-dist/scripts/context/stubs-mkiv/win64/contextjit.cmd deleted file mode 100755 index ec963b1a62a..00000000000 --- a/Master/texmf-dist/scripts/context/stubs-mkiv/win64/contextjit.cmd +++ /dev/null @@ -1,4 +0,0 @@ -@echo off - -for /f "usebackq tokens=*" %%M in (`kpsewhich mtxrun.lua`) do set MTX=%%M -luajittex --luaonly --socket %MTX% --script context %* diff --git a/Master/texmf-dist/scripts/context/stubs-mkiv/win64/luatools.cmd b/Master/texmf-dist/scripts/context/stubs-mkiv/win64/luatools.cmd deleted file mode 100755 index a20c7e0c901..00000000000 --- a/Master/texmf-dist/scripts/context/stubs-mkiv/win64/luatools.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -mtxrun --script base %* diff --git a/Master/texmf-dist/scripts/context/stubs-mkiv/win64/mtxrunjit.cmd b/Master/texmf-dist/scripts/context/stubs-mkiv/win64/mtxrunjit.cmd deleted file mode 100755 index 39507f2214a..00000000000 --- a/Master/texmf-dist/scripts/context/stubs-mkiv/win64/mtxrunjit.cmd +++ /dev/null @@ -1,4 +0,0 @@ -@echo off - -for /f "usebackq tokens=*" %%M in (`kpsewhich mtxrun.lua`) do set MTX=%%M -luajittex --luaonly --socket %MTX% %* diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua b/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua index 1abe9164a71..346917a1849 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua @@ -1528,16 +1528,16 @@ do end checkmath(di) i = i + 1 - elseif tg == "mrow" and detail then -- hm, falls through - di.detail = nil + elseif tg == "mrow" and di.detail then -- hm, falls through checkmath(di) di = { element = "maction", nature = "display", - attributes = { actiontype = detail }, + attributes = { actiontype = di.detail }, data = { di }, n = 0, } + di.detail = nil data[i] = di i = i + 1 else @@ -1545,14 +1545,15 @@ do if category then -- no checkmath(di) here if category == 1 then -- mo - i = collapse(di,i,data,ndata,detail,"mo") + i = collapse(di,i,data,ndata,di.detail,"mo") elseif category == 2 then -- mi - i = collapse(di,i,data,ndata,detail,"mi") + i = collapse(di,i,data,ndata,di.detail,"mi") elseif category == 3 then -- mn - i = collapse(di,i,data,ndata,detail,"mn") + i = collapse(di,i,data,ndata,di.detail,"mn") elseif category == 4 then -- ms - i = collapse(di,i,data,ndata,detail,"ms") + i = collapse(di,i,data,ndata,di.detail,"ms") elseif category >= 1000 then + -- Can this still happen .. maybe it's broken. local apply = category >= 2000 if apply then category = category - 1000 @@ -1562,7 +1563,7 @@ do root.skip = "comment" root.element = "function" end - i = collapse(di,i,data,ndata,detail,"mi") + i = collapse(di,i,data,ndata,di.detail,"mi") local tag = functions[category] if tag then di.data = functioncontent[tag] diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-def.lua b/Master/texmf-dist/tex/context/base/mkiv/char-def.lua index 1d4c130e918..ac00f8eae6b 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/char-def.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/char-def.lua @@ -24,6 +24,8 @@ Updated end 2021 as prelude to ar's remote talk at the meeting. Needs some indic checking (see comment field). Todo: get rid of specials = { "font", ... } in math ... we have already vectors. +Todo: remove adobe names (move them to the glyph list) + ]]-- local variants_emoji={ @@ -93,7 +95,6 @@ characters.data={ unicodeslot=0x0, }, { - adobename="controlSTX", category="cc", description="START OF HEADING", direction="bn", @@ -101,7 +102,6 @@ characters.data={ unicodeslot=0x1, }, { - adobename="controlSOT", category="cc", description="START OF TEXT", direction="bn", @@ -109,7 +109,6 @@ characters.data={ unicodeslot=0x2, }, { - adobename="controlETX", category="cc", description="END OF TEXT", direction="bn", @@ -117,7 +116,6 @@ characters.data={ unicodeslot=0x3, }, { - adobename="controlEOT", category="cc", description="END OF TRANSMISSION", direction="bn", @@ -125,7 +123,6 @@ characters.data={ unicodeslot=0x4, }, { - adobename="controlENQ", category="cc", description="ENQUIRY", direction="bn", @@ -133,7 +130,6 @@ characters.data={ unicodeslot=0x5, }, { - adobename="controlACK", category="cc", description="ACKNOWLEDGE", direction="bn", @@ -141,7 +137,6 @@ characters.data={ unicodeslot=0x6, }, { - adobename="controlBEL", category="cc", description="BELL", direction="bn", @@ -149,7 +144,6 @@ characters.data={ unicodeslot=0x7, }, { - adobename="controlBS", category="cc", description="BACKSPACE", direction="bn", @@ -157,7 +151,6 @@ characters.data={ unicodeslot=0x8, }, { - adobename="controlHT", category="cc", description="CHARACTER TABULATION", direction="s", @@ -166,7 +159,6 @@ characters.data={ unicodeslot=0x9, }, { - adobename="controlLF", category="cc", description="LINE FEED (LF)", direction="b", @@ -175,7 +167,6 @@ characters.data={ unicodeslot=0xA, }, { - adobename="controlVT", category="cc", description="LINE TABULATION", direction="s", @@ -184,7 +175,6 @@ characters.data={ unicodeslot=0xB, }, { - adobename="controlFF", category="cc", description="FORM FEED (FF)", direction="ws", @@ -193,7 +183,6 @@ characters.data={ unicodeslot=0xC, }, { - adobename="controlCR", category="cc", description="CARRIAGE RETURN (CR)", direction="b", @@ -202,7 +191,6 @@ characters.data={ unicodeslot=0xD, }, { - adobename="controlSO", category="cc", description="SHIFT OUT", direction="bn", @@ -210,7 +198,6 @@ characters.data={ unicodeslot=0xE, }, { - adobename="controlSI", category="cc", description="SHIFT IN", direction="bn", @@ -218,7 +205,6 @@ characters.data={ unicodeslot=0xF, }, { - adobename="controlDLE", category="cc", description="DATA LINK ESCAPE", direction="bn", @@ -226,7 +212,6 @@ characters.data={ unicodeslot=0x10, }, { - adobename="controlDC1", category="cc", description="DEVICE CONTROL ONE", direction="bn", @@ -234,7 +219,6 @@ characters.data={ unicodeslot=0x11, }, { - adobename="controlDC2", category="cc", description="DEVICE CONTROL TWO", direction="bn", @@ -242,7 +226,6 @@ characters.data={ unicodeslot=0x12, }, { - adobename="controlDC3", category="cc", description="DEVICE CONTROL THREE", direction="bn", @@ -250,7 +233,6 @@ characters.data={ unicodeslot=0x13, }, { - adobename="controlDC4", category="cc", description="DEVICE CONTROL FOUR", direction="bn", @@ -258,7 +240,6 @@ characters.data={ unicodeslot=0x14, }, { - adobename="controlNAK", category="cc", description="NEGATIVE ACKNOWLEDGE", direction="bn", @@ -266,7 +247,6 @@ characters.data={ unicodeslot=0x15, }, { - adobename="controlSYN", category="cc", description="SYNCHRONOUS IDLE", direction="bn", @@ -274,7 +254,6 @@ characters.data={ unicodeslot=0x16, }, { - adobename="controlETB", category="cc", description="END OF TRANSMISSION BLOCK", direction="bn", @@ -282,7 +261,6 @@ characters.data={ unicodeslot=0x17, }, { - adobename="controlCAN", category="cc", description="CANCEL", direction="bn", @@ -290,7 +268,6 @@ characters.data={ unicodeslot=0x18, }, { - adobename="controlEM", category="cc", description="END OF MEDIUM", direction="bn", @@ -298,7 +275,6 @@ characters.data={ unicodeslot=0x19, }, { - adobename="controlSUB", category="cc", description="SUBSTITUTE", direction="bn", @@ -306,7 +282,6 @@ characters.data={ unicodeslot=0x1A, }, { - adobename="controlESC", category="cc", description="ESCAPE", direction="bn", @@ -314,7 +289,6 @@ characters.data={ unicodeslot=0x1B, }, { - adobename="controlFS", category="cc", description="INFORMATION SEPARATOR FOUR", direction="b", @@ -323,7 +297,6 @@ characters.data={ unicodeslot=0x1C, }, { - adobename="controlGS", category="cc", description="INFORMATION SEPARATOR THREE", direction="b", @@ -332,7 +305,6 @@ characters.data={ unicodeslot=0x1D, }, { - adobename="controlRS", category="cc", description="INFORMATION SEPARATOR TWO", direction="b", @@ -341,7 +313,6 @@ characters.data={ unicodeslot=0x1E, }, { - adobename="controlUS", category="cc", description="INFORMATION SEPARATOR ONE", direction="s", @@ -350,7 +321,6 @@ characters.data={ unicodeslot=0x1F, }, { - adobename="space", category="zs", cjkwd="na", description="SPACE", @@ -359,18 +329,18 @@ characters.data={ unicodeslot=0x20, }, { - adobename="exclam", category="po", cjkwd="na", description="EXCLAMATION MARK", direction="on", linebreak="ex", mathclass="factorial", + mathgroup="factorial", + mathmeaning="factorial", synonyms={ "bang", "factorial" }, unicodeslot=0x21, }, { - adobename="quotedbl", category="po", cjkwd="na", contextname="quotedbl", @@ -382,7 +352,6 @@ characters.data={ unicodeslot=0x22, }, { - adobename="numbersign", category="po", cjkwd="na", contextname="texthash", @@ -390,13 +359,14 @@ characters.data={ direction="et", linebreak="al", mathclass="binary", + mathgroup="unary arithmetic", + mathmeaning="the number of", mathname="mathhash", synonyms={ "crosshatch", "hash", "octothorpe", "pound sign" }, unicodeslot=0x23, variants=variants_emoji, }, { - adobename="dollar", category="sc", cjkwd="na", contextname="textdollar", @@ -409,7 +379,6 @@ characters.data={ unicodeslot=0x24, }, { - adobename="percent", category="po", cjkwd="na", contextname="textpercent", @@ -417,11 +386,12 @@ characters.data={ direction="et", linebreak="po", mathclass="binary", + mathgroup="quantifier", + mathmeaning="percent", mathname="mathpercent", unicodeslot=0x25, }, { - adobename="ampersand", category="po", cjkwd="na", contextname="textampersand", @@ -429,23 +399,23 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary logical", + mathmeaning="and", mathname="mathampersand", unicodeslot=0x26, }, { - adobename="quotesingle", category="po", cjkwd="na", contextname="quotesingle", description="APOSTROPHE", direction="on", linebreak="qu", - mathclass="ordinary", + mathclass="prime", synonyms={ "apl quote", "apostrophe-quote", "neutral single quotation mark" }, unicodeslot=0x27, }, { - adobename="parenleft", category="ps", cjkwd="na", description="LEFT PARENTHESIS", @@ -459,7 +429,6 @@ characters.data={ unicodeslot=0x28, }, { - adobename="parenright", category="pe", cjkwd="na", description="RIGHT PARENTHESIS", @@ -473,7 +442,6 @@ characters.data={ unicodeslot=0x29, }, { - adobename="asterisk", category="po", cjkwd="na", description="ASTERISK", @@ -486,18 +454,17 @@ characters.data={ variants=variants_emoji, }, { - adobename="plus", category="sm", cjkwd="na", description="PLUS SIGN", direction="es", linebreak="pr", mathclass="binary", - mathgroup="nary arithmetic", + mathgroup="binary arithmetic", + mathmeaning="plus", unicodeslot=0x2B, }, { - adobename="comma", category="po", cjkwd="na", contextname="textcomma", @@ -505,11 +472,12 @@ characters.data={ direction="cs", linebreak="is", mathclass="punctuation", + mathgroup="punctuation", + mathmeaning="comma", synonyms={ "decimal separator" }, unicodeslot=0x2C, }, { - adobename="hyphen", category="pd", cjkwd="na", contextname="texthyphen", @@ -526,7 +494,6 @@ characters.data={ unicodeslot=0x2D, }, { - adobename="period", category="po", cjkwd="na", comment="class needed for autopunctuation", @@ -534,6 +501,7 @@ characters.data={ description="FULL STOP", direction="cs", linebreak="is", + mathclass="punctuation", mathspec={ { class="binary", @@ -548,7 +516,6 @@ characters.data={ unicodeslot=0x2E, }, { - adobename="slash", category="po", cjkwd="na", contextname="textslash", @@ -556,6 +523,8 @@ characters.data={ direction="cs", linebreak="sy", mathclass="division", + mathgroup="binary arithmetic", + mathmeaning="divided by", mathspec={ { class="division", @@ -570,7 +539,6 @@ characters.data={ unicodeslot=0x2F, }, { - adobename="zero", category="nd", cjkwd="na", description="DIGIT ZERO", @@ -585,7 +553,6 @@ characters.data={ }, }, { - adobename="one", category="nd", cjkwd="na", description="DIGIT ONE", @@ -596,7 +563,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="two", category="nd", cjkwd="na", description="DIGIT TWO", @@ -607,7 +573,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="three", category="nd", cjkwd="na", description="DIGIT THREE", @@ -618,7 +583,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="four", category="nd", cjkwd="na", description="DIGIT FOUR", @@ -629,7 +593,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="five", category="nd", cjkwd="na", description="DIGIT FIVE", @@ -640,7 +603,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="six", category="nd", cjkwd="na", description="DIGIT SIX", @@ -651,7 +613,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="seven", category="nd", cjkwd="na", description="DIGIT SEVEN", @@ -662,7 +623,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="eight", category="nd", cjkwd="na", description="DIGIT EIGHT", @@ -673,7 +633,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="nine", category="nd", cjkwd="na", description="DIGIT NINE", @@ -684,7 +643,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="colon", category="po", cjkwd="na", comment="mathclass=punctuation,mathname=colon,mathsymbol=0x2236", @@ -692,11 +650,9 @@ characters.data={ direction="cs", linebreak="is", mathclass="relation", ---mathsymbol=0x2236, unicodeslot=0x3A, }, { - adobename="semicolon", category="po", cjkwd="na", description="SEMICOLON", @@ -707,21 +663,20 @@ characters.data={ unicodeslot=0x3B, }, { - adobename="less", category="sm", cjkwd="na", description="LESS-THAN SIGN", direction="on", linebreak="al", mathclass="relation", - mathgroup="nary relation", + mathgroup="binary relation", + mathmeaning="is less than", mathname="lt", mirror=0x3E, textclass="open", unicodeslot=0x3C, }, { - adobename="equal", category="sm", cjkwd="na", comment="mathclass=binary", @@ -730,7 +685,8 @@ characters.data={ linebreak="al", mathextensible="h", mathfiller="equalfill", - mathgroup="nary relation", + mathgroup="binary relation", + mathmeaning="equals", mathspec={ { class="relation", @@ -745,21 +701,20 @@ characters.data={ unicodeslot=0x3D, }, { - adobename="greater", category="sm", cjkwd="na", description="GREATER-THAN SIGN", direction="on", linebreak="al", mathclass="relation", - mathgroup="nary relation", + mathgroup="binary relation", + mathmeaning="is greater than", mathname="gt", mirror=0x3C, textclass="close", unicodeslot=0x3E, }, { - adobename="question", category="po", cjkwd="na", description="QUESTION MARK", @@ -769,7 +724,6 @@ characters.data={ unicodeslot=0x3F, }, { - adobename="at", category="po", cjkwd="na", contextname="textat", @@ -780,87 +734,94 @@ characters.data={ unicodeslot=0x40, }, { - adobename="A", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER A", direction="l", lccode=0x61, linebreak="al", + mathclass="variable", unicodeslot=0x41, }, { - adobename="B", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER B", direction="l", lccode=0x62, linebreak="al", + mathclass="variable", unicodeslot=0x42, }, { - adobename="C", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER C", direction="l", lccode=0x63, linebreak="al", + mathclass="variable", unicodeslot=0x43, }, { - adobename="D", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER D", direction="l", lccode=0x64, linebreak="al", + mathclass="variable", + mathspec={ + { + class="differential", + group="differential", + meaning="differential operator D", + name="mathDuprightshape", + }, + }, unicodeslot=0x44, }, { - adobename="E", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER E", direction="l", lccode=0x65, linebreak="al", + mathclass="variable", unicodeslot=0x45, }, { - adobename="F", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER F", direction="l", lccode=0x66, linebreak="al", + mathclass="variable", unicodeslot=0x46, }, { - adobename="G", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER G", direction="l", lccode=0x67, linebreak="al", + mathclass="variable", unicodeslot=0x47, }, { - adobename="H", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER H", direction="l", lccode=0x68, linebreak="al", + mathclass="variable", unicodeslot=0x48, }, { - adobename="I", category="lu", cjkwd="na", contextname="dotlessI", @@ -868,10 +829,10 @@ characters.data={ direction="l", lccode=0x69, linebreak="al", + mathclass="variable", unicodeslot=0x49, }, { - adobename="J", category="lu", cjkwd="na", contextname="dotlessJ", @@ -879,170 +840,170 @@ characters.data={ direction="l", lccode=0x6A, linebreak="al", + mathclass="variable", unicodeslot=0x4A, }, { - adobename="K", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER K", direction="l", lccode=0x6B, linebreak="al", + mathclass="variable", unicodeslot=0x4B, }, { - adobename="L", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER L", direction="l", lccode=0x6C, linebreak="al", + mathclass="variable", unicodeslot=0x4C, }, { - adobename="M", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER M", direction="l", lccode=0x6D, linebreak="al", + mathclass="variable", unicodeslot=0x4D, }, { - adobename="N", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER N", direction="l", lccode=0x6E, linebreak="al", + mathclass="variable", unicodeslot=0x4E, }, { - adobename="O", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER O", direction="l", lccode=0x6F, linebreak="al", + mathclass="variable", unicodeslot=0x4F, }, { - adobename="P", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER P", direction="l", lccode=0x70, linebreak="al", + mathclass="variable", unicodeslot=0x50, }, { - adobename="Q", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER Q", direction="l", lccode=0x71, linebreak="al", + mathclass="variable", unicodeslot=0x51, }, { - adobename="R", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER R", direction="l", lccode=0x72, linebreak="al", + mathclass="variable", unicodeslot=0x52, }, { - adobename="S", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER S", direction="l", lccode=0x73, linebreak="al", + mathclass="variable", unicodeslot=0x53, }, { - adobename="T", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER T", direction="l", lccode=0x74, linebreak="al", + mathclass="variable", unicodeslot=0x54, }, { - adobename="U", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER U", direction="l", lccode=0x75, linebreak="al", + mathclass="variable", unicodeslot=0x55, }, { - adobename="V", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER V", direction="l", lccode=0x76, linebreak="al", + mathclass="variable", unicodeslot=0x56, }, { - adobename="W", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER W", direction="l", lccode=0x77, linebreak="al", + mathclass="variable", unicodeslot=0x57, }, { - adobename="X", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER X", direction="l", lccode=0x78, linebreak="al", + mathclass="variable", unicodeslot=0x58, }, { - adobename="Y", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER Y", direction="l", lccode=0x79, linebreak="al", + mathclass="variable", unicodeslot=0x59, }, { - adobename="Z", category="lu", cjkwd="na", description="LATIN CAPITAL LETTER Z", direction="l", lccode=0x7A, linebreak="al", + mathclass="variable", unicodeslot=0x5A, }, { - adobename="bracketleft", category="ps", cjkwd="na", description="LEFT SQUARE BRACKET", @@ -1056,7 +1017,6 @@ characters.data={ unicodeslot=0x5B, }, { - adobename="backslash", category="po", cjkwd="na", contextname="textbackslash", @@ -1069,7 +1029,6 @@ characters.data={ unicodeslot=0x5C, }, { - adobename="bracketright", category="pe", cjkwd="na", description="RIGHT SQUARE BRACKET", @@ -1083,7 +1042,6 @@ characters.data={ unicodeslot=0x5D, }, { - adobename="asciicircum", category="sk", cjkwd="na", comment="the Hat looks rediculous in most fonts", @@ -1091,13 +1049,10 @@ characters.data={ description="CIRCUMFLEX ACCENT", direction="on", linebreak="al", ---mathclass="topaccent", ---mathname="Hat", synonyms={ "spacing circumflex accent" }, unicodeslot=0x5E, }, { - adobename="underscore", category="pc", cjkwd="na", contextname="textunderscore", @@ -1108,7 +1063,6 @@ characters.data={ unicodeslot=0x5F, }, { - adobename="grave", category="sk", cjkwd="na", contextname="textgrave", @@ -1130,268 +1084,275 @@ characters.data={ unicodeslot=0x60, }, { - adobename="a", category="ll", cjkwd="na", description="LATIN SMALL LETTER A", direction="l", linebreak="al", + mathclass="variable", uccode=0x41, unicodeslot=0x61, }, { - adobename="b", category="ll", cjkwd="na", description="LATIN SMALL LETTER B", direction="l", linebreak="al", + mathclass="variable", uccode=0x42, unicodeslot=0x62, }, { - adobename="c", category="ll", cjkwd="na", description="LATIN SMALL LETTER C", direction="l", linebreak="al", + mathclass="variable", uccode=0x43, unicodeslot=0x63, }, { - adobename="d", category="ll", cjkwd="na", description="LATIN SMALL LETTER D", direction="l", linebreak="al", + mathclass="variable", + mathspec={ + { + class="differential", + group="differential", + meaning="differential", + name="mathduprightshape", + }, + }, uccode=0x44, unicodeslot=0x64, }, { - adobename="e", category="ll", cjkwd="na", description="LATIN SMALL LETTER E", direction="l", linebreak="al", + mathclass="variable", uccode=0x45, unicodeslot=0x65, }, { - adobename="f", category="ll", cjkwd="na", description="LATIN SMALL LETTER F", direction="l", linebreak="al", + mathclass="variable", uccode=0x46, unicodeslot=0x66, }, { - adobename="g", category="ll", cjkwd="na", description="LATIN SMALL LETTER G", direction="l", linebreak="al", + mathclass="variable", uccode=0x47, unicodeslot=0x67, }, { - adobename="h", category="ll", cjkwd="na", description="LATIN SMALL LETTER H", direction="l", linebreak="al", + mathclass="variable", uccode=0x48, unicodeslot=0x68, }, { - adobename="i", category="ll", cjkwd="na", contextname="idotaccent", description="LATIN SMALL LETTER I", direction="l", linebreak="al", + mathclass="variable", uccode=0x49, unicodeslot=0x69, }, { - adobename="j", category="ll", cjkwd="na", description="LATIN SMALL LETTER J", direction="l", linebreak="al", + mathclass="variable", uccode=0x4A, unicodeslot=0x6A, }, { - adobename="k", category="ll", cjkwd="na", description="LATIN SMALL LETTER K", direction="l", linebreak="al", + mathclass="variable", uccode=0x4B, unicodeslot=0x6B, }, { - adobename="l", category="ll", cjkwd="na", description="LATIN SMALL LETTER L", direction="l", linebreak="al", + mathclass="variable", uccode=0x4C, unicodeslot=0x6C, }, { - adobename="m", category="ll", cjkwd="na", description="LATIN SMALL LETTER M", direction="l", linebreak="al", + mathclass="variable", uccode=0x4D, unicodeslot=0x6D, }, { - adobename="n", category="ll", cjkwd="na", description="LATIN SMALL LETTER N", direction="l", linebreak="al", + mathclass="variable", uccode=0x4E, unicodeslot=0x6E, }, { - adobename="o", category="ll", cjkwd="na", description="LATIN SMALL LETTER O", direction="l", linebreak="al", + mathclass="variable", uccode=0x4F, unicodeslot=0x6F, }, { - adobename="p", category="ll", cjkwd="na", description="LATIN SMALL LETTER P", direction="l", linebreak="al", + mathclass="variable", uccode=0x50, unicodeslot=0x70, }, { - adobename="q", category="ll", cjkwd="na", description="LATIN SMALL LETTER Q", direction="l", linebreak="al", + mathclass="variable", uccode=0x51, unicodeslot=0x71, }, { - adobename="r", category="ll", cjkwd="na", description="LATIN SMALL LETTER R", direction="l", linebreak="al", + mathclass="variable", uccode=0x52, unicodeslot=0x72, }, { - adobename="s", category="ll", cjkwd="na", description="LATIN SMALL LETTER S", direction="l", linebreak="al", + mathclass="variable", uccode=0x53, unicodeslot=0x73, }, { - adobename="t", category="ll", cjkwd="na", description="LATIN SMALL LETTER T", direction="l", linebreak="al", + mathclass="variable", uccode=0x54, unicodeslot=0x74, }, { - adobename="u", category="ll", cjkwd="na", description="LATIN SMALL LETTER U", direction="l", linebreak="al", + mathclass="variable", uccode=0x55, unicodeslot=0x75, }, { - adobename="v", category="ll", cjkwd="na", description="LATIN SMALL LETTER V", direction="l", linebreak="al", + mathclass="variable", uccode=0x56, unicodeslot=0x76, }, { - adobename="w", category="ll", cjkwd="na", description="LATIN SMALL LETTER W", direction="l", linebreak="al", + mathclass="variable", uccode=0x57, unicodeslot=0x77, }, { - adobename="x", category="ll", cjkwd="na", description="LATIN SMALL LETTER X", direction="l", linebreak="al", + mathclass="variable", uccode=0x58, unicodeslot=0x78, }, { - adobename="y", category="ll", cjkwd="na", description="LATIN SMALL LETTER Y", direction="l", linebreak="al", + mathclass="variable", uccode=0x59, unicodeslot=0x79, }, { - adobename="z", category="ll", cjkwd="na", description="LATIN SMALL LETTER Z", direction="l", linebreak="al", + mathclass="variable", uccode=0x5A, unicodeslot=0x7A, }, { - adobename="braceleft", category="ps", cjkwd="na", contextname="textbraceleft", @@ -1406,7 +1367,6 @@ characters.data={ unicodeslot=0x7B, }, { - adobename="verticalbar", category="sm", cjkwd="na", comment="mathclass=binary,mathname=bar", @@ -1416,10 +1376,6 @@ characters.data={ linebreak="ba", mathclass="ordinary", mathspec={ --- { --- class="ordinary", --- name="arrowvert", --- }, { class="delimiter", name="vert", @@ -1445,7 +1401,6 @@ characters.data={ unicodeslot=0x7C, }, { - adobename="braceright", category="pe", cjkwd="na", contextname="textbraceright", @@ -1460,7 +1415,6 @@ characters.data={ unicodeslot=0x7D, }, { - adobename="asciitilde", category="sm", cjkwd="na", contextname="textasciitilde", @@ -1472,7 +1426,6 @@ characters.data={ unicodeslot=0x7E, }, { - adobename="controlDEL", category="cc", description="DELETE", direction="bn", @@ -1705,7 +1658,6 @@ characters.data={ unicodeslot=0x9F, }, { - adobename="nonbreakingspace", category="zs", contextname="nobreakspace", description="NO-BREAK SPACE", @@ -1717,7 +1669,6 @@ characters.data={ unicodeslot=0xA0, }, { - adobename="exclamdown", category="po", cjkwd="a", contextname="exclamdown", @@ -1727,7 +1678,6 @@ characters.data={ unicodeslot=0xA1, }, { - adobename="cent", category="sc", cjkwd="na", contextname="textcent", @@ -1737,7 +1687,6 @@ characters.data={ unicodeslot=0xA2, }, { - adobename="sterling", category="sc", cjkwd="na", contextname="textsterling", @@ -1748,7 +1697,6 @@ characters.data={ unicodeslot=0xA3, }, { - adobename="currency", category="sc", cjkwd="a", contextname="textcurrency", @@ -1758,7 +1706,6 @@ characters.data={ unicodeslot=0xA4, }, { - adobename="yen", category="sc", cjkwd="na", contextname="textyen", @@ -1771,7 +1718,6 @@ characters.data={ unicodeslot=0xA5, }, { - adobename="brokenbar", category="so", cjkwd="na", contextname="textbrokenbar", @@ -1782,7 +1728,6 @@ characters.data={ unicodeslot=0xA6, }, { - adobename="section", category="so", cjkwd="a", contextname="sectionmark", @@ -1795,7 +1740,6 @@ characters.data={ unicodeslot=0xA7, }, { - adobename="dieresis", category="sk", cjkwd="a", contextname="textdiaeresis", @@ -1818,7 +1762,6 @@ characters.data={ unicodeslot=0xA8, }, { - adobename="copyright", category="so", contextname="copyright", description="COPYRIGHT SIGN", @@ -1828,7 +1771,6 @@ characters.data={ variants=variants_emoji, }, { - adobename="ordfeminine", category="ll", cjkwd="a", contextname="ordfeminine", @@ -1839,7 +1781,6 @@ characters.data={ unicodeslot=0xAA, }, { - adobename="guillemotleft", category="pi", contextname="leftguillemot", description="LEFT-POINTING DOUBLE ANGLE QUOTATION MARK", @@ -1851,28 +1792,20 @@ characters.data={ unicodeslot=0xAB, }, { - adobename="logicalnot", category="sm", cjkwd="na", + comment="neg is now implemented as function", contextname="textlognot", description="NOT SIGN", direction="on", linebreak="al", - mathspec={ - { - class="ordinary", - name="lnot", - }, - { - class="ordinary", - name="neg", - }, - }, + mathgroup="unary logical", + mathmeaning="not", + mathname="lnot", synonyms={ "angled dash" }, unicodeslot=0xAC, }, { - adobename="softhyphen", category="cf", cjkwd="a", contextname="softhyphen", @@ -1883,7 +1816,6 @@ characters.data={ unicodeslot=0xAD, }, { - adobename="registered", category="so", cjkwd="a", contextname="registered", @@ -1895,16 +1827,12 @@ characters.data={ variants=variants_emoji, }, { - adobename="macron", category="sk", cjkwd="na", contextname="textmacron", description="MACRON", direction="on", linebreak="al", ---mathclass="topaccent", ---mathfiller="barfill", ---mathmleq=0x203E, mathspec={ { class="topaccent", @@ -1921,7 +1849,6 @@ characters.data={ unicodeslot=0xAF, }, { - adobename="degree", category="so", cjkwd="a", contextname="textdegree", @@ -1931,7 +1858,6 @@ characters.data={ unicodeslot=0xB0, }, { - adobename="plusminus", category="sm", cjkwd="a", contextname="textpm", @@ -1939,11 +1865,12 @@ characters.data={ direction="et", linebreak="pr", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="plus minus", mathname="pm", unicodeslot=0xB1, }, { - adobename="twosuperior", category="no", cjkwd="a", contextname="twosuperior", @@ -1955,7 +1882,6 @@ characters.data={ unicodeslot=0xB2, }, { - adobename="threesuperior", category="no", cjkwd="a", contextname="threesuperior", @@ -1967,7 +1893,6 @@ characters.data={ unicodeslot=0xB3, }, { - adobename="acute", category="sk", cjkwd="a", contextname="textacute", @@ -1990,7 +1915,6 @@ characters.data={ unicodeslot=0xB4, }, { - adobename="mu1", category="ll", contextname="textmu", description="MICRO SIGN", @@ -2001,7 +1925,6 @@ characters.data={ unicodeslot=0xB5, }, { - adobename="paragraph", category="so", cjkwd="a", contextname="paragraphmark", @@ -2014,7 +1937,6 @@ characters.data={ unicodeslot=0xB6, }, { - adobename="periodcentered", category="po", cjkwd="a", contextname="periodcentered", @@ -2022,12 +1944,13 @@ characters.data={ direction="on", linebreak="ai", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="dot product", mathname="centerdot", synonyms={ "georgian comma", "greek ano teleia", "greek middle dot", "midpoint" }, unicodeslot=0xB7, }, { - adobename="cedilla", category="sk", cjkwd="a", contextname="textcedilla", @@ -2039,7 +1962,6 @@ characters.data={ unicodeslot=0xB8, }, { - adobename="onesuperior", category="no", cjkwd="a", contextname="onesuperior", @@ -2050,7 +1972,6 @@ characters.data={ unicodeslot=0xB9, }, { - adobename="ordmasculine", category="ll", cjkwd="a", contextname="ordmasculine", @@ -2061,7 +1982,6 @@ characters.data={ unicodeslot=0xBA, }, { - adobename="guillemotright", category="pf", contextname="rightguillemot", description="RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK", @@ -2073,7 +1993,6 @@ characters.data={ unicodeslot=0xBB, }, { - adobename="onequarter", category="no", cjkwd="a", contextname="onequarter", @@ -2084,7 +2003,6 @@ characters.data={ unicodeslot=0xBC, }, { - adobename="onehalf", category="no", cjkwd="a", contextname="onehalf", @@ -2095,7 +2013,6 @@ characters.data={ unicodeslot=0xBD, }, { - adobename="threequarters", category="no", cjkwd="a", contextname="threequarter", @@ -2106,7 +2023,6 @@ characters.data={ unicodeslot=0xBE, }, { - adobename="questiondown", category="po", cjkwd="a", contextname="questiondown", @@ -2117,7 +2033,6 @@ characters.data={ unicodeslot=0xBF, }, { - adobename="Agrave", category="lu", contextname="Agrave", description="LATIN CAPITAL LETTER A WITH GRAVE", @@ -2129,7 +2044,6 @@ characters.data={ unicodeslot=0xC0, }, { - adobename="Aacute", category="lu", contextname="Aacute", description="LATIN CAPITAL LETTER A WITH ACUTE", @@ -2141,7 +2055,6 @@ characters.data={ unicodeslot=0xC1, }, { - adobename="Acircumflex", category="lu", contextname="Acircumflex", description="LATIN CAPITAL LETTER A WITH CIRCUMFLEX", @@ -2153,7 +2066,6 @@ characters.data={ unicodeslot=0xC2, }, { - adobename="Atilde", category="lu", contextname="Atilde", description="LATIN CAPITAL LETTER A WITH TILDE", @@ -2165,7 +2077,6 @@ characters.data={ unicodeslot=0xC3, }, { - adobename="Adieresis", category="lu", contextname="Adiaeresis", description="LATIN CAPITAL LETTER A WITH DIAERESIS", @@ -2177,7 +2088,6 @@ characters.data={ unicodeslot=0xC4, }, { - adobename="Aring", category="lu", contextname="Aring", description="LATIN CAPITAL LETTER A WITH RING ABOVE", @@ -2189,7 +2099,6 @@ characters.data={ unicodeslot=0xC5, }, { - adobename="AE", category="lu", cjkwd="a", contextname="AEligature", @@ -2202,7 +2111,6 @@ characters.data={ unicodeslot=0xC6, }, { - adobename="Ccedilla", category="lu", contextname="Ccedilla", description="LATIN CAPITAL LETTER C WITH CEDILLA", @@ -2214,7 +2122,6 @@ characters.data={ unicodeslot=0xC7, }, { - adobename="Egrave", category="lu", contextname="Egrave", description="LATIN CAPITAL LETTER E WITH GRAVE", @@ -2226,7 +2133,6 @@ characters.data={ unicodeslot=0xC8, }, { - adobename="Eacute", category="lu", contextname="Eacute", description="LATIN CAPITAL LETTER E WITH ACUTE", @@ -2238,7 +2144,6 @@ characters.data={ unicodeslot=0xC9, }, { - adobename="Ecircumflex", category="lu", contextname="Ecircumflex", description="LATIN CAPITAL LETTER E WITH CIRCUMFLEX", @@ -2250,7 +2155,6 @@ characters.data={ unicodeslot=0xCA, }, { - adobename="Edieresis", category="lu", contextname="Ediaeresis", description="LATIN CAPITAL LETTER E WITH DIAERESIS", @@ -2262,7 +2166,6 @@ characters.data={ unicodeslot=0xCB, }, { - adobename="Igrave", category="lu", contextname="Igrave", description="LATIN CAPITAL LETTER I WITH GRAVE", @@ -2274,7 +2177,6 @@ characters.data={ unicodeslot=0xCC, }, { - adobename="Iacute", category="lu", contextname="Iacute", description="LATIN CAPITAL LETTER I WITH ACUTE", @@ -2286,7 +2188,6 @@ characters.data={ unicodeslot=0xCD, }, { - adobename="Icircumflex", category="lu", contextname="Icircumflex", description="LATIN CAPITAL LETTER I WITH CIRCUMFLEX", @@ -2298,7 +2199,6 @@ characters.data={ unicodeslot=0xCE, }, { - adobename="Idieresis", category="lu", contextname="Idiaeresis", description="LATIN CAPITAL LETTER I WITH DIAERESIS", @@ -2310,7 +2210,6 @@ characters.data={ unicodeslot=0xCF, }, { - adobename="Eth", category="lu", cjkwd="a", contextname="Eth", @@ -2321,7 +2220,6 @@ characters.data={ unicodeslot=0xD0, }, { - adobename="Ntilde", category="lu", contextname="Ntilde", description="LATIN CAPITAL LETTER N WITH TILDE", @@ -2333,7 +2231,6 @@ characters.data={ unicodeslot=0xD1, }, { - adobename="Ograve", category="lu", contextname="Ograve", description="LATIN CAPITAL LETTER O WITH GRAVE", @@ -2345,7 +2242,6 @@ characters.data={ unicodeslot=0xD2, }, { - adobename="Oacute", category="lu", contextname="Oacute", description="LATIN CAPITAL LETTER O WITH ACUTE", @@ -2357,7 +2253,6 @@ characters.data={ unicodeslot=0xD3, }, { - adobename="Ocircumflex", category="lu", contextname="Ocircumflex", description="LATIN CAPITAL LETTER O WITH CIRCUMFLEX", @@ -2369,7 +2264,6 @@ characters.data={ unicodeslot=0xD4, }, { - adobename="Otilde", category="lu", contextname="Otilde", description="LATIN CAPITAL LETTER O WITH TILDE", @@ -2381,7 +2275,6 @@ characters.data={ unicodeslot=0xD5, }, { - adobename="Odieresis", category="lu", contextname="Odiaeresis", description="LATIN CAPITAL LETTER O WITH DIAERESIS", @@ -2393,7 +2286,6 @@ characters.data={ unicodeslot=0xD6, }, { - adobename="multiply", category="sm", cjkwd="a", contextname="textmultiply", @@ -2401,13 +2293,26 @@ characters.data={ direction="on", linebreak="ai", mathclass="binary", - mathgroup="nary arithmetic", - mathname="times", + mathgroup="binary arithmetic", + mathmeaning="times", + mathspec={ + { + class="binary", + group="binary arithmetic", + meaning="multiplication", + name="times", + }, + { + class="binary", + group="binary vector", + meaning="crossproduct", + name="crossproduct", + }, + }, synonyms={ "cartesian product" }, unicodeslot=0xD7, }, { - adobename="Oslash", category="lu", cjkwd="a", contextname="Ostroke", @@ -2421,7 +2326,6 @@ characters.data={ unicodeslot=0xD8, }, { - adobename="Ugrave", category="lu", contextname="Ugrave", description="LATIN CAPITAL LETTER U WITH GRAVE", @@ -2433,7 +2337,6 @@ characters.data={ unicodeslot=0xD9, }, { - adobename="Uacute", category="lu", contextname="Uacute", description="LATIN CAPITAL LETTER U WITH ACUTE", @@ -2445,7 +2348,6 @@ characters.data={ unicodeslot=0xDA, }, { - adobename="Ucircumflex", category="lu", contextname="Ucircumflex", description="LATIN CAPITAL LETTER U WITH CIRCUMFLEX", @@ -2457,7 +2359,6 @@ characters.data={ unicodeslot=0xDB, }, { - adobename="Udieresis", category="lu", contextname="Udiaeresis", description="LATIN CAPITAL LETTER U WITH DIAERESIS", @@ -2469,7 +2370,6 @@ characters.data={ unicodeslot=0xDC, }, { - adobename="Yacute", category="lu", contextname="Yacute", description="LATIN CAPITAL LETTER Y WITH ACUTE", @@ -2481,7 +2381,6 @@ characters.data={ unicodeslot=0xDD, }, { - adobename="Thorn", category="lu", cjkwd="a", contextname="Thorn", @@ -2492,7 +2391,6 @@ characters.data={ unicodeslot=0xDE, }, { - adobename="germandbls", category="ll", cjkwd="a", comment="uppercase can be 0x1E9E", @@ -2506,7 +2404,6 @@ characters.data={ unicodeslot=0xDF, }, { - adobename="agrave", category="ll", cjkwd="a", contextname="agrave", @@ -2519,7 +2416,6 @@ characters.data={ unicodeslot=0xE0, }, { - adobename="aacute", category="ll", cjkwd="a", contextname="aacute", @@ -2532,7 +2428,6 @@ characters.data={ unicodeslot=0xE1, }, { - adobename="acircumflex", category="ll", contextname="acircumflex", description="LATIN SMALL LETTER A WITH CIRCUMFLEX", @@ -2544,7 +2439,6 @@ characters.data={ unicodeslot=0xE2, }, { - adobename="atilde", category="ll", contextname="atilde", description="LATIN SMALL LETTER A WITH TILDE", @@ -2556,7 +2450,6 @@ characters.data={ unicodeslot=0xE3, }, { - adobename="adieresis", category="ll", contextname="adiaeresis", description="LATIN SMALL LETTER A WITH DIAERESIS", @@ -2568,7 +2461,6 @@ characters.data={ unicodeslot=0xE4, }, { - adobename="aring", category="ll", contextname="aring", description="LATIN SMALL LETTER A WITH RING ABOVE", @@ -2580,7 +2472,6 @@ characters.data={ unicodeslot=0xE5, }, { - adobename="ae", category="ll", cjkwd="a", contextname="aeligature", @@ -2593,7 +2484,6 @@ characters.data={ unicodeslot=0xE6, }, { - adobename="ccedilla", category="ll", contextname="ccedilla", description="LATIN SMALL LETTER C WITH CEDILLA", @@ -2605,7 +2495,6 @@ characters.data={ unicodeslot=0xE7, }, { - adobename="egrave", category="ll", cjkwd="a", contextname="egrave", @@ -2618,7 +2507,6 @@ characters.data={ unicodeslot=0xE8, }, { - adobename="eacute", category="ll", cjkwd="a", contextname="eacute", @@ -2631,7 +2519,6 @@ characters.data={ unicodeslot=0xE9, }, { - adobename="ecircumflex", category="ll", cjkwd="a", contextname="ecircumflex", @@ -2644,7 +2531,6 @@ characters.data={ unicodeslot=0xEA, }, { - adobename="edieresis", category="ll", contextname="ediaeresis", description="LATIN SMALL LETTER E WITH DIAERESIS", @@ -2656,7 +2542,6 @@ characters.data={ unicodeslot=0xEB, }, { - adobename="igrave", category="ll", cjkwd="a", contextname="igrave", @@ -2669,7 +2554,6 @@ characters.data={ unicodeslot=0xEC, }, { - adobename="iacute", category="ll", cjkwd="a", contextname="iacute", @@ -2682,7 +2566,6 @@ characters.data={ unicodeslot=0xED, }, { - adobename="icircumflex", category="ll", contextname="icircumflex", description="LATIN SMALL LETTER I WITH CIRCUMFLEX", @@ -2694,7 +2577,6 @@ characters.data={ unicodeslot=0xEE, }, { - adobename="idieresis", category="ll", contextname="idiaeresis", description="LATIN SMALL LETTER I WITH DIAERESIS", @@ -2706,7 +2588,6 @@ characters.data={ unicodeslot=0xEF, }, { - adobename="eth", category="ll", cjkwd="a", comment="contextname=eth", @@ -2719,7 +2600,6 @@ characters.data={ unicodeslot=0xF0, }, { - adobename="ntilde", category="ll", contextname="ntilde", description="LATIN SMALL LETTER N WITH TILDE", @@ -2731,7 +2611,6 @@ characters.data={ unicodeslot=0xF1, }, { - adobename="ograve", category="ll", cjkwd="a", contextname="ograve", @@ -2744,7 +2623,6 @@ characters.data={ unicodeslot=0xF2, }, { - adobename="oacute", category="ll", cjkwd="a", contextname="oacute", @@ -2757,7 +2635,6 @@ characters.data={ unicodeslot=0xF3, }, { - adobename="ocircumflex", category="ll", contextname="ocircumflex", description="LATIN SMALL LETTER O WITH CIRCUMFLEX", @@ -2769,7 +2646,6 @@ characters.data={ unicodeslot=0xF4, }, { - adobename="otilde", category="ll", contextname="otilde", description="LATIN SMALL LETTER O WITH TILDE", @@ -2781,7 +2657,6 @@ characters.data={ unicodeslot=0xF5, }, { - adobename="odieresis", category="ll", contextname="odiaeresis", description="LATIN SMALL LETTER O WITH DIAERESIS", @@ -2793,7 +2668,6 @@ characters.data={ unicodeslot=0xF6, }, { - adobename="divide", category="sm", cjkwd="a", contextname="textdiv", @@ -2802,12 +2676,12 @@ characters.data={ linebreak="ai", mathclass="binary", mathgroup="binary arithmetic", + mathmeaning="divided by", mathname="div", synonyms={ "obelus" }, unicodeslot=0xF7, }, { - adobename="oslash", category="ll", cjkwd="a", contextname="ostroke", @@ -2821,7 +2695,6 @@ characters.data={ unicodeslot=0xF8, }, { - adobename="ugrave", category="ll", cjkwd="a", contextname="ugrave", @@ -2834,7 +2707,6 @@ characters.data={ unicodeslot=0xF9, }, { - adobename="uacute", category="ll", cjkwd="a", contextname="uacute", @@ -2847,7 +2719,6 @@ characters.data={ unicodeslot=0xFA, }, { - adobename="ucircumflex", category="ll", contextname="ucircumflex", description="LATIN SMALL LETTER U WITH CIRCUMFLEX", @@ -2859,7 +2730,6 @@ characters.data={ unicodeslot=0xFB, }, { - adobename="udieresis", category="ll", cjkwd="a", contextname="udiaeresis", @@ -2872,7 +2742,6 @@ characters.data={ unicodeslot=0xFC, }, { - adobename="yacute", category="ll", contextname="yacute", description="LATIN SMALL LETTER Y WITH ACUTE", @@ -2884,7 +2753,6 @@ characters.data={ unicodeslot=0xFD, }, { - adobename="thorn", category="ll", cjkwd="a", contextname="thorn", @@ -2895,7 +2763,6 @@ characters.data={ unicodeslot=0xFE, }, { - adobename="ydieresis", category="ll", contextname="ydiaeresis", description="LATIN SMALL LETTER Y WITH DIAERESIS", @@ -2907,7 +2774,6 @@ characters.data={ unicodeslot=0xFF, }, { - adobename="Amacron", category="lu", contextname="Amacron", description="LATIN CAPITAL LETTER A WITH MACRON", @@ -2919,7 +2785,6 @@ characters.data={ unicodeslot=0x100, }, { - adobename="amacron", category="ll", cjkwd="a", contextname="amacron", @@ -2932,7 +2797,6 @@ characters.data={ unicodeslot=0x101, }, { - adobename="Abreve", category="lu", contextname="Abreve", description="LATIN CAPITAL LETTER A WITH BREVE", @@ -2944,7 +2808,6 @@ characters.data={ unicodeslot=0x102, }, { - adobename="abreve", category="ll", contextname="abreve", description="LATIN SMALL LETTER A WITH BREVE", @@ -2956,7 +2819,6 @@ characters.data={ unicodeslot=0x103, }, { - adobename="Aogonek", category="lu", contextname="Aogonek", description="LATIN CAPITAL LETTER A WITH OGONEK", @@ -2968,7 +2830,6 @@ characters.data={ unicodeslot=0x104, }, { - adobename="aogonek", category="ll", contextname="aogonek", description="LATIN SMALL LETTER A WITH OGONEK", @@ -2980,7 +2841,6 @@ characters.data={ unicodeslot=0x105, }, { - adobename="Cacute", category="lu", contextname="Cacute", description="LATIN CAPITAL LETTER C WITH ACUTE", @@ -2992,7 +2852,6 @@ characters.data={ unicodeslot=0x106, }, { - adobename="cacute", category="ll", contextname="cacute", description="LATIN SMALL LETTER C WITH ACUTE", @@ -3004,7 +2863,6 @@ characters.data={ unicodeslot=0x107, }, { - adobename="Ccircumflex", category="lu", contextname="Ccircumflex", description="LATIN CAPITAL LETTER C WITH CIRCUMFLEX", @@ -3016,7 +2874,6 @@ characters.data={ unicodeslot=0x108, }, { - adobename="ccircumflex", category="ll", contextname="ccircumflex", description="LATIN SMALL LETTER C WITH CIRCUMFLEX", @@ -3028,7 +2885,6 @@ characters.data={ unicodeslot=0x109, }, { - adobename="Cdotaccent", category="lu", contextname="Cdotaccent", description="LATIN CAPITAL LETTER C WITH DOT ABOVE", @@ -3040,7 +2896,6 @@ characters.data={ unicodeslot=0x10A, }, { - adobename="cdotaccent", category="ll", contextname="cdotaccent", description="LATIN SMALL LETTER C WITH DOT ABOVE", @@ -3052,7 +2907,6 @@ characters.data={ unicodeslot=0x10B, }, { - adobename="Ccaron", category="lu", contextname="Ccaron", description="LATIN CAPITAL LETTER C WITH CARON", @@ -3064,7 +2918,6 @@ characters.data={ unicodeslot=0x10C, }, { - adobename="ccaron", category="ll", contextname="ccaron", description="LATIN SMALL LETTER C WITH CARON", @@ -3076,7 +2929,6 @@ characters.data={ unicodeslot=0x10D, }, { - adobename="Dcaron", category="lu", contextname="Dcaron", description="LATIN CAPITAL LETTER D WITH CARON", @@ -3088,7 +2940,6 @@ characters.data={ unicodeslot=0x10E, }, { - adobename="dcaron", category="ll", contextname="dcaron", description="LATIN SMALL LETTER D WITH CARON", @@ -3100,7 +2951,6 @@ characters.data={ unicodeslot=0x10F, }, { - adobename="Dslash", category="lu", contextname="Dstroke", description="LATIN CAPITAL LETTER D WITH STROKE", @@ -3112,7 +2962,6 @@ characters.data={ unicodeslot=0x110, }, { - adobename="dmacron", category="ll", cjkwd="a", contextname="dstroke", @@ -3125,7 +2974,6 @@ characters.data={ unicodeslot=0x111, }, { - adobename="Emacron", category="lu", contextname="Emacron", description="LATIN CAPITAL LETTER E WITH MACRON", @@ -3137,7 +2985,6 @@ characters.data={ unicodeslot=0x112, }, { - adobename="emacron", category="ll", cjkwd="a", contextname="emacron", @@ -3150,7 +2997,6 @@ characters.data={ unicodeslot=0x113, }, { - adobename="Ebreve", category="lu", contextname="Ebreve", description="LATIN CAPITAL LETTER E WITH BREVE", @@ -3162,7 +3008,6 @@ characters.data={ unicodeslot=0x114, }, { - adobename="ebreve", category="ll", contextname="ebreve", description="LATIN SMALL LETTER E WITH BREVE", @@ -3174,7 +3019,6 @@ characters.data={ unicodeslot=0x115, }, { - adobename="Edotaccent", category="lu", contextname="Edotaccent", description="LATIN CAPITAL LETTER E WITH DOT ABOVE", @@ -3186,7 +3030,6 @@ characters.data={ unicodeslot=0x116, }, { - adobename="edotaccent", category="ll", contextname="edotaccent", description="LATIN SMALL LETTER E WITH DOT ABOVE", @@ -3198,7 +3041,6 @@ characters.data={ unicodeslot=0x117, }, { - adobename="Eogonek", category="lu", contextname="Eogonek", description="LATIN CAPITAL LETTER E WITH OGONEK", @@ -3210,7 +3052,6 @@ characters.data={ unicodeslot=0x118, }, { - adobename="eogonek", category="ll", contextname="eogonek", description="LATIN SMALL LETTER E WITH OGONEK", @@ -3222,7 +3063,6 @@ characters.data={ unicodeslot=0x119, }, { - adobename="Ecaron", category="lu", contextname="Ecaron", description="LATIN CAPITAL LETTER E WITH CARON", @@ -3234,7 +3074,6 @@ characters.data={ unicodeslot=0x11A, }, { - adobename="ecaron", category="ll", cjkwd="a", contextname="ecaron", @@ -3247,7 +3086,6 @@ characters.data={ unicodeslot=0x11B, }, { - adobename="Gcircumflex", category="lu", contextname="Gcircumflex", description="LATIN CAPITAL LETTER G WITH CIRCUMFLEX", @@ -3259,7 +3097,6 @@ characters.data={ unicodeslot=0x11C, }, { - adobename="gcircumflex", category="ll", contextname="gcircumflex", description="LATIN SMALL LETTER G WITH CIRCUMFLEX", @@ -3271,7 +3108,6 @@ characters.data={ unicodeslot=0x11D, }, { - adobename="Gbreve", category="lu", contextname="Gbreve", description="LATIN CAPITAL LETTER G WITH BREVE", @@ -3283,7 +3119,6 @@ characters.data={ unicodeslot=0x11E, }, { - adobename="gbreve", category="ll", contextname="gbreve", description="LATIN SMALL LETTER G WITH BREVE", @@ -3295,7 +3130,6 @@ characters.data={ unicodeslot=0x11F, }, { - adobename="Gdotaccent", category="lu", contextname="Gdotaccent", description="LATIN CAPITAL LETTER G WITH DOT ABOVE", @@ -3307,7 +3141,6 @@ characters.data={ unicodeslot=0x120, }, { - adobename="gdotaccent", category="ll", contextname="gdotaccent", description="LATIN SMALL LETTER G WITH DOT ABOVE", @@ -3319,7 +3152,6 @@ characters.data={ unicodeslot=0x121, }, { - adobename="Gcommaaccent", category="lu", contextname="Gcommaaccent", description="LATIN CAPITAL LETTER G WITH CEDILLA", @@ -3331,7 +3163,6 @@ characters.data={ unicodeslot=0x122, }, { - adobename="gcommaaccent", category="ll", contextname="gcommaaccent", description="LATIN SMALL LETTER G WITH CEDILLA", @@ -3343,7 +3174,6 @@ characters.data={ unicodeslot=0x123, }, { - adobename="Hcircumflex", category="lu", contextname="Hcircumflex", description="LATIN CAPITAL LETTER H WITH CIRCUMFLEX", @@ -3355,7 +3185,6 @@ characters.data={ unicodeslot=0x124, }, { - adobename="hcircumflex", category="ll", contextname="hcircumflex", description="LATIN SMALL LETTER H WITH CIRCUMFLEX", @@ -3367,7 +3196,6 @@ characters.data={ unicodeslot=0x125, }, { - adobename="Hbar", category="lu", cjkwd="a", contextname="Hstroke", @@ -3380,7 +3208,6 @@ characters.data={ unicodeslot=0x126, }, { - adobename="hbar", category="ll", cjkwd="a", contextname="hstroke", @@ -3393,7 +3220,6 @@ characters.data={ unicodeslot=0x127, }, { - adobename="Itilde", category="lu", contextname="Itilde", description="LATIN CAPITAL LETTER I WITH TILDE", @@ -3405,7 +3231,6 @@ characters.data={ unicodeslot=0x128, }, { - adobename="itilde", category="ll", contextname="itilde", description="LATIN SMALL LETTER I WITH TILDE", @@ -3417,7 +3242,6 @@ characters.data={ unicodeslot=0x129, }, { - adobename="Imacron", category="lu", contextname="Imacron", description="LATIN CAPITAL LETTER I WITH MACRON", @@ -3429,7 +3253,6 @@ characters.data={ unicodeslot=0x12A, }, { - adobename="imacron", category="ll", cjkwd="a", contextname="imacron", @@ -3442,7 +3265,6 @@ characters.data={ unicodeslot=0x12B, }, { - adobename="Ibreve", category="lu", contextname="Ibreve", description="LATIN CAPITAL LETTER I WITH BREVE", @@ -3454,7 +3276,6 @@ characters.data={ unicodeslot=0x12C, }, { - adobename="ibreve", category="ll", contextname="ibreve", description="LATIN SMALL LETTER I WITH BREVE", @@ -3466,7 +3287,6 @@ characters.data={ unicodeslot=0x12D, }, { - adobename="Iogonek", category="lu", contextname="Iogonek", description="LATIN CAPITAL LETTER I WITH OGONEK", @@ -3478,7 +3298,6 @@ characters.data={ unicodeslot=0x12E, }, { - adobename="iogonek", category="ll", contextname="iogonek", description="LATIN SMALL LETTER I WITH OGONEK", @@ -3490,7 +3309,6 @@ characters.data={ unicodeslot=0x12F, }, { - adobename="Idotaccent", category="lu", contextname="Idotaccent", description="LATIN CAPITAL LETTER I WITH DOT ABOVE", @@ -3503,7 +3321,6 @@ characters.data={ unicodeslot=0x130, }, { - adobename="dotlessi", category="ll", cjkwd="a", contextname="dotlessi", @@ -3514,7 +3331,6 @@ characters.data={ unicodeslot=0x131, }, { - adobename="IJ", category="lu", cjkwd="a", contextname="IJligature", @@ -3527,7 +3343,6 @@ characters.data={ unicodeslot=0x132, }, { - adobename="ij", category="ll", cjkwd="a", contextname="ijligature", @@ -3540,7 +3355,6 @@ characters.data={ unicodeslot=0x133, }, { - adobename="Jcircumflex", category="lu", contextname="Jcircumflex", description="LATIN CAPITAL LETTER J WITH CIRCUMFLEX", @@ -3552,7 +3366,6 @@ characters.data={ unicodeslot=0x134, }, { - adobename="jcircumflex", category="ll", contextname="jcircumflex", description="LATIN SMALL LETTER J WITH CIRCUMFLEX", @@ -3564,7 +3377,6 @@ characters.data={ unicodeslot=0x135, }, { - adobename="Kcommaaccent", category="lu", contextname="Kcommaaccent", description="LATIN CAPITAL LETTER K WITH CEDILLA", @@ -3576,7 +3388,6 @@ characters.data={ unicodeslot=0x136, }, { - adobename="kcommaaccent", category="ll", contextname="kcommaaccent", description="LATIN SMALL LETTER K WITH CEDILLA", @@ -3588,7 +3399,6 @@ characters.data={ unicodeslot=0x137, }, { - adobename="kgreenlandic", category="ll", cjkwd="a", contextname="kkra", @@ -3598,7 +3408,6 @@ characters.data={ unicodeslot=0x138, }, { - adobename="Lacute", category="lu", contextname="Lacute", description="LATIN CAPITAL LETTER L WITH ACUTE", @@ -3610,7 +3419,6 @@ characters.data={ unicodeslot=0x139, }, { - adobename="lacute", category="ll", contextname="lacute", description="LATIN SMALL LETTER L WITH ACUTE", @@ -3622,7 +3430,6 @@ characters.data={ unicodeslot=0x13A, }, { - adobename="Lcommaaccent", category="lu", contextname="Lcommaaccent", description="LATIN CAPITAL LETTER L WITH CEDILLA", @@ -3634,7 +3441,6 @@ characters.data={ unicodeslot=0x13B, }, { - adobename="lcommaaccent", category="ll", contextname="lcommaaccent", description="LATIN SMALL LETTER L WITH CEDILLA", @@ -3646,7 +3452,6 @@ characters.data={ unicodeslot=0x13C, }, { - adobename="Lcaron", category="lu", contextname="Lcaron", description="LATIN CAPITAL LETTER L WITH CARON", @@ -3658,7 +3463,6 @@ characters.data={ unicodeslot=0x13D, }, { - adobename="lcaron", category="ll", contextname="lcaron", description="LATIN SMALL LETTER L WITH CARON", @@ -3670,7 +3474,6 @@ characters.data={ unicodeslot=0x13E, }, { - adobename="Ldotaccent", category="lu", cjkwd="a", contextname="Ldotmiddle", @@ -3683,7 +3486,6 @@ characters.data={ unicodeslot=0x13F, }, { - adobename="ldotaccent", category="ll", cjkwd="a", contextname="ldotmiddle", @@ -3696,7 +3498,6 @@ characters.data={ unicodeslot=0x140, }, { - adobename="Lslash", category="lu", cjkwd="a", contextname="Lstroke", @@ -3709,7 +3510,6 @@ characters.data={ unicodeslot=0x141, }, { - adobename="lslash", category="ll", cjkwd="a", contextname="lstroke", @@ -3722,7 +3522,6 @@ characters.data={ unicodeslot=0x142, }, { - adobename="Nacute", category="lu", contextname="Nacute", description="LATIN CAPITAL LETTER N WITH ACUTE", @@ -3734,7 +3533,6 @@ characters.data={ unicodeslot=0x143, }, { - adobename="nacute", category="ll", cjkwd="a", contextname="nacute", @@ -3747,7 +3545,6 @@ characters.data={ unicodeslot=0x144, }, { - adobename="Ncommaaccent", category="lu", contextname="Ncommaaccent", description="LATIN CAPITAL LETTER N WITH CEDILLA", @@ -3759,7 +3556,6 @@ characters.data={ unicodeslot=0x145, }, { - adobename="ncommaaccent", category="ll", contextname="ncommaaccent", description="LATIN SMALL LETTER N WITH CEDILLA", @@ -3771,7 +3567,6 @@ characters.data={ unicodeslot=0x146, }, { - adobename="Ncaron", category="lu", contextname="Ncaron", description="LATIN CAPITAL LETTER N WITH CARON", @@ -3783,7 +3578,6 @@ characters.data={ unicodeslot=0x147, }, { - adobename="ncaron", category="ll", cjkwd="a", contextname="ncaron", @@ -3796,7 +3590,6 @@ characters.data={ unicodeslot=0x148, }, { - adobename="quoterightn", category="ll", cjkwd="a", contextname="napostrophe", @@ -3808,7 +3601,6 @@ characters.data={ unicodeslot=0x149, }, { - adobename="Eng", category="lu", cjkwd="a", contextname="Neng", @@ -3819,7 +3611,6 @@ characters.data={ unicodeslot=0x14A, }, { - adobename="eng", category="ll", cjkwd="a", contextname="neng", @@ -3830,7 +3621,6 @@ characters.data={ unicodeslot=0x14B, }, { - adobename="Omacron", category="lu", contextname="Omacron", description="LATIN CAPITAL LETTER O WITH MACRON", @@ -3842,7 +3632,6 @@ characters.data={ unicodeslot=0x14C, }, { - adobename="omacron", category="ll", cjkwd="a", contextname="omacron", @@ -3855,7 +3644,6 @@ characters.data={ unicodeslot=0x14D, }, { - adobename="Obreve", category="lu", contextname="Obreve", description="LATIN CAPITAL LETTER O WITH BREVE", @@ -3867,7 +3655,6 @@ characters.data={ unicodeslot=0x14E, }, { - adobename="obreve", category="ll", contextname="obreve", description="LATIN SMALL LETTER O WITH BREVE", @@ -3879,7 +3666,6 @@ characters.data={ unicodeslot=0x14F, }, { - adobename="Ohungarumlaut", category="lu", contextname="Ohungarumlaut", description="LATIN CAPITAL LETTER O WITH DOUBLE ACUTE", @@ -3891,7 +3677,6 @@ characters.data={ unicodeslot=0x150, }, { - adobename="ohungarumlaut", category="ll", contextname="ohungarumlaut", description="LATIN SMALL LETTER O WITH DOUBLE ACUTE", @@ -3903,7 +3688,6 @@ characters.data={ unicodeslot=0x151, }, { - adobename="OE", category="lu", cjkwd="a", contextname="OEligature", @@ -3915,7 +3699,6 @@ characters.data={ unicodeslot=0x152, }, { - adobename="oe", category="ll", cjkwd="a", contextname="oeligature", @@ -3928,7 +3711,6 @@ characters.data={ unicodeslot=0x153, }, { - adobename="Racute", category="lu", contextname="Racute", description="LATIN CAPITAL LETTER R WITH ACUTE", @@ -3940,7 +3722,6 @@ characters.data={ unicodeslot=0x154, }, { - adobename="racute", category="ll", contextname="racute", description="LATIN SMALL LETTER R WITH ACUTE", @@ -3952,7 +3733,6 @@ characters.data={ unicodeslot=0x155, }, { - adobename="Rcommaaccent", category="lu", contextname="Rcommaaccent", description="LATIN CAPITAL LETTER R WITH CEDILLA", @@ -3964,7 +3744,6 @@ characters.data={ unicodeslot=0x156, }, { - adobename="rcommaaccent", category="ll", contextname="rcommaaccent", description="LATIN SMALL LETTER R WITH CEDILLA", @@ -3976,7 +3755,6 @@ characters.data={ unicodeslot=0x157, }, { - adobename="Rcaron", category="lu", contextname="Rcaron", description="LATIN CAPITAL LETTER R WITH CARON", @@ -3988,7 +3766,6 @@ characters.data={ unicodeslot=0x158, }, { - adobename="rcaron", category="ll", contextname="rcaron", description="LATIN SMALL LETTER R WITH CARON", @@ -4000,7 +3777,6 @@ characters.data={ unicodeslot=0x159, }, { - adobename="Sacute", category="lu", contextname="Sacute", description="LATIN CAPITAL LETTER S WITH ACUTE", @@ -4012,7 +3788,6 @@ characters.data={ unicodeslot=0x15A, }, { - adobename="sacute", category="ll", contextname="sacute", description="LATIN SMALL LETTER S WITH ACUTE", @@ -4024,7 +3799,6 @@ characters.data={ unicodeslot=0x15B, }, { - adobename="Scircumflex", category="lu", contextname="Scircumflex", description="LATIN CAPITAL LETTER S WITH CIRCUMFLEX", @@ -4036,7 +3810,6 @@ characters.data={ unicodeslot=0x15C, }, { - adobename="scircumflex", category="ll", contextname="scircumflex", description="LATIN SMALL LETTER S WITH CIRCUMFLEX", @@ -4048,7 +3821,6 @@ characters.data={ unicodeslot=0x15D, }, { - adobename="Scedilla", category="lu", contextname="Scedilla", description="LATIN CAPITAL LETTER S WITH CEDILLA", @@ -4060,7 +3832,6 @@ characters.data={ unicodeslot=0x15E, }, { - adobename="scedilla", category="ll", contextname="scedilla", description="LATIN SMALL LETTER S WITH CEDILLA", @@ -4072,7 +3843,6 @@ characters.data={ unicodeslot=0x15F, }, { - adobename="Scaron", category="lu", contextname="Scaron", description="LATIN CAPITAL LETTER S WITH CARON", @@ -4084,7 +3854,6 @@ characters.data={ unicodeslot=0x160, }, { - adobename="scaron", category="ll", contextname="scaron", description="LATIN SMALL LETTER S WITH CARON", @@ -4096,7 +3865,6 @@ characters.data={ unicodeslot=0x161, }, { - adobename="Tcommaaccent", category="lu", contextname="Tcedilla", description="LATIN CAPITAL LETTER T WITH CEDILLA", @@ -4108,7 +3876,6 @@ characters.data={ unicodeslot=0x162, }, { - adobename="tcommaaccent", category="ll", contextname="tcedilla", description="LATIN SMALL LETTER T WITH CEDILLA", @@ -4120,7 +3887,6 @@ characters.data={ unicodeslot=0x163, }, { - adobename="Tcaron", category="lu", contextname="Tcaron", description="LATIN CAPITAL LETTER T WITH CARON", @@ -4132,7 +3898,6 @@ characters.data={ unicodeslot=0x164, }, { - adobename="tcaron", category="ll", contextname="tcaron", description="LATIN SMALL LETTER T WITH CARON", @@ -4144,7 +3909,6 @@ characters.data={ unicodeslot=0x165, }, { - adobename="Tbar", category="lu", cjkwd="a", contextname="Tstroke", @@ -4157,7 +3921,6 @@ characters.data={ unicodeslot=0x166, }, { - adobename="tbar", category="ll", cjkwd="a", contextname="tstroke", @@ -4170,7 +3933,6 @@ characters.data={ unicodeslot=0x167, }, { - adobename="Utilde", category="lu", contextname="Utilde", description="LATIN CAPITAL LETTER U WITH TILDE", @@ -4182,7 +3944,6 @@ characters.data={ unicodeslot=0x168, }, { - adobename="utilde", category="ll", contextname="utilde", description="LATIN SMALL LETTER U WITH TILDE", @@ -4194,7 +3955,6 @@ characters.data={ unicodeslot=0x169, }, { - adobename="Umacron", category="lu", contextname="Umacron", description="LATIN CAPITAL LETTER U WITH MACRON", @@ -4206,7 +3966,6 @@ characters.data={ unicodeslot=0x16A, }, { - adobename="umacron", category="ll", cjkwd="a", contextname="umacron", @@ -4219,7 +3978,6 @@ characters.data={ unicodeslot=0x16B, }, { - adobename="Ubreve", category="lu", contextname="Ubreve", description="LATIN CAPITAL LETTER U WITH BREVE", @@ -4231,7 +3989,6 @@ characters.data={ unicodeslot=0x16C, }, { - adobename="ubreve", category="ll", contextname="ubreve", description="LATIN SMALL LETTER U WITH BREVE", @@ -4243,7 +4000,6 @@ characters.data={ unicodeslot=0x16D, }, { - adobename="Uring", category="lu", contextname="Uring", description="LATIN CAPITAL LETTER U WITH RING ABOVE", @@ -4255,7 +4011,6 @@ characters.data={ unicodeslot=0x16E, }, { - adobename="uring", category="ll", contextname="uring", description="LATIN SMALL LETTER U WITH RING ABOVE", @@ -4267,7 +4022,6 @@ characters.data={ unicodeslot=0x16F, }, { - adobename="Uhungarumlaut", category="lu", contextname="Uhungarumlaut", description="LATIN CAPITAL LETTER U WITH DOUBLE ACUTE", @@ -4279,7 +4033,6 @@ characters.data={ unicodeslot=0x170, }, { - adobename="uhungarumlaut", category="ll", contextname="uhungarumlaut", description="LATIN SMALL LETTER U WITH DOUBLE ACUTE", @@ -4291,7 +4044,6 @@ characters.data={ unicodeslot=0x171, }, { - adobename="Uogonek", category="lu", contextname="Uogonek", description="LATIN CAPITAL LETTER U WITH OGONEK", @@ -4303,7 +4055,6 @@ characters.data={ unicodeslot=0x172, }, { - adobename="uogonek", category="ll", contextname="uogonek", description="LATIN SMALL LETTER U WITH OGONEK", @@ -4315,7 +4066,6 @@ characters.data={ unicodeslot=0x173, }, { - adobename="Wcircumflex", category="lu", contextname="Wcircumflex", description="LATIN CAPITAL LETTER W WITH CIRCUMFLEX", @@ -4327,7 +4077,6 @@ characters.data={ unicodeslot=0x174, }, { - adobename="wcircumflex", category="ll", contextname="wcircumflex", description="LATIN SMALL LETTER W WITH CIRCUMFLEX", @@ -4339,7 +4088,6 @@ characters.data={ unicodeslot=0x175, }, { - adobename="Ycircumflex", category="lu", contextname="Ycircumflex", description="LATIN CAPITAL LETTER Y WITH CIRCUMFLEX", @@ -4351,7 +4099,6 @@ characters.data={ unicodeslot=0x176, }, { - adobename="ycircumflex", category="ll", contextname="ycircumflex", description="LATIN SMALL LETTER Y WITH CIRCUMFLEX", @@ -4363,7 +4110,6 @@ characters.data={ unicodeslot=0x177, }, { - adobename="Ydieresis", category="lu", contextname="Ydiaeresis", description="LATIN CAPITAL LETTER Y WITH DIAERESIS", @@ -4375,7 +4121,6 @@ characters.data={ unicodeslot=0x178, }, { - adobename="Zacute", category="lu", contextname="Zacute", description="LATIN CAPITAL LETTER Z WITH ACUTE", @@ -4387,7 +4132,6 @@ characters.data={ unicodeslot=0x179, }, { - adobename="zacute", category="ll", contextname="zacute", description="LATIN SMALL LETTER Z WITH ACUTE", @@ -4399,7 +4143,6 @@ characters.data={ unicodeslot=0x17A, }, { - adobename="Zdotaccent", category="lu", contextname="Zdotaccent", description="LATIN CAPITAL LETTER Z WITH DOT ABOVE", @@ -4411,7 +4154,6 @@ characters.data={ unicodeslot=0x17B, }, { - adobename="zdotaccent", category="ll", contextname="zdotaccent", description="LATIN SMALL LETTER Z WITH DOT ABOVE", @@ -4423,7 +4165,6 @@ characters.data={ unicodeslot=0x17C, }, { - adobename="Zcaron", category="lu", contextname="Zcaron", description="LATIN CAPITAL LETTER Z WITH CARON", @@ -4435,7 +4176,6 @@ characters.data={ unicodeslot=0x17D, }, { - adobename="zcaron", category="ll", contextname="zcaron", description="LATIN SMALL LETTER Z WITH CARON", @@ -4447,7 +4187,6 @@ characters.data={ unicodeslot=0x17E, }, { - adobename="slong", category="ll", contextname="slong", description="LATIN SMALL LETTER LONG S", @@ -4458,7 +4197,6 @@ characters.data={ unicodeslot=0x17F, }, { - adobename="bstroke", category="ll", contextname="bstroke", description="LATIN SMALL LETTER B WITH STROKE", @@ -4470,7 +4208,6 @@ characters.data={ unicodeslot=0x180, }, { - adobename="Bhook", category="lu", contextname="Bhook", description="LATIN CAPITAL LETTER B WITH HOOK", @@ -4482,7 +4219,6 @@ characters.data={ unicodeslot=0x181, }, { - adobename="Btopbar", category="lu", description="LATIN CAPITAL LETTER B WITH TOPBAR", direction="l", @@ -4492,7 +4228,6 @@ characters.data={ unicodeslot=0x182, }, { - adobename="btopbar", category="ll", description="LATIN SMALL LETTER B WITH TOPBAR", direction="l", @@ -4502,7 +4237,6 @@ characters.data={ unicodeslot=0x183, }, { - adobename="Tonesix", category="lu", description="LATIN CAPITAL LETTER TONE SIX", direction="l", @@ -4511,7 +4245,6 @@ characters.data={ unicodeslot=0x184, }, { - adobename="tonesix", category="ll", description="LATIN SMALL LETTER TONE SIX", direction="l", @@ -4520,7 +4253,6 @@ characters.data={ unicodeslot=0x185, }, { - adobename="Oopen", category="lu", description="LATIN CAPITAL LETTER OPEN O", direction="l", @@ -4529,7 +4261,6 @@ characters.data={ unicodeslot=0x186, }, { - adobename="Chook", category="lu", contextname="Chook", description="LATIN CAPITAL LETTER C WITH HOOK", @@ -4541,7 +4272,6 @@ characters.data={ unicodeslot=0x187, }, { - adobename="chook", category="ll", contextname="chook", description="LATIN SMALL LETTER C WITH HOOK", @@ -4553,7 +4283,6 @@ characters.data={ unicodeslot=0x188, }, { - adobename="Dafrican", category="lu", contextname="Dafrican", description="LATIN CAPITAL LETTER AFRICAN D", @@ -4563,7 +4292,6 @@ characters.data={ unicodeslot=0x189, }, { - adobename="Dhook", category="lu", contextname="Dhook", description="LATIN CAPITAL LETTER D WITH HOOK", @@ -4575,7 +4303,6 @@ characters.data={ unicodeslot=0x18A, }, { - adobename="Dtopbar", category="lu", description="LATIN CAPITAL LETTER D WITH TOPBAR", direction="l", @@ -4585,7 +4312,6 @@ characters.data={ unicodeslot=0x18B, }, { - adobename="dtopbar", category="ll", description="LATIN SMALL LETTER D WITH TOPBAR", direction="l", @@ -4595,7 +4321,6 @@ characters.data={ unicodeslot=0x18C, }, { - adobename="deltaturned", category="ll", description="LATIN SMALL LETTER TURNED DELTA", direction="l", @@ -4603,7 +4328,6 @@ characters.data={ unicodeslot=0x18D, }, { - adobename="Ereversed", category="lu", description="LATIN CAPITAL LETTER REVERSED E", direction="l", @@ -4613,7 +4337,6 @@ characters.data={ unicodeslot=0x18E, }, { - adobename="Schwa", category="lu", contextname="Schwa", description="LATIN CAPITAL LETTER SCHWA", @@ -4623,7 +4346,6 @@ characters.data={ unicodeslot=0x18F, }, { - adobename="Eopen", category="lu", description="LATIN CAPITAL LETTER OPEN E", direction="l", @@ -4633,7 +4355,6 @@ characters.data={ unicodeslot=0x190, }, { - adobename="Fhook", category="lu", contextname="Fhook", description="LATIN CAPITAL LETTER F WITH HOOK", @@ -4645,7 +4366,6 @@ characters.data={ unicodeslot=0x191, }, { - adobename="florin", category="ll", contextname="fhook", description="LATIN SMALL LETTER F WITH HOOK", @@ -4658,7 +4378,6 @@ characters.data={ unicodeslot=0x192, }, { - adobename="Ghook", category="lu", contextname="Ghook", description="LATIN CAPITAL LETTER G WITH HOOK", @@ -4670,7 +4389,6 @@ characters.data={ unicodeslot=0x193, }, { - adobename="Gammaafrican", category="lu", description="LATIN CAPITAL LETTER GAMMA", direction="l", @@ -4679,7 +4397,6 @@ characters.data={ unicodeslot=0x194, }, { - adobename="hv", category="ll", description="LATIN SMALL LETTER HV", direction="l", @@ -4688,7 +4405,6 @@ characters.data={ unicodeslot=0x195, }, { - adobename="Iotaafrican", category="lu", description="LATIN CAPITAL LETTER IOTA", direction="l", @@ -4697,7 +4413,6 @@ characters.data={ unicodeslot=0x196, }, { - adobename="Istroke", category="lu", contextname="Istroke", description="LATIN CAPITAL LETTER I WITH STROKE", @@ -4710,7 +4425,6 @@ characters.data={ unicodeslot=0x197, }, { - adobename="Khook", category="lu", contextname="Khook", description="LATIN CAPITAL LETTER K WITH HOOK", @@ -4722,7 +4436,6 @@ characters.data={ unicodeslot=0x198, }, { - adobename="khook", category="ll", contextname="khook", description="LATIN SMALL LETTER K WITH HOOK", @@ -4734,7 +4447,6 @@ characters.data={ unicodeslot=0x199, }, { - adobename="lbar", category="ll", contextname="lbar", description="LATIN SMALL LETTER L WITH BAR", @@ -4745,7 +4457,6 @@ characters.data={ unicodeslot=0x19A, }, { - adobename="lambdastroke", category="ll", description="LATIN SMALL LETTER LAMBDA WITH STROKE", direction="l", @@ -4755,7 +4466,6 @@ characters.data={ unicodeslot=0x19B, }, { - adobename="Mturned", category="lu", description="LATIN CAPITAL LETTER TURNED M", direction="l", @@ -4764,7 +4474,6 @@ characters.data={ unicodeslot=0x19C, }, { - adobename="Nhookleft", category="lu", description="LATIN CAPITAL LETTER N WITH LEFT HOOK", direction="l", @@ -4774,7 +4483,6 @@ characters.data={ unicodeslot=0x19D, }, { - adobename="nlegrightlong", category="ll", description="LATIN SMALL LETTER N WITH LONG RIGHT LEG", direction="l", @@ -4784,7 +4492,6 @@ characters.data={ unicodeslot=0x19E, }, { - adobename="Ocenteredtilde", category="lu", description="LATIN CAPITAL LETTER O WITH MIDDLE TILDE", direction="l", @@ -4795,7 +4502,6 @@ characters.data={ unicodeslot=0x19F, }, { - adobename="Ohorn", category="lu", contextname="Ohorn", description="LATIN CAPITAL LETTER O WITH HORN", @@ -4807,7 +4513,6 @@ characters.data={ unicodeslot=0x1A0, }, { - adobename="ohorn", category="ll", contextname="ohorn", description="LATIN SMALL LETTER O WITH HORN", @@ -4819,7 +4524,6 @@ characters.data={ unicodeslot=0x1A1, }, { - adobename="Oi", category="lu", description="LATIN CAPITAL LETTER OI", direction="l", @@ -4828,7 +4532,6 @@ characters.data={ unicodeslot=0x1A2, }, { - adobename="oi", category="ll", description="LATIN SMALL LETTER OI", direction="l", @@ -4837,7 +4540,6 @@ characters.data={ unicodeslot=0x1A3, }, { - adobename="Phook", category="lu", contextname="Phook", description="LATIN CAPITAL LETTER P WITH HOOK", @@ -4849,7 +4551,6 @@ characters.data={ unicodeslot=0x1A4, }, { - adobename="phook", category="ll", contextname="phook", description="LATIN SMALL LETTER P WITH HOOK", @@ -4861,7 +4562,6 @@ characters.data={ unicodeslot=0x1A5, }, { - adobename="yr", category="lu", description="LATIN LETTER YR", direction="l", @@ -4870,7 +4570,6 @@ characters.data={ unicodeslot=0x1A6, }, { - adobename="Tonetwo", category="lu", description="LATIN CAPITAL LETTER TONE TWO", direction="l", @@ -4879,7 +4578,6 @@ characters.data={ unicodeslot=0x1A7, }, { - adobename="tonetwo", category="ll", description="LATIN SMALL LETTER TONE TWO", direction="l", @@ -4888,7 +4586,6 @@ characters.data={ unicodeslot=0x1A8, }, { - adobename="Esh", category="lu", description="LATIN CAPITAL LETTER ESH", direction="l", @@ -4897,7 +4594,6 @@ characters.data={ unicodeslot=0x1A9, }, { - adobename="eshreversedloop", category="ll", description="LATIN LETTER REVERSED ESH LOOP", direction="l", @@ -4905,7 +4601,6 @@ characters.data={ unicodeslot=0x1AA, }, { - adobename="tpalatalhook", category="ll", description="LATIN SMALL LETTER T WITH PALATAL HOOK", direction="l", @@ -4914,7 +4609,6 @@ characters.data={ unicodeslot=0x1AB, }, { - adobename="Thook", category="lu", contextname="Thook", description="LATIN CAPITAL LETTER T WITH HOOK", @@ -4926,7 +4620,6 @@ characters.data={ unicodeslot=0x1AC, }, { - adobename="thook", category="ll", contextname="thook", description="LATIN SMALL LETTER T WITH HOOK", @@ -4938,7 +4631,6 @@ characters.data={ unicodeslot=0x1AD, }, { - adobename="Tretroflexhook", category="lu", description="LATIN CAPITAL LETTER T WITH RETROFLEX HOOK", direction="l", @@ -4948,7 +4640,6 @@ characters.data={ unicodeslot=0x1AE, }, { - adobename="Uhorn", category="lu", contextname="Uhorn", description="LATIN CAPITAL LETTER U WITH HORN", @@ -4960,7 +4651,6 @@ characters.data={ unicodeslot=0x1AF, }, { - adobename="uhorn", category="ll", contextname="uhorn", description="LATIN SMALL LETTER U WITH HORN", @@ -4972,7 +4662,6 @@ characters.data={ unicodeslot=0x1B0, }, { - adobename="Upsilonafrican", category="lu", description="LATIN CAPITAL LETTER UPSILON", direction="l", @@ -4981,7 +4670,6 @@ characters.data={ unicodeslot=0x1B1, }, { - adobename="Vhook", category="lu", contextname="Vhook", description="LATIN CAPITAL LETTER V WITH HOOK", @@ -4994,7 +4682,6 @@ characters.data={ unicodeslot=0x1B2, }, { - adobename="Yhook", category="lu", contextname="Yhook", description="LATIN CAPITAL LETTER Y WITH HOOK", @@ -5006,7 +4693,6 @@ characters.data={ unicodeslot=0x1B3, }, { - adobename="yhook", category="ll", contextname="yhook", description="LATIN SMALL LETTER Y WITH HOOK", @@ -5018,7 +4704,6 @@ characters.data={ unicodeslot=0x1B4, }, { - adobename="Zstroke", category="lu", contextname="Zstroke", description="LATIN CAPITAL LETTER Z WITH STROKE", @@ -5030,7 +4715,6 @@ characters.data={ unicodeslot=0x1B5, }, { - adobename="zstroke", category="ll", contextname="zstroke", description="LATIN SMALL LETTER Z WITH STROKE", @@ -5043,7 +4727,6 @@ characters.data={ unicodeslot=0x1B6, }, { - adobename="Ezh", category="lu", description="LATIN CAPITAL LETTER EZH", direction="l", @@ -5052,7 +4735,6 @@ characters.data={ unicodeslot=0x1B7, }, { - adobename="Ezhreversed", category="lu", description="LATIN CAPITAL LETTER EZH REVERSED", direction="l", @@ -5061,7 +4743,6 @@ characters.data={ unicodeslot=0x1B8, }, { - adobename="ezhreversed", category="ll", description="LATIN SMALL LETTER EZH REVERSED", direction="l", @@ -5070,7 +4751,6 @@ characters.data={ unicodeslot=0x1B9, }, { - adobename="ezhtail", category="ll", description="LATIN SMALL LETTER EZH WITH TAIL", direction="l", @@ -5079,7 +4759,6 @@ characters.data={ unicodeslot=0x1BA, }, { - adobename="twostroke", category="lo", description="LATIN LETTER TWO WITH STROKE", direction="l", @@ -5087,7 +4766,6 @@ characters.data={ unicodeslot=0x1BB, }, { - adobename="Tonefive", category="lu", description="LATIN CAPITAL LETTER TONE FIVE", direction="l", @@ -5096,7 +4774,6 @@ characters.data={ unicodeslot=0x1BC, }, { - adobename="tonefive", category="ll", description="LATIN SMALL LETTER TONE FIVE", direction="l", @@ -5105,7 +4782,6 @@ characters.data={ unicodeslot=0x1BD, }, { - adobename="glottalinvertedstroke", category="ll", description="LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE", direction="l", @@ -5114,7 +4790,6 @@ characters.data={ unicodeslot=0x1BE, }, { - adobename="wynn", category="ll", description="LATIN LETTER WYNN", direction="l", @@ -5123,7 +4798,6 @@ characters.data={ unicodeslot=0x1BF, }, { - adobename="clickdental", category="lo", description="LATIN LETTER DENTAL CLICK", direction="l", @@ -5132,7 +4806,6 @@ characters.data={ unicodeslot=0x1C0, }, { - adobename="clicklateral", category="lo", description="LATIN LETTER LATERAL CLICK", direction="l", @@ -5141,7 +4814,6 @@ characters.data={ unicodeslot=0x1C1, }, { - adobename="clickalveolar", category="lo", description="LATIN LETTER ALVEOLAR CLICK", direction="l", @@ -5150,7 +4822,6 @@ characters.data={ unicodeslot=0x1C2, }, { - adobename="clickretroflex", category="lo", description="LATIN LETTER RETROFLEX CLICK", direction="l", @@ -5159,7 +4830,6 @@ characters.data={ unicodeslot=0x1C3, }, { - adobename="DZcaron", category="lu", contextname="DZcaronligature", description="LATIN CAPITAL LETTER DZ WITH CARON", @@ -5172,7 +4842,6 @@ characters.data={ unicodeslot=0x1C4, }, { - adobename="Dzcaron", category="lt", contextname="Dzcaronligature", description="LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON", @@ -5185,7 +4854,6 @@ characters.data={ unicodeslot=0x1C5, }, { - adobename="dzcaron", category="ll", contextname="dzcaronligature", description="LATIN SMALL LETTER DZ WITH CARON", @@ -5197,7 +4865,6 @@ characters.data={ unicodeslot=0x1C6, }, { - adobename="LJ", category="lu", contextname="LJligature", description="LATIN CAPITAL LETTER LJ", @@ -5210,7 +4877,6 @@ characters.data={ unicodeslot=0x1C7, }, { - adobename="Lj", category="lt", contextname="Ljligature", description="LATIN CAPITAL LETTER L WITH SMALL LETTER J", @@ -5223,7 +4889,6 @@ characters.data={ unicodeslot=0x1C8, }, { - adobename="lj", category="ll", contextname="ljligature", description="LATIN SMALL LETTER LJ", @@ -5235,7 +4900,6 @@ characters.data={ unicodeslot=0x1C9, }, { - adobename="NJ", category="lu", contextname="NJligature", description="LATIN CAPITAL LETTER NJ", @@ -5248,7 +4912,6 @@ characters.data={ unicodeslot=0x1CA, }, { - adobename="Nj", category="lt", contextname="Njligature", description="LATIN CAPITAL LETTER N WITH SMALL LETTER J", @@ -5261,7 +4924,6 @@ characters.data={ unicodeslot=0x1CB, }, { - adobename="nj", category="ll", contextname="njligature", description="LATIN SMALL LETTER NJ", @@ -5273,7 +4935,6 @@ characters.data={ unicodeslot=0x1CC, }, { - adobename="Acaron", category="lu", contextname="Acaron", description="LATIN CAPITAL LETTER A WITH CARON", @@ -5285,7 +4946,6 @@ characters.data={ unicodeslot=0x1CD, }, { - adobename="acaron", category="ll", cjkwd="a", contextname="acaron", @@ -5298,7 +4958,6 @@ characters.data={ unicodeslot=0x1CE, }, { - adobename="Icaron", category="lu", contextname="Icaron", description="LATIN CAPITAL LETTER I WITH CARON", @@ -5310,7 +4969,6 @@ characters.data={ unicodeslot=0x1CF, }, { - adobename="icaron", category="ll", cjkwd="a", contextname="icaron", @@ -5323,7 +4981,6 @@ characters.data={ unicodeslot=0x1D0, }, { - adobename="Ocaron", category="lu", contextname="Ocaron", description="LATIN CAPITAL LETTER O WITH CARON", @@ -5335,7 +4992,6 @@ characters.data={ unicodeslot=0x1D1, }, { - adobename="ocaron", category="ll", cjkwd="a", contextname="ocaron", @@ -5348,7 +5004,6 @@ characters.data={ unicodeslot=0x1D2, }, { - adobename="Ucaron", category="lu", contextname="Ucaron", description="LATIN CAPITAL LETTER U WITH CARON", @@ -5360,7 +5015,6 @@ characters.data={ unicodeslot=0x1D3, }, { - adobename="ucaron", category="ll", cjkwd="a", contextname="ucaron", @@ -5373,7 +5027,6 @@ characters.data={ unicodeslot=0x1D4, }, { - adobename="Udieresismacron", category="lu", contextname="Udiaeresismacron", description="LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON", @@ -5385,7 +5038,6 @@ characters.data={ unicodeslot=0x1D5, }, { - adobename="udieresismacron", category="ll", cjkwd="a", contextname="udiaeresismacron", @@ -5398,7 +5050,6 @@ characters.data={ unicodeslot=0x1D6, }, { - adobename="Udieresisacute", category="lu", contextname="Udiaeresisacute", description="LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE", @@ -5410,7 +5061,6 @@ characters.data={ unicodeslot=0x1D7, }, { - adobename="udieresisacute", category="ll", cjkwd="a", contextname="udiaeresisacute", @@ -5423,7 +5073,6 @@ characters.data={ unicodeslot=0x1D8, }, { - adobename="Udieresiscaron", category="lu", contextname="Udiaeresiscaron", description="LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON", @@ -5435,7 +5084,6 @@ characters.data={ unicodeslot=0x1D9, }, { - adobename="udieresiscaron", category="ll", cjkwd="a", contextname="udiaeresiscaron", @@ -5448,7 +5096,6 @@ characters.data={ unicodeslot=0x1DA, }, { - adobename="Udieresisgrave", category="lu", contextname="Udiaeresisgrave", description="LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE", @@ -5460,7 +5107,6 @@ characters.data={ unicodeslot=0x1DB, }, { - adobename="udieresisgrave", category="ll", cjkwd="a", contextname="udiaeresisgrave", @@ -5473,7 +5119,6 @@ characters.data={ unicodeslot=0x1DC, }, { - adobename="eturned", category="ll", description="LATIN SMALL LETTER TURNED E", direction="l", @@ -5482,7 +5127,6 @@ characters.data={ unicodeslot=0x1DD, }, { - adobename="Adieresismacron", category="lu", contextname="Adiaeresismacron", description="LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON", @@ -5494,7 +5138,6 @@ characters.data={ unicodeslot=0x1DE, }, { - adobename="adieresismacron", category="ll", contextname="adiaeresismacron", description="LATIN SMALL LETTER A WITH DIAERESIS AND MACRON", @@ -5506,7 +5149,6 @@ characters.data={ unicodeslot=0x1DF, }, { - adobename="Adotmacron", category="lu", contextname="Adotaccentmacron", description="LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON", @@ -5518,7 +5160,6 @@ characters.data={ unicodeslot=0x1E0, }, { - adobename="adotmacron", category="ll", contextname="adotaccentmacron", description="LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON", @@ -5530,7 +5171,6 @@ characters.data={ unicodeslot=0x1E1, }, { - adobename="AEmacron", category="lu", contextname="AEmacron", description="LATIN CAPITAL LETTER AE WITH MACRON", @@ -5542,7 +5182,6 @@ characters.data={ unicodeslot=0x1E2, }, { - adobename="aemacron", category="ll", contextname="aemacron", description="LATIN SMALL LETTER AE WITH MACRON", @@ -5554,7 +5193,6 @@ characters.data={ unicodeslot=0x1E3, }, { - adobename="Gstroke", category="lu", contextname="Gstroke", description="LATIN CAPITAL LETTER G WITH STROKE", @@ -5566,7 +5204,6 @@ characters.data={ unicodeslot=0x1E4, }, { - adobename="gstroke", category="ll", contextname="gstroke", description="LATIN SMALL LETTER G WITH STROKE", @@ -5578,7 +5215,6 @@ characters.data={ unicodeslot=0x1E5, }, { - adobename="Gcaron", category="lu", contextname="Gcaron", description="LATIN CAPITAL LETTER G WITH CARON", @@ -5590,7 +5226,6 @@ characters.data={ unicodeslot=0x1E6, }, { - adobename="gcaron", category="ll", contextname="gcaron", description="LATIN SMALL LETTER G WITH CARON", @@ -5602,7 +5237,6 @@ characters.data={ unicodeslot=0x1E7, }, { - adobename="Kcaron", category="lu", contextname="Kcaron", description="LATIN CAPITAL LETTER K WITH CARON", @@ -5614,7 +5248,6 @@ characters.data={ unicodeslot=0x1E8, }, { - adobename="kcaron", category="ll", contextname="kcaron", description="LATIN SMALL LETTER K WITH CARON", @@ -5626,7 +5259,6 @@ characters.data={ unicodeslot=0x1E9, }, { - adobename="Oogonek", category="lu", contextname="Oogonek", description="LATIN CAPITAL LETTER O WITH OGONEK", @@ -5638,7 +5270,6 @@ characters.data={ unicodeslot=0x1EA, }, { - adobename="oogonek", category="ll", contextname="oogonek", description="LATIN SMALL LETTER O WITH OGONEK", @@ -5650,7 +5281,6 @@ characters.data={ unicodeslot=0x1EB, }, { - adobename="Oogonekmacron", category="lu", contextname="Oogonekmacron", description="LATIN CAPITAL LETTER O WITH OGONEK AND MACRON", @@ -5662,7 +5292,6 @@ characters.data={ unicodeslot=0x1EC, }, { - adobename="oogonekmacron", category="ll", contextname="oogonekmacron", description="LATIN SMALL LETTER O WITH OGONEK AND MACRON", @@ -5674,7 +5303,6 @@ characters.data={ unicodeslot=0x1ED, }, { - adobename="Ezhcaron", category="lu", description="LATIN CAPITAL LETTER EZH WITH CARON", direction="l", @@ -5685,7 +5313,6 @@ characters.data={ unicodeslot=0x1EE, }, { - adobename="ezhcaron", category="ll", description="LATIN SMALL LETTER EZH WITH CARON", direction="l", @@ -5696,7 +5323,6 @@ characters.data={ unicodeslot=0x1EF, }, { - adobename="jcaron", category="ll", contextname="jcaron", description="LATIN SMALL LETTER J WITH CARON", @@ -5708,7 +5334,6 @@ characters.data={ unicodeslot=0x1F0, }, { - adobename="DZ", category="lu", contextname="DZligature", description="LATIN CAPITAL LETTER DZ", @@ -5720,7 +5345,6 @@ characters.data={ unicodeslot=0x1F1, }, { - adobename="Dz", category="lt", contextname="Dzligature", description="LATIN CAPITAL LETTER D WITH SMALL LETTER Z", @@ -5733,7 +5357,6 @@ characters.data={ unicodeslot=0x1F2, }, { - adobename="dz", category="ll", contextname="dzligature", description="LATIN SMALL LETTER DZ", @@ -5744,7 +5367,6 @@ characters.data={ unicodeslot=0x1F3, }, { - adobename="Gacute", category="lu", contextname="Gacute", description="LATIN CAPITAL LETTER G WITH ACUTE", @@ -5756,7 +5378,6 @@ characters.data={ unicodeslot=0x1F4, }, { - adobename="gacute", category="ll", contextname="gacute", description="LATIN SMALL LETTER G WITH ACUTE", @@ -5806,7 +5427,6 @@ characters.data={ unicodeslot=0x1F9, }, { - adobename="Aringacute", category="lu", contextname="Aringacute", description="LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE", @@ -5818,7 +5438,6 @@ characters.data={ unicodeslot=0x1FA, }, { - adobename="aringacute", category="ll", contextname="aringacute", description="LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE", @@ -5830,7 +5449,6 @@ characters.data={ unicodeslot=0x1FB, }, { - adobename="AEacute", category="lu", contextname="AEacute", description="LATIN CAPITAL LETTER AE WITH ACUTE", @@ -5842,7 +5460,6 @@ characters.data={ unicodeslot=0x1FC, }, { - adobename="aeacute", category="ll", contextname="aeacute", description="LATIN SMALL LETTER AE WITH ACUTE", @@ -5854,7 +5471,6 @@ characters.data={ unicodeslot=0x1FD, }, { - adobename="Ostrokeacute", category="lu", contextname="Ostrokeacute", description="LATIN CAPITAL LETTER O WITH STROKE AND ACUTE", @@ -5866,7 +5482,6 @@ characters.data={ unicodeslot=0x1FE, }, { - adobename="ostrokeacute", category="ll", contextname="ostrokeacute", description="LATIN SMALL LETTER O WITH STROKE AND ACUTE", @@ -5878,7 +5493,6 @@ characters.data={ unicodeslot=0x1FF, }, { - adobename="Adblgrave", category="lu", contextname="Adoublegrave", description="LATIN CAPITAL LETTER A WITH DOUBLE GRAVE", @@ -5890,7 +5504,6 @@ characters.data={ unicodeslot=0x200, }, { - adobename="adblgrave", category="ll", contextname="adoublegrave", description="LATIN SMALL LETTER A WITH DOUBLE GRAVE", @@ -5902,7 +5515,6 @@ characters.data={ unicodeslot=0x201, }, { - adobename="Ainvertedbreve", category="lu", contextname="Ainvertedbreve", description="LATIN CAPITAL LETTER A WITH INVERTED BREVE", @@ -5914,7 +5526,6 @@ characters.data={ unicodeslot=0x202, }, { - adobename="ainvertedbreve", category="ll", contextname="ainvertedbreve", description="LATIN SMALL LETTER A WITH INVERTED BREVE", @@ -5926,7 +5537,6 @@ characters.data={ unicodeslot=0x203, }, { - adobename="Edblgrave", category="lu", contextname="Edoublegrave", description="LATIN CAPITAL LETTER E WITH DOUBLE GRAVE", @@ -5938,7 +5548,6 @@ characters.data={ unicodeslot=0x204, }, { - adobename="edblgrave", category="ll", contextname="edoublegrave", description="LATIN SMALL LETTER E WITH DOUBLE GRAVE", @@ -5950,7 +5559,6 @@ characters.data={ unicodeslot=0x205, }, { - adobename="Einvertedbreve", category="lu", contextname="Einvertedbreve", description="LATIN CAPITAL LETTER E WITH INVERTED BREVE", @@ -5962,7 +5570,6 @@ characters.data={ unicodeslot=0x206, }, { - adobename="einvertedbreve", category="ll", contextname="einvertedbreve", description="LATIN SMALL LETTER E WITH INVERTED BREVE", @@ -5974,7 +5581,6 @@ characters.data={ unicodeslot=0x207, }, { - adobename="Idblgrave", category="lu", contextname="Idoublegrave", description="LATIN CAPITAL LETTER I WITH DOUBLE GRAVE", @@ -5986,7 +5592,6 @@ characters.data={ unicodeslot=0x208, }, { - adobename="idblgrave", category="ll", contextname="idoublegrave", description="LATIN SMALL LETTER I WITH DOUBLE GRAVE", @@ -5998,7 +5603,6 @@ characters.data={ unicodeslot=0x209, }, { - adobename="Iinvertedbreve", category="lu", contextname="Iinvertedbreve", description="LATIN CAPITAL LETTER I WITH INVERTED BREVE", @@ -6010,7 +5614,6 @@ characters.data={ unicodeslot=0x20A, }, { - adobename="iinvertedbreve", category="ll", contextname="iinvertedbreve", description="LATIN SMALL LETTER I WITH INVERTED BREVE", @@ -6022,7 +5625,6 @@ characters.data={ unicodeslot=0x20B, }, { - adobename="Odblgrave", category="lu", contextname="Odoublegrave", description="LATIN CAPITAL LETTER O WITH DOUBLE GRAVE", @@ -6034,7 +5636,6 @@ characters.data={ unicodeslot=0x20C, }, { - adobename="odblgrave", category="ll", contextname="odoublegrave", description="LATIN SMALL LETTER O WITH DOUBLE GRAVE", @@ -6046,7 +5647,6 @@ characters.data={ unicodeslot=0x20D, }, { - adobename="Oinvertedbreve", category="lu", contextname="Oinvertedbreve", description="LATIN CAPITAL LETTER O WITH INVERTED BREVE", @@ -6058,7 +5658,6 @@ characters.data={ unicodeslot=0x20E, }, { - adobename="oinvertedbreve", category="ll", contextname="oinvertedbreve", description="LATIN SMALL LETTER O WITH INVERTED BREVE", @@ -6070,7 +5669,6 @@ characters.data={ unicodeslot=0x20F, }, { - adobename="Rdblgrave", category="lu", contextname="Rdoublegrave", description="LATIN CAPITAL LETTER R WITH DOUBLE GRAVE", @@ -6082,7 +5680,6 @@ characters.data={ unicodeslot=0x210, }, { - adobename="rdblgrave", category="ll", contextname="rdoublegrave", description="LATIN SMALL LETTER R WITH DOUBLE GRAVE", @@ -6094,7 +5691,6 @@ characters.data={ unicodeslot=0x211, }, { - adobename="Rinvertedbreve", category="lu", contextname="Rinvertedbreve", description="LATIN CAPITAL LETTER R WITH INVERTED BREVE", @@ -6106,7 +5702,6 @@ characters.data={ unicodeslot=0x212, }, { - adobename="rinvertedbreve", category="ll", contextname="rinvertedbreve", description="LATIN SMALL LETTER R WITH INVERTED BREVE", @@ -6118,7 +5713,6 @@ characters.data={ unicodeslot=0x213, }, { - adobename="Udblgrave", category="lu", contextname="Udoublegrave", description="LATIN CAPITAL LETTER U WITH DOUBLE GRAVE", @@ -6130,7 +5724,6 @@ characters.data={ unicodeslot=0x214, }, { - adobename="udblgrave", category="ll", contextname="udoublegrave", description="LATIN SMALL LETTER U WITH DOUBLE GRAVE", @@ -6142,7 +5735,6 @@ characters.data={ unicodeslot=0x215, }, { - adobename="Uinvertedbreve", category="lu", contextname="Uinvertedbreve", description="LATIN CAPITAL LETTER U WITH INVERTED BREVE", @@ -6154,7 +5746,6 @@ characters.data={ unicodeslot=0x216, }, { - adobename="uinvertedbreve", category="ll", contextname="uinvertedbreve", description="LATIN SMALL LETTER U WITH INVERTED BREVE", @@ -6166,7 +5757,6 @@ characters.data={ unicodeslot=0x217, }, { - adobename="Scommaaccent", category="lu", contextname="Scommaaccent", description="LATIN CAPITAL LETTER S WITH COMMA BELOW", @@ -6178,7 +5768,6 @@ characters.data={ unicodeslot=0x218, }, { - adobename="scommaaccent", category="ll", contextname="scommaaccent", description="LATIN SMALL LETTER S WITH COMMA BELOW", @@ -6716,7 +6305,6 @@ characters.data={ unicodeslot=0x24F, }, { - adobename="aturned", category="ll", description="LATIN SMALL LETTER TURNED A", direction="l", @@ -6724,7 +6312,6 @@ characters.data={ unicodeslot=0x250, }, { - adobename="ascript", category="ll", cjkwd="a", description="LATIN SMALL LETTER ALPHA", @@ -6734,7 +6321,6 @@ characters.data={ unicodeslot=0x251, }, { - adobename="ascriptturned", category="ll", description="LATIN SMALL LETTER TURNED ALPHA", direction="l", @@ -6742,7 +6328,6 @@ characters.data={ unicodeslot=0x252, }, { - adobename="bhook", category="ll", contextname="bhook", description="LATIN SMALL LETTER B WITH HOOK", @@ -6754,7 +6339,6 @@ characters.data={ unicodeslot=0x253, }, { - adobename="oopen", category="ll", description="LATIN SMALL LETTER OPEN O", direction="l", @@ -6763,7 +6347,6 @@ characters.data={ unicodeslot=0x254, }, { - adobename="ccurl", category="ll", contextname="ccurl", description="LATIN SMALL LETTER C WITH CURL", @@ -6773,7 +6356,6 @@ characters.data={ unicodeslot=0x255, }, { - adobename="dtail", category="ll", contextname="dtail", description="LATIN SMALL LETTER D WITH TAIL", @@ -6785,7 +6367,6 @@ characters.data={ unicodeslot=0x256, }, { - adobename="dhook", category="ll", contextname="dhook", description="LATIN SMALL LETTER D WITH HOOK", @@ -6797,7 +6378,6 @@ characters.data={ unicodeslot=0x257, }, { - adobename="ereversed", category="ll", description="LATIN SMALL LETTER REVERSED E", direction="l", @@ -6805,7 +6385,6 @@ characters.data={ unicodeslot=0x258, }, { - adobename="schwa", category="ll", contextname="schwa", description="LATIN SMALL LETTER SCHWA", @@ -6815,7 +6394,6 @@ characters.data={ unicodeslot=0x259, }, { - adobename="schwahook", category="ll", contextname="schwahook", description="LATIN SMALL LETTER SCHWA WITH HOOK", @@ -6826,7 +6404,6 @@ characters.data={ unicodeslot=0x25A, }, { - adobename="eopen", category="ll", description="LATIN SMALL LETTER OPEN E", direction="l", @@ -6836,7 +6413,6 @@ characters.data={ unicodeslot=0x25B, }, { - adobename="eopenreversed", category="ll", description="LATIN SMALL LETTER REVERSED OPEN E", direction="l", @@ -6844,7 +6420,6 @@ characters.data={ unicodeslot=0x25C, }, { - adobename="eopenreversedhook", category="ll", description="LATIN SMALL LETTER REVERSED OPEN E WITH HOOK", direction="l", @@ -6853,7 +6428,6 @@ characters.data={ unicodeslot=0x25D, }, { - adobename="eopenreversedclosed", category="ll", description="LATIN SMALL LETTER CLOSED REVERSED OPEN E", direction="l", @@ -6862,7 +6436,6 @@ characters.data={ unicodeslot=0x25E, }, { - adobename="jdotlessstroke", category="ll", contextname="dotlessjstroke", description="LATIN SMALL LETTER DOTLESS J WITH STROKE", @@ -6872,7 +6445,6 @@ characters.data={ unicodeslot=0x25F, }, { - adobename="ghook", category="ll", description="LATIN SMALL LETTER G WITH HOOK", direction="l", @@ -6883,7 +6455,6 @@ characters.data={ unicodeslot=0x260, }, { - adobename="gscript", category="ll", cjkwd="a", description="LATIN SMALL LETTER SCRIPT G", @@ -6899,7 +6470,6 @@ characters.data={ unicodeslot=0x262, }, { - adobename="gammalatinsmall", category="ll", description="LATIN SMALL LETTER GAMMA", direction="l", @@ -6908,7 +6478,6 @@ characters.data={ unicodeslot=0x263, }, { - adobename="ramshorn", category="ll", description="LATIN SMALL LETTER RAMS HORN", direction="l", @@ -6917,7 +6486,6 @@ characters.data={ unicodeslot=0x264, }, { - adobename="hturned", category="ll", description="LATIN SMALL LETTER TURNED H", direction="l", @@ -6925,7 +6493,6 @@ characters.data={ unicodeslot=0x265, }, { - adobename="hhook", category="ll", description="LATIN SMALL LETTER H WITH HOOK", direction="l", @@ -6935,7 +6502,6 @@ characters.data={ unicodeslot=0x266, }, { - adobename="henghook", category="ll", description="LATIN SMALL LETTER HENG WITH HOOK", direction="l", @@ -6944,7 +6510,6 @@ characters.data={ unicodeslot=0x267, }, { - adobename="istroke", category="ll", description="LATIN SMALL LETTER I WITH STROKE", direction="l", @@ -6955,7 +6520,6 @@ characters.data={ unicodeslot=0x268, }, { - adobename="iotalatin", category="ll", description="LATIN SMALL LETTER IOTA", direction="l", @@ -6971,7 +6535,6 @@ characters.data={ unicodeslot=0x26A, }, { - adobename="lmiddletilde", category="ll", description="LATIN SMALL LETTER L WITH MIDDLE TILDE", direction="l", @@ -6981,7 +6544,6 @@ characters.data={ unicodeslot=0x26B, }, { - adobename="lbelt", category="ll", description="LATIN SMALL LETTER L WITH BELT", direction="l", @@ -6990,7 +6552,6 @@ characters.data={ unicodeslot=0x26C, }, { - adobename="lhookretroflex", category="ll", description="LATIN SMALL LETTER L WITH RETROFLEX HOOK", direction="l", @@ -6999,7 +6560,6 @@ characters.data={ unicodeslot=0x26D, }, { - adobename="lezh", category="ll", description="LATIN SMALL LETTER LEZH", direction="l", @@ -7007,7 +6567,6 @@ characters.data={ unicodeslot=0x26E, }, { - adobename="mturned", category="ll", description="LATIN SMALL LETTER TURNED M", direction="l", @@ -7016,7 +6575,6 @@ characters.data={ unicodeslot=0x26F, }, { - adobename="mlonglegturned", category="ll", description="LATIN SMALL LETTER TURNED M WITH LONG LEG", direction="l", @@ -7024,7 +6582,6 @@ characters.data={ unicodeslot=0x270, }, { - adobename="mhook", category="ll", description="LATIN SMALL LETTER M WITH HOOK", direction="l", @@ -7034,7 +6591,6 @@ characters.data={ unicodeslot=0x271, }, { - adobename="nhookleft", category="ll", description="LATIN SMALL LETTER N WITH LEFT HOOK", direction="l", @@ -7044,7 +6600,6 @@ characters.data={ unicodeslot=0x272, }, { - adobename="nhookretroflex", category="ll", description="LATIN SMALL LETTER N WITH RETROFLEX HOOK", direction="l", @@ -7060,7 +6615,6 @@ characters.data={ unicodeslot=0x274, }, { - adobename="obarred", category="ll", description="LATIN SMALL LETTER BARRED O", direction="l", @@ -7077,7 +6631,6 @@ characters.data={ unicodeslot=0x276, }, { - adobename="omegalatinclosed", category="ll", description="LATIN SMALL LETTER CLOSED OMEGA", direction="l", @@ -7085,7 +6638,6 @@ characters.data={ unicodeslot=0x277, }, { - adobename="philatin", category="ll", description="LATIN SMALL LETTER PHI", direction="l", @@ -7093,7 +6645,6 @@ characters.data={ unicodeslot=0x278, }, { - adobename="rturned", category="ll", description="LATIN SMALL LETTER TURNED R", direction="l", @@ -7101,7 +6652,6 @@ characters.data={ unicodeslot=0x279, }, { - adobename="rlonglegturned", category="ll", description="LATIN SMALL LETTER TURNED R WITH LONG LEG", direction="l", @@ -7109,7 +6659,6 @@ characters.data={ unicodeslot=0x27A, }, { - adobename="rhookturned", category="ll", description="LATIN SMALL LETTER TURNED R WITH HOOK", direction="l", @@ -7118,7 +6667,6 @@ characters.data={ unicodeslot=0x27B, }, { - adobename="rlongleg", category="ll", description="LATIN SMALL LETTER R WITH LONG LEG", direction="l", @@ -7127,7 +6675,6 @@ characters.data={ unicodeslot=0x27C, }, { - adobename="rhook", category="ll", description="LATIN SMALL LETTER R WITH TAIL", direction="l", @@ -7137,7 +6684,6 @@ characters.data={ unicodeslot=0x27D, }, { - adobename="rfishhook", category="ll", description="LATIN SMALL LETTER R WITH FISHHOOK", direction="l", @@ -7146,7 +6692,6 @@ characters.data={ unicodeslot=0x27E, }, { - adobename="rfishhookreversed", category="ll", description="LATIN SMALL LETTER REVERSED R WITH FISHHOOK", direction="l", @@ -7162,7 +6707,6 @@ characters.data={ unicodeslot=0x280, }, { - adobename="Rsmallinverted", category="ll", description="LATIN LETTER SMALL CAPITAL INVERTED R", direction="l", @@ -7170,7 +6714,6 @@ characters.data={ unicodeslot=0x281, }, { - adobename="shook", category="ll", description="LATIN SMALL LETTER S WITH HOOK", direction="l", @@ -7180,7 +6723,6 @@ characters.data={ unicodeslot=0x282, }, { - adobename="esh", category="ll", description="LATIN SMALL LETTER ESH", direction="l", @@ -7189,7 +6731,6 @@ characters.data={ unicodeslot=0x283, }, { - adobename="dotlessjstrokehook", category="ll", description="LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK", direction="l", @@ -7197,7 +6738,6 @@ characters.data={ unicodeslot=0x284, }, { - adobename="eshsquatreversed", category="ll", description="LATIN SMALL LETTER SQUAT REVERSED ESH", direction="l", @@ -7205,7 +6745,6 @@ characters.data={ unicodeslot=0x285, }, { - adobename="eshcurl", category="ll", description="LATIN SMALL LETTER ESH WITH CURL", direction="l", @@ -7214,7 +6753,6 @@ characters.data={ unicodeslot=0x286, }, { - adobename="tturned", category="ll", description="LATIN SMALL LETTER TURNED T", direction="l", @@ -7222,7 +6760,6 @@ characters.data={ unicodeslot=0x287, }, { - adobename="tretroflexhook", category="ll", description="LATIN SMALL LETTER T WITH RETROFLEX HOOK", direction="l", @@ -7232,7 +6769,6 @@ characters.data={ unicodeslot=0x288, }, { - adobename="ubar", category="ll", description="LATIN SMALL LETTER U BAR", direction="l", @@ -7241,7 +6777,6 @@ characters.data={ unicodeslot=0x289, }, { - adobename="upsilonlatin", category="ll", description="LATIN SMALL LETTER UPSILON", direction="l", @@ -7250,7 +6785,6 @@ characters.data={ unicodeslot=0x28A, }, { - adobename="vhook", category="ll", description="LATIN SMALL LETTER V WITH HOOK", direction="l", @@ -7262,7 +6796,6 @@ characters.data={ unicodeslot=0x28B, }, { - adobename="vturned", category="ll", description="LATIN SMALL LETTER TURNED V", direction="l", @@ -7272,7 +6805,6 @@ characters.data={ unicodeslot=0x28C, }, { - adobename="wturned", category="ll", description="LATIN SMALL LETTER TURNED W", direction="l", @@ -7280,7 +6812,6 @@ characters.data={ unicodeslot=0x28D, }, { - adobename="yturned", category="ll", description="LATIN SMALL LETTER TURNED Y", direction="l", @@ -7295,7 +6826,6 @@ characters.data={ unicodeslot=0x28F, }, { - adobename="zretroflexhook", category="ll", description="LATIN SMALL LETTER Z WITH RETROFLEX HOOK", direction="l", @@ -7304,7 +6834,6 @@ characters.data={ unicodeslot=0x290, }, { - adobename="zcurl", category="ll", description="LATIN SMALL LETTER Z WITH CURL", direction="l", @@ -7313,7 +6842,6 @@ characters.data={ unicodeslot=0x291, }, { - adobename="ezh", category="ll", description="LATIN SMALL LETTER EZH", direction="l", @@ -7323,7 +6851,6 @@ characters.data={ unicodeslot=0x292, }, { - adobename="ezhcurl", category="ll", description="LATIN SMALL LETTER EZH WITH CURL", direction="l", @@ -7332,7 +6859,6 @@ characters.data={ unicodeslot=0x293, }, { - adobename="glottalstop", category="lo", description="LATIN LETTER GLOTTAL STOP", direction="l", @@ -7340,7 +6866,6 @@ characters.data={ unicodeslot=0x294, }, { - adobename="glottalstopreversed", category="ll", description="LATIN LETTER PHARYNGEAL VOICED FRICATIVE", direction="l", @@ -7349,7 +6874,6 @@ characters.data={ unicodeslot=0x295, }, { - adobename="glottalstopinverted", category="ll", description="LATIN LETTER INVERTED GLOTTAL STOP", direction="l", @@ -7357,7 +6881,6 @@ characters.data={ unicodeslot=0x296, }, { - adobename="cstretched", category="ll", description="LATIN LETTER STRETCHED C", direction="l", @@ -7365,7 +6888,6 @@ characters.data={ unicodeslot=0x297, }, { - adobename="bilabialclick", category="ll", description="LATIN LETTER BILABIAL CLICK", direction="l", @@ -7381,7 +6903,6 @@ characters.data={ unicodeslot=0x299, }, { - adobename="eopenclosed", category="ll", description="LATIN SMALL LETTER CLOSED OPEN E", direction="l", @@ -7390,7 +6911,6 @@ characters.data={ unicodeslot=0x29A, }, { - adobename="Gsmallhook", category="ll", description="LATIN LETTER SMALL CAPITAL G WITH HOOK", direction="l", @@ -7406,7 +6926,6 @@ characters.data={ unicodeslot=0x29C, }, { - adobename="jcrossedtail", category="ll", description="LATIN SMALL LETTER J WITH CROSSED-TAIL", direction="l", @@ -7415,7 +6934,6 @@ characters.data={ unicodeslot=0x29D, }, { - adobename="kturned", category="ll", description="LATIN SMALL LETTER TURNED K", direction="l", @@ -7430,7 +6948,6 @@ characters.data={ unicodeslot=0x29F, }, { - adobename="qhook", category="ll", description="LATIN SMALL LETTER Q WITH HOOK", direction="l", @@ -7440,7 +6957,6 @@ characters.data={ unicodeslot=0x2A0, }, { - adobename="glottalstopstroke", category="ll", description="LATIN LETTER GLOTTAL STOP WITH STROKE", direction="l", @@ -7449,7 +6965,6 @@ characters.data={ unicodeslot=0x2A1, }, { - adobename="glottalstopstrokereversed", category="ll", description="LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE", direction="l", @@ -7457,7 +6972,6 @@ characters.data={ unicodeslot=0x2A2, }, { - adobename="dzaltone", category="ll", description="LATIN SMALL LETTER DZ DIGRAPH", direction="l", @@ -7465,7 +6979,6 @@ characters.data={ unicodeslot=0x2A3, }, { - adobename="dezh", category="ll", description="LATIN SMALL LETTER DEZH DIGRAPH", direction="l", @@ -7473,7 +6986,6 @@ characters.data={ unicodeslot=0x2A4, }, { - adobename="dzcurl", category="ll", description="LATIN SMALL LETTER DZ DIGRAPH WITH CURL", direction="l", @@ -7481,7 +6993,6 @@ characters.data={ unicodeslot=0x2A5, }, { - adobename="ts", category="ll", description="LATIN SMALL LETTER TS DIGRAPH", direction="l", @@ -7489,7 +7000,6 @@ characters.data={ unicodeslot=0x2A6, }, { - adobename="tesh", category="ll", description="LATIN SMALL LETTER TESH DIGRAPH", direction="l", @@ -7497,7 +7007,6 @@ characters.data={ unicodeslot=0x2A7, }, { - adobename="tccurl", category="ll", description="LATIN SMALL LETTER TC DIGRAPH WITH CURL", direction="l", @@ -7554,7 +7063,6 @@ characters.data={ unicodeslot=0x2AF, }, { - adobename="hsuperior", category="lm", description="MODIFIER LETTER SMALL H", direction="l", @@ -7563,7 +7071,6 @@ characters.data={ unicodeslot=0x2B0, }, { - adobename="hhooksuperior", category="lm", description="MODIFIER LETTER SMALL H WITH HOOK", direction="l", @@ -7572,7 +7079,6 @@ characters.data={ unicodeslot=0x2B1, }, { - adobename="jsuperior", category="lm", description="MODIFIER LETTER SMALL J", direction="l", @@ -7589,7 +7095,6 @@ characters.data={ unicodeslot=0x2B3, }, { - adobename="rturnedsuperior", category="lm", description="MODIFIER LETTER SMALL TURNED R", direction="l", @@ -7598,7 +7103,6 @@ characters.data={ unicodeslot=0x2B4, }, { - adobename="rhookturnedsuperior", category="lm", description="MODIFIER LETTER SMALL TURNED R WITH HOOK", direction="l", @@ -7607,7 +7111,6 @@ characters.data={ unicodeslot=0x2B5, }, { - adobename="Rsmallinvertedsuperior", category="lm", description="MODIFIER LETTER SMALL CAPITAL INVERTED R", direction="l", @@ -7616,7 +7119,6 @@ characters.data={ unicodeslot=0x2B6, }, { - adobename="wsuperior", category="lm", description="MODIFIER LETTER SMALL W", direction="l", @@ -7625,7 +7127,6 @@ characters.data={ unicodeslot=0x2B7, }, { - adobename="ysuperior", category="lm", description="MODIFIER LETTER SMALL Y", direction="l", @@ -7634,7 +7135,6 @@ characters.data={ unicodeslot=0x2B8, }, { - adobename="primemod", category="lm", description="MODIFIER LETTER PRIME", direction="on", @@ -7642,7 +7142,6 @@ characters.data={ unicodeslot=0x2B9, }, { - adobename="dblprimemod", category="lm", description="MODIFIER LETTER DOUBLE PRIME", direction="on", @@ -7650,7 +7149,6 @@ characters.data={ unicodeslot=0x2BA, }, { - adobename="commaturnedmod", category="lm", description="MODIFIER LETTER TURNED COMMA", direction="l", @@ -7658,7 +7156,6 @@ characters.data={ unicodeslot=0x2BB, }, { - adobename="apostrophemod", category="lm", description="MODIFIER LETTER APOSTROPHE", direction="l", @@ -7667,7 +7164,6 @@ characters.data={ unicodeslot=0x2BC, }, { - adobename="commareversedmod", category="lm", description="MODIFIER LETTER REVERSED COMMA", direction="l", @@ -7675,7 +7171,6 @@ characters.data={ unicodeslot=0x2BD, }, { - adobename="ringhalfright", category="lm", description="MODIFIER LETTER RIGHT HALF RING", direction="l", @@ -7683,7 +7178,6 @@ characters.data={ unicodeslot=0x2BE, }, { - adobename="ringhalfleft", category="lm", description="MODIFIER LETTER LEFT HALF RING", direction="l", @@ -7691,7 +7185,6 @@ characters.data={ unicodeslot=0x2BF, }, { - adobename="glottalstopmod", category="lm", description="MODIFIER LETTER GLOTTAL STOP", direction="l", @@ -7699,7 +7192,6 @@ characters.data={ unicodeslot=0x2C0, }, { - adobename="glottalstopreversedmod", category="lm", description="MODIFIER LETTER REVERSED GLOTTAL STOP", direction="l", @@ -7707,7 +7199,6 @@ characters.data={ unicodeslot=0x2C1, }, { - adobename="arrowheadleftmod", category="sk", description="MODIFIER LETTER LEFT ARROWHEAD", direction="on", @@ -7715,7 +7206,6 @@ characters.data={ unicodeslot=0x2C2, }, { - adobename="arrowheadrightmod", category="sk", description="MODIFIER LETTER RIGHT ARROWHEAD", direction="on", @@ -7723,7 +7213,6 @@ characters.data={ unicodeslot=0x2C3, }, { - adobename="arrowheadupmod", category="sk", cjkwd="a", description="MODIFIER LETTER UP ARROWHEAD", @@ -7732,7 +7221,6 @@ characters.data={ unicodeslot=0x2C4, }, { - adobename="arrowheaddownmod", category="sk", description="MODIFIER LETTER DOWN ARROWHEAD", direction="on", @@ -7740,7 +7228,6 @@ characters.data={ unicodeslot=0x2C5, }, { - adobename="circumflex", category="lm", comment="check special", contextname="textcircumflex", @@ -7762,7 +7249,6 @@ characters.data={ unicodeslot=0x2C6, }, { - adobename="caron", category="lm", cjkwd="a", comment="check special", @@ -7786,7 +7272,6 @@ characters.data={ unicodeslot=0x2C7, }, { - adobename="verticallinemod", category="lm", description="MODIFIER LETTER VERTICAL LINE", direction="on", @@ -7794,7 +7279,6 @@ characters.data={ unicodeslot=0x2C8, }, { - adobename="firsttonechinese", category="lm", cjkwd="a", description="MODIFIER LETTER MACRON", @@ -7804,7 +7288,6 @@ characters.data={ unicodeslot=0x2C9, }, { - adobename="secondtonechinese", category="lm", cjkwd="a", description="MODIFIER LETTER ACUTE ACCENT", @@ -7814,7 +7297,6 @@ characters.data={ unicodeslot=0x2CA, }, { - adobename="fourthtonechinese", category="lm", cjkwd="a", description="MODIFIER LETTER GRAVE ACCENT", @@ -7824,7 +7306,6 @@ characters.data={ unicodeslot=0x2CB, }, { - adobename="verticallinelowmod", category="lm", description="MODIFIER LETTER LOW VERTICAL LINE", direction="on", @@ -7832,7 +7313,6 @@ characters.data={ unicodeslot=0x2CC, }, { - adobename="macronlowmod", category="lm", cjkwd="a", description="MODIFIER LETTER LOW MACRON", @@ -7841,7 +7321,6 @@ characters.data={ unicodeslot=0x2CD, }, { - adobename="gravelowmod", category="lm", description="MODIFIER LETTER LOW GRAVE ACCENT", direction="on", @@ -7849,7 +7328,6 @@ characters.data={ unicodeslot=0x2CE, }, { - adobename="acutelowmod", category="lm", description="MODIFIER LETTER LOW ACUTE ACCENT", direction="on", @@ -7857,7 +7335,6 @@ characters.data={ unicodeslot=0x2CF, }, { - adobename="colontriangularmod", category="lm", cjkwd="a", description="MODIFIER LETTER TRIANGULAR COLON", @@ -7866,7 +7343,6 @@ characters.data={ unicodeslot=0x2D0, }, { - adobename="colontriangularhalfmod", category="lm", description="MODIFIER LETTER HALF TRIANGULAR COLON", direction="l", @@ -7874,7 +7350,6 @@ characters.data={ unicodeslot=0x2D1, }, { - adobename="ringhalfrightcentered", category="sk", description="MODIFIER LETTER CENTRED RIGHT HALF RING", direction="on", @@ -7882,7 +7357,6 @@ characters.data={ unicodeslot=0x2D2, }, { - adobename="ringhalfleftcentered", category="sk", description="MODIFIER LETTER CENTRED LEFT HALF RING", direction="on", @@ -7890,7 +7364,6 @@ characters.data={ unicodeslot=0x2D3, }, { - adobename="uptackmod", category="sk", description="MODIFIER LETTER UP TACK", direction="on", @@ -7898,7 +7371,6 @@ characters.data={ unicodeslot=0x2D4, }, { - adobename="downtackmod", category="sk", description="MODIFIER LETTER DOWN TACK", direction="on", @@ -7906,7 +7378,6 @@ characters.data={ unicodeslot=0x2D5, }, { - adobename="plusmod", category="sk", description="MODIFIER LETTER PLUS SIGN", direction="on", @@ -7914,7 +7385,6 @@ characters.data={ unicodeslot=0x2D6, }, { - adobename="minusmod", category="sk", description="MODIFIER LETTER MINUS SIGN", direction="on", @@ -7922,7 +7392,6 @@ characters.data={ unicodeslot=0x2D7, }, { - adobename="breve", category="sk", cjkwd="a", contextname="textbreve", @@ -7944,7 +7413,6 @@ characters.data={ unicodeslot=0x2D8, }, { - adobename="dotaccent", category="sk", cjkwd="a", contextname="textdotaccent", @@ -7967,7 +7435,6 @@ characters.data={ unicodeslot=0x2D9, }, { - adobename="ring", category="sk", cjkwd="a", contextname="textring", @@ -7989,7 +7456,6 @@ characters.data={ unicodeslot=0x2DA, }, { - adobename="ogonek", category="sk", cjkwd="a", contextname="textogonek", @@ -8000,7 +7466,6 @@ characters.data={ unicodeslot=0x2DB, }, { - adobename="tilde", category="sk", contextname="texttilde", description="SMALL TILDE", @@ -8021,7 +7486,6 @@ characters.data={ unicodeslot=0x2DC, }, { - adobename="hungarumlaut", category="sk", cjkwd="a", contextname="texthungarumlaut", @@ -8032,7 +7496,6 @@ characters.data={ unicodeslot=0x2DD, }, { - adobename="rhotichookmod", category="sk", description="MODIFIER LETTER RHOTIC HOOK", direction="on", @@ -8049,7 +7512,6 @@ characters.data={ unicodeslot=0x2DF, }, { - adobename="gammasuperior", category="lm", description="MODIFIER LETTER SMALL GAMMA", direction="l", @@ -8074,7 +7536,6 @@ characters.data={ unicodeslot=0x2E2, }, { - adobename="xsuperior", category="lm", description="MODIFIER LETTER SMALL X", direction="l", @@ -8083,7 +7544,6 @@ characters.data={ unicodeslot=0x2E3, }, { - adobename="glottalstopreversedsuperior", category="lm", description="MODIFIER LETTER SMALL REVERSED GLOTTAL STOP", direction="l", @@ -8092,7 +7552,6 @@ characters.data={ unicodeslot=0x2E4, }, { - adobename="tonebarextrahighmod", category="sk", description="MODIFIER LETTER EXTRA-HIGH TONE BAR", direction="on", @@ -8100,7 +7559,6 @@ characters.data={ unicodeslot=0x2E5, }, { - adobename="tonebarhighmod", category="sk", description="MODIFIER LETTER HIGH TONE BAR", direction="on", @@ -8108,7 +7566,6 @@ characters.data={ unicodeslot=0x2E6, }, { - adobename="tonebarmidmod", category="sk", description="MODIFIER LETTER MID TONE BAR", direction="on", @@ -8116,7 +7573,6 @@ characters.data={ unicodeslot=0x2E7, }, { - adobename="tonebarlowmod", category="sk", description="MODIFIER LETTER LOW TONE BAR", direction="on", @@ -8124,7 +7580,6 @@ characters.data={ unicodeslot=0x2E8, }, { - adobename="tonebarextralowmod", category="sk", description="MODIFIER LETTER EXTRA-LOW TONE BAR", direction="on", @@ -8286,7 +7741,6 @@ characters.data={ unicodeslot=0x2FF, }, { - adobename="gravecomb", category="mn", cjkwd="a", combining=0xE6, @@ -8297,7 +7751,6 @@ characters.data={ unicodeslot=0x300, }, { - adobename="acutecomb", category="mn", cjkwd="a", combining=0xE6, @@ -8308,7 +7761,6 @@ characters.data={ unicodeslot=0x301, }, { - adobename="circumflexcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8318,7 +7770,6 @@ characters.data={ unicodeslot=0x302, }, { - adobename="tildecomb", category="mn", cjkwd="a", combining=0xE6, @@ -8328,7 +7779,6 @@ characters.data={ unicodeslot=0x303, }, { - adobename="macroncmb", category="mn", cjkwd="a", combining=0xE6, @@ -8339,7 +7789,6 @@ characters.data={ unicodeslot=0x304, }, { - adobename="overlinecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8350,7 +7799,6 @@ characters.data={ unicodeslot=0x305, }, { - adobename="brevecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8361,7 +7809,6 @@ characters.data={ unicodeslot=0x306, }, { - adobename="dotaccentcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8372,7 +7819,6 @@ characters.data={ unicodeslot=0x307, }, { - adobename="dieresiscmb", category="mn", cjkwd="a", combining=0xE6, @@ -8383,7 +7829,6 @@ characters.data={ unicodeslot=0x308, }, { - adobename="hookcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8393,7 +7838,6 @@ characters.data={ unicodeslot=0x309, }, { - adobename="ringcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8403,7 +7847,6 @@ characters.data={ unicodeslot=0x30A, }, { - adobename="hungarumlautcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8413,7 +7856,6 @@ characters.data={ unicodeslot=0x30B, }, { - adobename="caroncmb", category="mn", cjkwd="a", combining=0xE6, @@ -8424,7 +7866,6 @@ characters.data={ unicodeslot=0x30C, }, { - adobename="verticallineabovecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8434,7 +7875,6 @@ characters.data={ unicodeslot=0x30D, }, { - adobename="dblverticallineabovecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8444,7 +7884,6 @@ characters.data={ unicodeslot=0x30E, }, { - adobename="dblgravecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8454,7 +7893,6 @@ characters.data={ unicodeslot=0x30F, }, { - adobename="candrabinducmb", category="mn", cjkwd="a", combining=0xE6, @@ -8464,7 +7902,6 @@ characters.data={ unicodeslot=0x310, }, { - adobename="breveinvertedcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8474,7 +7911,6 @@ characters.data={ unicodeslot=0x311, }, { - adobename="commaturnedabovecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8485,7 +7921,6 @@ characters.data={ unicodeslot=0x312, }, { - adobename="commaabovecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8496,7 +7931,6 @@ characters.data={ unicodeslot=0x313, }, { - adobename="commareversedabovecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8507,7 +7941,6 @@ characters.data={ unicodeslot=0x314, }, { - adobename="commaaboverightcmb", category="mn", cjkwd="a", combining=0xE8, @@ -8517,7 +7950,6 @@ characters.data={ unicodeslot=0x315, }, { - adobename="gravebelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8527,7 +7959,6 @@ characters.data={ unicodeslot=0x316, }, { - adobename="acutebelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8537,7 +7968,6 @@ characters.data={ unicodeslot=0x317, }, { - adobename="lefttackbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8547,7 +7977,6 @@ characters.data={ unicodeslot=0x318, }, { - adobename="righttackbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8557,7 +7986,6 @@ characters.data={ unicodeslot=0x319, }, { - adobename="leftangleabovecmb", category="mn", cjkwd="a", combining=0xE8, @@ -8567,7 +7995,6 @@ characters.data={ unicodeslot=0x31A, }, { - adobename="horncmb", category="mn", cjkwd="a", combining=0xD8, @@ -8577,7 +8004,6 @@ characters.data={ unicodeslot=0x31B, }, { - adobename="ringhalfleftbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8587,7 +8013,6 @@ characters.data={ unicodeslot=0x31C, }, { - adobename="uptackbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8597,7 +8022,6 @@ characters.data={ unicodeslot=0x31D, }, { - adobename="downtackbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8607,7 +8031,6 @@ characters.data={ unicodeslot=0x31E, }, { - adobename="plusbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8617,7 +8040,6 @@ characters.data={ unicodeslot=0x31F, }, { - adobename="minusbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8627,7 +8049,6 @@ characters.data={ unicodeslot=0x320, }, { - adobename="hookpalatalizedbelowcmb", category="mn", cjkwd="a", combining=0xCA, @@ -8637,7 +8058,6 @@ characters.data={ unicodeslot=0x321, }, { - adobename="hookretroflexbelowcmb", category="mn", cjkwd="a", combining=0xCA, @@ -8647,7 +8067,6 @@ characters.data={ unicodeslot=0x322, }, { - adobename="dotbelowcomb", category="mn", cjkwd="a", combining=0xDC, @@ -8658,7 +8077,6 @@ characters.data={ unicodeslot=0x323, }, { - adobename="dieresisbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8668,7 +8086,6 @@ characters.data={ unicodeslot=0x324, }, { - adobename="ringbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8688,7 +8105,6 @@ characters.data={ unicodeslot=0x326, }, { - adobename="cedillacmb", category="mn", cjkwd="a", combining=0xCA, @@ -8698,7 +8114,6 @@ characters.data={ unicodeslot=0x327, }, { - adobename="ogonekcmb", category="mn", cjkwd="a", combining=0xCA, @@ -8709,7 +8124,6 @@ characters.data={ unicodeslot=0x328, }, { - adobename="verticallinebelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8719,7 +8133,6 @@ characters.data={ unicodeslot=0x329, }, { - adobename="bridgebelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8729,7 +8142,6 @@ characters.data={ unicodeslot=0x32A, }, { - adobename="dblarchinvertedbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8739,7 +8151,6 @@ characters.data={ unicodeslot=0x32B, }, { - adobename="caronbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8749,7 +8160,6 @@ characters.data={ unicodeslot=0x32C, }, { - adobename="circumflexbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8759,7 +8169,6 @@ characters.data={ unicodeslot=0x32D, }, { - adobename="brevebelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8769,7 +8178,6 @@ characters.data={ unicodeslot=0x32E, }, { - adobename="breveinvertedbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8779,7 +8187,6 @@ characters.data={ unicodeslot=0x32F, }, { - adobename="tildebelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8789,7 +8196,6 @@ characters.data={ unicodeslot=0x330, }, { - adobename="macronbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8799,7 +8205,6 @@ characters.data={ unicodeslot=0x331, }, { - adobename="lowlinecmb", category="mn", cjkwd="a", combining=0xDC, @@ -8811,7 +8216,6 @@ characters.data={ unicodeslot=0x332, }, { - adobename="dbllowlinecmb", category="mn", cjkwd="a", combining=0xDC, @@ -8822,7 +8226,6 @@ characters.data={ unicodeslot=0x333, }, { - adobename="tildeoverlaycmb", category="mn", cjkwd="a", combining=0x1, @@ -8832,7 +8235,6 @@ characters.data={ unicodeslot=0x334, }, { - adobename="strokeshortoverlaycmb", category="mn", cjkwd="a", combining=0x1, @@ -8842,7 +8244,6 @@ characters.data={ unicodeslot=0x335, }, { - adobename="strokelongoverlaycmb", category="mn", cjkwd="a", combining=0x1, @@ -8852,7 +8253,6 @@ characters.data={ unicodeslot=0x336, }, { - adobename="solidusshortoverlaycmb", category="mn", cjkwd="a", combining=0x1, @@ -8863,7 +8263,6 @@ characters.data={ unicodeslot=0x337, }, { - adobename="soliduslongoverlaycmb", category="mn", cjkwd="a", combining=0x1, @@ -8876,7 +8275,6 @@ characters.data={ unicodeslot=0x338, }, { - adobename="ringhalfrightbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8886,7 +8284,6 @@ characters.data={ unicodeslot=0x339, }, { - adobename="bridgeinvertedbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8896,7 +8293,6 @@ characters.data={ unicodeslot=0x33A, }, { - adobename="squarebelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8906,7 +8302,6 @@ characters.data={ unicodeslot=0x33B, }, { - adobename="seagullbelowcmb", category="mn", cjkwd="a", combining=0xDC, @@ -8916,7 +8311,6 @@ characters.data={ unicodeslot=0x33C, }, { - adobename="xabovecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8926,7 +8320,6 @@ characters.data={ unicodeslot=0x33D, }, { - adobename="tildeverticalcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8936,7 +8329,6 @@ characters.data={ unicodeslot=0x33E, }, { - adobename="dbloverlinecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8946,7 +8338,6 @@ characters.data={ unicodeslot=0x33F, }, { - adobename="gravetonecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8957,7 +8348,6 @@ characters.data={ unicodeslot=0x340, }, { - adobename="acutetonecmb", category="mn", cjkwd="a", combining=0xE6, @@ -8968,7 +8358,6 @@ characters.data={ unicodeslot=0x341, }, { - adobename="perispomenigreekcmb", category="mn", cjkwd="a", combining=0xE6, @@ -8978,7 +8367,6 @@ characters.data={ unicodeslot=0x342, }, { - adobename="koroniscmb", category="mn", cjkwd="a", combining=0xE6, @@ -8989,7 +8377,6 @@ characters.data={ unicodeslot=0x343, }, { - adobename="dialytikatonoscmb", category="mn", cjkwd="a", combining=0xE6, @@ -9000,7 +8387,6 @@ characters.data={ unicodeslot=0x344, }, { - adobename="ypogegrammenigreekcmb", category="mn", cjkwd="a", combining=0xF0, @@ -9247,7 +8633,6 @@ characters.data={ unicodeslot=0x35F, }, { - adobename="tildedoublecmb", category="mn", cjkwd="a", combining=0xEA, @@ -9257,7 +8642,6 @@ characters.data={ unicodeslot=0x360, }, { - adobename="breveinverteddoublecmb", category="mn", cjkwd="a", combining=0xEA, @@ -9424,7 +8808,6 @@ characters.data={ unicodeslot=0x373, }, { - adobename="numeralsigngreek", category="sk", description="GREEK NUMERAL SIGN", direction="on", @@ -9433,7 +8816,6 @@ characters.data={ unicodeslot=0x374, }, { - adobename="numeralsignlowergreek", category="sk", description="GREEK LOWER NUMERAL SIGN", direction="on", @@ -9456,7 +8838,6 @@ characters.data={ unicodeslot=0x377, }, [0x37A]={ - adobename="ypogegrammeni", category="lm", description="GREEK YPOGEGRAMMENI", direction="l", @@ -9489,7 +8870,6 @@ characters.data={ unicodeslot=0x37D, }, [0x37E]={ - adobename="questiongreek", category="po", description="GREEK QUESTION MARK", direction="on", @@ -9506,7 +8886,6 @@ characters.data={ unicodeslot=0x37F, }, [0x384]={ - adobename="tonos", category="sk", contextname="greektonos", description="GREEK TONOS", @@ -9516,7 +8895,6 @@ characters.data={ unicodeslot=0x384, }, [0x385]={ - adobename="dieresistonos", category="sk", contextname="greekdialytikatonos", description="GREEK DIALYTIKA TONOS", @@ -9526,7 +8904,6 @@ characters.data={ unicodeslot=0x385, }, [0x386]={ - adobename="Alphatonos", category="lu", contextname="greekAlphatonos", description="GREEK CAPITAL LETTER ALPHA WITH TONOS", @@ -9538,7 +8915,6 @@ characters.data={ unicodeslot=0x386, }, [0x387]={ - adobename="anoteleia", category="po", description="GREEK ANO TELEIA", direction="on", @@ -9547,7 +8923,6 @@ characters.data={ unicodeslot=0x387, }, [0x388]={ - adobename="Epsilontonos", category="lu", contextname="greekEpsilontonos", description="GREEK CAPITAL LETTER EPSILON WITH TONOS", @@ -9559,7 +8934,6 @@ characters.data={ unicodeslot=0x388, }, [0x389]={ - adobename="Etatonos", category="lu", contextname="greekEtatonos", description="GREEK CAPITAL LETTER ETA WITH TONOS", @@ -9571,7 +8945,6 @@ characters.data={ unicodeslot=0x389, }, [0x38A]={ - adobename="Iotatonos", category="lu", contextname="greekIotatonos", description="GREEK CAPITAL LETTER IOTA WITH TONOS", @@ -9583,7 +8956,6 @@ characters.data={ unicodeslot=0x38A, }, [0x38C]={ - adobename="Omicrontonos", category="lu", contextname="greekOmicrontonos", description="GREEK CAPITAL LETTER OMICRON WITH TONOS", @@ -9595,7 +8967,6 @@ characters.data={ unicodeslot=0x38C, }, [0x38E]={ - adobename="Upsilontonos", category="lu", contextname="greekUpsilontonos", description="GREEK CAPITAL LETTER UPSILON WITH TONOS", @@ -9607,7 +8978,6 @@ characters.data={ unicodeslot=0x38E, }, [0x38F]={ - adobename="Omegatonos", category="lu", contextname="greekOmegatonos", description="GREEK CAPITAL LETTER OMEGA WITH TONOS", @@ -9619,7 +8989,6 @@ characters.data={ unicodeslot=0x38F, }, [0x390]={ - adobename="iotadieresistonos", category="ll", contextname="greekiotadialytikatonos", description="GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS", @@ -9631,7 +9000,6 @@ characters.data={ unicodeslot=0x390, }, [0x391]={ - adobename="Alpha", category="lu", cjkwd="a", contextname="greekAlpha", @@ -9639,11 +9007,11 @@ characters.data={ direction="l", lccode=0x3B1, linebreak="al", + mathclass="variable", mathname="Alpha", unicodeslot=0x391, }, [0x392]={ - adobename="Beta", category="lu", cjkwd="a", contextname="greekBeta", @@ -9651,11 +9019,11 @@ characters.data={ direction="l", lccode=0x3B2, linebreak="al", + mathclass="variable", mathname="Beta", unicodeslot=0x392, }, [0x393]={ - adobename="Gamma", category="lu", cjkwd="a", contextname="greekGamma", @@ -9663,12 +9031,12 @@ characters.data={ direction="l", lccode=0x3B3, linebreak="al", + mathclass="variable", mathname="Gamma", synonyms={ "gamma function" }, unicodeslot=0x393, }, [0x394]={ - adobename="Deltagreek", category="lu", cjkwd="a", contextname="greekDelta", @@ -9676,11 +9044,11 @@ characters.data={ direction="l", lccode=0x3B4, linebreak="al", + mathclass="variable", mathname="Delta", unicodeslot=0x394, }, [0x395]={ - adobename="Epsilon", category="lu", cjkwd="a", contextname="greekEpsilon", @@ -9688,11 +9056,11 @@ characters.data={ direction="l", lccode=0x3B5, linebreak="al", + mathclass="variable", mathname="Epsilon", unicodeslot=0x395, }, [0x396]={ - adobename="Zeta", category="lu", cjkwd="a", contextname="greekZeta", @@ -9700,11 +9068,11 @@ characters.data={ direction="l", lccode=0x3B6, linebreak="al", + mathclass="variable", mathname="Zeta", unicodeslot=0x396, }, [0x397]={ - adobename="Eta", category="lu", cjkwd="a", contextname="greekEta", @@ -9712,11 +9080,11 @@ characters.data={ direction="l", lccode=0x3B7, linebreak="al", + mathclass="variable", mathname="Eta", unicodeslot=0x397, }, [0x398]={ - adobename="Theta", category="lu", cjkwd="a", contextname="greekTheta", @@ -9724,11 +9092,11 @@ characters.data={ direction="l", lccode=0x3B8, linebreak="al", + mathclass="variable", mathname="Theta", unicodeslot=0x398, }, [0x399]={ - adobename="Iota", category="lu", cjkwd="a", contextname="greekIota", @@ -9736,11 +9104,11 @@ characters.data={ direction="l", lccode=0x3B9, linebreak="al", + mathclass="variable", mathname="Iota", unicodeslot=0x399, }, [0x39A]={ - adobename="Kappa", category="lu", cjkwd="a", contextname="greekKappa", @@ -9748,11 +9116,11 @@ characters.data={ direction="l", lccode=0x3BA, linebreak="al", + mathclass="variable", mathname="Kappa", unicodeslot=0x39A, }, [0x39B]={ - adobename="Lambda", category="lu", cjkwd="a", contextname="greekLambda", @@ -9760,11 +9128,11 @@ characters.data={ direction="l", lccode=0x3BB, linebreak="al", + mathclass="variable", mathname="Lambda", unicodeslot=0x39B, }, [0x39C]={ - adobename="Mu", category="lu", cjkwd="a", contextname="greekMu", @@ -9772,11 +9140,11 @@ characters.data={ direction="l", lccode=0x3BC, linebreak="al", + mathclass="variable", mathname="Mu", unicodeslot=0x39C, }, [0x39D]={ - adobename="Nu", category="lu", cjkwd="a", contextname="greekNu", @@ -9784,11 +9152,11 @@ characters.data={ direction="l", lccode=0x3BD, linebreak="al", + mathclass="variable", mathname="Nu", unicodeslot=0x39D, }, [0x39E]={ - adobename="Xi", category="lu", cjkwd="a", contextname="greekXi", @@ -9796,11 +9164,11 @@ characters.data={ direction="l", lccode=0x3BE, linebreak="al", + mathclass="variable", mathname="Xi", unicodeslot=0x39E, }, [0x39F]={ - adobename="Omicron", category="lu", cjkwd="a", contextname="greekOmicron", @@ -9808,11 +9176,11 @@ characters.data={ direction="l", lccode=0x3BF, linebreak="al", + mathclass="variable", mathname="Omicron", unicodeslot=0x39F, }, [0x3A0]={ - adobename="Pi", category="lu", cjkwd="a", contextname="greekPi", @@ -9820,11 +9188,11 @@ characters.data={ direction="l", lccode=0x3C0, linebreak="al", + mathclass="variable", mathname="Pi", unicodeslot=0x3A0, }, [0x3A1]={ - adobename="Rho", category="lu", cjkwd="a", contextname="greekRho", @@ -9832,11 +9200,11 @@ characters.data={ direction="l", lccode=0x3C1, linebreak="al", + mathclass="variable", mathname="Rho", unicodeslot=0x3A1, }, [0x3A3]={ - adobename="Sigma", category="lu", cjkwd="a", contextname="greekSigma", @@ -9844,11 +9212,11 @@ characters.data={ direction="l", lccode=0x3C3, linebreak="al", + mathclass="variable", mathname="Sigma", unicodeslot=0x3A3, }, [0x3A4]={ - adobename="Tau", category="lu", cjkwd="a", contextname="greekTau", @@ -9856,11 +9224,11 @@ characters.data={ direction="l", lccode=0x3C4, linebreak="al", + mathclass="variable", mathname="Tau", unicodeslot=0x3A4, }, [0x3A5]={ - adobename="Upsilon", category="lu", cjkwd="a", contextname="greekUpsilon", @@ -9868,11 +9236,11 @@ characters.data={ direction="l", lccode=0x3C5, linebreak="al", + mathclass="variable", mathname="Upsilon", unicodeslot=0x3A5, }, [0x3A6]={ - adobename="Phi", category="lu", cjkwd="a", contextname="greekPhi", @@ -9880,11 +9248,11 @@ characters.data={ direction="l", lccode=0x3C6, linebreak="al", + mathclass="variable", mathname="Phi", unicodeslot=0x3A6, }, [0x3A7]={ - adobename="Chi", category="lu", cjkwd="a", contextname="greekChi", @@ -9892,11 +9260,11 @@ characters.data={ direction="l", lccode=0x3C7, linebreak="al", + mathclass="variable", mathname="Chi", unicodeslot=0x3A7, }, [0x3A8]={ - adobename="Psi", category="lu", cjkwd="a", contextname="greekPsi", @@ -9904,11 +9272,11 @@ characters.data={ direction="l", lccode=0x3C8, linebreak="al", + mathclass="variable", mathname="Psi", unicodeslot=0x3A8, }, [0x3A9]={ - adobename="Omegagreek", category="lu", cjkwd="a", contextname="greekOmega", @@ -9916,23 +9284,23 @@ characters.data={ direction="l", lccode=0x3C9, linebreak="al", + mathclass="variable", mathname="Omega", unicodeslot=0x3A9, }, [0x3AA]={ - adobename="Iotadieresis", category="lu", contextname="greekIotadialytika", description="GREEK CAPITAL LETTER IOTA WITH DIALYTIKA", direction="l", lccode=0x3CA, linebreak="al", + mathclass="variable", shcode=0x399, specials={ "char", 0x399, 0x308 }, unicodeslot=0x3AA, }, [0x3AB]={ - adobename="Upsilondieresis", category="lu", contextname="greekUpsilondialytika", description="GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA", @@ -9944,7 +9312,6 @@ characters.data={ unicodeslot=0x3AB, }, [0x3AC]={ - adobename="alphatonos", category="ll", contextname="greekalphatonos", description="GREEK SMALL LETTER ALPHA WITH TONOS", @@ -9956,7 +9323,6 @@ characters.data={ unicodeslot=0x3AC, }, [0x3AD]={ - adobename="epsilontonos", category="ll", contextname="greekepsilontonos", description="GREEK SMALL LETTER EPSILON WITH TONOS", @@ -9968,7 +9334,6 @@ characters.data={ unicodeslot=0x3AD, }, [0x3AE]={ - adobename="etatonos", category="ll", contextname="greeketatonos", description="GREEK SMALL LETTER ETA WITH TONOS", @@ -9980,7 +9345,6 @@ characters.data={ unicodeslot=0x3AE, }, [0x3AF]={ - adobename="iotatonos", category="ll", contextname="greekiotatonos", description="GREEK SMALL LETTER IOTA WITH TONOS", @@ -9992,7 +9356,6 @@ characters.data={ unicodeslot=0x3AF, }, [0x3B0]={ - adobename="upsilondieresistonos", category="ll", contextname="greekupsilondialytikatonos", description="GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS", @@ -10004,307 +9367,306 @@ characters.data={ unicodeslot=0x3B0, }, [0x3B1]={ - adobename="alpha", category="ll", cjkwd="a", contextname="greekalpha", description="GREEK SMALL LETTER ALPHA", direction="l", linebreak="al", + mathclass="variable", mathname="alpha", uccode=0x391, unicodeslot=0x3B1, }, [0x3B2]={ - adobename="beta", category="ll", cjkwd="a", contextname="greekbeta", description="GREEK SMALL LETTER BETA", direction="l", linebreak="al", + mathclass="variable", mathname="beta", uccode=0x392, unicodeslot=0x3B2, }, [0x3B3]={ - adobename="gamma", category="ll", cjkwd="a", contextname="greekgamma", description="GREEK SMALL LETTER GAMMA", direction="l", linebreak="al", + mathclass="variable", mathname="gamma", uccode=0x393, unicodeslot=0x3B3, }, [0x3B4]={ - adobename="delta", category="ll", cjkwd="a", contextname="greekdelta", description="GREEK SMALL LETTER DELTA", direction="l", linebreak="al", + mathclass="variable", mathname="delta", uccode=0x394, unicodeslot=0x3B4, }, [0x3B5]={ - adobename="epsilon", category="ll", cjkwd="a", contextname="greekepsilon", description="GREEK SMALL LETTER EPSILON", direction="l", linebreak="al", + mathclass="variable", mathname="varepsilon", uccode=0x395, unicodeslot=0x3B5, }, [0x3B6]={ - adobename="zeta", category="ll", cjkwd="a", contextname="greekzeta", description="GREEK SMALL LETTER ZETA", direction="l", linebreak="al", + mathclass="variable", mathname="zeta", uccode=0x396, unicodeslot=0x3B6, }, [0x3B7]={ - adobename="eta", category="ll", cjkwd="a", contextname="greeketa", description="GREEK SMALL LETTER ETA", direction="l", linebreak="al", + mathclass="variable", mathname="eta", uccode=0x397, unicodeslot=0x3B7, }, [0x3B8]={ - adobename="theta", category="ll", cjkwd="a", contextname="greektheta", description="GREEK SMALL LETTER THETA", direction="l", linebreak="al", + mathclass="variable", mathname="theta", uccode=0x398, unicodeslot=0x3B8, }, [0x3B9]={ - adobename="iota", category="ll", cjkwd="a", contextname="greekiota", description="GREEK SMALL LETTER IOTA", direction="l", linebreak="al", + mathclass="variable", mathname="iota", uccode=0x399, unicodeslot=0x3B9, }, [0x3BA]={ - adobename="kappa", category="ll", cjkwd="a", contextname="greekkappa", description="GREEK SMALL LETTER KAPPA", direction="l", linebreak="al", + mathclass="variable", mathname="kappa", uccode=0x39A, unicodeslot=0x3BA, }, [0x3BB]={ - adobename="lambda", category="ll", cjkwd="a", contextname="greeklambda", description="GREEK SMALL LETTER LAMDA", direction="l", linebreak="al", + mathclass="variable", mathname="lambda", uccode=0x39B, unicodeslot=0x3BB, }, [0x3BC]={ - adobename="mugreek", category="ll", cjkwd="a", contextname="greekmu", description="GREEK SMALL LETTER MU", direction="l", linebreak="al", + mathclass="variable", mathname="mu", uccode=0x39C, unicodeslot=0x3BC, }, [0x3BD]={ - adobename="nu", category="ll", cjkwd="a", contextname="greeknu", description="GREEK SMALL LETTER NU", direction="l", linebreak="al", + mathclass="variable", mathname="nu", uccode=0x39D, unicodeslot=0x3BD, }, [0x3BE]={ - adobename="xi", category="ll", cjkwd="a", contextname="greekxi", description="GREEK SMALL LETTER XI", direction="l", linebreak="al", + mathclass="variable", mathname="xi", uccode=0x39E, unicodeslot=0x3BE, }, [0x3BF]={ - adobename="omicron", category="ll", cjkwd="a", contextname="greekomicron", description="GREEK SMALL LETTER OMICRON", direction="l", linebreak="al", + mathclass="variable", mathname="omicron", uccode=0x39F, unicodeslot=0x3BF, }, [0x3C0]={ - adobename="pi", category="ll", cjkwd="a", contextname="greekpi", description="GREEK SMALL LETTER PI", direction="l", linebreak="al", + mathclass="variable", mathname="pi", synonyms={ "mathematical constant 3.141592... pi", "mathematical constant pi" }, uccode=0x3A0, unicodeslot=0x3C0, }, [0x3C1]={ - adobename="rho", category="ll", cjkwd="a", contextname="greekrho", description="GREEK SMALL LETTER RHO", direction="l", linebreak="al", + mathclass="variable", mathname="rho", uccode=0x3A1, unicodeslot=0x3C1, }, [0x3C2]={ - adobename="sigmafinal", category="ll", contextname="greekfinalsigma", description="GREEK SMALL LETTER FINAL SIGMA", direction="l", linebreak="al", + mathclass="variable", mathname="varsigma", uccode=0x3C3, unicodeslot=0x3C2, }, [0x3C3]={ - adobename="sigma", category="ll", cjkwd="a", contextname="greeksigma", description="GREEK SMALL LETTER SIGMA", direction="l", linebreak="al", + mathclass="variable", mathname="sigma", uccode=0x3A3, unicodeslot=0x3C3, }, [0x3C4]={ - adobename="tau", category="ll", cjkwd="a", contextname="greektau", description="GREEK SMALL LETTER TAU", direction="l", linebreak="al", + mathclass="variable", mathname="tau", uccode=0x3A4, unicodeslot=0x3C4, }, [0x3C5]={ - adobename="upsilon", category="ll", cjkwd="a", contextname="greekupsilon", description="GREEK SMALL LETTER UPSILON", direction="l", linebreak="al", + mathclass="variable", mathname="upsilon", uccode=0x3A5, unicodeslot=0x3C5, }, [0x3C6]={ - adobename="phi", category="ll", cjkwd="a", contextname="greekphi", description="GREEK SMALL LETTER PHI", direction="l", linebreak="al", + mathclass="variable", mathname="varphi", uccode=0x3A6, unicodeslot=0x3C6, }, [0x3C7]={ - adobename="chi", category="ll", cjkwd="a", contextname="greekchi", description="GREEK SMALL LETTER CHI", direction="l", linebreak="al", + mathclass="variable", mathname="chi", uccode=0x3A7, unicodeslot=0x3C7, }, [0x3C8]={ - adobename="psi", category="ll", cjkwd="a", contextname="greekpsi", description="GREEK SMALL LETTER PSI", direction="l", linebreak="al", + mathclass="variable", mathname="psi", uccode=0x3A8, unicodeslot=0x3C8, }, [0x3C9]={ - adobename="omega", category="ll", cjkwd="a", contextname="greekomega", description="GREEK SMALL LETTER OMEGA", direction="l", linebreak="al", + mathclass="variable", mathname="omega", uccode=0x3A9, unicodeslot=0x3C9, }, [0x3CA]={ - adobename="iotadieresis", category="ll", contextname="greekiotadialytika", description="GREEK SMALL LETTER IOTA WITH DIALYTIKA", @@ -10316,7 +9678,6 @@ characters.data={ unicodeslot=0x3CA, }, [0x3CB]={ - adobename="upsilondieresis", category="ll", contextname="greekupsilondiaeresis", description="GREEK SMALL LETTER UPSILON WITH DIALYTIKA", @@ -10328,7 +9689,6 @@ characters.data={ unicodeslot=0x3CB, }, [0x3CC]={ - adobename="omicrontonos", category="ll", contextname="greekomicrontonos", description="GREEK SMALL LETTER OMICRON WITH TONOS", @@ -10340,7 +9700,6 @@ characters.data={ unicodeslot=0x3CC, }, [0x3CD]={ - adobename="upsilontonos", category="ll", contextname="greekupsilontonos", description="GREEK SMALL LETTER UPSILON WITH TONOS", @@ -10352,7 +9711,6 @@ characters.data={ unicodeslot=0x3CD, }, [0x3CE]={ - adobename="omegatonos", category="ll", contextname="greekomegatonos", description="GREEK SMALL LETTER OMEGA WITH TONOS", @@ -10372,7 +9730,6 @@ characters.data={ unicodeslot=0x3CF, }, [0x3D0]={ - adobename="betasymbolgreek", category="ll", contextname="greekbetaalt", description="GREEK BETA SYMBOL", @@ -10384,7 +9741,6 @@ characters.data={ unicodeslot=0x3D0, }, [0x3D1]={ - adobename="thetasymbolgreek", category="ll", contextname="greekthetaalt", description="GREEK THETA SYMBOL", @@ -10397,7 +9753,6 @@ characters.data={ unicodeslot=0x3D1, }, [0x3D2]={ - adobename="Upsilonhooksymbol", category="lu", description="GREEK UPSILON WITH HOOK SYMBOL", direction="l", @@ -10406,7 +9761,6 @@ characters.data={ unicodeslot=0x3D2, }, [0x3D3]={ - adobename="Upsilonacutehooksymbolgreek", category="lu", description="GREEK UPSILON WITH ACUTE AND HOOK SYMBOL", direction="l", @@ -10415,7 +9769,6 @@ characters.data={ unicodeslot=0x3D3, }, [0x3D4]={ - adobename="Upsilondieresishooksymbolgreek", category="lu", description="GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL", direction="l", @@ -10424,7 +9777,6 @@ characters.data={ unicodeslot=0x3D4, }, [0x3D5]={ - adobename="phisymbolgreek", category="ll", contextname="greekphialt", description="GREEK PHI SYMBOL", @@ -10436,7 +9788,6 @@ characters.data={ unicodeslot=0x3D5, }, [0x3D6]={ - adobename="pisymbolgreek", category="ll", contextname="greekpialt", description="GREEK PI SYMBOL", @@ -10473,7 +9824,6 @@ characters.data={ unicodeslot=0x3D9, }, [0x3DA]={ - adobename="Stigmagreek", category="lu", description="GREEK LETTER STIGMA", direction="l", @@ -10491,7 +9841,6 @@ characters.data={ unicodeslot=0x3DB, }, [0x3DC]={ - adobename="Digammagreek", category="lu", description="GREEK LETTER DIGAMMA", direction="l", @@ -10510,7 +9859,6 @@ characters.data={ unicodeslot=0x3DD, }, [0x3DE]={ - adobename="Koppagreek", category="lu", description="GREEK LETTER KOPPA", direction="l", @@ -10528,7 +9876,6 @@ characters.data={ unicodeslot=0x3DF, }, [0x3E0]={ - adobename="Sampigreek", category="lu", description="GREEK LETTER SAMPI", direction="l", @@ -10546,7 +9893,6 @@ characters.data={ unicodeslot=0x3E1, }, [0x3E2]={ - adobename="Sheicoptic", category="lu", description="COPTIC CAPITAL LETTER SHEI", direction="l", @@ -10555,7 +9901,6 @@ characters.data={ unicodeslot=0x3E2, }, [0x3E3]={ - adobename="sheicoptic", category="ll", description="COPTIC SMALL LETTER SHEI", direction="l", @@ -10564,7 +9909,6 @@ characters.data={ unicodeslot=0x3E3, }, [0x3E4]={ - adobename="Feicoptic", category="lu", description="COPTIC CAPITAL LETTER FEI", direction="l", @@ -10573,7 +9917,6 @@ characters.data={ unicodeslot=0x3E4, }, [0x3E5]={ - adobename="feicoptic", category="ll", description="COPTIC SMALL LETTER FEI", direction="l", @@ -10582,7 +9925,6 @@ characters.data={ unicodeslot=0x3E5, }, [0x3E6]={ - adobename="Kheicoptic", category="lu", description="COPTIC CAPITAL LETTER KHEI", direction="l", @@ -10591,7 +9933,6 @@ characters.data={ unicodeslot=0x3E6, }, [0x3E7]={ - adobename="kheicoptic", category="ll", description="COPTIC SMALL LETTER KHEI", direction="l", @@ -10600,7 +9941,6 @@ characters.data={ unicodeslot=0x3E7, }, [0x3E8]={ - adobename="Horicoptic", category="lu", description="COPTIC CAPITAL LETTER HORI", direction="l", @@ -10609,7 +9949,6 @@ characters.data={ unicodeslot=0x3E8, }, [0x3E9]={ - adobename="horicoptic", category="ll", description="COPTIC SMALL LETTER HORI", direction="l", @@ -10618,7 +9957,6 @@ characters.data={ unicodeslot=0x3E9, }, [0x3EA]={ - adobename="Gangiacoptic", category="lu", description="COPTIC CAPITAL LETTER GANGIA", direction="l", @@ -10627,7 +9965,6 @@ characters.data={ unicodeslot=0x3EA, }, [0x3EB]={ - adobename="gangiacoptic", category="ll", description="COPTIC SMALL LETTER GANGIA", direction="l", @@ -10636,7 +9973,6 @@ characters.data={ unicodeslot=0x3EB, }, [0x3EC]={ - adobename="Shimacoptic", category="lu", description="COPTIC CAPITAL LETTER SHIMA", direction="l", @@ -10645,7 +9981,6 @@ characters.data={ unicodeslot=0x3EC, }, [0x3ED]={ - adobename="shimacoptic", category="ll", description="COPTIC SMALL LETTER SHIMA", direction="l", @@ -10654,7 +9989,6 @@ characters.data={ unicodeslot=0x3ED, }, [0x3EE]={ - adobename="Deicoptic", category="lu", description="COPTIC CAPITAL LETTER DEI", direction="l", @@ -10663,7 +9997,6 @@ characters.data={ unicodeslot=0x3EE, }, [0x3EF]={ - adobename="deicoptic", category="ll", description="COPTIC SMALL LETTER DEI", direction="l", @@ -10672,7 +10005,6 @@ characters.data={ unicodeslot=0x3EF, }, [0x3F0]={ - adobename="kappasymbolgreek", category="ll", description="GREEK KAPPA SYMBOL", direction="l", @@ -10683,7 +10015,6 @@ characters.data={ unicodeslot=0x3F0, }, [0x3F1]={ - adobename="rhosymbolgreek", category="ll", contextname="greekrhoalt", description="GREEK RHO SYMBOL", @@ -10694,7 +10025,6 @@ characters.data={ unicodeslot=0x3F1, }, [0x3F2]={ - adobename="sigmalunatesymbolgreek", category="ll", contextname="greeksigmalunate", description="GREEK LUNATE SIGMA SYMBOL", @@ -10706,7 +10036,6 @@ characters.data={ unicodeslot=0x3F2, }, [0x3F3]={ - adobename="yotgreek", category="ll", description="GREEK LETTER YOT", direction="l", @@ -10828,7 +10157,6 @@ characters.data={ unicodeslot=0x400, }, [0x401]={ - adobename="afii10023", category="lu", cjkwd="a", contextname="cyrillicYO", @@ -10840,7 +10168,6 @@ characters.data={ unicodeslot=0x401, }, [0x402]={ - adobename="afii10051", category="lu", contextname="cyrillicDJE", description="CYRILLIC CAPITAL LETTER DJE", @@ -10850,7 +10177,6 @@ characters.data={ unicodeslot=0x402, }, [0x403]={ - adobename="afii10052", category="lu", contextname="cyrillicGJE", description="CYRILLIC CAPITAL LETTER GJE", @@ -10861,7 +10187,6 @@ characters.data={ unicodeslot=0x403, }, [0x404]={ - adobename="afii10053", category="lu", contextname="cyrillicIE", description="CYRILLIC CAPITAL LETTER UKRAINIAN IE", @@ -10871,7 +10196,6 @@ characters.data={ unicodeslot=0x404, }, [0x405]={ - adobename="afii10054", category="lu", contextname="cyrillicDZE", description="CYRILLIC CAPITAL LETTER DZE", @@ -10881,7 +10205,6 @@ characters.data={ unicodeslot=0x405, }, [0x406]={ - adobename="afii10055", category="lu", contextname="cyrillicII", description="CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I", @@ -10891,7 +10214,6 @@ characters.data={ unicodeslot=0x406, }, [0x407]={ - adobename="afii10056", category="lu", contextname="cyrillicYI", description="CYRILLIC CAPITAL LETTER YI", @@ -10902,7 +10224,6 @@ characters.data={ unicodeslot=0x407, }, [0x408]={ - adobename="afii10057", category="lu", contextname="cyrillicJE", description="CYRILLIC CAPITAL LETTER JE", @@ -10912,7 +10233,6 @@ characters.data={ unicodeslot=0x408, }, [0x409]={ - adobename="afii10058", category="lu", contextname="cyrillicLJE", description="CYRILLIC CAPITAL LETTER LJE", @@ -10922,7 +10242,6 @@ characters.data={ unicodeslot=0x409, }, [0x40A]={ - adobename="afii10059", category="lu", contextname="cyrillicNJE", description="CYRILLIC CAPITAL LETTER NJE", @@ -10932,7 +10251,6 @@ characters.data={ unicodeslot=0x40A, }, [0x40B]={ - adobename="afii10060", category="lu", contextname="cyrillicTSHE", description="CYRILLIC CAPITAL LETTER TSHE", @@ -10942,7 +10260,6 @@ characters.data={ unicodeslot=0x40B, }, [0x40C]={ - adobename="afii10061", category="lu", contextname="cyrillicKJE", description="CYRILLIC CAPITAL LETTER KJE", @@ -10964,7 +10281,6 @@ characters.data={ unicodeslot=0x40D, }, [0x40E]={ - adobename="afii10062", category="lu", contextname="cyrillicUSHRT", description="CYRILLIC CAPITAL LETTER SHORT U", @@ -10975,7 +10291,6 @@ characters.data={ unicodeslot=0x40E, }, [0x40F]={ - adobename="afii10145", category="lu", contextname="cyrillicDZHE", description="CYRILLIC CAPITAL LETTER DZHE", @@ -10985,7 +10300,6 @@ characters.data={ unicodeslot=0x40F, }, [0x410]={ - adobename="afii10017", category="lu", cjkwd="a", contextname="cyrillicA", @@ -10996,7 +10310,6 @@ characters.data={ unicodeslot=0x410, }, [0x411]={ - adobename="afii10018", category="lu", cjkwd="a", contextname="cyrillicB", @@ -11007,7 +10320,6 @@ characters.data={ unicodeslot=0x411, }, [0x412]={ - adobename="afii10019", category="lu", cjkwd="a", contextname="cyrillicV", @@ -11018,7 +10330,6 @@ characters.data={ unicodeslot=0x412, }, [0x413]={ - adobename="afii10020", category="lu", cjkwd="a", contextname="cyrillicG", @@ -11029,7 +10340,6 @@ characters.data={ unicodeslot=0x413, }, [0x414]={ - adobename="afii10021", category="lu", cjkwd="a", contextname="cyrillicD", @@ -11040,7 +10350,6 @@ characters.data={ unicodeslot=0x414, }, [0x415]={ - adobename="afii10022", category="lu", cjkwd="a", contextname="cyrillicE", @@ -11051,7 +10360,6 @@ characters.data={ unicodeslot=0x415, }, [0x416]={ - adobename="afii10024", category="lu", cjkwd="a", contextname="cyrillicZH", @@ -11062,7 +10370,6 @@ characters.data={ unicodeslot=0x416, }, [0x417]={ - adobename="afii10025", category="lu", cjkwd="a", contextname="cyrillicZ", @@ -11073,7 +10380,6 @@ characters.data={ unicodeslot=0x417, }, [0x418]={ - adobename="afii10026", category="lu", cjkwd="a", contextname="cyrillicI", @@ -11084,7 +10390,6 @@ characters.data={ unicodeslot=0x418, }, [0x419]={ - adobename="afii10027", category="lu", cjkwd="a", contextname="cyrillicISHRT", @@ -11096,7 +10401,6 @@ characters.data={ unicodeslot=0x419, }, [0x41A]={ - adobename="afii10028", category="lu", cjkwd="a", contextname="cyrillicK", @@ -11107,7 +10411,6 @@ characters.data={ unicodeslot=0x41A, }, [0x41B]={ - adobename="afii10029", category="lu", cjkwd="a", contextname="cyrillicL", @@ -11118,7 +10421,6 @@ characters.data={ unicodeslot=0x41B, }, [0x41C]={ - adobename="afii10030", category="lu", cjkwd="a", contextname="cyrillicM", @@ -11129,7 +10431,6 @@ characters.data={ unicodeslot=0x41C, }, [0x41D]={ - adobename="afii10031", category="lu", cjkwd="a", contextname="cyrillicN", @@ -11140,7 +10441,6 @@ characters.data={ unicodeslot=0x41D, }, [0x41E]={ - adobename="afii10032", category="lu", cjkwd="a", contextname="cyrillicO", @@ -11151,7 +10451,6 @@ characters.data={ unicodeslot=0x41E, }, [0x41F]={ - adobename="afii10033", category="lu", cjkwd="a", contextname="cyrillicP", @@ -11162,7 +10461,6 @@ characters.data={ unicodeslot=0x41F, }, [0x420]={ - adobename="afii10034", category="lu", cjkwd="a", contextname="cyrillicR", @@ -11173,7 +10471,6 @@ characters.data={ unicodeslot=0x420, }, [0x421]={ - adobename="afii10035", category="lu", cjkwd="a", contextname="cyrillicS", @@ -11184,7 +10481,6 @@ characters.data={ unicodeslot=0x421, }, [0x422]={ - adobename="afii10036", category="lu", cjkwd="a", contextname="cyrillicT", @@ -11195,7 +10491,6 @@ characters.data={ unicodeslot=0x422, }, [0x423]={ - adobename="afii10037", category="lu", cjkwd="a", contextname="cyrillicU", @@ -11206,7 +10501,6 @@ characters.data={ unicodeslot=0x423, }, [0x424]={ - adobename="afii10038", category="lu", cjkwd="a", contextname="cyrillicF", @@ -11217,7 +10511,6 @@ characters.data={ unicodeslot=0x424, }, [0x425]={ - adobename="afii10039", category="lu", cjkwd="a", contextname="cyrillicH", @@ -11228,7 +10521,6 @@ characters.data={ unicodeslot=0x425, }, [0x426]={ - adobename="afii10040", category="lu", cjkwd="a", contextname="cyrillicC", @@ -11239,7 +10531,6 @@ characters.data={ unicodeslot=0x426, }, [0x427]={ - adobename="afii10041", category="lu", cjkwd="a", contextname="cyrillicCH", @@ -11250,7 +10541,6 @@ characters.data={ unicodeslot=0x427, }, [0x428]={ - adobename="afii10042", category="lu", cjkwd="a", contextname="cyrillicSH", @@ -11261,7 +10551,6 @@ characters.data={ unicodeslot=0x428, }, [0x429]={ - adobename="afii10043", category="lu", cjkwd="a", contextname="cyrillicSHCH", @@ -11272,7 +10561,6 @@ characters.data={ unicodeslot=0x429, }, [0x42A]={ - adobename="afii10044", category="lu", cjkwd="a", contextname="cyrillicHRDSN", @@ -11283,7 +10571,6 @@ characters.data={ unicodeslot=0x42A, }, [0x42B]={ - adobename="afii10045", category="lu", cjkwd="a", contextname="cyrillicERY", @@ -11294,7 +10581,6 @@ characters.data={ unicodeslot=0x42B, }, [0x42C]={ - adobename="afii10046", category="lu", cjkwd="a", contextname="cyrillicSFTSN", @@ -11305,7 +10591,6 @@ characters.data={ unicodeslot=0x42C, }, [0x42D]={ - adobename="afii10047", category="lu", cjkwd="a", contextname="cyrillicEREV", @@ -11316,7 +10601,6 @@ characters.data={ unicodeslot=0x42D, }, [0x42E]={ - adobename="afii10048", category="lu", cjkwd="a", contextname="cyrillicYU", @@ -11327,7 +10611,6 @@ characters.data={ unicodeslot=0x42E, }, [0x42F]={ - adobename="afii10049", category="lu", cjkwd="a", contextname="cyrillicYA", @@ -11338,7 +10621,6 @@ characters.data={ unicodeslot=0x42F, }, [0x430]={ - adobename="afii10065", category="ll", cjkwd="a", contextname="cyrillica", @@ -11349,7 +10631,6 @@ characters.data={ unicodeslot=0x430, }, [0x431]={ - adobename="becyrillic", category="ll", cjkwd="a", contextname="cyrillicb", @@ -11360,7 +10641,6 @@ characters.data={ unicodeslot=0x431, }, [0x432]={ - adobename="vecyrillic", category="ll", cjkwd="a", contextname="cyrillicv", @@ -11371,7 +10651,6 @@ characters.data={ unicodeslot=0x432, }, [0x433]={ - adobename="gecyrillic", category="ll", cjkwd="a", contextname="cyrillicg", @@ -11382,7 +10661,6 @@ characters.data={ unicodeslot=0x433, }, [0x434]={ - adobename="decyrillic", category="ll", cjkwd="a", contextname="cyrillicd", @@ -11393,7 +10671,6 @@ characters.data={ unicodeslot=0x434, }, [0x435]={ - adobename="iecyrillic", category="ll", cjkwd="a", contextname="cyrillice", @@ -11404,7 +10681,6 @@ characters.data={ unicodeslot=0x435, }, [0x436]={ - adobename="zhecyrillic", category="ll", cjkwd="a", contextname="cyrilliczh", @@ -11415,7 +10691,6 @@ characters.data={ unicodeslot=0x436, }, [0x437]={ - adobename="zecyrillic", category="ll", cjkwd="a", contextname="cyrillicz", @@ -11426,7 +10701,6 @@ characters.data={ unicodeslot=0x437, }, [0x438]={ - adobename="iicyrillic", category="ll", cjkwd="a", contextname="cyrillici", @@ -11437,7 +10711,6 @@ characters.data={ unicodeslot=0x438, }, [0x439]={ - adobename="iishortcyrillic", category="ll", cjkwd="a", contextname="cyrillicishrt", @@ -11449,7 +10722,6 @@ characters.data={ unicodeslot=0x439, }, [0x43A]={ - adobename="kacyrillic", category="ll", cjkwd="a", contextname="cyrillick", @@ -11460,7 +10732,6 @@ characters.data={ unicodeslot=0x43A, }, [0x43B]={ - adobename="elcyrillic", category="ll", cjkwd="a", contextname="cyrillicl", @@ -11471,7 +10742,6 @@ characters.data={ unicodeslot=0x43B, }, [0x43C]={ - adobename="emcyrillic", category="ll", cjkwd="a", contextname="cyrillicm", @@ -11482,7 +10752,6 @@ characters.data={ unicodeslot=0x43C, }, [0x43D]={ - adobename="encyrillic", category="ll", cjkwd="a", contextname="cyrillicn", @@ -11493,7 +10762,6 @@ characters.data={ unicodeslot=0x43D, }, [0x43E]={ - adobename="ocyrillic", category="ll", cjkwd="a", contextname="cyrillico", @@ -11504,7 +10772,6 @@ characters.data={ unicodeslot=0x43E, }, [0x43F]={ - adobename="pecyrillic", category="ll", cjkwd="a", contextname="cyrillicp", @@ -11515,7 +10782,6 @@ characters.data={ unicodeslot=0x43F, }, [0x440]={ - adobename="ercyrillic", category="ll", cjkwd="a", contextname="cyrillicr", @@ -11526,7 +10792,6 @@ characters.data={ unicodeslot=0x440, }, [0x441]={ - adobename="escyrillic", category="ll", cjkwd="a", contextname="cyrillics", @@ -11537,7 +10802,6 @@ characters.data={ unicodeslot=0x441, }, [0x442]={ - adobename="tecyrillic", category="ll", cjkwd="a", contextname="cyrillict", @@ -11548,7 +10812,6 @@ characters.data={ unicodeslot=0x442, }, [0x443]={ - adobename="ucyrillic", category="ll", cjkwd="a", contextname="cyrillicu", @@ -11559,7 +10822,6 @@ characters.data={ unicodeslot=0x443, }, [0x444]={ - adobename="efcyrillic", category="ll", cjkwd="a", contextname="cyrillicf", @@ -11570,7 +10832,6 @@ characters.data={ unicodeslot=0x444, }, [0x445]={ - adobename="khacyrillic", category="ll", cjkwd="a", contextname="cyrillich", @@ -11581,7 +10842,6 @@ characters.data={ unicodeslot=0x445, }, [0x446]={ - adobename="tsecyrillic", category="ll", cjkwd="a", contextname="cyrillicc", @@ -11592,7 +10852,6 @@ characters.data={ unicodeslot=0x446, }, [0x447]={ - adobename="checyrillic", category="ll", cjkwd="a", contextname="cyrillicch", @@ -11603,7 +10862,6 @@ characters.data={ unicodeslot=0x447, }, [0x448]={ - adobename="shacyrillic", category="ll", cjkwd="a", contextname="cyrillicsh", @@ -11614,7 +10872,6 @@ characters.data={ unicodeslot=0x448, }, [0x449]={ - adobename="shchacyrillic", category="ll", cjkwd="a", contextname="cyrillicshch", @@ -11625,7 +10882,6 @@ characters.data={ unicodeslot=0x449, }, [0x44A]={ - adobename="hardsigncyrillic", category="ll", cjkwd="a", contextname="cyrillichrdsn", @@ -11636,7 +10892,6 @@ characters.data={ unicodeslot=0x44A, }, [0x44B]={ - adobename="yericyrillic", category="ll", cjkwd="a", contextname="cyrillicery", @@ -11647,7 +10902,6 @@ characters.data={ unicodeslot=0x44B, }, [0x44C]={ - adobename="softsigncyrillic", category="ll", cjkwd="a", contextname="cyrillicsftsn", @@ -11658,7 +10912,6 @@ characters.data={ unicodeslot=0x44C, }, [0x44D]={ - adobename="ereversedcyrillic", category="ll", cjkwd="a", contextname="cyrillicerev", @@ -11669,7 +10922,6 @@ characters.data={ unicodeslot=0x44D, }, [0x44E]={ - adobename="iucyrillic", category="ll", cjkwd="a", contextname="cyrillicyu", @@ -11680,7 +10932,6 @@ characters.data={ unicodeslot=0x44E, }, [0x44F]={ - adobename="iacyrillic", category="ll", cjkwd="a", contextname="cyrillicya", @@ -11702,7 +10953,6 @@ characters.data={ unicodeslot=0x450, }, [0x451]={ - adobename="iocyrillic", category="ll", cjkwd="a", contextname="cyrillicyo", @@ -11714,7 +10964,6 @@ characters.data={ unicodeslot=0x451, }, [0x452]={ - adobename="djecyrillic", category="ll", contextname="cyrillicdje", description="CYRILLIC SMALL LETTER DJE", @@ -11724,7 +10973,6 @@ characters.data={ unicodeslot=0x452, }, [0x453]={ - adobename="gjecyrillic", category="ll", contextname="cyrillicgje", description="CYRILLIC SMALL LETTER GJE", @@ -11735,7 +10983,6 @@ characters.data={ unicodeslot=0x453, }, [0x454]={ - adobename="ecyrillic", category="ll", contextname="cyrillicie", description="CYRILLIC SMALL LETTER UKRAINIAN IE", @@ -11745,7 +10992,6 @@ characters.data={ unicodeslot=0x454, }, [0x455]={ - adobename="dzecyrillic", category="ll", contextname="cyrillicdze", description="CYRILLIC SMALL LETTER DZE", @@ -11755,7 +11001,6 @@ characters.data={ unicodeslot=0x455, }, [0x456]={ - adobename="icyrillic", category="ll", contextname="cyrillicii", description="CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I", @@ -11765,7 +11010,6 @@ characters.data={ unicodeslot=0x456, }, [0x457]={ - adobename="yicyrillic", category="ll", contextname="cyrillicyi", description="CYRILLIC SMALL LETTER YI", @@ -11776,7 +11020,6 @@ characters.data={ unicodeslot=0x457, }, [0x458]={ - adobename="jecyrillic", category="ll", contextname="cyrillicje", description="CYRILLIC SMALL LETTER JE", @@ -11786,7 +11029,6 @@ characters.data={ unicodeslot=0x458, }, [0x459]={ - adobename="ljecyrillic", category="ll", contextname="cyrilliclje", description="CYRILLIC SMALL LETTER LJE", @@ -11796,7 +11038,6 @@ characters.data={ unicodeslot=0x459, }, [0x45A]={ - adobename="njecyrillic", category="ll", contextname="cyrillicnje", description="CYRILLIC SMALL LETTER NJE", @@ -11806,7 +11047,6 @@ characters.data={ unicodeslot=0x45A, }, [0x45B]={ - adobename="tshecyrillic", category="ll", contextname="cyrillictshe", description="CYRILLIC SMALL LETTER TSHE", @@ -11816,7 +11056,6 @@ characters.data={ unicodeslot=0x45B, }, [0x45C]={ - adobename="kjecyrillic", category="ll", contextname="cyrillickje", description="CYRILLIC SMALL LETTER KJE", @@ -11838,7 +11077,6 @@ characters.data={ unicodeslot=0x45D, }, [0x45E]={ - adobename="ushortcyrillic", category="ll", contextname="cyrillicushrt", description="CYRILLIC SMALL LETTER SHORT U", @@ -11849,7 +11087,6 @@ characters.data={ unicodeslot=0x45E, }, [0x45F]={ - adobename="dzhecyrillic", category="ll", contextname="cyrillicdzhe", description="CYRILLIC SMALL LETTER DZHE", @@ -11859,7 +11096,6 @@ characters.data={ unicodeslot=0x45F, }, [0x460]={ - adobename="Omegacyrillic", category="lu", contextname="cyrillicOMEGA", description="CYRILLIC CAPITAL LETTER OMEGA", @@ -11869,7 +11105,6 @@ characters.data={ unicodeslot=0x460, }, [0x461]={ - adobename="omegacyrillic", category="ll", contextname="cyrillicomega", description="CYRILLIC SMALL LETTER OMEGA", @@ -11879,7 +11114,6 @@ characters.data={ unicodeslot=0x461, }, [0x462]={ - adobename="afii10146", category="lu", contextname="cyrillicYAT", description="CYRILLIC CAPITAL LETTER YAT", @@ -11889,7 +11123,6 @@ characters.data={ unicodeslot=0x462, }, [0x463]={ - adobename="yatcyrillic", category="ll", contextname="cyrillicyat", description="CYRILLIC SMALL LETTER YAT", @@ -11899,7 +11132,6 @@ characters.data={ unicodeslot=0x463, }, [0x464]={ - adobename="Eiotifiedcyrillic", category="lu", contextname="cyrillicEiotified", description="CYRILLIC CAPITAL LETTER IOTIFIED E", @@ -11909,7 +11141,6 @@ characters.data={ unicodeslot=0x464, }, [0x465]={ - adobename="eiotifiedcyrillic", category="ll", contextname="cyrilliceiotified", description="CYRILLIC SMALL LETTER IOTIFIED E", @@ -11919,7 +11150,6 @@ characters.data={ unicodeslot=0x465, }, [0x466]={ - adobename="Yuslittlecyrillic", category="lu", contextname="cyrillicLITTLEYUS", description="CYRILLIC CAPITAL LETTER LITTLE YUS", @@ -11929,7 +11159,6 @@ characters.data={ unicodeslot=0x466, }, [0x467]={ - adobename="yuslittlecyrillic", category="ll", contextname="cyrilliclittleyus", description="CYRILLIC SMALL LETTER LITTLE YUS", @@ -11939,7 +11168,6 @@ characters.data={ unicodeslot=0x467, }, [0x468]={ - adobename="Yuslittleiotifiedcyrillic", category="lu", contextname="cyrillicLITTLEYUSiotified", description="CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS", @@ -11949,7 +11177,6 @@ characters.data={ unicodeslot=0x468, }, [0x469]={ - adobename="yuslittleiotifiedcyrillic", category="ll", contextname="cyrilliclittleyusiotified", description="CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS", @@ -11959,7 +11186,6 @@ characters.data={ unicodeslot=0x469, }, [0x46A]={ - adobename="Yusbigcyrillic", category="lu", contextname="cyrillicBIGYUS", description="CYRILLIC CAPITAL LETTER BIG YUS", @@ -11969,7 +11195,6 @@ characters.data={ unicodeslot=0x46A, }, [0x46B]={ - adobename="yusbigcyrillic", category="ll", contextname="cyrillicbigyus", description="CYRILLIC SMALL LETTER BIG YUS", @@ -11979,7 +11204,6 @@ characters.data={ unicodeslot=0x46B, }, [0x46C]={ - adobename="Yusbigiotifiedcyrillic", category="lu", contextname="cyrillicBIGYUSiotified", description="CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS", @@ -11989,7 +11213,6 @@ characters.data={ unicodeslot=0x46C, }, [0x46D]={ - adobename="yusbigiotifiedcyrillic", category="ll", contextname="cyrillicbigyusiotified", description="CYRILLIC SMALL LETTER IOTIFIED BIG YUS", @@ -11999,7 +11222,6 @@ characters.data={ unicodeslot=0x46D, }, [0x46E]={ - adobename="Ksicyrillic", category="lu", contextname="cyrillicKSI", description="CYRILLIC CAPITAL LETTER KSI", @@ -12009,7 +11231,6 @@ characters.data={ unicodeslot=0x46E, }, [0x46F]={ - adobename="ksicyrillic", category="ll", contextname="cyrillicksi", description="CYRILLIC SMALL LETTER KSI", @@ -12019,7 +11240,6 @@ characters.data={ unicodeslot=0x46F, }, [0x470]={ - adobename="Psicyrillic", category="lu", contextname="cyrillicPSI", description="CYRILLIC CAPITAL LETTER PSI", @@ -12029,7 +11249,6 @@ characters.data={ unicodeslot=0x470, }, [0x471]={ - adobename="psicyrillic", category="ll", contextname="cyrillicpsi", description="CYRILLIC SMALL LETTER PSI", @@ -12039,7 +11258,6 @@ characters.data={ unicodeslot=0x471, }, [0x472]={ - adobename="afii10147", category="lu", contextname="cyrillicFITA", description="CYRILLIC CAPITAL LETTER FITA", @@ -12049,7 +11267,6 @@ characters.data={ unicodeslot=0x472, }, [0x473]={ - adobename="fitacyrillic", category="ll", contextname="cyrillicfita", description="CYRILLIC SMALL LETTER FITA", @@ -12059,7 +11276,6 @@ characters.data={ unicodeslot=0x473, }, [0x474]={ - adobename="afii10148", category="lu", contextname="cyrillicIZHITSA", description="CYRILLIC CAPITAL LETTER IZHITSA", @@ -12069,7 +11285,6 @@ characters.data={ unicodeslot=0x474, }, [0x475]={ - adobename="izhitsacyrillic", category="ll", contextname="cyrillicizhitsa", description="CYRILLIC SMALL LETTER IZHITSA", @@ -12079,7 +11294,6 @@ characters.data={ unicodeslot=0x475, }, [0x476]={ - adobename="Izhitsadblgravecyrillic", category="lu", contextname="cyrillicIZHITSAdoublegrave", description="CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT", @@ -12091,7 +11305,6 @@ characters.data={ unicodeslot=0x476, }, [0x477]={ - adobename="izhitsadblgravecyrillic", category="ll", contextname="cyrillicizhitsadoublegrave", description="CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT", @@ -12103,7 +11316,6 @@ characters.data={ unicodeslot=0x477, }, [0x478]={ - adobename="Ukcyrillic", category="lu", contextname="cyrillicUK", description="CYRILLIC CAPITAL LETTER UK", @@ -12113,7 +11325,6 @@ characters.data={ unicodeslot=0x478, }, [0x479]={ - adobename="ukcyrillic", category="ll", contextname="cyrillicuk", description="CYRILLIC SMALL LETTER UK", @@ -12123,7 +11334,6 @@ characters.data={ unicodeslot=0x479, }, [0x47A]={ - adobename="Omegaroundcyrillic", category="lu", contextname="cyrillicOMEGAround", description="CYRILLIC CAPITAL LETTER ROUND OMEGA", @@ -12133,7 +11343,6 @@ characters.data={ unicodeslot=0x47A, }, [0x47B]={ - adobename="omegaroundcyrillic", category="ll", contextname="cyrillicomegaround", description="CYRILLIC SMALL LETTER ROUND OMEGA", @@ -12143,7 +11352,6 @@ characters.data={ unicodeslot=0x47B, }, [0x47C]={ - adobename="Omegatitlocyrillic", category="lu", contextname="cyrillicOMEGAtitlo", description="CYRILLIC CAPITAL LETTER OMEGA WITH TITLO", @@ -12154,7 +11362,6 @@ characters.data={ unicodeslot=0x47C, }, [0x47D]={ - adobename="omegatitlocyrillic", category="ll", contextname="cyrillicomegatitlo", description="CYRILLIC SMALL LETTER OMEGA WITH TITLO", @@ -12165,7 +11372,6 @@ characters.data={ unicodeslot=0x47D, }, [0x47E]={ - adobename="Otcyrillic", category="lu", contextname="cyrillicOT", description="CYRILLIC CAPITAL LETTER OT", @@ -12175,7 +11381,6 @@ characters.data={ unicodeslot=0x47E, }, [0x47F]={ - adobename="otcyrillic", category="ll", contextname="cyrillicot", description="CYRILLIC SMALL LETTER OT", @@ -12185,7 +11390,6 @@ characters.data={ unicodeslot=0x47F, }, [0x480]={ - adobename="Koppacyrillic", category="lu", contextname="cyrillicKOPPA", description="CYRILLIC CAPITAL LETTER KOPPA", @@ -12195,7 +11399,6 @@ characters.data={ unicodeslot=0x480, }, [0x481]={ - adobename="koppacyrillic", category="ll", contextname="cyrillickoppa", description="CYRILLIC SMALL LETTER KOPPA", @@ -12205,7 +11408,6 @@ characters.data={ unicodeslot=0x481, }, [0x482]={ - adobename="thousandcyrillic", category="so", description="CYRILLIC THOUSANDS SIGN", direction="l", @@ -12213,7 +11415,6 @@ characters.data={ unicodeslot=0x482, }, [0x483]={ - adobename="titlocyrilliccmb", category="mn", combining=0xE6, contextname="cyrillicTITLO", @@ -12223,7 +11424,6 @@ characters.data={ unicodeslot=0x483, }, [0x484]={ - adobename="palatalizationcyrilliccmb", category="mn", combining=0xE6, contextname="cyrillicPALATALIZATION", @@ -12233,7 +11433,6 @@ characters.data={ unicodeslot=0x484, }, [0x485]={ - adobename="dasiapneumatacyrilliccmb", category="mn", combining=0xE6, contextname="cyrillicDASIAPNEUMATA", @@ -12243,7 +11442,6 @@ characters.data={ unicodeslot=0x485, }, [0x486]={ - adobename="psilipneumatacyrilliccmb", category="mn", combining=0xE6, contextname="cyrillicPSILIPNEUMATA", @@ -12331,7 +11529,6 @@ characters.data={ unicodeslot=0x48F, }, [0x490]={ - adobename="afii10050", category="lu", contextname="cyrillicGHEupturn", description="CYRILLIC CAPITAL LETTER GHE WITH UPTURN", @@ -12342,7 +11539,6 @@ characters.data={ unicodeslot=0x490, }, [0x491]={ - adobename="gheupturncyrillic", category="ll", contextname="cyrillicgheupturn", description="CYRILLIC SMALL LETTER GHE WITH UPTURN", @@ -12353,7 +11549,6 @@ characters.data={ unicodeslot=0x491, }, [0x492]={ - adobename="Ghestrokecyrillic", category="lu", contextname="cyrillicGHEstroke", description="CYRILLIC CAPITAL LETTER GHE WITH STROKE", @@ -12365,7 +11560,6 @@ characters.data={ unicodeslot=0x492, }, [0x493]={ - adobename="ghestrokecyrillic", category="ll", contextname="cyrillicghestroke", description="CYRILLIC SMALL LETTER GHE WITH STROKE", @@ -12377,7 +11571,6 @@ characters.data={ unicodeslot=0x493, }, [0x494]={ - adobename="Ghemiddlehookcyrillic", category="lu", contextname="cyrillicGHEmidhook", description="CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK", @@ -12388,7 +11581,6 @@ characters.data={ unicodeslot=0x494, }, [0x495]={ - adobename="ghemiddlehookcyrillic", category="ll", contextname="cyrillicghemidhook", description="CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK", @@ -12399,7 +11591,6 @@ characters.data={ unicodeslot=0x495, }, [0x496]={ - adobename="Zhedescendercyrillic", category="lu", contextname="cyrillicZHEdescender", description="CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER", @@ -12410,7 +11601,6 @@ characters.data={ unicodeslot=0x496, }, [0x497]={ - adobename="zhedescendercyrillic", category="ll", contextname="cyrilliczhedescender", description="CYRILLIC SMALL LETTER ZHE WITH DESCENDER", @@ -12421,7 +11611,6 @@ characters.data={ unicodeslot=0x497, }, [0x498]={ - adobename="Zedescendercyrillic", category="lu", contextname="cyrillicZDSC", description="CYRILLIC CAPITAL LETTER ZE WITH DESCENDER", @@ -12432,7 +11621,6 @@ characters.data={ unicodeslot=0x498, }, [0x499]={ - adobename="zedescendercyrillic", category="ll", contextname="cyrilliczdsc", description="CYRILLIC SMALL LETTER ZE WITH DESCENDER", @@ -12443,7 +11631,6 @@ characters.data={ unicodeslot=0x499, }, [0x49A]={ - adobename="Kadescendercyrillic", category="lu", contextname="cyrillicKADC", description="CYRILLIC CAPITAL LETTER KA WITH DESCENDER", @@ -12454,7 +11641,6 @@ characters.data={ unicodeslot=0x49A, }, [0x49B]={ - adobename="kadescendercyrillic", category="ll", contextname="cyrillickadc", description="CYRILLIC SMALL LETTER KA WITH DESCENDER", @@ -12465,7 +11651,6 @@ characters.data={ unicodeslot=0x49B, }, [0x49C]={ - adobename="Kaverticalstrokecyrillic", category="lu", contextname="cyrillicKAvertstroke", description="CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE", @@ -12476,7 +11661,6 @@ characters.data={ unicodeslot=0x49C, }, [0x49D]={ - adobename="kaverticalstrokecyrillic", category="ll", contextname="cyrillickavertstroke", description="CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE", @@ -12487,7 +11671,6 @@ characters.data={ unicodeslot=0x49D, }, [0x49E]={ - adobename="Kastrokecyrillic", category="lu", contextname="cyrillicKAstroke", description="CYRILLIC CAPITAL LETTER KA WITH STROKE", @@ -12499,7 +11682,6 @@ characters.data={ unicodeslot=0x49E, }, [0x49F]={ - adobename="kastrokecyrillic", category="ll", contextname="cyrillickastroke", description="CYRILLIC SMALL LETTER KA WITH STROKE", @@ -12511,7 +11693,6 @@ characters.data={ unicodeslot=0x49F, }, [0x4A0]={ - adobename="Kabashkircyrillic", category="lu", contextname="cyrillicKAbashkir", description="CYRILLIC CAPITAL LETTER BASHKIR KA", @@ -12521,7 +11702,6 @@ characters.data={ unicodeslot=0x4A0, }, [0x4A1]={ - adobename="kabashkircyrillic", category="ll", contextname="cyrillickabashkir", description="CYRILLIC SMALL LETTER BASHKIR KA", @@ -12531,7 +11711,6 @@ characters.data={ unicodeslot=0x4A1, }, [0x4A2]={ - adobename="Endescendercyrillic", category="lu", contextname="cyrillicENDC", description="CYRILLIC CAPITAL LETTER EN WITH DESCENDER", @@ -12542,7 +11721,6 @@ characters.data={ unicodeslot=0x4A2, }, [0x4A3]={ - adobename="endescendercyrillic", category="ll", contextname="cyrillicendc", description="CYRILLIC SMALL LETTER EN WITH DESCENDER", @@ -12553,7 +11731,6 @@ characters.data={ unicodeslot=0x4A3, }, [0x4A4]={ - adobename="Enghecyrillic", category="lu", contextname="cyrillicENGHE", description="CYRILLIC CAPITAL LIGATURE EN GHE", @@ -12563,7 +11740,6 @@ characters.data={ unicodeslot=0x4A4, }, [0x4A5]={ - adobename="enghecyrillic", category="ll", contextname="cyrillicenghe", description="CYRILLIC SMALL LIGATURE EN GHE", @@ -12573,7 +11749,6 @@ characters.data={ unicodeslot=0x4A5, }, [0x4A6]={ - adobename="Pemiddlehookcyrillic", category="lu", contextname="cyrillicPEmidhook", description="CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK", @@ -12584,7 +11759,6 @@ characters.data={ unicodeslot=0x4A6, }, [0x4A7]={ - adobename="pemiddlehookcyrillic", category="ll", contextname="cyrillicpemidhook", description="CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK", @@ -12595,7 +11769,6 @@ characters.data={ unicodeslot=0x4A7, }, [0x4A8]={ - adobename="Haabkhasiancyrillic", category="lu", contextname="cyrillicHA", description="CYRILLIC CAPITAL LETTER ABKHASIAN HA", @@ -12605,7 +11778,6 @@ characters.data={ unicodeslot=0x4A8, }, [0x4A9]={ - adobename="haabkhasiancyrillic", category="ll", contextname="cyrillicha", description="CYRILLIC SMALL LETTER ABKHASIAN HA", @@ -12615,7 +11787,6 @@ characters.data={ unicodeslot=0x4A9, }, [0x4AA]={ - adobename="Esdescendercyrillic", category="lu", contextname="cyrillicSDSC", description="CYRILLIC CAPITAL LETTER ES WITH DESCENDER", @@ -12626,7 +11797,6 @@ characters.data={ unicodeslot=0x4AA, }, [0x4AB]={ - adobename="esdescendercyrillic", category="ll", contextname="cyrillicsdsc", description="CYRILLIC SMALL LETTER ES WITH DESCENDER", @@ -12637,7 +11807,6 @@ characters.data={ unicodeslot=0x4AB, }, [0x4AC]={ - adobename="Tedescendercyrillic", category="lu", contextname="cyrillicTEDC", description="CYRILLIC CAPITAL LETTER TE WITH DESCENDER", @@ -12648,7 +11817,6 @@ characters.data={ unicodeslot=0x4AC, }, [0x4AD]={ - adobename="tedescendercyrillic", category="ll", contextname="cyrillictedc", description="CYRILLIC SMALL LETTER TE WITH DESCENDER", @@ -12659,7 +11827,6 @@ characters.data={ unicodeslot=0x4AD, }, [0x4AE]={ - adobename="Ustraightcyrillic", category="lu", contextname="cyrillicYstr", description="CYRILLIC CAPITAL LETTER STRAIGHT U", @@ -12669,7 +11836,6 @@ characters.data={ unicodeslot=0x4AE, }, [0x4AF]={ - adobename="ustraightcyrillic", category="ll", contextname="cyrillicystr", description="CYRILLIC SMALL LETTER STRAIGHT U", @@ -12679,7 +11845,6 @@ characters.data={ unicodeslot=0x4AF, }, [0x4B0]={ - adobename="Ustraightstrokecyrillic", category="lu", contextname="cyrillicYstrstroke", description="CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE", @@ -12690,7 +11855,6 @@ characters.data={ unicodeslot=0x4B0, }, [0x4B1]={ - adobename="ustraightstrokecyrillic", category="ll", contextname="cyrillicystrstroke", description="CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE", @@ -12701,7 +11865,6 @@ characters.data={ unicodeslot=0x4B1, }, [0x4B2]={ - adobename="Hadescendercyrillic", category="lu", contextname="cyrillicHADC", description="CYRILLIC CAPITAL LETTER HA WITH DESCENDER", @@ -12712,7 +11875,6 @@ characters.data={ unicodeslot=0x4B2, }, [0x4B3]={ - adobename="hadescendercyrillic", category="ll", contextname="cyrillichadc", description="CYRILLIC SMALL LETTER HA WITH DESCENDER", @@ -12723,7 +11885,6 @@ characters.data={ unicodeslot=0x4B3, }, [0x4B4]={ - adobename="Tetsecyrillic", category="lu", contextname="cyrillicTETSE", description="CYRILLIC CAPITAL LIGATURE TE TSE", @@ -12733,7 +11894,6 @@ characters.data={ unicodeslot=0x4B4, }, [0x4B5]={ - adobename="tetsecyrillic", category="ll", contextname="cyrillictetse", description="CYRILLIC SMALL LIGATURE TE TSE", @@ -12743,7 +11903,6 @@ characters.data={ unicodeslot=0x4B5, }, [0x4B6]={ - adobename="Chedescendercyrillic", category="lu", contextname="cyrillicCHEDC", description="CYRILLIC CAPITAL LETTER CHE WITH DESCENDER", @@ -12754,7 +11913,6 @@ characters.data={ unicodeslot=0x4B6, }, [0x4B7]={ - adobename="chedescendercyrillic", category="ll", contextname="cyrillicchedc", description="CYRILLIC SMALL LETTER CHE WITH DESCENDER", @@ -12765,7 +11923,6 @@ characters.data={ unicodeslot=0x4B7, }, [0x4B8]={ - adobename="Cheverticalstrokecyrillic", category="lu", contextname="cyrillicCHEvertstroke", description="CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE", @@ -12776,7 +11933,6 @@ characters.data={ unicodeslot=0x4B8, }, [0x4B9]={ - adobename="cheverticalstrokecyrillic", category="ll", contextname="cyrillicchevertstroke", description="CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE", @@ -12787,7 +11943,6 @@ characters.data={ unicodeslot=0x4B9, }, [0x4BA]={ - adobename="Shhacyrillic", category="lu", contextname="cyrillicSHHA", description="CYRILLIC CAPITAL LETTER SHHA", @@ -12797,7 +11952,6 @@ characters.data={ unicodeslot=0x4BA, }, [0x4BB]={ - adobename="shhacyrillic", category="ll", contextname="cyrillicshha", description="CYRILLIC SMALL LETTER SHHA", @@ -12807,7 +11961,6 @@ characters.data={ unicodeslot=0x4BB, }, [0x4BC]={ - adobename="Cheabkhasiancyrillic", category="lu", contextname="cyrillicCHEabkhasian", description="CYRILLIC CAPITAL LETTER ABKHASIAN CHE", @@ -12817,7 +11970,6 @@ characters.data={ unicodeslot=0x4BC, }, [0x4BD]={ - adobename="cheabkhasiancyrillic", category="ll", contextname="cyrilliccheabkhasian", description="CYRILLIC SMALL LETTER ABKHASIAN CHE", @@ -12827,7 +11979,6 @@ characters.data={ unicodeslot=0x4BD, }, [0x4BE]={ - adobename="Chedescenderabkhasiancyrillic", category="lu", contextname="cyrillicCHEDCabkhasian", description="CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER", @@ -12837,7 +11988,6 @@ characters.data={ unicodeslot=0x4BE, }, [0x4BF]={ - adobename="chedescenderabkhasiancyrillic", category="ll", contextname="cyrillicchedcabkhasian", description="CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER", @@ -12847,7 +11997,6 @@ characters.data={ unicodeslot=0x4BF, }, [0x4C0]={ - adobename="palochkacyrillic", category="lu", contextname="cyrillicPALOCHKA", description="CYRILLIC LETTER PALOCHKA", @@ -12857,7 +12006,6 @@ characters.data={ unicodeslot=0x4C0, }, [0x4C1]={ - adobename="Zhebrevecyrillic", category="lu", contextname="cyrillicZHEbreve", description="CYRILLIC CAPITAL LETTER ZHE WITH BREVE", @@ -12869,7 +12017,6 @@ characters.data={ unicodeslot=0x4C1, }, [0x4C2]={ - adobename="zhebrevecyrillic", category="ll", contextname="cyrilliczhebreve", description="CYRILLIC SMALL LETTER ZHE WITH BREVE", @@ -12881,7 +12028,6 @@ characters.data={ unicodeslot=0x4C2, }, [0x4C3]={ - adobename="Kahookcyrillic", category="lu", contextname="cyrillicKAhook", description="CYRILLIC CAPITAL LETTER KA WITH HOOK", @@ -12893,7 +12039,6 @@ characters.data={ unicodeslot=0x4C3, }, [0x4C4]={ - adobename="kahookcyrillic", category="ll", contextname="cyrillickahook", description="CYRILLIC SMALL LETTER KA WITH HOOK", @@ -12925,7 +12070,6 @@ characters.data={ unicodeslot=0x4C6, }, [0x4C7]={ - adobename="Enhookcyrillic", category="lu", contextname="cyrillicENhook", description="CYRILLIC CAPITAL LETTER EN WITH HOOK", @@ -12937,7 +12081,6 @@ characters.data={ unicodeslot=0x4C7, }, [0x4C8]={ - adobename="enhookcyrillic", category="ll", contextname="cyrillicenhook", description="CYRILLIC SMALL LETTER EN WITH HOOK", @@ -12969,7 +12112,6 @@ characters.data={ unicodeslot=0x4CA, }, [0x4CB]={ - adobename="Chekhakassiancyrillic", category="lu", contextname="cyrillicCHEkhakassian", description="CYRILLIC CAPITAL LETTER KHAKASSIAN CHE", @@ -12979,7 +12121,6 @@ characters.data={ unicodeslot=0x4CB, }, [0x4CC]={ - adobename="chekhakassiancyrillic", category="ll", contextname="cyrillicchekhakassian", description="CYRILLIC SMALL LETTER KHAKASSIAN CHE", @@ -13017,7 +12158,6 @@ characters.data={ unicodeslot=0x4CF, }, [0x4D0]={ - adobename="Abrevecyrillic", category="lu", contextname="cyrillicAbreve", description="CYRILLIC CAPITAL LETTER A WITH BREVE", @@ -13029,7 +12169,6 @@ characters.data={ unicodeslot=0x4D0, }, [0x4D1]={ - adobename="abrevecyrillic", category="ll", contextname="cyrillicabreve", description="CYRILLIC SMALL LETTER A WITH BREVE", @@ -13041,7 +12180,6 @@ characters.data={ unicodeslot=0x4D1, }, [0x4D2]={ - adobename="Adieresiscyrillic", category="lu", contextname="cyrillicAdiaeresis", description="CYRILLIC CAPITAL LETTER A WITH DIAERESIS", @@ -13053,7 +12191,6 @@ characters.data={ unicodeslot=0x4D2, }, [0x4D3]={ - adobename="adieresiscyrillic", category="ll", contextname="cyrillicadiaeresis", description="CYRILLIC SMALL LETTER A WITH DIAERESIS", @@ -13065,7 +12202,6 @@ characters.data={ unicodeslot=0x4D3, }, [0x4D4]={ - adobename="Aiecyrillic", category="lu", contextname="cyrillicAE", description="CYRILLIC CAPITAL LIGATURE A IE", @@ -13075,7 +12211,6 @@ characters.data={ unicodeslot=0x4D4, }, [0x4D5]={ - adobename="aiecyrillic", category="ll", contextname="cyrillicae", description="CYRILLIC SMALL LIGATURE A IE", @@ -13085,7 +12220,6 @@ characters.data={ unicodeslot=0x4D5, }, [0x4D6]={ - adobename="Iebrevecyrillic", category="lu", contextname="cyrillicEbreve", description="CYRILLIC CAPITAL LETTER IE WITH BREVE", @@ -13097,7 +12231,6 @@ characters.data={ unicodeslot=0x4D6, }, [0x4D7]={ - adobename="iebrevecyrillic", category="ll", contextname="cyrillicebreve", description="CYRILLIC SMALL LETTER IE WITH BREVE", @@ -13109,7 +12242,6 @@ characters.data={ unicodeslot=0x4D7, }, [0x4D8]={ - adobename="Schwacyrillic", category="lu", contextname="cyrillicSCHWA", description="CYRILLIC CAPITAL LETTER SCHWA", @@ -13119,7 +12251,6 @@ characters.data={ unicodeslot=0x4D8, }, [0x4D9]={ - adobename="schwacyrillic", category="ll", contextname="cyrillicschwa", description="CYRILLIC SMALL LETTER SCHWA", @@ -13129,7 +12260,6 @@ characters.data={ unicodeslot=0x4D9, }, [0x4DA]={ - adobename="Schwadieresiscyrillic", category="lu", contextname="cyrillicSCHWAdiaeresis", description="CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS", @@ -13141,7 +12271,6 @@ characters.data={ unicodeslot=0x4DA, }, [0x4DB]={ - adobename="schwadieresiscyrillic", category="ll", contextname="cyrillicschwadiaeresis", description="CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS", @@ -13153,7 +12282,6 @@ characters.data={ unicodeslot=0x4DB, }, [0x4DC]={ - adobename="Zhedieresiscyrillic", category="lu", contextname="cyrillicZHEdiaeresis", description="CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS", @@ -13165,7 +12293,6 @@ characters.data={ unicodeslot=0x4DC, }, [0x4DD]={ - adobename="zhedieresiscyrillic", category="ll", contextname="cyrilliczhediaeresis", description="CYRILLIC SMALL LETTER ZHE WITH DIAERESIS", @@ -13177,7 +12304,6 @@ characters.data={ unicodeslot=0x4DD, }, [0x4DE]={ - adobename="Zedieresiscyrillic", category="lu", contextname="cyrillicZEdiaeresis", description="CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS", @@ -13189,7 +12315,6 @@ characters.data={ unicodeslot=0x4DE, }, [0x4DF]={ - adobename="zedieresiscyrillic", category="ll", contextname="cyrilliczediaeresis", description="CYRILLIC SMALL LETTER ZE WITH DIAERESIS", @@ -13201,7 +12326,6 @@ characters.data={ unicodeslot=0x4DF, }, [0x4E0]={ - adobename="Dzeabkhasiancyrillic", category="lu", contextname="cyrillicDZEabkhasian", description="CYRILLIC CAPITAL LETTER ABKHASIAN DZE", @@ -13211,7 +12335,6 @@ characters.data={ unicodeslot=0x4E0, }, [0x4E1]={ - adobename="dzeabkhasiancyrillic", category="ll", contextname="cyrillicdzeabkhasian", description="CYRILLIC SMALL LETTER ABKHASIAN DZE", @@ -13221,7 +12344,6 @@ characters.data={ unicodeslot=0x4E1, }, [0x4E2]={ - adobename="Imacroncyrillic", category="lu", contextname="cyrillicImacron", description="CYRILLIC CAPITAL LETTER I WITH MACRON", @@ -13233,7 +12355,6 @@ characters.data={ unicodeslot=0x4E2, }, [0x4E3]={ - adobename="imacroncyrillic", category="ll", contextname="cyrillicimacron", description="CYRILLIC SMALL LETTER I WITH MACRON", @@ -13245,7 +12366,6 @@ characters.data={ unicodeslot=0x4E3, }, [0x4E4]={ - adobename="Idieresiscyrillic", category="lu", contextname="cyrillicIdiaeresis", description="CYRILLIC CAPITAL LETTER I WITH DIAERESIS", @@ -13257,7 +12377,6 @@ characters.data={ unicodeslot=0x4E4, }, [0x4E5]={ - adobename="idieresiscyrillic", category="ll", contextname="cyrillicidiaeresis", description="CYRILLIC SMALL LETTER I WITH DIAERESIS", @@ -13269,7 +12388,6 @@ characters.data={ unicodeslot=0x4E5, }, [0x4E6]={ - adobename="Odieresiscyrillic", category="lu", contextname="cyrillicOdiaeresis", description="CYRILLIC CAPITAL LETTER O WITH DIAERESIS", @@ -13281,7 +12399,6 @@ characters.data={ unicodeslot=0x4E6, }, [0x4E7]={ - adobename="odieresiscyrillic", category="ll", contextname="cyrillicodiaeresis", description="CYRILLIC SMALL LETTER O WITH DIAERESIS", @@ -13293,7 +12410,6 @@ characters.data={ unicodeslot=0x4E7, }, [0x4E8]={ - adobename="Obarredcyrillic", category="lu", contextname="cyrillicObarred", description="CYRILLIC CAPITAL LETTER BARRED O", @@ -13303,7 +12419,6 @@ characters.data={ unicodeslot=0x4E8, }, [0x4E9]={ - adobename="obarredcyrillic", category="ll", contextname="cyrillicobarred", description="CYRILLIC SMALL LETTER BARRED O", @@ -13313,7 +12428,6 @@ characters.data={ unicodeslot=0x4E9, }, [0x4EA]={ - adobename="Obarreddieresiscyrillic", category="lu", contextname="cyrillicObarreddiaeresis", description="CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS", @@ -13324,7 +12438,6 @@ characters.data={ unicodeslot=0x4EA, }, [0x4EB]={ - adobename="obarreddieresiscyrillic", category="ll", contextname="cyrillicobarreddiaeresis", description="CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS", @@ -13357,7 +12470,6 @@ characters.data={ unicodeslot=0x4ED, }, [0x4EE]={ - adobename="Umacroncyrillic", category="lu", contextname="cyrillicUmacron", description="CYRILLIC CAPITAL LETTER U WITH MACRON", @@ -13369,7 +12481,6 @@ characters.data={ unicodeslot=0x4EE, }, [0x4EF]={ - adobename="umacroncyrillic", category="ll", contextname="cyrillicumacron", description="CYRILLIC SMALL LETTER U WITH MACRON", @@ -13381,7 +12492,6 @@ characters.data={ unicodeslot=0x4EF, }, [0x4F0]={ - adobename="Udieresiscyrillic", category="lu", contextname="cyrillicUdiaeresis", description="CYRILLIC CAPITAL LETTER U WITH DIAERESIS", @@ -13393,7 +12503,6 @@ characters.data={ unicodeslot=0x4F0, }, [0x4F1]={ - adobename="udieresiscyrillic", category="ll", contextname="cyrillicudiaeresis", description="CYRILLIC SMALL LETTER U WITH DIAERESIS", @@ -13405,7 +12514,6 @@ characters.data={ unicodeslot=0x4F1, }, [0x4F2]={ - adobename="Uhungarumlautcyrillic", category="lu", contextname="cyrillicUdoubleacute", description="CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE", @@ -13417,7 +12525,6 @@ characters.data={ unicodeslot=0x4F2, }, [0x4F3]={ - adobename="uhungarumlautcyrillic", category="ll", contextname="cyrillicudoubleacute", description="CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE", @@ -13429,7 +12536,6 @@ characters.data={ unicodeslot=0x4F3, }, [0x4F4]={ - adobename="Chedieresiscyrillic", category="lu", contextname="cyrillicCHEdiaeresis", description="CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS", @@ -13441,7 +12547,6 @@ characters.data={ unicodeslot=0x4F4, }, [0x4F5]={ - adobename="chedieresiscyrillic", category="ll", contextname="cyrillicchediaeresis", description="CYRILLIC SMALL LETTER CHE WITH DIAERESIS", @@ -13471,7 +12576,6 @@ characters.data={ unicodeslot=0x4F7, }, [0x4F8]={ - adobename="Yerudieresiscyrillic", category="lu", contextname="cyrillicYERUdiaeresis", description="CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS", @@ -13483,7 +12587,6 @@ characters.data={ unicodeslot=0x4F8, }, [0x4F9]={ - adobename="yerudieresiscyrillic", category="ll", contextname="cyrillicyerudiaeresis", description="CYRILLIC SMALL LETTER YERU WITH DIAERESIS", @@ -13927,7 +13030,6 @@ characters.data={ unicodeslot=0x52F, }, [0x531]={ - adobename="Aybarmenian", category="lu", description="ARMENIAN CAPITAL LETTER AYB", direction="l", @@ -13936,7 +13038,6 @@ characters.data={ unicodeslot=0x531, }, [0x532]={ - adobename="Benarmenian", category="lu", description="ARMENIAN CAPITAL LETTER BEN", direction="l", @@ -13945,7 +13046,6 @@ characters.data={ unicodeslot=0x532, }, [0x533]={ - adobename="Gimarmenian", category="lu", description="ARMENIAN CAPITAL LETTER GIM", direction="l", @@ -13954,7 +13054,6 @@ characters.data={ unicodeslot=0x533, }, [0x534]={ - adobename="Daarmenian", category="lu", description="ARMENIAN CAPITAL LETTER DA", direction="l", @@ -13963,7 +13062,6 @@ characters.data={ unicodeslot=0x534, }, [0x535]={ - adobename="Echarmenian", category="lu", description="ARMENIAN CAPITAL LETTER ECH", direction="l", @@ -13972,7 +13070,6 @@ characters.data={ unicodeslot=0x535, }, [0x536]={ - adobename="Zaarmenian", category="lu", description="ARMENIAN CAPITAL LETTER ZA", direction="l", @@ -13981,7 +13078,6 @@ characters.data={ unicodeslot=0x536, }, [0x537]={ - adobename="Eharmenian", category="lu", description="ARMENIAN CAPITAL LETTER EH", direction="l", @@ -13990,7 +13086,6 @@ characters.data={ unicodeslot=0x537, }, [0x538]={ - adobename="Etarmenian", category="lu", description="ARMENIAN CAPITAL LETTER ET", direction="l", @@ -13999,7 +13094,6 @@ characters.data={ unicodeslot=0x538, }, [0x539]={ - adobename="Toarmenian", category="lu", description="ARMENIAN CAPITAL LETTER TO", direction="l", @@ -14008,7 +13102,6 @@ characters.data={ unicodeslot=0x539, }, [0x53A]={ - adobename="Zhearmenian", category="lu", description="ARMENIAN CAPITAL LETTER ZHE", direction="l", @@ -14017,7 +13110,6 @@ characters.data={ unicodeslot=0x53A, }, [0x53B]={ - adobename="Iniarmenian", category="lu", description="ARMENIAN CAPITAL LETTER INI", direction="l", @@ -14026,7 +13118,6 @@ characters.data={ unicodeslot=0x53B, }, [0x53C]={ - adobename="Liwnarmenian", category="lu", description="ARMENIAN CAPITAL LETTER LIWN", direction="l", @@ -14035,7 +13126,6 @@ characters.data={ unicodeslot=0x53C, }, [0x53D]={ - adobename="Xeharmenian", category="lu", description="ARMENIAN CAPITAL LETTER XEH", direction="l", @@ -14044,7 +13134,6 @@ characters.data={ unicodeslot=0x53D, }, [0x53E]={ - adobename="Caarmenian", category="lu", description="ARMENIAN CAPITAL LETTER CA", direction="l", @@ -14053,7 +13142,6 @@ characters.data={ unicodeslot=0x53E, }, [0x53F]={ - adobename="Kenarmenian", category="lu", description="ARMENIAN CAPITAL LETTER KEN", direction="l", @@ -14062,7 +13150,6 @@ characters.data={ unicodeslot=0x53F, }, [0x540]={ - adobename="Hoarmenian", category="lu", description="ARMENIAN CAPITAL LETTER HO", direction="l", @@ -14071,7 +13158,6 @@ characters.data={ unicodeslot=0x540, }, [0x541]={ - adobename="Jaarmenian", category="lu", description="ARMENIAN CAPITAL LETTER JA", direction="l", @@ -14080,7 +13166,6 @@ characters.data={ unicodeslot=0x541, }, [0x542]={ - adobename="Ghadarmenian", category="lu", description="ARMENIAN CAPITAL LETTER GHAD", direction="l", @@ -14089,7 +13174,6 @@ characters.data={ unicodeslot=0x542, }, [0x543]={ - adobename="Cheharmenian", category="lu", description="ARMENIAN CAPITAL LETTER CHEH", direction="l", @@ -14098,7 +13182,6 @@ characters.data={ unicodeslot=0x543, }, [0x544]={ - adobename="Menarmenian", category="lu", description="ARMENIAN CAPITAL LETTER MEN", direction="l", @@ -14107,7 +13190,6 @@ characters.data={ unicodeslot=0x544, }, [0x545]={ - adobename="Yiarmenian", category="lu", description="ARMENIAN CAPITAL LETTER YI", direction="l", @@ -14116,7 +13198,6 @@ characters.data={ unicodeslot=0x545, }, [0x546]={ - adobename="Nowarmenian", category="lu", description="ARMENIAN CAPITAL LETTER NOW", direction="l", @@ -14125,7 +13206,6 @@ characters.data={ unicodeslot=0x546, }, [0x547]={ - adobename="Shaarmenian", category="lu", description="ARMENIAN CAPITAL LETTER SHA", direction="l", @@ -14134,7 +13214,6 @@ characters.data={ unicodeslot=0x547, }, [0x548]={ - adobename="Voarmenian", category="lu", description="ARMENIAN CAPITAL LETTER VO", direction="l", @@ -14143,7 +13222,6 @@ characters.data={ unicodeslot=0x548, }, [0x549]={ - adobename="Chaarmenian", category="lu", description="ARMENIAN CAPITAL LETTER CHA", direction="l", @@ -14152,7 +13230,6 @@ characters.data={ unicodeslot=0x549, }, [0x54A]={ - adobename="Peharmenian", category="lu", description="ARMENIAN CAPITAL LETTER PEH", direction="l", @@ -14161,7 +13238,6 @@ characters.data={ unicodeslot=0x54A, }, [0x54B]={ - adobename="Jheharmenian", category="lu", description="ARMENIAN CAPITAL LETTER JHEH", direction="l", @@ -14170,7 +13246,6 @@ characters.data={ unicodeslot=0x54B, }, [0x54C]={ - adobename="Raarmenian", category="lu", description="ARMENIAN CAPITAL LETTER RA", direction="l", @@ -14179,7 +13254,6 @@ characters.data={ unicodeslot=0x54C, }, [0x54D]={ - adobename="Seharmenian", category="lu", description="ARMENIAN CAPITAL LETTER SEH", direction="l", @@ -14188,7 +13262,6 @@ characters.data={ unicodeslot=0x54D, }, [0x54E]={ - adobename="Vewarmenian", category="lu", description="ARMENIAN CAPITAL LETTER VEW", direction="l", @@ -14197,7 +13270,6 @@ characters.data={ unicodeslot=0x54E, }, [0x54F]={ - adobename="Tiwnarmenian", category="lu", description="ARMENIAN CAPITAL LETTER TIWN", direction="l", @@ -14206,7 +13278,6 @@ characters.data={ unicodeslot=0x54F, }, [0x550]={ - adobename="Reharmenian", category="lu", description="ARMENIAN CAPITAL LETTER REH", direction="l", @@ -14215,7 +13286,6 @@ characters.data={ unicodeslot=0x550, }, [0x551]={ - adobename="Coarmenian", category="lu", description="ARMENIAN CAPITAL LETTER CO", direction="l", @@ -14224,7 +13294,6 @@ characters.data={ unicodeslot=0x551, }, [0x552]={ - adobename="Yiwnarmenian", category="lu", description="ARMENIAN CAPITAL LETTER YIWN", direction="l", @@ -14233,7 +13302,6 @@ characters.data={ unicodeslot=0x552, }, [0x553]={ - adobename="Piwrarmenian", category="lu", description="ARMENIAN CAPITAL LETTER PIWR", direction="l", @@ -14242,7 +13310,6 @@ characters.data={ unicodeslot=0x553, }, [0x554]={ - adobename="Keharmenian", category="lu", description="ARMENIAN CAPITAL LETTER KEH", direction="l", @@ -14251,7 +13318,6 @@ characters.data={ unicodeslot=0x554, }, [0x555]={ - adobename="Oharmenian", category="lu", description="ARMENIAN CAPITAL LETTER OH", direction="l", @@ -14260,7 +13326,6 @@ characters.data={ unicodeslot=0x555, }, [0x556]={ - adobename="Feharmenian", category="lu", description="ARMENIAN CAPITAL LETTER FEH", direction="l", @@ -14269,7 +13334,6 @@ characters.data={ unicodeslot=0x556, }, [0x559]={ - adobename="ringhalfleftarmenian", category="lm", description="ARMENIAN MODIFIER LETTER LEFT HALF RING", direction="l", @@ -14277,7 +13341,6 @@ characters.data={ unicodeslot=0x559, }, [0x55A]={ - adobename="apostrophearmenian", category="po", description="ARMENIAN APOSTROPHE", direction="l", @@ -14286,7 +13349,6 @@ characters.data={ unicodeslot=0x55A, }, [0x55B]={ - adobename="emphasismarkarmenian", category="po", description="ARMENIAN EMPHASIS MARK", direction="l", @@ -14295,7 +13357,6 @@ characters.data={ unicodeslot=0x55B, }, [0x55C]={ - adobename="exclamarmenian", category="po", description="ARMENIAN EXCLAMATION MARK", direction="l", @@ -14304,7 +13365,6 @@ characters.data={ unicodeslot=0x55C, }, [0x55D]={ - adobename="commaarmenian", category="po", description="ARMENIAN COMMA", direction="l", @@ -14313,7 +13373,6 @@ characters.data={ unicodeslot=0x55D, }, [0x55E]={ - adobename="questionarmenian", category="po", description="ARMENIAN QUESTION MARK", direction="l", @@ -14322,7 +13381,6 @@ characters.data={ unicodeslot=0x55E, }, [0x55F]={ - adobename="abbreviationmarkarmenian", category="po", description="ARMENIAN ABBREVIATION MARK", direction="l", @@ -14338,7 +13396,6 @@ characters.data={ unicodeslot=0x560, }, [0x561]={ - adobename="aybarmenian", category="ll", description="ARMENIAN SMALL LETTER AYB", direction="l", @@ -14347,7 +13404,6 @@ characters.data={ unicodeslot=0x561, }, [0x562]={ - adobename="benarmenian", category="ll", description="ARMENIAN SMALL LETTER BEN", direction="l", @@ -14356,7 +13412,6 @@ characters.data={ unicodeslot=0x562, }, [0x563]={ - adobename="gimarmenian", category="ll", description="ARMENIAN SMALL LETTER GIM", direction="l", @@ -14365,7 +13420,6 @@ characters.data={ unicodeslot=0x563, }, [0x564]={ - adobename="daarmenian", category="ll", description="ARMENIAN SMALL LETTER DA", direction="l", @@ -14374,7 +13428,6 @@ characters.data={ unicodeslot=0x564, }, [0x565]={ - adobename="echarmenian", category="ll", description="ARMENIAN SMALL LETTER ECH", direction="l", @@ -14383,7 +13436,6 @@ characters.data={ unicodeslot=0x565, }, [0x566]={ - adobename="zaarmenian", category="ll", description="ARMENIAN SMALL LETTER ZA", direction="l", @@ -14392,7 +13444,6 @@ characters.data={ unicodeslot=0x566, }, [0x567]={ - adobename="eharmenian", category="ll", description="ARMENIAN SMALL LETTER EH", direction="l", @@ -14401,7 +13452,6 @@ characters.data={ unicodeslot=0x567, }, [0x568]={ - adobename="etarmenian", category="ll", description="ARMENIAN SMALL LETTER ET", direction="l", @@ -14410,7 +13460,6 @@ characters.data={ unicodeslot=0x568, }, [0x569]={ - adobename="toarmenian", category="ll", description="ARMENIAN SMALL LETTER TO", direction="l", @@ -14419,7 +13468,6 @@ characters.data={ unicodeslot=0x569, }, [0x56A]={ - adobename="zhearmenian", category="ll", description="ARMENIAN SMALL LETTER ZHE", direction="l", @@ -14428,7 +13476,6 @@ characters.data={ unicodeslot=0x56A, }, [0x56B]={ - adobename="iniarmenian", category="ll", description="ARMENIAN SMALL LETTER INI", direction="l", @@ -14437,7 +13484,6 @@ characters.data={ unicodeslot=0x56B, }, [0x56C]={ - adobename="liwnarmenian", category="ll", description="ARMENIAN SMALL LETTER LIWN", direction="l", @@ -14446,7 +13492,6 @@ characters.data={ unicodeslot=0x56C, }, [0x56D]={ - adobename="xeharmenian", category="ll", description="ARMENIAN SMALL LETTER XEH", direction="l", @@ -14455,7 +13500,6 @@ characters.data={ unicodeslot=0x56D, }, [0x56E]={ - adobename="caarmenian", category="ll", description="ARMENIAN SMALL LETTER CA", direction="l", @@ -14464,7 +13508,6 @@ characters.data={ unicodeslot=0x56E, }, [0x56F]={ - adobename="kenarmenian", category="ll", description="ARMENIAN SMALL LETTER KEN", direction="l", @@ -14473,7 +13516,6 @@ characters.data={ unicodeslot=0x56F, }, [0x570]={ - adobename="hoarmenian", category="ll", description="ARMENIAN SMALL LETTER HO", direction="l", @@ -14482,7 +13524,6 @@ characters.data={ unicodeslot=0x570, }, [0x571]={ - adobename="jaarmenian", category="ll", description="ARMENIAN SMALL LETTER JA", direction="l", @@ -14491,7 +13532,6 @@ characters.data={ unicodeslot=0x571, }, [0x572]={ - adobename="ghadarmenian", category="ll", description="ARMENIAN SMALL LETTER GHAD", direction="l", @@ -14500,7 +13540,6 @@ characters.data={ unicodeslot=0x572, }, [0x573]={ - adobename="cheharmenian", category="ll", description="ARMENIAN SMALL LETTER CHEH", direction="l", @@ -14509,7 +13548,6 @@ characters.data={ unicodeslot=0x573, }, [0x574]={ - adobename="menarmenian", category="ll", description="ARMENIAN SMALL LETTER MEN", direction="l", @@ -14518,7 +13556,6 @@ characters.data={ unicodeslot=0x574, }, [0x575]={ - adobename="yiarmenian", category="ll", description="ARMENIAN SMALL LETTER YI", direction="l", @@ -14527,7 +13564,6 @@ characters.data={ unicodeslot=0x575, }, [0x576]={ - adobename="nowarmenian", category="ll", description="ARMENIAN SMALL LETTER NOW", direction="l", @@ -14536,7 +13572,6 @@ characters.data={ unicodeslot=0x576, }, [0x577]={ - adobename="shaarmenian", category="ll", description="ARMENIAN SMALL LETTER SHA", direction="l", @@ -14545,7 +13580,6 @@ characters.data={ unicodeslot=0x577, }, [0x578]={ - adobename="voarmenian", category="ll", description="ARMENIAN SMALL LETTER VO", direction="l", @@ -14554,7 +13588,6 @@ characters.data={ unicodeslot=0x578, }, [0x579]={ - adobename="chaarmenian", category="ll", description="ARMENIAN SMALL LETTER CHA", direction="l", @@ -14563,7 +13596,6 @@ characters.data={ unicodeslot=0x579, }, [0x57A]={ - adobename="peharmenian", category="ll", description="ARMENIAN SMALL LETTER PEH", direction="l", @@ -14572,7 +13604,6 @@ characters.data={ unicodeslot=0x57A, }, [0x57B]={ - adobename="jheharmenian", category="ll", description="ARMENIAN SMALL LETTER JHEH", direction="l", @@ -14581,7 +13612,6 @@ characters.data={ unicodeslot=0x57B, }, [0x57C]={ - adobename="raarmenian", category="ll", description="ARMENIAN SMALL LETTER RA", direction="l", @@ -14590,7 +13620,6 @@ characters.data={ unicodeslot=0x57C, }, [0x57D]={ - adobename="seharmenian", category="ll", description="ARMENIAN SMALL LETTER SEH", direction="l", @@ -14599,7 +13628,6 @@ characters.data={ unicodeslot=0x57D, }, [0x57E]={ - adobename="vewarmenian", category="ll", description="ARMENIAN SMALL LETTER VEW", direction="l", @@ -14608,7 +13636,6 @@ characters.data={ unicodeslot=0x57E, }, [0x57F]={ - adobename="tiwnarmenian", category="ll", description="ARMENIAN SMALL LETTER TIWN", direction="l", @@ -14617,7 +13644,6 @@ characters.data={ unicodeslot=0x57F, }, [0x580]={ - adobename="reharmenian", category="ll", description="ARMENIAN SMALL LETTER REH", direction="l", @@ -14626,7 +13652,6 @@ characters.data={ unicodeslot=0x580, }, [0x581]={ - adobename="coarmenian", category="ll", description="ARMENIAN SMALL LETTER CO", direction="l", @@ -14635,7 +13660,6 @@ characters.data={ unicodeslot=0x581, }, [0x582]={ - adobename="yiwnarmenian", category="ll", description="ARMENIAN SMALL LETTER YIWN", direction="l", @@ -14644,7 +13668,6 @@ characters.data={ unicodeslot=0x582, }, [0x583]={ - adobename="piwrarmenian", category="ll", description="ARMENIAN SMALL LETTER PIWR", direction="l", @@ -14653,7 +13676,6 @@ characters.data={ unicodeslot=0x583, }, [0x584]={ - adobename="keharmenian", category="ll", description="ARMENIAN SMALL LETTER KEH", direction="l", @@ -14662,7 +13684,6 @@ characters.data={ unicodeslot=0x584, }, [0x585]={ - adobename="oharmenian", category="ll", description="ARMENIAN SMALL LETTER OH", direction="l", @@ -14671,7 +13692,6 @@ characters.data={ unicodeslot=0x585, }, [0x586]={ - adobename="feharmenian", category="ll", description="ARMENIAN SMALL LETTER FEH", direction="l", @@ -14680,7 +13700,6 @@ characters.data={ unicodeslot=0x586, }, [0x587]={ - adobename="echyiwnarmenian", category="ll", description="ARMENIAN SMALL LIGATURE ECH YIWN", direction="l", @@ -14697,7 +13716,6 @@ characters.data={ unicodeslot=0x588, }, [0x589]={ - adobename="periodarmenian", category="po", description="ARMENIAN FULL STOP", direction="l", @@ -14736,7 +13754,6 @@ characters.data={ unicodeslot=0x58F, }, [0x591]={ - adobename="etnahtalefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT ETNAHTA", @@ -14745,7 +13762,6 @@ characters.data={ unicodeslot=0x591, }, [0x592]={ - adobename="segoltahebrew", category="mn", combining=0xE6, description="HEBREW ACCENT SEGOL", @@ -14754,7 +13770,6 @@ characters.data={ unicodeslot=0x592, }, [0x593]={ - adobename="shalshelethebrew", category="mn", combining=0xE6, description="HEBREW ACCENT SHALSHELET", @@ -14763,7 +13778,6 @@ characters.data={ unicodeslot=0x593, }, [0x594]={ - adobename="zaqefqatanhebrew", category="mn", combining=0xE6, description="HEBREW ACCENT ZAQEF QATAN", @@ -14772,7 +13786,6 @@ characters.data={ unicodeslot=0x594, }, [0x595]={ - adobename="zaqefgadolhebrew", category="mn", combining=0xE6, description="HEBREW ACCENT ZAQEF GADOL", @@ -14781,7 +13794,6 @@ characters.data={ unicodeslot=0x595, }, [0x596]={ - adobename="tipehalefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT TIPEHA", @@ -14790,7 +13802,6 @@ characters.data={ unicodeslot=0x596, }, [0x597]={ - adobename="reviamugrashhebrew", category="mn", combining=0xE6, description="HEBREW ACCENT REVIA", @@ -14799,7 +13810,6 @@ characters.data={ unicodeslot=0x597, }, [0x598]={ - adobename="zarqahebrew", category="mn", combining=0xE6, description="HEBREW ACCENT ZARQA", @@ -14808,7 +13818,6 @@ characters.data={ unicodeslot=0x598, }, [0x599]={ - adobename="pashtahebrew", category="mn", combining=0xE6, description="HEBREW ACCENT PASHTA", @@ -14817,7 +13826,6 @@ characters.data={ unicodeslot=0x599, }, [0x59A]={ - adobename="yetivhebrew", category="mn", combining=0xDE, description="HEBREW ACCENT YETIV", @@ -14826,7 +13834,6 @@ characters.data={ unicodeslot=0x59A, }, [0x59B]={ - adobename="tevirlefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT TEVIR", @@ -14835,7 +13842,6 @@ characters.data={ unicodeslot=0x59B, }, [0x59C]={ - adobename="gereshaccenthebrew", category="mn", combining=0xE6, description="HEBREW ACCENT GERESH", @@ -14844,7 +13850,6 @@ characters.data={ unicodeslot=0x59C, }, [0x59D]={ - adobename="gereshmuqdamhebrew", category="mn", combining=0xE6, description="HEBREW ACCENT GERESH MUQDAM", @@ -14853,7 +13858,6 @@ characters.data={ unicodeslot=0x59D, }, [0x59E]={ - adobename="gershayimaccenthebrew", category="mn", combining=0xE6, description="HEBREW ACCENT GERSHAYIM", @@ -14862,7 +13866,6 @@ characters.data={ unicodeslot=0x59E, }, [0x59F]={ - adobename="qarneyparahebrew", category="mn", combining=0xE6, description="HEBREW ACCENT QARNEY PARA", @@ -14871,7 +13874,6 @@ characters.data={ unicodeslot=0x59F, }, [0x5A0]={ - adobename="telishagedolahebrew", category="mn", combining=0xE6, description="HEBREW ACCENT TELISHA GEDOLA", @@ -14880,7 +13882,6 @@ characters.data={ unicodeslot=0x5A0, }, [0x5A1]={ - adobename="pazerhebrew", category="mn", combining=0xE6, description="HEBREW ACCENT PAZER", @@ -14897,7 +13898,6 @@ characters.data={ unicodeslot=0x5A2, }, [0x5A3]={ - adobename="munahlefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT MUNAH", @@ -14906,7 +13906,6 @@ characters.data={ unicodeslot=0x5A3, }, [0x5A4]={ - adobename="mahapakhlefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT MAHAPAKH", @@ -14915,7 +13914,6 @@ characters.data={ unicodeslot=0x5A4, }, [0x5A5]={ - adobename="merkhalefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT MERKHA", @@ -14924,7 +13922,6 @@ characters.data={ unicodeslot=0x5A5, }, [0x5A6]={ - adobename="merkhakefulalefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT MERKHA KEFULA", @@ -14933,7 +13930,6 @@ characters.data={ unicodeslot=0x5A6, }, [0x5A7]={ - adobename="dargalefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT DARGA", @@ -14942,7 +13938,6 @@ characters.data={ unicodeslot=0x5A7, }, [0x5A8]={ - adobename="qadmahebrew", category="mn", combining=0xE6, description="HEBREW ACCENT QADMA", @@ -14951,7 +13946,6 @@ characters.data={ unicodeslot=0x5A8, }, [0x5A9]={ - adobename="telishaqetanahebrew", category="mn", combining=0xE6, description="HEBREW ACCENT TELISHA QETANA", @@ -14960,7 +13954,6 @@ characters.data={ unicodeslot=0x5A9, }, [0x5AA]={ - adobename="yerahbenyomolefthebrew", category="mn", combining=0xDC, description="HEBREW ACCENT YERAH BEN YOMO", @@ -14969,7 +13962,6 @@ characters.data={ unicodeslot=0x5AA, }, [0x5AB]={ - adobename="olehebrew", category="mn", combining=0xE6, description="HEBREW ACCENT OLE", @@ -14978,7 +13970,6 @@ characters.data={ unicodeslot=0x5AB, }, [0x5AC]={ - adobename="iluyhebrew", category="mn", combining=0xE6, description="HEBREW ACCENT ILUY", @@ -14987,7 +13978,6 @@ characters.data={ unicodeslot=0x5AC, }, [0x5AD]={ - adobename="dehihebrew", category="mn", combining=0xDE, description="HEBREW ACCENT DEHI", @@ -14996,7 +13986,6 @@ characters.data={ unicodeslot=0x5AD, }, [0x5AE]={ - adobename="zinorhebrew", category="mn", combining=0xE4, description="HEBREW ACCENT ZINOR", @@ -15005,7 +13994,6 @@ characters.data={ unicodeslot=0x5AE, }, [0x5AF]={ - adobename="masoracirclehebrew", category="mn", combining=0xE6, description="HEBREW MARK MASORA CIRCLE", @@ -15014,7 +14002,6 @@ characters.data={ unicodeslot=0x5AF, }, [0x5B0]={ - adobename="shevawidehebrew", category="mn", combining=0xA, description="HEBREW POINT SHEVA", @@ -15023,7 +14010,6 @@ characters.data={ unicodeslot=0x5B0, }, [0x5B1]={ - adobename="hatafsegolwidehebrew", category="mn", combining=0xB, description="HEBREW POINT HATAF SEGOL", @@ -15032,7 +14018,6 @@ characters.data={ unicodeslot=0x5B1, }, [0x5B2]={ - adobename="hatafpatahwidehebrew", category="mn", combining=0xC, description="HEBREW POINT HATAF PATAH", @@ -15041,7 +14026,6 @@ characters.data={ unicodeslot=0x5B2, }, [0x5B3]={ - adobename="hatafqamatswidehebrew", category="mn", combining=0xD, description="HEBREW POINT HATAF QAMATS", @@ -15050,7 +14034,6 @@ characters.data={ unicodeslot=0x5B3, }, [0x5B4]={ - adobename="hiriqwidehebrew", category="mn", combining=0xE, description="HEBREW POINT HIRIQ", @@ -15059,7 +14042,6 @@ characters.data={ unicodeslot=0x5B4, }, [0x5B5]={ - adobename="tserewidehebrew", category="mn", combining=0xF, description="HEBREW POINT TSERE", @@ -15068,7 +14050,6 @@ characters.data={ unicodeslot=0x5B5, }, [0x5B6]={ - adobename="segolwidehebrew", category="mn", combining=0x10, description="HEBREW POINT SEGOL", @@ -15077,7 +14058,6 @@ characters.data={ unicodeslot=0x5B6, }, [0x5B7]={ - adobename="patahwidehebrew", category="mn", combining=0x11, description="HEBREW POINT PATAH", @@ -15086,7 +14066,6 @@ characters.data={ unicodeslot=0x5B7, }, [0x5B8]={ - adobename="qamatswidehebrew", category="mn", combining=0x12, description="HEBREW POINT QAMATS", @@ -15095,7 +14074,6 @@ characters.data={ unicodeslot=0x5B8, }, [0x5B9]={ - adobename="holamwidehebrew", category="mn", combining=0x13, description="HEBREW POINT HOLAM", @@ -15112,7 +14090,6 @@ characters.data={ unicodeslot=0x5BA, }, [0x5BB]={ - adobename="qubutswidehebrew", category="mn", combining=0x14, description="HEBREW POINT QUBUTS", @@ -15121,7 +14098,6 @@ characters.data={ unicodeslot=0x5BB, }, [0x5BC]={ - adobename="dageshhebrew", category="mn", combining=0x15, description="HEBREW POINT DAGESH OR MAPIQ", @@ -15130,7 +14106,6 @@ characters.data={ unicodeslot=0x5BC, }, [0x5BD]={ - adobename="siluqlefthebrew", category="mn", combining=0x16, description="HEBREW POINT METEG", @@ -15139,7 +14114,6 @@ characters.data={ unicodeslot=0x5BD, }, [0x5BE]={ - adobename="maqafhebrew", category="po", description="HEBREW PUNCTUATION MAQAF", direction="r", @@ -15147,7 +14121,6 @@ characters.data={ unicodeslot=0x5BE, }, [0x5BF]={ - adobename="rafehebrew", category="mn", combining=0x17, description="HEBREW POINT RAFE", @@ -15156,7 +14129,6 @@ characters.data={ unicodeslot=0x5BF, }, [0x5C0]={ - adobename="paseqhebrew", category="po", description="HEBREW PUNCTUATION PASEQ", direction="r", @@ -15164,7 +14136,6 @@ characters.data={ unicodeslot=0x5C0, }, [0x5C1]={ - adobename="shindothebrew", category="mn", combining=0x18, description="HEBREW POINT SHIN DOT", @@ -15173,7 +14144,6 @@ characters.data={ unicodeslot=0x5C1, }, [0x5C2]={ - adobename="sindothebrew", category="mn", combining=0x19, description="HEBREW POINT SIN DOT", @@ -15182,7 +14152,6 @@ characters.data={ unicodeslot=0x5C2, }, [0x5C3]={ - adobename="sofpasuqhebrew", category="po", description="HEBREW PUNCTUATION SOF PASUQ", direction="r", @@ -15190,7 +14159,6 @@ characters.data={ unicodeslot=0x5C3, }, [0x5C4]={ - adobename="upperdothebrew", category="mn", combining=0xE6, description="HEBREW MARK UPPER DOT", @@ -15222,7 +14190,6 @@ characters.data={ unicodeslot=0x5C7, }, [0x5D0]={ - adobename="alefhebrew", category="lo", contextname="hebrewAlef", description="HEBREW LETTER ALEF", @@ -15231,7 +14198,6 @@ characters.data={ unicodeslot=0x5D0, }, [0x5D1]={ - adobename="bethebrew", category="lo", contextname="hebrewBet", description="HEBREW LETTER BET", @@ -15240,7 +14206,6 @@ characters.data={ unicodeslot=0x5D1, }, [0x5D2]={ - adobename="gimelhebrew", category="lo", contextname="hebrewGimel", description="HEBREW LETTER GIMEL", @@ -15249,7 +14214,6 @@ characters.data={ unicodeslot=0x5D2, }, [0x5D3]={ - adobename="dalettserehebrew", category="lo", contextname="hebrewDalet", description="HEBREW LETTER DALET", @@ -15258,7 +14222,6 @@ characters.data={ unicodeslot=0x5D3, }, [0x5D4]={ - adobename="hehebrew", category="lo", contextname="hebrewHe", description="HEBREW LETTER HE", @@ -15267,7 +14230,6 @@ characters.data={ unicodeslot=0x5D4, }, [0x5D5]={ - adobename="vavhebrew", category="lo", contextname="hebrewVav", description="HEBREW LETTER VAV", @@ -15276,7 +14238,6 @@ characters.data={ unicodeslot=0x5D5, }, [0x5D6]={ - adobename="zayinhebrew", category="lo", contextname="hebrewZayin", description="HEBREW LETTER ZAYIN", @@ -15285,7 +14246,6 @@ characters.data={ unicodeslot=0x5D6, }, [0x5D7]={ - adobename="hethebrew", category="lo", contextname="hebrewHet", description="HEBREW LETTER HET", @@ -15294,7 +14254,6 @@ characters.data={ unicodeslot=0x5D7, }, [0x5D8]={ - adobename="tethebrew", category="lo", contextname="hebrewTet", description="HEBREW LETTER TET", @@ -15303,7 +14262,6 @@ characters.data={ unicodeslot=0x5D8, }, [0x5D9]={ - adobename="yodhebrew", category="lo", contextname="hebrewYod", description="HEBREW LETTER YOD", @@ -15312,7 +14270,6 @@ characters.data={ unicodeslot=0x5D9, }, [0x5DA]={ - adobename="finalkafshevahebrew", category="lo", contextname="hebrewKaffinal", description="HEBREW LETTER FINAL KAF", @@ -15321,7 +14278,6 @@ characters.data={ unicodeslot=0x5DA, }, [0x5DB]={ - adobename="kafhebrew", category="lo", contextname="hebrewKaf", description="HEBREW LETTER KAF", @@ -15330,7 +14286,6 @@ characters.data={ unicodeslot=0x5DB, }, [0x5DC]={ - adobename="lamedholamhebrew", category="lo", contextname="hebrewLamed", description="HEBREW LETTER LAMED", @@ -15339,7 +14294,6 @@ characters.data={ unicodeslot=0x5DC, }, [0x5DD]={ - adobename="finalmemhebrew", category="lo", contextname="hebrewMemfinal", description="HEBREW LETTER FINAL MEM", @@ -15348,7 +14302,6 @@ characters.data={ unicodeslot=0x5DD, }, [0x5DE]={ - adobename="memhebrew", category="lo", contextname="hebrewMem", description="HEBREW LETTER MEM", @@ -15357,7 +14310,6 @@ characters.data={ unicodeslot=0x5DE, }, [0x5DF]={ - adobename="finalnunhebrew", category="lo", contextname="hebrewNunfinal", description="HEBREW LETTER FINAL NUN", @@ -15366,7 +14318,6 @@ characters.data={ unicodeslot=0x5DF, }, [0x5E0]={ - adobename="nunhebrew", category="lo", contextname="hebrewNun", description="HEBREW LETTER NUN", @@ -15375,7 +14326,6 @@ characters.data={ unicodeslot=0x5E0, }, [0x5E1]={ - adobename="samekhhebrew", category="lo", contextname="hebrewSamekh", description="HEBREW LETTER SAMEKH", @@ -15384,7 +14334,6 @@ characters.data={ unicodeslot=0x5E1, }, [0x5E2]={ - adobename="ayinhebrew", category="lo", contextname="hebrewAyin", description="HEBREW LETTER AYIN", @@ -15393,7 +14342,6 @@ characters.data={ unicodeslot=0x5E2, }, [0x5E3]={ - adobename="finalpehebrew", category="lo", contextname="hebrewPefinal", description="HEBREW LETTER FINAL PE", @@ -15402,7 +14350,6 @@ characters.data={ unicodeslot=0x5E3, }, [0x5E4]={ - adobename="pehebrew", category="lo", contextname="hebrewPe", description="HEBREW LETTER PE", @@ -15411,7 +14358,6 @@ characters.data={ unicodeslot=0x5E4, }, [0x5E5]={ - adobename="finaltsadihebrew", category="lo", contextname="hebrewTsadifinal", description="HEBREW LETTER FINAL TSADI", @@ -15420,7 +14366,6 @@ characters.data={ unicodeslot=0x5E5, }, [0x5E6]={ - adobename="tsadihebrew", category="lo", contextname="hebrewTsadi", description="HEBREW LETTER TSADI", @@ -15429,7 +14374,6 @@ characters.data={ unicodeslot=0x5E6, }, [0x5E7]={ - adobename="qoftserehebrew", category="lo", contextname="hebrewQof", description="HEBREW LETTER QOF", @@ -15438,7 +14382,6 @@ characters.data={ unicodeslot=0x5E7, }, [0x5E8]={ - adobename="reshtserehebrew", category="lo", contextname="hebrewResh", description="HEBREW LETTER RESH", @@ -15447,7 +14390,6 @@ characters.data={ unicodeslot=0x5E8, }, [0x5E9]={ - adobename="shinhebrew", category="lo", contextname="hebrewShin", description="HEBREW LETTER SHIN", @@ -15456,7 +14398,6 @@ characters.data={ unicodeslot=0x5E9, }, [0x5EA]={ - adobename="tavhebrew", category="lo", contextname="hebrewTav", description="HEBREW LETTER TAV", @@ -15472,7 +14413,6 @@ characters.data={ unicodeslot=0x5EF, }, [0x5F0]={ - adobename="vavvavhebrew", category="lo", description="HEBREW LIGATURE YIDDISH DOUBLE VAV", direction="r", @@ -15480,7 +14420,6 @@ characters.data={ unicodeslot=0x5F0, }, [0x5F1]={ - adobename="vavyodhebrew", category="lo", description="HEBREW LIGATURE YIDDISH VAV YOD", direction="r", @@ -15488,7 +14427,6 @@ characters.data={ unicodeslot=0x5F1, }, [0x5F2]={ - adobename="yodyodhebrew", category="lo", description="HEBREW LIGATURE YIDDISH DOUBLE YOD", direction="r", @@ -15496,7 +14434,6 @@ characters.data={ unicodeslot=0x5F2, }, [0x5F3]={ - adobename="gereshhebrew", category="po", description="HEBREW PUNCTUATION GERESH", direction="r", @@ -15504,7 +14441,6 @@ characters.data={ unicodeslot=0x5F3, }, [0x5F4]={ - adobename="gershayimhebrew", category="po", description="HEBREW PUNCTUATION GERSHAYIM", direction="r", @@ -15517,7 +14453,7 @@ characters.data={ contextname="arabicnumber", description="ARABIC NUMBER SIGN", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x600, visible=true, }, @@ -15527,7 +14463,7 @@ characters.data={ contextname="arabicsanah", description="ARABIC SIGN SANAH", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x601, visible=true, }, @@ -15537,7 +14473,7 @@ characters.data={ contextname="arabicfootnotemarker", description="ARABIC FOOTNOTE MARKER", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x602, visible=true, }, @@ -15547,7 +14483,7 @@ characters.data={ contextname="arabicsafha", description="ARABIC SIGN SAFHA", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x603, visible=true, }, @@ -15557,7 +14493,7 @@ characters.data={ contextname="arabicsamvat", description="ARABIC SIGN SAMVAT", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x604, }, [0x605]={ @@ -15566,7 +14502,7 @@ characters.data={ contextname="arabicnumberabove", description="ARABIC NUMBER MARK ABOVE", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x605, }, [0x606]={ @@ -15620,7 +14556,6 @@ characters.data={ unicodeslot=0x60B, }, [0x60C]={ - adobename="commaarabic", category="po", contextname="arabiccomma", description="ARABIC COMMA", @@ -15748,7 +14683,6 @@ characters.data={ unicodeslot=0x61A, }, [0x61B]={ - adobename="semicolonarabic", category="po", contextname="arabicsemicolon", description="ARABIC SEMICOLON", @@ -15780,7 +14714,6 @@ characters.data={ unicodeslot=0x61E, }, [0x61F]={ - adobename="questionarabic", category="po", contextname="arabicquestion", description="ARABIC QUESTION MARK", @@ -15797,7 +14730,6 @@ characters.data={ unicodeslot=0x620, }, [0x621]={ - adobename="hamzasukunarabic", arabic="u", category="lo", description="ARABIC LETTER HAMZA", @@ -15806,7 +14738,6 @@ characters.data={ unicodeslot=0x621, }, [0x622]={ - adobename="alefmaddaabovearabic", arabic="r", category="lo", description="ARABIC LETTER ALEF WITH MADDA ABOVE", @@ -15817,7 +14748,6 @@ characters.data={ unicodeslot=0x622, }, [0x623]={ - adobename="alefhamzaabovearabic", arabic="r", category="lo", description="ARABIC LETTER ALEF WITH HAMZA ABOVE", @@ -15828,7 +14758,6 @@ characters.data={ unicodeslot=0x623, }, [0x624]={ - adobename="wawhamzaabovearabic", arabic="r", category="lo", description="ARABIC LETTER WAW WITH HAMZA ABOVE", @@ -15839,7 +14768,6 @@ characters.data={ unicodeslot=0x624, }, [0x625]={ - adobename="alefhamzabelowarabic", arabic="r", category="lo", description="ARABIC LETTER ALEF WITH HAMZA BELOW", @@ -15850,7 +14778,6 @@ characters.data={ unicodeslot=0x625, }, [0x626]={ - adobename="yehhamzaabovearabic", arabic="d", category="lo", description="ARABIC LETTER YEH WITH HAMZA ABOVE", @@ -15861,7 +14788,6 @@ characters.data={ unicodeslot=0x626, }, [0x627]={ - adobename="alefarabic", arabic="r", category="lo", description="ARABIC LETTER ALEF", @@ -15870,7 +14796,6 @@ characters.data={ unicodeslot=0x627, }, [0x628]={ - adobename="beharabic", arabic="d", category="lo", description="ARABIC LETTER BEH", @@ -15879,7 +14804,6 @@ characters.data={ unicodeslot=0x628, }, [0x629]={ - adobename="tehmarbutaarabic", arabic="r", category="lo", description="ARABIC LETTER TEH MARBUTA", @@ -15888,7 +14812,6 @@ characters.data={ unicodeslot=0x629, }, [0x62A]={ - adobename="teharabic", arabic="d", category="lo", description="ARABIC LETTER TEH", @@ -15897,7 +14820,6 @@ characters.data={ unicodeslot=0x62A, }, [0x62B]={ - adobename="theharabic", arabic="d", category="lo", description="ARABIC LETTER THEH", @@ -15906,7 +14828,6 @@ characters.data={ unicodeslot=0x62B, }, [0x62C]={ - adobename="jeemarabic", arabic="d", category="lo", description="ARABIC LETTER JEEM", @@ -15915,7 +14836,6 @@ characters.data={ unicodeslot=0x62C, }, [0x62D]={ - adobename="haharabic", arabic="d", category="lo", description="ARABIC LETTER HAH", @@ -15924,7 +14844,6 @@ characters.data={ unicodeslot=0x62D, }, [0x62E]={ - adobename="khaharabic", arabic="d", category="lo", description="ARABIC LETTER KHAH", @@ -15933,7 +14852,6 @@ characters.data={ unicodeslot=0x62E, }, [0x62F]={ - adobename="dalarabic", arabic="r", category="lo", description="ARABIC LETTER DAL", @@ -15942,7 +14860,6 @@ characters.data={ unicodeslot=0x62F, }, [0x630]={ - adobename="thalarabic", arabic="r", category="lo", description="ARABIC LETTER THAL", @@ -15951,7 +14868,6 @@ characters.data={ unicodeslot=0x630, }, [0x631]={ - adobename="rehyehaleflamarabic", arabic="r", category="lo", description="ARABIC LETTER REH", @@ -15960,7 +14876,6 @@ characters.data={ unicodeslot=0x631, }, [0x632]={ - adobename="zainarabic", arabic="r", category="lo", description="ARABIC LETTER ZAIN", @@ -15969,7 +14884,6 @@ characters.data={ unicodeslot=0x632, }, [0x633]={ - adobename="seenarabic", arabic="d", category="lo", description="ARABIC LETTER SEEN", @@ -15978,7 +14892,6 @@ characters.data={ unicodeslot=0x633, }, [0x634]={ - adobename="sheenarabic", arabic="d", category="lo", description="ARABIC LETTER SHEEN", @@ -15987,7 +14900,6 @@ characters.data={ unicodeslot=0x634, }, [0x635]={ - adobename="sadarabic", arabic="d", category="lo", description="ARABIC LETTER SAD", @@ -15996,7 +14908,6 @@ characters.data={ unicodeslot=0x635, }, [0x636]={ - adobename="dadarabic", arabic="d", category="lo", description="ARABIC LETTER DAD", @@ -16005,7 +14916,6 @@ characters.data={ unicodeslot=0x636, }, [0x637]={ - adobename="taharabic", arabic="d", category="lo", description="ARABIC LETTER TAH", @@ -16014,7 +14924,6 @@ characters.data={ unicodeslot=0x637, }, [0x638]={ - adobename="zaharabic", arabic="d", category="lo", description="ARABIC LETTER ZAH", @@ -16023,7 +14932,6 @@ characters.data={ unicodeslot=0x638, }, [0x639]={ - adobename="ainarabic", arabic="d", category="lo", description="ARABIC LETTER AIN", @@ -16032,7 +14940,6 @@ characters.data={ unicodeslot=0x639, }, [0x63A]={ - adobename="ghainarabic", arabic="d", category="lo", description="ARABIC LETTER GHAIN", @@ -16081,7 +14988,6 @@ characters.data={ unicodeslot=0x63F, }, [0x640]={ - adobename="tatweelarabic", arabic="c", category="lm", description="ARABIC TATWEEL", @@ -16091,7 +14997,6 @@ characters.data={ unicodeslot=0x640, }, [0x641]={ - adobename="feharabic", arabic="d", category="lo", description="ARABIC LETTER FEH", @@ -16100,7 +15005,6 @@ characters.data={ unicodeslot=0x641, }, [0x642]={ - adobename="qafarabic", arabic="d", category="lo", description="ARABIC LETTER QAF", @@ -16109,7 +15013,6 @@ characters.data={ unicodeslot=0x642, }, [0x643]={ - adobename="kafarabic", arabic="d", category="lo", description="ARABIC LETTER KAF", @@ -16118,7 +15021,6 @@ characters.data={ unicodeslot=0x643, }, [0x644]={ - adobename="lamarabic", arabic="d", category="lo", description="ARABIC LETTER LAM", @@ -16127,7 +15029,6 @@ characters.data={ unicodeslot=0x644, }, [0x645]={ - adobename="meemarabic", arabic="d", category="lo", description="ARABIC LETTER MEEM", @@ -16136,7 +15037,6 @@ characters.data={ unicodeslot=0x645, }, [0x646]={ - adobename="noonarabic", arabic="d", category="lo", description="ARABIC LETTER NOON", @@ -16145,7 +15045,6 @@ characters.data={ unicodeslot=0x646, }, [0x647]={ - adobename="heharabic", arabic="d", category="lo", description="ARABIC LETTER HEH", @@ -16154,7 +15053,6 @@ characters.data={ unicodeslot=0x647, }, [0x648]={ - adobename="wawarabic", arabic="r", category="lo", description="ARABIC LETTER WAW", @@ -16163,7 +15061,6 @@ characters.data={ unicodeslot=0x648, }, [0x649]={ - adobename="alefmaksuraarabic", arabic="d", category="lo", description="ARABIC LETTER ALEF MAKSURA", @@ -16172,7 +15069,6 @@ characters.data={ unicodeslot=0x649, }, [0x64A]={ - adobename="yeharabic", arabic="d", category="lo", description="ARABIC LETTER YEH", @@ -16181,7 +15077,6 @@ characters.data={ unicodeslot=0x64A, }, [0x64B]={ - adobename="fathatanarabic", category="mn", combining=0x1B, description="ARABIC FATHATAN", @@ -16190,7 +15085,6 @@ characters.data={ unicodeslot=0x64B, }, [0x64C]={ - adobename="dammatanarabic", category="mn", combining=0x1C, description="ARABIC DAMMATAN", @@ -16199,7 +15093,6 @@ characters.data={ unicodeslot=0x64C, }, [0x64D]={ - adobename="kasratanarabic", category="mn", combining=0x1D, description="ARABIC KASRATAN", @@ -16208,7 +15101,6 @@ characters.data={ unicodeslot=0x64D, }, [0x64E]={ - adobename="fathalowarabic", category="mn", combining=0x1E, description="ARABIC FATHA", @@ -16217,7 +15109,6 @@ characters.data={ unicodeslot=0x64E, }, [0x64F]={ - adobename="dammalowarabic", category="mn", combining=0x1F, description="ARABIC DAMMA", @@ -16226,7 +15117,6 @@ characters.data={ unicodeslot=0x64F, }, [0x650]={ - adobename="kasraarabic", category="mn", combining=0x20, description="ARABIC KASRA", @@ -16235,7 +15125,6 @@ characters.data={ unicodeslot=0x650, }, [0x651]={ - adobename="shaddafathatanarabic", category="mn", combining=0x21, description="ARABIC SHADDA", @@ -16244,7 +15133,6 @@ characters.data={ unicodeslot=0x651, }, [0x652]={ - adobename="sukunarabic", category="mn", combining=0x22, description="ARABIC SUKUN", @@ -16357,87 +15245,86 @@ characters.data={ unicodeslot=0x65F, }, [0x660]={ - adobename="zerohackarabic", category="nd", description="ARABIC-INDIC DIGIT ZERO", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x660, }, [0x661]={ - adobename="onehackarabic", category="nd", description="ARABIC-INDIC DIGIT ONE", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x661, }, [0x662]={ - adobename="twohackarabic", category="nd", description="ARABIC-INDIC DIGIT TWO", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x662, }, [0x663]={ - adobename="threehackarabic", category="nd", description="ARABIC-INDIC DIGIT THREE", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x663, }, [0x664]={ - adobename="fourhackarabic", category="nd", description="ARABIC-INDIC DIGIT FOUR", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x664, }, [0x665]={ - adobename="fivehackarabic", category="nd", description="ARABIC-INDIC DIGIT FIVE", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x665, }, [0x666]={ - adobename="sixhackarabic", category="nd", description="ARABIC-INDIC DIGIT SIX", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x666, }, [0x667]={ - adobename="sevenhackarabic", category="nd", description="ARABIC-INDIC DIGIT SEVEN", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x667, }, [0x668]={ - adobename="eighthackarabic", category="nd", description="ARABIC-INDIC DIGIT EIGHT", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x668, }, [0x669]={ - adobename="ninehackarabic", category="nd", description="ARABIC-INDIC DIGIT NINE", direction="an", linebreak="nu", + mathclass="digit", unicodeslot=0x669, }, [0x66A]={ - adobename="percentarabic", category="po", contextname="arabicpercent", description="ARABIC PERCENT SIGN", @@ -16446,7 +15333,6 @@ characters.data={ unicodeslot=0x66A, }, [0x66B]={ - adobename="decimalseparatorpersian", category="po", contextname="persiandecimalseparator", description="ARABIC DECIMAL SEPARATOR", @@ -16455,7 +15341,6 @@ characters.data={ unicodeslot=0x66B, }, [0x66C]={ - adobename="thousandsseparatorpersian", category="po", contextname="persianthousandsseparator", description="ARABIC THOUSANDS SEPARATOR", @@ -16465,7 +15350,6 @@ characters.data={ unicodeslot=0x66C, }, [0x66D]={ - adobename="asteriskarabic", category="po", contextname="arabicasterisk", description="ARABIC FIVE POINTED STAR", @@ -16569,7 +15453,6 @@ characters.data={ unicodeslot=0x678, }, [0x679]={ - adobename="tteharabic", arabic="d", category="lo", description="ARABIC LETTER TTEH", @@ -16612,7 +15495,6 @@ characters.data={ unicodeslot=0x67D, }, [0x67E]={ - adobename="peharabic", arabic="d", category="lo", description="ARABIC LETTER PEH", @@ -16680,7 +15562,6 @@ characters.data={ unicodeslot=0x685, }, [0x686]={ - adobename="tcheharabic", arabic="d", category="lo", description="ARABIC LETTER TCHEH", @@ -16697,7 +15578,6 @@ characters.data={ unicodeslot=0x687, }, [0x688]={ - adobename="ddalarabic", arabic="r", category="lo", description="ARABIC LETTER DDAL", @@ -16775,7 +15655,6 @@ characters.data={ unicodeslot=0x690, }, [0x691]={ - adobename="rreharabic", arabic="r", category="lo", description="ARABIC LETTER RREH", @@ -16838,7 +15717,6 @@ characters.data={ unicodeslot=0x697, }, [0x698]={ - adobename="jeharabic", arabic="r", category="lo", description="ARABIC LETTER JEH", @@ -16945,7 +15823,6 @@ characters.data={ unicodeslot=0x6A3, }, [0x6A4]={ - adobename="veharabic", arabic="d", category="lo", description="ARABIC LETTER VEH", @@ -17040,7 +15917,6 @@ characters.data={ unicodeslot=0x6AE, }, [0x6AF]={ - adobename="gafarabic", arabic="d", category="lo", description="ARABIC LETTER GAF", @@ -17137,7 +16013,6 @@ characters.data={ unicodeslot=0x6B9, }, [0x6BA]={ - adobename="noonghunnaarabic", arabic="d", category="lo", description="ARABIC LETTER NOON GHUNNA", @@ -17200,7 +16075,6 @@ characters.data={ unicodeslot=0x6C0, }, [0x6C1]={ - adobename="hehaltonearabic", arabic="d", category="lo", description="ARABIC LETTER HEH GOAL", @@ -17335,7 +16209,6 @@ characters.data={ unicodeslot=0x6D0, }, [0x6D1]={ - adobename="yehthreedotsbelowarabic", arabic="d", category="lo", description="ARABIC LETTER YEH WITH THREE DOTS BELOW", @@ -17345,7 +16218,6 @@ characters.data={ unicodeslot=0x6D1, }, [0x6D2]={ - adobename="yehbarreearabic", arabic="r", category="lo", description="ARABIC LETTER YEH BARREE", @@ -17371,7 +16243,6 @@ characters.data={ unicodeslot=0x6D4, }, [0x6D5]={ - adobename="afii57534", arabic="r", category="lo", description="ARABIC LETTER AE", @@ -17448,7 +16319,7 @@ characters.data={ contextname="arabicendofayah", description="ARABIC END OF AYAH", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x6DD, visible=true, }, @@ -17605,83 +16476,83 @@ characters.data={ unicodeslot=0x6EF, }, [0x6F0]={ - adobename="zeropersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT ZERO", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F0, }, [0x6F1]={ - adobename="onepersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT ONE", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F1, }, [0x6F2]={ - adobename="twopersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT TWO", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F2, }, [0x6F3]={ - adobename="threepersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT THREE", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F3, }, [0x6F4]={ - adobename="fourpersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT FOUR", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F4, }, [0x6F5]={ - adobename="fivepersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT FIVE", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F5, }, [0x6F6]={ - adobename="sixpersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT SIX", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F6, }, [0x6F7]={ - adobename="sevenpersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT SEVEN", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F7, }, [0x6F8]={ - adobename="eightpersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT EIGHT", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F8, }, [0x6F9]={ - adobename="ninepersian", category="nd", description="EXTENDED ARABIC-INDIC DIGIT NINE", direction="en", linebreak="nu", + mathclass="digit", unicodeslot=0x6F9, }, [0x6FA]={ @@ -20600,7 +19471,7 @@ characters.data={ category="cf", description="ARABIC POUND MARK ABOVE", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x890, }, [0x891]={ @@ -20608,7 +19479,7 @@ characters.data={ category="cf", description="ARABIC PIASTRE MARK ABOVE", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x891, }, [0x898]={ @@ -21222,7 +20093,7 @@ characters.data={ contextname="arabicdisputedendofayah", description="ARABIC DISPUTED END OF AYAH", direction="an", - linebreak="al", + linebreak="nu", unicodeslot=0x8E2, }, [0x8E3]={ @@ -21467,7 +20338,6 @@ characters.data={ unicodeslot=0x900, }, [0x901]={ - adobename="candrabindudeva", category="mn", description="DEVANAGARI SIGN CANDRABINDU", direction="nsm", @@ -21478,7 +20348,6 @@ characters.data={ unicodeslot=0x901, }, [0x902]={ - adobename="anusvaradeva", category="mn", description="DEVANAGARI SIGN ANUSVARA", direction="nsm", @@ -21489,7 +20358,6 @@ characters.data={ unicodeslot=0x902, }, [0x903]={ - adobename="visargadeva", category="mc", description="DEVANAGARI SIGN VISARGA", direction="l", @@ -21507,7 +20375,6 @@ characters.data={ unicodeslot=0x904, }, [0x905]={ - adobename="adeva", category="lo", description="DEVANAGARI LETTER A", direction="l", @@ -21516,7 +20383,6 @@ characters.data={ unicodeslot=0x905, }, [0x906]={ - adobename="aadeva", category="lo", description="DEVANAGARI LETTER AA", direction="l", @@ -21525,7 +20391,6 @@ characters.data={ unicodeslot=0x906, }, [0x907]={ - adobename="ideva", category="lo", description="DEVANAGARI LETTER I", direction="l", @@ -21534,7 +20399,6 @@ characters.data={ unicodeslot=0x907, }, [0x908]={ - adobename="iideva", category="lo", description="DEVANAGARI LETTER II", direction="l", @@ -21543,7 +20407,6 @@ characters.data={ unicodeslot=0x908, }, [0x909]={ - adobename="udeva", category="lo", description="DEVANAGARI LETTER U", direction="l", @@ -21552,7 +20415,6 @@ characters.data={ unicodeslot=0x909, }, [0x90A]={ - adobename="uudeva", category="lo", description="DEVANAGARI LETTER UU", direction="l", @@ -21561,7 +20423,6 @@ characters.data={ unicodeslot=0x90A, }, [0x90B]={ - adobename="rvocalicdeva", category="lo", description="DEVANAGARI LETTER VOCALIC R", direction="l", @@ -21570,7 +20431,6 @@ characters.data={ unicodeslot=0x90B, }, [0x90C]={ - adobename="lvocalicdeva", category="lo", description="DEVANAGARI LETTER VOCALIC L", direction="l", @@ -21579,7 +20439,6 @@ characters.data={ unicodeslot=0x90C, }, [0x90D]={ - adobename="ecandradeva", category="lo", description="DEVANAGARI LETTER CANDRA E", direction="l", @@ -21588,7 +20447,6 @@ characters.data={ unicodeslot=0x90D, }, [0x90E]={ - adobename="eshortdeva", category="lo", description="DEVANAGARI LETTER SHORT E", direction="l", @@ -21597,7 +20455,6 @@ characters.data={ unicodeslot=0x90E, }, [0x90F]={ - adobename="edeva", category="lo", description="DEVANAGARI LETTER E", direction="l", @@ -21606,7 +20463,6 @@ characters.data={ unicodeslot=0x90F, }, [0x910]={ - adobename="aideva", category="lo", description="DEVANAGARI LETTER AI", direction="l", @@ -21615,7 +20471,6 @@ characters.data={ unicodeslot=0x910, }, [0x911]={ - adobename="ocandradeva", category="lo", description="DEVANAGARI LETTER CANDRA O", direction="l", @@ -21624,7 +20479,6 @@ characters.data={ unicodeslot=0x911, }, [0x912]={ - adobename="oshortdeva", category="lo", description="DEVANAGARI LETTER SHORT O", direction="l", @@ -21633,7 +20487,6 @@ characters.data={ unicodeslot=0x912, }, [0x913]={ - adobename="odeva", category="lo", description="DEVANAGARI LETTER O", direction="l", @@ -21642,7 +20495,6 @@ characters.data={ unicodeslot=0x913, }, [0x914]={ - adobename="audeva", category="lo", description="DEVANAGARI LETTER AU", direction="l", @@ -21651,7 +20503,6 @@ characters.data={ unicodeslot=0x914, }, [0x915]={ - adobename="kadeva", category="lo", description="DEVANAGARI LETTER KA", direction="l", @@ -21660,7 +20511,6 @@ characters.data={ unicodeslot=0x915, }, [0x916]={ - adobename="khadeva", category="lo", description="DEVANAGARI LETTER KHA", direction="l", @@ -21669,7 +20519,6 @@ characters.data={ unicodeslot=0x916, }, [0x917]={ - adobename="gadeva", category="lo", description="DEVANAGARI LETTER GA", direction="l", @@ -21678,7 +20527,6 @@ characters.data={ unicodeslot=0x917, }, [0x918]={ - adobename="ghadeva", category="lo", description="DEVANAGARI LETTER GHA", direction="l", @@ -21687,7 +20535,6 @@ characters.data={ unicodeslot=0x918, }, [0x919]={ - adobename="ngadeva", category="lo", description="DEVANAGARI LETTER NGA", direction="l", @@ -21696,7 +20543,6 @@ characters.data={ unicodeslot=0x919, }, [0x91A]={ - adobename="cadeva", category="lo", description="DEVANAGARI LETTER CA", direction="l", @@ -21705,7 +20551,6 @@ characters.data={ unicodeslot=0x91A, }, [0x91B]={ - adobename="chadeva", category="lo", description="DEVANAGARI LETTER CHA", direction="l", @@ -21714,7 +20559,6 @@ characters.data={ unicodeslot=0x91B, }, [0x91C]={ - adobename="jadeva", category="lo", description="DEVANAGARI LETTER JA", direction="l", @@ -21723,7 +20567,6 @@ characters.data={ unicodeslot=0x91C, }, [0x91D]={ - adobename="jhadeva", category="lo", description="DEVANAGARI LETTER JHA", direction="l", @@ -21732,7 +20575,6 @@ characters.data={ unicodeslot=0x91D, }, [0x91E]={ - adobename="nyadeva", category="lo", description="DEVANAGARI LETTER NYA", direction="l", @@ -21741,7 +20583,6 @@ characters.data={ unicodeslot=0x91E, }, [0x91F]={ - adobename="ttadeva", category="lo", description="DEVANAGARI LETTER TTA", direction="l", @@ -21750,7 +20591,6 @@ characters.data={ unicodeslot=0x91F, }, [0x920]={ - adobename="tthadeva", category="lo", description="DEVANAGARI LETTER TTHA", direction="l", @@ -21759,7 +20599,6 @@ characters.data={ unicodeslot=0x920, }, [0x921]={ - adobename="ddadeva", category="lo", description="DEVANAGARI LETTER DDA", direction="l", @@ -21768,7 +20607,6 @@ characters.data={ unicodeslot=0x921, }, [0x922]={ - adobename="ddhadeva", category="lo", description="DEVANAGARI LETTER DDHA", direction="l", @@ -21777,7 +20615,6 @@ characters.data={ unicodeslot=0x922, }, [0x923]={ - adobename="nnadeva", category="lo", description="DEVANAGARI LETTER NNA", direction="l", @@ -21786,7 +20623,6 @@ characters.data={ unicodeslot=0x923, }, [0x924]={ - adobename="tadeva", category="lo", description="DEVANAGARI LETTER TA", direction="l", @@ -21795,7 +20631,6 @@ characters.data={ unicodeslot=0x924, }, [0x925]={ - adobename="thadeva", category="lo", description="DEVANAGARI LETTER THA", direction="l", @@ -21804,7 +20639,6 @@ characters.data={ unicodeslot=0x925, }, [0x926]={ - adobename="dadeva", category="lo", description="DEVANAGARI LETTER DA", direction="l", @@ -21813,7 +20647,6 @@ characters.data={ unicodeslot=0x926, }, [0x927]={ - adobename="dhadeva", category="lo", description="DEVANAGARI LETTER DHA", direction="l", @@ -21822,7 +20655,6 @@ characters.data={ unicodeslot=0x927, }, [0x928]={ - adobename="nadeva", category="lo", description="DEVANAGARI LETTER NA", direction="l", @@ -21831,7 +20663,6 @@ characters.data={ unicodeslot=0x928, }, [0x929]={ - adobename="nnnadeva", category="lo", description="DEVANAGARI LETTER NNNA", direction="l", @@ -21841,7 +20672,6 @@ characters.data={ unicodeslot=0x929, }, [0x92A]={ - adobename="padeva", category="lo", description="DEVANAGARI LETTER PA", direction="l", @@ -21850,7 +20680,6 @@ characters.data={ unicodeslot=0x92A, }, [0x92B]={ - adobename="phadeva", category="lo", description="DEVANAGARI LETTER PHA", direction="l", @@ -21859,7 +20688,6 @@ characters.data={ unicodeslot=0x92B, }, [0x92C]={ - adobename="badeva", category="lo", description="DEVANAGARI LETTER BA", direction="l", @@ -21868,7 +20696,6 @@ characters.data={ unicodeslot=0x92C, }, [0x92D]={ - adobename="bhadeva", category="lo", description="DEVANAGARI LETTER BHA", direction="l", @@ -21877,7 +20704,6 @@ characters.data={ unicodeslot=0x92D, }, [0x92E]={ - adobename="madeva", category="lo", description="DEVANAGARI LETTER MA", direction="l", @@ -21886,7 +20712,6 @@ characters.data={ unicodeslot=0x92E, }, [0x92F]={ - adobename="yadeva", category="lo", description="DEVANAGARI LETTER YA", direction="l", @@ -21895,7 +20720,6 @@ characters.data={ unicodeslot=0x92F, }, [0x930]={ - adobename="radeva", category="lo", description="DEVANAGARI LETTER RA", direction="l", @@ -21906,7 +20730,6 @@ characters.data={ unicodeslot=0x930, }, [0x931]={ - adobename="rradeva", category="lo", description="DEVANAGARI LETTER RRA", direction="l", @@ -21916,7 +20739,6 @@ characters.data={ unicodeslot=0x931, }, [0x932]={ - adobename="ladeva", category="lo", description="DEVANAGARI LETTER LA", direction="l", @@ -21925,7 +20747,6 @@ characters.data={ unicodeslot=0x932, }, [0x933]={ - adobename="lladeva", category="lo", description="DEVANAGARI LETTER LLA", direction="l", @@ -21934,7 +20755,6 @@ characters.data={ unicodeslot=0x933, }, [0x934]={ - adobename="llladeva", category="lo", description="DEVANAGARI LETTER LLLA", direction="l", @@ -21944,7 +20764,6 @@ characters.data={ unicodeslot=0x934, }, [0x935]={ - adobename="vadeva", category="lo", description="DEVANAGARI LETTER VA", direction="l", @@ -21953,7 +20772,6 @@ characters.data={ unicodeslot=0x935, }, [0x936]={ - adobename="shadeva", category="lo", description="DEVANAGARI LETTER SHA", direction="l", @@ -21962,7 +20780,6 @@ characters.data={ unicodeslot=0x936, }, [0x937]={ - adobename="ssadeva", category="lo", description="DEVANAGARI LETTER SSA", direction="l", @@ -21971,7 +20788,6 @@ characters.data={ unicodeslot=0x937, }, [0x938]={ - adobename="sadeva", category="lo", description="DEVANAGARI LETTER SA", direction="l", @@ -21980,7 +20796,6 @@ characters.data={ unicodeslot=0x938, }, [0x939]={ - adobename="hadeva", category="lo", description="DEVANAGARI LETTER HA", direction="l", @@ -22007,7 +20822,6 @@ characters.data={ unicodeslot=0x93B, }, [0x93C]={ - adobename="nuktadeva", category="mn", combining=0x7, description="DEVANAGARI SIGN NUKTA", @@ -22019,7 +20833,6 @@ characters.data={ unicodeslot=0x93C, }, [0x93D]={ - adobename="avagrahadeva", category="lo", description="DEVANAGARI SIGN AVAGRAHA", direction="l", @@ -22028,7 +20841,6 @@ characters.data={ unicodeslot=0x93D, }, [0x93E]={ - adobename="aavowelsigndeva", category="mc", description="DEVANAGARI VOWEL SIGN AA", direction="l", @@ -22039,7 +20851,6 @@ characters.data={ unicodeslot=0x93E, }, [0x93F]={ - adobename="ivowelsigndeva", category="mc", description="DEVANAGARI VOWEL SIGN I", direction="l", @@ -22050,7 +20861,6 @@ characters.data={ unicodeslot=0x93F, }, [0x940]={ - adobename="iivowelsigndeva", category="mc", description="DEVANAGARI VOWEL SIGN II", direction="l", @@ -22061,7 +20871,6 @@ characters.data={ unicodeslot=0x940, }, [0x941]={ - adobename="uvowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN U", direction="nsm", @@ -22072,7 +20881,6 @@ characters.data={ unicodeslot=0x941, }, [0x942]={ - adobename="uuvowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN UU", direction="nsm", @@ -22083,7 +20891,6 @@ characters.data={ unicodeslot=0x942, }, [0x943]={ - adobename="rvocalicvowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN VOCALIC R", direction="nsm", @@ -22094,7 +20901,6 @@ characters.data={ unicodeslot=0x943, }, [0x944]={ - adobename="rrvocalicvowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN VOCALIC RR", direction="nsm", @@ -22105,7 +20911,6 @@ characters.data={ unicodeslot=0x944, }, [0x945]={ - adobename="ecandravowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN CANDRA E", direction="nsm", @@ -22116,7 +20921,6 @@ characters.data={ unicodeslot=0x945, }, [0x946]={ - adobename="eshortvowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN SHORT E", direction="nsm", @@ -22127,7 +20931,6 @@ characters.data={ unicodeslot=0x946, }, [0x947]={ - adobename="evowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN E", direction="nsm", @@ -22138,7 +20941,6 @@ characters.data={ unicodeslot=0x947, }, [0x948]={ - adobename="aivowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN AI", direction="nsm", @@ -22149,7 +20951,6 @@ characters.data={ unicodeslot=0x948, }, [0x949]={ - adobename="ocandravowelsigndeva", category="mc", description="DEVANAGARI VOWEL SIGN CANDRA O", direction="l", @@ -22160,7 +20961,6 @@ characters.data={ unicodeslot=0x949, }, [0x94A]={ - adobename="oshortvowelsigndeva", category="mc", description="DEVANAGARI VOWEL SIGN SHORT O", direction="l", @@ -22171,7 +20971,6 @@ characters.data={ unicodeslot=0x94A, }, [0x94B]={ - adobename="ovowelsigndeva", category="mc", description="DEVANAGARI VOWEL SIGN O", direction="l", @@ -22182,7 +20981,6 @@ characters.data={ unicodeslot=0x94B, }, [0x94C]={ - adobename="auvowelsigndeva", category="mc", description="DEVANAGARI VOWEL SIGN AU", direction="l", @@ -22193,7 +20991,6 @@ characters.data={ unicodeslot=0x94C, }, [0x94D]={ - adobename="viramadeva", category="mn", combining=0x9, description="DEVANAGARI SIGN VIRAMA", @@ -22225,7 +21022,6 @@ characters.data={ unicodeslot=0x94F, }, [0x950]={ - adobename="omdeva", category="lo", description="DEVANAGARI OM", direction="l", @@ -22234,7 +21030,6 @@ characters.data={ unicodeslot=0x950, }, [0x951]={ - adobename="udattadeva", category="mn", combining=0xE6, description="DEVANAGARI STRESS SIGN UDATTA", @@ -22245,7 +21040,6 @@ characters.data={ unicodeslot=0x951, }, [0x952]={ - adobename="anudattadeva", category="mn", combining=0xDC, description="DEVANAGARI STRESS SIGN ANUDATTA", @@ -22257,7 +21051,6 @@ characters.data={ unicodeslot=0x952, }, [0x953]={ - adobename="gravedeva", category="mn", combining=0xE6, description="DEVANAGARI GRAVE ACCENT", @@ -22268,7 +21061,6 @@ characters.data={ unicodeslot=0x953, }, [0x954]={ - adobename="acutedeva", category="mn", combining=0xE6, description="DEVANAGARI ACUTE ACCENT", @@ -22306,7 +21098,6 @@ characters.data={ unicodeslot=0x957, }, [0x958]={ - adobename="qadeva", category="lo", description="DEVANAGARI LETTER QA", direction="l", @@ -22316,7 +21107,6 @@ characters.data={ unicodeslot=0x958, }, [0x959]={ - adobename="khhadeva", category="lo", description="DEVANAGARI LETTER KHHA", direction="l", @@ -22326,7 +21116,6 @@ characters.data={ unicodeslot=0x959, }, [0x95A]={ - adobename="ghhadeva", category="lo", description="DEVANAGARI LETTER GHHA", direction="l", @@ -22336,7 +21125,6 @@ characters.data={ unicodeslot=0x95A, }, [0x95B]={ - adobename="zadeva", category="lo", description="DEVANAGARI LETTER ZA", direction="l", @@ -22346,7 +21134,6 @@ characters.data={ unicodeslot=0x95B, }, [0x95C]={ - adobename="dddhadeva", category="lo", description="DEVANAGARI LETTER DDDHA", direction="l", @@ -22356,7 +21143,6 @@ characters.data={ unicodeslot=0x95C, }, [0x95D]={ - adobename="rhadeva", category="lo", description="DEVANAGARI LETTER RHA", direction="l", @@ -22366,7 +21152,6 @@ characters.data={ unicodeslot=0x95D, }, [0x95E]={ - adobename="fadeva", category="lo", description="DEVANAGARI LETTER FA", direction="l", @@ -22376,7 +21161,6 @@ characters.data={ unicodeslot=0x95E, }, [0x95F]={ - adobename="yyadeva", category="lo", description="DEVANAGARI LETTER YYA", direction="l", @@ -22386,7 +21170,6 @@ characters.data={ unicodeslot=0x95F, }, [0x960]={ - adobename="rrvocalicdeva", category="lo", description="DEVANAGARI LETTER VOCALIC RR", direction="l", @@ -22395,7 +21178,6 @@ characters.data={ unicodeslot=0x960, }, [0x961]={ - adobename="llvocalicdeva", category="lo", description="DEVANAGARI LETTER VOCALIC LL", direction="l", @@ -22404,7 +21186,6 @@ characters.data={ unicodeslot=0x961, }, [0x962]={ - adobename="lvocalicvowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN VOCALIC L", direction="nsm", @@ -22415,7 +21196,6 @@ characters.data={ unicodeslot=0x962, }, [0x963]={ - adobename="llvocalicvowelsigndeva", category="mn", description="DEVANAGARI VOWEL SIGN VOCALIC LL", direction="nsm", @@ -22426,7 +21206,6 @@ characters.data={ unicodeslot=0x963, }, [0x964]={ - adobename="danda", category="po", description="DEVANAGARI DANDA", direction="l", @@ -22436,7 +21215,6 @@ characters.data={ unicodeslot=0x964, }, [0x965]={ - adobename="dbldanda", category="po", description="DEVANAGARI DOUBLE DANDA", direction="l", @@ -22446,7 +21224,6 @@ characters.data={ unicodeslot=0x965, }, [0x966]={ - adobename="zerodeva", category="nd", description="DEVANAGARI DIGIT ZERO", direction="l", @@ -22455,7 +21232,6 @@ characters.data={ unicodeslot=0x966, }, [0x967]={ - adobename="onedeva", category="nd", description="DEVANAGARI DIGIT ONE", direction="l", @@ -22464,7 +21240,6 @@ characters.data={ unicodeslot=0x967, }, [0x968]={ - adobename="twodeva", category="nd", description="DEVANAGARI DIGIT TWO", direction="l", @@ -22473,7 +21248,6 @@ characters.data={ unicodeslot=0x968, }, [0x969]={ - adobename="threedeva", category="nd", description="DEVANAGARI DIGIT THREE", direction="l", @@ -22482,7 +21256,6 @@ characters.data={ unicodeslot=0x969, }, [0x96A]={ - adobename="fourdeva", category="nd", description="DEVANAGARI DIGIT FOUR", direction="l", @@ -22491,7 +21264,6 @@ characters.data={ unicodeslot=0x96A, }, [0x96B]={ - adobename="fivedeva", category="nd", description="DEVANAGARI DIGIT FIVE", direction="l", @@ -22500,7 +21272,6 @@ characters.data={ unicodeslot=0x96B, }, [0x96C]={ - adobename="sixdeva", category="nd", description="DEVANAGARI DIGIT SIX", direction="l", @@ -22509,7 +21280,6 @@ characters.data={ unicodeslot=0x96C, }, [0x96D]={ - adobename="sevendeva", category="nd", description="DEVANAGARI DIGIT SEVEN", direction="l", @@ -22518,7 +21288,6 @@ characters.data={ unicodeslot=0x96D, }, [0x96E]={ - adobename="eightdeva", category="nd", description="DEVANAGARI DIGIT EIGHT", direction="l", @@ -22527,7 +21296,6 @@ characters.data={ unicodeslot=0x96E, }, [0x96F]={ - adobename="ninedeva", category="nd", description="DEVANAGARI DIGIT NINE", direction="l", @@ -22536,7 +21304,6 @@ characters.data={ unicodeslot=0x96F, }, [0x970]={ - adobename="abbreviationsigndeva", category="po", description="DEVANAGARI ABBREVIATION SIGN", direction="l", @@ -22673,7 +21440,6 @@ characters.data={ unicodeslot=0x980, }, [0x981]={ - adobename="candrabindubengali", category="mn", description="BENGALI SIGN CANDRABINDU", direction="nsm", @@ -22683,7 +21449,6 @@ characters.data={ unicodeslot=0x981, }, [0x982]={ - adobename="anusvarabengali", category="mc", description="BENGALI SIGN ANUSVARA", direction="l", @@ -22692,7 +21457,6 @@ characters.data={ unicodeslot=0x982, }, [0x983]={ - adobename="visargabengali", category="mc", description="BENGALI SIGN VISARGA", direction="l", @@ -22701,7 +21465,6 @@ characters.data={ unicodeslot=0x983, }, [0x985]={ - adobename="abengali", category="lo", description="BENGALI LETTER A", direction="l", @@ -22710,7 +21473,6 @@ characters.data={ unicodeslot=0x985, }, [0x986]={ - adobename="aabengali", category="lo", description="BENGALI LETTER AA", direction="l", @@ -22719,7 +21481,6 @@ characters.data={ unicodeslot=0x986, }, [0x987]={ - adobename="ibengali", category="lo", description="BENGALI LETTER I", direction="l", @@ -22728,7 +21489,6 @@ characters.data={ unicodeslot=0x987, }, [0x988]={ - adobename="iibengali", category="lo", description="BENGALI LETTER II", direction="l", @@ -22737,7 +21497,6 @@ characters.data={ unicodeslot=0x988, }, [0x989]={ - adobename="ubengali", category="lo", description="BENGALI LETTER U", direction="l", @@ -22746,7 +21505,6 @@ characters.data={ unicodeslot=0x989, }, [0x98A]={ - adobename="uubengali", category="lo", description="BENGALI LETTER UU", direction="l", @@ -22755,7 +21513,6 @@ characters.data={ unicodeslot=0x98A, }, [0x98B]={ - adobename="rvocalicbengali", category="lo", description="BENGALI LETTER VOCALIC R", direction="l", @@ -22764,7 +21521,6 @@ characters.data={ unicodeslot=0x98B, }, [0x98C]={ - adobename="lvocalicbengali", category="lo", description="BENGALI LETTER VOCALIC L", direction="l", @@ -22773,7 +21529,6 @@ characters.data={ unicodeslot=0x98C, }, [0x98F]={ - adobename="ebengali", category="lo", description="BENGALI LETTER E", direction="l", @@ -22782,7 +21537,6 @@ characters.data={ unicodeslot=0x98F, }, [0x990]={ - adobename="aibengali", category="lo", description="BENGALI LETTER AI", direction="l", @@ -22791,7 +21545,6 @@ characters.data={ unicodeslot=0x990, }, [0x993]={ - adobename="obengali", category="lo", description="BENGALI LETTER O", direction="l", @@ -22800,7 +21553,6 @@ characters.data={ unicodeslot=0x993, }, [0x994]={ - adobename="aubengali", category="lo", description="BENGALI LETTER AU", direction="l", @@ -22809,7 +21561,6 @@ characters.data={ unicodeslot=0x994, }, [0x995]={ - adobename="kabengali", category="lo", description="BENGALI LETTER KA", direction="l", @@ -22818,7 +21569,6 @@ characters.data={ unicodeslot=0x995, }, [0x996]={ - adobename="khabengali", category="lo", description="BENGALI LETTER KHA", direction="l", @@ -22827,7 +21577,6 @@ characters.data={ unicodeslot=0x996, }, [0x997]={ - adobename="gabengali", category="lo", description="BENGALI LETTER GA", direction="l", @@ -22836,7 +21585,6 @@ characters.data={ unicodeslot=0x997, }, [0x998]={ - adobename="ghabengali", category="lo", description="BENGALI LETTER GHA", direction="l", @@ -22845,7 +21593,6 @@ characters.data={ unicodeslot=0x998, }, [0x999]={ - adobename="ngabengali", category="lo", description="BENGALI LETTER NGA", direction="l", @@ -22854,7 +21601,6 @@ characters.data={ unicodeslot=0x999, }, [0x99A]={ - adobename="cabengali", category="lo", description="BENGALI LETTER CA", direction="l", @@ -22863,7 +21609,6 @@ characters.data={ unicodeslot=0x99A, }, [0x99B]={ - adobename="chabengali", category="lo", description="BENGALI LETTER CHA", direction="l", @@ -22872,7 +21617,6 @@ characters.data={ unicodeslot=0x99B, }, [0x99C]={ - adobename="jabengali", category="lo", description="BENGALI LETTER JA", direction="l", @@ -22881,7 +21625,6 @@ characters.data={ unicodeslot=0x99C, }, [0x99D]={ - adobename="jhabengali", category="lo", description="BENGALI LETTER JHA", direction="l", @@ -22890,7 +21633,6 @@ characters.data={ unicodeslot=0x99D, }, [0x99E]={ - adobename="nyabengali", category="lo", description="BENGALI LETTER NYA", direction="l", @@ -22899,7 +21641,6 @@ characters.data={ unicodeslot=0x99E, }, [0x99F]={ - adobename="ttabengali", category="lo", description="BENGALI LETTER TTA", direction="l", @@ -22908,7 +21649,6 @@ characters.data={ unicodeslot=0x99F, }, [0x9A0]={ - adobename="tthabengali", category="lo", description="BENGALI LETTER TTHA", direction="l", @@ -22917,7 +21657,6 @@ characters.data={ unicodeslot=0x9A0, }, [0x9A1]={ - adobename="ddabengali", category="lo", description="BENGALI LETTER DDA", direction="l", @@ -22926,7 +21665,6 @@ characters.data={ unicodeslot=0x9A1, }, [0x9A2]={ - adobename="ddhabengali", category="lo", description="BENGALI LETTER DDHA", direction="l", @@ -22935,7 +21673,6 @@ characters.data={ unicodeslot=0x9A2, }, [0x9A3]={ - adobename="nnabengali", category="lo", description="BENGALI LETTER NNA", direction="l", @@ -22944,7 +21681,6 @@ characters.data={ unicodeslot=0x9A3, }, [0x9A4]={ - adobename="tabengali", category="lo", description="BENGALI LETTER TA", direction="l", @@ -22953,7 +21689,6 @@ characters.data={ unicodeslot=0x9A4, }, [0x9A5]={ - adobename="thabengali", category="lo", description="BENGALI LETTER THA", direction="l", @@ -22962,7 +21697,6 @@ characters.data={ unicodeslot=0x9A5, }, [0x9A6]={ - adobename="dabengali", category="lo", description="BENGALI LETTER DA", direction="l", @@ -22971,7 +21705,6 @@ characters.data={ unicodeslot=0x9A6, }, [0x9A7]={ - adobename="dhabengali", category="lo", description="BENGALI LETTER DHA", direction="l", @@ -22980,7 +21713,6 @@ characters.data={ unicodeslot=0x9A7, }, [0x9A8]={ - adobename="nabengali", category="lo", description="BENGALI LETTER NA", direction="l", @@ -22989,7 +21721,6 @@ characters.data={ unicodeslot=0x9A8, }, [0x9AA]={ - adobename="pabengali", category="lo", description="BENGALI LETTER PA", direction="l", @@ -22998,7 +21729,6 @@ characters.data={ unicodeslot=0x9AA, }, [0x9AB]={ - adobename="phabengali", category="lo", description="BENGALI LETTER PHA", direction="l", @@ -23007,7 +21737,6 @@ characters.data={ unicodeslot=0x9AB, }, [0x9AC]={ - adobename="babengali", category="lo", description="BENGALI LETTER BA", direction="l", @@ -23016,7 +21745,6 @@ characters.data={ unicodeslot=0x9AC, }, [0x9AD]={ - adobename="bhabengali", category="lo", description="BENGALI LETTER BHA", direction="l", @@ -23025,7 +21753,6 @@ characters.data={ unicodeslot=0x9AD, }, [0x9AE]={ - adobename="mabengali", category="lo", description="BENGALI LETTER MA", direction="l", @@ -23034,7 +21761,6 @@ characters.data={ unicodeslot=0x9AE, }, [0x9AF]={ - adobename="yabengali", category="lo", description="BENGALI LETTER YA", direction="l", @@ -23043,7 +21769,6 @@ characters.data={ unicodeslot=0x9AF, }, [0x9B0]={ - adobename="rabengali", category="lo", description="BENGALI LETTER RA", direction="l", @@ -23054,7 +21779,6 @@ characters.data={ unicodeslot=0x9B0, }, [0x9B2]={ - adobename="labengali", category="lo", description="BENGALI LETTER LA", direction="l", @@ -23063,7 +21787,6 @@ characters.data={ unicodeslot=0x9B2, }, [0x9B6]={ - adobename="shabengali", category="lo", description="BENGALI LETTER SHA", direction="l", @@ -23072,7 +21795,6 @@ characters.data={ unicodeslot=0x9B6, }, [0x9B7]={ - adobename="ssabengali", category="lo", description="BENGALI LETTER SSA", direction="l", @@ -23081,7 +21803,6 @@ characters.data={ unicodeslot=0x9B7, }, [0x9B8]={ - adobename="sabengali", category="lo", description="BENGALI LETTER SA", direction="l", @@ -23090,7 +21811,6 @@ characters.data={ unicodeslot=0x9B8, }, [0x9B9]={ - adobename="habengali", category="lo", description="BENGALI LETTER HA", direction="l", @@ -23099,7 +21819,6 @@ characters.data={ unicodeslot=0x9B9, }, [0x9BC]={ - adobename="nuktabengali", category="mn", combining=0x7, description="BENGALI SIGN NUKTA", @@ -23119,7 +21838,6 @@ characters.data={ unicodeslot=0x9BD, }, [0x9BE]={ - adobename="aavowelsignbengali", category="mc", description="BENGALI VOWEL SIGN AA", direction="l", @@ -23130,7 +21848,6 @@ characters.data={ unicodeslot=0x9BE, }, [0x9BF]={ - adobename="ivowelsignbengali", category="mc", description="BENGALI VOWEL SIGN I", direction="l", @@ -23141,7 +21858,6 @@ characters.data={ unicodeslot=0x9BF, }, [0x9C0]={ - adobename="iivowelsignbengali", category="mc", description="BENGALI VOWEL SIGN II", direction="l", @@ -23152,7 +21868,6 @@ characters.data={ unicodeslot=0x9C0, }, [0x9C1]={ - adobename="uvowelsignbengali", category="mn", description="BENGALI VOWEL SIGN U", direction="nsm", @@ -23163,7 +21878,6 @@ characters.data={ unicodeslot=0x9C1, }, [0x9C2]={ - adobename="uuvowelsignbengali", category="mn", description="BENGALI VOWEL SIGN UU", direction="nsm", @@ -23174,7 +21888,6 @@ characters.data={ unicodeslot=0x9C2, }, [0x9C3]={ - adobename="rvocalicvowelsignbengali", category="mn", description="BENGALI VOWEL SIGN VOCALIC R", direction="nsm", @@ -23185,7 +21898,6 @@ characters.data={ unicodeslot=0x9C3, }, [0x9C4]={ - adobename="rrvocalicvowelsignbengali", category="mn", description="BENGALI VOWEL SIGN VOCALIC RR", direction="nsm", @@ -23196,7 +21908,6 @@ characters.data={ unicodeslot=0x9C4, }, [0x9C7]={ - adobename="evowelsignbengali", category="mc", description="BENGALI VOWEL SIGN E", direction="l", @@ -23207,7 +21918,6 @@ characters.data={ unicodeslot=0x9C7, }, [0x9C8]={ - adobename="aivowelsignbengali", category="mc", description="BENGALI VOWEL SIGN AI", direction="l", @@ -23217,7 +21927,6 @@ characters.data={ unicodeslot=0x9C8, }, [0x9CB]={ - adobename="ovowelsignbengali", category="mc", description="BENGALI VOWEL SIGN O", direction="l", @@ -23228,7 +21937,6 @@ characters.data={ unicodeslot=0x9CB, }, [0x9CC]={ - adobename="auvowelsignbengali", category="mc", description="BENGALI VOWEL SIGN AU", direction="l", @@ -23239,7 +21947,6 @@ characters.data={ unicodeslot=0x9CC, }, [0x9CD]={ - adobename="viramabengali", category="mn", combining=0x9, description="BENGALI SIGN VIRAMA", @@ -23261,7 +21968,6 @@ characters.data={ unicodeslot=0x9CE, }, [0x9D7]={ - adobename="aulengthmarkbengali", category="mc", description="BENGALI AU LENGTH MARK", direction="l", @@ -23272,7 +21978,6 @@ characters.data={ unicodeslot=0x9D7, }, [0x9DC]={ - adobename="rrabengali", category="lo", description="BENGALI LETTER RRA", direction="l", @@ -23282,7 +21987,6 @@ characters.data={ unicodeslot=0x9DC, }, [0x9DD]={ - adobename="rhabengali", category="lo", description="BENGALI LETTER RHA", direction="l", @@ -23292,7 +21996,6 @@ characters.data={ unicodeslot=0x9DD, }, [0x9DF]={ - adobename="yyabengali", category="lo", description="BENGALI LETTER YYA", direction="l", @@ -23302,7 +22005,6 @@ characters.data={ unicodeslot=0x9DF, }, [0x9E0]={ - adobename="rrvocalicbengali", category="lo", description="BENGALI LETTER VOCALIC RR", direction="l", @@ -23311,7 +22013,6 @@ characters.data={ unicodeslot=0x9E0, }, [0x9E1]={ - adobename="llvocalicbengali", category="lo", description="BENGALI LETTER VOCALIC LL", direction="l", @@ -23320,7 +22021,6 @@ characters.data={ unicodeslot=0x9E1, }, [0x9E2]={ - adobename="lvocalicvowelsignbengali", category="mn", description="BENGALI VOWEL SIGN VOCALIC L", direction="nsm", @@ -23330,7 +22030,6 @@ characters.data={ unicodeslot=0x9E2, }, [0x9E3]={ - adobename="llvocalicvowelsignbengali", category="mn", description="BENGALI VOWEL SIGN VOCALIC LL", direction="nsm", @@ -23340,7 +22039,6 @@ characters.data={ unicodeslot=0x9E3, }, [0x9E6]={ - adobename="zerobengali", category="nd", description="BENGALI DIGIT ZERO", direction="l", @@ -23349,7 +22047,6 @@ characters.data={ unicodeslot=0x9E6, }, [0x9E7]={ - adobename="onebengali", category="nd", description="BENGALI DIGIT ONE", direction="l", @@ -23358,7 +22055,6 @@ characters.data={ unicodeslot=0x9E7, }, [0x9E8]={ - adobename="twobengali", category="nd", description="BENGALI DIGIT TWO", direction="l", @@ -23367,7 +22063,6 @@ characters.data={ unicodeslot=0x9E8, }, [0x9E9]={ - adobename="threebengali", category="nd", description="BENGALI DIGIT THREE", direction="l", @@ -23376,7 +22071,6 @@ characters.data={ unicodeslot=0x9E9, }, [0x9EA]={ - adobename="fourbengali", category="nd", description="BENGALI DIGIT FOUR", direction="l", @@ -23385,7 +22079,6 @@ characters.data={ unicodeslot=0x9EA, }, [0x9EB]={ - adobename="fivebengali", category="nd", description="BENGALI DIGIT FIVE", direction="l", @@ -23394,7 +22087,6 @@ characters.data={ unicodeslot=0x9EB, }, [0x9EC]={ - adobename="sixbengali", category="nd", description="BENGALI DIGIT SIX", direction="l", @@ -23403,7 +22095,6 @@ characters.data={ unicodeslot=0x9EC, }, [0x9ED]={ - adobename="sevenbengali", category="nd", description="BENGALI DIGIT SEVEN", direction="l", @@ -23412,7 +22103,6 @@ characters.data={ unicodeslot=0x9ED, }, [0x9EE]={ - adobename="eightbengali", category="nd", description="BENGALI DIGIT EIGHT", direction="l", @@ -23421,7 +22111,6 @@ characters.data={ unicodeslot=0x9EE, }, [0x9EF]={ - adobename="ninebengali", category="nd", description="BENGALI DIGIT NINE", direction="l", @@ -23430,7 +22119,6 @@ characters.data={ unicodeslot=0x9EF, }, [0x9F0]={ - adobename="ramiddlediagonalbengali", category="lo", description="BENGALI LETTER RA WITH MIDDLE DIAGONAL", direction="l", @@ -23442,7 +22130,6 @@ characters.data={ unicodeslot=0x9F0, }, [0x9F1]={ - adobename="ralowerdiagonalbengali", category="lo", description="BENGALI LETTER RA WITH LOWER DIAGONAL", direction="l", @@ -23452,7 +22139,6 @@ characters.data={ unicodeslot=0x9F1, }, [0x9F2]={ - adobename="rupeemarkbengali", category="sc", description="BENGALI RUPEE MARK", direction="et", @@ -23461,7 +22147,6 @@ characters.data={ unicodeslot=0x9F2, }, [0x9F3]={ - adobename="rupeesignbengali", category="sc", description="BENGALI RUPEE SIGN", direction="et", @@ -23470,7 +22155,6 @@ characters.data={ unicodeslot=0x9F3, }, [0x9F4]={ - adobename="onenumeratorbengali", category="no", description="BENGALI CURRENCY NUMERATOR ONE", direction="l", @@ -23479,7 +22163,6 @@ characters.data={ unicodeslot=0x9F4, }, [0x9F5]={ - adobename="twonumeratorbengali", category="no", description="BENGALI CURRENCY NUMERATOR TWO", direction="l", @@ -23488,7 +22171,6 @@ characters.data={ unicodeslot=0x9F5, }, [0x9F6]={ - adobename="threenumeratorbengali", category="no", description="BENGALI CURRENCY NUMERATOR THREE", direction="l", @@ -23497,7 +22179,6 @@ characters.data={ unicodeslot=0x9F6, }, [0x9F7]={ - adobename="fournumeratorbengali", category="no", description="BENGALI CURRENCY NUMERATOR FOUR", direction="l", @@ -23506,7 +22187,6 @@ characters.data={ unicodeslot=0x9F7, }, [0x9F8]={ - adobename="denominatorminusonenumeratorbengali", category="no", description="BENGALI CURRENCY NUMERATOR ONE LESS THAN THE DENOMINATOR", direction="l", @@ -23515,7 +22195,6 @@ characters.data={ unicodeslot=0x9F8, }, [0x9F9]={ - adobename="sixteencurrencydenominatorbengali", category="no", description="BENGALI CURRENCY DENOMINATOR SIXTEEN", direction="l", @@ -23524,7 +22203,6 @@ characters.data={ unicodeslot=0x9F9, }, [0x9FA]={ - adobename="issharbengali", category="so", description="BENGALI ISSHAR", direction="l", @@ -23574,7 +22252,6 @@ characters.data={ unicodeslot=0xA01, }, [0xA02]={ - adobename="bindigurmukhi", category="mn", description="GURMUKHI SIGN BINDI", direction="nsm", @@ -23592,7 +22269,6 @@ characters.data={ unicodeslot=0xA03, }, [0xA05]={ - adobename="agurmukhi", category="lo", description="GURMUKHI LETTER A", direction="l", @@ -23601,7 +22277,6 @@ characters.data={ unicodeslot=0xA05, }, [0xA06]={ - adobename="aagurmukhi", category="lo", description="GURMUKHI LETTER AA", direction="l", @@ -23610,7 +22285,6 @@ characters.data={ unicodeslot=0xA06, }, [0xA07]={ - adobename="igurmukhi", category="lo", description="GURMUKHI LETTER I", direction="l", @@ -23619,7 +22293,6 @@ characters.data={ unicodeslot=0xA07, }, [0xA08]={ - adobename="iigurmukhi", category="lo", description="GURMUKHI LETTER II", direction="l", @@ -23628,7 +22301,6 @@ characters.data={ unicodeslot=0xA08, }, [0xA09]={ - adobename="ugurmukhi", category="lo", description="GURMUKHI LETTER U", direction="l", @@ -23637,7 +22309,6 @@ characters.data={ unicodeslot=0xA09, }, [0xA0A]={ - adobename="uugurmukhi", category="lo", description="GURMUKHI LETTER UU", direction="l", @@ -23646,7 +22317,6 @@ characters.data={ unicodeslot=0xA0A, }, [0xA0F]={ - adobename="eegurmukhi", category="lo", description="GURMUKHI LETTER EE", direction="l", @@ -23655,7 +22325,6 @@ characters.data={ unicodeslot=0xA0F, }, [0xA10]={ - adobename="aigurmukhi", category="lo", description="GURMUKHI LETTER AI", direction="l", @@ -23664,7 +22333,6 @@ characters.data={ unicodeslot=0xA10, }, [0xA13]={ - adobename="oogurmukhi", category="lo", description="GURMUKHI LETTER OO", direction="l", @@ -23673,7 +22341,6 @@ characters.data={ unicodeslot=0xA13, }, [0xA14]={ - adobename="augurmukhi", category="lo", description="GURMUKHI LETTER AU", direction="l", @@ -23682,7 +22349,6 @@ characters.data={ unicodeslot=0xA14, }, [0xA15]={ - adobename="kagurmukhi", category="lo", description="GURMUKHI LETTER KA", direction="l", @@ -23691,7 +22357,6 @@ characters.data={ unicodeslot=0xA15, }, [0xA16]={ - adobename="khagurmukhi", category="lo", description="GURMUKHI LETTER KHA", direction="l", @@ -23700,7 +22365,6 @@ characters.data={ unicodeslot=0xA16, }, [0xA17]={ - adobename="gagurmukhi", category="lo", description="GURMUKHI LETTER GA", direction="l", @@ -23709,7 +22373,6 @@ characters.data={ unicodeslot=0xA17, }, [0xA18]={ - adobename="ghagurmukhi", category="lo", description="GURMUKHI LETTER GHA", direction="l", @@ -23718,7 +22381,6 @@ characters.data={ unicodeslot=0xA18, }, [0xA19]={ - adobename="ngagurmukhi", category="lo", description="GURMUKHI LETTER NGA", direction="l", @@ -23727,7 +22389,6 @@ characters.data={ unicodeslot=0xA19, }, [0xA1A]={ - adobename="cagurmukhi", category="lo", description="GURMUKHI LETTER CA", direction="l", @@ -23736,7 +22397,6 @@ characters.data={ unicodeslot=0xA1A, }, [0xA1B]={ - adobename="chagurmukhi", category="lo", description="GURMUKHI LETTER CHA", direction="l", @@ -23745,7 +22405,6 @@ characters.data={ unicodeslot=0xA1B, }, [0xA1C]={ - adobename="jagurmukhi", category="lo", description="GURMUKHI LETTER JA", direction="l", @@ -23754,7 +22413,6 @@ characters.data={ unicodeslot=0xA1C, }, [0xA1D]={ - adobename="jhagurmukhi", category="lo", description="GURMUKHI LETTER JHA", direction="l", @@ -23763,7 +22421,6 @@ characters.data={ unicodeslot=0xA1D, }, [0xA1E]={ - adobename="nyagurmukhi", category="lo", description="GURMUKHI LETTER NYA", direction="l", @@ -23772,7 +22429,6 @@ characters.data={ unicodeslot=0xA1E, }, [0xA1F]={ - adobename="ttagurmukhi", category="lo", description="GURMUKHI LETTER TTA", direction="l", @@ -23781,7 +22437,6 @@ characters.data={ unicodeslot=0xA1F, }, [0xA20]={ - adobename="tthagurmukhi", category="lo", description="GURMUKHI LETTER TTHA", direction="l", @@ -23790,7 +22445,6 @@ characters.data={ unicodeslot=0xA20, }, [0xA21]={ - adobename="ddagurmukhi", category="lo", description="GURMUKHI LETTER DDA", direction="l", @@ -23799,7 +22453,6 @@ characters.data={ unicodeslot=0xA21, }, [0xA22]={ - adobename="ddhagurmukhi", category="lo", description="GURMUKHI LETTER DDHA", direction="l", @@ -23808,7 +22461,6 @@ characters.data={ unicodeslot=0xA22, }, [0xA23]={ - adobename="nnagurmukhi", category="lo", description="GURMUKHI LETTER NNA", direction="l", @@ -23817,7 +22469,6 @@ characters.data={ unicodeslot=0xA23, }, [0xA24]={ - adobename="tagurmukhi", category="lo", description="GURMUKHI LETTER TA", direction="l", @@ -23826,7 +22477,6 @@ characters.data={ unicodeslot=0xA24, }, [0xA25]={ - adobename="thagurmukhi", category="lo", description="GURMUKHI LETTER THA", direction="l", @@ -23835,7 +22485,6 @@ characters.data={ unicodeslot=0xA25, }, [0xA26]={ - adobename="dagurmukhi", category="lo", description="GURMUKHI LETTER DA", direction="l", @@ -23844,7 +22493,6 @@ characters.data={ unicodeslot=0xA26, }, [0xA27]={ - adobename="dhagurmukhi", category="lo", description="GURMUKHI LETTER DHA", direction="l", @@ -23853,7 +22501,6 @@ characters.data={ unicodeslot=0xA27, }, [0xA28]={ - adobename="nagurmukhi", category="lo", description="GURMUKHI LETTER NA", direction="l", @@ -23862,7 +22509,6 @@ characters.data={ unicodeslot=0xA28, }, [0xA2A]={ - adobename="pagurmukhi", category="lo", description="GURMUKHI LETTER PA", direction="l", @@ -23871,7 +22517,6 @@ characters.data={ unicodeslot=0xA2A, }, [0xA2B]={ - adobename="phagurmukhi", category="lo", description="GURMUKHI LETTER PHA", direction="l", @@ -23880,7 +22525,6 @@ characters.data={ unicodeslot=0xA2B, }, [0xA2C]={ - adobename="bagurmukhi", category="lo", description="GURMUKHI LETTER BA", direction="l", @@ -23889,7 +22533,6 @@ characters.data={ unicodeslot=0xA2C, }, [0xA2D]={ - adobename="bhagurmukhi", category="lo", description="GURMUKHI LETTER BHA", direction="l", @@ -23898,7 +22541,6 @@ characters.data={ unicodeslot=0xA2D, }, [0xA2E]={ - adobename="magurmukhi", category="lo", description="GURMUKHI LETTER MA", direction="l", @@ -23907,7 +22549,6 @@ characters.data={ unicodeslot=0xA2E, }, [0xA2F]={ - adobename="yagurmukhi", category="lo", description="GURMUKHI LETTER YA", direction="l", @@ -23916,7 +22557,6 @@ characters.data={ unicodeslot=0xA2F, }, [0xA30]={ - adobename="ragurmukhi", category="lo", description="GURMUKHI LETTER RA", direction="l", @@ -23927,7 +22567,6 @@ characters.data={ unicodeslot=0xA30, }, [0xA32]={ - adobename="lagurmukhi", category="lo", description="GURMUKHI LETTER LA", direction="l", @@ -23945,7 +22584,6 @@ characters.data={ unicodeslot=0xA33, }, [0xA35]={ - adobename="vagurmukhi", category="lo", description="GURMUKHI LETTER VA", direction="l", @@ -23954,7 +22592,6 @@ characters.data={ unicodeslot=0xA35, }, [0xA36]={ - adobename="shagurmukhi", category="lo", description="GURMUKHI LETTER SHA", direction="l", @@ -23964,7 +22601,6 @@ characters.data={ unicodeslot=0xA36, }, [0xA38]={ - adobename="sagurmukhi", category="lo", description="GURMUKHI LETTER SA", direction="l", @@ -23973,7 +22609,6 @@ characters.data={ unicodeslot=0xA38, }, [0xA39]={ - adobename="hagurmukhi", category="lo", description="GURMUKHI LETTER HA", direction="l", @@ -23982,7 +22617,6 @@ characters.data={ unicodeslot=0xA39, }, [0xA3C]={ - adobename="nuktagurmukhi", category="mn", combining=0x7, description="GURMUKHI SIGN NUKTA", @@ -23994,7 +22628,6 @@ characters.data={ unicodeslot=0xA3C, }, [0xA3E]={ - adobename="aamatragurmukhi", category="mc", description="GURMUKHI VOWEL SIGN AA", direction="l", @@ -24005,7 +22638,6 @@ characters.data={ unicodeslot=0xA3E, }, [0xA3F]={ - adobename="imatragurmukhi", category="mc", description="GURMUKHI VOWEL SIGN I", direction="l", @@ -24016,7 +22648,6 @@ characters.data={ unicodeslot=0xA3F, }, [0xA40]={ - adobename="iimatragurmukhi", category="mc", description="GURMUKHI VOWEL SIGN II", direction="l", @@ -24027,7 +22658,6 @@ characters.data={ unicodeslot=0xA40, }, [0xA41]={ - adobename="umatragurmukhi", category="mn", description="GURMUKHI VOWEL SIGN U", direction="nsm", @@ -24038,7 +22668,6 @@ characters.data={ unicodeslot=0xA41, }, [0xA42]={ - adobename="uumatragurmukhi", category="mn", description="GURMUKHI VOWEL SIGN UU", direction="nsm", @@ -24049,7 +22678,6 @@ characters.data={ unicodeslot=0xA42, }, [0xA47]={ - adobename="eematragurmukhi", category="mn", description="GURMUKHI VOWEL SIGN EE", direction="nsm", @@ -24060,7 +22688,6 @@ characters.data={ unicodeslot=0xA47, }, [0xA48]={ - adobename="aimatragurmukhi", category="mn", description="GURMUKHI VOWEL SIGN AI", direction="nsm", @@ -24071,7 +22698,6 @@ characters.data={ unicodeslot=0xA48, }, [0xA4B]={ - adobename="oomatragurmukhi", category="mn", description="GURMUKHI VOWEL SIGN OO", direction="nsm", @@ -24082,7 +22708,6 @@ characters.data={ unicodeslot=0xA4B, }, [0xA4C]={ - adobename="aumatragurmukhi", category="mn", description="GURMUKHI VOWEL SIGN AU", direction="nsm", @@ -24093,7 +22718,6 @@ characters.data={ unicodeslot=0xA4C, }, [0xA4D]={ - adobename="halantgurmukhi", category="mn", combining=0x9, description="GURMUKHI SIGN VIRAMA", @@ -24113,7 +22737,6 @@ characters.data={ unicodeslot=0xA51, }, [0xA59]={ - adobename="khhagurmukhi", category="lo", description="GURMUKHI LETTER KHHA", direction="l", @@ -24123,7 +22746,6 @@ characters.data={ unicodeslot=0xA59, }, [0xA5A]={ - adobename="ghhagurmukhi", category="lo", description="GURMUKHI LETTER GHHA", direction="l", @@ -24133,7 +22755,6 @@ characters.data={ unicodeslot=0xA5A, }, [0xA5B]={ - adobename="zagurmukhi", category="lo", description="GURMUKHI LETTER ZA", direction="l", @@ -24143,7 +22764,6 @@ characters.data={ unicodeslot=0xA5B, }, [0xA5C]={ - adobename="rragurmukhi", category="lo", description="GURMUKHI LETTER RRA", direction="l", @@ -24152,7 +22772,6 @@ characters.data={ unicodeslot=0xA5C, }, [0xA5E]={ - adobename="fagurmukhi", category="lo", description="GURMUKHI LETTER FA", direction="l", @@ -24162,7 +22781,6 @@ characters.data={ unicodeslot=0xA5E, }, [0xA66]={ - adobename="zerogurmukhi", category="nd", description="GURMUKHI DIGIT ZERO", direction="l", @@ -24171,7 +22789,6 @@ characters.data={ unicodeslot=0xA66, }, [0xA67]={ - adobename="onegurmukhi", category="nd", description="GURMUKHI DIGIT ONE", direction="l", @@ -24180,7 +22797,6 @@ characters.data={ unicodeslot=0xA67, }, [0xA68]={ - adobename="twogurmukhi", category="nd", description="GURMUKHI DIGIT TWO", direction="l", @@ -24189,7 +22805,6 @@ characters.data={ unicodeslot=0xA68, }, [0xA69]={ - adobename="threegurmukhi", category="nd", description="GURMUKHI DIGIT THREE", direction="l", @@ -24198,7 +22813,6 @@ characters.data={ unicodeslot=0xA69, }, [0xA6A]={ - adobename="fourgurmukhi", category="nd", description="GURMUKHI DIGIT FOUR", direction="l", @@ -24207,7 +22821,6 @@ characters.data={ unicodeslot=0xA6A, }, [0xA6B]={ - adobename="fivegurmukhi", category="nd", description="GURMUKHI DIGIT FIVE", direction="l", @@ -24216,7 +22829,6 @@ characters.data={ unicodeslot=0xA6B, }, [0xA6C]={ - adobename="sixgurmukhi", category="nd", description="GURMUKHI DIGIT SIX", direction="l", @@ -24225,7 +22837,6 @@ characters.data={ unicodeslot=0xA6C, }, [0xA6D]={ - adobename="sevengurmukhi", category="nd", description="GURMUKHI DIGIT SEVEN", direction="l", @@ -24234,7 +22845,6 @@ characters.data={ unicodeslot=0xA6D, }, [0xA6E]={ - adobename="eightgurmukhi", category="nd", description="GURMUKHI DIGIT EIGHT", direction="l", @@ -24243,7 +22853,6 @@ characters.data={ unicodeslot=0xA6E, }, [0xA6F]={ - adobename="ninegurmukhi", category="nd", description="GURMUKHI DIGIT NINE", direction="l", @@ -24252,7 +22861,6 @@ characters.data={ unicodeslot=0xA6F, }, [0xA70]={ - adobename="tippigurmukhi", category="mn", description="GURMUKHI TIPPI", direction="nsm", @@ -24262,7 +22870,6 @@ characters.data={ unicodeslot=0xA70, }, [0xA71]={ - adobename="addakgurmukhi", category="mn", description="GURMUKHI ADDAK", direction="nsm", @@ -24272,7 +22879,6 @@ characters.data={ unicodeslot=0xA71, }, [0xA72]={ - adobename="irigurmukhi", category="lo", description="GURMUKHI IRI", direction="l", @@ -24281,7 +22887,6 @@ characters.data={ unicodeslot=0xA72, }, [0xA73]={ - adobename="uragurmukhi", category="lo", description="GURMUKHI URA", direction="l", @@ -24290,7 +22895,6 @@ characters.data={ unicodeslot=0xA73, }, [0xA74]={ - adobename="ekonkargurmukhi", category="lo", description="GURMUKHI EK ONKAR", direction="l", @@ -24314,7 +22918,6 @@ characters.data={ unicodeslot=0xA76, }, [0xA81]={ - adobename="candrabindugujarati", category="mn", description="GUJARATI SIGN CANDRABINDU", direction="nsm", @@ -24323,7 +22926,6 @@ characters.data={ unicodeslot=0xA81, }, [0xA82]={ - adobename="anusvaragujarati", category="mn", description="GUJARATI SIGN ANUSVARA", direction="nsm", @@ -24333,7 +22935,6 @@ characters.data={ unicodeslot=0xA82, }, [0xA83]={ - adobename="visargagujarati", category="mc", description="GUJARATI SIGN VISARGA", direction="l", @@ -24342,7 +22943,6 @@ characters.data={ unicodeslot=0xA83, }, [0xA85]={ - adobename="agujarati", category="lo", description="GUJARATI LETTER A", direction="l", @@ -24351,7 +22951,6 @@ characters.data={ unicodeslot=0xA85, }, [0xA86]={ - adobename="aagujarati", category="lo", description="GUJARATI LETTER AA", direction="l", @@ -24360,7 +22959,6 @@ characters.data={ unicodeslot=0xA86, }, [0xA87]={ - adobename="igujarati", category="lo", description="GUJARATI LETTER I", direction="l", @@ -24369,7 +22967,6 @@ characters.data={ unicodeslot=0xA87, }, [0xA88]={ - adobename="iigujarati", category="lo", description="GUJARATI LETTER II", direction="l", @@ -24378,7 +22975,6 @@ characters.data={ unicodeslot=0xA88, }, [0xA89]={ - adobename="ugujarati", category="lo", description="GUJARATI LETTER U", direction="l", @@ -24387,7 +22983,6 @@ characters.data={ unicodeslot=0xA89, }, [0xA8A]={ - adobename="uugujarati", category="lo", description="GUJARATI LETTER UU", direction="l", @@ -24396,7 +22991,6 @@ characters.data={ unicodeslot=0xA8A, }, [0xA8B]={ - adobename="rvocalicgujarati", category="lo", description="GUJARATI LETTER VOCALIC R", direction="l", @@ -24413,7 +23007,6 @@ characters.data={ unicodeslot=0xA8C, }, [0xA8D]={ - adobename="ecandragujarati", category="lo", description="GUJARATI VOWEL CANDRA E", direction="l", @@ -24422,7 +23015,6 @@ characters.data={ unicodeslot=0xA8D, }, [0xA8F]={ - adobename="egujarati", category="lo", description="GUJARATI LETTER E", direction="l", @@ -24431,7 +23023,6 @@ characters.data={ unicodeslot=0xA8F, }, [0xA90]={ - adobename="aigujarati", category="lo", description="GUJARATI LETTER AI", direction="l", @@ -24440,7 +23031,6 @@ characters.data={ unicodeslot=0xA90, }, [0xA91]={ - adobename="ocandragujarati", category="lo", description="GUJARATI VOWEL CANDRA O", direction="l", @@ -24449,7 +23039,6 @@ characters.data={ unicodeslot=0xA91, }, [0xA93]={ - adobename="ogujarati", category="lo", description="GUJARATI LETTER O", direction="l", @@ -24458,7 +23047,6 @@ characters.data={ unicodeslot=0xA93, }, [0xA94]={ - adobename="augujarati", category="lo", description="GUJARATI LETTER AU", direction="l", @@ -24467,7 +23055,6 @@ characters.data={ unicodeslot=0xA94, }, [0xA95]={ - adobename="kagujarati", category="lo", description="GUJARATI LETTER KA", direction="l", @@ -24476,7 +23063,6 @@ characters.data={ unicodeslot=0xA95, }, [0xA96]={ - adobename="khagujarati", category="lo", description="GUJARATI LETTER KHA", direction="l", @@ -24485,7 +23071,6 @@ characters.data={ unicodeslot=0xA96, }, [0xA97]={ - adobename="gagujarati", category="lo", description="GUJARATI LETTER GA", direction="l", @@ -24494,7 +23079,6 @@ characters.data={ unicodeslot=0xA97, }, [0xA98]={ - adobename="ghagujarati", category="lo", description="GUJARATI LETTER GHA", direction="l", @@ -24503,7 +23087,6 @@ characters.data={ unicodeslot=0xA98, }, [0xA99]={ - adobename="ngagujarati", category="lo", description="GUJARATI LETTER NGA", direction="l", @@ -24512,7 +23095,6 @@ characters.data={ unicodeslot=0xA99, }, [0xA9A]={ - adobename="cagujarati", category="lo", description="GUJARATI LETTER CA", direction="l", @@ -24521,7 +23103,6 @@ characters.data={ unicodeslot=0xA9A, }, [0xA9B]={ - adobename="chagujarati", category="lo", description="GUJARATI LETTER CHA", direction="l", @@ -24530,7 +23111,6 @@ characters.data={ unicodeslot=0xA9B, }, [0xA9C]={ - adobename="jagujarati", category="lo", description="GUJARATI LETTER JA", direction="l", @@ -24539,7 +23119,6 @@ characters.data={ unicodeslot=0xA9C, }, [0xA9D]={ - adobename="jhagujarati", category="lo", description="GUJARATI LETTER JHA", direction="l", @@ -24548,7 +23127,6 @@ characters.data={ unicodeslot=0xA9D, }, [0xA9E]={ - adobename="nyagujarati", category="lo", description="GUJARATI LETTER NYA", direction="l", @@ -24557,7 +23135,6 @@ characters.data={ unicodeslot=0xA9E, }, [0xA9F]={ - adobename="ttagujarati", category="lo", description="GUJARATI LETTER TTA", direction="l", @@ -24566,7 +23143,6 @@ characters.data={ unicodeslot=0xA9F, }, [0xAA0]={ - adobename="tthagujarati", category="lo", description="GUJARATI LETTER TTHA", direction="l", @@ -24575,7 +23151,6 @@ characters.data={ unicodeslot=0xAA0, }, [0xAA1]={ - adobename="ddagujarati", category="lo", description="GUJARATI LETTER DDA", direction="l", @@ -24584,7 +23159,6 @@ characters.data={ unicodeslot=0xAA1, }, [0xAA2]={ - adobename="ddhagujarati", category="lo", description="GUJARATI LETTER DDHA", direction="l", @@ -24593,7 +23167,6 @@ characters.data={ unicodeslot=0xAA2, }, [0xAA3]={ - adobename="nnagujarati", category="lo", description="GUJARATI LETTER NNA", direction="l", @@ -24602,7 +23175,6 @@ characters.data={ unicodeslot=0xAA3, }, [0xAA4]={ - adobename="tagujarati", category="lo", description="GUJARATI LETTER TA", direction="l", @@ -24611,7 +23183,6 @@ characters.data={ unicodeslot=0xAA4, }, [0xAA5]={ - adobename="thagujarati", category="lo", description="GUJARATI LETTER THA", direction="l", @@ -24620,7 +23191,6 @@ characters.data={ unicodeslot=0xAA5, }, [0xAA6]={ - adobename="dagujarati", category="lo", description="GUJARATI LETTER DA", direction="l", @@ -24629,7 +23199,6 @@ characters.data={ unicodeslot=0xAA6, }, [0xAA7]={ - adobename="dhagujarati", category="lo", description="GUJARATI LETTER DHA", direction="l", @@ -24638,7 +23207,6 @@ characters.data={ unicodeslot=0xAA7, }, [0xAA8]={ - adobename="nagujarati", category="lo", description="GUJARATI LETTER NA", direction="l", @@ -24647,7 +23215,6 @@ characters.data={ unicodeslot=0xAA8, }, [0xAAA]={ - adobename="pagujarati", category="lo", description="GUJARATI LETTER PA", direction="l", @@ -24656,7 +23223,6 @@ characters.data={ unicodeslot=0xAAA, }, [0xAAB]={ - adobename="phagujarati", category="lo", description="GUJARATI LETTER PHA", direction="l", @@ -24665,7 +23231,6 @@ characters.data={ unicodeslot=0xAAB, }, [0xAAC]={ - adobename="bagujarati", category="lo", description="GUJARATI LETTER BA", direction="l", @@ -24674,7 +23239,6 @@ characters.data={ unicodeslot=0xAAC, }, [0xAAD]={ - adobename="bhagujarati", category="lo", description="GUJARATI LETTER BHA", direction="l", @@ -24683,7 +23247,6 @@ characters.data={ unicodeslot=0xAAD, }, [0xAAE]={ - adobename="magujarati", category="lo", description="GUJARATI LETTER MA", direction="l", @@ -24692,7 +23255,6 @@ characters.data={ unicodeslot=0xAAE, }, [0xAAF]={ - adobename="yagujarati", category="lo", description="GUJARATI LETTER YA", direction="l", @@ -24702,7 +23264,6 @@ characters.data={ unicodeslot=0xAAF, }, [0xAB0]={ - adobename="ragujarati", category="lo", description="GUJARATI LETTER RA", direction="l", @@ -24713,7 +23274,6 @@ characters.data={ unicodeslot=0xAB0, }, [0xAB2]={ - adobename="lagujarati", category="lo", description="GUJARATI LETTER LA", direction="l", @@ -24722,7 +23282,6 @@ characters.data={ unicodeslot=0xAB2, }, [0xAB3]={ - adobename="llagujarati", category="lo", description="GUJARATI LETTER LLA", direction="l", @@ -24731,7 +23290,6 @@ characters.data={ unicodeslot=0xAB3, }, [0xAB5]={ - adobename="vagujarati", category="lo", description="GUJARATI LETTER VA", direction="l", @@ -24740,7 +23298,6 @@ characters.data={ unicodeslot=0xAB5, }, [0xAB6]={ - adobename="shagujarati", category="lo", description="GUJARATI LETTER SHA", direction="l", @@ -24749,7 +23306,6 @@ characters.data={ unicodeslot=0xAB6, }, [0xAB7]={ - adobename="ssagujarati", category="lo", description="GUJARATI LETTER SSA", direction="l", @@ -24758,7 +23314,6 @@ characters.data={ unicodeslot=0xAB7, }, [0xAB8]={ - adobename="sagujarati", category="lo", description="GUJARATI LETTER SA", direction="l", @@ -24767,7 +23322,6 @@ characters.data={ unicodeslot=0xAB8, }, [0xAB9]={ - adobename="hagujarati", category="lo", description="GUJARATI LETTER HA", direction="l", @@ -24776,7 +23330,6 @@ characters.data={ unicodeslot=0xAB9, }, [0xABC]={ - adobename="nuktagujarati", category="mn", combining=0x7, description="GUJARATI SIGN NUKTA", @@ -24796,7 +23349,6 @@ characters.data={ unicodeslot=0xABD, }, [0xABE]={ - adobename="aavowelsigngujarati", category="mc", description="GUJARATI VOWEL SIGN AA", direction="l", @@ -24807,7 +23359,6 @@ characters.data={ unicodeslot=0xABE, }, [0xABF]={ - adobename="ivowelsigngujarati", category="mc", description="GUJARATI VOWEL SIGN I", direction="l", @@ -24818,7 +23369,6 @@ characters.data={ unicodeslot=0xABF, }, [0xAC0]={ - adobename="iivowelsigngujarati", category="mc", description="GUJARATI VOWEL SIGN II", direction="l", @@ -24829,7 +23379,6 @@ characters.data={ unicodeslot=0xAC0, }, [0xAC1]={ - adobename="uvowelsigngujarati", category="mn", description="GUJARATI VOWEL SIGN U", direction="nsm", @@ -24840,7 +23389,6 @@ characters.data={ unicodeslot=0xAC1, }, [0xAC2]={ - adobename="uuvowelsigngujarati", category="mn", description="GUJARATI VOWEL SIGN UU", direction="nsm", @@ -24851,7 +23399,6 @@ characters.data={ unicodeslot=0xAC2, }, [0xAC3]={ - adobename="rvocalicvowelsigngujarati", category="mn", description="GUJARATI VOWEL SIGN VOCALIC R", direction="nsm", @@ -24862,7 +23409,6 @@ characters.data={ unicodeslot=0xAC3, }, [0xAC4]={ - adobename="rrvocalicvowelsigngujarati", category="mn", description="GUJARATI VOWEL SIGN VOCALIC RR", direction="nsm", @@ -24873,7 +23419,6 @@ characters.data={ unicodeslot=0xAC4, }, [0xAC5]={ - adobename="ecandravowelsigngujarati", category="mn", description="GUJARATI VOWEL SIGN CANDRA E", direction="nsm", @@ -24884,7 +23429,6 @@ characters.data={ unicodeslot=0xAC5, }, [0xAC7]={ - adobename="evowelsigngujarati", category="mn", description="GUJARATI VOWEL SIGN E", direction="nsm", @@ -24895,7 +23439,6 @@ characters.data={ unicodeslot=0xAC7, }, [0xAC8]={ - adobename="aivowelsigngujarati", category="mn", description="GUJARATI VOWEL SIGN AI", direction="nsm", @@ -24906,7 +23449,6 @@ characters.data={ unicodeslot=0xAC8, }, [0xAC9]={ - adobename="ocandravowelsigngujarati", category="mc", description="GUJARATI VOWEL SIGN CANDRA O", direction="l", @@ -24917,7 +23459,6 @@ characters.data={ unicodeslot=0xAC9, }, [0xACB]={ - adobename="ovowelsigngujarati", category="mc", description="GUJARATI VOWEL SIGN O", direction="l", @@ -24928,7 +23469,6 @@ characters.data={ unicodeslot=0xACB, }, [0xACC]={ - adobename="auvowelsigngujarati", category="mc", description="GUJARATI VOWEL SIGN AU", direction="l", @@ -24939,7 +23479,6 @@ characters.data={ unicodeslot=0xACC, }, [0xACD]={ - adobename="viramagujarati", category="mn", combining=0x9, description="GUJARATI SIGN VIRAMA", @@ -24951,7 +23490,6 @@ characters.data={ unicodeslot=0xACD, }, [0xAD0]={ - adobename="omgujarati", category="lo", description="GUJARATI OM", direction="l", @@ -24960,7 +23498,6 @@ characters.data={ unicodeslot=0xAD0, }, [0xAE0]={ - adobename="rrvocalicgujarati", category="lo", description="GUJARATI LETTER VOCALIC RR", direction="l", @@ -24995,7 +23532,6 @@ characters.data={ unicodeslot=0xAE3, }, [0xAE6]={ - adobename="zerogujarati", category="nd", description="GUJARATI DIGIT ZERO", direction="l", @@ -25004,7 +23540,6 @@ characters.data={ unicodeslot=0xAE6, }, [0xAE7]={ - adobename="onegujarati", category="nd", description="GUJARATI DIGIT ONE", direction="l", @@ -25013,7 +23548,6 @@ characters.data={ unicodeslot=0xAE7, }, [0xAE8]={ - adobename="twogujarati", category="nd", description="GUJARATI DIGIT TWO", direction="l", @@ -25022,7 +23556,6 @@ characters.data={ unicodeslot=0xAE8, }, [0xAE9]={ - adobename="threegujarati", category="nd", description="GUJARATI DIGIT THREE", direction="l", @@ -25031,7 +23564,6 @@ characters.data={ unicodeslot=0xAE9, }, [0xAEA]={ - adobename="fourgujarati", category="nd", description="GUJARATI DIGIT FOUR", direction="l", @@ -25040,7 +23572,6 @@ characters.data={ unicodeslot=0xAEA, }, [0xAEB]={ - adobename="fivegujarati", category="nd", description="GUJARATI DIGIT FIVE", direction="l", @@ -25049,7 +23580,6 @@ characters.data={ unicodeslot=0xAEB, }, [0xAEC]={ - adobename="sixgujarati", category="nd", description="GUJARATI DIGIT SIX", direction="l", @@ -25058,7 +23588,6 @@ characters.data={ unicodeslot=0xAEC, }, [0xAED]={ - adobename="sevengujarati", category="nd", description="GUJARATI DIGIT SEVEN", direction="l", @@ -25067,7 +23596,6 @@ characters.data={ unicodeslot=0xAED, }, [0xAEE]={ - adobename="eightgujarati", category="nd", description="GUJARATI DIGIT EIGHT", direction="l", @@ -25076,7 +23604,6 @@ characters.data={ unicodeslot=0xAEE, }, [0xAEF]={ - adobename="ninegujarati", category="nd", description="GUJARATI DIGIT NINE", direction="l", @@ -29768,7 +28295,6 @@ characters.data={ unicodeslot=0xDF4, }, [0xE01]={ - adobename="kokaithai", category="lo", description="THAI CHARACTER KO KAI", direction="l", @@ -29776,7 +28302,6 @@ characters.data={ unicodeslot=0xE01, }, [0xE02]={ - adobename="khokhaithai", category="lo", description="THAI CHARACTER KHO KHAI", direction="l", @@ -29784,7 +28309,6 @@ characters.data={ unicodeslot=0xE02, }, [0xE03]={ - adobename="khokhuatthai", category="lo", description="THAI CHARACTER KHO KHUAT", direction="l", @@ -29792,7 +28316,6 @@ characters.data={ unicodeslot=0xE03, }, [0xE04]={ - adobename="khokhwaithai", category="lo", description="THAI CHARACTER KHO KHWAI", direction="l", @@ -29800,7 +28323,6 @@ characters.data={ unicodeslot=0xE04, }, [0xE05]={ - adobename="khokhonthai", category="lo", description="THAI CHARACTER KHO KHON", direction="l", @@ -29808,7 +28330,6 @@ characters.data={ unicodeslot=0xE05, }, [0xE06]={ - adobename="khorakhangthai", category="lo", description="THAI CHARACTER KHO RAKHANG", direction="l", @@ -29816,7 +28337,6 @@ characters.data={ unicodeslot=0xE06, }, [0xE07]={ - adobename="ngonguthai", category="lo", description="THAI CHARACTER NGO NGU", direction="l", @@ -29824,7 +28344,6 @@ characters.data={ unicodeslot=0xE07, }, [0xE08]={ - adobename="chochanthai", category="lo", description="THAI CHARACTER CHO CHAN", direction="l", @@ -29832,7 +28351,6 @@ characters.data={ unicodeslot=0xE08, }, [0xE09]={ - adobename="chochingthai", category="lo", description="THAI CHARACTER CHO CHING", direction="l", @@ -29840,7 +28358,6 @@ characters.data={ unicodeslot=0xE09, }, [0xE0A]={ - adobename="chochangthai", category="lo", description="THAI CHARACTER CHO CHANG", direction="l", @@ -29848,7 +28365,6 @@ characters.data={ unicodeslot=0xE0A, }, [0xE0B]={ - adobename="sosothai", category="lo", description="THAI CHARACTER SO SO", direction="l", @@ -29856,7 +28372,6 @@ characters.data={ unicodeslot=0xE0B, }, [0xE0C]={ - adobename="chochoethai", category="lo", description="THAI CHARACTER CHO CHOE", direction="l", @@ -29864,7 +28379,6 @@ characters.data={ unicodeslot=0xE0C, }, [0xE0D]={ - adobename="yoyingthai", category="lo", description="THAI CHARACTER YO YING", direction="l", @@ -29872,7 +28386,6 @@ characters.data={ unicodeslot=0xE0D, }, [0xE0E]={ - adobename="dochadathai", category="lo", description="THAI CHARACTER DO CHADA", direction="l", @@ -29880,7 +28393,6 @@ characters.data={ unicodeslot=0xE0E, }, [0xE0F]={ - adobename="topatakthai", category="lo", description="THAI CHARACTER TO PATAK", direction="l", @@ -29888,7 +28400,6 @@ characters.data={ unicodeslot=0xE0F, }, [0xE10]={ - adobename="thothanthai", category="lo", description="THAI CHARACTER THO THAN", direction="l", @@ -29896,7 +28407,6 @@ characters.data={ unicodeslot=0xE10, }, [0xE11]={ - adobename="thonangmonthothai", category="lo", description="THAI CHARACTER THO NANGMONTHO", direction="l", @@ -29904,7 +28414,6 @@ characters.data={ unicodeslot=0xE11, }, [0xE12]={ - adobename="thophuthaothai", category="lo", description="THAI CHARACTER THO PHUTHAO", direction="l", @@ -29912,7 +28421,6 @@ characters.data={ unicodeslot=0xE12, }, [0xE13]={ - adobename="nonenthai", category="lo", description="THAI CHARACTER NO NEN", direction="l", @@ -29920,7 +28428,6 @@ characters.data={ unicodeslot=0xE13, }, [0xE14]={ - adobename="dodekthai", category="lo", description="THAI CHARACTER DO DEK", direction="l", @@ -29928,7 +28435,6 @@ characters.data={ unicodeslot=0xE14, }, [0xE15]={ - adobename="totaothai", category="lo", description="THAI CHARACTER TO TAO", direction="l", @@ -29936,7 +28442,6 @@ characters.data={ unicodeslot=0xE15, }, [0xE16]={ - adobename="thothungthai", category="lo", description="THAI CHARACTER THO THUNG", direction="l", @@ -29944,7 +28449,6 @@ characters.data={ unicodeslot=0xE16, }, [0xE17]={ - adobename="thothahanthai", category="lo", description="THAI CHARACTER THO THAHAN", direction="l", @@ -29952,7 +28456,6 @@ characters.data={ unicodeslot=0xE17, }, [0xE18]={ - adobename="thothongthai", category="lo", description="THAI CHARACTER THO THONG", direction="l", @@ -29960,7 +28463,6 @@ characters.data={ unicodeslot=0xE18, }, [0xE19]={ - adobename="nonuthai", category="lo", description="THAI CHARACTER NO NU", direction="l", @@ -29968,7 +28470,6 @@ characters.data={ unicodeslot=0xE19, }, [0xE1A]={ - adobename="bobaimaithai", category="lo", description="THAI CHARACTER BO BAIMAI", direction="l", @@ -29976,7 +28477,6 @@ characters.data={ unicodeslot=0xE1A, }, [0xE1B]={ - adobename="poplathai", category="lo", description="THAI CHARACTER PO PLA", direction="l", @@ -29984,7 +28484,6 @@ characters.data={ unicodeslot=0xE1B, }, [0xE1C]={ - adobename="phophungthai", category="lo", description="THAI CHARACTER PHO PHUNG", direction="l", @@ -29992,7 +28491,6 @@ characters.data={ unicodeslot=0xE1C, }, [0xE1D]={ - adobename="fofathai", category="lo", description="THAI CHARACTER FO FA", direction="l", @@ -30000,7 +28498,6 @@ characters.data={ unicodeslot=0xE1D, }, [0xE1E]={ - adobename="phophanthai", category="lo", description="THAI CHARACTER PHO PHAN", direction="l", @@ -30008,7 +28505,6 @@ characters.data={ unicodeslot=0xE1E, }, [0xE1F]={ - adobename="fofanthai", category="lo", description="THAI CHARACTER FO FAN", direction="l", @@ -30016,7 +28512,6 @@ characters.data={ unicodeslot=0xE1F, }, [0xE20]={ - adobename="phosamphaothai", category="lo", description="THAI CHARACTER PHO SAMPHAO", direction="l", @@ -30024,7 +28519,6 @@ characters.data={ unicodeslot=0xE20, }, [0xE21]={ - adobename="momathai", category="lo", description="THAI CHARACTER MO MA", direction="l", @@ -30032,7 +28526,6 @@ characters.data={ unicodeslot=0xE21, }, [0xE22]={ - adobename="yoyakthai", category="lo", description="THAI CHARACTER YO YAK", direction="l", @@ -30040,7 +28533,6 @@ characters.data={ unicodeslot=0xE22, }, [0xE23]={ - adobename="roruathai", category="lo", description="THAI CHARACTER RO RUA", direction="l", @@ -30048,7 +28540,6 @@ characters.data={ unicodeslot=0xE23, }, [0xE24]={ - adobename="ruthai", category="lo", description="THAI CHARACTER RU", direction="l", @@ -30056,7 +28547,6 @@ characters.data={ unicodeslot=0xE24, }, [0xE25]={ - adobename="lolingthai", category="lo", description="THAI CHARACTER LO LING", direction="l", @@ -30064,7 +28554,6 @@ characters.data={ unicodeslot=0xE25, }, [0xE26]={ - adobename="luthai", category="lo", description="THAI CHARACTER LU", direction="l", @@ -30072,7 +28561,6 @@ characters.data={ unicodeslot=0xE26, }, [0xE27]={ - adobename="wowaenthai", category="lo", description="THAI CHARACTER WO WAEN", direction="l", @@ -30080,7 +28568,6 @@ characters.data={ unicodeslot=0xE27, }, [0xE28]={ - adobename="sosalathai", category="lo", description="THAI CHARACTER SO SALA", direction="l", @@ -30088,7 +28575,6 @@ characters.data={ unicodeslot=0xE28, }, [0xE29]={ - adobename="sorusithai", category="lo", description="THAI CHARACTER SO RUSI", direction="l", @@ -30096,7 +28582,6 @@ characters.data={ unicodeslot=0xE29, }, [0xE2A]={ - adobename="sosuathai", category="lo", description="THAI CHARACTER SO SUA", direction="l", @@ -30104,7 +28589,6 @@ characters.data={ unicodeslot=0xE2A, }, [0xE2B]={ - adobename="hohipthai", category="lo", description="THAI CHARACTER HO HIP", direction="l", @@ -30112,7 +28596,6 @@ characters.data={ unicodeslot=0xE2B, }, [0xE2C]={ - adobename="lochulathai", category="lo", description="THAI CHARACTER LO CHULA", direction="l", @@ -30120,7 +28603,6 @@ characters.data={ unicodeslot=0xE2C, }, [0xE2D]={ - adobename="oangthai", category="lo", description="THAI CHARACTER O ANG", direction="l", @@ -30128,7 +28610,6 @@ characters.data={ unicodeslot=0xE2D, }, [0xE2E]={ - adobename="honokhukthai", category="lo", description="THAI CHARACTER HO NOKHUK", direction="l", @@ -30136,7 +28617,6 @@ characters.data={ unicodeslot=0xE2E, }, [0xE2F]={ - adobename="paiyannoithai", category="lo", description="THAI CHARACTER PAIYANNOI", direction="l", @@ -30144,7 +28624,6 @@ characters.data={ unicodeslot=0xE2F, }, [0xE30]={ - adobename="saraathai", category="lo", description="THAI CHARACTER SARA A", direction="l", @@ -30152,7 +28631,6 @@ characters.data={ unicodeslot=0xE30, }, [0xE31]={ - adobename="maihanakatthai", category="mn", description="THAI CHARACTER MAI HAN-AKAT", direction="nsm", @@ -30160,7 +28638,6 @@ characters.data={ unicodeslot=0xE31, }, [0xE32]={ - adobename="saraaathai", category="lo", description="THAI CHARACTER SARA AA", direction="l", @@ -30168,7 +28645,6 @@ characters.data={ unicodeslot=0xE32, }, [0xE33]={ - adobename="saraamthai", category="lo", description="THAI CHARACTER SARA AM", direction="l", @@ -30177,7 +28653,6 @@ characters.data={ unicodeslot=0xE33, }, [0xE34]={ - adobename="saraithai", category="mn", description="THAI CHARACTER SARA I", direction="nsm", @@ -30185,7 +28660,6 @@ characters.data={ unicodeslot=0xE34, }, [0xE35]={ - adobename="saraiithai", category="mn", description="THAI CHARACTER SARA II", direction="nsm", @@ -30193,7 +28667,6 @@ characters.data={ unicodeslot=0xE35, }, [0xE36]={ - adobename="sarauethai", category="mn", description="THAI CHARACTER SARA UE", direction="nsm", @@ -30201,7 +28674,6 @@ characters.data={ unicodeslot=0xE36, }, [0xE37]={ - adobename="saraueethai", category="mn", description="THAI CHARACTER SARA UEE", direction="nsm", @@ -30209,7 +28681,6 @@ characters.data={ unicodeslot=0xE37, }, [0xE38]={ - adobename="sarauthai", category="mn", combining=0x67, description="THAI CHARACTER SARA U", @@ -30218,7 +28689,6 @@ characters.data={ unicodeslot=0xE38, }, [0xE39]={ - adobename="sarauuthai", category="mn", combining=0x67, description="THAI CHARACTER SARA UU", @@ -30227,7 +28697,6 @@ characters.data={ unicodeslot=0xE39, }, [0xE3A]={ - adobename="phinthuthai", category="mn", combining=0x9, description="THAI CHARACTER PHINTHU", @@ -30236,7 +28705,6 @@ characters.data={ unicodeslot=0xE3A, }, [0xE3F]={ - adobename="bahtthai", category="sc", description="THAI CURRENCY SYMBOL BAHT", direction="et", @@ -30244,7 +28712,6 @@ characters.data={ unicodeslot=0xE3F, }, [0xE40]={ - adobename="saraethai", category="lo", description="THAI CHARACTER SARA E", direction="l", @@ -30252,7 +28719,6 @@ characters.data={ unicodeslot=0xE40, }, [0xE41]={ - adobename="saraaethai", category="lo", description="THAI CHARACTER SARA AE", direction="l", @@ -30260,7 +28726,6 @@ characters.data={ unicodeslot=0xE41, }, [0xE42]={ - adobename="saraothai", category="lo", description="THAI CHARACTER SARA O", direction="l", @@ -30268,7 +28733,6 @@ characters.data={ unicodeslot=0xE42, }, [0xE43]={ - adobename="saraaimaimuanthai", category="lo", description="THAI CHARACTER SARA AI MAIMUAN", direction="l", @@ -30276,7 +28740,6 @@ characters.data={ unicodeslot=0xE43, }, [0xE44]={ - adobename="saraaimaimalaithai", category="lo", description="THAI CHARACTER SARA AI MAIMALAI", direction="l", @@ -30284,7 +28747,6 @@ characters.data={ unicodeslot=0xE44, }, [0xE45]={ - adobename="lakkhangyaothai", category="lo", description="THAI CHARACTER LAKKHANGYAO", direction="l", @@ -30292,7 +28754,6 @@ characters.data={ unicodeslot=0xE45, }, [0xE46]={ - adobename="maiyamokthai", category="lm", description="THAI CHARACTER MAIYAMOK", direction="l", @@ -30300,7 +28761,6 @@ characters.data={ unicodeslot=0xE46, }, [0xE47]={ - adobename="maitaikhuthai", category="mn", description="THAI CHARACTER MAITAIKHU", direction="nsm", @@ -30308,7 +28768,6 @@ characters.data={ unicodeslot=0xE47, }, [0xE48]={ - adobename="maiekthai", category="mn", combining=0x6B, description="THAI CHARACTER MAI EK", @@ -30317,7 +28776,6 @@ characters.data={ unicodeslot=0xE48, }, [0xE49]={ - adobename="maithothai", category="mn", combining=0x6B, description="THAI CHARACTER MAI THO", @@ -30326,7 +28784,6 @@ characters.data={ unicodeslot=0xE49, }, [0xE4A]={ - adobename="maitrithai", category="mn", combining=0x6B, description="THAI CHARACTER MAI TRI", @@ -30335,7 +28792,6 @@ characters.data={ unicodeslot=0xE4A, }, [0xE4B]={ - adobename="maichattawathai", category="mn", combining=0x6B, description="THAI CHARACTER MAI CHATTAWA", @@ -30344,7 +28800,6 @@ characters.data={ unicodeslot=0xE4B, }, [0xE4C]={ - adobename="thanthakhatthai", category="mn", description="THAI CHARACTER THANTHAKHAT", direction="nsm", @@ -30352,7 +28807,6 @@ characters.data={ unicodeslot=0xE4C, }, [0xE4D]={ - adobename="nikhahitthai", category="mn", description="THAI CHARACTER NIKHAHIT", direction="nsm", @@ -30360,7 +28814,6 @@ characters.data={ unicodeslot=0xE4D, }, [0xE4E]={ - adobename="yamakkanthai", category="mn", description="THAI CHARACTER YAMAKKAN", direction="nsm", @@ -30368,7 +28821,6 @@ characters.data={ unicodeslot=0xE4E, }, [0xE4F]={ - adobename="fongmanthai", category="po", description="THAI CHARACTER FONGMAN", direction="l", @@ -30376,7 +28828,6 @@ characters.data={ unicodeslot=0xE4F, }, [0xE50]={ - adobename="zerothai", category="nd", description="THAI DIGIT ZERO", direction="l", @@ -30384,7 +28835,6 @@ characters.data={ unicodeslot=0xE50, }, [0xE51]={ - adobename="onethai", category="nd", description="THAI DIGIT ONE", direction="l", @@ -30392,7 +28842,6 @@ characters.data={ unicodeslot=0xE51, }, [0xE52]={ - adobename="twothai", category="nd", description="THAI DIGIT TWO", direction="l", @@ -30400,7 +28849,6 @@ characters.data={ unicodeslot=0xE52, }, [0xE53]={ - adobename="threethai", category="nd", description="THAI DIGIT THREE", direction="l", @@ -30408,7 +28856,6 @@ characters.data={ unicodeslot=0xE53, }, [0xE54]={ - adobename="fourthai", category="nd", description="THAI DIGIT FOUR", direction="l", @@ -30416,7 +28863,6 @@ characters.data={ unicodeslot=0xE54, }, [0xE55]={ - adobename="fivethai", category="nd", description="THAI DIGIT FIVE", direction="l", @@ -30424,7 +28870,6 @@ characters.data={ unicodeslot=0xE55, }, [0xE56]={ - adobename="sixthai", category="nd", description="THAI DIGIT SIX", direction="l", @@ -30432,7 +28877,6 @@ characters.data={ unicodeslot=0xE56, }, [0xE57]={ - adobename="seventhai", category="nd", description="THAI DIGIT SEVEN", direction="l", @@ -30440,7 +28884,6 @@ characters.data={ unicodeslot=0xE57, }, [0xE58]={ - adobename="eightthai", category="nd", description="THAI DIGIT EIGHT", direction="l", @@ -30448,7 +28891,6 @@ characters.data={ unicodeslot=0xE58, }, [0xE59]={ - adobename="ninethai", category="nd", description="THAI DIGIT NINE", direction="l", @@ -30456,7 +28898,6 @@ characters.data={ unicodeslot=0xE59, }, [0xE5A]={ - adobename="angkhankhuthai", category="po", description="THAI CHARACTER ANGKHANKHU", direction="l", @@ -30464,7 +28905,6 @@ characters.data={ unicodeslot=0xE5A, }, [0xE5B]={ - adobename="khomutthai", category="po", description="THAI CHARACTER KHOMUT", direction="l", @@ -51491,14 +49931,14 @@ characters.data={ category="lo", description="BALINESE LETTER AKARA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B05, }, [0x1B06]={ category="lo", description="BALINESE LETTER AKARA TEDUNG", direction="l", - linebreak="al", + linebreak="ak", specials={ "char", 0x1B05, 0x1B35 }, unicodeslot=0x1B06, }, @@ -51506,14 +49946,14 @@ characters.data={ category="lo", description="BALINESE LETTER IKARA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B07, }, [0x1B08]={ category="lo", description="BALINESE LETTER IKARA TEDUNG", direction="l", - linebreak="al", + linebreak="ak", specials={ "char", 0x1B07, 0x1B35 }, unicodeslot=0x1B08, }, @@ -51521,14 +49961,14 @@ characters.data={ category="lo", description="BALINESE LETTER UKARA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B09, }, [0x1B0A]={ category="lo", description="BALINESE LETTER UKARA TEDUNG", direction="l", - linebreak="al", + linebreak="ak", specials={ "char", 0x1B09, 0x1B35 }, unicodeslot=0x1B0A, }, @@ -51536,14 +49976,14 @@ characters.data={ category="lo", description="BALINESE LETTER RA REPA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B0B, }, [0x1B0C]={ category="lo", description="BALINESE LETTER RA REPA TEDUNG", direction="l", - linebreak="al", + linebreak="ak", specials={ "char", 0x1B0B, 0x1B35 }, unicodeslot=0x1B0C, }, @@ -51551,14 +49991,14 @@ characters.data={ category="lo", description="BALINESE LETTER LA LENGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B0D, }, [0x1B0E]={ category="lo", description="BALINESE LETTER LA LENGA TEDUNG", direction="l", - linebreak="al", + linebreak="ak", specials={ "char", 0x1B0D, 0x1B35 }, unicodeslot=0x1B0E, }, @@ -51566,28 +50006,28 @@ characters.data={ category="lo", description="BALINESE LETTER EKARA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B0F, }, [0x1B10]={ category="lo", description="BALINESE LETTER AIKARA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B10, }, [0x1B11]={ category="lo", description="BALINESE LETTER OKARA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B11, }, [0x1B12]={ category="lo", description="BALINESE LETTER OKARA TEDUNG", direction="l", - linebreak="al", + linebreak="ak", specials={ "char", 0x1B11, 0x1B35 }, unicodeslot=0x1B12, }, @@ -51595,231 +50035,231 @@ characters.data={ category="lo", description="BALINESE LETTER KA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B13, }, [0x1B14]={ category="lo", description="BALINESE LETTER KA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B14, }, [0x1B15]={ category="lo", description="BALINESE LETTER GA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B15, }, [0x1B16]={ category="lo", description="BALINESE LETTER GA GORA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B16, }, [0x1B17]={ category="lo", description="BALINESE LETTER NGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B17, }, [0x1B18]={ category="lo", description="BALINESE LETTER CA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B18, }, [0x1B19]={ category="lo", description="BALINESE LETTER CA LACA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B19, }, [0x1B1A]={ category="lo", description="BALINESE LETTER JA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B1A, }, [0x1B1B]={ category="lo", description="BALINESE LETTER JA JERA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B1B, }, [0x1B1C]={ category="lo", description="BALINESE LETTER NYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B1C, }, [0x1B1D]={ category="lo", description="BALINESE LETTER TA LATIK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B1D, }, [0x1B1E]={ category="lo", description="BALINESE LETTER TA MURDA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B1E, }, [0x1B1F]={ category="lo", description="BALINESE LETTER DA MURDA ALPAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B1F, }, [0x1B20]={ category="lo", description="BALINESE LETTER DA MURDA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B20, }, [0x1B21]={ category="lo", description="BALINESE LETTER NA RAMBAT", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B21, }, [0x1B22]={ category="lo", description="BALINESE LETTER TA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B22, }, [0x1B23]={ category="lo", description="BALINESE LETTER TA TAWA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B23, }, [0x1B24]={ category="lo", description="BALINESE LETTER DA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B24, }, [0x1B25]={ category="lo", description="BALINESE LETTER DA MADU", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B25, }, [0x1B26]={ category="lo", description="BALINESE LETTER NA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B26, }, [0x1B27]={ category="lo", description="BALINESE LETTER PA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B27, }, [0x1B28]={ category="lo", description="BALINESE LETTER PA KAPAL", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B28, }, [0x1B29]={ category="lo", description="BALINESE LETTER BA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B29, }, [0x1B2A]={ category="lo", description="BALINESE LETTER BA KEMBANG", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B2A, }, [0x1B2B]={ category="lo", description="BALINESE LETTER MA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B2B, }, [0x1B2C]={ category="lo", description="BALINESE LETTER YA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B2C, }, [0x1B2D]={ category="lo", description="BALINESE LETTER RA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B2D, }, [0x1B2E]={ category="lo", description="BALINESE LETTER LA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B2E, }, [0x1B2F]={ category="lo", description="BALINESE LETTER WA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B2F, }, [0x1B30]={ category="lo", description="BALINESE LETTER SA SAGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B30, }, [0x1B31]={ category="lo", description="BALINESE LETTER SA SAPA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B31, }, [0x1B32]={ category="lo", description="BALINESE LETTER SA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B32, }, [0x1B33]={ category="lo", description="BALINESE LETTER HA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B33, }, [0x1B34]={ @@ -51945,133 +50385,133 @@ characters.data={ combining=0x9, description="BALINESE ADEG ADEG", direction="l", - linebreak="cm", + linebreak="vi", unicodeslot=0x1B44, }, [0x1B45]={ category="lo", description="BALINESE LETTER KAF SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B45, }, [0x1B46]={ category="lo", description="BALINESE LETTER KHOT SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B46, }, [0x1B47]={ category="lo", description="BALINESE LETTER TZIR SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B47, }, [0x1B48]={ category="lo", description="BALINESE LETTER EF SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B48, }, [0x1B49]={ category="lo", description="BALINESE LETTER VE SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B49, }, [0x1B4A]={ category="lo", description="BALINESE LETTER ZAL SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B4A, }, [0x1B4B]={ category="lo", description="BALINESE LETTER ASYURA SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B4B, }, [0x1B4C]={ category="lo", description="BALINESE LETTER ARCHAIC JNYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1B4C, }, [0x1B50]={ category="nd", description="BALINESE DIGIT ZERO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B50, }, [0x1B51]={ category="nd", description="BALINESE DIGIT ONE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B51, }, [0x1B52]={ category="nd", description="BALINESE DIGIT TWO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B52, }, [0x1B53]={ category="nd", description="BALINESE DIGIT THREE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B53, }, [0x1B54]={ category="nd", description="BALINESE DIGIT FOUR", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B54, }, [0x1B55]={ category="nd", description="BALINESE DIGIT FIVE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B55, }, [0x1B56]={ category="nd", description="BALINESE DIGIT SIX", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B56, }, [0x1B57]={ category="nd", description="BALINESE DIGIT SEVEN", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B57, }, [0x1B58]={ category="nd", description="BALINESE DIGIT EIGHT", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B58, }, [0x1B59]={ category="nd", description="BALINESE DIGIT NINE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x1B59, }, [0x1B5A]={ @@ -52092,7 +50532,7 @@ characters.data={ category="po", description="BALINESE WINDU", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B5C, }, [0x1B5D]={ @@ -52127,70 +50567,70 @@ characters.data={ category="so", description="BALINESE MUSICAL SYMBOL DONG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B61, }, [0x1B62]={ category="so", description="BALINESE MUSICAL SYMBOL DENG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B62, }, [0x1B63]={ category="so", description="BALINESE MUSICAL SYMBOL DUNG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B63, }, [0x1B64]={ category="so", description="BALINESE MUSICAL SYMBOL DANG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B64, }, [0x1B65]={ category="so", description="BALINESE MUSICAL SYMBOL DANG SURANG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B65, }, [0x1B66]={ category="so", description="BALINESE MUSICAL SYMBOL DING", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B66, }, [0x1B67]={ category="so", description="BALINESE MUSICAL SYMBOL DAENG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B67, }, [0x1B68]={ category="so", description="BALINESE MUSICAL SYMBOL DEUNG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B68, }, [0x1B69]={ category="so", description="BALINESE MUSICAL SYMBOL DAING", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B69, }, [0x1B6A]={ category="so", description="BALINESE MUSICAL SYMBOL DANG GEDE", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B6A, }, [0x1B6B]={ @@ -52269,63 +50709,63 @@ characters.data={ category="so", description="BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B74, }, [0x1B75]={ category="so", description="BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DAG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B75, }, [0x1B76]={ category="so", description="BALINESE MUSICAL SYMBOL RIGHT-HAND CLOSED TUK", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B76, }, [0x1B77]={ category="so", description="BALINESE MUSICAL SYMBOL RIGHT-HAND CLOSED TAK", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B77, }, [0x1B78]={ category="so", description="BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PANG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B78, }, [0x1B79]={ category="so", description="BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PUNG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B79, }, [0x1B7A]={ category="so", description="BALINESE MUSICAL SYMBOL LEFT-HAND CLOSED PLAK", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B7A, }, [0x1B7B]={ category="so", description="BALINESE MUSICAL SYMBOL LEFT-HAND CLOSED PLUK", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B7B, }, [0x1B7C]={ category="so", description="BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PING", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1B7C, }, [0x1B7D]={ @@ -52796,266 +51236,266 @@ characters.data={ category="lo", description="BATAK LETTER A", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC0, }, [0x1BC1]={ category="lo", description="BATAK LETTER SIMALUNGUN A", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC1, }, [0x1BC2]={ category="lo", description="BATAK LETTER HA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC2, }, [0x1BC3]={ category="lo", description="BATAK LETTER SIMALUNGUN HA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC3, }, [0x1BC4]={ category="lo", description="BATAK LETTER MANDAILING HA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC4, }, [0x1BC5]={ category="lo", description="BATAK LETTER BA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC5, }, [0x1BC6]={ category="lo", description="BATAK LETTER KARO BA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC6, }, [0x1BC7]={ category="lo", description="BATAK LETTER PA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC7, }, [0x1BC8]={ category="lo", description="BATAK LETTER SIMALUNGUN PA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC8, }, [0x1BC9]={ category="lo", description="BATAK LETTER NA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BC9, }, [0x1BCA]={ category="lo", description="BATAK LETTER MANDAILING NA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BCA, }, [0x1BCB]={ category="lo", description="BATAK LETTER WA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BCB, }, [0x1BCC]={ category="lo", description="BATAK LETTER SIMALUNGUN WA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BCC, }, [0x1BCD]={ category="lo", description="BATAK LETTER PAKPAK WA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BCD, }, [0x1BCE]={ category="lo", description="BATAK LETTER GA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BCE, }, [0x1BCF]={ category="lo", description="BATAK LETTER SIMALUNGUN GA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BCF, }, [0x1BD0]={ category="lo", description="BATAK LETTER JA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD0, }, [0x1BD1]={ category="lo", description="BATAK LETTER DA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD1, }, [0x1BD2]={ category="lo", description="BATAK LETTER RA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD2, }, [0x1BD3]={ category="lo", description="BATAK LETTER SIMALUNGUN RA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD3, }, [0x1BD4]={ category="lo", description="BATAK LETTER MA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD4, }, [0x1BD5]={ category="lo", description="BATAK LETTER SIMALUNGUN MA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD5, }, [0x1BD6]={ category="lo", description="BATAK LETTER SOUTHERN TA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD6, }, [0x1BD7]={ category="lo", description="BATAK LETTER NORTHERN TA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD7, }, [0x1BD8]={ category="lo", description="BATAK LETTER SA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD8, }, [0x1BD9]={ category="lo", description="BATAK LETTER SIMALUNGUN SA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BD9, }, [0x1BDA]={ category="lo", description="BATAK LETTER MANDAILING SA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BDA, }, [0x1BDB]={ category="lo", description="BATAK LETTER YA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BDB, }, [0x1BDC]={ category="lo", description="BATAK LETTER SIMALUNGUN YA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BDC, }, [0x1BDD]={ category="lo", description="BATAK LETTER NGA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BDD, }, [0x1BDE]={ category="lo", description="BATAK LETTER LA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BDE, }, [0x1BDF]={ category="lo", description="BATAK LETTER SIMALUNGUN LA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BDF, }, [0x1BE0]={ category="lo", description="BATAK LETTER NYA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BE0, }, [0x1BE1]={ category="lo", description="BATAK LETTER CA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BE1, }, [0x1BE2]={ category="lo", description="BATAK LETTER NDA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BE2, }, [0x1BE3]={ category="lo", description="BATAK LETTER MBA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BE3, }, [0x1BE4]={ category="lo", description="BATAK LETTER I", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BE4, }, [0x1BE5]={ category="lo", description="BATAK LETTER U", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1BE5, }, [0x1BE6]={ @@ -53148,7 +51588,7 @@ characters.data={ combining=0x9, description="BATAK PANGOLAT", direction="l", - linebreak="cm", + linebreak="vf", unicodeslot=0x1BF2, }, [0x1BF3]={ @@ -53156,7 +51596,7 @@ characters.data={ combining=0x9, description="BATAK PANONGONAN", direction="l", - linebreak="cm", + linebreak="vf", unicodeslot=0x1BF3, }, [0x1BFC]={ @@ -56865,7 +55305,6 @@ characters.data={ unicodeslot=0x1DFF, }, [0x1E00]={ - adobename="Aringbelow", category="lu", description="LATIN CAPITAL LETTER A WITH RING BELOW", direction="l", @@ -56876,7 +55315,6 @@ characters.data={ unicodeslot=0x1E00, }, [0x1E01]={ - adobename="aringbelow", category="ll", description="LATIN SMALL LETTER A WITH RING BELOW", direction="l", @@ -56887,7 +55325,6 @@ characters.data={ unicodeslot=0x1E01, }, [0x1E02]={ - adobename="Bdotaccent", category="lu", description="LATIN CAPITAL LETTER B WITH DOT ABOVE", direction="l", @@ -56898,7 +55335,6 @@ characters.data={ unicodeslot=0x1E02, }, [0x1E03]={ - adobename="bdotaccent", category="ll", description="LATIN SMALL LETTER B WITH DOT ABOVE", direction="l", @@ -56909,7 +55345,6 @@ characters.data={ unicodeslot=0x1E03, }, [0x1E04]={ - adobename="Bdotbelow", category="lu", description="LATIN CAPITAL LETTER B WITH DOT BELOW", direction="l", @@ -56920,7 +55355,6 @@ characters.data={ unicodeslot=0x1E04, }, [0x1E05]={ - adobename="bdotbelow", category="ll", description="LATIN SMALL LETTER B WITH DOT BELOW", direction="l", @@ -56931,7 +55365,6 @@ characters.data={ unicodeslot=0x1E05, }, [0x1E06]={ - adobename="Blinebelow", category="lu", description="LATIN CAPITAL LETTER B WITH LINE BELOW", direction="l", @@ -56942,7 +55375,6 @@ characters.data={ unicodeslot=0x1E06, }, [0x1E07]={ - adobename="blinebelow", category="ll", description="LATIN SMALL LETTER B WITH LINE BELOW", direction="l", @@ -56953,7 +55385,6 @@ characters.data={ unicodeslot=0x1E07, }, [0x1E08]={ - adobename="Ccedillaacute", category="lu", description="LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE", direction="l", @@ -56964,7 +55395,6 @@ characters.data={ unicodeslot=0x1E08, }, [0x1E09]={ - adobename="ccedillaacute", category="ll", description="LATIN SMALL LETTER C WITH CEDILLA AND ACUTE", direction="l", @@ -56975,7 +55405,6 @@ characters.data={ unicodeslot=0x1E09, }, [0x1E0A]={ - adobename="Ddotaccent", category="lu", description="LATIN CAPITAL LETTER D WITH DOT ABOVE", direction="l", @@ -56986,7 +55415,6 @@ characters.data={ unicodeslot=0x1E0A, }, [0x1E0B]={ - adobename="ddotaccent", category="ll", description="LATIN SMALL LETTER D WITH DOT ABOVE", direction="l", @@ -56997,7 +55425,6 @@ characters.data={ unicodeslot=0x1E0B, }, [0x1E0C]={ - adobename="Ddotbelow", category="lu", description="LATIN CAPITAL LETTER D WITH DOT BELOW", direction="l", @@ -57008,7 +55435,6 @@ characters.data={ unicodeslot=0x1E0C, }, [0x1E0D]={ - adobename="ddotbelow", category="ll", description="LATIN SMALL LETTER D WITH DOT BELOW", direction="l", @@ -57019,7 +55445,6 @@ characters.data={ unicodeslot=0x1E0D, }, [0x1E0E]={ - adobename="Dlinebelow", category="lu", description="LATIN CAPITAL LETTER D WITH LINE BELOW", direction="l", @@ -57030,7 +55455,6 @@ characters.data={ unicodeslot=0x1E0E, }, [0x1E0F]={ - adobename="dlinebelow", category="ll", description="LATIN SMALL LETTER D WITH LINE BELOW", direction="l", @@ -57041,7 +55465,6 @@ characters.data={ unicodeslot=0x1E0F, }, [0x1E10]={ - adobename="Dcedilla", category="lu", description="LATIN CAPITAL LETTER D WITH CEDILLA", direction="l", @@ -57052,7 +55475,6 @@ characters.data={ unicodeslot=0x1E10, }, [0x1E11]={ - adobename="dcedilla", category="ll", description="LATIN SMALL LETTER D WITH CEDILLA", direction="l", @@ -57063,7 +55485,6 @@ characters.data={ unicodeslot=0x1E11, }, [0x1E12]={ - adobename="Dcircumflexbelow", category="lu", description="LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW", direction="l", @@ -57074,7 +55495,6 @@ characters.data={ unicodeslot=0x1E12, }, [0x1E13]={ - adobename="dcircumflexbelow", category="ll", description="LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW", direction="l", @@ -57085,7 +55505,6 @@ characters.data={ unicodeslot=0x1E13, }, [0x1E14]={ - adobename="Emacrongrave", category="lu", description="LATIN CAPITAL LETTER E WITH MACRON AND GRAVE", direction="l", @@ -57096,7 +55515,6 @@ characters.data={ unicodeslot=0x1E14, }, [0x1E15]={ - adobename="emacrongrave", category="ll", description="LATIN SMALL LETTER E WITH MACRON AND GRAVE", direction="l", @@ -57107,7 +55525,6 @@ characters.data={ unicodeslot=0x1E15, }, [0x1E16]={ - adobename="Emacronacute", category="lu", description="LATIN CAPITAL LETTER E WITH MACRON AND ACUTE", direction="l", @@ -57118,7 +55535,6 @@ characters.data={ unicodeslot=0x1E16, }, [0x1E17]={ - adobename="emacronacute", category="ll", description="LATIN SMALL LETTER E WITH MACRON AND ACUTE", direction="l", @@ -57129,7 +55545,6 @@ characters.data={ unicodeslot=0x1E17, }, [0x1E18]={ - adobename="Ecircumflexbelow", category="lu", description="LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW", direction="l", @@ -57140,7 +55555,6 @@ characters.data={ unicodeslot=0x1E18, }, [0x1E19]={ - adobename="ecircumflexbelow", category="ll", description="LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW", direction="l", @@ -57151,7 +55565,6 @@ characters.data={ unicodeslot=0x1E19, }, [0x1E1A]={ - adobename="Etildebelow", category="lu", description="LATIN CAPITAL LETTER E WITH TILDE BELOW", direction="l", @@ -57162,7 +55575,6 @@ characters.data={ unicodeslot=0x1E1A, }, [0x1E1B]={ - adobename="etildebelow", category="ll", description="LATIN SMALL LETTER E WITH TILDE BELOW", direction="l", @@ -57173,7 +55585,6 @@ characters.data={ unicodeslot=0x1E1B, }, [0x1E1C]={ - adobename="Ecedillabreve", category="lu", description="LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE", direction="l", @@ -57184,7 +55595,6 @@ characters.data={ unicodeslot=0x1E1C, }, [0x1E1D]={ - adobename="ecedillabreve", category="ll", description="LATIN SMALL LETTER E WITH CEDILLA AND BREVE", direction="l", @@ -57195,7 +55605,6 @@ characters.data={ unicodeslot=0x1E1D, }, [0x1E1E]={ - adobename="Fdotaccent", category="lu", description="LATIN CAPITAL LETTER F WITH DOT ABOVE", direction="l", @@ -57206,7 +55615,6 @@ characters.data={ unicodeslot=0x1E1E, }, [0x1E1F]={ - adobename="fdotaccent", category="ll", description="LATIN SMALL LETTER F WITH DOT ABOVE", direction="l", @@ -57217,7 +55625,6 @@ characters.data={ unicodeslot=0x1E1F, }, [0x1E20]={ - adobename="Gmacron", category="lu", description="LATIN CAPITAL LETTER G WITH MACRON", direction="l", @@ -57228,7 +55635,6 @@ characters.data={ unicodeslot=0x1E20, }, [0x1E21]={ - adobename="gmacron", category="ll", description="LATIN SMALL LETTER G WITH MACRON", direction="l", @@ -57239,7 +55645,6 @@ characters.data={ unicodeslot=0x1E21, }, [0x1E22]={ - adobename="Hdotaccent", category="lu", description="LATIN CAPITAL LETTER H WITH DOT ABOVE", direction="l", @@ -57250,7 +55655,6 @@ characters.data={ unicodeslot=0x1E22, }, [0x1E23]={ - adobename="hdotaccent", category="ll", description="LATIN SMALL LETTER H WITH DOT ABOVE", direction="l", @@ -57261,7 +55665,6 @@ characters.data={ unicodeslot=0x1E23, }, [0x1E24]={ - adobename="Hdotbelow", category="lu", description="LATIN CAPITAL LETTER H WITH DOT BELOW", direction="l", @@ -57272,7 +55675,6 @@ characters.data={ unicodeslot=0x1E24, }, [0x1E25]={ - adobename="hdotbelow", category="ll", description="LATIN SMALL LETTER H WITH DOT BELOW", direction="l", @@ -57283,7 +55685,6 @@ characters.data={ unicodeslot=0x1E25, }, [0x1E26]={ - adobename="Hdieresis", category="lu", description="LATIN CAPITAL LETTER H WITH DIAERESIS", direction="l", @@ -57294,7 +55695,6 @@ characters.data={ unicodeslot=0x1E26, }, [0x1E27]={ - adobename="hdieresis", category="ll", description="LATIN SMALL LETTER H WITH DIAERESIS", direction="l", @@ -57305,7 +55705,6 @@ characters.data={ unicodeslot=0x1E27, }, [0x1E28]={ - adobename="Hcedilla", category="lu", description="LATIN CAPITAL LETTER H WITH CEDILLA", direction="l", @@ -57316,7 +55715,6 @@ characters.data={ unicodeslot=0x1E28, }, [0x1E29]={ - adobename="hcedilla", category="ll", description="LATIN SMALL LETTER H WITH CEDILLA", direction="l", @@ -57327,7 +55725,6 @@ characters.data={ unicodeslot=0x1E29, }, [0x1E2A]={ - adobename="Hbrevebelow", category="lu", description="LATIN CAPITAL LETTER H WITH BREVE BELOW", direction="l", @@ -57338,7 +55735,6 @@ characters.data={ unicodeslot=0x1E2A, }, [0x1E2B]={ - adobename="hbrevebelow", category="ll", description="LATIN SMALL LETTER H WITH BREVE BELOW", direction="l", @@ -57349,7 +55745,6 @@ characters.data={ unicodeslot=0x1E2B, }, [0x1E2C]={ - adobename="Itildebelow", category="lu", description="LATIN CAPITAL LETTER I WITH TILDE BELOW", direction="l", @@ -57360,7 +55755,6 @@ characters.data={ unicodeslot=0x1E2C, }, [0x1E2D]={ - adobename="itildebelow", category="ll", description="LATIN SMALL LETTER I WITH TILDE BELOW", direction="l", @@ -57371,7 +55765,6 @@ characters.data={ unicodeslot=0x1E2D, }, [0x1E2E]={ - adobename="Idieresisacute", category="lu", description="LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE", direction="l", @@ -57382,7 +55775,6 @@ characters.data={ unicodeslot=0x1E2E, }, [0x1E2F]={ - adobename="idieresisacute", category="ll", description="LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE", direction="l", @@ -57393,7 +55785,6 @@ characters.data={ unicodeslot=0x1E2F, }, [0x1E30]={ - adobename="Kacute", category="lu", description="LATIN CAPITAL LETTER K WITH ACUTE", direction="l", @@ -57404,7 +55795,6 @@ characters.data={ unicodeslot=0x1E30, }, [0x1E31]={ - adobename="kacute", category="ll", description="LATIN SMALL LETTER K WITH ACUTE", direction="l", @@ -57415,7 +55805,6 @@ characters.data={ unicodeslot=0x1E31, }, [0x1E32]={ - adobename="Kdotbelow", category="lu", description="LATIN CAPITAL LETTER K WITH DOT BELOW", direction="l", @@ -57426,7 +55815,6 @@ characters.data={ unicodeslot=0x1E32, }, [0x1E33]={ - adobename="kdotbelow", category="ll", description="LATIN SMALL LETTER K WITH DOT BELOW", direction="l", @@ -57437,7 +55825,6 @@ characters.data={ unicodeslot=0x1E33, }, [0x1E34]={ - adobename="Klinebelow", category="lu", description="LATIN CAPITAL LETTER K WITH LINE BELOW", direction="l", @@ -57448,7 +55835,6 @@ characters.data={ unicodeslot=0x1E34, }, [0x1E35]={ - adobename="klinebelow", category="ll", description="LATIN SMALL LETTER K WITH LINE BELOW", direction="l", @@ -57459,7 +55845,6 @@ characters.data={ unicodeslot=0x1E35, }, [0x1E36]={ - adobename="Ldotbelow", category="lu", description="LATIN CAPITAL LETTER L WITH DOT BELOW", direction="l", @@ -57470,7 +55855,6 @@ characters.data={ unicodeslot=0x1E36, }, [0x1E37]={ - adobename="ldotbelow", category="ll", description="LATIN SMALL LETTER L WITH DOT BELOW", direction="l", @@ -57481,7 +55865,6 @@ characters.data={ unicodeslot=0x1E37, }, [0x1E38]={ - adobename="Ldotbelowmacron", category="lu", description="LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON", direction="l", @@ -57492,7 +55875,6 @@ characters.data={ unicodeslot=0x1E38, }, [0x1E39]={ - adobename="ldotbelowmacron", category="ll", description="LATIN SMALL LETTER L WITH DOT BELOW AND MACRON", direction="l", @@ -57503,7 +55885,6 @@ characters.data={ unicodeslot=0x1E39, }, [0x1E3A]={ - adobename="Llinebelow", category="lu", description="LATIN CAPITAL LETTER L WITH LINE BELOW", direction="l", @@ -57514,7 +55895,6 @@ characters.data={ unicodeslot=0x1E3A, }, [0x1E3B]={ - adobename="llinebelow", category="ll", description="LATIN SMALL LETTER L WITH LINE BELOW", direction="l", @@ -57525,7 +55905,6 @@ characters.data={ unicodeslot=0x1E3B, }, [0x1E3C]={ - adobename="Lcircumflexbelow", category="lu", description="LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW", direction="l", @@ -57536,7 +55915,6 @@ characters.data={ unicodeslot=0x1E3C, }, [0x1E3D]={ - adobename="lcircumflexbelow", category="ll", description="LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW", direction="l", @@ -57547,7 +55925,6 @@ characters.data={ unicodeslot=0x1E3D, }, [0x1E3E]={ - adobename="Macute", category="lu", description="LATIN CAPITAL LETTER M WITH ACUTE", direction="l", @@ -57558,7 +55935,6 @@ characters.data={ unicodeslot=0x1E3E, }, [0x1E3F]={ - adobename="macute", category="ll", description="LATIN SMALL LETTER M WITH ACUTE", direction="l", @@ -57569,7 +55945,6 @@ characters.data={ unicodeslot=0x1E3F, }, [0x1E40]={ - adobename="Mdotaccent", category="lu", description="LATIN CAPITAL LETTER M WITH DOT ABOVE", direction="l", @@ -57580,7 +55955,6 @@ characters.data={ unicodeslot=0x1E40, }, [0x1E41]={ - adobename="mdotaccent", category="ll", description="LATIN SMALL LETTER M WITH DOT ABOVE", direction="l", @@ -57591,7 +55965,6 @@ characters.data={ unicodeslot=0x1E41, }, [0x1E42]={ - adobename="Mdotbelow", category="lu", description="LATIN CAPITAL LETTER M WITH DOT BELOW", direction="l", @@ -57602,7 +55975,6 @@ characters.data={ unicodeslot=0x1E42, }, [0x1E43]={ - adobename="mdotbelow", category="ll", description="LATIN SMALL LETTER M WITH DOT BELOW", direction="l", @@ -57613,7 +55985,6 @@ characters.data={ unicodeslot=0x1E43, }, [0x1E44]={ - adobename="Ndotaccent", category="lu", description="LATIN CAPITAL LETTER N WITH DOT ABOVE", direction="l", @@ -57624,7 +55995,6 @@ characters.data={ unicodeslot=0x1E44, }, [0x1E45]={ - adobename="ndotaccent", category="ll", description="LATIN SMALL LETTER N WITH DOT ABOVE", direction="l", @@ -57635,7 +56005,6 @@ characters.data={ unicodeslot=0x1E45, }, [0x1E46]={ - adobename="Ndotbelow", category="lu", description="LATIN CAPITAL LETTER N WITH DOT BELOW", direction="l", @@ -57646,7 +56015,6 @@ characters.data={ unicodeslot=0x1E46, }, [0x1E47]={ - adobename="ndotbelow", category="ll", description="LATIN SMALL LETTER N WITH DOT BELOW", direction="l", @@ -57657,7 +56025,6 @@ characters.data={ unicodeslot=0x1E47, }, [0x1E48]={ - adobename="Nlinebelow", category="lu", description="LATIN CAPITAL LETTER N WITH LINE BELOW", direction="l", @@ -57668,7 +56035,6 @@ characters.data={ unicodeslot=0x1E48, }, [0x1E49]={ - adobename="nlinebelow", category="ll", description="LATIN SMALL LETTER N WITH LINE BELOW", direction="l", @@ -57679,7 +56045,6 @@ characters.data={ unicodeslot=0x1E49, }, [0x1E4A]={ - adobename="Ncircumflexbelow", category="lu", description="LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW", direction="l", @@ -57690,7 +56055,6 @@ characters.data={ unicodeslot=0x1E4A, }, [0x1E4B]={ - adobename="ncircumflexbelow", category="ll", description="LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW", direction="l", @@ -57701,7 +56065,6 @@ characters.data={ unicodeslot=0x1E4B, }, [0x1E4C]={ - adobename="Otildeacute", category="lu", description="LATIN CAPITAL LETTER O WITH TILDE AND ACUTE", direction="l", @@ -57712,7 +56075,6 @@ characters.data={ unicodeslot=0x1E4C, }, [0x1E4D]={ - adobename="otildeacute", category="ll", description="LATIN SMALL LETTER O WITH TILDE AND ACUTE", direction="l", @@ -57723,7 +56085,6 @@ characters.data={ unicodeslot=0x1E4D, }, [0x1E4E]={ - adobename="Otildedieresis", category="lu", description="LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS", direction="l", @@ -57734,7 +56095,6 @@ characters.data={ unicodeslot=0x1E4E, }, [0x1E4F]={ - adobename="otildedieresis", category="ll", description="LATIN SMALL LETTER O WITH TILDE AND DIAERESIS", direction="l", @@ -57745,7 +56105,6 @@ characters.data={ unicodeslot=0x1E4F, }, [0x1E50]={ - adobename="Omacrongrave", category="lu", description="LATIN CAPITAL LETTER O WITH MACRON AND GRAVE", direction="l", @@ -57756,7 +56115,6 @@ characters.data={ unicodeslot=0x1E50, }, [0x1E51]={ - adobename="omacrongrave", category="ll", description="LATIN SMALL LETTER O WITH MACRON AND GRAVE", direction="l", @@ -57767,7 +56125,6 @@ characters.data={ unicodeslot=0x1E51, }, [0x1E52]={ - adobename="Omacronacute", category="lu", description="LATIN CAPITAL LETTER O WITH MACRON AND ACUTE", direction="l", @@ -57778,7 +56135,6 @@ characters.data={ unicodeslot=0x1E52, }, [0x1E53]={ - adobename="omacronacute", category="ll", description="LATIN SMALL LETTER O WITH MACRON AND ACUTE", direction="l", @@ -57789,7 +56145,6 @@ characters.data={ unicodeslot=0x1E53, }, [0x1E54]={ - adobename="Pacute", category="lu", description="LATIN CAPITAL LETTER P WITH ACUTE", direction="l", @@ -57800,7 +56155,6 @@ characters.data={ unicodeslot=0x1E54, }, [0x1E55]={ - adobename="pacute", category="ll", description="LATIN SMALL LETTER P WITH ACUTE", direction="l", @@ -57811,7 +56165,6 @@ characters.data={ unicodeslot=0x1E55, }, [0x1E56]={ - adobename="Pdotaccent", category="lu", description="LATIN CAPITAL LETTER P WITH DOT ABOVE", direction="l", @@ -57822,7 +56175,6 @@ characters.data={ unicodeslot=0x1E56, }, [0x1E57]={ - adobename="pdotaccent", category="ll", description="LATIN SMALL LETTER P WITH DOT ABOVE", direction="l", @@ -57833,7 +56185,6 @@ characters.data={ unicodeslot=0x1E57, }, [0x1E58]={ - adobename="Rdotaccent", category="lu", description="LATIN CAPITAL LETTER R WITH DOT ABOVE", direction="l", @@ -57844,7 +56195,6 @@ characters.data={ unicodeslot=0x1E58, }, [0x1E59]={ - adobename="rdotaccent", category="ll", description="LATIN SMALL LETTER R WITH DOT ABOVE", direction="l", @@ -57855,7 +56205,6 @@ characters.data={ unicodeslot=0x1E59, }, [0x1E5A]={ - adobename="Rdotbelow", category="lu", description="LATIN CAPITAL LETTER R WITH DOT BELOW", direction="l", @@ -57866,7 +56215,6 @@ characters.data={ unicodeslot=0x1E5A, }, [0x1E5B]={ - adobename="rdotbelow", category="ll", description="LATIN SMALL LETTER R WITH DOT BELOW", direction="l", @@ -57877,7 +56225,6 @@ characters.data={ unicodeslot=0x1E5B, }, [0x1E5C]={ - adobename="Rdotbelowmacron", category="lu", description="LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON", direction="l", @@ -57888,7 +56235,6 @@ characters.data={ unicodeslot=0x1E5C, }, [0x1E5D]={ - adobename="rdotbelowmacron", category="ll", description="LATIN SMALL LETTER R WITH DOT BELOW AND MACRON", direction="l", @@ -57899,7 +56245,6 @@ characters.data={ unicodeslot=0x1E5D, }, [0x1E5E]={ - adobename="Rlinebelow", category="lu", description="LATIN CAPITAL LETTER R WITH LINE BELOW", direction="l", @@ -57910,7 +56255,6 @@ characters.data={ unicodeslot=0x1E5E, }, [0x1E5F]={ - adobename="rlinebelow", category="ll", description="LATIN SMALL LETTER R WITH LINE BELOW", direction="l", @@ -57921,7 +56265,6 @@ characters.data={ unicodeslot=0x1E5F, }, [0x1E60]={ - adobename="Sdotaccent", category="lu", description="LATIN CAPITAL LETTER S WITH DOT ABOVE", direction="l", @@ -57932,7 +56275,6 @@ characters.data={ unicodeslot=0x1E60, }, [0x1E61]={ - adobename="sdotaccent", category="ll", description="LATIN SMALL LETTER S WITH DOT ABOVE", direction="l", @@ -57943,7 +56285,6 @@ characters.data={ unicodeslot=0x1E61, }, [0x1E62]={ - adobename="Sdotbelow", category="lu", description="LATIN CAPITAL LETTER S WITH DOT BELOW", direction="l", @@ -57954,7 +56295,6 @@ characters.data={ unicodeslot=0x1E62, }, [0x1E63]={ - adobename="sdotbelow", category="ll", description="LATIN SMALL LETTER S WITH DOT BELOW", direction="l", @@ -57965,7 +56305,6 @@ characters.data={ unicodeslot=0x1E63, }, [0x1E64]={ - adobename="Sacutedotaccent", category="lu", description="LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE", direction="l", @@ -57976,7 +56315,6 @@ characters.data={ unicodeslot=0x1E64, }, [0x1E65]={ - adobename="sacutedotaccent", category="ll", description="LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE", direction="l", @@ -57987,7 +56325,6 @@ characters.data={ unicodeslot=0x1E65, }, [0x1E66]={ - adobename="Scarondotaccent", category="lu", description="LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE", direction="l", @@ -57998,7 +56335,6 @@ characters.data={ unicodeslot=0x1E66, }, [0x1E67]={ - adobename="scarondotaccent", category="ll", description="LATIN SMALL LETTER S WITH CARON AND DOT ABOVE", direction="l", @@ -58009,7 +56345,6 @@ characters.data={ unicodeslot=0x1E67, }, [0x1E68]={ - adobename="Sdotbelowdotaccent", category="lu", description="LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE", direction="l", @@ -58020,7 +56355,6 @@ characters.data={ unicodeslot=0x1E68, }, [0x1E69]={ - adobename="sdotbelowdotaccent", category="ll", description="LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE", direction="l", @@ -58031,7 +56365,6 @@ characters.data={ unicodeslot=0x1E69, }, [0x1E6A]={ - adobename="Tdotaccent", category="lu", description="LATIN CAPITAL LETTER T WITH DOT ABOVE", direction="l", @@ -58042,7 +56375,6 @@ characters.data={ unicodeslot=0x1E6A, }, [0x1E6B]={ - adobename="tdotaccent", category="ll", description="LATIN SMALL LETTER T WITH DOT ABOVE", direction="l", @@ -58053,7 +56385,6 @@ characters.data={ unicodeslot=0x1E6B, }, [0x1E6C]={ - adobename="Tdotbelow", category="lu", description="LATIN CAPITAL LETTER T WITH DOT BELOW", direction="l", @@ -58064,7 +56395,6 @@ characters.data={ unicodeslot=0x1E6C, }, [0x1E6D]={ - adobename="tdotbelow", category="ll", description="LATIN SMALL LETTER T WITH DOT BELOW", direction="l", @@ -58075,7 +56405,6 @@ characters.data={ unicodeslot=0x1E6D, }, [0x1E6E]={ - adobename="Tlinebelow", category="lu", description="LATIN CAPITAL LETTER T WITH LINE BELOW", direction="l", @@ -58086,7 +56415,6 @@ characters.data={ unicodeslot=0x1E6E, }, [0x1E6F]={ - adobename="tlinebelow", category="ll", description="LATIN SMALL LETTER T WITH LINE BELOW", direction="l", @@ -58097,7 +56425,6 @@ characters.data={ unicodeslot=0x1E6F, }, [0x1E70]={ - adobename="Tcircumflexbelow", category="lu", description="LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW", direction="l", @@ -58108,7 +56435,6 @@ characters.data={ unicodeslot=0x1E70, }, [0x1E71]={ - adobename="tcircumflexbelow", category="ll", description="LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW", direction="l", @@ -58119,7 +56445,6 @@ characters.data={ unicodeslot=0x1E71, }, [0x1E72]={ - adobename="Udieresisbelow", category="lu", description="LATIN CAPITAL LETTER U WITH DIAERESIS BELOW", direction="l", @@ -58130,7 +56455,6 @@ characters.data={ unicodeslot=0x1E72, }, [0x1E73]={ - adobename="udieresisbelow", category="ll", description="LATIN SMALL LETTER U WITH DIAERESIS BELOW", direction="l", @@ -58141,7 +56465,6 @@ characters.data={ unicodeslot=0x1E73, }, [0x1E74]={ - adobename="Utildebelow", category="lu", description="LATIN CAPITAL LETTER U WITH TILDE BELOW", direction="l", @@ -58152,7 +56475,6 @@ characters.data={ unicodeslot=0x1E74, }, [0x1E75]={ - adobename="utildebelow", category="ll", description="LATIN SMALL LETTER U WITH TILDE BELOW", direction="l", @@ -58163,7 +56485,6 @@ characters.data={ unicodeslot=0x1E75, }, [0x1E76]={ - adobename="Ucircumflexbelow", category="lu", description="LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW", direction="l", @@ -58174,7 +56495,6 @@ characters.data={ unicodeslot=0x1E76, }, [0x1E77]={ - adobename="ucircumflexbelow", category="ll", description="LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW", direction="l", @@ -58185,7 +56505,6 @@ characters.data={ unicodeslot=0x1E77, }, [0x1E78]={ - adobename="Utildeacute", category="lu", description="LATIN CAPITAL LETTER U WITH TILDE AND ACUTE", direction="l", @@ -58196,7 +56515,6 @@ characters.data={ unicodeslot=0x1E78, }, [0x1E79]={ - adobename="utildeacute", category="ll", description="LATIN SMALL LETTER U WITH TILDE AND ACUTE", direction="l", @@ -58207,7 +56525,6 @@ characters.data={ unicodeslot=0x1E79, }, [0x1E7A]={ - adobename="Umacrondieresis", category="lu", description="LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS", direction="l", @@ -58218,7 +56535,6 @@ characters.data={ unicodeslot=0x1E7A, }, [0x1E7B]={ - adobename="umacrondieresis", category="ll", description="LATIN SMALL LETTER U WITH MACRON AND DIAERESIS", direction="l", @@ -58229,7 +56545,6 @@ characters.data={ unicodeslot=0x1E7B, }, [0x1E7C]={ - adobename="Vtilde", category="lu", description="LATIN CAPITAL LETTER V WITH TILDE", direction="l", @@ -58240,7 +56555,6 @@ characters.data={ unicodeslot=0x1E7C, }, [0x1E7D]={ - adobename="vtilde", category="ll", description="LATIN SMALL LETTER V WITH TILDE", direction="l", @@ -58251,7 +56565,6 @@ characters.data={ unicodeslot=0x1E7D, }, [0x1E7E]={ - adobename="Vdotbelow", category="lu", description="LATIN CAPITAL LETTER V WITH DOT BELOW", direction="l", @@ -58262,7 +56575,6 @@ characters.data={ unicodeslot=0x1E7E, }, [0x1E7F]={ - adobename="vdotbelow", category="ll", description="LATIN SMALL LETTER V WITH DOT BELOW", direction="l", @@ -58273,7 +56585,6 @@ characters.data={ unicodeslot=0x1E7F, }, [0x1E80]={ - adobename="Wgrave", category="lu", description="LATIN CAPITAL LETTER W WITH GRAVE", direction="l", @@ -58284,7 +56595,6 @@ characters.data={ unicodeslot=0x1E80, }, [0x1E81]={ - adobename="wgrave", category="ll", description="LATIN SMALL LETTER W WITH GRAVE", direction="l", @@ -58295,7 +56605,6 @@ characters.data={ unicodeslot=0x1E81, }, [0x1E82]={ - adobename="Wacute", category="lu", description="LATIN CAPITAL LETTER W WITH ACUTE", direction="l", @@ -58306,7 +56615,6 @@ characters.data={ unicodeslot=0x1E82, }, [0x1E83]={ - adobename="wacute", category="ll", description="LATIN SMALL LETTER W WITH ACUTE", direction="l", @@ -58317,7 +56625,6 @@ characters.data={ unicodeslot=0x1E83, }, [0x1E84]={ - adobename="Wdieresis", category="lu", description="LATIN CAPITAL LETTER W WITH DIAERESIS", direction="l", @@ -58328,7 +56635,6 @@ characters.data={ unicodeslot=0x1E84, }, [0x1E85]={ - adobename="wdieresis", category="ll", description="LATIN SMALL LETTER W WITH DIAERESIS", direction="l", @@ -58339,7 +56645,6 @@ characters.data={ unicodeslot=0x1E85, }, [0x1E86]={ - adobename="Wdotaccent", category="lu", description="LATIN CAPITAL LETTER W WITH DOT ABOVE", direction="l", @@ -58350,7 +56655,6 @@ characters.data={ unicodeslot=0x1E86, }, [0x1E87]={ - adobename="wdotaccent", category="ll", description="LATIN SMALL LETTER W WITH DOT ABOVE", direction="l", @@ -58361,7 +56665,6 @@ characters.data={ unicodeslot=0x1E87, }, [0x1E88]={ - adobename="Wdotbelow", category="lu", description="LATIN CAPITAL LETTER W WITH DOT BELOW", direction="l", @@ -58372,7 +56675,6 @@ characters.data={ unicodeslot=0x1E88, }, [0x1E89]={ - adobename="wdotbelow", category="ll", description="LATIN SMALL LETTER W WITH DOT BELOW", direction="l", @@ -58383,7 +56685,6 @@ characters.data={ unicodeslot=0x1E89, }, [0x1E8A]={ - adobename="Xdotaccent", category="lu", description="LATIN CAPITAL LETTER X WITH DOT ABOVE", direction="l", @@ -58394,7 +56695,6 @@ characters.data={ unicodeslot=0x1E8A, }, [0x1E8B]={ - adobename="xdotaccent", category="ll", description="LATIN SMALL LETTER X WITH DOT ABOVE", direction="l", @@ -58405,7 +56705,6 @@ characters.data={ unicodeslot=0x1E8B, }, [0x1E8C]={ - adobename="Xdieresis", category="lu", description="LATIN CAPITAL LETTER X WITH DIAERESIS", direction="l", @@ -58416,7 +56715,6 @@ characters.data={ unicodeslot=0x1E8C, }, [0x1E8D]={ - adobename="xdieresis", category="ll", description="LATIN SMALL LETTER X WITH DIAERESIS", direction="l", @@ -58427,7 +56725,6 @@ characters.data={ unicodeslot=0x1E8D, }, [0x1E8E]={ - adobename="Ydotaccent", category="lu", description="LATIN CAPITAL LETTER Y WITH DOT ABOVE", direction="l", @@ -58438,7 +56735,6 @@ characters.data={ unicodeslot=0x1E8E, }, [0x1E8F]={ - adobename="ydotaccent", category="ll", description="LATIN SMALL LETTER Y WITH DOT ABOVE", direction="l", @@ -58449,7 +56745,6 @@ characters.data={ unicodeslot=0x1E8F, }, [0x1E90]={ - adobename="Zcircumflex", category="lu", description="LATIN CAPITAL LETTER Z WITH CIRCUMFLEX", direction="l", @@ -58460,7 +56755,6 @@ characters.data={ unicodeslot=0x1E90, }, [0x1E91]={ - adobename="zcircumflex", category="ll", description="LATIN SMALL LETTER Z WITH CIRCUMFLEX", direction="l", @@ -58471,7 +56765,6 @@ characters.data={ unicodeslot=0x1E91, }, [0x1E92]={ - adobename="Zdotbelow", category="lu", description="LATIN CAPITAL LETTER Z WITH DOT BELOW", direction="l", @@ -58482,7 +56775,6 @@ characters.data={ unicodeslot=0x1E92, }, [0x1E93]={ - adobename="zdotbelow", category="ll", description="LATIN SMALL LETTER Z WITH DOT BELOW", direction="l", @@ -58493,7 +56785,6 @@ characters.data={ unicodeslot=0x1E93, }, [0x1E94]={ - adobename="Zlinebelow", category="lu", description="LATIN CAPITAL LETTER Z WITH LINE BELOW", direction="l", @@ -58504,7 +56795,6 @@ characters.data={ unicodeslot=0x1E94, }, [0x1E95]={ - adobename="zlinebelow", category="ll", description="LATIN SMALL LETTER Z WITH LINE BELOW", direction="l", @@ -58515,7 +56805,6 @@ characters.data={ unicodeslot=0x1E95, }, [0x1E96]={ - adobename="hlinebelow", category="ll", description="LATIN SMALL LETTER H WITH LINE BELOW", direction="l", @@ -58526,7 +56815,6 @@ characters.data={ unicodeslot=0x1E96, }, [0x1E97]={ - adobename="tdieresis", category="ll", description="LATIN SMALL LETTER T WITH DIAERESIS", direction="l", @@ -58537,7 +56825,6 @@ characters.data={ unicodeslot=0x1E97, }, [0x1E98]={ - adobename="wring", category="ll", description="LATIN SMALL LETTER W WITH RING ABOVE", direction="l", @@ -58548,7 +56835,6 @@ characters.data={ unicodeslot=0x1E98, }, [0x1E99]={ - adobename="yring", category="ll", description="LATIN SMALL LETTER Y WITH RING ABOVE", direction="l", @@ -58559,7 +56845,6 @@ characters.data={ unicodeslot=0x1E99, }, [0x1E9A]={ - adobename="arighthalfring", category="ll", description="LATIN SMALL LETTER A WITH RIGHT HALF RING", direction="l", @@ -58570,7 +56855,6 @@ characters.data={ unicodeslot=0x1E9A, }, [0x1E9B]={ - adobename="slongdotaccent", category="ll", description="LATIN SMALL LETTER LONG S WITH DOT ABOVE", direction="l", @@ -58610,7 +56894,6 @@ characters.data={ unicodeslot=0x1E9F, }, [0x1EA0]={ - adobename="Adotbelow", category="lu", contextname="Adotbelow", description="LATIN CAPITAL LETTER A WITH DOT BELOW", @@ -58622,7 +56905,6 @@ characters.data={ unicodeslot=0x1EA0, }, [0x1EA1]={ - adobename="adotbelow", category="ll", contextname="adotbelow", description="LATIN SMALL LETTER A WITH DOT BELOW", @@ -58634,7 +56916,6 @@ characters.data={ unicodeslot=0x1EA1, }, [0x1EA2]={ - adobename="Ahookabove", category="lu", contextname="Ahook", description="LATIN CAPITAL LETTER A WITH HOOK ABOVE", @@ -58646,7 +56927,6 @@ characters.data={ unicodeslot=0x1EA2, }, [0x1EA3]={ - adobename="ahookabove", category="ll", contextname="ahook", description="LATIN SMALL LETTER A WITH HOOK ABOVE", @@ -58658,7 +56938,6 @@ characters.data={ unicodeslot=0x1EA3, }, [0x1EA4]={ - adobename="Acircumflexacute", category="lu", contextname="Acircumflexacute", description="LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE", @@ -58670,7 +56949,6 @@ characters.data={ unicodeslot=0x1EA4, }, [0x1EA5]={ - adobename="acircumflexacute", category="ll", contextname="acircumflexacute", description="LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE", @@ -58682,7 +56960,6 @@ characters.data={ unicodeslot=0x1EA5, }, [0x1EA6]={ - adobename="Acircumflexgrave", category="lu", contextname="Acircumflexgrave", description="LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE", @@ -58694,7 +56971,6 @@ characters.data={ unicodeslot=0x1EA6, }, [0x1EA7]={ - adobename="acircumflexgrave", category="ll", contextname="acircumflexgrave", description="LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE", @@ -58706,7 +56982,6 @@ characters.data={ unicodeslot=0x1EA7, }, [0x1EA8]={ - adobename="Acircumflexhookabove", category="lu", contextname="Acircumflexhook", description="LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE", @@ -58718,7 +56993,6 @@ characters.data={ unicodeslot=0x1EA8, }, [0x1EA9]={ - adobename="acircumflexhookabove", category="ll", contextname="acircumflexhook", description="LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE", @@ -58730,7 +57004,6 @@ characters.data={ unicodeslot=0x1EA9, }, [0x1EAA]={ - adobename="Acircumflextilde", category="lu", contextname="Acircumflextilde", description="LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE", @@ -58742,7 +57015,6 @@ characters.data={ unicodeslot=0x1EAA, }, [0x1EAB]={ - adobename="acircumflextilde", category="ll", contextname="acircumflextilde", description="LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE", @@ -58754,7 +57026,6 @@ characters.data={ unicodeslot=0x1EAB, }, [0x1EAC]={ - adobename="Acircumflexdotbelow", category="lu", contextname="Acircumflexdotbelow", description="LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW", @@ -58766,7 +57037,6 @@ characters.data={ unicodeslot=0x1EAC, }, [0x1EAD]={ - adobename="acircumflexdotbelow", category="ll", contextname="acircumflexdotbelow", description="LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW", @@ -58778,7 +57048,6 @@ characters.data={ unicodeslot=0x1EAD, }, [0x1EAE]={ - adobename="Abreveacute", category="lu", contextname="Abreveacute", description="LATIN CAPITAL LETTER A WITH BREVE AND ACUTE", @@ -58790,7 +57059,6 @@ characters.data={ unicodeslot=0x1EAE, }, [0x1EAF]={ - adobename="abreveacute", category="ll", contextname="abreveacute", description="LATIN SMALL LETTER A WITH BREVE AND ACUTE", @@ -58802,7 +57070,6 @@ characters.data={ unicodeslot=0x1EAF, }, [0x1EB0]={ - adobename="Abrevegrave", category="lu", contextname="Abrevegrave", description="LATIN CAPITAL LETTER A WITH BREVE AND GRAVE", @@ -58814,7 +57081,6 @@ characters.data={ unicodeslot=0x1EB0, }, [0x1EB1]={ - adobename="abrevegrave", category="ll", contextname="abrevegrave", description="LATIN SMALL LETTER A WITH BREVE AND GRAVE", @@ -58826,7 +57092,6 @@ characters.data={ unicodeslot=0x1EB1, }, [0x1EB2]={ - adobename="Abrevehookabove", category="lu", contextname="Abrevehook", description="LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE", @@ -58838,7 +57103,6 @@ characters.data={ unicodeslot=0x1EB2, }, [0x1EB3]={ - adobename="abrevehookabove", category="ll", contextname="abrevehook", description="LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE", @@ -58850,7 +57114,6 @@ characters.data={ unicodeslot=0x1EB3, }, [0x1EB4]={ - adobename="Abrevetilde", category="lu", contextname="Abrevetilde", description="LATIN CAPITAL LETTER A WITH BREVE AND TILDE", @@ -58862,7 +57125,6 @@ characters.data={ unicodeslot=0x1EB4, }, [0x1EB5]={ - adobename="abrevetilde", category="ll", contextname="abrevetilde", description="LATIN SMALL LETTER A WITH BREVE AND TILDE", @@ -58874,7 +57136,6 @@ characters.data={ unicodeslot=0x1EB5, }, [0x1EB6]={ - adobename="Abrevedotbelow", category="lu", contextname="Abrevedotbelow", description="LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW", @@ -58886,7 +57147,6 @@ characters.data={ unicodeslot=0x1EB6, }, [0x1EB7]={ - adobename="abrevedotbelow", category="ll", contextname="abrevedotbelow", description="LATIN SMALL LETTER A WITH BREVE AND DOT BELOW", @@ -58898,7 +57158,6 @@ characters.data={ unicodeslot=0x1EB7, }, [0x1EB8]={ - adobename="Edotbelow", category="lu", contextname="Edotbelow", description="LATIN CAPITAL LETTER E WITH DOT BELOW", @@ -58910,7 +57169,6 @@ characters.data={ unicodeslot=0x1EB8, }, [0x1EB9]={ - adobename="edotbelow", category="ll", contextname="edotbelow", description="LATIN SMALL LETTER E WITH DOT BELOW", @@ -58922,7 +57180,6 @@ characters.data={ unicodeslot=0x1EB9, }, [0x1EBA]={ - adobename="Ehookabove", category="lu", contextname="Ehook", description="LATIN CAPITAL LETTER E WITH HOOK ABOVE", @@ -58934,7 +57191,6 @@ characters.data={ unicodeslot=0x1EBA, }, [0x1EBB]={ - adobename="ehookabove", category="ll", contextname="ehook", description="LATIN SMALL LETTER E WITH HOOK ABOVE", @@ -58946,7 +57202,6 @@ characters.data={ unicodeslot=0x1EBB, }, [0x1EBC]={ - adobename="Etilde", category="lu", contextname="Etilde", description="LATIN CAPITAL LETTER E WITH TILDE", @@ -58958,7 +57213,6 @@ characters.data={ unicodeslot=0x1EBC, }, [0x1EBD]={ - adobename="etilde", category="ll", contextname="etilde", description="LATIN SMALL LETTER E WITH TILDE", @@ -58970,7 +57224,6 @@ characters.data={ unicodeslot=0x1EBD, }, [0x1EBE]={ - adobename="Ecircumflexacute", category="lu", contextname="Ecircumflexacute", description="LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE", @@ -58982,7 +57235,6 @@ characters.data={ unicodeslot=0x1EBE, }, [0x1EBF]={ - adobename="ecircumflexacute", category="ll", contextname="ecircumflexacute", description="LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE", @@ -58994,7 +57246,6 @@ characters.data={ unicodeslot=0x1EBF, }, [0x1EC0]={ - adobename="Ecircumflexgrave", category="lu", contextname="Ecircumflexgrave", description="LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE", @@ -59006,7 +57257,6 @@ characters.data={ unicodeslot=0x1EC0, }, [0x1EC1]={ - adobename="ecircumflexgrave", category="ll", contextname="ecircumflexgrave", description="LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE", @@ -59018,7 +57268,6 @@ characters.data={ unicodeslot=0x1EC1, }, [0x1EC2]={ - adobename="Ecircumflexhookabove", category="lu", contextname="Ecircumflexhook", description="LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE", @@ -59030,7 +57279,6 @@ characters.data={ unicodeslot=0x1EC2, }, [0x1EC3]={ - adobename="ecircumflexhookabove", category="ll", contextname="ecircumflexhook", description="LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE", @@ -59042,7 +57290,6 @@ characters.data={ unicodeslot=0x1EC3, }, [0x1EC4]={ - adobename="Ecircumflextilde", category="lu", contextname="Ecircumflextilde", description="LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE", @@ -59054,7 +57301,6 @@ characters.data={ unicodeslot=0x1EC4, }, [0x1EC5]={ - adobename="ecircumflextilde", category="ll", contextname="ecircumflextilde", description="LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE", @@ -59066,7 +57312,6 @@ characters.data={ unicodeslot=0x1EC5, }, [0x1EC6]={ - adobename="Ecircumflexdotbelow", category="lu", contextname="Ecircumflexdotbelow", description="LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW", @@ -59078,7 +57323,6 @@ characters.data={ unicodeslot=0x1EC6, }, [0x1EC7]={ - adobename="ecircumflexdotbelow", category="ll", contextname="ecircumflexdotbelow", description="LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW", @@ -59090,7 +57334,6 @@ characters.data={ unicodeslot=0x1EC7, }, [0x1EC8]={ - adobename="Ihookabove", category="lu", contextname="Ihook", description="LATIN CAPITAL LETTER I WITH HOOK ABOVE", @@ -59102,7 +57345,6 @@ characters.data={ unicodeslot=0x1EC8, }, [0x1EC9]={ - adobename="ihookabove", category="ll", contextname="ihook", description="LATIN SMALL LETTER I WITH HOOK ABOVE", @@ -59114,7 +57356,6 @@ characters.data={ unicodeslot=0x1EC9, }, [0x1ECA]={ - adobename="Idotbelow", category="lu", contextname="Idotbelow", description="LATIN CAPITAL LETTER I WITH DOT BELOW", @@ -59126,7 +57367,6 @@ characters.data={ unicodeslot=0x1ECA, }, [0x1ECB]={ - adobename="idotbelow", category="ll", contextname="idotbelow", description="LATIN SMALL LETTER I WITH DOT BELOW", @@ -59138,7 +57378,6 @@ characters.data={ unicodeslot=0x1ECB, }, [0x1ECC]={ - adobename="Odotbelow", category="lu", contextname="Odotbelow", description="LATIN CAPITAL LETTER O WITH DOT BELOW", @@ -59150,7 +57389,6 @@ characters.data={ unicodeslot=0x1ECC, }, [0x1ECD]={ - adobename="odotbelow", category="ll", contextname="odotbelow", description="LATIN SMALL LETTER O WITH DOT BELOW", @@ -59162,7 +57400,6 @@ characters.data={ unicodeslot=0x1ECD, }, [0x1ECE]={ - adobename="Ohookabove", category="lu", contextname="Ohook", description="LATIN CAPITAL LETTER O WITH HOOK ABOVE", @@ -59174,7 +57411,6 @@ characters.data={ unicodeslot=0x1ECE, }, [0x1ECF]={ - adobename="ohookabove", category="ll", contextname="ohook", description="LATIN SMALL LETTER O WITH HOOK ABOVE", @@ -59186,7 +57422,6 @@ characters.data={ unicodeslot=0x1ECF, }, [0x1ED0]={ - adobename="Ocircumflexacute", category="lu", contextname="Ocircumflexacute", description="LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE", @@ -59198,7 +57433,6 @@ characters.data={ unicodeslot=0x1ED0, }, [0x1ED1]={ - adobename="ocircumflexacute", category="ll", contextname="ocircumflexacute", description="LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE", @@ -59210,7 +57444,6 @@ characters.data={ unicodeslot=0x1ED1, }, [0x1ED2]={ - adobename="Ocircumflexgrave", category="lu", contextname="Ocircumflexgrave", description="LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE", @@ -59222,7 +57455,6 @@ characters.data={ unicodeslot=0x1ED2, }, [0x1ED3]={ - adobename="ocircumflexgrave", category="ll", contextname="ocircumflexgrave", description="LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE", @@ -59234,7 +57466,6 @@ characters.data={ unicodeslot=0x1ED3, }, [0x1ED4]={ - adobename="Ocircumflexhookabove", category="lu", contextname="Ocircumflexhook", description="LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE", @@ -59246,7 +57477,6 @@ characters.data={ unicodeslot=0x1ED4, }, [0x1ED5]={ - adobename="ocircumflexhookabove", category="ll", contextname="ocircumflexhook", description="LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE", @@ -59258,7 +57488,6 @@ characters.data={ unicodeslot=0x1ED5, }, [0x1ED6]={ - adobename="Ocircumflextilde", category="lu", contextname="Ocircumflextilde", description="LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE", @@ -59270,7 +57499,6 @@ characters.data={ unicodeslot=0x1ED6, }, [0x1ED7]={ - adobename="ocircumflextilde", category="ll", contextname="ocircumflextilde", description="LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE", @@ -59282,7 +57510,6 @@ characters.data={ unicodeslot=0x1ED7, }, [0x1ED8]={ - adobename="Ocircumflexdotbelow", category="lu", contextname="Ocircumflexdotbelow", description="LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW", @@ -59294,7 +57521,6 @@ characters.data={ unicodeslot=0x1ED8, }, [0x1ED9]={ - adobename="ocircumflexdotbelow", category="ll", contextname="ocircumflexdotbelow", description="LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW", @@ -59306,7 +57532,6 @@ characters.data={ unicodeslot=0x1ED9, }, [0x1EDA]={ - adobename="Ohornacute", category="lu", contextname="Ohornacute", description="LATIN CAPITAL LETTER O WITH HORN AND ACUTE", @@ -59318,7 +57543,6 @@ characters.data={ unicodeslot=0x1EDA, }, [0x1EDB]={ - adobename="ohornacute", category="ll", contextname="ohornacute", description="LATIN SMALL LETTER O WITH HORN AND ACUTE", @@ -59330,7 +57554,6 @@ characters.data={ unicodeslot=0x1EDB, }, [0x1EDC]={ - adobename="Ohorngrave", category="lu", contextname="Ohorngrave", description="LATIN CAPITAL LETTER O WITH HORN AND GRAVE", @@ -59342,7 +57565,6 @@ characters.data={ unicodeslot=0x1EDC, }, [0x1EDD]={ - adobename="ohorngrave", category="ll", contextname="ohorngrave", description="LATIN SMALL LETTER O WITH HORN AND GRAVE", @@ -59354,7 +57576,6 @@ characters.data={ unicodeslot=0x1EDD, }, [0x1EDE]={ - adobename="Ohornhookabove", category="lu", contextname="Ohornhook", description="LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE", @@ -59366,7 +57587,6 @@ characters.data={ unicodeslot=0x1EDE, }, [0x1EDF]={ - adobename="ohornhookabove", category="ll", contextname="ohornhook", description="LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE", @@ -59378,7 +57598,6 @@ characters.data={ unicodeslot=0x1EDF, }, [0x1EE0]={ - adobename="Ohorntilde", category="lu", contextname="Ohorntilde", description="LATIN CAPITAL LETTER O WITH HORN AND TILDE", @@ -59390,7 +57609,6 @@ characters.data={ unicodeslot=0x1EE0, }, [0x1EE1]={ - adobename="ohorntilde", category="ll", contextname="ohorntilde", description="LATIN SMALL LETTER O WITH HORN AND TILDE", @@ -59402,7 +57620,6 @@ characters.data={ unicodeslot=0x1EE1, }, [0x1EE2]={ - adobename="Ohorndotbelow", category="lu", contextname="Ohorndotbelow", description="LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW", @@ -59414,7 +57631,6 @@ characters.data={ unicodeslot=0x1EE2, }, [0x1EE3]={ - adobename="ohorndotbelow", category="ll", contextname="ohorndotbelow", description="LATIN SMALL LETTER O WITH HORN AND DOT BELOW", @@ -59426,7 +57642,6 @@ characters.data={ unicodeslot=0x1EE3, }, [0x1EE4]={ - adobename="Udotbelow", category="lu", contextname="Udotbelow", description="LATIN CAPITAL LETTER U WITH DOT BELOW", @@ -59438,7 +57653,6 @@ characters.data={ unicodeslot=0x1EE4, }, [0x1EE5]={ - adobename="udotbelow", category="ll", contextname="udotbelow", description="LATIN SMALL LETTER U WITH DOT BELOW", @@ -59450,7 +57664,6 @@ characters.data={ unicodeslot=0x1EE5, }, [0x1EE6]={ - adobename="Uhookabove", category="lu", contextname="Uhook", description="LATIN CAPITAL LETTER U WITH HOOK ABOVE", @@ -59462,7 +57675,6 @@ characters.data={ unicodeslot=0x1EE6, }, [0x1EE7]={ - adobename="uhookabove", category="ll", contextname="uhook", description="LATIN SMALL LETTER U WITH HOOK ABOVE", @@ -59474,7 +57686,6 @@ characters.data={ unicodeslot=0x1EE7, }, [0x1EE8]={ - adobename="Uhornacute", category="lu", contextname="Uhornacute", description="LATIN CAPITAL LETTER U WITH HORN AND ACUTE", @@ -59486,7 +57697,6 @@ characters.data={ unicodeslot=0x1EE8, }, [0x1EE9]={ - adobename="uhornacute", category="ll", contextname="uhornacute", description="LATIN SMALL LETTER U WITH HORN AND ACUTE", @@ -59498,7 +57708,6 @@ characters.data={ unicodeslot=0x1EE9, }, [0x1EEA]={ - adobename="Uhorngrave", category="lu", contextname="Uhorngrave", description="LATIN CAPITAL LETTER U WITH HORN AND GRAVE", @@ -59510,7 +57719,6 @@ characters.data={ unicodeslot=0x1EEA, }, [0x1EEB]={ - adobename="uhorngrave", category="ll", contextname="uhorngrave", description="LATIN SMALL LETTER U WITH HORN AND GRAVE", @@ -59522,7 +57730,6 @@ characters.data={ unicodeslot=0x1EEB, }, [0x1EEC]={ - adobename="Uhornhookabove", category="lu", contextname="Uhornhook", description="LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE", @@ -59534,7 +57741,6 @@ characters.data={ unicodeslot=0x1EEC, }, [0x1EED]={ - adobename="uhornhookabove", category="ll", contextname="uhornhook", description="LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE", @@ -59546,7 +57752,6 @@ characters.data={ unicodeslot=0x1EED, }, [0x1EEE]={ - adobename="Uhorntilde", category="lu", contextname="Uhorntilde", description="LATIN CAPITAL LETTER U WITH HORN AND TILDE", @@ -59558,7 +57763,6 @@ characters.data={ unicodeslot=0x1EEE, }, [0x1EEF]={ - adobename="uhorntilde", category="ll", contextname="uhorntilde", description="LATIN SMALL LETTER U WITH HORN AND TILDE", @@ -59570,7 +57774,6 @@ characters.data={ unicodeslot=0x1EEF, }, [0x1EF0]={ - adobename="Uhorndotbelow", category="lu", contextname="Uhorndotbelow", description="LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW", @@ -59582,7 +57785,6 @@ characters.data={ unicodeslot=0x1EF0, }, [0x1EF1]={ - adobename="uhorndotbelow", category="ll", contextname="uhorndotbelow", description="LATIN SMALL LETTER U WITH HORN AND DOT BELOW", @@ -59594,7 +57796,6 @@ characters.data={ unicodeslot=0x1EF1, }, [0x1EF2]={ - adobename="Ygrave", category="lu", contextname="Ygrave", description="LATIN CAPITAL LETTER Y WITH GRAVE", @@ -59606,7 +57807,6 @@ characters.data={ unicodeslot=0x1EF2, }, [0x1EF3]={ - adobename="ygrave", category="ll", contextname="ygrave", description="LATIN SMALL LETTER Y WITH GRAVE", @@ -59618,7 +57818,6 @@ characters.data={ unicodeslot=0x1EF3, }, [0x1EF4]={ - adobename="Ydotbelow", category="lu", contextname="Ydotbelow", description="LATIN CAPITAL LETTER Y WITH DOT BELOW", @@ -59630,7 +57829,6 @@ characters.data={ unicodeslot=0x1EF4, }, [0x1EF5]={ - adobename="ydotbelow", category="ll", contextname="ydotbelow", description="LATIN SMALL LETTER Y WITH DOT BELOW", @@ -59642,7 +57840,6 @@ characters.data={ unicodeslot=0x1EF5, }, [0x1EF6]={ - adobename="Yhookabove", category="lu", description="LATIN CAPITAL LETTER Y WITH HOOK ABOVE", direction="l", @@ -59653,7 +57850,6 @@ characters.data={ unicodeslot=0x1EF6, }, [0x1EF7]={ - adobename="yhookabove", category="ll", description="LATIN SMALL LETTER Y WITH HOOK ABOVE", direction="l", @@ -59664,7 +57860,6 @@ characters.data={ unicodeslot=0x1EF7, }, [0x1EF8]={ - adobename="Ytilde", category="lu", contextname="Ytilde", description="LATIN CAPITAL LETTER Y WITH TILDE", @@ -59676,7 +57871,6 @@ characters.data={ unicodeslot=0x1EF8, }, [0x1EF9]={ - adobename="ytilde", category="ll", contextname="ytilde", description="LATIN SMALL LETTER Y WITH TILDE", @@ -62284,7 +60478,6 @@ characters.data={ unicodeslot=0x2001, }, [0x2002]={ - adobename="enspace", category="zs", contextname="enspace", description="EN SPACE", @@ -62370,17 +60563,24 @@ characters.data={ unicodeslot=0x200A, }, [0x200B]={ - adobename="zerowidthspace", category="cf", contextname="zerowidthspace", description="ZERO WIDTH SPACE", direction="bn", linebreak="zw", + mathclass="ordinary", + mathspec={ + { + class="ghost", + group="whatever", + meaning="notimes", + name="notimes", + }, + }, synonyms={ "zwsp" }, unicodeslot=0x200B, }, [0x200C]={ - adobename="zerowidthnonjoiner", arabic="u", category="cf", contextname="zwnj", @@ -62392,7 +60592,6 @@ characters.data={ unicodeslot=0x200C, }, [0x200D]={ - adobename="afii301", arabic="c", category="cf", contextname="zwj", @@ -62404,7 +60603,6 @@ characters.data={ unicodeslot=0x200D, }, [0x200E]={ - adobename="afii299", category="cf", description="LEFT-TO-RIGHT MARK", direction="l", @@ -62413,7 +60611,6 @@ characters.data={ unicodeslot=0x200E, }, [0x200F]={ - adobename="afii300", category="cf", description="RIGHT-TO-LEFT MARK", direction="r", @@ -62422,7 +60619,6 @@ characters.data={ unicodeslot=0x200F, }, [0x2010]={ - adobename="hyphentwo", category="pd", cjkwd="a", description="HYPHEN", @@ -62441,7 +60637,6 @@ characters.data={ unicodeslot=0x2011, }, [0x2012]={ - adobename="figuredash", category="pd", contextname="figuredash", contextspec={ "textminus" }, @@ -62452,7 +60647,6 @@ characters.data={ unicodeslot=0x2012, }, [0x2013]={ - adobename="endash", category="pd", cjkwd="a", contextname="endash", @@ -62463,7 +60657,6 @@ characters.data={ unicodeslot=0x2013, }, [0x2014]={ - adobename="emdash", category="pd", cjkwd="a", contextname="emdash", @@ -62474,7 +60667,6 @@ characters.data={ unicodeslot=0x2014, }, [0x2015]={ - adobename="horizontalbar", category="pd", cjkwd="a", contextname="texthorizontalbar", @@ -62485,7 +60677,6 @@ characters.data={ unicodeslot=0x2015, }, [0x2016]={ - adobename="dblverticalbar", category="po", cjkwd="a", description="DOUBLE VERTICAL LINE", @@ -62521,7 +60712,6 @@ characters.data={ unicodeslot=0x2016, }, [0x2017]={ - adobename="underscoredbl", category="po", description="DOUBLE LOW LINE", direction="on", @@ -62531,7 +60721,6 @@ characters.data={ unicodeslot=0x2017, }, [0x2018]={ - adobename="quoteleft", category="pi", cjkwd="a", contextname="quoteleft", @@ -62542,7 +60731,6 @@ characters.data={ unicodeslot=0x2018, }, [0x2019]={ - adobename="quoteright", category="pf", cjkwd="a", contextname="quoteright", @@ -62553,7 +60741,6 @@ characters.data={ unicodeslot=0x2019, }, [0x201A]={ - adobename="quotesinglbase", category="ps", contextname="quotesinglebase", description="SINGLE LOW-0x0009 QUOTATION MARK", @@ -62563,7 +60750,6 @@ characters.data={ unicodeslot=0x201A, }, [0x201B]={ - adobename="quotereversed", category="pi", description="SINGLE HIGH-REVERSED-0x0009 QUOTATION MARK", direction="on", @@ -62572,7 +60758,6 @@ characters.data={ unicodeslot=0x201B, }, [0x201C]={ - adobename="quotedblleft", category="pi", cjkwd="a", contextname="quotedblleft", @@ -62583,7 +60768,6 @@ characters.data={ unicodeslot=0x201C, }, [0x201D]={ - adobename="quotedblright", category="pf", cjkwd="a", contextname="quotedblright", @@ -62594,7 +60778,6 @@ characters.data={ unicodeslot=0x201D, }, [0x201E]={ - adobename="quotedblbase", category="ps", contextname="quotedblbase", description="DOUBLE LOW-0x0009 QUOTATION MARK", @@ -62612,7 +60795,6 @@ characters.data={ unicodeslot=0x201F, }, [0x2020]={ - adobename="dagger", category="po", cjkwd="a", contextname="textdag", @@ -62633,7 +60815,6 @@ characters.data={ unicodeslot=0x2020, }, [0x2021]={ - adobename="daggerdbl", category="po", cjkwd="a", contextname="textddag", @@ -62654,7 +60835,6 @@ characters.data={ unicodeslot=0x2021, }, [0x2022]={ - adobename="bullet", category="po", cjkwd="a", contextname="textbullet", @@ -62674,7 +60854,6 @@ characters.data={ unicodeslot=0x2023, }, [0x2024]={ - adobename="onedotenleader", category="po", cjkwd="a", description="ONE DOT LEADER", @@ -62684,7 +60863,6 @@ characters.data={ unicodeslot=0x2024, }, [0x2025]={ - adobename="twodotleader", category="po", cjkwd="a", description="TWO DOT LEADER", @@ -62694,7 +60872,6 @@ characters.data={ unicodeslot=0x2025, }, [0x2026]={ - adobename="ellipsis", category="po", cjkwd="a", contextname="textellipsis", @@ -62704,6 +60881,8 @@ characters.data={ mathspec={ { class="ellipsis", + group="punctuation", + meaning="and so on", name="ldots", }, { @@ -62754,7 +60933,6 @@ characters.data={ unicodeslot=0x202B, }, [0x202C]={ - adobename="afii61573", category="cf", description="POP DIRECTIONAL FORMATTING", direction="pdf", @@ -62763,7 +60941,6 @@ characters.data={ unicodeslot=0x202C, }, [0x202D]={ - adobename="afii61574", category="cf", description="LEFT-TO-RIGHT OVERRIDE", direction="lro", @@ -62772,7 +60949,6 @@ characters.data={ unicodeslot=0x202D, }, [0x202E]={ - adobename="afii61575", category="cf", description="RIGHT-TO-LEFT OVERRIDE", direction="rlo", @@ -62793,7 +60969,6 @@ characters.data={ unicodeslot=0x202F, }, [0x2030]={ - adobename="perthousand", category="po", cjkwd="a", contextname="perthousand", @@ -62811,26 +60986,48 @@ characters.data={ unicodeslot=0x2031, }, [0x2032]={ - adobename="minute", category="po", cjkwd="a", description="PRIME", direction="et", linebreak="po", - mathclass="prime", - mathname="prime", + mathspec={ + { + class="prime", + group="prime", + meaning="prime", + name="prime", + }, + { + class="prime", + group="postfix operator", + meaning="derivative", + name="derivativesymbol", + }, + }, synonyms={ "feet", "minutes" }, unicodeslot=0x2032, }, [0x2033]={ - adobename="second", category="po", cjkwd="a", description="DOUBLE PRIME", direction="et", linebreak="po", - mathclass="prime", - mathname="doubleprime", + mathspec={ + { + class="prime", + group="prime", + meaning="double prime", + name="doubleprime", + }, + { + class="prime", + group="postfix operator", + meaning="second derivative", + name="secondderivativesymbol", + }, + }, specials={ "compat", 0x2032, 0x2032 }, synonyms={ "inches", "seconds" }, unicodeslot=0x2033, @@ -62840,19 +61037,32 @@ characters.data={ description="TRIPLE PRIME", direction="et", linebreak="po", - mathclass="prime", - mathname="tripleprime", + mathspec={ + { + class="prime", + group="prime", + meaning="triple prime", + name="tripleprime", + }, + { + class="prime", + group="postfix operator", + meaning="third derivative", + name="thirdderivativesymbol", + }, + }, specials={ "compat", 0x2032, 0x2032, 0x2032 }, unicodeslot=0x2034, }, [0x2035]={ - adobename="primereversed", category="po", cjkwd="a", description="REVERSED PRIME", direction="on", linebreak="po", mathclass="prime", + mathgroup="prime", + mathmeaning="reversed prime", mathname="reversedprime", unicodeslot=0x2035, }, @@ -62862,6 +61072,8 @@ characters.data={ direction="on", linebreak="po", mathclass="prime", + mathgroup="prime", + mathmeaning="reversed doubleprime", mathname="reverseddoubleprime", specials={ "compat", 0x2035, 0x2035 }, unicodeslot=0x2036, @@ -62872,6 +61084,8 @@ characters.data={ direction="on", linebreak="po", mathclass="prime", + mathgroup="prime", + mathmeaning="reversed triple prime", mathname="reversedtripleprime", specials={ "compat", 0x2035, 0x2035, 0x2035 }, unicodeslot=0x2037, @@ -62884,7 +61098,6 @@ characters.data={ unicodeslot=0x2038, }, [0x2039]={ - adobename="guilsinglleft", category="pi", contextname="guilsingleleft", description="SINGLE LEFT-POINTING ANGLE QUOTATION MARK", @@ -62896,7 +61109,6 @@ characters.data={ unicodeslot=0x2039, }, [0x203A]={ - adobename="guilsinglright", category="pf", contextname="guilsingleright", description="SINGLE RIGHT-POINTING ANGLE QUOTATION MARK", @@ -62908,7 +61120,6 @@ characters.data={ unicodeslot=0x203A, }, [0x203B]={ - adobename="referencemark", category="po", cjkwd="a", description="REFERENCE MARK", @@ -62918,7 +61129,6 @@ characters.data={ unicodeslot=0x203B, }, [0x203C]={ - adobename="exclamdbl", category="po", description="DOUBLE EXCLAMATION MARK", direction="on", @@ -62935,7 +61145,6 @@ characters.data={ unicodeslot=0x203D, }, [0x203E]={ - adobename="overline", category="po", cjkwd="a", comment="mathspec={ { class=\"topaccent\", name=\"overbar\" }, { class=\"botaccent\", name=\"underbar\" } }\"", @@ -62983,7 +61192,6 @@ characters.data={ unicodeslot=0x2041, }, [0x2042]={ - adobename="asterism", category="po", description="ASTERISM", direction="on", @@ -62998,7 +61206,6 @@ characters.data={ unicodeslot=0x2043, }, [0x2044]={ - adobename="fraction", category="sm", contextname="textfraction", description="FRACTION SLASH", @@ -63146,8 +61353,20 @@ characters.data={ description="QUADRUPLE PRIME", direction="on", linebreak="po", - mathclass="prime", - mathname="quadrupleprime", + mathspec={ + { + class="prime", + group="prime", + meaning="quadruple prime", + name="quadrupleprime", + }, + { + class="prime", + group="postfix operator", + meaning="fourth derivative", + name="fourthderivativesymbol", + }, + }, specials={ "compat", 0x2032, 0x2032, 0x2032, 0x2032 }, unicodeslot=0x2057, }, @@ -63226,8 +61445,21 @@ characters.data={ description="FUNCTION APPLICATION", direction="bn", linebreak="al", - mathclass="ghost", - mathname="applyfunction", + mathclass="ordinary", + mathspec={ + { + class="ghost", + group="whatever", + meaning="applyfunction", + name="applyfunction", + }, + { + class="ghost", + group="whatever2", + meaning="applyfunctionof", + name="applyfunctionof", + }, + }, unicodeslot=0x2061, }, [0x2062]={ @@ -63336,7 +61568,6 @@ characters.data={ unicodeslot=0x206F, }, [0x2070]={ - adobename="zerosuperior", category="no", description="SUPERSCRIPT ZERO", direction="en", @@ -63353,7 +61584,6 @@ characters.data={ unicodeslot=0x2071, }, [0x2074]={ - adobename="foursuperior", category="no", cjkwd="a", description="SUPERSCRIPT FOUR", @@ -63363,7 +61593,6 @@ characters.data={ unicodeslot=0x2074, }, [0x2075]={ - adobename="fivesuperior", category="no", description="SUPERSCRIPT FIVE", direction="en", @@ -63372,7 +61601,6 @@ characters.data={ unicodeslot=0x2075, }, [0x2076]={ - adobename="sixsuperior", category="no", description="SUPERSCRIPT SIX", direction="en", @@ -63381,7 +61609,6 @@ characters.data={ unicodeslot=0x2076, }, [0x2077]={ - adobename="sevensuperior", category="no", description="SUPERSCRIPT SEVEN", direction="en", @@ -63390,7 +61617,6 @@ characters.data={ unicodeslot=0x2077, }, [0x2078]={ - adobename="eightsuperior", category="no", description="SUPERSCRIPT EIGHT", direction="en", @@ -63399,7 +61625,6 @@ characters.data={ unicodeslot=0x2078, }, [0x2079]={ - adobename="ninesuperior", category="no", description="SUPERSCRIPT NINE", direction="en", @@ -63408,7 +61633,6 @@ characters.data={ unicodeslot=0x2079, }, [0x207A]={ - adobename="plussuperior", category="sm", description="SUPERSCRIPT PLUS SIGN", direction="es", @@ -63429,7 +61653,6 @@ characters.data={ unicodeslot=0x207B, }, [0x207C]={ - adobename="equalsuperior", category="sm", description="SUPERSCRIPT EQUALS SIGN", direction="on", @@ -63438,7 +61661,6 @@ characters.data={ unicodeslot=0x207C, }, [0x207D]={ - adobename="parenleftsuperior", category="ps", description="SUPERSCRIPT LEFT PARENTHESIS", direction="on", @@ -63449,7 +61671,6 @@ characters.data={ unicodeslot=0x207D, }, [0x207E]={ - adobename="parenrightsuperior", category="pe", description="SUPERSCRIPT RIGHT PARENTHESIS", direction="on", @@ -63460,7 +61681,6 @@ characters.data={ unicodeslot=0x207E, }, [0x207F]={ - adobename="nsuperior", category="ll", cjkwd="a", description="SUPERSCRIPT LATIN SMALL LETTER N", @@ -63470,7 +61690,6 @@ characters.data={ unicodeslot=0x207F, }, [0x2080]={ - adobename="zeroinferior", category="no", description="SUBSCRIPT ZERO", direction="en", @@ -63479,7 +61698,6 @@ characters.data={ unicodeslot=0x2080, }, [0x2081]={ - adobename="oneinferior", category="no", cjkwd="a", description="SUBSCRIPT ONE", @@ -63489,7 +61707,6 @@ characters.data={ unicodeslot=0x2081, }, [0x2082]={ - adobename="twoinferior", category="no", cjkwd="a", description="SUBSCRIPT TWO", @@ -63499,7 +61716,6 @@ characters.data={ unicodeslot=0x2082, }, [0x2083]={ - adobename="threeinferior", category="no", cjkwd="a", description="SUBSCRIPT THREE", @@ -63509,7 +61725,6 @@ characters.data={ unicodeslot=0x2083, }, [0x2084]={ - adobename="fourinferior", category="no", cjkwd="a", description="SUBSCRIPT FOUR", @@ -63519,7 +61734,6 @@ characters.data={ unicodeslot=0x2084, }, [0x2085]={ - adobename="fiveinferior", category="no", description="SUBSCRIPT FIVE", direction="en", @@ -63528,7 +61742,6 @@ characters.data={ unicodeslot=0x2085, }, [0x2086]={ - adobename="sixinferior", category="no", description="SUBSCRIPT SIX", direction="en", @@ -63537,7 +61750,6 @@ characters.data={ unicodeslot=0x2086, }, [0x2087]={ - adobename="seveninferior", category="no", description="SUBSCRIPT SEVEN", direction="en", @@ -63546,7 +61758,6 @@ characters.data={ unicodeslot=0x2087, }, [0x2088]={ - adobename="eightinferior", category="no", description="SUBSCRIPT EIGHT", direction="en", @@ -63555,7 +61766,6 @@ characters.data={ unicodeslot=0x2088, }, [0x2089]={ - adobename="nineinferior", category="no", description="SUBSCRIPT NINE", direction="en", @@ -63588,7 +61798,6 @@ characters.data={ unicodeslot=0x208C, }, [0x208D]={ - adobename="parenleftinferior", category="ps", description="SUBSCRIPT LEFT PARENTHESIS", direction="on", @@ -63599,7 +61808,6 @@ characters.data={ unicodeslot=0x208D, }, [0x208E]={ - adobename="parenrightinferior", category="pe", description="SUBSCRIPT RIGHT PARENTHESIS", direction="on", @@ -63721,7 +61929,6 @@ characters.data={ unicodeslot=0x20A0, }, [0x20A1]={ - adobename="colonsign", category="sc", description="COLON SIGN", direction="et", @@ -63730,7 +61937,6 @@ characters.data={ unicodeslot=0x20A1, }, [0x20A2]={ - adobename="cruzeiro", category="sc", description="CRUZEIRO SIGN", direction="et", @@ -63739,7 +61945,6 @@ characters.data={ unicodeslot=0x20A2, }, [0x20A3]={ - adobename="franc", category="sc", description="FRENCH FRANC SIGN", direction="et", @@ -63748,7 +61953,6 @@ characters.data={ unicodeslot=0x20A3, }, [0x20A4]={ - adobename="lira", category="sc", description="LIRA SIGN", direction="et", @@ -63772,7 +61976,6 @@ characters.data={ unicodeslot=0x20A6, }, [0x20A7]={ - adobename="peseta", category="sc", description="PESETA SIGN", direction="et", @@ -63790,7 +61993,6 @@ characters.data={ unicodeslot=0x20A8, }, [0x20A9]={ - adobename="won", category="sc", cjkwd="h", description="WON SIGN", @@ -63800,7 +62002,6 @@ characters.data={ unicodeslot=0x20A9, }, [0x20AA]={ - adobename="sheqelhebrew", category="sc", description="NEW SHEQEL SIGN", direction="et", @@ -63809,7 +62010,6 @@ characters.data={ unicodeslot=0x20AA, }, [0x20AB]={ - adobename="dong", category="sc", contextname="textdong", description="DONG SIGN", @@ -63819,7 +62019,6 @@ characters.data={ unicodeslot=0x20AB, }, [0x20AC]={ - adobename="euro", category="sc", cjkwd="a", contextname="texteuro", @@ -64034,9 +62233,9 @@ characters.data={ combining=0xE6, description="COMBINING LEFT ARROW ABOVE", direction="nsm", + linebreak="cm", mathclass="topaccent", mathstretch="h", - linebreak="cm", unicodeslot=0x20D6, }, [0x20D7]={ @@ -64277,6 +62476,7 @@ characters.data={ description="ACCOUNT OF", direction="on", linebreak="al", + mathclass="variable", specials={ "compat", 0x61, 0x2F, 0x63 }, unicodeslot=0x2100, }, @@ -64285,6 +62485,7 @@ characters.data={ description="ADDRESSED TO THE SUBJECT", direction="on", linebreak="al", + mathclass="variable", specials={ "compat", 0x61, 0x2F, 0x73 }, unicodeslot=0x2101, }, @@ -64293,20 +62494,27 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL C", direction="l", linebreak="al", - mathgroup="constant set", - mathname="complexes", + mathclass="variable", + mathspec={ + { + class="ordinary", + group="number set", + meaning="the complex numbers", + name="complexes", + }, + }, specials={ "font", 0x43 }, synonyms={ "complex numbers", "the set of complex numbers" }, unicodeslot=0x2102, }, [0x2103]={ - adobename="centigrade", category="so", cjkwd="a", contextname="textcelsius", description="DEGREE CELSIUS", direction="on", linebreak="po", + mathclass="variable", specials={ "compat", 0xB0, 0x43 }, synonyms={ "degrees centigrade" }, unicodeslot=0x2103, @@ -64316,16 +62524,17 @@ characters.data={ description="CENTRE LINE SYMBOL", direction="on", linebreak="al", + mathclass="variable", synonyms={ "clone" }, unicodeslot=0x2104, }, [0x2105]={ - adobename="careof", category="so", cjkwd="a", description="CARE OF", direction="on", linebreak="ai", + mathclass="variable", specials={ "compat", 0x63, 0x2F, 0x6F }, unicodeslot=0x2105, }, @@ -64334,6 +62543,7 @@ characters.data={ description="CADA UNA", direction="on", linebreak="al", + mathclass="variable", specials={ "compat", 0x63, 0x2F, 0x75 }, unicodeslot=0x2106, }, @@ -64342,6 +62552,7 @@ characters.data={ description="EULER CONSTANT", direction="l", linebreak="al", + mathclass="variable", mathname="Eulerconst", specials={ "compat", 0x190 }, unicodeslot=0x2107, @@ -64351,15 +62562,16 @@ characters.data={ description="SCRUPLE", direction="on", linebreak="al", + mathclass="variable", unicodeslot=0x2108, }, [0x2109]={ - adobename="fahrenheit", category="so", cjkwd="a", description="DEGREE FAHRENHEIT", direction="on", linebreak="po", + mathclass="variable", specials={ "compat", 0xB0, 0x46 }, unicodeslot=0x2109, }, @@ -64368,6 +62580,7 @@ characters.data={ description="SCRIPT SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, synonyms={ "real number symbol" }, unicodeslot=0x210A, @@ -64378,6 +62591,7 @@ characters.data={ description="SCRIPT CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x210B, variants=variants_style, @@ -64388,6 +62602,7 @@ characters.data={ description="BLACK-LETTER CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, synonyms={ "hilbert space" }, unicodeslot=0x210C, @@ -64397,6 +62612,9 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL H", direction="l", linebreak="al", + mathclass="variable", + mathgroup="number set", + mathmeaning="the quaternions", specials={ "font", 0x48 }, unicodeslot=0x210D, }, @@ -64405,6 +62623,7 @@ characters.data={ description="PLANCK CONSTANT", direction="l", linebreak="al", + mathclass="variable", mathname="Plankconst", specials={ "font", 0x68 }, unicodeslot=0x210E, @@ -64414,13 +62633,14 @@ characters.data={ description="PLANCK CONSTANT OVER TWO PI", direction="l", linebreak="al", + mathclass="variable", mathspec={ { - class="ordinary", + mathclass="variable", name="hslash", }, { - class="ordinary", + mathclass="variable", name="hbar", }, }, @@ -64432,17 +62652,18 @@ characters.data={ description="SCRIPT CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x2110, variants=variants_style, visual="it", }, [0x2111]={ - adobename="Ifraktur", category="lu", description="BLACK-LETTER CAPITAL I", direction="l", linebreak="al", + mathclass="variable", mathname="Im", specials={ "font", 0x49 }, synonyms={ "imaginary part" }, @@ -64453,6 +62674,7 @@ characters.data={ description="SCRIPT CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, synonyms={ "laplace transform" }, unicodeslot=0x2112, @@ -64460,14 +62682,13 @@ characters.data={ visual="it", }, [0x2113]={ - adobename="lsquare", category="ll", cjkwd="a", comment="not: MATHEMATICAL SCRIPT SMALL L", description="SCRIPT SMALL L", direction="l", linebreak="ai", - mathclass="ordinary", + mathclass="variable", mathname="ell", specials={ "font", 0x6C }, synonyms={ "liter" }, @@ -64478,6 +62699,7 @@ characters.data={ description="L B BAR SYMBOL", direction="on", linebreak="al", + mathclass="variable", synonyms={ "pounds" }, unicodeslot=0x2114, }, @@ -64486,20 +62708,22 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL N", direction="l", linebreak="al", - mathgroup="constant set", + mathclass="variable", + mathgroup="number set", + mathmeaning="the natural numbers", mathname="naturalnumbers", specials={ "font", 0x4E }, synonyms={ "natural number" }, unicodeslot=0x2115, }, [0x2116]={ - adobename="numero", category="so", cjkwd="a", contextname="textnumero", description="NUMERO SIGN", direction="on", linebreak="pr", + mathclass="variable", specials={ "compat", 0x4E, 0x6F }, unicodeslot=0x2116, }, @@ -64509,15 +62733,16 @@ characters.data={ description="SOUND RECORDING COPYRIGHT", direction="on", linebreak="al", + mathclass="variable", synonyms={ "phonorecord sign", "published" }, unicodeslot=0x2117, }, [0x2118]={ - adobename="weierstrass", category="so", description="SCRIPT CAPITAL P", direction="on", linebreak="al", + mathclass="variable", mathname="wp", synonyms={ "weierstrass elliptic function" }, unicodeslot=0x2118, @@ -64527,7 +62752,9 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL P", direction="l", linebreak="al", - mathgroup="constant set", + mathclass="variable", + mathgroup="number set", + mathmeaning="the prime numbers", mathname="primes", specials={ "font", 0x50 }, unicodeslot=0x2119, @@ -64537,7 +62764,9 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL Q", direction="l", linebreak="al", - mathgroup="constant set", + mathclass="variable", + mathgroup="number set", + mathmeaning="the rational numbers", mathname="rationals", specials={ "font", 0x51 }, synonyms={ "rational numbers", "the set of rational numbers" }, @@ -64548,6 +62777,7 @@ characters.data={ description="SCRIPT CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, synonyms={ "riemann integral" }, unicodeslot=0x211B, @@ -64555,11 +62785,11 @@ characters.data={ visual="it", }, [0x211C]={ - adobename="Rfraktur", category="lu", description="BLACK-LETTER CAPITAL R", direction="l", linebreak="al", + mathclass="variable", mathname="Re", specials={ "font", 0x52 }, synonyms={ "real part" }, @@ -64570,18 +62800,20 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL R", direction="l", linebreak="al", - mathgroup="constant set", + mathclass="variable", + mathgroup="number set", + mathmeaning="the real numbers", mathname="reals", specials={ "font", 0x52 }, synonyms={ "real numbers", "the set of real numbers" }, unicodeslot=0x211D, }, [0x211E]={ - adobename="prescription", category="so", description="PRESCRIPTION TAKE", direction="on", linebreak="al", + mathclass="variable", synonyms={ "cross ratio", "recipe" }, unicodeslot=0x211E, }, @@ -64590,6 +62822,7 @@ characters.data={ description="RESPONSE", direction="on", linebreak="al", + mathclass="variable", unicodeslot=0x211F, }, [0x2120]={ @@ -64597,27 +62830,28 @@ characters.data={ description="SERVICE MARK", direction="on", linebreak="al", + mathclass="variable", specials={ "super", 0x53, 0x4D }, unicodeslot=0x2120, }, [0x2121]={ - adobename="telephone", category="so", cjkwd="a", description="TELEPHONE SIGN", direction="on", linebreak="ai", + mathclass="variable", specials={ "compat", 0x54, 0x45, 0x4C }, unicodeslot=0x2121, }, [0x2122]={ - adobename="trademark", category="so", cjkwd="a", contextname="trademark", description="TRADE MARK SIGN", direction="on", linebreak="ai", + mathclass="variable", specials={ "super", 0x54, 0x4D }, unicodeslot=0x2122, variants=variants_emoji, @@ -64627,6 +62861,7 @@ characters.data={ description="VERSICLE", direction="on", linebreak="al", + mathclass="variable", unicodeslot=0x2123, }, [0x2124]={ @@ -64634,7 +62869,9 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL Z", direction="l", linebreak="al", - mathgroup="constant set", + mathclass="variable", + mathgroup="number set", + mathmeaning="the integers", mathname="integers", specials={ "font", 0x5A }, synonyms={ "integers", "the set of integers" }, @@ -64646,10 +62883,10 @@ characters.data={ description="OUNCE SIGN", direction="on", linebreak="al", + mathclass="variable", unicodeslot=0x2125, }, [0x2126]={ - adobename="Omega", category="lu", cjkwd="a", contextname="textohm", @@ -64657,6 +62894,7 @@ characters.data={ direction="l", lccode=0x3C9, linebreak="al", + mathclass="variable", mathname="ohm", specials={ "char", 0x3A9 }, unicodeslot=0x2126, @@ -64667,6 +62905,7 @@ characters.data={ description="INVERTED OHM SIGN", direction="on", linebreak="al", + mathclass="variable", mathname="mho", synonyms={ "mho" }, unicodeslot=0x2127, @@ -64676,6 +62915,7 @@ characters.data={ description="BLACK-LETTER CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x2128, }, @@ -64684,6 +62924,7 @@ characters.data={ description="TURNED GREEK SMALL LETTER IOTA", direction="on", linebreak="al", + mathclass="variable", mathname="turnediota", synonyms={ "unique element" }, unicodeslot=0x2129, @@ -64695,11 +62936,11 @@ characters.data={ direction="l", lccode=0x6B, linebreak="al", + mathclass="variable", specials={ "char", 0x4B }, unicodeslot=0x212A, }, [0x212B]={ - adobename="angstrom", category="lu", cjkwd="a", contextname="textAngstrom", @@ -64707,6 +62948,7 @@ characters.data={ direction="l", lccode=0xE5, linebreak="ai", + mathclass="variable", mathname="Angstrom", specials={ "char", 0xC5 }, unicodeslot=0x212B, @@ -64716,6 +62958,7 @@ characters.data={ description="SCRIPT CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, synonyms={ "bernoulli function" }, unicodeslot=0x212C, @@ -64727,15 +62970,16 @@ characters.data={ description="BLACK-LETTER CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x212D, }, [0x212E]={ - adobename="estimated", category="so", description="ESTIMATED SYMBOL", direction="et", linebreak="al", + mathclass="variable", unicodeslot=0x212E, }, [0x212F]={ @@ -64743,6 +62987,7 @@ characters.data={ description="SCRIPT SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, synonyms={ "error", "natural exponent" }, unicodeslot=0x212F, @@ -64753,6 +62998,7 @@ characters.data={ description="SCRIPT CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, synonyms={ "electromotive force", "emf" }, unicodeslot=0x2130, @@ -64764,6 +63010,7 @@ characters.data={ description="SCRIPT CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, synonyms={ "fourier transform" }, unicodeslot=0x2131, @@ -64776,7 +63023,7 @@ characters.data={ direction="l", lccode=0x214E, linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="Finv", synonyms={ "claudian digamma inversum" }, unicodeslot=0x2132, @@ -64786,6 +63033,7 @@ characters.data={ description="SCRIPT CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, synonyms={ "german mark pre-wwii", "m-matrix" }, unicodeslot=0x2133, @@ -64797,18 +63045,18 @@ characters.data={ description="SCRIPT SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, synonyms={ "order" }, unicodeslot=0x2134, visual="it", }, [0x2135]={ - adobename="aleph", category="lo", description="ALEF SYMBOL", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="aleph", specials={ "compat", 0x5D0 }, synonyms={ "first transfinite cardinal", "first transfinite cardinal countable" }, @@ -64819,7 +63067,7 @@ characters.data={ description="BET SYMBOL", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="beth", specials={ "compat", 0x5D1 }, synonyms={ "second transfinite cardinal", "second transfinite cardinal continuum" }, @@ -64830,7 +63078,7 @@ characters.data={ description="GIMEL SYMBOL", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="gimel", specials={ "compat", 0x5D2 }, synonyms={ "third transfinite cardinal" }, @@ -64841,7 +63089,7 @@ characters.data={ description="DALET SYMBOL", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="daleth", specials={ "compat", 0x5D3 }, synonyms={ "fourth transfinite cardinal" }, @@ -64852,6 +63100,7 @@ characters.data={ description="INFORMATION SOURCE", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x2139, variants=variants_emoji, @@ -64861,6 +63110,7 @@ characters.data={ description="ROTATED CAPITAL Q", direction="on", linebreak="al", + mathclass="variable", unicodeslot=0x213A, }, [0x213B]={ @@ -64868,6 +63118,7 @@ characters.data={ description="FACSIMILE SIGN", direction="on", linebreak="al", + mathclass="variable", specials={ "compat", 0x46, 0x41, 0x58 }, unicodeslot=0x213B, }, @@ -64876,6 +63127,7 @@ characters.data={ description="DOUBLE-STRUCK SMALL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C0 }, unicodeslot=0x213C, }, @@ -64884,6 +63136,7 @@ characters.data={ description="DOUBLE-STRUCK SMALL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B3 }, unicodeslot=0x213D, }, @@ -64892,6 +63145,7 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x393 }, unicodeslot=0x213E, }, @@ -64900,6 +63154,7 @@ characters.data={ description="DOUBLE-STRUCK CAPITAL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A0 }, unicodeslot=0x213F, }, @@ -64908,6 +63163,7 @@ characters.data={ description="DOUBLE-STRUCK N-ARY SUMMATION", direction="on", linebreak="al", + mathclass="variable", specials={ "font", 0x2211 }, unicodeslot=0x2140, }, @@ -64916,7 +63172,7 @@ characters.data={ description="TURNED SANS-SERIF CAPITAL G", direction="on", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="Game", synonyms={ "game" }, unicodeslot=0x2141, @@ -64927,7 +63183,7 @@ characters.data={ description="TURNED SANS-SERIF CAPITAL L", direction="on", linebreak="al", - mathclass="ordinary", + mathclass="variable", unicodeslot=0x2142, }, [0x2143]={ @@ -64936,7 +63192,7 @@ characters.data={ description="REVERSED SANS-SERIF CAPITAL L", direction="on", linebreak="al", - mathclass="ordinary", + mathclass="variable", unicodeslot=0x2143, }, [0x2144]={ @@ -64945,7 +63201,7 @@ characters.data={ description="TURNED SANS-SERIF CAPITAL Y", direction="on", linebreak="al", - mathclass="ordinary", + mathclass="variable", unicodeslot=0x2144, }, [0x2145]={ @@ -64953,8 +63209,13 @@ characters.data={ description="DOUBLE-STRUCK ITALIC CAPITAL D", direction="l", linebreak="al", - mathclass="differential", - mathname="differentialD", + mathclass="variable", + mathspec={ + { + class="differential", + name="differentialD", + }, + }, specials={ "font", 0x44 }, unicodeslot=0x2145, }, @@ -64963,8 +63224,13 @@ characters.data={ description="DOUBLE-STRUCK ITALIC SMALL D", direction="l", linebreak="al", - mathclass="differential", - mathname="differentiald", + mathclass="variable", + mathspec={ + { + class="differential", + name="differentiald", + }, + }, specials={ "font", 0x64 }, unicodeslot=0x2146, }, @@ -64973,8 +63239,13 @@ characters.data={ description="DOUBLE-STRUCK ITALIC SMALL E", direction="l", linebreak="al", - mathclass="exponential", - mathname="exponentiale", + mathclass="variable", + mathspec={ + { + class="exponential", + name="exponentiale", + }, + }, specials={ "font", 0x65 }, unicodeslot=0x2147, }, @@ -64983,8 +63254,13 @@ characters.data={ description="DOUBLE-STRUCK ITALIC SMALL I", direction="l", linebreak="al", - mathclass="ordinary", - mathname="imaginaryi", + mathclass="variable", + mathspec={ + { + class="imaginary", + name="imaginaryi", + }, + }, specials={ "font", 0x69 }, unicodeslot=0x2148, }, @@ -64993,18 +63269,23 @@ characters.data={ description="DOUBLE-STRUCK ITALIC SMALL J", direction="l", linebreak="al", - mathclass="ordinary", - mathname="imaginaryj", + mathclass="variable", + mathspec={ + { + class="imaginary", + name="imaginaryj", + }, + }, specials={ "font", 0x6A }, unicodeslot=0x2149, }, [0x214A]={ category="so", + comment="PropertyLine", description="PROPERTY LINE", direction="on", linebreak="al", mathclass="ordinary", - mathname="PropertyLine", unicodeslot=0x214A, }, [0x214B]={ @@ -65021,6 +63302,7 @@ characters.data={ description="PER SIGN", direction="on", linebreak="al", + mathclass="variable", unicodeslot=0x214C, }, [0x214D]={ @@ -65028,6 +63310,7 @@ characters.data={ description="AKTIESELSKAB", direction="on", linebreak="al", + mathclass="variable", unicodeslot=0x214D, }, [0x214E]={ @@ -65035,6 +63318,7 @@ characters.data={ description="TURNED SMALL F", direction="l", linebreak="al", + mathclass="variable", uccode=0x2132, unicodeslot=0x214E, }, @@ -65043,6 +63327,7 @@ characters.data={ description="SYMBOL FOR SAMARITAN SOURCE", direction="l", linebreak="al", + mathclass="variable", unicodeslot=0x214F, }, [0x2150]={ @@ -65070,7 +63355,6 @@ characters.data={ unicodeslot=0x2152, }, [0x2153]={ - adobename="onethird", category="no", cjkwd="a", contextname="onethird", @@ -65081,7 +63365,6 @@ characters.data={ unicodeslot=0x2153, }, [0x2154]={ - adobename="twothirds", category="no", cjkwd="a", contextname="twothirds", @@ -65146,7 +63429,6 @@ characters.data={ unicodeslot=0x215A, }, [0x215B]={ - adobename="oneeighth", category="no", cjkwd="a", contextname="oneeighth", @@ -65157,7 +63439,6 @@ characters.data={ unicodeslot=0x215B, }, [0x215C]={ - adobename="threeeighths", category="no", cjkwd="a", contextname="threeeighths", @@ -65168,7 +63449,6 @@ characters.data={ unicodeslot=0x215C, }, [0x215D]={ - adobename="fiveeighths", category="no", cjkwd="a", contextname="fiveeighths", @@ -65179,7 +63459,6 @@ characters.data={ unicodeslot=0x215D, }, [0x215E]={ - adobename="seveneighths", category="no", cjkwd="a", contextname="seveneighths", @@ -65198,7 +63477,6 @@ characters.data={ unicodeslot=0x215F, }, [0x2160]={ - adobename="Oneroman", category="nl", cjkwd="a", contextname="romanI", @@ -65210,7 +63488,6 @@ characters.data={ unicodeslot=0x2160, }, [0x2161]={ - adobename="Tworoman", category="nl", cjkwd="a", contextname="romanII", @@ -65222,7 +63499,6 @@ characters.data={ unicodeslot=0x2161, }, [0x2162]={ - adobename="Threeroman", category="nl", cjkwd="a", contextname="romanIII", @@ -65234,7 +63510,6 @@ characters.data={ unicodeslot=0x2162, }, [0x2163]={ - adobename="Fourroman", category="nl", cjkwd="a", contextname="romanIV", @@ -65246,7 +63521,6 @@ characters.data={ unicodeslot=0x2163, }, [0x2164]={ - adobename="Fiveroman", category="nl", cjkwd="a", contextname="romanV", @@ -65258,7 +63532,6 @@ characters.data={ unicodeslot=0x2164, }, [0x2165]={ - adobename="Sixroman", category="nl", cjkwd="a", contextname="romanVI", @@ -65270,7 +63543,6 @@ characters.data={ unicodeslot=0x2165, }, [0x2166]={ - adobename="Sevenroman", category="nl", cjkwd="a", contextname="romanVII", @@ -65282,7 +63554,6 @@ characters.data={ unicodeslot=0x2166, }, [0x2167]={ - adobename="Eightroman", category="nl", cjkwd="a", contextname="romanVIII", @@ -65294,7 +63565,6 @@ characters.data={ unicodeslot=0x2167, }, [0x2168]={ - adobename="Nineroman", category="nl", cjkwd="a", contextname="romanIX", @@ -65306,7 +63576,6 @@ characters.data={ unicodeslot=0x2168, }, [0x2169]={ - adobename="Tenroman", category="nl", cjkwd="a", contextname="romanX", @@ -65318,7 +63587,6 @@ characters.data={ unicodeslot=0x2169, }, [0x216A]={ - adobename="Elevenroman", category="nl", cjkwd="a", contextname="romanXI", @@ -65330,7 +63598,6 @@ characters.data={ unicodeslot=0x216A, }, [0x216B]={ - adobename="Twelveroman", category="nl", cjkwd="a", contextname="romanXII", @@ -65382,7 +63649,6 @@ characters.data={ unicodeslot=0x216F, }, [0x2170]={ - adobename="oneroman", category="nl", cjkwd="a", contextname="romani", @@ -65394,7 +63660,6 @@ characters.data={ unicodeslot=0x2170, }, [0x2171]={ - adobename="tworoman", category="nl", cjkwd="a", contextname="romanii", @@ -65406,7 +63671,6 @@ characters.data={ unicodeslot=0x2171, }, [0x2172]={ - adobename="threeroman", category="nl", cjkwd="a", contextname="romaniii", @@ -65418,7 +63682,6 @@ characters.data={ unicodeslot=0x2172, }, [0x2173]={ - adobename="fourroman", category="nl", cjkwd="a", contextname="romaniv", @@ -65430,7 +63693,6 @@ characters.data={ unicodeslot=0x2173, }, [0x2174]={ - adobename="fiveroman", category="nl", cjkwd="a", contextname="romanv", @@ -65442,7 +63704,6 @@ characters.data={ unicodeslot=0x2174, }, [0x2175]={ - adobename="sixroman", category="nl", cjkwd="a", contextname="romanvi", @@ -65454,7 +63715,6 @@ characters.data={ unicodeslot=0x2175, }, [0x2176]={ - adobename="sevenroman", category="nl", cjkwd="a", contextname="romanvii", @@ -65466,7 +63726,6 @@ characters.data={ unicodeslot=0x2176, }, [0x2177]={ - adobename="eightroman", category="nl", cjkwd="a", contextname="romanviii", @@ -65478,7 +63737,6 @@ characters.data={ unicodeslot=0x2177, }, [0x2178]={ - adobename="nineroman", category="nl", cjkwd="a", contextname="romanix", @@ -65490,7 +63748,6 @@ characters.data={ unicodeslot=0x2178, }, [0x2179]={ - adobename="tenroman", category="nl", cjkwd="a", contextname="romanx", @@ -65502,7 +63759,6 @@ characters.data={ unicodeslot=0x2179, }, [0x217A]={ - adobename="elevenroman", category="nl", contextname="romanxi", description="SMALL ROMAN NUMERAL ELEVEN", @@ -65513,7 +63769,6 @@ characters.data={ unicodeslot=0x217A, }, [0x217B]={ - adobename="twelveroman", category="nl", contextname="romanxii", description="SMALL ROMAN NUMERAL TWELVE", @@ -65653,7 +63908,6 @@ characters.data={ unicodeslot=0x218B, }, [0x2190]={ - adobename="arrowleft", category="sm", cjkwd="a", description="LEFTWARDS ARROW", @@ -65661,7 +63915,9 @@ characters.data={ linebreak="ai", mathextensible="l", mathfiller="leftarrowfill", + mathgroup="binary relation", mathlist={ 0x3C, 0x2212 }, + mathmeaning="gets", mathspec={ { class="relation", @@ -65684,7 +63940,6 @@ characters.data={ unicodeslot=0x2190, }, [0x2191]={ - adobename="arrowup", category="sm", cjkwd="a", description="UPWARDS ARROW", @@ -65692,12 +63947,13 @@ characters.data={ linebreak="ai", mathclass="relation", mathextensible="u", + mathgroup="limit", + mathmeaning="tends from below to", mathname="uparrow", synonyms={ "egressive airflow" }, unicodeslot=0x2191, }, [0x2192]={ - adobename="arrowright", category="sm", cjkwd="a", description="RIGHTWARDS ARROW", @@ -65705,7 +63961,9 @@ characters.data={ linebreak="ai", mathextensible="r", mathfiller="rightarrowfill", + mathgroup="limit", mathlist={ 0x2212, 0x3E }, + mathmeaning="to", mathspec={ { class="relation", @@ -65713,8 +63971,16 @@ characters.data={ }, { class="relation", + group="binary set relation", + meaning="to", name="to", }, + { + class="relation", + group="limit", + meaning="tends to", + name="tendsto", + }, { class="under", name="underrightarrow", @@ -65729,7 +63995,6 @@ characters.data={ unicodeslot=0x2192, }, [0x2193]={ - adobename="arrowdown", category="sm", cjkwd="a", description="DOWNWARDS ARROW", @@ -65737,12 +64002,13 @@ characters.data={ linebreak="ai", mathclass="relation", mathextensible="d", + mathgroup="limit", + mathmeaning="tends from above to", mathname="downarrow", synonyms={ "ingressive airflow" }, unicodeslot=0x2193, }, [0x2194]={ - adobename="arrowboth", category="sm", cjkwd="a", description="LEFT RIGHT ARROW", @@ -65757,7 +64023,6 @@ characters.data={ variants=variants_emoji, }, [0x2195]={ - adobename="arrowupdn", category="so", cjkwd="a", description="UP DOWN ARROW", @@ -65770,7 +64035,6 @@ characters.data={ variants=variants_emoji, }, [0x2196]={ - adobename="arrowupleft", category="so", cjkwd="a", description="NORTH WEST ARROW", @@ -65782,31 +64046,32 @@ characters.data={ variants=variants_emoji, }, [0x2197]={ - adobename="arrowupright", category="so", cjkwd="a", description="NORTH EAST ARROW", direction="on", linebreak="ai", mathclass="relation", + mathgroup="limit", + mathmeaning="tends from below to", mathname="nearrow", unicodeslot=0x2197, variants=variants_emoji, }, [0x2198]={ - adobename="arrowdownright", category="so", cjkwd="a", description="SOUTH EAST ARROW", direction="on", linebreak="ai", mathclass="relation", + mathgroup="limit", + mathmeaning="tends from above to", mathname="searrow", unicodeslot=0x2198, variants=variants_emoji, }, [0x2199]={ - adobename="arrowdownleft", category="so", cjkwd="a", description="SOUTH WEST ARROW", @@ -65933,6 +64198,8 @@ characters.data={ linebreak="al", mathclass="relation", mathextensible="l", + mathgroup="binary relation", + mathmeaning="maps from", mathname="mapsfrom", unicodeslot=0x21A4, }, @@ -65943,6 +64210,8 @@ characters.data={ linebreak="al", mathclass="relation", mathextensible="u", + mathgroup="binary relation", + mathmeaning="maps up", mathname="mapsup", unicodeslot=0x21A5, }, @@ -65954,6 +64223,8 @@ characters.data={ mathclass="relation", mathextensible="r", mathfiller="mapstofill", + mathgroup="binary relation", + mathmeaning="maps to", mathname="mapsto", synonyms={ "maplet" }, unicodeslot=0x21A6, @@ -65965,12 +64236,13 @@ characters.data={ linebreak="al", mathclass="relation", mathextensible="d", + mathgroup="binary relation", + mathmeaning="maps down", mathname="mapsdown", synonyms={ "depth symbol" }, unicodeslot=0x21A7, }, [0x21A8]={ - adobename="arrowupdownbase", category="so", description="UP DOWN ARROW WITH BASE", direction="on", @@ -66108,7 +64380,6 @@ characters.data={ unicodeslot=0x21B4, }, [0x21B5]={ - adobename="carriagereturn", category="so", comment="conflict: carriagereturn", description="DOWNWARDS ARROW WITH CORNER LEFTWARDS", @@ -66194,7 +64465,6 @@ characters.data={ unicodeslot=0x21BB, }, [0x21BC]={ - adobename="harpoonleftbarbup", category="so", description="LEFTWARDS HARPOON WITH BARB UPWARDS", direction="on", @@ -66221,6 +64491,8 @@ characters.data={ description="UPWARDS HARPOON WITH BARB RIGHTWARDS", direction="on", linebreak="al", + mathgroup="binary relation", + mathmeaning="restriction", mathspec={ { class="relation", @@ -66243,7 +64515,6 @@ characters.data={ unicodeslot=0x21BF, }, [0x21C0]={ - adobename="harpoonrightbarbup", category="so", description="RIGHTWARDS HARPOON WITH BARB UPWARDS", direction="on", @@ -66284,7 +64555,6 @@ characters.data={ unicodeslot=0x21C3, }, [0x21C4]={ - adobename="arrowrightoverleft", category="so", description="RIGHTWARDS ARROW OVER LEFTWARDS ARROW", direction="on", @@ -66296,7 +64566,6 @@ characters.data={ unicodeslot=0x21C4, }, [0x21C5]={ - adobename="arrowupleftofdown", category="so", description="UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW", direction="on", @@ -66307,7 +64576,6 @@ characters.data={ unicodeslot=0x21C5, }, [0x21C6]={ - adobename="arrowleftoverright", category="so", description="LEFTWARDS ARROW OVER RIGHTWARDS ARROW", direction="on", @@ -66381,13 +64649,14 @@ characters.data={ unicodeslot=0x21CC, }, [0x21CD]={ - adobename="arrowleftdblstroke", category="so", description="LEFTWARDS DOUBLE ARROW WITH STROKE", direction="on", linebreak="al", mathclass="relation", mathextensible="l", + mathgroup="binary relation", + mathmeaning="is not implied by", mathname="nLeftarrow", specials={ "char", 0x21D0, 0x338 }, unicodeslot=0x21CD, @@ -66404,7 +64673,6 @@ characters.data={ unicodeslot=0x21CE, }, [0x21CF]={ - adobename="arrowrightdblstroke", category="sm", description="RIGHTWARDS DOUBLE ARROW WITH STROKE", direction="on", @@ -66416,19 +64684,19 @@ characters.data={ unicodeslot=0x21CF, }, [0x21D0]={ - adobename="arrowleftdbl", category="so", description="LEFTWARDS DOUBLE ARROW", direction="on", linebreak="al", mathclass="relation", mathextensible="l", + mathgroup="binary relation", mathlist={ 0x3C, 0x3D, 0x3D }, + mathmeaning="is implied by", mathname="Leftarrow", unicodeslot=0x21D0, }, [0x21D1]={ - adobename="arrowdblup", category="so", description="UPWARDS DOUBLE ARROW", direction="on", @@ -66439,14 +64707,15 @@ characters.data={ unicodeslot=0x21D1, }, [0x21D2]={ - adobename="dblarrowright", category="sm", cjkwd="a", description="RIGHTWARDS DOUBLE ARROW", direction="on", linebreak="ai", mathextensible="r", + mathgroup="binary relation", mathlist={ 0x3D, 0x3D, 0x3E }, + mathmeaning="implies", mathspec={ { class="relation", @@ -66460,7 +64729,6 @@ characters.data={ unicodeslot=0x21D2, }, [0x21D3]={ - adobename="arrowdbldown", category="so", description="DOWNWARDS DOUBLE ARROW", direction="on", @@ -66471,7 +64739,6 @@ characters.data={ unicodeslot=0x21D3, }, [0x21D4]={ - adobename="dblarrowleft", category="sm", cjkwd="a", description="LEFT RIGHT DOUBLE ARROW", @@ -66479,7 +64746,9 @@ characters.data={ linebreak="ai", mathclass="relation", mathextensible="h", + mathgroup="binary relation", mathlist={ 0x3C, 0x3D, 0x3D, 0x3E }, + mathmeaning="if, and only if", mathname="Leftrightarrow", unicodeslot=0x21D4, }, @@ -66564,6 +64833,8 @@ characters.data={ description="RIGHTWARDS SQUIGGLE ARROW", direction="on", linebreak="al", + mathgroup="binary relation", + mathmeaning="leads to", mathspec={ { class="relation", @@ -66577,7 +64848,6 @@ characters.data={ unicodeslot=0x21DD, }, [0x21DE]={ - adobename="pageup", category="so", description="UPWARDS ARROW WITH DOUBLE STROKE", direction="on", @@ -66589,7 +64859,6 @@ characters.data={ unicodeslot=0x21DE, }, [0x21DF]={ - adobename="pagedown", category="so", description="DOWNWARDS ARROW WITH DOUBLE STROKE", direction="on", @@ -66600,7 +64869,6 @@ characters.data={ unicodeslot=0x21DF, }, [0x21E0]={ - adobename="arrowdashleft", category="so", description="LEFTWARDS DASHED ARROW", direction="on", @@ -66611,7 +64879,6 @@ characters.data={ unicodeslot=0x21E0, }, [0x21E1]={ - adobename="arrowdashup", category="so", description="UPWARDS DASHED ARROW", direction="on", @@ -66622,7 +64889,6 @@ characters.data={ unicodeslot=0x21E1, }, [0x21E2]={ - adobename="arrowdashright", category="so", description="RIGHTWARDS DASHED ARROW", direction="on", @@ -66640,7 +64906,6 @@ characters.data={ unicodeslot=0x21E2, }, [0x21E3]={ - adobename="arrowdashdown", category="so", description="DOWNWARDS DASHED ARROW", direction="on", @@ -66651,7 +64916,6 @@ characters.data={ unicodeslot=0x21E3, }, [0x21E4]={ - adobename="arrowtableft", category="so", description="LEFTWARDS ARROW TO BAR", direction="on", @@ -66663,7 +64927,6 @@ characters.data={ unicodeslot=0x21E4, }, [0x21E5]={ - adobename="arrowtabright", category="so", description="RIGHTWARDS ARROW TO BAR", direction="on", @@ -66675,7 +64938,6 @@ characters.data={ unicodeslot=0x21E5, }, [0x21E6]={ - adobename="arrowleftwhite", category="so", description="LEFTWARDS WHITE ARROW", direction="on", @@ -66686,7 +64948,6 @@ characters.data={ unicodeslot=0x21E6, }, [0x21E7]={ - adobename="arrowupwhite", category="so", cjkwd="a", description="UPWARDS WHITE ARROW", @@ -66699,7 +64960,6 @@ characters.data={ unicodeslot=0x21E7, }, [0x21E8]={ - adobename="arrowrightwhite", category="so", description="RIGHTWARDS WHITE ARROW", direction="on", @@ -66710,7 +64970,6 @@ characters.data={ unicodeslot=0x21E8, }, [0x21E9]={ - adobename="arrowdownwhite", category="so", description="DOWNWARDS WHITE ARROW", direction="on", @@ -66721,7 +64980,6 @@ characters.data={ unicodeslot=0x21E9, }, [0x21EA]={ - adobename="capslock", category="so", description="UPWARDS WHITE ARROW FROM BAR", direction="on", @@ -66928,13 +65186,14 @@ characters.data={ unicodeslot=0x21FF, }, [0x2200]={ - adobename="universal", category="sm", cjkwd="a", description="FOR ALL", direction="on", linebreak="ai", mathclass="ordinary", + mathgroup="unary set", + mathmeaning="for all", mathname="forall", synonyms={ "universal quantifier" }, unicodeslot=0x2200, @@ -66945,28 +65204,32 @@ characters.data={ direction="on", linebreak="al", mathclass="ordinary", + mathgroup="unary set", + mathmeaning="the complement of", mathname="complement", unicodeslot=0x2201, }, [0x2202]={ - adobename="partialdiff", category="sm", cjkwd="a", description="PARTIAL DIFFERENTIAL", direction="on", linebreak="ai", mathclass="differential", + mathgroup="differential", + mathmeaning="partial d", mathname="partial", unicodeslot=0x2202, }, [0x2203]={ - adobename="thereexists", category="sm", cjkwd="a", description="THERE EXISTS", direction="on", linebreak="ai", mathclass="ordinary", + mathgroup="unary set", + mathmeaning="there exists", mathname="exists", synonyms={ "existential quantifier" }, unicodeslot=0x2203, @@ -66977,18 +65240,20 @@ characters.data={ direction="on", linebreak="al", mathclass="ordinary", + mathgroup="unary set", + mathmeaning="does not exist", mathname="nexists", specials={ "char", 0x2203, 0x338 }, unicodeslot=0x2204, }, [0x2205]={ - adobename="emptyset", category="sm", description="EMPTY SET", direction="on", linebreak="al", mathclass="ordinary", mathgroup="constant set", + mathmeaning="empty set", mathname="emptyset", synonyms={ "null set" }, unicodeslot=0x2205, @@ -66997,46 +65262,61 @@ characters.data={ }, }, [0x2206]={ - adobename="increment", category="sm", description="INCREMENT", direction="on", linebreak="al", mathclass="differential", + mathgroup="differential", + mathmeaning="laplacian", mathname="laplace", synonyms={ "forward difference", "laplace operator" }, unicodeslot=0x2206, }, [0x2207]={ - adobename="nabla", category="sm", cjkwd="a", description="NABLA", direction="on", linebreak="ai", - mathclass="ordinary", - mathname="nabla", + mathgroup="differential", + mathspec={ + { + class="differential", + group="differential", + meaning="nabla", + name="nabla", + }, + { + class="differential", + group="differential2", + meaning="gradient", + name="gradient", + }, + }, synonyms={ "backward difference", "del" }, unicodeslot=0x2207, }, [0x2208]={ - adobename="element", category="sm", cjkwd="a", description="ELEMENT OF", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="belongs to", mathname="in", mirror=0x220B, unicodeslot=0x2208, }, [0x2209]={ - adobename="notelementof", category="sm", description="NOT AN ELEMENT OF", direction="on", linebreak="al", + mathgroup="binary set relation", + mathmeaning="does not belong to", mathspec={ { class="relation", @@ -67060,12 +65340,13 @@ characters.data={ unicodeslot=0x220A, }, [0x220B]={ - adobename="suchthat", category="sm", cjkwd="a", description="CONTAINS AS MEMBER", direction="on", linebreak="ai", + mathgroup="binary set relation", + mathmeaning="contains", mathspec={ { class="relation", @@ -67080,11 +65361,12 @@ characters.data={ unicodeslot=0x220B, }, [0x220C]={ - adobename="notcontains", category="sm", description="DOES NOT CONTAIN AS MEMBER", direction="on", linebreak="al", + mathgroup="binary set relation", + mathmeaning="does not contain", mathspec={ { class="relation", @@ -67116,13 +65398,14 @@ characters.data={ unicodeslot=0x220E, }, [0x220F]={ - adobename="product", category="sm", cjkwd="a", description="N-ARY PRODUCT", direction="on", linebreak="ai", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="product", mathname="prod", synonyms={ "product sign" }, unicodeslot=0x220F, @@ -67132,31 +65415,34 @@ characters.data={ description="N-ARY COPRODUCT", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="coproduct", mathname="coprod", synonyms={ "coproduct sign" }, unicodeslot=0x2210, }, [0x2211]={ - adobename="summation", category="sm", cjkwd="a", description="N-ARY SUMMATION", direction="on", linebreak="ai", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="sum", mathname="sum", synonyms={ "summation sign" }, unicodeslot=0x2211, }, [0x2212]={ - adobename="minus", category="sm", description="MINUS SIGN", direction="es", linebreak="pr", mathextensible="h", - mathgroup="binary arithmetic", + mathgroup="binary operator", + mathmeaning="minus", mathspec={ { class="binary", @@ -67171,13 +65457,14 @@ characters.data={ unicodeslot=0x2212, }, [0x2213]={ - adobename="minusplus", category="sm", contextname="textmp", description="MINUS-OR-PLUS SIGN", direction="et", linebreak="pr", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="minus plus", mathname="mp", unicodeslot=0x2213, }, @@ -67187,11 +65474,12 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="dot plus", mathname="dotplus", unicodeslot=0x2214, }, [0x2215]={ - adobename="divisionslash", category="sm", cjkwd="a", comment="mathclass=ordinary,mathname=diagup", @@ -67207,6 +65495,8 @@ characters.data={ description="SET MINUS", direction="on", linebreak="al", + mathgroup="binary arithmetic", + mathmeaning="set minus", mathspec={ { class="binary", @@ -67216,13 +65506,30 @@ characters.data={ unicodeslot=0x2216, }, [0x2217]={ - adobename="asteriskmath", category="sm", description="ASTERISK OPERATOR", direction="on", linebreak="al", - mathclass="binary", - mathname="ast", + mathspec={ + { + class="binary", + group="binary arithmetic", + meaning="asterisk operator", + name="ast", + }, + { + class="binary", + group="binary operator", + meaning="convolved with", + name="convolve", + }, + { + class="prime", + group="postfix operator", + meaning="adjoint", + name="adjointsymbol", + }, + }, unicodeslot=0x2217, }, [0x2218]={ @@ -67231,12 +65538,13 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="composed with", mathname="circ", synonyms={ "apl jot", "composite function" }, unicodeslot=0x2218, }, [0x2219]={ - adobename="bulletoperator", category="sm", description="BULLET OPERATOR", direction="on", @@ -67245,7 +65553,6 @@ characters.data={ unicodeslot=0x2219, }, [0x221A]={ - adobename="radical", category="sm", cjkwd="a", description="SQUARE ROOT", @@ -67283,29 +65590,30 @@ characters.data={ unicodeslot=0x221C, }, [0x221D]={ - adobename="proportional", category="sm", cjkwd="a", description="PROPORTIONAL TO", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is proportional to", mathname="propto", unicodeslot=0x221D, }, [0x221E]={ - adobename="infinity", category="sm", cjkwd="a", description="INFINITY", direction="on", linebreak="ai", mathclass="ordinary", + mathgroup="constant arithmetic", + mathmeaning="infinity", mathname="infty", unicodeslot=0x221E, }, [0x221F]={ - adobename="rightangle", category="sm", cjkwd="a", description="RIGHT ANGLE", @@ -67317,7 +65625,6 @@ characters.data={ unicodeslot=0x221F, }, [0x2220]={ - adobename="angle", category="sm", cjkwd="a", description="ANGLE", @@ -67350,15 +65657,15 @@ characters.data={ unicodeslot=0x2222, }, [0x2223]={ - adobename="divides", category="sm", cjkwd="a", description="DIVIDES", direction="on", linebreak="ai", + mathgroup="binary relation", + mathmeaning="divides", mathspec={ { - -- class="binary", class="ordinary", name="divides", }, @@ -67375,9 +65682,11 @@ characters.data={ description="DOES NOT DIVIDE", direction="on", linebreak="al", + mathclass="relation", + mathgroup="binary relation", + mathmeaning="does not divide", mathspec={ { - -- class="binary", class="ordinary", name="ndivides", }, @@ -67391,12 +65700,14 @@ characters.data={ unicodeslot=0x2224, }, [0x2225]={ - adobename="parallel", category="sm", cjkwd="a", description="PARALLEL TO", direction="on", linebreak="ai", + mathclass="relation", + mathgroup="binary relation", + mathmeaning="is parallel to", mathspec={ { class="relation", @@ -67406,18 +65717,18 @@ characters.data={ unicodeslot=0x2225, }, [0x2226]={ - adobename="notparallel", category="sm", description="NOT PARALLEL TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is not parallel to", mathname="nparallel", specials={ "char", 0x2225, 0x338 }, unicodeslot=0x2226, }, [0x2227]={ - adobename="logicaland", category="sm", cjkwd="a", description="LOGICAL AND", @@ -67426,10 +65737,14 @@ characters.data={ mathspec={ { class="binary", + group="binary arithmetic", + meaning="wedge product", name="wedge", }, { class="binary", + group="binary logical", + meaning="and", name="land", }, }, @@ -67437,7 +65752,6 @@ characters.data={ unicodeslot=0x2227, }, [0x2228]={ - adobename="logicalor", category="sm", cjkwd="a", description="LOGICAL OR", @@ -67446,10 +65760,14 @@ characters.data={ mathspec={ { class="binary", + group="binary arithmetic", + meaning="wedge sum", name="vee", }, { class="binary", + group="binary logical", + meaning="or", name="lor", }, }, @@ -67457,13 +65775,14 @@ characters.data={ unicodeslot=0x2228, }, [0x2229]={ - adobename="intersection", category="sm", cjkwd="a", description="INTERSECTION", direction="on", linebreak="ai", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="intersection", mathname="cap", synonyms={ "cap", "hat" }, unicodeslot=0x2229, @@ -67472,13 +65791,14 @@ characters.data={ }, }, [0x222A]={ - adobename="union", category="sm", cjkwd="a", description="UNION", direction="on", linebreak="ai", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="union", mathname="cup", synonyms={ "cup" }, unicodeslot=0x222A, @@ -67487,16 +65807,17 @@ characters.data={ }, }, [0x222B]={ - adobename="integral", category="sm", cjkwd="a", description="INTEGRAL", direction="on", linebreak="ai", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="integral", mathspec={ { - class="limop", + class="integral", name="int", }, { @@ -67507,16 +65828,17 @@ characters.data={ unicodeslot=0x222B, }, [0x222C]={ - adobename="dblintegral", category="sm", cjkwd="a", description="DOUBLE INTEGRAL", direction="on", linebreak="ai", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="double integral", mathspec={ { - class="limop", + class="integral", name="iint", }, { @@ -67532,10 +65854,12 @@ characters.data={ description="TRIPLE INTEGRAL", direction="on", linebreak="al", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="triple integral of", mathspec={ { - class="limop", + class="integral", name="iiint", }, { @@ -67547,13 +65871,14 @@ characters.data={ unicodeslot=0x222D, }, [0x222E]={ - adobename="contourintegral", category="sm", cjkwd="a", description="CONTOUR INTEGRAL", direction="on", linebreak="ai", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="contour integral", mathname="oint", unicodeslot=0x222E, }, @@ -67562,7 +65887,9 @@ characters.data={ description="SURFACE INTEGRAL", direction="on", linebreak="al", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="surface integral", mathname="oiint", specials={ "compat", 0x222E, 0x222E }, unicodeslot=0x222F, @@ -67572,7 +65899,9 @@ characters.data={ description="VOLUME INTEGRAL", direction="on", linebreak="al", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="volume integral", mathname="oiiint", specials={ "compat", 0x222E, 0x222E, 0x222E }, unicodeslot=0x2230, @@ -67582,7 +65911,9 @@ characters.data={ description="CLOCKWISE INTEGRAL", direction="on", linebreak="al", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="clockwise integral", mathname="intclockwise", unicodeslot=0x2231, }, @@ -67591,7 +65922,9 @@ characters.data={ description="CLOCKWISE CONTOUR INTEGRAL", direction="on", linebreak="al", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="clockwise contour integral", mathname="ointclockwise", unicodeslot=0x2232, }, @@ -67600,46 +65933,67 @@ characters.data={ description="ANTICLOCKWISE CONTOUR INTEGRAL", direction="on", linebreak="al", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="anticlockwise contour integral", mathname="ointctrclockwise", synonyms={ "counterclockwise contour integral" }, unicodeslot=0x2233, }, [0x2234]={ - adobename="therefore", category="sm", cjkwd="a", description="THEREFORE", direction="on", linebreak="ai", - mathclass="relation", + mathclass="ellipsis", + mathgroup="whatever", + mathmeaning="therefore, ", mathname="therefore", unicodeslot=0x2234, }, [0x2235]={ - adobename="because", category="sm", cjkwd="a", description="BECAUSE", direction="on", linebreak="ai", - mathclass="relation", + mathclass="ellipsis", + mathgroup="whatever", + mathmeaning="because", mathname="because", unicodeslot=0x2235, }, [0x2236]={ - adobename="ratio", category="sm", cjkwd="a", description="RATIO", direction="on", linebreak="ai", mathclass="punctuation", - mathname="colon", + mathspec={ + { + class="punctuation", + group="punctuation", + meaning="colon", + name="colon", + }, + { + class="punctuation", + group="specifier", + meaning="maps", + name="maps", + }, + { + class="punctuation", + group="specifier2", + meaning="maps as", + name="mapsas", + }, + }, unicodeslot=0x2236, }, [0x2237]={ - adobename="proportion", category="sm", cjkwd="a", description="PROPORTION", @@ -67685,7 +66039,6 @@ characters.data={ unicodeslot=0x223B, }, [0x223C]={ - adobename="tildeoperator", category="sm", cjkwd="a", description="TILDE OPERATOR", @@ -67698,7 +66051,6 @@ characters.data={ unicodeslot=0x223C, }, [0x223D]={ - adobename="reversedtilde", category="sm", cjkwd="a", description="REVERSED TILDE", @@ -67732,6 +66084,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary operator", + mathmeaning="wreath product", mathname="wr", unicodeslot=0x2240, }, @@ -67755,12 +66109,13 @@ characters.data={ unicodeslot=0x2242, }, [0x2243]={ - adobename="asymptoticallyequal", category="sm", description="ASYMPTOTICALLY EQUAL TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="asymptotically equals", mathname="simeq", mirror=0x22CD, unicodeslot=0x2243, @@ -67771,16 +66126,19 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is not asymptotically equal to", mathname="nsimeq", specials={ "char", 0x2243, 0x338 }, unicodeslot=0x2244, }, [0x2245]={ - adobename="congruent", category="sm", description="APPROXIMATELY EQUAL TO", direction="on", linebreak="al", + mathgroup="binary relation", + mathmeaning="approximately equals", mathspec={ { class="relation", @@ -67799,6 +66157,8 @@ characters.data={ description="APPROXIMATELY BUT NOT ACTUALLY EQUAL TO", direction="on", linebreak="al", + mathgroup="binary relation", + mathmeaning="similar but not equal to", mathspec={ { class="relation", @@ -67817,18 +66177,21 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is neither approximately, nor equal to", mathname="approxnEq", specials={ "char", 0x2245, 0x338 }, unicodeslot=0x2247, }, [0x2248]={ - adobename="approxequal", category="sm", cjkwd="a", description="ALMOST EQUAL TO", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", + mathmeaning="approximately equals", mathname="approx", synonyms={ "asymptotic to" }, unicodeslot=0x2248, @@ -67839,6 +66202,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is not approximately equal to", mathname="napprox", specials={ "char", 0x2248, 0x338 }, unicodeslot=0x2249, @@ -67849,6 +66214,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="approximately equals, or equals", mathname="approxeq", unicodeslot=0x224A, }, @@ -67857,16 +66224,20 @@ characters.data={ description="TRIPLE TILDE", direction="on", linebreak="al", + mathclass="relation", + mathgroup="binary relation", + mathmeaning="approximately identical to", unicodeslot=0x224B, }, [0x224C]={ - adobename="allequal", category="sm", cjkwd="a", description="ALL EQUAL TO", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", + mathmeaning="are all equal to", mirror=0x2245, unicodeslot=0x224C, }, @@ -67876,6 +66247,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="asymptotically equals", mathname="asymp", unicodeslot=0x224D, }, @@ -67896,7 +66269,6 @@ characters.data={ unicodeslot=0x224F, }, [0x2250]={ - adobename="approaches", category="sm", description="APPROACHES THE LIMIT", direction="on", @@ -67906,7 +66278,6 @@ characters.data={ unicodeslot=0x2250, }, [0x2251]={ - adobename="geometricallyequal", category="sm", description="GEOMETRICALLY EQUAL TO", direction="on", @@ -67924,7 +66295,6 @@ characters.data={ unicodeslot=0x2251, }, [0x2252]={ - adobename="approxequalorimage", category="sm", cjkwd="a", description="APPROXIMATELY EQUAL TO OR THE IMAGE OF", @@ -67937,7 +66307,6 @@ characters.data={ unicodeslot=0x2252, }, [0x2253]={ - adobename="imageorapproximatelyequal", category="sm", description="IMAGE OF OR APPROXIMATELY EQUAL TO", direction="on", @@ -67953,7 +66322,9 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x3A, 0x3D }, + mathmeaning="is defined by", mathname="colonequals", mirror=0x2255, unicodeslot=0x2254, @@ -67964,7 +66335,9 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x3D, 0x3A }, + mathmeaning="defines", mathname="equalscolon", mirror=0x2254, unicodeslot=0x2255, @@ -68061,13 +66434,14 @@ characters.data={ unicodeslot=0x225F, }, [0x2260]={ - adobename="notequal", category="sm", cjkwd="a", description="NOT EQUAL TO", direction="on", linebreak="ai", + mathgroup="binary relation", mathlist={ 0x2F, 0x3D }, + mathmeaning="is not equal to", mathspec={ { class="relation", @@ -68082,7 +66456,6 @@ characters.data={ unicodeslot=0x2260, }, [0x2261]={ - adobename="equivalence", category="sm", cjkwd="a", description="IDENTICAL TO", @@ -68090,12 +66463,13 @@ characters.data={ linebreak="ai", mathclass="relation", mathextensible="h", + mathgroup="binary relation", mathlist={ 0x3D, 0x3D }, + mathmeaning="is equivalent to", mathname="equiv", unicodeslot=0x2261, }, [0x2262]={ - adobename="notidentical", category="sm", description="NOT IDENTICAL TO", direction="on", @@ -68103,7 +66477,9 @@ characters.data={ mathclass="relation", mathextensible="h", mathfiller="triplerelfill", + mathgroup="binary relation", mathlist={ 0x2F, 0x3D, 0x3D }, + mathmeaning="is not equivalent to", mathname="nequiv", specials={ "char", 0x2261, 0x338 }, unicodeslot=0x2262, @@ -68115,17 +66491,19 @@ characters.data={ linebreak="al", mathclass="relation", mathextensible="h", + mathgroup="binary relation", + mathmeaning="is strictly equivalent to", unicodeslot=0x2263, }, [0x2264]={ - adobename="lessequal", category="sm", cjkwd="a", description="LESS-THAN OR EQUAL TO", direction="on", linebreak="ai", - mathgroup="nary relation", + mathgroup="binary relation", mathlist={ 0x3C, 0x3D }, + mathmeaning="is less than, or equal to", mathspec={ { class="relation", @@ -68140,14 +66518,14 @@ characters.data={ unicodeslot=0x2264, }, [0x2265]={ - adobename="greaterequal", category="sm", cjkwd="a", description="GREATER-THAN OR EQUAL TO", direction="on", linebreak="ai", - mathgroup="nary relation", + mathgroup="binary relation", mathlist={ 0x3E, 0x3D }, + mathmeaning="is greater than, or equal to", mathspec={ { class="relation", @@ -68162,25 +66540,27 @@ characters.data={ unicodeslot=0x2265, }, [0x2266]={ - adobename="lessoverequal", category="sm", cjkwd="a", description="LESS-THAN OVER EQUAL TO", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is less than, or equal to", mathname="leqq", mirror=0x2267, unicodeslot=0x2266, }, [0x2267]={ - adobename="greateroverequal", category="sm", cjkwd="a", description="GREATER-THAN OVER EQUAL TO", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is greater than, or equal to", mathname="geqq", mirror=0x2266, unicodeslot=0x2267, @@ -68191,6 +66571,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is less than, but not equal to", mathname="lneqq", mirror=0x2269, unicodeslot=0x2268, @@ -68204,6 +66586,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is greater than, but not equal to", mathname="gneqq", mirror=0x2268, unicodeslot=0x2269, @@ -68212,27 +66596,29 @@ characters.data={ }, }, [0x226A]={ - adobename="muchless", category="sm", cjkwd="a", description="MUCH LESS-THAN", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x3C, 0x3C }, + mathmeaning="is much less than", mathname="ll", mirror=0x226B, unicodeslot=0x226A, }, [0x226B]={ - adobename="muchgreater", category="sm", cjkwd="a", description="MUCH GREATER-THAN", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x3E, 0x3E }, + mathmeaning="is much greater than", mathname="gg", mirror=0x226A, unicodeslot=0x226B, @@ -68259,66 +66645,71 @@ characters.data={ unicodeslot=0x226D, }, [0x226E]={ - adobename="notless", category="sm", cjkwd="a", description="NOT LESS-THAN", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x2F, 0x3C }, + mathmeaning="is not less than", mathname="nless", mirror=0x226F, specials={ "char", 0x3C, 0x338 }, unicodeslot=0x226E, }, [0x226F]={ - adobename="notgreater", category="sm", cjkwd="a", description="NOT GREATER-THAN", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x2F, 0x3E }, + mathmeaning="is not greater than", mathname="ngtr", mirror=0x226E, specials={ "char", 0x3E, 0x338 }, unicodeslot=0x226F, }, [0x2270]={ - adobename="notlessnorequal", category="sm", description="NEITHER LESS-THAN NOR EQUAL TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x2F, 0x3C, 0x3D }, + mathmeaning="is neither less than, nor equal to", mathname="nleq", mirror=0x2271, specials={ "char", 0x2264, 0x338 }, unicodeslot=0x2270, }, [0x2271]={ - adobename="notgreaternorequal", category="sm", description="NEITHER GREATER-THAN NOR EQUAL TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x2F, 0x3E, 0x3D }, + mathmeaning="is neither greater than, nor equal to", mathname="ngeq", mirror=0x2270, specials={ "char", 0x2265, 0x338 }, unicodeslot=0x2271, }, [0x2272]={ - adobename="lessorequivalent", category="sm", description="LESS-THAN OR EQUIVALENT TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is less than, or similar to", mathname="lesssim", mirror=0x2273, unicodeslot=0x2272, @@ -68327,12 +66718,13 @@ characters.data={ }, }, [0x2273]={ - adobename="greaterorequivalent", category="sm", description="GREATER-THAN OR EQUIVALENT TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is greater than, or similar to", mathname="gtrsim", mirror=0x2272, unicodeslot=0x2273, @@ -68346,6 +66738,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is neither less than, nor similar to", mathname="nlesssim", mirror=0x2275, specials={ "char", 0x2272, 0x338 }, @@ -68357,29 +66751,33 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is neither greater than, nor similar to", mathname="ngtrsim", mirror=0x2274, specials={ "char", 0x2273, 0x338 }, unicodeslot=0x2275, }, [0x2276]={ - adobename="lessorgreater", category="sm", description="LESS-THAN OR GREATER-THAN", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is less than, or greater than", mathname="lessgtr", mirror=0x2277, unicodeslot=0x2276, }, [0x2277]={ - adobename="greaterorless", category="sm", description="GREATER-THAN OR LESS-THAN", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is greater than, or less than", mathname="gtrless", mirror=0x2276, unicodeslot=0x2277, @@ -68390,42 +66788,47 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is neither less than, nor greater than", mathname="nlessgtr", mirror=0x2279, specials={ "char", 0x2276, 0x338 }, unicodeslot=0x2278, }, [0x2279]={ - adobename="notgreaternorless", category="sm", description="NEITHER GREATER-THAN NOR LESS-THAN", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is neither greater than, nor less than", mathname="ngtrless", mirror=0x2278, specials={ "char", 0x2277, 0x338 }, unicodeslot=0x2279, }, [0x227A]={ - adobename="precedes", category="sm", description="PRECEDES", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="precedes", mathname="prec", mirror=0x227B, synonyms={ "lower rank than" }, unicodeslot=0x227A, }, [0x227B]={ - adobename="succeeds", category="sm", description="SUCCEEDS", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="succeeds", mathname="succ", mirror=0x227A, synonyms={ "higher rank than" }, @@ -68437,6 +66840,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="precedes, or equals", mathname="preccurlyeq", mirror=0x227D, unicodeslot=0x227C, @@ -68447,6 +66852,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="succeeds, or equals", mathname="succcurlyeq", mirror=0x227C, unicodeslot=0x227D, @@ -68457,6 +66864,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="precedes, or is equivalent to", mathname="precsim", mirror=0x227F, unicodeslot=0x227E, @@ -68467,104 +66876,114 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="succeeds, or is equivalent to", mathname="succsim", mirror=0x227E, unicodeslot=0x227F, }, [0x2280]={ - adobename="notprecedes", category="sm", description="DOES NOT PRECEDE", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="does not precede", mathname="nprec", mirror=0x2281, specials={ "char", 0x227A, 0x338 }, unicodeslot=0x2280, }, [0x2281]={ - adobename="notsucceeds", category="sm", description="DOES NOT SUCCEED", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="does not succeed", mathname="nsucc", mirror=0x2280, specials={ "char", 0x227B, 0x338 }, unicodeslot=0x2281, }, [0x2282]={ - adobename="subset", category="sm", cjkwd="a", description="SUBSET OF", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is a subset of", mathname="subset", mirror=0x2283, synonyms={ "included in set" }, unicodeslot=0x2282, }, [0x2283]={ - adobename="superset", category="sm", cjkwd="a", description="SUPERSET OF", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is a superset of", mathname="supset", mirror=0x2282, synonyms={ "includes in set" }, unicodeslot=0x2283, }, [0x2284]={ - adobename="notsubset", category="sm", description="NOT A SUBSET OF", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is not a subset of", mathname="nsubset", mirror=0x2285, specials={ "char", 0x2282, 0x338 }, unicodeslot=0x2284, }, [0x2285]={ - adobename="notsuperset", category="sm", description="NOT A SUPERSET OF", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is not a superset of", mathname="nsupset", mirror=0x2284, specials={ "char", 0x2283, 0x338 }, unicodeslot=0x2285, }, [0x2286]={ - adobename="subsetorequal", category="sm", cjkwd="a", description="SUBSET OF OR EQUAL TO", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is a subset of, or equal to", mathname="subseteq", mirror=0x2287, unicodeslot=0x2286, }, [0x2287]={ - adobename="supersetorequal", category="sm", cjkwd="a", description="SUPERSET OF OR EQUAL TO", direction="on", linebreak="ai", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is a superset of, or equal to", mathname="supseteq", mirror=0x2286, unicodeslot=0x2287, @@ -68575,6 +66994,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is neither a subset of, nor equal to", mathname="nsubseteq", mirror=0x2289, specials={ "char", 0x2286, 0x338 }, @@ -68586,18 +67007,21 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is neither a superset of, nor equal to", mathname="nsupseteq", mirror=0x2288, specials={ "char", 0x2287, 0x338 }, unicodeslot=0x2289, }, [0x228A]={ - adobename="subsetnotequal", category="sm", description="SUBSET OF WITH NOT EQUAL TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is a subset of, but not equal to", mathname="subsetneq", mirror=0x228B, unicodeslot=0x228A, @@ -68606,12 +67030,13 @@ characters.data={ }, }, [0x228B]={ - adobename="supersetnotequal", category="sm", description="SUPERSET OF WITH NOT EQUAL TO", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary set relation", + mathmeaning="is a superset of, but not equal to", mathname="supsetneq", mirror=0x228A, unicodeslot=0x228B, @@ -68639,6 +67064,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="multiset union", mathname="uplus", synonyms={ "bag addition" }, unicodeslot=0x228E, @@ -68708,7 +67135,6 @@ characters.data={ }, }, [0x2295]={ - adobename="pluscircle", category="sm", cjkwd="a", description="CIRCLED PLUS", @@ -68723,7 +67149,6 @@ characters.data={ }, }, [0x2296]={ - adobename="minuscircle", category="sm", description="CIRCLED MINUS", direction="on", @@ -68734,7 +67159,6 @@ characters.data={ unicodeslot=0x2296, }, [0x2297]={ - adobename="timescircle", category="sm", description="CIRCLED TIMES", direction="on", @@ -68758,7 +67182,6 @@ characters.data={ unicodeslot=0x2298, }, [0x2299]={ - adobename="circleot", category="sm", cjkwd="a", description="CIRCLED DOT OPERATOR", @@ -68856,7 +67279,6 @@ characters.data={ unicodeslot=0x22A2, }, [0x22A3]={ - adobename="tackleft", category="sm", description="LEFT TACK", direction="on", @@ -68868,23 +67290,25 @@ characters.data={ unicodeslot=0x22A3, }, [0x22A4]={ - adobename="tackdown", category="sm", description="DOWN TACK", direction="on", linebreak="al", mathclass="ordinary", + mathgroup="constant logical", + mathmeaning="true", mathname="top", synonyms={ "top" }, unicodeslot=0x22A4, }, [0x22A5]={ - adobename="perpendicular", category="sm", cjkwd="a", description="UP TACK", direction="on", linebreak="ai", + mathgroup="constant logical", + mathmeaning="false", mathspec={ { class="ordinary", @@ -69053,6 +67477,9 @@ characters.data={ description="ORIGINAL OF", direction="on", linebreak="al", + mathclass="relation", + mathgroup="binary relation", + mathmeaning="original of", mirror=0x22B7, unicodeslot=0x22B6, }, @@ -69061,6 +67488,9 @@ characters.data={ description="IMAGE OF", direction="on", linebreak="al", + mathclass="relation", + mathgroup="binary relation", + mathmeaning="image of", mirror=0x22B6, unicodeslot=0x22B7, }, @@ -69096,6 +67526,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary logical", + mathmeaning="xor", mathname="veebar", unicodeslot=0x22BB, }, @@ -69105,6 +67537,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary logical", + mathmeaning="not and", mathname="barwedge", unicodeslot=0x22BC, }, @@ -69123,7 +67557,6 @@ characters.data={ unicodeslot=0x22BE, }, [0x22BF]={ - adobename="righttriangle", category="sm", cjkwd="a", description="RIGHT TRIANGLE", @@ -69136,7 +67569,9 @@ characters.data={ description="N-ARY LOGICAL AND", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary logical", + mathmeaning="wedge product", mathname="bigwedge", unicodeslot=0x22C0, }, @@ -69145,7 +67580,9 @@ characters.data={ description="N-ARY LOGICAL OR", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary logical", + mathmeaning="wedge sum", mathname="bigvee", unicodeslot=0x22C1, }, @@ -69154,7 +67591,9 @@ characters.data={ description="N-ARY INTERSECTION", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="union", mathname="bigcap", synonyms={ "generalized intersection" }, unicodeslot=0x22C2, @@ -69164,7 +67603,9 @@ characters.data={ description="N-ARY UNION", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="union", mathname="bigcup", synonyms={ "generalized union" }, unicodeslot=0x22C3, @@ -69175,11 +67616,12 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="diamond operator", mathname="diamond", unicodeslot=0x22C4, }, [0x22C5]={ - adobename="dotmath", category="sm", description="DOT OPERATOR", direction="on", @@ -69187,8 +67629,16 @@ characters.data={ mathspec={ { class="binary", + group="binary arithmetic", + meaning="multiplication", name="cdot", }, + { + class="binary", + group="binary vector", + meaning="scalarproduct", + name="scalarproduct", + }, { class="punctuation", name="cdotp", @@ -69202,6 +67652,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="star operator", mathname="star", unicodeslot=0x22C6, }, @@ -69237,6 +67689,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="semidirect product", mathname="ltimes", mirror=0x22CA, unicodeslot=0x22C9, @@ -69247,6 +67701,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="semidirect product", mathname="rtimes", mirror=0x22C9, unicodeslot=0x22CA, @@ -69257,6 +67713,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="left semidirect product", mathname="leftthreetimes", mirror=0x22CC, unicodeslot=0x22CB, @@ -69267,6 +67725,8 @@ characters.data={ direction="on", linebreak="al", mathclass="binary", + mathgroup="binary arithmetic", + mathmeaning="right semidirect product", mathname="rightthreetimes", mirror=0x22CB, unicodeslot=0x22CC, @@ -69280,22 +67740,24 @@ characters.data={ unicodeslot=0x22CD, }, [0x22CE]={ - adobename="curlyor", category="sm", description="CURLY LOGICAL OR", direction="on", linebreak="al", mathclass="binary", + mathgroup="binary logical", + mathmeaning="wedge sum", mathname="curlyvee", unicodeslot=0x22CE, }, [0x22CF]={ - adobename="curlyand", category="sm", description="CURLY LOGICAL AND", direction="on", linebreak="al", mathclass="binary", + mathgroup="binary logical", + mathmeaning="wedge product", mathname="curlywedge", unicodeslot=0x22CF, }, @@ -69395,7 +67857,9 @@ characters.data={ description="VERY MUCH LESS-THAN", direction="on", linebreak="al", + mathgroup="binary relation", mathlist={ 0x3C, 0x3C, 0x3C }, + mathmeaning="way less than", mathspec={ { class="relation", @@ -69414,7 +67878,9 @@ characters.data={ description="VERY MUCH GREATER-THAN", direction="on", linebreak="al", + mathgroup="binary relation", mathlist={ 0x3E, 0x3E, 0x3E }, + mathmeaning="way greater than", mathspec={ { class="relation", @@ -69429,12 +67895,13 @@ characters.data={ unicodeslot=0x22D9, }, [0x22DA]={ - adobename="lessequalorgreater", category="sm", description="LESS-THAN EQUAL TO OR GREATER-THAN", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is less than, equals, or greater than", mathname="lesseqgtr", mirror=0x22DB, unicodeslot=0x22DA, @@ -69443,12 +67910,13 @@ characters.data={ }, }, [0x22DB]={ - adobename="greaterequalorless", category="sm", description="GREATER-THAN EQUAL TO OR LESS-THAN", direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is greater than, equals, or less than", mathname="gtreqless", mirror=0x22DA, unicodeslot=0x22DB, @@ -69462,7 +67930,9 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x3D, 0x3C }, + mathmeaning="equals, or is less than", mathname="eqless", mirror=0x22DD, unicodeslot=0x22DC, @@ -69473,7 +67943,9 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", mathlist={ 0x3D, 0x3E }, + mathmeaning="equals, or is greater than", mathname="eqgtr", mirror=0x22DC, unicodeslot=0x22DD, @@ -69484,6 +67956,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="equals, or precedes", mathname="curlyeqprec", mirror=0x22DF, unicodeslot=0x22DE, @@ -69494,6 +67968,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="equals, or succeeds", mathname="curlyeqsucc", mirror=0x22DE, unicodeslot=0x22DF, @@ -69504,6 +67980,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="does not precede, nor equals to", mathname="npreccurlyeq", mirror=0x22E1, specials={ "char", 0x227C, 0x338 }, @@ -69515,6 +67993,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="does not succeed, nor equals to", mathname="nsucccurlyeq", mirror=0x22E0, specials={ "char", 0x227D, 0x338 }, @@ -69568,6 +68048,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="less than, but not equivalent to", mathname="lnsim", mirror=0x22E7, unicodeslot=0x22E6, @@ -69578,6 +68060,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="greater than, but not equivalent to", mathname="gnsim", mirror=0x22E6, unicodeslot=0x22E7, @@ -69588,6 +68072,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="preceeds, but not equivalent to", mathname="precnsim", mirror=0x22E9, unicodeslot=0x22E8, @@ -69598,6 +68084,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="succeeds, but not equivalent to", mathname="succnsim", mirror=0x22E8, unicodeslot=0x22E9, @@ -69608,6 +68096,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is not a normal subgroup of", mathname="ntriangleright", mirror=0x22EB, specials={ "char", 0x22B2, 0x338 }, @@ -69619,6 +68109,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="does not contain a normal subgroup", mathname="ntriangleleft", mirror=0x22EA, specials={ "char", 0x22B3, 0x338 }, @@ -69630,6 +68122,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="is not a normal subgroup of, nor equal to", mathname="ntrianglelefteq", mirror=0x22ED, specials={ "char", 0x22B4, 0x338 }, @@ -69641,13 +68135,14 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="does not contain a normal subgroup, nor is equal to", mathname="ntrianglerighteq", mirror=0x22EC, specials={ "char", 0x22B5, 0x338 }, unicodeslot=0x22ED, }, [0x22EE]={ - adobename="ellipsisvertical", category="sm", description="VERTICAL ELLIPSIS", direction="on", @@ -69819,7 +68314,6 @@ characters.data={ unicodeslot=0x2301, }, [0x2302]={ - adobename="house", category="so", description="HOUSE", direction="on", @@ -69827,7 +68321,6 @@ characters.data={ unicodeslot=0x2302, }, [0x2303]={ - adobename="control", category="so", description="UP ARROWHEAD", direction="on", @@ -69842,7 +68335,6 @@ characters.data={ unicodeslot=0x2304, }, [0x2305]={ - adobename="projective", category="so", description="PROJECTIVE", direction="on", @@ -69934,7 +68426,6 @@ characters.data={ unicodeslot=0x230F, }, [0x2310]={ - adobename="revlogicalnot", category="so", description="REVERSED NOT SIGN", direction="on", @@ -69951,7 +68442,6 @@ characters.data={ unicodeslot=0x2311, }, [0x2312]={ - adobename="arc", category="so", cjkwd="a", description="ARC", @@ -69995,7 +68485,6 @@ characters.data={ unicodeslot=0x2317, }, [0x2318]={ - adobename="propellor", category="so", description="PLACE OF INTEREST SIGN", direction="on", @@ -70066,7 +68555,6 @@ characters.data={ unicodeslot=0x231F, }, [0x2320]={ - adobename="integraltp", category="sm", description="TOP HALF INTEGRAL", direction="on", @@ -70074,7 +68562,6 @@ characters.data={ unicodeslot=0x2320, }, [0x2321]={ - adobename="integralbt", category="sm", description="BOTTOM HALF INTEGRAL", direction="on", @@ -70108,7 +68595,6 @@ characters.data={ unicodeslot=0x2324, }, [0x2325]={ - adobename="option", category="so", description="OPTION KEY", direction="on", @@ -70116,7 +68602,6 @@ characters.data={ unicodeslot=0x2325, }, [0x2326]={ - adobename="deleteright", category="so", description="ERASE TO THE RIGHT", direction="on", @@ -70125,7 +68610,6 @@ characters.data={ unicodeslot=0x2326, }, [0x2327]={ - adobename="clear", category="so", description="X IN A RECTANGLE BOX", direction="on", @@ -70142,7 +68626,6 @@ characters.data={ variants=variants_emoji, }, [0x2329]={ - adobename="angleleft", category="ps", cjkwd="w", description="LEFT-POINTING ANGLE BRACKET", @@ -70153,7 +68636,6 @@ characters.data={ unicodeslot=0x2329, }, [0x232A]={ - adobename="angleright", category="pe", cjkwd="w", description="RIGHT-POINTING ANGLE BRACKET", @@ -70164,7 +68646,6 @@ characters.data={ unicodeslot=0x232A, }, [0x232B]={ - adobename="deleteleft", category="so", description="ERASE TO THE LEFT", direction="on", @@ -71968,7 +70449,6 @@ characters.data={ unicodeslot=0x2422, }, [0x2423]={ - adobename="blank", category="so", contextname="textcontrolspace", description="OPEN BOX", @@ -72076,7 +70556,6 @@ characters.data={ unicodeslot=0x244A, }, [0x2460]={ - adobename="onecircle", category="no", cjkwd="a", description="CIRCLED DIGIT ONE", @@ -72086,7 +70565,6 @@ characters.data={ unicodeslot=0x2460, }, [0x2461]={ - adobename="twocircle", category="no", cjkwd="a", description="CIRCLED DIGIT TWO", @@ -72096,7 +70574,6 @@ characters.data={ unicodeslot=0x2461, }, [0x2462]={ - adobename="threecircle", category="no", cjkwd="a", description="CIRCLED DIGIT THREE", @@ -72106,7 +70583,6 @@ characters.data={ unicodeslot=0x2462, }, [0x2463]={ - adobename="fourcircle", category="no", cjkwd="a", description="CIRCLED DIGIT FOUR", @@ -72116,7 +70592,6 @@ characters.data={ unicodeslot=0x2463, }, [0x2464]={ - adobename="fivecircle", category="no", cjkwd="a", description="CIRCLED DIGIT FIVE", @@ -72126,7 +70601,6 @@ characters.data={ unicodeslot=0x2464, }, [0x2465]={ - adobename="sixcircle", category="no", cjkwd="a", description="CIRCLED DIGIT SIX", @@ -72136,7 +70610,6 @@ characters.data={ unicodeslot=0x2465, }, [0x2466]={ - adobename="sevencircle", category="no", cjkwd="a", description="CIRCLED DIGIT SEVEN", @@ -72146,7 +70619,6 @@ characters.data={ unicodeslot=0x2466, }, [0x2467]={ - adobename="eightcircle", category="no", cjkwd="a", description="CIRCLED DIGIT EIGHT", @@ -72156,7 +70628,6 @@ characters.data={ unicodeslot=0x2467, }, [0x2468]={ - adobename="ninecircle", category="no", cjkwd="a", description="CIRCLED DIGIT NINE", @@ -72166,7 +70637,6 @@ characters.data={ unicodeslot=0x2468, }, [0x2469]={ - adobename="tencircle", category="no", cjkwd="a", description="CIRCLED NUMBER TEN", @@ -72176,7 +70646,6 @@ characters.data={ unicodeslot=0x2469, }, [0x246A]={ - adobename="elevencircle", category="no", cjkwd="a", description="CIRCLED NUMBER ELEVEN", @@ -72186,7 +70655,6 @@ characters.data={ unicodeslot=0x246A, }, [0x246B]={ - adobename="twelvecircle", category="no", cjkwd="a", description="CIRCLED NUMBER TWELVE", @@ -72196,7 +70664,6 @@ characters.data={ unicodeslot=0x246B, }, [0x246C]={ - adobename="thirteencircle", category="no", cjkwd="a", description="CIRCLED NUMBER THIRTEEN", @@ -72206,7 +70673,6 @@ characters.data={ unicodeslot=0x246C, }, [0x246D]={ - adobename="fourteencircle", category="no", cjkwd="a", description="CIRCLED NUMBER FOURTEEN", @@ -72216,7 +70682,6 @@ characters.data={ unicodeslot=0x246D, }, [0x246E]={ - adobename="fifteencircle", category="no", cjkwd="a", description="CIRCLED NUMBER FIFTEEN", @@ -72226,7 +70691,6 @@ characters.data={ unicodeslot=0x246E, }, [0x246F]={ - adobename="sixteencircle", category="no", cjkwd="a", description="CIRCLED NUMBER SIXTEEN", @@ -72236,7 +70700,6 @@ characters.data={ unicodeslot=0x246F, }, [0x2470]={ - adobename="seventeencircle", category="no", cjkwd="a", description="CIRCLED NUMBER SEVENTEEN", @@ -72246,7 +70709,6 @@ characters.data={ unicodeslot=0x2470, }, [0x2471]={ - adobename="eighteencircle", category="no", cjkwd="a", description="CIRCLED NUMBER EIGHTEEN", @@ -72256,7 +70718,6 @@ characters.data={ unicodeslot=0x2471, }, [0x2472]={ - adobename="nineteencircle", category="no", cjkwd="a", description="CIRCLED NUMBER NINETEEN", @@ -72266,7 +70727,6 @@ characters.data={ unicodeslot=0x2472, }, [0x2473]={ - adobename="twentycircle", category="no", cjkwd="a", description="CIRCLED NUMBER TWENTY", @@ -72276,7 +70736,6 @@ characters.data={ unicodeslot=0x2473, }, [0x2474]={ - adobename="oneparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT ONE", @@ -72286,7 +70745,6 @@ characters.data={ unicodeslot=0x2474, }, [0x2475]={ - adobename="twoparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT TWO", @@ -72296,7 +70754,6 @@ characters.data={ unicodeslot=0x2475, }, [0x2476]={ - adobename="threeparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT THREE", @@ -72306,7 +70763,6 @@ characters.data={ unicodeslot=0x2476, }, [0x2477]={ - adobename="fourparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT FOUR", @@ -72316,7 +70772,6 @@ characters.data={ unicodeslot=0x2477, }, [0x2478]={ - adobename="fiveparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT FIVE", @@ -72326,7 +70781,6 @@ characters.data={ unicodeslot=0x2478, }, [0x2479]={ - adobename="sixparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT SIX", @@ -72336,7 +70790,6 @@ characters.data={ unicodeslot=0x2479, }, [0x247A]={ - adobename="sevenparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT SEVEN", @@ -72346,7 +70799,6 @@ characters.data={ unicodeslot=0x247A, }, [0x247B]={ - adobename="eightparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT EIGHT", @@ -72356,7 +70808,6 @@ characters.data={ unicodeslot=0x247B, }, [0x247C]={ - adobename="nineparen", category="no", cjkwd="a", description="PARENTHESIZED DIGIT NINE", @@ -72366,7 +70817,6 @@ characters.data={ unicodeslot=0x247C, }, [0x247D]={ - adobename="tenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER TEN", @@ -72376,7 +70826,6 @@ characters.data={ unicodeslot=0x247D, }, [0x247E]={ - adobename="elevenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER ELEVEN", @@ -72386,7 +70835,6 @@ characters.data={ unicodeslot=0x247E, }, [0x247F]={ - adobename="twelveparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER TWELVE", @@ -72396,7 +70844,6 @@ characters.data={ unicodeslot=0x247F, }, [0x2480]={ - adobename="thirteenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER THIRTEEN", @@ -72406,7 +70853,6 @@ characters.data={ unicodeslot=0x2480, }, [0x2481]={ - adobename="fourteenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER FOURTEEN", @@ -72416,7 +70862,6 @@ characters.data={ unicodeslot=0x2481, }, [0x2482]={ - adobename="fifteenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER FIFTEEN", @@ -72426,7 +70871,6 @@ characters.data={ unicodeslot=0x2482, }, [0x2483]={ - adobename="sixteenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER SIXTEEN", @@ -72436,7 +70880,6 @@ characters.data={ unicodeslot=0x2483, }, [0x2484]={ - adobename="seventeenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER SEVENTEEN", @@ -72446,7 +70889,6 @@ characters.data={ unicodeslot=0x2484, }, [0x2485]={ - adobename="eighteenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER EIGHTEEN", @@ -72456,7 +70898,6 @@ characters.data={ unicodeslot=0x2485, }, [0x2486]={ - adobename="nineteenparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER NINETEEN", @@ -72466,7 +70907,6 @@ characters.data={ unicodeslot=0x2486, }, [0x2487]={ - adobename="twentyparen", category="no", cjkwd="a", description="PARENTHESIZED NUMBER TWENTY", @@ -72476,7 +70916,6 @@ characters.data={ unicodeslot=0x2487, }, [0x2488]={ - adobename="oneperiod", category="no", cjkwd="a", description="DIGIT ONE FULL STOP", @@ -72486,7 +70925,6 @@ characters.data={ unicodeslot=0x2488, }, [0x2489]={ - adobename="twoperiod", category="no", cjkwd="a", description="DIGIT TWO FULL STOP", @@ -72496,7 +70934,6 @@ characters.data={ unicodeslot=0x2489, }, [0x248A]={ - adobename="threeperiod", category="no", cjkwd="a", description="DIGIT THREE FULL STOP", @@ -72506,7 +70943,6 @@ characters.data={ unicodeslot=0x248A, }, [0x248B]={ - adobename="fourperiod", category="no", cjkwd="a", description="DIGIT FOUR FULL STOP", @@ -72516,7 +70952,6 @@ characters.data={ unicodeslot=0x248B, }, [0x248C]={ - adobename="fiveperiod", category="no", cjkwd="a", description="DIGIT FIVE FULL STOP", @@ -72526,7 +70961,6 @@ characters.data={ unicodeslot=0x248C, }, [0x248D]={ - adobename="sixperiod", category="no", cjkwd="a", description="DIGIT SIX FULL STOP", @@ -72536,7 +70970,6 @@ characters.data={ unicodeslot=0x248D, }, [0x248E]={ - adobename="sevenperiod", category="no", cjkwd="a", description="DIGIT SEVEN FULL STOP", @@ -72546,7 +70979,6 @@ characters.data={ unicodeslot=0x248E, }, [0x248F]={ - adobename="eightperiod", category="no", cjkwd="a", description="DIGIT EIGHT FULL STOP", @@ -72556,7 +70988,6 @@ characters.data={ unicodeslot=0x248F, }, [0x2490]={ - adobename="nineperiod", category="no", cjkwd="a", description="DIGIT NINE FULL STOP", @@ -72566,7 +70997,6 @@ characters.data={ unicodeslot=0x2490, }, [0x2491]={ - adobename="tenperiod", category="no", cjkwd="a", description="NUMBER TEN FULL STOP", @@ -72576,7 +71006,6 @@ characters.data={ unicodeslot=0x2491, }, [0x2492]={ - adobename="elevenperiod", category="no", cjkwd="a", description="NUMBER ELEVEN FULL STOP", @@ -72586,7 +71015,6 @@ characters.data={ unicodeslot=0x2492, }, [0x2493]={ - adobename="twelveperiod", category="no", cjkwd="a", description="NUMBER TWELVE FULL STOP", @@ -72596,7 +71024,6 @@ characters.data={ unicodeslot=0x2493, }, [0x2494]={ - adobename="thirteenperiod", category="no", cjkwd="a", description="NUMBER THIRTEEN FULL STOP", @@ -72606,7 +71033,6 @@ characters.data={ unicodeslot=0x2494, }, [0x2495]={ - adobename="fourteenperiod", category="no", cjkwd="a", description="NUMBER FOURTEEN FULL STOP", @@ -72616,7 +71042,6 @@ characters.data={ unicodeslot=0x2495, }, [0x2496]={ - adobename="fifteenperiod", category="no", cjkwd="a", description="NUMBER FIFTEEN FULL STOP", @@ -72626,7 +71051,6 @@ characters.data={ unicodeslot=0x2496, }, [0x2497]={ - adobename="sixteenperiod", category="no", cjkwd="a", description="NUMBER SIXTEEN FULL STOP", @@ -72636,7 +71060,6 @@ characters.data={ unicodeslot=0x2497, }, [0x2498]={ - adobename="seventeenperiod", category="no", cjkwd="a", description="NUMBER SEVENTEEN FULL STOP", @@ -72646,7 +71069,6 @@ characters.data={ unicodeslot=0x2498, }, [0x2499]={ - adobename="eighteenperiod", category="no", cjkwd="a", description="NUMBER EIGHTEEN FULL STOP", @@ -72656,7 +71078,6 @@ characters.data={ unicodeslot=0x2499, }, [0x249A]={ - adobename="nineteenperiod", category="no", cjkwd="a", description="NUMBER NINETEEN FULL STOP", @@ -72666,7 +71087,6 @@ characters.data={ unicodeslot=0x249A, }, [0x249B]={ - adobename="twentyperiod", category="no", cjkwd="a", description="NUMBER TWENTY FULL STOP", @@ -72676,7 +71096,6 @@ characters.data={ unicodeslot=0x249B, }, [0x249C]={ - adobename="aparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER A", @@ -72686,7 +71105,6 @@ characters.data={ unicodeslot=0x249C, }, [0x249D]={ - adobename="bparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER B", @@ -72696,7 +71114,6 @@ characters.data={ unicodeslot=0x249D, }, [0x249E]={ - adobename="cparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER C", @@ -72706,7 +71123,6 @@ characters.data={ unicodeslot=0x249E, }, [0x249F]={ - adobename="dparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER D", @@ -72716,7 +71132,6 @@ characters.data={ unicodeslot=0x249F, }, [0x24A0]={ - adobename="eparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER E", @@ -72726,7 +71141,6 @@ characters.data={ unicodeslot=0x24A0, }, [0x24A1]={ - adobename="fparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER F", @@ -72736,7 +71150,6 @@ characters.data={ unicodeslot=0x24A1, }, [0x24A2]={ - adobename="gparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER G", @@ -72746,7 +71159,6 @@ characters.data={ unicodeslot=0x24A2, }, [0x24A3]={ - adobename="hparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER H", @@ -72756,7 +71168,6 @@ characters.data={ unicodeslot=0x24A3, }, [0x24A4]={ - adobename="iparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER I", @@ -72766,7 +71177,6 @@ characters.data={ unicodeslot=0x24A4, }, [0x24A5]={ - adobename="jparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER J", @@ -72776,7 +71186,6 @@ characters.data={ unicodeslot=0x24A5, }, [0x24A6]={ - adobename="kparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER K", @@ -72786,7 +71195,6 @@ characters.data={ unicodeslot=0x24A6, }, [0x24A7]={ - adobename="lparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER L", @@ -72796,7 +71204,6 @@ characters.data={ unicodeslot=0x24A7, }, [0x24A8]={ - adobename="mparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER M", @@ -72806,7 +71213,6 @@ characters.data={ unicodeslot=0x24A8, }, [0x24A9]={ - adobename="nparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER N", @@ -72816,7 +71222,6 @@ characters.data={ unicodeslot=0x24A9, }, [0x24AA]={ - adobename="oparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER O", @@ -72826,7 +71231,6 @@ characters.data={ unicodeslot=0x24AA, }, [0x24AB]={ - adobename="pparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER P", @@ -72836,7 +71240,6 @@ characters.data={ unicodeslot=0x24AB, }, [0x24AC]={ - adobename="qparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER Q", @@ -72846,7 +71249,6 @@ characters.data={ unicodeslot=0x24AC, }, [0x24AD]={ - adobename="rparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER R", @@ -72856,7 +71258,6 @@ characters.data={ unicodeslot=0x24AD, }, [0x24AE]={ - adobename="sparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER S", @@ -72866,7 +71267,6 @@ characters.data={ unicodeslot=0x24AE, }, [0x24AF]={ - adobename="tparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER T", @@ -72876,7 +71276,6 @@ characters.data={ unicodeslot=0x24AF, }, [0x24B0]={ - adobename="uparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER U", @@ -72886,7 +71285,6 @@ characters.data={ unicodeslot=0x24B0, }, [0x24B1]={ - adobename="vparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER V", @@ -72896,7 +71294,6 @@ characters.data={ unicodeslot=0x24B1, }, [0x24B2]={ - adobename="wparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER W", @@ -72906,7 +71303,6 @@ characters.data={ unicodeslot=0x24B2, }, [0x24B3]={ - adobename="xparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER X", @@ -72916,7 +71312,6 @@ characters.data={ unicodeslot=0x24B3, }, [0x24B4]={ - adobename="yparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER Y", @@ -72926,7 +71321,6 @@ characters.data={ unicodeslot=0x24B4, }, [0x24B5]={ - adobename="zparen", category="so", cjkwd="a", description="PARENTHESIZED LATIN SMALL LETTER Z", @@ -72936,7 +71330,6 @@ characters.data={ unicodeslot=0x24B5, }, [0x24B6]={ - adobename="Acircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER A", @@ -72947,7 +71340,6 @@ characters.data={ unicodeslot=0x24B6, }, [0x24B7]={ - adobename="Bcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER B", @@ -72958,7 +71350,6 @@ characters.data={ unicodeslot=0x24B7, }, [0x24B8]={ - adobename="Ccircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER C", @@ -72969,7 +71360,6 @@ characters.data={ unicodeslot=0x24B8, }, [0x24B9]={ - adobename="Dcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER D", @@ -72980,7 +71370,6 @@ characters.data={ unicodeslot=0x24B9, }, [0x24BA]={ - adobename="Ecircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER E", @@ -72991,7 +71380,6 @@ characters.data={ unicodeslot=0x24BA, }, [0x24BB]={ - adobename="Fcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER F", @@ -73002,7 +71390,6 @@ characters.data={ unicodeslot=0x24BB, }, [0x24BC]={ - adobename="Gcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER G", @@ -73013,7 +71400,6 @@ characters.data={ unicodeslot=0x24BC, }, [0x24BD]={ - adobename="Hcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER H", @@ -73024,7 +71410,6 @@ characters.data={ unicodeslot=0x24BD, }, [0x24BE]={ - adobename="Icircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER I", @@ -73035,7 +71420,6 @@ characters.data={ unicodeslot=0x24BE, }, [0x24BF]={ - adobename="Jcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER J", @@ -73046,7 +71430,6 @@ characters.data={ unicodeslot=0x24BF, }, [0x24C0]={ - adobename="Kcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER K", @@ -73057,7 +71440,6 @@ characters.data={ unicodeslot=0x24C0, }, [0x24C1]={ - adobename="Lcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER L", @@ -73068,7 +71450,6 @@ characters.data={ unicodeslot=0x24C1, }, [0x24C2]={ - adobename="Mcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER M", @@ -73080,7 +71461,6 @@ characters.data={ variants=variants_emoji, }, [0x24C3]={ - adobename="Ncircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER N", @@ -73091,7 +71471,6 @@ characters.data={ unicodeslot=0x24C3, }, [0x24C4]={ - adobename="Ocircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER O", @@ -73102,7 +71481,6 @@ characters.data={ unicodeslot=0x24C4, }, [0x24C5]={ - adobename="Pcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER P", @@ -73113,7 +71491,6 @@ characters.data={ unicodeslot=0x24C5, }, [0x24C6]={ - adobename="Qcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER Q", @@ -73124,7 +71501,6 @@ characters.data={ unicodeslot=0x24C6, }, [0x24C7]={ - adobename="Rcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER R", @@ -73137,7 +71513,6 @@ characters.data={ unicodeslot=0x24C7, }, [0x24C8]={ - adobename="Scircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER S", @@ -73150,7 +71525,6 @@ characters.data={ unicodeslot=0x24C8, }, [0x24C9]={ - adobename="Tcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER T", @@ -73161,7 +71535,6 @@ characters.data={ unicodeslot=0x24C9, }, [0x24CA]={ - adobename="Ucircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER U", @@ -73172,7 +71545,6 @@ characters.data={ unicodeslot=0x24CA, }, [0x24CB]={ - adobename="Vcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER V", @@ -73183,7 +71555,6 @@ characters.data={ unicodeslot=0x24CB, }, [0x24CC]={ - adobename="Wcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER W", @@ -73194,7 +71565,6 @@ characters.data={ unicodeslot=0x24CC, }, [0x24CD]={ - adobename="Xcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER X", @@ -73205,7 +71575,6 @@ characters.data={ unicodeslot=0x24CD, }, [0x24CE]={ - adobename="Ycircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER Y", @@ -73216,7 +71585,6 @@ characters.data={ unicodeslot=0x24CE, }, [0x24CF]={ - adobename="Zcircle", category="so", cjkwd="a", description="CIRCLED LATIN CAPITAL LETTER Z", @@ -73227,7 +71595,6 @@ characters.data={ unicodeslot=0x24CF, }, [0x24D0]={ - adobename="acircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER A", @@ -73238,7 +71605,6 @@ characters.data={ unicodeslot=0x24D0, }, [0x24D1]={ - adobename="bcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER B", @@ -73249,7 +71615,6 @@ characters.data={ unicodeslot=0x24D1, }, [0x24D2]={ - adobename="ccircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER C", @@ -73260,7 +71625,6 @@ characters.data={ unicodeslot=0x24D2, }, [0x24D3]={ - adobename="dcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER D", @@ -73271,7 +71635,6 @@ characters.data={ unicodeslot=0x24D3, }, [0x24D4]={ - adobename="ecircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER E", @@ -73282,7 +71645,6 @@ characters.data={ unicodeslot=0x24D4, }, [0x24D5]={ - adobename="fcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER F", @@ -73293,7 +71655,6 @@ characters.data={ unicodeslot=0x24D5, }, [0x24D6]={ - adobename="gcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER G", @@ -73304,7 +71665,6 @@ characters.data={ unicodeslot=0x24D6, }, [0x24D7]={ - adobename="hcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER H", @@ -73315,7 +71675,6 @@ characters.data={ unicodeslot=0x24D7, }, [0x24D8]={ - adobename="icircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER I", @@ -73326,7 +71685,6 @@ characters.data={ unicodeslot=0x24D8, }, [0x24D9]={ - adobename="jcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER J", @@ -73337,7 +71695,6 @@ characters.data={ unicodeslot=0x24D9, }, [0x24DA]={ - adobename="kcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER K", @@ -73348,7 +71705,6 @@ characters.data={ unicodeslot=0x24DA, }, [0x24DB]={ - adobename="lcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER L", @@ -73359,7 +71715,6 @@ characters.data={ unicodeslot=0x24DB, }, [0x24DC]={ - adobename="mcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER M", @@ -73370,7 +71725,6 @@ characters.data={ unicodeslot=0x24DC, }, [0x24DD]={ - adobename="ncircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER N", @@ -73381,7 +71735,6 @@ characters.data={ unicodeslot=0x24DD, }, [0x24DE]={ - adobename="ocircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER O", @@ -73392,7 +71745,6 @@ characters.data={ unicodeslot=0x24DE, }, [0x24DF]={ - adobename="pcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER P", @@ -73403,7 +71755,6 @@ characters.data={ unicodeslot=0x24DF, }, [0x24E0]={ - adobename="qcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER Q", @@ -73414,7 +71765,6 @@ characters.data={ unicodeslot=0x24E0, }, [0x24E1]={ - adobename="rcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER R", @@ -73425,7 +71775,6 @@ characters.data={ unicodeslot=0x24E1, }, [0x24E2]={ - adobename="scircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER S", @@ -73436,7 +71785,6 @@ characters.data={ unicodeslot=0x24E2, }, [0x24E3]={ - adobename="tcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER T", @@ -73447,7 +71795,6 @@ characters.data={ unicodeslot=0x24E3, }, [0x24E4]={ - adobename="ucircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER U", @@ -73458,7 +71805,6 @@ characters.data={ unicodeslot=0x24E4, }, [0x24E5]={ - adobename="vcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER V", @@ -73469,7 +71815,6 @@ characters.data={ unicodeslot=0x24E5, }, [0x24E6]={ - adobename="wcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER W", @@ -73480,7 +71825,6 @@ characters.data={ unicodeslot=0x24E6, }, [0x24E7]={ - adobename="xcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER X", @@ -73491,7 +71835,6 @@ characters.data={ unicodeslot=0x24E7, }, [0x24E8]={ - adobename="ycircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER Y", @@ -73502,7 +71845,6 @@ characters.data={ unicodeslot=0x24E8, }, [0x24E9]={ - adobename="zcircle", category="so", cjkwd="a", description="CIRCLED LATIN SMALL LETTER Z", @@ -73689,7 +72031,6 @@ characters.data={ unicodeslot=0x24FF, }, [0x2500]={ - adobename="SF100000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT HORIZONTAL", @@ -73706,7 +72047,6 @@ characters.data={ unicodeslot=0x2501, }, [0x2502]={ - adobename="SF110000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT VERTICAL", @@ -73787,7 +72127,6 @@ characters.data={ unicodeslot=0x250B, }, [0x250C]={ - adobename="SF010000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT DOWN AND RIGHT", @@ -73820,7 +72159,6 @@ characters.data={ unicodeslot=0x250F, }, [0x2510]={ - adobename="SF030000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT DOWN AND LEFT", @@ -73853,7 +72191,6 @@ characters.data={ unicodeslot=0x2513, }, [0x2514]={ - adobename="SF020000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT UP AND RIGHT", @@ -73886,7 +72223,6 @@ characters.data={ unicodeslot=0x2517, }, [0x2518]={ - adobename="SF040000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT UP AND LEFT", @@ -73919,7 +72255,6 @@ characters.data={ unicodeslot=0x251B, }, [0x251C]={ - adobename="SF080000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT VERTICAL AND RIGHT", @@ -73984,7 +72319,6 @@ characters.data={ unicodeslot=0x2523, }, [0x2524]={ - adobename="SF090000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT VERTICAL AND LEFT", @@ -74049,7 +72383,6 @@ characters.data={ unicodeslot=0x252B, }, [0x252C]={ - adobename="SF060000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT DOWN AND HORIZONTAL", @@ -74114,7 +72447,6 @@ characters.data={ unicodeslot=0x2533, }, [0x2534]={ - adobename="SF070000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT UP AND HORIZONTAL", @@ -74179,7 +72511,6 @@ characters.data={ unicodeslot=0x253B, }, [0x253C]={ - adobename="SF050000", category="so", cjkwd="a", description="BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL", @@ -74336,7 +72667,6 @@ characters.data={ unicodeslot=0x254F, }, [0x2550]={ - adobename="SF430000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE HORIZONTAL", @@ -74345,7 +72675,6 @@ characters.data={ unicodeslot=0x2550, }, [0x2551]={ - adobename="SF240000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE VERTICAL", @@ -74354,7 +72683,6 @@ characters.data={ unicodeslot=0x2551, }, [0x2552]={ - adobename="SF510000", category="so", cjkwd="a", description="BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE", @@ -74363,7 +72691,6 @@ characters.data={ unicodeslot=0x2552, }, [0x2553]={ - adobename="SF520000", category="so", cjkwd="a", description="BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE", @@ -74372,7 +72699,6 @@ characters.data={ unicodeslot=0x2553, }, [0x2554]={ - adobename="SF390000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE DOWN AND RIGHT", @@ -74381,7 +72707,6 @@ characters.data={ unicodeslot=0x2554, }, [0x2555]={ - adobename="SF220000", category="so", cjkwd="a", description="BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE", @@ -74390,7 +72715,6 @@ characters.data={ unicodeslot=0x2555, }, [0x2556]={ - adobename="SF210000", category="so", cjkwd="a", description="BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE", @@ -74399,7 +72723,6 @@ characters.data={ unicodeslot=0x2556, }, [0x2557]={ - adobename="SF250000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE DOWN AND LEFT", @@ -74408,7 +72731,6 @@ characters.data={ unicodeslot=0x2557, }, [0x2558]={ - adobename="SF500000", category="so", cjkwd="a", description="BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE", @@ -74417,7 +72739,6 @@ characters.data={ unicodeslot=0x2558, }, [0x2559]={ - adobename="SF490000", category="so", cjkwd="a", description="BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE", @@ -74426,7 +72747,6 @@ characters.data={ unicodeslot=0x2559, }, [0x255A]={ - adobename="SF380000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE UP AND RIGHT", @@ -74435,7 +72755,6 @@ characters.data={ unicodeslot=0x255A, }, [0x255B]={ - adobename="SF280000", category="so", cjkwd="a", description="BOX DRAWINGS UP SINGLE AND LEFT DOUBLE", @@ -74444,7 +72763,6 @@ characters.data={ unicodeslot=0x255B, }, [0x255C]={ - adobename="SF270000", category="so", cjkwd="a", description="BOX DRAWINGS UP DOUBLE AND LEFT SINGLE", @@ -74453,7 +72771,6 @@ characters.data={ unicodeslot=0x255C, }, [0x255D]={ - adobename="SF260000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE UP AND LEFT", @@ -74462,7 +72779,6 @@ characters.data={ unicodeslot=0x255D, }, [0x255E]={ - adobename="SF360000", category="so", cjkwd="a", description="BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE", @@ -74471,7 +72787,6 @@ characters.data={ unicodeslot=0x255E, }, [0x255F]={ - adobename="SF370000", category="so", cjkwd="a", description="BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE", @@ -74480,7 +72795,6 @@ characters.data={ unicodeslot=0x255F, }, [0x2560]={ - adobename="SF420000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE VERTICAL AND RIGHT", @@ -74489,7 +72803,6 @@ characters.data={ unicodeslot=0x2560, }, [0x2561]={ - adobename="SF190000", category="so", cjkwd="a", description="BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE", @@ -74498,7 +72811,6 @@ characters.data={ unicodeslot=0x2561, }, [0x2562]={ - adobename="SF200000", category="so", cjkwd="a", description="BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE", @@ -74507,7 +72819,6 @@ characters.data={ unicodeslot=0x2562, }, [0x2563]={ - adobename="SF230000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE VERTICAL AND LEFT", @@ -74516,7 +72827,6 @@ characters.data={ unicodeslot=0x2563, }, [0x2564]={ - adobename="SF470000", category="so", cjkwd="a", description="BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE", @@ -74525,7 +72835,6 @@ characters.data={ unicodeslot=0x2564, }, [0x2565]={ - adobename="SF480000", category="so", cjkwd="a", description="BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE", @@ -74534,7 +72843,6 @@ characters.data={ unicodeslot=0x2565, }, [0x2566]={ - adobename="SF410000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL", @@ -74543,7 +72851,6 @@ characters.data={ unicodeslot=0x2566, }, [0x2567]={ - adobename="SF450000", category="so", cjkwd="a", description="BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE", @@ -74552,7 +72859,6 @@ characters.data={ unicodeslot=0x2567, }, [0x2568]={ - adobename="SF460000", category="so", cjkwd="a", description="BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE", @@ -74561,7 +72867,6 @@ characters.data={ unicodeslot=0x2568, }, [0x2569]={ - adobename="SF400000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE UP AND HORIZONTAL", @@ -74570,7 +72875,6 @@ characters.data={ unicodeslot=0x2569, }, [0x256A]={ - adobename="SF540000", category="so", cjkwd="a", description="BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE", @@ -74579,7 +72883,6 @@ characters.data={ unicodeslot=0x256A, }, [0x256B]={ - adobename="SF530000", category="so", cjkwd="a", description="BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE", @@ -74588,7 +72891,6 @@ characters.data={ unicodeslot=0x256B, }, [0x256C]={ - adobename="SF440000", category="so", cjkwd="a", description="BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL", @@ -74737,7 +73039,6 @@ characters.data={ unicodeslot=0x257F, }, [0x2580]={ - adobename="upblock", category="so", cjkwd="a", description="UPPER HALF BLOCK", @@ -74770,7 +73071,6 @@ characters.data={ unicodeslot=0x2583, }, [0x2584]={ - adobename="dnblock", category="so", cjkwd="a", description="LOWER HALF BLOCK", @@ -74803,7 +73103,6 @@ characters.data={ unicodeslot=0x2587, }, [0x2588]={ - adobename="block", category="so", cjkwd="a", description="FULL BLOCK", @@ -74837,7 +73136,6 @@ characters.data={ unicodeslot=0x258B, }, [0x258C]={ - adobename="lfblock", category="so", cjkwd="a", description="LEFT HALF BLOCK", @@ -74870,7 +73168,6 @@ characters.data={ unicodeslot=0x258F, }, [0x2590]={ - adobename="rtblock", category="so", description="RIGHT HALF BLOCK", direction="on", @@ -74878,7 +73175,6 @@ characters.data={ unicodeslot=0x2590, }, [0x2591]={ - adobename="shadelight", category="so", description="LIGHT SHADE", direction="on", @@ -74886,7 +73182,6 @@ characters.data={ unicodeslot=0x2591, }, [0x2592]={ - adobename="shademedium", category="so", cjkwd="a", description="MEDIUM SHADE", @@ -74895,7 +73190,6 @@ characters.data={ unicodeslot=0x2592, }, [0x2593]={ - adobename="shadedark", category="so", cjkwd="a", description="DARK SHADE", @@ -74990,23 +73284,25 @@ characters.data={ unicodeslot=0x259F, }, [0x25A0]={ - adobename="filledbox", category="so", cjkwd="a", description="BLACK SQUARE", direction="on", linebreak="ai", mathclass="ordinary", + mathgroup="whatever", + mathmeaning="Q.E.D.", mathname="blacksquare", unicodeslot=0x25A0, }, [0x25A1]={ - adobename="whitesquare", category="so", cjkwd="a", description="WHITE SQUARE", direction="on", linebreak="ai", + mathgroup="whatever", + mathmeaning="Q.E.D.", mathspec={ { class="ordinary", @@ -75029,7 +73325,6 @@ characters.data={ unicodeslot=0x25A2, }, [0x25A3]={ - adobename="squarewhitewithsmallblack", category="so", cjkwd="a", description="WHITE SQUARE CONTAINING BLACK SMALL SQUARE", @@ -75038,7 +73333,6 @@ characters.data={ unicodeslot=0x25A3, }, [0x25A4]={ - adobename="squarehorizontalfill", category="so", cjkwd="a", description="SQUARE WITH HORIZONTAL FILL", @@ -75047,7 +73341,6 @@ characters.data={ unicodeslot=0x25A4, }, [0x25A5]={ - adobename="squareverticalfill", category="so", cjkwd="a", description="SQUARE WITH VERTICAL FILL", @@ -75056,7 +73349,6 @@ characters.data={ unicodeslot=0x25A5, }, [0x25A6]={ - adobename="squareorthogonalcrosshatchfill", category="so", cjkwd="a", description="SQUARE WITH ORTHOGONAL CROSSHATCH FILL", @@ -75065,7 +73357,6 @@ characters.data={ unicodeslot=0x25A6, }, [0x25A7]={ - adobename="squareupperlefttolowerrightfill", category="so", cjkwd="a", description="SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL", @@ -75074,7 +73365,6 @@ characters.data={ unicodeslot=0x25A7, }, [0x25A8]={ - adobename="squareupperrighttolowerleftfill", category="so", cjkwd="a", description="SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL", @@ -75083,7 +73373,6 @@ characters.data={ unicodeslot=0x25A8, }, [0x25A9]={ - adobename="squarediagonalcrosshatchfill", category="so", cjkwd="a", description="SQUARE WITH DIAGONAL CROSSHATCH FILL", @@ -75092,7 +73381,6 @@ characters.data={ unicodeslot=0x25A9, }, [0x25AA]={ - adobename="blacksmallsquare", category="so", description="BLACK SMALL SQUARE", direction="on", @@ -75101,7 +73389,6 @@ characters.data={ variants=variants_emoji, }, [0x25AB]={ - adobename="whitesmallsquare", category="so", description="WHITE SMALL SQUARE", direction="on", @@ -75110,7 +73397,6 @@ characters.data={ variants=variants_emoji, }, [0x25AC]={ - adobename="filledrect", category="so", description="BLACK RECTANGLE", direction="on", @@ -75154,7 +73440,6 @@ characters.data={ unicodeslot=0x25B1, }, [0x25B2]={ - adobename="triagup", category="so", cjkwd="a", description="BLACK UP-POINTING TRIANGLE", @@ -75165,7 +73450,6 @@ characters.data={ unicodeslot=0x25B2, }, [0x25B3]={ - adobename="whiteuppointingtriangle", category="so", cjkwd="a", description="WHITE UP-POINTING TRIANGLE", @@ -75185,7 +73469,6 @@ characters.data={ unicodeslot=0x25B3, }, [0x25B4]={ - adobename="blackuppointingsmalltriangle", category="so", description="BLACK UP-POINTING SMALL TRIANGLE", direction="on", @@ -75193,7 +73476,6 @@ characters.data={ unicodeslot=0x25B4, }, [0x25B5]={ - adobename="whiteuppointingsmalltriangle", category="so", description="WHITE UP-POINTING SMALL TRIANGLE", direction="on", @@ -75201,7 +73483,6 @@ characters.data={ unicodeslot=0x25B5, }, [0x25B6]={ - adobename="blackrightpointingtriangle", category="so", cjkwd="a", description="BLACK RIGHT-POINTING TRIANGLE", @@ -75213,7 +73494,6 @@ characters.data={ variants=variants_emoji, }, [0x25B7]={ - adobename="whiterightpointingtriangle", category="sm", cjkwd="a", description="WHITE RIGHT-POINTING TRIANGLE", @@ -75232,7 +73512,6 @@ characters.data={ unicodeslot=0x25B8, }, [0x25B9]={ - adobename="whiterightpointingsmalltriangle", category="so", description="WHITE RIGHT-POINTING SMALL TRIANGLE", direction="on", @@ -75240,7 +73519,6 @@ characters.data={ unicodeslot=0x25B9, }, [0x25BA]={ - adobename="triagrt", category="so", description="BLACK RIGHT-POINTING POINTER", direction="on", @@ -75256,7 +73534,6 @@ characters.data={ unicodeslot=0x25BB, }, [0x25BC]={ - adobename="triagdn", category="so", cjkwd="a", description="BLACK DOWN-POINTING TRIANGLE", @@ -75267,7 +73544,6 @@ characters.data={ unicodeslot=0x25BC, }, [0x25BD]={ - adobename="whitedownpointingtriangle", category="so", cjkwd="a", description="WHITE DOWN-POINTING TRIANGLE", @@ -75294,7 +73570,6 @@ characters.data={ unicodeslot=0x25BE, }, [0x25BF]={ - adobename="whitedownpointingsmalltriangle", category="so", description="WHITE DOWN-POINTING SMALL TRIANGLE", direction="on", @@ -75302,7 +73577,6 @@ characters.data={ unicodeslot=0x25BF, }, [0x25C0]={ - adobename="blackleftpointingtriangle", category="so", cjkwd="a", description="BLACK LEFT-POINTING TRIANGLE", @@ -75314,7 +73588,6 @@ characters.data={ variants=variants_emoji, }, [0x25C1]={ - adobename="whiteleftpointingtriangle", category="sm", cjkwd="a", description="WHITE LEFT-POINTING TRIANGLE", @@ -75333,7 +73606,6 @@ characters.data={ unicodeslot=0x25C2, }, [0x25C3]={ - adobename="whiteleftpointingsmalltriangle", category="so", description="WHITE LEFT-POINTING SMALL TRIANGLE", direction="on", @@ -75341,7 +73613,6 @@ characters.data={ unicodeslot=0x25C3, }, [0x25C4]={ - adobename="triaglf", category="so", description="BLACK LEFT-POINTING POINTER", direction="on", @@ -75357,7 +73628,6 @@ characters.data={ unicodeslot=0x25C5, }, [0x25C6]={ - adobename="blackdiamond", category="so", cjkwd="a", description="BLACK DIAMOND", @@ -75366,7 +73636,6 @@ characters.data={ unicodeslot=0x25C6, }, [0x25C7]={ - adobename="whitediamond", category="so", cjkwd="a", description="WHITE DIAMOND", @@ -75375,7 +73644,6 @@ characters.data={ unicodeslot=0x25C7, }, [0x25C8]={ - adobename="whitediamondcontainingblacksmalldiamond", category="so", cjkwd="a", description="WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND", @@ -75384,7 +73652,6 @@ characters.data={ unicodeslot=0x25C8, }, [0x25C9]={ - adobename="fisheye", category="so", description="FISHEYE", direction="on", @@ -75393,7 +73660,6 @@ characters.data={ unicodeslot=0x25C9, }, [0x25CA]={ - adobename="lozenge", category="so", description="LOZENGE", direction="on", @@ -75403,7 +73669,6 @@ characters.data={ unicodeslot=0x25CA, }, [0x25CB]={ - adobename="whitecircle", category="so", cjkwd="a", description="WHITE CIRCLE", @@ -75412,7 +73677,6 @@ characters.data={ unicodeslot=0x25CB, }, [0x25CC]={ - adobename="dottedcircle", category="so", contextname="dottedcircle", description="DOTTED CIRCLE", @@ -75429,7 +73693,6 @@ characters.data={ unicodeslot=0x25CD, }, [0x25CE]={ - adobename="bullseye", category="so", cjkwd="a", description="BULLSEYE", @@ -75438,7 +73701,6 @@ characters.data={ unicodeslot=0x25CE, }, [0x25CF]={ - adobename="blackcircle", category="so", cjkwd="a", description="BLACK CIRCLE", @@ -75447,7 +73709,6 @@ characters.data={ unicodeslot=0x25CF, }, [0x25D0]={ - adobename="circlewithlefthalfblack", category="so", cjkwd="a", description="CIRCLE WITH LEFT HALF BLACK", @@ -75456,7 +73717,6 @@ characters.data={ unicodeslot=0x25D0, }, [0x25D1]={ - adobename="circlewithrighthalfblack", category="so", cjkwd="a", description="CIRCLE WITH RIGHT HALF BLACK", @@ -75507,7 +73767,6 @@ characters.data={ unicodeslot=0x25D7, }, [0x25D8]={ - adobename="invbullet", category="so", description="INVERSE BULLET", direction="on", @@ -75515,7 +73774,6 @@ characters.data={ unicodeslot=0x25D8, }, [0x25D9]={ - adobename="whitecircleinverse", category="so", description="INVERSE WHITE CIRCLE", direction="on", @@ -75579,7 +73837,6 @@ characters.data={ unicodeslot=0x25E1, }, [0x25E2]={ - adobename="blacklowerrighttriangle", category="so", cjkwd="a", description="BLACK LOWER RIGHT TRIANGLE", @@ -75588,7 +73845,6 @@ characters.data={ unicodeslot=0x25E2, }, [0x25E3]={ - adobename="blacklowerlefttriangle", category="so", cjkwd="a", description="BLACK LOWER LEFT TRIANGLE", @@ -75597,7 +73853,6 @@ characters.data={ unicodeslot=0x25E3, }, [0x25E4]={ - adobename="blackupperlefttriangle", category="so", cjkwd="a", description="BLACK UPPER LEFT TRIANGLE", @@ -75606,7 +73861,6 @@ characters.data={ unicodeslot=0x25E4, }, [0x25E5]={ - adobename="blackupperrighttriangle", category="so", cjkwd="a", description="BLACK UPPER RIGHT TRIANGLE", @@ -75615,7 +73869,6 @@ characters.data={ unicodeslot=0x25E5, }, [0x25E6]={ - adobename="whitebullet", category="so", description="WHITE BULLET", direction="on", @@ -75679,7 +73932,6 @@ characters.data={ unicodeslot=0x25EE, }, [0x25EF]={ - adobename="largecircle", category="so", cjkwd="a", description="LARGE CIRCLE", @@ -75853,7 +74105,6 @@ characters.data={ variants=variants_emoji, }, [0x2605]={ - adobename="blackstar", category="so", cjkwd="a", description="BLACK STAR", @@ -75864,7 +74115,6 @@ characters.data={ unicodeslot=0x2605, }, [0x2606]={ - adobename="whitestar", category="so", cjkwd="a", description="WHITE STAR", @@ -75923,7 +74173,6 @@ characters.data={ unicodeslot=0x260D, }, [0x260E]={ - adobename="telephoneblack", category="so", cjkwd="a", description="BLACK TELEPHONE", @@ -75933,7 +74182,6 @@ characters.data={ variants=variants_emoji, }, [0x260F]={ - adobename="whitetelephone", category="so", cjkwd="a", description="WHITE TELEPHONE", @@ -76035,7 +74283,6 @@ characters.data={ unicodeslot=0x261B, }, [0x261C]={ - adobename="pointingindexleftwhite", category="so", cjkwd="a", description="WHITE LEFT POINTING INDEX", @@ -76044,7 +74291,6 @@ characters.data={ unicodeslot=0x261C, }, [0x261D]={ - adobename="pointingindexupwhite", category="so", description="WHITE UP POINTING INDEX", direction="on", @@ -76053,7 +74299,6 @@ characters.data={ variants=variants_emoji, }, [0x261E]={ - adobename="pointingindexrightwhite", category="so", cjkwd="a", description="WHITE RIGHT POINTING INDEX", @@ -76063,7 +74308,6 @@ characters.data={ unicodeslot=0x261E, }, [0x261F]={ - adobename="pointingindexdownwhite", category="so", description="WHITE DOWN POINTING INDEX", direction="on", @@ -76185,7 +74429,6 @@ characters.data={ variants=variants_emoji, }, [0x262F]={ - adobename="yinyang", category="so", description="YIN YANG", direction="on", @@ -76266,7 +74509,6 @@ characters.data={ variants=variants_emoji, }, [0x263A]={ - adobename="whitesmilingface", category="so", description="WHITE SMILING FACE", direction="on", @@ -76276,7 +74518,6 @@ characters.data={ variants=variants_emoji, }, [0x263B]={ - adobename="invsmileface", category="so", description="BLACK SMILING FACE", direction="on", @@ -76284,7 +74525,6 @@ characters.data={ unicodeslot=0x263B, }, [0x263C]={ - adobename="sun", category="so", description="WHITE SUN WITH RAYS", direction="on", @@ -76314,7 +74554,6 @@ characters.data={ unicodeslot=0x263F, }, [0x2640]={ - adobename="venus", category="so", cjkwd="a", description="FEMALE SIGN", @@ -76324,7 +74563,6 @@ characters.data={ unicodeslot=0x2640, }, [0x2641]={ - adobename="earth", category="so", description="EARTH", direction="on", @@ -76332,7 +74570,6 @@ characters.data={ unicodeslot=0x2641, }, [0x2642]={ - adobename="mars", category="so", cjkwd="a", description="MALE SIGN", @@ -76571,7 +74808,6 @@ characters.data={ unicodeslot=0x265F, }, [0x2660]={ - adobename="spadesuitblack", category="so", cjkwd="a", description="BLACK SPADE SUIT", @@ -76583,7 +74819,6 @@ characters.data={ variants=variants_emoji, }, [0x2661]={ - adobename="heartsuitwhite", category="so", cjkwd="a", description="WHITE HEART SUIT", @@ -76594,7 +74829,6 @@ characters.data={ unicodeslot=0x2661, }, [0x2662]={ - adobename="diamondsuitwhite", category="so", description="WHITE DIAMOND SUIT", direction="on", @@ -76604,7 +74838,6 @@ characters.data={ unicodeslot=0x2662, }, [0x2663]={ - adobename="clubsuitblack", category="so", cjkwd="a", description="BLACK CLUB SUIT", @@ -76617,7 +74850,6 @@ characters.data={ variants=variants_emoji, }, [0x2664]={ - adobename="spadesuitwhite", category="so", cjkwd="a", description="WHITE SPADE SUIT", @@ -76626,7 +74858,6 @@ characters.data={ unicodeslot=0x2664, }, [0x2665]={ - adobename="heartsuitblack", category="so", cjkwd="a", description="BLACK HEART SUIT", @@ -76637,7 +74868,6 @@ characters.data={ variants=variants_emoji, }, [0x2666]={ - adobename="diamond", category="so", description="BLACK DIAMOND SUIT", direction="on", @@ -76648,7 +74878,6 @@ characters.data={ variants=variants_emoji, }, [0x2667]={ - adobename="clubsuitwhite", category="so", cjkwd="a", description="WHITE CLUB SUIT", @@ -76657,7 +74886,6 @@ characters.data={ unicodeslot=0x2667, }, [0x2668]={ - adobename="hotsprings", category="so", cjkwd="a", description="HOT SPRINGS", @@ -76667,7 +74895,6 @@ characters.data={ variants=variants_emoji, }, [0x2669]={ - adobename="quarternote", category="so", cjkwd="a", description="QUARTER NOTE", @@ -76677,7 +74904,6 @@ characters.data={ unicodeslot=0x2669, }, [0x266A]={ - adobename="musicalnote", category="so", cjkwd="a", description="EIGHTH NOTE", @@ -76687,7 +74913,6 @@ characters.data={ unicodeslot=0x266A, }, [0x266B]={ - adobename="musicalnotedbl", category="so", description="BEAMED EIGHTH NOTES", direction="on", @@ -76696,7 +74921,6 @@ characters.data={ unicodeslot=0x266B, }, [0x266C]={ - adobename="beamedsixteenthnotes", category="so", cjkwd="a", description="BEAMED SIXTEENTH NOTES", @@ -76706,7 +74930,6 @@ characters.data={ unicodeslot=0x266C, }, [0x266D]={ - adobename="musicflatsign", category="so", cjkwd="a", description="MUSIC FLAT SIGN", @@ -76726,7 +74949,6 @@ characters.data={ unicodeslot=0x266E, }, [0x266F]={ - adobename="musicsharpsign", category="sm", cjkwd="a", description="MUSIC SHARP SIGN", @@ -78028,7 +76250,6 @@ characters.data={ variants=variants_emoji, }, [0x2713]={ - adobename="checkmark", category="so", description="CHECK MARK", direction="on", @@ -78915,7 +77136,6 @@ characters.data={ unicodeslot=0x2789, }, [0x278A]={ - adobename="onecircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE", direction="on", @@ -78923,7 +77143,6 @@ characters.data={ unicodeslot=0x278A, }, [0x278B]={ - adobename="twocircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT TWO", direction="on", @@ -78931,7 +77150,6 @@ characters.data={ unicodeslot=0x278B, }, [0x278C]={ - adobename="threecircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE", direction="on", @@ -78939,7 +77157,6 @@ characters.data={ unicodeslot=0x278C, }, [0x278D]={ - adobename="fourcircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FOUR", direction="on", @@ -78947,7 +77164,6 @@ characters.data={ unicodeslot=0x278D, }, [0x278E]={ - adobename="fivecircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FIVE", direction="on", @@ -78955,7 +77171,6 @@ characters.data={ unicodeslot=0x278E, }, [0x278F]={ - adobename="sixcircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SIX", direction="on", @@ -78963,7 +77178,6 @@ characters.data={ unicodeslot=0x278F, }, [0x2790]={ - adobename="sevencircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SEVEN", direction="on", @@ -78971,7 +77185,6 @@ characters.data={ unicodeslot=0x2790, }, [0x2791]={ - adobename="eightcircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT", direction="on", @@ -78979,7 +77192,6 @@ characters.data={ unicodeslot=0x2791, }, [0x2792]={ - adobename="ninecircleinversesansserif", category="no", description="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT NINE", direction="on", @@ -79067,7 +77279,6 @@ characters.data={ unicodeslot=0x279D, }, [0x279E]={ - adobename="arrowrightheavy", category="so", description="HEAVY TRIANGLE-HEADED RIGHTWARDS ARROW", direction="on", @@ -79766,7 +77977,9 @@ characters.data={ mathclass="relation", mathextensible="r", mathfiller="rightarrowfill", + mathgroup="binary relation", mathlist={ 0x2212, 0x2212, 0x3E }, + mathmeaning="to", mathname="longrightarrow", mathparent=0x2192, unicodeslot=0x27F6, @@ -79793,7 +78006,9 @@ characters.data={ mathclass="relation", mathextensible="l", mathfiller="Leftarrowfill", + mathgroup="binary relation", mathlist={ 0x3C, 0x3D, 0x3D, 0x3D }, + mathmeaning="is implied by", mathname="Longleftarrow", unicodeslot=0x27F8, }, @@ -79806,7 +78021,9 @@ characters.data={ mathclass="relation", mathextensible="r", mathfiller="Rightarrowfill", + mathgroup="binary relation", mathlist={ 0x3D, 0x3D, 0x3D, 0x3E }, + mathmeaning="implies", mathname="Longrightarrow", unicodeslot=0x27F9, }, @@ -79818,7 +78035,9 @@ characters.data={ mathclass="relation", mathextensible="h", mathfiller="Leftrightarrowfill", + mathgroup="binary relation", mathlist={ 0x3C, 0x3D, 0x3D, 0x3D, 0x3E }, + mathmeaning="if, and only if", mathname="Longleftrightarrow", unicodeslot=0x27FA, }, @@ -79829,6 +78048,8 @@ characters.data={ linebreak="al", mathclass="relation", mathextensible="l", + mathgroup="binary relation", + mathmeaning="maps from", mathname="longmapsfrom", unicodeslot=0x27FB, }, @@ -79839,6 +78060,8 @@ characters.data={ linebreak="al", mathclass="relation", mathextensible="r", + mathgroup="binary relation", + mathmeaning="maps to", mathname="longmapsto", unicodeslot=0x27FC, }, @@ -83660,7 +81883,7 @@ characters.data={ description="N-ARY CIRCLED DOT OPERATOR", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", mathname="bigodot", unicodeslot=0x2A00, }, @@ -83669,7 +81892,9 @@ characters.data={ description="N-ARY CIRCLED PLUS OPERATOR", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="direct sum", mathname="bigoplus", unicodeslot=0x2A01, }, @@ -83678,7 +81903,9 @@ characters.data={ description="N-ARY CIRCLED TIMES OPERATOR", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="tensor product", mathname="bigotimes", unicodeslot=0x2A02, }, @@ -83687,7 +81914,7 @@ characters.data={ description="N-ARY UNION OPERATOR WITH DOT", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", mathname="bigudot", unicodeslot=0x2A03, }, @@ -83696,7 +81923,7 @@ characters.data={ description="N-ARY UNION OPERATOR WITH PLUS", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", mathname="biguplus", unicodeslot=0x2A04, }, @@ -83705,7 +81932,7 @@ characters.data={ description="N-ARY SQUARE INTERSECTION OPERATOR", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", mathname="bigsqcap", unicodeslot=0x2A05, }, @@ -83714,7 +81941,7 @@ characters.data={ description="N-ARY SQUARE UNION OPERATOR", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", mathname="bigsqcup", unicodeslot=0x2A06, }, @@ -83738,7 +81965,9 @@ characters.data={ description="N-ARY TIMES OPERATOR", direction="on", linebreak="al", - mathclass="limop", + mathclass="operator", + mathgroup="nary operator", + mathmeaning="times", mathname="bigtimes", unicodeslot=0x2A09, }, @@ -83761,10 +81990,12 @@ characters.data={ description="QUADRUPLE INTEGRAL OPERATOR", direction="on", linebreak="al", - mathclass="limop", + mathclass="integral", + mathgroup="integral", + mathmeaning="quadruple integral of", mathspec={ { - class="limop", + class="integral", name="iiiint", }, { @@ -84539,6 +82770,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="much more equal to", mathname="eqeq", specials={ "compat", 0x3D, 0x3D }, unicodeslot=0x2A75, @@ -84549,6 +82782,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="way equal to", mathname="eqeqeq", specials={ "compat", 0x3D, 0x3D, 0x3D }, unicodeslot=0x2A76, @@ -84605,6 +82840,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="less or equal to", mathname="leqslant", mirror=0x2A7E, unicodeslot=0x2A7D, @@ -84615,6 +82852,8 @@ characters.data={ direction="on", linebreak="al", mathclass="relation", + mathgroup="binary relation", + mathmeaning="more or equal to", mathname="geqslant", mirror=0x2A7D, unicodeslot=0x2A7E, @@ -94682,8 +92921,39 @@ characters.data={ linebreak="id", unicodeslot=0x2FFB, }, + [0x2FFC]={ + category="so", + cjkwd="w", + description="IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM RIGHT", + direction="on", + linebreak="id", + unicodeslot=0x2FFC, + }, + [0x2FFD]={ + category="so", + cjkwd="w", + description="IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER RIGHT", + direction="on", + linebreak="id", + unicodeslot=0x2FFD, + }, + [0x2FFE]={ + category="so", + cjkwd="w", + description="IDEOGRAPHIC DESCRIPTION CHARACTER HORIZONTAL REFLECTION", + direction="on", + linebreak="id", + unicodeslot=0x2FFE, + }, + [0x2FFF]={ + category="so", + cjkwd="w", + description="IDEOGRAPHIC DESCRIPTION CHARACTER ROTATION", + direction="on", + linebreak="id", + unicodeslot=0x2FFF, + }, [0x3000]={ - adobename="ideographicspace", category="zs", cjkwd="f", contextname="ideographicspace", @@ -94694,7 +92964,6 @@ characters.data={ unicodeslot=0x3000, }, [0x3001]={ - adobename="ideographiccomma", category="po", cjkwd="w", description="IDEOGRAPHIC COMMA", @@ -94704,7 +92973,6 @@ characters.data={ variants=variants_forms, }, [0x3002]={ - adobename="ideographicperiod", category="po", cjkwd="w", description="IDEOGRAPHIC FULL STOP", @@ -94714,7 +92982,6 @@ characters.data={ variants=variants_forms, }, [0x3003]={ - adobename="dittomark", category="po", cjkwd="w", description="DITTO MARK", @@ -94723,7 +92990,6 @@ characters.data={ unicodeslot=0x3003, }, [0x3004]={ - adobename="jis", category="so", cjkwd="w", description="JAPANESE INDUSTRIAL STANDARD SYMBOL", @@ -94732,7 +92998,6 @@ characters.data={ unicodeslot=0x3004, }, [0x3005]={ - adobename="ideographiciterationmark", category="lm", cjkwd="w", description="IDEOGRAPHIC ITERATION MARK", @@ -94741,7 +93006,6 @@ characters.data={ unicodeslot=0x3005, }, [0x3006]={ - adobename="ideographicclose", category="lo", cjkwd="w", description="IDEOGRAPHIC CLOSING MARK", @@ -94750,7 +93014,6 @@ characters.data={ unicodeslot=0x3006, }, [0x3007]={ - adobename="ideographiczero", category="nl", cjkwd="w", description="IDEOGRAPHIC NUMBER ZERO", @@ -94759,7 +93022,6 @@ characters.data={ unicodeslot=0x3007, }, [0x3008]={ - adobename="anglebracketleft", category="ps", cjkwd="w", description="LEFT ANGLE BRACKET", @@ -94769,7 +93031,6 @@ characters.data={ unicodeslot=0x3008, }, [0x3009]={ - adobename="anglebracketright", category="pe", cjkwd="w", description="RIGHT ANGLE BRACKET", @@ -94779,7 +93040,6 @@ characters.data={ unicodeslot=0x3009, }, [0x300A]={ - adobename="dblanglebracketleft", category="ps", cjkwd="w", description="LEFT DOUBLE ANGLE BRACKET", @@ -94789,7 +93049,6 @@ characters.data={ unicodeslot=0x300A, }, [0x300B]={ - adobename="dblanglebracketright", category="pe", cjkwd="w", description="RIGHT DOUBLE ANGLE BRACKET", @@ -94799,7 +93058,6 @@ characters.data={ unicodeslot=0x300B, }, [0x300C]={ - adobename="cornerbracketleft", category="ps", cjkwd="w", description="LEFT CORNER BRACKET", @@ -94809,7 +93067,6 @@ characters.data={ unicodeslot=0x300C, }, [0x300D]={ - adobename="cornerbracketright", category="pe", cjkwd="w", description="RIGHT CORNER BRACKET", @@ -94819,7 +93076,6 @@ characters.data={ unicodeslot=0x300D, }, [0x300E]={ - adobename="whitecornerbracketleft", category="ps", cjkwd="w", description="LEFT WHITE CORNER BRACKET", @@ -94829,7 +93085,6 @@ characters.data={ unicodeslot=0x300E, }, [0x300F]={ - adobename="whitecornerbracketright", category="pe", cjkwd="w", description="RIGHT WHITE CORNER BRACKET", @@ -94839,7 +93094,6 @@ characters.data={ unicodeslot=0x300F, }, [0x3010]={ - adobename="blacklenticularbracketleft", category="ps", cjkwd="w", description="LEFT BLACK LENTICULAR BRACKET", @@ -94849,7 +93103,6 @@ characters.data={ unicodeslot=0x3010, }, [0x3011]={ - adobename="blacklenticularbracketright", category="pe", cjkwd="w", description="RIGHT BLACK LENTICULAR BRACKET", @@ -94859,7 +93112,6 @@ characters.data={ unicodeslot=0x3011, }, [0x3012]={ - adobename="postalmark", category="so", cjkwd="w", description="POSTAL MARK", @@ -94868,7 +93120,6 @@ characters.data={ unicodeslot=0x3012, }, [0x3013]={ - adobename="getamark", category="so", cjkwd="w", description="GETA MARK", @@ -94877,7 +93128,6 @@ characters.data={ unicodeslot=0x3013, }, [0x3014]={ - adobename="tortoiseshellbracketleft", category="ps", cjkwd="w", description="LEFT TORTOISE SHELL BRACKET", @@ -94887,7 +93137,6 @@ characters.data={ unicodeslot=0x3014, }, [0x3015]={ - adobename="tortoiseshellbracketright", category="pe", cjkwd="w", description="RIGHT TORTOISE SHELL BRACKET", @@ -94897,7 +93146,6 @@ characters.data={ unicodeslot=0x3015, }, [0x3016]={ - adobename="whitelenticularbracketleft", category="ps", cjkwd="w", description="LEFT WHITE LENTICULAR BRACKET", @@ -94907,7 +93155,6 @@ characters.data={ unicodeslot=0x3016, }, [0x3017]={ - adobename="whitelenticularbracketright", category="pe", cjkwd="w", description="RIGHT WHITE LENTICULAR BRACKET", @@ -94917,7 +93164,6 @@ characters.data={ unicodeslot=0x3017, }, [0x3018]={ - adobename="whitetortoiseshellbracketleft", category="ps", cjkwd="w", description="LEFT WHITE TORTOISE SHELL BRACKET", @@ -94927,7 +93173,6 @@ characters.data={ unicodeslot=0x3018, }, [0x3019]={ - adobename="whitetortoiseshellbracketright", category="pe", cjkwd="w", description="RIGHT WHITE TORTOISE SHELL BRACKET", @@ -94957,7 +93202,6 @@ characters.data={ unicodeslot=0x301B, }, [0x301C]={ - adobename="wavedash", category="pd", cjkwd="w", description="WAVE DASH", @@ -94966,7 +93210,6 @@ characters.data={ unicodeslot=0x301C, }, [0x301D]={ - adobename="quotedblprimereversed", category="ps", cjkwd="w", description="REVERSED DOUBLE PRIME QUOTATION MARK", @@ -94975,7 +93218,6 @@ characters.data={ unicodeslot=0x301D, }, [0x301E]={ - adobename="quotedblprime", category="pe", cjkwd="w", description="DOUBLE PRIME QUOTATION MARK", @@ -94992,7 +93234,6 @@ characters.data={ unicodeslot=0x301F, }, [0x3020]={ - adobename="postalmarkface", category="so", cjkwd="w", description="POSTAL MARK FACE", @@ -95001,7 +93242,6 @@ characters.data={ unicodeslot=0x3020, }, [0x3021]={ - adobename="onehangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL ONE", @@ -95010,7 +93250,6 @@ characters.data={ unicodeslot=0x3021, }, [0x3022]={ - adobename="twohangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL TWO", @@ -95019,7 +93258,6 @@ characters.data={ unicodeslot=0x3022, }, [0x3023]={ - adobename="threehangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL THREE", @@ -95028,7 +93266,6 @@ characters.data={ unicodeslot=0x3023, }, [0x3024]={ - adobename="fourhangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL FOUR", @@ -95037,7 +93274,6 @@ characters.data={ unicodeslot=0x3024, }, [0x3025]={ - adobename="fivehangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL FIVE", @@ -95046,7 +93282,6 @@ characters.data={ unicodeslot=0x3025, }, [0x3026]={ - adobename="sixhangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL SIX", @@ -95055,7 +93290,6 @@ characters.data={ unicodeslot=0x3026, }, [0x3027]={ - adobename="sevenhangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL SEVEN", @@ -95064,7 +93298,6 @@ characters.data={ unicodeslot=0x3027, }, [0x3028]={ - adobename="eighthangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL EIGHT", @@ -95073,7 +93306,6 @@ characters.data={ unicodeslot=0x3028, }, [0x3029]={ - adobename="ninehangzhou", category="nl", cjkwd="w", description="HANGZHOU NUMERAL NINE", @@ -95185,7 +93417,6 @@ characters.data={ unicodeslot=0x3035, }, [0x3036]={ - adobename="circlepostalmark", category="so", cjkwd="w", description="CIRCLED POSTAL MARK", @@ -95271,7 +93502,6 @@ characters.data={ unicodeslot=0x303F, }, [0x3041]={ - adobename="asmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL A", @@ -95283,7 +93513,6 @@ characters.data={ unicodeslot=0x3041, }, [0x3042]={ - adobename="ahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER A", @@ -95295,7 +93524,6 @@ characters.data={ unicodeslot=0x3042, }, [0x3043]={ - adobename="ismallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL I", @@ -95307,7 +93535,6 @@ characters.data={ unicodeslot=0x3043, }, [0x3044]={ - adobename="ihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER I", @@ -95319,7 +93546,6 @@ characters.data={ unicodeslot=0x3044, }, [0x3045]={ - adobename="usmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL U", @@ -95331,7 +93557,6 @@ characters.data={ unicodeslot=0x3045, }, [0x3046]={ - adobename="uhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER U", @@ -95343,7 +93568,6 @@ characters.data={ unicodeslot=0x3046, }, [0x3047]={ - adobename="esmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL E", @@ -95355,7 +93579,6 @@ characters.data={ unicodeslot=0x3047, }, [0x3048]={ - adobename="ehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER E", @@ -95367,7 +93590,6 @@ characters.data={ unicodeslot=0x3048, }, [0x3049]={ - adobename="osmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL O", @@ -95379,7 +93601,6 @@ characters.data={ unicodeslot=0x3049, }, [0x304A]={ - adobename="ohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER O", @@ -95391,7 +93612,6 @@ characters.data={ unicodeslot=0x304A, }, [0x304B]={ - adobename="kahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER KA", @@ -95403,7 +93623,6 @@ characters.data={ unicodeslot=0x304B, }, [0x304C]={ - adobename="gahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER GA", @@ -95416,7 +93635,6 @@ characters.data={ unicodeslot=0x304C, }, [0x304D]={ - adobename="kihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER KI", @@ -95428,7 +93646,6 @@ characters.data={ unicodeslot=0x304D, }, [0x304E]={ - adobename="gihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER GI", @@ -95441,7 +93658,6 @@ characters.data={ unicodeslot=0x304E, }, [0x304F]={ - adobename="kuhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER KU", @@ -95453,7 +93669,6 @@ characters.data={ unicodeslot=0x304F, }, [0x3050]={ - adobename="guhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER GU", @@ -95466,7 +93681,6 @@ characters.data={ unicodeslot=0x3050, }, [0x3051]={ - adobename="kehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER KE", @@ -95478,7 +93692,6 @@ characters.data={ unicodeslot=0x3051, }, [0x3052]={ - adobename="gehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER GE", @@ -95491,7 +93704,6 @@ characters.data={ unicodeslot=0x3052, }, [0x3053]={ - adobename="kohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER KO", @@ -95503,7 +93715,6 @@ characters.data={ unicodeslot=0x3053, }, [0x3054]={ - adobename="gohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER GO", @@ -95516,7 +93727,6 @@ characters.data={ unicodeslot=0x3054, }, [0x3055]={ - adobename="sahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SA", @@ -95528,7 +93738,6 @@ characters.data={ unicodeslot=0x3055, }, [0x3056]={ - adobename="zahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER ZA", @@ -95541,7 +93750,6 @@ characters.data={ unicodeslot=0x3056, }, [0x3057]={ - adobename="sihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SI", @@ -95553,7 +93761,6 @@ characters.data={ unicodeslot=0x3057, }, [0x3058]={ - adobename="zihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER ZI", @@ -95566,7 +93773,6 @@ characters.data={ unicodeslot=0x3058, }, [0x3059]={ - adobename="suhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SU", @@ -95578,7 +93784,6 @@ characters.data={ unicodeslot=0x3059, }, [0x305A]={ - adobename="zuhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER ZU", @@ -95591,7 +93796,6 @@ characters.data={ unicodeslot=0x305A, }, [0x305B]={ - adobename="sehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SE", @@ -95603,7 +93807,6 @@ characters.data={ unicodeslot=0x305B, }, [0x305C]={ - adobename="zehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER ZE", @@ -95616,7 +93819,6 @@ characters.data={ unicodeslot=0x305C, }, [0x305D]={ - adobename="sohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SO", @@ -95628,7 +93830,6 @@ characters.data={ unicodeslot=0x305D, }, [0x305E]={ - adobename="zohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER ZO", @@ -95641,7 +93842,6 @@ characters.data={ unicodeslot=0x305E, }, [0x305F]={ - adobename="tahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER TA", @@ -95653,7 +93853,6 @@ characters.data={ unicodeslot=0x305F, }, [0x3060]={ - adobename="dahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER DA", @@ -95666,7 +93865,6 @@ characters.data={ unicodeslot=0x3060, }, [0x3061]={ - adobename="tihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER TI", @@ -95678,7 +93876,6 @@ characters.data={ unicodeslot=0x3061, }, [0x3062]={ - adobename="dihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER DI", @@ -95691,7 +93888,6 @@ characters.data={ unicodeslot=0x3062, }, [0x3063]={ - adobename="tusmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL TU", @@ -95703,7 +93899,6 @@ characters.data={ unicodeslot=0x3063, }, [0x3064]={ - adobename="tuhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER TU", @@ -95715,7 +93910,6 @@ characters.data={ unicodeslot=0x3064, }, [0x3065]={ - adobename="duhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER DU", @@ -95728,7 +93922,6 @@ characters.data={ unicodeslot=0x3065, }, [0x3066]={ - adobename="tehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER TE", @@ -95740,7 +93933,6 @@ characters.data={ unicodeslot=0x3066, }, [0x3067]={ - adobename="dehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER DE", @@ -95753,7 +93945,6 @@ characters.data={ unicodeslot=0x3067, }, [0x3068]={ - adobename="tohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER TO", @@ -95765,7 +93956,6 @@ characters.data={ unicodeslot=0x3068, }, [0x3069]={ - adobename="dohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER DO", @@ -95778,7 +93968,6 @@ characters.data={ unicodeslot=0x3069, }, [0x306A]={ - adobename="nahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER NA", @@ -95790,7 +93979,6 @@ characters.data={ unicodeslot=0x306A, }, [0x306B]={ - adobename="nihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER NI", @@ -95802,7 +93990,6 @@ characters.data={ unicodeslot=0x306B, }, [0x306C]={ - adobename="nuhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER NU", @@ -95814,7 +94001,6 @@ characters.data={ unicodeslot=0x306C, }, [0x306D]={ - adobename="nehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER NE", @@ -95826,7 +94012,6 @@ characters.data={ unicodeslot=0x306D, }, [0x306E]={ - adobename="nohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER NO", @@ -95838,7 +94023,6 @@ characters.data={ unicodeslot=0x306E, }, [0x306F]={ - adobename="hahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER HA", @@ -95850,7 +94034,6 @@ characters.data={ unicodeslot=0x306F, }, [0x3070]={ - adobename="bahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER BA", @@ -95863,7 +94046,6 @@ characters.data={ unicodeslot=0x3070, }, [0x3071]={ - adobename="pahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER PA", @@ -95876,7 +94058,6 @@ characters.data={ unicodeslot=0x3071, }, [0x3072]={ - adobename="hihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER HI", @@ -95888,7 +94069,6 @@ characters.data={ unicodeslot=0x3072, }, [0x3073]={ - adobename="bihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER BI", @@ -95901,7 +94081,6 @@ characters.data={ unicodeslot=0x3073, }, [0x3074]={ - adobename="pihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER PI", @@ -95914,7 +94093,6 @@ characters.data={ unicodeslot=0x3074, }, [0x3075]={ - adobename="huhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER HU", @@ -95926,7 +94104,6 @@ characters.data={ unicodeslot=0x3075, }, [0x3076]={ - adobename="buhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER BU", @@ -95939,7 +94116,6 @@ characters.data={ unicodeslot=0x3076, }, [0x3077]={ - adobename="puhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER PU", @@ -95952,7 +94128,6 @@ characters.data={ unicodeslot=0x3077, }, [0x3078]={ - adobename="hehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER HE", @@ -95964,7 +94139,6 @@ characters.data={ unicodeslot=0x3078, }, [0x3079]={ - adobename="behiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER BE", @@ -95977,7 +94151,6 @@ characters.data={ unicodeslot=0x3079, }, [0x307A]={ - adobename="pehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER PE", @@ -95990,7 +94163,6 @@ characters.data={ unicodeslot=0x307A, }, [0x307B]={ - adobename="hohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER HO", @@ -96002,7 +94174,6 @@ characters.data={ unicodeslot=0x307B, }, [0x307C]={ - adobename="bohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER BO", @@ -96015,7 +94186,6 @@ characters.data={ unicodeslot=0x307C, }, [0x307D]={ - adobename="pohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER PO", @@ -96028,7 +94198,6 @@ characters.data={ unicodeslot=0x307D, }, [0x307E]={ - adobename="mahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER MA", @@ -96040,7 +94209,6 @@ characters.data={ unicodeslot=0x307E, }, [0x307F]={ - adobename="mihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER MI", @@ -96052,7 +94220,6 @@ characters.data={ unicodeslot=0x307F, }, [0x3080]={ - adobename="muhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER MU", @@ -96064,7 +94231,6 @@ characters.data={ unicodeslot=0x3080, }, [0x3081]={ - adobename="mehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER ME", @@ -96076,7 +94242,6 @@ characters.data={ unicodeslot=0x3081, }, [0x3082]={ - adobename="mohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER MO", @@ -96088,7 +94253,6 @@ characters.data={ unicodeslot=0x3082, }, [0x3083]={ - adobename="yasmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL YA", @@ -96100,7 +94264,6 @@ characters.data={ unicodeslot=0x3083, }, [0x3084]={ - adobename="yahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER YA", @@ -96112,7 +94275,6 @@ characters.data={ unicodeslot=0x3084, }, [0x3085]={ - adobename="yusmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL YU", @@ -96124,7 +94286,6 @@ characters.data={ unicodeslot=0x3085, }, [0x3086]={ - adobename="yuhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER YU", @@ -96136,7 +94297,6 @@ characters.data={ unicodeslot=0x3086, }, [0x3087]={ - adobename="yosmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL YO", @@ -96148,7 +94308,6 @@ characters.data={ unicodeslot=0x3087, }, [0x3088]={ - adobename="yohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER YO", @@ -96160,7 +94319,6 @@ characters.data={ unicodeslot=0x3088, }, [0x3089]={ - adobename="rahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER RA", @@ -96172,7 +94330,6 @@ characters.data={ unicodeslot=0x3089, }, [0x308A]={ - adobename="rihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER RI", @@ -96184,7 +94341,6 @@ characters.data={ unicodeslot=0x308A, }, [0x308B]={ - adobename="ruhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER RU", @@ -96196,7 +94352,6 @@ characters.data={ unicodeslot=0x308B, }, [0x308C]={ - adobename="rehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER RE", @@ -96208,7 +94363,6 @@ characters.data={ unicodeslot=0x308C, }, [0x308D]={ - adobename="rohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER RO", @@ -96220,7 +94374,6 @@ characters.data={ unicodeslot=0x308D, }, [0x308E]={ - adobename="wasmallhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL WA", @@ -96232,7 +94385,6 @@ characters.data={ unicodeslot=0x308E, }, [0x308F]={ - adobename="wahiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER WA", @@ -96244,7 +94396,6 @@ characters.data={ unicodeslot=0x308F, }, [0x3090]={ - adobename="wihiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER WI", @@ -96256,7 +94407,6 @@ characters.data={ unicodeslot=0x3090, }, [0x3091]={ - adobename="wehiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER WE", @@ -96268,7 +94418,6 @@ characters.data={ unicodeslot=0x3091, }, [0x3092]={ - adobename="wohiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER WO", @@ -96280,7 +94429,6 @@ characters.data={ unicodeslot=0x3092, }, [0x3093]={ - adobename="nhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER N", @@ -96292,7 +94440,6 @@ characters.data={ unicodeslot=0x3093, }, [0x3094]={ - adobename="vuhiragana", category="lo", cjkwd="w", description="HIRAGANA LETTER VU", @@ -96349,7 +94496,6 @@ characters.data={ unicodeslot=0x309A, }, [0x309B]={ - adobename="voicedmarkkana", category="sk", cjkwd="w", description="KATAKANA-HIRAGANA VOICED SOUND MARK", @@ -96361,7 +94507,6 @@ characters.data={ unicodeslot=0x309B, }, [0x309C]={ - adobename="semivoicedmarkkana", category="sk", cjkwd="w", description="KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK", @@ -96373,7 +94518,6 @@ characters.data={ unicodeslot=0x309C, }, [0x309D]={ - adobename="iterationhiragana", category="lm", cjkwd="w", description="HIRAGANA ITERATION MARK", @@ -96385,7 +94529,6 @@ characters.data={ unicodeslot=0x309D, }, [0x309E]={ - adobename="voicediterationhiragana", category="lm", cjkwd="w", description="HIRAGANA VOICED ITERATION MARK", @@ -96415,7 +94558,6 @@ characters.data={ unicodeslot=0x30A0, }, [0x30A1]={ - adobename="asmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL A", @@ -96427,7 +94569,6 @@ characters.data={ unicodeslot=0x30A1, }, [0x30A2]={ - adobename="akatakana", category="lo", cjkwd="w", description="KATAKANA LETTER A", @@ -96439,7 +94580,6 @@ characters.data={ unicodeslot=0x30A2, }, [0x30A3]={ - adobename="ismallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL I", @@ -96451,7 +94591,6 @@ characters.data={ unicodeslot=0x30A3, }, [0x30A4]={ - adobename="ikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER I", @@ -96463,7 +94602,6 @@ characters.data={ unicodeslot=0x30A4, }, [0x30A5]={ - adobename="usmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL U", @@ -96475,7 +94613,6 @@ characters.data={ unicodeslot=0x30A5, }, [0x30A6]={ - adobename="ukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER U", @@ -96487,7 +94624,6 @@ characters.data={ unicodeslot=0x30A6, }, [0x30A7]={ - adobename="esmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL E", @@ -96499,7 +94635,6 @@ characters.data={ unicodeslot=0x30A7, }, [0x30A8]={ - adobename="ekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER E", @@ -96511,7 +94646,6 @@ characters.data={ unicodeslot=0x30A8, }, [0x30A9]={ - adobename="osmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL O", @@ -96523,7 +94657,6 @@ characters.data={ unicodeslot=0x30A9, }, [0x30AA]={ - adobename="okatakana", category="lo", cjkwd="w", description="KATAKANA LETTER O", @@ -96535,7 +94668,6 @@ characters.data={ unicodeslot=0x30AA, }, [0x30AB]={ - adobename="kakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER KA", @@ -96547,7 +94679,6 @@ characters.data={ unicodeslot=0x30AB, }, [0x30AC]={ - adobename="gakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER GA", @@ -96560,7 +94691,6 @@ characters.data={ unicodeslot=0x30AC, }, [0x30AD]={ - adobename="kikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER KI", @@ -96572,7 +94702,6 @@ characters.data={ unicodeslot=0x30AD, }, [0x30AE]={ - adobename="gikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER GI", @@ -96585,7 +94714,6 @@ characters.data={ unicodeslot=0x30AE, }, [0x30AF]={ - adobename="kukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER KU", @@ -96597,7 +94725,6 @@ characters.data={ unicodeslot=0x30AF, }, [0x30B0]={ - adobename="gukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER GU", @@ -96610,7 +94737,6 @@ characters.data={ unicodeslot=0x30B0, }, [0x30B1]={ - adobename="kekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER KE", @@ -96622,7 +94748,6 @@ characters.data={ unicodeslot=0x30B1, }, [0x30B2]={ - adobename="gekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER GE", @@ -96635,7 +94760,6 @@ characters.data={ unicodeslot=0x30B2, }, [0x30B3]={ - adobename="kokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER KO", @@ -96647,7 +94771,6 @@ characters.data={ unicodeslot=0x30B3, }, [0x30B4]={ - adobename="gokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER GO", @@ -96660,7 +94783,6 @@ characters.data={ unicodeslot=0x30B4, }, [0x30B5]={ - adobename="sakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SA", @@ -96672,7 +94794,6 @@ characters.data={ unicodeslot=0x30B5, }, [0x30B6]={ - adobename="zakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER ZA", @@ -96685,7 +94806,6 @@ characters.data={ unicodeslot=0x30B6, }, [0x30B7]={ - adobename="sikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SI", @@ -96697,7 +94817,6 @@ characters.data={ unicodeslot=0x30B7, }, [0x30B8]={ - adobename="zikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER ZI", @@ -96710,7 +94829,6 @@ characters.data={ unicodeslot=0x30B8, }, [0x30B9]={ - adobename="sukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SU", @@ -96722,7 +94840,6 @@ characters.data={ unicodeslot=0x30B9, }, [0x30BA]={ - adobename="zukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER ZU", @@ -96735,7 +94852,6 @@ characters.data={ unicodeslot=0x30BA, }, [0x30BB]={ - adobename="sekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SE", @@ -96747,7 +94863,6 @@ characters.data={ unicodeslot=0x30BB, }, [0x30BC]={ - adobename="zekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER ZE", @@ -96760,7 +94875,6 @@ characters.data={ unicodeslot=0x30BC, }, [0x30BD]={ - adobename="sokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SO", @@ -96772,7 +94886,6 @@ characters.data={ unicodeslot=0x30BD, }, [0x30BE]={ - adobename="zokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER ZO", @@ -96785,7 +94898,6 @@ characters.data={ unicodeslot=0x30BE, }, [0x30BF]={ - adobename="takatakana", category="lo", cjkwd="w", description="KATAKANA LETTER TA", @@ -96797,7 +94909,6 @@ characters.data={ unicodeslot=0x30BF, }, [0x30C0]={ - adobename="dakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER DA", @@ -96810,7 +94921,6 @@ characters.data={ unicodeslot=0x30C0, }, [0x30C1]={ - adobename="tikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER TI", @@ -96822,7 +94932,6 @@ characters.data={ unicodeslot=0x30C1, }, [0x30C2]={ - adobename="dikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER DI", @@ -96835,7 +94944,6 @@ characters.data={ unicodeslot=0x30C2, }, [0x30C3]={ - adobename="tusmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL TU", @@ -96847,7 +94955,6 @@ characters.data={ unicodeslot=0x30C3, }, [0x30C4]={ - adobename="tukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER TU", @@ -96859,7 +94966,6 @@ characters.data={ unicodeslot=0x30C4, }, [0x30C5]={ - adobename="dukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER DU", @@ -96872,7 +94978,6 @@ characters.data={ unicodeslot=0x30C5, }, [0x30C6]={ - adobename="tekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER TE", @@ -96884,7 +94989,6 @@ characters.data={ unicodeslot=0x30C6, }, [0x30C7]={ - adobename="dekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER DE", @@ -96897,7 +95001,6 @@ characters.data={ unicodeslot=0x30C7, }, [0x30C8]={ - adobename="tokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER TO", @@ -96909,7 +95012,6 @@ characters.data={ unicodeslot=0x30C8, }, [0x30C9]={ - adobename="dokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER DO", @@ -96922,7 +95024,6 @@ characters.data={ unicodeslot=0x30C9, }, [0x30CA]={ - adobename="nakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER NA", @@ -96934,7 +95035,6 @@ characters.data={ unicodeslot=0x30CA, }, [0x30CB]={ - adobename="nikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER NI", @@ -96946,7 +95046,6 @@ characters.data={ unicodeslot=0x30CB, }, [0x30CC]={ - adobename="nukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER NU", @@ -96958,7 +95057,6 @@ characters.data={ unicodeslot=0x30CC, }, [0x30CD]={ - adobename="nekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER NE", @@ -96970,7 +95068,6 @@ characters.data={ unicodeslot=0x30CD, }, [0x30CE]={ - adobename="nokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER NO", @@ -96982,7 +95079,6 @@ characters.data={ unicodeslot=0x30CE, }, [0x30CF]={ - adobename="hakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER HA", @@ -96994,7 +95090,6 @@ characters.data={ unicodeslot=0x30CF, }, [0x30D0]={ - adobename="bakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER BA", @@ -97007,7 +95102,6 @@ characters.data={ unicodeslot=0x30D0, }, [0x30D1]={ - adobename="pakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER PA", @@ -97020,7 +95114,6 @@ characters.data={ unicodeslot=0x30D1, }, [0x30D2]={ - adobename="hikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER HI", @@ -97032,7 +95125,6 @@ characters.data={ unicodeslot=0x30D2, }, [0x30D3]={ - adobename="bikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER BI", @@ -97045,7 +95137,6 @@ characters.data={ unicodeslot=0x30D3, }, [0x30D4]={ - adobename="pikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER PI", @@ -97058,7 +95149,6 @@ characters.data={ unicodeslot=0x30D4, }, [0x30D5]={ - adobename="hukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER HU", @@ -97070,7 +95160,6 @@ characters.data={ unicodeslot=0x30D5, }, [0x30D6]={ - adobename="bukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER BU", @@ -97083,7 +95172,6 @@ characters.data={ unicodeslot=0x30D6, }, [0x30D7]={ - adobename="pukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER PU", @@ -97096,7 +95184,6 @@ characters.data={ unicodeslot=0x30D7, }, [0x30D8]={ - adobename="hekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER HE", @@ -97108,7 +95195,6 @@ characters.data={ unicodeslot=0x30D8, }, [0x30D9]={ - adobename="bekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER BE", @@ -97121,7 +95207,6 @@ characters.data={ unicodeslot=0x30D9, }, [0x30DA]={ - adobename="pekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER PE", @@ -97134,7 +95219,6 @@ characters.data={ unicodeslot=0x30DA, }, [0x30DB]={ - adobename="hokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER HO", @@ -97146,7 +95230,6 @@ characters.data={ unicodeslot=0x30DB, }, [0x30DC]={ - adobename="bokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER BO", @@ -97159,7 +95242,6 @@ characters.data={ unicodeslot=0x30DC, }, [0x30DD]={ - adobename="pokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER PO", @@ -97172,7 +95254,6 @@ characters.data={ unicodeslot=0x30DD, }, [0x30DE]={ - adobename="makatakana", category="lo", cjkwd="w", description="KATAKANA LETTER MA", @@ -97184,7 +95265,6 @@ characters.data={ unicodeslot=0x30DE, }, [0x30DF]={ - adobename="mikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER MI", @@ -97196,7 +95276,6 @@ characters.data={ unicodeslot=0x30DF, }, [0x30E0]={ - adobename="mukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER MU", @@ -97208,7 +95287,6 @@ characters.data={ unicodeslot=0x30E0, }, [0x30E1]={ - adobename="mekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER ME", @@ -97220,7 +95298,6 @@ characters.data={ unicodeslot=0x30E1, }, [0x30E2]={ - adobename="mokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER MO", @@ -97232,7 +95309,6 @@ characters.data={ unicodeslot=0x30E2, }, [0x30E3]={ - adobename="yasmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL YA", @@ -97244,7 +95320,6 @@ characters.data={ unicodeslot=0x30E3, }, [0x30E4]={ - adobename="yakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER YA", @@ -97256,7 +95331,6 @@ characters.data={ unicodeslot=0x30E4, }, [0x30E5]={ - adobename="yusmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL YU", @@ -97268,7 +95342,6 @@ characters.data={ unicodeslot=0x30E5, }, [0x30E6]={ - adobename="yukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER YU", @@ -97280,7 +95353,6 @@ characters.data={ unicodeslot=0x30E6, }, [0x30E7]={ - adobename="yosmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL YO", @@ -97292,7 +95364,6 @@ characters.data={ unicodeslot=0x30E7, }, [0x30E8]={ - adobename="yokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER YO", @@ -97304,7 +95375,6 @@ characters.data={ unicodeslot=0x30E8, }, [0x30E9]={ - adobename="rakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER RA", @@ -97316,7 +95386,6 @@ characters.data={ unicodeslot=0x30E9, }, [0x30EA]={ - adobename="rikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER RI", @@ -97328,7 +95397,6 @@ characters.data={ unicodeslot=0x30EA, }, [0x30EB]={ - adobename="rukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER RU", @@ -97340,7 +95408,6 @@ characters.data={ unicodeslot=0x30EB, }, [0x30EC]={ - adobename="rekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER RE", @@ -97352,7 +95419,6 @@ characters.data={ unicodeslot=0x30EC, }, [0x30ED]={ - adobename="rokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER RO", @@ -97364,7 +95430,6 @@ characters.data={ unicodeslot=0x30ED, }, [0x30EE]={ - adobename="wasmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL WA", @@ -97376,7 +95441,6 @@ characters.data={ unicodeslot=0x30EE, }, [0x30EF]={ - adobename="wakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER WA", @@ -97388,7 +95452,6 @@ characters.data={ unicodeslot=0x30EF, }, [0x30F0]={ - adobename="wikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER WI", @@ -97400,7 +95463,6 @@ characters.data={ unicodeslot=0x30F0, }, [0x30F1]={ - adobename="wekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER WE", @@ -97412,7 +95474,6 @@ characters.data={ unicodeslot=0x30F1, }, [0x30F2]={ - adobename="wokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER WO", @@ -97424,7 +95485,6 @@ characters.data={ unicodeslot=0x30F2, }, [0x30F3]={ - adobename="nkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER N", @@ -97436,7 +95496,6 @@ characters.data={ unicodeslot=0x30F3, }, [0x30F4]={ - adobename="vukatakana", category="lo", cjkwd="w", description="KATAKANA LETTER VU", @@ -97449,7 +95508,6 @@ characters.data={ unicodeslot=0x30F4, }, [0x30F5]={ - adobename="kasmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL KA", @@ -97461,7 +95519,6 @@ characters.data={ unicodeslot=0x30F5, }, [0x30F6]={ - adobename="kesmallkatakana", category="lo", cjkwd="w", description="KATAKANA LETTER SMALL KE", @@ -97473,7 +95530,6 @@ characters.data={ unicodeslot=0x30F6, }, [0x30F7]={ - adobename="vakatakana", category="lo", cjkwd="w", description="KATAKANA LETTER VA", @@ -97485,7 +95541,6 @@ characters.data={ unicodeslot=0x30F7, }, [0x30F8]={ - adobename="vikatakana", category="lo", cjkwd="w", description="KATAKANA LETTER VI", @@ -97497,7 +95552,6 @@ characters.data={ unicodeslot=0x30F8, }, [0x30F9]={ - adobename="vekatakana", category="lo", cjkwd="w", description="KATAKANA LETTER VE", @@ -97509,7 +95563,6 @@ characters.data={ unicodeslot=0x30F9, }, [0x30FA]={ - adobename="vokatakana", category="lo", cjkwd="w", description="KATAKANA LETTER VO", @@ -97521,7 +95574,6 @@ characters.data={ unicodeslot=0x30FA, }, [0x30FB]={ - adobename="dotkatakana", category="po", cjkwd="w", description="KATAKANA MIDDLE DOT", @@ -97530,7 +95582,6 @@ characters.data={ unicodeslot=0x30FB, }, [0x30FC]={ - adobename="prolongedkana", category="lm", cjkwd="w", description="KATAKANA-HIRAGANA PROLONGED SOUND MARK", @@ -97542,7 +95593,6 @@ characters.data={ unicodeslot=0x30FC, }, [0x30FD]={ - adobename="iterationkatakana", category="lm", cjkwd="w", description="KATAKANA ITERATION MARK", @@ -97554,7 +95604,6 @@ characters.data={ unicodeslot=0x30FD, }, [0x30FE]={ - adobename="voicediterationkatakana", category="lm", cjkwd="w", description="KATAKANA VOICED ITERATION MARK", @@ -97576,7 +95625,6 @@ characters.data={ unicodeslot=0x30FF, }, [0x3105]={ - adobename="bbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER B", @@ -97585,7 +95633,6 @@ characters.data={ unicodeslot=0x3105, }, [0x3106]={ - adobename="pbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER P", @@ -97594,7 +95641,6 @@ characters.data={ unicodeslot=0x3106, }, [0x3107]={ - adobename="mbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER M", @@ -97603,7 +95649,6 @@ characters.data={ unicodeslot=0x3107, }, [0x3108]={ - adobename="fbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER F", @@ -97612,7 +95657,6 @@ characters.data={ unicodeslot=0x3108, }, [0x3109]={ - adobename="dbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER D", @@ -97621,7 +95665,6 @@ characters.data={ unicodeslot=0x3109, }, [0x310A]={ - adobename="tbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER T", @@ -97630,7 +95673,6 @@ characters.data={ unicodeslot=0x310A, }, [0x310B]={ - adobename="nbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER N", @@ -97639,7 +95681,6 @@ characters.data={ unicodeslot=0x310B, }, [0x310C]={ - adobename="lbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER L", @@ -97648,7 +95689,6 @@ characters.data={ unicodeslot=0x310C, }, [0x310D]={ - adobename="gbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER G", @@ -97657,7 +95697,6 @@ characters.data={ unicodeslot=0x310D, }, [0x310E]={ - adobename="kbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER K", @@ -97666,7 +95705,6 @@ characters.data={ unicodeslot=0x310E, }, [0x310F]={ - adobename="hbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER H", @@ -97675,7 +95713,6 @@ characters.data={ unicodeslot=0x310F, }, [0x3110]={ - adobename="jbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER J", @@ -97684,7 +95721,6 @@ characters.data={ unicodeslot=0x3110, }, [0x3111]={ - adobename="qbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER Q", @@ -97693,7 +95729,6 @@ characters.data={ unicodeslot=0x3111, }, [0x3112]={ - adobename="xbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER X", @@ -97702,7 +95737,6 @@ characters.data={ unicodeslot=0x3112, }, [0x3113]={ - adobename="zhbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER ZH", @@ -97711,7 +95745,6 @@ characters.data={ unicodeslot=0x3113, }, [0x3114]={ - adobename="chbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER CH", @@ -97720,7 +95753,6 @@ characters.data={ unicodeslot=0x3114, }, [0x3115]={ - adobename="shbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER SH", @@ -97729,7 +95761,6 @@ characters.data={ unicodeslot=0x3115, }, [0x3116]={ - adobename="rbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER R", @@ -97738,7 +95769,6 @@ characters.data={ unicodeslot=0x3116, }, [0x3117]={ - adobename="zbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER Z", @@ -97747,7 +95777,6 @@ characters.data={ unicodeslot=0x3117, }, [0x3118]={ - adobename="cbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER C", @@ -97756,7 +95785,6 @@ characters.data={ unicodeslot=0x3118, }, [0x3119]={ - adobename="sbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER S", @@ -97765,7 +95793,6 @@ characters.data={ unicodeslot=0x3119, }, [0x311A]={ - adobename="abopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER A", @@ -97774,7 +95801,6 @@ characters.data={ unicodeslot=0x311A, }, [0x311B]={ - adobename="obopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER O", @@ -97783,7 +95809,6 @@ characters.data={ unicodeslot=0x311B, }, [0x311C]={ - adobename="ebopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER E", @@ -97792,7 +95817,6 @@ characters.data={ unicodeslot=0x311C, }, [0x311D]={ - adobename="ehbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER EH", @@ -97801,7 +95825,6 @@ characters.data={ unicodeslot=0x311D, }, [0x311E]={ - adobename="aibopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER AI", @@ -97810,7 +95833,6 @@ characters.data={ unicodeslot=0x311E, }, [0x311F]={ - adobename="eibopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER EI", @@ -97819,7 +95841,6 @@ characters.data={ unicodeslot=0x311F, }, [0x3120]={ - adobename="aubopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER AU", @@ -97828,7 +95849,6 @@ characters.data={ unicodeslot=0x3120, }, [0x3121]={ - adobename="oubopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER OU", @@ -97837,7 +95857,6 @@ characters.data={ unicodeslot=0x3121, }, [0x3122]={ - adobename="anbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER AN", @@ -97846,7 +95865,6 @@ characters.data={ unicodeslot=0x3122, }, [0x3123]={ - adobename="enbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER EN", @@ -97855,7 +95873,6 @@ characters.data={ unicodeslot=0x3123, }, [0x3124]={ - adobename="angbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER ANG", @@ -97864,7 +95881,6 @@ characters.data={ unicodeslot=0x3124, }, [0x3125]={ - adobename="engbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER ENG", @@ -97873,7 +95889,6 @@ characters.data={ unicodeslot=0x3125, }, [0x3126]={ - adobename="erbopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER ER", @@ -97882,7 +95897,6 @@ characters.data={ unicodeslot=0x3126, }, [0x3127]={ - adobename="ibopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER I", @@ -97891,7 +95905,6 @@ characters.data={ unicodeslot=0x3127, }, [0x3128]={ - adobename="ubopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER U", @@ -97900,7 +95913,6 @@ characters.data={ unicodeslot=0x3128, }, [0x3129]={ - adobename="iubopomofo", category="lo", cjkwd="w", description="BOPOMOFO LETTER IU", @@ -97957,7 +95969,6 @@ characters.data={ unicodeslot=0x312F, }, [0x3131]={ - adobename="kiyeokkorean", category="lo", cjkwd="w", description="HANGUL LETTER KIYEOK", @@ -97967,7 +95978,6 @@ characters.data={ unicodeslot=0x3131, }, [0x3132]={ - adobename="ssangkiyeokkorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGKIYEOK", @@ -97977,7 +95987,6 @@ characters.data={ unicodeslot=0x3132, }, [0x3133]={ - adobename="kiyeoksioskorean", category="lo", cjkwd="w", description="HANGUL LETTER KIYEOK-SIOS", @@ -97987,7 +95996,6 @@ characters.data={ unicodeslot=0x3133, }, [0x3134]={ - adobename="nieunkorean", category="lo", cjkwd="w", description="HANGUL LETTER NIEUN", @@ -97997,7 +96005,6 @@ characters.data={ unicodeslot=0x3134, }, [0x3135]={ - adobename="nieuncieuckorean", category="lo", cjkwd="w", description="HANGUL LETTER NIEUN-CIEUC", @@ -98007,7 +96014,6 @@ characters.data={ unicodeslot=0x3135, }, [0x3136]={ - adobename="nieunhieuhkorean", category="lo", cjkwd="w", description="HANGUL LETTER NIEUN-HIEUH", @@ -98017,7 +96023,6 @@ characters.data={ unicodeslot=0x3136, }, [0x3137]={ - adobename="tikeutkorean", category="lo", cjkwd="w", description="HANGUL LETTER TIKEUT", @@ -98027,7 +96032,6 @@ characters.data={ unicodeslot=0x3137, }, [0x3138]={ - adobename="ssangtikeutkorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGTIKEUT", @@ -98037,7 +96041,6 @@ characters.data={ unicodeslot=0x3138, }, [0x3139]={ - adobename="rieulkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL", @@ -98047,7 +96050,6 @@ characters.data={ unicodeslot=0x3139, }, [0x313A]={ - adobename="rieulkiyeokkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-KIYEOK", @@ -98057,7 +96059,6 @@ characters.data={ unicodeslot=0x313A, }, [0x313B]={ - adobename="rieulmieumkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-MIEUM", @@ -98067,7 +96068,6 @@ characters.data={ unicodeslot=0x313B, }, [0x313C]={ - adobename="rieulpieupkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-PIEUP", @@ -98077,7 +96077,6 @@ characters.data={ unicodeslot=0x313C, }, [0x313D]={ - adobename="rieulsioskorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-SIOS", @@ -98087,7 +96086,6 @@ characters.data={ unicodeslot=0x313D, }, [0x313E]={ - adobename="rieulthieuthkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-THIEUTH", @@ -98097,7 +96095,6 @@ characters.data={ unicodeslot=0x313E, }, [0x313F]={ - adobename="rieulphieuphkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-PHIEUPH", @@ -98107,7 +96104,6 @@ characters.data={ unicodeslot=0x313F, }, [0x3140]={ - adobename="rieulhieuhkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-HIEUH", @@ -98117,7 +96113,6 @@ characters.data={ unicodeslot=0x3140, }, [0x3141]={ - adobename="mieumkorean", category="lo", cjkwd="w", description="HANGUL LETTER MIEUM", @@ -98127,7 +96122,6 @@ characters.data={ unicodeslot=0x3141, }, [0x3142]={ - adobename="pieupkorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP", @@ -98137,7 +96131,6 @@ characters.data={ unicodeslot=0x3142, }, [0x3143]={ - adobename="ssangpieupkorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGPIEUP", @@ -98147,7 +96140,6 @@ characters.data={ unicodeslot=0x3143, }, [0x3144]={ - adobename="pieupsioskorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP-SIOS", @@ -98157,7 +96149,6 @@ characters.data={ unicodeslot=0x3144, }, [0x3145]={ - adobename="sioskorean", category="lo", cjkwd="w", description="HANGUL LETTER SIOS", @@ -98167,7 +96158,6 @@ characters.data={ unicodeslot=0x3145, }, [0x3146]={ - adobename="ssangsioskorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGSIOS", @@ -98177,7 +96167,6 @@ characters.data={ unicodeslot=0x3146, }, [0x3147]={ - adobename="ieungkorean", category="lo", cjkwd="w", description="HANGUL LETTER IEUNG", @@ -98187,7 +96176,6 @@ characters.data={ unicodeslot=0x3147, }, [0x3148]={ - adobename="cieuckorean", category="lo", cjkwd="w", description="HANGUL LETTER CIEUC", @@ -98197,7 +96185,6 @@ characters.data={ unicodeslot=0x3148, }, [0x3149]={ - adobename="ssangcieuckorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGCIEUC", @@ -98207,7 +96194,6 @@ characters.data={ unicodeslot=0x3149, }, [0x314A]={ - adobename="chieuchkorean", category="lo", cjkwd="w", description="HANGUL LETTER CHIEUCH", @@ -98217,7 +96203,6 @@ characters.data={ unicodeslot=0x314A, }, [0x314B]={ - adobename="khieukhkorean", category="lo", cjkwd="w", description="HANGUL LETTER KHIEUKH", @@ -98227,7 +96212,6 @@ characters.data={ unicodeslot=0x314B, }, [0x314C]={ - adobename="thieuthkorean", category="lo", cjkwd="w", description="HANGUL LETTER THIEUTH", @@ -98237,7 +96221,6 @@ characters.data={ unicodeslot=0x314C, }, [0x314D]={ - adobename="phieuphkorean", category="lo", cjkwd="w", description="HANGUL LETTER PHIEUPH", @@ -98247,7 +96230,6 @@ characters.data={ unicodeslot=0x314D, }, [0x314E]={ - adobename="hieuhkorean", category="lo", cjkwd="w", description="HANGUL LETTER HIEUH", @@ -98257,7 +96239,6 @@ characters.data={ unicodeslot=0x314E, }, [0x314F]={ - adobename="akorean", category="lo", cjkwd="w", description="HANGUL LETTER A", @@ -98267,7 +96248,6 @@ characters.data={ unicodeslot=0x314F, }, [0x3150]={ - adobename="aekorean", category="lo", cjkwd="w", description="HANGUL LETTER AE", @@ -98277,7 +96257,6 @@ characters.data={ unicodeslot=0x3150, }, [0x3151]={ - adobename="yakorean", category="lo", cjkwd="w", description="HANGUL LETTER YA", @@ -98287,7 +96266,6 @@ characters.data={ unicodeslot=0x3151, }, [0x3152]={ - adobename="yaekorean", category="lo", cjkwd="w", description="HANGUL LETTER YAE", @@ -98297,7 +96275,6 @@ characters.data={ unicodeslot=0x3152, }, [0x3153]={ - adobename="eokorean", category="lo", cjkwd="w", description="HANGUL LETTER EO", @@ -98307,7 +96284,6 @@ characters.data={ unicodeslot=0x3153, }, [0x3154]={ - adobename="ekorean", category="lo", cjkwd="w", description="HANGUL LETTER E", @@ -98317,7 +96293,6 @@ characters.data={ unicodeslot=0x3154, }, [0x3155]={ - adobename="yeokorean", category="lo", cjkwd="w", description="HANGUL LETTER YEO", @@ -98327,7 +96302,6 @@ characters.data={ unicodeslot=0x3155, }, [0x3156]={ - adobename="yekorean", category="lo", cjkwd="w", description="HANGUL LETTER YE", @@ -98337,7 +96311,6 @@ characters.data={ unicodeslot=0x3156, }, [0x3157]={ - adobename="okorean", category="lo", cjkwd="w", description="HANGUL LETTER O", @@ -98347,7 +96320,6 @@ characters.data={ unicodeslot=0x3157, }, [0x3158]={ - adobename="wakorean", category="lo", cjkwd="w", description="HANGUL LETTER WA", @@ -98357,7 +96329,6 @@ characters.data={ unicodeslot=0x3158, }, [0x3159]={ - adobename="waekorean", category="lo", cjkwd="w", description="HANGUL LETTER WAE", @@ -98367,7 +96338,6 @@ characters.data={ unicodeslot=0x3159, }, [0x315A]={ - adobename="oekorean", category="lo", cjkwd="w", description="HANGUL LETTER OE", @@ -98377,7 +96347,6 @@ characters.data={ unicodeslot=0x315A, }, [0x315B]={ - adobename="yokorean", category="lo", cjkwd="w", description="HANGUL LETTER YO", @@ -98387,7 +96356,6 @@ characters.data={ unicodeslot=0x315B, }, [0x315C]={ - adobename="ukorean", category="lo", cjkwd="w", description="HANGUL LETTER U", @@ -98397,7 +96365,6 @@ characters.data={ unicodeslot=0x315C, }, [0x315D]={ - adobename="weokorean", category="lo", cjkwd="w", description="HANGUL LETTER WEO", @@ -98407,7 +96374,6 @@ characters.data={ unicodeslot=0x315D, }, [0x315E]={ - adobename="wekorean", category="lo", cjkwd="w", description="HANGUL LETTER WE", @@ -98417,7 +96383,6 @@ characters.data={ unicodeslot=0x315E, }, [0x315F]={ - adobename="wikorean", category="lo", cjkwd="w", description="HANGUL LETTER WI", @@ -98427,7 +96392,6 @@ characters.data={ unicodeslot=0x315F, }, [0x3160]={ - adobename="yukorean", category="lo", cjkwd="w", description="HANGUL LETTER YU", @@ -98437,7 +96401,6 @@ characters.data={ unicodeslot=0x3160, }, [0x3161]={ - adobename="eukorean", category="lo", cjkwd="w", description="HANGUL LETTER EU", @@ -98447,7 +96410,6 @@ characters.data={ unicodeslot=0x3161, }, [0x3162]={ - adobename="yikorean", category="lo", cjkwd="w", description="HANGUL LETTER YI", @@ -98457,7 +96419,6 @@ characters.data={ unicodeslot=0x3162, }, [0x3163]={ - adobename="ikorean", category="lo", cjkwd="w", description="HANGUL LETTER I", @@ -98467,7 +96428,6 @@ characters.data={ unicodeslot=0x3163, }, [0x3164]={ - adobename="hangulfiller", category="lo", cjkwd="w", description="HANGUL FILLER", @@ -98477,7 +96437,6 @@ characters.data={ unicodeslot=0x3164, }, [0x3165]={ - adobename="ssangnieunkorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGNIEUN", @@ -98487,7 +96446,6 @@ characters.data={ unicodeslot=0x3165, }, [0x3166]={ - adobename="nieuntikeutkorean", category="lo", cjkwd="w", description="HANGUL LETTER NIEUN-TIKEUT", @@ -98497,7 +96455,6 @@ characters.data={ unicodeslot=0x3166, }, [0x3167]={ - adobename="nieunsioskorean", category="lo", cjkwd="w", description="HANGUL LETTER NIEUN-SIOS", @@ -98507,7 +96464,6 @@ characters.data={ unicodeslot=0x3167, }, [0x3168]={ - adobename="nieunpansioskorean", category="lo", cjkwd="w", description="HANGUL LETTER NIEUN-PANSIOS", @@ -98517,7 +96473,6 @@ characters.data={ unicodeslot=0x3168, }, [0x3169]={ - adobename="rieulkiyeoksioskorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-KIYEOK-SIOS", @@ -98527,7 +96482,6 @@ characters.data={ unicodeslot=0x3169, }, [0x316A]={ - adobename="rieultikeutkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-TIKEUT", @@ -98537,7 +96491,6 @@ characters.data={ unicodeslot=0x316A, }, [0x316B]={ - adobename="rieulpieupsioskorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-PIEUP-SIOS", @@ -98547,7 +96500,6 @@ characters.data={ unicodeslot=0x316B, }, [0x316C]={ - adobename="rieulpansioskorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-PANSIOS", @@ -98557,7 +96509,6 @@ characters.data={ unicodeslot=0x316C, }, [0x316D]={ - adobename="rieulyeorinhieuhkorean", category="lo", cjkwd="w", description="HANGUL LETTER RIEUL-YEORINHIEUH", @@ -98567,7 +96518,6 @@ characters.data={ unicodeslot=0x316D, }, [0x316E]={ - adobename="mieumpieupkorean", category="lo", cjkwd="w", description="HANGUL LETTER MIEUM-PIEUP", @@ -98577,7 +96527,6 @@ characters.data={ unicodeslot=0x316E, }, [0x316F]={ - adobename="mieumsioskorean", category="lo", cjkwd="w", description="HANGUL LETTER MIEUM-SIOS", @@ -98587,7 +96536,6 @@ characters.data={ unicodeslot=0x316F, }, [0x3170]={ - adobename="mieumpansioskorean", category="lo", cjkwd="w", description="HANGUL LETTER MIEUM-PANSIOS", @@ -98597,7 +96545,6 @@ characters.data={ unicodeslot=0x3170, }, [0x3171]={ - adobename="kapyeounmieumkorean", category="lo", cjkwd="w", description="HANGUL LETTER KAPYEOUNMIEUM", @@ -98607,7 +96554,6 @@ characters.data={ unicodeslot=0x3171, }, [0x3172]={ - adobename="pieupkiyeokkorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP-KIYEOK", @@ -98617,7 +96563,6 @@ characters.data={ unicodeslot=0x3172, }, [0x3173]={ - adobename="pieuptikeutkorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP-TIKEUT", @@ -98627,7 +96572,6 @@ characters.data={ unicodeslot=0x3173, }, [0x3174]={ - adobename="pieupsioskiyeokkorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP-SIOS-KIYEOK", @@ -98637,7 +96581,6 @@ characters.data={ unicodeslot=0x3174, }, [0x3175]={ - adobename="pieupsiostikeutkorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP-SIOS-TIKEUT", @@ -98647,7 +96590,6 @@ characters.data={ unicodeslot=0x3175, }, [0x3176]={ - adobename="pieupcieuckorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP-CIEUC", @@ -98657,7 +96599,6 @@ characters.data={ unicodeslot=0x3176, }, [0x3177]={ - adobename="pieupthieuthkorean", category="lo", cjkwd="w", description="HANGUL LETTER PIEUP-THIEUTH", @@ -98667,7 +96608,6 @@ characters.data={ unicodeslot=0x3177, }, [0x3178]={ - adobename="kapyeounpieupkorean", category="lo", cjkwd="w", description="HANGUL LETTER KAPYEOUNPIEUP", @@ -98677,7 +96617,6 @@ characters.data={ unicodeslot=0x3178, }, [0x3179]={ - adobename="kapyeounssangpieupkorean", category="lo", cjkwd="w", description="HANGUL LETTER KAPYEOUNSSANGPIEUP", @@ -98687,7 +96626,6 @@ characters.data={ unicodeslot=0x3179, }, [0x317A]={ - adobename="sioskiyeokkorean", category="lo", cjkwd="w", description="HANGUL LETTER SIOS-KIYEOK", @@ -98697,7 +96635,6 @@ characters.data={ unicodeslot=0x317A, }, [0x317B]={ - adobename="siosnieunkorean", category="lo", cjkwd="w", description="HANGUL LETTER SIOS-NIEUN", @@ -98707,7 +96644,6 @@ characters.data={ unicodeslot=0x317B, }, [0x317C]={ - adobename="siostikeutkorean", category="lo", cjkwd="w", description="HANGUL LETTER SIOS-TIKEUT", @@ -98717,7 +96653,6 @@ characters.data={ unicodeslot=0x317C, }, [0x317D]={ - adobename="siospieupkorean", category="lo", cjkwd="w", description="HANGUL LETTER SIOS-PIEUP", @@ -98727,7 +96662,6 @@ characters.data={ unicodeslot=0x317D, }, [0x317E]={ - adobename="sioscieuckorean", category="lo", cjkwd="w", description="HANGUL LETTER SIOS-CIEUC", @@ -98737,7 +96671,6 @@ characters.data={ unicodeslot=0x317E, }, [0x317F]={ - adobename="pansioskorean", category="lo", cjkwd="w", description="HANGUL LETTER PANSIOS", @@ -98747,7 +96680,6 @@ characters.data={ unicodeslot=0x317F, }, [0x3180]={ - adobename="ssangieungkorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGIEUNG", @@ -98757,7 +96689,6 @@ characters.data={ unicodeslot=0x3180, }, [0x3181]={ - adobename="yesieungkorean", category="lo", cjkwd="w", description="HANGUL LETTER YESIEUNG", @@ -98767,7 +96698,6 @@ characters.data={ unicodeslot=0x3181, }, [0x3182]={ - adobename="yesieungsioskorean", category="lo", cjkwd="w", description="HANGUL LETTER YESIEUNG-SIOS", @@ -98777,7 +96707,6 @@ characters.data={ unicodeslot=0x3182, }, [0x3183]={ - adobename="yesieungpansioskorean", category="lo", cjkwd="w", description="HANGUL LETTER YESIEUNG-PANSIOS", @@ -98787,7 +96716,6 @@ characters.data={ unicodeslot=0x3183, }, [0x3184]={ - adobename="kapyeounphieuphkorean", category="lo", cjkwd="w", description="HANGUL LETTER KAPYEOUNPHIEUPH", @@ -98797,7 +96725,6 @@ characters.data={ unicodeslot=0x3184, }, [0x3185]={ - adobename="ssanghieuhkorean", category="lo", cjkwd="w", description="HANGUL LETTER SSANGHIEUH", @@ -98807,7 +96734,6 @@ characters.data={ unicodeslot=0x3185, }, [0x3186]={ - adobename="yeorinhieuhkorean", category="lo", cjkwd="w", description="HANGUL LETTER YEORINHIEUH", @@ -98817,7 +96743,6 @@ characters.data={ unicodeslot=0x3186, }, [0x3187]={ - adobename="yoyakorean", category="lo", cjkwd="w", description="HANGUL LETTER YO-YA", @@ -98827,7 +96752,6 @@ characters.data={ unicodeslot=0x3187, }, [0x3188]={ - adobename="yoyaekorean", category="lo", cjkwd="w", description="HANGUL LETTER YO-YAE", @@ -98837,7 +96761,6 @@ characters.data={ unicodeslot=0x3188, }, [0x3189]={ - adobename="yoikorean", category="lo", cjkwd="w", description="HANGUL LETTER YO-I", @@ -98847,7 +96770,6 @@ characters.data={ unicodeslot=0x3189, }, [0x318A]={ - adobename="yuyeokorean", category="lo", cjkwd="w", description="HANGUL LETTER YU-YEO", @@ -98857,7 +96779,6 @@ characters.data={ unicodeslot=0x318A, }, [0x318B]={ - adobename="yuyekorean", category="lo", cjkwd="w", description="HANGUL LETTER YU-YE", @@ -98867,7 +96788,6 @@ characters.data={ unicodeslot=0x318B, }, [0x318C]={ - adobename="yuikorean", category="lo", cjkwd="w", description="HANGUL LETTER YU-I", @@ -98877,7 +96797,6 @@ characters.data={ unicodeslot=0x318C, }, [0x318D]={ - adobename="araeakorean", category="lo", cjkwd="w", description="HANGUL LETTER ARAEA", @@ -98887,7 +96806,6 @@ characters.data={ unicodeslot=0x318D, }, [0x318E]={ - adobename="araeaekorean", category="lo", cjkwd="w", description="HANGUL LETTER ARAEAE", @@ -99582,6 +97500,14 @@ characters.data={ linebreak="id", unicodeslot=0x31E3, }, + [0x31EF]={ + category="so", + cjkwd="w", + description="IDEOGRAPHIC DESCRIPTION CHARACTER SUBTRACTION", + direction="on", + linebreak="id", + unicodeslot=0x31EF, + }, [0x31F0]={ category="lo", cjkwd="w", @@ -99742,7 +97668,6 @@ characters.data={ unicodeslot=0x31FF, }, [0x3200]={ - adobename="kiyeokparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL KIYEOK", @@ -99752,7 +97677,6 @@ characters.data={ unicodeslot=0x3200, }, [0x3201]={ - adobename="nieunparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL NIEUN", @@ -99762,7 +97686,6 @@ characters.data={ unicodeslot=0x3201, }, [0x3202]={ - adobename="tikeutparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL TIKEUT", @@ -99772,7 +97695,6 @@ characters.data={ unicodeslot=0x3202, }, [0x3203]={ - adobename="rieulparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL RIEUL", @@ -99782,7 +97704,6 @@ characters.data={ unicodeslot=0x3203, }, [0x3204]={ - adobename="mieumparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL MIEUM", @@ -99792,7 +97713,6 @@ characters.data={ unicodeslot=0x3204, }, [0x3205]={ - adobename="pieupparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL PIEUP", @@ -99802,7 +97722,6 @@ characters.data={ unicodeslot=0x3205, }, [0x3206]={ - adobename="siosparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL SIOS", @@ -99812,7 +97731,6 @@ characters.data={ unicodeslot=0x3206, }, [0x3207]={ - adobename="ieungparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL IEUNG", @@ -99822,7 +97740,6 @@ characters.data={ unicodeslot=0x3207, }, [0x3208]={ - adobename="cieucparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL CIEUC", @@ -99832,7 +97749,6 @@ characters.data={ unicodeslot=0x3208, }, [0x3209]={ - adobename="chieuchparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL CHIEUCH", @@ -99842,7 +97758,6 @@ characters.data={ unicodeslot=0x3209, }, [0x320A]={ - adobename="khieukhparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL KHIEUKH", @@ -99852,7 +97767,6 @@ characters.data={ unicodeslot=0x320A, }, [0x320B]={ - adobename="thieuthparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL THIEUTH", @@ -99862,7 +97776,6 @@ characters.data={ unicodeslot=0x320B, }, [0x320C]={ - adobename="phieuphparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL PHIEUPH", @@ -99872,7 +97785,6 @@ characters.data={ unicodeslot=0x320C, }, [0x320D]={ - adobename="hieuhparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL HIEUH", @@ -99882,7 +97794,6 @@ characters.data={ unicodeslot=0x320D, }, [0x320E]={ - adobename="kiyeokaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL KIYEOK A", @@ -99892,7 +97803,6 @@ characters.data={ unicodeslot=0x320E, }, [0x320F]={ - adobename="nieunaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL NIEUN A", @@ -99902,7 +97812,6 @@ characters.data={ unicodeslot=0x320F, }, [0x3210]={ - adobename="tikeutaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL TIKEUT A", @@ -99912,7 +97821,6 @@ characters.data={ unicodeslot=0x3210, }, [0x3211]={ - adobename="rieulaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL RIEUL A", @@ -99922,7 +97830,6 @@ characters.data={ unicodeslot=0x3211, }, [0x3212]={ - adobename="mieumaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL MIEUM A", @@ -99932,7 +97839,6 @@ characters.data={ unicodeslot=0x3212, }, [0x3213]={ - adobename="pieupaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL PIEUP A", @@ -99942,7 +97848,6 @@ characters.data={ unicodeslot=0x3213, }, [0x3214]={ - adobename="siosaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL SIOS A", @@ -99952,7 +97857,6 @@ characters.data={ unicodeslot=0x3214, }, [0x3215]={ - adobename="ieungaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL IEUNG A", @@ -99962,7 +97866,6 @@ characters.data={ unicodeslot=0x3215, }, [0x3216]={ - adobename="cieucaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL CIEUC A", @@ -99972,7 +97875,6 @@ characters.data={ unicodeslot=0x3216, }, [0x3217]={ - adobename="chieuchaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL CHIEUCH A", @@ -99982,7 +97884,6 @@ characters.data={ unicodeslot=0x3217, }, [0x3218]={ - adobename="khieukhaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL KHIEUKH A", @@ -99992,7 +97893,6 @@ characters.data={ unicodeslot=0x3218, }, [0x3219]={ - adobename="thieuthaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL THIEUTH A", @@ -100002,7 +97902,6 @@ characters.data={ unicodeslot=0x3219, }, [0x321A]={ - adobename="phieuphaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL PHIEUPH A", @@ -100012,7 +97911,6 @@ characters.data={ unicodeslot=0x321A, }, [0x321B]={ - adobename="hieuhaparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL HIEUH A", @@ -100022,7 +97920,6 @@ characters.data={ unicodeslot=0x321B, }, [0x321C]={ - adobename="cieucuparenkorean", category="so", cjkwd="w", description="PARENTHESIZED HANGUL CIEUC U", @@ -100050,7 +97947,6 @@ characters.data={ unicodeslot=0x321E, }, [0x3220]={ - adobename="oneideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH ONE", @@ -100060,7 +97956,6 @@ characters.data={ unicodeslot=0x3220, }, [0x3221]={ - adobename="twoideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH TWO", @@ -100070,7 +97965,6 @@ characters.data={ unicodeslot=0x3221, }, [0x3222]={ - adobename="threeideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH THREE", @@ -100080,7 +97974,6 @@ characters.data={ unicodeslot=0x3222, }, [0x3223]={ - adobename="fourideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH FOUR", @@ -100090,7 +97983,6 @@ characters.data={ unicodeslot=0x3223, }, [0x3224]={ - adobename="fiveideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH FIVE", @@ -100100,7 +97992,6 @@ characters.data={ unicodeslot=0x3224, }, [0x3225]={ - adobename="sixideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH SIX", @@ -100110,7 +98001,6 @@ characters.data={ unicodeslot=0x3225, }, [0x3226]={ - adobename="sevenideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH SEVEN", @@ -100120,7 +98010,6 @@ characters.data={ unicodeslot=0x3226, }, [0x3227]={ - adobename="eightideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH EIGHT", @@ -100130,7 +98019,6 @@ characters.data={ unicodeslot=0x3227, }, [0x3228]={ - adobename="nineideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH NINE", @@ -100140,7 +98028,6 @@ characters.data={ unicodeslot=0x3228, }, [0x3229]={ - adobename="tenideographicparen", category="no", cjkwd="w", description="PARENTHESIZED IDEOGRAPH TEN", @@ -100150,7 +98037,6 @@ characters.data={ unicodeslot=0x3229, }, [0x322A]={ - adobename="ideographicmoonparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH MOON", @@ -100160,7 +98046,6 @@ characters.data={ unicodeslot=0x322A, }, [0x322B]={ - adobename="ideographicfireparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH FIRE", @@ -100170,7 +98055,6 @@ characters.data={ unicodeslot=0x322B, }, [0x322C]={ - adobename="ideographicwaterparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH WATER", @@ -100180,7 +98064,6 @@ characters.data={ unicodeslot=0x322C, }, [0x322D]={ - adobename="ideographicwoodparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH WOOD", @@ -100190,7 +98073,6 @@ characters.data={ unicodeslot=0x322D, }, [0x322E]={ - adobename="ideographicmetalparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH METAL", @@ -100200,7 +98082,6 @@ characters.data={ unicodeslot=0x322E, }, [0x322F]={ - adobename="ideographicearthparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH EARTH", @@ -100210,7 +98091,6 @@ characters.data={ unicodeslot=0x322F, }, [0x3230]={ - adobename="ideographicsunparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH SUN", @@ -100220,7 +98100,6 @@ characters.data={ unicodeslot=0x3230, }, [0x3231]={ - adobename="ideographicstockparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH STOCK", @@ -100230,7 +98109,6 @@ characters.data={ unicodeslot=0x3231, }, [0x3232]={ - adobename="ideographichaveparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH HAVE", @@ -100240,7 +98118,6 @@ characters.data={ unicodeslot=0x3232, }, [0x3233]={ - adobename="ideographicsocietyparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH SOCIETY", @@ -100250,7 +98127,6 @@ characters.data={ unicodeslot=0x3233, }, [0x3234]={ - adobename="ideographicnameparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH NAME", @@ -100260,7 +98136,6 @@ characters.data={ unicodeslot=0x3234, }, [0x3235]={ - adobename="ideographicspecialparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH SPECIAL", @@ -100270,7 +98145,6 @@ characters.data={ unicodeslot=0x3235, }, [0x3236]={ - adobename="ideographicfinancialparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH FINANCIAL", @@ -100280,7 +98154,6 @@ characters.data={ unicodeslot=0x3236, }, [0x3237]={ - adobename="ideographiccongratulationparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH CONGRATULATION", @@ -100290,7 +98163,6 @@ characters.data={ unicodeslot=0x3237, }, [0x3238]={ - adobename="ideographiclaborparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH LABOR", @@ -100300,7 +98172,6 @@ characters.data={ unicodeslot=0x3238, }, [0x3239]={ - adobename="ideographicrepresentparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH REPRESENT", @@ -100310,7 +98181,6 @@ characters.data={ unicodeslot=0x3239, }, [0x323A]={ - adobename="ideographiccallparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH CALL", @@ -100320,7 +98190,6 @@ characters.data={ unicodeslot=0x323A, }, [0x323B]={ - adobename="ideographicstudyparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH STUDY", @@ -100330,7 +98199,6 @@ characters.data={ unicodeslot=0x323B, }, [0x323C]={ - adobename="ideographicsuperviseparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH SUPERVISE", @@ -100340,7 +98208,6 @@ characters.data={ unicodeslot=0x323C, }, [0x323D]={ - adobename="ideographicenterpriseparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH ENTERPRISE", @@ -100350,7 +98217,6 @@ characters.data={ unicodeslot=0x323D, }, [0x323E]={ - adobename="ideographicresourceparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH RESOURCE", @@ -100360,7 +98226,6 @@ characters.data={ unicodeslot=0x323E, }, [0x323F]={ - adobename="ideographicallianceparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH ALLIANCE", @@ -100370,7 +98235,6 @@ characters.data={ unicodeslot=0x323F, }, [0x3240]={ - adobename="ideographicfestivalparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH FESTIVAL", @@ -100389,7 +98253,6 @@ characters.data={ unicodeslot=0x3241, }, [0x3242]={ - adobename="ideographicselfparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH SELF", @@ -100399,7 +98262,6 @@ characters.data={ unicodeslot=0x3242, }, [0x3243]={ - adobename="ideographicreachparen", category="so", cjkwd="w", description="PARENTHESIZED IDEOGRAPH REACH", @@ -100653,7 +98515,6 @@ characters.data={ unicodeslot=0x325F, }, [0x3260]={ - adobename="kiyeokcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL KIYEOK", @@ -100663,7 +98524,6 @@ characters.data={ unicodeslot=0x3260, }, [0x3261]={ - adobename="nieuncirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL NIEUN", @@ -100673,7 +98533,6 @@ characters.data={ unicodeslot=0x3261, }, [0x3262]={ - adobename="tikeutcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL TIKEUT", @@ -100683,7 +98542,6 @@ characters.data={ unicodeslot=0x3262, }, [0x3263]={ - adobename="rieulcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL RIEUL", @@ -100693,7 +98551,6 @@ characters.data={ unicodeslot=0x3263, }, [0x3264]={ - adobename="mieumcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL MIEUM", @@ -100703,7 +98560,6 @@ characters.data={ unicodeslot=0x3264, }, [0x3265]={ - adobename="pieupcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL PIEUP", @@ -100713,7 +98569,6 @@ characters.data={ unicodeslot=0x3265, }, [0x3266]={ - adobename="sioscirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL SIOS", @@ -100723,7 +98578,6 @@ characters.data={ unicodeslot=0x3266, }, [0x3267]={ - adobename="ieungcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL IEUNG", @@ -100733,7 +98587,6 @@ characters.data={ unicodeslot=0x3267, }, [0x3268]={ - adobename="cieuccirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL CIEUC", @@ -100743,7 +98596,6 @@ characters.data={ unicodeslot=0x3268, }, [0x3269]={ - adobename="chieuchcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL CHIEUCH", @@ -100753,7 +98605,6 @@ characters.data={ unicodeslot=0x3269, }, [0x326A]={ - adobename="khieukhcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL KHIEUKH", @@ -100763,7 +98614,6 @@ characters.data={ unicodeslot=0x326A, }, [0x326B]={ - adobename="thieuthcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL THIEUTH", @@ -100773,7 +98623,6 @@ characters.data={ unicodeslot=0x326B, }, [0x326C]={ - adobename="phieuphcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL PHIEUPH", @@ -100783,7 +98632,6 @@ characters.data={ unicodeslot=0x326C, }, [0x326D]={ - adobename="hieuhcirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL HIEUH", @@ -100793,7 +98641,6 @@ characters.data={ unicodeslot=0x326D, }, [0x326E]={ - adobename="kiyeokacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL KIYEOK A", @@ -100803,7 +98650,6 @@ characters.data={ unicodeslot=0x326E, }, [0x326F]={ - adobename="nieunacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL NIEUN A", @@ -100813,7 +98659,6 @@ characters.data={ unicodeslot=0x326F, }, [0x3270]={ - adobename="tikeutacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL TIKEUT A", @@ -100823,7 +98668,6 @@ characters.data={ unicodeslot=0x3270, }, [0x3271]={ - adobename="rieulacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL RIEUL A", @@ -100833,7 +98677,6 @@ characters.data={ unicodeslot=0x3271, }, [0x3272]={ - adobename="mieumacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL MIEUM A", @@ -100843,7 +98686,6 @@ characters.data={ unicodeslot=0x3272, }, [0x3273]={ - adobename="pieupacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL PIEUP A", @@ -100853,7 +98695,6 @@ characters.data={ unicodeslot=0x3273, }, [0x3274]={ - adobename="siosacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL SIOS A", @@ -100863,7 +98704,6 @@ characters.data={ unicodeslot=0x3274, }, [0x3275]={ - adobename="ieungacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL IEUNG A", @@ -100873,7 +98713,6 @@ characters.data={ unicodeslot=0x3275, }, [0x3276]={ - adobename="cieucacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL CIEUC A", @@ -100883,7 +98722,6 @@ characters.data={ unicodeslot=0x3276, }, [0x3277]={ - adobename="chieuchacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL CHIEUCH A", @@ -100893,7 +98731,6 @@ characters.data={ unicodeslot=0x3277, }, [0x3278]={ - adobename="khieukhacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL KHIEUKH A", @@ -100903,7 +98740,6 @@ characters.data={ unicodeslot=0x3278, }, [0x3279]={ - adobename="thieuthacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL THIEUTH A", @@ -100913,7 +98749,6 @@ characters.data={ unicodeslot=0x3279, }, [0x327A]={ - adobename="phieuphacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL PHIEUPH A", @@ -100923,7 +98758,6 @@ characters.data={ unicodeslot=0x327A, }, [0x327B]={ - adobename="hieuhacirclekorean", category="so", cjkwd="w", description="CIRCLED HANGUL HIEUH A", @@ -100960,7 +98794,6 @@ characters.data={ unicodeslot=0x327E, }, [0x327F]={ - adobename="koreanstandardsymbol", category="so", cjkwd="w", description="KOREAN STANDARD SYMBOL", @@ -101059,7 +98892,6 @@ characters.data={ unicodeslot=0x3289, }, [0x328A]={ - adobename="ideographmooncircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH MOON", @@ -101069,7 +98901,6 @@ characters.data={ unicodeslot=0x328A, }, [0x328B]={ - adobename="ideographfirecircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH FIRE", @@ -101079,7 +98910,6 @@ characters.data={ unicodeslot=0x328B, }, [0x328C]={ - adobename="ideographwatercircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH WATER", @@ -101089,7 +98919,6 @@ characters.data={ unicodeslot=0x328C, }, [0x328D]={ - adobename="ideographwoodcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH WOOD", @@ -101099,7 +98928,6 @@ characters.data={ unicodeslot=0x328D, }, [0x328E]={ - adobename="ideographmetalcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH METAL", @@ -101109,7 +98937,6 @@ characters.data={ unicodeslot=0x328E, }, [0x328F]={ - adobename="ideographearthcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH EARTH", @@ -101119,7 +98946,6 @@ characters.data={ unicodeslot=0x328F, }, [0x3290]={ - adobename="ideographsuncircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH SUN", @@ -101156,7 +98982,6 @@ characters.data={ unicodeslot=0x3293, }, [0x3294]={ - adobename="ideographnamecircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH NAME", @@ -101175,7 +99000,6 @@ characters.data={ unicodeslot=0x3295, }, [0x3296]={ - adobename="ideographicfinancialcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH FINANCIAL", @@ -101195,7 +99019,6 @@ characters.data={ variants=variants_emoji, }, [0x3298]={ - adobename="ideographiclaborcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH LABOR", @@ -101205,7 +99028,6 @@ characters.data={ unicodeslot=0x3298, }, [0x3299]={ - adobename="ideographicsecretcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH SECRET", @@ -101243,7 +99065,6 @@ characters.data={ unicodeslot=0x329C, }, [0x329D]={ - adobename="ideographicexcellentcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH EXCELLENT", @@ -101253,7 +99074,6 @@ characters.data={ unicodeslot=0x329D, }, [0x329E]={ - adobename="ideographicprintcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH PRINT", @@ -101299,7 +99119,6 @@ characters.data={ unicodeslot=0x32A2, }, [0x32A3]={ - adobename="ideographiccorrectcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH CORRECT", @@ -101309,7 +99128,6 @@ characters.data={ unicodeslot=0x32A3, }, [0x32A4]={ - adobename="ideographichighcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH HIGH", @@ -101319,7 +99137,6 @@ characters.data={ unicodeslot=0x32A4, }, [0x32A5]={ - adobename="ideographiccentrecircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH CENTRE", @@ -101329,7 +99146,6 @@ characters.data={ unicodeslot=0x32A5, }, [0x32A6]={ - adobename="ideographiclowcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH LOW", @@ -101339,7 +99155,6 @@ characters.data={ unicodeslot=0x32A6, }, [0x32A7]={ - adobename="ideographicleftcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH LEFT", @@ -101349,7 +99164,6 @@ characters.data={ unicodeslot=0x32A7, }, [0x32A8]={ - adobename="ideographicrightcircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH RIGHT", @@ -101359,7 +99173,6 @@ characters.data={ unicodeslot=0x32A8, }, [0x32A9]={ - adobename="ideographicmedicinecircle", category="so", cjkwd="w", description="CIRCLED IDEOGRAPH MEDICINE", @@ -102143,7 +99956,6 @@ characters.data={ unicodeslot=0x32FF, }, [0x3300]={ - adobename="apaatosquare", category="so", cjkwd="w", description="SQUARE APAATO", @@ -102171,7 +99983,6 @@ characters.data={ unicodeslot=0x3302, }, [0x3303]={ - adobename="aarusquare", category="so", cjkwd="w", description="SQUARE AARU", @@ -102190,7 +100001,6 @@ characters.data={ unicodeslot=0x3304, }, [0x3305]={ - adobename="intisquare", category="so", cjkwd="w", description="SQUARE INTI", @@ -102263,7 +100073,6 @@ characters.data={ unicodeslot=0x330C, }, [0x330D]={ - adobename="karoriisquare", category="so", cjkwd="w", description="SQUARE KARORII", @@ -102327,7 +100136,6 @@ characters.data={ unicodeslot=0x3313, }, [0x3314]={ - adobename="kirosquare", category="so", cjkwd="w", description="SQUARE KIRO", @@ -102337,7 +100145,6 @@ characters.data={ unicodeslot=0x3314, }, [0x3315]={ - adobename="kiroguramusquare", category="so", cjkwd="w", description="SQUARE KIROGURAMU", @@ -102347,7 +100154,6 @@ characters.data={ unicodeslot=0x3315, }, [0x3316]={ - adobename="kiromeetorusquare", category="so", cjkwd="w", description="SQUARE KIROMEETORU", @@ -102366,7 +100172,6 @@ characters.data={ unicodeslot=0x3317, }, [0x3318]={ - adobename="guramusquare", category="so", cjkwd="w", description="SQUARE GURAMU", @@ -102421,7 +100226,6 @@ characters.data={ unicodeslot=0x331D, }, [0x331E]={ - adobename="kooposquare", category="so", cjkwd="w", description="SQUARE KOOPO", @@ -102458,7 +100262,6 @@ characters.data={ unicodeslot=0x3321, }, [0x3322]={ - adobename="sentisquare", category="so", cjkwd="w", description="SQUARE SENTI", @@ -102468,7 +100271,6 @@ characters.data={ unicodeslot=0x3322, }, [0x3323]={ - adobename="sentosquare", category="so", cjkwd="w", description="SQUARE SENTO", @@ -102496,7 +100298,6 @@ characters.data={ unicodeslot=0x3325, }, [0x3326]={ - adobename="dorusquare", category="so", cjkwd="w", description="SQUARE DORU", @@ -102506,7 +100307,6 @@ characters.data={ unicodeslot=0x3326, }, [0x3327]={ - adobename="tonsquare", category="so", cjkwd="w", description="SQUARE TON", @@ -102534,7 +100334,6 @@ characters.data={ unicodeslot=0x3329, }, [0x332A]={ - adobename="haitusquare", category="so", cjkwd="w", description="SQUARE HAITU", @@ -102544,7 +100343,6 @@ characters.data={ unicodeslot=0x332A, }, [0x332B]={ - adobename="paasentosquare", category="so", cjkwd="w", description="SQUARE PAASENTO", @@ -102599,7 +100397,6 @@ characters.data={ unicodeslot=0x3330, }, [0x3331]={ - adobename="birusquare", category="so", cjkwd="w", description="SQUARE BIRU", @@ -102618,7 +100415,6 @@ characters.data={ unicodeslot=0x3332, }, [0x3333]={ - adobename="huiitosquare", category="so", cjkwd="w", description="SQUARE HUIITO", @@ -102646,7 +100442,6 @@ characters.data={ unicodeslot=0x3335, }, [0x3336]={ - adobename="hekutaarusquare", category="so", cjkwd="w", description="SQUARE HEKUTAARU", @@ -102674,7 +100469,6 @@ characters.data={ unicodeslot=0x3338, }, [0x3339]={ - adobename="herutusquare", category="so", cjkwd="w", description="SQUARE HERUTU", @@ -102693,7 +100487,6 @@ characters.data={ unicodeslot=0x333A, }, [0x333B]={ - adobename="peezisquare", category="so", cjkwd="w", description="SQUARE PEEZI", @@ -102757,7 +100550,6 @@ characters.data={ unicodeslot=0x3341, }, [0x3342]={ - adobename="hoonsquare", category="so", cjkwd="w", description="SQUARE HOON", @@ -102803,7 +100595,6 @@ characters.data={ unicodeslot=0x3346, }, [0x3347]={ - adobename="mansyonsquare", category="so", cjkwd="w", description="SQUARE MANSYON", @@ -102822,7 +100613,6 @@ characters.data={ unicodeslot=0x3348, }, [0x3349]={ - adobename="mirisquare", category="so", cjkwd="w", description="SQUARE MIRI", @@ -102832,7 +100622,6 @@ characters.data={ unicodeslot=0x3349, }, [0x334A]={ - adobename="miribaarusquare", category="so", cjkwd="w", description="SQUARE MIRIBAARU", @@ -102860,7 +100649,6 @@ characters.data={ unicodeslot=0x334C, }, [0x334D]={ - adobename="meetorusquare", category="so", cjkwd="w", description="SQUARE MEETORU", @@ -102870,7 +100658,6 @@ characters.data={ unicodeslot=0x334D, }, [0x334E]={ - adobename="yaadosquare", category="so", cjkwd="w", description="SQUARE YAADO", @@ -102898,7 +100685,6 @@ characters.data={ unicodeslot=0x3350, }, [0x3351]={ - adobename="rittorusquare", category="so", cjkwd="w", description="SQUARE RITTORU", @@ -102953,7 +100739,6 @@ characters.data={ unicodeslot=0x3356, }, [0x3357]={ - adobename="wattosquare", category="so", cjkwd="w", description="SQUARE WATTO", @@ -103278,7 +101063,6 @@ characters.data={ unicodeslot=0x337A, }, [0x337B]={ - adobename="heiseierasquare", category="so", cjkwd="w", description="SQUARE ERA NAME HEISEI", @@ -103288,7 +101072,6 @@ characters.data={ unicodeslot=0x337B, }, [0x337C]={ - adobename="syouwaerasquare", category="so", cjkwd="w", description="SQUARE ERA NAME SYOUWA", @@ -103298,7 +101081,6 @@ characters.data={ unicodeslot=0x337C, }, [0x337D]={ - adobename="taisyouerasquare", category="so", cjkwd="w", description="SQUARE ERA NAME TAISYOU", @@ -103308,7 +101090,6 @@ characters.data={ unicodeslot=0x337D, }, [0x337E]={ - adobename="meizierasquare", category="so", cjkwd="w", description="SQUARE ERA NAME MEIZI", @@ -103318,7 +101099,6 @@ characters.data={ unicodeslot=0x337E, }, [0x337F]={ - adobename="corporationsquare", category="so", cjkwd="w", description="SQUARE CORPORATION", @@ -103329,7 +101109,6 @@ characters.data={ unicodeslot=0x337F, }, [0x3380]={ - adobename="paampssquare", category="so", cjkwd="w", description="SQUARE PA AMPS", @@ -103339,7 +101118,6 @@ characters.data={ unicodeslot=0x3380, }, [0x3381]={ - adobename="nasquare", category="so", cjkwd="w", description="SQUARE NA", @@ -103349,7 +101127,6 @@ characters.data={ unicodeslot=0x3381, }, [0x3382]={ - adobename="muasquare", category="so", cjkwd="w", description="SQUARE MU A", @@ -103359,7 +101136,6 @@ characters.data={ unicodeslot=0x3382, }, [0x3383]={ - adobename="masquare", category="so", cjkwd="w", description="SQUARE MA", @@ -103369,7 +101145,6 @@ characters.data={ unicodeslot=0x3383, }, [0x3384]={ - adobename="kasquare", category="so", cjkwd="w", description="SQUARE KA", @@ -103379,7 +101154,6 @@ characters.data={ unicodeslot=0x3384, }, [0x3385]={ - adobename="KBsquare", category="so", cjkwd="w", description="SQUARE KB", @@ -103389,7 +101163,6 @@ characters.data={ unicodeslot=0x3385, }, [0x3386]={ - adobename="MBsquare", category="so", cjkwd="w", description="SQUARE MB", @@ -103399,7 +101172,6 @@ characters.data={ unicodeslot=0x3386, }, [0x3387]={ - adobename="GBsquare", category="so", cjkwd="w", description="SQUARE GB", @@ -103409,7 +101181,6 @@ characters.data={ unicodeslot=0x3387, }, [0x3388]={ - adobename="calsquare", category="so", cjkwd="w", description="SQUARE CAL", @@ -103419,7 +101190,6 @@ characters.data={ unicodeslot=0x3388, }, [0x3389]={ - adobename="kcalsquare", category="so", cjkwd="w", description="SQUARE KCAL", @@ -103429,7 +101199,6 @@ characters.data={ unicodeslot=0x3389, }, [0x338A]={ - adobename="pfsquare", category="so", cjkwd="w", description="SQUARE PF", @@ -103439,7 +101208,6 @@ characters.data={ unicodeslot=0x338A, }, [0x338B]={ - adobename="nfsquare", category="so", cjkwd="w", description="SQUARE NF", @@ -103449,7 +101217,6 @@ characters.data={ unicodeslot=0x338B, }, [0x338C]={ - adobename="mufsquare", category="so", cjkwd="w", description="SQUARE MU F", @@ -103459,7 +101226,6 @@ characters.data={ unicodeslot=0x338C, }, [0x338D]={ - adobename="mugsquare", category="so", cjkwd="w", description="SQUARE MU G", @@ -103469,7 +101235,6 @@ characters.data={ unicodeslot=0x338D, }, [0x338E]={ - adobename="squaremg", category="so", cjkwd="w", description="SQUARE MG", @@ -103479,7 +101244,6 @@ characters.data={ unicodeslot=0x338E, }, [0x338F]={ - adobename="squarekg", category="so", cjkwd="w", description="SQUARE KG", @@ -103489,7 +101253,6 @@ characters.data={ unicodeslot=0x338F, }, [0x3390]={ - adobename="Hzsquare", category="so", cjkwd="w", description="SQUARE HZ", @@ -103499,7 +101262,6 @@ characters.data={ unicodeslot=0x3390, }, [0x3391]={ - adobename="khzsquare", category="so", cjkwd="w", description="SQUARE KHZ", @@ -103509,7 +101271,6 @@ characters.data={ unicodeslot=0x3391, }, [0x3392]={ - adobename="mhzsquare", category="so", cjkwd="w", description="SQUARE MHZ", @@ -103519,7 +101280,6 @@ characters.data={ unicodeslot=0x3392, }, [0x3393]={ - adobename="ghzsquare", category="so", cjkwd="w", description="SQUARE GHZ", @@ -103529,7 +101289,6 @@ characters.data={ unicodeslot=0x3393, }, [0x3394]={ - adobename="thzsquare", category="so", cjkwd="w", description="SQUARE THZ", @@ -103539,7 +101298,6 @@ characters.data={ unicodeslot=0x3394, }, [0x3395]={ - adobename="mulsquare", category="so", cjkwd="w", description="SQUARE MU L", @@ -103549,7 +101307,6 @@ characters.data={ unicodeslot=0x3395, }, [0x3396]={ - adobename="mlsquare", category="so", cjkwd="w", description="SQUARE ML", @@ -103559,7 +101316,6 @@ characters.data={ unicodeslot=0x3396, }, [0x3397]={ - adobename="dlsquare", category="so", cjkwd="w", description="SQUARE DL", @@ -103569,7 +101325,6 @@ characters.data={ unicodeslot=0x3397, }, [0x3398]={ - adobename="klsquare", category="so", cjkwd="w", description="SQUARE KL", @@ -103579,7 +101334,6 @@ characters.data={ unicodeslot=0x3398, }, [0x3399]={ - adobename="fmsquare", category="so", cjkwd="w", description="SQUARE FM", @@ -103589,7 +101343,6 @@ characters.data={ unicodeslot=0x3399, }, [0x339A]={ - adobename="nmsquare", category="so", cjkwd="w", description="SQUARE NM", @@ -103599,7 +101352,6 @@ characters.data={ unicodeslot=0x339A, }, [0x339B]={ - adobename="mumsquare", category="so", cjkwd="w", description="SQUARE MU M", @@ -103609,7 +101361,6 @@ characters.data={ unicodeslot=0x339B, }, [0x339C]={ - adobename="squaremm", category="so", cjkwd="w", description="SQUARE MM", @@ -103619,7 +101370,6 @@ characters.data={ unicodeslot=0x339C, }, [0x339D]={ - adobename="squarecm", category="so", cjkwd="w", description="SQUARE CM", @@ -103629,7 +101379,6 @@ characters.data={ unicodeslot=0x339D, }, [0x339E]={ - adobename="squarekm", category="so", cjkwd="w", description="SQUARE KM", @@ -103639,7 +101388,6 @@ characters.data={ unicodeslot=0x339E, }, [0x339F]={ - adobename="mmsquaredsquare", category="so", cjkwd="w", description="SQUARE MM SQUARED", @@ -103649,7 +101397,6 @@ characters.data={ unicodeslot=0x339F, }, [0x33A0]={ - adobename="cmsquaredsquare", category="so", cjkwd="w", description="SQUARE CM SQUARED", @@ -103659,7 +101406,6 @@ characters.data={ unicodeslot=0x33A0, }, [0x33A1]={ - adobename="squaremsquared", category="so", cjkwd="w", description="SQUARE M SQUARED", @@ -103669,7 +101415,6 @@ characters.data={ unicodeslot=0x33A1, }, [0x33A2]={ - adobename="kmsquaredsquare", category="so", cjkwd="w", description="SQUARE KM SQUARED", @@ -103679,7 +101424,6 @@ characters.data={ unicodeslot=0x33A2, }, [0x33A3]={ - adobename="mmcubedsquare", category="so", cjkwd="w", description="SQUARE MM CUBED", @@ -103689,7 +101433,6 @@ characters.data={ unicodeslot=0x33A3, }, [0x33A4]={ - adobename="cmcubedsquare", category="so", cjkwd="w", description="SQUARE CM CUBED", @@ -103699,7 +101442,6 @@ characters.data={ unicodeslot=0x33A4, }, [0x33A5]={ - adobename="mcubedsquare", category="so", cjkwd="w", description="SQUARE M CUBED", @@ -103709,7 +101451,6 @@ characters.data={ unicodeslot=0x33A5, }, [0x33A6]={ - adobename="kmcubedsquare", category="so", cjkwd="w", description="SQUARE KM CUBED", @@ -103719,7 +101460,6 @@ characters.data={ unicodeslot=0x33A6, }, [0x33A7]={ - adobename="moverssquare", category="so", cjkwd="w", description="SQUARE M OVER S", @@ -103729,7 +101469,6 @@ characters.data={ unicodeslot=0x33A7, }, [0x33A8]={ - adobename="moverssquaredsquare", category="so", cjkwd="w", description="SQUARE M OVER S SQUARED", @@ -103739,7 +101478,6 @@ characters.data={ unicodeslot=0x33A8, }, [0x33A9]={ - adobename="pasquare", category="so", cjkwd="w", description="SQUARE PA", @@ -103749,7 +101487,6 @@ characters.data={ unicodeslot=0x33A9, }, [0x33AA]={ - adobename="kpasquare", category="so", cjkwd="w", description="SQUARE KPA", @@ -103759,7 +101496,6 @@ characters.data={ unicodeslot=0x33AA, }, [0x33AB]={ - adobename="mpasquare", category="so", cjkwd="w", description="SQUARE MPA", @@ -103769,7 +101505,6 @@ characters.data={ unicodeslot=0x33AB, }, [0x33AC]={ - adobename="gpasquare", category="so", cjkwd="w", description="SQUARE GPA", @@ -103779,7 +101514,6 @@ characters.data={ unicodeslot=0x33AC, }, [0x33AD]={ - adobename="radsquare", category="so", cjkwd="w", description="SQUARE RAD", @@ -103789,7 +101523,6 @@ characters.data={ unicodeslot=0x33AD, }, [0x33AE]={ - adobename="radoverssquare", category="so", cjkwd="w", description="SQUARE RAD OVER S", @@ -103799,7 +101532,6 @@ characters.data={ unicodeslot=0x33AE, }, [0x33AF]={ - adobename="radoverssquaredsquare", category="so", cjkwd="w", description="SQUARE RAD OVER S SQUARED", @@ -103809,7 +101541,6 @@ characters.data={ unicodeslot=0x33AF, }, [0x33B0]={ - adobename="pssquare", category="so", cjkwd="w", description="SQUARE PS", @@ -103819,7 +101550,6 @@ characters.data={ unicodeslot=0x33B0, }, [0x33B1]={ - adobename="nssquare", category="so", cjkwd="w", description="SQUARE NS", @@ -103829,7 +101559,6 @@ characters.data={ unicodeslot=0x33B1, }, [0x33B2]={ - adobename="mussquare", category="so", cjkwd="w", description="SQUARE MU S", @@ -103839,7 +101568,6 @@ characters.data={ unicodeslot=0x33B2, }, [0x33B3]={ - adobename="mssquare", category="so", cjkwd="w", description="SQUARE MS", @@ -103849,7 +101577,6 @@ characters.data={ unicodeslot=0x33B3, }, [0x33B4]={ - adobename="pvsquare", category="so", cjkwd="w", description="SQUARE PV", @@ -103859,7 +101586,6 @@ characters.data={ unicodeslot=0x33B4, }, [0x33B5]={ - adobename="nvsquare", category="so", cjkwd="w", description="SQUARE NV", @@ -103869,7 +101595,6 @@ characters.data={ unicodeslot=0x33B5, }, [0x33B6]={ - adobename="muvsquare", category="so", cjkwd="w", description="SQUARE MU V", @@ -103879,7 +101604,6 @@ characters.data={ unicodeslot=0x33B6, }, [0x33B7]={ - adobename="mvsquare", category="so", cjkwd="w", description="SQUARE MV", @@ -103889,7 +101613,6 @@ characters.data={ unicodeslot=0x33B7, }, [0x33B8]={ - adobename="kvsquare", category="so", cjkwd="w", description="SQUARE KV", @@ -103899,7 +101622,6 @@ characters.data={ unicodeslot=0x33B8, }, [0x33B9]={ - adobename="mvmegasquare", category="so", cjkwd="w", description="SQUARE MV MEGA", @@ -103909,7 +101631,6 @@ characters.data={ unicodeslot=0x33B9, }, [0x33BA]={ - adobename="pwsquare", category="so", cjkwd="w", description="SQUARE PW", @@ -103919,7 +101640,6 @@ characters.data={ unicodeslot=0x33BA, }, [0x33BB]={ - adobename="nwsquare", category="so", cjkwd="w", description="SQUARE NW", @@ -103929,7 +101649,6 @@ characters.data={ unicodeslot=0x33BB, }, [0x33BC]={ - adobename="muwsquare", category="so", cjkwd="w", description="SQUARE MU W", @@ -103939,7 +101658,6 @@ characters.data={ unicodeslot=0x33BC, }, [0x33BD]={ - adobename="mwsquare", category="so", cjkwd="w", description="SQUARE MW", @@ -103949,7 +101667,6 @@ characters.data={ unicodeslot=0x33BD, }, [0x33BE]={ - adobename="kwsquare", category="so", cjkwd="w", description="SQUARE KW", @@ -103959,7 +101676,6 @@ characters.data={ unicodeslot=0x33BE, }, [0x33BF]={ - adobename="mwmegasquare", category="so", cjkwd="w", description="SQUARE MW MEGA", @@ -103969,7 +101685,6 @@ characters.data={ unicodeslot=0x33BF, }, [0x33C0]={ - adobename="kohmsquare", category="so", cjkwd="w", description="SQUARE K OHM", @@ -103979,7 +101694,6 @@ characters.data={ unicodeslot=0x33C0, }, [0x33C1]={ - adobename="mohmsquare", category="so", cjkwd="w", description="SQUARE M OHM", @@ -103989,7 +101703,6 @@ characters.data={ unicodeslot=0x33C1, }, [0x33C2]={ - adobename="amsquare", category="so", cjkwd="w", description="SQUARE AM", @@ -103999,7 +101712,6 @@ characters.data={ unicodeslot=0x33C2, }, [0x33C3]={ - adobename="bqsquare", category="so", cjkwd="w", description="SQUARE BQ", @@ -104009,7 +101721,6 @@ characters.data={ unicodeslot=0x33C3, }, [0x33C4]={ - adobename="squarecc", category="so", cjkwd="w", description="SQUARE CC", @@ -104019,7 +101730,6 @@ characters.data={ unicodeslot=0x33C4, }, [0x33C5]={ - adobename="cdsquare", category="so", cjkwd="w", description="SQUARE CD", @@ -104029,7 +101739,6 @@ characters.data={ unicodeslot=0x33C5, }, [0x33C6]={ - adobename="coverkgsquare", category="so", cjkwd="w", description="SQUARE C OVER KG", @@ -104039,7 +101748,6 @@ characters.data={ unicodeslot=0x33C6, }, [0x33C7]={ - adobename="cosquare", category="so", cjkwd="w", description="SQUARE CO", @@ -104049,7 +101757,6 @@ characters.data={ unicodeslot=0x33C7, }, [0x33C8]={ - adobename="dbsquare", category="so", cjkwd="w", description="SQUARE DB", @@ -104059,7 +101766,6 @@ characters.data={ unicodeslot=0x33C8, }, [0x33C9]={ - adobename="gysquare", category="so", cjkwd="w", description="SQUARE GY", @@ -104069,7 +101775,6 @@ characters.data={ unicodeslot=0x33C9, }, [0x33CA]={ - adobename="hasquare", category="so", cjkwd="w", description="SQUARE HA", @@ -104079,7 +101784,6 @@ characters.data={ unicodeslot=0x33CA, }, [0x33CB]={ - adobename="HPsquare", category="so", cjkwd="w", description="SQUARE HP", @@ -104098,7 +101802,6 @@ characters.data={ unicodeslot=0x33CC, }, [0x33CD]={ - adobename="KKsquare", category="so", cjkwd="w", description="SQUARE KK", @@ -104108,7 +101811,6 @@ characters.data={ unicodeslot=0x33CD, }, [0x33CE]={ - adobename="squarekmcapital", category="so", cjkwd="w", description="SQUARE KM CAPITAL", @@ -104118,7 +101820,6 @@ characters.data={ unicodeslot=0x33CE, }, [0x33CF]={ - adobename="ktsquare", category="so", cjkwd="w", description="SQUARE KT", @@ -104128,7 +101829,6 @@ characters.data={ unicodeslot=0x33CF, }, [0x33D0]={ - adobename="lmsquare", category="so", cjkwd="w", description="SQUARE LM", @@ -104138,7 +101838,6 @@ characters.data={ unicodeslot=0x33D0, }, [0x33D1]={ - adobename="squareln", category="so", cjkwd="w", description="SQUARE LN", @@ -104148,7 +101847,6 @@ characters.data={ unicodeslot=0x33D1, }, [0x33D2]={ - adobename="squarelog", category="so", cjkwd="w", description="SQUARE LOG", @@ -104158,7 +101856,6 @@ characters.data={ unicodeslot=0x33D2, }, [0x33D3]={ - adobename="lxsquare", category="so", cjkwd="w", description="SQUARE LX", @@ -104168,7 +101865,6 @@ characters.data={ unicodeslot=0x33D3, }, [0x33D4]={ - adobename="mbsquare", category="so", cjkwd="w", description="SQUARE MB SMALL", @@ -104178,7 +101874,6 @@ characters.data={ unicodeslot=0x33D4, }, [0x33D5]={ - adobename="squaremil", category="so", cjkwd="w", description="SQUARE MIL", @@ -104188,7 +101883,6 @@ characters.data={ unicodeslot=0x33D5, }, [0x33D6]={ - adobename="molsquare", category="so", cjkwd="w", description="SQUARE MOL", @@ -104207,7 +101901,6 @@ characters.data={ unicodeslot=0x33D7, }, [0x33D8]={ - adobename="pmsquare", category="so", cjkwd="w", description="SQUARE PM", @@ -104235,7 +101928,6 @@ characters.data={ unicodeslot=0x33DA, }, [0x33DB]={ - adobename="srsquare", category="so", cjkwd="w", description="SQUARE SR", @@ -104245,7 +101937,6 @@ characters.data={ unicodeslot=0x33DB, }, [0x33DC]={ - adobename="svsquare", category="so", cjkwd="w", description="SQUARE SV", @@ -104255,7 +101946,6 @@ characters.data={ unicodeslot=0x33DC, }, [0x33DD]={ - adobename="wbsquare", category="so", cjkwd="w", description="SQUARE WB", @@ -122802,329 +120492,329 @@ characters.data={ category="lo", description="JAVANESE LETTER A", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA984, }, [0xA985]={ category="lo", description="JAVANESE LETTER I KAWI", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA985, }, [0xA986]={ category="lo", description="JAVANESE LETTER I", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA986, }, [0xA987]={ category="lo", description="JAVANESE LETTER II", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA987, }, [0xA988]={ category="lo", description="JAVANESE LETTER U", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA988, }, [0xA989]={ category="lo", description="JAVANESE LETTER PA CEREK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA989, }, [0xA98A]={ category="lo", description="JAVANESE LETTER NGA LELET", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA98A, }, [0xA98B]={ category="lo", description="JAVANESE LETTER NGA LELET RASWADI", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA98B, }, [0xA98C]={ category="lo", description="JAVANESE LETTER E", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA98C, }, [0xA98D]={ category="lo", description="JAVANESE LETTER AI", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA98D, }, [0xA98E]={ category="lo", description="JAVANESE LETTER O", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA98E, }, [0xA98F]={ category="lo", description="JAVANESE LETTER KA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA98F, }, [0xA990]={ category="lo", description="JAVANESE LETTER KA SASAK", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA990, }, [0xA991]={ category="lo", description="JAVANESE LETTER KA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA991, }, [0xA992]={ category="lo", description="JAVANESE LETTER GA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA992, }, [0xA993]={ category="lo", description="JAVANESE LETTER GA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA993, }, [0xA994]={ category="lo", description="JAVANESE LETTER NGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA994, }, [0xA995]={ category="lo", description="JAVANESE LETTER CA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA995, }, [0xA996]={ category="lo", description="JAVANESE LETTER CA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA996, }, [0xA997]={ category="lo", description="JAVANESE LETTER JA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA997, }, [0xA998]={ category="lo", description="JAVANESE LETTER NYA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA998, }, [0xA999]={ category="lo", description="JAVANESE LETTER JA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA999, }, [0xA99A]={ category="lo", description="JAVANESE LETTER NYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA99A, }, [0xA99B]={ category="lo", description="JAVANESE LETTER TTA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA99B, }, [0xA99C]={ category="lo", description="JAVANESE LETTER TTA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA99C, }, [0xA99D]={ category="lo", description="JAVANESE LETTER DDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA99D, }, [0xA99E]={ category="lo", description="JAVANESE LETTER DDA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA99E, }, [0xA99F]={ category="lo", description="JAVANESE LETTER NA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA99F, }, [0xA9A0]={ category="lo", description="JAVANESE LETTER TA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A0, }, [0xA9A1]={ category="lo", description="JAVANESE LETTER TA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A1, }, [0xA9A2]={ category="lo", description="JAVANESE LETTER DA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A2, }, [0xA9A3]={ category="lo", description="JAVANESE LETTER DA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A3, }, [0xA9A4]={ category="lo", description="JAVANESE LETTER NA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A4, }, [0xA9A5]={ category="lo", description="JAVANESE LETTER PA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A5, }, [0xA9A6]={ category="lo", description="JAVANESE LETTER PA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A6, }, [0xA9A7]={ category="lo", description="JAVANESE LETTER BA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A7, }, [0xA9A8]={ category="lo", description="JAVANESE LETTER BA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A8, }, [0xA9A9]={ category="lo", description="JAVANESE LETTER MA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9A9, }, [0xA9AA]={ category="lo", description="JAVANESE LETTER YA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9AA, }, [0xA9AB]={ category="lo", description="JAVANESE LETTER RA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9AB, }, [0xA9AC]={ category="lo", description="JAVANESE LETTER RA AGUNG", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9AC, }, [0xA9AD]={ category="lo", description="JAVANESE LETTER LA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9AD, }, [0xA9AE]={ category="lo", description="JAVANESE LETTER WA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9AE, }, [0xA9AF]={ category="lo", description="JAVANESE LETTER SA MURDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9AF, }, [0xA9B0]={ category="lo", description="JAVANESE LETTER SA MAHAPRANA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9B0, }, [0xA9B1]={ category="lo", description="JAVANESE LETTER SA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9B1, }, [0xA9B2]={ category="lo", description="JAVANESE LETTER HA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0xA9B2, }, [0xA9B3]={ @@ -123224,49 +120914,49 @@ characters.data={ combining=0x9, description="JAVANESE PANGKON", direction="l", - linebreak="cm", + linebreak="vi", unicodeslot=0xA9C0, }, [0xA9C1]={ category="po", description="JAVANESE LEFT RERENGGAN", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9C1, }, [0xA9C2]={ category="po", description="JAVANESE RIGHT RERENGGAN", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9C2, }, [0xA9C3]={ category="po", description="JAVANESE PADA ANDAP", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9C3, }, [0xA9C4]={ category="po", description="JAVANESE PADA MADYA", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9C4, }, [0xA9C5]={ category="po", description="JAVANESE PADA LUHUR", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9C5, }, [0xA9C6]={ category="po", description="JAVANESE PADA WINDU", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9C6, }, [0xA9C7]={ @@ -123294,119 +120984,119 @@ characters.data={ category="po", description="JAVANESE PADA ADEG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9CA, }, [0xA9CB]={ category="po", description="JAVANESE PADA ADEG ADEG", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9CB, }, [0xA9CC]={ category="po", description="JAVANESE PADA PISELEH", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9CC, }, [0xA9CD]={ category="po", description="JAVANESE TURNED PADA PISELEH", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9CD, }, [0xA9CF]={ category="lm", description="JAVANESE PANGRANGKEP", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xA9CF, }, [0xA9D0]={ category="nd", description="JAVANESE DIGIT ZERO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D0, }, [0xA9D1]={ category="nd", description="JAVANESE DIGIT ONE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D1, }, [0xA9D2]={ category="nd", description="JAVANESE DIGIT TWO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D2, }, [0xA9D3]={ category="nd", description="JAVANESE DIGIT THREE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D3, }, [0xA9D4]={ category="nd", description="JAVANESE DIGIT FOUR", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D4, }, [0xA9D5]={ category="nd", description="JAVANESE DIGIT FIVE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D5, }, [0xA9D6]={ category="nd", description="JAVANESE DIGIT SIX", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D6, }, [0xA9D7]={ category="nd", description="JAVANESE DIGIT SEVEN", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D7, }, [0xA9D8]={ category="nd", description="JAVANESE DIGIT EIGHT", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D8, }, [0xA9D9]={ category="nd", description="JAVANESE DIGIT NINE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xA9D9, }, [0xA9DE]={ category="po", description="JAVANESE PADA TIRTA TUMETES", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9DE, }, [0xA9DF]={ category="po", description="JAVANESE PADA ISEN-ISEN", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xA9DF, }, [0xA9E0]={ @@ -123662,287 +121352,287 @@ characters.data={ category="lo", description="CHAM LETTER A", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA00, }, [0xAA01]={ category="lo", description="CHAM LETTER I", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA01, }, [0xAA02]={ category="lo", description="CHAM LETTER U", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA02, }, [0xAA03]={ category="lo", description="CHAM LETTER E", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA03, }, [0xAA04]={ category="lo", description="CHAM LETTER AI", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA04, }, [0xAA05]={ category="lo", description="CHAM LETTER O", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA05, }, [0xAA06]={ category="lo", description="CHAM LETTER KA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA06, }, [0xAA07]={ category="lo", description="CHAM LETTER KHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA07, }, [0xAA08]={ category="lo", description="CHAM LETTER GA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA08, }, [0xAA09]={ category="lo", description="CHAM LETTER GHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA09, }, [0xAA0A]={ category="lo", description="CHAM LETTER NGUE", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA0A, }, [0xAA0B]={ category="lo", description="CHAM LETTER NGA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA0B, }, [0xAA0C]={ category="lo", description="CHAM LETTER CHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA0C, }, [0xAA0D]={ category="lo", description="CHAM LETTER CHHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA0D, }, [0xAA0E]={ category="lo", description="CHAM LETTER JA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA0E, }, [0xAA0F]={ category="lo", description="CHAM LETTER JHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA0F, }, [0xAA10]={ category="lo", description="CHAM LETTER NHUE", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA10, }, [0xAA11]={ category="lo", description="CHAM LETTER NHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA11, }, [0xAA12]={ category="lo", description="CHAM LETTER NHJA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA12, }, [0xAA13]={ category="lo", description="CHAM LETTER TA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA13, }, [0xAA14]={ category="lo", description="CHAM LETTER THA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA14, }, [0xAA15]={ category="lo", description="CHAM LETTER DA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA15, }, [0xAA16]={ category="lo", description="CHAM LETTER DHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA16, }, [0xAA17]={ category="lo", description="CHAM LETTER NUE", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA17, }, [0xAA18]={ category="lo", description="CHAM LETTER NA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA18, }, [0xAA19]={ category="lo", description="CHAM LETTER DDA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA19, }, [0xAA1A]={ category="lo", description="CHAM LETTER PA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA1A, }, [0xAA1B]={ category="lo", description="CHAM LETTER PPA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA1B, }, [0xAA1C]={ category="lo", description="CHAM LETTER PHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA1C, }, [0xAA1D]={ category="lo", description="CHAM LETTER BA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA1D, }, [0xAA1E]={ category="lo", description="CHAM LETTER BHA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA1E, }, [0xAA1F]={ category="lo", description="CHAM LETTER MUE", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA1F, }, [0xAA20]={ category="lo", description="CHAM LETTER MA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA20, }, [0xAA21]={ category="lo", description="CHAM LETTER BBA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA21, }, [0xAA22]={ category="lo", description="CHAM LETTER YA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA22, }, [0xAA23]={ category="lo", description="CHAM LETTER RA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA23, }, [0xAA24]={ category="lo", description="CHAM LETTER LA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA24, }, [0xAA25]={ category="lo", description="CHAM LETTER VA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA25, }, [0xAA26]={ category="lo", description="CHAM LETTER SSA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA26, }, [0xAA27]={ category="lo", description="CHAM LETTER SA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA27, }, [0xAA28]={ category="lo", description="CHAM LETTER HA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0xAA28, }, [0xAA29]={ @@ -124047,21 +121737,21 @@ characters.data={ category="lo", description="CHAM LETTER FINAL K", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA40, }, [0xAA41]={ category="lo", description="CHAM LETTER FINAL G", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA41, }, [0xAA42]={ category="lo", description="CHAM LETTER FINAL NG", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA42, }, [0xAA43]={ @@ -124075,56 +121765,56 @@ characters.data={ category="lo", description="CHAM LETTER FINAL CH", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA44, }, [0xAA45]={ category="lo", description="CHAM LETTER FINAL T", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA45, }, [0xAA46]={ category="lo", description="CHAM LETTER FINAL N", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA46, }, [0xAA47]={ category="lo", description="CHAM LETTER FINAL P", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA47, }, [0xAA48]={ category="lo", description="CHAM LETTER FINAL Y", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA48, }, [0xAA49]={ category="lo", description="CHAM LETTER FINAL R", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA49, }, [0xAA4A]={ category="lo", description="CHAM LETTER FINAL L", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA4A, }, [0xAA4B]={ category="lo", description="CHAM LETTER FINAL SS", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0xAA4B, }, [0xAA4C]={ @@ -124145,77 +121835,77 @@ characters.data={ category="nd", description="CHAM DIGIT ZERO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA50, }, [0xAA51]={ category="nd", description="CHAM DIGIT ONE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA51, }, [0xAA52]={ category="nd", description="CHAM DIGIT TWO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA52, }, [0xAA53]={ category="nd", description="CHAM DIGIT THREE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA53, }, [0xAA54]={ category="nd", description="CHAM DIGIT FOUR", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA54, }, [0xAA55]={ category="nd", description="CHAM DIGIT FIVE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA55, }, [0xAA56]={ category="nd", description="CHAM DIGIT SIX", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA56, }, [0xAA57]={ category="nd", description="CHAM DIGIT SEVEN", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA57, }, [0xAA58]={ category="nd", description="CHAM DIGIT EIGHT", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA58, }, [0xAA59]={ category="nd", description="CHAM DIGIT NINE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0xAA59, }, [0xAA5C]={ category="po", description="CHAM PUNCTUATION SPIRAL", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0xAA5C, }, [0xAA5D]={ @@ -127425,7 +125115,6 @@ characters.data={ unicodeslot=0xE000, }, [0xF8FF]={ - adobename="apple", category="co", cjkwd="a", description="", @@ -131669,7 +129358,6 @@ characters.data={ unicodeslot=0xFAD9, }, [0xFB00]={ - adobename="ff", category="ll", contextname="ffligature", description="LATIN SMALL LIGATURE FF", @@ -131680,7 +129368,6 @@ characters.data={ unicodeslot=0xFB00, }, [0xFB01]={ - adobename="fi", category="ll", contextname="filigature", description="LATIN SMALL LIGATURE FI", @@ -131692,7 +129379,6 @@ characters.data={ unicodeslot=0xFB01, }, [0xFB02]={ - adobename="fl", category="ll", contextname="flligature", description="LATIN SMALL LIGATURE FL", @@ -131704,7 +129390,6 @@ characters.data={ unicodeslot=0xFB02, }, [0xFB03]={ - adobename="ffi", category="ll", contextname="ffiligature", description="LATIN SMALL LIGATURE FFI", @@ -131716,7 +129401,6 @@ characters.data={ unicodeslot=0xFB03, }, [0xFB04]={ - adobename="ffl", category="ll", contextname="fflligature", description="LATIN SMALL LIGATURE FFL", @@ -131733,7 +129417,7 @@ characters.data={ direction="l", linebreak="al", specials={ "compat", 0x17F, 0x74 }, - uccode={ 0x73, 0x74 }, + uccode=0xFB06, unicodeslot=0xFB05, }, [0xFB06]={ @@ -131810,7 +129494,6 @@ characters.data={ unicodeslot=0xFB1E, }, [0xFB1F]={ - adobename="yodyodpatahhebrew", category="lo", description="HEBREW LIGATURE YIDDISH YOD YOD PATAH", direction="r", @@ -131819,7 +129502,6 @@ characters.data={ unicodeslot=0xFB1F, }, [0xFB20]={ - adobename="ayinaltonehebrew", category="lo", description="HEBREW LETTER ALTERNATIVE AYIN", direction="r", @@ -131900,7 +129582,6 @@ characters.data={ unicodeslot=0xFB29, }, [0xFB2A]={ - adobename="shinshindothebrew", category="lo", description="HEBREW LETTER SHIN WITH SHIN DOT", direction="r", @@ -131910,7 +129591,6 @@ characters.data={ unicodeslot=0xFB2A, }, [0xFB2B]={ - adobename="shinsindothebrew", category="lo", description="HEBREW LETTER SHIN WITH SIN DOT", direction="r", @@ -131920,7 +129600,6 @@ characters.data={ unicodeslot=0xFB2B, }, [0xFB2C]={ - adobename="shindageshshindothebrew", category="lo", description="HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT", direction="r", @@ -131930,7 +129609,6 @@ characters.data={ unicodeslot=0xFB2C, }, [0xFB2D]={ - adobename="shindageshsindothebrew", category="lo", description="HEBREW LETTER SHIN WITH DAGESH AND SIN DOT", direction="r", @@ -131940,7 +129618,6 @@ characters.data={ unicodeslot=0xFB2D, }, [0xFB2E]={ - adobename="alefpatahhebrew", category="lo", description="HEBREW LETTER ALEF WITH PATAH", direction="r", @@ -131950,7 +129627,6 @@ characters.data={ unicodeslot=0xFB2E, }, [0xFB2F]={ - adobename="alefqamatshebrew", category="lo", description="HEBREW LETTER ALEF WITH QAMATS", direction="r", @@ -131960,7 +129636,6 @@ characters.data={ unicodeslot=0xFB2F, }, [0xFB30]={ - adobename="alefdageshhebrew", category="lo", description="HEBREW LETTER ALEF WITH MAPIQ", direction="r", @@ -131970,7 +129645,6 @@ characters.data={ unicodeslot=0xFB30, }, [0xFB31]={ - adobename="betdageshhebrew", category="lo", description="HEBREW LETTER BET WITH DAGESH", direction="r", @@ -131980,7 +129654,6 @@ characters.data={ unicodeslot=0xFB31, }, [0xFB32]={ - adobename="gimeldageshhebrew", category="lo", description="HEBREW LETTER GIMEL WITH DAGESH", direction="r", @@ -131990,7 +129663,6 @@ characters.data={ unicodeslot=0xFB32, }, [0xFB33]={ - adobename="daletdageshhebrew", category="lo", description="HEBREW LETTER DALET WITH DAGESH", direction="r", @@ -132000,7 +129672,6 @@ characters.data={ unicodeslot=0xFB33, }, [0xFB34]={ - adobename="hedageshhebrew", category="lo", description="HEBREW LETTER HE WITH MAPIQ", direction="r", @@ -132010,7 +129681,6 @@ characters.data={ unicodeslot=0xFB34, }, [0xFB35]={ - adobename="vavdageshhebrew", category="lo", description="HEBREW LETTER VAV WITH DAGESH", direction="r", @@ -132020,7 +129690,6 @@ characters.data={ unicodeslot=0xFB35, }, [0xFB36]={ - adobename="zayindageshhebrew", category="lo", description="HEBREW LETTER ZAYIN WITH DAGESH", direction="r", @@ -132030,7 +129699,6 @@ characters.data={ unicodeslot=0xFB36, }, [0xFB38]={ - adobename="tetdageshhebrew", category="lo", description="HEBREW LETTER TET WITH DAGESH", direction="r", @@ -132040,7 +129708,6 @@ characters.data={ unicodeslot=0xFB38, }, [0xFB39]={ - adobename="yoddageshhebrew", category="lo", description="HEBREW LETTER YOD WITH DAGESH", direction="r", @@ -132050,7 +129717,6 @@ characters.data={ unicodeslot=0xFB39, }, [0xFB3A]={ - adobename="finalkafdageshhebrew", category="lo", description="HEBREW LETTER FINAL KAF WITH DAGESH", direction="r", @@ -132059,7 +129725,6 @@ characters.data={ unicodeslot=0xFB3A, }, [0xFB3B]={ - adobename="kafdageshhebrew", category="lo", description="HEBREW LETTER KAF WITH DAGESH", direction="r", @@ -132069,7 +129734,6 @@ characters.data={ unicodeslot=0xFB3B, }, [0xFB3C]={ - adobename="lameddageshhebrew", category="lo", description="HEBREW LETTER LAMED WITH DAGESH", direction="r", @@ -132079,7 +129743,6 @@ characters.data={ unicodeslot=0xFB3C, }, [0xFB3E]={ - adobename="memdageshhebrew", category="lo", description="HEBREW LETTER MEM WITH DAGESH", direction="r", @@ -132089,7 +129752,6 @@ characters.data={ unicodeslot=0xFB3E, }, [0xFB40]={ - adobename="nundageshhebrew", category="lo", description="HEBREW LETTER NUN WITH DAGESH", direction="r", @@ -132099,7 +129761,6 @@ characters.data={ unicodeslot=0xFB40, }, [0xFB41]={ - adobename="samekhdageshhebrew", category="lo", description="HEBREW LETTER SAMEKH WITH DAGESH", direction="r", @@ -132109,7 +129770,6 @@ characters.data={ unicodeslot=0xFB41, }, [0xFB43]={ - adobename="pefinaldageshhebrew", category="lo", description="HEBREW LETTER FINAL PE WITH DAGESH", direction="r", @@ -132118,7 +129778,6 @@ characters.data={ unicodeslot=0xFB43, }, [0xFB44]={ - adobename="pedageshhebrew", category="lo", description="HEBREW LETTER PE WITH DAGESH", direction="r", @@ -132128,7 +129787,6 @@ characters.data={ unicodeslot=0xFB44, }, [0xFB46]={ - adobename="tsadidageshhebrew", category="lo", description="HEBREW LETTER TSADI WITH DAGESH", direction="r", @@ -132138,7 +129796,6 @@ characters.data={ unicodeslot=0xFB46, }, [0xFB47]={ - adobename="qofdageshhebrew", category="lo", description="HEBREW LETTER QOF WITH DAGESH", direction="r", @@ -132148,7 +129805,6 @@ characters.data={ unicodeslot=0xFB47, }, [0xFB48]={ - adobename="reshdageshhebrew", category="lo", description="HEBREW LETTER RESH WITH DAGESH", direction="r", @@ -132158,7 +129814,6 @@ characters.data={ unicodeslot=0xFB48, }, [0xFB49]={ - adobename="shindageshhebrew", category="lo", description="HEBREW LETTER SHIN WITH DAGESH", direction="r", @@ -132168,7 +129823,6 @@ characters.data={ unicodeslot=0xFB49, }, [0xFB4A]={ - adobename="tavdageshhebrew", category="lo", description="HEBREW LETTER TAV WITH DAGESH", direction="r", @@ -132178,7 +129832,6 @@ characters.data={ unicodeslot=0xFB4A, }, [0xFB4B]={ - adobename="vavholamhebrew", category="lo", description="HEBREW LETTER VAV WITH HOLAM", direction="r", @@ -132188,7 +129841,6 @@ characters.data={ unicodeslot=0xFB4B, }, [0xFB4C]={ - adobename="betrafehebrew", category="lo", description="HEBREW LETTER BET WITH RAFE", direction="r", @@ -132198,7 +129850,6 @@ characters.data={ unicodeslot=0xFB4C, }, [0xFB4D]={ - adobename="kafrafehebrew", category="lo", description="HEBREW LETTER KAF WITH RAFE", direction="r", @@ -132208,7 +129859,6 @@ characters.data={ unicodeslot=0xFB4D, }, [0xFB4E]={ - adobename="perafehebrew", category="lo", description="HEBREW LETTER PE WITH RAFE", direction="r", @@ -132218,7 +129868,6 @@ characters.data={ unicodeslot=0xFB4E, }, [0xFB4F]={ - adobename="aleflamedhebrew", category="lo", description="HEBREW LIGATURE ALEF LAMED", direction="r", @@ -132283,7 +129932,6 @@ characters.data={ unicodeslot=0xFB56, }, [0xFB57]={ - adobename="pehfinalarabic", category="lo", description="ARABIC LETTER PEH FINAL FORM", direction="al", @@ -132292,7 +129940,6 @@ characters.data={ unicodeslot=0xFB57, }, [0xFB58]={ - adobename="pehinitialarabic", category="lo", description="ARABIC LETTER PEH INITIAL FORM", direction="al", @@ -132301,7 +129948,6 @@ characters.data={ unicodeslot=0xFB58, }, [0xFB59]={ - adobename="pehmedialarabic", category="lo", description="ARABIC LETTER PEH MEDIAL FORM", direction="al", @@ -132414,7 +130060,6 @@ characters.data={ unicodeslot=0xFB66, }, [0xFB67]={ - adobename="ttehfinalarabic", category="lo", description="ARABIC LETTER TTEH FINAL FORM", direction="al", @@ -132423,7 +130068,6 @@ characters.data={ unicodeslot=0xFB67, }, [0xFB68]={ - adobename="ttehinitialarabic", category="lo", description="ARABIC LETTER TTEH INITIAL FORM", direction="al", @@ -132432,7 +130076,6 @@ characters.data={ unicodeslot=0xFB68, }, [0xFB69]={ - adobename="ttehmedialarabic", category="lo", description="ARABIC LETTER TTEH MEDIAL FORM", direction="al", @@ -132449,7 +130092,6 @@ characters.data={ unicodeslot=0xFB6A, }, [0xFB6B]={ - adobename="vehfinalarabic", category="lo", description="ARABIC LETTER VEH FINAL FORM", direction="al", @@ -132458,7 +130100,6 @@ characters.data={ unicodeslot=0xFB6B, }, [0xFB6C]={ - adobename="vehinitialarabic", category="lo", description="ARABIC LETTER VEH INITIAL FORM", direction="al", @@ -132467,7 +130108,6 @@ characters.data={ unicodeslot=0xFB6C, }, [0xFB6D]={ - adobename="vehmedialarabic", category="lo", description="ARABIC LETTER VEH MEDIAL FORM", direction="al", @@ -132580,7 +130220,6 @@ characters.data={ unicodeslot=0xFB7A, }, [0xFB7B]={ - adobename="tchehfinalarabic", category="lo", description="ARABIC LETTER TCHEH FINAL FORM", direction="al", @@ -132589,7 +130228,6 @@ characters.data={ unicodeslot=0xFB7B, }, [0xFB7C]={ - adobename="tchehmeeminitialarabic", category="lo", description="ARABIC LETTER TCHEH INITIAL FORM", direction="al", @@ -132598,7 +130236,6 @@ characters.data={ unicodeslot=0xFB7C, }, [0xFB7D]={ - adobename="tchehmedialarabic", category="lo", description="ARABIC LETTER TCHEH MEDIAL FORM", direction="al", @@ -132695,7 +130332,6 @@ characters.data={ unicodeslot=0xFB88, }, [0xFB89]={ - adobename="ddalfinalarabic", category="lo", description="ARABIC LETTER DDAL FINAL FORM", direction="al", @@ -132712,7 +130348,6 @@ characters.data={ unicodeslot=0xFB8A, }, [0xFB8B]={ - adobename="jehfinalarabic", category="lo", description="ARABIC LETTER JEH FINAL FORM", direction="al", @@ -132729,7 +130364,6 @@ characters.data={ unicodeslot=0xFB8C, }, [0xFB8D]={ - adobename="rrehfinalarabic", category="lo", description="ARABIC LETTER RREH FINAL FORM", direction="al", @@ -132778,7 +130412,6 @@ characters.data={ unicodeslot=0xFB92, }, [0xFB93]={ - adobename="gaffinalarabic", category="lo", description="ARABIC LETTER GAF FINAL FORM", direction="al", @@ -132787,7 +130420,6 @@ characters.data={ unicodeslot=0xFB93, }, [0xFB94]={ - adobename="gafinitialarabic", category="lo", description="ARABIC LETTER GAF INITIAL FORM", direction="al", @@ -132796,7 +130428,6 @@ characters.data={ unicodeslot=0xFB94, }, [0xFB95]={ - adobename="gafmedialarabic", category="lo", description="ARABIC LETTER GAF MEDIAL FORM", direction="al", @@ -132877,7 +130508,6 @@ characters.data={ unicodeslot=0xFB9E, }, [0xFB9F]={ - adobename="noonghunnafinalarabic", category="lo", description="ARABIC LETTER NOON GHUNNA FINAL FORM", direction="al", @@ -132918,7 +130548,6 @@ characters.data={ unicodeslot=0xFBA3, }, [0xFBA4]={ - adobename="hehhamzaaboveisolatedarabic", category="lo", description="ARABIC LETTER HEH WITH YEH ABOVE ISOLATED FORM", direction="al", @@ -132928,7 +130557,6 @@ characters.data={ unicodeslot=0xFBA4, }, [0xFBA5]={ - adobename="hehhamzaabovefinalarabic", category="lo", description="ARABIC LETTER HEH WITH YEH ABOVE FINAL FORM", direction="al", @@ -132946,7 +130574,6 @@ characters.data={ unicodeslot=0xFBA6, }, [0xFBA7]={ - adobename="hehfinalaltonearabic", category="lo", description="ARABIC LETTER HEH GOAL FINAL FORM", direction="al", @@ -132955,7 +130582,6 @@ characters.data={ unicodeslot=0xFBA7, }, [0xFBA8]={ - adobename="hehinitialaltonearabic", category="lo", description="ARABIC LETTER HEH GOAL INITIAL FORM", direction="al", @@ -132964,7 +130590,6 @@ characters.data={ unicodeslot=0xFBA8, }, [0xFBA9]={ - adobename="hehmedialaltonearabic", category="lo", description="ARABIC LETTER HEH GOAL MEDIAL FORM", direction="al", @@ -133013,7 +130638,6 @@ characters.data={ unicodeslot=0xFBAE, }, [0xFBAF]={ - adobename="yehbarreefinalarabic", category="lo", description="ARABIC LETTER YEH BARREE FINAL FORM", direction="al", @@ -133582,7 +131206,6 @@ characters.data={ unicodeslot=0xFC07, }, [0xFC08]={ - adobename="behmeemisolatedarabic", category="lo", description="ARABIC LIGATURE BEH WITH MEEM ISOLATED FORM", direction="al", @@ -133607,7 +131230,6 @@ characters.data={ unicodeslot=0xFC0A, }, [0xFC0B]={ - adobename="tehjeemisolatedarabic", category="lo", description="ARABIC LIGATURE TEH WITH JEEM ISOLATED FORM", direction="al", @@ -133616,7 +131238,6 @@ characters.data={ unicodeslot=0xFC0B, }, [0xFC0C]={ - adobename="tehhahisolatedarabic", category="lo", description="ARABIC LIGATURE TEH WITH HAH ISOLATED FORM", direction="al", @@ -133633,7 +131254,6 @@ characters.data={ unicodeslot=0xFC0D, }, [0xFC0E]={ - adobename="tehmeemisolatedarabic", category="lo", description="ARABIC LIGATURE TEH WITH MEEM ISOLATED FORM", direction="al", @@ -134098,7 +131718,6 @@ characters.data={ unicodeslot=0xFC47, }, [0xFC48]={ - adobename="meemmeemisolatedarabic", category="lo", description="ARABIC LIGATURE MEEM WITH MEEM ISOLATED FORM", direction="al", @@ -134123,7 +131742,6 @@ characters.data={ unicodeslot=0xFC4A, }, [0xFC4B]={ - adobename="noonjeemisolatedarabic", category="lo", description="ARABIC LIGATURE NOON WITH JEEM ISOLATED FORM", direction="al", @@ -134148,7 +131766,6 @@ characters.data={ unicodeslot=0xFC4D, }, [0xFC4E]={ - adobename="noonmeemisolatedarabic", category="lo", description="ARABIC LIGATURE NOON WITH MEEM ISOLATED FORM", direction="al", @@ -134229,7 +131846,6 @@ characters.data={ unicodeslot=0xFC57, }, [0xFC58]={ - adobename="yehmeemisolatedarabic", category="lo", description="ARABIC LIGATURE YEH WITH MEEM ISOLATED FORM", direction="al", @@ -134278,7 +131894,6 @@ characters.data={ unicodeslot=0xFC5D, }, [0xFC5E]={ - adobename="shaddadammatanarabic", category="lo", description="ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM", direction="al", @@ -134287,7 +131902,6 @@ characters.data={ unicodeslot=0xFC5E, }, [0xFC5F]={ - adobename="shaddakasratanarabic", category="lo", description="ARABIC LIGATURE SHADDA WITH KASRATAN ISOLATED FORM", direction="al", @@ -134296,7 +131910,6 @@ characters.data={ unicodeslot=0xFC5F, }, [0xFC60]={ - adobename="shaddafathaarabic", category="lo", description="ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM", direction="al", @@ -134305,7 +131918,6 @@ characters.data={ unicodeslot=0xFC60, }, [0xFC61]={ - adobename="shaddadammaarabic", category="lo", description="ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM", direction="al", @@ -134314,7 +131926,6 @@ characters.data={ unicodeslot=0xFC61, }, [0xFC62]={ - adobename="shaddakasraarabic", category="lo", description="ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM", direction="al", @@ -134403,7 +132014,6 @@ characters.data={ unicodeslot=0xFC6C, }, [0xFC6D]={ - adobename="behnoonfinalarabic", category="lo", description="ARABIC LIGATURE BEH WITH NOON FINAL FORM", direction="al", @@ -134452,7 +132062,6 @@ characters.data={ unicodeslot=0xFC72, }, [0xFC73]={ - adobename="tehnoonfinalarabic", category="lo", description="ARABIC LIGATURE TEH WITH NOON FINAL FORM", direction="al", @@ -134661,7 +132270,6 @@ characters.data={ unicodeslot=0xFC8C, }, [0xFC8D]={ - adobename="noonnoonfinalarabic", category="lo", description="ARABIC LIGATURE NOON WITH NOON FINAL FORM", direction="al", @@ -134718,7 +132326,6 @@ characters.data={ unicodeslot=0xFC93, }, [0xFC94]={ - adobename="yehnoonfinalarabic", category="lo", description="ARABIC LIGATURE YEH WITH NOON FINAL FORM", direction="al", @@ -134807,7 +132414,6 @@ characters.data={ unicodeslot=0xFC9E, }, [0xFC9F]={ - adobename="behmeeminitialarabic", category="lo", description="ARABIC LIGATURE BEH WITH MEEM INITIAL FORM", direction="al", @@ -134824,7 +132430,6 @@ characters.data={ unicodeslot=0xFCA0, }, [0xFCA1]={ - adobename="tehjeeminitialarabic", category="lo", description="ARABIC LIGATURE TEH WITH JEEM INITIAL FORM", direction="al", @@ -134833,7 +132438,6 @@ characters.data={ unicodeslot=0xFCA1, }, [0xFCA2]={ - adobename="tehhahinitialarabic", category="lo", description="ARABIC LIGATURE TEH WITH HAH INITIAL FORM", direction="al", @@ -134850,7 +132454,6 @@ characters.data={ unicodeslot=0xFCA3, }, [0xFCA4]={ - adobename="tehmeeminitialarabic", category="lo", description="ARABIC LIGATURE TEH WITH MEEM INITIAL FORM", direction="al", @@ -135147,7 +132750,6 @@ characters.data={ unicodeslot=0xFCC8, }, [0xFCC9]={ - adobename="lamjeeminitialarabic", category="lo", description="ARABIC LIGATURE LAM WITH JEEM INITIAL FORM", direction="al", @@ -135156,7 +132758,6 @@ characters.data={ unicodeslot=0xFCC9, }, [0xFCCA]={ - adobename="lamhahinitialarabic", category="lo", description="ARABIC LIGATURE LAM WITH HAH INITIAL FORM", direction="al", @@ -135165,7 +132766,6 @@ characters.data={ unicodeslot=0xFCCA, }, [0xFCCB]={ - adobename="lamkhahinitialarabic", category="lo", description="ARABIC LIGATURE LAM WITH KHAH INITIAL FORM", direction="al", @@ -135174,7 +132774,6 @@ characters.data={ unicodeslot=0xFCCB, }, [0xFCCC]={ - adobename="lammeeminitialarabic", category="lo", description="ARABIC LIGATURE LAM WITH MEEM INITIAL FORM", direction="al", @@ -135215,7 +132814,6 @@ characters.data={ unicodeslot=0xFCD0, }, [0xFCD1]={ - adobename="meemmeeminitialarabic", category="lo", description="ARABIC LIGATURE MEEM WITH MEEM INITIAL FORM", direction="al", @@ -135224,7 +132822,6 @@ characters.data={ unicodeslot=0xFCD1, }, [0xFCD2]={ - adobename="noonjeeminitialarabic", category="lo", description="ARABIC LIGATURE NOON WITH JEEM INITIAL FORM", direction="al", @@ -135249,7 +132846,6 @@ characters.data={ unicodeslot=0xFCD4, }, [0xFCD5]={ - adobename="noonmeeminitialarabic", category="lo", description="ARABIC LIGATURE NOON WITH MEEM INITIAL FORM", direction="al", @@ -135314,7 +132910,6 @@ characters.data={ unicodeslot=0xFCDC, }, [0xFCDD]={ - adobename="yehmeeminitialarabic", category="lo", description="ARABIC LIGATURE YEH WITH MEEM INITIAL FORM", direction="al", @@ -136091,7 +133686,6 @@ characters.data={ unicodeslot=0xFD3D, }, [0xFD3E]={ - adobename="parenleftaltonearabic", category="ps", contextname="arabicparenleft", description="ORNATE LEFT PARENTHESIS", @@ -136100,7 +133694,6 @@ characters.data={ unicodeslot=0xFD3E, }, [0xFD3F]={ - adobename="parenrightaltonearabic", category="pe", contextname="arabicparenright", description="ORNATE RIGHT PARENTHESIS", @@ -136669,7 +134262,6 @@ characters.data={ unicodeslot=0xFD87, }, [0xFD88]={ - adobename="lammeemhahinitialarabic", category="lo", description="ARABIC LIGATURE LAM WITH MEEM WITH HAH INITIAL FORM", direction="al", @@ -137191,7 +134783,6 @@ characters.data={ unicodeslot=0xFDF1, }, [0xFDF2]={ - adobename="lamlamhehisolatedarabic", category="lo", contextname="arabicallah", description="ARABIC LIGATURE ALLAH ISOLATED FORM", @@ -137264,7 +134855,6 @@ characters.data={ unicodeslot=0xFDF9, }, [0xFDFA]={ - adobename="sallallahoualayhewasallamarabic", category="lo", contextname="arabicallallahou", description="ARABIC LIGATURE SALLALLAHOU ALAYHE WASALLAM", @@ -137540,7 +135130,6 @@ characters.data={ unicodeslot=0xFE2F, }, [0xFE30]={ - adobename="twodotleadervertical", category="po", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL TWO DOT LEADER", @@ -137550,7 +135139,6 @@ characters.data={ unicodeslot=0xFE30, }, [0xFE31]={ - adobename="emdashvertical", category="pd", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL EM DASH", @@ -137560,7 +135148,6 @@ characters.data={ unicodeslot=0xFE31, }, [0xFE32]={ - adobename="endashvertical", category="pd", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL EN DASH", @@ -137570,7 +135157,6 @@ characters.data={ unicodeslot=0xFE32, }, [0xFE33]={ - adobename="underscorevertical", category="pc", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LOW LINE", @@ -137580,7 +135166,6 @@ characters.data={ unicodeslot=0xFE33, }, [0xFE34]={ - adobename="wavyunderscorevertical", category="pc", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL WAVY LOW LINE", @@ -137590,7 +135175,6 @@ characters.data={ unicodeslot=0xFE34, }, [0xFE35]={ - adobename="parenleftvertical", category="ps", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS", @@ -137600,7 +135184,6 @@ characters.data={ unicodeslot=0xFE35, }, [0xFE36]={ - adobename="parenrightvertical", category="pe", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS", @@ -137610,7 +135193,6 @@ characters.data={ unicodeslot=0xFE36, }, [0xFE37]={ - adobename="braceleftvertical", category="ps", cjkwd="w", comment="weird math needed for mathml", @@ -137622,7 +135204,6 @@ characters.data={ unicodeslot=0xFE37, }, [0xFE38]={ - adobename="bracerightvertical", category="pe", cjkwd="w", comment="weird math needed for mathml", @@ -137634,7 +135215,6 @@ characters.data={ unicodeslot=0xFE38, }, [0xFE39]={ - adobename="tortoiseshellbracketleftvertical", category="ps", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET", @@ -137644,7 +135224,6 @@ characters.data={ unicodeslot=0xFE39, }, [0xFE3A]={ - adobename="tortoiseshellbracketrightvertical", category="pe", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET", @@ -137654,7 +135233,6 @@ characters.data={ unicodeslot=0xFE3A, }, [0xFE3B]={ - adobename="blacklenticularbracketleftvertical", category="ps", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET", @@ -137664,7 +135242,6 @@ characters.data={ unicodeslot=0xFE3B, }, [0xFE3C]={ - adobename="blacklenticularbracketrightvertical", category="pe", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET", @@ -137674,7 +135251,6 @@ characters.data={ unicodeslot=0xFE3C, }, [0xFE3D]={ - adobename="dblanglebracketleftvertical", category="ps", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET", @@ -137684,7 +135260,6 @@ characters.data={ unicodeslot=0xFE3D, }, [0xFE3E]={ - adobename="dblanglebracketrightvertical", category="pe", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET", @@ -137694,7 +135269,6 @@ characters.data={ unicodeslot=0xFE3E, }, [0xFE3F]={ - adobename="anglebracketleftvertical", category="ps", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET", @@ -137704,7 +135278,6 @@ characters.data={ unicodeslot=0xFE3F, }, [0xFE40]={ - adobename="anglebracketrightvertical", category="pe", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET", @@ -137714,7 +135287,6 @@ characters.data={ unicodeslot=0xFE40, }, [0xFE41]={ - adobename="cornerbracketleftvertical", category="ps", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET", @@ -137724,7 +135296,6 @@ characters.data={ unicodeslot=0xFE41, }, [0xFE42]={ - adobename="cornerbracketrightvertical", category="pe", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET", @@ -137734,7 +135305,6 @@ characters.data={ unicodeslot=0xFE42, }, [0xFE43]={ - adobename="whitecornerbracketleftvertical", category="ps", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET", @@ -137744,7 +135314,6 @@ characters.data={ unicodeslot=0xFE43, }, [0xFE44]={ - adobename="whitecornerbracketrightvertical", category="pe", cjkwd="w", description="PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET", @@ -137788,7 +135357,6 @@ characters.data={ unicodeslot=0xFE48, }, [0xFE49]={ - adobename="overlinedashed", category="po", cjkwd="w", description="DASHED OVERLINE", @@ -137798,7 +135366,6 @@ characters.data={ unicodeslot=0xFE49, }, [0xFE4A]={ - adobename="overlinecenterline", category="po", cjkwd="w", description="CENTRELINE OVERLINE", @@ -137808,7 +135375,6 @@ characters.data={ unicodeslot=0xFE4A, }, [0xFE4B]={ - adobename="overlinewavy", category="po", cjkwd="w", description="WAVY OVERLINE", @@ -137818,7 +135384,6 @@ characters.data={ unicodeslot=0xFE4B, }, [0xFE4C]={ - adobename="overlinedblwavy", category="po", cjkwd="w", description="DOUBLE WAVY OVERLINE", @@ -137828,7 +135393,6 @@ characters.data={ unicodeslot=0xFE4C, }, [0xFE4D]={ - adobename="lowlinedashed", category="pc", cjkwd="w", description="DASHED LOW LINE", @@ -137838,7 +135402,6 @@ characters.data={ unicodeslot=0xFE4D, }, [0xFE4E]={ - adobename="lowlinecenterline", category="pc", cjkwd="w", description="CENTRELINE LOW LINE", @@ -137848,7 +135411,6 @@ characters.data={ unicodeslot=0xFE4E, }, [0xFE4F]={ - adobename="underscorewavy", category="pc", cjkwd="w", description="WAVY LOW LINE", @@ -137858,7 +135420,6 @@ characters.data={ unicodeslot=0xFE4F, }, [0xFE50]={ - adobename="commasmall", category="po", cjkwd="w", description="SMALL COMMA", @@ -137877,7 +135438,6 @@ characters.data={ unicodeslot=0xFE51, }, [0xFE52]={ - adobename="periodsmall", category="po", cjkwd="w", description="SMALL FULL STOP", @@ -137887,7 +135447,6 @@ characters.data={ unicodeslot=0xFE52, }, [0xFE54]={ - adobename="semicolonsmall", category="po", cjkwd="w", description="SMALL SEMICOLON", @@ -137897,7 +135456,6 @@ characters.data={ unicodeslot=0xFE54, }, [0xFE55]={ - adobename="colonsmall", category="po", cjkwd="w", description="SMALL COLON", @@ -137934,7 +135492,6 @@ characters.data={ unicodeslot=0xFE58, }, [0xFE59]={ - adobename="parenleftsmall", category="ps", cjkwd="w", description="SMALL LEFT PARENTHESIS", @@ -137946,7 +135503,6 @@ characters.data={ unicodeslot=0xFE59, }, [0xFE5A]={ - adobename="parenrightsmall", category="pe", cjkwd="w", description="SMALL RIGHT PARENTHESIS", @@ -137958,7 +135514,6 @@ characters.data={ unicodeslot=0xFE5A, }, [0xFE5B]={ - adobename="braceleftsmall", category="ps", cjkwd="w", description="SMALL LEFT CURLY BRACKET", @@ -137970,7 +135525,6 @@ characters.data={ unicodeslot=0xFE5B, }, [0xFE5C]={ - adobename="bracerightsmall", category="pe", cjkwd="w", description="SMALL RIGHT CURLY BRACKET", @@ -137982,7 +135536,6 @@ characters.data={ unicodeslot=0xFE5C, }, [0xFE5D]={ - adobename="tortoiseshellbracketleftsmall", category="ps", cjkwd="w", description="SMALL LEFT TORTOISE SHELL BRACKET", @@ -137994,7 +135547,6 @@ characters.data={ unicodeslot=0xFE5D, }, [0xFE5E]={ - adobename="tortoiseshellbracketrightsmall", category="pe", cjkwd="w", description="SMALL RIGHT TORTOISE SHELL BRACKET", @@ -138006,7 +135558,6 @@ characters.data={ unicodeslot=0xFE5E, }, [0xFE5F]={ - adobename="numbersignsmall", category="po", cjkwd="w", description="SMALL NUMBER SIGN", @@ -138025,7 +135576,6 @@ characters.data={ unicodeslot=0xFE60, }, [0xFE61]={ - adobename="asterisksmall", category="po", cjkwd="w", description="SMALL ASTERISK", @@ -138035,7 +135585,6 @@ characters.data={ unicodeslot=0xFE61, }, [0xFE62]={ - adobename="plussmall", category="sm", cjkwd="w", description="SMALL PLUS SIGN", @@ -138045,7 +135594,6 @@ characters.data={ unicodeslot=0xFE62, }, [0xFE63]={ - adobename="hyphensmall", category="pd", cjkwd="w", description="SMALL HYPHEN-MINUS", @@ -138055,7 +135603,6 @@ characters.data={ unicodeslot=0xFE63, }, [0xFE64]={ - adobename="lesssmall", category="sm", cjkwd="w", description="SMALL LESS-THAN SIGN", @@ -138067,7 +135614,6 @@ characters.data={ unicodeslot=0xFE64, }, [0xFE65]={ - adobename="greatersmall", category="sm", cjkwd="w", description="SMALL GREATER-THAN SIGN", @@ -138079,7 +135625,6 @@ characters.data={ unicodeslot=0xFE65, }, [0xFE66]={ - adobename="equalsmall", category="sm", cjkwd="w", description="SMALL EQUALS SIGN", @@ -138098,7 +135643,6 @@ characters.data={ unicodeslot=0xFE68, }, [0xFE69]={ - adobename="dollarsmall", category="sc", cjkwd="w", description="SMALL DOLLAR SIGN", @@ -138108,7 +135652,6 @@ characters.data={ unicodeslot=0xFE69, }, [0xFE6A]={ - adobename="percentsmall", category="po", cjkwd="w", description="SMALL PERCENT SIGN", @@ -138118,7 +135661,6 @@ characters.data={ unicodeslot=0xFE6A, }, [0xFE6B]={ - adobename="atsmall", category="po", cjkwd="w", description="SMALL COMMERCIAL AT", @@ -138264,7 +135806,6 @@ characters.data={ unicodeslot=0xFE81, }, [0xFE82]={ - adobename="alefmaddaabovefinalarabic", category="lo", description="ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM", direction="al", @@ -138283,7 +135824,6 @@ characters.data={ unicodeslot=0xFE83, }, [0xFE84]={ - adobename="alefhamzaabovefinalarabic", category="lo", description="ARABIC LETTER ALEF WITH HAMZA ABOVE FINAL FORM", direction="al", @@ -138302,7 +135842,6 @@ characters.data={ unicodeslot=0xFE85, }, [0xFE86]={ - adobename="wawhamzaabovefinalarabic", category="lo", description="ARABIC LETTER WAW WITH HAMZA ABOVE FINAL FORM", direction="al", @@ -138321,7 +135860,6 @@ characters.data={ unicodeslot=0xFE87, }, [0xFE88]={ - adobename="alefhamzabelowfinalarabic", category="lo", description="ARABIC LETTER ALEF WITH HAMZA BELOW FINAL FORM", direction="al", @@ -138340,7 +135878,6 @@ characters.data={ unicodeslot=0xFE89, }, [0xFE8A]={ - adobename="yehhamzaabovefinalarabic", category="lo", description="ARABIC LETTER YEH WITH HAMZA ABOVE FINAL FORM", direction="al", @@ -138350,7 +135887,6 @@ characters.data={ unicodeslot=0xFE8A, }, [0xFE8B]={ - adobename="yehhamzaaboveinitialarabic", category="lo", description="ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM", direction="al", @@ -138360,7 +135896,6 @@ characters.data={ unicodeslot=0xFE8B, }, [0xFE8C]={ - adobename="yehhamzaabovemedialarabic", category="lo", description="ARABIC LETTER YEH WITH HAMZA ABOVE MEDIAL FORM", direction="al", @@ -138378,7 +135913,6 @@ characters.data={ unicodeslot=0xFE8D, }, [0xFE8E]={ - adobename="aleffinalarabic", category="lo", description="ARABIC LETTER ALEF FINAL FORM", direction="al", @@ -138395,7 +135929,6 @@ characters.data={ unicodeslot=0xFE8F, }, [0xFE90]={ - adobename="behfinalarabic", category="lo", description="ARABIC LETTER BEH FINAL FORM", direction="al", @@ -138404,7 +135937,6 @@ characters.data={ unicodeslot=0xFE90, }, [0xFE91]={ - adobename="behinitialarabic", category="lo", description="ARABIC LETTER BEH INITIAL FORM", direction="al", @@ -138413,7 +135945,6 @@ characters.data={ unicodeslot=0xFE91, }, [0xFE92]={ - adobename="behmedialarabic", category="lo", description="ARABIC LETTER BEH MEDIAL FORM", direction="al", @@ -138430,7 +135961,6 @@ characters.data={ unicodeslot=0xFE93, }, [0xFE94]={ - adobename="tehmarbutafinalarabic", category="lo", description="ARABIC LETTER TEH MARBUTA FINAL FORM", direction="al", @@ -138447,7 +135977,6 @@ characters.data={ unicodeslot=0xFE95, }, [0xFE96]={ - adobename="tehfinalarabic", category="lo", description="ARABIC LETTER TEH FINAL FORM", direction="al", @@ -138456,7 +135985,6 @@ characters.data={ unicodeslot=0xFE96, }, [0xFE97]={ - adobename="tehinitialarabic", category="lo", description="ARABIC LETTER TEH INITIAL FORM", direction="al", @@ -138465,7 +135993,6 @@ characters.data={ unicodeslot=0xFE97, }, [0xFE98]={ - adobename="tehmedialarabic", category="lo", description="ARABIC LETTER TEH MEDIAL FORM", direction="al", @@ -138482,7 +136009,6 @@ characters.data={ unicodeslot=0xFE99, }, [0xFE9A]={ - adobename="thehfinalarabic", category="lo", description="ARABIC LETTER THEH FINAL FORM", direction="al", @@ -138491,7 +136017,6 @@ characters.data={ unicodeslot=0xFE9A, }, [0xFE9B]={ - adobename="thehinitialarabic", category="lo", description="ARABIC LETTER THEH INITIAL FORM", direction="al", @@ -138500,7 +136025,6 @@ characters.data={ unicodeslot=0xFE9B, }, [0xFE9C]={ - adobename="thehmedialarabic", category="lo", description="ARABIC LETTER THEH MEDIAL FORM", direction="al", @@ -138517,7 +136041,6 @@ characters.data={ unicodeslot=0xFE9D, }, [0xFE9E]={ - adobename="jeemfinalarabic", category="lo", description="ARABIC LETTER JEEM FINAL FORM", direction="al", @@ -138526,7 +136049,6 @@ characters.data={ unicodeslot=0xFE9E, }, [0xFE9F]={ - adobename="jeeminitialarabic", category="lo", description="ARABIC LETTER JEEM INITIAL FORM", direction="al", @@ -138535,7 +136057,6 @@ characters.data={ unicodeslot=0xFE9F, }, [0xFEA0]={ - adobename="jeemmedialarabic", category="lo", description="ARABIC LETTER JEEM MEDIAL FORM", direction="al", @@ -138552,7 +136073,6 @@ characters.data={ unicodeslot=0xFEA1, }, [0xFEA2]={ - adobename="hahfinalarabic", category="lo", description="ARABIC LETTER HAH FINAL FORM", direction="al", @@ -138561,7 +136081,6 @@ characters.data={ unicodeslot=0xFEA2, }, [0xFEA3]={ - adobename="hahinitialarabic", category="lo", description="ARABIC LETTER HAH INITIAL FORM", direction="al", @@ -138570,7 +136089,6 @@ characters.data={ unicodeslot=0xFEA3, }, [0xFEA4]={ - adobename="hahmedialarabic", category="lo", description="ARABIC LETTER HAH MEDIAL FORM", direction="al", @@ -138587,7 +136105,6 @@ characters.data={ unicodeslot=0xFEA5, }, [0xFEA6]={ - adobename="khahfinalarabic", category="lo", description="ARABIC LETTER KHAH FINAL FORM", direction="al", @@ -138596,7 +136113,6 @@ characters.data={ unicodeslot=0xFEA6, }, [0xFEA7]={ - adobename="khahinitialarabic", category="lo", description="ARABIC LETTER KHAH INITIAL FORM", direction="al", @@ -138605,7 +136121,6 @@ characters.data={ unicodeslot=0xFEA7, }, [0xFEA8]={ - adobename="khahmedialarabic", category="lo", description="ARABIC LETTER KHAH MEDIAL FORM", direction="al", @@ -138622,7 +136137,6 @@ characters.data={ unicodeslot=0xFEA9, }, [0xFEAA]={ - adobename="dalfinalarabic", category="lo", description="ARABIC LETTER DAL FINAL FORM", direction="al", @@ -138639,7 +136153,6 @@ characters.data={ unicodeslot=0xFEAB, }, [0xFEAC]={ - adobename="thalfinalarabic", category="lo", description="ARABIC LETTER THAL FINAL FORM", direction="al", @@ -138656,7 +136169,6 @@ characters.data={ unicodeslot=0xFEAD, }, [0xFEAE]={ - adobename="rehfinalarabic", category="lo", description="ARABIC LETTER REH FINAL FORM", direction="al", @@ -138673,7 +136185,6 @@ characters.data={ unicodeslot=0xFEAF, }, [0xFEB0]={ - adobename="zainfinalarabic", category="lo", description="ARABIC LETTER ZAIN FINAL FORM", direction="al", @@ -138690,7 +136201,6 @@ characters.data={ unicodeslot=0xFEB1, }, [0xFEB2]={ - adobename="seenfinalarabic", category="lo", description="ARABIC LETTER SEEN FINAL FORM", direction="al", @@ -138699,7 +136209,6 @@ characters.data={ unicodeslot=0xFEB2, }, [0xFEB3]={ - adobename="seeninitialarabic", category="lo", description="ARABIC LETTER SEEN INITIAL FORM", direction="al", @@ -138708,7 +136217,6 @@ characters.data={ unicodeslot=0xFEB3, }, [0xFEB4]={ - adobename="seenmedialarabic", category="lo", description="ARABIC LETTER SEEN MEDIAL FORM", direction="al", @@ -138725,7 +136233,6 @@ characters.data={ unicodeslot=0xFEB5, }, [0xFEB6]={ - adobename="sheenfinalarabic", category="lo", description="ARABIC LETTER SHEEN FINAL FORM", direction="al", @@ -138734,7 +136241,6 @@ characters.data={ unicodeslot=0xFEB6, }, [0xFEB7]={ - adobename="sheeninitialarabic", category="lo", description="ARABIC LETTER SHEEN INITIAL FORM", direction="al", @@ -138743,7 +136249,6 @@ characters.data={ unicodeslot=0xFEB7, }, [0xFEB8]={ - adobename="sheenmedialarabic", category="lo", description="ARABIC LETTER SHEEN MEDIAL FORM", direction="al", @@ -138760,7 +136265,6 @@ characters.data={ unicodeslot=0xFEB9, }, [0xFEBA]={ - adobename="sadfinalarabic", category="lo", description="ARABIC LETTER SAD FINAL FORM", direction="al", @@ -138769,7 +136273,6 @@ characters.data={ unicodeslot=0xFEBA, }, [0xFEBB]={ - adobename="sadinitialarabic", category="lo", description="ARABIC LETTER SAD INITIAL FORM", direction="al", @@ -138778,7 +136281,6 @@ characters.data={ unicodeslot=0xFEBB, }, [0xFEBC]={ - adobename="sadmedialarabic", category="lo", description="ARABIC LETTER SAD MEDIAL FORM", direction="al", @@ -138795,7 +136297,6 @@ characters.data={ unicodeslot=0xFEBD, }, [0xFEBE]={ - adobename="dadfinalarabic", category="lo", description="ARABIC LETTER DAD FINAL FORM", direction="al", @@ -138804,7 +136305,6 @@ characters.data={ unicodeslot=0xFEBE, }, [0xFEBF]={ - adobename="dadinitialarabic", category="lo", description="ARABIC LETTER DAD INITIAL FORM", direction="al", @@ -138813,7 +136313,6 @@ characters.data={ unicodeslot=0xFEBF, }, [0xFEC0]={ - adobename="dadmedialarabic", category="lo", description="ARABIC LETTER DAD MEDIAL FORM", direction="al", @@ -138830,7 +136329,6 @@ characters.data={ unicodeslot=0xFEC1, }, [0xFEC2]={ - adobename="tahfinalarabic", category="lo", description="ARABIC LETTER TAH FINAL FORM", direction="al", @@ -138839,7 +136337,6 @@ characters.data={ unicodeslot=0xFEC2, }, [0xFEC3]={ - adobename="tahinitialarabic", category="lo", description="ARABIC LETTER TAH INITIAL FORM", direction="al", @@ -138848,7 +136345,6 @@ characters.data={ unicodeslot=0xFEC3, }, [0xFEC4]={ - adobename="tahmedialarabic", category="lo", description="ARABIC LETTER TAH MEDIAL FORM", direction="al", @@ -138865,7 +136361,6 @@ characters.data={ unicodeslot=0xFEC5, }, [0xFEC6]={ - adobename="zahfinalarabic", category="lo", description="ARABIC LETTER ZAH FINAL FORM", direction="al", @@ -138874,7 +136369,6 @@ characters.data={ unicodeslot=0xFEC6, }, [0xFEC7]={ - adobename="zahinitialarabic", category="lo", description="ARABIC LETTER ZAH INITIAL FORM", direction="al", @@ -138883,7 +136377,6 @@ characters.data={ unicodeslot=0xFEC7, }, [0xFEC8]={ - adobename="zahmedialarabic", category="lo", description="ARABIC LETTER ZAH MEDIAL FORM", direction="al", @@ -138900,7 +136393,6 @@ characters.data={ unicodeslot=0xFEC9, }, [0xFECA]={ - adobename="ainfinalarabic", category="lo", description="ARABIC LETTER AIN FINAL FORM", direction="al", @@ -138909,7 +136401,6 @@ characters.data={ unicodeslot=0xFECA, }, [0xFECB]={ - adobename="aininitialarabic", category="lo", description="ARABIC LETTER AIN INITIAL FORM", direction="al", @@ -138918,7 +136409,6 @@ characters.data={ unicodeslot=0xFECB, }, [0xFECC]={ - adobename="ainmedialarabic", category="lo", description="ARABIC LETTER AIN MEDIAL FORM", direction="al", @@ -138935,7 +136425,6 @@ characters.data={ unicodeslot=0xFECD, }, [0xFECE]={ - adobename="ghainfinalarabic", category="lo", description="ARABIC LETTER GHAIN FINAL FORM", direction="al", @@ -138944,7 +136433,6 @@ characters.data={ unicodeslot=0xFECE, }, [0xFECF]={ - adobename="ghaininitialarabic", category="lo", description="ARABIC LETTER GHAIN INITIAL FORM", direction="al", @@ -138953,7 +136441,6 @@ characters.data={ unicodeslot=0xFECF, }, [0xFED0]={ - adobename="ghainmedialarabic", category="lo", description="ARABIC LETTER GHAIN MEDIAL FORM", direction="al", @@ -138970,7 +136457,6 @@ characters.data={ unicodeslot=0xFED1, }, [0xFED2]={ - adobename="fehfinalarabic", category="lo", description="ARABIC LETTER FEH FINAL FORM", direction="al", @@ -138979,7 +136465,6 @@ characters.data={ unicodeslot=0xFED2, }, [0xFED3]={ - adobename="fehinitialarabic", category="lo", description="ARABIC LETTER FEH INITIAL FORM", direction="al", @@ -138988,7 +136473,6 @@ characters.data={ unicodeslot=0xFED3, }, [0xFED4]={ - adobename="fehmedialarabic", category="lo", description="ARABIC LETTER FEH MEDIAL FORM", direction="al", @@ -139005,7 +136489,6 @@ characters.data={ unicodeslot=0xFED5, }, [0xFED6]={ - adobename="qaffinalarabic", category="lo", description="ARABIC LETTER QAF FINAL FORM", direction="al", @@ -139014,7 +136497,6 @@ characters.data={ unicodeslot=0xFED6, }, [0xFED7]={ - adobename="qafinitialarabic", category="lo", description="ARABIC LETTER QAF INITIAL FORM", direction="al", @@ -139023,7 +136505,6 @@ characters.data={ unicodeslot=0xFED7, }, [0xFED8]={ - adobename="qafmedialarabic", category="lo", description="ARABIC LETTER QAF MEDIAL FORM", direction="al", @@ -139040,7 +136521,6 @@ characters.data={ unicodeslot=0xFED9, }, [0xFEDA]={ - adobename="kaffinalarabic", category="lo", description="ARABIC LETTER KAF FINAL FORM", direction="al", @@ -139049,7 +136529,6 @@ characters.data={ unicodeslot=0xFEDA, }, [0xFEDB]={ - adobename="kafinitialarabic", category="lo", description="ARABIC LETTER KAF INITIAL FORM", direction="al", @@ -139058,7 +136537,6 @@ characters.data={ unicodeslot=0xFEDB, }, [0xFEDC]={ - adobename="kafmedialarabic", category="lo", description="ARABIC LETTER KAF MEDIAL FORM", direction="al", @@ -139075,7 +136553,6 @@ characters.data={ unicodeslot=0xFEDD, }, [0xFEDE]={ - adobename="lamfinalarabic", category="lo", description="ARABIC LETTER LAM FINAL FORM", direction="al", @@ -139084,7 +136561,6 @@ characters.data={ unicodeslot=0xFEDE, }, [0xFEDF]={ - adobename="lammeemkhahinitialarabic", category="lo", description="ARABIC LETTER LAM INITIAL FORM", direction="al", @@ -139093,7 +136569,6 @@ characters.data={ unicodeslot=0xFEDF, }, [0xFEE0]={ - adobename="lammedialarabic", category="lo", description="ARABIC LETTER LAM MEDIAL FORM", direction="al", @@ -139110,7 +136585,6 @@ characters.data={ unicodeslot=0xFEE1, }, [0xFEE2]={ - adobename="meemfinalarabic", category="lo", description="ARABIC LETTER MEEM FINAL FORM", direction="al", @@ -139119,7 +136593,6 @@ characters.data={ unicodeslot=0xFEE2, }, [0xFEE3]={ - adobename="meeminitialarabic", category="lo", description="ARABIC LETTER MEEM INITIAL FORM", direction="al", @@ -139128,7 +136601,6 @@ characters.data={ unicodeslot=0xFEE3, }, [0xFEE4]={ - adobename="meemmedialarabic", category="lo", description="ARABIC LETTER MEEM MEDIAL FORM", direction="al", @@ -139145,7 +136617,6 @@ characters.data={ unicodeslot=0xFEE5, }, [0xFEE6]={ - adobename="noonfinalarabic", category="lo", description="ARABIC LETTER NOON FINAL FORM", direction="al", @@ -139154,7 +136625,6 @@ characters.data={ unicodeslot=0xFEE6, }, [0xFEE7]={ - adobename="nooninitialarabic", category="lo", description="ARABIC LETTER NOON INITIAL FORM", direction="al", @@ -139163,7 +136633,6 @@ characters.data={ unicodeslot=0xFEE7, }, [0xFEE8]={ - adobename="noonmedialarabic", category="lo", description="ARABIC LETTER NOON MEDIAL FORM", direction="al", @@ -139180,7 +136649,6 @@ characters.data={ unicodeslot=0xFEE9, }, [0xFEEA]={ - adobename="hehfinalarabic", category="lo", description="ARABIC LETTER HEH FINAL FORM", direction="al", @@ -139189,7 +136657,6 @@ characters.data={ unicodeslot=0xFEEA, }, [0xFEEB]={ - adobename="hehinitialarabic", category="lo", description="ARABIC LETTER HEH INITIAL FORM", direction="al", @@ -139198,7 +136665,6 @@ characters.data={ unicodeslot=0xFEEB, }, [0xFEEC]={ - adobename="hehmedialarabic", category="lo", description="ARABIC LETTER HEH MEDIAL FORM", direction="al", @@ -139215,7 +136681,6 @@ characters.data={ unicodeslot=0xFEED, }, [0xFEEE]={ - adobename="wawfinalarabic", category="lo", description="ARABIC LETTER WAW FINAL FORM", direction="al", @@ -139232,7 +136697,6 @@ characters.data={ unicodeslot=0xFEEF, }, [0xFEF0]={ - adobename="alefmaksurafinalarabic", category="lo", description="ARABIC LETTER ALEF MAKSURA FINAL FORM", direction="al", @@ -139249,7 +136713,6 @@ characters.data={ unicodeslot=0xFEF1, }, [0xFEF2]={ - adobename="yehfinalarabic", category="lo", description="ARABIC LETTER YEH FINAL FORM", direction="al", @@ -139258,7 +136721,6 @@ characters.data={ unicodeslot=0xFEF2, }, [0xFEF3]={ - adobename="yehinitialarabic", category="lo", description="ARABIC LETTER YEH INITIAL FORM", direction="al", @@ -139267,7 +136729,6 @@ characters.data={ unicodeslot=0xFEF3, }, [0xFEF4]={ - adobename="yehmedialarabic", category="lo", description="ARABIC LETTER YEH MEDIAL FORM", direction="al", @@ -139276,7 +136737,6 @@ characters.data={ unicodeslot=0xFEF4, }, [0xFEF5]={ - adobename="lamalefmaddaaboveisolatedarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM", direction="al", @@ -139285,7 +136745,6 @@ characters.data={ unicodeslot=0xFEF5, }, [0xFEF6]={ - adobename="lamalefmaddaabovefinalarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM", direction="al", @@ -139294,7 +136753,6 @@ characters.data={ unicodeslot=0xFEF6, }, [0xFEF7]={ - adobename="lamalefhamzaaboveisolatedarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM", direction="al", @@ -139303,7 +136761,6 @@ characters.data={ unicodeslot=0xFEF7, }, [0xFEF8]={ - adobename="lamalefhamzaabovefinalarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM", direction="al", @@ -139312,7 +136769,6 @@ characters.data={ unicodeslot=0xFEF8, }, [0xFEF9]={ - adobename="lamalefhamzabelowisolatedarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM", direction="al", @@ -139321,7 +136777,6 @@ characters.data={ unicodeslot=0xFEF9, }, [0xFEFA]={ - adobename="lamalefhamzabelowfinalarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM", direction="al", @@ -139330,7 +136785,6 @@ characters.data={ unicodeslot=0xFEFA, }, [0xFEFB]={ - adobename="lamalefisolatedarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM", direction="al", @@ -139339,7 +136793,6 @@ characters.data={ unicodeslot=0xFEFB, }, [0xFEFC]={ - adobename="lamaleffinalarabic", category="lo", description="ARABIC LIGATURE LAM WITH ALEF FINAL FORM", direction="al", @@ -139348,7 +136801,6 @@ characters.data={ unicodeslot=0xFEFC, }, [0xFEFF]={ - adobename="zerowidthjoiner", category="cf", contextname="zerowidthnobreakspace", description="ZERO WIDTH NO-BREAK SPACE", @@ -139358,7 +136810,6 @@ characters.data={ unicodeslot=0xFEFF, }, [0xFF01]={ - adobename="exclammonospace", category="po", cjkwd="f", description="FULLWIDTH EXCLAMATION MARK", @@ -139369,7 +136820,6 @@ characters.data={ variants=variants_forms, }, [0xFF02]={ - adobename="quotedblmonospace", category="po", cjkwd="f", description="FULLWIDTH QUOTATION MARK", @@ -139379,7 +136829,6 @@ characters.data={ unicodeslot=0xFF02, }, [0xFF03]={ - adobename="numbersignmonospace", category="po", cjkwd="f", description="FULLWIDTH NUMBER SIGN", @@ -139389,7 +136838,6 @@ characters.data={ unicodeslot=0xFF03, }, [0xFF04]={ - adobename="dollarmonospace", category="sc", cjkwd="f", description="FULLWIDTH DOLLAR SIGN", @@ -139399,7 +136847,6 @@ characters.data={ unicodeslot=0xFF04, }, [0xFF05]={ - adobename="percentmonospace", category="po", cjkwd="f", description="FULLWIDTH PERCENT SIGN", @@ -139409,7 +136856,6 @@ characters.data={ unicodeslot=0xFF05, }, [0xFF06]={ - adobename="ampersandmonospace", category="po", cjkwd="f", description="FULLWIDTH AMPERSAND", @@ -139419,7 +136865,6 @@ characters.data={ unicodeslot=0xFF06, }, [0xFF07]={ - adobename="quotesinglemonospace", category="po", cjkwd="f", description="FULLWIDTH APOSTROPHE", @@ -139429,7 +136874,6 @@ characters.data={ unicodeslot=0xFF07, }, [0xFF08]={ - adobename="parenleftmonospace", category="ps", cjkwd="f", description="FULLWIDTH LEFT PARENTHESIS", @@ -139441,7 +136885,6 @@ characters.data={ unicodeslot=0xFF08, }, [0xFF09]={ - adobename="parenrightmonospace", category="pe", cjkwd="f", description="FULLWIDTH RIGHT PARENTHESIS", @@ -139453,7 +136896,6 @@ characters.data={ unicodeslot=0xFF09, }, [0xFF0A]={ - adobename="asteriskmonospace", category="po", cjkwd="f", description="FULLWIDTH ASTERISK", @@ -139463,7 +136905,6 @@ characters.data={ unicodeslot=0xFF0A, }, [0xFF0B]={ - adobename="plusmonospace", category="sm", cjkwd="f", description="FULLWIDTH PLUS SIGN", @@ -139473,7 +136914,6 @@ characters.data={ unicodeslot=0xFF0B, }, [0xFF0C]={ - adobename="commamonospace", category="po", cjkwd="f", description="FULLWIDTH COMMA", @@ -139484,7 +136924,6 @@ characters.data={ variants=variants_forms, }, [0xFF0D]={ - adobename="hyphenmonospace", category="pd", cjkwd="f", description="FULLWIDTH HYPHEN-MINUS", @@ -139494,7 +136933,6 @@ characters.data={ unicodeslot=0xFF0D, }, [0xFF0E]={ - adobename="periodmonospace", category="po", cjkwd="f", description="FULLWIDTH FULL STOP", @@ -139505,7 +136943,6 @@ characters.data={ variants=variants_forms, }, [0xFF0F]={ - adobename="slashmonospace", category="po", cjkwd="f", description="FULLWIDTH SOLIDUS", @@ -139515,7 +136952,6 @@ characters.data={ unicodeslot=0xFF0F, }, [0xFF10]={ - adobename="zeromonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT ZERO", @@ -139528,7 +136964,6 @@ characters.data={ }, }, [0xFF11]={ - adobename="onemonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT ONE", @@ -139538,7 +136973,6 @@ characters.data={ unicodeslot=0xFF11, }, [0xFF12]={ - adobename="twomonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT TWO", @@ -139548,7 +136982,6 @@ characters.data={ unicodeslot=0xFF12, }, [0xFF13]={ - adobename="threemonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT THREE", @@ -139558,7 +136991,6 @@ characters.data={ unicodeslot=0xFF13, }, [0xFF14]={ - adobename="fourmonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT FOUR", @@ -139568,7 +137000,6 @@ characters.data={ unicodeslot=0xFF14, }, [0xFF15]={ - adobename="fivemonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT FIVE", @@ -139578,7 +137009,6 @@ characters.data={ unicodeslot=0xFF15, }, [0xFF16]={ - adobename="sixmonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT SIX", @@ -139588,7 +137018,6 @@ characters.data={ unicodeslot=0xFF16, }, [0xFF17]={ - adobename="sevenmonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT SEVEN", @@ -139598,7 +137027,6 @@ characters.data={ unicodeslot=0xFF17, }, [0xFF18]={ - adobename="eightmonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT EIGHT", @@ -139608,7 +137036,6 @@ characters.data={ unicodeslot=0xFF18, }, [0xFF19]={ - adobename="ninemonospace", category="nd", cjkwd="f", description="FULLWIDTH DIGIT NINE", @@ -139618,7 +137045,6 @@ characters.data={ unicodeslot=0xFF19, }, [0xFF1A]={ - adobename="colonmonospace", category="po", cjkwd="f", description="FULLWIDTH COLON", @@ -139629,7 +137055,6 @@ characters.data={ variants=variants_forms, }, [0xFF1B]={ - adobename="semicolonmonospace", category="po", cjkwd="f", description="FULLWIDTH SEMICOLON", @@ -139640,7 +137065,6 @@ characters.data={ variants=variants_forms, }, [0xFF1C]={ - adobename="lessmonospace", category="sm", cjkwd="f", description="FULLWIDTH LESS-THAN SIGN", @@ -139652,7 +137076,6 @@ characters.data={ unicodeslot=0xFF1C, }, [0xFF1D]={ - adobename="equalmonospace", category="sm", cjkwd="f", description="FULLWIDTH EQUALS SIGN", @@ -139662,7 +137085,6 @@ characters.data={ unicodeslot=0xFF1D, }, [0xFF1E]={ - adobename="greatermonospace", category="sm", cjkwd="f", description="FULLWIDTH GREATER-THAN SIGN", @@ -139674,7 +137096,6 @@ characters.data={ unicodeslot=0xFF1E, }, [0xFF1F]={ - adobename="questionmonospace", category="po", cjkwd="f", description="FULLWIDTH QUESTION MARK", @@ -139685,7 +137106,6 @@ characters.data={ variants=variants_forms, }, [0xFF20]={ - adobename="atmonospace", category="po", cjkwd="f", description="FULLWIDTH COMMERCIAL AT", @@ -139695,7 +137115,6 @@ characters.data={ unicodeslot=0xFF20, }, [0xFF21]={ - adobename="Amonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER A", @@ -139706,7 +137125,6 @@ characters.data={ unicodeslot=0xFF21, }, [0xFF22]={ - adobename="Bmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER B", @@ -139717,7 +137135,6 @@ characters.data={ unicodeslot=0xFF22, }, [0xFF23]={ - adobename="Cmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER C", @@ -139728,7 +137145,6 @@ characters.data={ unicodeslot=0xFF23, }, [0xFF24]={ - adobename="Dmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER D", @@ -139739,7 +137155,6 @@ characters.data={ unicodeslot=0xFF24, }, [0xFF25]={ - adobename="Emonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER E", @@ -139750,7 +137165,6 @@ characters.data={ unicodeslot=0xFF25, }, [0xFF26]={ - adobename="Fmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER F", @@ -139761,7 +137175,6 @@ characters.data={ unicodeslot=0xFF26, }, [0xFF27]={ - adobename="Gmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER G", @@ -139772,7 +137185,6 @@ characters.data={ unicodeslot=0xFF27, }, [0xFF28]={ - adobename="Hmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER H", @@ -139783,7 +137195,6 @@ characters.data={ unicodeslot=0xFF28, }, [0xFF29]={ - adobename="Imonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER I", @@ -139794,7 +137205,6 @@ characters.data={ unicodeslot=0xFF29, }, [0xFF2A]={ - adobename="Jmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER J", @@ -139805,7 +137215,6 @@ characters.data={ unicodeslot=0xFF2A, }, [0xFF2B]={ - adobename="Kmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER K", @@ -139816,7 +137225,6 @@ characters.data={ unicodeslot=0xFF2B, }, [0xFF2C]={ - adobename="Lmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER L", @@ -139827,7 +137235,6 @@ characters.data={ unicodeslot=0xFF2C, }, [0xFF2D]={ - adobename="Mmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER M", @@ -139838,7 +137245,6 @@ characters.data={ unicodeslot=0xFF2D, }, [0xFF2E]={ - adobename="Nmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER N", @@ -139849,7 +137255,6 @@ characters.data={ unicodeslot=0xFF2E, }, [0xFF2F]={ - adobename="Omonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER O", @@ -139860,7 +137265,6 @@ characters.data={ unicodeslot=0xFF2F, }, [0xFF30]={ - adobename="Pmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER P", @@ -139871,7 +137275,6 @@ characters.data={ unicodeslot=0xFF30, }, [0xFF31]={ - adobename="Qmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER Q", @@ -139882,7 +137285,6 @@ characters.data={ unicodeslot=0xFF31, }, [0xFF32]={ - adobename="Rmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER R", @@ -139893,7 +137295,6 @@ characters.data={ unicodeslot=0xFF32, }, [0xFF33]={ - adobename="Smonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER S", @@ -139904,7 +137305,6 @@ characters.data={ unicodeslot=0xFF33, }, [0xFF34]={ - adobename="Tmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER T", @@ -139915,7 +137315,6 @@ characters.data={ unicodeslot=0xFF34, }, [0xFF35]={ - adobename="Umonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER U", @@ -139926,7 +137325,6 @@ characters.data={ unicodeslot=0xFF35, }, [0xFF36]={ - adobename="Vmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER V", @@ -139937,7 +137335,6 @@ characters.data={ unicodeslot=0xFF36, }, [0xFF37]={ - adobename="Wmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER W", @@ -139948,7 +137345,6 @@ characters.data={ unicodeslot=0xFF37, }, [0xFF38]={ - adobename="Xmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER X", @@ -139959,7 +137355,6 @@ characters.data={ unicodeslot=0xFF38, }, [0xFF39]={ - adobename="Ymonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER Y", @@ -139970,7 +137365,6 @@ characters.data={ unicodeslot=0xFF39, }, [0xFF3A]={ - adobename="Zmonospace", category="lu", cjkwd="f", description="FULLWIDTH LATIN CAPITAL LETTER Z", @@ -139981,7 +137375,6 @@ characters.data={ unicodeslot=0xFF3A, }, [0xFF3B]={ - adobename="bracketleftmonospace", category="ps", cjkwd="f", description="FULLWIDTH LEFT SQUARE BRACKET", @@ -139993,7 +137386,6 @@ characters.data={ unicodeslot=0xFF3B, }, [0xFF3C]={ - adobename="backslashmonospace", category="po", cjkwd="f", description="FULLWIDTH REVERSE SOLIDUS", @@ -140003,7 +137395,6 @@ characters.data={ unicodeslot=0xFF3C, }, [0xFF3D]={ - adobename="bracketrightmonospace", category="pe", cjkwd="f", description="FULLWIDTH RIGHT SQUARE BRACKET", @@ -140015,7 +137406,6 @@ characters.data={ unicodeslot=0xFF3D, }, [0xFF3E]={ - adobename="asciicircummonospace", category="sk", cjkwd="f", description="FULLWIDTH CIRCUMFLEX ACCENT", @@ -140025,7 +137415,6 @@ characters.data={ unicodeslot=0xFF3E, }, [0xFF3F]={ - adobename="underscoremonospace", category="pc", cjkwd="f", description="FULLWIDTH LOW LINE", @@ -140035,7 +137424,6 @@ characters.data={ unicodeslot=0xFF3F, }, [0xFF40]={ - adobename="gravemonospace", category="sk", cjkwd="f", description="FULLWIDTH GRAVE ACCENT", @@ -140045,7 +137433,6 @@ characters.data={ unicodeslot=0xFF40, }, [0xFF41]={ - adobename="amonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER A", @@ -140056,7 +137443,6 @@ characters.data={ unicodeslot=0xFF41, }, [0xFF42]={ - adobename="bmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER B", @@ -140067,7 +137453,6 @@ characters.data={ unicodeslot=0xFF42, }, [0xFF43]={ - adobename="cmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER C", @@ -140078,7 +137463,6 @@ characters.data={ unicodeslot=0xFF43, }, [0xFF44]={ - adobename="dmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER D", @@ -140089,7 +137473,6 @@ characters.data={ unicodeslot=0xFF44, }, [0xFF45]={ - adobename="emonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER E", @@ -140100,7 +137483,6 @@ characters.data={ unicodeslot=0xFF45, }, [0xFF46]={ - adobename="fmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER F", @@ -140111,7 +137493,6 @@ characters.data={ unicodeslot=0xFF46, }, [0xFF47]={ - adobename="gmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER G", @@ -140122,7 +137503,6 @@ characters.data={ unicodeslot=0xFF47, }, [0xFF48]={ - adobename="hmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER H", @@ -140133,7 +137513,6 @@ characters.data={ unicodeslot=0xFF48, }, [0xFF49]={ - adobename="imonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER I", @@ -140144,7 +137523,6 @@ characters.data={ unicodeslot=0xFF49, }, [0xFF4A]={ - adobename="jmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER J", @@ -140155,7 +137533,6 @@ characters.data={ unicodeslot=0xFF4A, }, [0xFF4B]={ - adobename="kmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER K", @@ -140166,7 +137543,6 @@ characters.data={ unicodeslot=0xFF4B, }, [0xFF4C]={ - adobename="lmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER L", @@ -140177,7 +137553,6 @@ characters.data={ unicodeslot=0xFF4C, }, [0xFF4D]={ - adobename="mmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER M", @@ -140188,7 +137563,6 @@ characters.data={ unicodeslot=0xFF4D, }, [0xFF4E]={ - adobename="nmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER N", @@ -140199,7 +137573,6 @@ characters.data={ unicodeslot=0xFF4E, }, [0xFF4F]={ - adobename="omonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER O", @@ -140210,7 +137583,6 @@ characters.data={ unicodeslot=0xFF4F, }, [0xFF50]={ - adobename="pmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER P", @@ -140221,7 +137593,6 @@ characters.data={ unicodeslot=0xFF50, }, [0xFF51]={ - adobename="qmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER Q", @@ -140232,7 +137603,6 @@ characters.data={ unicodeslot=0xFF51, }, [0xFF52]={ - adobename="rmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER R", @@ -140243,7 +137613,6 @@ characters.data={ unicodeslot=0xFF52, }, [0xFF53]={ - adobename="smonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER S", @@ -140254,7 +137623,6 @@ characters.data={ unicodeslot=0xFF53, }, [0xFF54]={ - adobename="tmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER T", @@ -140265,7 +137633,6 @@ characters.data={ unicodeslot=0xFF54, }, [0xFF55]={ - adobename="umonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER U", @@ -140276,7 +137643,6 @@ characters.data={ unicodeslot=0xFF55, }, [0xFF56]={ - adobename="vmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER V", @@ -140287,7 +137653,6 @@ characters.data={ unicodeslot=0xFF56, }, [0xFF57]={ - adobename="wmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER W", @@ -140298,7 +137663,6 @@ characters.data={ unicodeslot=0xFF57, }, [0xFF58]={ - adobename="xmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER X", @@ -140309,7 +137673,6 @@ characters.data={ unicodeslot=0xFF58, }, [0xFF59]={ - adobename="ymonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER Y", @@ -140320,7 +137683,6 @@ characters.data={ unicodeslot=0xFF59, }, [0xFF5A]={ - adobename="zmonospace", category="ll", cjkwd="f", description="FULLWIDTH LATIN SMALL LETTER Z", @@ -140331,7 +137693,6 @@ characters.data={ unicodeslot=0xFF5A, }, [0xFF5B]={ - adobename="braceleftmonospace", category="ps", cjkwd="f", description="FULLWIDTH LEFT CURLY BRACKET", @@ -140343,7 +137704,6 @@ characters.data={ unicodeslot=0xFF5B, }, [0xFF5C]={ - adobename="barmonospace", category="sm", cjkwd="f", description="FULLWIDTH VERTICAL LINE", @@ -140353,7 +137713,6 @@ characters.data={ unicodeslot=0xFF5C, }, [0xFF5D]={ - adobename="bracerightmonospace", category="pe", cjkwd="f", description="FULLWIDTH RIGHT CURLY BRACKET", @@ -140365,7 +137724,6 @@ characters.data={ unicodeslot=0xFF5D, }, [0xFF5E]={ - adobename="asciitildemonospace", category="sm", cjkwd="f", description="FULLWIDTH TILDE", @@ -140397,7 +137755,6 @@ characters.data={ unicodeslot=0xFF60, }, [0xFF61]={ - adobename="periodhalfwidth", category="po", cjkwd="h", description="HALFWIDTH IDEOGRAPHIC FULL STOP", @@ -140407,7 +137764,6 @@ characters.data={ unicodeslot=0xFF61, }, [0xFF62]={ - adobename="cornerbracketlefthalfwidth", category="ps", cjkwd="h", description="HALFWIDTH LEFT CORNER BRACKET", @@ -140419,7 +137775,6 @@ characters.data={ unicodeslot=0xFF62, }, [0xFF63]={ - adobename="cornerbracketrighthalfwidth", category="pe", cjkwd="h", description="HALFWIDTH RIGHT CORNER BRACKET", @@ -140431,7 +137786,6 @@ characters.data={ unicodeslot=0xFF63, }, [0xFF64]={ - adobename="ideographiccommaleft", category="po", cjkwd="h", description="HALFWIDTH IDEOGRAPHIC COMMA", @@ -140441,7 +137795,6 @@ characters.data={ unicodeslot=0xFF64, }, [0xFF65]={ - adobename="middledotkatakanahalfwidth", category="po", cjkwd="h", description="HALFWIDTH KATAKANA MIDDLE DOT", @@ -140451,7 +137804,6 @@ characters.data={ unicodeslot=0xFF65, }, [0xFF66]={ - adobename="wokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER WO", @@ -140462,7 +137814,6 @@ characters.data={ unicodeslot=0xFF66, }, [0xFF67]={ - adobename="asmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL A", @@ -140472,7 +137823,6 @@ characters.data={ unicodeslot=0xFF67, }, [0xFF68]={ - adobename="ismallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL I", @@ -140482,7 +137832,6 @@ characters.data={ unicodeslot=0xFF68, }, [0xFF69]={ - adobename="usmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL U", @@ -140492,7 +137841,6 @@ characters.data={ unicodeslot=0xFF69, }, [0xFF6A]={ - adobename="esmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL E", @@ -140502,7 +137850,6 @@ characters.data={ unicodeslot=0xFF6A, }, [0xFF6B]={ - adobename="osmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL O", @@ -140512,7 +137859,6 @@ characters.data={ unicodeslot=0xFF6B, }, [0xFF6C]={ - adobename="yasmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL YA", @@ -140523,7 +137869,6 @@ characters.data={ unicodeslot=0xFF6C, }, [0xFF6D]={ - adobename="yusmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL YU", @@ -140534,7 +137879,6 @@ characters.data={ unicodeslot=0xFF6D, }, [0xFF6E]={ - adobename="yosmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL YO", @@ -140545,7 +137889,6 @@ characters.data={ unicodeslot=0xFF6E, }, [0xFF6F]={ - adobename="tusmallkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SMALL TU", @@ -140556,7 +137899,6 @@ characters.data={ unicodeslot=0xFF6F, }, [0xFF70]={ - adobename="katahiraprolongmarkhalfwidth", category="lm", cjkwd="h", description="HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK", @@ -140566,7 +137908,6 @@ characters.data={ unicodeslot=0xFF70, }, [0xFF71]={ - adobename="akatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER A", @@ -140577,7 +137918,6 @@ characters.data={ unicodeslot=0xFF71, }, [0xFF72]={ - adobename="ikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER I", @@ -140588,7 +137928,6 @@ characters.data={ unicodeslot=0xFF72, }, [0xFF73]={ - adobename="ukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER U", @@ -140599,7 +137938,6 @@ characters.data={ unicodeslot=0xFF73, }, [0xFF74]={ - adobename="ekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER E", @@ -140610,7 +137948,6 @@ characters.data={ unicodeslot=0xFF74, }, [0xFF75]={ - adobename="okatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER O", @@ -140621,7 +137958,6 @@ characters.data={ unicodeslot=0xFF75, }, [0xFF76]={ - adobename="kakatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER KA", @@ -140632,7 +137968,6 @@ characters.data={ unicodeslot=0xFF76, }, [0xFF77]={ - adobename="kikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER KI", @@ -140643,7 +137978,6 @@ characters.data={ unicodeslot=0xFF77, }, [0xFF78]={ - adobename="kukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER KU", @@ -140654,7 +137988,6 @@ characters.data={ unicodeslot=0xFF78, }, [0xFF79]={ - adobename="kekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER KE", @@ -140665,7 +137998,6 @@ characters.data={ unicodeslot=0xFF79, }, [0xFF7A]={ - adobename="kokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER KO", @@ -140676,7 +138008,6 @@ characters.data={ unicodeslot=0xFF7A, }, [0xFF7B]={ - adobename="sakatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SA", @@ -140687,7 +138018,6 @@ characters.data={ unicodeslot=0xFF7B, }, [0xFF7C]={ - adobename="sikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SI", @@ -140698,7 +138028,6 @@ characters.data={ unicodeslot=0xFF7C, }, [0xFF7D]={ - adobename="sukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SU", @@ -140709,7 +138038,6 @@ characters.data={ unicodeslot=0xFF7D, }, [0xFF7E]={ - adobename="sekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SE", @@ -140720,7 +138048,6 @@ characters.data={ unicodeslot=0xFF7E, }, [0xFF7F]={ - adobename="sokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER SO", @@ -140731,7 +138058,6 @@ characters.data={ unicodeslot=0xFF7F, }, [0xFF80]={ - adobename="takatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER TA", @@ -140742,7 +138068,6 @@ characters.data={ unicodeslot=0xFF80, }, [0xFF81]={ - adobename="tikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER TI", @@ -140753,7 +138078,6 @@ characters.data={ unicodeslot=0xFF81, }, [0xFF82]={ - adobename="tukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER TU", @@ -140764,7 +138088,6 @@ characters.data={ unicodeslot=0xFF82, }, [0xFF83]={ - adobename="tekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER TE", @@ -140775,7 +138098,6 @@ characters.data={ unicodeslot=0xFF83, }, [0xFF84]={ - adobename="tokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER TO", @@ -140786,7 +138108,6 @@ characters.data={ unicodeslot=0xFF84, }, [0xFF85]={ - adobename="nakatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER NA", @@ -140797,7 +138118,6 @@ characters.data={ unicodeslot=0xFF85, }, [0xFF86]={ - adobename="nikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER NI", @@ -140808,7 +138128,6 @@ characters.data={ unicodeslot=0xFF86, }, [0xFF87]={ - adobename="nukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER NU", @@ -140819,7 +138138,6 @@ characters.data={ unicodeslot=0xFF87, }, [0xFF88]={ - adobename="nekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER NE", @@ -140830,7 +138148,6 @@ characters.data={ unicodeslot=0xFF88, }, [0xFF89]={ - adobename="nokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER NO", @@ -140841,7 +138158,6 @@ characters.data={ unicodeslot=0xFF89, }, [0xFF8A]={ - adobename="hakatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER HA", @@ -140852,7 +138168,6 @@ characters.data={ unicodeslot=0xFF8A, }, [0xFF8B]={ - adobename="hikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER HI", @@ -140863,7 +138178,6 @@ characters.data={ unicodeslot=0xFF8B, }, [0xFF8C]={ - adobename="hukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER HU", @@ -140874,7 +138188,6 @@ characters.data={ unicodeslot=0xFF8C, }, [0xFF8D]={ - adobename="hekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER HE", @@ -140885,7 +138198,6 @@ characters.data={ unicodeslot=0xFF8D, }, [0xFF8E]={ - adobename="hokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER HO", @@ -140896,7 +138208,6 @@ characters.data={ unicodeslot=0xFF8E, }, [0xFF8F]={ - adobename="makatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER MA", @@ -140907,7 +138218,6 @@ characters.data={ unicodeslot=0xFF8F, }, [0xFF90]={ - adobename="mikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER MI", @@ -140918,7 +138228,6 @@ characters.data={ unicodeslot=0xFF90, }, [0xFF91]={ - adobename="mukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER MU", @@ -140929,7 +138238,6 @@ characters.data={ unicodeslot=0xFF91, }, [0xFF92]={ - adobename="mekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER ME", @@ -140940,7 +138248,6 @@ characters.data={ unicodeslot=0xFF92, }, [0xFF93]={ - adobename="mokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER MO", @@ -140951,7 +138258,6 @@ characters.data={ unicodeslot=0xFF93, }, [0xFF94]={ - adobename="yakatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER YA", @@ -140962,7 +138268,6 @@ characters.data={ unicodeslot=0xFF94, }, [0xFF95]={ - adobename="yukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER YU", @@ -140973,7 +138278,6 @@ characters.data={ unicodeslot=0xFF95, }, [0xFF96]={ - adobename="yokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER YO", @@ -140984,7 +138288,6 @@ characters.data={ unicodeslot=0xFF96, }, [0xFF97]={ - adobename="rakatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER RA", @@ -140995,7 +138298,6 @@ characters.data={ unicodeslot=0xFF97, }, [0xFF98]={ - adobename="rikatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER RI", @@ -141006,7 +138308,6 @@ characters.data={ unicodeslot=0xFF98, }, [0xFF99]={ - adobename="rukatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER RU", @@ -141017,7 +138318,6 @@ characters.data={ unicodeslot=0xFF99, }, [0xFF9A]={ - adobename="rekatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER RE", @@ -141028,7 +138328,6 @@ characters.data={ unicodeslot=0xFF9A, }, [0xFF9B]={ - adobename="rokatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER RO", @@ -141039,7 +138338,6 @@ characters.data={ unicodeslot=0xFF9B, }, [0xFF9C]={ - adobename="wakatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER WA", @@ -141050,7 +138348,6 @@ characters.data={ unicodeslot=0xFF9C, }, [0xFF9D]={ - adobename="nkatakanahalfwidth", category="lo", cjkwd="h", description="HALFWIDTH KATAKANA LETTER N", @@ -141061,7 +138358,6 @@ characters.data={ unicodeslot=0xFF9D, }, [0xFF9E]={ - adobename="voicedmarkkanahalfwidth", category="lm", cjkwd="h", description="HALFWIDTH KATAKANA VOICED SOUND MARK", @@ -141071,7 +138367,6 @@ characters.data={ unicodeslot=0xFF9E, }, [0xFF9F]={ - adobename="semivoicedmarkkanahalfwidth", category="lm", cjkwd="h", description="HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK", @@ -141549,7 +138844,6 @@ characters.data={ unicodeslot=0xFFDC, }, [0xFFE0]={ - adobename="centmonospace", category="sc", cjkwd="f", description="FULLWIDTH CENT SIGN", @@ -141559,7 +138853,6 @@ characters.data={ unicodeslot=0xFFE0, }, [0xFFE1]={ - adobename="sterlingmonospace", category="sc", cjkwd="f", description="FULLWIDTH POUND SIGN", @@ -141578,7 +138871,6 @@ characters.data={ unicodeslot=0xFFE2, }, [0xFFE3]={ - adobename="macronmonospace", category="sk", cjkwd="f", description="FULLWIDTH MACRON", @@ -141597,7 +138889,6 @@ characters.data={ unicodeslot=0xFFE4, }, [0xFFE5]={ - adobename="yenmonospace", category="sc", cjkwd="f", description="FULLWIDTH YEN SIGN", @@ -141607,7 +138898,6 @@ characters.data={ unicodeslot=0xFFE5, }, [0xFFE6]={ - adobename="wonmonospace", category="sc", cjkwd="f", description="FULLWIDTH WON SIGN", @@ -160899,371 +158189,371 @@ characters.data={ category="lo", description="BRAHMI SIGN JIHVAMULIYA", direction="l", - linebreak="al", + linebreak="ap", unicodeslot=0x11003, }, [0x11004]={ category="lo", description="BRAHMI SIGN UPADHMANIYA", direction="l", - linebreak="al", + linebreak="ap", unicodeslot=0x11004, }, [0x11005]={ category="lo", description="BRAHMI LETTER A", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11005, }, [0x11006]={ category="lo", description="BRAHMI LETTER AA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11006, }, [0x11007]={ category="lo", description="BRAHMI LETTER I", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11007, }, [0x11008]={ category="lo", description="BRAHMI LETTER II", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11008, }, [0x11009]={ category="lo", description="BRAHMI LETTER U", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11009, }, [0x1100A]={ category="lo", description="BRAHMI LETTER UU", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1100A, }, [0x1100B]={ category="lo", description="BRAHMI LETTER VOCALIC R", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1100B, }, [0x1100C]={ category="lo", description="BRAHMI LETTER VOCALIC RR", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1100C, }, [0x1100D]={ category="lo", description="BRAHMI LETTER VOCALIC L", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1100D, }, [0x1100E]={ category="lo", description="BRAHMI LETTER VOCALIC LL", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1100E, }, [0x1100F]={ category="lo", description="BRAHMI LETTER E", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1100F, }, [0x11010]={ category="lo", description="BRAHMI LETTER AI", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11010, }, [0x11011]={ category="lo", description="BRAHMI LETTER O", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11011, }, [0x11012]={ category="lo", description="BRAHMI LETTER AU", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11012, }, [0x11013]={ category="lo", description="BRAHMI LETTER KA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11013, }, [0x11014]={ category="lo", description="BRAHMI LETTER KHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11014, }, [0x11015]={ category="lo", description="BRAHMI LETTER GA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11015, }, [0x11016]={ category="lo", description="BRAHMI LETTER GHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11016, }, [0x11017]={ category="lo", description="BRAHMI LETTER NGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11017, }, [0x11018]={ category="lo", description="BRAHMI LETTER CA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11018, }, [0x11019]={ category="lo", description="BRAHMI LETTER CHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11019, }, [0x1101A]={ category="lo", description="BRAHMI LETTER JA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1101A, }, [0x1101B]={ category="lo", description="BRAHMI LETTER JHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1101B, }, [0x1101C]={ category="lo", description="BRAHMI LETTER NYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1101C, }, [0x1101D]={ category="lo", description="BRAHMI LETTER TTA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1101D, }, [0x1101E]={ category="lo", description="BRAHMI LETTER TTHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1101E, }, [0x1101F]={ category="lo", description="BRAHMI LETTER DDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1101F, }, [0x11020]={ category="lo", description="BRAHMI LETTER DDHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11020, }, [0x11021]={ category="lo", description="BRAHMI LETTER NNA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11021, }, [0x11022]={ category="lo", description="BRAHMI LETTER TA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11022, }, [0x11023]={ category="lo", description="BRAHMI LETTER THA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11023, }, [0x11024]={ category="lo", description="BRAHMI LETTER DA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11024, }, [0x11025]={ category="lo", description="BRAHMI LETTER DHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11025, }, [0x11026]={ category="lo", description="BRAHMI LETTER NA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11026, }, [0x11027]={ category="lo", description="BRAHMI LETTER PA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11027, }, [0x11028]={ category="lo", description="BRAHMI LETTER PHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11028, }, [0x11029]={ category="lo", description="BRAHMI LETTER BA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11029, }, [0x1102A]={ category="lo", description="BRAHMI LETTER BHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1102A, }, [0x1102B]={ category="lo", description="BRAHMI LETTER MA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1102B, }, [0x1102C]={ category="lo", description="BRAHMI LETTER YA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1102C, }, [0x1102D]={ category="lo", description="BRAHMI LETTER RA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1102D, }, [0x1102E]={ category="lo", description="BRAHMI LETTER LA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1102E, }, [0x1102F]={ category="lo", description="BRAHMI LETTER VA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1102F, }, [0x11030]={ category="lo", description="BRAHMI LETTER SHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11030, }, [0x11031]={ category="lo", description="BRAHMI LETTER SSA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11031, }, [0x11032]={ category="lo", description="BRAHMI LETTER SA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11032, }, [0x11033]={ category="lo", description="BRAHMI LETTER HA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11033, }, [0x11034]={ category="lo", description="BRAHMI LETTER LLA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11034, }, [0x11035]={ category="lo", description="BRAHMI LETTER OLD TAMIL LLLA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11035, }, [0x11036]={ category="lo", description="BRAHMI LETTER OLD TAMIL RRA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11036, }, [0x11037]={ category="lo", description="BRAHMI LETTER OLD TAMIL NNNA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11037, }, [0x11038]={ @@ -161369,7 +158659,7 @@ characters.data={ combining=0x9, description="BRAHMI VIRAMA", direction="nsm", - linebreak="cm", + linebreak="vi", unicodeslot=0x11046, }, [0x11047]={ @@ -161390,245 +158680,245 @@ characters.data={ category="po", description="BRAHMI PUNCTUATION DOT", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x11049, }, [0x1104A]={ category="po", description="BRAHMI PUNCTUATION DOUBLE DOT", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1104A, }, [0x1104B]={ category="po", description="BRAHMI PUNCTUATION LINE", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1104B, }, [0x1104C]={ category="po", description="BRAHMI PUNCTUATION CRESCENT BAR", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1104C, }, [0x1104D]={ category="po", description="BRAHMI PUNCTUATION LOTUS", direction="l", - linebreak="al", + linebreak="id", unicodeslot=0x1104D, }, [0x11052]={ category="no", description="BRAHMI NUMBER ONE", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11052, }, [0x11053]={ category="no", description="BRAHMI NUMBER TWO", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11053, }, [0x11054]={ category="no", description="BRAHMI NUMBER THREE", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11054, }, [0x11055]={ category="no", description="BRAHMI NUMBER FOUR", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11055, }, [0x11056]={ category="no", description="BRAHMI NUMBER FIVE", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11056, }, [0x11057]={ category="no", description="BRAHMI NUMBER SIX", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11057, }, [0x11058]={ category="no", description="BRAHMI NUMBER SEVEN", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11058, }, [0x11059]={ category="no", description="BRAHMI NUMBER EIGHT", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11059, }, [0x1105A]={ category="no", description="BRAHMI NUMBER NINE", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x1105A, }, [0x1105B]={ category="no", description="BRAHMI NUMBER TEN", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x1105B, }, [0x1105C]={ category="no", description="BRAHMI NUMBER TWENTY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x1105C, }, [0x1105D]={ category="no", description="BRAHMI NUMBER THIRTY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x1105D, }, [0x1105E]={ category="no", description="BRAHMI NUMBER FORTY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x1105E, }, [0x1105F]={ category="no", description="BRAHMI NUMBER FIFTY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x1105F, }, [0x11060]={ category="no", description="BRAHMI NUMBER SIXTY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11060, }, [0x11061]={ category="no", description="BRAHMI NUMBER SEVENTY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11061, }, [0x11062]={ category="no", description="BRAHMI NUMBER EIGHTY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11062, }, [0x11063]={ category="no", description="BRAHMI NUMBER NINETY", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11063, }, [0x11064]={ category="no", description="BRAHMI NUMBER ONE HUNDRED", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11064, }, [0x11065]={ category="no", description="BRAHMI NUMBER ONE THOUSAND", direction="on", - linebreak="al", + linebreak="id", unicodeslot=0x11065, }, [0x11066]={ category="nd", description="BRAHMI DIGIT ZERO", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11066, }, [0x11067]={ category="nd", description="BRAHMI DIGIT ONE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11067, }, [0x11068]={ category="nd", description="BRAHMI DIGIT TWO", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11068, }, [0x11069]={ category="nd", description="BRAHMI DIGIT THREE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11069, }, [0x1106A]={ category="nd", description="BRAHMI DIGIT FOUR", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x1106A, }, [0x1106B]={ category="nd", description="BRAHMI DIGIT FIVE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x1106B, }, [0x1106C]={ category="nd", description="BRAHMI DIGIT SIX", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x1106C, }, [0x1106D]={ category="nd", description="BRAHMI DIGIT SEVEN", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x1106D, }, [0x1106E]={ category="nd", description="BRAHMI DIGIT EIGHT", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x1106E, }, [0x1106F]={ category="nd", description="BRAHMI DIGIT NINE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x1106F, }, [0x11070]={ @@ -161643,14 +158933,14 @@ characters.data={ category="lo", description="BRAHMI LETTER OLD TAMIL SHORT E", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11071, }, [0x11072]={ category="lo", description="BRAHMI LETTER OLD TAMIL SHORT O", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11072, }, [0x11073]={ @@ -161671,7 +158961,7 @@ characters.data={ category="lo", description="BRAHMI LETTER OLD TAMIL LLA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11075, }, [0x1107F]={ @@ -161679,7 +158969,7 @@ characters.data={ combining=0x9, description="BRAHMI NUMBER JOINER", direction="nsm", - linebreak="cm", + linebreak="gl", unicodeslot=0x1107F, }, [0x11080]={ @@ -162119,7 +159409,7 @@ characters.data={ category="cf", description="KAITHI NUMBER SIGN", direction="l", - linebreak="al", + linebreak="nu", unicodeslot=0x110BD, }, [0x110BE]={ @@ -162162,7 +159452,7 @@ characters.data={ category="cf", description="KAITHI NUMBER SIGN ABOVE", direction="l", - linebreak="al", + linebreak="nu", unicodeslot=0x110CD, }, [0x110D0]={ @@ -165242,322 +162532,322 @@ characters.data={ category="lo", description="GRANTHA LETTER A", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11305, }, [0x11306]={ category="lo", description="GRANTHA LETTER AA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11306, }, [0x11307]={ category="lo", description="GRANTHA LETTER I", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11307, }, [0x11308]={ category="lo", description="GRANTHA LETTER II", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11308, }, [0x11309]={ category="lo", description="GRANTHA LETTER U", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11309, }, [0x1130A]={ category="lo", description="GRANTHA LETTER UU", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1130A, }, [0x1130B]={ category="lo", description="GRANTHA LETTER VOCALIC R", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1130B, }, [0x1130C]={ category="lo", description="GRANTHA LETTER VOCALIC L", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1130C, }, [0x1130F]={ category="lo", description="GRANTHA LETTER EE", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1130F, }, [0x11310]={ category="lo", description="GRANTHA LETTER AI", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11310, }, [0x11313]={ category="lo", description="GRANTHA LETTER OO", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11313, }, [0x11314]={ category="lo", description="GRANTHA LETTER AU", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11314, }, [0x11315]={ category="lo", description="GRANTHA LETTER KA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11315, }, [0x11316]={ category="lo", description="GRANTHA LETTER KHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11316, }, [0x11317]={ category="lo", description="GRANTHA LETTER GA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11317, }, [0x11318]={ category="lo", description="GRANTHA LETTER GHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11318, }, [0x11319]={ category="lo", description="GRANTHA LETTER NGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11319, }, [0x1131A]={ category="lo", description="GRANTHA LETTER CA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1131A, }, [0x1131B]={ category="lo", description="GRANTHA LETTER CHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1131B, }, [0x1131C]={ category="lo", description="GRANTHA LETTER JA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1131C, }, [0x1131D]={ category="lo", description="GRANTHA LETTER JHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1131D, }, [0x1131E]={ category="lo", description="GRANTHA LETTER NYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1131E, }, [0x1131F]={ category="lo", description="GRANTHA LETTER TTA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1131F, }, [0x11320]={ category="lo", description="GRANTHA LETTER TTHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11320, }, [0x11321]={ category="lo", description="GRANTHA LETTER DDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11321, }, [0x11322]={ category="lo", description="GRANTHA LETTER DDHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11322, }, [0x11323]={ category="lo", description="GRANTHA LETTER NNA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11323, }, [0x11324]={ category="lo", description="GRANTHA LETTER TA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11324, }, [0x11325]={ category="lo", description="GRANTHA LETTER THA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11325, }, [0x11326]={ category="lo", description="GRANTHA LETTER DA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11326, }, [0x11327]={ category="lo", description="GRANTHA LETTER DHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11327, }, [0x11328]={ category="lo", description="GRANTHA LETTER NA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11328, }, [0x1132A]={ category="lo", description="GRANTHA LETTER PA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1132A, }, [0x1132B]={ category="lo", description="GRANTHA LETTER PHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1132B, }, [0x1132C]={ category="lo", description="GRANTHA LETTER BA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1132C, }, [0x1132D]={ category="lo", description="GRANTHA LETTER BHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1132D, }, [0x1132E]={ category="lo", description="GRANTHA LETTER MA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1132E, }, [0x1132F]={ category="lo", description="GRANTHA LETTER YA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1132F, }, [0x11330]={ category="lo", description="GRANTHA LETTER RA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11330, }, [0x11332]={ category="lo", description="GRANTHA LETTER LA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11332, }, [0x11333]={ category="lo", description="GRANTHA LETTER LLA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11333, }, [0x11335]={ category="lo", description="GRANTHA LETTER VA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11335, }, [0x11336]={ category="lo", description="GRANTHA LETTER SHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11336, }, [0x11337]={ category="lo", description="GRANTHA LETTER SSA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11337, }, [0x11338]={ category="lo", description="GRANTHA LETTER SA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11338, }, [0x11339]={ category="lo", description="GRANTHA LETTER HA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11339, }, [0x1133B]={ @@ -165580,7 +162870,7 @@ characters.data={ category="lo", description="GRANTHA SIGN AVAGRAHA", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0x1133D, }, [0x1133E]={ @@ -165667,14 +162957,14 @@ characters.data={ combining=0x9, description="GRANTHA SIGN VIRAMA", direction="l", - linebreak="cm", + linebreak="vi", unicodeslot=0x1134D, }, [0x11350]={ category="lo", description="GRANTHA OM", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11350, }, [0x11357]={ @@ -165688,35 +162978,35 @@ characters.data={ category="lo", description="GRANTHA SIGN PLUTA", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0x1135D, }, [0x1135E]={ category="lo", description="GRANTHA LETTER VEDIC ANUSVARA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1135E, }, [0x1135F]={ category="lo", description="GRANTHA LETTER VEDIC DOUBLE ANUSVARA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x1135F, }, [0x11360]={ category="lo", description="GRANTHA LETTER VOCALIC RR", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11360, }, [0x11361]={ category="lo", description="GRANTHA LETTER VOCALIC LL", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11361, }, [0x11362]={ @@ -170376,294 +167666,294 @@ characters.data={ category="lo", description="DIVES AKURU LETTER A", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11900, }, [0x11901]={ category="lo", description="DIVES AKURU LETTER AA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11901, }, [0x11902]={ category="lo", description="DIVES AKURU LETTER I", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11902, }, [0x11903]={ category="lo", description="DIVES AKURU LETTER II", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11903, }, [0x11904]={ category="lo", description="DIVES AKURU LETTER U", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11904, }, [0x11905]={ category="lo", description="DIVES AKURU LETTER UU", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11905, }, [0x11906]={ category="lo", description="DIVES AKURU LETTER E", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11906, }, [0x11909]={ category="lo", description="DIVES AKURU LETTER O", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11909, }, [0x1190C]={ category="lo", description="DIVES AKURU LETTER KA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1190C, }, [0x1190D]={ category="lo", description="DIVES AKURU LETTER KHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1190D, }, [0x1190E]={ category="lo", description="DIVES AKURU LETTER GA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1190E, }, [0x1190F]={ category="lo", description="DIVES AKURU LETTER GHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1190F, }, [0x11910]={ category="lo", description="DIVES AKURU LETTER NGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11910, }, [0x11911]={ category="lo", description="DIVES AKURU LETTER CA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11911, }, [0x11912]={ category="lo", description="DIVES AKURU LETTER CHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11912, }, [0x11913]={ category="lo", description="DIVES AKURU LETTER JA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11913, }, [0x11915]={ category="lo", description="DIVES AKURU LETTER NYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11915, }, [0x11916]={ category="lo", description="DIVES AKURU LETTER TTA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11916, }, [0x11918]={ category="lo", description="DIVES AKURU LETTER DDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11918, }, [0x11919]={ category="lo", description="DIVES AKURU LETTER DDHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11919, }, [0x1191A]={ category="lo", description="DIVES AKURU LETTER NNA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1191A, }, [0x1191B]={ category="lo", description="DIVES AKURU LETTER TA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1191B, }, [0x1191C]={ category="lo", description="DIVES AKURU LETTER THA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1191C, }, [0x1191D]={ category="lo", description="DIVES AKURU LETTER DA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1191D, }, [0x1191E]={ category="lo", description="DIVES AKURU LETTER DHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1191E, }, [0x1191F]={ category="lo", description="DIVES AKURU LETTER NA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1191F, }, [0x11920]={ category="lo", description="DIVES AKURU LETTER PA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11920, }, [0x11921]={ category="lo", description="DIVES AKURU LETTER PHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11921, }, [0x11922]={ category="lo", description="DIVES AKURU LETTER BA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11922, }, [0x11923]={ category="lo", description="DIVES AKURU LETTER BHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11923, }, [0x11924]={ category="lo", description="DIVES AKURU LETTER MA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11924, }, [0x11925]={ category="lo", description="DIVES AKURU LETTER YA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11925, }, [0x11926]={ category="lo", description="DIVES AKURU LETTER YYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11926, }, [0x11927]={ category="lo", description="DIVES AKURU LETTER RA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11927, }, [0x11928]={ category="lo", description="DIVES AKURU LETTER LA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11928, }, [0x11929]={ category="lo", description="DIVES AKURU LETTER VA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11929, }, [0x1192A]={ category="lo", description="DIVES AKURU LETTER SHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1192A, }, [0x1192B]={ category="lo", description="DIVES AKURU LETTER SSA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1192B, }, [0x1192C]={ category="lo", description="DIVES AKURU LETTER SA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1192C, }, [0x1192D]={ category="lo", description="DIVES AKURU LETTER HA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1192D, }, [0x1192E]={ category="lo", description="DIVES AKURU LETTER LLA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1192E, }, [0x1192F]={ category="lo", description="DIVES AKURU LETTER ZA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x1192F, }, [0x11930]={ @@ -170750,14 +168040,14 @@ characters.data={ combining=0x9, description="DIVES AKURU VIRAMA", direction="nsm", - linebreak="cm", + linebreak="vi", unicodeslot=0x1193E, }, [0x1193F]={ category="lo", description="DIVES AKURU PREFIXED NASAL SIGN", direction="l", - linebreak="al", + linebreak="ap", unicodeslot=0x1193F, }, [0x11940]={ @@ -170771,7 +168061,7 @@ characters.data={ category="lo", description="DIVES AKURU INITIAL RA", direction="l", - linebreak="al", + linebreak="ap", unicodeslot=0x11941, }, [0x11942]={ @@ -170814,70 +168104,70 @@ characters.data={ category="nd", description="DIVES AKURU DIGIT ZERO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11950, }, [0x11951]={ category="nd", description="DIVES AKURU DIGIT ONE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11951, }, [0x11952]={ category="nd", description="DIVES AKURU DIGIT TWO", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11952, }, [0x11953]={ category="nd", description="DIVES AKURU DIGIT THREE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11953, }, [0x11954]={ category="nd", description="DIVES AKURU DIGIT FOUR", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11954, }, [0x11955]={ category="nd", description="DIVES AKURU DIGIT FIVE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11955, }, [0x11956]={ category="nd", description="DIVES AKURU DIGIT SIX", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11956, }, [0x11957]={ category="nd", description="DIVES AKURU DIGIT SEVEN", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11957, }, [0x11958]={ category="nd", description="DIVES AKURU DIGIT EIGHT", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11958, }, [0x11959]={ category="nd", description="DIVES AKURU DIGIT NINE", direction="l", - linebreak="nu", + linebreak="id", unicodeslot=0x11959, }, [0x119A0]={ @@ -175135,133 +172425,133 @@ characters.data={ category="lo", description="MAKASAR LETTER KA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE0, }, [0x11EE1]={ category="lo", description="MAKASAR LETTER GA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE1, }, [0x11EE2]={ category="lo", description="MAKASAR LETTER NGA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE2, }, [0x11EE3]={ category="lo", description="MAKASAR LETTER PA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE3, }, [0x11EE4]={ category="lo", description="MAKASAR LETTER BA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE4, }, [0x11EE5]={ category="lo", description="MAKASAR LETTER MA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE5, }, [0x11EE6]={ category="lo", description="MAKASAR LETTER TA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE6, }, [0x11EE7]={ category="lo", description="MAKASAR LETTER DA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE7, }, [0x11EE8]={ category="lo", description="MAKASAR LETTER NA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE8, }, [0x11EE9]={ category="lo", description="MAKASAR LETTER CA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EE9, }, [0x11EEA]={ category="lo", description="MAKASAR LETTER JA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EEA, }, [0x11EEB]={ category="lo", description="MAKASAR LETTER NYA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EEB, }, [0x11EEC]={ category="lo", description="MAKASAR LETTER YA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EEC, }, [0x11EED]={ category="lo", description="MAKASAR LETTER RA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EED, }, [0x11EEE]={ category="lo", description="MAKASAR LETTER LA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EEE, }, [0x11EEF]={ category="lo", description="MAKASAR LETTER VA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EEF, }, [0x11EF0]={ category="lo", description="MAKASAR LETTER SA", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EF0, }, [0x11EF1]={ category="lo", description="MAKASAR LETTER A", direction="l", - linebreak="al", + linebreak="as", unicodeslot=0x11EF1, }, [0x11EF2]={ category="lo", description="MAKASAR ANGKA", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0x11EF2, }, [0x11EF3]={ @@ -175296,14 +172586,14 @@ characters.data={ category="po", description="MAKASAR PASSIMBANG", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0x11EF7, }, [0x11EF8]={ category="po", description="MAKASAR END OF SECTION", direction="l", - linebreak="al", + linebreak="ba", unicodeslot=0x11EF8, }, [0x11F00]={ @@ -175324,7 +172614,7 @@ characters.data={ category="lo", description="KAWI SIGN REPHA", direction="l", - linebreak="al", + linebreak="ap", unicodeslot=0x11F02, }, [0x11F03]={ @@ -175338,329 +172628,329 @@ characters.data={ category="lo", description="KAWI LETTER A", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F04, }, [0x11F05]={ category="lo", description="KAWI LETTER AA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F05, }, [0x11F06]={ category="lo", description="KAWI LETTER I", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F06, }, [0x11F07]={ category="lo", description="KAWI LETTER II", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F07, }, [0x11F08]={ category="lo", description="KAWI LETTER U", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F08, }, [0x11F09]={ category="lo", description="KAWI LETTER UU", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F09, }, [0x11F0A]={ category="lo", description="KAWI LETTER VOCALIC R", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F0A, }, [0x11F0B]={ category="lo", description="KAWI LETTER VOCALIC RR", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F0B, }, [0x11F0C]={ category="lo", description="KAWI LETTER VOCALIC L", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F0C, }, [0x11F0D]={ category="lo", description="KAWI LETTER VOCALIC LL", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F0D, }, [0x11F0E]={ category="lo", description="KAWI LETTER E", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F0E, }, [0x11F0F]={ category="lo", description="KAWI LETTER AI", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F0F, }, [0x11F10]={ category="lo", description="KAWI LETTER O", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F10, }, [0x11F12]={ category="lo", description="KAWI LETTER KA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F12, }, [0x11F13]={ category="lo", description="KAWI LETTER KHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F13, }, [0x11F14]={ category="lo", description="KAWI LETTER GA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F14, }, [0x11F15]={ category="lo", description="KAWI LETTER GHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F15, }, [0x11F16]={ category="lo", description="KAWI LETTER NGA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F16, }, [0x11F17]={ category="lo", description="KAWI LETTER CA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F17, }, [0x11F18]={ category="lo", description="KAWI LETTER CHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F18, }, [0x11F19]={ category="lo", description="KAWI LETTER JA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F19, }, [0x11F1A]={ category="lo", description="KAWI LETTER JHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F1A, }, [0x11F1B]={ category="lo", description="KAWI LETTER NYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F1B, }, [0x11F1C]={ category="lo", description="KAWI LETTER TTA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F1C, }, [0x11F1D]={ category="lo", description="KAWI LETTER TTHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F1D, }, [0x11F1E]={ category="lo", description="KAWI LETTER DDA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F1E, }, [0x11F1F]={ category="lo", description="KAWI LETTER DDHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F1F, }, [0x11F20]={ category="lo", description="KAWI LETTER NNA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F20, }, [0x11F21]={ category="lo", description="KAWI LETTER TA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F21, }, [0x11F22]={ category="lo", description="KAWI LETTER THA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F22, }, [0x11F23]={ category="lo", description="KAWI LETTER DA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F23, }, [0x11F24]={ category="lo", description="KAWI LETTER DHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F24, }, [0x11F25]={ category="lo", description="KAWI LETTER NA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F25, }, [0x11F26]={ category="lo", description="KAWI LETTER PA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F26, }, [0x11F27]={ category="lo", description="KAWI LETTER PHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F27, }, [0x11F28]={ category="lo", description="KAWI LETTER BA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F28, }, [0x11F29]={ category="lo", description="KAWI LETTER BHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F29, }, [0x11F2A]={ category="lo", description="KAWI LETTER MA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F2A, }, [0x11F2B]={ category="lo", description="KAWI LETTER YA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F2B, }, [0x11F2C]={ category="lo", description="KAWI LETTER RA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F2C, }, [0x11F2D]={ category="lo", description="KAWI LETTER LA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F2D, }, [0x11F2E]={ category="lo", description="KAWI LETTER WA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F2E, }, [0x11F2F]={ category="lo", description="KAWI LETTER SHA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F2F, }, [0x11F30]={ category="lo", description="KAWI LETTER SSA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F30, }, [0x11F31]={ category="lo", description="KAWI LETTER SA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F31, }, [0x11F32]={ category="lo", description="KAWI LETTER HA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F32, }, [0x11F33]={ category="lo", description="KAWI LETTER JNYA", direction="l", - linebreak="al", + linebreak="ak", unicodeslot=0x11F33, }, [0x11F34]={ @@ -175746,7 +173036,7 @@ characters.data={ combining=0x9, description="KAWI CONJOINER", direction="nsm", - linebreak="cm", + linebreak="vi", unicodeslot=0x11F42, }, [0x11F43]={ @@ -175844,70 +173134,70 @@ characters.data={ category="nd", description="KAWI DIGIT ZERO", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F50, }, [0x11F51]={ category="nd", description="KAWI DIGIT ONE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F51, }, [0x11F52]={ category="nd", description="KAWI DIGIT TWO", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F52, }, [0x11F53]={ category="nd", description="KAWI DIGIT THREE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F53, }, [0x11F54]={ category="nd", description="KAWI DIGIT FOUR", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F54, }, [0x11F55]={ category="nd", description="KAWI DIGIT FIVE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F55, }, [0x11F56]={ category="nd", description="KAWI DIGIT SIX", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F56, }, [0x11F57]={ category="nd", description="KAWI DIGIT SEVEN", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F57, }, [0x11F58]={ category="nd", description="KAWI DIGIT EIGHT", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F58, }, [0x11F59]={ category="nd", description="KAWI DIGIT NINE", direction="l", - linebreak="nu", + linebreak="as", unicodeslot=0x11F59, }, [0x11FB0]={ @@ -176650,8 +173940,6 @@ characters.data={ description="CUNEIFORM SIGN ARAD TIMES KUR", direction="l", linebreak="al", - mathclass="ordinary", - mathname="backprime", unicodeslot=0x12035, }, [0x12036]={ @@ -193184,7 +190472,7 @@ characters.data={ category="lo", description="EGYPTIAN HIEROGLYPH V011D", direction="l", - linebreak="al", + linebreak="op", unicodeslot=0x1342F, }, [0x13430]={ @@ -228229,6 +225517,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D400, visual="bf", @@ -228238,6 +225527,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D401, visual="bf", @@ -228247,6 +225537,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D402, visual="bf", @@ -228256,6 +225547,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D403, visual="bf", @@ -228265,6 +225557,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D404, visual="bf", @@ -228274,6 +225567,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D405, visual="bf", @@ -228283,6 +225577,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D406, visual="bf", @@ -228292,6 +225587,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D407, visual="bf", @@ -228301,6 +225597,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D408, visual="bf", @@ -228310,6 +225607,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D409, visual="bf", @@ -228319,6 +225617,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D40A, visual="bf", @@ -228328,6 +225627,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D40B, visual="bf", @@ -228337,6 +225637,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D40C, visual="bf", @@ -228346,6 +225647,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D40D, visual="bf", @@ -228355,6 +225657,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D40E, visual="bf", @@ -228364,6 +225667,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D40F, visual="bf", @@ -228373,6 +225677,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D410, visual="bf", @@ -228382,6 +225687,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D411, visual="bf", @@ -228391,6 +225697,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D412, visual="bf", @@ -228400,6 +225707,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D413, visual="bf", @@ -228409,6 +225717,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D414, visual="bf", @@ -228418,6 +225727,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D415, visual="bf", @@ -228427,6 +225737,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D416, visual="bf", @@ -228436,6 +225747,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D417, visual="bf", @@ -228445,6 +225757,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D418, visual="bf", @@ -228454,6 +225767,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D419, visual="bf", @@ -228463,6 +225777,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D41A, visual="bf", @@ -228472,6 +225787,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D41B, visual="bf", @@ -228481,6 +225797,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D41C, visual="bf", @@ -228490,6 +225807,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D41D, visual="bf", @@ -228499,6 +225817,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D41E, visual="bf", @@ -228508,6 +225827,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D41F, visual="bf", @@ -228517,6 +225837,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D420, visual="bf", @@ -228526,6 +225847,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D421, visual="bf", @@ -228535,6 +225857,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D422, visual="bf", @@ -228544,6 +225867,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D423, visual="bf", @@ -228553,6 +225877,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D424, visual="bf", @@ -228562,6 +225887,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D425, visual="bf", @@ -228571,6 +225897,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D426, visual="bf", @@ -228580,6 +225907,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D427, visual="bf", @@ -228589,6 +225917,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D428, visual="bf", @@ -228598,6 +225927,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D429, visual="bf", @@ -228607,6 +225937,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D42A, visual="bf", @@ -228616,6 +225947,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D42B, visual="bf", @@ -228625,6 +225957,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D42C, visual="bf", @@ -228634,6 +225967,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D42D, visual="bf", @@ -228643,6 +225977,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D42E, visual="bf", @@ -228652,6 +225987,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D42F, visual="bf", @@ -228661,6 +225997,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D430, visual="bf", @@ -228670,6 +226007,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D431, visual="bf", @@ -228679,6 +226017,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D432, visual="bf", @@ -228688,6 +226027,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D433, visual="bf", @@ -228697,6 +226037,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D434, visual="it", @@ -228706,6 +226047,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D435, visual="it", @@ -228715,6 +226057,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D436, visual="it", @@ -228724,11 +226067,13 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL D", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathspec={ { class="differential", - name="Dd", + group="differential", + meaning="differential operator D", + name="mathDitalicshape", }, }, specials={ "font", 0x44 }, @@ -228740,6 +226085,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D438, visual="it", @@ -228749,6 +226095,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D439, visual="it", @@ -228758,6 +226105,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D43A, visual="it", @@ -228767,6 +226115,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D43B, visual="it", @@ -228776,6 +226125,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D43C, visual="it", @@ -228785,6 +226135,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D43D, visual="it", @@ -228794,6 +226145,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D43E, visual="it", @@ -228803,6 +226155,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D43F, visual="it", @@ -228812,6 +226165,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D440, visual="it", @@ -228821,6 +226175,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D441, visual="it", @@ -228830,6 +226185,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D442, visual="it", @@ -228839,6 +226195,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D443, visual="it", @@ -228848,6 +226205,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D444, visual="it", @@ -228857,6 +226215,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D445, visual="it", @@ -228866,6 +226225,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D446, visual="it", @@ -228875,6 +226235,17 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL T", direction="l", linebreak="al", + mathclass="variable", + mathgroup="default", + mathmeaning="𝑇", + mathspec={ + { + class="prime", + group="postfix operator", + meaning="transpose", + name="transposesymbol", + }, + }, specials={ "font", 0x54 }, unicodeslot=0x1D447, visual="it", @@ -228884,6 +226255,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D448, visual="it", @@ -228893,6 +226265,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D449, visual="it", @@ -228902,6 +226275,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D44A, visual="it", @@ -228911,6 +226285,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D44B, visual="it", @@ -228920,6 +226295,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D44C, visual="it", @@ -228929,6 +226305,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D44D, visual="it", @@ -228938,6 +226315,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D44E, visual="it", @@ -228947,6 +226325,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D44F, visual="it", @@ -228956,6 +226335,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D450, visual="it", @@ -228965,11 +226345,14 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL D", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", + mathgroup="whatever", mathspec={ { class="differential", - name="dd", + group="differential", + meaning="differential", + name="mathditalicshape", }, }, specials={ "font", 0x64 }, @@ -228981,7 +226364,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL E", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathspec={ { class="exponential", @@ -228997,6 +226380,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D453, visual="it", @@ -229006,6 +226390,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D454, visual="it", @@ -229015,7 +226400,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL I", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathspec={ { class="imaginary", @@ -229031,7 +226416,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL J", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathspec={ { class="imaginary", @@ -229047,6 +226432,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D458, visual="it", @@ -229056,6 +226442,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D459, visual="it", @@ -229065,6 +226452,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D45A, visual="it", @@ -229074,6 +226462,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D45B, visual="it", @@ -229083,6 +226472,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D45C, visual="it", @@ -229092,6 +226482,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D45D, visual="it", @@ -229101,6 +226492,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D45E, visual="it", @@ -229110,6 +226502,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D45F, visual="it", @@ -229119,6 +226512,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D460, visual="it", @@ -229128,6 +226522,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D461, visual="it", @@ -229137,6 +226532,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D462, visual="it", @@ -229146,6 +226542,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D463, visual="it", @@ -229155,6 +226552,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D464, visual="it", @@ -229164,6 +226562,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D465, visual="it", @@ -229173,6 +226572,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D466, visual="it", @@ -229182,6 +226582,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D467, visual="it", @@ -229191,6 +226592,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D468, visual="bi", @@ -229200,6 +226602,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D469, visual="bi", @@ -229209,6 +226612,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D46A, visual="bi", @@ -229218,6 +226622,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D46B, visual="bi", @@ -229227,6 +226632,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D46C, visual="bi", @@ -229236,6 +226642,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D46D, visual="bi", @@ -229245,6 +226652,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D46E, visual="bi", @@ -229254,6 +226662,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D46F, visual="bi", @@ -229263,6 +226672,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D470, visual="bi", @@ -229272,6 +226682,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D471, visual="bi", @@ -229281,6 +226692,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D472, visual="bi", @@ -229290,6 +226702,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D473, visual="bi", @@ -229299,6 +226712,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D474, visual="bi", @@ -229308,6 +226722,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D475, visual="bi", @@ -229317,6 +226732,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D476, visual="bi", @@ -229326,6 +226742,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D477, visual="bi", @@ -229335,6 +226752,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D478, visual="bi", @@ -229344,6 +226762,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D479, visual="bi", @@ -229353,6 +226772,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D47A, visual="bi", @@ -229362,6 +226782,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D47B, visual="bi", @@ -229371,6 +226792,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D47C, visual="bi", @@ -229380,6 +226802,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D47D, visual="bi", @@ -229389,6 +226812,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D47E, visual="bi", @@ -229398,6 +226822,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D47F, visual="bi", @@ -229407,6 +226832,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D480, visual="bi", @@ -229416,6 +226842,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D481, visual="bi", @@ -229425,6 +226852,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D482, visual="bi", @@ -229434,6 +226862,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D483, visual="bi", @@ -229443,6 +226872,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D484, visual="bi", @@ -229452,6 +226882,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D485, visual="bi", @@ -229461,6 +226892,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D486, visual="bi", @@ -229470,6 +226902,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D487, visual="bi", @@ -229479,6 +226912,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D488, visual="bi", @@ -229488,6 +226922,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D489, visual="bi", @@ -229497,6 +226932,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D48A, visual="bi", @@ -229506,6 +226942,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D48B, visual="bi", @@ -229515,6 +226952,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D48C, visual="bi", @@ -229524,6 +226962,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D48D, visual="bi", @@ -229533,6 +226972,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D48E, visual="bi", @@ -229542,6 +226982,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D48F, visual="bi", @@ -229551,6 +226992,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D490, visual="bi", @@ -229560,6 +227002,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D491, visual="bi", @@ -229569,6 +227012,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D492, visual="bi", @@ -229578,6 +227022,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D493, visual="bi", @@ -229587,6 +227032,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D494, visual="bi", @@ -229596,6 +227042,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D495, visual="bi", @@ -229605,6 +227052,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D496, visual="bi", @@ -229614,6 +227062,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D497, visual="bi", @@ -229623,6 +227072,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D498, visual="bi", @@ -229632,6 +227082,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D499, visual="bi", @@ -229641,6 +227092,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D49A, visual="bi", @@ -229650,6 +227102,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D49B, visual="bi", @@ -229659,6 +227112,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D49C, variants=variants_style, @@ -229669,6 +227123,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D49E, variants=variants_style, @@ -229679,6 +227134,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D49F, variants=variants_style, @@ -229689,6 +227145,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D4A2, variants=variants_style, @@ -229699,6 +227156,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D4A5, variants=variants_style, @@ -229709,6 +227167,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D4A6, variants=variants_style, @@ -229719,6 +227178,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D4A9, variants=variants_style, @@ -229729,6 +227189,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D4AA, variants=variants_style, @@ -229739,6 +227200,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, synonyms={ "power set" }, unicodeslot=0x1D4AB, @@ -229750,6 +227212,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D4AC, variants=variants_style, @@ -229760,6 +227223,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D4AE, variants=variants_style, @@ -229770,6 +227234,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D4AF, variants=variants_style, @@ -229780,6 +227245,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D4B0, variants=variants_style, @@ -229790,6 +227256,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D4B1, variants=variants_style, @@ -229800,6 +227267,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D4B2, variants=variants_style, @@ -229810,6 +227278,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D4B3, variants=variants_style, @@ -229820,6 +227289,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D4B4, variants=variants_style, @@ -229830,6 +227300,7 @@ characters.data={ description="MATHEMATICAL SCRIPT CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D4B5, variants=variants_style, @@ -229840,6 +227311,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D4B6, visual="it", @@ -229849,6 +227321,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D4B7, visual="it", @@ -229858,6 +227331,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D4B8, visual="it", @@ -229867,6 +227341,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D4B9, visual="it", @@ -229876,6 +227351,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D4BB, visual="it", @@ -229885,6 +227361,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D4BD, visual="it", @@ -229894,6 +227371,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D4BE, visual="it", @@ -229903,6 +227381,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D4BF, visual="it", @@ -229912,6 +227391,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D4C0, visual="it", @@ -229921,6 +227401,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D4C1, visual="it", @@ -229930,6 +227411,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D4C2, visual="it", @@ -229939,6 +227421,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D4C3, visual="it", @@ -229948,6 +227431,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D4C5, visual="it", @@ -229957,6 +227441,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D4C6, visual="it", @@ -229966,6 +227451,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D4C7, visual="it", @@ -229975,6 +227461,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D4C8, visual="it", @@ -229984,6 +227471,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D4C9, visual="it", @@ -229993,6 +227481,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D4CA, visual="it", @@ -230002,6 +227491,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D4CB, visual="it", @@ -230011,6 +227501,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D4CC, visual="it", @@ -230020,6 +227511,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D4CD, visual="it", @@ -230029,6 +227521,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D4CE, visual="it", @@ -230038,6 +227531,7 @@ characters.data={ description="MATHEMATICAL SCRIPT SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D4CF, visual="it", @@ -230047,6 +227541,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D4D0, visual="bi", @@ -230056,6 +227551,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D4D1, visual="bi", @@ -230065,6 +227561,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D4D2, visual="bi", @@ -230074,6 +227571,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D4D3, visual="bi", @@ -230083,6 +227581,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D4D4, visual="bi", @@ -230092,6 +227591,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D4D5, visual="bi", @@ -230101,6 +227601,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D4D6, visual="bi", @@ -230110,6 +227611,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D4D7, visual="bi", @@ -230119,6 +227621,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D4D8, visual="bi", @@ -230128,6 +227631,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D4D9, visual="bi", @@ -230137,6 +227641,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D4DA, visual="bi", @@ -230146,6 +227651,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D4DB, visual="bi", @@ -230155,6 +227661,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D4DC, visual="bi", @@ -230164,6 +227671,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D4DD, visual="bi", @@ -230173,6 +227681,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D4DE, visual="bi", @@ -230182,6 +227691,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D4DF, visual="bi", @@ -230191,6 +227701,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D4E0, visual="bi", @@ -230200,6 +227711,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D4E1, visual="bi", @@ -230209,6 +227721,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D4E2, visual="bi", @@ -230218,6 +227731,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D4E3, visual="bi", @@ -230227,6 +227741,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D4E4, visual="bi", @@ -230236,6 +227751,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D4E5, visual="bi", @@ -230245,6 +227761,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D4E6, visual="bi", @@ -230254,6 +227771,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D4E7, visual="bi", @@ -230263,6 +227781,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D4E8, visual="bi", @@ -230272,6 +227791,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D4E9, visual="bi", @@ -230281,6 +227801,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D4EA, visual="bi", @@ -230290,6 +227811,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D4EB, visual="bi", @@ -230299,6 +227821,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D4EC, visual="bi", @@ -230308,6 +227831,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D4ED, visual="bi", @@ -230317,6 +227841,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D4EE, visual="bi", @@ -230326,6 +227851,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D4EF, visual="bi", @@ -230335,6 +227861,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D4F0, visual="bi", @@ -230344,6 +227871,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D4F1, visual="bi", @@ -230353,6 +227881,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D4F2, visual="bi", @@ -230362,6 +227891,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D4F3, visual="bi", @@ -230371,6 +227901,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D4F4, visual="bi", @@ -230380,6 +227911,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D4F5, visual="bi", @@ -230389,6 +227921,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D4F6, visual="bi", @@ -230398,6 +227931,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D4F7, visual="bi", @@ -230407,6 +227941,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D4F8, visual="bi", @@ -230416,6 +227951,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D4F9, visual="bi", @@ -230425,6 +227961,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D4FA, visual="bi", @@ -230434,6 +227971,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D4FB, visual="bi", @@ -230443,6 +227981,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D4FC, visual="bi", @@ -230452,6 +227991,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D4FD, visual="bi", @@ -230461,6 +228001,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D4FE, visual="bi", @@ -230470,6 +228011,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D4FF, visual="bi", @@ -230479,6 +228021,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D500, visual="bi", @@ -230488,6 +228031,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D501, visual="bi", @@ -230497,6 +228041,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D502, visual="bi", @@ -230506,6 +228051,7 @@ characters.data={ description="MATHEMATICAL BOLD SCRIPT SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D503, visual="bi", @@ -230515,6 +228061,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D504, }, @@ -230523,6 +228070,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D505, }, @@ -230531,6 +228079,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D507, }, @@ -230539,6 +228088,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D508, }, @@ -230547,6 +228097,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D509, }, @@ -230555,6 +228106,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D50A, }, @@ -230563,6 +228115,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D50D, }, @@ -230571,6 +228124,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D50E, }, @@ -230579,6 +228133,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D50F, }, @@ -230587,6 +228142,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, synonyms={ "new testament majority text" }, unicodeslot=0x1D510, @@ -230596,6 +228152,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D511, }, @@ -230604,6 +228161,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D512, }, @@ -230612,6 +228170,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D513, }, @@ -230620,6 +228179,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D514, }, @@ -230628,6 +228188,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, synonyms={ "greek old testament", "septuagint" }, unicodeslot=0x1D516, @@ -230637,6 +228198,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D517, }, @@ -230645,6 +228207,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D518, }, @@ -230653,6 +228216,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D519, }, @@ -230661,6 +228225,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D51A, }, @@ -230669,6 +228234,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D51B, }, @@ -230677,6 +228243,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D51C, }, @@ -230685,6 +228252,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D51E, }, @@ -230693,6 +228261,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D51F, }, @@ -230701,6 +228270,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D520, }, @@ -230709,6 +228279,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D521, }, @@ -230717,6 +228288,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D522, }, @@ -230725,6 +228297,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D523, }, @@ -230733,6 +228306,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D524, }, @@ -230741,6 +228315,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D525, }, @@ -230749,6 +228324,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D526, }, @@ -230757,6 +228333,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D527, }, @@ -230765,6 +228342,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D528, }, @@ -230773,6 +228351,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D529, }, @@ -230781,6 +228360,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D52A, }, @@ -230789,6 +228369,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D52B, }, @@ -230797,6 +228378,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D52C, }, @@ -230805,6 +228387,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D52D, }, @@ -230813,6 +228396,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D52E, }, @@ -230821,6 +228405,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D52F, }, @@ -230829,6 +228414,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D530, }, @@ -230837,6 +228423,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D531, }, @@ -230845,6 +228432,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D532, }, @@ -230853,6 +228441,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D533, }, @@ -230861,6 +228450,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D534, }, @@ -230869,6 +228459,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D535, }, @@ -230877,6 +228468,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D536, }, @@ -230885,6 +228477,7 @@ characters.data={ description="MATHEMATICAL FRAKTUR SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D537, }, @@ -230893,6 +228486,9 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL A", direction="l", linebreak="al", + mathclass="variable", + mathgroup="number set", + mathmeaning="the algebraic numbers", specials={ "font", 0x41 }, unicodeslot=0x1D538, }, @@ -230901,6 +228497,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D539, }, @@ -230909,6 +228506,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D53B, }, @@ -230917,6 +228515,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D53C, }, @@ -230925,6 +228524,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D53D, }, @@ -230933,6 +228533,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D53E, }, @@ -230941,6 +228542,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D540, }, @@ -230949,6 +228551,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D541, }, @@ -230957,6 +228560,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D542, }, @@ -230965,6 +228569,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D543, }, @@ -230973,6 +228578,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D544, }, @@ -230981,6 +228587,9 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL O", direction="l", linebreak="al", + mathclass="variable", + mathgroup="number set", + mathmeaning="the octonions", specials={ "font", 0x4F }, unicodeslot=0x1D546, }, @@ -230989,6 +228598,9 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL S", direction="l", linebreak="al", + mathclass="variable", + mathgroup="number set", + mathmeaning="the sedenions", specials={ "font", 0x53 }, unicodeslot=0x1D54A, }, @@ -230997,6 +228609,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D54B, }, @@ -231005,6 +228618,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D54C, }, @@ -231013,6 +228627,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D54D, }, @@ -231021,6 +228636,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D54E, }, @@ -231029,6 +228645,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D54F, }, @@ -231037,6 +228654,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D550, }, @@ -231045,6 +228663,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D552, }, @@ -231053,6 +228672,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D553, }, @@ -231061,6 +228681,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D554, }, @@ -231069,6 +228690,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D555, }, @@ -231077,6 +228699,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D556, }, @@ -231085,6 +228708,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D557, }, @@ -231093,6 +228717,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D558, }, @@ -231101,6 +228726,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D559, }, @@ -231109,6 +228735,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D55A, }, @@ -231117,6 +228744,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D55B, }, @@ -231125,6 +228753,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D55C, }, @@ -231133,6 +228762,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D55D, }, @@ -231141,6 +228771,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D55E, }, @@ -231149,6 +228780,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D55F, }, @@ -231157,6 +228789,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D560, }, @@ -231165,6 +228798,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D561, }, @@ -231173,6 +228807,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D562, }, @@ -231181,6 +228816,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D563, }, @@ -231189,6 +228825,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D564, }, @@ -231197,6 +228834,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D565, }, @@ -231205,6 +228843,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D566, }, @@ -231213,6 +228852,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D567, }, @@ -231221,6 +228861,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D568, }, @@ -231229,6 +228870,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D569, }, @@ -231237,6 +228879,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D56A, }, @@ -231245,6 +228888,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D56B, }, @@ -231253,6 +228897,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D56C, visual="bf", @@ -231262,6 +228907,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D56D, visual="bf", @@ -231271,6 +228917,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D56E, visual="bf", @@ -231280,6 +228927,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D56F, visual="bf", @@ -231289,6 +228937,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D570, visual="bf", @@ -231298,6 +228947,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D571, visual="bf", @@ -231307,6 +228957,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D572, visual="bf", @@ -231316,6 +228967,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D573, visual="bf", @@ -231325,6 +228977,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D574, visual="bf", @@ -231334,6 +228987,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D575, visual="bf", @@ -231343,6 +228997,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D576, visual="bf", @@ -231352,6 +229007,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D577, visual="bf", @@ -231361,6 +229017,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D578, visual="bf", @@ -231370,6 +229027,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D579, visual="bf", @@ -231379,6 +229037,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D57A, visual="bf", @@ -231388,6 +229047,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D57B, visual="bf", @@ -231397,6 +229057,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D57C, visual="bf", @@ -231406,6 +229067,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D57D, visual="bf", @@ -231415,6 +229077,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D57E, visual="bf", @@ -231424,6 +229087,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D57F, visual="bf", @@ -231433,6 +229097,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D580, visual="bf", @@ -231442,6 +229107,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D581, visual="bf", @@ -231451,6 +229117,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D582, visual="bf", @@ -231460,6 +229127,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D583, visual="bf", @@ -231469,6 +229137,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D584, visual="bf", @@ -231478,6 +229147,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D585, visual="bf", @@ -231487,6 +229157,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D586, visual="bf", @@ -231496,6 +229167,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D587, visual="bf", @@ -231505,6 +229177,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D588, visual="bf", @@ -231514,6 +229187,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D589, visual="bf", @@ -231523,6 +229197,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D58A, visual="bf", @@ -231532,6 +229207,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D58B, visual="bf", @@ -231541,6 +229217,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D58C, visual="bf", @@ -231550,6 +229227,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D58D, visual="bf", @@ -231559,6 +229237,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D58E, visual="bf", @@ -231568,6 +229247,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D58F, visual="bf", @@ -231577,6 +229257,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D590, visual="bf", @@ -231586,6 +229267,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D591, visual="bf", @@ -231595,6 +229277,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D592, visual="bf", @@ -231604,6 +229287,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D593, visual="bf", @@ -231613,6 +229297,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D594, visual="bf", @@ -231622,6 +229307,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D595, visual="bf", @@ -231631,6 +229317,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D596, visual="bf", @@ -231640,6 +229327,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D597, visual="bf", @@ -231649,6 +229337,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D598, visual="bf", @@ -231658,6 +229347,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D599, visual="bf", @@ -231667,6 +229357,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D59A, visual="bf", @@ -231676,6 +229367,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D59B, visual="bf", @@ -231685,6 +229377,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D59C, visual="bf", @@ -231694,6 +229387,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D59D, visual="bf", @@ -231703,6 +229397,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D59E, visual="bf", @@ -231712,6 +229407,7 @@ characters.data={ description="MATHEMATICAL BOLD FRAKTUR SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D59F, visual="bf", @@ -231721,6 +229417,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D5A0, }, @@ -231729,6 +229426,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D5A1, }, @@ -231737,6 +229435,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D5A2, }, @@ -231745,6 +229444,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D5A3, }, @@ -231753,6 +229453,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D5A4, }, @@ -231761,6 +229462,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D5A5, }, @@ -231769,6 +229471,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D5A6, }, @@ -231777,6 +229480,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D5A7, }, @@ -231785,6 +229489,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D5A8, }, @@ -231793,6 +229498,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D5A9, }, @@ -231801,6 +229507,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D5AA, }, @@ -231809,6 +229516,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D5AB, }, @@ -231817,6 +229525,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D5AC, }, @@ -231825,6 +229534,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D5AD, }, @@ -231833,6 +229543,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D5AE, }, @@ -231841,6 +229552,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D5AF, }, @@ -231849,6 +229561,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D5B0, }, @@ -231857,6 +229570,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D5B1, }, @@ -231865,6 +229579,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D5B2, }, @@ -231873,6 +229588,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D5B3, }, @@ -231881,6 +229597,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D5B4, }, @@ -231889,6 +229606,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D5B5, }, @@ -231897,6 +229615,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D5B6, }, @@ -231905,6 +229624,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D5B7, }, @@ -231913,6 +229633,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D5B8, }, @@ -231921,6 +229642,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D5B9, }, @@ -231929,6 +229651,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D5BA, }, @@ -231937,6 +229660,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D5BB, }, @@ -231945,6 +229669,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D5BC, }, @@ -231953,6 +229678,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D5BD, }, @@ -231961,6 +229687,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D5BE, }, @@ -231969,6 +229696,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D5BF, }, @@ -231977,6 +229705,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D5C0, }, @@ -231985,6 +229714,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D5C1, }, @@ -231993,6 +229723,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D5C2, }, @@ -232001,6 +229732,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D5C3, }, @@ -232009,6 +229741,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D5C4, }, @@ -232017,6 +229750,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D5C5, }, @@ -232025,6 +229759,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D5C6, }, @@ -232033,6 +229768,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D5C7, }, @@ -232041,6 +229777,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D5C8, }, @@ -232049,6 +229786,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D5C9, }, @@ -232057,6 +229795,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D5CA, }, @@ -232065,6 +229804,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D5CB, }, @@ -232073,6 +229813,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D5CC, }, @@ -232081,6 +229822,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D5CD, }, @@ -232089,6 +229831,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D5CE, }, @@ -232097,6 +229840,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D5CF, }, @@ -232105,6 +229849,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D5D0, }, @@ -232113,6 +229858,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D5D1, }, @@ -232121,6 +229867,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D5D2, }, @@ -232129,6 +229876,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D5D3, }, @@ -232137,6 +229885,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D5D4, visual="bf", @@ -232146,6 +229895,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D5D5, visual="bf", @@ -232155,6 +229905,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D5D6, visual="bf", @@ -232164,6 +229915,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D5D7, visual="bf", @@ -232173,6 +229925,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D5D8, visual="bf", @@ -232182,6 +229935,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D5D9, visual="bf", @@ -232191,6 +229945,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D5DA, visual="bf", @@ -232200,6 +229955,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D5DB, visual="bf", @@ -232209,6 +229965,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D5DC, visual="bf", @@ -232218,6 +229975,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D5DD, visual="bf", @@ -232227,6 +229985,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D5DE, visual="bf", @@ -232236,6 +229995,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D5DF, visual="bf", @@ -232245,6 +230005,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D5E0, visual="bf", @@ -232254,6 +230015,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D5E1, visual="bf", @@ -232263,6 +230025,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D5E2, visual="bf", @@ -232272,6 +230035,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D5E3, visual="bf", @@ -232281,6 +230045,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D5E4, visual="bf", @@ -232290,6 +230055,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D5E5, visual="bf", @@ -232299,6 +230065,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D5E6, visual="bf", @@ -232308,6 +230075,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D5E7, visual="bf", @@ -232317,6 +230085,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D5E8, visual="bf", @@ -232326,6 +230095,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D5E9, visual="bf", @@ -232335,6 +230105,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D5EA, visual="bf", @@ -232344,6 +230115,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D5EB, visual="bf", @@ -232353,6 +230125,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D5EC, visual="bf", @@ -232362,6 +230135,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D5ED, visual="bf", @@ -232371,6 +230145,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D5EE, visual="bf", @@ -232380,6 +230155,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D5EF, visual="bf", @@ -232389,6 +230165,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D5F0, visual="bf", @@ -232398,6 +230175,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D5F1, visual="bf", @@ -232407,6 +230185,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D5F2, visual="bf", @@ -232416,6 +230195,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D5F3, visual="bf", @@ -232425,6 +230205,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D5F4, visual="bf", @@ -232434,6 +230215,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D5F5, visual="bf", @@ -232443,6 +230225,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D5F6, visual="bf", @@ -232452,6 +230235,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D5F7, visual="bf", @@ -232461,6 +230245,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D5F8, visual="bf", @@ -232470,6 +230255,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D5F9, visual="bf", @@ -232479,6 +230265,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D5FA, visual="bf", @@ -232488,6 +230275,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D5FB, visual="bf", @@ -232497,6 +230285,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D5FC, visual="bf", @@ -232506,6 +230295,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D5FD, visual="bf", @@ -232515,6 +230305,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D5FE, visual="bf", @@ -232524,6 +230315,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D5FF, visual="bf", @@ -232533,6 +230325,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D600, visual="bf", @@ -232542,6 +230335,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D601, visual="bf", @@ -232551,6 +230345,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D602, visual="bf", @@ -232560,6 +230355,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D603, visual="bf", @@ -232569,6 +230365,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D604, visual="bf", @@ -232578,6 +230375,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D605, visual="bf", @@ -232587,6 +230385,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D606, visual="bf", @@ -232596,6 +230395,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D607, visual="bf", @@ -232605,6 +230405,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D608, visual="it", @@ -232614,6 +230415,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D609, visual="it", @@ -232623,6 +230425,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D60A, visual="it", @@ -232632,6 +230435,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D60B, visual="it", @@ -232641,6 +230445,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D60C, visual="it", @@ -232650,6 +230455,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D60D, visual="it", @@ -232659,6 +230465,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D60E, visual="it", @@ -232668,6 +230475,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D60F, visual="it", @@ -232677,6 +230485,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D610, visual="it", @@ -232686,6 +230495,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D611, visual="it", @@ -232695,6 +230505,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D612, visual="it", @@ -232704,6 +230515,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D613, visual="it", @@ -232713,6 +230525,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D614, visual="it", @@ -232722,6 +230535,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D615, visual="it", @@ -232731,6 +230545,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D616, visual="it", @@ -232740,6 +230555,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D617, visual="it", @@ -232749,6 +230565,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D618, visual="it", @@ -232758,6 +230575,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D619, visual="it", @@ -232767,6 +230585,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D61A, visual="it", @@ -232776,6 +230595,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D61B, visual="it", @@ -232785,6 +230605,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D61C, visual="it", @@ -232794,6 +230615,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D61D, visual="it", @@ -232803,6 +230625,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D61E, visual="it", @@ -232812,6 +230635,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D61F, visual="it", @@ -232821,6 +230645,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D620, visual="it", @@ -232830,6 +230655,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D621, visual="it", @@ -232839,6 +230665,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D622, visual="it", @@ -232848,6 +230675,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D623, visual="it", @@ -232857,6 +230685,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D624, visual="it", @@ -232866,6 +230695,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D625, visual="it", @@ -232875,6 +230705,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D626, visual="it", @@ -232884,6 +230715,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D627, visual="it", @@ -232893,6 +230725,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D628, visual="it", @@ -232902,6 +230735,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D629, visual="it", @@ -232911,6 +230745,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D62A, visual="it", @@ -232920,6 +230755,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D62B, visual="it", @@ -232929,6 +230765,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D62C, visual="it", @@ -232938,6 +230775,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D62D, visual="it", @@ -232947,6 +230785,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D62E, visual="it", @@ -232956,6 +230795,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D62F, visual="it", @@ -232965,6 +230805,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D630, visual="it", @@ -232974,6 +230815,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D631, visual="it", @@ -232983,6 +230825,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D632, visual="it", @@ -232992,6 +230835,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D633, visual="it", @@ -233001,6 +230845,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D634, visual="it", @@ -233010,6 +230855,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D635, visual="it", @@ -233019,6 +230865,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D636, visual="it", @@ -233028,6 +230875,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D637, visual="it", @@ -233037,6 +230885,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D638, visual="it", @@ -233046,6 +230895,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D639, visual="it", @@ -233055,6 +230905,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D63A, visual="it", @@ -233064,6 +230915,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF ITALIC SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D63B, visual="it", @@ -233073,6 +230925,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D63C, visual="bi", @@ -233082,6 +230935,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D63D, visual="bi", @@ -233091,6 +230945,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D63E, visual="bi", @@ -233100,6 +230955,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D63F, visual="bi", @@ -233109,6 +230965,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D640, visual="bi", @@ -233118,6 +230975,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D641, visual="bi", @@ -233127,6 +230985,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D642, visual="bi", @@ -233136,6 +230995,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D643, visual="bi", @@ -233145,6 +231005,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D644, visual="bi", @@ -233154,6 +231015,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D645, visual="bi", @@ -233163,6 +231025,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D646, visual="bi", @@ -233172,6 +231035,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D647, visual="bi", @@ -233181,6 +231045,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D648, visual="bi", @@ -233190,6 +231055,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D649, visual="bi", @@ -233199,6 +231065,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D64A, visual="bi", @@ -233208,6 +231075,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D64B, visual="bi", @@ -233217,6 +231085,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D64C, visual="bi", @@ -233226,6 +231095,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D64D, visual="bi", @@ -233235,6 +231105,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D64E, visual="bi", @@ -233244,6 +231115,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D64F, visual="bi", @@ -233253,6 +231125,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D650, visual="bi", @@ -233262,6 +231135,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D651, visual="bi", @@ -233271,6 +231145,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D652, visual="bi", @@ -233280,6 +231155,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D653, visual="bi", @@ -233289,6 +231165,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D654, visual="bi", @@ -233298,6 +231175,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D655, visual="bi", @@ -233307,6 +231185,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D656, visual="bi", @@ -233316,6 +231195,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D657, visual="bi", @@ -233325,6 +231205,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D658, visual="bi", @@ -233334,6 +231215,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D659, visual="bi", @@ -233343,6 +231225,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D65A, visual="bi", @@ -233352,6 +231235,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D65B, visual="bi", @@ -233361,6 +231245,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D65C, visual="bi", @@ -233370,6 +231255,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D65D, visual="bi", @@ -233379,6 +231265,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D65E, visual="bi", @@ -233388,6 +231275,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D65F, visual="bi", @@ -233397,6 +231285,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D660, visual="bi", @@ -233406,6 +231295,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D661, visual="bi", @@ -233415,6 +231305,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D662, visual="bi", @@ -233424,6 +231315,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D663, visual="bi", @@ -233433,6 +231325,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D664, visual="bi", @@ -233442,6 +231335,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D665, visual="bi", @@ -233451,6 +231345,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D666, visual="bi", @@ -233460,6 +231355,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D667, visual="bi", @@ -233469,6 +231365,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D668, visual="bi", @@ -233478,6 +231375,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D669, visual="bi", @@ -233487,6 +231385,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D66A, visual="bi", @@ -233496,6 +231395,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D66B, visual="bi", @@ -233505,6 +231405,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D66C, visual="bi", @@ -233514,6 +231415,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D66D, visual="bi", @@ -233523,6 +231425,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D66E, visual="bi", @@ -233532,6 +231435,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D66F, visual="bi", @@ -233541,6 +231445,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x41 }, unicodeslot=0x1D670, }, @@ -233549,6 +231454,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x42 }, unicodeslot=0x1D671, }, @@ -233557,6 +231463,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x43 }, unicodeslot=0x1D672, }, @@ -233565,6 +231472,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x44 }, unicodeslot=0x1D673, }, @@ -233573,6 +231481,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x45 }, unicodeslot=0x1D674, }, @@ -233581,6 +231490,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x46 }, unicodeslot=0x1D675, }, @@ -233589,6 +231499,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x47 }, unicodeslot=0x1D676, }, @@ -233597,6 +231508,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x48 }, unicodeslot=0x1D677, }, @@ -233605,6 +231517,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x49 }, unicodeslot=0x1D678, }, @@ -233613,6 +231526,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4A }, unicodeslot=0x1D679, }, @@ -233621,6 +231535,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4B }, unicodeslot=0x1D67A, }, @@ -233629,6 +231544,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4C }, unicodeslot=0x1D67B, }, @@ -233637,6 +231553,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4D }, unicodeslot=0x1D67C, }, @@ -233645,6 +231562,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4E }, unicodeslot=0x1D67D, }, @@ -233653,6 +231571,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x4F }, unicodeslot=0x1D67E, }, @@ -233661,6 +231580,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x50 }, unicodeslot=0x1D67F, }, @@ -233669,6 +231589,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x51 }, unicodeslot=0x1D680, }, @@ -233677,6 +231598,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x52 }, unicodeslot=0x1D681, }, @@ -233685,6 +231607,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x53 }, unicodeslot=0x1D682, }, @@ -233693,6 +231616,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x54 }, unicodeslot=0x1D683, }, @@ -233701,6 +231625,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x55 }, unicodeslot=0x1D684, }, @@ -233709,6 +231634,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x56 }, unicodeslot=0x1D685, }, @@ -233717,6 +231643,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x57 }, unicodeslot=0x1D686, }, @@ -233725,6 +231652,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x58 }, unicodeslot=0x1D687, }, @@ -233733,6 +231661,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x59 }, unicodeslot=0x1D688, }, @@ -233741,6 +231670,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE CAPITAL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x5A }, unicodeslot=0x1D689, }, @@ -233749,6 +231679,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL A", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x61 }, unicodeslot=0x1D68A, }, @@ -233757,6 +231688,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL B", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x62 }, unicodeslot=0x1D68B, }, @@ -233765,6 +231697,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL C", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x63 }, unicodeslot=0x1D68C, }, @@ -233773,6 +231706,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL D", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x64 }, unicodeslot=0x1D68D, }, @@ -233781,6 +231715,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL E", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x65 }, unicodeslot=0x1D68E, }, @@ -233789,6 +231724,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL F", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x66 }, unicodeslot=0x1D68F, }, @@ -233797,6 +231733,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL G", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x67 }, unicodeslot=0x1D690, }, @@ -233805,6 +231742,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL H", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x68 }, unicodeslot=0x1D691, }, @@ -233813,6 +231751,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL I", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x69 }, unicodeslot=0x1D692, }, @@ -233821,6 +231760,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL J", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6A }, unicodeslot=0x1D693, }, @@ -233829,6 +231769,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL K", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6B }, unicodeslot=0x1D694, }, @@ -233837,6 +231778,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL L", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6C }, unicodeslot=0x1D695, }, @@ -233845,6 +231787,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL M", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6D }, unicodeslot=0x1D696, }, @@ -233853,6 +231796,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL N", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6E }, unicodeslot=0x1D697, }, @@ -233861,6 +231805,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL O", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x6F }, unicodeslot=0x1D698, }, @@ -233869,6 +231814,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL P", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x70 }, unicodeslot=0x1D699, }, @@ -233877,6 +231823,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL Q", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x71 }, unicodeslot=0x1D69A, }, @@ -233885,6 +231832,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL R", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x72 }, unicodeslot=0x1D69B, }, @@ -233893,6 +231841,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL S", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x73 }, unicodeslot=0x1D69C, }, @@ -233901,6 +231850,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL T", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x74 }, unicodeslot=0x1D69D, }, @@ -233909,6 +231859,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL U", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x75 }, unicodeslot=0x1D69E, }, @@ -233917,6 +231868,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL V", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x76 }, unicodeslot=0x1D69F, }, @@ -233925,6 +231877,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL W", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x77 }, unicodeslot=0x1D6A0, }, @@ -233933,6 +231886,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL X", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x78 }, unicodeslot=0x1D6A1, }, @@ -233941,6 +231895,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL Y", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x79 }, unicodeslot=0x1D6A2, }, @@ -233949,6 +231904,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE SMALL Z", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x7A }, unicodeslot=0x1D6A3, }, @@ -233958,6 +231914,8 @@ characters.data={ direction="l", linebreak="al", mathclass="ordinary", + mathgroup="constant arithmetic", + mathmeaning="imaginary i", mathname="imath", specials={ "font", 0x131 }, unicodeslot=0x1D6A4, @@ -233969,6 +231927,8 @@ characters.data={ direction="l", linebreak="al", mathclass="ordinary", + mathgroup="constant arithmetic", + mathmeaning="imaginary j", mathname="jmath", specials={ "font", 0x237 }, unicodeslot=0x1D6A5, @@ -233979,6 +231939,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x391 }, unicodeslot=0x1D6A8, visual="bf", @@ -233988,6 +231949,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x392 }, unicodeslot=0x1D6A9, visual="bf", @@ -233997,6 +231959,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x393 }, unicodeslot=0x1D6AA, visual="bf", @@ -234006,6 +231969,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x394 }, unicodeslot=0x1D6AB, visual="bf", @@ -234015,6 +231979,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x395 }, unicodeslot=0x1D6AC, visual="bf", @@ -234024,6 +231989,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x396 }, unicodeslot=0x1D6AD, visual="bf", @@ -234033,6 +231999,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x397 }, unicodeslot=0x1D6AE, visual="bf", @@ -234042,6 +232009,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x398 }, unicodeslot=0x1D6AF, visual="bf", @@ -234051,6 +232019,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x399 }, unicodeslot=0x1D6B0, visual="bf", @@ -234060,6 +232029,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39A }, unicodeslot=0x1D6B1, visual="bf", @@ -234069,6 +232039,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39B }, unicodeslot=0x1D6B2, visual="bf", @@ -234078,6 +232049,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39C }, unicodeslot=0x1D6B3, visual="bf", @@ -234087,6 +232059,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39D }, unicodeslot=0x1D6B4, visual="bf", @@ -234096,6 +232069,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39E }, unicodeslot=0x1D6B5, visual="bf", @@ -234105,6 +232079,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39F }, unicodeslot=0x1D6B6, visual="bf", @@ -234114,6 +232089,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A0 }, unicodeslot=0x1D6B7, visual="bf", @@ -234123,6 +232099,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A1 }, unicodeslot=0x1D6B8, visual="bf", @@ -234132,6 +232109,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F4 }, unicodeslot=0x1D6B9, visual="bf", @@ -234141,6 +232119,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A3 }, unicodeslot=0x1D6BA, visual="bf", @@ -234150,6 +232129,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A4 }, unicodeslot=0x1D6BB, visual="bf", @@ -234159,6 +232139,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A5 }, unicodeslot=0x1D6BC, visual="bf", @@ -234168,6 +232149,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A6 }, unicodeslot=0x1D6BD, visual="bf", @@ -234177,6 +232159,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A7 }, unicodeslot=0x1D6BE, visual="bf", @@ -234186,6 +232169,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A8 }, unicodeslot=0x1D6BF, visual="bf", @@ -234195,6 +232179,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A9 }, unicodeslot=0x1D6C0, visual="bf", @@ -234204,6 +232189,9 @@ characters.data={ description="MATHEMATICAL BOLD NABLA", direction="l", linebreak="al", + mathclass="differential", + mathgroup="differential", + mathmeaning="vector gradient", specials={ "font", 0x2207 }, unicodeslot=0x1D6C1, visual="bf", @@ -234213,6 +232201,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B1 }, unicodeslot=0x1D6C2, visual="bf", @@ -234222,6 +232211,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B2 }, unicodeslot=0x1D6C3, visual="bf", @@ -234231,6 +232221,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B3 }, unicodeslot=0x1D6C4, visual="bf", @@ -234240,6 +232231,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B4 }, unicodeslot=0x1D6C5, visual="bf", @@ -234249,6 +232241,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B5 }, unicodeslot=0x1D6C6, visual="bf", @@ -234258,6 +232251,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B6 }, unicodeslot=0x1D6C7, visual="bf", @@ -234267,6 +232261,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B7 }, unicodeslot=0x1D6C8, visual="bf", @@ -234276,6 +232271,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B8 }, unicodeslot=0x1D6C9, visual="bf", @@ -234285,6 +232281,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B9 }, unicodeslot=0x1D6CA, visual="bf", @@ -234294,6 +232291,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BA }, unicodeslot=0x1D6CB, visual="bf", @@ -234303,6 +232301,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BB }, unicodeslot=0x1D6CC, visual="bf", @@ -234312,6 +232311,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BC }, unicodeslot=0x1D6CD, visual="bf", @@ -234321,6 +232321,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BD }, unicodeslot=0x1D6CE, visual="bf", @@ -234330,6 +232331,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BE }, unicodeslot=0x1D6CF, visual="bf", @@ -234339,6 +232341,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BF }, unicodeslot=0x1D6D0, visual="bf", @@ -234348,6 +232351,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C0 }, unicodeslot=0x1D6D1, visual="bf", @@ -234357,6 +232361,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C1 }, unicodeslot=0x1D6D2, visual="bf", @@ -234366,6 +232371,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL FINAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C2 }, unicodeslot=0x1D6D3, visual="bf", @@ -234375,6 +232381,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C3 }, unicodeslot=0x1D6D4, visual="bf", @@ -234384,6 +232391,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C4 }, unicodeslot=0x1D6D5, visual="bf", @@ -234393,6 +232401,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C5 }, unicodeslot=0x1D6D6, visual="bf", @@ -234402,6 +232411,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C6 }, unicodeslot=0x1D6D7, visual="bf", @@ -234411,6 +232421,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C7 }, unicodeslot=0x1D6D8, visual="bf", @@ -234420,6 +232431,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C8 }, unicodeslot=0x1D6D9, visual="bf", @@ -234429,6 +232441,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C9 }, unicodeslot=0x1D6DA, visual="bf", @@ -234439,6 +232452,8 @@ characters.data={ direction="on", linebreak="al", mathclass="differential", + mathgroup="differential", + mathmeaning="vector partial", specials={ "font", 0x2202 }, unicodeslot=0x1D6DB, visual="bf", @@ -234448,6 +232463,7 @@ characters.data={ description="MATHEMATICAL BOLD EPSILON SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F5 }, unicodeslot=0x1D6DC, visual="bf", @@ -234457,6 +232473,7 @@ characters.data={ description="MATHEMATICAL BOLD THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D1 }, unicodeslot=0x1D6DD, visual="bf", @@ -234466,6 +232483,7 @@ characters.data={ description="MATHEMATICAL BOLD KAPPA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F0 }, unicodeslot=0x1D6DE, visual="bf", @@ -234475,6 +232493,7 @@ characters.data={ description="MATHEMATICAL BOLD PHI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D5 }, unicodeslot=0x1D6DF, visual="bf", @@ -234484,6 +232503,7 @@ characters.data={ description="MATHEMATICAL BOLD RHO SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F1 }, unicodeslot=0x1D6E0, visual="bf", @@ -234493,6 +232513,7 @@ characters.data={ description="MATHEMATICAL BOLD PI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D6 }, unicodeslot=0x1D6E1, visual="bf", @@ -234502,6 +232523,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x391 }, unicodeslot=0x1D6E2, visual="it", @@ -234511,6 +232533,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x392 }, unicodeslot=0x1D6E3, visual="it", @@ -234520,6 +232543,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x393 }, unicodeslot=0x1D6E4, visual="it", @@ -234529,6 +232553,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x394 }, unicodeslot=0x1D6E5, visual="it", @@ -234538,6 +232563,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x395 }, unicodeslot=0x1D6E6, visual="it", @@ -234547,6 +232573,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x396 }, unicodeslot=0x1D6E7, visual="it", @@ -234556,6 +232583,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x397 }, unicodeslot=0x1D6E8, visual="it", @@ -234565,6 +232593,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x398 }, unicodeslot=0x1D6E9, visual="it", @@ -234574,6 +232603,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x399 }, unicodeslot=0x1D6EA, visual="it", @@ -234583,6 +232613,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39A }, unicodeslot=0x1D6EB, visual="it", @@ -234592,6 +232623,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39B }, unicodeslot=0x1D6EC, visual="it", @@ -234601,6 +232633,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39C }, unicodeslot=0x1D6ED, visual="it", @@ -234610,6 +232643,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39D }, unicodeslot=0x1D6EE, visual="it", @@ -234619,6 +232653,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39E }, unicodeslot=0x1D6EF, visual="it", @@ -234628,6 +232663,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39F }, unicodeslot=0x1D6F0, visual="it", @@ -234637,6 +232673,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A0 }, unicodeslot=0x1D6F1, visual="it", @@ -234646,6 +232683,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A1 }, unicodeslot=0x1D6F2, visual="it", @@ -234655,6 +232693,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F4 }, unicodeslot=0x1D6F3, visual="it", @@ -234664,6 +232703,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A3 }, unicodeslot=0x1D6F4, visual="it", @@ -234673,6 +232713,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A4 }, unicodeslot=0x1D6F5, visual="it", @@ -234682,6 +232723,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A5 }, unicodeslot=0x1D6F6, visual="it", @@ -234691,6 +232733,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A6 }, unicodeslot=0x1D6F7, visual="it", @@ -234700,6 +232743,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A7 }, unicodeslot=0x1D6F8, visual="it", @@ -234709,6 +232753,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A8 }, unicodeslot=0x1D6F9, visual="it", @@ -234718,6 +232763,7 @@ characters.data={ description="MATHEMATICAL ITALIC CAPITAL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A9 }, unicodeslot=0x1D6FA, visual="it", @@ -234727,7 +232773,9 @@ characters.data={ description="MATHEMATICAL ITALIC NABLA", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="differential", + mathgroup="differential", + mathmeaning="gradient", specials={ "font", 0x2207 }, unicodeslot=0x1D6FB, visual="it", @@ -234737,6 +232785,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B1 }, unicodeslot=0x1D6FC, visual="it", @@ -234746,6 +232795,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B2 }, unicodeslot=0x1D6FD, visual="it", @@ -234755,6 +232805,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B3 }, unicodeslot=0x1D6FE, visual="it", @@ -234764,6 +232815,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B4 }, unicodeslot=0x1D6FF, visual="it", @@ -234773,6 +232825,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B5 }, unicodeslot=0x1D700, visual="it", @@ -234782,6 +232835,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B6 }, unicodeslot=0x1D701, visual="it", @@ -234791,6 +232845,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B7 }, unicodeslot=0x1D702, visual="it", @@ -234800,6 +232855,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B8 }, unicodeslot=0x1D703, visual="it", @@ -234809,6 +232865,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B9 }, unicodeslot=0x1D704, visual="it", @@ -234818,6 +232875,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BA }, unicodeslot=0x1D705, visual="it", @@ -234827,6 +232885,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BB }, unicodeslot=0x1D706, visual="it", @@ -234836,6 +232895,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BC }, unicodeslot=0x1D707, visual="it", @@ -234845,6 +232905,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BD }, unicodeslot=0x1D708, visual="it", @@ -234854,6 +232915,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BE }, unicodeslot=0x1D709, visual="it", @@ -234863,6 +232925,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BF }, unicodeslot=0x1D70A, visual="it", @@ -234872,6 +232935,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C0 }, unicodeslot=0x1D70B, visual="it", @@ -234881,6 +232945,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C1 }, unicodeslot=0x1D70C, visual="it", @@ -234890,6 +232955,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL FINAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C2 }, unicodeslot=0x1D70D, visual="it", @@ -234899,6 +232965,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C3 }, unicodeslot=0x1D70E, visual="it", @@ -234908,6 +232975,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C4 }, unicodeslot=0x1D70F, visual="it", @@ -234917,6 +232985,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C5 }, unicodeslot=0x1D710, visual="it", @@ -234926,6 +232995,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C6 }, unicodeslot=0x1D711, visual="it", @@ -234935,6 +233005,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C7 }, unicodeslot=0x1D712, visual="it", @@ -234944,6 +233015,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C8 }, unicodeslot=0x1D713, visual="it", @@ -234953,6 +233025,7 @@ characters.data={ description="MATHEMATICAL ITALIC SMALL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C9 }, unicodeslot=0x1D714, visual="it", @@ -234962,7 +233035,14 @@ characters.data={ description="MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL", direction="on", linebreak="al", - mathclass="differential", + mathclass="variable", + mathspec={ + { + class="differential", + group="differential", + meaning="partial", + }, + }, specials={ "font", 0x2202 }, unicodeslot=0x1D715, visual="it", @@ -234972,6 +233052,7 @@ characters.data={ description="MATHEMATICAL ITALIC EPSILON SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F5 }, unicodeslot=0x1D716, visual="it", @@ -234981,7 +233062,7 @@ characters.data={ description="MATHEMATICAL ITALIC THETA SYMBOL", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="vartheta", specials={ "font", 0x3D1 }, unicodeslot=0x1D717, @@ -234992,7 +233073,7 @@ characters.data={ description="MATHEMATICAL ITALIC KAPPA SYMBOL", direction="l", linebreak="al", - mathclass="ordinary", + mathclass="variable", mathname="varkappa", specials={ "font", 0x3F0 }, unicodeslot=0x1D718, @@ -235003,6 +233084,7 @@ characters.data={ description="MATHEMATICAL ITALIC PHI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D5 }, unicodeslot=0x1D719, visual="it", @@ -235012,6 +233094,7 @@ characters.data={ description="MATHEMATICAL ITALIC RHO SYMBOL", direction="l", linebreak="al", + mathclass="variable", mathname="varrho", specials={ "font", 0x3F1 }, unicodeslot=0x1D71A, @@ -235031,6 +233114,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x391 }, unicodeslot=0x1D71C, visual="bi", @@ -235040,6 +233124,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x392 }, unicodeslot=0x1D71D, visual="bi", @@ -235049,6 +233134,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x393 }, unicodeslot=0x1D71E, visual="bi", @@ -235058,6 +233144,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x394 }, unicodeslot=0x1D71F, visual="bi", @@ -235067,6 +233154,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x395 }, unicodeslot=0x1D720, visual="bi", @@ -235076,6 +233164,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x396 }, unicodeslot=0x1D721, visual="bi", @@ -235085,6 +233174,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x397 }, unicodeslot=0x1D722, visual="bi", @@ -235094,6 +233184,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x398 }, unicodeslot=0x1D723, visual="bi", @@ -235103,6 +233194,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x399 }, unicodeslot=0x1D724, visual="bi", @@ -235112,6 +233204,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39A }, unicodeslot=0x1D725, visual="bi", @@ -235121,6 +233214,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39B }, unicodeslot=0x1D726, visual="bi", @@ -235130,6 +233224,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39C }, unicodeslot=0x1D727, visual="bi", @@ -235139,6 +233234,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39D }, unicodeslot=0x1D728, visual="bi", @@ -235148,6 +233244,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39E }, unicodeslot=0x1D729, visual="bi", @@ -235157,6 +233254,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39F }, unicodeslot=0x1D72A, visual="bi", @@ -235166,6 +233264,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A0 }, unicodeslot=0x1D72B, visual="bi", @@ -235175,6 +233274,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A1 }, unicodeslot=0x1D72C, visual="bi", @@ -235184,6 +233284,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F4 }, unicodeslot=0x1D72D, visual="bi", @@ -235193,6 +233294,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A3 }, unicodeslot=0x1D72E, visual="bi", @@ -235202,6 +233304,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A4 }, unicodeslot=0x1D72F, visual="bi", @@ -235211,6 +233314,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A5 }, unicodeslot=0x1D730, visual="bi", @@ -235220,6 +233324,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A6 }, unicodeslot=0x1D731, visual="bi", @@ -235229,6 +233334,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A7 }, unicodeslot=0x1D732, visual="bi", @@ -235238,6 +233344,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A8 }, unicodeslot=0x1D733, visual="bi", @@ -235247,6 +233354,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC CAPITAL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A9 }, unicodeslot=0x1D734, visual="bi", @@ -235256,6 +233364,9 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC NABLA", direction="l", linebreak="al", + mathclass="differential", + mathgroup="differential", + mathmeaning="vector gradient", specials={ "font", 0x2207 }, unicodeslot=0x1D735, visual="bi", @@ -235265,6 +233376,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B1 }, unicodeslot=0x1D736, visual="bi", @@ -235274,6 +233386,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B2 }, unicodeslot=0x1D737, visual="bi", @@ -235283,6 +233396,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B3 }, unicodeslot=0x1D738, visual="bi", @@ -235292,6 +233406,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B4 }, unicodeslot=0x1D739, visual="bi", @@ -235301,6 +233416,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B5 }, unicodeslot=0x1D73A, visual="bi", @@ -235310,6 +233426,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B6 }, unicodeslot=0x1D73B, visual="bi", @@ -235319,6 +233436,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B7 }, unicodeslot=0x1D73C, visual="bi", @@ -235328,6 +233446,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B8 }, unicodeslot=0x1D73D, visual="bi", @@ -235337,6 +233456,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B9 }, unicodeslot=0x1D73E, visual="bi", @@ -235346,6 +233466,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BA }, unicodeslot=0x1D73F, visual="bi", @@ -235355,6 +233476,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BB }, unicodeslot=0x1D740, visual="bi", @@ -235364,6 +233486,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BC }, unicodeslot=0x1D741, visual="bi", @@ -235373,6 +233496,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BD }, unicodeslot=0x1D742, visual="bi", @@ -235382,6 +233506,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BE }, unicodeslot=0x1D743, visual="bi", @@ -235391,6 +233516,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BF }, unicodeslot=0x1D744, visual="bi", @@ -235400,6 +233526,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C0 }, unicodeslot=0x1D745, visual="bi", @@ -235409,6 +233536,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C1 }, unicodeslot=0x1D746, visual="bi", @@ -235418,6 +233546,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL FINAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C2 }, unicodeslot=0x1D747, visual="bi", @@ -235427,6 +233556,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C3 }, unicodeslot=0x1D748, visual="bi", @@ -235436,6 +233566,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C4 }, unicodeslot=0x1D749, visual="bi", @@ -235445,6 +233576,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C5 }, unicodeslot=0x1D74A, visual="bi", @@ -235454,6 +233586,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C6 }, unicodeslot=0x1D74B, visual="bi", @@ -235463,6 +233596,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C7 }, unicodeslot=0x1D74C, visual="bi", @@ -235472,6 +233606,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C8 }, unicodeslot=0x1D74D, visual="bi", @@ -235481,6 +233616,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC SMALL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C9 }, unicodeslot=0x1D74E, visual="bi", @@ -235491,6 +233627,8 @@ characters.data={ direction="on", linebreak="al", mathclass="differential", + mathgroup="differential", + mathmeaning="vector partial", specials={ "font", 0x2202 }, unicodeslot=0x1D74F, visual="bi", @@ -235500,6 +233638,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC EPSILON SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F5 }, unicodeslot=0x1D750, visual="bi", @@ -235509,6 +233648,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D1 }, unicodeslot=0x1D751, visual="bi", @@ -235518,6 +233658,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC KAPPA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F0 }, unicodeslot=0x1D752, visual="bi", @@ -235527,6 +233668,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC PHI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D5 }, unicodeslot=0x1D753, visual="bi", @@ -235536,6 +233678,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC RHO SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F1 }, unicodeslot=0x1D754, visual="bi", @@ -235545,6 +233688,7 @@ characters.data={ description="MATHEMATICAL BOLD ITALIC PI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D6 }, unicodeslot=0x1D755, visual="bi", @@ -235554,6 +233698,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x391 }, unicodeslot=0x1D756, visual="bf", @@ -235563,6 +233708,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x392 }, unicodeslot=0x1D757, visual="bf", @@ -235572,6 +233718,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x393 }, unicodeslot=0x1D758, visual="bf", @@ -235581,6 +233728,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x394 }, unicodeslot=0x1D759, visual="bf", @@ -235590,6 +233738,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x395 }, unicodeslot=0x1D75A, visual="bf", @@ -235599,6 +233748,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x396 }, unicodeslot=0x1D75B, visual="bf", @@ -235608,6 +233758,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x397 }, unicodeslot=0x1D75C, visual="bf", @@ -235617,6 +233768,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x398 }, unicodeslot=0x1D75D, visual="bf", @@ -235626,6 +233778,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x399 }, unicodeslot=0x1D75E, visual="bf", @@ -235635,6 +233788,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39A }, unicodeslot=0x1D75F, visual="bf", @@ -235644,6 +233798,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39B }, unicodeslot=0x1D760, visual="bf", @@ -235653,6 +233808,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39C }, unicodeslot=0x1D761, visual="bf", @@ -235662,6 +233818,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39D }, unicodeslot=0x1D762, visual="bf", @@ -235671,6 +233828,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39E }, unicodeslot=0x1D763, visual="bf", @@ -235680,6 +233838,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39F }, unicodeslot=0x1D764, visual="bf", @@ -235689,6 +233848,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A0 }, unicodeslot=0x1D765, visual="bf", @@ -235698,6 +233858,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A1 }, unicodeslot=0x1D766, visual="bf", @@ -235707,6 +233868,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F4 }, unicodeslot=0x1D767, visual="bf", @@ -235716,6 +233878,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A3 }, unicodeslot=0x1D768, visual="bf", @@ -235725,6 +233888,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A4 }, unicodeslot=0x1D769, visual="bf", @@ -235734,6 +233898,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A5 }, unicodeslot=0x1D76A, visual="bf", @@ -235743,6 +233908,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A6 }, unicodeslot=0x1D76B, visual="bf", @@ -235752,6 +233918,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A7 }, unicodeslot=0x1D76C, visual="bf", @@ -235761,6 +233928,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A8 }, unicodeslot=0x1D76D, visual="bf", @@ -235770,6 +233938,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A9 }, unicodeslot=0x1D76E, visual="bf", @@ -235779,6 +233948,9 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD NABLA", direction="l", linebreak="al", + mathclass="differential", + mathgroup="differential", + mathmeaning="vector gradient", specials={ "font", 0x2207 }, unicodeslot=0x1D76F, visual="bf", @@ -235788,6 +233960,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B1 }, unicodeslot=0x1D770, visual="bf", @@ -235797,6 +233970,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B2 }, unicodeslot=0x1D771, visual="bf", @@ -235806,6 +233980,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B3 }, unicodeslot=0x1D772, visual="bf", @@ -235815,6 +233990,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B4 }, unicodeslot=0x1D773, visual="bf", @@ -235824,6 +234000,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B5 }, unicodeslot=0x1D774, visual="bf", @@ -235833,6 +234010,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B6 }, unicodeslot=0x1D775, visual="bf", @@ -235842,6 +234020,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B7 }, unicodeslot=0x1D776, visual="bf", @@ -235851,6 +234030,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B8 }, unicodeslot=0x1D777, visual="bf", @@ -235860,6 +234040,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B9 }, unicodeslot=0x1D778, visual="bf", @@ -235869,6 +234050,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BA }, unicodeslot=0x1D779, visual="bf", @@ -235878,6 +234060,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BB }, unicodeslot=0x1D77A, visual="bf", @@ -235887,6 +234070,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BC }, unicodeslot=0x1D77B, visual="bf", @@ -235896,6 +234080,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BD }, unicodeslot=0x1D77C, visual="bf", @@ -235905,6 +234090,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BE }, unicodeslot=0x1D77D, visual="bf", @@ -235914,6 +234100,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BF }, unicodeslot=0x1D77E, visual="bf", @@ -235923,6 +234110,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C0 }, unicodeslot=0x1D77F, visual="bf", @@ -235932,6 +234120,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C1 }, unicodeslot=0x1D780, visual="bf", @@ -235941,6 +234130,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL FINAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C2 }, unicodeslot=0x1D781, visual="bf", @@ -235950,6 +234140,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C3 }, unicodeslot=0x1D782, visual="bf", @@ -235959,6 +234150,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C4 }, unicodeslot=0x1D783, visual="bf", @@ -235968,6 +234160,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C5 }, unicodeslot=0x1D784, visual="bf", @@ -235977,6 +234170,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C6 }, unicodeslot=0x1D785, visual="bf", @@ -235986,6 +234180,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C7 }, unicodeslot=0x1D786, visual="bf", @@ -235995,6 +234190,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C8 }, unicodeslot=0x1D787, visual="bf", @@ -236004,6 +234200,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C9 }, unicodeslot=0x1D788, visual="bf", @@ -236014,6 +234211,8 @@ characters.data={ direction="on", linebreak="al", mathclass="differential", + mathgroup="differential", + mathmeaning="vector partial", specials={ "font", 0x2202 }, unicodeslot=0x1D789, visual="bf", @@ -236023,6 +234222,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F5 }, unicodeslot=0x1D78A, visual="bf", @@ -236032,6 +234232,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D1 }, unicodeslot=0x1D78B, visual="bf", @@ -236041,6 +234242,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F0 }, unicodeslot=0x1D78C, visual="bf", @@ -236050,6 +234252,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D5 }, unicodeslot=0x1D78D, visual="bf", @@ -236059,6 +234262,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F1 }, unicodeslot=0x1D78E, visual="bf", @@ -236068,6 +234272,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD PI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D6 }, unicodeslot=0x1D78F, visual="bf", @@ -236077,6 +234282,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x391 }, unicodeslot=0x1D790, visual="bi", @@ -236086,6 +234292,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x392 }, unicodeslot=0x1D791, visual="bi", @@ -236095,6 +234302,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x393 }, unicodeslot=0x1D792, visual="bi", @@ -236104,6 +234312,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x394 }, unicodeslot=0x1D793, visual="bi", @@ -236113,6 +234322,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x395 }, unicodeslot=0x1D794, visual="bi", @@ -236122,6 +234332,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x396 }, unicodeslot=0x1D795, visual="bi", @@ -236131,6 +234342,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x397 }, unicodeslot=0x1D796, visual="bi", @@ -236140,6 +234352,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x398 }, unicodeslot=0x1D797, visual="bi", @@ -236149,6 +234362,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x399 }, unicodeslot=0x1D798, visual="bi", @@ -236158,6 +234372,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39A }, unicodeslot=0x1D799, visual="bi", @@ -236167,6 +234382,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39B }, unicodeslot=0x1D79A, visual="bi", @@ -236176,6 +234392,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39C }, unicodeslot=0x1D79B, visual="bi", @@ -236185,6 +234402,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39D }, unicodeslot=0x1D79C, visual="bi", @@ -236194,6 +234412,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39E }, unicodeslot=0x1D79D, visual="bi", @@ -236203,6 +234422,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x39F }, unicodeslot=0x1D79E, visual="bi", @@ -236212,6 +234432,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A0 }, unicodeslot=0x1D79F, visual="bi", @@ -236221,6 +234442,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A1 }, unicodeslot=0x1D7A0, visual="bi", @@ -236230,6 +234452,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F4 }, unicodeslot=0x1D7A1, visual="bi", @@ -236239,6 +234462,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A3 }, unicodeslot=0x1D7A2, visual="bi", @@ -236248,6 +234472,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A4 }, unicodeslot=0x1D7A3, visual="bi", @@ -236257,6 +234482,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A5 }, unicodeslot=0x1D7A4, visual="bi", @@ -236266,6 +234492,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A6 }, unicodeslot=0x1D7A5, visual="bi", @@ -236275,6 +234502,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A7 }, unicodeslot=0x1D7A6, visual="bi", @@ -236284,6 +234512,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A8 }, unicodeslot=0x1D7A7, visual="bi", @@ -236293,6 +234522,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3A9 }, unicodeslot=0x1D7A8, visual="bi", @@ -236302,6 +234532,9 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA", direction="l", linebreak="al", + mathclass="differential", + mathgroup="differential", + mathmeaning="vector gradient", specials={ "font", 0x2207 }, unicodeslot=0x1D7A9, visual="bi", @@ -236311,6 +234544,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B1 }, unicodeslot=0x1D7AA, visual="bi", @@ -236320,6 +234554,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL BETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B2 }, unicodeslot=0x1D7AB, visual="bi", @@ -236329,6 +234564,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL GAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B3 }, unicodeslot=0x1D7AC, visual="bi", @@ -236338,6 +234574,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL DELTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B4 }, unicodeslot=0x1D7AD, visual="bi", @@ -236347,6 +234584,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL EPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B5 }, unicodeslot=0x1D7AE, visual="bi", @@ -236356,6 +234594,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B6 }, unicodeslot=0x1D7AF, visual="bi", @@ -236365,6 +234604,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B7 }, unicodeslot=0x1D7B0, visual="bi", @@ -236374,6 +234614,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL THETA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B8 }, unicodeslot=0x1D7B1, visual="bi", @@ -236383,6 +234624,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL IOTA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3B9 }, unicodeslot=0x1D7B2, visual="bi", @@ -236392,6 +234634,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL KAPPA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BA }, unicodeslot=0x1D7B3, visual="bi", @@ -236401,6 +234644,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMDA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BB }, unicodeslot=0x1D7B4, visual="bi", @@ -236410,6 +234654,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BC }, unicodeslot=0x1D7B5, visual="bi", @@ -236419,6 +234664,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL NU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BD }, unicodeslot=0x1D7B6, visual="bi", @@ -236428,6 +234674,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL XI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BE }, unicodeslot=0x1D7B7, visual="bi", @@ -236437,6 +234684,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMICRON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3BF }, unicodeslot=0x1D7B8, visual="bi", @@ -236446,6 +234694,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C0 }, unicodeslot=0x1D7B9, visual="bi", @@ -236455,6 +234704,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL RHO", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C1 }, unicodeslot=0x1D7BA, visual="bi", @@ -236464,6 +234714,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL FINAL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C2 }, unicodeslot=0x1D7BB, visual="bi", @@ -236473,6 +234724,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL SIGMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C3 }, unicodeslot=0x1D7BC, visual="bi", @@ -236482,6 +234734,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL TAU", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C4 }, unicodeslot=0x1D7BD, visual="bi", @@ -236491,6 +234744,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C5 }, unicodeslot=0x1D7BE, visual="bi", @@ -236500,6 +234754,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C6 }, unicodeslot=0x1D7BF, visual="bi", @@ -236509,6 +234764,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C7 }, unicodeslot=0x1D7C0, visual="bi", @@ -236518,6 +234774,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PSI", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C8 }, unicodeslot=0x1D7C1, visual="bi", @@ -236527,6 +234784,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3C9 }, unicodeslot=0x1D7C2, visual="bi", @@ -236537,6 +234795,8 @@ characters.data={ direction="on", linebreak="al", mathclass="differential", + mathgroup="differential", + mathmeaning="vector partial", specials={ "font", 0x2202 }, unicodeslot=0x1D7C3, visual="bi", @@ -236546,6 +234806,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F5 }, unicodeslot=0x1D7C4, visual="bi", @@ -236555,6 +234816,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D1 }, unicodeslot=0x1D7C5, visual="bi", @@ -236564,6 +234826,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F0 }, unicodeslot=0x1D7C6, visual="bi", @@ -236573,6 +234836,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D5 }, unicodeslot=0x1D7C7, visual="bi", @@ -236582,6 +234846,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3F1 }, unicodeslot=0x1D7C8, visual="bi", @@ -236591,6 +234856,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3D6 }, unicodeslot=0x1D7C9, visual="bi", @@ -236600,6 +234866,7 @@ characters.data={ description="MATHEMATICAL BOLD CAPITAL DIGAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3DC }, unicodeslot=0x1D7CA, visual="bf", @@ -236609,6 +234876,7 @@ characters.data={ description="MATHEMATICAL BOLD SMALL DIGAMMA", direction="l", linebreak="al", + mathclass="variable", specials={ "font", 0x3DD }, unicodeslot=0x1D7CB, visual="bf", @@ -236618,6 +234886,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT ZERO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x30 }, unicodeslot=0x1D7CE, visual="bf", @@ -236627,6 +234896,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT ONE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x31 }, unicodeslot=0x1D7CF, visual="bf", @@ -236636,6 +234906,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT TWO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x32 }, unicodeslot=0x1D7D0, visual="bf", @@ -236645,6 +234916,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT THREE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x33 }, unicodeslot=0x1D7D1, visual="bf", @@ -236654,6 +234926,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT FOUR", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x34 }, unicodeslot=0x1D7D2, visual="bf", @@ -236663,6 +234936,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT FIVE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x35 }, unicodeslot=0x1D7D3, visual="bf", @@ -236672,6 +234946,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT SIX", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x36 }, unicodeslot=0x1D7D4, visual="bf", @@ -236681,6 +234956,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT SEVEN", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x37 }, unicodeslot=0x1D7D5, visual="bf", @@ -236690,6 +234966,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT EIGHT", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x38 }, unicodeslot=0x1D7D6, visual="bf", @@ -236699,6 +234976,7 @@ characters.data={ description="MATHEMATICAL BOLD DIGIT NINE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x39 }, unicodeslot=0x1D7D7, visual="bf", @@ -236708,6 +234986,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x30 }, unicodeslot=0x1D7D8, }, @@ -236716,6 +234995,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT ONE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x31 }, unicodeslot=0x1D7D9, }, @@ -236724,6 +235004,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT TWO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x32 }, unicodeslot=0x1D7DA, }, @@ -236732,6 +235013,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT THREE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x33 }, unicodeslot=0x1D7DB, }, @@ -236740,6 +235022,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT FOUR", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x34 }, unicodeslot=0x1D7DC, }, @@ -236748,6 +235031,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT FIVE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x35 }, unicodeslot=0x1D7DD, }, @@ -236756,6 +235040,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT SIX", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x36 }, unicodeslot=0x1D7DE, }, @@ -236764,6 +235049,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT SEVEN", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x37 }, unicodeslot=0x1D7DF, }, @@ -236772,6 +235058,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT EIGHT", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x38 }, unicodeslot=0x1D7E0, }, @@ -236780,6 +235067,7 @@ characters.data={ description="MATHEMATICAL DOUBLE-STRUCK DIGIT NINE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x39 }, unicodeslot=0x1D7E1, }, @@ -236788,6 +235076,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT ZERO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x30 }, unicodeslot=0x1D7E2, }, @@ -236796,6 +235085,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT ONE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x31 }, unicodeslot=0x1D7E3, }, @@ -236804,6 +235094,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT TWO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x32 }, unicodeslot=0x1D7E4, }, @@ -236812,6 +235103,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT THREE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x33 }, unicodeslot=0x1D7E5, }, @@ -236820,6 +235112,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT FOUR", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x34 }, unicodeslot=0x1D7E6, }, @@ -236828,6 +235121,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT FIVE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x35 }, unicodeslot=0x1D7E7, }, @@ -236836,6 +235130,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT SIX", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x36 }, unicodeslot=0x1D7E8, }, @@ -236844,6 +235139,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT SEVEN", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x37 }, unicodeslot=0x1D7E9, }, @@ -236852,6 +235148,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT EIGHT", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x38 }, unicodeslot=0x1D7EA, }, @@ -236860,6 +235157,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF DIGIT NINE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x39 }, unicodeslot=0x1D7EB, }, @@ -236868,6 +235166,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x30 }, unicodeslot=0x1D7EC, visual="bf", @@ -236877,6 +235176,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT ONE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x31 }, unicodeslot=0x1D7ED, visual="bf", @@ -236886,6 +235186,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT TWO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x32 }, unicodeslot=0x1D7EE, visual="bf", @@ -236895,6 +235196,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT THREE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x33 }, unicodeslot=0x1D7EF, visual="bf", @@ -236904,6 +235206,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT FOUR", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x34 }, unicodeslot=0x1D7F0, visual="bf", @@ -236913,6 +235216,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x35 }, unicodeslot=0x1D7F1, visual="bf", @@ -236922,6 +235226,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT SIX", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x36 }, unicodeslot=0x1D7F2, visual="bf", @@ -236931,6 +235236,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT SEVEN", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x37 }, unicodeslot=0x1D7F3, visual="bf", @@ -236940,6 +235246,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT EIGHT", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x38 }, unicodeslot=0x1D7F4, visual="bf", @@ -236949,6 +235256,7 @@ characters.data={ description="MATHEMATICAL SANS-SERIF BOLD DIGIT NINE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x39 }, unicodeslot=0x1D7F5, visual="bf", @@ -236958,6 +235266,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT ZERO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x30 }, unicodeslot=0x1D7F6, }, @@ -236966,6 +235275,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT ONE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x31 }, unicodeslot=0x1D7F7, }, @@ -236974,6 +235284,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT TWO", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x32 }, unicodeslot=0x1D7F8, }, @@ -236982,6 +235293,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT THREE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x33 }, unicodeslot=0x1D7F9, }, @@ -236990,6 +235302,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT FOUR", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x34 }, unicodeslot=0x1D7FA, }, @@ -236998,6 +235311,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT FIVE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x35 }, unicodeslot=0x1D7FB, }, @@ -237006,6 +235320,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT SIX", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x36 }, unicodeslot=0x1D7FC, }, @@ -237014,6 +235329,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT SEVEN", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x37 }, unicodeslot=0x1D7FD, }, @@ -237022,6 +235338,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT EIGHT", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x38 }, unicodeslot=0x1D7FE, }, @@ -237030,6 +235347,7 @@ characters.data={ description="MATHEMATICAL MONOSPACE DIGIT NINE", direction="en", linebreak="nu", + mathclass="digit", specials={ "font", 0x39 }, unicodeslot=0x1D7FF, }, diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua index 627ba072c70..73b3462916b 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua @@ -254,6 +254,7 @@ local blocks = allocate { ["cjkunifiedideographsextensionf"] = { first = 0x2CEB0, last = 0x2EBEF, description = "CJK Unified Ideographs Extension F" }, ["cjkunifiedideographsextensiong"] = { first = 0x30000, last = 0x3134F, description = "CJK Unified Ideographs Extension G" }, ["cjkunifiedideographsextensionh"] = { first = 0x31350, last = 0x323AF, description = "CJK Unified Ideographs Extension H" }, + ["cjkunifiedideographsextensioni"] = { first = 0x2EBF0, last = 0x2EE5F, description = "CJK Unified Ideographs Extension I" }, ["combiningdiacriticalmarks"] = { first = 0x00300, last = 0x0036F, description = "Combining Diacritical Marks" }, ["combiningdiacriticalmarksextended"] = { first = 0x01AB0, last = 0x01AFF, description = "Combining Diacritical Marks Extended" }, ["combiningdiacriticalmarksforsymbols"] = { first = 0x020D0, last = 0x020FF, description = "Combining Diacritical Marks for Symbols" }, @@ -586,18 +587,39 @@ local blocks = allocate { ["zanabazarsquare"] = { first = 0x11A00, last = 0x11A4F, description = "Zanabazar Square" }, ["znamennymusicalnotation"] = { first = 0x1CF00, last = 0x1CFCF, description = "Znamenny Musical Notation" }, - -- we need this early on: + -- The calligraphic shapes are different from script shapes but don't have a dedicated + -- range so we make one. An example of a font that has them is Lucida but we also drop + -- them into other fonts. ["lowercasecalligraphic"] = { first = 0x100000, last = 0x100019, math = true }, ["uppercasecalligraphic"] = { first = 0x100020, last = 0x100039, math = true }, ["lowercaseboldcalligraphic"] = { first = 0x100040, last = 0x100059, math = true }, ["uppercaseboldcalligraphic"] = { first = 0x100060, last = 0x100079, math = true }, - -- ["lowercasesansgreek"] = { first = 0x100040, last = 0x100059, math = true }, -- reserved for future use - -- ["uppercasesansgreek"] = { first = 0x100060, last = 0x100079, math = true }, -- reserved for future use - -- ["lowercaseitalicsansgreek"] = { first = 0x100080, last = 0x100099, math = true }, -- reserved for future use - -- ["uppercaseitalicsansgreek"] = { first = 0x1000A0, last = 0x1000B9, math = true }, -- reserved for future use - -- ["lowercaseblackboarditalic"] = { first = 0x1000C0, last = 0x1000D9, math = true }, -- reserved for future use - -- ["uppercaseblackboarditalic"] = { first = 0x1000E0, last = 0x1000F9, math = true }, -- reserved for future use + + -- At the same time we reserve(d) some extra greek alphabets and surprise, a font like + -- stixtwo actually has them, so we enable them now. + + ["lowercasesansgreek"] = { first = 0x100080, last = 0x100099, math = true }, + ["uppercasesansgreek"] = { first = 0x1000A0, last = 0x1000B9, math = true }, + ["lowercaseitalicsansgreek"] = { first = 0x1000C0, last = 0x1000D9, math = true }, + ["uppercaseitalicsansgreek"] = { first = 0x1000E0, last = 0x1000F9, math = true }, + + -- Maybe this one also makes sense, although the fact that all these extra alphabets + -- were not made part of unicode math (combined with the holes in alphabets) indicates + -- that usage was not perceived. + + ["lowercaseblackboarditalic"] = { first = 0x100100, last = 0x100119, math = true }, + ["uppercaseblackboarditalic"] = { first = 0x100120, last = 0x100139, math = true }, + + -- Anyway, all permutations at some point might show up, but it might take decades + -- before the tex math dev community catches on. In the end it is upto microsoft to + -- take the lead, just as with other unicode math and fonts. + -- + -- Also, it would be a bit pathetic to add more alphabets natively to unicode at + -- the one hand while accepting these gaps in existing alphabets and not having a + -- native upright greek math alphabet either in order to distringuish from greek + -- text. Either we go semantic ore go shapes, but a mix is only confusing. + } -- moved from math-act.lua to here: @@ -859,7 +881,14 @@ setmetatableindex(characters.can_have_space, mti) -- normative : BK CR LF CM SG GL CB SP ZW NL WJ JL JV JT H2 H3 -- informative : XX OP CL CP QU NS EX SY IS PR PO NU AL ID IN HY BB BA SA AI B2 HL CJ RI -- --- comments taken from standard: +-- U+03400..U+04DBF ID +-- U+04E00..U+09FFF ID +-- U+0F900..U+0FAFF ID +-- U+20000..U+2FFFD ID +-- U+30000..U+3FFFD ID +-- U+1F000..U+1FAFF ID +-- U+1FC00..U+1FFFD ID +-- U+020A0..U+020CF PR characters.linebreaks = allocate { @@ -906,7 +935,10 @@ characters.linebreaks = allocate { -- other characters ["ai"] = "ambiguous (alphabetic or ideographic)", -- characters with ambiguous east asian width : act like al when the resolved eaw is n; otherwise, act as id + ["ak"] = "aksara", -- Consonants ["al"] = "alphabetic", -- alphabets and regular symbols : are alphabetic characters or symbols that are used with alphabetic characters + ["ap"] = "aksara pre-pase", -- pre-base repha + ["as"] = "ksara start", -- independent vowels ["cj"] = "conditional japanese starter", -- small kana : treat as ns or id for strict or normal breaking. ["eb"] = "emoji base", -- all emoji allowing modifiers, do not break from following emoji modifier ["em"] = "emoji modifier", -- skin tone modifiers, do not break from preceding emoji base @@ -915,10 +947,12 @@ characters.linebreaks = allocate { ["hl"] = "hebrew letter", -- hebrew : do not break around a following hyphen; otherwise act as alphabetic ["id"] = "ideographic", -- ideographs : break before or after, except in some numeric context ["jl"] = "hangul l jamo", -- conjoining jamo : form korean syllable blocks - ["jv"] = "hangul v jamo", -- conjoining jamo : form korean syllable blocks ["jt"] = "hangul t jamo", -- conjoining jamo : form korean syllable blocks + ["jv"] = "hangul v jamo", -- conjoining jamo : form korean syllable blocks ["ri"] = "regional indicator", -- regional indicator symbol letter a .. z : keep together, break before and after from others ["sa"] = "complex context dependent (south east asian)", -- south east asian: thai, lao, khmer : provide a line break opportunity contingent on additional, language-specific context analysis + ["vf"] = "virama final", -- Viramas for final consonants + ["vi"] = "virama", -- Conjoining viramas ["xx"] = "unknown", -- most unassigned, private-use : have as yet unknown line breaking behavior or unassigned code positions } diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua index 09547d00540..1f7e6b108f6 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua @@ -64,12 +64,14 @@ local private = { utffilters.private = private -for ch in gmatch(special,".") do - local cb - if type(ch) == "number" then - cb, ch = ch, utfchar(ch) +for chr in gmatch(special,".") do + local cb, ch + if type(chr) == "number" then + ch = utfchar(chr) + cb = chr else - cb = utfbyte(ch) + ch = chr + cb = utfbyte(chr) end if cb < 256 then escapes[ch] = "\\" .. ch diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua b/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua index f9cba36ca5c..4e9e8c250fe 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua @@ -168,11 +168,13 @@ else end elseif kind == "with" then if size == 3 then - combined[utfchar(vs[2])..utfchar(vs[3])] = utfchar(unicode) + -- combined[utfchar(vs[2])..utfchar(vs[3])] = utfchar(unicode) + combined[utfchar(vs[2],vs[3])] = utfchar(unicode) end elseif kind == "compat" then if size == 3 then - combined[utfchar(vs[2])..utfchar(vs[3])] = utfchar(unicode) + -- combined[utfchar(vs[2])..utfchar(vs[3])] = utfchar(unicode) + combined[utfchar(vs[2],vs[3])] = utfchar(unicode) end if size > 2 and (v.mathclass or v.mathspec) then setlist(unicode,vs,2,"specials") diff --git a/Master/texmf-dist/tex/context/base/mkiv/chem-str.lua b/Master/texmf-dist/tex/context/base/mkiv/chem-str.lua index 1316769cac5..2a4ed3242f3 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/chem-str.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/chem-str.lua @@ -39,7 +39,7 @@ local processor_tostring = typesetters and typesetters.processors.tostring local settings_to_array = utilities.parsers.settings_to_array local settings_to_array_with_repeat = utilities.parsers.settings_to_array_with_repeat -local lpegmatch = lpeg.match +local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns local P, R, S, C, Cs, Ct, Cc, Cmt = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.Cc, lpeg.Cmt local variables = interfaces and interfaces.variables @@ -824,10 +824,10 @@ implement { { "symalign" }, { "axis" }, { "framecolor" }, - { "rulethickness" }, - { "offset" }, - { "unit" }, - { "factor" } + { "rulethickness", "dimension" }, + { "offset", "dimension" }, + { "unit", "dimension" }, + { "factor", "integer" } } } } @@ -848,6 +848,7 @@ implement { local inline = { ["single"] = "\\chemicalsinglebond", ["-"] = "\\chemicalsinglebond", + -- ["−"] = "\\chemicalsinglebond", ["double"] = "\\chemicaldoublebond", ["--"] = "\\chemicaldoublebond", ["="] = "\\chemicaldoublebond", ["triple"] = "\\chemicaltriplebond", ["---"] = "\\chemicaltriplebond", @@ -863,7 +864,8 @@ local inline = { ["space"] = "\\chemicalspace", } -local ctx_chemicalinline = context.chemicalinline +local ctx_chemicalinline = context.chemicalinline +local ctx_chemicalspecial = context.chemicalspecial function chemistry.inlinechemical(spec) local spec = settings_to_array_with_repeat(spec,true) @@ -871,7 +873,7 @@ function chemistry.inlinechemical(spec) local s = spec[i] local inl = inline[lower(s)] if inl then - context(inl) -- could be a fast context.sprint + ctx_chemicalspecial(inl) else ctx_chemicalinline(molecule(s)) end @@ -883,3 +885,73 @@ implement { actions = chemistry.inlinechemical, arguments = "string" } + +-- This is the new approach: + +do + + local short_mapping = { + ["-"] = "\\csinglebond ", + -- ["−"] = "\\csinglebond ", + ["--"] = "\\cdoublebond ", + ["="] = "\\cdoublebond ", + ["---"] = "\\ctriplebond ", + ["≡"] = "\\ctriplebond ", + ["->"] = "\\cgives ", + ["<-"] = "\\creturns ", + ["<->"] = "\\cmesomeric ", + ["-->"] = "\\clonggives ", + ["<--"] = "\\clongreturns ", + ["<-->"] = "\\clongmesomeric ", + ["<=>"] = "\\cequilibrium ", + ["<="] = "\\cleaningleft ", + ["=>"] = "\\cleaningright ", + ["<==>"] = "\\clongequilibrium ", + ["<=="] = "\\clongleaningleft ", + ["==>"] = "\\clongleaningright ", + } + + local long_mapping = { + ["single"] = "\\csinglebond ", + ["double"] = "\\cdoublebond ", + ["triple"] = "\\ctriplebond ", + ["gives"] = "\\cgives ", ["lgives"] = "\\clonggives ", + ["returns"] = "\\creturns ", ["lreturns"] = "\\clongreturns ", + ["mesomeric"] = "\\cmesomeric ", ["lmesomeric"] = "\\clongmesomeric ", + ["equilibrium"] = "\\cequilibrium ", ["lequilibrium"] = "\\clongequilibrium ", + ["leaningleft"] = "\\cleaningleft ", ["lleaningleft"] = "\\clongleaningleft ", + ["leaningright"] = "\\cleaningright ", ["lleaningright"] = "\\clongleaningright ", + -- ["plus"] = "\\cplus ", + -- ["minus"] = "\\cminus ", + -- ["equals"] = "\\cequals ", + } + + local sign = S("+-") + local script = S("^_") + local character = lpegpatterns.utf8character + local cardinal = lpegpatterns.cardinal + local spaces = lpegpatterns.whitespace + local nospaces = spaces^0/"" + + local short = lpeg.utfchartabletopattern(short_mapping) + local long = lpeg.utfchartabletopattern(long_mapping) + + local csname = P("\\") * R("az")^1 -- \left[ * lpegpatterns.nestedbrackets^-1 + + local pattern = Cs (( + csname + + spaces * (short / short_mapping) * spaces + + spaces * (long / long_mapping) * spaces + + script^1 * nospaces * Cc("{") * nospaces * (sign^-1 * cardinal^1 + sign) * Cc("}") + + character + )^0) + + interfaces.implement { + name = "ic", + arguments = "string", + actions = function(s) + context(lpegmatch(pattern,s)) + end + } + +end diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua index b7f1628622f..90a5c2468f9 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua @@ -403,7 +403,7 @@ local registerscanner if CONTEXTLMTXMODE > 0 then -- todo: make bitset instead of keys (nil is skipped anyway) local function toflags(specification) - local protected = specification.protected and "protected" + local protected = (specification.protected and "protected") or (specification.semiprotected and "semiprotected") local untraced = specification.untraced and "untraced" local usage = specification.usage if usage == "value" then @@ -413,7 +413,7 @@ local registerscanner if CONTEXTLMTXMODE > 0 then elseif specification.frozen then return "global", "frozen", untraced, protected elseif specification.permanent == false or specification.onlyonce then -- for now onlyonce here - return "global", untraced, protected + return "global", untraced, protected, semiprotected else return "global", "permanent", untraced, protected end @@ -492,11 +492,14 @@ end local function dummy() end +local texsetmacro = token.setmacro or token.set_macro + function commands.ctxresetter(name) -- to be checked return function() if storedscanners[name] then rawset(interfacescanners,name,dummy) - context.resetctxscanner(privatenamespace .. name) + -- context.resetctxscanner(privatenamespace .. name) + texsetmacro(privatenamespace .. name,"","global") end end end @@ -1664,22 +1667,13 @@ do end local p_texescape = patterns.texescape + local p_ctxescape = patterns.ctxescape - function context.escaped(s) - if s then - context(lpegmatch(p_texescape,s) or s) - else - -- context("") - end - end + function context.escaped (s) if s then context(lpegmatch(p_texescape,s) or s) end end + function context.ctxescaped(s) if s then context(lpegmatch(p_ctxescape,s) or s) end end - function context.escape(s) - if s then - return lpegmatch(p_texescape,s) or s - else - return "" - end - end + function context.escape (s) return (s and lpegmatch(p_texescape,s)) or s or "" end + function context.ctxescape(s) return (s and lpegmatch(p_ctxescape,s)) or s or "" end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-prs.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-prs.lua index 3c3836a3ee8..7b9e4b4468e 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/cldf-prs.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-prs.lua @@ -24,33 +24,19 @@ local backslash = P("\\") local csname = backslash * P(1) * (1-backslash-leftbrace)^0 * P(" ")^0 local sign = P("+") / "\\textplus " + P("-") / "\\textminus " -local nested = P { leftbrace * (V(1) + (1-rightbrace))^0 * rightbrace } +local nested = P { leftbrace * (V(1) + (1-rightbrace))^0 * rightbrace } -- we already have this local subscript = P("_") local superscript = P("^") --- local scripts = P { "start", --- start = V("csname") + V("lowfirst") + V("highfirst"), --- csname = csname, --- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8character)), --- lowfirst = subscript * ( Cc("\\lohi{%s}{%s}") * V("content") * superscript + Cc("\\low{%s}" ) ) * V("content") / format, --- highfirst = superscript * ( Cc("\\hilo{%s}{%s}") * V("content") * subscript + Cc("\\high{%s}") ) * V("content") / format, --- } - --- local scripts = P { "start", --- start = (V("csname") + V("lowfirst") + V("highfirst"))^1, --- csname = csname, --- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8character)), --- lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), --- highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), --- } - local scripted = Cs { "start", start = (V("csname") + V("nested") + V("lowfirst") + V("highfirst") + V("character"))^1, rest = V("csname") + V("nested") + V("lowfirst") + V("highfirst"), csname = csname, character = utf8character, - -- nested = leftbrace * (V("rest") + (V("character")-rightbrace))^0 * rightbrace, - nested = leftbrace * (V("start") -rightbrace)^0 * rightbrace, + nested = leftbrace * (V("rest") + (V("character")-rightbrace))^0 * rightbrace, + -- why does this fail: + -- nested = leftbrace * (V("start") - rightbrace)^0 * rightbrace, + -- nested = lpeg.patterns.nested, -- leftbrace * (V("start") - rightbrace)^0 * rightbrace, -- content = Cs(V("nested") + sign^-1 * (cardinal + V("character"))), content = V("nested") + sign^-1 * (cardinal + V("character")) + sign, lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), @@ -61,7 +47,9 @@ cpatterns.csname = csname cpatterns.scripted = scripted cpatterns.nested = nested --- print(lpegmatch(scripted,"10^-3_x")) +-- print(lpegmatch(scripted,"^4_2He")) +-- print(lpegmatch(scripted,"^{4}_{2}He")) +-- print(lpegmatch(scripted,"^{4}He")) -- print(lpegmatch(scripted,"\\L {C_5}")) -- print(lpegmatch(scripted,"\\SL{}")) -- print(lpegmatch(scripted,"\\SL{C_5}")) @@ -69,4 +57,3 @@ cpatterns.nested = nested -- print(lpegmatch(scripted,"{C_5}")) -- print(lpegmatch(scripted,"{\\C_5}")) -- print(lpegmatch(scripted,"10^-a")) - diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv index a3bc4164e7c..8e69b649100 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.05.05 18:36} +\newcontextversion{2024.02.27 09:18} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv index 1ef4503ab17..37f382a4fa3 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2023.05.05 18:36} +\edef\contextversion{2024.02.27 09:18} %D Kind of special: diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-con.lua b/Master/texmf-dist/tex/context/base/mkiv/core-con.lua index d3e108a7a3d..e8e6117ea1e 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/core-con.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/core-con.lua @@ -15,7 +15,7 @@ if not modules then modules = { } end modules ['core-con'] = { local floor = math.floor local osdate, ostime, ostimezone = os.date, os.time, os.timezone local concat, insert, reverse = table.concat, table.insert, table.reverse -local lower, upper, rep, match, gsub = string.lower, string.upper, string.rep, string.match, string.gsub +local lower, upper, rep, match, gsub, gmatch = string.lower, string.upper, string.rep, string.match, string.gsub, string.gmatch local utfchar, utfbyte = utf.char, utf.byte local tonumber, tostring, type, rawset = tonumber, tostring, type, rawset local P, S, R, Cc, Cf, Cg, Ct, Cs, C, V, Carg = lpeg.P, lpeg.S, lpeg.R, lpeg.Cc, lpeg.Cf, lpeg.Cg, lpeg.Ct, lpeg.Cs, lpeg.C, lpeg.V, lpeg.Carg @@ -621,9 +621,21 @@ local vector = { } } -local function tochinese(n,name) -- normal, caps, all - -- improved version by Li Yanrui +local function tochinese(n,name) -- normal, caps, all, date + -- improved version by Li Yanrui, Song Yihan local result, r = { }, 0 + + if name == "date" then + -- We could do some number juggling instead but this is fast enough. There is + -- no error checking here so we assume a proper year. Maybe a better name is + -- asis (so that it can be used for more than dates). + local vector = vector.normal + for s in gmatch(tostring(n),".") do + r = r + 1 ; result[r] = vector[tonumber(s)] + end + return concat(result) + end + local vector = vector[name] or vector.normal while true do if n == 0 then @@ -708,10 +720,12 @@ converters.tochinese = tochinese function converters.chinesenumerals (n,how) return tochinese(n,how or "normal") end function converters.chinesecapnumerals(n) return tochinese(n,"cap") end function converters.chineseallnumerals(n) return tochinese(n,"all") end +function converters.chinesedatenumerals(n) return tochinese(n,"date") end converters['cn'] = converters.chinesenumerals converters['cn-c'] = converters.chinesecapnumerals converters['cn-a'] = converters.chineseallnumerals +converters['cn-d'] = converters.chinesedatenumerals implement { name = "chinesenumerals", diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv index 616ed199640..b9912d8ebf1 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv @@ -107,9 +107,10 @@ \let\koreanparenthesisnumerals\koreannumeralsp \let\koreancirclenumerals \koreannumeralsc -\def\chinesenumerals #1{\clf_chinesenumerals\numexpr#1\relax{normal}} -\def\chinesecapnumerals#1{\clf_chinesenumerals\numexpr#1\relax{cap}} -\def\chineseallnumerals#1{\clf_chinesenumerals\numexpr#1\relax{all}} +\def\chinesenumerals #1{\clf_chinesenumerals\numexpr#1\relax{normal}} +\def\chinesecapnumerals #1{\clf_chinesenumerals\numexpr#1\relax{cap}} +\def\chineseallnumerals #1{\clf_chinesenumerals\numexpr#1\relax{all}} +\def\chinesedatenumerals#1{\clf_chinesenumerals\numexpr#1\relax{date}} %D \macros %D {character,Character} @@ -779,10 +780,12 @@ \defineconversion [chinesenumerals] [\chinesenumerals] \defineconversion [chinesecapnumerals] [\chinesecapnumerals] \defineconversion [chineseallnumerals] [\chineseallnumerals] +\defineconversion [chinesedatenumerals] [\chinesedatenumerals] \defineconversion [cn] [\chinesenumerals] \defineconversion [cn-c] [\chinesecapnumerals] \defineconversion [cn-a] [\chineseallnumerals] +\defineconversion [cn-d] [\chinesedatenumerals] %D Moved from lang-def.mkiv: %D diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/core-ctx.lua index 1c39b658124..eb8cf45ba34 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/core-ctx.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/core-ctx.lua @@ -193,7 +193,7 @@ function ctxrunner.load(ctxname) for r, d, k in xml.elements(pattern,"/ctx:value[@name='old'") do d[k] = jobname end - pattern =justtext(xml.tostring(pattern)) + local pattern =justtext(xml.tostring(pattern)) if preprocessor and preprocessor ~= "" and pattern and pattern ~= "" then local noftreatments = #treatments + 1 local findpattern = string.topattern(pattern) @@ -327,8 +327,8 @@ function ctxrunner.preparedfile(name) return resolve(name) or name end -local processfile = commands.processfile -local doifelseinputfile = commands.doifelseinputfile +local ctx_processfile = commands.processfile +local ctx_doifelseinputfile = commands.doifelseinputfile implement { name = "processfile", @@ -337,9 +337,10 @@ implement { actions = function(name,maxreadlevel) -- overloaded local prepname = resolve(name) if prepname then - return processfile(prepname,0) + return ctx_processfile(prepname,0) + else + return ctx_processfile(name,maxreadlevel) end - return processfile(name,maxreadlevel) end } @@ -350,9 +351,10 @@ implement { actions = function(name,depth) local prepname = resolve(name) if prepname then - return doifelseinputfile(prepname,0) + return ctx_doifelseinputfile(prepname,0) + else + return ctx_doifelseinputfile(name,depth) end - return doifelseinputfile(name,depth) end } diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv index 0f042f81512..331c66fa1a7 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv @@ -574,17 +574,22 @@ % Is doglobal still relevant? Maybe always global? Or never? Anyway, it will become obsolete. +\let\syst_setups_def\def + +\unexpanded\def\pushglobalsetups{\let\syst_setups_def\gdef} +\unexpanded\def\popglobalsetups {\let\syst_setups_def\def } + \unexpanded\def\startluasetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_lua_a\syst_setups_start_lua_b} \let\stopluasetups \relax \unexpanded\def\startxmlsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_xml_a\syst_setups_start_xml_b} \let\stopxmlsetups \relax \unexpanded\def\startrawsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_raw_a\syst_setups_start_raw_b} \let\stoprawsetups \relax \unexpanded\def\startlocalsetups{\begingroup\doifelsenextoptionalcs\syst_setups_start_loc_a\syst_setups_start_loc_b} \let\stoplocalsetups \relax \unexpanded\def\startsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_tex_a\syst_setups_start_tex_b} \let\stopsetups \relax -\def\syst_setups_start_lua_indeed#1#2#3\stopluasetups {\endgroup\dodoglobal\expandafter\def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} -\def\syst_setups_start_xml_indeed#1#2#3\stopxmlsetups {\endgroup\dodoglobal\expandafter\def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} -\def\syst_setups_start_raw_indeed#1#2#3\stoprawsetups {\endgroup\dodoglobal\expandafter\def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} -\def\syst_setups_start_loc_indeed#1#2#3\stoplocalsetups{\endgroup\dodoglobal\expandafter\def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} -\def\syst_setups_start_tex_indeed#1#2#3\stopsetups {\endgroup\dodoglobal\expandafter\def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} +\def\syst_setups_start_lua_indeed#1#2#3\stopluasetups {\endgroup\dodoglobal\expandafter\syst_setups_def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} +\def\syst_setups_start_xml_indeed#1#2#3\stopxmlsetups {\endgroup\dodoglobal\expandafter\syst_setups_def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} +\def\syst_setups_start_raw_indeed#1#2#3\stoprawsetups {\endgroup\dodoglobal\expandafter\syst_setups_def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} +\def\syst_setups_start_loc_indeed#1#2#3\stoplocalsetups{\endgroup\dodoglobal\expandafter\syst_setups_def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} +\def\syst_setups_start_tex_indeed#1#2#3\stopsetups {\endgroup\dodoglobal\expandafter\syst_setups_def\csname\??setup#1:#2\expandafter\endcsname\expandafter##\expandafter1\expandafter{#3}} \def\syst_setups_start_lua{\ifsecondargument\expandafter\syst_setups_start_lua_c\else\expandafter\syst_setups_start_lua_d\fi} \def\syst_setups_start_xml{\ifsecondargument\expandafter\syst_setups_start_xml_c\else\expandafter\syst_setups_start_xml_d\fi} diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-env.lua b/Master/texmf-dist/tex/context/base/mkiv/data-env.lua index c9c11e49c04..6f482bae03f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/data-env.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/data-env.lua @@ -13,6 +13,7 @@ local resolvers = resolvers local allocate = utilities.storage.allocate local setmetatableindex = table.setmetatableindex +local sortedhash = table.sortedhash local suffixonly = file.suffixonly local formats = allocate() @@ -118,7 +119,7 @@ local relations = allocate { -- todo: handlers also here lua = { names = { "lua" }, variable = 'LUAINPUTS', - suffixes = { luasuffixes.lua, luasuffixes.luc, luasuffixes.tma, luasuffixes.tmc }, + suffixes = { luasuffixes.lmt, luasuffixes.lua, luasuffixes.luc, luasuffixes.tma, luasuffixes.tmc }, usertype = true, }, lib = { @@ -223,8 +224,10 @@ resolvers.relations = relations -- formats: maps a format onto a variable function resolvers.updaterelations() - for category, categories in next, relations do - for name, relation in next, categories do + -- we sort because we have a few duplicates and we want the same + -- mapping every run + for category, categories in sortedhash(relations) do + for name, relation in sortedhash(categories) do local rn = relation.names local rv = relation.variable if rn and rv then @@ -237,7 +240,9 @@ function resolvers.updaterelations() suffixes[rni] = rs for i=1,#rs do local rsi = rs[i] - suffixmap[rsi] = rni + if not suffixmap[rsi] then + suffixmap[rsi] = rni + end end end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua b/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua index 98c2f6839f9..30a35bc1c6c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua @@ -131,10 +131,10 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi str = lpegmatch(stripper_1,str) if validate then for s in gmatch(str,"[^,]+") do - s = validate(s) - if s then + local v = validate(s) + if v then n = n + 1 - t[n] = s + t[n] = v end end else diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-res.lua b/Master/texmf-dist/tex/context/base/mkiv/data-res.lua index 11e67f78545..a1b6795de52 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/data-res.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/data-res.lua @@ -135,35 +135,47 @@ local criticalvars = { -- we also report weird ones, with weird being: (1) duplicate /texmf or (2) no /web2c in -- the names. --- if environment.default_texmfcnf then --- resolvers.luacnfspec = "home:texmf/web2c;" .. environment.default_texmfcnf -- texlive + home: for taco etc --- else --- resolvers.luacnfspec = concat ( { --- "home:texmf/web2c", --- "selfautoparent:/texmf-local/web2c", --- "selfautoparent:/texmf-context/web2c", --- "selfautoparent:/texmf-dist/web2c", --- "selfautoparent:/texmf/web2c", --- }, ";") --- end - -if environment.default_texmfcnf then - -- this will go away (but then also no more checking in mtxrun.lua itself) - resolvers.luacnfspec = "home:texmf/web2c;" .. environment.default_texmfcnf -- texlive + home: for taco etc -else +do + local texroot = environment.texroot - resolvers.luacnfspec = "home:texmf/web2c;selfautoparent:/texmf-local/web2c;selfautoparent:/texmf-context/web2c;selfautoparent:/texmf/web2c" - if texroot and isdir(texroot .. "/texmf-context") then - -- we're okay and run the lean and mean installation + + resolvers.luacnfspec = { + "home:texmf/web2c", + "selfautoparent:/texmf-local/web2c", + "selfautoparent:/texmf-context/web2c", + "selfautoparent:/texmf/web2c", + } + + if environment.default_texmfcnf then + -- this will go away (but then also no more checking in mtxrun.lua itself) + resolvers.luacnfspec = { + "home:texmf/web2c", + environment.default_texmfcnf, -- texlive + home: for taco etc + } + elseif texroot and isdir(texroot .. "/texmf-context") then + -- we're okay and run the lean and mean reference installation elseif texroot and isdir(texroot .. "/texmf-dist") then -- we're in texlive where texmf-dist is leading - resolvers.luacnfspec = "home:texmf/web2c;selfautoparent:/texmf-local/web2c;selfautoparent:/texmf-dist/web2c;selfautoparent:/texmf/web2c" + resolvers.luacnfspec = { + "home:texmf/web2c", + "selfautoparent:/texmf-local/web2c", + "selfautoparent:", -- new per 2024 as it's needed for osx + "selfautoparent:/texmf-dist/web2c", + "selfautoparent:/texmf/web2c", + } elseif ostype ~= "windows" and isdir("/etc/texmf/web2c") then -- we have some linux distribution that does it its own way - resolvers.luacnfspec = "home:texmf/web2c;/etc/texmf/web2c;selfautodir:/share/texmf/web2c" + resolvers.luacnfspec = { + "home:texmf/web2c", + "/etc/texmf/web2c", + "selfautodir:/share/texmf/web2c", + } else -- we stick to the reference specification end + + resolvers.luacnfspec = concat(resolvers.luacnfspec,";") + end local unset_variable = "unset" @@ -1164,7 +1176,7 @@ local preparetreepattern = Cs((P(".")/"%%." + P("-")/"%%-" + P(1))^0 * Cc("$")) local collect_instance_files local function find_analyze(filename,askedformat,allresults) - local filetype = '' + local filetype = "" local filesuffix = suffixonly(filename) local wantedfiles = { } -- too tricky as filename can be bla.1.2.3: @@ -1177,7 +1189,7 @@ local function find_analyze(filename,askedformat,allresults) if filesuffix == "" or not suffixmap[filesuffix] then local defaultsuffixes = resolvers.defaultsuffixes for i=1,#defaultsuffixes do - local forcedname = filename .. '.' .. defaultsuffixes[i] + local forcedname = filename .. "." .. defaultsuffixes[i] wantedfiles[#wantedfiles+1] = forcedname filetype = formatofsuffix(forcedname) if trace_locating then @@ -1582,7 +1594,9 @@ collect_instance_files = function(filename,askedformat,allresults) -- uses neste local result = { } local status = { } local done = { } - for k, r in next, results do +-- for k, r in next, results do + for k=1,#results do + local r = results[k] local method, list = r[1], r[2] if method and list then for i=1,#list do diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/file-ini.lua index 01bedeeebe4..3eb9fec2549 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/file-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/file-ini.lua @@ -9,16 +9,16 @@ if not modules then modules = { } end modules ['file-ini'] = { -- It's more convenient to manipulate filenames (paths) in Lua than in TeX. These -- methods have counterparts at the TeX end. -local implement = interfaces.implement -local setmacro = interfaces.setmacro -local setcount = interfaces.setcount +local implement = interfaces.implement +local setmacro = interfaces.setmacro +local setcount = interfaces.setcount -resolvers.jobs = resolvers.jobs or { } +resolvers.jobs = resolvers.jobs or { } -local filenametotable = file.nametotable -local findtexfile = resolvers.findtexfile +local filenametotable = file.nametotable +local findtexfile = resolvers.findtexfile -local commands_doifelse = commands.doifelse +local ctx_doifelse = commands.doifelse local function splitfilename(full) local split = filenametotable(full) @@ -43,7 +43,7 @@ local function istexfile(name) return name ~= "" and name end -implement { name = "splitfilename", actions = splitfilename, arguments = "string" } -implement { name = "doifelseparentfile", actions = { isparentfile, commands_doifelse }, arguments = "string" } -implement { name = "doifelsepathexist", actions = { lfs.isdir, commands_doifelse }, arguments = "string" } -implement { name = "doifelsefileexist", actions = { istexfile, commands_doifelse }, arguments = "string" } +implement { name = "splitfilename", actions = splitfilename, arguments = "string" } +implement { name = "doifelseparentfile", actions = { isparentfile, ctx_doifelse }, arguments = "string" } +implement { name = "doifelsepathexist", actions = { lfs.isdir, ctx_doifelse }, arguments = "string" } +implement { name = "doifelsefileexist", actions = { istexfile, ctx_doifelse }, arguments = "string" } diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-job.lua b/Master/texmf-dist/tex/context/base/mkiv/file-job.lua index 0d26cdfb259..76459b758f3 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/file-job.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/file-job.lua @@ -523,7 +523,7 @@ do logs.registerfinalactions(function() root.name = environment.jobname -- - logs.startfilelogging(report,"used files") + logs.startfilelogging(report,"used job files") log_tree(report,root,"") logs.stopfilelogging() -- diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua b/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua index 50ac5e1db34..7af02013270 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua @@ -33,9 +33,15 @@ local function defaultfailure(name) report_files("asked name %a, not found",name) end +local ignoredfiles = { } + +function resolvers.ignorelibrary(name) + ignoredfiles[name] = true +end + function resolvers.uselibrary(specification) -- todo: reporter local name = specification.name - if name and name ~= "" then + if name and name ~= "" and not ignoredfiles[name] then local patterns = specification.patterns or defaultpatterns local action = specification.action or defaultaction local failure = specification.failure or defaultfailure diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-agl.lua b/Master/texmf-dist/tex/context/base/mkiv/font-agl.lua index 19912b94478..f8aeb8a2ace 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-agl.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-agl.lua @@ -6,6 +6,10 @@ if not modules then modules = { } end modules ['font-agl'] = { original = "Adobe Glyph List, version 2.0, September 20, 2002", } +-- This one is somewhat over the top and we can probably remove quite some of these. It mostly relates +-- to obsolete Type1 fonts anyway. It makes no sense to keep part of these list in char-def so we now +-- moved them here. + local next = next local allocate = utilities.storage.allocate @@ -19,6 +23,4119 @@ fonts.encodings.agl = agl table.setmetatableindex(agl,nil) -- prevent recursive lookups otherwise when autoloaded +local unicodes = { + A = 0x00041, + AE = 0x000C6, + AEacute = 0x001FC, + AEmacron = 0x001E2, + Aacute = 0x000C1, + Abreve = 0x00102, + Abreveacute = 0x01EAE, + Abrevecyrillic = 0x004D0, + Abrevedotbelow = 0x01EB6, + Abrevegrave = 0x01EB0, + Abrevehookabove = 0x01EB2, + Abrevetilde = 0x01EB4, + Acaron = 0x001CD, + Acircle = 0x024B6, + Acircumflex = 0x000C2, + Acircumflexacute = 0x01EA4, + Acircumflexdotbelow = 0x01EAC, + Acircumflexgrave = 0x01EA6, + Acircumflexhookabove = 0x01EA8, + Acircumflextilde = 0x01EAA, + Acyrillic = 0x00410, + Adblgrave = 0x00200, + Adieresis = 0x000C4, + Adieresiscyrillic = 0x004D2, + Adieresismacron = 0x001DE, + Adotbelow = 0x01EA0, + Adotmacron = 0x001E0, + Agrave = 0x000C0, + Ahookabove = 0x01EA2, + Aiecyrillic = 0x004D4, + Ainvertedbreve = 0x00202, + Alpha = 0x00391, + Alphatonos = 0x00386, + Amacron = 0x00100, + Amonospace = 0x0FF21, + Aogonek = 0x00104, + Aring = 0x000C5, + Aringacute = 0x001FA, + Aringbelow = 0x01E00, + Atilde = 0x000C3, + Aybarmenian = 0x00531, + B = 0x00042, + Bcircle = 0x024B7, + Bdotaccent = 0x01E02, + Bdotbelow = 0x01E04, + Becyrillic = 0x00411, + Benarmenian = 0x00532, + Beta = 0x00392, + Bhook = 0x00181, + Blinebelow = 0x01E06, + Bmonospace = 0x0FF22, + Btopbar = 0x00182, + C = 0x00043, + Caarmenian = 0x0053E, + Cacute = 0x00106, + Ccaron = 0x0010C, + Ccedilla = 0x000C7, + Ccedillaacute = 0x01E08, + Ccircle = 0x024B8, + Ccircumflex = 0x00108, + Cdot = 0x0010A, + Cdotaccent = 0x0010A, + Chaarmenian = 0x00549, + Cheabkhasiancyrillic = 0x004BC, + Checyrillic = 0x00427, + Chedescenderabkhasiancyrillic = 0x004BE, + Chedescendercyrillic = 0x004B6, + Chedieresiscyrillic = 0x004F4, + Cheharmenian = 0x00543, + Chekhakassiancyrillic = 0x004CB, + Cheverticalstrokecyrillic = 0x004B8, + Chi = 0x003A7, + Chook = 0x00187, + Cmonospace = 0x0FF23, + Coarmenian = 0x00551, + D = 0x00044, + DZ = 0x001F1, + DZcaron = 0x001C4, + Daarmenian = 0x00534, + Dafrican = 0x00189, + Dcaron = 0x0010E, + Dcedilla = 0x01E10, + Dcircle = 0x024B9, + Dcircumflexbelow = 0x01E12, + Dcroat = 0x00110, + Ddotaccent = 0x01E0A, + Ddotbelow = 0x01E0C, + Decyrillic = 0x00414, + Deicoptic = 0x003EE, + Delta = 0x02206, + Deltagreek = 0x00394, + Dhook = 0x0018A, + Digammagreek = 0x003DC, + Djecyrillic = 0x00402, + Dlinebelow = 0x01E0E, + Dmonospace = 0x0FF24, + Dslash = 0x00110, + Dtopbar = 0x0018B, + Dz = 0x001F2, + Dzcaron = 0x001C5, + Dzeabkhasiancyrillic = 0x004E0, + Dzecyrillic = 0x00405, + Dzhecyrillic = 0x0040F, + E = 0x00045, + Eacute = 0x000C9, + Ebreve = 0x00114, + Ecaron = 0x0011A, + Ecedillabreve = 0x01E1C, + Echarmenian = 0x00535, + Ecircle = 0x024BA, + Ecircumflex = 0x000CA, + Ecircumflexacute = 0x01EBE, + Ecircumflexbelow = 0x01E18, + Ecircumflexdotbelow = 0x01EC6, + Ecircumflexgrave = 0x01EC0, + Ecircumflexhookabove = 0x01EC2, + Ecircumflextilde = 0x01EC4, + Ecyrillic = 0x00404, + Edblgrave = 0x00204, + Edieresis = 0x000CB, + Edot = 0x00116, + Edotaccent = 0x00116, + Edotbelow = 0x01EB8, + Efcyrillic = 0x00424, + Egrave = 0x000C8, + Eharmenian = 0x00537, + Ehookabove = 0x01EBA, + Eightroman = 0x02167, + Einvertedbreve = 0x00206, + Eiotifiedcyrillic = 0x00464, + Elcyrillic = 0x0041B, + Elevenroman = 0x0216A, + Emacron = 0x00112, + Emacronacute = 0x01E16, + Emacrongrave = 0x01E14, + Emcyrillic = 0x0041C, + Emonospace = 0x0FF25, + Encyrillic = 0x0041D, + Endescendercyrillic = 0x004A2, + Eng = 0x0014A, + Enghecyrillic = 0x004A4, + Enhookcyrillic = 0x004C7, + Eogonek = 0x00118, + Eopen = 0x00190, + Epsilon = 0x00395, + Epsilontonos = 0x00388, + Ercyrillic = 0x00420, + Ereversed = 0x0018E, + Ereversedcyrillic = 0x0042D, + Escyrillic = 0x00421, + Esdescendercyrillic = 0x004AA, + Esh = 0x001A9, + Eta = 0x00397, + Etarmenian = 0x00538, + Etatonos = 0x00389, + Eth = 0x000D0, + Etilde = 0x01EBC, + Etildebelow = 0x01E1A, + Euro = 0x020AC, + Ezh = 0x001B7, + Ezhcaron = 0x001EE, + Ezhreversed = 0x001B8, + F = 0x00046, + Fcircle = 0x024BB, + Fdotaccent = 0x01E1E, + Feharmenian = 0x00556, + Feicoptic = 0x003E4, + Fhook = 0x00191, + Fitacyrillic = 0x00472, + Fiveroman = 0x02164, + Fmonospace = 0x0FF26, + Fourroman = 0x02163, + G = 0x00047, + GBsquare = 0x03387, + Gacute = 0x001F4, + Gamma = 0x00393, + Gammaafrican = 0x00194, + Gangiacoptic = 0x003EA, + Gbreve = 0x0011E, + Gcaron = 0x001E6, + Gcedilla = 0x00122, + Gcircle = 0x024BC, + Gcircumflex = 0x0011C, + Gcommaaccent = 0x00122, + Gdot = 0x00120, + Gdotaccent = 0x00120, + Gecyrillic = 0x00413, + Ghadarmenian = 0x00542, + Ghemiddlehookcyrillic = 0x00494, + Ghestrokecyrillic = 0x00492, + Gheupturncyrillic = 0x00490, + Ghook = 0x00193, + Gimarmenian = 0x00533, + Gjecyrillic = 0x00403, + Gmacron = 0x01E20, + Gmonospace = 0x0FF27, + Gsmallhook = 0x0029B, + Gstroke = 0x001E4, + H = 0x00048, + H18533 = 0x025CF, + H18543 = 0x025AA, + H18551 = 0x025AB, + H22073 = 0x025A1, + HPsquare = 0x033CB, + Haabkhasiancyrillic = 0x004A8, + Hadescendercyrillic = 0x004B2, + Hardsigncyrillic = 0x0042A, + Hbar = 0x00126, + Hbrevebelow = 0x01E2A, + Hcedilla = 0x01E28, + Hcircle = 0x024BD, + Hcircumflex = 0x00124, + Hdieresis = 0x01E26, + Hdotaccent = 0x01E22, + Hdotbelow = 0x01E24, + Hmonospace = 0x0FF28, + Hoarmenian = 0x00540, + Horicoptic = 0x003E8, + Hzsquare = 0x03390, + I = 0x00049, + IAcyrillic = 0x0042F, + IJ = 0x00132, + IUcyrillic = 0x0042E, + Iacute = 0x000CD, + Ibreve = 0x0012C, + Icaron = 0x001CF, + Icircle = 0x024BE, + Icircumflex = 0x000CE, + Icyrillic = 0x00406, + Idblgrave = 0x00208, + Idieresis = 0x000CF, + Idieresisacute = 0x01E2E, + Idieresiscyrillic = 0x004E4, + Idot = 0x00130, + Idotaccent = 0x00130, + Idotbelow = 0x01ECA, + Iebrevecyrillic = 0x004D6, + Iecyrillic = 0x00415, + Ifraktur = 0x02111, + Igrave = 0x000CC, + Ihookabove = 0x01EC8, + Iicyrillic = 0x00418, + Iinvertedbreve = 0x0020A, + Iishortcyrillic = 0x00419, + Imacron = 0x0012A, + Imacroncyrillic = 0x004E2, + Imonospace = 0x0FF29, + Iniarmenian = 0x0053B, + Iocyrillic = 0x00401, + Iogonek = 0x0012E, + Iota = 0x00399, + Iotaafrican = 0x00196, + Iotadieresis = 0x003AA, + Iotatonos = 0x0038A, + Istroke = 0x00197, + Itilde = 0x00128, + Itildebelow = 0x01E2C, + Izhitsacyrillic = 0x00474, + Izhitsadblgravecyrillic = 0x00476, + J = 0x0004A, + Jaarmenian = 0x00541, + Jcircle = 0x024BF, + Jcircumflex = 0x00134, + Jecyrillic = 0x00408, + Jheharmenian = 0x0054B, + Jmonospace = 0x0FF2A, + K = 0x0004B, + KBsquare = 0x03385, + KKsquare = 0x033CD, + Kabashkircyrillic = 0x004A0, + Kacute = 0x01E30, + Kacyrillic = 0x0041A, + Kadescendercyrillic = 0x0049A, + Kahookcyrillic = 0x004C3, + Kappa = 0x0039A, + Kastrokecyrillic = 0x0049E, + Kaverticalstrokecyrillic = 0x0049C, + Kcaron = 0x001E8, + Kcedilla = 0x00136, + Kcircle = 0x024C0, + Kcommaaccent = 0x00136, + Kdotbelow = 0x01E32, + Keharmenian = 0x00554, + Kenarmenian = 0x0053F, + Khacyrillic = 0x00425, + Kheicoptic = 0x003E6, + Khook = 0x00198, + Kjecyrillic = 0x0040C, + Klinebelow = 0x01E34, + Kmonospace = 0x0FF2B, + Koppacyrillic = 0x00480, + Koppagreek = 0x003DE, + Ksicyrillic = 0x0046E, + L = 0x0004C, + LJ = 0x001C7, + Lacute = 0x00139, + Lambda = 0x0039B, + Lcaron = 0x0013D, + Lcedilla = 0x0013B, + Lcircle = 0x024C1, + Lcircumflexbelow = 0x01E3C, + Lcommaaccent = 0x0013B, + Ldot = 0x0013F, + Ldotaccent = 0x0013F, + Ldotbelow = 0x01E36, + Ldotbelowmacron = 0x01E38, + Liwnarmenian = 0x0053C, + Lj = 0x001C8, + Ljecyrillic = 0x00409, + Llinebelow = 0x01E3A, + Lmonospace = 0x0FF2C, + Lslash = 0x00141, + M = 0x0004D, + MBsquare = 0x03386, + Macute = 0x01E3E, + Mcircle = 0x024C2, + Mdotaccent = 0x01E40, + Mdotbelow = 0x01E42, + Menarmenian = 0x00544, + Mmonospace = 0x0FF2D, + Mturned = 0x0019C, + Mu = 0x0039C, + N = 0x0004E, + NJ = 0x001CA, + Nacute = 0x00143, + Ncaron = 0x00147, + Ncedilla = 0x00145, + Ncircle = 0x024C3, + Ncircumflexbelow = 0x01E4A, + Ncommaaccent = 0x00145, + Ndotaccent = 0x01E44, + Ndotbelow = 0x01E46, + Nhookleft = 0x0019D, + Nineroman = 0x02168, + Nj = 0x001CB, + Njecyrillic = 0x0040A, + Nlinebelow = 0x01E48, + Nmonospace = 0x0FF2E, + Nowarmenian = 0x00546, + Ntilde = 0x000D1, + Nu = 0x0039D, + O = 0x0004F, + OE = 0x00152, + Oacute = 0x000D3, + Obarredcyrillic = 0x004E8, + Obarreddieresiscyrillic = 0x004EA, + Obreve = 0x0014E, + Ocaron = 0x001D1, + Ocenteredtilde = 0x0019F, + Ocircle = 0x024C4, + Ocircumflex = 0x000D4, + Ocircumflexacute = 0x01ED0, + Ocircumflexdotbelow = 0x01ED8, + Ocircumflexgrave = 0x01ED2, + Ocircumflexhookabove = 0x01ED4, + Ocircumflextilde = 0x01ED6, + Ocyrillic = 0x0041E, + Odblacute = 0x00150, + Odblgrave = 0x0020C, + Odieresis = 0x000D6, + Odieresiscyrillic = 0x004E6, + Odotbelow = 0x01ECC, + Ograve = 0x000D2, + Oharmenian = 0x00555, + Ohm = 0x02126, + Ohookabove = 0x01ECE, + Ohorn = 0x001A0, + Ohornacute = 0x01EDA, + Ohorndotbelow = 0x01EE2, + Ohorngrave = 0x01EDC, + Ohornhookabove = 0x01EDE, + Ohorntilde = 0x01EE0, + Ohungarumlaut = 0x00150, + Oi = 0x001A2, + Oinvertedbreve = 0x0020E, + Omacron = 0x0014C, + Omacronacute = 0x01E52, + Omacrongrave = 0x01E50, + Omega = 0x02126, + Omegacyrillic = 0x00460, + Omegagreek = 0x003A9, + Omegaroundcyrillic = 0x0047A, + Omegatitlocyrillic = 0x0047C, + Omegatonos = 0x0038F, + Omicron = 0x0039F, + Omicrontonos = 0x0038C, + Omonospace = 0x0FF2F, + Oneroman = 0x02160, + Oogonek = 0x001EA, + Oogonekmacron = 0x001EC, + Oopen = 0x00186, + Oslash = 0x000D8, + Oslashacute = 0x001FE, + Ostrokeacute = 0x001FE, + Otcyrillic = 0x0047E, + Otilde = 0x000D5, + Otildeacute = 0x01E4C, + Otildedieresis = 0x01E4E, + P = 0x00050, + Pacute = 0x01E54, + Pcircle = 0x024C5, + Pdotaccent = 0x01E56, + Pecyrillic = 0x0041F, + Peharmenian = 0x0054A, + Pemiddlehookcyrillic = 0x004A6, + Phi = 0x003A6, + Phook = 0x001A4, + Pi = 0x003A0, + Piwrarmenian = 0x00553, + Pmonospace = 0x0FF30, + Psi = 0x003A8, + Psicyrillic = 0x00470, + Q = 0x00051, + Qcircle = 0x024C6, + Qmonospace = 0x0FF31, + R = 0x00052, + Raarmenian = 0x0054C, + Racute = 0x00154, + Rcaron = 0x00158, + Rcedilla = 0x00156, + Rcircle = 0x024C7, + Rcommaaccent = 0x00156, + Rdblgrave = 0x00210, + Rdotaccent = 0x01E58, + Rdotbelow = 0x01E5A, + Rdotbelowmacron = 0x01E5C, + Reharmenian = 0x00550, + Rfraktur = 0x0211C, + Rho = 0x003A1, + Rinvertedbreve = 0x00212, + Rlinebelow = 0x01E5E, + Rmonospace = 0x0FF32, + Rsmallinverted = 0x00281, + Rsmallinvertedsuperior = 0x002B6, + S = 0x00053, + SF010000 = 0x0250C, + SF020000 = 0x02514, + SF030000 = 0x02510, + SF040000 = 0x02518, + SF050000 = 0x0253C, + SF060000 = 0x0252C, + SF070000 = 0x02534, + SF080000 = 0x0251C, + SF090000 = 0x02524, + SF10000 = 0x0250C, + SF100000 = 0x02500, + SF110000 = 0x02502, + SF190000 = 0x02561, + SF20000 = 0x02514, + SF200000 = 0x02562, + SF210000 = 0x02556, + SF220000 = 0x02555, + SF230000 = 0x02563, + SF240000 = 0x02551, + SF250000 = 0x02557, + SF260000 = 0x0255D, + SF270000 = 0x0255C, + SF280000 = 0x0255B, + SF30000 = 0x02510, + SF360000 = 0x0255E, + SF370000 = 0x0255F, + SF380000 = 0x0255A, + SF390000 = 0x02554, + SF40000 = 0x02518, + SF400000 = 0x02569, + SF410000 = 0x02566, + SF420000 = 0x02560, + SF430000 = 0x02550, + SF440000 = 0x0256C, + SF450000 = 0x02567, + SF460000 = 0x02568, + SF470000 = 0x02564, + SF480000 = 0x02565, + SF490000 = 0x02559, + SF50000 = 0x0253C, + SF500000 = 0x02558, + SF510000 = 0x02552, + SF520000 = 0x02553, + SF530000 = 0x0256B, + SF540000 = 0x0256A, + SF60000 = 0x0252C, + SF70000 = 0x02534, + SF80000 = 0x0251C, + SF90000 = 0x02524, + Sacute = 0x0015A, + Sacutedotaccent = 0x01E64, + Sampigreek = 0x003E0, + Scaron = 0x00160, + Scarondotaccent = 0x01E66, + Scedilla = 0x0015E, + Schwa = 0x0018F, + Schwacyrillic = 0x004D8, + Schwadieresiscyrillic = 0x004DA, + Scircle = 0x024C8, + Scircumflex = 0x0015C, + Scommaaccent = 0x00218, + Sdotaccent = 0x01E60, + Sdotbelow = 0x01E62, + Sdotbelowdotaccent = 0x01E68, + Seharmenian = 0x0054D, + Sevenroman = 0x02166, + Shaarmenian = 0x00547, + Shacyrillic = 0x00428, + Shchacyrillic = 0x00429, + Sheicoptic = 0x003E2, + Shhacyrillic = 0x004BA, + Shimacoptic = 0x003EC, + Sigma = 0x003A3, + Sixroman = 0x02165, + Smonospace = 0x0FF33, + Softsigncyrillic = 0x0042C, + Stigmagreek = 0x003DA, + T = 0x00054, + Tau = 0x003A4, + Tbar = 0x00166, + Tcaron = 0x00164, + Tcedilla = 0x00162, + Tcircle = 0x024C9, + Tcircumflexbelow = 0x01E70, + Tcommaaccent = 0x00162, + Tdotaccent = 0x01E6A, + Tdotbelow = 0x01E6C, + Tecyrillic = 0x00422, + Tedescendercyrillic = 0x004AC, + Tenroman = 0x02169, + Tetsecyrillic = 0x004B4, + Theta = 0x00398, + Thook = 0x001AC, + Thorn = 0x000DE, + Threeroman = 0x02162, + Tiwnarmenian = 0x0054F, + Tlinebelow = 0x01E6E, + Tmonospace = 0x0FF34, + Toarmenian = 0x00539, + Tonefive = 0x001BC, + Tonesix = 0x00184, + Tonetwo = 0x001A7, + Tretroflexhook = 0x001AE, + Tsecyrillic = 0x00426, + Tshecyrillic = 0x0040B, + Twelveroman = 0x0216B, + Tworoman = 0x02161, + U = 0x00055, + Uacute = 0x000DA, + Ubreve = 0x0016C, + Ucaron = 0x001D3, + Ucircle = 0x024CA, + Ucircumflex = 0x000DB, + Ucircumflexbelow = 0x01E76, + Ucyrillic = 0x00423, + Udblacute = 0x00170, + Udblgrave = 0x00214, + Udieresis = 0x000DC, + Udieresisacute = 0x001D7, + Udieresisbelow = 0x01E72, + Udieresiscaron = 0x001D9, + Udieresiscyrillic = 0x004F0, + Udieresisgrave = 0x001DB, + Udieresismacron = 0x001D5, + Udotbelow = 0x01EE4, + Ugrave = 0x000D9, + Uhookabove = 0x01EE6, + Uhorn = 0x001AF, + Uhornacute = 0x01EE8, + Uhorndotbelow = 0x01EF0, + Uhorngrave = 0x01EEA, + Uhornhookabove = 0x01EEC, + Uhorntilde = 0x01EEE, + Uhungarumlaut = 0x00170, + Uhungarumlautcyrillic = 0x004F2, + Uinvertedbreve = 0x00216, + Ukcyrillic = 0x00478, + Umacron = 0x0016A, + Umacroncyrillic = 0x004EE, + Umacrondieresis = 0x01E7A, + Umonospace = 0x0FF35, + Uogonek = 0x00172, + Upsilon = 0x003A5, + Upsilon1 = 0x003D2, + Upsilonacutehooksymbolgreek = 0x003D3, + Upsilonafrican = 0x001B1, + Upsilondieresis = 0x003AB, + Upsilondieresishooksymbolgreek = 0x003D4, + Upsilonhooksymbol = 0x003D2, + Upsilontonos = 0x0038E, + Uring = 0x0016E, + Ushortcyrillic = 0x0040E, + Ustraightcyrillic = 0x004AE, + Ustraightstrokecyrillic = 0x004B0, + Utilde = 0x00168, + Utildeacute = 0x01E78, + Utildebelow = 0x01E74, + V = 0x00056, + Vcircle = 0x024CB, + Vdotbelow = 0x01E7E, + Vecyrillic = 0x00412, + Vewarmenian = 0x0054E, + Vhook = 0x001B2, + Vmonospace = 0x0FF36, + Voarmenian = 0x00548, + Vtilde = 0x01E7C, + W = 0x00057, + Wacute = 0x01E82, + Wcircle = 0x024CC, + Wcircumflex = 0x00174, + Wdieresis = 0x01E84, + Wdotaccent = 0x01E86, + Wdotbelow = 0x01E88, + Wgrave = 0x01E80, + Wmonospace = 0x0FF37, + X = 0x00058, + Xcircle = 0x024CD, + Xdieresis = 0x01E8C, + Xdotaccent = 0x01E8A, + Xeharmenian = 0x0053D, + Xi = 0x0039E, + Xmonospace = 0x0FF38, + Y = 0x00059, + Yacute = 0x000DD, + Yatcyrillic = 0x00462, + Ycircle = 0x024CE, + Ycircumflex = 0x00176, + Ydieresis = 0x00178, + Ydotaccent = 0x01E8E, + Ydotbelow = 0x01EF4, + Yericyrillic = 0x0042B, + Yerudieresiscyrillic = 0x004F8, + Ygrave = 0x01EF2, + Yhook = 0x001B3, + Yhookabove = 0x01EF6, + Yiarmenian = 0x00545, + Yicyrillic = 0x00407, + Yiwnarmenian = 0x00552, + Ymonospace = 0x0FF39, + Ytilde = 0x01EF8, + Yusbigcyrillic = 0x0046A, + Yusbigiotifiedcyrillic = 0x0046C, + Yuslittlecyrillic = 0x00466, + Yuslittleiotifiedcyrillic = 0x00468, + Z = 0x0005A, + Zaarmenian = 0x00536, + Zacute = 0x00179, + Zcaron = 0x0017D, + Zcircle = 0x024CF, + Zcircumflex = 0x01E90, + Zdot = 0x0017B, + Zdotaccent = 0x0017B, + Zdotbelow = 0x01E92, + Zecyrillic = 0x00417, + Zedescendercyrillic = 0x00498, + Zedieresiscyrillic = 0x004DE, + Zeta = 0x00396, + Zhearmenian = 0x0053A, + Zhebrevecyrillic = 0x004C1, + Zhecyrillic = 0x00416, + Zhedescendercyrillic = 0x00496, + Zhedieresiscyrillic = 0x004DC, + Zlinebelow = 0x01E94, + Zmonospace = 0x0FF3A, + Zstroke = 0x001B5, + a = 0x00061, + aabengali = 0x00986, + aacute = 0x000E1, + aadeva = 0x00906, + aagujarati = 0x00A86, + aagurmukhi = 0x00A06, + aamatragurmukhi = 0x00A3E, + aarusquare = 0x03303, + aavowelsignbengali = 0x009BE, + aavowelsigndeva = 0x0093E, + aavowelsigngujarati = 0x00ABE, + abbreviationmarkarmenian = 0x0055F, + abbreviationsigndeva = 0x00970, + abengali = 0x00985, + abopomofo = 0x0311A, + abreve = 0x00103, + abreveacute = 0x01EAF, + abrevecyrillic = 0x004D1, + abrevedotbelow = 0x01EB7, + abrevegrave = 0x01EB1, + abrevehookabove = 0x01EB3, + abrevetilde = 0x01EB5, + acaron = 0x001CE, + acircle = 0x024D0, + acircumflex = 0x000E2, + acircumflexacute = 0x01EA5, + acircumflexdotbelow = 0x01EAD, + acircumflexgrave = 0x01EA7, + acircumflexhookabove = 0x01EA9, + acircumflextilde = 0x01EAB, + acute = 0x000B4, + acutebelowcmb = 0x00317, + acutecmb = 0x00301, + acutecomb = 0x00301, + acutedeva = 0x00954, + acutelowmod = 0x002CF, + acutetonecmb = 0x00341, + acyrillic = 0x00430, + adblgrave = 0x00201, + addakgurmukhi = 0x00A71, + adeva = 0x00905, + adieresis = 0x000E4, + adieresiscyrillic = 0x004D3, + adieresismacron = 0x001DF, + adotbelow = 0x01EA1, + adotmacron = 0x001E1, + ae = 0x000E6, + aeacute = 0x001FD, + aekorean = 0x03150, + aemacron = 0x001E3, + afii00208 = 0x02015, + afii08941 = 0x020A4, + afii10017 = 0x00410, + afii10018 = 0x00411, + afii10019 = 0x00412, + afii10020 = 0x00413, + afii10021 = 0x00414, + afii10022 = 0x00415, + afii10023 = 0x00401, + afii10024 = 0x00416, + afii10025 = 0x00417, + afii10026 = 0x00418, + afii10027 = 0x00419, + afii10028 = 0x0041A, + afii10029 = 0x0041B, + afii10030 = 0x0041C, + afii10031 = 0x0041D, + afii10032 = 0x0041E, + afii10033 = 0x0041F, + afii10034 = 0x00420, + afii10035 = 0x00421, + afii10036 = 0x00422, + afii10037 = 0x00423, + afii10038 = 0x00424, + afii10039 = 0x00425, + afii10040 = 0x00426, + afii10041 = 0x00427, + afii10042 = 0x00428, + afii10043 = 0x00429, + afii10044 = 0x0042A, + afii10045 = 0x0042B, + afii10046 = 0x0042C, + afii10047 = 0x0042D, + afii10048 = 0x0042E, + afii10049 = 0x0042F, + afii10050 = 0x00490, + afii10051 = 0x00402, + afii10052 = 0x00403, + afii10053 = 0x00404, + afii10054 = 0x00405, + afii10055 = 0x00406, + afii10056 = 0x00407, + afii10057 = 0x00408, + afii10058 = 0x00409, + afii10059 = 0x0040A, + afii10060 = 0x0040B, + afii10061 = 0x0040C, + afii10062 = 0x0040E, + afii10065 = 0x00430, + afii10066 = 0x00431, + afii10067 = 0x00432, + afii10068 = 0x00433, + afii10069 = 0x00434, + afii10070 = 0x00435, + afii10071 = 0x00451, + afii10072 = 0x00436, + afii10073 = 0x00437, + afii10074 = 0x00438, + afii10075 = 0x00439, + afii10076 = 0x0043A, + afii10077 = 0x0043B, + afii10078 = 0x0043C, + afii10079 = 0x0043D, + afii10080 = 0x0043E, + afii10081 = 0x0043F, + afii10082 = 0x00440, + afii10083 = 0x00441, + afii10084 = 0x00442, + afii10085 = 0x00443, + afii10086 = 0x00444, + afii10087 = 0x00445, + afii10088 = 0x00446, + afii10089 = 0x00447, + afii10090 = 0x00448, + afii10091 = 0x00449, + afii10092 = 0x0044A, + afii10093 = 0x0044B, + afii10094 = 0x0044C, + afii10095 = 0x0044D, + afii10096 = 0x0044E, + afii10097 = 0x0044F, + afii10098 = 0x00491, + afii10099 = 0x00452, + afii10100 = 0x00453, + afii10101 = 0x00454, + afii10102 = 0x00455, + afii10103 = 0x00456, + afii10104 = 0x00457, + afii10105 = 0x00458, + afii10106 = 0x00459, + afii10107 = 0x0045A, + afii10108 = 0x0045B, + afii10109 = 0x0045C, + afii10110 = 0x0045E, + afii10145 = 0x0040F, + afii10146 = 0x00462, + afii10147 = 0x00472, + afii10148 = 0x00474, + afii10193 = 0x0045F, + afii10194 = 0x00463, + afii10195 = 0x00473, + afii10196 = 0x00475, + afii10846 = 0x004D9, + afii208 = 0x02015, + afii299 = 0x0200E, + afii300 = 0x0200F, + afii301 = 0x0200D, + afii57381 = 0x0066A, + afii57388 = 0x0060C, + afii57392 = 0x00660, + afii57393 = 0x00661, + afii57394 = 0x00662, + afii57395 = 0x00663, + afii57396 = 0x00664, + afii57397 = 0x00665, + afii57398 = 0x00666, + afii57399 = 0x00667, + afii57400 = 0x00668, + afii57401 = 0x00669, + afii57403 = 0x0061B, + afii57407 = 0x0061F, + afii57409 = 0x00621, + afii57410 = 0x00622, + afii57411 = 0x00623, + afii57412 = 0x00624, + afii57413 = 0x00625, + afii57414 = 0x00626, + afii57415 = 0x00627, + afii57416 = 0x00628, + afii57417 = 0x00629, + afii57418 = 0x0062A, + afii57419 = 0x0062B, + afii57420 = 0x0062C, + afii57421 = 0x0062D, + afii57422 = 0x0062E, + afii57423 = 0x0062F, + afii57424 = 0x00630, + afii57425 = 0x00631, + afii57426 = 0x00632, + afii57427 = 0x00633, + afii57428 = 0x00634, + afii57429 = 0x00635, + afii57430 = 0x00636, + afii57431 = 0x00637, + afii57432 = 0x00638, + afii57433 = 0x00639, + afii57434 = 0x0063A, + afii57440 = 0x00640, + afii57441 = 0x00641, + afii57442 = 0x00642, + afii57443 = 0x00643, + afii57444 = 0x00644, + afii57445 = 0x00645, + afii57446 = 0x00646, + afii57448 = 0x00648, + afii57449 = 0x00649, + afii57450 = 0x0064A, + afii57451 = 0x0064B, + afii57452 = 0x0064C, + afii57453 = 0x0064D, + afii57454 = 0x0064E, + afii57455 = 0x0064F, + afii57456 = 0x00650, + afii57457 = 0x00651, + afii57458 = 0x00652, + afii57470 = 0x00647, + afii57505 = 0x006A4, + afii57506 = 0x0067E, + afii57507 = 0x00686, + afii57508 = 0x00698, + afii57509 = 0x006AF, + afii57511 = 0x00679, + afii57512 = 0x00688, + afii57513 = 0x00691, + afii57514 = 0x006BA, + afii57519 = 0x006D2, + afii57534 = 0x006D5, + afii57636 = 0x020AA, + afii57645 = 0x005BE, + afii57658 = 0x005C3, + afii57664 = 0x005D0, + afii57665 = 0x005D1, + afii57666 = 0x005D2, + afii57667 = 0x005D3, + afii57668 = 0x005D4, + afii57669 = 0x005D5, + afii57670 = 0x005D6, + afii57671 = 0x005D7, + afii57672 = 0x005D8, + afii57673 = 0x005D9, + afii57674 = 0x005DA, + afii57675 = 0x005DB, + afii57676 = 0x005DC, + afii57677 = 0x005DD, + afii57678 = 0x005DE, + afii57679 = 0x005DF, + afii57680 = 0x005E0, + afii57681 = 0x005E1, + afii57682 = 0x005E2, + afii57683 = 0x005E3, + afii57684 = 0x005E4, + afii57685 = 0x005E5, + afii57686 = 0x005E6, + afii57687 = 0x005E7, + afii57688 = 0x005E8, + afii57689 = 0x005E9, + afii57690 = 0x005EA, + afii57694 = 0x0FB2A, + afii57695 = 0x0FB2B, + afii57700 = 0x0FB4B, + afii57705 = 0x0FB1F, + afii57716 = 0x005F0, + afii57717 = 0x005F1, + afii57718 = 0x005F2, + afii57723 = 0x0FB35, + afii57793 = 0x005B4, + afii57794 = 0x005B5, + afii57795 = 0x005B6, + afii57796 = 0x005BB, + afii57797 = 0x005B8, + afii57798 = 0x005B7, + afii57799 = 0x005B0, + afii57800 = 0x005B2, + afii57801 = 0x005B1, + afii57802 = 0x005B3, + afii57803 = 0x005C2, + afii57804 = 0x005C1, + afii57806 = 0x005B9, + afii57807 = 0x005BC, + afii57839 = 0x005BD, + afii57841 = 0x005BF, + afii57842 = 0x005C0, + afii57929 = 0x002BC, + afii61248 = 0x02105, + afii61289 = 0x02113, + afii61352 = 0x02116, + afii61573 = 0x0202C, + afii61574 = 0x0202D, + afii61575 = 0x0202E, + afii61664 = 0x0200C, + afii63167 = 0x0066D, + afii64937 = 0x002BD, + agrave = 0x000E0, + agujarati = 0x00A85, + agurmukhi = 0x00A05, + ahiragana = 0x03042, + ahookabove = 0x01EA3, + aibengali = 0x00990, + aibopomofo = 0x0311E, + aideva = 0x00910, + aiecyrillic = 0x004D5, + aigujarati = 0x00A90, + aigurmukhi = 0x00A10, + aimatragurmukhi = 0x00A48, + ainarabic = 0x00639, + ainfinalarabic = 0x0FECA, + aininitialarabic = 0x0FECB, + ainmedialarabic = 0x0FECC, + ainvertedbreve = 0x00203, + aivowelsignbengali = 0x009C8, + aivowelsigndeva = 0x00948, + aivowelsigngujarati = 0x00AC8, + akatakana = 0x030A2, + akatakanahalfwidth = 0x0FF71, + akorean = 0x0314F, + alef = 0x005D0, + alefarabic = 0x00627, + alefdageshhebrew = 0x0FB30, + aleffinalarabic = 0x0FE8E, + alefhamzaabovearabic = 0x00623, + alefhamzaabovefinalarabic = 0x0FE84, + alefhamzabelowarabic = 0x00625, + alefhamzabelowfinalarabic = 0x0FE88, + alefhebrew = 0x005D0, + aleflamedhebrew = 0x0FB4F, + alefmaddaabovearabic = 0x00622, + alefmaddaabovefinalarabic = 0x0FE82, + alefmaksuraarabic = 0x00649, + alefmaksurafinalarabic = 0x0FEF0, + alefmaksurainitialarabic = 0x0FEF3, + alefmaksuramedialarabic = 0x0FEF4, + alefpatahhebrew = 0x0FB2E, + alefqamatshebrew = 0x0FB2F, + aleph = 0x02135, + allequal = 0x0224C, + alpha = 0x003B1, + alphatonos = 0x003AC, + amacron = 0x00101, + amonospace = 0x0FF41, + ampersand = 0x00026, + ampersandmonospace = 0x0FF06, + amsquare = 0x033C2, + anbopomofo = 0x03122, + angbopomofo = 0x03124, + angkhankhuthai = 0x00E5A, + angle = 0x02220, + anglebracketleft = 0x03008, + anglebracketleftvertical = 0x0FE3F, + anglebracketright = 0x03009, + anglebracketrightvertical = 0x0FE40, + angleleft = 0x02329, + angleright = 0x0232A, + angstrom = 0x0212B, + anoteleia = 0x00387, + anudattadeva = 0x00952, + anusvarabengali = 0x00982, + anusvaradeva = 0x00902, + anusvaragujarati = 0x00A82, + aogonek = 0x00105, + apaatosquare = 0x03300, + aparen = 0x0249C, + apostrophearmenian = 0x0055A, + apostrophemod = 0x002BC, + apple = 0x0F8FF, + approaches = 0x02250, + approxequal = 0x02248, + approxequalorimage = 0x02252, + approximatelyequal = 0x02245, + araeaekorean = 0x0318E, + araeakorean = 0x0318D, + arc = 0x02312, + arighthalfring = 0x01E9A, + aring = 0x000E5, + aringacute = 0x001FB, + aringbelow = 0x01E01, + arrowboth = 0x02194, + arrowdashdown = 0x021E3, + arrowdashleft = 0x021E0, + arrowdashright = 0x021E2, + arrowdashup = 0x021E1, + arrowdblboth = 0x021D4, + arrowdbldown = 0x021D3, + arrowdblleft = 0x021D0, + arrowdblright = 0x021D2, + arrowdblup = 0x021D1, + arrowdown = 0x02193, + arrowdownleft = 0x02199, + arrowdownright = 0x02198, + arrowdownwhite = 0x021E9, + arrowheaddownmod = 0x002C5, + arrowheadleftmod = 0x002C2, + arrowheadrightmod = 0x002C3, + arrowheadupmod = 0x002C4, + arrowleft = 0x02190, + arrowleftdbl = 0x021D0, + arrowleftdblstroke = 0x021CD, + arrowleftoverright = 0x021C6, + arrowleftwhite = 0x021E6, + arrowright = 0x02192, + arrowrightdblstroke = 0x021CF, + arrowrightheavy = 0x0279E, + arrowrightoverleft = 0x021C4, + arrowrightwhite = 0x021E8, + arrowtableft = 0x021E4, + arrowtabright = 0x021E5, + arrowup = 0x02191, + arrowupdn = 0x02195, + arrowupdnbse = 0x021A8, + arrowupdownbase = 0x021A8, + arrowupleft = 0x02196, + arrowupleftofdown = 0x021C5, + arrowupright = 0x02197, + arrowupwhite = 0x021E7, + asciicircum = 0x0005E, + asciicircummonospace = 0x0FF3E, + asciitilde = 0x0007E, + asciitildemonospace = 0x0FF5E, + ascript = 0x00251, + ascriptturned = 0x00252, + asmallhiragana = 0x03041, + asmallkatakana = 0x030A1, + asmallkatakanahalfwidth = 0x0FF67, + asterisk = 0x0002A, + asteriskaltonearabic = 0x0066D, + asteriskarabic = 0x0066D, + asteriskmath = 0x02217, + asteriskmonospace = 0x0FF0A, + asterisksmall = 0x0FE61, + asterism = 0x02042, + asymptoticallyequal = 0x02243, + at = 0x00040, + atilde = 0x000E3, + atmonospace = 0x0FF20, + atsmall = 0x0FE6B, + aturned = 0x00250, + aubengali = 0x00994, + aubopomofo = 0x03120, + audeva = 0x00914, + augujarati = 0x00A94, + augurmukhi = 0x00A14, + aulengthmarkbengali = 0x009D7, + aumatragurmukhi = 0x00A4C, + auvowelsignbengali = 0x009CC, + auvowelsigndeva = 0x0094C, + auvowelsigngujarati = 0x00ACC, + avagrahadeva = 0x0093D, + aybarmenian = 0x00561, + ayin = 0x005E2, + ayinaltonehebrew = 0x0FB20, + ayinhebrew = 0x005E2, + b = 0x00062, + babengali = 0x009AC, + backslash = 0x0005C, + backslashmonospace = 0x0FF3C, + badeva = 0x0092C, + bagujarati = 0x00AAC, + bagurmukhi = 0x00A2C, + bahiragana = 0x03070, + bahtthai = 0x00E3F, + bakatakana = 0x030D0, + bar = 0x0007C, + barmonospace = 0x0FF5C, + bbopomofo = 0x03105, + bcircle = 0x024D1, + bdotaccent = 0x01E03, + bdotbelow = 0x01E05, + beamedsixteenthnotes = 0x0266C, + because = 0x02235, + becyrillic = 0x00431, + beharabic = 0x00628, + behfinalarabic = 0x0FE90, + behinitialarabic = 0x0FE91, + behiragana = 0x03079, + behmedialarabic = 0x0FE92, + behmeeminitialarabic = 0x0FC9F, + behmeemisolatedarabic = 0x0FC08, + behnoonfinalarabic = 0x0FC6D, + bekatakana = 0x030D9, + benarmenian = 0x00562, + bet = 0x005D1, + beta = 0x003B2, + betasymbolgreek = 0x003D0, + betdagesh = 0x0FB31, + betdageshhebrew = 0x0FB31, + bethebrew = 0x005D1, + betrafehebrew = 0x0FB4C, + bhabengali = 0x009AD, + bhadeva = 0x0092D, + bhagujarati = 0x00AAD, + bhagurmukhi = 0x00A2D, + bhook = 0x00253, + bihiragana = 0x03073, + bikatakana = 0x030D3, + bilabialclick = 0x00298, + bindigurmukhi = 0x00A02, + birusquare = 0x03331, + blackcircle = 0x025CF, + blackdiamond = 0x025C6, + blackdownpointingtriangle = 0x025BC, + blackleftpointingpointer = 0x025C4, + blackleftpointingtriangle = 0x025C0, + blacklenticularbracketleft = 0x03010, + blacklenticularbracketleftvertical = 0x0FE3B, + blacklenticularbracketright = 0x03011, + blacklenticularbracketrightvertical = 0x0FE3C, + blacklowerlefttriangle = 0x025E3, + blacklowerrighttriangle = 0x025E2, + blackrectangle = 0x025AC, + blackrightpointingpointer = 0x025BA, + blackrightpointingtriangle = 0x025B6, + blacksmallsquare = 0x025AA, + blacksmilingface = 0x0263B, + blacksquare = 0x025A0, + blackstar = 0x02605, + blackupperlefttriangle = 0x025E4, + blackupperrighttriangle = 0x025E5, + blackuppointingsmalltriangle = 0x025B4, + blackuppointingtriangle = 0x025B2, + blank = 0x02423, + blinebelow = 0x01E07, + block = 0x02588, + bmonospace = 0x0FF42, + bobaimaithai = 0x00E1A, + bohiragana = 0x0307C, + bokatakana = 0x030DC, + bparen = 0x0249D, + bqsquare = 0x033C3, + braceleft = 0x0007B, + braceleftmonospace = 0x0FF5B, + braceleftsmall = 0x0FE5B, + braceleftvertical = 0x0FE37, + braceright = 0x0007D, + bracerightmonospace = 0x0FF5D, + bracerightsmall = 0x0FE5C, + bracerightvertical = 0x0FE38, + bracketleft = 0x0005B, + bracketleftmonospace = 0x0FF3B, + bracketright = 0x0005D, + bracketrightmonospace = 0x0FF3D, + breve = 0x002D8, + brevebelowcmb = 0x0032E, + brevecmb = 0x00306, + breveinvertedbelowcmb = 0x0032F, + breveinvertedcmb = 0x00311, + breveinverteddoublecmb = 0x00361, + bridgebelowcmb = 0x0032A, + bridgeinvertedbelowcmb = 0x0033A, + brokenbar = 0x000A6, + bstroke = 0x00180, + btopbar = 0x00183, + buhiragana = 0x03076, + bukatakana = 0x030D6, + bullet = 0x02022, + bulletinverse = 0x025D8, + bulletoperator = 0x02219, + bullseye = 0x025CE, + c = 0x00063, + caarmenian = 0x0056E, + cabengali = 0x0099A, + cacute = 0x00107, + cadeva = 0x0091A, + cagujarati = 0x00A9A, + cagurmukhi = 0x00A1A, + calsquare = 0x03388, + candrabindubengali = 0x00981, + candrabinducmb = 0x00310, + candrabindudeva = 0x00901, + candrabindugujarati = 0x00A81, + capslock = 0x021EA, + careof = 0x02105, + caron = 0x002C7, + caronbelowcmb = 0x0032C, + caroncmb = 0x0030C, + carriagereturn = 0x021B5, + cbopomofo = 0x03118, + ccaron = 0x0010D, + ccedilla = 0x000E7, + ccedillaacute = 0x01E09, + ccircle = 0x024D2, + ccircumflex = 0x00109, + ccurl = 0x00255, + cdot = 0x0010B, + cdotaccent = 0x0010B, + cdsquare = 0x033C5, + cedilla = 0x000B8, + cedillacmb = 0x00327, + cent = 0x000A2, + centigrade = 0x02103, + centmonospace = 0x0FFE0, + chaarmenian = 0x00579, + chabengali = 0x0099B, + chadeva = 0x0091B, + chagujarati = 0x00A9B, + chagurmukhi = 0x00A1B, + chbopomofo = 0x03114, + cheabkhasiancyrillic = 0x004BD, + checkmark = 0x02713, + checyrillic = 0x00447, + chedescenderabkhasiancyrillic = 0x004BF, + chedescendercyrillic = 0x004B7, + chedieresiscyrillic = 0x004F5, + cheharmenian = 0x00573, + chekhakassiancyrillic = 0x004CC, + cheverticalstrokecyrillic = 0x004B9, + chi = 0x003C7, + chieuchacirclekorean = 0x03277, + chieuchaparenkorean = 0x03217, + chieuchcirclekorean = 0x03269, + chieuchkorean = 0x0314A, + chieuchparenkorean = 0x03209, + chochangthai = 0x00E0A, + chochanthai = 0x00E08, + chochingthai = 0x00E09, + chochoethai = 0x00E0C, + chook = 0x00188, + cieucacirclekorean = 0x03276, + cieucaparenkorean = 0x03216, + cieuccirclekorean = 0x03268, + cieuckorean = 0x03148, + cieucparenkorean = 0x03208, + cieucuparenkorean = 0x0321C, + circle = 0x025CB, + circlemultiply = 0x02297, + circleot = 0x02299, + circleplus = 0x02295, + circlepostalmark = 0x03036, + circlewithlefthalfblack = 0x025D0, + circlewithrighthalfblack = 0x025D1, + circumflex = 0x002C6, + circumflexbelowcmb = 0x0032D, + circumflexcmb = 0x00302, + clear = 0x02327, + clickalveolar = 0x001C2, + clickdental = 0x001C0, + clicklateral = 0x001C1, + clickretroflex = 0x001C3, + club = 0x02663, + clubsuitblack = 0x02663, + clubsuitwhite = 0x02667, + cmcubedsquare = 0x033A4, + cmonospace = 0x0FF43, + cmsquaredsquare = 0x033A0, + coarmenian = 0x00581, + colon = 0x0003A, + colonmonetary = 0x020A1, + colonmonospace = 0x0FF1A, + colonsign = 0x020A1, + colonsmall = 0x0FE55, + colontriangularhalfmod = 0x002D1, + colontriangularmod = 0x002D0, + comma = 0x0002C, + commaabovecmb = 0x00313, + commaaboverightcmb = 0x00315, + commaarabic = 0x0060C, + commaarmenian = 0x0055D, + commamonospace = 0x0FF0C, + commareversedabovecmb = 0x00314, + commareversedmod = 0x002BD, + commasmall = 0x0FE50, + commaturnedabovecmb = 0x00312, + commaturnedmod = 0x002BB, + compass = 0x0263C, + congruent = 0x02245, + contourintegral = 0x0222E, + control = 0x02303, + controlACK = 0x00006, + controlBEL = 0x00007, + controlBS = 0x00008, + controlCAN = 0x00018, + controlCR = 0x0000D, + controlDC1 = 0x00011, + controlDC2 = 0x00012, + controlDC3 = 0x00013, + controlDC4 = 0x00014, + controlDEL = 0x0007F, + controlDLE = 0x00010, + controlEM = 0x00019, + controlENQ = 0x00005, + controlEOT = 0x00004, + controlESC = 0x0001B, + controlETB = 0x00017, + controlETX = 0x00003, + controlFF = 0x0000C, + controlFS = 0x0001C, + controlGS = 0x0001D, + controlHT = 0x00009, + controlLF = 0x0000A, + controlNAK = 0x00015, + controlRS = 0x0001E, + controlSI = 0x0000F, + controlSO = 0x0000E, + controlSOT = 0x00002, + controlSTX = 0x00001, + controlSUB = 0x0001A, + controlSYN = 0x00016, + controlUS = 0x0001F, + controlVT = 0x0000B, + copyright = 0x000A9, + cornerbracketleft = 0x0300C, + cornerbracketlefthalfwidth = 0x0FF62, + cornerbracketleftvertical = 0x0FE41, + cornerbracketright = 0x0300D, + cornerbracketrighthalfwidth = 0x0FF63, + cornerbracketrightvertical = 0x0FE42, + corporationsquare = 0x0337F, + cosquare = 0x033C7, + coverkgsquare = 0x033C6, + cparen = 0x0249E, + cruzeiro = 0x020A2, + cstretched = 0x00297, + curlyand = 0x022CF, + curlyor = 0x022CE, + currency = 0x000A4, + d = 0x00064, + daarmenian = 0x00564, + dabengali = 0x009A6, + dadarabic = 0x00636, + dadeva = 0x00926, + dadfinalarabic = 0x0FEBE, + dadinitialarabic = 0x0FEBF, + dadmedialarabic = 0x0FEC0, + dagesh = 0x005BC, + dageshhebrew = 0x005BC, + dagger = 0x02020, + daggerdbl = 0x02021, + dagujarati = 0x00AA6, + dagurmukhi = 0x00A26, + dahiragana = 0x03060, + dakatakana = 0x030C0, + dalarabic = 0x0062F, + dalet = 0x005D3, + daletdagesh = 0x0FB33, + daletdageshhebrew = 0x0FB33, + dalethatafpatah = 0x005D3, + dalethatafpatahhebrew = 0x005D3, + dalethatafsegol = 0x005D3, + dalethatafsegolhebrew = 0x005D3, + dalethebrew = 0x005D3, + dalethiriq = 0x005D3, + dalethiriqhebrew = 0x005D3, + daletholam = 0x005D3, + daletholamhebrew = 0x005D3, + daletpatah = 0x005D3, + daletpatahhebrew = 0x005D3, + daletqamats = 0x005D3, + daletqamatshebrew = 0x005D3, + daletqubuts = 0x005D3, + daletqubutshebrew = 0x005D3, + daletsegol = 0x005D3, + daletsegolhebrew = 0x005D3, + daletsheva = 0x005D3, + daletshevahebrew = 0x005D3, + dalettsere = 0x005D3, + dalettserehebrew = 0x005D3, + dalfinalarabic = 0x0FEAA, + dammaarabic = 0x0064F, + dammalowarabic = 0x0064F, + dammatanaltonearabic = 0x0064C, + dammatanarabic = 0x0064C, + danda = 0x00964, + dargahebrew = 0x005A7, + dargalefthebrew = 0x005A7, + dasiapneumatacyrilliccmb = 0x00485, + dblanglebracketleft = 0x0300A, + dblanglebracketleftvertical = 0x0FE3D, + dblanglebracketright = 0x0300B, + dblanglebracketrightvertical = 0x0FE3E, + dblarchinvertedbelowcmb = 0x0032B, + dblarrowleft = 0x021D4, + dblarrowright = 0x021D2, + dbldanda = 0x00965, + dblgravecmb = 0x0030F, + dblintegral = 0x0222C, + dbllowline = 0x02017, + dbllowlinecmb = 0x00333, + dbloverlinecmb = 0x0033F, + dblprimemod = 0x002BA, + dblverticalbar = 0x02016, + dblverticallineabovecmb = 0x0030E, + dbopomofo = 0x03109, + dbsquare = 0x033C8, + dcaron = 0x0010F, + dcedilla = 0x01E11, + dcircle = 0x024D3, + dcircumflexbelow = 0x01E13, + dcroat = 0x00111, + ddabengali = 0x009A1, + ddadeva = 0x00921, + ddagujarati = 0x00AA1, + ddagurmukhi = 0x00A21, + ddalarabic = 0x00688, + ddalfinalarabic = 0x0FB89, + dddhadeva = 0x0095C, + ddhabengali = 0x009A2, + ddhadeva = 0x00922, + ddhagujarati = 0x00AA2, + ddhagurmukhi = 0x00A22, + ddotaccent = 0x01E0B, + ddotbelow = 0x01E0D, + decimalseparatorarabic = 0x0066B, + decimalseparatorpersian = 0x0066B, + decyrillic = 0x00434, + degree = 0x000B0, + dehihebrew = 0x005AD, + dehiragana = 0x03067, + deicoptic = 0x003EF, + dekatakana = 0x030C7, + deleteleft = 0x0232B, + deleteright = 0x02326, + delta = 0x003B4, + deltaturned = 0x0018D, + denominatorminusonenumeratorbengali = 0x009F8, + dezh = 0x002A4, + dhabengali = 0x009A7, + dhadeva = 0x00927, + dhagujarati = 0x00AA7, + dhagurmukhi = 0x00A27, + dhook = 0x00257, + dialytikatonos = 0x00385, + dialytikatonoscmb = 0x00344, + diamond = 0x02666, + diamondsuitwhite = 0x02662, + dieresis = 0x000A8, + dieresisbelowcmb = 0x00324, + dieresiscmb = 0x00308, + dieresistonos = 0x00385, + dihiragana = 0x03062, + dikatakana = 0x030C2, + dittomark = 0x03003, + divide = 0x000F7, + divides = 0x02223, + divisionslash = 0x02215, + djecyrillic = 0x00452, + dkshade = 0x02593, + dlinebelow = 0x01E0F, + dlsquare = 0x03397, + dmacron = 0x00111, + dmonospace = 0x0FF44, + dnblock = 0x02584, + dochadathai = 0x00E0E, + dodekthai = 0x00E14, + dohiragana = 0x03069, + dokatakana = 0x030C9, + dollar = 0x00024, + dollarmonospace = 0x0FF04, + dollarsmall = 0x0FE69, + dong = 0x020AB, + dorusquare = 0x03326, + dotaccent = 0x002D9, + dotaccentcmb = 0x00307, + dotbelowcmb = 0x00323, + dotbelowcomb = 0x00323, + dotkatakana = 0x030FB, + dotlessi = 0x00131, + dotlessj = 0x00237, + dotlessjstrokehook = 0x00284, + dotmath = 0x022C5, + dottedcircle = 0x025CC, + doubleyodpatah = 0x0FB1F, + doubleyodpatahhebrew = 0x0FB1F, + downtackbelowcmb = 0x0031E, + downtackmod = 0x002D5, + dparen = 0x0249F, + dtail = 0x00256, + dtopbar = 0x0018C, + duhiragana = 0x03065, + dukatakana = 0x030C5, + dz = 0x001F3, + dzaltone = 0x002A3, + dzcaron = 0x001C6, + dzcurl = 0x002A5, + dzeabkhasiancyrillic = 0x004E1, + dzecyrillic = 0x00455, + dzhecyrillic = 0x0045F, + e = 0x00065, + eacute = 0x000E9, + earth = 0x02641, + ebengali = 0x0098F, + ebopomofo = 0x0311C, + ebreve = 0x00115, + ecandradeva = 0x0090D, + ecandragujarati = 0x00A8D, + ecandravowelsigndeva = 0x00945, + ecandravowelsigngujarati = 0x00AC5, + ecaron = 0x0011B, + ecedillabreve = 0x01E1D, + echarmenian = 0x00565, + echyiwnarmenian = 0x00587, + ecircle = 0x024D4, + ecircumflex = 0x000EA, + ecircumflexacute = 0x01EBF, + ecircumflexbelow = 0x01E19, + ecircumflexdotbelow = 0x01EC7, + ecircumflexgrave = 0x01EC1, + ecircumflexhookabove = 0x01EC3, + ecircumflextilde = 0x01EC5, + ecyrillic = 0x00454, + edblgrave = 0x00205, + edeva = 0x0090F, + edieresis = 0x000EB, + edot = 0x00117, + edotaccent = 0x00117, + edotbelow = 0x01EB9, + eegurmukhi = 0x00A0F, + eematragurmukhi = 0x00A47, + efcyrillic = 0x00444, + egrave = 0x000E8, + egujarati = 0x00A8F, + eharmenian = 0x00567, + ehbopomofo = 0x0311D, + ehiragana = 0x03048, + ehookabove = 0x01EBB, + eibopomofo = 0x0311F, + eight = 0x00038, + eightarabic = 0x00668, + eightbengali = 0x009EE, + eightcircle = 0x02467, + eightcircleinversesansserif = 0x02791, + eightdeva = 0x0096E, + eighteencircle = 0x02471, + eighteenparen = 0x02485, + eighteenperiod = 0x02499, + eightgujarati = 0x00AEE, + eightgurmukhi = 0x00A6E, + eighthackarabic = 0x00668, + eighthangzhou = 0x03028, + eighthnotebeamed = 0x0266B, + eightideographicparen = 0x03227, + eightinferior = 0x02088, + eightmonospace = 0x0FF18, + eightoldstyle = 0x00038, + eightparen = 0x0247B, + eightperiod = 0x0248F, + eightpersian = 0x006F8, + eightroman = 0x02177, + eightsuperior = 0x02078, + eightthai = 0x00E58, + einvertedbreve = 0x00207, + eiotifiedcyrillic = 0x00465, + ekatakana = 0x030A8, + ekatakanahalfwidth = 0x0FF74, + ekonkargurmukhi = 0x00A74, + ekorean = 0x03154, + elcyrillic = 0x0043B, + element = 0x02208, + elevencircle = 0x0246A, + elevenparen = 0x0247E, + elevenperiod = 0x02492, + elevenroman = 0x0217A, + ellipsis = 0x02026, + ellipsisvertical = 0x022EE, + emacron = 0x00113, + emacronacute = 0x01E17, + emacrongrave = 0x01E15, + emcyrillic = 0x0043C, + emdash = 0x02014, + emdashvertical = 0x0FE31, + emonospace = 0x0FF45, + emphasismarkarmenian = 0x0055B, + emptyset = 0x02205, + enbopomofo = 0x03123, + encyrillic = 0x0043D, + endash = 0x02013, + endashvertical = 0x0FE32, + endescendercyrillic = 0x004A3, + eng = 0x0014B, + engbopomofo = 0x03125, + enghecyrillic = 0x004A5, + enhookcyrillic = 0x004C8, + enspace = 0x02002, + eogonek = 0x00119, + eokorean = 0x03153, + eopen = 0x0025B, + eopenclosed = 0x0029A, + eopenreversed = 0x0025C, + eopenreversedclosed = 0x0025E, + eopenreversedhook = 0x0025D, + eparen = 0x024A0, + epsilon = 0x003B5, + epsilontonos = 0x003AD, + equal = 0x0003D, + equalmonospace = 0x0FF1D, + equalsmall = 0x0FE66, + equalsuperior = 0x0207C, + equivalence = 0x02261, + erbopomofo = 0x03126, + ercyrillic = 0x00440, + ereversed = 0x00258, + ereversedcyrillic = 0x0044D, + escyrillic = 0x00441, + esdescendercyrillic = 0x004AB, + esh = 0x00283, + eshcurl = 0x00286, + eshortdeva = 0x0090E, + eshortvowelsigndeva = 0x00946, + eshreversedloop = 0x001AA, + eshsquatreversed = 0x00285, + esmallhiragana = 0x03047, + esmallkatakana = 0x030A7, + esmallkatakanahalfwidth = 0x0FF6A, + estimated = 0x0212E, + eta = 0x003B7, + etarmenian = 0x00568, + etatonos = 0x003AE, + eth = 0x000F0, + etilde = 0x01EBD, + etildebelow = 0x01E1B, + etnahtafoukhhebrew = 0x00591, + etnahtafoukhlefthebrew = 0x00591, + etnahtahebrew = 0x00591, + etnahtalefthebrew = 0x00591, + eturned = 0x001DD, + eukorean = 0x03161, + euro = 0x020AC, + evowelsignbengali = 0x009C7, + evowelsigndeva = 0x00947, + evowelsigngujarati = 0x00AC7, + exclam = 0x00021, + exclamarmenian = 0x0055C, + exclamdbl = 0x0203C, + exclamdown = 0x000A1, + exclammonospace = 0x0FF01, + existential = 0x02203, + ezh = 0x00292, + ezhcaron = 0x001EF, + ezhcurl = 0x00293, + ezhreversed = 0x001B9, + ezhtail = 0x001BA, + f = 0x00066, + fadeva = 0x0095E, + fagurmukhi = 0x00A5E, + fahrenheit = 0x02109, + fathaarabic = 0x0064E, + fathalowarabic = 0x0064E, + fathatanarabic = 0x0064B, + fbopomofo = 0x03108, + fcircle = 0x024D5, + fdotaccent = 0x01E1F, + feharabic = 0x00641, + feharmenian = 0x00586, + fehfinalarabic = 0x0FED2, + fehinitialarabic = 0x0FED3, + fehmedialarabic = 0x0FED4, + feicoptic = 0x003E5, + female = 0x02640, + ff = 0x0FB00, + ffi = 0x0FB03, + ffl = 0x0FB04, + fi = 0x0FB01, + fifteencircle = 0x0246E, + fifteenparen = 0x02482, + fifteenperiod = 0x02496, + figuredash = 0x02012, + filledbox = 0x025A0, + filledrect = 0x025AC, + finalkaf = 0x005DA, + finalkafdagesh = 0x0FB3A, + finalkafdageshhebrew = 0x0FB3A, + finalkafhebrew = 0x005DA, + finalkafqamats = 0x005DA, + finalkafqamatshebrew = 0x005DA, + finalkafsheva = 0x005DA, + finalkafshevahebrew = 0x005DA, + finalmem = 0x005DD, + finalmemhebrew = 0x005DD, + finalnun = 0x005DF, + finalnunhebrew = 0x005DF, + finalpe = 0x005E3, + finalpehebrew = 0x005E3, + finaltsadi = 0x005E5, + finaltsadihebrew = 0x005E5, + firsttonechinese = 0x002C9, + fisheye = 0x025C9, + fitacyrillic = 0x00473, + five = 0x00035, + fivearabic = 0x00665, + fivebengali = 0x009EB, + fivecircle = 0x02464, + fivecircleinversesansserif = 0x0278E, + fivedeva = 0x0096B, + fiveeighths = 0x0215D, + fivegujarati = 0x00AEB, + fivegurmukhi = 0x00A6B, + fivehackarabic = 0x00665, + fivehangzhou = 0x03025, + fiveideographicparen = 0x03224, + fiveinferior = 0x02085, + fivemonospace = 0x0FF15, + fiveoldstyle = 0x00035, + fiveparen = 0x02478, + fiveperiod = 0x0248C, + fivepersian = 0x006F5, + fiveroman = 0x02174, + fivesuperior = 0x02075, + fivethai = 0x00E55, + fl = 0x0FB02, + florin = 0x00192, + fmonospace = 0x0FF46, + fmsquare = 0x03399, + fofanthai = 0x00E1F, + fofathai = 0x00E1D, + fongmanthai = 0x00E4F, + forall = 0x02200, + four = 0x00034, + fourarabic = 0x00664, + fourbengali = 0x009EA, + fourcircle = 0x02463, + fourcircleinversesansserif = 0x0278D, + fourdeva = 0x0096A, + fourgujarati = 0x00AEA, + fourgurmukhi = 0x00A6A, + fourhackarabic = 0x00664, + fourhangzhou = 0x03024, + fourideographicparen = 0x03223, + fourinferior = 0x02084, + fourmonospace = 0x0FF14, + fournumeratorbengali = 0x009F7, + fouroldstyle = 0x00034, + fourparen = 0x02477, + fourperiod = 0x0248B, + fourpersian = 0x006F4, + fourroman = 0x02173, + foursuperior = 0x02074, + fourteencircle = 0x0246D, + fourteenparen = 0x02481, + fourteenperiod = 0x02495, + fourthai = 0x00E54, + fourthtonechinese = 0x002CB, + fparen = 0x024A1, + fraction = 0x02044, + franc = 0x020A3, + g = 0x00067, + gabengali = 0x00997, + gacute = 0x001F5, + gadeva = 0x00917, + gafarabic = 0x006AF, + gaffinalarabic = 0x0FB93, + gafinitialarabic = 0x0FB94, + gafmedialarabic = 0x0FB95, + gagujarati = 0x00A97, + gagurmukhi = 0x00A17, + gahiragana = 0x0304C, + gakatakana = 0x030AC, + gamma = 0x003B3, + gammalatinsmall = 0x00263, + gammasuperior = 0x002E0, + gangiacoptic = 0x003EB, + gbopomofo = 0x0310D, + gbreve = 0x0011F, + gcaron = 0x001E7, + gcedilla = 0x00123, + gcircle = 0x024D6, + gcircumflex = 0x0011D, + gcommaaccent = 0x00123, + gdot = 0x00121, + gdotaccent = 0x00121, + gecyrillic = 0x00433, + gehiragana = 0x03052, + gekatakana = 0x030B2, + geometricallyequal = 0x02251, + gereshaccenthebrew = 0x0059C, + gereshhebrew = 0x005F3, + gereshmuqdamhebrew = 0x0059D, + germandbls = 0x000DF, + gershayimaccenthebrew = 0x0059E, + gershayimhebrew = 0x005F4, + getamark = 0x03013, + ghabengali = 0x00998, + ghadarmenian = 0x00572, + ghadeva = 0x00918, + ghagujarati = 0x00A98, + ghagurmukhi = 0x00A18, + ghainarabic = 0x0063A, + ghainfinalarabic = 0x0FECE, + ghaininitialarabic = 0x0FECF, + ghainmedialarabic = 0x0FED0, + ghemiddlehookcyrillic = 0x00495, + ghestrokecyrillic = 0x00493, + gheupturncyrillic = 0x00491, + ghhadeva = 0x0095A, + ghhagurmukhi = 0x00A5A, + ghook = 0x00260, + ghzsquare = 0x03393, + gihiragana = 0x0304E, + gikatakana = 0x030AE, + gimarmenian = 0x00563, + gimel = 0x005D2, + gimeldagesh = 0x0FB32, + gimeldageshhebrew = 0x0FB32, + gimelhebrew = 0x005D2, + gjecyrillic = 0x00453, + glottalinvertedstroke = 0x001BE, + glottalstop = 0x00294, + glottalstopinverted = 0x00296, + glottalstopmod = 0x002C0, + glottalstopreversed = 0x00295, + glottalstopreversedmod = 0x002C1, + glottalstopreversedsuperior = 0x002E4, + glottalstopstroke = 0x002A1, + glottalstopstrokereversed = 0x002A2, + gmacron = 0x01E21, + gmonospace = 0x0FF47, + gohiragana = 0x03054, + gokatakana = 0x030B4, + gparen = 0x024A2, + gpasquare = 0x033AC, + gradient = 0x02207, + grave = 0x00060, + gravebelowcmb = 0x00316, + gravecmb = 0x00300, + gravecomb = 0x00300, + gravedeva = 0x00953, + gravelowmod = 0x002CE, + gravemonospace = 0x0FF40, + gravetonecmb = 0x00340, + greater = 0x0003E, + greaterequal = 0x02265, + greaterequalorless = 0x022DB, + greatermonospace = 0x0FF1E, + greaterorequivalent = 0x02273, + greaterorless = 0x02277, + greateroverequal = 0x02267, + greatersmall = 0x0FE65, + gscript = 0x00261, + gstroke = 0x001E5, + guhiragana = 0x03050, + guillemotleft = 0x000AB, + guillemotright = 0x000BB, + guilsinglleft = 0x02039, + guilsinglright = 0x0203A, + gukatakana = 0x030B0, + guramusquare = 0x03318, + gysquare = 0x033C9, + h = 0x00068, + haabkhasiancyrillic = 0x004A9, + haaltonearabic = 0x006C1, + habengali = 0x009B9, + hadescendercyrillic = 0x004B3, + hadeva = 0x00939, + hagujarati = 0x00AB9, + hagurmukhi = 0x00A39, + haharabic = 0x0062D, + hahfinalarabic = 0x0FEA2, + hahinitialarabic = 0x0FEA3, + hahiragana = 0x0306F, + hahmedialarabic = 0x0FEA4, + haitusquare = 0x0332A, + hakatakana = 0x030CF, + hakatakanahalfwidth = 0x0FF8A, + halantgurmukhi = 0x00A4D, + hamzaarabic = 0x00621, + hamzadammaarabic = 0x00621, + hamzadammatanarabic = 0x00621, + hamzafathaarabic = 0x00621, + hamzafathatanarabic = 0x00621, + hamzalowarabic = 0x00621, + hamzalowkasraarabic = 0x00621, + hamzalowkasratanarabic = 0x00621, + hamzasukunarabic = 0x00621, + hangulfiller = 0x03164, + hardsigncyrillic = 0x0044A, + harpoonleftbarbup = 0x021BC, + harpoonrightbarbup = 0x021C0, + hasquare = 0x033CA, + hatafpatah = 0x005B2, + hatafpatah16 = 0x005B2, + hatafpatah23 = 0x005B2, + hatafpatah2f = 0x005B2, + hatafpatahhebrew = 0x005B2, + hatafpatahnarrowhebrew = 0x005B2, + hatafpatahquarterhebrew = 0x005B2, + hatafpatahwidehebrew = 0x005B2, + hatafqamats = 0x005B3, + hatafqamats1b = 0x005B3, + hatafqamats28 = 0x005B3, + hatafqamats34 = 0x005B3, + hatafqamatshebrew = 0x005B3, + hatafqamatsnarrowhebrew = 0x005B3, + hatafqamatsquarterhebrew = 0x005B3, + hatafqamatswidehebrew = 0x005B3, + hatafsegol = 0x005B1, + hatafsegol17 = 0x005B1, + hatafsegol24 = 0x005B1, + hatafsegol30 = 0x005B1, + hatafsegolhebrew = 0x005B1, + hatafsegolnarrowhebrew = 0x005B1, + hatafsegolquarterhebrew = 0x005B1, + hatafsegolwidehebrew = 0x005B1, + hbar = 0x00127, + hbopomofo = 0x0310F, + hbrevebelow = 0x01E2B, + hcedilla = 0x01E29, + hcircle = 0x024D7, + hcircumflex = 0x00125, + hdieresis = 0x01E27, + hdotaccent = 0x01E23, + hdotbelow = 0x01E25, + he = 0x005D4, + heart = 0x02665, + heartsuitblack = 0x02665, + heartsuitwhite = 0x02661, + hedagesh = 0x0FB34, + hedageshhebrew = 0x0FB34, + hehaltonearabic = 0x006C1, + heharabic = 0x00647, + hehebrew = 0x005D4, + hehfinalaltonearabic = 0x0FBA7, + hehfinalalttwoarabic = 0x0FEEA, + hehfinalarabic = 0x0FEEA, + hehhamzaabovefinalarabic = 0x0FBA5, + hehhamzaaboveisolatedarabic = 0x0FBA4, + hehinitialaltonearabic = 0x0FBA8, + hehinitialarabic = 0x0FEEB, + hehiragana = 0x03078, + hehmedialaltonearabic = 0x0FBA9, + hehmedialarabic = 0x0FEEC, + heiseierasquare = 0x0337B, + hekatakana = 0x030D8, + hekatakanahalfwidth = 0x0FF8D, + hekutaarusquare = 0x03336, + henghook = 0x00267, + herutusquare = 0x03339, + het = 0x005D7, + hethebrew = 0x005D7, + hhook = 0x00266, + hhooksuperior = 0x002B1, + hieuhacirclekorean = 0x0327B, + hieuhaparenkorean = 0x0321B, + hieuhcirclekorean = 0x0326D, + hieuhkorean = 0x0314E, + hieuhparenkorean = 0x0320D, + hihiragana = 0x03072, + hikatakana = 0x030D2, + hikatakanahalfwidth = 0x0FF8B, + hiriq = 0x005B4, + hiriq14 = 0x005B4, + hiriq21 = 0x005B4, + hiriq2d = 0x005B4, + hiriqhebrew = 0x005B4, + hiriqnarrowhebrew = 0x005B4, + hiriqquarterhebrew = 0x005B4, + hiriqwidehebrew = 0x005B4, + hlinebelow = 0x01E96, + hmonospace = 0x0FF48, + hoarmenian = 0x00570, + hohipthai = 0x00E2B, + hohiragana = 0x0307B, + hokatakana = 0x030DB, + hokatakanahalfwidth = 0x0FF8E, + holam = 0x005B9, + holam19 = 0x005B9, + holam26 = 0x005B9, + holam32 = 0x005B9, + holamhebrew = 0x005B9, + holamnarrowhebrew = 0x005B9, + holamquarterhebrew = 0x005B9, + holamwidehebrew = 0x005B9, + honokhukthai = 0x00E2E, + hookabovecomb = 0x00309, + hookcmb = 0x00309, + hookpalatalizedbelowcmb = 0x00321, + hookretroflexbelowcmb = 0x00322, + hoonsquare = 0x03342, + horicoptic = 0x003E9, + horizontalbar = 0x02015, + horncmb = 0x0031B, + hotsprings = 0x02668, + house = 0x02302, + hparen = 0x024A3, + hsuperior = 0x002B0, + hturned = 0x00265, + huhiragana = 0x03075, + huiitosquare = 0x03333, + hukatakana = 0x030D5, + hukatakanahalfwidth = 0x0FF8C, + hungarumlaut = 0x002DD, + hungarumlautcmb = 0x0030B, + hv = 0x00195, + hyphen = 0x0002D, + hyphenmonospace = 0x0FF0D, + hyphensmall = 0x0FE63, + hyphentwo = 0x02010, + i = 0x00069, + iacute = 0x000ED, + iacyrillic = 0x0044F, + ibengali = 0x00987, + ibopomofo = 0x03127, + ibreve = 0x0012D, + icaron = 0x001D0, + icircle = 0x024D8, + icircumflex = 0x000EE, + icyrillic = 0x00456, + idblgrave = 0x00209, + ideographearthcircle = 0x0328F, + ideographfirecircle = 0x0328B, + ideographicallianceparen = 0x0323F, + ideographiccallparen = 0x0323A, + ideographiccentrecircle = 0x032A5, + ideographicclose = 0x03006, + ideographiccomma = 0x03001, + ideographiccommaleft = 0x0FF64, + ideographiccongratulationparen = 0x03237, + ideographiccorrectcircle = 0x032A3, + ideographicearthparen = 0x0322F, + ideographicenterpriseparen = 0x0323D, + ideographicexcellentcircle = 0x0329D, + ideographicfestivalparen = 0x03240, + ideographicfinancialcircle = 0x03296, + ideographicfinancialparen = 0x03236, + ideographicfireparen = 0x0322B, + ideographichaveparen = 0x03232, + ideographichighcircle = 0x032A4, + ideographiciterationmark = 0x03005, + ideographiclaborcircle = 0x03298, + ideographiclaborparen = 0x03238, + ideographicleftcircle = 0x032A7, + ideographiclowcircle = 0x032A6, + ideographicmedicinecircle = 0x032A9, + ideographicmetalparen = 0x0322E, + ideographicmoonparen = 0x0322A, + ideographicnameparen = 0x03234, + ideographicperiod = 0x03002, + ideographicprintcircle = 0x0329E, + ideographicreachparen = 0x03243, + ideographicrepresentparen = 0x03239, + ideographicresourceparen = 0x0323E, + ideographicrightcircle = 0x032A8, + ideographicsecretcircle = 0x03299, + ideographicselfparen = 0x03242, + ideographicsocietyparen = 0x03233, + ideographicspace = 0x03000, + ideographicspecialparen = 0x03235, + ideographicstockparen = 0x03231, + ideographicstudyparen = 0x0323B, + ideographicsunparen = 0x03230, + ideographicsuperviseparen = 0x0323C, + ideographicwaterparen = 0x0322C, + ideographicwoodparen = 0x0322D, + ideographiczero = 0x03007, + ideographmetalcircle = 0x0328E, + ideographmooncircle = 0x0328A, + ideographnamecircle = 0x03294, + ideographsuncircle = 0x03290, + ideographwatercircle = 0x0328C, + ideographwoodcircle = 0x0328D, + ideva = 0x00907, + idieresis = 0x000EF, + idieresisacute = 0x01E2F, + idieresiscyrillic = 0x004E5, + idotbelow = 0x01ECB, + iebrevecyrillic = 0x004D7, + iecyrillic = 0x00435, + ieungacirclekorean = 0x03275, + ieungaparenkorean = 0x03215, + ieungcirclekorean = 0x03267, + ieungkorean = 0x03147, + ieungparenkorean = 0x03207, + igrave = 0x000EC, + igujarati = 0x00A87, + igurmukhi = 0x00A07, + ihiragana = 0x03044, + ihookabove = 0x01EC9, + iibengali = 0x00988, + iicyrillic = 0x00438, + iideva = 0x00908, + iigujarati = 0x00A88, + iigurmukhi = 0x00A08, + iimatragurmukhi = 0x00A40, + iinvertedbreve = 0x0020B, + iishortcyrillic = 0x00439, + iivowelsignbengali = 0x009C0, + iivowelsigndeva = 0x00940, + iivowelsigngujarati = 0x00AC0, + ij = 0x00133, + ikatakana = 0x030A4, + ikatakanahalfwidth = 0x0FF72, + ikorean = 0x03163, + ilde = 0x002DC, + iluyhebrew = 0x005AC, + imacron = 0x0012B, + imacroncyrillic = 0x004E3, + imageorapproximatelyequal = 0x02253, + imatragurmukhi = 0x00A3F, + imonospace = 0x0FF49, + increment = 0x02206, + infinity = 0x0221E, + iniarmenian = 0x0056B, + integral = 0x0222B, + integralbottom = 0x02321, + integralbt = 0x02321, + integraltop = 0x02320, + integraltp = 0x02320, + intersection = 0x02229, + intisquare = 0x03305, + invbullet = 0x025D8, + invcircle = 0x025D9, + invsmileface = 0x0263B, + iocyrillic = 0x00451, + iogonek = 0x0012F, + iota = 0x003B9, + iotadieresis = 0x003CA, + iotadieresistonos = 0x00390, + iotalatin = 0x00269, + iotatonos = 0x003AF, + iparen = 0x024A4, + irigurmukhi = 0x00A72, + ismallhiragana = 0x03043, + ismallkatakana = 0x030A3, + ismallkatakanahalfwidth = 0x0FF68, + issharbengali = 0x009FA, + istroke = 0x00268, + iterationhiragana = 0x0309D, + iterationkatakana = 0x030FD, + itilde = 0x00129, + itildebelow = 0x01E2D, + iubopomofo = 0x03129, + iucyrillic = 0x0044E, + ivowelsignbengali = 0x009BF, + ivowelsigndeva = 0x0093F, + ivowelsigngujarati = 0x00ABF, + izhitsacyrillic = 0x00475, + izhitsadblgravecyrillic = 0x00477, + j = 0x0006A, + jaarmenian = 0x00571, + jabengali = 0x0099C, + jadeva = 0x0091C, + jagujarati = 0x00A9C, + jagurmukhi = 0x00A1C, + jbopomofo = 0x03110, + jcaron = 0x001F0, + jcircle = 0x024D9, + jcircumflex = 0x00135, + jcrossedtail = 0x0029D, + jdotlessstroke = 0x0025F, + jecyrillic = 0x00458, + jeemarabic = 0x0062C, + jeemfinalarabic = 0x0FE9E, + jeeminitialarabic = 0x0FE9F, + jeemmedialarabic = 0x0FEA0, + jeharabic = 0x00698, + jehfinalarabic = 0x0FB8B, + jhabengali = 0x0099D, + jhadeva = 0x0091D, + jhagujarati = 0x00A9D, + jhagurmukhi = 0x00A1D, + jheharmenian = 0x0057B, + jis = 0x03004, + jmonospace = 0x0FF4A, + jparen = 0x024A5, + jsuperior = 0x002B2, + k = 0x0006B, + kabashkircyrillic = 0x004A1, + kabengali = 0x00995, + kacute = 0x01E31, + kacyrillic = 0x0043A, + kadescendercyrillic = 0x0049B, + kadeva = 0x00915, + kaf = 0x005DB, + kafarabic = 0x00643, + kafdagesh = 0x0FB3B, + kafdageshhebrew = 0x0FB3B, + kaffinalarabic = 0x0FEDA, + kafhebrew = 0x005DB, + kafinitialarabic = 0x0FEDB, + kafmedialarabic = 0x0FEDC, + kafrafehebrew = 0x0FB4D, + kagujarati = 0x00A95, + kagurmukhi = 0x00A15, + kahiragana = 0x0304B, + kahookcyrillic = 0x004C4, + kakatakana = 0x030AB, + kakatakanahalfwidth = 0x0FF76, + kappa = 0x003BA, + kappasymbolgreek = 0x003F0, + kapyeounmieumkorean = 0x03171, + kapyeounphieuphkorean = 0x03184, + kapyeounpieupkorean = 0x03178, + kapyeounssangpieupkorean = 0x03179, + karoriisquare = 0x0330D, + kashidaautoarabic = 0x00640, + kashidaautonosidebearingarabic = 0x00640, + kasmallkatakana = 0x030F5, + kasquare = 0x03384, + kasraarabic = 0x00650, + kasratanarabic = 0x0064D, + kastrokecyrillic = 0x0049F, + katahiraprolongmarkhalfwidth = 0x0FF70, + kaverticalstrokecyrillic = 0x0049D, + kbopomofo = 0x0310E, + kcalsquare = 0x03389, + kcaron = 0x001E9, + kcedilla = 0x00137, + kcircle = 0x024DA, + kcommaaccent = 0x00137, + kdotbelow = 0x01E33, + keharmenian = 0x00584, + kehiragana = 0x03051, + kekatakana = 0x030B1, + kekatakanahalfwidth = 0x0FF79, + kenarmenian = 0x0056F, + kesmallkatakana = 0x030F6, + kgreenlandic = 0x00138, + khabengali = 0x00996, + khacyrillic = 0x00445, + khadeva = 0x00916, + khagujarati = 0x00A96, + khagurmukhi = 0x00A16, + khaharabic = 0x0062E, + khahfinalarabic = 0x0FEA6, + khahinitialarabic = 0x0FEA7, + khahmedialarabic = 0x0FEA8, + kheicoptic = 0x003E7, + khhadeva = 0x00959, + khhagurmukhi = 0x00A59, + khieukhacirclekorean = 0x03278, + khieukhaparenkorean = 0x03218, + khieukhcirclekorean = 0x0326A, + khieukhkorean = 0x0314B, + khieukhparenkorean = 0x0320A, + khokhaithai = 0x00E02, + khokhonthai = 0x00E05, + khokhuatthai = 0x00E03, + khokhwaithai = 0x00E04, + khomutthai = 0x00E5B, + khook = 0x00199, + khorakhangthai = 0x00E06, + khzsquare = 0x03391, + kihiragana = 0x0304D, + kikatakana = 0x030AD, + kikatakanahalfwidth = 0x0FF77, + kiroguramusquare = 0x03315, + kiromeetorusquare = 0x03316, + kirosquare = 0x03314, + kiyeokacirclekorean = 0x0326E, + kiyeokaparenkorean = 0x0320E, + kiyeokcirclekorean = 0x03260, + kiyeokkorean = 0x03131, + kiyeokparenkorean = 0x03200, + kiyeoksioskorean = 0x03133, + kjecyrillic = 0x0045C, + klinebelow = 0x01E35, + klsquare = 0x03398, + kmcubedsquare = 0x033A6, + kmonospace = 0x0FF4B, + kmsquaredsquare = 0x033A2, + kohiragana = 0x03053, + kohmsquare = 0x033C0, + kokaithai = 0x00E01, + kokatakana = 0x030B3, + kokatakanahalfwidth = 0x0FF7A, + kooposquare = 0x0331E, + koppacyrillic = 0x00481, + koreanstandardsymbol = 0x0327F, + koroniscmb = 0x00343, + kparen = 0x024A6, + kpasquare = 0x033AA, + ksicyrillic = 0x0046F, + ktsquare = 0x033CF, + kturned = 0x0029E, + kuhiragana = 0x0304F, + kukatakana = 0x030AF, + kukatakanahalfwidth = 0x0FF78, + kvsquare = 0x033B8, + kwsquare = 0x033BE, + l = 0x0006C, + labengali = 0x009B2, + lacute = 0x0013A, + ladeva = 0x00932, + lagujarati = 0x00AB2, + lagurmukhi = 0x00A32, + lakkhangyaothai = 0x00E45, + lamaleffinalarabic = 0x0FEFC, + lamalefhamzaabovefinalarabic = 0x0FEF8, + lamalefhamzaaboveisolatedarabic = 0x0FEF7, + lamalefhamzabelowfinalarabic = 0x0FEFA, + lamalefhamzabelowisolatedarabic = 0x0FEF9, + lamalefisolatedarabic = 0x0FEFB, + lamalefmaddaabovefinalarabic = 0x0FEF6, + lamalefmaddaaboveisolatedarabic = 0x0FEF5, + lamarabic = 0x00644, + lambda = 0x003BB, + lambdastroke = 0x0019B, + lamed = 0x005DC, + lameddagesh = 0x0FB3C, + lameddageshhebrew = 0x0FB3C, + lamedhebrew = 0x005DC, + lamedholam = 0x005DC, + lamedholamdagesh = 0x005DC, + lamedholamdageshhebrew = 0x005DC, + lamedholamhebrew = 0x005DC, + lamfinalarabic = 0x0FEDE, + lamhahinitialarabic = 0x0FCCA, + laminitialarabic = 0x0FEDF, + lamjeeminitialarabic = 0x0FCC9, + lamkhahinitialarabic = 0x0FCCB, + lamlamhehisolatedarabic = 0x0FDF2, + lammedialarabic = 0x0FEE0, + lammeemhahinitialarabic = 0x0FD88, + lammeeminitialarabic = 0x0FCCC, + lammeemjeeminitialarabic = 0x0FEDF, + lammeemkhahinitialarabic = 0x0FEDF, + largecircle = 0x025EF, + lbar = 0x0019A, + lbelt = 0x0026C, + lbopomofo = 0x0310C, + lcaron = 0x0013E, + lcedilla = 0x0013C, + lcircle = 0x024DB, + lcircumflexbelow = 0x01E3D, + lcommaaccent = 0x0013C, + ldot = 0x00140, + ldotaccent = 0x00140, + ldotbelow = 0x01E37, + ldotbelowmacron = 0x01E39, + leftangleabovecmb = 0x0031A, + lefttackbelowcmb = 0x00318, + less = 0x0003C, + lessequal = 0x02264, + lessequalorgreater = 0x022DA, + lessmonospace = 0x0FF1C, + lessorequivalent = 0x02272, + lessorgreater = 0x02276, + lessoverequal = 0x02266, + lesssmall = 0x0FE64, + lezh = 0x0026E, + lfblock = 0x0258C, + lhookretroflex = 0x0026D, + lira = 0x020A4, + liwnarmenian = 0x0056C, + lj = 0x001C9, + ljecyrillic = 0x00459, + lladeva = 0x00933, + llagujarati = 0x00AB3, + llinebelow = 0x01E3B, + llladeva = 0x00934, + llvocalicbengali = 0x009E1, + llvocalicdeva = 0x00961, + llvocalicvowelsignbengali = 0x009E3, + llvocalicvowelsigndeva = 0x00963, + lmiddletilde = 0x0026B, + lmonospace = 0x0FF4C, + lmsquare = 0x033D0, + lochulathai = 0x00E2C, + logicaland = 0x02227, + logicalnot = 0x000AC, + logicalnotreversed = 0x02310, + logicalor = 0x02228, + lolingthai = 0x00E25, + longs = 0x0017F, + lowlinecenterline = 0x0FE4E, + lowlinecmb = 0x00332, + lowlinedashed = 0x0FE4D, + lozenge = 0x025CA, + lparen = 0x024A7, + lslash = 0x00142, + lsquare = 0x02113, + ltshade = 0x02591, + luthai = 0x00E26, + lvocalicbengali = 0x0098C, + lvocalicdeva = 0x0090C, + lvocalicvowelsignbengali = 0x009E2, + lvocalicvowelsigndeva = 0x00962, + lxsquare = 0x033D3, + m = 0x0006D, + mabengali = 0x009AE, + macron = 0x000AF, + macronbelowcmb = 0x00331, + macroncmb = 0x00304, + macronlowmod = 0x002CD, + macronmonospace = 0x0FFE3, + macute = 0x01E3F, + madeva = 0x0092E, + magujarati = 0x00AAE, + magurmukhi = 0x00A2E, + mahapakhhebrew = 0x005A4, + mahapakhlefthebrew = 0x005A4, + mahiragana = 0x0307E, + maichattawathai = 0x00E4B, + maiekthai = 0x00E48, + maihanakatthai = 0x00E31, + maitaikhuthai = 0x00E47, + maithothai = 0x00E49, + maitrithai = 0x00E4A, + maiyamokthai = 0x00E46, + makatakana = 0x030DE, + makatakanahalfwidth = 0x0FF8F, + male = 0x02642, + mansyonsquare = 0x03347, + maqafhebrew = 0x005BE, + mars = 0x02642, + masoracirclehebrew = 0x005AF, + masquare = 0x03383, + mbopomofo = 0x03107, + mbsquare = 0x033D4, + mcircle = 0x024DC, + mcubedsquare = 0x033A5, + mdotaccent = 0x01E41, + mdotbelow = 0x01E43, + meemarabic = 0x00645, + meemfinalarabic = 0x0FEE2, + meeminitialarabic = 0x0FEE3, + meemmedialarabic = 0x0FEE4, + meemmeeminitialarabic = 0x0FCD1, + meemmeemisolatedarabic = 0x0FC48, + meetorusquare = 0x0334D, + mehiragana = 0x03081, + meizierasquare = 0x0337E, + mekatakana = 0x030E1, + mekatakanahalfwidth = 0x0FF92, + mem = 0x005DE, + memdagesh = 0x0FB3E, + memdageshhebrew = 0x0FB3E, + memhebrew = 0x005DE, + menarmenian = 0x00574, + merkhahebrew = 0x005A5, + merkhakefulahebrew = 0x005A6, + merkhakefulalefthebrew = 0x005A6, + merkhalefthebrew = 0x005A5, + mhook = 0x00271, + mhzsquare = 0x03392, + middledotkatakanahalfwidth = 0x0FF65, + middot = 0x000B7, + mieumacirclekorean = 0x03272, + mieumaparenkorean = 0x03212, + mieumcirclekorean = 0x03264, + mieumkorean = 0x03141, + mieumpansioskorean = 0x03170, + mieumparenkorean = 0x03204, + mieumpieupkorean = 0x0316E, + mieumsioskorean = 0x0316F, + mihiragana = 0x0307F, + mikatakana = 0x030DF, + mikatakanahalfwidth = 0x0FF90, + minus = 0x02212, + minusbelowcmb = 0x00320, + minuscircle = 0x02296, + minusmod = 0x002D7, + minusplus = 0x02213, + minute = 0x02032, + miribaarusquare = 0x0334A, + mirisquare = 0x03349, + mlonglegturned = 0x00270, + mlsquare = 0x03396, + mmcubedsquare = 0x033A3, + mmonospace = 0x0FF4D, + mmsquaredsquare = 0x0339F, + mohiragana = 0x03082, + mohmsquare = 0x033C1, + mokatakana = 0x030E2, + mokatakanahalfwidth = 0x0FF93, + molsquare = 0x033D6, + momathai = 0x00E21, + moverssquare = 0x033A7, + moverssquaredsquare = 0x033A8, + mparen = 0x024A8, + mpasquare = 0x033AB, + mssquare = 0x033B3, + mturned = 0x0026F, + mu = 0x000B5, + mu1 = 0x000B5, + muasquare = 0x03382, + muchgreater = 0x0226B, + muchless = 0x0226A, + mufsquare = 0x0338C, + mugreek = 0x003BC, + mugsquare = 0x0338D, + muhiragana = 0x03080, + mukatakana = 0x030E0, + mukatakanahalfwidth = 0x0FF91, + mulsquare = 0x03395, + multiply = 0x000D7, + mumsquare = 0x0339B, + munahhebrew = 0x005A3, + munahlefthebrew = 0x005A3, + musicalnote = 0x0266A, + musicalnotedbl = 0x0266B, + musicflatsign = 0x0266D, + musicsharpsign = 0x0266F, + mussquare = 0x033B2, + muvsquare = 0x033B6, + muwsquare = 0x033BC, + mvmegasquare = 0x033B9, + mvsquare = 0x033B7, + mwmegasquare = 0x033BF, + mwsquare = 0x033BD, + n = 0x0006E, + nabengali = 0x009A8, + nabla = 0x02207, + nacute = 0x00144, + nadeva = 0x00928, + nagujarati = 0x00AA8, + nagurmukhi = 0x00A28, + nahiragana = 0x0306A, + nakatakana = 0x030CA, + nakatakanahalfwidth = 0x0FF85, + napostrophe = 0x00149, + nasquare = 0x03381, + nbopomofo = 0x0310B, + nbspace = 0x000A0, + ncaron = 0x00148, + ncedilla = 0x00146, + ncircle = 0x024DD, + ncircumflexbelow = 0x01E4B, + ncommaaccent = 0x00146, + ndotaccent = 0x01E45, + ndotbelow = 0x01E47, + nehiragana = 0x0306D, + nekatakana = 0x030CD, + nekatakanahalfwidth = 0x0FF88, + newsheqelsign = 0x020AA, + nfsquare = 0x0338B, + ngabengali = 0x00999, + ngadeva = 0x00919, + ngagujarati = 0x00A99, + ngagurmukhi = 0x00A19, + ngonguthai = 0x00E07, + nhiragana = 0x03093, + nhookleft = 0x00272, + nhookretroflex = 0x00273, + nieunacirclekorean = 0x0326F, + nieunaparenkorean = 0x0320F, + nieuncieuckorean = 0x03135, + nieuncirclekorean = 0x03261, + nieunhieuhkorean = 0x03136, + nieunkorean = 0x03134, + nieunpansioskorean = 0x03168, + nieunparenkorean = 0x03201, + nieunsioskorean = 0x03167, + nieuntikeutkorean = 0x03166, + nihiragana = 0x0306B, + nikatakana = 0x030CB, + nikatakanahalfwidth = 0x0FF86, + nikhahitthai = 0x00E4D, + nine = 0x00039, + ninearabic = 0x00669, + ninebengali = 0x009EF, + ninecircle = 0x02468, + ninecircleinversesansserif = 0x02792, + ninedeva = 0x0096F, + ninegujarati = 0x00AEF, + ninegurmukhi = 0x00A6F, + ninehackarabic = 0x00669, + ninehangzhou = 0x03029, + nineideographicparen = 0x03228, + nineinferior = 0x02089, + ninemonospace = 0x0FF19, + nineoldstyle = 0x00039, + nineparen = 0x0247C, + nineperiod = 0x02490, + ninepersian = 0x006F9, + nineroman = 0x02178, + ninesuperior = 0x02079, + nineteencircle = 0x02472, + nineteenparen = 0x02486, + nineteenperiod = 0x0249A, + ninethai = 0x00E59, + nj = 0x001CC, + njecyrillic = 0x0045A, + nkatakana = 0x030F3, + nkatakanahalfwidth = 0x0FF9D, + nlegrightlong = 0x0019E, + nlinebelow = 0x01E49, + nmonospace = 0x0FF4E, + nmsquare = 0x0339A, + nnabengali = 0x009A3, + nnadeva = 0x00923, + nnagujarati = 0x00AA3, + nnagurmukhi = 0x00A23, + nnnadeva = 0x00929, + nohiragana = 0x0306E, + nokatakana = 0x030CE, + nokatakanahalfwidth = 0x0FF89, + nonbreakingspace = 0x000A0, + nonenthai = 0x00E13, + nonuthai = 0x00E19, + noonarabic = 0x00646, + noonfinalarabic = 0x0FEE6, + noonghunnaarabic = 0x006BA, + noonghunnafinalarabic = 0x0FB9F, + noonhehinitialarabic = 0x0FEE7, + nooninitialarabic = 0x0FEE7, + noonjeeminitialarabic = 0x0FCD2, + noonjeemisolatedarabic = 0x0FC4B, + noonmedialarabic = 0x0FEE8, + noonmeeminitialarabic = 0x0FCD5, + noonmeemisolatedarabic = 0x0FC4E, + noonnoonfinalarabic = 0x0FC8D, + notcontains = 0x0220C, + notelement = 0x02209, + notelementof = 0x02209, + notequal = 0x02260, + notgreater = 0x0226F, + notgreaternorequal = 0x02271, + notgreaternorless = 0x02279, + notidentical = 0x02262, + notless = 0x0226E, + notlessnorequal = 0x02270, + notparallel = 0x02226, + notprecedes = 0x02280, + notsubset = 0x02284, + notsucceeds = 0x02281, + notsuperset = 0x02285, + nowarmenian = 0x00576, + nparen = 0x024A9, + nssquare = 0x033B1, + nsuperior = 0x0207F, + ntilde = 0x000F1, + nu = 0x003BD, + nuhiragana = 0x0306C, + nukatakana = 0x030CC, + nukatakanahalfwidth = 0x0FF87, + nuktabengali = 0x009BC, + nuktadeva = 0x0093C, + nuktagujarati = 0x00ABC, + nuktagurmukhi = 0x00A3C, + numbersign = 0x00023, + numbersignmonospace = 0x0FF03, + numbersignsmall = 0x0FE5F, + numeralsigngreek = 0x00374, + numeralsignlowergreek = 0x00375, + numero = 0x02116, + nun = 0x005E0, + nundagesh = 0x0FB40, + nundageshhebrew = 0x0FB40, + nunhebrew = 0x005E0, + nvsquare = 0x033B5, + nwsquare = 0x033BB, + nyabengali = 0x0099E, + nyadeva = 0x0091E, + nyagujarati = 0x00A9E, + nyagurmukhi = 0x00A1E, + o = 0x0006F, + oacute = 0x000F3, + oangthai = 0x00E2D, + obarred = 0x00275, + obarredcyrillic = 0x004E9, + obarreddieresiscyrillic = 0x004EB, + obengali = 0x00993, + obopomofo = 0x0311B, + obreve = 0x0014F, + ocandradeva = 0x00911, + ocandragujarati = 0x00A91, + ocandravowelsigndeva = 0x00949, + ocandravowelsigngujarati = 0x00AC9, + ocaron = 0x001D2, + ocircle = 0x024DE, + ocircumflex = 0x000F4, + ocircumflexacute = 0x01ED1, + ocircumflexdotbelow = 0x01ED9, + ocircumflexgrave = 0x01ED3, + ocircumflexhookabove = 0x01ED5, + ocircumflextilde = 0x01ED7, + ocyrillic = 0x0043E, + odblacute = 0x00151, + odblgrave = 0x0020D, + odeva = 0x00913, + odieresis = 0x000F6, + odieresiscyrillic = 0x004E7, + odotbelow = 0x01ECD, + oe = 0x00153, + oekorean = 0x0315A, + ogonek = 0x002DB, + ogonekcmb = 0x00328, + ograve = 0x000F2, + ogujarati = 0x00A93, + oharmenian = 0x00585, + ohiragana = 0x0304A, + ohookabove = 0x01ECF, + ohorn = 0x001A1, + ohornacute = 0x01EDB, + ohorndotbelow = 0x01EE3, + ohorngrave = 0x01EDD, + ohornhookabove = 0x01EDF, + ohorntilde = 0x01EE1, + ohungarumlaut = 0x00151, + oi = 0x001A3, + oinvertedbreve = 0x0020F, + okatakana = 0x030AA, + okatakanahalfwidth = 0x0FF75, + okorean = 0x03157, + olehebrew = 0x005AB, + omacron = 0x0014D, + omacronacute = 0x01E53, + omacrongrave = 0x01E51, + omdeva = 0x00950, + omega = 0x003C9, + omega1 = 0x003D6, + omegacyrillic = 0x00461, + omegalatinclosed = 0x00277, + omegaroundcyrillic = 0x0047B, + omegatitlocyrillic = 0x0047D, + omegatonos = 0x003CE, + omgujarati = 0x00AD0, + omicron = 0x003BF, + omicrontonos = 0x003CC, + omonospace = 0x0FF4F, + one = 0x00031, + onearabic = 0x00661, + onebengali = 0x009E7, + onecircle = 0x02460, + onecircleinversesansserif = 0x0278A, + onedeva = 0x00967, + onedotenleader = 0x02024, + oneeighth = 0x0215B, + onegujarati = 0x00AE7, + onegurmukhi = 0x00A67, + onehackarabic = 0x00661, + onehalf = 0x000BD, + onehangzhou = 0x03021, + oneideographicparen = 0x03220, + oneinferior = 0x02081, + onemonospace = 0x0FF11, + onenumeratorbengali = 0x009F4, + oneoldstyle = 0x00031, + oneparen = 0x02474, + oneperiod = 0x02488, + onepersian = 0x006F1, + onequarter = 0x000BC, + oneroman = 0x02170, + onesuperior = 0x000B9, + onethai = 0x00E51, + onethird = 0x02153, + oogonek = 0x001EB, + oogonekmacron = 0x001ED, + oogurmukhi = 0x00A13, + oomatragurmukhi = 0x00A4B, + oopen = 0x00254, + oparen = 0x024AA, + openbullet = 0x025E6, + option = 0x02325, + ordfeminine = 0x000AA, + ordmasculine = 0x000BA, + orthogonal = 0x0221F, + oshortdeva = 0x00912, + oshortvowelsigndeva = 0x0094A, + oslash = 0x000F8, + oslashacute = 0x001FF, + osmallhiragana = 0x03049, + osmallkatakana = 0x030A9, + osmallkatakanahalfwidth = 0x0FF6B, + ostrokeacute = 0x001FF, + otcyrillic = 0x0047F, + otilde = 0x000F5, + otildeacute = 0x01E4D, + otildedieresis = 0x01E4F, + oubopomofo = 0x03121, + overline = 0x0203E, + overlinecenterline = 0x0FE4A, + overlinecmb = 0x00305, + overlinedashed = 0x0FE49, + overlinedblwavy = 0x0FE4C, + overlinewavy = 0x0FE4B, + overscore = 0x000AF, + ovowelsignbengali = 0x009CB, + ovowelsigndeva = 0x0094B, + ovowelsigngujarati = 0x00ACB, + p = 0x00070, + paampssquare = 0x03380, + paasentosquare = 0x0332B, + pabengali = 0x009AA, + pacute = 0x01E55, + padeva = 0x0092A, + pagedown = 0x021DF, + pageup = 0x021DE, + pagujarati = 0x00AAA, + pagurmukhi = 0x00A2A, + pahiragana = 0x03071, + paiyannoithai = 0x00E2F, + pakatakana = 0x030D1, + palatalizationcyrilliccmb = 0x00484, + palochkacyrillic = 0x004C0, + pansioskorean = 0x0317F, + paragraph = 0x000B6, + parallel = 0x02225, + parenleft = 0x00028, + parenleftaltonearabic = 0x0FD3E, + parenleftinferior = 0x0208D, + parenleftmonospace = 0x0FF08, + parenleftsmall = 0x0FE59, + parenleftsuperior = 0x0207D, + parenleftvertical = 0x0FE35, + parenright = 0x00029, + parenrightaltonearabic = 0x0FD3F, + parenrightinferior = 0x0208E, + parenrightmonospace = 0x0FF09, + parenrightsmall = 0x0FE5A, + parenrightsuperior = 0x0207E, + parenrightvertical = 0x0FE36, + partialdiff = 0x02202, + paseqhebrew = 0x005C0, + pashtahebrew = 0x00599, + pasquare = 0x033A9, + patah = 0x005B7, + patah11 = 0x005B7, + patah1d = 0x005B7, + patah2a = 0x005B7, + patahhebrew = 0x005B7, + patahnarrowhebrew = 0x005B7, + patahquarterhebrew = 0x005B7, + patahwidehebrew = 0x005B7, + pazerhebrew = 0x005A1, + pbopomofo = 0x03106, + pcircle = 0x024DF, + pdotaccent = 0x01E57, + pe = 0x005E4, + pecyrillic = 0x0043F, + pedagesh = 0x0FB44, + pedageshhebrew = 0x0FB44, + peezisquare = 0x0333B, + pefinaldageshhebrew = 0x0FB43, + peharabic = 0x0067E, + peharmenian = 0x0057A, + pehebrew = 0x005E4, + pehfinalarabic = 0x0FB57, + pehinitialarabic = 0x0FB58, + pehiragana = 0x0307A, + pehmedialarabic = 0x0FB59, + pekatakana = 0x030DA, + pemiddlehookcyrillic = 0x004A7, + perafehebrew = 0x0FB4E, + percent = 0x00025, + percentarabic = 0x0066A, + percentmonospace = 0x0FF05, + percentsmall = 0x0FE6A, + period = 0x0002E, + periodarmenian = 0x00589, + periodcentered = 0x000B7, + periodhalfwidth = 0x0FF61, + periodmonospace = 0x0FF0E, + periodsmall = 0x0FE52, + perispomenigreekcmb = 0x00342, + perpendicular = 0x022A5, + perthousand = 0x02030, + peseta = 0x020A7, + pfsquare = 0x0338A, + phabengali = 0x009AB, + phadeva = 0x0092B, + phagujarati = 0x00AAB, + phagurmukhi = 0x00A2B, + phi = 0x003C6, + phi1 = 0x003D5, + phieuphacirclekorean = 0x0327A, + phieuphaparenkorean = 0x0321A, + phieuphcirclekorean = 0x0326C, + phieuphkorean = 0x0314D, + phieuphparenkorean = 0x0320C, + philatin = 0x00278, + phinthuthai = 0x00E3A, + phisymbolgreek = 0x003D5, + phook = 0x001A5, + phophanthai = 0x00E1E, + phophungthai = 0x00E1C, + phosamphaothai = 0x00E20, + pi = 0x003C0, + pieupacirclekorean = 0x03273, + pieupaparenkorean = 0x03213, + pieupcieuckorean = 0x03176, + pieupcirclekorean = 0x03265, + pieupkiyeokkorean = 0x03172, + pieupkorean = 0x03142, + pieupparenkorean = 0x03205, + pieupsioskiyeokkorean = 0x03174, + pieupsioskorean = 0x03144, + pieupsiostikeutkorean = 0x03175, + pieupthieuthkorean = 0x03177, + pieuptikeutkorean = 0x03173, + pihiragana = 0x03074, + pikatakana = 0x030D4, + pisymbolgreek = 0x003D6, + piwrarmenian = 0x00583, + plus = 0x0002B, + plusbelowcmb = 0x0031F, + pluscircle = 0x02295, + plusminus = 0x000B1, + plusmod = 0x002D6, + plusmonospace = 0x0FF0B, + plussmall = 0x0FE62, + plussuperior = 0x0207A, + pmonospace = 0x0FF50, + pmsquare = 0x033D8, + pohiragana = 0x0307D, + pointingindexdownwhite = 0x0261F, + pointingindexleftwhite = 0x0261C, + pointingindexrightwhite = 0x0261E, + pointingindexupwhite = 0x0261D, + pokatakana = 0x030DD, + poplathai = 0x00E1B, + postalmark = 0x03012, + postalmarkface = 0x03020, + pparen = 0x024AB, + precedes = 0x0227A, + prescription = 0x0211E, + primemod = 0x002B9, + primereversed = 0x02035, + product = 0x0220F, + projective = 0x02305, + prolongedkana = 0x030FC, + propellor = 0x02318, + propersubset = 0x02282, + propersuperset = 0x02283, + proportion = 0x02237, + proportional = 0x0221D, + psi = 0x003C8, + psicyrillic = 0x00471, + psilipneumatacyrilliccmb = 0x00486, + pssquare = 0x033B0, + puhiragana = 0x03077, + pukatakana = 0x030D7, + pvsquare = 0x033B4, + pwsquare = 0x033BA, + q = 0x00071, + qadeva = 0x00958, + qadmahebrew = 0x005A8, + qafarabic = 0x00642, + qaffinalarabic = 0x0FED6, + qafinitialarabic = 0x0FED7, + qafmedialarabic = 0x0FED8, + qamats = 0x005B8, + qamats10 = 0x005B8, + qamats1a = 0x005B8, + qamats1c = 0x005B8, + qamats27 = 0x005B8, + qamats29 = 0x005B8, + qamats33 = 0x005B8, + qamatsde = 0x005B8, + qamatshebrew = 0x005B8, + qamatsnarrowhebrew = 0x005B8, + qamatsqatanhebrew = 0x005B8, + qamatsqatannarrowhebrew = 0x005B8, + qamatsqatanquarterhebrew = 0x005B8, + qamatsqatanwidehebrew = 0x005B8, + qamatsquarterhebrew = 0x005B8, + qamatswidehebrew = 0x005B8, + qarneyparahebrew = 0x0059F, + qbopomofo = 0x03111, + qcircle = 0x024E0, + qhook = 0x002A0, + qmonospace = 0x0FF51, + qof = 0x005E7, + qofdagesh = 0x0FB47, + qofdageshhebrew = 0x0FB47, + qofhatafpatah = 0x005E7, + qofhatafpatahhebrew = 0x005E7, + qofhatafsegol = 0x005E7, + qofhatafsegolhebrew = 0x005E7, + qofhebrew = 0x005E7, + qofhiriq = 0x005E7, + qofhiriqhebrew = 0x005E7, + qofholam = 0x005E7, + qofholamhebrew = 0x005E7, + qofpatah = 0x005E7, + qofpatahhebrew = 0x005E7, + qofqamats = 0x005E7, + qofqamatshebrew = 0x005E7, + qofqubuts = 0x005E7, + qofqubutshebrew = 0x005E7, + qofsegol = 0x005E7, + qofsegolhebrew = 0x005E7, + qofsheva = 0x005E7, + qofshevahebrew = 0x005E7, + qoftsere = 0x005E7, + qoftserehebrew = 0x005E7, + qparen = 0x024AC, + quarternote = 0x02669, + qubuts = 0x005BB, + qubuts18 = 0x005BB, + qubuts25 = 0x005BB, + qubuts31 = 0x005BB, + qubutshebrew = 0x005BB, + qubutsnarrowhebrew = 0x005BB, + qubutsquarterhebrew = 0x005BB, + qubutswidehebrew = 0x005BB, + question = 0x0003F, + questionarabic = 0x0061F, + questionarmenian = 0x0055E, + questiondown = 0x000BF, + questiongreek = 0x0037E, + questionmonospace = 0x0FF1F, + quotedbl = 0x00022, + quotedblbase = 0x0201E, + quotedblleft = 0x0201C, + quotedblmonospace = 0x0FF02, + quotedblprime = 0x0301E, + quotedblprimereversed = 0x0301D, + quotedblright = 0x0201D, + quoteleft = 0x02018, + quoteleftreversed = 0x0201B, + quotereversed = 0x0201B, + quoteright = 0x02019, + quoterightn = 0x00149, + quotesinglbase = 0x0201A, + quotesingle = 0x00027, + quotesinglemonospace = 0x0FF07, + r = 0x00072, + raarmenian = 0x0057C, + rabengali = 0x009B0, + racute = 0x00155, + radeva = 0x00930, + radical = 0x0221A, + radoverssquare = 0x033AE, + radoverssquaredsquare = 0x033AF, + radsquare = 0x033AD, + rafe = 0x005BF, + rafehebrew = 0x005BF, + ragujarati = 0x00AB0, + ragurmukhi = 0x00A30, + rahiragana = 0x03089, + rakatakana = 0x030E9, + rakatakanahalfwidth = 0x0FF97, + ralowerdiagonalbengali = 0x009F1, + ramiddlediagonalbengali = 0x009F0, + ramshorn = 0x00264, + ratio = 0x02236, + rbopomofo = 0x03116, + rcaron = 0x00159, + rcedilla = 0x00157, + rcircle = 0x024E1, + rcommaaccent = 0x00157, + rdblgrave = 0x00211, + rdotaccent = 0x01E59, + rdotbelow = 0x01E5B, + rdotbelowmacron = 0x01E5D, + referencemark = 0x0203B, + reflexsubset = 0x02286, + reflexsuperset = 0x02287, + registered = 0x000AE, + reharabic = 0x00631, + reharmenian = 0x00580, + rehfinalarabic = 0x0FEAE, + rehiragana = 0x0308C, + rehyehaleflamarabic = 0x00631, + rekatakana = 0x030EC, + rekatakanahalfwidth = 0x0FF9A, + resh = 0x005E8, + reshdageshhebrew = 0x0FB48, + reshhatafpatah = 0x005E8, + reshhatafpatahhebrew = 0x005E8, + reshhatafsegol = 0x005E8, + reshhatafsegolhebrew = 0x005E8, + reshhebrew = 0x005E8, + reshhiriq = 0x005E8, + reshhiriqhebrew = 0x005E8, + reshholam = 0x005E8, + reshholamhebrew = 0x005E8, + reshpatah = 0x005E8, + reshpatahhebrew = 0x005E8, + reshqamats = 0x005E8, + reshqamatshebrew = 0x005E8, + reshqubuts = 0x005E8, + reshqubutshebrew = 0x005E8, + reshsegol = 0x005E8, + reshsegolhebrew = 0x005E8, + reshsheva = 0x005E8, + reshshevahebrew = 0x005E8, + reshtsere = 0x005E8, + reshtserehebrew = 0x005E8, + reversedtilde = 0x0223D, + reviahebrew = 0x00597, + reviamugrashhebrew = 0x00597, + revlogicalnot = 0x02310, + rfishhook = 0x0027E, + rfishhookreversed = 0x0027F, + rhabengali = 0x009DD, + rhadeva = 0x0095D, + rho = 0x003C1, + rhook = 0x0027D, + rhookturned = 0x0027B, + rhookturnedsuperior = 0x002B5, + rhosymbolgreek = 0x003F1, + rhotichookmod = 0x002DE, + rieulacirclekorean = 0x03271, + rieulaparenkorean = 0x03211, + rieulcirclekorean = 0x03263, + rieulhieuhkorean = 0x03140, + rieulkiyeokkorean = 0x0313A, + rieulkiyeoksioskorean = 0x03169, + rieulkorean = 0x03139, + rieulmieumkorean = 0x0313B, + rieulpansioskorean = 0x0316C, + rieulparenkorean = 0x03203, + rieulphieuphkorean = 0x0313F, + rieulpieupkorean = 0x0313C, + rieulpieupsioskorean = 0x0316B, + rieulsioskorean = 0x0313D, + rieulthieuthkorean = 0x0313E, + rieultikeutkorean = 0x0316A, + rieulyeorinhieuhkorean = 0x0316D, + rightangle = 0x0221F, + righttackbelowcmb = 0x00319, + righttriangle = 0x022BF, + rihiragana = 0x0308A, + rikatakana = 0x030EA, + rikatakanahalfwidth = 0x0FF98, + ring = 0x002DA, + ringbelowcmb = 0x00325, + ringcmb = 0x0030A, + ringhalfleft = 0x002BF, + ringhalfleftarmenian = 0x00559, + ringhalfleftbelowcmb = 0x0031C, + ringhalfleftcentered = 0x002D3, + ringhalfright = 0x002BE, + ringhalfrightbelowcmb = 0x00339, + ringhalfrightcentered = 0x002D2, + rinvertedbreve = 0x00213, + rittorusquare = 0x03351, + rlinebelow = 0x01E5F, + rlongleg = 0x0027C, + rlonglegturned = 0x0027A, + rmonospace = 0x0FF52, + rohiragana = 0x0308D, + rokatakana = 0x030ED, + rokatakanahalfwidth = 0x0FF9B, + roruathai = 0x00E23, + rparen = 0x024AD, + rrabengali = 0x009DC, + rradeva = 0x00931, + rragurmukhi = 0x00A5C, + rreharabic = 0x00691, + rrehfinalarabic = 0x0FB8D, + rrvocalicbengali = 0x009E0, + rrvocalicdeva = 0x00960, + rrvocalicgujarati = 0x00AE0, + rrvocalicvowelsignbengali = 0x009C4, + rrvocalicvowelsigndeva = 0x00944, + rrvocalicvowelsigngujarati = 0x00AC4, + rtblock = 0x02590, + rturned = 0x00279, + rturnedsuperior = 0x002B4, + ruhiragana = 0x0308B, + rukatakana = 0x030EB, + rukatakanahalfwidth = 0x0FF99, + rupeemarkbengali = 0x009F2, + rupeesignbengali = 0x009F3, + ruthai = 0x00E24, + rvocalicbengali = 0x0098B, + rvocalicdeva = 0x0090B, + rvocalicgujarati = 0x00A8B, + rvocalicvowelsignbengali = 0x009C3, + rvocalicvowelsigndeva = 0x00943, + rvocalicvowelsigngujarati = 0x00AC3, + s = 0x00073, + sabengali = 0x009B8, + sacute = 0x0015B, + sacutedotaccent = 0x01E65, + sadarabic = 0x00635, + sadeva = 0x00938, + sadfinalarabic = 0x0FEBA, + sadinitialarabic = 0x0FEBB, + sadmedialarabic = 0x0FEBC, + sagujarati = 0x00AB8, + sagurmukhi = 0x00A38, + sahiragana = 0x03055, + sakatakana = 0x030B5, + sakatakanahalfwidth = 0x0FF7B, + sallallahoualayhewasallamarabic = 0x0FDFA, + samekh = 0x005E1, + samekhdagesh = 0x0FB41, + samekhdageshhebrew = 0x0FB41, + samekhhebrew = 0x005E1, + saraaathai = 0x00E32, + saraaethai = 0x00E41, + saraaimaimalaithai = 0x00E44, + saraaimaimuanthai = 0x00E43, + saraamthai = 0x00E33, + saraathai = 0x00E30, + saraethai = 0x00E40, + saraiithai = 0x00E35, + saraithai = 0x00E34, + saraothai = 0x00E42, + saraueethai = 0x00E37, + sarauethai = 0x00E36, + sarauthai = 0x00E38, + sarauuthai = 0x00E39, + sbopomofo = 0x03119, + scaron = 0x00161, + scarondotaccent = 0x01E67, + scedilla = 0x0015F, + schwa = 0x00259, + schwacyrillic = 0x004D9, + schwadieresiscyrillic = 0x004DB, + schwahook = 0x0025A, + scircle = 0x024E2, + scircumflex = 0x0015D, + scommaaccent = 0x00219, + sdotaccent = 0x01E61, + sdotbelow = 0x01E63, + sdotbelowdotaccent = 0x01E69, + seagullbelowcmb = 0x0033C, + second = 0x02033, + secondtonechinese = 0x002CA, + section = 0x000A7, + seenarabic = 0x00633, + seenfinalarabic = 0x0FEB2, + seeninitialarabic = 0x0FEB3, + seenmedialarabic = 0x0FEB4, + segol = 0x005B6, + segol13 = 0x005B6, + segol1f = 0x005B6, + segol2c = 0x005B6, + segolhebrew = 0x005B6, + segolnarrowhebrew = 0x005B6, + segolquarterhebrew = 0x005B6, + segoltahebrew = 0x00592, + segolwidehebrew = 0x005B6, + seharmenian = 0x0057D, + sehiragana = 0x0305B, + sekatakana = 0x030BB, + sekatakanahalfwidth = 0x0FF7E, + semicolon = 0x0003B, + semicolonarabic = 0x0061B, + semicolonmonospace = 0x0FF1B, + semicolonsmall = 0x0FE54, + semivoicedmarkkana = 0x0309C, + semivoicedmarkkanahalfwidth = 0x0FF9F, + sentisquare = 0x03322, + sentosquare = 0x03323, + seven = 0x00037, + sevenarabic = 0x00667, + sevenbengali = 0x009ED, + sevencircle = 0x02466, + sevencircleinversesansserif = 0x02790, + sevendeva = 0x0096D, + seveneighths = 0x0215E, + sevengujarati = 0x00AED, + sevengurmukhi = 0x00A6D, + sevenhackarabic = 0x00667, + sevenhangzhou = 0x03027, + sevenideographicparen = 0x03226, + seveninferior = 0x02087, + sevenmonospace = 0x0FF17, + sevenoldstyle = 0x00037, + sevenparen = 0x0247A, + sevenperiod = 0x0248E, + sevenpersian = 0x006F7, + sevenroman = 0x02176, + sevensuperior = 0x02077, + seventeencircle = 0x02470, + seventeenparen = 0x02484, + seventeenperiod = 0x02498, + seventhai = 0x00E57, + sfthyphen = 0x000AD, + shaarmenian = 0x00577, + shabengali = 0x009B6, + shacyrillic = 0x00448, + shaddaarabic = 0x00651, + shaddadammaarabic = 0x0FC61, + shaddadammatanarabic = 0x0FC5E, + shaddafathaarabic = 0x0FC60, + shaddafathatanarabic = 0x00651, + shaddakasraarabic = 0x0FC62, + shaddakasratanarabic = 0x0FC5F, + shade = 0x02592, + shadedark = 0x02593, + shadelight = 0x02591, + shademedium = 0x02592, + shadeva = 0x00936, + shagujarati = 0x00AB6, + shagurmukhi = 0x00A36, + shalshelethebrew = 0x00593, + shbopomofo = 0x03115, + shchacyrillic = 0x00449, + sheenarabic = 0x00634, + sheenfinalarabic = 0x0FEB6, + sheeninitialarabic = 0x0FEB7, + sheenmedialarabic = 0x0FEB8, + sheicoptic = 0x003E3, + sheqel = 0x020AA, + sheqelhebrew = 0x020AA, + sheva = 0x005B0, + sheva115 = 0x005B0, + sheva15 = 0x005B0, + sheva22 = 0x005B0, + sheva2e = 0x005B0, + shevahebrew = 0x005B0, + shevanarrowhebrew = 0x005B0, + shevaquarterhebrew = 0x005B0, + shevawidehebrew = 0x005B0, + shhacyrillic = 0x004BB, + shimacoptic = 0x003ED, + shin = 0x005E9, + shindagesh = 0x0FB49, + shindageshhebrew = 0x0FB49, + shindageshshindot = 0x0FB2C, + shindageshshindothebrew = 0x0FB2C, + shindageshsindot = 0x0FB2D, + shindageshsindothebrew = 0x0FB2D, + shindothebrew = 0x005C1, + shinhebrew = 0x005E9, + shinshindot = 0x0FB2A, + shinshindothebrew = 0x0FB2A, + shinsindot = 0x0FB2B, + shinsindothebrew = 0x0FB2B, + shook = 0x00282, + sigma = 0x003C3, + sigma1 = 0x003C2, + sigmafinal = 0x003C2, + sigmalunatesymbolgreek = 0x003F2, + sihiragana = 0x03057, + sikatakana = 0x030B7, + sikatakanahalfwidth = 0x0FF7C, + siluqhebrew = 0x005BD, + siluqlefthebrew = 0x005BD, + similar = 0x0223C, + sindothebrew = 0x005C2, + siosacirclekorean = 0x03274, + siosaparenkorean = 0x03214, + sioscieuckorean = 0x0317E, + sioscirclekorean = 0x03266, + sioskiyeokkorean = 0x0317A, + sioskorean = 0x03145, + siosnieunkorean = 0x0317B, + siosparenkorean = 0x03206, + siospieupkorean = 0x0317D, + siostikeutkorean = 0x0317C, + six = 0x00036, + sixarabic = 0x00666, + sixbengali = 0x009EC, + sixcircle = 0x02465, + sixcircleinversesansserif = 0x0278F, + sixdeva = 0x0096C, + sixgujarati = 0x00AEC, + sixgurmukhi = 0x00A6C, + sixhackarabic = 0x00666, + sixhangzhou = 0x03026, + sixideographicparen = 0x03225, + sixinferior = 0x02086, + sixmonospace = 0x0FF16, + sixoldstyle = 0x00036, + sixparen = 0x02479, + sixperiod = 0x0248D, + sixpersian = 0x006F6, + sixroman = 0x02175, + sixsuperior = 0x02076, + sixteencircle = 0x0246F, + sixteencurrencydenominatorbengali = 0x009F9, + sixteenparen = 0x02483, + sixteenperiod = 0x02497, + sixthai = 0x00E56, + slash = 0x0002F, + slashmonospace = 0x0FF0F, + slong = 0x0017F, + slongdotaccent = 0x01E9B, + smileface = 0x0263A, + smonospace = 0x0FF53, + sofpasuqhebrew = 0x005C3, + softhyphen = 0x000AD, + softsigncyrillic = 0x0044C, + sohiragana = 0x0305D, + sokatakana = 0x030BD, + sokatakanahalfwidth = 0x0FF7F, + soliduslongoverlaycmb = 0x00338, + solidusshortoverlaycmb = 0x00337, + sorusithai = 0x00E29, + sosalathai = 0x00E28, + sosothai = 0x00E0B, + sosuathai = 0x00E2A, + space = 0x00020, + spacehackarabic = 0x00020, + spade = 0x02660, + spadesuitblack = 0x02660, + spadesuitwhite = 0x02664, + sparen = 0x024AE, + squarebelowcmb = 0x0033B, + squarecc = 0x033C4, + squarecm = 0x0339D, + squarediagonalcrosshatchfill = 0x025A9, + squarehorizontalfill = 0x025A4, + squarekg = 0x0338F, + squarekm = 0x0339E, + squarekmcapital = 0x033CE, + squareln = 0x033D1, + squarelog = 0x033D2, + squaremg = 0x0338E, + squaremil = 0x033D5, + squaremm = 0x0339C, + squaremsquared = 0x033A1, + squareorthogonalcrosshatchfill = 0x025A6, + squareupperlefttolowerrightfill = 0x025A7, + squareupperrighttolowerleftfill = 0x025A8, + squareverticalfill = 0x025A5, + squarewhitewithsmallblack = 0x025A3, + srsquare = 0x033DB, + ssabengali = 0x009B7, + ssadeva = 0x00937, + ssagujarati = 0x00AB7, + ssangcieuckorean = 0x03149, + ssanghieuhkorean = 0x03185, + ssangieungkorean = 0x03180, + ssangkiyeokkorean = 0x03132, + ssangnieunkorean = 0x03165, + ssangpieupkorean = 0x03143, + ssangsioskorean = 0x03146, + ssangtikeutkorean = 0x03138, + sterling = 0x000A3, + sterlingmonospace = 0x0FFE1, + strokelongoverlaycmb = 0x00336, + strokeshortoverlaycmb = 0x00335, + subset = 0x02282, + subsetnotequal = 0x0228A, + subsetorequal = 0x02286, + succeeds = 0x0227B, + suchthat = 0x0220B, + suhiragana = 0x03059, + sukatakana = 0x030B9, + sukatakanahalfwidth = 0x0FF7D, + sukunarabic = 0x00652, + summation = 0x02211, + sun = 0x0263C, + superset = 0x02283, + supersetnotequal = 0x0228B, + supersetorequal = 0x02287, + svsquare = 0x033DC, + syouwaerasquare = 0x0337C, + t = 0x00074, + tabengali = 0x009A4, + tackdown = 0x022A4, + tackleft = 0x022A3, + tadeva = 0x00924, + tagujarati = 0x00AA4, + tagurmukhi = 0x00A24, + taharabic = 0x00637, + tahfinalarabic = 0x0FEC2, + tahinitialarabic = 0x0FEC3, + tahiragana = 0x0305F, + tahmedialarabic = 0x0FEC4, + taisyouerasquare = 0x0337D, + takatakana = 0x030BF, + takatakanahalfwidth = 0x0FF80, + tatweelarabic = 0x00640, + tau = 0x003C4, + tav = 0x005EA, + tavdages = 0x0FB4A, + tavdagesh = 0x0FB4A, + tavdageshhebrew = 0x0FB4A, + tavhebrew = 0x005EA, + tbar = 0x00167, + tbopomofo = 0x0310A, + tcaron = 0x00165, + tccurl = 0x002A8, + tcedilla = 0x00163, + tcheharabic = 0x00686, + tchehfinalarabic = 0x0FB7B, + tchehinitialarabic = 0x0FB7C, + tchehmedialarabic = 0x0FB7D, + tchehmeeminitialarabic = 0x0FB7C, + tcircle = 0x024E3, + tcircumflexbelow = 0x01E71, + tcommaaccent = 0x00163, + tdieresis = 0x01E97, + tdotaccent = 0x01E6B, + tdotbelow = 0x01E6D, + tecyrillic = 0x00442, + tedescendercyrillic = 0x004AD, + teharabic = 0x0062A, + tehfinalarabic = 0x0FE96, + tehhahinitialarabic = 0x0FCA2, + tehhahisolatedarabic = 0x0FC0C, + tehinitialarabic = 0x0FE97, + tehiragana = 0x03066, + tehjeeminitialarabic = 0x0FCA1, + tehjeemisolatedarabic = 0x0FC0B, + tehmarbutaarabic = 0x00629, + tehmarbutafinalarabic = 0x0FE94, + tehmedialarabic = 0x0FE98, + tehmeeminitialarabic = 0x0FCA4, + tehmeemisolatedarabic = 0x0FC0E, + tehnoonfinalarabic = 0x0FC73, + tekatakana = 0x030C6, + tekatakanahalfwidth = 0x0FF83, + telephone = 0x02121, + telephoneblack = 0x0260E, + telishagedolahebrew = 0x005A0, + telishaqetanahebrew = 0x005A9, + tencircle = 0x02469, + tenideographicparen = 0x03229, + tenparen = 0x0247D, + tenperiod = 0x02491, + tenroman = 0x02179, + tesh = 0x002A7, + tet = 0x005D8, + tetdagesh = 0x0FB38, + tetdageshhebrew = 0x0FB38, + tethebrew = 0x005D8, + tetsecyrillic = 0x004B5, + tevirhebrew = 0x0059B, + tevirlefthebrew = 0x0059B, + thabengali = 0x009A5, + thadeva = 0x00925, + thagujarati = 0x00AA5, + thagurmukhi = 0x00A25, + thalarabic = 0x00630, + thalfinalarabic = 0x0FEAC, + thanthakhatthai = 0x00E4C, + theharabic = 0x0062B, + thehfinalarabic = 0x0FE9A, + thehinitialarabic = 0x0FE9B, + thehmedialarabic = 0x0FE9C, + thereexists = 0x02203, + therefore = 0x02234, + theta = 0x003B8, + theta1 = 0x003D1, + thetasymbolgreek = 0x003D1, + thieuthacirclekorean = 0x03279, + thieuthaparenkorean = 0x03219, + thieuthcirclekorean = 0x0326B, + thieuthkorean = 0x0314C, + thieuthparenkorean = 0x0320B, + thirteencircle = 0x0246C, + thirteenparen = 0x02480, + thirteenperiod = 0x02494, + thonangmonthothai = 0x00E11, + thook = 0x001AD, + thophuthaothai = 0x00E12, + thorn = 0x000FE, + thothahanthai = 0x00E17, + thothanthai = 0x00E10, + thothongthai = 0x00E18, + thothungthai = 0x00E16, + thousandcyrillic = 0x00482, + thousandsseparatorarabic = 0x0066C, + thousandsseparatorpersian = 0x0066C, + three = 0x00033, + threearabic = 0x00663, + threebengali = 0x009E9, + threecircle = 0x02462, + threecircleinversesansserif = 0x0278C, + threedeva = 0x00969, + threeeighths = 0x0215C, + threegujarati = 0x00AE9, + threegurmukhi = 0x00A69, + threehackarabic = 0x00663, + threehangzhou = 0x03023, + threeideographicparen = 0x03222, + threeinferior = 0x02083, + threemonospace = 0x0FF13, + threenumeratorbengali = 0x009F6, + threeoldstyle = 0x00033, + threeparen = 0x02476, + threeperiod = 0x0248A, + threepersian = 0x006F3, + threequarters = 0x000BE, + threeroman = 0x02172, + threesuperior = 0x000B3, + threethai = 0x00E53, + thzsquare = 0x03394, + tihiragana = 0x03061, + tikatakana = 0x030C1, + tikatakanahalfwidth = 0x0FF81, + tikeutacirclekorean = 0x03270, + tikeutaparenkorean = 0x03210, + tikeutcirclekorean = 0x03262, + tikeutkorean = 0x03137, + tikeutparenkorean = 0x03202, + tilde = 0x002DC, + tildebelowcmb = 0x00330, + tildecmb = 0x00303, + tildecomb = 0x00303, + tildedoublecmb = 0x00360, + tildeoperator = 0x0223C, + tildeoverlaycmb = 0x00334, + tildeverticalcmb = 0x0033E, + timescircle = 0x02297, + tipehahebrew = 0x00596, + tipehalefthebrew = 0x00596, + tippigurmukhi = 0x00A70, + titlocyrilliccmb = 0x00483, + tiwnarmenian = 0x0057F, + tlinebelow = 0x01E6F, + tmonospace = 0x0FF54, + toarmenian = 0x00569, + tohiragana = 0x03068, + tokatakana = 0x030C8, + tokatakanahalfwidth = 0x0FF84, + tonebarextrahighmod = 0x002E5, + tonebarextralowmod = 0x002E9, + tonebarhighmod = 0x002E6, + tonebarlowmod = 0x002E8, + tonebarmidmod = 0x002E7, + tonefive = 0x001BD, + tonesix = 0x00185, + tonetwo = 0x001A8, + tonos = 0x00384, + tonsquare = 0x03327, + topatakthai = 0x00E0F, + tortoiseshellbracketleft = 0x03014, + tortoiseshellbracketleftsmall = 0x0FE5D, + tortoiseshellbracketleftvertical = 0x0FE39, + tortoiseshellbracketright = 0x03015, + tortoiseshellbracketrightsmall = 0x0FE5E, + tortoiseshellbracketrightvertical = 0x0FE3A, + totaothai = 0x00E15, + tpalatalhook = 0x001AB, + tparen = 0x024AF, + trademark = 0x02122, + tretroflexhook = 0x00288, + triagdn = 0x025BC, + triaglf = 0x025C4, + triagrt = 0x025BA, + triagup = 0x025B2, + ts = 0x002A6, + tsadi = 0x005E6, + tsadidagesh = 0x0FB46, + tsadidageshhebrew = 0x0FB46, + tsadihebrew = 0x005E6, + tsecyrillic = 0x00446, + tsere = 0x005B5, + tsere12 = 0x005B5, + tsere1e = 0x005B5, + tsere2b = 0x005B5, + tserehebrew = 0x005B5, + tserenarrowhebrew = 0x005B5, + tserequarterhebrew = 0x005B5, + tserewidehebrew = 0x005B5, + tshecyrillic = 0x0045B, + ttabengali = 0x0099F, + ttadeva = 0x0091F, + ttagujarati = 0x00A9F, + ttagurmukhi = 0x00A1F, + tteharabic = 0x00679, + ttehfinalarabic = 0x0FB67, + ttehinitialarabic = 0x0FB68, + ttehmedialarabic = 0x0FB69, + tthabengali = 0x009A0, + tthadeva = 0x00920, + tthagujarati = 0x00AA0, + tthagurmukhi = 0x00A20, + tturned = 0x00287, + tuhiragana = 0x03064, + tukatakana = 0x030C4, + tukatakanahalfwidth = 0x0FF82, + tusmallhiragana = 0x03063, + tusmallkatakana = 0x030C3, + tusmallkatakanahalfwidth = 0x0FF6F, + twelvecircle = 0x0246B, + twelveparen = 0x0247F, + twelveperiod = 0x02493, + twelveroman = 0x0217B, + twentycircle = 0x02473, + twentyparen = 0x02487, + twentyperiod = 0x0249B, + two = 0x00032, + twoarabic = 0x00662, + twobengali = 0x009E8, + twocircle = 0x02461, + twocircleinversesansserif = 0x0278B, + twodeva = 0x00968, + twodotenleader = 0x02025, + twodotleader = 0x02025, + twodotleadervertical = 0x0FE30, + twogujarati = 0x00AE8, + twogurmukhi = 0x00A68, + twohackarabic = 0x00662, + twohangzhou = 0x03022, + twoideographicparen = 0x03221, + twoinferior = 0x02082, + twomonospace = 0x0FF12, + twonumeratorbengali = 0x009F5, + twooldstyle = 0x00032, + twoparen = 0x02475, + twoperiod = 0x02489, + twopersian = 0x006F2, + tworoman = 0x02171, + twostroke = 0x001BB, + twosuperior = 0x000B2, + twothai = 0x00E52, + twothirds = 0x02154, + u = 0x00075, + uacute = 0x000FA, + ubar = 0x00289, + ubengali = 0x00989, + ubopomofo = 0x03128, + ubreve = 0x0016D, + ucaron = 0x001D4, + ucircle = 0x024E4, + ucircumflex = 0x000FB, + ucircumflexbelow = 0x01E77, + ucyrillic = 0x00443, + udattadeva = 0x00951, + udblacute = 0x00171, + udblgrave = 0x00215, + udeva = 0x00909, + udieresis = 0x000FC, + udieresisacute = 0x001D8, + udieresisbelow = 0x01E73, + udieresiscaron = 0x001DA, + udieresiscyrillic = 0x004F1, + udieresisgrave = 0x001DC, + udieresismacron = 0x001D6, + udotbelow = 0x01EE5, + ugrave = 0x000F9, + ugujarati = 0x00A89, + ugurmukhi = 0x00A09, + uhiragana = 0x03046, + uhookabove = 0x01EE7, + uhorn = 0x001B0, + uhornacute = 0x01EE9, + uhorndotbelow = 0x01EF1, + uhorngrave = 0x01EEB, + uhornhookabove = 0x01EED, + uhorntilde = 0x01EEF, + uhungarumlaut = 0x00171, + uhungarumlautcyrillic = 0x004F3, + uinvertedbreve = 0x00217, + ukatakana = 0x030A6, + ukatakanahalfwidth = 0x0FF73, + ukcyrillic = 0x00479, + ukorean = 0x0315C, + umacron = 0x0016B, + umacroncyrillic = 0x004EF, + umacrondieresis = 0x01E7B, + umatragurmukhi = 0x00A41, + umonospace = 0x0FF55, + underscore = 0x0005F, + underscoredbl = 0x02017, + underscoremonospace = 0x0FF3F, + underscorevertical = 0x0FE33, + underscorewavy = 0x0FE4F, + union = 0x0222A, + universal = 0x02200, + uogonek = 0x00173, + uparen = 0x024B0, + upblock = 0x02580, + upperdothebrew = 0x005C4, + upsilon = 0x003C5, + upsilondieresis = 0x003CB, + upsilondieresistonos = 0x003B0, + upsilonlatin = 0x0028A, + upsilontonos = 0x003CD, + uptackbelowcmb = 0x0031D, + uptackmod = 0x002D4, + uragurmukhi = 0x00A73, + uring = 0x0016F, + ushortcyrillic = 0x0045E, + usmallhiragana = 0x03045, + usmallkatakana = 0x030A5, + usmallkatakanahalfwidth = 0x0FF69, + ustraightcyrillic = 0x004AF, + ustraightstrokecyrillic = 0x004B1, + utilde = 0x00169, + utildeacute = 0x01E79, + utildebelow = 0x01E75, + uubengali = 0x0098A, + uudeva = 0x0090A, + uugujarati = 0x00A8A, + uugurmukhi = 0x00A0A, + uumatragurmukhi = 0x00A42, + uuvowelsignbengali = 0x009C2, + uuvowelsigndeva = 0x00942, + uuvowelsigngujarati = 0x00AC2, + uvowelsignbengali = 0x009C1, + uvowelsigndeva = 0x00941, + uvowelsigngujarati = 0x00AC1, + v = 0x00076, + vadeva = 0x00935, + vagujarati = 0x00AB5, + vagurmukhi = 0x00A35, + vakatakana = 0x030F7, + vav = 0x005D5, + vavdagesh = 0x0FB35, + vavdagesh65 = 0x0FB35, + vavdageshhebrew = 0x0FB35, + vavhebrew = 0x005D5, + vavholam = 0x0FB4B, + vavholamhebrew = 0x0FB4B, + vavvavhebrew = 0x005F0, + vavyodhebrew = 0x005F1, + vcircle = 0x024E5, + vdotbelow = 0x01E7F, + vecyrillic = 0x00432, + veharabic = 0x006A4, + vehfinalarabic = 0x0FB6B, + vehinitialarabic = 0x0FB6C, + vehmedialarabic = 0x0FB6D, + vekatakana = 0x030F9, + venus = 0x02640, + verticalbar = 0x0007C, + verticallineabovecmb = 0x0030D, + verticallinebelowcmb = 0x00329, + verticallinelowmod = 0x002CC, + verticallinemod = 0x002C8, + vewarmenian = 0x0057E, + vhook = 0x0028B, + vikatakana = 0x030F8, + viramabengali = 0x009CD, + viramadeva = 0x0094D, + viramagujarati = 0x00ACD, + visargabengali = 0x00983, + visargadeva = 0x00903, + visargagujarati = 0x00A83, + vmonospace = 0x0FF56, + voarmenian = 0x00578, + voicediterationhiragana = 0x0309E, + voicediterationkatakana = 0x030FE, + voicedmarkkana = 0x0309B, + voicedmarkkanahalfwidth = 0x0FF9E, + vokatakana = 0x030FA, + vparen = 0x024B1, + vtilde = 0x01E7D, + vturned = 0x0028C, + vuhiragana = 0x03094, + vukatakana = 0x030F4, + w = 0x00077, + wacute = 0x01E83, + waekorean = 0x03159, + wahiragana = 0x0308F, + wakatakana = 0x030EF, + wakatakanahalfwidth = 0x0FF9C, + wakorean = 0x03158, + wasmallhiragana = 0x0308E, + wasmallkatakana = 0x030EE, + wattosquare = 0x03357, + wavedash = 0x0301C, + wavyunderscorevertical = 0x0FE34, + wawarabic = 0x00648, + wawfinalarabic = 0x0FEEE, + wawhamzaabovearabic = 0x00624, + wawhamzaabovefinalarabic = 0x0FE86, + wbsquare = 0x033DD, + wcircle = 0x024E6, + wcircumflex = 0x00175, + wdieresis = 0x01E85, + wdotaccent = 0x01E87, + wdotbelow = 0x01E89, + wehiragana = 0x03091, + weierstrass = 0x02118, + wekatakana = 0x030F1, + wekorean = 0x0315E, + weokorean = 0x0315D, + wgrave = 0x01E81, + whitebullet = 0x025E6, + whitecircle = 0x025CB, + whitecircleinverse = 0x025D9, + whitecornerbracketleft = 0x0300E, + whitecornerbracketleftvertical = 0x0FE43, + whitecornerbracketright = 0x0300F, + whitecornerbracketrightvertical = 0x0FE44, + whitediamond = 0x025C7, + whitediamondcontainingblacksmalldiamond = 0x025C8, + whitedownpointingsmalltriangle = 0x025BF, + whitedownpointingtriangle = 0x025BD, + whiteleftpointingsmalltriangle = 0x025C3, + whiteleftpointingtriangle = 0x025C1, + whitelenticularbracketleft = 0x03016, + whitelenticularbracketright = 0x03017, + whiterightpointingsmalltriangle = 0x025B9, + whiterightpointingtriangle = 0x025B7, + whitesmallsquare = 0x025AB, + whitesmilingface = 0x0263A, + whitesquare = 0x025A1, + whitestar = 0x02606, + whitetelephone = 0x0260F, + whitetortoiseshellbracketleft = 0x03018, + whitetortoiseshellbracketright = 0x03019, + whiteuppointingsmalltriangle = 0x025B5, + whiteuppointingtriangle = 0x025B3, + wihiragana = 0x03090, + wikatakana = 0x030F0, + wikorean = 0x0315F, + wmonospace = 0x0FF57, + wohiragana = 0x03092, + wokatakana = 0x030F2, + wokatakanahalfwidth = 0x0FF66, + won = 0x020A9, + wonmonospace = 0x0FFE6, + wowaenthai = 0x00E27, + wparen = 0x024B2, + wring = 0x01E98, + wsuperior = 0x002B7, + wturned = 0x0028D, + wynn = 0x001BF, + x = 0x00078, + xabovecmb = 0x0033D, + xbopomofo = 0x03112, + xcircle = 0x024E7, + xdieresis = 0x01E8D, + xdotaccent = 0x01E8B, + xeharmenian = 0x0056D, + xi = 0x003BE, + xmonospace = 0x0FF58, + xparen = 0x024B3, + xsuperior = 0x002E3, + y = 0x00079, + yaadosquare = 0x0334E, + yabengali = 0x009AF, + yacute = 0x000FD, + yadeva = 0x0092F, + yaekorean = 0x03152, + yagujarati = 0x00AAF, + yagurmukhi = 0x00A2F, + yahiragana = 0x03084, + yakatakana = 0x030E4, + yakatakanahalfwidth = 0x0FF94, + yakorean = 0x03151, + yamakkanthai = 0x00E4E, + yasmallhiragana = 0x03083, + yasmallkatakana = 0x030E3, + yasmallkatakanahalfwidth = 0x0FF6C, + yatcyrillic = 0x00463, + ycircle = 0x024E8, + ycircumflex = 0x00177, + ydieresis = 0x000FF, + ydotaccent = 0x01E8F, + ydotbelow = 0x01EF5, + yeharabic = 0x0064A, + yehbarreearabic = 0x006D2, + yehbarreefinalarabic = 0x0FBAF, + yehfinalarabic = 0x0FEF2, + yehhamzaabovearabic = 0x00626, + yehhamzaabovefinalarabic = 0x0FE8A, + yehhamzaaboveinitialarabic = 0x0FE8B, + yehhamzaabovemedialarabic = 0x0FE8C, + yehinitialarabic = 0x0FEF3, + yehmedialarabic = 0x0FEF4, + yehmeeminitialarabic = 0x0FCDD, + yehmeemisolatedarabic = 0x0FC58, + yehnoonfinalarabic = 0x0FC94, + yehthreedotsbelowarabic = 0x006D1, + yekorean = 0x03156, + yen = 0x000A5, + yenmonospace = 0x0FFE5, + yeokorean = 0x03155, + yeorinhieuhkorean = 0x03186, + yerahbenyomohebrew = 0x005AA, + yerahbenyomolefthebrew = 0x005AA, + yericyrillic = 0x0044B, + yerudieresiscyrillic = 0x004F9, + yesieungkorean = 0x03181, + yesieungpansioskorean = 0x03183, + yesieungsioskorean = 0x03182, + yetivhebrew = 0x0059A, + ygrave = 0x01EF3, + yhook = 0x001B4, + yhookabove = 0x01EF7, + yiarmenian = 0x00575, + yicyrillic = 0x00457, + yikorean = 0x03162, + yinyang = 0x0262F, + yiwnarmenian = 0x00582, + ymonospace = 0x0FF59, + yod = 0x005D9, + yoddagesh = 0x0FB39, + yoddageshhebrew = 0x0FB39, + yodhebrew = 0x005D9, + yodyodhebrew = 0x005F2, + yodyodpatahhebrew = 0x0FB1F, + yohiragana = 0x03088, + yoikorean = 0x03189, + yokatakana = 0x030E8, + yokatakanahalfwidth = 0x0FF96, + yokorean = 0x0315B, + yosmallhiragana = 0x03087, + yosmallkatakana = 0x030E7, + yosmallkatakanahalfwidth = 0x0FF6E, + yotgreek = 0x003F3, + yoyaekorean = 0x03188, + yoyakorean = 0x03187, + yoyakthai = 0x00E22, + yoyingthai = 0x00E0D, + yparen = 0x024B4, + ypogegrammeni = 0x0037A, + ypogegrammenigreekcmb = 0x00345, + yr = 0x001A6, + yring = 0x01E99, + ysuperior = 0x002B8, + ytilde = 0x01EF9, + yturned = 0x0028E, + yuhiragana = 0x03086, + yuikorean = 0x0318C, + yukatakana = 0x030E6, + yukatakanahalfwidth = 0x0FF95, + yukorean = 0x03160, + yusbigcyrillic = 0x0046B, + yusbigiotifiedcyrillic = 0x0046D, + yuslittlecyrillic = 0x00467, + yuslittleiotifiedcyrillic = 0x00469, + yusmallhiragana = 0x03085, + yusmallkatakana = 0x030E5, + yusmallkatakanahalfwidth = 0x0FF6D, + yuyekorean = 0x0318B, + yuyeokorean = 0x0318A, + yyabengali = 0x009DF, + yyadeva = 0x0095F, + z = 0x0007A, + zaarmenian = 0x00566, + zacute = 0x0017A, + zadeva = 0x0095B, + zagurmukhi = 0x00A5B, + zaharabic = 0x00638, + zahfinalarabic = 0x0FEC6, + zahinitialarabic = 0x0FEC7, + zahiragana = 0x03056, + zahmedialarabic = 0x0FEC8, + zainarabic = 0x00632, + zainfinalarabic = 0x0FEB0, + zakatakana = 0x030B6, + zaqefgadolhebrew = 0x00595, + zaqefqatanhebrew = 0x00594, + zarqahebrew = 0x00598, + zayin = 0x005D6, + zayindagesh = 0x0FB36, + zayindageshhebrew = 0x0FB36, + zayinhebrew = 0x005D6, + zbopomofo = 0x03117, + zcaron = 0x0017E, + zcircle = 0x024E9, + zcircumflex = 0x01E91, + zcurl = 0x00291, + zdot = 0x0017C, + zdotaccent = 0x0017C, + zdotbelow = 0x01E93, + zecyrillic = 0x00437, + zedescendercyrillic = 0x00499, + zedieresiscyrillic = 0x004DF, + zehiragana = 0x0305C, + zekatakana = 0x030BC, + zero = 0x00030, + zeroarabic = 0x00660, + zerobengali = 0x009E6, + zerodeva = 0x00966, + zerogujarati = 0x00AE6, + zerogurmukhi = 0x00A66, + zerohackarabic = 0x00660, + zeroinferior = 0x02080, + zeromonospace = 0x0FF10, + zerooldstyle = 0x00030, + zeropersian = 0x006F0, + zerosuperior = 0x02070, + zerothai = 0x00E50, + zerowidthjoiner = 0x0FEFF, + zerowidthnonjoiner = 0x0200C, + zerowidthspace = 0x0200B, + zeta = 0x003B6, + zhbopomofo = 0x03113, + zhearmenian = 0x0056A, + zhebrevecyrillic = 0x004C2, + zhecyrillic = 0x00436, + zhedescendercyrillic = 0x00497, + zhedieresiscyrillic = 0x004DD, + zihiragana = 0x03058, + zikatakana = 0x030B8, + zinorhebrew = 0x005AE, + zlinebelow = 0x01E95, + zmonospace = 0x0FF5A, + zohiragana = 0x0305E, + zokatakana = 0x030BE, + zparen = 0x024B5, + zretroflexhook = 0x00290, + zstroke = 0x001B6, + zuhiragana = 0x0305A, + zukatakana = 0x030BA, +} + local synonyms = allocate { Acyrillic = 0x0410, Becyrillic = 0x0411, @@ -655,7 +4772,7 @@ local extras = allocate { -- private extensions -- Well, we currently have this table preloaded anyway. local names = agl.names -local unicodes = agl.unicodes +----- unicodes = agl.unicodes local ctxcodes = agl.ctxcodes if names then @@ -667,15 +4784,15 @@ if names then elseif characters then names = allocate { } -- filled from char-def.lua - unicodes = allocate { } + -- unicodes = allocate { } ctxcodes = allocate { } for u, c in next, characters.data do - local a = c.adobename - if a then - unicodes[a] = u - names [u] = a - end + -- local a = c.adobename + -- if a then + -- -- unicodes[a] = u + -- names [u] = a + -- end local n = c.contextname if n then ctxcodes[n] = u @@ -685,30 +4802,36 @@ elseif characters then for a, u in next, extras do unicodes[a] = u - if not names[u] then - names[u] = a - end + -- if names[u] then + -- -- comment + -- -- print("dup extra",a,u) + -- else + -- names[u] = a + -- end end for s, u in next, synonyms do unicodes[s] = u - if not names[u] then - names[u] = s - end + -- if names[u] then + -- -- comment + -- -- print("dup synonym",s,u) + -- else + -- names[u] = s + -- end end if storage then - storage.register("encodings/names", names, "fonts.encodings.agl.names") + -- storage.register("encodings/names", names, "fonts.encodings.agl.names") storage.register("encodings/unicodes", unicodes, "fonts.encodings.agl.unicodes") storage.register("encodings/ctxcodes", ctxcodes, "fonts.encodings.agl.ctxcodes") end end -agl.names = names -- unicode -> name +---.names = names -- unicode -> name agl.unicodes = unicodes -- name -> unicode agl.ctxcodes = ctxcodes -- name -> unicode -agl.synonyms = synonyms -- merged into the other two -agl.extras = extras -- merged into the other two +agl.synonyms = synonyms -- merged into the other two -- used? +agl.extras = extras -- merged into the other two -- used? return agl diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-con.lua b/Master/texmf-dist/tex/context/base/mkiv/font-con.lua index 10f98ca1201..81fb08235a6 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-con.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-con.lua @@ -526,7 +526,6 @@ function constructors.scale(tfmdata,specification) local stackmath = not properties.nostackmath local haskerns = properties.haskerns or properties.mode == "base" -- we can have afm in node mode local hasligatures = properties.hasligatures or properties.mode == "base" -- we can have afm in node mode - local realdimensions = properties.realdimensions local writingmode = properties.writingmode or "horizontal" local identity = properties.identity or "horizontal" local vfonts = target.fonts @@ -651,13 +650,13 @@ function constructors.scale(tfmdata,specification) if changed then local c = changed[unicode] if c and c ~= unicode then - -- local cc = changed[c] - -- if cc then - -- while cc do - -- c = cc - -- cc = changed[c] - -- end - -- end + local cc = changed[c] + if cc then + while cc do + c = cc + cc = changed[c] + end + end -- check not needed: if c then description = descriptions[c] or descriptions[unicode] or character @@ -679,27 +678,6 @@ function constructors.scale(tfmdata,specification) local height = description.height local depth = description.depth local isunicode = description.unicode - if realdimensions then - -- this is mostly for checking issues - if not height or height == 0 then - local bb = description.boundingbox - local ht = bb[4] - if ht ~= 0 then - height = ht - end - if not depth or depth == 0 then - local dp = -bb[2] - if dp ~= 0 then - depth = dp - end - end - elseif not depth or depth == 0 then - local dp = -description.boundingbox[2] - if dp ~= 0 then - depth = dp - end - end - end if width then width = hdelta*width else width = scaledwidth end if height then height = vdelta*height else height = scaledheight end -- if depth then depth = vdelta*depth else depth = scaleddepth end diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua index f0f8e50cfcf..d1aeacc7265 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua @@ -1183,25 +1183,30 @@ local function chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nof rules = rules, } elseif subtype == 3 then + -- Maybe this one needs checking. Anyway zero current is bad. local before = readarray(f) local current = readarray(f) local after = readarray(f) local noflookups = readushort(f) - local lookups = readlookuparray(f,noflookups,#current) - before = readcoveragearray(f,tableoffset,before,true) - current = readcoveragearray(f,tableoffset,current,true) - after = readcoveragearray(f,tableoffset,after,true) - return { - format = "coverage", - rules = { - { - before = before, - current = current, - after = after, - lookups = lookups, + local lookups = current and readlookuparray(f,noflookups,#current) + if lookups then + before = readcoveragearray(f,tableoffset,before,true) + current = readcoveragearray(f,tableoffset,current,true) + after = readcoveragearray(f,tableoffset,after,true) + return { + format = "coverage", + rules = { + { + before = before, + current = current, + after = after, + lookups = lookups, + } } } - } + else + report("confusing subtype %a in %a %s",subtype,"chainedcontext",what) + end else report("unsupported subtype %a in %a %s",subtype,"chainedcontext",what) end @@ -2134,7 +2139,7 @@ do return features end - local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) setposition(f,lookupoffset) local noflookups = readushort(f) local lookups = readcardinaltable(f,noflookups,ushort) @@ -2152,12 +2157,12 @@ do end -- which one wins? local markclass = band(flagbits,0x0010) ~= 0 -- usemarkfilteringset + local markset = rshift(flagbits,8) if markclass then markclass = readushort(f) -- + 1 end - local markset = rshift(flagbits,8) if markset > 0 then - markclass = markset -- + 1 + markclass = nofmarkclasses + markset end lookups[lookupid] = { type = lookuptype, @@ -2559,7 +2564,10 @@ do return end -- - local lookups = readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local markclasses = fontdata.markclasses + local marksets = fontdata.marksets + local nofmarkclasses = (markclasses and #markclasses or 0) - (marksets and #marksets or 0) + local lookups = readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) -- if lookups then resolvelookups(f,lookupoffset,fontdata,lookups,lookuptypes,lookuphandlers,what,tableoffset) @@ -2740,8 +2748,9 @@ function readers.gdef(f,fontdata,specification) end end end - -- mark sets : todo: just make the same as class sets above + -- mark sets if marksetsoffset ~= 0 then + local nofmarkclasses = fontdata.markclasses and #fontdata.markclasses or 0 marksetsoffset = tableoffset + marksetsoffset setposition(f,marksetsoffset) local format = readushort(f) @@ -2751,7 +2760,8 @@ function readers.gdef(f,fontdata,specification) for i=1,nofsets do local offset = sets[i] if offset ~= 0 then - marksets[i] = readcoverage(f,marksetsoffset+offset) + markclasses[nofmarkclasses + i] = readcoverage(f,marksetsoffset+offset) + marksets[i] = { } end end end @@ -3200,9 +3210,6 @@ end local compress = gzip and gzip.compress local compressed = compress and gzip.compressed --- At some point I will delay loading and only store the offsets (in context lmtx --- only). - -- compressed = false function readers.svg(f,fontdata,specification) @@ -3982,3 +3989,7 @@ function readers.mvar(f,fontdata,specification) -- setvariabledata(fontdata,"mregions",regions) end end + +function readers.dsig(f,fontdata,specification) + -- We're not going to deal with this security crap. +end diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua index 9e664a68484..bab2ea5f9b5 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua @@ -100,6 +100,7 @@ local function initialize(tfmdata,key,value) local depth = newdepth or olddepth or 0 if oldwidth ~= width or oldheight ~= height or olddepth ~= depth then character.width = width +-- character.advance = oldwidth character.height = height character.depth = depth if oldwidth ~= width then @@ -135,16 +136,3 @@ local specification = { registerotffeature(specification) registerafmfeature(specification) - -local function initialize(tfmdata,value) - tfmdata.properties.realdimensions = value and true -end - -registerotffeature { - name = "realdimensions", - description = "accept negative dimensions", - initializers = { - base = initialize, - node = initialize, - } -} diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-map.lua b/Master/texmf-dist/tex/context/base/mkiv/font-map.lua index 4aa937ed162..3ead64d561f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-map.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-map.lua @@ -72,7 +72,7 @@ local function tounicode16(unicode) return s_unknown else unicode = unicode - 0x10000 - return f_double(idiv(k,0x400)+0xD800,unicode%0x400+0xDC00) + return f_double(idiv(unicode,0x400)+0xD800,unicode%0x400+0xDC00) end end @@ -93,7 +93,7 @@ local function tounicode16sequence(unicodes) t[l] = s_unknown else u = u - 0x10000 - t[l] = f_double(idiv(k,0x400)+0xD800,u%0x400+0xDC00) + t[l] = f_double(idiv(u,0x400)+0xD800,u%0x400+0xDC00) end end return concat(t) diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua b/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua index f721be0ef8f..5aa016439d5 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua @@ -21,7 +21,7 @@ local readers = otf.readers if readers then - otf.version = otf.version or 3.133 + otf.version = otf.version or 3.140 otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true) function fonts.helpers.getfeatures(name,save) diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-one.lua b/Master/texmf-dist/tex/context/base/mkiv/font-one.lua index 25efc2a0467..d484292aedc 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-one.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-one.lua @@ -58,7 +58,7 @@ local registerafmfeature = afmfeatures.register local afmenhancers = constructors.enhancers.afm local registerafmenhancer = afmenhancers.register -afm.version = 1.513 -- incrementing this number one up will force a re-cache +afm.version = 1.540 -- incrementing this number one up will force a re-cache afm.cache = containers.define("fonts", "one", afm.version, true) afm.autoprefixed = true -- this will become false some day (catches texnansi-blabla.*) diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua index 6234742a3d4..413a8d85e24 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua @@ -40,7 +40,7 @@ handlers.afm = afm local readers = afm.readers or { } afm.readers = readers -afm.version = 1.513 -- incrementing this number one up will force a re-cache +afm.version = 1.540 -- incrementing this number one up will force a re-cache -- We start with the basic reader which we give a name similar to the built in TFM -- and OTF reader. We use a PFB loader but I see no differences between the old and diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua b/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua index f35be2cd188..cff9272741c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua @@ -60,6 +60,10 @@ if not modules then modules = { } end modules ['font-osd'] = { -- script devanag -- conjuncts options that can deal with fuzzy fonts. The machinery does what it has -- to do but some fonts expect more magic to be applied. -- +-- Some changes have been reverted because they interfere with proper fonts. We just +-- don't support bad fonts with heuristics any longer. If needed one can use the +-- translitaration filters that come with ConTeXt. +-- -- Hans Hagen, PRAGMA-ADE, Hasselt NL -- Todo: @@ -216,6 +220,9 @@ end -- we might need to have consonants etc per script and initialize a local table -- pointing to the right one. But not now. +-- We have additional data in char-def that provides information not present (at +-- least when this was written) in Unicode. + local indicgroups = characters and characters.indicgroups if not indicgroups and characters then @@ -2107,14 +2114,12 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas local last = getnext(stop) while current ~= last do -- find base consonant local next = getnext(current) --- IF PATCHED THEN --- if current == subpos then --- subnotafterbase = current --- end --- if current == postpos then --- postnotafterbase = current --- end --- END + if current == subpos then + subnotafterbase = current + end + if current == postpos then + postnotafterbase = current + end if consonant[getchar(current)] then if not (current ~= stop and next ~= stop and halant[getchar(next)] and getchar(getnext(next)) == c_zwj) then if not firstcons then @@ -2124,14 +2129,12 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas local a = getstate(current) if not (a == s_blwf or a == s_pstf or (a ~= s_rphf and a ~= s_blwf and ra[getchar(current)])) then base = current --- IF PATCHED THEN --- if subnotafterbase then --- subpos = base --- end --- if postnotafterbase then --- postpos = base --- end --- END + if subnotafterbase then + subpos = base + end + if postnotafterbase then + postpos = base + end end end end @@ -2189,17 +2192,9 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas end end -- --- IF PATCHED THEN --- if dependent_vowel[char] then --- ELSE if not moved[current] and dependent_vowel[char] then --- END if pre_mark[char] then -- or: if before_main or before_half --- IF PATCHED THEN --- -- nothing --- ELSE moved[current] = true --- END -- can be helper to remove one node local prev, next = getboth(current) setlink(prev,next) @@ -2250,22 +2245,11 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas end elseif above_mark[char] then -- after main consonant --- IF PATCHED --- target = subpos --- if postpos == subpos then --- postpos = current --- end --- subpos = current --- ELSE - target = basepos - if subpos == basepos then - subpos = current - end - if postpos == basepos then + target = subpos + if postpos == subpos then postpos = current end - basepos = current --- END + subpos = current elseif below_mark[char] then -- after subjoined consonants target = subpos @@ -2509,16 +2493,7 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe if pre_mark[v] and not already_pre_mark then already_pre_mark = true elseif post_mark[v] and not already_post_mark then --- IF PATCHED THEN --- already_post_mark = true --- ELSE - if devanagarihash[font].conjuncts == "mixed" then - -- for messy fonts - return c - else already_post_mark = true - end --- END elseif below_mark[v] and not already_below_mark then already_below_mark = true elseif above_mark[v] and not already_above_mark then @@ -2738,16 +2713,7 @@ local function analyze_next_chars_two(c,font) if pre_mark[v] and not already_pre_mark then already_pre_mark = true elseif post_mark[v] and not already_post_mark then --- IF PATCHED THEN --- already_post_mark = true --- ELSE - if devanagarihash[font].conjuncts == "mixed" then - -- for messy fonts - return c - else already_post_mark = true - end --- END elseif below_mark[v] and not already_below_mark then already_below_mark = true elseif above_mark[v] and not already_above_mark then diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua index 0825077b3f2..d1d16eaa326 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua @@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading") local fonts = fonts local otf = fonts.handlers.otf -otf.version = 3.133 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version = 3.140 -- beware: also sync font-mis.lua and in mtx-fonts otf.cache = containers.define("fonts", "otl", otf.version, true) otf.svgcache = containers.define("fonts", "svg", otf.version, true) otf.pngcache = containers.define("fonts", "png", otf.version, true) @@ -317,7 +317,7 @@ local function copytotfm(data,cache_id) local properties = derivetable(data.properties) local descriptions = derivetable(data.descriptions) local goodies = derivetable(data.goodies) - local characters = { } -- newtable if we knwo how many + local characters = { } -- newtable if we know how many local parameters = { } local mathparameters = { } -- diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua b/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua index 0689f4dfb5b..4da19188acb 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua @@ -262,10 +262,8 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis if kind == "gsub_single" then for i=1,#steps do for unicode, data in next, steps[i].coverage do - if unicode ~= data then --- if not changed[unicode] then + if unicode ~= data and not changed[unicode] then changed[unicode] = data --- end end if trace_singles then report_substitution(feature,sequence,descriptions,unicode,data) @@ -277,30 +275,24 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis for unicode, data in next, steps[i].coverage do local replacement = data[alternate] if replacement then - if unicode ~= replacement then --- if not changed[unicode] then + if unicode ~= replacement and not changed[unicode] then changed[unicode] = replacement --- end end if trace_alternatives then report_alternate(feature,sequence,descriptions,unicode,replacement,value,"normal") end elseif defaultalt == "first" then replacement = data[1] - if unicode ~= replacement then --- if not changed[unicode] then + if unicode ~= replacement and not changed[unicode] then changed[unicode] = replacement --- end end if trace_alternatives then report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt) end elseif defaultalt == "last" then replacement = data[#data] - if unicode ~= replacement then --- if not changed[unicode] then + if unicode ~= replacement and not changed[unicode] then changed[unicode] = replacement --- end end if trace_alternatives then report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt) diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua index 1e6f94e455c..1c0290db734 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua @@ -1982,11 +1982,14 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst capheight = metrics.capheight or fontdata.maxy, -- can be missing ascender = metrics.typoascender, descender = metrics.typodescender, + ascent = metrics.winascent, -- these might be more reliable + descent = metrics.windescent, -- these might be more reliable platformnames = platformnames or nil, instancenames = instancenames or nil, tableoffsets = fontdata.tableoffsets, defaultvheight = (verticalheader.ascender or 0) - (verticalheader.descender or 0) } + -- print(fontname,fontheader.macstyle) : maybe for italic if metricstoo then local keys = { "version", diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua index 48f85c3658d..da058b16c05 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua @@ -544,7 +544,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou componentindex = countcomponents(start,marks) -- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])" -- and such: - elseif not deletemarks then + elseif not deletemarks or (skiphash and skiphash[char]) then -- we can get a loop when the font expects otherwise (i.e. unexpected deletemarks) setligaindex(start,baseindex + getligaindex(start,componentindex)) if trace_marks then @@ -2552,17 +2552,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if last then local char, id = ischar(last,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n < l then + last = getnext(last) + end + n = n + 1 + elseif skiphash and skiphash[char] then skipped = true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end last = getnext(last) - elseif seq[n][char] then - if n < l then - last = getnext(last) - end - n = n + 1 elseif discfound then notmatchreplace[discfound] = true if notmatchpre[discfound] then @@ -2661,17 +2661,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if prev then local char, id = ischar(prev,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n > 1 then + prev = getprev(prev) + end + n = n - 1 + elseif skiphash and skiphash[char] then skipped = true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end prev = getprev(prev) - elseif seq[n][char] then - if n > 1 then - prev = getprev(prev) - end - n = n - 1 elseif discfound then notmatchreplace[discfound] = true if notmatchpost[discfound] then @@ -2792,17 +2792,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if current then local char, id = ischar(current,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n < s then + current = getnext(current) + end + n = n + 1 + elseif skiphash and skiphash[char] then skipped = true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end - current = getnext(current) -- was absent - elseif seq[n][char] then - if n < s then -- new test - current = getnext(current) -- was absent - end - n = n + 1 + current = getnext(current) elseif discfound then notmatchreplace[discfound] = true if notmatchpre[discfound] then @@ -3978,36 +3978,32 @@ do while start do local char, id = ischar(start,font) if char then - if skiphash and skiphash[char] then -- we never needed it here but let's try - start = getnext(start) - else - local lookupmatch = lookupcache[char] - if lookupmatch then - local a -- happens often so no assignment is faster - if attr then - if getglyphdata(start) == attr and (not attribute or getstate(start,attribute)) then - a = true - end - elseif not attribute or getstate(start,attribute) then + local lookupmatch = lookupcache[char] + if lookupmatch then + local a -- happens often so no assignment is faster + if attr then + if getglyphdata(start) == attr and (not attribute or getstate(start,attribute)) then a = true end - if a then - local ok, df - head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - -- if ok then - -- done = true - -- end - if df then + elseif not attribute or getstate(start,attribute) then + a = true + end + if a then + local ok, df + head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + -- if ok then + -- done = true + -- end + if df then -- print("restart 1",typ) - elseif start then - start = getnext(start) - end - else + elseif start then start = getnext(start) end else - start = getnext(start) + start = getnext(start) end + else + start = getnext(start) end elseif char == false or id == glue_code then -- a different font|state or glue (happens often) @@ -4041,53 +4037,49 @@ do while start do local char, id = ischar(start,font) if char then - if skiphash and skiphash[char] then -- we never needed it here but let's try - start = getnext(start) - else - local m = merged[char] - if m then - local a -- happens often so no assignment is faster - if attr then - if getglyphdata(start) == attr and (not attribute or getstate(start,attribute)) then - a = true - end - elseif not attribute or getstate(start,attribute) then + local m = merged[char] + if m then + local a -- happens often so no assignment is faster + if attr then + if getglyphdata(start) == attr and (not attribute or getstate(start,attribute)) then a = true end - if a then - local ok, df - for i=m[1],m[2] do - local step = steps[i] - -- for i=1,#m do - -- local step = m[i] - local lookupcache = step.coverage - local lookupmatch = lookupcache[char] - if lookupmatch then - -- we could move all code inline but that makes things even more unreadable + elseif not attribute or getstate(start,attribute) then + a = true + end + if a then + local ok, df + for i=m[1],m[2] do + local step = steps[i] + -- for i=1,#m do + -- local step = m[i] + local lookupcache = step.coverage + local lookupmatch = lookupcache[char] + if lookupmatch then + -- we could move all code inline but that makes things even more unreadable -- local ok, df - head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if df then - break - elseif ok then - -- done = true - break - elseif not start then - -- don't ask why ... shouldn't happen - break - end + head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if df then + break + elseif ok then + -- done = true + break + elseif not start then + -- don't ask why ... shouldn't happen + break end end - if df then + end + if df then -- print("restart 2",typ) - elseif start then - start = getnext(start) - end - else + elseif start then start = getnext(start) end else start = getnext(start) end + else + start = getnext(start) end elseif char == false or id == glue_code then -- a different font|state or glue (happens often) @@ -4183,31 +4175,27 @@ do position = position + 1 local m = merged[char] if m then - if skiphash and skiphash[char] then -- we never needed it here but let's try - start = getnext(start) - else - for i=m[1],m[2] do - local step = steps[i] - local lookupcache = step.coverage - local lookupmatch = lookupcache[char] - if lookupmatch then - local ok - head, start, ok = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if ok then - -- if matches then - -- matches[position] = i - -- else - -- matches = { [position] = i } - -- end - break - elseif not start then - break - end + for i=m[1],m[2] do + local step = steps[i] + local lookupcache = step.coverage + local lookupmatch = lookupcache[char] + if lookupmatch then + local ok + head, start, ok = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if ok then + -- if matches then + -- matches[position] = i + -- else + -- matches = { [position] = i } + -- end + break + elseif not start then + break end end - if start then - start = getnext(start) - end + end + if start then + start = getnext(start) end else start = getnext(start) diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua b/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua index 198e62bee40..767c80a95ad 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua @@ -739,6 +739,33 @@ local function checklookups(fontdata,missing,nofmissing) report_unicodes("not unicoded: % t",sortedkeys(done)) end end + + for k, v in next, descriptions do + local math = v.math + if math then + local variants = math.variants + local parts = math.parts + local unicode = v.unicode + if variants then + if unicode then + for i=1,#variants do + local v = descriptions[variants[i]] + if not v then + -- error + elseif v.unicode then + -- error + else + v.unicode = unicode + end + end + end + end + if parts then + parts[#parts//2+1].unicode = unicode + end + end + end + end local firstprivate = fonts.privateoffsets and fonts.privateoffsets.textbase or 0xF0000 @@ -945,7 +972,9 @@ local function unifyglyphs(fontdata,usenames) if colors then for i=1,#colors do local c = colors[i] - c.slot = indices[c.slot] + if c then -- safeguard + c.slot = indices[c.slot] + end end end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua b/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua index 59b793444d8..be9363b7266 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua @@ -15,20 +15,23 @@ local fontdata = fonts.hashes.identifiers local setmetatableindex = table.setmetatableindex +-- if we run out of space we can think of another range but by sharing we can +-- use these privates for mechanisms like alignments-on-character and such + local currentprivate = fonts.privateoffsets.textextrabase local maximumprivate = currentprivate + 0xFFF -local extraprivates = { } +local extraprivates = utilities.storage.allocate() +local sharedprivates = utilities.storage.allocate() + helpers.extraprivates = extraprivates +helpers.sharedprivates = sharedprivates function fonts.helpers.addextraprivate(name,f) extraprivates[#extraprivates+1] = { name, f } end --- if we run out of space we can think of another range but by sharing we can --- use these privates for mechanisms like alignments-on-character and such - -local sharedprivates = setmetatableindex(function(t,k) +setmetatableindex(sharedprivates,function(t,k) local v = currentprivate if currentprivate < maximumprivate then currentprivate = currentprivate + 1 @@ -39,8 +42,6 @@ local sharedprivates = setmetatableindex(function(t,k) return v end) -fonts.helpers.sharedprivates = sharedprivates - function helpers.addprivate(tfmdata,name,characterdata) local properties = tfmdata.properties local characters = tfmdata.characters diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua b/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua index 9fba3d8d4a0..68fb9eaf80d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua @@ -157,6 +157,7 @@ local styles = Cs ( + P("italic") + P("oblique") / "italic" + P("slanted") + + P("slant") / "slanted" + P("roman") / "normal" + P("ital") / "italic" -- might be tricky + P("ita") / "italic" -- might be tricky diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua b/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua index 16b89c3932c..1fb18bff565 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua @@ -356,14 +356,8 @@ Q]] ] pixels = readcardinal1(s) xsize = readcardinal1(s) ysize = readcardinal1(s) - xoffset = readcardinal1(s) - yoffset = readcardinal1(s) - if xoffset > 127 then - xoffset = xoffset - 256 - end - if yoffset > 127 then - yoffset = yoffset - 256 - end + xoffset = readinteger1(s) + yoffset = readinteger1(s) elseif c >= 4 and c <= 6 then length = band(flagbyte,3) * 65536 + readcardinal1(s) * 256 + readcardinal1(s) - 4 index = readcardinal1(s) @@ -371,8 +365,8 @@ Q]] ] pixels = readcardinal2(s) xsize = readcardinal2(s) ysize = readcardinal2(s) - xoffset = readcardinal2(s) - yoffset = readcardinal2(s) + xoffset = readinteger2(s) + yoffset = readinteger2(s) else -- 7 length = readcardinal4(s) - 9 index = readcardinal4(s) @@ -381,8 +375,8 @@ Q]] ] readcardinal4(s) xsize = readcardinal4(s) ysize = readcardinal4(s) - xoffset = readcardinal4(s) - yoffset = readcardinal4(s) + xoffset = readinteger4(s) + yoffset = readinteger4(s) end local glyph = { index = index, diff --git a/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua index 33e79a5d48f..0dda3342641 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua @@ -309,7 +309,7 @@ local function setextrafeatures(tfmdata) -- hashed for feature, specification in sortedhash(f) do if not done[feature] then - feature = specification.name or feature + local feature = specification.name or feature specification.name = feature addotffeature(rawdata,feature,specification) registerotffeature { diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua index 0cfc9ba085b..4b2f00f6a71 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua @@ -109,7 +109,7 @@ function checkers.pdf(data) if trace_pdf then report_pdf("copy page %i from image %a, %i pages copied",page,filename,copied) end - local result = copypage(pdfdoc,page,nil,request.compact,request.width,request.height,request.attr) + local result = copypage(pdfdoc,page,nil,request.compact,request.width,request.height,request.attr,request.metadata) if pdfdoc.nofcopied >= pdfdoc.nofpages then if trace_pdf then report_pdf("closing image %a, %i pages copied",filename,copied) diff --git a/Master/texmf-dist/tex/context/base/mkiv/java-imp-fields.mkiv b/Master/texmf-dist/tex/context/base/mkiv/java-imp-fields.mkiv index 5801c321636..642c34a5476 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/java-imp-fields.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/java-imp-fields.mkiv @@ -41,9 +41,7 @@ ctx_verbatim("{\n") for accent, group in sortedhash(characters.tex.accentmapping) do for character, mapping in sortedhash(group) do - if character == "" then - character = " " - end + local character = character == "" and " " or character if accent == '"' then ctx_verbatim(" '\\\\%s%s' : '\\u%04X',\n",accent,character,utfbyte(mapping)) else diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-os.lua b/Master/texmf-dist/tex/context/base/mkiv/l-os.lua index faae76881ac..a5ade7bd716 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/l-os.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/l-os.lua @@ -209,6 +209,8 @@ os.name = os.name or (os.type == "windows" and "mswin" ) or "linux" if os.type == "windows" then os.libsuffix, os.binsuffix, os.binsuffixes = 'dll', 'exe', { 'exe', 'cmd', 'bat' } +elseif os.name == "macosx" then + os.libsuffix, os.binsuffix, os.binsuffixes = 'dylib', '', { '' } else os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' } end diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-table.lua b/Master/texmf-dist/tex/context/base/mkiv/l-table.lua index c20bd4733c4..f5ca5483466 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/l-table.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/l-table.lua @@ -469,19 +469,22 @@ local function copy(t,tables) -- taken from lua wiki, slightly adapted tables[t] = tcopy end for i,v in next, t do -- brrr, what happens with sparse indexed + local k if type(i) == "table" then if tables[i] then - i = tables[i] + k = tables[i] else - i = copy(i,tables) + k = copy(i,tables) end + else + k = i end if type(v) ~= "table" then - tcopy[i] = v + tcopy[k] = v elseif tables[v] then - tcopy[i] = tables[v] + tcopy[k] = tables[v] else - tcopy[i] = copy(v,tables) + tcopy[k] = copy(v,tables) end end local mt = getmetatable(t) @@ -711,7 +714,11 @@ local function do_serialize(root,name,depth,level,indexed) elseif tv == "number" then if tk == "number" then if hexify then - handle(format("%s [0x%X]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [0x%X]=%q,",depth,k,v)) + else + handle(format("%s [0x%X]=%s,",depth,k,v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k,v)) else @@ -719,7 +726,11 @@ local function do_serialize(root,name,depth,level,indexed) end elseif tk == "boolean" then if hexify then - handle(format("%s [%s]=0x%X,",depth,k and "true" or "false",v)) + if accurate then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + else + handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) else @@ -729,7 +740,12 @@ local function do_serialize(root,name,depth,level,indexed) -- ignore elseif noquotes and not reserved[k] and lpegmatch(propername,k) then if hexify then - handle(format("%s %s=0x%X,",depth,k,v)) + if accurate then + handle(format("%s %s=%q,",depth,k,v)) + else +-- handle(format("%s %s=%s,",depth,k,v)) + handle(format("%s %s=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s %s=%q,",depth,k,v)) else @@ -737,7 +753,12 @@ local function do_serialize(root,name,depth,level,indexed) end else if hexify then - handle(format("%s [%q]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [%q]=%q,",depth,k,v)) + else +-- handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%q]=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s [%q]=%q,",depth,k,v)) else diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii-data.lgz b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii-data.lgz new file mode 100644 index 00000000000..9bbcc6afc76 Binary files /dev/null and b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii-data.lgz differ diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii.lua new file mode 100644 index 00000000000..8fe664a2767 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-simpleascii.lua @@ -0,0 +1,114 @@ +-- The data is taken from: +-- +-- https://github.com/anyascii/anyascii/blob/master/table.tsv +-- +-- by Hunter WB under the ISC License (2020-2023). +-- +-- Updating: +-- +-- -- copy table.tsv to lang-imp-simpleascii-data.tsv +-- -- mtxrun --script lang-imp-simpleascii +-- -- copy lang-imp-simpleascii-data.lgz over old file +-- +-- Usage: +-- +-- \usetransliteration[simpleascii] +-- +-- \definetransliteration +-- [simpleascii] +-- [color=blue, +-- vector={simple ascii}] +-- +-- \settransliteration[simpleascii] +-- +-- \starttext +-- +-- \startchapter[title={深圳 ଗଜପତି Blöße}] +-- 深圳 ଗଜପତି Blöße\par +-- 深圳 ଗଜପତି Blöße\par +-- 深圳 ଗଜପତି Blöße\par +-- 深圳 ଗଜପତି Blöße\par +-- \stopchapter +-- +-- \stoptext + +local textfile = "lang-imp-simpleascii-data.tsv" -- a copy of table.tsv +local datafile = "lang-imp-simpleascii-data.lua" -- for tracing +local compfile = "lang-imp-simpleascii-data.lgz" -- idem in distribution + +local verbose = false -- when true, saved uncompressed file for tracing +local report = logs.reporter("simpleascii") + +if not context and lfs.isfile(textfile) then + + -- We save it in the local path so we need to move it explicitly into + -- the tree which prevents errors. + + local data = io.loaddata(textfile) + if data and data ~= "" then + local mapping = { } + for k, v in string.gmatch(data,"(%S+)[\t]*([^\n\r]-)[\n\r]") do + if k ~= "" and v ~= "" and k ~= v then + mapping[k] = v + end + end + if verbose then + table.save(datafile,mapping) + else + mapping = gzip.compress(table.fastserialize(mapping)) -- zlib.compress(d,9) + datafile = compfile + io.savedata(compfile,mapping) + end + report("data from %a saved in %a",textfile,datafile) + else + report("no data file %a",textfile) + end + +else + + local mapping = false + + if not verbose then + mapping = io.loaddata(resolvers.findfile(compfile) or "") + if mapping then + mapping = table.deserialize(gzip.decompress(mapping)) -- zlib.decompress(d) + if mapping then + datafile = compfile + else + report("data file %a is corrupt",compfile) + end + end + end + if not mapping then + mapping = table.load(resolvers.findfile(datafile) or "") + end + + if mapping then + + report("data file %a loaded",datafile) + + -- for i = 0, 127 do + -- mapping[utfchar(i)] = utfchar(i) -- not needed + -- end + + return { + + name = "simple ascii", + version = "1.00", + comment = "Unicode to ASCII transliteration", + author = "Jairo A. del Rio & Hans Hagen", + copyright = "ConTeXt development team & whoever made this list", + + transliterations = { + ["simple ascii"] = { + mapping = mapping + }, + } + + } + + else + report("no data file %a",datafile) + end + +end diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua index d2c47f5bacd..a07524a930d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua @@ -266,7 +266,7 @@ local function replace(head,first,last,final,hasspace,overload) current = getnext(current) end end - current = getnext(final) + -- current = getnext(final) -- some left over? no next! elseif oldlength < newlength then for i=1,newlength-oldlength do local n = copy_node(current) diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua index c41936dacb8..0531a0e1915 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua @@ -754,6 +754,11 @@ data.labels={ ["sv"]="coth", }, }, + ["crossproduct"]={ + ["labels"]={ + ["en"]="×", + }, + }, ["csc"]={ ["labels"]={ ["ca"]="csc", @@ -863,6 +868,12 @@ data.labels={ ["sv"]="sgd", }, }, +-- not here +-- ["gradient"]={ +-- ["labels"]={ +-- ["en"]="∇", +-- }, +-- }, ["hom"]={ ["labels"]={ ["ca"]="hom", @@ -938,6 +949,11 @@ data.labels={ ["sv"]="ker", }, }, + ["laplace"]={ + ["labels"]={ + ["en"]="∆", + }, + }, ["lcm"]={ ["labels"]={ ["ca"]="MCM", @@ -1124,6 +1140,16 @@ data.labels={ ["sv"]="mod", }, }, + ["neg"]={ + ["labels"]={ + ["en"]="¬", + }, + }, + ["partial"]={ + ["labels"]={ + ["en"]="∂", + }, + }, ["projlim"]={ ["labels"]={ ["ca"]="lim proy", @@ -1139,6 +1165,11 @@ data.labels={ ["sv"]="proj\\sixperemspace lim", }, }, + ["scalarproduct"]={ + ["labels"]={ + ["en"]="·", + }, + }, ["sec"]={ ["labels"]={ ["ca"]="sec", @@ -4348,4 +4379,3 @@ functions.ctg = functions.cot functions.arctg = functions.arctan functions.arcctg = functions.arccot functions.arctgh = functions.arctanh - diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua index 1c440bd7f2a..50cee7ded5d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua @@ -11,7 +11,7 @@ local lower = string.lower local utfchar = utf.char local concat, setmetatableindex = table.concat, table.setmetatableindex local lpegmatch = lpeg.match -local P, S, Cs, Cf, Cg, Cc, C = lpeg.P, lpeg.S, lpeg.Cs, lpeg.Cf, lpeg.Cg, lpeg.Cc, lpeg.C +local P, S, Cs, Cc, C = lpeg.P, lpeg.S, lpeg.Cs, lpeg.Cc, lpeg.C local report_words = logs.reporter("languages","words") @@ -85,7 +85,6 @@ local loaders = { local data = io.loaddata(fullname) if data and data ~= "" then local parser = (spacing + word/function(s) list[s] = true end)^0 - -- local parser = Cf(Cc(list) * Cg(spacing^0 * word * Cc(true))^1,rawset) -- not better lpegmatch(parser,data) end end, diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua index c6a3f25ff5e..ebe3896ae01 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua @@ -40,6 +40,7 @@ local pdfflushstreamfileobject = lpdf.flushstreamfileobject local addtoinfo = lpdf.addtoinfo local injectxmpinfo = lpdf.injectxmpinfo local insertxmpinfo = lpdf.insertxmpinfo +local replacexmpinfo = lpdf.replacexmpinfo local settings_to_array = utilities.parsers.settings_to_array local settings_to_hash = utilities.parsers.settings_to_hash @@ -141,7 +142,14 @@ local formats = utilities.storage.allocate { attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-1a:2001") - injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2001",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-1a:2001 + +]] + ) end }, ["pdf/x-1a:2003"] = { @@ -158,7 +166,14 @@ local formats = utilities.storage.allocate { attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-1a:2003") - injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2003",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-1a:2003 + +]] + ) end }, ["pdf/x-3:2002"] = { @@ -224,9 +239,24 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","PDF/X-4",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-4 + +]] + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[1]], + false + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[default]], + false + ) end }, ["pdf/x-4p"] = { @@ -252,9 +282,24 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","PDF/X-4p",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-4p + +]] + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[1]], + false + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[default]], + false + ) end }, ["pdf/x-5g"] = { @@ -355,7 +400,15 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","1A",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 1 + A + +]] + ) end }, ["pdf/a-1b:2005"] = { @@ -376,7 +429,15 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","1B",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 1 + B + +]] + ) end }, -- Only PDF/A Attachments are allowed but we don't check the attachments @@ -404,7 +465,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, -- new inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","2A",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 2 + A + +]] + ) end }, ["pdf/a-2b"] = { @@ -430,7 +499,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","2B",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 2 + B + +]] + ) end }, -- This is like the b variant, but it requires Unicode mapping of fonts @@ -458,7 +535,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","2U",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 2 + U + +]] + ) end }, -- Any type of attachment is allowed but we don't check the quality @@ -486,7 +571,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3A",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + A + +]] + ) end }, ["pdf/a-3b"] = { @@ -512,7 +605,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3B",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + B + +]] + ) end }, ["pdf/a-3u"] = { @@ -538,7 +639,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3U",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + U + +]] + ) end }, ["pdf/ua-1"] = { -- based on PDF/A-3a, but no 'gts_flag' @@ -563,8 +672,18 @@ local formats = utilities.storage.allocate { include_charsets = true, --- really ? attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3A",false) - injectxmpinfo("xml://rdf:RDF","1",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + A + + + 1 + +]] + ) end }, } diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua index 07e9c8df82b..68f626e0445 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua @@ -1417,7 +1417,7 @@ do local t = type(str) if t == "string" then local Y, M, D, h, m, s, Zs, Zh, Zm = match(str,"^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)([%+%-])(%d%d):(%d%d)$") - return Y and format("D:%s%s%s%s%s%s%s%s'%s'",Y,M,D,h,m,s,Zs,Zh,Zm) + return Y and format("D:%s%s%s%s%s%s%s%s'%s",Y,M,D,h,m,s,Zs,Zh,Zm) else return osdate("D:%Y%m%d%H%M%S",t == "number" and str or ostime()) -- maybe "!D..." : universal time end diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml index 0de54aa2aae..8d2e5645dae 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml +++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml @@ -3,219 +3,225 @@ - - - - application/pdf - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - - - - - - - - - - http://ns.adobe.com/pdf/1.3/ - pdf - Adobe PDF Schema - - - - internal - A name object indicating whether the document has been modified to include trapping information - Trapped - Text - - - - - - - - - http://purl.org/dc/elements/1.1/ - pdf - Dubline Core Schema - - - - internal - Subject in Document Properties - description - Text - - - - - - - - - http://ns.adobe.com/pdfx/1.3/ - pdfx - PDF/X ID Schema - - - - external - Name of the ConTeXt job - ConTeXt.Jobname - Text - - - external - Time stamp of ConTeXt version - ConTeXt.Time - Text - - - external - ConTeXt website - ConTeXt.Url - Text - - - external - ConTeXt support - ConTeXt.Support - Text - - - external - ConTeXt version - ConTeXt.Version - Text - - - external - ConTeXt LMTX version - ConTeXt.LMTX - Text - - - external - TeX support - TeX.Support - Text - - - external - LuaTeX version - LuaTeX.Version - Text - - - external - LuaTeX functionality - LuaTeX.Functionality - Text - - - external - LuaTeX Lua version - LuaTeX.LuaVersion - Text - - - external - LuaTeX platform - LuaTeX.Platform - Text - - - external - Document identifier - ID - Text - - - - - - - - - http://ns.adobe.com/xap/1.0/mm/ - xmpMM - XMP Media Management Schema - - - - internal - UUID based identifier for specific incarnation of a document - InstanceID - URI - - - - - - - - - http://www.aiim.org/pdfa/ns/id/ - pdfaid - PDF/A ID Schema - - - - internal - Part of PDF/A standard - part - Integer - - - internal - Amendment of PDF/A standard - amd - Text - - - internal - Conformance level of PDF/A standard - conformance - Text - - - - - - - - - - - + + + + application/pdf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + + http://ns.adobe.com/pdf/1.3/ + pdf + Adobe PDF Schema + + + + internal + A name object indicating whether the document has been modified to include trapping information + Trapped + Text + + + + + + + + + http://purl.org/dc/elements/1.1/ + pdf + Dubline Core Schema + + + + internal + Subject in Document Properties + description + Text + + + + + + + + + http://ns.adobe.com/pdfx/1.3/ + pdfx + PDF/X ID Schema + + + + external + Name of the ConTeXt job + ConTeXt.Jobname + Text + + + external + Time stamp of ConTeXt version + ConTeXt.Time + Text + + + external + ConTeXt website + ConTeXt.Url + Text + + + external + ConTeXt support + ConTeXt.Support + Text + + + external + ConTeXt version + ConTeXt.Version + Text + + + external + TeX support + TeX.Support + Text + + + external + LuaTeX version + LuaTeX.Version + Text + + + external + LuaTeX functionality + LuaTeX.Functionality + Text + + + external + LuaTeX Lua version + LuaTeX.LuaVersion + Text + + + external + LuaTeX platform + LuaTeX.Platform + Text + + + external + Document identifier + ID + Text + + + + + + + + + http://ns.adobe.com/xap/1.0/mm/ + xmpMM + XMP Media Management Schema + + + + internal + UUID based identifier for specific incarnation of a document + InstanceID + URI + + + + + + + + + http://www.aiim.org/pdfa/ns/id/ + pdfaid + PDF/A ID Schema + + + + internal + Part of PDF/A standard + part + Integer + + + internal + Amendment of PDF/A standard + amd + Text + + + internal + Conformance level of PDF/A standard + conformance + Text + + + + + + + + + + + + diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml index 45349b4d8fc..e83416255b8 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml +++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml @@ -3,46 +3,76 @@ + + + + - - - application/pdf - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - - - - - - + + + application/pdf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml index 091a3d40092..943f14ba255 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml +++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml @@ -11,233 +11,251 @@ + + vs + + + + +--> + + - - - application/pdf - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - - - - - - - - - - http://ns.adobe.com/pdf/1.3/ - pdf - Adobe PDF Schema - - - - internal - A name object indicating whether the document has been modified to include trapping information - Trapped - Text - - - - - - http://purl.org/dc/elements/1.1/ - pdf - Dubline Core Schema - - - - internal - Subject in Document Properties - description - Text - - - - - - http://ns.adobe.com/pdfx/1.3/ - pdfx - PDF/X ID Schema - - - - external - Name of the ConTeXt job - ConTeXt.Jobname - Text - - - external - Time stamp of ConTeXt version - ConTeXt.Time - Text - - - external - ConTeXt website - ConTeXt.Url - Text - - - external - ConTeXt support - ConTeXt.Support - Text - - - external - ConTeXt version - ConTeXt.Version - Text - - - external - ConTeXt LMTX version - ConTeXt.LMTX - Text - - - external - TeX support - TeX.Support - Text - - - external - LuaTeX version - LuaTeX.Version - Text - - - external - LuaTeX functionality - LuaTeX.Functionality - Text - - - external - LuaTeX Lua version - LuaTeX.LuaVersion - Text - - - external - LuaTeX platform - LuaTeX.Platform - Text - - - external - Document identifier - ID - Text - - - - - - http://ns.adobe.com/xap/1.0/mm/ - xmpMM - XMP Media Management Schema - - - - internal - UUID based identifier for specific incarnation of a document - InstanceID - URI - - - - - - http://www.aiim.org/pdfa/ns/id/ - pdfaid - PDF/A ID Schema - - - - internal - Part of PDF/A standard - part - Integer - - - internal - Amendment of PDF/A standard - amd - Text - - - internal - Conformance level of PDF/A standard - conformance - Text - - - - - - http://www.aiim.org/pdfua/ns/id/ - pdfuaid - PDF/UA identification schema - - - - internal - PDF/UA version identifier - part - Integer - - - internal - PDF/UA amendment identifier - amd - Text - - - internal - PDF/UA corrigenda identifier - corr - Text - - - - - - - - + + + application/pdf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + + http://ns.adobe.com/pdf/1.3/ + pdf + Adobe PDF Schema + + + + internal + A name object indicating whether the document has been modified to include trapping information + Trapped + Text + + + + + + http://purl.org/dc/elements/1.1/ + pdf + Dubline Core Schema + + + + internal + Subject in Document Properties + description + Text + + + + + + http://ns.adobe.com/pdfx/1.3/ + pdfx + PDF/X ID Schema + + + + external + Name of the ConTeXt job + ConTeXt.Jobname + Text + + + external + Time stamp of ConTeXt version + ConTeXt.Time + Text + + + external + ConTeXt website + ConTeXt.Url + Text + + + external + ConTeXt support + ConTeXt.Support + Text + + + external + ConTeXt version + ConTeXt.Version + Text + + + external + TeX support + TeX.Support + Text + + + external + LuaTeX version + LuaTeX.Version + Text + + + external + LuaTeX functionality + LuaTeX.Functionality + Text + + + external + LuaTeX Lua version + LuaTeX.LuaVersion + Text + + + external + LuaTeX platform + LuaTeX.Platform + Text + + + external + Document identifier + ID + Text + + + + + + http://ns.adobe.com/xap/1.0/mm/ + xmpMM + XMP Media Management Schema + + + + internal + UUID based identifier for specific incarnation of a document + InstanceID + URI + + + + + + http://www.aiim.org/pdfa/ns/id/ + pdfaid + PDF/A ID Schema + + + + internal + Part of PDF/A standard + part + Integer + + + internal + Amendment of PDF/A standard + amd + Text + + + internal + Conformance level of PDF/A standard + conformance + Text + + + + + + http://www.aiim.org/pdfua/ns/id/ + pdfuaid + PDF/UA identification schema + + + + internal + PDF/UA version identifier + part + Integer + + + internal + PDF/UA amendment identifier + amd + Text + + + internal + PDF/UA corrigenda identifier + corr + Text + + + + + + + + + diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua index 2ca3ab3fea3..0eeb6167708 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua @@ -8,10 +8,10 @@ if not modules then modules = { } end modules ['lpdf-xmp'] = { } local tostring, type = tostring, type -local format, gsub = string.format, string.gsub +local format, gsub, match, rep, count = string.format, string.gsub, string.match, string.rep, string.count local utfchar = utf.char -local xmlfillin = xml.fillin local md5HEX = md5.HEX +local xmlfillin, xmldelete, xmltext = xml.fillin, xml.delete, xml.text local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end) local trace_info = false trackers.register("backend.info", function(v) trace_info = v end) @@ -47,7 +47,6 @@ local mapping = { ["ConTeXt.Url"] = { "context", "rdf:Description/pdfx:ConTeXt.Url" }, ["ConTeXt.Support"] = { "context", "rdf:Description/pdfx:ConTeXt.Support" }, ["ConTeXt.Version"] = { "context", "rdf:Description/pdfx:ConTeXt.Version" }, - ["ConTeXt.LMTX"] = { "context", "rdf:Description/pdfx:ConTeXt.LMTX" }, ["TeX.Support"] = { "metadata","rdf:Description/pdfx:TeX.Support" }, ["LuaTeX.Version"] = { "metadata","rdf:Description/pdfx:LuaTeX.Version" }, ["LuaTeX.Functionality"] = { "metadata","rdf:Description/pdfx:LuaTeX.Functionality" }, @@ -55,19 +54,23 @@ local mapping = { ["LuaTeX.Platform"] = { "metadata","rdf:Description/pdfx:LuaTeX.Platform" }, ["ID"] = { "id", "rdf:Description/pdfx:ID" }, -- has date -- Adobe PDF schema - ["Keywords"] = { "metadata","rdf:Description/pdf:Keywords" }, - ["Producer"] = { "metadata","rdf:Description/pdf:Producer" }, + ["Keywords"] = { "metadata","rdf:Description/pdf:Keywords", true }, + ["Producer"] = { "metadata","rdf:Description/pdf:Producer", true }, -- ["Trapped"] = { "pdf", "rdf:Description/pdf:Trapped" }, -- '/False' in /Info, but 'False' in XMP -- Dublin Core schema ["Format"] = { "metadata","rdf:Description/dc:format" }, -- optional, but nice to have - -- These were dc:.../rdf:Seq/rdf:li but there was a (invalidating) bug in the iso - ["Author"] = { "metadata","rdf:Description/dc:creator" }, - ["Subject"] = { "metadata","rdf:Description/dc:description" }, - ["Title"] = { "metadata","rdf:Description/dc:title" }, + -- see xml file for comment: + -- ["Author"] = { "metadata","rdf:Description/dc:creator" }, + -- ["Subject"] = { "metadata","rdf:Description/dc:description" }, + -- ["Title"] = { "metadata","rdf:Description/dc:title" }, + ["Author"] = { "metadata","rdf:Description/dc:creator/rdf:Seq/rdf:li", true }, + ["Subject"] = { "metadata","rdf:Description/dc:description/rdf:Alt/rdf:li", true }, + ["Title"] = { "metadata","rdf:Description/dc:title/rdf:Alt/rdf:li", true }, -- XMP Basic schema ["CreateDate"] = { "date", "rdf:Description/xmp:CreateDate" }, ["CreationDate"] = { "date", "rdf:Description/xmp:CreationDate" }, -- dummy - ["Creator"] = { "metadata","rdf:Description/xmp:CreatorTool" }, + ["CreatorTool"] = { "metadata","rdf:Description/xmp:CreatorTool" }, + -- ["Creator"] = { "metadata","rdf:Description/xmp:CreatorTool" }, ["MetadataDate"] = { "date", "rdf:Description/xmp:MetadataDate" }, ["ModDate"] = { "date", "rdf:Description/xmp:ModDate" }, -- dummy ["ModifyDate"] = { "date", "rdf:Description/xmp:ModifyDate" }, @@ -90,6 +93,8 @@ local mapping = { ["AuthorsPosition"] = { "metadata", "rdf:Description/photoshop:AuthorsPosition" }, ["Copyright"] = { "metadata", "rdf:Description/photoshop:Copyright" }, ["CaptionWriter"] = { "metadata", "rdf:Description/photoshop:CaptionWriter" }, + -- + ["Placeholder"] = { "metadata", "pdfaid-placeholder", true } } lpdf.setsuppressoptionalinfo ( @@ -254,6 +259,10 @@ function lpdf.injectxmpinfo(pattern,whatever,prepend) xml.inject(xmp or valid_xmp(),pattern,whatever,prepend) end +function lpdf.replacexmpinfo(pattern,whatever) + xml.replace(xmp or valid_xmp(),pattern,whatever) +end + -- flushing local add_xmp_blob = true directives.register("backend.xmp",function(v) add_xmp_blob = v end) @@ -293,6 +302,17 @@ local function flushxmpinfo() pdfaddxmpinfo("LuaTeX.LuaVersion",metadata.luaversion) pdfaddxmpinfo("LuaTeX.Platform",metadata.platform) + -- checks for empty: + + for tag, map in next, mapping do + if map[3] == true then + local pattern = map[2] + if type(pattern) == "string" and xmltext(xmp,pattern) == "" then + xmldelete(xmp,pattern .. rep("/..",count(pattern,"/")-1)) + end + end + end + local blob = xml.tostring(xml.first(xmp or valid_xmp(),"/x:xmpmeta")) local md = pdfdictionary { Subtype = pdfconstant("XML"), diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua index a67167bb9ff..3c123037c0d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua @@ -87,28 +87,16 @@ function texconfig.init() basictex = { -- always "callback", "font", "lua", "node", "status", "tex", "texconfig", "texio", "token", - -- not in luametatex "img", "pdf", "lang", - -- in luametatex - "language", }, extralua = { - -- not in luametatex "unicode", "utf", "gzip", "zip", "zlib", - -- in luametatex - "xzip", "xmath", "xcomplex", "xdecimal", "basexx", - -- maybe some day in luametatex "lz4", "lzo", - -- always (mime can go) "lfs","socket", "mime", "md5", "sha2", "fio", "sio", }, extratex = { - -- not in luametatex "kpse", - -- always "pdfe", "mplib", - -- in luametatex - "pdfdecode", "pngdecode", }, obsolete = { "epdf", diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua index edf127765a8..14290f1ddc6 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua @@ -101,7 +101,7 @@ local function strippable(filename) end end -function environment.luafilechunk(filename,silent,macros) -- used for loading lua bytecode in the format +function environment.luafilechunk(filename,silent,macros,optional) -- used for loading lua bytecode in the format filename = file.replacesuffix(filename, "lua") local fullname = environment.luafile(filename) if fullname and fullname ~= "" then @@ -111,7 +111,7 @@ function environment.luafilechunk(filename,silent,macros) -- used for loading lu end return data else - if not silent then + if not optional and not silent then report_lua("unknown file %a",filename) end return nil diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv b/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv index 3df374de9ad..a8d649801ec 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv @@ -19,7 +19,7 @@ \registerctxluafile{util-sac}{optimize} \registerctxluafile{util-sto}{} % could also be done in trac-deb.mkiv \registerctxluafile{util-pck}{} -\registerctxluafile{util-prs}{} +\registerctxluafile{util-prs}{autosuffix} \registerctxluafile{util-fmt}{} \registerctxluafile{util-dim}{} diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-log.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-log.lua index 8bfec8d218e..d2aae768359 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-log.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-log.lua @@ -502,9 +502,9 @@ local function setblocked(category,value) -- v.state == value == true : disable if v then v.state = value else - c = topattern(c,true,true) + local p = topattern(c,true,true) for k, v in next, data do - if find(k,c) then + if find(k,p) then v.state = value end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua index fca59c993ba..63d824228c2 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua @@ -183,7 +183,10 @@ local nolong = 1 - longleft - longright local utf8character = P(1) * R("\128\191")^1 -- unchecked but fast -local name = (R("AZ","az") + utf8character)^1 +-- so no #[AZ] permitted + +local name = ((R("az") + utf8character) * (R("AZ","az") + utf8character)^0) + + ((R("AZ","az") + utf8character) * (R("AZ","az") + utf8character)^1) local csname = (R("AZ","az") + S("@?!_:-*") + utf8character)^1 local longname = (longleft/"") * (nolong^1) * (longright/"") local variable = P("#") * Cs(name + longname) @@ -225,6 +228,7 @@ local argument = P { leftbrace * ((identifier + V(1) + (1 - leftbrace - ri local function matcherror(str,pos) report_macros("runaway definition at: %s",sub(str,pos-30,pos)) + os.exit() end local csname_endcsname = P("\\csname") * (identifier + (1 - P("\\endcsname")))^1 @@ -303,11 +307,13 @@ function macros.preprocessed(str,strip) end function macros.convertfile(oldname,newname) -- beware, no testing on oldname == newname - local data = loadtexfile(oldname) + local data = (loadtexfile or io.loaddata)(oldname) data = macros.preprocessed(data) or "" -- interfaces not yet defined savedata(newname,data) end +-- macros.convertfile("c:/data/develop/context/sources/publ-imp-definitions.mkvi","e:/tmp/temp-macros.mkiv") + function macros.version(data) return lpegmatch(checker,data) end diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-sta.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-sta.lua index 8b58774d357..fc987680bb6 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-sta.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-sta.lua @@ -112,100 +112,100 @@ function states.get(key,default) return get_by_tag(states.tag,key,default) end ---~ data.update = { ---~ ["version"] = { ---~ ["major"] = 0, ---~ ["minor"] = 1, ---~ }, ---~ ["rsync"] = { ---~ ["server"] = "contextgarden.net", ---~ ["module"] = "minimals", ---~ ["repository"] = "current", ---~ ["flags"] = "-rpztlv --stats", ---~ }, ---~ ["tasks"] = { ---~ ["update"] = true, ---~ ["make"] = true, ---~ ["delete"] = false, ---~ }, ---~ ["platform"] = { ---~ ["host"] = true, ---~ ["other"] = { ---~ ["mswin"] = false, ---~ ["linux"] = false, ---~ ["linux-64"] = false, ---~ ["osx-intel"] = false, ---~ ["osx-ppc"] = false, ---~ ["sun"] = false, ---~ }, ---~ }, ---~ ["context"] = { ---~ ["available"] = {"current", "beta", "alpha", "experimental"}, ---~ ["selected"] = "current", ---~ }, ---~ ["formats"] = { ---~ ["cont-en"] = true, ---~ ["cont-nl"] = true, ---~ ["cont-de"] = false, ---~ ["cont-cz"] = false, ---~ ["cont-fr"] = false, ---~ ["cont-ro"] = false, ---~ }, ---~ ["engine"] = { ---~ ["pdftex"] = { ---~ ["install"] = true, ---~ ["formats"] = { ---~ ["pdftex"] = true, ---~ }, ---~ }, ---~ ["luatex"] = { ---~ ["install"] = true, ---~ ["formats"] = { ---~ }, ---~ }, ---~ ["xetex"] = { ---~ ["install"] = true, ---~ ["formats"] = { ---~ ["xetex"] = false, ---~ }, ---~ }, ---~ ["metapost"] = { ---~ ["install"] = true, ---~ ["formats"] = { ---~ ["mpost"] = true, ---~ ["metafun"] = true, ---~ }, ---~ }, ---~ }, ---~ ["fonts"] = { ---~ }, ---~ ["doc"] = { ---~ }, ---~ ["modules"] = { ---~ ["f-urwgaramond"] = false, ---~ ["f-urwgothic"] = false, ---~ ["t-bnf"] = false, ---~ ["t-chromato"] = false, ---~ ["t-cmscbf"] = false, ---~ ["t-cmttbf"] = false, ---~ ["t-construction-plan"] = false, ---~ ["t-degrade"] = false, ---~ ["t-french"] = false, ---~ ["t-lettrine"] = false, ---~ ["t-lilypond"] = false, ---~ ["t-mathsets"] = false, ---~ ["t-tikz"] = false, ---~ ["t-typearea"] = false, ---~ ["t-vim"] = false, ---~ }, ---~ } - ---~ states.save("teststate", "update") ---~ states.load("teststate", "update") - ---~ print(states.get_by_tag("update","rsync.server","unknown")) ---~ states.set_by_tag("update","rsync.server","oeps") ---~ print(states.get_by_tag("update","rsync.server","unknown")) ---~ states.save("teststate", "update") ---~ states.load("teststate", "update") ---~ print(states.get_by_tag("update","rsync.server","unknown")) +-- data.update = { +-- ["version"] = { +-- ["major"] = 0, +-- ["minor"] = 1, +-- }, +-- ["rsync"] = { +-- ["server"] = "contextgarden.net", +-- ["module"] = "minimals", +-- ["repository"] = "current", +-- ["flags"] = "-rpztlv --stats", +-- }, +-- ["tasks"] = { +-- ["update"] = true, +-- ["make"] = true, +-- ["delete"] = false, +-- }, +-- ["platform"] = { +-- ["host"] = true, +-- ["other"] = { +-- ["mswin"] = false, +-- ["linux"] = false, +-- ["linux-64"] = false, +-- ["osx-intel"] = false, +-- ["osx-ppc"] = false, +-- ["sun"] = false, +-- }, +-- }, +-- ["context"] = { +-- ["available"] = {"current", "beta", "alpha", "experimental"}, +-- ["selected"] = "current", +-- }, +-- ["formats"] = { +-- ["cont-en"] = true, +-- ["cont-nl"] = true, +-- ["cont-de"] = false, +-- ["cont-cz"] = false, +-- ["cont-fr"] = false, +-- ["cont-ro"] = false, +-- }, +-- ["engine"] = { +-- ["pdftex"] = { +-- ["install"] = true, +-- ["formats"] = { +-- ["pdftex"] = true, +-- }, +-- }, +-- ["luatex"] = { +-- ["install"] = true, +-- ["formats"] = { +-- }, +-- }, +-- ["xetex"] = { +-- ["install"] = true, +-- ["formats"] = { +-- ["xetex"] = false, +-- }, +-- }, +-- ["metapost"] = { +-- ["install"] = true, +-- ["formats"] = { +-- ["mpost"] = true, +-- ["metafun"] = true, +-- }, +-- }, +-- }, +-- ["fonts"] = { +-- }, +-- ["doc"] = { +-- }, +-- ["modules"] = { +-- ["f-urwgaramond"] = false, +-- ["f-urwgothic"] = false, +-- ["t-bnf"] = false, +-- ["t-chromato"] = false, +-- ["t-cmscbf"] = false, +-- ["t-cmttbf"] = false, +-- ["t-construction-plan"] = false, +-- ["t-degrade"] = false, +-- ["t-french"] = false, +-- ["t-lettrine"] = false, +-- ["t-lilypond"] = false, +-- ["t-mathsets"] = false, +-- ["t-tikz"] = false, +-- ["t-typearea"] = false, +-- ["t-vim"] = false, +-- }, +-- } + +-- states.save("teststate", "update") +-- states.load("teststate", "update") + +-- print(states.get_by_tag("update","rsync.server","unknown")) +-- states.set_by_tag("update","rsync.server","oeps") +-- print(states.get_by_tag("update","rsync.server","unknown")) +-- states.save("teststate", "update") +-- states.load("teststate", "update") +-- print(states.get_by_tag("update","rsync.server","unknown")) diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua index 980a83f1a2b..7e2a67f1ba2 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua @@ -45,6 +45,7 @@ implement { name = "xmlatt", public = true, actions = lxml.att, implement { name = "xmlattdef", public = true, actions = lxml.att, arguments = "3 strings" } implement { name = "xmlattribute", public = true, actions = lxml.attribute, arguments = "3 strings" } implement { name = "xmlattributedef", public = true, actions = lxml.attribute, arguments = "4 strings" } +implement { name = "xmltexatt", public = true, actions = lxml.texatt, arguments = "2 strings" } implement { name = "xmlbadinclusions", public = true, actions = lxml.badinclusions, arguments = "string" } implement { name = "xmlchainatt", public = true, actions = lxml.chainattribute, arguments = { "string", "'/'", "string" } } implement { name = "xmlchainattdef", public = true, actions = lxml.chainattribute, arguments = { "string", "'/'", "string", "string" } } @@ -64,6 +65,8 @@ implement { name = "xmldirectivesafter", public = true, actions = lxml.directi implement { name = "xmldirectivesbefore", public = true, actions = lxml.directives.before, arguments = "string" } implement { name = "xmldisplayverbatim", public = true, actions = lxml.displayverbatim, arguments = "string" } implement { name = "xmlelement", public = true, actions = lxml.element, arguments = "2 strings" } -- could be integer but now we can alias +implement { name = "xmlfilename", public = true, actions = lxml.filename, arguments = "string" } +implement { name = "xmlfileline", public = true, actions = lxml.fileline, arguments = "string" } implement { name = "xmlfilter", public = true, actions = lxml.filter, arguments = "2 strings" } implement { name = "xmlfilterlist", public = true, actions = lxml.filterlist, arguments = "2 strings" } implement { name = "xmlfirst", public = true, actions = lxml.first, arguments = "2 strings" } @@ -211,7 +214,7 @@ if CONTEXTLMTXMODE > 0 then usage = "condition", arguments = "2 arguments", actions = function(id,pattern) - return boolean_code, not checkedempty(getid(id),pattern) and true + return boolean_code, checkedempty(getid(id),pattern) and true end } @@ -221,7 +224,7 @@ if CONTEXTLMTXMODE > 0 then usage = "condition", arguments = "argument", actions = function(id) - return boolean_code, not checkedempty(getid(id)) and true + return boolean_code, checkedempty(getid(id)) and true end } diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua index d242b07de92..e0c8ed30d36 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua @@ -1341,11 +1341,15 @@ expressions.print = function(...) return true end -expressions.find = find -expressions.upper = upper -expressions.lower = lower -expressions.number = tonumber -expressions.boolean = toboolean +expressions.find = function(str,...) + return str and find(str,...) +end + +expressions.upper = function(str) return str and upper(str) or "" end -- todo: utf +expressions.lower = function(str) return str and lower(str) or "" end -- todo: utf + +expressions.number = tonumber +expressions.boolean = toboolean function expressions.contains(str,pattern) local t = type(str) diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua index a06b5906540..f18c69deaaf 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua @@ -523,9 +523,16 @@ do [ [[~]] ] = "&U+7E;", } - local privates_n = { -- keeps track of defined ones + local privates_n = { + -- keeps track of defined ones } + utilities.storage.mark(privates_u) + utilities.storage.mark(privates_p) + utilities.storage.mark(privates_s) + utilities.storage.mark(privates_x) + utilities.storage.mark(privates_n) + local escaped = utf.remapper(privates_u,"dynamic") local unprivatized = utf.remapper(privates_p,"dynamic") local unspecialized = utf.remapper(privates_s,"dynamic") @@ -1466,7 +1473,11 @@ local f_attribute = formatters['%s=%q'] local function verbose_element(e,handlers,escape) -- options local handle = handlers.handle local serialize = handlers.serialize - local ens, etg, eat, edt, ern = e.ns, e.tg, e.at, e.dt, e.rn + local ens = e.ns + local etg = e.tg + local eat = e.at + local edt = e.dt + local ern = e.rn local ats = eat and next(eat) and { } if ats then -- we now sort attributes diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua index 520797883cd..56858772113 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua @@ -17,7 +17,7 @@ local lpegmatch = lpeg.match local P, S, C = lpeg.P, lpeg.S, lpeg.C local patterns = lpeg.patterns local setmetatableindex = table.setmetatableindex -local formatters, strip = string.formatters, string.strip +local formatters, strip, collapse = string.formatters, string.strip, utilities.strings.collapse local tex, xml = tex, xml local lowerchars, upperchars, lettered = characters.lower, characters.upper, characters.lettered @@ -34,6 +34,10 @@ local commands = commands local context = context local contextsprint = context.sprint -- with catcodes (here we use fast variants, but with option for tracing) +local ctx_doif = commands.doif +local ctx_doifnot = commands.doifnot +local ctx_doifelse = commands.doifelse + local synctex = luatex.synctex local implement = interfaces.implement @@ -644,7 +648,7 @@ function lxml.include(id,pattern,attribute,options) if filename then -- preprocessing if options.prepare then - filename = commands.preparedfile(filename) + filename = ctxrunner.preparedfile(filename) end -- handy if we have a flattened structure if options.basename then @@ -674,6 +678,20 @@ function lxml.include(id,pattern,attribute,options) stoptiming(xml) end +function lxml.filename(id) + local e = getid(id) + if e then + context(e.cf) + end +end + +function lxml.fileline(id) + local e = getid(id) + if e then + context(e.cl) + end +end + function lxml.inclusion(id,default,base) local inclusion = xmlinclusion(getid(id),default) if inclusion then @@ -1428,7 +1446,7 @@ local function all(collected) end end -local function reverse(collected) +texfinalizers.reverse = function(collected) if collected then local nc = #collected if nc >0 then @@ -1687,7 +1705,7 @@ local function ctxtext(collected) end end -local function stripped(collected) -- tricky as we strip in place +texfinalizers.stripped = function(collected) -- tricky as we strip in place if collected then local nc = #collected if nc > 0 then @@ -1698,7 +1716,16 @@ local function stripped(collected) -- tricky as we strip in place end end -local function lower(collected) +texfinalizers.collapsed = function(collected) + if collected and #collected > 0 then + local s = xmltext(collected[1]) + if s ~= "" then + sprint(collapse(s)) + end + end +end + +texfinalizers.lower = function(collected) if not collected then local nc = #collected if nc > 0 then @@ -1709,7 +1736,7 @@ local function lower(collected) end end -local function upper(collected) +texfinalizers.upper = function(collected) if collected then local nc = #collected if nc > 0 then @@ -1778,30 +1805,30 @@ local function depth(collected) contextsprint(ctxcatcodes,d) end +-- todo just move up as not used local + texfinalizers.first = first texfinalizers.last = last texfinalizers.all = all -texfinalizers.reverse = reverse texfinalizers.count = count texfinalizers.command = command texfinalizers.attribute = attribute -texfinalizers.param = parameter +texfinalizers.param = parameter -- obsolete texfinalizers.parameter = parameter texfinalizers.text = text -texfinalizers.stripped = stripped -texfinalizers.lower = lower -texfinalizers.upper = upper texfinalizers.ctxtext = ctxtext texfinalizers.context = ctxtext texfinalizers.position = position texfinalizers.match = match texfinalizers.index = index texfinalizers.concat = concatlist -texfinalizers.concatrange = concatrange +texfinalizers.concatrange = concatrange -- used below texfinalizers.chainattribute = chainattribute texfinalizers.chainpath = chainpath texfinalizers.default = all -- !! -texfinalizers.depth = depth +texfinalizers.depth = depth -- used below + +-- function texfinalizers.tag(collected,n) if collected then @@ -2070,6 +2097,24 @@ do end end + function lxml.texatt(id,a,default) + local e = getid(id) + if e then + local at = e.at + if at then + att = at[a] + if att ~= "" then +-- context(ctxcatcodes,att) + context(att) + end + else + att = "" + end + else + att = "" + end + end + function lxml.ifatt(id,a,value) local e = getid(id) if e then @@ -2114,10 +2159,6 @@ do contextsprint(notcatcodes,att) end - local ctx_doif = commands.doif - local ctx_doifnot = commands.doifnot - local ctx_doifelse = commands.doifelse - implement { name = "xmldoifatt", arguments = "3 strings", @@ -2328,14 +2369,12 @@ do local found, empty = xml.found, xml.empty - local doif, doifnot, doifelse = commands.doif, commands.doifnot, commands.doifelse - - function lxml.doif (id,pattern) doif (found(getid(id),pattern)) end - function lxml.doifnot (id,pattern) doifnot (found(getid(id),pattern)) end - function lxml.doifelse (id,pattern) doifelse(found(getid(id),pattern)) end - function lxml.doiftext (id,pattern) doif (not empty(getid(id),pattern)) end - function lxml.doifnottext (id,pattern) doifnot (not empty(getid(id),pattern)) end - function lxml.doifelsetext (id,pattern) doifelse(not empty(getid(id),pattern)) end + function lxml.doif (id,pattern) ctx_doif (found(getid(id),pattern)) end + function lxml.doifnot (id,pattern) ctx_doifnot (found(getid(id),pattern)) end + function lxml.doifelse (id,pattern) ctx_doifelse(found(getid(id),pattern)) end + function lxml.doiftext (id,pattern) ctx_doif (not empty(getid(id),pattern)) end + function lxml.doifnottext (id,pattern) ctx_doifnot (not empty(getid(id),pattern)) end + function lxml.doifelsetext (id,pattern) ctx_doifelse(not empty(getid(id),pattern)) end -- special case: "*" and "" -> self else lpath lookup @@ -2352,9 +2391,9 @@ do xml.checkedempty = checkedempty - function lxml.doifempty (id,pattern) doif (checkedempty(id,pattern)) end - function lxml.doifnotempty (id,pattern) doifnot (checkedempty(id,pattern)) end - function lxml.doifelseempty(id,pattern) doifelse(checkedempty(id,pattern)) end + function lxml.doifempty (id,pattern) ctx_doif (checkedempty(id,pattern)) end + function lxml.doifnotempty (id,pattern) ctx_doifnot (checkedempty(id,pattern)) end + function lxml.doifelseempty(id,pattern) ctx_doifelse(checkedempty(id,pattern)) end end @@ -2849,3 +2888,55 @@ do -- end end + +do + + local lpegmatch = lpegmatch + local unescaper = lpeg.patterns.urlunescaper + + function xmlfinalizers.url(e,a) + local u = #e > 0 and e[1].at[a] + return u and lpegmatch(unescaper,u) + end + + if CONTEXTLMTXMODE > 0 then + + function texfinalizers.url(e,a) + local u = #e > 0 and e[1].at[a] + if u then + contextsprint(tex.hshcatcodes,string.texhashed(lpegmatch(unescaper,u))) + end + end + + else + + function texfinalizers.url(e,a) + local u = #e > 0 and e[1].at[a] + if u then + -- context.verbatim(lpegmatch(unescaper,u)) -- no hash intercept here, verbatim is new per 23-09-06 + context(lpegmatch(unescaper,u)) + end + end + + end + +end + +if CONTEXTLMTXMODE > 0 then + + local setmacro = tokens.setters.macro + + xmlfinalizers.tomacro = function(collected,macroname,index) + if macroname and macroname ~= '' then + if index == 'last' then + index = #collected + elseif index == 'first' then + index = 1 + else + index = tonumber(index) or 1 + end + setmacro(tex.nilcatcodes,macroname,collapse(xmltext(collected[index]))) + end + end + +end diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua b/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua index b4270462969..064a20ea3fb 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua @@ -312,11 +312,11 @@ end -- we could move the defs from math-act here -local function accent_to_extensible(target,newchr,original,oldchr,height,depth,swap,offset,unicode) +local function accent_to_extensible(target,newchr,original,oldchr,height,depth,swap,offset,unicode,force) local characters = target.characters local olddata = characters[oldchr] -- brrr ... pagella has only next - if olddata and not olddata.commands then -- not: and olddata.width > 0 + if force or (olddata and not olddata.commands) then -- not: and olddata.width > 0 local addprivate = fonts.helpers.addprivate if swap then swap = characters[swap] @@ -412,14 +412,14 @@ virtualcharacters[0xFE33E] = function(data) local target = data.target local height = 0 local depth = target.parameters.xheight/4 - return accent_to_extensible(target,0xFE33E,data.original,0x0305,height,depth,nil,nil,0x203E) + return accent_to_extensible(target,0xFE33E,data.original,0x0305,height,depth,nil,nil,0x203E,true) end virtualcharacters[0xFE33F] = function(data) local target = data.target local height = target.parameters.xheight/8 local depth = height - return accent_to_extensible(target,0xFE33F,data.original,0x0305,height,depth,nil,nil,0x203E) + return accent_to_extensible(target,0xFE33F,data.original,0x0305,height,depth,nil,nil,0x203E,true) end -- spacing (no need for a cache of widths) diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua index 688f682c8ac..b40e4e74890 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua @@ -82,8 +82,10 @@ local classes = allocate { exponential = 0, limop = 1, -- mathlimopcomm @@mathlimopcomm nolop = 1, -- mathnolopcomm @@mathnolopcomm + integral = 1, -- new in lmtx but here still an operator -- ordinary = 0, -- ord + operator = 1, -- op alphabetic = 7, -- alpha punctuation = 6, -- punct opening = 4, -- open @@ -430,7 +432,7 @@ end local function utfmathlimop(chr) local cd = somechar[chr] - return cd and cd.mathclass == "limop" or false + return cd and (cd.mathclass == "operator" or cd.mathclass == "integral") or false end local function utfmathaccent(chr,default,asked1,asked2) diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv index a955e9284f5..66a65b25972 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv @@ -1001,6 +1001,11 @@ \fi \to \everysetupmathematics +%D \starttyping +%D \setupmathematics[ampersand=normal] +%D $\eqalign{a&=a'\cr}$ +%D \stoptyping + %D A simplified version of this code is: %D %D \starttyping diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua b/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua index 5bbe5cb3a3b..4fc11caade1 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua @@ -389,13 +389,13 @@ process = function(start) -- we cannot use the processor as we have no finalizer setattr(start,a_tagged,start_tagged("mrow")) process(list) stop_tagged() - elseif actionstack[#actionstack] == action then + elseif actionstack[#actionstack] == detail then setattr(start,a_tagged,start_tagged("mrow")) process(list) stop_tagged() else - insert(actionstack,action) - setattr(start,a_tagged,start_tagged("mrow",{ detail = action })) + insert(actionstack,detail) + setattr(start,a_tagged,start_tagged("mrow",{ detail = detail })) process(list) stop_tagged() remove(actionstack) diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/meta-tex.lua index c2f72bcf3c7..e4c02488270 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/meta-tex.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/meta-tex.lua @@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['meta-tex'] = { } local tostring, tonumber = tostring, tonumber -local format = string.format +local format, find, gsub = string.format, string.find, string.gsub local formatters = string.formatters local P, S, R, C, Cs, lpegmatch = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Cs, lpeg.match @@ -51,11 +51,21 @@ do end local number = tonumber(num) if number then - local base, exponent = lpegmatch(enumber,formatters[lpegmatch(cleaner,fmt)](number)) - if base and exponent then - context.MPexponent(base,exponent) + if find(fmt,"[mMfFgG]$") then + local clean = gsub(fmt,"@","%%") + context(formatters[clean](number)) + elseif find(fmt,"[dD]$") then + local clean = gsub(fmt,"[dD]$","") + clean = gsub(clean,"@","%%") + context.digits(formatters[clean](number)) else - context(number) + local clean = lpegmatch(cleaner,fmt) + local base, exponent = lpegmatch(enumber,formatters[clean](number)) + if base and exponent then + context.MPexponent(base,exponent) + else + context(number) + end end else context(tostring(num)) @@ -126,7 +136,7 @@ do arguments = "2 strings", } - utilities.strings.formatters.add(formatters,"texexp", [[texexp(...)]], { texexp = metapost.texexp }) + utilities.strings.formatters.add(formatters,"texexp", [[texexp(...)]], { texexp = metapost.texexp }) local f_textext = formatters[ [[textext("%s")]] ] local f_mthtext = formatters[ [[textext("\mathematics{%s}")]] ] diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex index 16f8a540858..e446012e14d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex +++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex @@ -16,6 +16,7 @@ % usage: context --extra=compare [options] file-1 file-2 % % example: context --extra=compare file1.pdf file-2.pdf +% context --extra=compare file1.pdf file-2.pdf --colors=red,blue % % end help @@ -23,18 +24,47 @@ \starttext +\definecolor[colorred] [r=1,a=1,t=.5] +\definecolor[colorgreen] [g=1,a=1,t=.5] +\definecolor[colorblue] [b=1,a=1,t=.5] +\definecolor[colorgray] [s=0,a=1,t=.5] +\definecolor[colorcyan] [g=1,b=1,a=1,t=.5] +\definecolor[colormagenta][r=1,b=1,a=1,t=.5] +\definecolor[coloryellow] [r=1,g=1,a=1,t=.5] + \starttexdefinition unexpanded ShowBoth #1#2#3 \startTEXpage[width=21cm] - \startoverlay - {\externalfigure[#1][page=#3,width=21cm]} - {\externalfigure[#2][page=#3,width=21cm]} - \stopoverlay + \doifelsecolor {colorone} { + \startoverlay + {{\char0\externalfigure[#1][page=#3,width=21cm,foregroundcolor=colorone]}} + {{\char0\externalfigure[#2][page=#3,width=21cm,foregroundcolor=colortwo]}} + \stopoverlay + } { + \startoverlay + {\externalfigure[#1][page=#3,width=21cm]} + {\externalfigure[#2][page=#3,width=21cm]} + \stopoverlay + } + \stopTEXpage +\stoptexdefinition + +\starttexdefinition unexpanded ShowOne #1#2 + \startTEXpage[width=21cm] + \doifelsecolor {colorone} { + \color[colorone]{\char0\externalfigure[#1][page=#2,width=21cm]} + } { + \externalfigure[#1][page=#2,width=21cm] + } \stopTEXpage \stoptexdefinition -\starttexdefinition unexpanded ShowPage #1#2 +\starttexdefinition unexpanded ShowTwo #1#2 \startTEXpage[width=21cm] - \externalfigure[#1][page=#2,width=21cm] + \doifelsecolor {colorone} { + \color[colortwo]{\char0\externalfigure[#1][page=#2,width=21cm]} + } { + \externalfigure[#1][page=#2,width=21cm] + } \stopTEXpage \stoptexdefinition @@ -45,6 +75,31 @@ local report = logs.reporter("compare") local fileone = document.files[1] or "" local filetwo = document.files[2] or "" +local colorone = false +local colortwo = false + +local colors = document.arguments.colors + +if colors then + colorone, colortwo = string.splitup(colors,",") +end + +local valid = { + red = "colorred", + green = "colorgreen", + blue = "colorblue", + cyan = "colorcyan", + magenta = "colormagenta", + yellow = "coloryellow", + gray = "colorgray", + grey = "colorgray", +} + +if valid[colorone] and valid[colortwo] then + context.definecolor({ "colorone" }, { valid[colorone] }) + context.definecolor({ "colortwo" }, { valid[colortwo] }) +end + if fileone == "" or filetwo == "" then report("provide two filenames") os.exit() @@ -94,14 +149,14 @@ if n_one > n_two then context.ShowBoth(fileone,filetwo,i) end for i=n_two+1,n_one do - context.ShowPage(fileone,i) + context.ShowOne(fileone,i) end else for i=1,n_one do context.ShowBoth(fileone,filetwo,i) end for i=n_one+1,n_two do - context.ShowPage(filetwo,i) + context.ShowTwo(filetwo,i) end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-copy.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-copy.tex index d29f1d07ce2..2024aa74b5d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-copy.tex +++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-copy.tex @@ -1,5 +1,3 @@ -% engine=luatex - %D \module %D [ file=mtx-context-copy, %D version=2008.11.10, % about that time i started playing with this @@ -23,14 +21,9 @@ % % end help -\input mtx-context-common.tex +\continuewhenlmtxmode -\doif {\getdocumentargument{interaction}} {yes} { - \setupinteraction - [state=start] - \setupexternalfigures - [interaction=yes] -} +\input mtx-context-common.tex \setupexternalfigures [directory=] @@ -43,23 +36,113 @@ \setuplayout [page] -% this will be an option to \copypages +\doif {\getdocumentargument{interaction}} {yes} { + \setupinteraction + [state=start] + \setupexternalfigures + [interaction=yes] +} -\unexpanded\def\CopyPages[#1]% - {\dorecurse - {\noffigurepages} - {\startTEXpage - \externalfigure[#1][page=\recurselevel]% - \stopTEXpage}} +\doif {\getdocumentargument{tracelinks}} {yes} { + \enabletrackers[figures.links] +% \enabletrackers[refer*] +% \enabletrackers[dest*] +} + +\starttexdefinition CopyPages #1 + + \filterpages[#1][all][alternative=page] + +\stoptexdefinition + +\starttexdefinition CopyEntry #1#2#3#4 + + \doifelsesomething {#4} { + \setupinteraction + [state=start] + \setupexternalfigures + [interaction={#4}] + \writestatus + {filter pages} + {file #1, first page #2, last page #3, interaction '#4'} + + } { + \setupinteraction + [state=stop] + \setupexternalfigures + [interaction=] + \writestatus + {filter pages} + {file #1, first page #2, last page #3} + } + + \filterpages[#1][#2:#3][alternative=page] + +\stoptexdefinition \starttext +% return { +% comment = "tugboat 137", +% list = { +% { +% filename = "tb137complete", +% first = 1, +% last = 1, +% interaction = "all" +% pageoffset = -1, +% +% }, +% { +% filename = "issue", +% first = 2, +% last = 123, +% interaction = "all" +% }, +% { +% filename = "issue", +% first = 124, +% last = 125, +% interaction = "all" +% pageoffset = -1, +% }, +% }, +% } + \startluacode local find = string.find if #document.files == 0 then context("no files given") + elseif document.arguments.template then + local filename = file.addsuffix(document.files[1],"lua") + local template = table.load(filename) + if template then + local list = template.list + if type(list) == "table" then + for i=1,#list do + local entry = list[i] + local filename = entry.filename or "" + local first = tonumber(entry.first) or 1 + local last = tonumber(entry.last) or "*" + local interaction = entry.interaction or "" + local pageoffset = tonumber(entry.pageoffset) + local minheight = tonumber(entry.minheight) + if interaction ~= "" then + if pageoffset then + interaction = interaction .. ",pageoffset:" .. pageoffset + end + if minheight then + interaction = interaction .. ",minheight:" .. minheight + end + end + context.CopyEntry(filename,first,last,interaction) + end + end + else + logs.report("copy","invalid or missing template file") + end else if document.arguments.pattern then document.files = dir.glob(document.arguments.pattern) @@ -68,12 +151,7 @@ local filename = document.files[i] if not find(filename,"^mtx%-context%-") and not find(filename,"^context%-extra") then logs.report("copy",filename) - context.getfiguredimensions - { filename } - context.setuppapersize - { "fit" } - context.CopyPages - { filename } + context.CopyPages(filename) end end end @@ -82,7 +160,6 @@ \stoptext - % def copyoutput % copyortrim(false,'copy') % end diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua index b0aba96d694..96211fe6327 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua @@ -7450,6 +7450,12 @@ return { ["en"]="alignmentrightwidth", ["fr"]="largeurdroitealignement", }, + ["interscriptfactor"]={ + ["en"]="interscriptfactor", + }, + ["alignscripts"]={ + ["en"]="alignscripts", + }, ["alignsymbol"]={ ["en"]="alignsymbol", ["fr"]="alignersursymbol", @@ -7634,6 +7640,9 @@ return { ["pe"]="عرض‌خودکار", ["ro"]="autolatime", }, + ["autointervals"]={ + ["en"]="autointervals", + }, ["autopunctuation"]={ ["en"]="autopunctuation", ["fr"]="autoponctuation", @@ -7963,6 +7972,9 @@ return { ["pe"]="وضعیت‌پایین", ["ro"]="starejos", }, + ["bottomstyle"]={ + ["en"]="bottomstyle", + }, ["break"]={ ["en"]="break", ["fr"]="saut", @@ -8402,6 +8414,9 @@ return { ["pe"]="دش", ["ro"]="dash", }, + ["dashstep"]={ + ["en"]="dashstep", + }, ["dat"]={ ["cs"]="dat", ["de"]="dat", @@ -8502,6 +8517,9 @@ return { ["pe"]="تصحیح‌عمق", ["ro"]="corectieadancime", }, + ["differentiald"]={ + ["en"]="differentiald", + }, ["direction"]={ ["cs"]="smer", ["de"]="richtung", @@ -8536,6 +8554,9 @@ return { ["en"]="displaythreshold", ["fr"]="seuilaffichage", }, + ["displayfactor"]={ + ["en"]="displayfactor", + }, ["distance"]={ ["cs"]="vzdalenost", ["de"]="abstand", @@ -9351,6 +9372,12 @@ return { ["en"]="hyphens", ["fr"]="traitsdunion", }, + ["hz"]={ + ["en"]="hz", + }, + ["vz"]={ + ["en"]="vz", + }, ["icommand"]={ ["cs"]="iprikaz", ["de"]="ibefehl", @@ -9450,6 +9477,9 @@ return { ["en"]="inlinethreshold", ["fr"]="seuilenligne", }, + ["inlinefactor"]={ + ["en"]="inlinefactor", + }, ["inner"]={ ["cs"]="vnitrni", ["de"]="innen", @@ -9878,6 +9908,10 @@ return { ["pe"]="مرحله‌ها", ["ro"]="nivele", }, + ["limit"]={ + ["en"]="limit", + ["nl"]="beperk", + }, ["limittext"]={ ["cs"]="limittext", ["de"]="limittext", @@ -9888,6 +9922,10 @@ return { ["pe"]="مرزمتن", ["ro"]="limittext", }, + ["limitstretch"]={ + ["en"]="limitstretch", + ["nl"]="limietrek", + }, ["line"]={ ["cs"]="radek", ["de"]="zeile", @@ -10080,6 +10118,9 @@ return { ["en"]="mathclass", ["fr"]="classemath", }, + ["mathmeaning"]={ + ["en"]="mathmeaning", + }, ["leftclass"]={ ["en"]="leftclass", }, @@ -10151,6 +10192,9 @@ return { ["pe"]="منو", ["ro"]="meniu", }, + ["metadata"]={ + ["en"]="metadata", + }, ["method"]={ ["cs"]="metoda", ["de"]="methode", @@ -10634,6 +10678,16 @@ return { ["pe"]="حاشیه‌فرد", ["ro"]="margineimpara", }, + ["off"]={ + ["cs"]="vyp", + ["de"]="aus", + ["en"]="off", + ["fr"]="arret", + ["it"]="disattivo", + ["nl"]="uit", + ["pe"]="خاموش", + ["ro"]="dezactivat", + }, ["offset"]={ ["cs"]="offset", ["de"]="offset", @@ -10644,6 +10698,16 @@ return { ["pe"]="آفست", ["ro"]="offset", }, + ["on"]={ + ["cs"]="zap", + ["de"]="an", + ["en"]="on", + ["fr"]="marche", + ["it"]="attivo", + ["nl"]="aan", + ["pe"]="روی", + ["ro"]="on", + }, ["openaction"]={ ["cs"]="otevriakci", ["de"]="oeffenaktion", @@ -10716,6 +10780,9 @@ return { ["pe"]="حاشیه‌خارجی", ["ro"]="outermargin", }, + ["overflow"]={ + ["en"]="overflow", + }, ["overprint"]={ ["cs"]="overprint", ["de"]="overprint", @@ -12554,6 +12621,9 @@ return { ["pe"]="وضعیت‌بالا", ["ro"]="staresus", }, + ["topstyle"]={ + ["en"]="topstyle", + }, ["totalnumber"]={ ["en"]="totalnumber", ["fr"]="nombretotal", @@ -15082,6 +15152,10 @@ return { ["en"]="camel", ["fr"]="camel", }, + ["Camel"]={ + ["en"]="Camel", + ["fr"]="Camel", + }, ["cap"]={ ["cs"]="kap", ["de"]="kap", @@ -15352,6 +15426,16 @@ return { ["pe"]="فضای‌برش", ["ro"]="cutspace", }, + ["dash"]={ + ["cs"]="pomlcka", + ["de"]="strich", + ["en"]="dash", + ["fr"]="pointille", + ["it"]="dash", + ["nl"]="streep", + ["pe"]="دش", + ["ro"]="dash", + }, ["dataset"]={ ["en"]="dataset", ["fr"]="jeudedonnees", @@ -15436,6 +15520,9 @@ return { ["pe"]="نمایش", ["ro"]="display", }, + ["document"]={ + ["en"]="document", + }, ["dot"]={ ["cs"]="tecka", ["de"]="punkt", @@ -15534,6 +15621,9 @@ return { ["pe"]="ته‌نوشت", ["ro"]="endnote", }, + ["mathnote"]={ + ["en"]="mathnote", + }, ["enumeration"]={ ["cs"]="vycet", ["de"]="nummerierung", @@ -15731,6 +15821,10 @@ return { ["pe"]="ثابت", ["ro"]="fixat", }, + ["spread"]={ + ["en"]="spread", + ["nl"]="gespreid", + }, ["flexible"]={ ["cs"]="prizpusobive", ["de"]="flexibel", @@ -16040,6 +16134,14 @@ return { ["pe"]="بیاویز", ["ro"]="suspenda", }, + ["hangleft"]={ + ["en"]="hangleft", + ["nl"]="hanglinks", + }, + ["hangright"]={ + ["en"]="hangright", + ["nl"]="hangrechts", + }, ["hanging"]={ ["cs"]="visici", ["de"]="haengend", @@ -16188,14 +16290,10 @@ return { ["ro"]="despsilabe", }, ["hz"]={ - ["cs"]="hz", - ["de"]="hz", ["en"]="hz", - ["fr"]="hz", - ["it"]="hz", - ["nl"]="hz", - ["pe"]="hz", - ["ro"]="hz", + }, + ["vz"]={ + ["en"]="vz", }, ["inbetween"]={ ["cs"]="mezi", @@ -16751,6 +16849,10 @@ return { ["en"]="letterspacing", ["fr"]="espacementlettre", }, + ["limit"]={ + ["en"]="limit", + ["nl"]="beperk", + }, ["line"]={ ["cs"]="radek", ["de"]="zeile", @@ -17622,6 +17724,12 @@ return { ["pe"]="لبه‌خارجی", ["ro"]="outeredge", }, + ["outlined"]={ + ["en"]="outlined", + }, + ["outline"]={ + ["en"]="outline", + }, ["outermargin"]={ ["cs"]="outermargin", ["de"]="outermargin", @@ -18465,6 +18573,16 @@ return { ["pe"]="six", ["ro"]="six", }, + ["size"]={ + ["cs"]="velikost", + ["de"]="groesse", + ["en"]="size", + ["fr"]="taille", + ["it"]="dimensione", + ["nl"]="formaat", + ["pe"]="اندازه", + ["ro"]="dimensiune", + }, ["slanted"]={ ["cs"]="sklonene", ["de"]="geneigt", @@ -19244,6 +19362,10 @@ return { ["fr"]="resserre", ["nl"]="krap", }, + ["verytight"]={ + ["en"]="verytight", + ["nl"]="heelkrap", + }, ["title"]={ ["cs"]="titul", ["de"]="titel", @@ -19264,6 +19386,9 @@ return { ["pe"]="تغییر", ["ro"]="toggle", }, + ["granular"]={ + ["en"]="granular", + }, ["tolerant"]={ ["cs"]="tolerantni", ["de"]="tolerant", diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua index 0926b5d1287..53fa4dacd2c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua @@ -50,6 +50,8 @@ return { "matrixbox", "matrixcell", "matrixspan", -- "pensilcolor", "pensilstep", + -- + "uu" }, commands = { "loadfile", "loadimage", "loadmodule", @@ -239,5 +241,8 @@ return { "xnormalized", "ynormalized", "xynormalized", "phantom", "scrutinized", + -- + "xshifted", + "yshifted", }, } diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua index 69655ee3884..c73a2726512 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua @@ -19,11 +19,13 @@ return { "points", "halfpoint", "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip", "centeringfillskip", "stretchingfillskip", "shrinkingfillskip", + "centeringfilllskip", "stretchingfilllskip", "shrinkingfilllskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty", - "thickermuskip", + "thickermuskip", "continuationmuskip", "fencemuskip", "mathinterwordmuskip", + "zerofloat", -- "directionlefttoright", "directionrighttoleft", -- @@ -73,6 +75,7 @@ return { "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode", + "zeroasciicode", "nineasciicode", "alowercaseasciicode", "zlowercaseasciicode", -- "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode", "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode", @@ -80,7 +83,7 @@ return { "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode", "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode", "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode", - "mathpenaltyfrozenparcode", + "emergencyfrozenparcode", "parpassesfrozenparcode", "singlelinepenaltyfrozenparcode", -- "activemathcharcode", -- @@ -115,14 +118,21 @@ return { "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", "extendaccentsmathcontrolcode", "extenddelimitersmathcontrolcode", -- - "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", - "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode", - "noitaliccorrectionglyphoptioncode", "islargeoperatorglyphoptioncode", "hasitalicshapeglyphoptioncode", - -- "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode", "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode", "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode", -- + "normalparbegincode", "forceparbegincode", "indentparbegincode", "noindentparbegincode", "mathcharparbegincode", + "charparbegincode", "boundaryparbegincode", "spaceparbegincode", "mathparbegincode", + "kernparbegincode", "hskipparbegincode", "unhboxparbegincode", "valignparbegincode", + "vruleparbegincode", + -- + "fixedsuperorsubscriptsmodecode", "fixedsuperandsubscriptsmodecode", "ignoreemptyscriptsmodecode", + "ignoreemptysuperscriptsmodecode", "ignoreemptysubscriptsmodecode", "ignoreemptyprimescriptsmodecode", + -- + "inheritclassdoublescriptmodecode", "discardshapekerndoublescriptmodecode", + "realignscriptsdoublescriptmodecode", "reorderprescriptsdoublescriptmodecode", + -- "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode", "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode", "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode", @@ -153,7 +163,7 @@ return { "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument", "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule","setupmodule","currentmoduleparameter","moduleparameter", - "everystarttext", "everystoptext", + "everystarttext", "everystoptext", "everyforgetall", "luaenvironment", -- "startTEXpage", "stopTEXpage", -- "startMPpage", "stopMPpage", -- already catched by nested lexer @@ -167,15 +177,16 @@ return { "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode", "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode", "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode", - "mathfractioncode", "mathmiddlecode", "mathaccentcode", "mathfencedcode", "mathghostcode", + "mathfractioncode", "mathmiddlecode", "mathprimecode", "mathaccentcode", "mathfencedcode", "mathghostcode", "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode", "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode", - "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", - "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", + "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", "mathcontinuationcode", + "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathintegralcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", -- "mathtopaccentcode", "mathbottomaccentcode", "mathdelimitercode", "mathrootcode", "mathprintcode", -- "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode", + "mathchemicalbondcode", "mathimplicationcode", -- "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", -- @@ -193,7 +204,7 @@ return { -- "Ux", "eUx", -- - "parfillleftskip", "parfillrightskip", + -- "parfillleftskip", "parfillrightskip", -- "startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode", -- @@ -209,7 +220,7 @@ return { "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode", -- - "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", + "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", "limitprevgrafnormalizeparcode", -- "nopreslackclassoptioncode", "nopostslackclassoptioncode", "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", @@ -219,13 +230,25 @@ return { "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode", - "operatoritaliccorrectionclassoptioncode", + "operatoritaliccorrectionclassoptioncode", "shortinlineclassoptioncode", + "pushnestingclassoptioncode", "popnestingclassoptioncode", "obeynestingclassoptioncode", + -- + "noitaliccorrectionglyphoptioncode", "nozeroitaliccorrectionglyphoptioncode", + "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", + "noleftkernglyphoptioncode", "norightkernglyphoptioncode", + "noleftligatureglyphoptioncode", "norightligatureglyphoptioncode", + "textcheckitalicglyphoptioncode", "mathcheckitalicglyphoptioncode", -- - "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", - "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", - "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode", - -- extras: - "nokerningcode", "noligaturingcode", + -- "noitaliccorrectionmathoptioncode", "noleftpairkernmathoptioncode", "norightpairkernmathoptioncode", + -- "autodiscretionarymathoptioncode", "fulldiscretionarymathoptioncode", + -- "ignoredcharactermathoptioncode", "islargeoperatormathoptioncode", "hasitalicshapemathoptioncode", + -- + "nokerningcode", "noligaturingcode", "noitalicscode", + -- + "indecentparpassclasses", "looseparpassclasses", "tightparpassclasses", + "verylooseparpassclass", "looseparpassclass", "semilooseparpassclass", + "decentparpassclass", "almostdecentparpassclasses", + "semitightparpassclass", "tightparpassclass", -- "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode", @@ -233,11 +256,17 @@ return { "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode", -- "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode", + "preferbreakdiscoptioncode", "prefernobreakdiscoptioncode", + "noitaliccorrectiondiscoptioncode", "nozeroitaliccorrectiondiscoptioncode", + "textcheckitalicdiscoptioncode", -- "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode", + -- + "uunit" }, ["helpers"] = { -- + "pushglobalsetups", "popglobalsetups", "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", @@ -261,6 +290,7 @@ return { -- "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newfloat", "newlanguage", "newfamily", "newfam", "newhelp", -- not used + "newuserunit", -- "newinteger", "newdimension", "newgluespec", "newmugluespec", "newposit", "aliasinteger", "aliasdimension", "aliasposit", @@ -270,6 +300,8 @@ return { -- "autorule", -- + "tobit", "tobits", "tohexa", + -- "strippedcsname","checkedstrippedcsname", -- "nofarguments", @@ -281,13 +313,14 @@ return { "sixthargumentfalse", "sixthargumenttrue", "seventhargumentfalse", "seventhargumenttrue", -- - "vkern", "hkern", "vpenalty", "hpenalty", + -- "vkern", "hkern", "vpenalty", "hpenalty", -- native in mkxl -- "doglobal", "dodoglobal", "redoglobal", "resetglobal", -- "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall", -- "donetrue", "donefalse", "foundtrue", "foundfalse", + "globaldonetrue", "globaldonefalse", "globalfoundtrue", "globalfoundfalse", -- "inlineordisplaymath", "indisplaymath", "forcedisplaymath", "startforceddisplaymath", "stopforceddisplaymath", "startpickupmath", "stoppickupmath", "reqno", "forceinlinemath", @@ -323,6 +356,7 @@ return { -- "scratchstring", "scratchstringone", "scratchstringtwo", "tempstring", "scratchcounter", "globalscratchcounter", "privatescratchcounter", + "scratchfloat", "globalscratchfloat", "privatescratchfloat", "scratchdimen", "globalscratchdimen", "privatescratchdimen", "scratchskip", "globalscratchskip", "privatescratchskip", "scratchmuskip", "globalscratchmuskip", "privatescratchmuskip", @@ -354,20 +388,25 @@ return { "givenwidth", "givenheight", "givendepth", "scangivendimensions", -- "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal", "scratchitalic", - "scratchhsize", "scratchvsize", + "scratchhsize", "scratchvsize", "scratchclass", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", -- "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchcounterfour", "scratchcounterfive", "scratchcountersix", + "scratchfloatone", "scratchfloattwo", "scratchfloatthree", "scratchfloatfour", "scratchfloatfive", "scratchfloatsix", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchdimenfour", "scratchdimenfive", "scratchdimensix", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchskipfour", "scratchskipfive", "scratchskipsix", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchmuskipfour", "scratchmuskipfive", "scratchmuskipsix", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchtoksfour", "scratchtoksfive", "scratchtokssix", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchboxfour", "scratchboxfive", "scratchboxsix", "scratchnx", "scratchny", "scratchmx", "scratchmy", - "scratchunicode", + "scratchunicode", "scratchunicodeone", "scratchunicodetwo", "scratchunicodethree", "scratchmin", "scratchmax", + "scratchread", "scratchwrite", + -- + "pfsin", "pfcos", "pftan", "pfasin", "pfacos", "pfatan", "pfsinh", "pfcosh", "pftanh", "pfasinh", "pfacosh", "pfatanh", + "pfsqrt", "pflog", "pfexp", "pfceil", "pffloor", "pfround", "pfabs", "pfrad", "pfdeg", "pfatantwo", "pfpow", "pfmod", "pfrem", -- "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", -- @@ -399,7 +438,7 @@ return { "doifinstring", "doifnotinstring", "doifelseinstring", "doifinstringelse", "doifelseassignment", "doifassignmentelse", "docheckassignment", "doifelseassignmentcs", "doifassignmentelsecs", "validassignment", "novalidassignment", - "doiftext", "doifelsetext", "doiftextelse", "doifnottext", + "doiftext", "doifelsetext", "doiftextelse", "doifnottext", "validtext", -- "quitcondition", "truecondition", "falsecondition", -- @@ -424,7 +463,8 @@ return { "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "removepunctuation", "ignoreparskip", "forcestrutdepth", "onlynonbreakablespace", -- - "wait", "writestatus", "define", "defineexpandable", "redefine", + "wait", "writestatus", "writeline", "define", + "defineexpandable", "redefine", -- "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "directmeasure", @@ -496,6 +536,7 @@ return { -- "strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight", "leftboundary", "rightboundary", "signalcharacter", + "ascender", "descender", "capheight", -- "aligncontentleft", "aligncontentmiddle", "aligncontentright", -- @@ -553,9 +594,6 @@ return { -- "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", - "normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript", "normalprimescript", - "superscript", "subscript", "nosuperscript", "nosubscript", "primescript", - "superprescript", "subprescript", "nosuperprescript", "nosubsprecript", -- "uncramped", "cramped", "mathstyletrigger", "triggermathstyle", "triggeredmathstyle", @@ -574,11 +612,13 @@ return { "expdoifelsecommon", "expdoifcommonelse", "expdoifelseinset", "expdoifinsetelse", -- + "glyphscaled", -- will change + -- "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", - "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch", + "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch", "ctxluamatchfile", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", @@ -592,6 +632,7 @@ return { "freezeparagraphproperties", "defrostparagraphproperties", "setparagraphfreezing", "forgetparagraphfreezing", "updateparagraphproperties", "updateparagraphpenalties", "updateparagraphdemerits", "updateparagraphshapes", "updateparagraphlines", + "updateparagraphpasses", -- "lastlinewidth", -- @@ -628,7 +669,7 @@ return { -- "unsupportedcs", -- - "openout", "closeout", "write", "openin", "closein", "read", "readline", "readfromterminal", + "openout", "closeout", "write", "openin", "closein", "read", "readline", "readlinedirect", "readfromterminal", -- "boxlines", "boxline", "setboxline", "copyboxline", "boxlinewd","boxlineht", "boxlinedp", @@ -663,6 +704,31 @@ return { "newlocalwrite", "newlocalread", "setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox", -- - "ifexpression" + "ifexpression", + -- + "localcontrolledrepeating", "expandedrepeating", "unexpandedrepeating", + -- + "lastchkinteger", "ifchkinteger", + -- + -- "mathopen", "mathclose", "mathinner", + "mathordinary", "mathoperator", "mathbinary", "mathrelation", "mathpunctuation", "mathfraction", + "mathradical", "mathmiddle", "mathaccent", "mathfenced", "mathghost", "mathvariable", "mathactive", + "mathvcenter", "mathimaginary", "mathdifferential", "mathexponential", "mathdigit", "mathdivision", + "mathfactorial", "mathwrapped", "mathconstruct", "mathdimension", "mathunary", "mathchemicalbond", + "mathimplication", + -- "mathfunction", "mathexplicit", "mathbegin", "mathend", + -- + "filebasename", "filenameonly", "filedirname", "filesuffix", + -- + "setmathoption", "resetmathoption", + -- + "Ustack", "Umathdict", "Umathclass", + "Ustyle", "Uchar", + "Usuperscript", "Usubscript", "Unosuperscript", "Unosubscript", "Uprimescript", + "Usuperprescript", "Usubprescript", "Unosuperprescript", "Unosubprescript", + -- + "ignorefile", + -- + "boxwidth", "boxheight", "boxdepth", } } diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua index 65ae022c0bb..d26604599db 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua @@ -610,7 +610,7 @@ return { ["fonts:14"] = { cs = "bodyfont %a is defined (can better be done global)", de = "Fliesstext %a wurde definiert (besser waere globale Definition)", - en = "bodyfont %a is defined (can better be done global)", + en = "bodyfont %a is defined (can better be done global (maybe use \\usebodyfont)", fr = "policecorps %a est défini (une définition globale pourrait être plus adéquat)", it = "corpo del testo %a definito (sarebbe meglio globale)", nl = "korps %a is gedefinieerd (kan beter globaal plaatsvinden)", diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua index cfa8215170f..80a44b1c7d2 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua @@ -3,80 +3,74 @@ return { "btex", "etex", "verbatimtex", }, shortcuts = { - "..", "...", "--", "---", "&", "&&", "\\", + "..", "...", "--", "---", "&", "&&", "&&&", "&&&&", "\\", }, - primitives = { -- to be checked - "charcode", "day", "linecap", "linejoin", "miterlimit", "stacking", "month", "pausing", - "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", - "tracingcommands", "tracingequations", "tracinglostchars", - "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", - "tracingspecs", "tracingstats", "tracingtitles", "truecorners", - "warningcheck", "year", - "false", "nullpicture", "pencircle", "penspec", "true", - "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", - "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", - "hex", "infont", "intersectiontimes", "known", "void", "length", "llcorner", - "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", - "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", - "postcontrol", "precontrol", "reverse", "rotated", "scaled", - "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", - "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", - "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", - "yypart", "zscaled", - "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "setgroup", - "shipout", "show", "showdependencies", "showtoken", "showvariable", - "special", - "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", - "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", - "tertiary", "primarydef", "secondarydef", "tertiarydef", - "randomseed", "also", "contour", "doublepath", - "withcolor", "withcmykcolor", "withpen", "withstacking", - "dashed", - "envelope", - "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", - "forsuffixes", "step", "until", - "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", - "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", - "fontmaking", "charexists", - "cullit", "currenttransform", "gfcorners", "grayfont", "hround", - "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", - "displaying", "currentwindow", "screen_rows", "screen_cols", - "pixels_per_inch", "cull", "display", "openwindow", "numspecial", - "totalweight", "autorounding", "fillin", "proofing", "tracingpens", - "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", - "chardy", "hppp", "tracingedges", "vppp", - "extra_beginfig", "extra_endfig", "mpxbreak", - "endinput", - "message", "delimiters", "turningnumber", "errmessage", - "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "closefrom", - "withprescript", "withpostscript", - -- "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", + primitives = { -- - "redpart", "greenpart", "bluepart", - "cyanpart", "magentapart", "yellowpart", - "blackpart", - "prescriptpart", "postscriptpart", - "rgbcolor", "cmykcolor", -- "greycolor", "graycolor", - "colormodel", "graypart", "greypart", "greycolor", "graycolor", - "dashpart", "penpart", "stackingpart", --- "colorpart", - "stroked", "filled", "textual", "clipped", "bounded", "pathpart", - "expandafter", - "minute", "hour", - "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", - "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", + "tracingtitles", "tracingequations", "tracingcapsules", "tracingchoices", + "tracingspecs", "tracingcommands", "tracingrestores", "tracingmacros", + "tracingoutput", "tracingstats", "tracingonline", "year", "month", "day", + "time", "hour", "minute", "charcode", "charwd", "charht", "chardp", + "charic", "pausing", "showstopping", "texscriptmode", "overloadmode", + "linejoin", "linecap", "stacking", "miterlimit", "warningcheck", + "truecorners", "defaultcolormodel", "restoreclipcolor", "numbersystem", + "numberprecision", "jobname", "addto", "atleast", "begingroup", + "controls", "curl", "delimiters", "endgroup", "everyjob", "exitif", + "expandafter", "interim", "let", "newinternal", "of", "randomseed", + "maxknotpool", "save", "scantokens", "runscript", "maketext", "shipout", + "step", "str", "void", "tension", "to", "until", "within", "write", + "btex", "verbatimtex", "etex", "def", "vardef", "primarydef", + "secondarydef", "tertiarydef", "enddef", "for", "forsuffixes", "forever", + "endfor", "quote", "expr", "suffix", "text", "primary", "secondary", + "tertiary", "input", "endinput", "if", "fi", "else", "elseif", "true", + "false", "nullpicture", "nullpen", "readstring", "pencircle", + "normaldeviate", "readfrom", "closefrom", "odd", "known", "unknown", + "not", "decimal", "reverse", "uncycle", "makepath", "makepen", "makenep", + "convexed", "uncontrolled", "oct", "hex", "ASCII", "char", "length", + "turningnumber", "xpart", "ypart", "xxpart", "xypart", "yxpart", + "yypart", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", + "yellowpart", "blackpart", "greypart", "colormodel", "prescriptpart", + "postscriptpart", "stackingpart", "pathpart", "penpart", "dashpart", + "sqrt", "mexp", "mlog", "sind", "cosd", "floor", "uniformdeviate", + "llcorner", "lrcorner", "ulcorner", "urcorner", "centerof", + "centerofmass", "corners", "xrange", "yrange", "deltapoint", + "deltaprecontrol", "deltapostcontrol", "deltadirection", "arclength", + "angle", "cycle", "nocycle", "stroked", "filled", "clipped", "grouped", + "bounded", "or", "and", "substring", "subpath", "directiontime", "point", + "precontrol", "postcontrol", "direction", "pathpoint", "pathprecontrol", + "pathpostcontrol", "pathdirection", "penoffset", "arctime", "arcpoint", + "arcpointlist", "subarclength", "mpversion", "rotated", "slanted", + "scaled", "shifted", "transformed", "xscaled", "yscaled", "zscaled", + "intersectiontimes", "intersectiontimeslist", "envelope", "boundingpath", + "numeric", "string", "boolean", "path", "pen", "nep", "picture", + "transform", "color", "rgbcolor", "cmykcolor", "pair", "end", "dump", + "batchmode", "nonstopmode", "scrollmode", "errorstopmode", "silentmode", + "inner", "outer", "setproperty", "showtoken", "showstats", "show", + "showvariable", "showdependencies", "doublepath", "contour", "also", + "withpen", "dashed", "withprescript", "withpostscript", "withstacking", + "withlinecap", "withlinejoin", "withmiterlimit", "withoutcolor", + "withgreyscale", "withcolor", "withrgbcolor", "withcmykcolor", "clip", + "setgroup", "setbounds", "message", "errmessage", "errhelp", -- - "runscript", "maketext", "numbersystem", - "overloadmode", "setproperty", + -- aliased -- - "intersectiontimeslist", "arcpoint", "arcpointlist", "subarclength", "maxknotpool", "nocycle", - "pathpoint", "pathprecontrol", "pathpostcontrol", "pathdirection", - "deltapoint", "deltaprecontrol", "deltapostcontrol", "deltadirection", - "corner", "xrange", "yrange", - "convexed", "uncontrolled", - "nep", "makenep", - "withmiterlimit", "withlinejoin", "withlinecap", - "centerof", "centerofmass", + "graypart", + -- + -- gone -- + -- + -- "autorounding", "bot", "boundarychar", "chardx", "chardy", "charexists", + -- "charext", "charlist", "colorpart", "corner", "cull", "cullit", + -- "currenttransform", "currentwindow", "designsize", "display", + -- "displaying", "extensible", "filenametemplate", "fillin", "fontdimen", + -- "fontmaking", "fontmapfile", "fontmapline", "fontpart", "fontsize", + -- "gfcorners", "glyph", "granularity", "graycolor", "grayfont", "graypart", + -- "greycolor", "headerbyte", "hppp", "hround", "imagerules", "infont", + -- "kern", "ligtable", "lowres_fix", "mpprocset", "mpxbreak", "nodisplays", + -- "notransforms", "numspecial", "openit", "openwindow", "outputformat", + -- "outputtemplate", "pixels_per_inch", "prologues", "proofing", + -- "screen_cols", "screen_rows", "smoothing", "special", "textual", + -- "totalweight", "tracingedges", "tracinglostchars", "tracingpens", + -- "troffmode", "turningcheck", "vppp", "xoffset", "yoffset", }, commands = { "on", "off", diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua index 37779ec57cd..9927ed1ff24 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua @@ -12,6 +12,7 @@ return { "currentifbranch", "currentiflevel", "currentiftype", + "currentstacksize", "detokenize", "dimexpr", "displaywidowpenalties", @@ -67,7 +68,6 @@ return { "Uabovewithdelims", "Uatop", "Uatopwithdelims", - "Uchar", "Udelcode", "Udelimited", "Udelimiter", @@ -91,11 +91,7 @@ return { "Umathaxis", "Umathbottomaccentvariant", "Umathchar", - "Umathcharclass", "Umathchardef", - "Umathcharfam", - "Umathcharslot", - "Umathclass", "Umathcode", "Umathconnectoroverlapmin", "Umathdegreevariant", @@ -105,9 +101,8 @@ return { "Umathdelimitershortfall", "Umathdelimiterundervariant", "Umathdenominatorvariant", - "Umathdict", "Umathdictdef", - "Umathdiscretionary", + "Umathexheight", "Umathextrasubpreshift", "Umathextrasubprespace", "Umathextrasubshift", @@ -179,10 +174,12 @@ return { "Umathsource", "Umathspaceafterscript", "Umathspacebeforescript", + "Umathspacebetweenscript", "Umathstackdenomdown", "Umathstacknumup", "Umathstackvariant", "Umathstackvgap", + "Umathsubscriptsnap", "Umathsubscriptvariant", "Umathsubshiftdistance", "Umathsubshiftdown", @@ -191,6 +188,7 @@ return { "Umathsubsupvgap", "Umathsubtopmax", "Umathsupbottommin", + "Umathsuperscriptsnap", "Umathsuperscriptvariant", "Umathsupshiftdistance", "Umathsupshiftdrop", @@ -210,26 +208,16 @@ return { "Umathxscale", "Umathyscale", "Umiddle", - "Unosubprescript", - "Unosubscript", - "Unosuperprescript", - "Unosuperscript", "Uoperator", "Uover", "Uoverdelimiter", "Uoverwithdelims", - "Uprimescript", "Uradical", "Uright", "Uroot", "Urooted", - "Ushiftedsubprescript", - "Ushiftedsubscript", - "Ushiftedsuperprescript", - "Ushiftedsuperscript", "Uskewed", "Uskewedwithdelims", - "Ustack", "Ustartdisplaymath", "Ustartmath", "Ustartmathmode", @@ -238,17 +226,14 @@ return { "Ustopmathmode", "Ustretched", "Ustretchedwithdelims", - "Ustyle", - "Usubprescript", - "Usubscript", - "Usuperprescript", - "Usuperscript", "Uunderdelimiter", "Uvextensible", + "additionalpageskip", "adjustspacing", "adjustspacingshrink", "adjustspacingstep", "adjustspacingstretch", + "advanceby", "afterassigned", "aftergrouped", "aliased", @@ -268,6 +253,9 @@ return { "alluncrampedstyles", "allunsplitstyles", "amcode", + "associateunit", + "atendoffile", + "atendoffiled", "atendofgroup", "atendofgrouped", "attribute", @@ -286,12 +274,18 @@ return { "boxanchors", "boxattribute", "boxdirection", + "boxfinalize", "boxfreeze", "boxgeometry", + "boxlimit", + "boxlimitate", + "boxlimitmode", "boxorientation", "boxrepack", "boxshift", + "boxshrink", "boxsource", + "boxstretch", "boxtarget", "boxtotal", "boxvadjust", @@ -305,6 +299,7 @@ return { "cfcode", "clearmarks", "constant", + "constrained", "copymathatomrule", "copymathparent", "copymathspacing", @@ -316,18 +311,27 @@ return { "csstring", "currentloopiterator", "currentloopnesting", + "currentlysetmathstyle", "currentmarks", "dbox", "defcsname", "deferred", + "detokened", "detokenized", "dimensiondef", "dimexpression", "directlua", + "discretionaryoptions", + "divideby", + "doubleadjdemerits", "dpack", "dsplit", "edefcsname", + "edivide", + "edivideby", "efcode", + "emergencyleftskip", + "emergencyrightskip", "endlocalcontrol", "endmathgroup", "endsimplegroup", @@ -347,10 +351,17 @@ return { "expandcstoken", "expanded", "expandedafter", + "expandeddetokenize", + "expandedendless", "expandedloop", + "expandedrepeat", + "expandparameter", "expandtoken", + "expandtoks", "explicitdiscretionary", "explicithyphenpenalty", + "explicititaliccorrection", + "explicitspace", "firstvalidlanguage", "float", "floatdef", @@ -365,9 +376,13 @@ return { "fontspecifiedname", "fontspecifiedsize", "fontspecscale", + "fontspecslant", + "fontspecweight", "fontspecxscale", "fontspecyscale", "fonttextcontrol", + "forcedleftcorrection", + "forcedrightcorrection", "formatname", "frozen", "futurecsname", @@ -376,6 +391,7 @@ return { "futureexpandis", "futureexpandisap", "gdefcsname", + "givenmathstyle", "gleaders", "glet", "gletcsname", @@ -388,8 +404,10 @@ return { "glyphscriptfield", "glyphscriptscale", "glyphscriptscriptscale", + "glyphslant", "glyphstatefield", "glyphtextscale", + "glyphweight", "glyphxoffset", "glyphxscale", "glyphxscaled", @@ -403,6 +421,7 @@ return { "hmcode", "holdingmigrations", "hpack", + "hpenalty", "hyphenationmin", "hyphenationmode", "ifabsdim", @@ -417,6 +436,7 @@ return { "ifcmpdim", "ifcmpnum", "ifcondition", + "ifcramped", "ifcstok", "ifdimexpression", "ifdimval", @@ -427,8 +447,13 @@ return { "ifhastok", "ifhastoks", "ifhasxtoks", + "ifinalignment", "ifincsname", "ifinsert", + "ifintervaldim", + "ifintervalfloat", + "ifintervalnum", + "iflastnamedcs", "ifmathparameter", "ifmathstyle", "ifnumexpression", @@ -441,14 +466,19 @@ return { "ifzerofloat", "ifzeronum", "ignorearguments", - "ignoredepthcriterium", + "ignoredepthcriterion", + "ignorenestedupto", "ignorepars", + "ignorerest", + "ignoreupto", "immediate", "immutable", "indexofcharacter", "indexofregister", "inherited", "initcatcodetable", + "initialpageskip", + "initialtopskip", "insertbox", "insertcopy", "insertdepth", @@ -471,14 +501,15 @@ return { "lastarguments", "lastatomclass", "lastboundary", - "lastchkdim", - "lastchknum", + "lastchkdimension", + "lastchknumber", "lastleftclass", "lastloopiterator", "lastnamedcs", "lastnodesubtype", "lastpageextra", "lastparcontext", + "lastpartrigger", "lastrightclass", "leftmarginkern", "letcharcode", @@ -488,20 +519,27 @@ return { "letmathparent", "letmathspacing", "letprotected", + "lettolastnamedcs", "lettonothing", - "linebreakcriterium", + "linebreakcriterion", + "linebreakoptional", + "linebreakpasses", "linedirection", "localbrokenpenalty", "localcontrol", "localcontrolled", + "localcontrolledendless", "localcontrolledloop", + "localcontrolledrepeat", "localinterlinepenalty", "localleftbox", "localleftboxbox", "localmiddlebox", "localmiddleboxbox", + "localpretolerance", "localrightbox", "localrightboxbox", + "localtolerance", "lpcode", "luabytecode", "luabytecodecall", @@ -513,44 +551,40 @@ return { "luatexbanner", "luatexrevision", "luatexversion", - "mathaccent", "mathatom", "mathatomglue", "mathatomskip", "mathbackwardpenalties", "mathbeginclass", - "mathbinary", + "mathboundary", + "mathcharclass", + "mathcharfam", + "mathcharslot", "mathcheckfencesmode", - "mathclose", + "mathclass", "mathdictgroup", + "mathdictionary", "mathdictproperties", "mathdirection", + "mathdiscretionary", "mathdisplaymode", + "mathdisplaypenaltyfactor", "mathdisplayskipmode", "mathdoublescriptmode", "mathendclass", "matheqnogapstep", - "mathfenced", "mathfontcontrol", "mathforwardpenalties", - "mathfraction", - "mathghost", "mathgluemode", "mathgroupingmode", - "mathinner", + "mathinlinepenaltyfactor", "mathleftclass", "mathlimitsmode", "mathmainstyle", - "mathmiddle", "mathnolimitsmode", - "mathopen", - "mathoperator", - "mathordinary", - "mathoverline", + "mathparentstyle", "mathpenaltiesmode", - "mathpunctuation", - "mathradical", - "mathrelation", + "mathpretolerance", "mathrightclass", "mathrulesfam", "mathrulesmode", @@ -558,31 +592,42 @@ return { "mathscriptsmode", "mathslackmode", "mathspacingmode", + "mathstack", "mathstackstyle", "mathstyle", "mathstylefontid", "mathsurroundmode", "mathsurroundskip", "maththreshold", - "mathunderline", + "mathtolerance", "meaningasis", "meaningful", "meaningfull", "meaningles", "meaningless", "mugluespecdef", + "multiplyby", "mutable", + "nestedloopiterator", "noaligned", "noatomruling", "noboundary", "nohrule", + "nomathchar", "norelax", "normalizelinemode", "normalizeparmode", + "noscript", "nospaces", + "nosubprescript", + "nosubscript", + "nosuperprescript", + "nosuperscript", "novrule", "numericscale", + "numericscaled", "numexpression", + "optionalboundary", "orelse", "orphanpenalties", "orphanpenalty", @@ -592,30 +637,62 @@ return { "overloadmode", "overshoot", "pageboundary", + "pagedepth", + "pageexcess", "pageextragoal", + "pagefistretch", + "pagelastdepth", + "pagelastfilllstretch", + "pagelastfillstretch", + "pagelastfilstretch", + "pagelastfistretch", + "pagelastheight", + "pagelastshrink", + "pagelaststretch", "pagevsize", "parametercount", + "parameterdef", + "parameterindex", "parametermark", + "parametermode", "parattribute", "pardirection", + "parfillleftskip", + "parfillrightskip", + "parinitleftskip", + "parinitrightskip", + "parpasses", + "parshapewidth", "permanent", "pettymuskip", "positdef", "postexhyphenchar", "posthyphenchar", "postinlinepenalty", + "postshortinlinepenalty", "prebinoppenalty", "predisplaygapfactor", "preexhyphenchar", "prehyphenchar", "preinlinepenalty", "prerelpenalty", + "preshortinlinepenalty", + "previousloopiterator", + "primescript", + "protecteddetokenize", + "protectedexpandeddetokenize", "protrudechars", "protrusionboundary", "pxdimen", "quitloop", + "quitloopnow", "quitvmode", + "rdivide", + "rdivideby", + "realign", "resetmathspacing", + "restorecatcodetable", + "retained", "retokenized", "rightmarginkern", "rpcode", @@ -623,13 +700,25 @@ return { "scaledemwidth", "scaledexheight", "scaledextraspace", + "scaledfontcharba", + "scaledfontchardp", + "scaledfontcharht", + "scaledfontcharic", + "scaledfontcharta", + "scaledfontcharwd", "scaledfontdimen", "scaledinterwordshrink", "scaledinterwordspace", "scaledinterwordstretch", + "scaledmathaxis", + "scaledmathemwidth", + "scaledmathexheight", "scaledmathstyle", "scaledslantperpoint", "scantextokens", + "scriptspaceafterfactor", + "scriptspacebeforefactor", + "scriptspacebetweenfactor", "semiexpand", "semiexpanded", "semiprotected", @@ -645,14 +734,31 @@ return { "setmathspacing", "shapingpenaltiesmode", "shapingpenalty", + "shiftedsubprescript", + "shiftedsubscript", + "shiftedsuperprescript", + "shiftedsuperscript", + "shortinlinemaththreshold", + "shortinlineorphanpenalty", + "showcodestack", + "showstack", + "singlelinepenalty", "snapshotpar", + "spacefactormode", + "spacefactorshrinklimit", + "spacefactorstretchlimit", "srule", + "subprescript", + "subscript", + "superprescript", + "superscript", "supmarkmode", "swapcsvalues", "tabsize", "textdirection", "thewithoutunit", "tinymuskip", + "tocharacter", "todimension", "tohexadecimal", "tointeger", @@ -668,7 +774,6 @@ return { "tracingadjusts", "tracingalignments", "tracingexpressions", - "tracingfonts", "tracingfullboxes", "tracinghyphenation", "tracinginserts", @@ -677,11 +782,14 @@ return { "tracingmarks", "tracingmath", "tracingnodes", + "tracingpasses", "tracingpenalties", "tsplit", "uleaders", "undent", + "unexpandedendless", "unexpandedloop", + "unexpandedrepeat", "unhpack", "unletfrozen", "unletprotected", @@ -691,6 +799,7 @@ return { "virtualhrule", "virtualvrule", "vpack", + "vpenalty", "wordboundary", "wrapuppar", "xdefcsname", @@ -829,7 +938,6 @@ return { "accent", "adjdemerits", "advance", - "advanceby", "afterassignment", "aftergroup", "atop", @@ -874,18 +982,19 @@ return { "displaywidowpenalty", "displaywidth", "divide", - "divideby", "doublehyphendemerits", "dp", "dump", "edef", "else", + "emergencyextrastretch", "emergencystretch", "end", "endcsname", "endgroup", "endinput", "endlinechar", + "eofinput", "eqno", "errhelp", "errmessage", @@ -923,6 +1032,7 @@ return { "hfill", "hfilneg", "hfuzz", + "hkern", "holdinginserts", "hrule", "hsize", @@ -978,12 +1088,16 @@ return { "lower", "lowercase", "mark", + "mathaccent", "mathbin", "mathchar", "mathchardef", "mathchoice", + "mathclose", "mathcode", + "mathinner", "mathop", + "mathopen", "mathord", "mathpunct", "mathrel", @@ -1000,7 +1114,6 @@ return { "moveright", "mskip", "multiply", - "multiplyby", "muskip", "muskipdef", "newlinechar", @@ -1022,7 +1135,6 @@ return { "overfullrule", "overline", "overwithdelims", - "pagedepth", "pagefilllstretch", "pagefillstretch", "pagefilstretch", @@ -1031,11 +1143,8 @@ return { "pagestretch", "pagetotal", "par", - "parfillleftskip", "parfillskip", "parindent", - "parinitleftskip", - "parinitrightskip", "parshape", "parskip", "patterns", @@ -1125,6 +1234,7 @@ return { "vfill", "vfilneg", "vfuzz", + "vkern", "vrule", "vsize", "vskip", diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua b/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua index 5106f1fef92..20a689ce193 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua @@ -407,6 +407,7 @@ end local function here(c,r,nr,nofcolumns,nofrows,cells,width,spans) local rr = r + nr - 1 if rr > nofrows then + report("%i rows needed, %i rows available, no slots free at (%i,%i), discarding",rr,nofrows,c,r) return false end local cc = 0 @@ -424,14 +425,14 @@ local function here(c,r,nr,nofcolumns,nofrows,cells,width,spans) end end if cc == 0 or cc > nofcolumns then - -- report("needed %p, no slot free at (%i,%i)",width,c,r) + report("needed %p, no slot free at (%i,%i), discarding",width,c,r) return false end for i=c,cc do local column = cells[i] for j=r,rr do if column[j] then - -- report("width %p, needed %p, checking (%i,%i) x (%i,%i), %s",width,wc,c,r,nc,nr,"quit") + report("width %p, needed %p, checking (%i,%i) x (%i,%i), %s",width,wc,c,r,nc,nr,"quit") return false end end @@ -658,6 +659,7 @@ function columnsets.check(t) cfound, rfound, nc = action(c,r,nr,lastcolumn,nofrows,cells,boxwidth-threshold,spans) end if not cfound and method ~= v_here then +-- if not cfound and method == v_here then cfound, rfound, nc = here(c,r,nr,lastcolumn,nofrows,cells,boxwidth-threshold,spans) end if cfound then @@ -1247,7 +1249,7 @@ end -- The interface. -interfaces.implement { +implement { name = "definecolumnset", actions = columnsets.define, arguments = { { @@ -1255,7 +1257,7 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "resetcolumnset", actions = columnsets.reset, arguments = { { @@ -1271,49 +1273,49 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "preparecolumnsetflush", actions = columnsets.prepareflush, arguments = "string", } -interfaces.implement { +implement { name = "finishcolumnsetflush", actions = columnsets.finishflush, arguments = "string", } -interfaces.implement { +implement { name = "flushcolumnsetcolumn", actions = columnsets.flushcolumn, arguments = { "string" ,"integer" }, } -interfaces.implement { +implement { name = "setvsizecolumnset", actions = columnsets.setvsize, arguments = "string", } -interfaces.implement { +implement { name = "sethsizecolumnset", actions = columnsets.sethsize, arguments = "string", } -interfaces.implement { +implement { name = "sethsizecolumnspan", actions = columnsets.sethspan, arguments = { "string" ,"integer" }, } -interfaces.implement { +implement { name = "flushcolumnsetrest", actions = columnsets.flushrest, arguments = { "string", "integer" }, } -interfaces.implement { +implement { name = "blockcolumnset", actions = columnsets.block, arguments = { { @@ -1327,7 +1329,7 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "checkcolumnset", actions = columnsets.check, arguments = { { @@ -1343,7 +1345,7 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "putincolumnset", actions = columnsets.put, arguments = { { @@ -1355,13 +1357,13 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "addtocolumnset", actions = columnsets.add, arguments = { "string", "integer" }, } -interfaces.implement { +implement { name = "setcolumnsetlines", actions = columnsets.setlines, arguments = { { @@ -1372,7 +1374,7 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "setcolumnsetstart", actions = columnsets.setstart, arguments = { { @@ -1383,7 +1385,7 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "setcolumnsetproperties", actions = columnsets.setproperties, arguments = { { @@ -1394,7 +1396,7 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "registercolumnsetarea", actions = columnsets.registerarea, arguments = { { @@ -1409,13 +1411,13 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "flushcolumnsetareas", actions = columnsets.flushareas, arguments = "string", } -interfaces.implement { +implement { name = "setcolumnsetarea", actions = columnsets.setarea, arguments = { { @@ -1427,18 +1429,18 @@ interfaces.implement { } } } -interfaces.implement { +implement { name = "columnsetgoto", actions = columnsets["goto"], arguments = "2 strings", } -interfaces.implement { +implement { name = "columnsetnoto", actions = columnsets["noto"], } -interfaces.implement { +implement { name = "columnsetcurrentcolumn", actions = columnsets.currentcolumn, arguments = "string", diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi index b8038bd960b..fb97c0ff8d2 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi @@ -1,4 +1,4 @@ -%D \module +%D \modul %D [ file=publ-imp-apa, %D version=2013.12.12, %D title=APA bibliography style, @@ -34,11 +34,13 @@ [\c!default=default, \c!specification=apa, \c!otherstext={\btxspace\btxlabeltext{others}}, - %c!journalconversion=\v!normal, + %\c!journalconversion=\v!normal, \c!monthconversion=\v!month, - \c!stopper:initials={. }, % with a (breakable) space + %\c!separator:firstnames={\btxnobreakspace}, % ? + \c!stopper:initials={\btxperiod}, % TODO: nobreak between multiple initials + \c!separator:invertedinitials={\btxcomma\btxnobreakspace}, \c!separator:names:2={\btxcomma}, % aka namesep - in this namespace - \c!separator:names:3={\btxcomma\btxnobreakspace\textampersand\space}, % comma separated list + \c!separator:names:3={\btxcomma\btxnobreakspace\textampersand\space}, \c!separator:names:4={\btxnobreakspace\textampersand\space}] % last of two, no comma! % First, define list and rendering parameters @@ -181,7 +183,7 @@ [apa:\s!list] [\c!style=\v!italic, \c!command=\Word, - \c!translate=\v!yes] + ] %\c!translate=\v!yes] \definebtx [apa:\s!list:title:article] @@ -319,7 +321,8 @@ \c!etaldisplay=1, % TODO: when 2-4, show all first time, etaldisplay subsequently... \c!authorconversion=\v!name, \c!sorttype=normal, % \v!normal ? - \c!style=, + \c!style=, % hyjacked below: + \c!style={\texdefinition{btx:apa:setlanguage}{\mainbtxlanguage}}, \c!compress=\v!yes, % note that cite sorts only work with compress=yes. \c!separator:names:3={\btxcomma\btxlabeltext{and}\space}, % not \textampersand \c!separator:names:4={\btxspace\btxlabeltext{and}\space}] % not \textampersand @@ -402,13 +405,17 @@ \definebtx [apa:\s!cite:author:year] % todo [apa:\s!cite] + [\c!separator:2={\btxcomma}, + \c!separator:3={\btxcomma}] \definebtx [apa:\s!cite:author:years] % todo [apa:\s!cite:authoryears] [\c!inbetween=, \c!left={\btxspace(}, - \c!right={)}] + \c!right={)}, + \c!separator:2={\btxcomma}, + \c!separator:3={\btxcomma}] \definebtx [apa:\s!cite:lefttext] @@ -435,7 +442,6 @@ [\c!separator:2={\btxcomma}, % :0 and :1 - between items of a list \c!separator:3={\btxcomma\btxlabeltext{and}\space}, % not \textampersand \c!separator:4={\btxspace\btxlabeltext{and}\space}, % not \textampersand - \c!command={\language[\currentbtxlanguage]}, % BAH \c!sorttype=none, \c!style=\v!italic] @@ -560,9 +566,9 @@ [\c!left=, \c!right=, \c!inbetween={\btxspace}, - \c!separator:2={\btxsemicolon}, - \c!separator:3=\btxparameter{\c!separator:2}, - \c!separator:4=\btxparameter{\c!separator:2}] + \c!separator:2={\btxcomma}, + \c!separator:3={\btxsemicolon}, + \c!separator:4={\btxsemicolon}] % Now we setup for the details of the renderings @@ -860,6 +866,16 @@ %D returned. In lua syntax, it can be understood as %D author or editor or publisher or title or "" +\starttexdefinition mutable protected btx:apa:setlanguage #language + \language[#language] + \doifelse{#language}{french} + {\setcharacterspacing[frenchpunctuation]} + {\doifelse{#language}{fr} + {\setcharacterspacing[frenchpunctuation]} + {\setcharacterspacing[nofrenchpunctuation]} + } +\stoptexdefinition + % #title can be title or booktitle \starttexdefinition mutable protected btx:apa:translated-title #title @@ -869,13 +885,14 @@ % no need for an extra \else \btxdoif {#title:\mainbtxlanguage} { - \begingroup - \language[\mainbtxlanguage] + \begingroup % does this limit scope? + \texdefinition{btx:apa:setlanguage}{\mainbtxlanguage} \btxleftbracket \btxusecommand [apa:\s!list:#title:\currentbtxcategory] { \btxflush{#title:\mainbtxlanguage} } \btxrightbracket + \texdefinition{btx:apa:setlanguage}{\currentbtxlanguage} \endgroup } \fi\fi @@ -884,7 +901,7 @@ \starttexdefinition mutable protected btx:apa:composed-title #title \btxstartstyleandcolor[apa:\s!list:#title:\currentbtxcategory] \begingroup - \language[\currentbtxlanguage] + \texdefinition{btx:apa:setlanguage}{\currentbtxlanguage} \btxusecommand [apa:\s!list:#title:\currentbtxcategory] { \btxflush{#title} \btxdoif {sub#title} { @@ -892,6 +909,7 @@ \btxflush{sub#title} } } + \texdefinition{btx:apa:setlanguage}{\mainbtxlanguage} \endgroup % which namespace? %\doif{\btxparameter{translate}}\v!yes { @@ -909,7 +927,7 @@ \setmode{btx:apa:title-placed} % we make the title active, opening "file" \btxdoifelse {file} { - \texdefinition{btx:format:inject} + \texdefinition{btx:format:goto} {url(file:\btxflush{file})} { \texdefinition{btx:apa:composed-title}{title} @@ -941,8 +959,6 @@ \btxlabeltext{apa:Translator} \btxrightparenthesis } - \btxperiod - % TODO: this period may NOT be wanted, as in: Title (2nd ed.). } \stoptexdefinition @@ -951,7 +967,7 @@ \resetmode{btx:apa:title-placed} } { \btxdoif {title} { - \btxspace + \btxperiod \texdefinition {btx:apa:title} } } @@ -1071,8 +1087,7 @@ \starttexdefinition mutable protected btx:apa:authoryear % we make the authoryear active, pointing to the citation - \texdefinition{btx:format:inject} - {internal(\currentbtxinternal)} + \texdefinition{btx:format:gotointernal} { \doifelsesetups{apa:list:sameauthor} { \btxdoifelsesameasprevious {author} { @@ -1088,7 +1103,6 @@ \btxrightparenthesis } % outside of interaction - \btxperiod \doif {\btxfoundname{author}} {title} { \setmode{btx:apa:title-placed} } @@ -1096,6 +1110,7 @@ \starttexdefinition mutable protected btx:apa:editor-in \btxdoif {booktitle} { + \btxperiod \btxlabeltext{In} \btxspace \doifnot {\btxfoundname{author}} {editor} { @@ -1105,7 +1120,6 @@ } } \texdefinition{btx:apa:composed-title}{booktitle} - \btxperiod } \stoptexdefinition @@ -1119,9 +1133,6 @@ } \stoptexdefinition -% TODO: The title is terminated with period. However, -% we probably don't want this before the parenthesis. - \starttexdefinition mutable protected btx:apa:leftparenthesis-or-comma \doifelsemode {btx:apa:editionset-is-empty} { \btxleftparenthesis @@ -1181,8 +1192,9 @@ \btxflush{pages} } \doifnotmode {btx:apa:editionset-is-empty} { - \btxrightparenthesisperiod + \btxrightparenthesis } + \btxperiod \stoptexdefinition \starttexdefinition mutable protected btx:apa:journal @@ -1276,44 +1288,27 @@ \btxperiod \stoptexdefinition -\definebreakpoints[doi] -\definebreakpoint [doi][:][nleft=3,type=1] -\definebreakpoint [doi][/][nleft=3,type=1] -\definebreakpoint [doi][-][nleft=3,type=1] -\definebreakpoint [doi][.][nleft=3,type=1] - % use \btxentry here? +% Alan's editor does not want lines to begin with these characters: +\sethyphenatedurlafter{:./-_} + \starttexdefinition mutable protected btx:apa:url - \begingroup - \setbreakpoints[doi] - \ifconditional\btxinteractive - \goto { - \hyphenatedurl{\btxflush{url}} - } [ - url(\btxflush{url}) - ] - \else - \hyphenatedurl{\btxflush{url}} - \fi - \endgroup + \texdefinition {btx:format:goto} { + url(\btxflush{url}) + } { + \hyphenatedurl{\btxflush{url}} + } \stoptexdefinition % use \btxentry here? \starttexdefinition mutable protected btx:apa:doi - \begingroup - \setbreakpoints[doi] - \ifconditional\btxinteractive - \goto { - \hyphenatedurl{doi:\btxflush{doi}} - } [ - url(http://dx.doi.org/\btxflush{doi}) - ] - \else - \hyphenatedurl{doi:\btxflush{doi}} - \fi - \endgroup + \texdefinition {btx:format:goto} { + url(http://dx.doi.org/\btxflush{doi}) + } { + \hyphenatedurl{doi:\btxflush{doi}} + } \stoptexdefinition \starttexdefinition mutable protected btx:apa:note @@ -1335,13 +1330,14 @@ \btxspace \texdefinition{btx:apa:doi} } + % should the following be hyperlinks? To where? \btxdoif {issn} { \btxspace - issn\colon\btxflush{issn} + \hyphenatedurl{issn:\btxflush{issn}} } \btxdoif {isbn} { \btxspace - isbn\colon\btxflush{isbn} + \hyphenatedurl{isbn:\btxflush{isbn}} } \texdefinition{btx:apa:note} \removeunwantedspaces @@ -1351,7 +1347,7 @@ \btxdoif {type} { \btxleftbracket \btxflush{type} - \btxrightbracketperiod + \btxrightbracket } \stoptexdefinition @@ -1366,6 +1362,7 @@ \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} \texdefinition{btx:apa:type} + \btxperiod \texdefinition{btx:apa:journal-volume-number-pages} \texdefinition{btx:apa:url-doi-note} \stopsetups @@ -1403,6 +1400,7 @@ \startsetups btx:apa:list:standard \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} + \btxperiod \texdefinition{btx:apa:url-doi-note} \stopsetups @@ -1645,10 +1643,10 @@ } \doifnot {\btxfoundname{title}} {album} { \btxdoif {album} { + \btxperiod \btxlabeltext{In} \btxspace \btxflush{album} - \btxperiod } } \texdefinition{btx:apa:type} @@ -1671,6 +1669,7 @@ \startsetups btx:apa:list:misc \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} + \btxperiod \btxdoif {howpublished} { \btxspace \btxflush{howpublished} diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi index f6f118ada79..da84c312ede 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi @@ -615,7 +615,7 @@ \btxdoif {title} { % we make the title active, opening file \btxdoifelse {file} { - \texdefinition{btx:format:inject} + \texdefinition{btx:format:goto} {url(file:\btxflush{file})} { \texdefinition{btx:aps:composed-title}{title} diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi index 4b6e8d6ae46..f15d41e532f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi @@ -33,7 +33,9 @@ \else\ifnum\currentbtxinternal=\zerocount #content \else\ifconditional\btxinteractive - \goto {#content} [\s!internal(\currentbtxinternal)] + \goto + {#content} + [\s!internal(\currentbtxinternal)] \else #content \fi\fi\fi diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi index 5b4331eed46..15ed8df8270 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi @@ -48,7 +48,7 @@ \starttexdefinition mutable protected btx:list:numbering #variant \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:#variant] - \btxusecommand[\currentbtxspecification:\s!list:\s!numbering:#variant] { + \btxusecommand [\currentbtxspecification:\s!list:\s!numbering:#variant] { \fastsetup{\s!btx:\s!list:\s!numbering} } \btxstopstyleandcolor diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv index fafefa78188..258cfd348a7 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv @@ -417,9 +417,12 @@ \unexpanded\def\btxnbsp {\removeunwantedspaces\nbsp} % the same anyway \unexpanded\def\btxperiod {\removeunwantedspaces.\space} \unexpanded\def\btxcomma {\removeunwantedspaces,\space} +\unexpanded\def\btxserialcomma {\removeunwantedspaces,\space} % (aka Oxford comma) redefine to disable +\unexpanded\def\btxellipsis {\removeunwantedspaces\nobreakspace\textellipsis\space} \unexpanded\def\btxcommabreak {\removeunwantedspaces,\hskip\zeropoint plus .5\emwidth\relax} \unexpanded\def\btxcolon {\removeunwantedspaces:\space} \unexpanded\def\btxsemicolon {\removeunwantedspaces;\space} +\unexpanded\def\btxhyphen {\removeunwantedspaces-} \unexpanded\def\btxlparent {\removeunwantedspaces\space(} % obsolete \unexpanded\def\btxrparent {\removeunwantedspaces)\space} % obsolete \unexpanded\def\btxleftparenthesis {\removeunwantedspaces\space(} @@ -1143,7 +1146,7 @@ {\the\t_btx_reference_inject \strc_lists_inject_direct % todo: make like \btx_list_reference_inject_now with { } [\s!btx]% - [\c!type=\s!btx,\c!location=\v!here]% + [\c!type=\s!btx]% \c!location=\v!none [\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% \s!btxref=\currentbtxtag,% %\ifx\currentbtxcombis \empty\else\s!btxcom={\currentbtxcombis},\fi% @@ -1995,8 +1998,9 @@ \c!otherstext={\btxspace et al.}, \c!separator:firstnames={\btxspace}, \c!separator:juniors={\btxspace}, - \c!separator:vons={\btxspace}, + \c!separator:vons={\btxnobreakspace}, \c!separator:initials={\btxspace}, + \c!connector:initials={\btxhyphen}, \c!stopper:initials={.}, %\c!surnamesep={\btxcomma}, % is this used anywhere? \c!separator:invertedinitials={\btxcomma}, diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-reg.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-reg.lua index 9ee574929de..ca19472c9d8 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-reg.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-reg.lua @@ -90,7 +90,8 @@ local function btxtoregister(dataset,tag) local dset = step.dataset if dset == v_all or dset == dataset then local done = step.done - if not done[tag] then +-- if not done[tag] then +if not step.once or not done[tag] then local value, field, kind = getcasted(current,tag,step.field,specifications[step.specification]) if value then flushers[kind](step,field,value) @@ -179,24 +180,6 @@ end -- publications.registerflushers = flushers -local function btxtoregister(dataset,tag) - local current = datasets[dataset] - for i=1,#sequence do - local step = sequence[i] - local dset = step.dataset - if dset == v_all or dset == dataset then - local done = step.done - if not done[tag] then - local value, field, kind = getcasted(current,tag,step.field,specifications[step.specification]) - if value then - flushers[kind](step,field,value) - end - done[tag] = true - end - end - end -end - local function authortoregister(dataset,hash) local author = publications.authorcache[hash] if author then diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi index ac5d28e9e35..56b6b018b69 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi +++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi @@ -1059,12 +1059,11 @@ \unexpanded\def\scrn_rollbutton_symbol_indeed#getparameter#inheritedframed#setparameter#usestyleandcolor#what#text% {\definecolor[rollover][rollover:#what]% - \doifelse{#what}{n}% ? - {\doifelse{#getparameter\c!alternative}\v!hidden\phantom\hbox}\hbox - {#setparameter\c!framecolor {rollover}% - #setparameter\c!backgroundcolor{rollover}% - #setparameter\c!color {rollover}% - #inheritedframed{#usestyleandcolor\c!style\c!color{#text}}}} + \doifelse{#getparameter\c!alternative}\v!hidden\phantom\hbox + {#setparameter\c!framecolor {rollover}% + #setparameter\c!backgroundcolor{rollover}% + #setparameter\c!color {rollover}% + #inheritedframed{#usestyleandcolor\c!style\c!color{#text}}}} %D We plug into the menu system diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua b/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua index 0667e8031f0..b36ba02378f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua @@ -542,6 +542,7 @@ function scripts.decomposehangul(head) for current, char in nextglyph, head do local lead_consonant, medial_vowel, tail_consonant = decomposed(char) if lead_consonant then + local current = current -- 5.5 constant setchar(current,lead_consonant) local m = copy_node(current) setchar(m,medial_vowel) diff --git a/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua index a375d705751..680dc342383 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua @@ -220,7 +220,7 @@ local function preparetables(data) end end else - l = lower[l] or lcchars[l] + local l = lower[l] or lcchars[l] if l then if trace_orders then report_sorters(" 5 lower: %C",l) diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv index a54c44b72f8..352f276c19d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv @@ -745,9 +745,6 @@ \setvalue{\??aligncommand1*\v!more}{\toksapp\t_spac_align_collected{\looseness\plusone}} \setvalue{\??aligncommand2*\v!more}{\toksapp\t_spac_align_collected{\looseness\plustwo}} -% \setvalue{\??aligncommand ... }{\toksapp\t_spac_align_collected{\nopenalties}} -% \setvalue{\??aligncommand ... }{\toksapp\t_spac_align_collected{\setdefaultpenalties}} - \definehspace [\v!final] [\emspaceamount] \def\spac_align_flush_parfill diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf index d4b423224f5..310a8d59022 100644 Binary files a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf and b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf differ diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf index ee377dae779..3420be1e0ad 100644 Binary files a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf and b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf differ diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua index 6e26f6f3701..87547664641 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua @@ -1155,7 +1155,12 @@ local function collapsedpage(pages) local second_first_last = second_first.references.lastrealpage if first_last_last then first_last_pn = first_last_last - if second_first == second_last and second_first_pn <= first_last_pn then + if first_last_pn == second_first_pn then + -- 2-3, 3-9 -> 2-9 + pages[i-1] = { first_first, second_last } + remove(pages,i) + return true + elseif second_first == second_last and second_first_pn <= first_last_pn then -- 2=8, 5 -> 12=8 remove(pages,i) return true diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-fontawesome.mkiv b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-fontawesome.mkiv index c638998ab75..62ea7019801 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-fontawesome.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-fontawesome.mkiv @@ -7,7 +7,15 @@ %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -\definefontsynonym [FontAwesome] [file:FontAwesome.otf] +\loadfontgoodies[fontawesome] + +\definefontsynonym [FontAwesome] [file:FontAwesome.otf] +%definefontsynonym [FontAwesomeBrands] [file:fontawesome5brandsregular400.otf] +%definefontsynonym [FontAwesomeRegular] [file:fontawesome5freeregular400.otf] +%definefontsynonym [FontAwesomeSolid] [file:fontawesome5freesolid900.otf] +\definefontsynonym [FontAwesomeBrands] [file:FontAwesomeBrandsRegular.otf] +\definefontsynonym [FontAwesomeRegular] [file:FontAwesomeFreeRegular.otf] +\definefontsynonym [FontAwesomeSolid] [file:FontAwesomeFreeSolid.otf] %def\FontAwesomeSymbol#1{\getglyphstyled{FontAwesome}{\utfchar{0x#1}}} \def\FontAwesomeSymbol#1{\getglyphstyled{FontAwesome}{\tochar{n:#1}}} @@ -749,19 +757,15 @@ \stopsymbolset -\definefontsynonym [FontAwesomeBrands] [file:fontawesome5brandsregular400.otf] -\definefontsynonym [FontAwesomeRegular] [file:fontawesome5freeregular400.otf] -\definefontsynonym [FontAwesomeSolid] [file:fontawesome5freesolid900.otf] - -\startsymbolset [fontawesome-brands] [font=FontAwesomeBrands] +\startsymbolset [fontawesome-brands] [font=FontAwesomeBrands*fontawesome] % Font Awesome Brands \stopsymbolset -\startsymbolset [fontawesome-regular] [font=FontAwesomeRegular] +\startsymbolset [fontawesome-regular] [font=FontAwesomeRegular*fontawesome] % Font Awesome Regular \stopsymbolset -\startsymbolset [fontawesome-solid] [font=FontAwesomeSolid] +\startsymbolset [fontawesome-solid] [font=FontAwesomeSolid*fontawesome] % Font Awesome Solid \stopsymbolset diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv index 44668dcc98d..57b961b9936 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv @@ -573,7 +573,7 @@ \def\setgvalue #1{\expandafter\gdef\csname#1\endcsname} \def\setevalue #1{\expandafter\edef\csname#1\endcsname} \def\setxvalue #1{\expandafter\xdef\csname#1\endcsname} -\def\getvalue #1{\csname#1\endcsname} % maybe: \begincsname#1\endcsname +\def\getvalue #1{\begincsname#1\endcsname} \def\letvalue #1{\expandafter\let \csname#1\endcsname} \def\letgvalue #1{\expandafter\glet\csname#1\endcsname} \def\resetvalue #1{\expandafter\let \csname#1\endcsname\empty} @@ -585,7 +585,7 @@ \def\setugvalue #1{\protected\expandafter\gdef\csname#1\endcsname} \def\setuxvalue #1{\protected\expandafter\xdef\csname#1\endcsname} -\protected\def\getuvalue#1{\csname#1\endcsname} +\protected\def\getuvalue#1{\begincsname#1\endcsname} %D \macros %D {globallet,glet} diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua index 96b69a73e0f..d0e804b0905 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua @@ -20,6 +20,7 @@ local concat, insert, remove = table.concat, table.insert, table.remove local topattern = string.topattern local utfchar = utf.char local datetime = os.date +local sleep = os.sleep local openfile = io.open local write_nl = print @@ -350,9 +351,9 @@ local function setblocked(category,value) -- v.state == value == true : disable if v then v.state = value else - c = topattern(c,true,true) + local p = topattern(c,true,true) for k, v in next, data do - if find(k,c) then + if find(k,p) then v.state = value end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua index 0441f386b39..87f40db893c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua @@ -102,11 +102,11 @@ local function set(t,what,newvalue) else value = is_boolean(value,value,true) -- strict end - w = topattern(w,true,true) + local p = topattern(w,true,true) for name, functions in sortedhash(data) do if done[name] then -- prevent recursion due to wildcards - elseif find(name,w) then + elseif find(name,p) then done[name] = true for i=1,#functions do functions[i](value) diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua index 2f00fa038ec..f37afa3c37f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua @@ -685,7 +685,8 @@ end local function resolve_neutral(list,size,start,limit,orderbefore,orderafter) -- N1, N2 - for i=start,limit do + local i = start + while i <= limit do local entry = list[i] if b_s_ws_on[entry.direction] then -- this needs checking diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua b/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua index 10e5731b036..18cf60cd3b0 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua @@ -186,13 +186,7 @@ function debugger.showstats(printer,threshold) realtime = realtime + real end totaltime = totaltime + total - if line < 0 then - line = 0 - end - -- if name = "a" then - -- -- weird name - -- end - dataset[#dataset+1] = { real, total, count, name, source, line } + dataset[#dataset+1] = { real, total, count, name, source, line < 0 and 0 or line } end end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua b/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua index 6462f3e4920..432c1a9a0e5 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua @@ -27,8 +27,8 @@ local p_stripzeros = lpeg.patterns.stripzeros number = number or { } local number = number -number.tonumberf = function(n) return lpegmatch(p_stripzeros,format("%.20f",n)) end -number.tonumberg = function(n) return format("%.20g",n) end +number.tonumberf = function(n) return lpegmatch(p_stripzeros,format("%.20f",n)) end -- not used +number.tonumberg = function(n) return format("%.20g",n) end -- not used local dimenfactors = allocate { ["pt"] = 1/65536, diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-env.lua b/Master/texmf-dist/tex/context/base/mkiv/util-env.lua index dde76587486..c98cd5f1335 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-env.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-env.lua @@ -15,12 +15,14 @@ local concat, insert, remove = table.concat, table.insert, table.remove environment = environment or { } local environment = environment --- locales are a useless feature in and even dangerous for luatex - -local setlocale = os.setlocale - -setlocale(nil,nil) -- setlocale("all","C") +-- -- These locales are a useless feature in and even dangerous for luatex, so +-- -- we just ignore them. We used to warn but I assume no one needs it anyway +-- -- so let's save some bytes. +-- local setlocale = os.setlocale +-- +-- setlocale(nil,nil) -- setlocale("all","C") +-- -- function os.resetlocale() -- setlocale(nil,nil) -- end @@ -53,21 +55,25 @@ setlocale(nil,nil) -- setlocale("all","C") -- end -- end -local report = logs.reporter("system") - -function os.setlocale(a,b) - if a or b then - if report then - report() - report("You're messing with os.locale in a supposedly locale neutral enviroment. From") - report("now on are on your own and without support. Crashes or unexpected side effects") - report("can happen but don't bother the luatex and context developer team with it.") - report() - report = nil - end - setlocale(a,b) - end -end +-- local report = logs.reporter("system") +-- +-- function os.setlocale(a,b) +-- if a or b then +-- if report then +-- report() +-- report("You're messing with os.setlocale in a supposedly locale neutral enviroment. From") +-- report("now on are on your own and without support. Crashes or unexpected side effects") +-- report("can happen but don't bother the luatex and context developer team with it.") +-- report() +-- report = nil +-- end +-- setlocale(a,b) +-- end +-- end + +-- It's time to get rid of it: + +os.setlocale(nil,nil) function os.setlocale() end -- dirty tricks (we will replace the texlua call by luatex --luaonly) @@ -191,7 +197,8 @@ end -- a registration of arguments so from now on we have 'partial' function environment.getargument(name,partial) - local arguments, sortedflags = environment.arguments, environment.sortedflags + local arguments = environment.arguments + local sortedflags = environment.sortedflags if arguments[name] then return arguments[name] elseif partial then diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua b/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua index 75c2282f0f2..a34e902e9ed 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua @@ -219,6 +219,8 @@ local function result(t,fmt,a,b,c) end end +-- the token is kind of generic and shared + local f = replacer ( [[curl ]] .. [[--silent --insecure ]] .. diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-lua.lua b/Master/texmf-dist/tex/context/base/mkiv/util-lua.lua index fb4088e7b66..4c79959f607 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-lua.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-lua.lua @@ -39,6 +39,7 @@ luautilities.suffixes = { tma = "tma", tmc = (CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 and "tmd") or (jit and "tmb") or "tmc", lua = "lua", + lmt = "lmt", luc = (CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 and "lud") or (jit and "lub") or "luc", lui = "lui", luv = "luv", diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua index d7b7087a5ec..aef1b24676c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua @@ -383,9 +383,25 @@ hashes.settings_to_set = table.setmetatableindex(function(t,k) -- experiment, n return v end) +function parsers.settings_to_set(str) + return str and lpegmatch(pattern,str) or { } +end + +local pattern = Ct((C((1-S(", "))^1) * S(", ")^0)^1) + +hashes.settings_to_list = table.setmetatableindex(function(t,k) -- experiment, not public + local v = k and lpegmatch(pattern,k) or { } + t[k] = v + return v +end) + +-- inspect(hashes.settings_to_set["a,b, c, d"]) +-- inspect(hashes.settings_to_list["a,b, c, d"]) + -- as we use a next, we are not sure when the gc kicks in -getmetatable(hashes.settings_to_set).__mode = "kv" -- could be an option (maybe sharing makes sense) +getmetatable(hashes.settings_to_set ).__mode = "kv" -- could be an option (maybe sharing makes sense) +getmetatable(hashes.settings_to_list).__mode = "kv" -- could be an option (maybe sharing makes sense) function parsers.simple_hash_to_string(h, separator) local t = { } @@ -420,6 +436,7 @@ end local value = P(lbrace * C((nobrace + nestedbraces)^0) * rbrace) + C(digit^1 * lparent * (noparent + nestedparents)^1 * rparent) + C((nestedbraces + (1-comma))^1) + + Cc("") -- new local pattern_a = spaces * Ct(value*(separator*value)^0) local function repeater(n,str) @@ -446,6 +463,7 @@ end local value = P(lbrace * C((nobrace + nestedbraces)^0) * rbrace) + (C(digit^1)/tonumber * lparent * Cs((noparent + nestedparents)^1) * rparent) / repeater + C((nestedbraces + (1-comma))^1) + + Cc("") -- new local pattern_b = spaces * Ct(value*(separator*value)^0) function parsers.settings_to_array_with_repeat(str,expand) -- beware: "" => { } diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-ftp.lua b/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-ftp.lua index 124c8d4ee71..a017427bd72 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-ftp.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-ftp.lua @@ -124,7 +124,7 @@ function methods.port(self, address, port) local tp = self.tp self.pasvt = nil if not address then - address, port = try(tp:getsockname()) + address = try(tp:getsockname()) self.server = try(bindsocket(address, 0)) address, port = try(self.server:getsockname()) try(self.server:settimeout(ftp.TIMEOUT)) @@ -142,7 +142,7 @@ function methods.eprt(self, family, address, port) local tp = self.tp self.pasvt = nil if not address then - address, port = try(tp:getsockname()) + address = try(tp:getsockname()) self.server = try(bindsocket(address, 0)) address, port = try(self.server:getsockname()) try(self.server:settimeout(ftp.TIMEOUT)) diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua b/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua index d8f45880e7f..521dc0387fc 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua @@ -68,7 +68,7 @@ local function receiveheaders(sock, headers) -- get field-name and value local name, value = skipsocket(2, find(line, "^(.-):%s*(.*)")) if not (name and value) then - return nil, "malformed reponse headers" + return nil, "malformed response headers" end name = lower(name) -- get next line (value might be folded) @@ -186,10 +186,14 @@ function methods.sendbody(self, headers, source, step) end function methods.receivestatusline(self) - local try = self.try - local status = try(self.c:receive(5)) + local try = self.try + local status, err = try(self.c:receive(5)) if status ~= "HTTP/" then - return nil, status -- HTTP/0.9 + if err == "timeout" then + return 408 + else + return nil, status -- HTTP/0.9 + end end status = try(self.c:receive("*l", status)) local code = skipsocket(2, find(status, "HTTP/%d*%.%d* (%d%d%d)")) @@ -200,6 +204,15 @@ function methods.receiveheaders(self) return self.try(receiveheaders(self.c)) end +-- part of request: +-- +-- Accept-Encoding: gzip + +-- part if body: +-- +-- Content-Encoding: gzip +-- Vary: Accept-Encoding + function methods.receivebody(self, headers, sink, step) if not sink then sink = sinknull() @@ -308,7 +321,7 @@ local function adjustrequest(originalrequest) return request end -local maxredericts = 4 +local maxredericts = 5 local validredirects = { [301] = true, [302] = true, [303] = true, [307] = true } local validmethods = { [false] = true, GET = true, HEAD = true } @@ -325,10 +338,11 @@ local function shouldredirect(request, code, headers) if scheme and not SCHEMES[scheme] then return false end - local method = request.method - local redirect = request.redirect - local redirects = request.nredirects or 0 - return redirect and validredirects[code] and validmethods[method] and redirects <= maxredericts + local method = request.method + local redirect = request.redirect + local redirects = request.nredirects or 0 + local maxredirects = request.maxredirects or maxredirects + return redirect and validredirects[code] and validmethods[method] and redirects <= maxredirects end local function shouldreceivebody(request, code) @@ -348,13 +362,14 @@ local tredirect, trequest, srequest tredirect = function(request, location) local result, code, headers, status = trequest { - url = absoluteurl(request.url,location), - source = request.source, - sink = request.sink, - headers = request.headers, - proxy = request.proxy, - nredirects = (request.nredirects or 0) + 1, - create = request.create, + url = absoluteurl(request.url,location), + source = request.source, + sink = request.sink, + headers = request.headers, + proxy = request.proxy, + nredirects = (request.nredirects or 0) + 1, + maxredirects = request.maxredirects or maxredirects, + create = request.create, } if not headers then headers = { } @@ -377,10 +392,13 @@ trequest = function(originalrequest) local code, status = connection:receivestatusline() if not code then connection:receive09body(status, request.sink, request.step) + connection:close() return 1, 200 + elseif code == 408 then + return 1, code end while code == 100 do - headers = connection:receiveheaders() + connection:receiveheaders() code, status = connection:receivestatusline() end headers = connection:receiveheaders() diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-client.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-client.lua index 2f72ef13824..c48b3505a8a 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-client.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-client.lua @@ -108,6 +108,7 @@ local function splitdata(data) -- todo: hash on first line ... maybe move to cli end end p = Cf(Ct("") * p,rawset) * newline^1 + -- p = Ct("") * (p % rawset) * newline^1 -- future if getserver() == "mssql" then p = skipfirst * skipdashes * Ct(p^0) else diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-str.lua b/Master/texmf-dist/tex/context/base/mkiv/util-str.lua index b5c721a41d2..ac6981d6aef 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-str.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-str.lua @@ -269,6 +269,7 @@ local p_prune_intospace = Cs ( noleading * ( notrailing + intospace + 1 local p_retain_normal = Cs ( ( normalline + normalempty )^0 ) local p_retain_collapse = Cs ( ( normalline + doubleempty )^0 ) local p_retain_noempty = Cs ( ( normalline + singleempty )^0 ) +local p_collapse_all = Cs ( stripstart * ( stripend + ((whitespace+newline)^1/" ") + 1)^0 ) -- function striplines(str,prune,collapse,noempty) -- if prune then @@ -298,6 +299,7 @@ local striplinepatterns = { ["retain"] = p_retain_normal, ["retain and collapse"] = p_retain_collapse, ["retain and no empty"] = p_retain_noempty, + ["collapse all"] = p_collapse_all, ["collapse"] = patterns.collapser, } @@ -313,6 +315,10 @@ function strings.collapse(str) -- maybe also in strings return str and lpegmatch(p_prune_intospace,str) or str end +-- local s = " \naa\n\naa\na a\n\n " +-- local s = [[ \naa\n\naa\na a\n\n]] +-- print("["..strings.striplines(s,"collapse all").."]") + -- also see: string.collapsespaces strings.striplong = strings.striplines -- for old times sake @@ -1417,6 +1423,7 @@ strings.formatters.add = add patterns.xmlescape = Cs((P("<")/"<" + P(">")/">" + P("&")/"&" + P('"')/""" + anything)^0) patterns.texescape = Cs((C(S("#$%\\{}"))/"\\%1" + anything)^0) +patterns.ctxescape = Cs((C(S("#$%\\{}|"))/"\\%1" + anything)^0) patterns.luaescape = Cs(((1-S('"\n'))^1 + P('"')/'\\"' + P('\n')/'\\n"')^0) -- maybe also \0 patterns.luaquoted = Cs(Cc('"') * ((1-S('"\n'))^1 + P('"')/'\\"' + P('\n')/'\\n"')^0 * Cc('"')) @@ -1552,3 +1559,20 @@ do end +if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then + + local t = { + ["#"] = "#H", + ["\n"] = "#L", + ['"'] = "#Q", + ["\r"] = "#R", + [" "] = "#S", + ["\t"] = "#T", + ["\\"] = "#X", + } + + function string.texhashed(s) + return (gsub(s,".",t)) + end + +end diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua b/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua index 4ceec7afdbb..404b397138e 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua @@ -34,11 +34,13 @@ end local files = utilities.files local openfile = files.open local closefile = files.close +local getsize = files.size local readstring = files.readstring local readcardinal2 = files.readcardinal2le local readcardinal4 = files.readcardinal4le local setposition = files.setposition local getposition = files.getposition +local skipbytes = files.skip local band = bit32.band local rshift = bit32.rshift @@ -69,6 +71,158 @@ local openzipfile, closezipfile, unzipfile, foundzipfile, getziphash, getziplist } end + -- https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT + +-- local function collect(z) +-- if not z.list then +-- local list = { } +-- local hash = { } +-- local position = 0 +-- local index = 0 +-- local handle = z.handle +-- while true do +-- setposition(handle,position) +-- local signature = readstring(handle,4) +-- if signature == "PK\3\4" then +-- -- [local file header 1] +-- -- [encryption header 1] +-- -- [file data 1] +-- -- [data descriptor 1] +-- local version = readcardinal2(handle) +-- local flag = readcardinal2(handle) +-- local method = readcardinal2(handle) +-- local filetime = readcardinal2(handle) +-- local filedate = readcardinal2(handle) +-- local crc32 = readcardinal4(handle) +-- local compressed = readcardinal4(handle) +-- local uncompressed = readcardinal4(handle) +-- local namelength = readcardinal2(handle) +-- local extralength = readcardinal2(handle) +-- local filename = readstring(handle,namelength) +-- local descriptor = band(flag,8) ~= 0 +-- local encrypted = band(flag,1) ~= 0 +-- local acceptable = method == 0 or method == 8 +-- -- 30 bytes of header including the signature +-- local skipped = 0 +-- local size = 0 +-- if encrypted then +-- size = readcardinal2(handle) +-- skipbytes(handle,size) +-- skipped = skipped + size + 2 +-- skipbytes(8) +-- skipped = skipped + 8 +-- size = readcardinal2(handle) +-- skipbytes(handle,size) +-- skipped = skipped + size + 2 +-- size = readcardinal4(handle) +-- skipbytes(handle,size) +-- skipped = skipped + size + 4 +-- size = readcardinal2(handle) +-- skipbytes(handle,size) +-- skipped = skipped + size + 2 +-- end +-- position = position + 30 + namelength + extralength + skipped +-- -- if descriptor then +-- -- -- where is this one located +-- -- setposition(handle,position + compressed) +-- -- crc32 = readcardinal4(handle) +-- -- compressed = readcardinal4(handle) +-- -- uncompressed = readcardinal4(handle) +-- -- end +-- if acceptable then +-- index = index + 1 +-- local data = { +-- filename = filename, +-- index = index, +-- position = position, +-- method = method, +-- compressed = compressed, +-- uncompressed = uncompressed, +-- crc32 = crc32, +-- encrypted = encrypted, +-- } +-- hash[filename] = data +-- list[index] = data +-- else +-- -- maybe a warning when encrypted +-- end +-- position = position + compressed +-- else +-- break +-- end +-- z.list = list +-- z.hash = hash +-- end +-- end +-- end +-- end + +-- end +-- end + + local function update(handle,data) + position = data.offset + setposition(handle,position) + local signature = readstring(handle,4) + if signature == "PK\3\4" then -- 0x04034B50 + -- [local file header 1] + -- [encryption header 1] + -- [file data 1] + -- [data descriptor 1] + local version = readcardinal2(handle) + local flag = readcardinal2(handle) + local method = readcardinal2(handle) + skipbytes(handle,4) + ----- filetime = readcardinal2(handle) + ----- filedate = readcardinal2(handle) + local crc32 = readcardinal4(handle) + local compressed = readcardinal4(handle) + local uncompressed = readcardinal4(handle) + local namelength = readcardinal2(handle) + local extralength = readcardinal2(handle) + local filename = readstring(handle,namelength) + local descriptor = band(flag,8) ~= 0 + local encrypted = band(flag,1) ~= 0 + local acceptable = method == 0 or method == 8 + -- 30 bytes of header including the signature + local skipped = 0 + local size = 0 + if encrypted then + size = readcardinal2(handle) + skipbytes(handle,size) + skipped = skipped + size + 2 + skipbytes(8) + skipped = skipped + 8 + size = readcardinal2(handle) + skipbytes(handle,size) + skipped = skipped + size + 2 + size = readcardinal4(handle) + skipbytes(handle,size) + skipped = skipped + size + 4 + size = readcardinal2(handle) + skipbytes(handle,size) + skipped = skipped + size + 2 + end + if acceptable then + if filename ~= data.filename then + -- elseif method ~= data.method then + -- elseif encrypted ~= data.encrypted then + -- elseif crc32 ~= 0 and crc32 ~= data.crc32 then + -- elseif uncompressed ~= 0 and uncompressed ~= data.uncompressed then + -- elseif compressed ~= 0 and compressed ~= data.compressed then + else + position = position + 30 + namelength + extralength + skipped + data.position = position + return position + end + else + -- maybe a warning when encrypted + end + end + data.position = false + return false + end + local function collect(z) if not z.list then local list = { } @@ -76,78 +230,88 @@ local openzipfile, closezipfile, unzipfile, foundzipfile, getziphash, getziplist local position = 0 local index = 0 local handle = z.handle - while true do - setposition(handle,position) - local signature = readstring(handle,4) - if signature == "PK\3\4" then - -- [local file header 1] - -- [encryption header 1] - -- [file data 1] - -- [data descriptor 1] - local version = readcardinal2(handle) - local flag = readcardinal2(handle) - local method = readcardinal2(handle) - local filetime = readcardinal2(handle) - local filedate = readcardinal2(handle) - local crc32 = readcardinal4(handle) - local compressed = readcardinal4(handle) - local uncompressed = readcardinal4(handle) - local namelength = readcardinal2(handle) - local extralength = readcardinal2(handle) - local filename = readstring(handle,namelength) - local descriptor = band(flag,8) ~= 0 - local encrypted = band(flag,1) ~= 0 - local acceptable = method == 0 or method == 8 - -- 30 bytes of header including the signature - local skipped = 0 - local size = 0 - if encrypted then - size = readcardinal2(handle) - skipbytes(size) - skipped = skipped + size + 2 - skipbytes(8) - skipped = skipped + 8 - size = readcardinal2(handle) - skipbytes(size) - skipped = skipped + size + 2 - size = readcardinal4(handle) - skipbytes(size) - skipped = skipped + size + 4 - size = readcardinal2(handle) - skipbytes(size) - skipped = skipped + size + 2 - end - position = position + 30 + namelength + extralength + skipped - if descriptor then - setposition(handle,position + compressed) - crc32 = readcardinal4(handle) - compressed = readcardinal4(handle) - uncompressed = readcardinal4(handle) - end - if acceptable then - index = index + 1 - local data = { - filename = filename, - index = index, - position = position, - method = method, - compressed = compressed, - uncompressed = uncompressed, - crc32 = crc32, - encrypted = encrypted, - } - hash[filename] = data - list[index] = data - else - -- maybe a warning when encrypted + local size = getsize(handle) + -- + -- Not all files have the compressed into set so we need to get the directory + -- first. We only handle single disk zip files. + -- + for i=size-4,size-64*1024,-1 do + setposition(handle,i) + local enddirsignature = readcardinal4(handle) + if enddirsignature == 0x06054B50 then + local thisdisknumber = readcardinal2(handle) + local centraldisknumber = readcardinal2(handle) + local thisnofentries = readcardinal2(handle) + local totalnofentries = readcardinal2(handle) + local centralsize = readcardinal4(handle) + local centraloffset = readcardinal4(handle) + local commentlength = readcardinal2(handle) + local comment = readstring(handle,length) + if size - i >= 22 then + if thisdisknumber == centraldisknumber then + setposition(handle,centraloffset) + while true do + if readcardinal4(handle) == 0x02014B50 then + skipbytes(handle,4) + ----- versionmadeby = readcardinal2(handle) + ----- versionneeded = readcardinal2(handle) + local flag = readcardinal2(handle) + local method = readcardinal2(handle) + skipbytes(handle,4) + ----- filetime = readcardinal2(handle) + ----- filedate = readcardinal2(handle) + local crc32 = readcardinal4(handle) + local compressed = readcardinal4(handle) + local uncompressed = readcardinal4(handle) + local namelength = readcardinal2(handle) + local extralength = readcardinal2(handle) + local commentlength = readcardinal2(handle) + skipbytes(handle,8) + ----- disknumber = readcardinal2(handle) + ----- intattributes = readcardinal2(handle) + ----- extattributes = readcardinal4(handle) + local headeroffset = readcardinal4(handle) + local filename = readstring(handle,namelength) + skipbytes(handle,extralength+commentlength) + ----- extradata = readstring(handle,extralength) + ----- comment = readstring(handle,commentlength) + -- + local descriptor = band(flag,8) ~= 0 + local encrypted = band(flag,1) ~= 0 + local acceptable = method == 0 or method == 8 + if acceptable then + index = index + 1 + local data = { + filename = filename, + index = index, + position = nil, + method = method, + compressed = compressed, + uncompressed = uncompressed, + crc32 = crc32, + encrypted = encrypted, + offset = headeroffset, + } + hash[filename] = data + list[index] = data + end + else + break + end + end + end + break end - position = position + compressed - else - break end - z.list = list - z.hash = hash end + -- for i=1,index do -- delayed + -- local data = list[i] + -- if not data.position then + -- update(handle,list[i]) + -- end + -- end + z.list = list + z.hash = hash end end @@ -156,6 +320,7 @@ local openzipfile, closezipfile, unzipfile, foundzipfile, getziphash, getziplist if not list then collect(z) end + -- inspect(z.list) return z.list end @@ -193,7 +358,10 @@ local openzipfile, closezipfile, unzipfile, foundzipfile, getziphash, getziplist local handle = z.handle local position = data.position local compressed = data.compressed - if compressed > 0 then + if position == nil then + position = update(handle,data) + end + if position and compressed > 0 then setposition(handle,position) local result = readstring(handle,compressed) if data.method == 8 then @@ -451,11 +619,13 @@ if xzip then -- flate then do end end - local function unzipdir(zipname,path,verbose) + local function unzipdir(zipname,path,verbose,collect,validate) if type(zipname) == "table" then - verbose = zipname.verbose - path = zipname.path - zipname = zipname.zipname + validate = zipname.validate + collect = zipname.collect + verbose = zipname.verbose + path = zipname.path + zipname = zipname.zipname end if not zipname or zipname == "" then return @@ -473,34 +643,49 @@ if xzip then -- flate then do local done = 0 local steps = verbose == "steps" local time = steps and osclock() + -- local skip = 0 + if collect then + collect = { } + else + collect = false + end for i=1,count do local l = list[i] local n = l.filename - local d = unzipfile(z,n) -- true for check - if d then - local p = filejoin(path,n) - if mkdirs(dirname(p)) then - if steps then - total = total + #d - done = done + 1 - if done >= step then - done = 0 - logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time)) + if not validate or validate(n) then + local d = unzipfile(z,n) -- true for check + if d then + local p = filejoin(path,n) + if mkdirs(dirname(p)) then + if steps then + total = total + #d + done = done + 1 + if done >= step then + done = 0 + logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time)) + end + elseif verbose then + logwriter(n) + end + savedata(p,d) + if collect then + collect[#collect+1] = p end - elseif verbose then - logwriter(n) end - savedata(p,d) + else + logwriter(format("problem with file %s",n)) end else - logwriter(format("problem with file %s",n)) + -- skip = skip + 1 end end if steps then logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",count,count,total,osclock()-time)) end closezipfile(z) - return true + if collect then + return collect + end else closezipfile(z) end diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl index f99e6142854..37a5459e1b3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl @@ -83,18 +83,18 @@ \aliased\let\setupsidebars\setupsidebar -\permanent\tolerant\protected\def\startsidebar[#1]#*[#2]% +\permanent\tolerant\protected\def\startsidebar[#S#1]#*[#S#2]% {\bgroup \dontleavehmode \advanceby\c_anch_sidebars_level\plusone \global\advanceby\c_anch_sidebars_n\plusone \c_anch_sidebars_current\c_anch_sidebars_n\relax % relax needed \ifhastok={#1}% - \edef\currentsidebar{\the\c_anch_sidebars_level}% + \cdef\currentsidebar{\the\c_anch_sidebars_level}% \checksidebarparent \setupcurrentsidebar[#1]% \else - \def\currentsidebar{#1}% + \cdef\currentsidebar{#1}% \setupcurrentsidebar[#2]% \fi \scratchdistance\sidebarparameter\c!distance\relax @@ -186,7 +186,7 @@ \dorecurse{5}{\definesidebar[\v!margin:#1][\v!margin]} % let's be nice and predefine 5 levels -\permanent\tolerant\protected\def\setupmarginrule[#1]#*[#2]% +\permanent\tolerant\protected\def\setupmarginrule[#S#1]#*[#S#2]% {\ifarguments\or \setupsidebar[\v!margin][#1]% \or @@ -195,11 +195,11 @@ \aliased\let\setupmarginrules\setupmarginrule -\permanent\tolerant\protected\def\startmarginrule[#1]% pretty inefficient checking +\permanent\tolerant\protected\def\startmarginrule[#S#1]% pretty inefficient checking {\edef\m_anch_marginrules_kind{#1}% \ifempty\m_anch_marginrules_kind \startsidebar[\v!margin][]% - \orelse\ifhastok={\m_anch_marginrules_kind}% + \orelse\ifhastok={#1}% \startsidebar[\v!margin][#1]% \else \anch_marginrules_check{#1}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx b/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx index ea6999f45da..78ed3fc171a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx @@ -39,7 +39,7 @@ \def\anch_backgrounds_text_initialize_next {\global\advanceby\c_anch_backgrounds_text_n\plusone - \edef\v_anch_backgrounds_text_current{tbg:\number\c_anch_backgrounds_text_n}} + \edef\v_anch_backgrounds_text_current{tbg:\the\c_anch_backgrounds_text_n}} % The first position can be used in the middle of a paragraph in which case we're % too late with initializing par positions. Therefore we check if positions are @@ -62,7 +62,7 @@ \permanent\def\MPself {\MPvar{self}} \permanent\def\MPbself {b:\MPvar{self}} \permanent\def\MPeself {e:\MPvar{self}} -\permanent\def\MPparanchor{p:\number\MPparcounter} +\permanent\def\MPparanchor{p:\number\MPparcounter} % \the % \carryoverpar is needed for left/right floats @@ -125,11 +125,11 @@ \newinteger \c_anch_backgrounds_text_check \newconstant\c_anch_backgrounds_text_state -\permanent\tolerant\protected\def\starttextbackground[#tag]#spacer[#settings]% +\permanent\tolerant\protected\def\starttextbackground[#tag]#spacer[#S#settings]% {\begingroup \global\advanceby\c_anch_backgrounds_text_count\plusone \advanceby\c_anch_backgrounds_text_level\plusone - \def\currenttextbackground{#tag}% + \cdef\currenttextbackground{#tag}% \anch_backgrounds_text_initialize_next \ifparameter#settings\or \setupcurrenttextbackground[#settings]% @@ -398,8 +398,8 @@ \newdimension \d_free_offset_bottom \installtextracker{floats.freeregion} - {\settrue \c_strc_floats_trace_free} - {\setfalse\c_strc_floats_trace_free} + {\c_strc_floats_trace_free\conditionaltrue} + {\c_strc_floats_trace_free\conditionalfalse} \def\strc_floats_mark_as_free#1#2#3#4#5% {\c_free_offset_kind #1% diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl index e1ab5662c90..a8a59849636 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl @@ -37,7 +37,7 @@ \mutable\lettonothing\boxanchorposone \mutable\lettonothing\boxanchorpostwo -\tolerant\permanent\protected\def\connectboxanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6% +\tolerant\permanent\protected\def\connectboxanchors[#1]#*[#2]#*[#S#3]#*[#S#4]#*#:#5#6% {\begingroup % \edef\boxanchorone{\boxanchoringclass:#5}% @@ -81,7 +81,7 @@ % dedicated or not -\tolerant\permanent\protected\def\connectmatrixanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6% +\tolerant\permanent\protected\def\connectmatrixanchors[#1]#*[#2]#*[#S#3]#*[#S#4]#*#:#5#6% {\begingroup \doifelseinset{#5}{\m_anch_matrix_list}\donetrue\donefalse \ifdone\else diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt b/Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt index 14efab2606f..1574c75ad12 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt @@ -13,7 +13,6 @@ local context = context local nuts = nodes.nuts local nodepool = nodes.pool -local whatever = nodepool.userids["localanchor"] local new_usernode = nodepool.usernode local new_kern = nuts.pool.kern local getbox = nuts.getbox @@ -30,10 +29,12 @@ local implement = interfaces.implement local analyze = drivers.converters.analyze -local dimension_value = tokens.values.dimension +local dimension_value = tokens.values.dimension -local v_left = interfaces.variables.left -local v_middle = interfaces.variables.middle +local whatever = nodepool.userids["localanchor"] + +local v_left = interfaces.variables.left +local v_middle = interfaces.variables.middle local positionsstack = setmetatableindex("table") diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt index 575d4e90644..df7fc6639a6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt @@ -28,20 +28,20 @@ local settings_to_array = utilities.parsers.settings_to_array local enableaction = nodes.tasks.enableaction -local commands = commands local context = context +local ctx_doifelse = commands.doifelse + local implement = interfaces.implement local texgetcount = tex.getcount -local texiscount = tex.iscount local getmacro = tokens.getters.macro local expandasvalue = tex.expandasvalue local scanmpstring = mp.scan.string ----- mpgnamespace = getmacro("??graphicvariable") -local string_value = tokens.values.string +local string_value = tokens.values.string local report_graphics = logs.reporter("backgrounds") local report_shapes = logs.reporter("backgrounds","shapes") @@ -62,7 +62,7 @@ local f_pair = formatters["(%p,%p)"] local f_path = formatters["%--t--cycle"] local f_pair_i = formatters["(%r,%r)"] -- rounded -local c_realpageno = texiscount("realpageno") +local c_realpageno = tex.iscount("realpageno") graphics = graphics or { } local backgrounds = { } @@ -78,7 +78,7 @@ backgrounds.path = f_path local texsetattribute = tex.setattribute -local a_textbackground = attributes.private("textbackground") +local a_textbackground = attributes.private("textbackground") local nuts = nodes.nuts @@ -94,8 +94,7 @@ local setlink = nuts.setlink local getheight = nuts.getheight local getdepth = nuts.getdepth -local nodecodes = nodes.nodecodes -local par_code = nodecodes.par +local par_code = nodes.nodecodes.par local startofpar = nuts.startofpar local insertbefore = nuts.insertbefore @@ -103,7 +102,7 @@ local insertafter = nuts.insertafter local processranges = nuts.processranges -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue local jobpositions = job.positions local getpos = jobpositions.getpos @@ -1323,8 +1322,6 @@ end do - local doifelse = commands.doifelse - implement { name = "doifelserangeonpage", arguments = { "string", "string", "integer" }, @@ -1337,12 +1334,12 @@ do local l = c[last] if l then l = l.p - doifelse(l and l ~= true and page <= l) + ctx_doifelse(l and l ~= true and page <= l) return end end end - doifelse(false) + ctx_doifelse(false) end } diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl index 10c66b66581..809e7163802 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl @@ -51,7 +51,7 @@ \aliased\let\doifpositionactionelse\doifelsepositionaction \permanent\protected\def\dopositionaction#1% - {\edef\currentpositionaction{#1}% + {\cdef\currentpositionaction{#1}% \ifcsname\??positionaction\currentpositionaction\endcsname \anch_positions_action_indeed \fi} @@ -68,8 +68,8 @@ {\begingroup \setbox\scratchbox\hbox % \hpack {\anch_positions_trace_action_yes - \the\everyinsertpositionaction - \the\everypositionaction + \expand\everyinsertpositionaction + \expand\everypositionaction \begincsname\??positionaction\currentpositionaction\endcsname \anch_positions_cleanup_action}% \smashedbox\scratchbox % smashing is really needed else we get problems with too big overlays @@ -96,13 +96,13 @@ \def\anch_positions_cleanup_action % not in trialtypesetting {\ifcsname\??positioncleanup\currentpositionaction\endcsname - \the\everycleanpositionaction + \expand\everycleanpositionaction \xdefcsname\??positioncleanup\currentpositionaction\endcsname{\csname\??positioncleanup\currentpositionaction\endcsname}% \fi} \permanent\protected\def\handlepositionaction#1\with#2\on#3% ugly, will change {\begingroup - \edef\currentpositionanchor{\ifempty\currentpositionoverlay#3\else\currentpositionoverlay::\MPanchoridentifier\fi}% + \cdef\currentpositionanchor{\ifempty\currentpositionoverlay#3\else\currentpositionoverlay::\MPanchoridentifier\fi}% \normalexpanded{\anch_positions_set_action{\currentpositionanchor}{\noexpand\csname\??positioncleanup\currentpositionanchor\endcsname}}% \let#1\relax \ifcsname\??positioncleanup\currentpositionanchor\endcsname @@ -225,7 +225,7 @@ \def\anch_positions_overlay_indeed#1% {\begingroup - \edef\currentpositionoverlay{#1}% + \cdef\currentpositionoverlay{#1}% \ifcsname\??positionaction\currentpositionoverlay::\MPanchoridentifier\endcsname \anch_positions_overlay_compose \fi @@ -239,7 +239,7 @@ \edef\MPanchorid{\currentpositionoverlay::\MPanchoridentifier:\MPanchornumber}% realpageno % \edef\MPanchor##1{\MPpos\MPanchorid}% \enforced\let\MPanchor\MPoverlayanchor % no need to fetch it already, seldom used - \the\everyinsertpositionaction + \expand\everyinsertpositionaction \copyposition{\currentpositionoverlay::\MPanchoridentifier}\MPanchorid \setbox\scratchbox\hbox to \d_overlay_width % \hpack {\dopositionaction{\currentpositionoverlay::\MPanchoridentifier}\hss}% @@ -260,8 +260,8 @@ \def\anch_positions_region_overlay_indeed#1#2% {\begingroup - \edef\currentpositionregion {#1}% - \edef\currentpositionoverlay{#2}% + \cdef\currentpositionregion {#1}% + \cdef\currentpositionoverlay{#2}% \ifcsname\??positionaction\currentpositionoverlay::\MPanchoridentifier\endcsname \anch_positions_region_overlay_compose \fi @@ -271,7 +271,7 @@ {\vpack to \d_overlay_height {\let\MPanchorid\currentpositionregion \enforced\let\MPanchor\MPoverlayanchor % no need to fetch it already, seldom used - \the\everyinsertpositionaction + \expand\everyinsertpositionaction \copyposition{\currentpositionoverlay::\MPanchoridentifier}\MPanchorid \setbox\scratchbox\hbox to \d_overlay_width % \hpack {\dopositionaction{\currentpositionoverlay::\MPanchoridentifier}\hss}% @@ -298,7 +298,7 @@ \def\anch_positions_overlay_start_yes#1% {\checkpositionoverlays - \edef\currentpositionoverlay{#1}} + \cdef\currentpositionoverlay{#1}} \permanent\protected\def\stoppositionoverlay {\lettonothing\currentpositionoverlay} @@ -318,16 +318,16 @@ \permanent\protected\lettonothing\stopMPpositiongraphic \def\anch_positions_meta_graphic_prepare - {\iftok{\mpcategoryparameter{self}}\emptytoks + {\ifempty{\mpcategoryparameter{self}}% \letmpcategoryparameter{self}\currentposition \fi - \iftok{\mpcategoryparameter{from}}\emptytoks + \ifempty{\mpcategoryparameter{from}}% \letmpcategoryparameter{from}\currentposition \fi} \def\anch_positions_meta_graphic_use#1#2#3% {\begingroup - \edef\currentmpcategory{#1}% + \cdef\currentmpcategory{#1}% \anch_positions_meta_graphic_prepare \startMPcode#3\stopMPcode \endgroup} @@ -346,7 +346,7 @@ \def\anch_positions_meta_graphic_direct#1#2#3% what tag setups {\begingroup - \edef\currentmpcategory{#2}% + \cdef\currentmpcategory{#2}% \setupcurrentmpcategory[#3]% \anch_positions_meta_graphic_prepare \obeyMPboxorigin % do we also set the size ? when needed this must be done in mp ... might change @@ -360,7 +360,7 @@ \def\anch_positions_meta_graphic_nested#1#2#3% nesting used in prikkels / pascal (might go away) {\begingroup - \edef\currentmpcategory{#2}% + \cdef\currentmpcategory{#2}% \setupcurrentmpcategory[#1,#3]% \anch_positions_meta_graphic_prepare \begincsname\??positiongraphic#2\endcsname @@ -385,7 +385,7 @@ \def\anch_positions_meta_graphic_insert#1#2#3% pos tag setups {\ifnum\MPp{#1}=\realpageno\relax % extra saveguard - \def\currentposition{#1}\MPpositiongraphic{#2}{#3}% + \cdef\currentposition{#1}\MPpositiongraphic{#2}{#3}% \fi} \let\anch_positions_meta_graphic_handle_indeed\relax @@ -417,7 +417,7 @@ \def\anch_positions_meta_graphic_insert_range#1#2#3#4% pos pos tag setups {\clf_doifelserangeonpage{#1}{#2}\realpageno - {\def\currentposition{#1}% + {\cdef\currentposition{#1}% \MPpositiongraphic{#3}{#4}}% {}} diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt index 07a6ecf33f9..0afe443d35e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt @@ -61,6 +61,9 @@ local context = context local ctx_latelua = context.latelua +local ctx_doif = commands.doif +local ctx_doifelse = commands.doifelse + local tex = tex local texgetdimen = tex.getdimen local texgetcount = tex.getcount @@ -87,20 +90,19 @@ local setprop = nuts.setprop local getparstate = nuts.getparstate -local hlist_code = nodes.nodecodes.hlist -local par_code = nodes.nodecodes.par +local hlist_code = nodes.nodecodes.hlist +local par_code = nodes.nodecodes.par local find_tail = nuts.tail ----- hpack = nuts.hpack local new_latelua = nuts.pool.latelua -local variables = interfaces.variables -local v_text = variables.text -local v_column = variables.column +local v_text = interfaces.variables.text +local v_column = interfaces.variables.column + +local pt = number.dimenfactors.pt -local pt = number.dimenfactors.pt -local pts = number.pts local formatters = string.formatters local collected = allocate() @@ -145,9 +147,9 @@ local f_region = formatters["region:%s"] local f_tag_three = formatters["%s:%s:%s"] local f_tag_two = formatters["%s:%s"] -local c_realpageno = texiscount("realpageno") -local d_strutht = texisdimen("strutht") -local d_strutdp = texisdimen("strutdp") +local c_realpageno = texiscount("realpageno") +local d_strutht = texisdimen("strutht") +local d_strutdp = texisdimen("strutdp") -- Because positions are set with a delay we cannot yet make the tree -- so that -- is a finalizer step. But, we already have a dual split. @@ -1197,7 +1199,7 @@ end do - local c_anch_positions_paragraph = texiscount("c_anch_positions_paragraph") + local c_anch_positions_paragraph = texiscount("c_anch_positions_paragraph") local nofparagraphs = 0 @@ -2205,16 +2207,13 @@ implement { end } -local doif = commands.doif -local doifelse = commands.doifelse - implement { name = "doifelseposition", arguments = "argument", public = true, protected = true, actions = function(name) - doifelse(collected[name]) + ctx_doifelse(collected[name]) end } @@ -2224,7 +2223,7 @@ implement { public = true, protected = true, actions = function(name) - doif(collected[name]) + ctx_doif(collected[name]) end } @@ -2235,7 +2234,7 @@ implement { protected = true, actions = function(name,p) local c = collected[name] - doifelse(c and c.p == p) + ctx_doifelse(c and c.p == p) end } @@ -2245,7 +2244,7 @@ implement { public = true, protected = true, actions = function(one,two) - doifelse(overlapping(one,two)) + ctx_doifelse(overlapping(one,two)) end } @@ -2255,7 +2254,7 @@ implement { public = true, protected = true, actions = function(list) - doifelse(onsamepage(list)) + ctx_doifelse(onsamepage(list)) end } @@ -2265,7 +2264,7 @@ implement { public = true, protected = true, actions = function(list) - doifelse(onsamepage(list,tostring(texgetcount(c_realpageno)))) + ctx_doifelse(onsamepage(list,tostring(texgetcount(c_realpageno)))) end } @@ -2274,7 +2273,7 @@ implement { public = true, protected = true, actions = function() - doifelse(jobpositions.used()) + ctx_doifelse(jobpositions.used()) end } diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl index a1e0cc35434..951e0fdf2b2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl @@ -144,7 +144,7 @@ \def\anch_positions_set_only_indeed#1% {\anch_positions_initialize - \edef\currentposition{#1}% + \cdef\currentposition{#1}% \dosetposition\currentposition} \permanent\protected\def\setposition @@ -156,7 +156,7 @@ \def\anch_positions_set_indeed#1% {\anch_positions_initialize - \edef\currentposition{#1}% + \cdef\currentposition{#1}% \dosetposition\currentposition \anch_positions_trace_left \dopositionaction\currentposition} @@ -171,7 +171,7 @@ \def\anch_positions_set_data_indeed#1#2#3#4% {\anch_positions_initialize \hbox % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionwhd\currentposition{#2}{#3}{#4}% \anch_positions_trace_left \dopositionaction\currentposition @@ -194,7 +194,7 @@ {\anch_positions_initialize %\hbox to \wd\nextbox \hpack to \wd\nextbox - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionbox\currentposition\nextbox \anch_positions_trace_left \setbox\b_anch_position\box\nextbox @@ -215,7 +215,7 @@ \def\anch_positions_set_strut_yes#1% {\anch_positions_initialize \hbox to \zeropoint % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionstrut\currentposition \anch_positions_trace_left \dopositionaction\currentposition @@ -232,7 +232,7 @@ \def\anch_positions_set_strut_kind_yes#1#2% {\anch_positions_initialize \hbox to \zeropoint % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionstrutkind\currentposition{#2}% \anch_positions_trace_left \dopositionaction\currentposition @@ -252,7 +252,7 @@ \def\anch_positions_set_plus_indeed#1#2#3#4#5% {\anch_positions_initialize \hbox % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionplus\currentposition{#2}{#3}{#4}{#5}% \anch_positions_trace_right \dopositionaction\currentposition @@ -274,7 +274,7 @@ \def\anch_positions_set_plus_yes_finish#1#2% {\anch_positions_initialize \hbox to \nextboxwd % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionplus\currentposition{\wd\nextbox}{\ht\nextbox}{\dp\nextbox}{#2}% \anch_positions_trace_right \setbox\b_anch_position\flushnextbox @@ -420,7 +420,7 @@ % see top: \newinteger\c_anch_positions_paragraph \permanent\protected\def\tracepositions - {\the\t_anch_positions_tracers} + {\expand\t_anch_positions_tracers} \permanent\protected\def\enableparpositions % global {\enforced\aliased\glet\registerparoptions\doregisterparoptions @@ -444,7 +444,7 @@ {\hss \startcolor[blue]% \hpack \s!yoffset -2\onepoint to \zeropoint - {\hss\infofont\number\c_anch_positions_paragraph\hskip2\onepoint}% + {\hss\infofont\the\c_anch_positions_paragraph\hskip2\onepoint}% \vrule \s!width 4\onepoint \s!height2\onepoint diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl index 94e02165307..27b4633e4ad 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl @@ -60,7 +60,7 @@ % for text backgrounds \appendtoks - \settrue\c_anch_backgrounds_pos_no_shape + \c_anch_backgrounds_pos_no_shape\conditionaltrue \to \everytabulate %D Beware, the following code is somewhat weird and experimental and might be @@ -94,7 +94,7 @@ \tolerant\def\anch_table_checked#1[#2]% {\iftrialtypesetting - \global\settrue\tablehaspositions + \global\tablehaspositions\conditionaltrue \expandafter\anch_tables_indeed_NC \orelse\ifparameter#2\or \expandafter#1% @@ -132,12 +132,12 @@ \def\anch_tables_process_GSC[#1:#2]% {\remappositionframed{#2}{\tbPOSprefix#1}% \anch_tabulate_bpos{\tbPOSprefix#1}% - \doglobal\appendtoks\expandafter\anch_tabulate_epos\expandafter{\tbPOSprefix#1}\to\posXCtoks} -% \xtoksapp\posXCtoks{\anch_tabulate_epos{\tbPOSprefix#1}}} +% \doglobal\appendtoks\expandafter\anch_tabulate_epos\expandafter{\tbPOSprefix#1}\to\posXCtoks} + \xtoksapp\posXCtoks{\anch_tabulate_epos{\tbPOSprefix#1}}} \def\anch_tables_indeed_GFC[#1]% - {\doglobal\appendtoks\anch_tables_delayed_GFC[#1]\to\posXCtoks\NC} -% {\gtoksapp\posXCtoks{\anch_tables_delayed_GFC[#1]}\NC} +% {\doglobal\appendtoks\anch_tables_delayed_GFC[#1]\to\posXCtoks\NC} + {\gtoksapp\posXCtoks{\anch_tables_delayed_GFC[#1]}\NC} \def\anch_tables_delayed_GFC[#1]% {\processcommalist[#1]\anch_tables_step_GFC} @@ -150,12 +150,12 @@ \anch_tabulate_bpos{\tbPOSprefix#1}} \def\anch_tables_indeed_GTC[#1]% - {\doglobal\appendtoks\anch_tables_delayed_GTC[#1]\to\posXCtoks\NC} -% {\gtoksapp\posXCtoks{\anch_tables_delayed_GTC[#1]}\NC} +% {\doglobal\appendtoks\anch_tables_delayed_GTC[#1]\to\posXCtoks\NC} + {\gtoksapp\posXCtoks{\anch_tables_delayed_GTC[#1]}\NC} \def\anch_tables_delayed_GTC[#1]% - {\doglobal\appendtoks\anch_tables_process_GTC[#1]\to\posXCtoks} -% {\gtoksapp\posXCtoks{\anch_tables_process_GTC[#1]}\NC} +% {\doglobal\appendtoks\anch_tables_process_GTC[#1]\to\posXCtoks} + {\gtoksapp\posXCtoks{\anch_tables_process_GTC[#1]}\NC} \def\anch_tables_process_GTC[#1]% {\processcommalist[#1]\anch_tables_step_GTC} @@ -196,7 +196,7 @@ \appendtoks \global\advanceby\noftabpositions\plusone - \global\setfalse\tablehaspositions + \global\tablehaspositions\conditionalfalse \to \everytabulate % We need to handle paragraphs as well. @@ -275,7 +275,7 @@ \appendtoks \global\advanceby\noftabpositions\plusone - \global\setfalse\tablehaspositions + \global\tablehaspositions\conditionalfalse \to \everytable %D Since we don't want nameclashes: @@ -367,14 +367,14 @@ \copyposition{e:#1}{e:#2}% \anch_positions_set_action{b:#2}{\dopositionaction{b:#1}}} -\permanent\tolerant\protected\def\definepositionframed[#1]#*[#2]% +\permanent\tolerant\protected\def\definepositionframed[#1]#*[#S#2]% {\anch_positions_set_action{b:#1}{\anch_framed_handle[#1][#2]}} \protected\def\anch_framed_handle {\bgroup \positionframed} -\permanent\tolerant\protected\def\positionframed[#1]#*[#2]% +\permanent\tolerant\protected\def\positionframed[#1]#*[#S#2]% {\setbox\scratchbox\hpack {\scratchwidth \dimexpr\MPx{e:#1}-\MPx{b:#1}\relax \scratchdepth \dimexpr\MPy{b:#1}-\MPy{e:#1}+\MPd{e:#1}\relax diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-alt.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-alt.lmt index 9d85920741d..42f3af48b9a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-alt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-alt.lmt @@ -22,7 +22,7 @@ local implement = interfaces.implement attributes.alternates = attributes.alternates or { } local alternates = attributes.alternates -local a_alternate = attributes.private('alternate') +local a_alternate = attributes.private('alternate') alternates.data = allocate() alternates.values = alternates.values or { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl b/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl index 3881d929e1c..73fd7b65bf2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl @@ -38,7 +38,7 @@ \unprotect -\permanent\protected\def\startalternate[#1]% maybe better/also: [text={...}] +\permanent\protected\def\startalternate[#S#1]% maybe better/also: [text={...}] {\begingroup \getdummyparameters[\c!text=,#1]% \clf_setalternate text {\dummyparameter\c!text}\relax} diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt index 1ac1cf93b0e..a6c8ac2ea59 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt @@ -26,8 +26,8 @@ local context = context local tex = tex local variables = interfaces.variables -local v_yes = variables.yes -local v_no = variables.no +local v_yes = variables.yes +local v_no = variables.no local p_split_comma = lpeg.tsplitat(",") local p_split_colon = lpeg.splitat(":") @@ -49,7 +49,8 @@ local report_transparencies = logs.reporter("transparencies","support") local states = attributes.states local registrations = backends.registrations local nodeinjections = backends.nodeinjections -local unsetvalue = attributes.unsetvalue + +local unsetvalue = attributes.unsetvalue local enableaction = nodes.tasks.enableaction local setaction = nodes.tasks.setaction @@ -95,8 +96,8 @@ local texgetattribute = tex.getattribute attributes.colors = attributes.colors or { } local colors = attributes.colors -local a_color = attributes.private('color') -local a_selector = attributes.private('colormodel') +local a_color = attributes.private('color') +local a_selector = attributes.private('colormodel') colors.data = allocate() colors.values = colors.values or { } @@ -132,7 +133,7 @@ local f_colors = { } local models = { - [interfaces.variables.none] = unsetvalue, + [variables.none] = unsetvalue, black = unsetvalue, bw = unsetvalue, all = 1, @@ -502,7 +503,7 @@ end -- transparencies -local a_transparency = attributes.private('transparency') +local a_transparency = attributes.private('transparency') attributes.transparencies = attributes.transparencies or { } local transparencies = attributes.transparencies @@ -613,6 +614,7 @@ end attributes.colorintents = attributes.colorintents or { } local colorintents = attributes.colorintents colorintents.data = allocate() -- colorintents.data or { } + colorintents.attribute = attributes.private('colorintent') colorintents.registered = allocate { diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-eff.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-eff.lmt index d04408fb970..a36a48a6b73 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-eff.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-eff.lmt @@ -20,13 +20,12 @@ local formatters = string.formatters local interfaces = interfaces local implement = interfaces.implement -local variables = interfaces.variables -local v_normal = variables.normal +local v_normal = interfaces.variables.normal attributes.effects = attributes.effects or { } local effects = attributes.effects -local a_effect = attributes.private('effect') +local a_effect = attributes.private('effect') effects.data = allocate() effects.values = effects.values or { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-eff.mkxl b/Master/texmf-dist/tex/context/base/mkxl/attr-eff.mkxl index 5a50ab60cdc..f0eafcbc310 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-eff.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-eff.mkxl @@ -28,8 +28,7 @@ \c!alternative=\v!normal] \appendtoks - \edef\p_method{\effectparameter\c!method}% - \ifx\p_method\v!command + \ifcstok{\effectparameter\c!method}\v!command \frozen\protected\xdefcsname\e!start\currenteffect\endcsname{\starteffect[#1]}% \frozen\protected\xdefcsname\e!stop \currenteffect\endcsname{\stopeffect}% \fi diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt index 32fc36cdd87..8e2a2da3753 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt @@ -34,7 +34,7 @@ attributes.values = attributes.values or { } attributes.counts = attributes.counts or { } attributes.handlers = attributes.handlers or { } attributes.states = attributes.states or { } -attributes.unsetvalue = -0x7FFFFFFF +attributes.unsetvalue = tex.magicconstants.unusedattributevalue local currentfont = font.current local currentattributes = nodes and nodes. currentattributes or node.currentattributes @@ -57,7 +57,7 @@ local report_value = logs.reporter("attributes","values") local trace_values = false -local max_register_index = tex.magicconstants.max_attribute_register_index +local max_register_index = tex.magicconstants.max_attribute_register_index trackers.register("attributes.values", function(v) trace_values = v end) diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl index ce21be08128..9b04422027e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl @@ -59,25 +59,30 @@ \global\permanent\expandafter\attributedef\csname\??attributeprefix#2\endcsname\scratchcounter % \foo = 123 \global\permanent\expandafter\integerdef \csname\??attributeid #2\endcsname\scratchcounter % \attribute\foo = 123 % some attributes are always global - \doifelseinset\s!global{#3}% - {\xtoksapp\t_attr_list_global{\csname\??attributeprefix#2\endcsname\attributeunsetvalue}}% \c_attr_foo - {\xtoksapp\t_attr_list_local {\csname\??attributeprefix#2\endcsname\attributeunsetvalue}}% - \doifinset\s!nomath{#3}% - {\xtoksapp\t_attr_list_nomath{\csname\??attributeprefix#2\endcsname\attributeunsetvalue}}% - \doifinset\s!public{#3}% - {\aliased\gletcsname#2\s!attribute\expandafter\endcsname\csname\??attributeid#2\endcsname}% \attribute\fooattribute + \ifinset\s!global{#3}% + \xtoksapp\t_attr_list_global{\csname\??attributeprefix#2\endcsname\attributeunsetvalue}% \c_attr_foo + \else + \xtoksapp\t_attr_list_local {\csname\??attributeprefix#2\endcsname\attributeunsetvalue}% + \fi + \ifinset\s!nomath{#3}% + \xtoksapp\t_attr_list_nomath{\csname\??attributeprefix#2\endcsname\attributeunsetvalue}% + \fi + \ifinset\s!public{#3}% + \aliased\gletcsname#2\s!attribute\expandafter\endcsname\csname\??attributeid#2\endcsname% \attribute\fooattribute + \fi % used to sync in the page builder .. used for directions and scripts ... i start forgetting these details .. (seldom used) - \doifinset\s!pickup{#3}% - {\global\expandafter\integerdef\csname\??attributepickup#2\endcsname\attributeunsetvalue - \xtoksapp\t_attr_list_pickup{\csname\??attributeprefix#2\endcsname\csname\??attributepickup#2\endcsname}% - \ifcsname#2\s!attribute\endcsname - \permanent\xdefcsname\s!pickup#2\s!attribute\endcsname{\expandafter\integerdef\csname\??attributepickup#2\endcsname\csname\??attributeprefix#2\endcsname}% - \permanent\xdefcsname\s!forget#2\s!attribute\endcsname{\expandafter\integerdef\csname\??attributepickup#2\endcsname\attributeunsetvalue}% - \fi}% + \ifinset\s!pickup{#3}% + \global\expandafter\integerdef\csname\??attributepickup#2\endcsname\attributeunsetvalue + \xtoksapp\t_attr_list_pickup{\csname\??attributeprefix#2\endcsname\csname\??attributepickup#2\endcsname}% + \ifcsname#2\s!attribute\endcsname + \permanent\xdefcsname\s!pickup#2\s!attribute\endcsname{\expandafter\integerdef\csname\??attributepickup#2\endcsname\csname\??attributeprefix#2\endcsname}% + \permanent\xdefcsname\s!forget#2\s!attribute\endcsname{\expandafter\integerdef\csname\??attributepickup#2\endcsname\attributeunsetvalue}% + \fi + \fi \fi} \permanent\protected\def\pickupattributes - {\the\t_attr_list_pickup\relax} + {\expand\t_attr_list_pickup\relax} \permanent\protected\def\newattribute#1% {\attr_basics_define_indeed[\s!public][\csstring#1][]% @@ -92,8 +97,8 @@ \aliased\let\dompattribute\gobbletwoarguments -\permanent\protected\def\resetglobalattributes{\the\t_attr_list_global\glyphdatafield\zerocount\glyphscriptfield\zerocount} -\permanent\protected\def\resetlocalattributes {\the\t_attr_list_local \glyphdatafield\zerocount\glyphscriptfield\zerocount} +\permanent\protected\def\resetglobalattributes{\expand\t_attr_list_global\glyphdatafield\zerocount\glyphscriptfield\zerocount} +\permanent\protected\def\resetlocalattributes {\expand\t_attr_list_local \glyphdatafield\zerocount\glyphscriptfield\zerocount} \aliased\let\resetallattributes\resetlocalattributes diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-lay.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-lay.lmt index d0febb9eefb..bcedf1a041a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-lay.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-lay.lmt @@ -44,12 +44,12 @@ attributes.viewerlayers = attributes.viewerlayers or { } local viewerlayers = attributes.viewerlayers local variables = interfaces.variables -local v_local = variables["local"] -local v_global = variables["global"] -local v_start = variables["start"] -local v_yes = variables["yes"] +local v_local = variables["local"] +local v_global = variables["global"] +local v_start = variables["start"] +local v_yes = variables["yes"] -local a_viewerlayer = attributes.private("viewerlayer") +local a_viewerlayer = attributes.private("viewerlayer") viewerlayers = viewerlayers or { } viewerlayers.data = allocate() @@ -133,7 +133,7 @@ local function initializer(...) return states.initialize(...) end -attributes.viewerlayers.handler = nodes.installattributehandler { +viewerlayers.handler = nodes.installattributehandler { name = "viewerlayer", namespace = viewerlayers, initializer = initializer, @@ -245,6 +245,11 @@ function viewerlayers.define(settings) end end +function viewerlayers.setup(settings) + -- fragile + codeinjections.setupviewerlayer(settings) +end + function viewerlayers.definedlayoutcomponent(tag) viewerlayers.define { tag = tag, @@ -266,10 +271,8 @@ implement { actions = viewerlayers.cleanup } -implement { - name = "defineviewerlayer", - actions = viewerlayers.define, - arguments = { +do + local t = { { { "tag" }, { "title" }, @@ -278,10 +281,22 @@ implement { { "export" }, { "printable" }, { "scope" }, - }, - true + } } -} + + implement { + name = "defineviewerlayer", + actions = viewerlayers.define, + arguments = t + } + + implement { + name = "setupviewerlayer", + actions = viewerlayers.setup, + arguments = t + } + +end implement { name = "definedlayoutcomponent", diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl b/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl index 122839c0608..773b4113c1c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl @@ -38,21 +38,30 @@ \c!scope=\v!local, % maybe global but needs checking with layout \c!method=\v!none] +\permanent\def\attr_layoutcomponent_whatever#1% + {#1% + tag {\currentviewerlayer}% + title {\viewerlayerparameter\c!title}% + visible {\viewerlayerparameter\c!state}% + editable {\v!yes}% + export {\viewerlayerparameter\c!export}% + printable {\viewerlayerparameter\c!printable}% + scope {\viewerlayerparameter\c!scope}% + \relax} + \appendtoks - \clf_defineviewerlayer - tag {\currentviewerlayer}% - title {\viewerlayerparameter\c!title}% - visible {\viewerlayerparameter\c!state}% - editable {\v!yes}% - export {\viewerlayerparameter\c!export}% - printable {\viewerlayerparameter\c!printable}% - scope {\viewerlayerparameter\c!scope}% - \relax - \doif{\viewerlayerparameter\c!method}\v!command - {\frozen\instance\setuxvalue{\e!start#1}{\startviewerlayer[\currentviewerlayer]}% - \frozen\instance\setuxvalue{\e!stop #1}{\stopviewerlayer}}% + \attr_layoutcomponent_whatever\clf_defineviewerlayer + \ifcstok{\viewerlayerparameter\c!method}\v!command + \frozen\protected\instance\xdefcsname\e!start\currentviewerlayer\endcsname{\startviewerlayer[\currentviewerlayer]}% + \else + \frozen\protected\instance\xdefcsname\e!stop \currentviewerlayer\endcsname{\stopviewerlayer}% + \fi \to \everydefineviewerlayer +\appendtoks + \attr_layoutcomponent_whatever\clf_setupviewerlayer +\to \everysetupviewerlayer + % \startviewerlayer[#1] % defined at lua end % \stopviewerlayer % defined at lua end diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-mkr.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-mkr.lmt index 10550d93504..a2cddf5d845 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-mkr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-mkr.lmt @@ -11,7 +11,7 @@ nodes.markers = markers local cache = { } local numbers = attributes.numbers -local a_unknown = attributes.private("marker:unknown") +local a_unknown = attributes.private("marker:unknown") local nuts = nodes.nuts local tonut = nodes.tonut diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-neg.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-neg.lmt index 4739b736d82..4909a42b528 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/attr-neg.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/attr-neg.lmt @@ -19,7 +19,6 @@ local states = attributes.states local enableaction = nodes.tasks.enableaction local nodeinjections = backends.nodeinjections local texsetattribute = tex.setattribute -local variables = interfaces.variables local allocate = utilities.storage.allocate local setmetatableindex = table.setmetatableindex @@ -28,16 +27,16 @@ local setmetatableindex = table.setmetatableindex attributes.negatives = attributes.negatives or { } local negatives = attributes.negatives -local a_negative = attributes.private("negative") +local a_negative = attributes.private("negative") -local v_none = interfaces.variables.none +local v_none = interfaces.variables.none negatives.data = allocate() negatives.attribute = a_negative negatives.registered = allocate { - [variables.positive] = 1, - [variables.negative] = 2, + [interfaces.variables.positive] = 1, + [interfaces.variables.negative] = 2, } local data = negatives.data diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt index 4df109b54f5..8357ad7d5fe 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt @@ -8,6 +8,7 @@ if not modules then modules = { } end modules ['back-exp-imp-mth'] = { local sub = string.sub local utfchar, utfvalues = utf.char, utf.values +local insert = table.insert local setmetatableindex, concat = table.setmetatableindex, table.concat local structurestags = structures.tags @@ -29,12 +30,14 @@ local implement = interfaces.implement do - local automathrows = true directives.register("export.math.autorows", function(v) automathrows = v end) - local automathapply = true directives.register("export.math.autoapply", function(v) automathapply = v end) - local automathnumber = true directives.register("export.math.autonumber", function(v) automathnumber = v end) + ----- automathrows = true directives.register("export.math.autorows", function(v) automathrows = v end) + ----- automathapply = true directives.register("export.math.autoapply", function(v) automathapply = v end) + ----- automathnumber = true directives.register("export.math.autonumber", function(v) automathnumber = v end) local automathstrip = true directives.register("export.math.autostrip", function(v) automathstrip = v end) local functions = mathematics.categories.functions + local tagging = mathematics.tagging + local functiontype = mathematics.functiontype local function collapse(di,i,data,ndata,detail,element) local collapsing = di.data @@ -56,48 +59,89 @@ do return i end - local function collapse_mn(di,i,data,ndata) - -- this is tricky ... we need to make sure that we wrap in mrows if we want - -- to bypass this one - local collapsing = di.data - if data then - i = i + 1 - while i <= ndata do - local dn = data[i] - local tg = dn.tg - if tg == "mn" then - collapsing[#collapsing+1] = dn.data[1] - dn.skip = "ignore" - i = i + 1 - elseif tg == "mo" then - local d = dn.data[1] - if d == "." then - collapsing[#collapsing+1] = d - dn.skip = "ignore" - i = i + 1 + local function collapse_all_mn(data) + local n = #data + local f = false + local l = false + local d = false + local p = false + for i=1,n do + local di = data[i] + local tg = di.tg + if tg == "mn" then + if not f then + d = di.data + f = i + p = false + else + if p then + p.element = "mn" + local s = specifications[p.fulltag] + s.mathcharacter = nil + s.mathclass = nil + s.mathgroup = nil + s.mathindex = nil + end + d[#d+1] = di.data[1] + data[i] = false + p = false + end + l = i + elseif tg == "mi" or tg == "mc" then + if p then + f = false + end + if i < n and data[i+1].tg == "mn" then + local d1 = di.data[1] + if d1 then + local c = d1.content + local s = specifications[di.fulltag] + if s.mathclass == "ordinary" and c and (c == "." or c == ",") then + if not f then + d = di.data + f = i + l = i + p = di + else + d[#d+1] = d1 + data[i] = false + end + else + f = false + end else - break + f = false end else - break + f = false + end + elseif f and (tg == "msub" or tg == "msup" or tg == "msubsup") then + local d1 = di.data[1] + if d1 and d1.tg == "mn" then + d[#d+1] = d1.data[1] + d1.data = d + data[f] = false end + f = false + else + f = false + end + end + if d then + local j = 0 + for i=1,n do + local d = data[i] + if d then + j = j + 1 + data[j] = d + end + end + for i=j+1,n do + data[i] = nil end end - return i end - -- maybe delay __i__ till we need it - - local apply_function = { - { - element = "mo", - -- comment = "apply function", - -- data = { utfchar(0x2061) }, - data = { "⁡" }, - nature = "mixed", - } - } - local functioncontent = { } setmetatableindex(functioncontent,function(t,k) @@ -109,59 +153,114 @@ do local dummy_nucleus = { element = "mtext", data = { content = "" }, - nature = "inline", + nature = "mixed", comment = "dummy nucleus", fulltag = "mtext>0" } - local function accentchar(d) - for i=1,3 do - d = d.data - if not d then - return + local function accentchar(d) -- see mkiv for old one + local detail = tonumber(d.detail) + if detail then + local d1 = d.data[1] + if d1 and d1.tg == "mrow" then + -- + d.element = "mrow" -- used + d.detail = nil + local s = specifications[d.fulltag] -- hm, used when not set + s.detail = nil + -- + d1.element = "mo" -- used + -- d1.detail = nil + d1.nature = "mixed" + d1.data = { { content = utfchar(detail) } } + return d end - d = d[1] - if not d then - return + end + end + + local no_mrow = { + mrow = true, + mfenced = true, + mfrac = true, + mroot = true, + msqrt = true, + mtable = true, + mi = true, + mo = true, + mn = true, + mspace = true, + mtext = true, + -- mmultiscripts = true, + -- mstacker = true, + -- mextensible = true, + } + + -- we could make a stupid xml and then just use lpath to clean it up + + -- local separator = utfchar(0x2061) + + -- local function markapplicationof(di,data,i) + -- if i > 1 then + -- local d0 = data[i-1] + -- local at = d0.attributes + -- if at then + -- at.mathapplication = true + -- else + -- d0.attributes = { + -- mathapplication = true, + -- } + -- end + -- end + -- -- di.tg = "ignore" + -- -- di.skip = "ignore" + -- end + + local function checked(d,n) + if n == 1 then + local di = d[1] + local tg = di.tg + if tg == "ignore" then + -- todo: we can move ignore's data one level up + return 1 + elseif di.content then + return 1 + else + local dd = di.data + local nn = #dd + if nn > 0 and checked(dd,nn) > 0 then + return 1 + else + return 0 + end end - local tg = d.tg - if tg == "mover" then - local s = specifications[d.fulltag] - local t = s.top - if t then - d = d.data[1] - local d1 = d.data[1] - d1.content = utfchar(t) - d.data = { d1 } - return d + else + local m = 0 + for i=1,n do + local di = d[i] + local tg = di.tg + if tg == "ignore" then + -- skip + elseif di.content then + m = m + 1 + d[m] = di + else + local dd = di.data + local nn = #dd + if nn > 0 and checked(dd,nn) > 0 then + m = m + 1 + d[m] = di + end end - elseif tg == "munder" then - local s = specifications[d.fulltag] - local b = s.bottom - if b then - d = d.data[1] - local d1 = d.data[1] - d1.content = utfchar(b) - d.data = { d1 } - return d + end + if m < n then + for i=n,m+1,-1 do + d[i] = nil end end + return m end end - local no_mrow = { - mrow = true, - mfenced = true, - mfrac = true, - mroot = true, - msqrt = true, - mtable = true, - mi = true, - mo = true, - mn = true, - mspace = true, - } - local function checkmath(root) -- we can provide utf.toentities as an option local data = root.data if data then @@ -169,61 +268,27 @@ do local roottg = root.tg if roottg == "mo" then local s = specifications[root.fulltag] - local c = s.class - if c == "open" or c == "close" or c == "middle" then + -- maybe just via metatable + if s.mathgroup then root.attributes = { - maxsize = 1 + mathclass = s.mathclass, + mathgroup = s.mathgroup, + mathindex = s.mathindex, + mathcharacter = s.mathcharacter, + mathstack = s.mathstack, } - end - elseif roottg == "msubsup" then - -- kind of tricky: we have a different order in display mode - local nucleus, superscript, subscript - if ndata > 3 then - -- error else - for i=1,ndata do - local di = data[i] - if not di then - -- weird - elseif di.content then - -- text - else - local s = specifications[di.fulltag] - if s.subscript then - subscript = i - elseif s.superscript then - superscript = i - else - nucleus = i - end - end - end - if superscript or subscript then - -- we probably always have 3 anyway ... needs checking - local nuc = nucleus and data[nucleus] - local sub = subscript and data[subscript] - local sup = superscript and data[superscript] - local n = 0 -- play safe - if nuc then n = n + 1 ; data[n] = nuc end - if sub then n = n + 1 ; data[n] = sub end - if sup then n = n + 1 ; data[n] = sup end - end + root.attributes = { + mathstack = s.mathstack, + } end - -- elseif roottg == "msup" or roottg == "msub" then - -- -- m$^2$ - -- if ndata == 1 then - -- local d = data[1] - -- data[2] = d - -- d.__i__ = 2 - -- data[1] = dummy_nucleus - -- end elseif roottg == "mfenced" then local s = specifications[root.fulltag] local o = s.operator if o then root.skip = "comment" -- root.content = utfchar(o) -- use embedded for now - else + elseif tagging.mfenced then local l = s.left local m = s.middle local r = s.right @@ -245,7 +310,15 @@ do separators = m, close = r, } + else + root.element = "mrow" + root.attributes = { + mathcategory = s.mathcategory + } end + -- elseif roottg == "mstacker" then + elseif roottg == "mrow" then +ndata = checked(data,ndata) end if ndata == 0 then root.skip = "comment" -- get rid of weird artefacts @@ -258,21 +331,38 @@ do return elseif d.content then return - else -- if ndata == 1 then - local tg = d.tg - if automathrows and (roottg == "mrow" or roottg == "mtext") then - -- maybe just always ! check spec first - -- or we can have checks.* for each as we then can flatten - if no_mrow[tg] then - root.skip = "comment" - end - elseif roottg == "mo" then - if tg == "mo" then - root.skip = "comment" - end + elseif roottg == "mrow" or roottg == "mtext" then + -- maybe just always ! check spec first + -- or we can have checks.* for each as we then can flatten + local s = specifications[root.fulltag] + if s.mathunit then + d.attributes = { + mathunit = s.mathunit + } + elseif s.mathdigits then + d.attributes = { + mathdigits = s.mathdigits + } + elseif s.mathfunction then + d.attributes = { + mathfunction = s.mathfunction, + mathcategory = s.mathcategory, + mathstack = s.mathstack, + } + elseif no_mrow[d.tg] then + root.skip = "comment" + else + d.attributes = { + mathstack = s.mathstack, + } + end + elseif roottg == "mo" then + if d.tg == "mo" then + root.skip = "comment" end end end + -- todo local i = 1 while i <= ndata do -- -- -- TOO MUCH NESTED CHECKING -- -- -- local di = data[i] @@ -290,12 +380,13 @@ do local d = di.data -- todo: accent = "false" (for scripts like limits) di.attributes = { - accent = "true", + accent = "true", + mathcategory = s.mathcategory, } -- todo: p.topfixed if t then -- mover - if true then -- we don't go here any more + if true then local dd = d[1].data if dd then dd[1].content = utfchar(t) @@ -316,12 +407,13 @@ do local d = di.data -- todo: accent = "false" (for scripts like limits) di.attributes = { - accent = "true", + accent = "true", + mathcategory = s.mathcategory, } -- todo: p.bottomfixed if b then -- munder - if true then -- we don't go here any more + if true then local dd = d[2].data if dd then dd[1].content = utfchar(b) @@ -474,82 +566,105 @@ do end checkmath(di) i = i + 1 - elseif tg == "mrow" and detail then -- hm, falls through - di.detail = nil - checkmath(di) - di = { - element = "maction", - nature = "display", - attributes = { actiontype = detail }, - data = { di }, - n = 0, - } - data[i] = di - i = i + 1 - else - local category = di.mathcategory - if category then - -- no checkmath(di) here - if category == 1 then -- mo - i = collapse(di,i,data,ndata,detail,"mo") - elseif category == 2 then -- mi - i = collapse(di,i,data,ndata,detail,"mi") - elseif category == 3 then -- mn - i = collapse(di,i,data,ndata,detail,"mn") - elseif category == 4 then -- ms - i = collapse(di,i,data,ndata,detail,"ms") - elseif category >= 1000 then - local apply = category >= 2000 - if apply then - category = category - 1000 - end - if tg == "mi" then -- function - if roottg == "mrow" then - root.skip = "comment" - root.element = "function" - end - i = collapse(di,i,data,ndata,detail,"mi") - local tag = functions[category] - if tag then - di.data = functioncontent[tag] - end - if apply then - di.after = apply_function - elseif automathapply then -- make function - local following - if i <= ndata then - -- normally not the case - following = data[i] - else - local parent = di.__p__ -- == root - if parent.tg == "mrow" then - parent = parent.__p__ - end - local index = parent.__i__ - following = parent.data[index+1] - end - if following then - local tg = following.tg - if tg == "mrow" or tg == "mfenced" then -- we need to figure out the right condition - di.after = apply_function - end - end - end - else -- some problem - checkmath(di) - i = i + 1 - end + elseif tg == "mi" then + local s = specifications[di.fulltag] + if s.mathclass == "punctuation" then + di.element = "mtext" + checkmath(di) + i = i + 1 + else + -- if di.data[1].content == separator then + -- markapplicationof(di,data,i) + -- end + local category = s.mathcategory + if s.mathgroup then + di.attributes = { + mathclass = s.mathclass, + mathgroup = s.mathgroup, + mathindex = s.mathindex, + mathcharacter = s.mathcharacter, + mathstack = s.mathstack, + } else - checkmath(di) - i = i + 1 + di.attributes = { + mathstack = s.mathstack, + } end - elseif automathnumber and tg == "mn" then checkmath(di) - i = collapse_mn(di,i,data,ndata) + i = i + 1 + end + elseif tg == "mrow" then + local d = di.data + local n = #d + local s = specifications[di.fulltag] + if s.mathunit then + di.attributes = { mathunit = s.mathunit } + elseif s.mathdigits then + for i=1,n do + d[i] = d[i].data[1].content or "" + end + di.tg = "mn" + di.element = "mn" + di.nature = "mixed" + di.data = { { content = concat(d) } } + elseif s.mathfunction then + di.attributes = { + mathfunction = s.mathfunction, + mathstack = s.mathstack + } + local category = tonumber(s.mathcategory) + if functiontype(category) == "function" then + local fnc = functions[category] -- functions[s.mathfunction] + local tag = fnc and fnc.tag + if tag then + di.tg = "mi" + di.element = "mi" + di.nature = "mixed" + di.data = functioncontent[tag] + end + end + i = i + 1 + elseif s.mathfunctionstack then + di.attributes = { + mathfunction = s.mathfunction, + mathstack = s.mathstack, + mathfunctionstack = s.mathfunctionstack, + } + checkmath(di) + i = i + 1 + -- maybe fall through + elseif s.mathfractionstack then + di.attributes = { + mathfractionstack = s.mathfractionstack, + } + checkmath(di) + i = i + 1 + -- maybe fall through else + if n > 0 then + local d1 = d[1] + local tg = d1.tg + if tg == "mfrac" then + if n == 1 then -- simple one + di = d1 + data[i] = di + elseif n == 2 and d[2].tg == "ignore" then -- simple one with nilled middle fence + -- already wiped anyway + di = d1 + data[i] = di + end +-- elseif tg == "mo" then +-- if i > 1 and d1.data[1].content == separator then +-- markapplicationof(di,data,i) +-- end + end + end checkmath(di) i = i + 1 end + else + checkmath(di) + i = i + 1 end else -- can be string or boolean if parenttg ~= "mtext" and di == " " then @@ -583,52 +698,33 @@ do end if d then local content = d.content +-- if d.tg == "mspace" then +-- n = n + 1 +-- data[n] = d +-- d.data = { } +-- elseif not content then +-- n = n + 1 +-- data[n] = d +-- d.__i__ = n -- hm +-- else +-- n = n + 1 +-- data[n] = d +-- end + n = n + 1 + data[n] = d if d.tg == "mspace" then - n = n + 1 - data[n] = d d.data = { } elseif not content then --- if not content then - n = n + 1 - d.__i__ = n - data[n] = d --- elseif content == " " or content == "" then --- if d.tg == "mspace" then --- -- we append or prepend a space to a preceding or following mtext --- local parent = di.__p__ --- local index = di.__i__ -- == i --- local data = parent.data --- if index > 1 then --- local d = data[index-1] --- if d.tg == "mtext" then --- local dd = d.data --- local dn = dd[#dd] --- local dc = dn.content --- if dc then --- dn.content = dc .. content --- end --- end --- elseif index < ndata then --- local d = data[index+1] --- if d.tg == "mtext" then --- local dd = d.data --- local dn = dd[1] --- local dc = dn.content --- if dc then --- dn.content = content .. dc --- end --- end --- end --- end - else - n = n + 1 - data[n] = d + d.__i__ = n -- hm end end end for i=ndata,n+1,-1 do data[i] = nil end + -- maybe integrate the above and this one: + collapse_all_mn(data) + -- if #data > 0 then return di end @@ -642,14 +738,19 @@ do -- issue that i need to look into else local specification = specifications[di.fulltag] - local mode = specification and specification.mode == "display" and "block" or "inline" + local mode = specification.mode == "display" and "block" or "inline" + local domain = specification.domain or "default" di.attributes = { ["display"] = mode, + ["domain"] = domain, + ["alttext"] = specification.input, -- bonus ["xmlns:m"] = mathmlns, ["xmlns:math"] = mathmlns, } -- can be option if needed: - if mode == "inline" then + if specification.standalone then + di.nature = "display" + elseif mode == "inline" then -- di.nature = "mixed" -- else spacing problem (maybe inline) di.nature = "inline" -- we need to catch x$X$x and x $X$ x else @@ -664,58 +765,169 @@ do -- this one can replace some of the previous code .. todo (test on mathmatrix) - -- ignore with no data can be removed + local mprescripts = { + element = "mprescripts", + data = { content = "" }, + nature = "inline", -- mixed + fulltag = "mprescripts>0" + } - local function checked(d) - local n = #d - if n == 1 then - local di = d[1] - local tg = di.tg - if tg == "ignore" then - -- todo: we can move ignore's data one level up - return 1 - elseif di.content then - return 1 - else - local dd = di.data - if #dd > 0 and checked(dd) > 0 then - return 1 - else - return 0 - end + local function wrapup(d,index,n,prelist,kernel,postlist) + local di = d[index] + local post = #postlist + local pre = #prelist + local list = { kernel } + local size = 1 + for i=index+1,n do + d[i].skip = "ignore" + end + if post > 0 then + for i=1,post do + size = size + 1 ; list[size] = postlist[i] end - else - local m = 0 - for i=1,n do + end + if pre > 0 then + size = size + 1 ; list[size] = mprescripts + for i=1,pre do + size = size + 1 ; list[size] = prelist[i] + end + end + di.element = "mmultiscripts" + -- di.tg = "mmultiscripts" + di.data = list + di.iscontinuation = true + di.__i__ = size + end + + local function found(d,what) + if what then + for i=1,#d do local di = d[i] - local tg = di.tg - if tg == "ignore" then - -- skip - elseif di.content then - m = m + 1 - d[m] = di - else - local dd = di.data - if #dd > 0 and checked(dd) > 0 then - m = m + 1 - d[m] = di - end + local sp = specifications[di.fulltag] + if sp and sp.script == what then + return di end end - if m < n then - for i=n,m+1,-1 do - d[i] = nil + else + for i=1,#d do + local di = d[i] + local sp = specifications[di.fulltag] + if not sp or not sp.script then + return di end end - return m end end + -- todo: pick up kernel + function checks.mrow(di) - -- local d = di.data - -- if d then - -- checked(d) - -- end + local d = di.data + if d then + local postlist = nil + local prelist = nil + local kernel = nil + local index = 0 + for i=1,#d do + local di = d[i] + local data = di.data + local tg = di and di.tg + local sp = specifications[di.fulltag] + local continuation = sp and sp.continuation + if continuation then + -- head kernel next + if postlist and continuation.head then + wrapup(d,index,#d,prelist,kernel,postlist) + postlist = nil + prelist = nil + kernel = 0 + end + -- play safe as we can have empty ones (so maybe move the extra code here) + local nd = #data + if tg == "msup" then + if not postlist then + index = i + postlist = { } + prelist = { } + kernel = dummy_nucleus + end + local sup = found(data,"sup") + postlist[#postlist+1] = dummy_nucleus + postlist[#postlist+1] = sup + if continuation.kernel then + kernel = data[1] or dummy_nucleus + end + elseif tg == "msub" then + if not postlist then + index = i + postlist = { } + prelist = { } + kernel = dummy_nucleus + end + local sub = found(data,"sub") + postlist[#postlist+1] = sub + postlist[#postlist+1] = dummy_nucleus + if continuation.kernel then + kernel = data[1] or dummy_nucleus + end + elseif tg == "msubsup" then + if not postlist then + index = i + postlist = { } + prelist = { } + kernel = dummy_nucleus + end + local sub = found(data,"sub") + local sup = found(data,"sup") + postlist[#postlist+1] = sub or dummy_nucleus + postlist[#postlist+1] = sup or dummy_nucleus + if continuation.kernel then + kernel = data[1] or dummy_nucleus + end + elseif tg == "mmultiscripts" then + -- we know that we only have one set + if not postlist then + index = i + postlist = { } + prelist = { } + kernel = dummy_nucleus + end + local prime = found(data,"prime") + local sub = found(data,"sub") + local sup = found(data,"sup") + local presub = found(data,"presub") + local presup = found(data,"presup") + if prime then + postlist[#postlist+1] = dummy_nucleus + postlist[#postlist+1] = prime + end + if sub or sup then + postlist[#postlist+1] = sub or dummy_nucleus + postlist[#postlist+1] = sup or dummy_nucleus + end + if presub or presup then + prelist[#prelist+1] = presub or dummy_nucleus + prelist[#prelist+1] = presup or dummy_nucleus + end + if continuation.kernel then + kernel = data[1] or dummy_nucleus + end + else + postlist = nil + prelist = nil + kernel = nil + end + elseif postlist then + wrapup(d,index,i-1,prelist,kernel,postlist) + postlist = nil + prelist = nil + kernel = nil + end + end + if postlist then + wrapup(d,index,#d,prelist,kernel,postlist) + end + end end -- we can move more checks here @@ -726,7 +938,7 @@ do local d = r.data local n = #d if d and n > 1 then - n = checked(d) + n = checked(d,n) end local tg = r.tg if n == 1 and (tg == "mtext" or tg == "mrow") then @@ -763,39 +975,84 @@ do end end - do - - local a, z, A, Z = 0x61, 0x7A, 0x41, 0x5A - - function extras.mi(di,element,n,fulltag) -- check with content - local str = di.data[1].content - if str and sub(str,1,1) ~= "&" then -- hack but good enough (maybe gsub op eerste) - for v in utfvalues(str) do - if (v >= a and v <= z) or (v >= A and v <= Z) then - local a = di.attributes - if a then - a.mathvariant = "normal" - else - di.attributes = { mathvariant = "normal" } - end - end - end + function extras.mmultiscripts(di,element,n,fulltag) + if not di.iscontinuation then + local d = di.data + local sup = found(d,"sup") + local sub = found(d,"sub") + local presup = found(d,"presup") + local presub = found(d,"presub") + local prime = found(d,"prime") + local n = 1 + if sup or sub then + n = n + 1 ; d[n] = sub or dummy_nucleus + n = n + 1 ; d[n] = sup or dummy_nucleus + end + if prime then + n = n + 1 ; d[n] = dummy_nucleus + n = n + 1 ; d[n] = prime end + if presup or presub then + n = n + 1 ; d[n] = mprescripts + n = n + 1 ; d[n] = presub or dummy_nucleus + n = n + 1 ; d[n] = presup or dummy_nucleus + end + d.__i__ = n end - end function extras.msub(di,element,n,fulltag) - -- m$^2$ local data = di.data if #data == 1 then - local d = data[1] - data[2] = d - d.__i__ = 2 - data[1] = dummy_nucleus + insert(data,1,dummy_nucleus) + data.__i__ = 2 + end + local sp = specifications[di.fulltag] + if attributes then + attributes.mathsubindex = sp.subshifted + else + di.attributes = { + mathsubindex = sp.subshifted, + } end end - extras.msup = extras.msub + function extras.msup(di,element,n,fulltag) + local data = di.data + if #data == 1 then + insert(data,1,dummy_nucleus) + data.__i__ = 2 + end + local sp = specifications[di.fulltag] + local attributes = di.attributes + if attributes then + attributes.mathsupindex = sp.supshifted + else + di.attributes = { + mathsupindex = sp.supshifted, + } + end + end + + function extras.msubsup(di,element,n,fulltag) + local data = di.data + local nuc = found(data) + local sup = found(data,"sup") + local sub = found(data,"sub") + data[1] = nuc or dummy_nucleus + data[2] = sub or dummy_nucleus + data[3] = sup or dummy_nucleus + data.__i__ = 3 + local sp = specifications[di.fulltag] + if attributes then + attributes.mathsupindex = sp.supshifted + attributes.mathsubindex = sp.subshifted + else + di.attributes = { + mathsupindex = sp.supshifted, + mathsubindex = sp.subshifted, + } + end + end end diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-tag.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-tag.lmt index 73b7b5b47e6..f3c4dffe52c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-tag.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-tag.lmt @@ -11,7 +11,7 @@ if not modules then modules = { } end modules ['back-exp-imp-tag'] = { local tonumber = tonumber local todimen = number.todimen -local sortedhash, setmetatableindex, concat, insert = table.sortedhash, table.setmetatableindex, table.concat, table.insert +local sortedkeys, sortedhash, setmetatableindex, concat, insert = table.sortedkeys, table.sortedhash, table.setmetatableindex, table.concat, table.insert local settings_to_hash = utilities.parsers.settings_to_hash local lpegmatch = lpeg.match local formatters = string.formatters @@ -844,3 +844,31 @@ do end + +do + + local usedcodepoints = { } + + local function checkcodepoint(di,element,n,fulltag) + local unicode = usedcodepoints[fulltag] + if unicode then + setattribute(di,"codepoint",unicode) + end + end + + local function setcodepoint(tag,unicode) + usedcodepoints[locatedtag(tag)] = unicode + if not extras[tag] then + extras[tag] = checkcodepoint + end + end + + implement { + name = "settagcodepoint", + actions = setcodepoint, + arguments = { "argument", "integer" }, + } + + structurestags.setcodepoint = setcodepoint + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt index e5e2e9dab00..03e45291d9e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt @@ -68,10 +68,10 @@ local nodes = nodes local attributes = attributes local variables = interfaces.variables -local v_yes = variables.yes -local v_no = variables.no -local v_xml = variables.xml -local v_hidden = variables.hidden +local v_yes = variables.yes +local v_no = variables.no +local v_xml = variables.xml +local v_hidden = variables.hidden local implement = interfaces.implement @@ -191,35 +191,44 @@ local namespaced = { } local namespaces = { - msubsup = "m", - msub = "m", - msup = "m", - mn = "m", - mi = "m", - ms = "m", - mo = "m", - mtext = "m", - mrow = "m", - mfrac = "m", - mroot = "m", - msqrt = "m", - munderover = "m", - munder = "m", - mover = "m", - merror = "m", - math = "m", - mrow = "m", - mtable = "m", - mtr = "m", - mtd = "m", - mfenced = "m", - maction = "m", - mspace = "m", + msubsup = "m", + msub = "m", + msup = "m", + mn = "m", + mi = "m", + ms = "m", + mo = "m", + mc = "m", + mtext = "m", + mrow = "m", + mfrac = "m", + mroot = "m", + msqrt = "m", + munderover = "m", + munder = "m", + mover = "m", + merror = "m", + math = "m", + mrow = "m", + mtable = "m", + mtr = "m", + mtd = "m", + mfenced = "m", + maction = "m", + -- munit = "m", + mspace = "m", + mmultiscripts = "m", + mprescripts = "m", -- only when testing - mstacker = "m", - mstackertop = "m", - mstackermid = "m", - mstackerbot = "m", + mstacker = "m", + mstackertop = "m", + mstackermid = "m", + mstackerbot = "m", + mextensible = 'm', + mfunction = 'm', + mfunctionstack = 'm', + mfraction = 'm', + mfractionstack = 'm', } setmetatableindex(namespaced, function(t,k) @@ -387,7 +396,7 @@ local styletemplate = [[ for detail, data in sortedhash(details) do local s = fontspecification(data.style) local c = colorspecification(data.color) - detail = gsub(detail,"[^A-Za-z0-9]+","-") + local detail = gsub(detail,"[^A-Za-z0-9]+","-") result[#result+1] = replacetemplate(styletemplate,{ namespace = usecssnamespace and cssnamespace or "", element = element, @@ -921,6 +930,8 @@ do emptytag(result,element,nature,di) elseif element == "mspace" then -- todo: use empty flag emptytag(result,element,nature,di) + elseif element == "mprescripts" then -- todo: use empty flag + emptytag(result,element,nature,di) -- -why has nature to be set elseif element == "" or di.skip == "ignore" then -- skip else @@ -1424,37 +1435,39 @@ local collectresults do -- too many locals otherwise local subtypes = nodes.subtypes - local hlist_code = nodecodes.hlist - local vlist_code = nodecodes.vlist - local glyph_code = nodecodes.glyph - local glue_code = nodecodes.glue - local kern_code = nodecodes.kern - local disc_code = nodecodes.disc - local whatsit_code = nodecodes.whatsit - local par_code = nodecodes.par + local userkern_code = nodes.kerncodes.userkern + + local hlist_code = nodecodes.hlist + local vlist_code = nodecodes.vlist + local glyph_code = nodecodes.glyph + local glue_code = nodecodes.glue + local kern_code = nodecodes.kern + local disc_code = nodecodes.disc + local whatsit_code = nodecodes.whatsit + local par_code = nodecodes.par - local userskip_code = gluecodes.userskip - local rightskip_code = gluecodes.rightskip - local parfillskip_code = gluecodes.parfillskip - local spaceskip_code = gluecodes.spaceskip - local xspaceskip_code = gluecodes.xspaceskip - local intermathskip_code = gluecodes.intermathskip + local userskip_code = gluecodes.userskip + local rightskip_code = gluecodes.rightskip + local parfillskip_code = gluecodes.parfillskip + local spaceskip_code = gluecodes.spaceskip + local xspaceskip_code = gluecodes.xspaceskip + local intermathskip_code = gluecodes.intermathskip - local linelist_code = listcodes.line + local linelist_code = listcodes.line - local userdefinedwhatsit_code = whatsitcodes.userdefined + local userdefinedwhatsit_code = whatsitcodes.userdefined local privateattribute = attributes.private - local a_image = privateattribute('image') - local a_reference = privateattribute('reference') - local a_destination = privateattribute('destination') - local a_characters = privateattribute('characters') - local a_exportstatus = privateattribute('exportstatus') - local a_tagged = privateattribute('tagged') - local a_taggedpar = privateattribute("taggedpar") - local a_textblock = privateattribute("textblock") + local a_image = privateattribute('image') + local a_reference = privateattribute('reference') + local a_destination = privateattribute('destination') + local a_characters = privateattribute('characters') + local a_exportstatus = privateattribute('exportstatus') + local a_tagged = privateattribute('tagged') + local a_taggedpar = privateattribute("taggedpar") + local a_textblock = privateattribute("textblock") - local inline_mark = nodes.pool.userids["margins.inline"] + local inline_mark = nodes.pool.userids["margins.inline"] local nuts = nodes.nuts @@ -1467,6 +1480,7 @@ local collectresults do -- too many locals otherwise local isglyph = nuts.isglyph local getkern = nuts.getkern local getwidth = nuts.getwidth + local getclass = nuts.getclass local startofpar = nuts.startofpar @@ -1528,6 +1542,10 @@ local collectresults do -- too many locals otherwise if paragraph and (not ap or ap < paragraph) then maybewrong = addtomaybe(maybewrong,c,1) end +-- if subtype > 0 then +-- print("EXPORTING",nodes.glyphcodes[subtype]) +-- end + tl.class = getclass(n) pushcontent() currentnesting = tl currentparagraph = ap @@ -1576,9 +1594,9 @@ local collectresults do -- too many locals otherwise if s then c = s end - if c == 0 then + if c == 0 or c == 0xFFFD then if trace_export then - report_export("%w",currentdepth) + report_export("%w",currentdepth,c) end elseif c == 0x20 then local a = getattr(n,a_characters) @@ -1597,7 +1615,9 @@ local collectresults do -- too many locals otherwise fc = fc and fc[c] if fc then local u = fc.unicode - if not u then + if u == 0 or u == 0xFFFD then + -- ignore (can make disappear) + elseif not u then nofcurrentcontent = nofcurrentcontent + 1 currentcontent[nofcurrentcontent] = utfchar(c) elseif type(u) == "table" then @@ -1797,45 +1817,47 @@ local collectresults do -- too many locals otherwise end end elseif id == kern_code then - local kern = getkern(n) - if kern > 0 then - local a = getattr(n,a_tagged) or pat - local t = taglist[a] - if not t or t.tagname ~= "ignore" then -- maybe earlier on top) - local limit = threshold - if p then - local c, f = isglyph(p) - if c then - limit = fontquads[f] / 4 + if subtype == userkern_code then + local kern = getkern(n) + if kern > 0 then + local a = getattr(n,a_tagged) or pat + local t = taglist[a] + if not t or t.tagname ~= "ignore" then -- maybe earlier on top) + local limit = threshold + if p then + local c, f = isglyph(p) + if c then + limit = fontquads[f] / 4 + end end - end - if kern > limit then - if last and not somespace[currentcontent[nofcurrentcontent]] then - -- local a = getattr(n,a_tagged) or pat - if a == last then - if not somespace[currentcontent[nofcurrentcontent]] then + if kern > limit then + if last and not somespace[currentcontent[nofcurrentcontent]] then + -- local a = getattr(n,a_tagged) or pat + if a == last then + if not somespace[currentcontent[nofcurrentcontent]] then + if trace_export then + report_export("%w",currentdepth,kern) + end + nofcurrentcontent = nofcurrentcontent + 1 + currentcontent[nofcurrentcontent] = " " + end + elseif a then + -- e.g LOGOLOGO + if trace_export then + report_export("%w",currentdepth,limit,last,a) + end + last = a + pushcontent() if trace_export then - report_export("%w",currentdepth,kern) + report_export("%w",currentdepth,kern) end nofcurrentcontent = nofcurrentcontent + 1 currentcontent[nofcurrentcontent] = " " + -- currentnesting = taglist[last] + currentnesting = t + pushentry(currentnesting) + currentattribute = last end - elseif a then - -- e.g LOGOLOGO - if trace_export then - report_export("%w",currentdepth,limit,last,a) - end - last = a - pushcontent() - if trace_export then - report_export("%w",currentdepth,kern) - end - nofcurrentcontent = nofcurrentcontent + 1 - currentcontent[nofcurrentcontent] = " " - -- currentnesting = taglist[last] - currentnesting = t - pushentry(currentnesting) - currentattribute = last end end end @@ -2091,17 +2113,23 @@ local htmltemplate = [[ return concat(result,"\n\n") end - local function allcontent(tree) + local function allcontent(tree,nocheck) local result = { } local data = tree.data - for i=1,#data do - if data[i].tg ~= "document" then - data[i] = { } + if nocheck then + -- maybe mathml + else + for i=1,#data do + if data[i].tg ~= "document" then + data[i] = { } + end end end flushtree(result,tree.data,"display") -- we need to collect images - result = concat(result) -- no need to lpeg .. fast enough + result[1] = gsub(result[1],"^%s+","") + result[#result] = gsub(result[#result],"%s+$","") + result = concat(result) result = gsub(result,"\n *\n","\n") result = gsub(result,"\n +([^< ])","\n%1") -- @@ -2218,7 +2246,7 @@ local htmltemplate = [[ * lpeg.P(" ")^0 )^1 ) - local classes = table.setmetatableindex(function(t,k) + local classes = setmetatableindex(function(t,k) local v = concat(lpegmatch(p_splitter,k,1,{})," ") t[k] = v return v @@ -2396,7 +2424,9 @@ local htmltemplate = [[ wrapups.finalizetree(tree) end - local function localexport(head) + local notnamespaced = setmetatableindex(function(t,k) t[k] = k return k end) + + local function localexport(head,simple) starttiming(treehash) local saved_treestack = treestack @@ -2419,13 +2449,34 @@ local htmltemplate = [[ finishexport() wrapuptree(tree) - -- tree.data = tree.data[1].data - - local result = concat { - wholepreamble(true,true), - allcontent(tree), - } + local result + if simple then + while true do + local d = tree.data + if not d then + return + end + d = d[1] + if not d then + return + end + if d.tg == simple then + local ns = namespaced + namespaced = notnamespaced + result = allcontent(tree,true) + namespaced = ns + break + else + tree.data = d.data + end + end + else + result = concat { + wholepreamble(true), + allcontent(tree), + } + end treestack = saved_treestack nesting = saved_nesting currentdepth = saved_currentdepth @@ -2793,7 +2844,7 @@ local htmltemplate = [[ if not exporting then report_export("enabling export to xml") enableaction("shipouts","nodes.handlers.export") - enableaction("shipouts","nodes.handlers.accessibility") + -- enableaction("shipouts","nodes.handlers.accessibility") enableaction("math", "noads.handlers.tags") enableaction("everypar","nodes.handlers.checkparcounter") luatex.registerstopactions(structurestags.finishexport) diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl index cafbb938ffb..16f458ff1d9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl @@ -97,7 +97,7 @@ \clf_settagtabulatecell\c_tabl_tabulate_align\c_tabl_tabulate_kind \fi}% \enforced\permanent\protected\def\dotagtabulatesignal - {\dontleavehmode\signalcharacter\ignorespaces}% + {\dontleavehmode\signalcharacter\ignorespaces\ignorepars}% \to \everyenableelements \appendtoks @@ -268,6 +268,17 @@ \fi}% \to \everyenableelements +% For more elements, so an extra argument: + +\ifdefined\dotagcodepoint \else \aliased\let\dotagcodepoint\gobbletwoarguments \fi + +\appendtoks + \enforced\permanent\protected\def\dotagcodepoint#1#2% + {\iftrialtypesetting\else + \clf_settagcodepoint{#1}#2\relax + \fi}% +\to \everyenableelements + % The action: \setupbackend[export=yes] % or filename % maybe xhtml css settings will move to setupexport @@ -297,15 +308,14 @@ \resetsystemmode\v!export \permanent\protected\def\doinitializeexport - {\edef\p_export{\backendparameter\c!export}% - \ifempty\p_export \else + {\ifempty{\backendparameter\c!export}\else % yes | xml \setuptagging[\c!state=\v!start]% \clf_initializeexport \setsystemmode\v!export \exportingtrue \writestatus\m!backend\empty % so messages will stand out a bit - \the\everyinitializeexport + \expand\everyinitializeexport \writestatus\m!backend\empty % so messages will stand out a bit \enforced\glet\doinitializeexport\relax \fi} @@ -411,18 +421,9 @@ \installsetuponlycommandhandler \??boxexport {boxexport} \installsetuponlycommandhandler \??mathexport {mathexport} -% \permanent\tolerant\protected\def\startboxexport[#1]% -% {\dowithnextbox{\strc_export_box{#1}}\vbox\bgroup} -% -% \permanent\protected\def\stopboxexport -% {\egroup} -% -% \def\strc_export_box#1% -% {\ctxlua{buffers.assign("#1",structures.tags.exportbox(\number\nextbox))}} - -\permanent\tolerant\protected\def\startboxexport[#1]% +\permanent\tolerant\protected\def\startboxexport[#S#1]% {\begingroup - \iftok{#1}\emptytoks + \ifempty{#1}% \letboxexportparameter\c!buffer\v!yes \orelse\ifhastok={#1}\relax \setupmathexport[#1]% @@ -438,9 +439,9 @@ {\boxexportparameter\c!buffer}% \endgroup} -\permanent\tolerant\protected\def\startmathexport[#1]% +\permanent\tolerant\protected\def\startmathexport[#S#1]% {\begingroup - \iftok{#1}\emptytoks + \ifempty{#1}% \letboxexportparameter\c!buffer\v!yes \orelse\ifhastok={#1}\relax \setupmathexport[#1]% @@ -452,8 +453,20 @@ \permanent\protected\def\stopmathexport {\clf_stopcollectingmath \clf_processcollectedmath - {\boxexportparameter\c!file} + {\boxexportparameter\c!file}% {\boxexportparameter\c!buffer}% + {\boxexportparameter\c!n}% + {\boxexportparameter\c!option}% + \endgroup} + +\permanent\tolerant\protected\def\savemathexport[#S#1]% + {\begingroup + \setupboxexport[#1]% + \clf_processcollectedmath + {\boxexportparameter\c!file}% + {\boxexportparameter\c!buffer}% + {\boxexportparameter\c!n}% + {\boxexportparameter\c!option}% \endgroup} % Defined at the \LUA\ end: @@ -461,4 +474,23 @@ % \the\collectedmath : number of snippets % \collectedmath n : specific snippet +% \startluacode +% function commands.doifelsesimplecollectedmath() +% commands.doifelse(string.find( +% buffers.getcontent("test"), +% "%s*[^<>]+%s*") +% ) +% end +% \stopluacode +% +% \dorecurse {\collectedmath} { +% \savemathexport[buffer=test,n=#1] +% \ctxlua{commands.doifelsesimplecollectedmath()} { +% } { +% \startsubsubsubject[title={math blob #1}] +% \typebuffer[test] +% \stopsubsubsubject +% } +% } + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.lmt index 5bb23973cb0..4c1cd890599 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.lmt @@ -16,20 +16,21 @@ local fontshapes = fonts.hashes.shapes local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming -local bpfactor = number.dimenfactors.bp local texgetbox = tex.getbox -local rulecodes = nodes.rulecodes -local normalrule_code = rulecodes.normal ------ boxrule_code = rulecodes.box ------ imagerule_code = rulecodes.image ------ emptyrule_code = rulecodes.empty ------ userrule_code = rulecodes.user ------ overrule_code = rulecodes.over ------ underrule_code = rulecodes.under ------ fractionrule_code = rulecodes.fraction ------ radicalrule_code = rulecodes.radical -local outlinerule_code = rulecodes.outline +local bpfactor = number.dimenfactors.bp + +local rulecodes = nodes.rulecodes +local normalrule_code = rulecodes.normal +----- boxrule_code = rulecodes.box +----- imagerule_code = rulecodes.image +----- emptyrule_code = rulecodes.empty +----- userrule_code = rulecodes.user +----- overrule_code = rulecodes.over +----- underrule_code = rulecodes.under +----- fractionrule_code = rulecodes.fraction +----- radicalrule_code = rulecodes.radical +local outlinerule_code = rulecodes.outline -- todo : per instance diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.lmt index 05d7c4a638c..e1364c12c53 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.lmt @@ -13,21 +13,23 @@ local fontparameters = fonts.hashes.parameters local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming -local bpfactor = number.dimenfactors.bp local texgetbox = tex.getbox local formatters = string.formatters local rulecodes = nodes.rulecodes -local normalrule_code = rulecodes.normal ------ boxrule_code = rulecodes.box ------ imagerule_code = rulecodes.image ------ emptyrule_code = rulecodes.empty ------ userrule_code = rulecodes.user ------ overrule_code = rulecodes.over ------ underrule_code = rulecodes.under ------ fractionrule_code = rulecodes.fraction ------ radicalrule_code = rulecodes.radical -local outlinerule_code = rulecodes.outline + +local normalrule_code = rulecodes.normal +----- boxrule_code = rulecodes.box +----- imagerule_code = rulecodes.image +----- emptyrule_code = rulecodes.empty +----- userrule_code = rulecodes.user +----- overrule_code = rulecodes.over +----- underrule_code = rulecodes.under +----- fractionrule_code = rulecodes.fraction +----- radicalrule_code = rulecodes.radical +local outlinerule_code = rulecodes.outline + +local bpfactor = number.dimenfactors.bp local fonts = { } local pages = { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl index f2afe61daff..022bb64d554 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl @@ -28,6 +28,7 @@ \registerctxluafile{lpdf-ini}{autosuffix} \registerctxluafile{lpdf-lmt}{autosuffix} +\registerctxluafile{lpdf-sig}{autosuffix,optional} \registerctxluafile{lpdf-col}{autosuffix} \registerctxluafile{lpdf-xmp}{autosuffix} \registerctxluafile{lpdf-ano}{autosuffix} @@ -42,12 +43,17 @@ \registerctxluafile{lpdf-img}{autosuffix} \registerctxluafile{lpdf-epa}{autosuffix} \registerctxluafile{lpdf-emb}{autosuffix} -\registerctxluafile{lpdf-fnt}{autosuffix} +\registerctxluafile{lpdf-fix}{autosuffix} \registerctxluafile{lpdf-rul}{autosuffix} \registerctxluafile{back-imp-pdf}{autosuffix} % some code will move to lpdf-* \registerctxluafile{back-imp-pdp}{autosuffix} +\registerctxluafile{lpdf-fix-imp-fonts} {autosuffix} % some code will move to lpdf-* +\registerctxluafile{lpdf-fix-imp-contents}{autosuffix} % idem + +\registerctxluafile{lxml-mms}{autosuffix} + % \registerctxluafile{lpdf-u3d}{autosuffix} \loadmkxlfile{back-imp-u3d} diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdp.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdp.lmt index 6b5a0edf937..02b6fe5689f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdp.lmt @@ -28,10 +28,11 @@ local scaninteger = tokenscanners.integer local scanwhd = tokenscanners.whd local values = tokens.values -local dimension_value = values.dimension -local cardinal_value = values.cardinal +local dimension_value = values.dimension +local cardinal_value = values.cardinal +local integer_value = values.integer -local immediate_code = tex.flagcodes.immediate +local immediate_code = tex.flagcodes.immediate local trace = false trackers.register("backend.primitives", function(v) trace = v end) local report = logs.reporter("backend") @@ -44,7 +45,6 @@ local newsetmatrix = nodepool.setmatrix local implement = interfaces.implement local constants = interfaces.constants -local variables = interfaces.variables -- literals @@ -287,3 +287,11 @@ implement { name = "pdfrefobj", actions = pdf_refobj, public = true, untra --------- { name = "pdfsave", actions = pdf_save } --------- { name = "pdfrestore", actions = pdf_restore } --------- { name = "pdfsetmatrix", actions = pdf_setmatrix } + +-- implement { +-- name = "pdfstrcmp", +-- arguments = "2 strings", +-- usage = "value", +-- public = true, +-- actions = function(a,b) return integer_value, (a < b and -1) or (a > b and 1) or 0 end +-- } diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt index 110a1b3dc2e..da19015fd77 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt @@ -19,7 +19,7 @@ local report = logs.reporter("backend") local allocate = utilities.storage.allocate local setmetatableindex = table.setmetatableindex -local setaction = nodes.tasks.setaction +----- setaction = nodes.tasks.setaction local implement = interfaces.implement local variables = interfaces.variables @@ -115,7 +115,8 @@ interfaces.implement { name = "setrealspaces", arguments = "string", actions = function(v) - setaction("shipouts","nodes.handlers.accessibility",v == variables.yes) + directives.enable("backends.spaces", v == variables.yes) + -- setaction("shipouts","nodes.handlers.accessibility",v == variables.yes) end } diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl index 8a4b9d894ac..9eaf126f5de 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl @@ -55,7 +55,8 @@ \to \everysetupbackend \setupbackend - [\c!hyphen=\v!yes] + [\c!space=\v!yes, % is now default + \c!hyphen=\v!yes] %D For the moment this is an experiment (defauls is pdf, but we also %D have lua, json and mps). @@ -76,6 +77,8 @@ %D \stoptext %D \stoptyping -\permanent\protected\def\setupoutput[#1]{\clf_enabledriver{#1}} +\permanent\protected\def\setupoutput[#1]% + {\clf_enabledriver{#1}% + \clf_setrealspaces{\backendparameter\c!space}} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt index 031e56909e9..49c2ec0bdd8 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt @@ -21,12 +21,10 @@ local scanwhd = scanners.whd local implement = interfaces.implement local constants = interfaces.constants -local variables = interfaces.variables -local values = tokens.values ------ dimension_value = values.dimension -local cardinal_value = values.cardinal ------ direct_value = values.direct +----- dimension_value = tokens.values.dimension +local cardinal_value = tokens.values.cardinal +----- direct_value = tokens.values.direct -- A box resource has an index. This happens to be an object number due to the pdf -- backend but in fact it's an abstraction. This is why we have explicit fetchers. diff --git a/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl b/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl index ffdb5b954b1..86c31bb6683 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl @@ -117,10 +117,10 @@ %D %D \typebuffer -\newtoks \everydefinebibtexsession -\newtoks \everypreparebibtexsession -\newtoks \everysetupbibtexsession -\setfalse \tracebibtexformat +\newtoks \everydefinebibtexsession +\newtoks \everypreparebibtexsession +\newtoks \everysetupbibtexsession +\newconditional\tracebibtexformat \protected\def\definebibtexsession {\dosingleargument\dodefinebibtexsession} \def\preparebibtexsession{\dodoubleempty \dopreparebibtexsession} @@ -278,12 +278,12 @@ \stopxmlsetups \startxmlsetups bibtex:format:doi -% \bibdoifelse{\@@pb@doi}{#1\expanded{\bibgotoDOI{\@@pb@thekey}{\@@pb@doi}}#2}{#3} + % \bibdoifelse{\@@pb@doi}{#1\normalexpanded{\bibgotoDOI{\@@pb@thekey}{\@@pb@doi}}#2}{#3} *doi* \stopxmlsetups \startxmlsetups bibtex:format:doi -% \bibdoifelse{\@@pb@biburl}{#1\expanded{\bibgotoURL{\@@pb@thekey}{\@@pb@biburl}}#2}{#3} +% \bibdoifelse{\@@pb@biburl}{#1\normalexpanded{\bibgotoURL{\@@pb@thekey}{\@@pb@biburl}}#2}{#3} *url* \stopxmlsetups @@ -663,7 +663,7 @@ \def\thebibtexpublicationlistelement {\strut - \expanded{\reference[\bibtexrefprefix\currentbibtexsessiontag]{\number\bibtexcounter}}% + \normalexpanded{\reference[\bibtexrefprefix\currentbibtexsessiontag]{\number\bibtexcounter}}% \dotypesetabibtexpublication\currentbibtexsessiontag \strut} @@ -715,7 +715,7 @@ \setupcite[\currentbibtexvariant][#1]% \else \edef\@@pb@@pbextras{{\@@pb@@pbextras\ifdefined\@@pb@@pbright\@@pb@@pbright\else\bibtexpublicationparameter\c!right\fi}}% - \expanded{\setupcite[\currentbibtexvariant][#1,\c!right=\@@pb@@pbextras]}% + \normalexpanded{\setupcite[\currentbibtexvariant][#1,\c!right=\@@pb@@pbextras]}% \fi}% {\def\currentbibtexvariant{#1}}% \getvalue{bibtex\currentbibtexvariant ref}[#2]} @@ -728,7 +728,7 @@ \def\dobibtexcitationindeed#1% {\iftrialtypesetting \else - \expanded{\writedatatolist[\currentbibtexsession][bibref=#1]}% + \normalexpanded{\writedatatolist[\currentbibtexsession][bibref=#1]}% \fi} \def\nobibtexcitation[#1]% @@ -832,11 +832,11 @@ \newconditional\firstbibtexrefsep \def\bibtexresetrefsep - {\settrue\firstbibtexrefsep} + {\firstbibtexrefsep\conditionaltrue} \def\bibtexinsertrefsep {\ifconditional\firstbibtexrefsep - \setfalse\firstbibtexrefsep + \firstbibtexrefsep\conditionalfalse \else \bibtexcitationparameter\c!pubsep \fi} @@ -857,7 +857,7 @@ {!#1!}} \def\dobibtexurllink#1#2% - {\expanded{\useURL[bibtex:url:#1][#2]}% + {\normalexpanded{\useURL[bibtex:url:#1][#2]}% \doifelsebibtexinteraction {\goto{\url[bibtex:url:#1]}[url(bibtex:url:#1)]} {\url[bibtex:url:#1]}} diff --git a/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl b/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl index d197e8ea4b7..2fab8ed9344 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl @@ -446,10 +446,10 @@ \processcommacommand[\bibcommandlist]\simplebibdef \protected\def\bibinsertdoi#1#2#3% let's see how this fails - {\bibdoifelse{\@@pb@doi}{#1\expanded{\bibgotoDOI{\@@pb@thekey}{\@@pb@doi}}#2}{#3}} + {\bibdoifelse{\@@pb@doi}{#1\normalexpanded{\bibgotoDOI{\@@pb@thekey}{\@@pb@doi}}#2}{#3}} \protected\def\bibinsertbiburl#1#2#3% let's see how this fails - {\bibdoifelse{\@@pb@biburl}{#1\expanded{\bibgotoURL{\@@pb@thekey}{\@@pb@biburl}}#2}{#3}} + {\bibdoifelse{\@@pb@biburl}{#1\normalexpanded{\bibgotoURL{\@@pb@thekey}{\@@pb@biburl}}#2}{#3}} \protected\def\bibinsertmonth#1#2#3% {\bibdoifelse\@@pb@month @@ -790,7 +790,7 @@ \setbox\scratchbox\hbox{\@@pbnumbercommand{\structurelistsize}}}% \fi \edef\publistnumberbox{\hbox to \the\wd\scratchbox}% - \expanded{\setuplist[pubs][\c!width=\the\wd\scratchbox,\c!distance=\zeropoint]}% + \normalexpanded{\setuplist[pubs][\c!width=\the\wd\scratchbox,\c!distance=\zeropoint]}% \ifx\@@pbnumbering\v!short \def\@@pblimitednumber##1{\publistnumberbox{\@@pbnumbercommand{\bibgetvars\currentpublicationkey}}}% \orelse\ifx\@@pbnumbering\v!bib @@ -889,7 +889,7 @@ {}} % invalid \protected\def\bibtexpubtext - {\expanded{\reference[\bibrefprefix\currentpublicationkey]{\number\bibtexcounter}}% + {\normalexpanded{\reference[\bibrefprefix\currentpublicationkey]{\number\bibtexcounter}}% \strut\dotypesetapublication\currentpublicationkey\strut} \protected\def\dotypesetapublication#1% @@ -972,7 +972,7 @@ \else \edef\LOextras{{\LOextras\LOright}}% \fi - \expanded{\setupcite[\@@currentalternative][#1,\c!right=\LOextras]}% + \normalexpanded{\setupcite[\@@currentalternative][#1,\c!right=\LOextras]}% \fi}% {\def\@@currentalternative{#1}}% \doifelsevalue{@@pv\@@currentalternative\c!compress}\v!no\bibcitecompressfalse\bibcitecompresstrue @@ -1021,7 +1021,7 @@ \protected\def\docitation#1% {\iftrialtypesetting \else - \expanded{\writedatatolist[pubs][bibref=#1]}% + \normalexpanded{\writedatatolist[pubs][bibref=#1]}% \fi} \let\addthisref\gobbleoneargument % keep this for compatibility @@ -1109,7 +1109,7 @@ \or \def\currentbibauthor{#1}% \or - \expanded{\docurrentbibauthor#1}% + \normalexpanded{\docurrentbibauthor#1}% \else \handlemultiplebibauthors{\commalistsize}{#1}% \fi} @@ -1148,15 +1148,17 @@ \bibalternative{otherstext}\else\bibalternative{andtext}#2\fi}% \fi}} -%D This is not the one Hans made for me, because I need a global -%D edef, and the \type {\robustdoifinsetelse} doesn't listen to -%D \type {\doglobal}. +%D This is not the one Hans made for me, because I need a global edef, and the \type +%D {\robustdoifinsetelse} doesn't listen to \type {\doglobal}. \pushoverloadmode +% \protected\def\robustaddtocommalist#1#2% {item} \cs +% {\robustdoifelseinset{#1}#2\resetglobal +% {\dodoglobal\xdef#2{\ifempty#2\else#2,\fi#1}}} + \protected\def\robustaddtocommalist#1#2% {item} \cs - {\robustdoifelseinset{#1}#2\resetglobal - {\dodoglobal\xdef#2{\ifempty#2\else#2,\fi#1}}} + {\robustdoifelseinset{#1}#2\donothing{\xdef#2{\ifempty#2\else#2,\fi#1}}} \popoverloadmode @@ -1253,8 +1255,8 @@ %D Beware, we can have cites without reference match. \protected\def\gotobiblink#1[#2]{\doifelsereferencefound{\bibrefprefix#2}{\goto{#1}[\bibrefprefix#2]}{#1}} -\protected\def\atbiblink [#1]{\doifelsereferencefound{\bibrefprefix#1}{\at [\bibrefprefix#1]}{#1}} -\protected\def\inbiblink [#1]{\doifelsereferencefound{\bibrefprefix#1}{\expanded{\goto{\currentreferencetext}}[\bibrefprefix#1]}{#1}} +\protected\def\atbiblink [#1]{\doifelsereferencefound{\bibrefprefix#1}{\at[\bibrefprefix#1]}{#1}} +\protected\def\inbiblink [#1]{\doifelsereferencefound{\bibrefprefix#1}{\normalexpanded{\goto{\currentreferencetext}}[\bibrefprefix#1]}{#1}} %D \macros{bibauthoryearref,bibauthoryearsref,bibauthorref,bibyearref} %D @@ -1325,11 +1327,11 @@ \newconditional\firstbibrefsep \protected\def\bibresetrefsep - {\settrue\firstbibrefsep} + {\firstbibrefsep\conditionaltrue} \protected\def\bibinsertrefsep {\ifconditional\firstbibrefsep - \setfalse\firstbibrefsep + \firstbibrefsep\conditionalfalse \else \bibalternative\c!pubsep \fi} @@ -1380,7 +1382,7 @@ \protected\def\dobibdoiref#1% {\bibinsertrefsep \doifelsebibreferencefound{#1} - {\expanded{\bibgotoDOI{#1}{\bibgetvaro{#1}}}} + {\normalexpanded{\bibgotoDOI{#1}{\bibgetvaro{#1}}}} {}} \protected\def\biburlref[#1]% @@ -1396,7 +1398,7 @@ \protected\def\dobiburlref#1% {\bibinsertrefsep \doifelsebibreferencefound{#1} - {\expanded{\bibgotoURL{#1}{\bibgetvaru{#1}}}} + {\normalexpanded{\bibgotoURL{#1}{\bibgetvaru{#1}}}} {}} \protected\def\bibtyperef[#1]% diff --git a/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt index a2244dcdd6f..a52df8f249e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt @@ -188,8 +188,9 @@ blobs.strhd = strhd -- upgraded -local dimension_code = tokens.values.dimension -local scan_hbox = tokens.scanners.hbox +local scan_hbox = tokens.scanners.hbox + +local dimension_code = tokens.values.dimension local function action(field,what) local l = scan_hbox() diff --git a/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl index 8481048bb97..c9dab57eb2d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl @@ -23,13 +23,15 @@ \immutable\def\??boundaryprefix{c_bndr_} \permanent\tolerant\protected\def\defineboundary[#1]#*[#2]% nicer for users - {\doifelseinset\s!public{#2}% - {\ifcsname#1\endcsname\else - \global\permanent\expandafter\integerdef\csname#1\endcsname\clf_defineboundary{#1}\relax - \fi} - {\ifcsname\??boundaryprefix#1\endcsname\else - \global\permanent\expandafter\integerdef\csname\??boundaryprefix#1\endcsname\clf_defineboundary{#1}\relax - \fi}} + {\ifinset\s!public{#2}% + \ifcsname#1\endcsname\else + \global\permanent\expandafter\integerdef\csname#1\endcsname\clf_defineboundary{#1}\relax + \fi + \else + \ifcsname\??boundaryprefix#1\endcsname\else + \global\permanent\expandafter\integerdef\csname\??boundaryprefix#1\endcsname\clf_defineboundary{#1}\relax + \fi + \fi} \permanent\protected\def\newboundary#1% nicer for lowlevel {\ifdefined#1\else diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt index 9f5535638ce..3d08c60e8a6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt @@ -10,8 +10,8 @@ local concat = table.concat local type, next, load = type, next, load local sub, format, find, match = string.sub, string.format, string.find, string.match local splitlines, validstring, replacenewlines = string.splitlines, string.valid, string.replacenewlines -local P, S, C, Ct, Cs = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs -local patterns, lpegmatch = lpeg.patterns, lpeg.match +local P, S, C, Ct, Cs, Cp = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Cp +local lpegpatterns, lpegmatch = lpeg.patterns, lpeg.match local utfchar = utf.char local nameonly = file.nameonly local totable = string.totable @@ -49,7 +49,6 @@ local grabtokens = token.grab local getcommand = tokens.accessors.command local getnextchar = tokens.scanners.nextchar -local variables = interfaces.variables local settings_to_array = utilities.parsers.settings_to_array local formatters = string.formatters local addsuffix = file.addsuffix @@ -57,20 +56,18 @@ local replacesuffix = file.replacesuffix local registertempfile = luatex.registertempfile -local v_yes = variables.yes -local v_append = variables.append +local v_yes = interfaces.variables.yes +local v_append = interfaces.variables.append -local eol = patterns.eol -local space = patterns.space -local whitespace = patterns.whitespace +local eol = lpegpatterns.eol +local space = lpegpatterns.space +local whitespace = lpegpatterns.whitespace local blackspace = whitespace - eol local whatever = (1-eol)^1 * eol^0 local emptyline = space^0 * eol -local catcodenumbers = catcodes.numbers - -local ctxcatcodes = catcodenumbers.ctxcatcodes -local txtcatcodes = catcodenumbers.txtcatcodes +local ctxcatcodes = catcodes.numbers.ctxcatcodes +local txtcatcodes = catcodes.numbers.txtcatcodes local setdata = job.datasets.setdata local getdata = job.datasets.getdata @@ -103,7 +100,7 @@ local assign do -- There is no gain in an immediate concatenating lpeg local action = whitespace^0 * C(P("+")^1 + P("*")) * whitespace^0 - local equal = whitespace^0 * patterns.equal * whitespace^0 + local equal = whitespace^0 * lpegpatterns.equal * whitespace^0 local name = C((1-action)^1) local pattern = C((1-equal)^1) * equal * Ct((action + name)^1) @@ -270,9 +267,9 @@ implement { arguments = "string" } --- local anything = patterns.anything --- local alwaysmatched = patterns.alwaysmatched --- local utf8character = patterns.utf8character +-- local anything = lpegpatterns.anything +-- local alwaysmatched = lpegpatterns.alwaysmatched +-- local utf8character = lpegpatterns.utf8character -- -- local function countnesting(b,e) -- local n @@ -373,7 +370,7 @@ local tochar = { [ 3] = "$", [ 4] = "&", [ 5] = "\n", - [ 6] = "#", + [ 6] = "#", -- todo [ 7] = "^", [ 8] = "_", [10] = " ", @@ -677,7 +674,9 @@ local function runbuffer(name,encapsulate,runnername,suffixes) content = "empty buffer" end if encapsulate then - content = formatters["\\starttext\n%s\n\\stoptext\n"](content) + if not find(content,"\\starttext") then + content = formatters["\\starttext\n%s\n\\stoptext\n"](content) + end end -- local hash = md5hex(content) @@ -759,7 +758,7 @@ implement { name = "getbuffer", actions = getbuffer, arguments = "argu implement { name = "getbuffermkvi", actions = getbuffermkvi, arguments = "argument" } implement { name = "getbuffertex", actions = getbuffertex, arguments = "argument" } -interfaces.implement { +implement { name = "getbuffercontent", arguments = "string", actions = { getcontent, context }, @@ -828,7 +827,7 @@ end -- moved here: -function buffers.samplefile(name) +function buffers.samplefile(name,before,after,inbetween) if not exists(name) then assign(name,io.loaddata(resolvers.findfile(name))) end @@ -837,10 +836,37 @@ end implement { name = "samplefile", -- bad name, maybe rename to injectbuffercontent + public = true, + protected = true, actions = buffers.samplefile, arguments = "string" } +function buffers.splitsamplefile(name,before,after,inbetween) + local data = io.loaddata(resolvers.findfile(name)) or "" + local split = string.split(utilities.strings.striplines(data,"prune and collapse"),lpegpatterns.whitespace^1) + local size = #split + local before = tonumber(before) or 1 + local after = tonumber(after) or 1 + if before + after < size then + table.move(split,size-after,size,before+1) + if inbetween and inbetween ~= "" then + split[before+1] = inbetween + end + data = concat(split, " ",1,before+after+1) + end + assign(name,data) + getbuffer(name) +end + +implement { + name = "splitsamplefile", -- bad name, maybe rename to injectbuffercontent + public = true, + protected = true, + actions = buffers.splitsamplefile, + arguments = "4 strings", +} + -- A somewhat strange place (for now) so the *.log definitions might move someplace -- else (if useful at all). @@ -918,3 +944,55 @@ do } end + +do + + local integer_value = tokens.values.integer + + local p_newline = lpegpatterns.newline + + local amount + + local p_count = ( + p_newline / function() amount = amount + 1 end + + 1 + )^0 + + local p_width = ( + ( + Cp() * (lpegpatterns.utf8char-p_newline)^1 * Cp() * (p_newline + P(0)) + ) / function(f,t) local l = t - f ; if l > amount then amount = l end end + + p_newline + )^0 + + implement { + name = "nofbufferlines", + public = true, + usage = "value", + arguments = "string", + actions = function(n) + amount = 0 + local data = getcontent(n) + if data and data ~= "" then + lpegmatch(p_count,data) + end + return integer_value, amount + end + } + + implement { + name = "maxbufferwidth", + public = true, + usage = "value", + arguments = "string", + actions = function(n) + amount = 0 + local data = getcontent(n) + if data and data ~= "" then + lpegmatch(p_width,data) + end + return integer_value, amount + end + } + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl index 0bc4d665f30..a810f8bd008 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl @@ -40,14 +40,13 @@ {\buff_start_indeed{}{#1}{\e!start\v!buffer}{\e!stop\v!buffer}} \def\buff_start_indeed#1#2#3#4% - {\edef\p_strip{\namedbufferparameter{#1}\c!strip}% for aditya - \normalexpanded{\buff_pickup + {\normalexpanded{\buff_pickup {#2}% {#3}% {#4}% {}% {\buff_stop{#4}}% - \ifx\p_strip\v!no\zerocount\else\plusone\fi}} + \ifcstok{\namedbufferparameter{#1}\c!strip}\v!no\zerocount\else\plusone\fi}} \permanent\protected\def\grabbufferdatadirect % name start stop {\begingroup % (6) @@ -96,7 +95,7 @@ % \expandafter\relax\string} % dirty trick \scratchcounterone % better than \string but still a dirty trick to avoid \par mess in blocks - \expandafter\scratchcountertwo\detokenized} + \expandafter\scratchcountertwo\detokenized} % the bare token (so not \detokened !) \protected\def\buff_stop#1% {\endgroup % (3 & 4 & 5 & 6) @@ -126,8 +125,8 @@ \appendtoks \global\advanceby\c_buff_n_of_defined\plusone - \setexpandedbufferparameter\c!number{\number\c_buff_n_of_defined}% - \edef\currentdefinedbuffer{def-\number\c_buff_n_of_defined}% + \setexpandedbufferparameter\c!number{\the\c_buff_n_of_defined}% + \cdef\currentdefinedbuffer{def-\the\c_buff_n_of_defined}% \ifcstok{\bufferparameter\c!define}\v!yes \frozen\instance\protected\edefcsname\e!start\currentbuffer\endcsname {\buff_start_defined{\currentbuffer}{\currentdefinedbuffer}{\e!start\currentbuffer}{\e!stop\currentbuffer}}% @@ -164,9 +163,11 @@ % We had this: % % \permanent\tolerant\protected\def\inlinebuffer[#1]% [name] -% {\doifelsenothing{#1} -% {\buff_get_stored_inline_indeed\empty} -% {\processcommalist[#1]\buff_get_stored_inline_indeed}} +% {\ifempty{#1} +% \buff_get_stored_inline_indeed\empty +% \else +% \processcommalist[#1]\buff_get_stored_inline_indeed +% \fi} % % \protected\def\buff_get_stored_inline_indeed#1% % {\ignorespaces\clf_getbuffer{#1}\removeunwantedspaces} @@ -205,7 +206,7 @@ \c!directory=, \c!prefix=\v!yes] -\permanent\tolerant\protected\def\savebuffer[#1]#*[#2]% +\permanent\tolerant\protected\def\savebuffer[#S#1]#*[#2]% {\begingroup \ifhastok={#1}% \setupcurrentsavebuffer[#1]% @@ -254,7 +255,7 @@ \to \everydefinesavebuffer \protected\def\buff_stop_save_buffer#1% - {\edef\currentsavebuffer{#1}% + {\cdef\currentsavebuffer{#1}% \global\advanceby\csname\??savebuffercounter\currentsavebuffer\endcsname\plusone \clf_savebuffer % will become key/value {\thedefinedbuffer{\currentsavebuffer}}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx b/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx index 63e6f47bd5a..b58e77e97a9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx @@ -72,8 +72,8 @@ \clf_defineparallel{#name}{#instances}% \expandafter\newtoks\csname\??parallelhandler#name\endcsname \processcommacommand[#instances]{\buff_parallel_define_instance{#name}}% - \frozen\instance\setuevalue{\e!start#name}{\buff_parallel_start{#name}}% - \frozen\instance\setuevalue{\e!stop #name}{\buff_parallel_stop}} + \frozen\instance\protected\edefcsname\e!start#name\endcsname{\buff_parallel_start{#name}}% + \frozen\instance\protected\edefcsname\e!stop #name\endcsname{\buff_parallel_stop}} \popoverloadmode @@ -86,7 +86,7 @@ \toksapp \csname\??parallelhandler#name\endcsname {\edef\currentparallelinstance{#instance}\buff_process_parallel_instance\relax}% - \setuevalue{\e!stop#instance}{\buff_parallel_save{#instance}}} + \protected\edefcsname\e!stop#instance\edefcsname{\buff_parallel_save{#instance}}} \pushoverloadmode @@ -102,7 +102,7 @@ \protected\def\buff_parallel_start#name% {\pushmacro\currentparallel - \edef\currentparallel{#name}% + \cdef\currentparallel{#name}% \clf_nextparallel{\currentparallel}} \protected\def\buff_parallel_stop @@ -115,9 +115,9 @@ {\thedefinedbuffer{#instance}}% \relax} -\permanent\tolerant\protected\def\placeparallel[#name]#spacer[#instance]#spacer[#settings]% +\permanent\tolerant\protected\def\placeparallel[#name]#spacer[#instance]#spacer[#S#settings]% {\begingroup - \edef\currentparallel{#name}% + \cdef\currentparallel{#name}% \setupcurrentparallel[#settings]% \clf_placeparallel {\currentparallel}% @@ -173,9 +173,11 @@ \hbox to 3\emwidth \bgroup \hss \bf - \doifsomething \currentparallellabel { + \ifempty\currentparallellabel + % bad news + \else \textreference[\currentparallellabel]{\currentparallelline} - } + \fi \currentparallelline \quad \egroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-ver.lmt b/Master/texmf-dist/tex/context/base/mkxl/buff-ver.lmt new file mode 100644 index 00000000000..68c944dbe1e --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/buff-ver.lmt @@ -0,0 +1,992 @@ +if not modules then modules = { } end modules ['buff-ver'] = { + version = 1.001, + comment = "companion to buff-ver.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- The default visualizers have reserved names starting with buff-imp-*. Users are +-- supposed to use different names for their own variants. +-- +-- todo: skip=auto +-- +-- todo: update to match context scite lexing + +local type, next, rawset, rawget, setmetatable, getmetatable, tonumber = type, next, rawset, rawget, setmetatable, getmetatable, tonumber +local lower, upper,match, find, sub = string.lower, string.upper, string.match, string.find, string.sub +local splitlines = string.splitlines +local concat = table.concat +local C, P, R, S, V, Carg, Cc, Cs = lpeg.C, lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Carg, lpeg.Cc, lpeg.Cs +local patterns, lpegmatch, is_lpeg = lpeg.patterns, lpeg.match, lpeg.is_lpeg + +local trace_visualize = false trackers.register("buffers.visualize", function(v) trace_visualize = v end) +local report_visualizers = logs.reporter("buffers","visualizers") + +local allocate = utilities.storage.allocate + +visualizers = visualizers or { } +local specifications = allocate() +visualizers.specifications = specifications + +local context = context +local commands = commands +local implement = interfaces.implement + +local formatters = string.formatters + +local tabtospace = utilities.strings.tabtospace +local settings_to_array = utilities.parsers.settings_to_array +local findfile = resolvers.findfile +local addsuffix = file.addsuffix + +local variables = interfaces.variables +local v_yes = variables.yes +local v_no = variables.no +local v_last = variables.last +local v_all = variables.all +local v_absolute = variables.absolute +----- v_inline = variables.inline -- not ! +----- v_display = variables.display -- not ! + +-- beware, all macros have an argument: + +local ctx_inlineverbatimnewline = context.doinlineverbatimnewline +local ctx_inlineverbatimbeginline = context.doinlineverbatimbeginline +local ctx_inlineverbatimemptyline = context.doinlineverbatimemptyline +local ctx_inlineverbatimstart = context.doinlineverbatimstart +local ctx_inlineverbatimstop = context.doinlineverbatimstop + +local ctx_displayverbatiminitialize = context.dodisplayverbatiminitialize -- the number of arguments might change over time +local ctx_displayverbatimnewline = context.dodisplayverbatimnewline +local ctx_displayverbatimbeginline = context.dodisplayverbatimbeginline +local ctx_displayverbatimemptyline = context.dodisplayverbatimemptyline +local ctx_displayverbatimstart = context.dodisplayverbatimstart +local ctx_displayverbatimstop = context.dodisplayverbatimstop + +local ctx_verbatim = context.verbatim +local ctx_verbatimspace = context.doverbatimspace + +local CargOne = Carg(1) + +local function f_emptyline(s,settings) + if settings and settings.nature == "inline" then + ctx_inlineverbatimemptyline() + else + ctx_displayverbatimemptyline() + end +end + +local function f_beginline(s,settings) + if settings and settings.nature == "inline" then + ctx_inlineverbatimbeginline() + else + ctx_displayverbatimbeginline() + end +end + +local function f_newline(s,settings) + if settings and settings.nature == "inline" then + ctx_inlineverbatimnewline() + else + ctx_displayverbatimnewline() + end +end + +local function f_start(s,settings) + if settings and settings.nature == "inline" then + ctx_inlineverbatimstart() + else + ctx_displayverbatimstart() + end +end + +local function f_stop(s,settings) + if settings and settings.nature == "inline" then + ctx_inlineverbatimstop() + else + ctx_displayverbatimstop() + end +end + +local function f_default(s) -- (s,settings) + ctx_verbatim(s) +end + +local function f_space() -- (s,settings) + ctx_verbatimspace() +end + +local function f_signal() -- (s,settings) + -- we use these for special purposes +end + +local signal = "\000" + +visualizers.signal = signal +visualizers.signalpattern = P(signal) + +local functions = { + __index = { + emptyline = f_emptyline, + newline = f_newline, + default = f_default, + beginline = f_beginline, + space = f_space, + start = f_start, + stop = f_stop, + signal = f_signal, + } +} + +local handlers = { } + +function visualizers.newhandler(name,data) + local tname = type(name) + local tdata = type(data) + if tname == "table" then -- (data) + setmetatable(name,getmetatable(name) or functions) + return name + elseif tname == "string" then + if tdata == "string" then -- ("name","parent") + local result = { } + setmetatable(result,getmetatable(handlers[data]) or functions) + handlers[name] = result + return result + elseif tdata == "table" then -- ("name",data) + setmetatable(data,getmetatable(data) or functions) + handlers[name] = data + return data + else -- ("name") + local result = { } + setmetatable(result,functions) + handlers[name] = result + return result + end + else -- () + local result = { } + setmetatable(result,functions) + return result + end +end + +function visualizers.newgrammar(name,t) + name = lower(name) + t = t or { } + local g = visualizers.specifications[name] + g = g and g.grammar + if g then + if trace_visualize then + report_visualizers("cloning grammar %a",name) + end + for k,v in next, g do + if not t[k] then + t[k] = v + end + if is_lpeg(v) then + t[name..":"..k] = v + end + end + end + return t +end + +local function getvisualizer(method,nature) + method = lower(method) + local m = specifications[method] or specifications.default + if nature then + if trace_visualize then + report_visualizers("getting visualizer %a with nature %a",method,nature) + end + return m and (m[nature] or m.parser) or nil + else + if trace_visualize then + report_visualizers("getting visualizer %a",method) + end + return m and m.parser or nil + end +end + +local ctx_fallback = ctx_verbatim + +local function makepattern(visualizer,replacement,pattern) + if not pattern then + report_visualizers("error in visualizer %a",replacement) + return patterns.alwaystrue + else + if type(visualizer) == "table" and type(replacement) == "string" then + replacement = visualizer[replacement] or ctx_fallback + else + replacement = ctx_fallback + end + return (C(pattern) * CargOne) / replacement + end +end + +local function makenested(handler,how,start,stop) + local b, e, f = P(start), P(stop), how + if type(how) == "string" then + f = function(s) getvisualizer(how,"direct")(s) end + end + return makepattern(handler,"name",b) + * ((1-e)^1/f) + * makepattern(handler,"name",e) +end + +visualizers.pattern = makepattern +visualizers.makepattern = makepattern +visualizers.makenested = makenested + +function visualizers.load(name) + name = lower(name) + if rawget(specifications,name) == nil then + name = lower(name) + local impname = "buff-imp-"..name + local texname = findfile(addsuffix(impname,"mkiv")) + local luaname = findfile(addsuffix(impname,"lua")) + if texname == "" or luaname == "" then + -- assume a user specific file + luaname = findfile(addsuffix(name,"mkiv")) + texname = findfile(addsuffix(name,"lua")) + end + if texname == "" or luaname == "" then + if trace_visualize then + report_visualizers("unknown visualizer %a",name) + end + else + if trace_visualize then + report_visualizers("loading visualizer %a",name) + end + lua.registercode(luaname) -- only used here, end up in format + context.input(texname) + end + if rawget(specifications,name) == nil then + rawset(specifications,name,false) + end + end +end + +function visualizers.register(name,specification) + name = lower(name) + if trace_visualize then + report_visualizers("registering visualizer %a",name) + end + specifications[name] = specification + local parser = specification.parser + local handler = specification.handler + local displayparser = specification.display or parser + local inlineparser = specification.inline or parser + local isparser = is_lpeg(parser) + local start, stop + if isparser then + start = makepattern(handler,"start",patterns.alwaysmatched) + stop = makepattern(handler,"stop", patterns.alwaysmatched) + end + if handler then + if isparser then + specification.display = function(content,settings) + if handler.startdisplay then handler.startdisplay(settings) end + lpegmatch(start * displayparser * stop,content,1,settings) + if handler.stopdisplay then handler.stopdisplay(settings) end + end + specification.inline = function(content,settings) + if handler.startinline then handler.startinline(settings) end + lpegmatch(start * inlineparser * stop,content,1,settings) + if handler.stopinline then handler.stopinline(settings) end + end + specification.direct = function(content,settings) + lpegmatch(parser,content,1,settings) + end + elseif parser then + specification.display = function(content,settings) + if handler.startdisplay then handler.startdisplay(settings) end + parser(content,settings) + if handler.stopdisplay then handler.stopdisplay(settings) end + end + specification.inline = function(content,settings) + if handler.startinline then handler.startinline(settings) end + parser(content,settings) + if handler.stopinline then handler.stopinline(settings) end + end + specification.direct = parser + end + elseif isparser then + specification.display = function(content,settings) + lpegmatch(start * displayparser * stop,content,1,settings) + end + specification.inline = function(content,settings) + lpegmatch(start * inlineparser * stop,content,1,settings) + end + specification.direct = function(content,settings) + lpegmatch(parser,content,1,settings) + end + elseif parser then + specification.display = parser + specification.inline = parser + specification.direct = parser + end + return specification +end + +function visualizers.getspecification(name) + return specifications[lower(name)] +end + +local escapepatterns = allocate() +visualizers.escapepatterns = escapepatterns + +local function texmethod(s) + context.bgroup() + context(s) + context.egroup() +end + +local function texcommand(s) + context[s]() +end + +local function defaultmethod(s,settings) + lpegmatch(getvisualizer("default"),lower(s),1,settings) +end + +-- we can consider using a nested instead + +local space_pattern = patterns.space^0 +local name_pattern = R("az","AZ")^1 + +-- the hack is needed in order to retain newlines when an escape happens at the +-- at the begin of a line; it also ensures proper line numbering; a bit messy + +local function hack(pattern) + return Cs(pattern * Cc(signal)) +end + +local split_processor = typesetters.processors.split +local apply_processor = typesetters.processors.apply + +-- todo: { before = b, after = a, processor = p }, ... + +function visualizers.registerescapepattern(name,befores,afters,normalmethod,escapemethod,processors) + local escapepattern = escapepatterns[name] + if not escapepattern then + if type(befores) ~= "table" then befores = { befores } end + if type(afters) ~= "table" then afters = { afters } end + if type(processors) ~= "table" then processors = { processors } end + for i=1,#befores do + local before = befores[i] + local after = afters[i] + local processor = processors[i] + if trace_visualize then + report_visualizers("registering escape pattern, name %a, index %a, before %a, after %a, processor %a", + name,i,before,after,processor or "default") + end + before = P(before) * space_pattern + after = space_pattern * P(after) + local action + if processor then + action = function(s) apply_processor(processor,s) end + else + action = escapemethod or texmethod + end + local ep = (before / "") * ((1 - after)^0 / action) * (after / "") + if escapepattern then + escapepattern = escapepattern + ep + else + escapepattern = ep + end + end + escapepattern = ( + escapepattern + + hack((1 - escapepattern)^1) / (normalmethod or defaultmethod) + )^0 + escapepatterns[name] = escapepattern + end + return escapepattern +end + +function visualizers.registerescapeline(name,befores,normalmethod,escapemethod,processors) + local escapepattern = escapepatterns[name] + if not escapepattern then + if type(befores) ~= "table" then befores = { befores } end + if type(processors) ~= "table" then processors = { processors } end + for i=1,#befores do + local before = befores[i] + local processor = processors[i] + if trace_visualize then + report_visualizers("registering escape line pattern, name %a, before %a, after <>",name,before) + end + before = P(before) * space_pattern + after = space_pattern * P("\n") + local action + if processor then + action = function(s) apply_processor(processor,s) end + else + action = escapemethod or texmethod + end + local ep = (before / "") * ((1 - after)^0 / action) * (space_pattern / "") + if escapepattern then + escapepattern = escapepattern + ep + else + escapepattern = ep + end + end + escapepattern = ( + escapepattern + + hack((1 - escapepattern)^1) / (normalmethod or defaultmethod) + )^0 + escapepatterns[name] = escapepattern + end + return escapepattern +end + +function visualizers.registerescapecommand(name,token,normalmethod,escapecommand,processor) + local escapepattern = escapepatterns[name] + if not escapepattern then + if trace_visualize then + report_visualizers("registering escape token, name %a, token %a",name,token) + end + token = P(token) + local notoken = hack((1 - token)^1) + local cstoken = Cs(name_pattern * (space_pattern/"")) + escapepattern = ( + (token / "") + * (cstoken / (escapecommand or texcommand)) + + (notoken / (normalmethod or defaultmethod)) + )^0 + escapepatterns[name] = escapepattern + end + return escapepattern +end + +local escapedvisualizers = { } +local f_escapedvisualizer = formatters["%s : %s"] + +local function visualize(content,settings) -- maybe also method in settings + if content and content ~= "" then + local method = lower(settings.method or "default") + local m = specifications[method] or specifications.default + local e = settings.escape + if e and e ~= "" and not m.handler.noescape then + local newname = f_escapedvisualizer(method,e) + local newspec = specifications[newname] + if newspec then + m = newspec + else + local starts, stops, processors = { }, { }, { } + if e == v_yes then + starts[1] = "/BTEX" + stops [1] = "/ETEX" + else + local s = settings_to_array(e,true) + for i=1,#s do + local si = s[i] + local processor, pattern = split_processor(si) + si = processor and pattern or si + local start, stop = match(si,"^(.-),(.-)$") + if start then + local n = #starts + 1 + starts[n] = start + stops [n] = stop or "" + processors[n] = processor + end + end + end + local oldm = m + local oldparser = oldm.direct + local newhandler = oldm.handler + local newparser = oldm.parser -- nil + if starts[1] and stops[1] ~= "" then + newparser = visualizers.registerescapepattern(newname,starts,stops,oldparser,nil,processors) + elseif starts[1] then + newparser = visualizers.registerescapeline(newname,starts,oldparser,nil,processors) + else -- for old times sake: /em + newparser = visualizers.registerescapecommand(newname,e,oldparser,nil,processors) + end + m = visualizers.register(newname, { + parser = newparser, + handler = newhandler, + }) + end + else + m = specifications[method] or specifications.default + end + local nature = settings.nature or "display" + local n = m and m[nature] + if n then + if trace_visualize then + report_visualizers("visualize using method %a and nature %a",method,nature) + end + n(content,settings) + else + if trace_visualize then + report_visualizers("visualize using method %a",method) + end + ctx_fallback(content,1,settings) + end + end +end + +visualizers.visualize = visualize +visualizers.getvisualizer = getvisualizer + +local fallbacks = { } table.setmetatableindex(fallbacks,function(t,k) local v = { nature = k } t[k] = v return v end) + +local function checkedsettings(settings,nature) + if not settings then + -- let's avoid dummy tables as much as possible + return fallbacks[nature] + else + if not settings.nature then + settings.nature = nature + end + return settings + end +end + +function visualizers.visualizestring(content,settings) + visualize(content,checkedsettings(settings,"inline")) +end + +function visualizers.visualizefile(name,settings) + visualize(resolvers.loadtexfile(name),checkedsettings(settings,"display")) +end + +function visualizers.visualizebuffer(name,settings) + visualize(buffers.getcontent(name),checkedsettings(settings,"display")) +end + +-- -- + +local space = C(patterns.space) * CargOne / f_space +local newline = C(patterns.newline) * CargOne / f_newline +local emptyline = C(patterns.emptyline) * CargOne / f_emptyline +local beginline = C(patterns.beginline) * CargOne / f_beginline +local anything = C(patterns.somecontent) * CargOne / f_default + +----- verbosed = (space + newline * (emptyline^0) * beginline + anything)^0 +local verbosed = (space + newline * (emptyline^0) * beginline + newline * emptyline + newline + anything)^0 + +local function write(s,settings) -- bad name + lpegmatch(verbosed,s,1,settings or false) +end + +visualizers.write = write +visualizers.writenewline = f_newline +visualizers.writeemptyline = f_emptyline +visualizers.writespace = f_space +visualizers.writedefault = f_default + +function visualizers.writeargument(...) + context("{") -- If we didn't have tracing then we could + write(...) -- use a faster print to tex variant for the + context("}") -- { } tokens as they always have ctxcatcodes. +end + +-- helpers + +local function realign(lines,strip) -- "yes", + local n + if strip == v_yes then + n = 0xFFFF + for i=1, #lines do + local spaces = find(lines[i],"%S") -- can be lpeg + if not spaces then + -- empty line + elseif spaces == 0 then + n = 0 + break + elseif spaces < n then + n = spaces + end + end + n = n - 1 + else + n = tonumber(strip) + end + if n and n > 0 then + local copy = { } + for i=1,#lines do + copy[i] = sub(lines[i],n+1) + end + return copy + end + return lines +end + +local onlyspaces = S(" \t\f\n\r")^0 * P(-1) + +local function getstrip(lines,first,last) + if not first then + first = 1 + end + if not last then + last = #lines + end + for i=first,last do + local li = lines[i] + if #li == 0 or lpegmatch(onlyspaces,li) then + first = first + 1 + else + break + end + end + for i=last,first,-1 do + local li = lines[i] + if #li == 0 or lpegmatch(onlyspaces,li) then + last = last - 1 + else + break + end + end + return first, last, last - first + 1 +end + +-- we look for text (todo): (needs documentation) +-- +-- "foo" : start after line with "foo" +-- "=" : ignore first blob +-- "=foo" : start at "foo" +-- "!foo" : maybe a not "foo" + +-- % - # lines start a comment + +local comment = "^[%%%-#]" + +local function getrange(lines,first,last,range) -- 1,3 1,+3 fromhere,tothere + local noflines = #lines + local first = first or 1 + local last = last or noflines + if last < 0 then + last = noflines + last + end + local what = settings_to_array(range) -- maybe also n:m + local r_first = what[1] + local r_last = what[2] + local f = tonumber(r_first) + local l = tonumber(r_last) + if r_first then + if f then + if f > first then + first = f + end + elseif r_first == "=" then + for i=first,last do + if find(lines[i],comment) then + first = i + 1 + else + break + end + end + elseif r_first ~= "" then + local exact, r_first = match(r_first,"^([=]?)(.*)") + for i=first,last do + if find(lines[i],r_first) then + if exact == "=" then + first = i + else + first = i + 1 + end + break + else + first = i + end + end + end + end + if r_last then + if l then + if l < 0 then + l = noflines + l + end + if find(r_last,"^[%+]") then -- 1,+3 + l = first + l + end + if l < last then + last = l + end + elseif r_first == "=" then + for i=first,last do + if find(lines[i],comment) then + break + else + last = i + end + end + elseif r_last ~= "" then + local exact, r_last = match(r_last,"^([=]?)(.*)") + for i=first,last do + if find(lines[i],r_last) then + if exact == "=" then + last = i + end + break + else + last = i + end + end + end + end + return first, last +end + +local tablength = 7 + +local function dotabs(content,settings) + local par = settings.par + if par == v_yes then + return utilities.strings.striplines(content,"collapse all") + else + local tab = settings.tab + tab = tab and (tab == v_yes and tablength or tonumber(tab)) + if tab then + return tabtospace(content,tab) + end + end + return content +end + +local function filter(lines,settings) -- todo: inline or display in settings + local strip = settings.strip + -- if strip and strip == "" then + if strip ~= v_no and strip ~= false then + lines = realign(lines,strip) + end + local line = 0 + local n = 0 + local range = settings.range + local first, last, m = getstrip(lines) + if range then + first, last = getrange(lines,first,last,range) + first, last = getstrip(lines,first,last) + end + -- \r is \endlinechar but \n would is more generic so this choice is debatable + local content = concat(lines,(settings.nature == "inline" and " ") or "\n",first,last) + return content, m +end + +local getlines = buffers.getlines + +-- local decodecomment = resolvers.macros.decodecomment -- experiment + +local function typebuffer(settings) + local lines = getlines(settings.name) + if lines then + ctx_displayverbatiminitialize(#lines) + local content, m = filter(lines,settings) + if content and content ~= "" then + -- content = decodecomment(content) + content = dotabs(content,settings) + visualize(content,checkedsettings(settings,"display")) + end + end +end + +local function processbuffer(settings) + local lines = getlines(settings.name) + if lines then + local content, m = filter(lines,settings) + if content and content ~= "" then + content = dotabs(content,settings) + visualize(content,checkedsettings(settings,"direct")) + end + end +end + +-- not really buffers but it's closely related + +-- A string.gsub(str,"(\\.-) +$","%1") is faster than an lpeg when there is a +-- match but slower when there is no match. But anyway, we need a more clever +-- parser so we use lpeg. +-- +-- [[\text ]] [[\text{}]] [[\foo\bar .tex]] [[\text \text ]] [[\text \\ \text ]] +-- +-- needed in e.g. tabulate (manuals) + +local fences = S([[[{]]) +local symbols = S([[!#"$%&'*()+,-./:;<=>?@[]^_`{|}~0123456789]]) -- digits added but maybe split it +local space = S([[ ]]) +local backslash = S([[\]]) +local nospace = space^1/"" +local endstring = P(-1) + +local compactors = { + [v_all] = Cs((backslash * (1-backslash-space)^1 * nospace * (endstring + fences + #backslash) + 1)^0), + [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols + backslash ) + 1)^0), + [v_last] = Cs((space^1 * endstring/"" + 1)^0), +} + +-- local content = "" + +local function typestring(settings) +-- content = settings.data + local content = settings.data + if content and content ~= "" then + local compact = settings.compact + local compactor = compact and compactors[compact] + if compactor then + content = lpegmatch(compactor,content) or content + end + -- content = decodecomment(content) + -- content = dotabs(content,settings) + visualize(content,checkedsettings(settings,"inline")) +-- else +-- content = "" + end +end + +local function typefile(settings) + local filename = settings.name + local foundname = resolvers.findtexfile(filename) + if foundname and foundname ~= "" then + local str = resolvers.loadtexfile(foundname) + if str and str ~= "" then + local regime = settings.regime + if regime and regime ~= "" then + str = regimes.translate(str,regime) + end + if str and str~= "" then + -- content = decodecomment(content) + local lines = splitlines(str) + local content, m = filter(lines,settings) + if content and content ~= "" then + content = dotabs(content,settings) + visualize(content,checkedsettings(settings,"display")) + end + end + end + end +end + +implement { + name = "type", + actions = typestring, + arguments = { + { + { "data" }, +-- { "data", "detokened" }, +-- { "data", "tokenstring" }, + { "tab" }, + { "par" }, + { "method" }, + { "compact" }, + { "nature" }, + { "escape" }, + } + } +} + +-- implement { +-- name = "gettypestring", +-- public = true, +-- actions = function() +-- if content ~= "" then +-- context(content) +-- end +-- end +-- } + +-- implement { +-- name = "type_x", +-- actions = typestring, +-- arguments = { +-- { +-- { "data", "verbatim" }, +-- { "tab" }, +-- { "method" }, +-- { "compact" }, +-- { "nature" }, +-- { "escape" }, +-- } +-- } +-- } + +-- local function typestring_y(settings) +-- local content = tex.toks[settings.n] +-- if content and content ~= "" then +-- local compact = settings.compact +-- local compactor = compact and compactors[compact] +-- if compactor then +-- content = lpegmatch(compactor,content) +-- end +-- -- content = decodecomment(content) +-- -- content = dotabs(content,settings) +-- visualize(content,checkedsettings(settings,"inline")) +-- end +-- end + +-- implement { +-- name = "type_y", +-- actions = typestring_y, +-- arguments = { +-- { +-- { "n", "integer" }, +-- { "tab" }, +-- { "method" }, +-- { "compact" }, +-- { "nature" }, +-- { "escape" }, +-- } +-- } +-- } + +implement { + name = "processbuffer", + actions = processbuffer, + arguments = { + { + { "name" }, + { "strip" }, + { "tab" }, + { "par" }, + { "method" }, + { "nature" }, + } + } +} + +implement { + name = "typebuffer", + actions = typebuffer, + arguments = { + { + { "name" }, + { "strip" }, + { "range" }, + { "regime" }, + { "tab" }, + { "par" }, + { "method" }, + { "escape" }, + { "nature" }, + } + } +} + +implement { + name = "typefile", + actions = typefile, + arguments = { + { + { "name" }, + { "strip" }, + { "range" }, + { "regime" }, + { "tab" }, + { "method" }, + { "escape" }, + { "nature" }, + } + } +} + +implement { + name = "doifelsevisualizer", + actions = { visualizers.getspecification, commands.doifelse }, + arguments = "string" +} + +implement { + name = "loadvisualizer", + actions = visualizers.load, + arguments = "string" +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl b/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl index 8c42694a320..4b1e6acad25 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl @@ -15,7 +15,7 @@ \writestatus{loading}{ConTeXt Buffer Macros / Verbatim} -\registerctxluafile{buff-ver}{} +\registerctxluafile{buff-ver}{autosuffix} \unprotect @@ -23,7 +23,7 @@ \definesystemattribute[verbatimline][public] -\appendtoksonce +\appendtoks \c_attr_verbatimline\attributeunsetvalue \to \everyforgetall @@ -35,7 +35,7 @@ \newtoks\everyinitializeverbatim \appendtoks - \the\everyresettypesetting + \expand\everyresettypesetting \resetfontfeature \resetcharacterspacing \resetbreakpoints @@ -43,7 +43,7 @@ \to \everyinitializeverbatim \permanent\protected\def\setverbatimspaceskip % to be checked: must happen after font switch - {\spaceskip\fontcharwd\font`x\relax + {\spaceskip\scaledfontcharwd\font`x\relax \xspaceskip\spaceskip} \defcsname\??typinglines\v!no \endcsname{\buff_verbatim_ignore_hyphens} @@ -83,11 +83,10 @@ {\spaceskip.5\emwidth\relax \enforced\let\obeyedspace\specialobeyedspace \enforced\let\controlspace\specialcontrolspace - \edef\p_buff_lines{\typeparameter\c!lines}% - \begincsname\??typinglines\p_buff_lines\endcsname - \edef\p_buff_space{\typeparameter\c!space}% - \begincsname\??typingspace\p_buff_space\endcsname - \relax\the\everyinitializeverbatim\relax} + \begincsname\??typinglines\typeparameter\c!lines\endcsname + \begincsname\??typingspace\typeparameter\c!space\endcsname + \relax\expand\everyinitializeverbatim\relax + \usesetupsparameter\typeparameter\relax} \permanent\protected\def\doinitializeverbatim % for use elsewhere .. temp hack (see lxml-ini) {\buff_verbatim_initialize_type_one @@ -123,11 +122,10 @@ {\spaceskip.5\emwidth\relax \enforced\let\obeyedspace\specialobeyedspace \enforced\let\controlspace\specialcontrolspace - \edef\p_buff_lines{\typingparameter\c!lines}% - \begincsname\??typinglines\p_buff_lines\endcsname - \edef\p_buff_space{\typingparameter\c!space}% - \begincsname\??typingspace\p_buff_space\endcsname - \relax\the\everyinitializeverbatim\relax} + \begincsname\??typinglines\typingparameter\c!lines\endcsname + \begincsname\??typingspace\typingparameter\c!space\endcsname + \relax\expand\everyinitializeverbatim\relax + \usesetupsparameter\typingparameter\relax} %D \macros %D {definetype,setuptype} @@ -261,18 +259,18 @@ \protected\def\buff_verbatim_type#1% {\dontleavehmode \bgroup - \edef\currenttype{#1}% + \cdef\currenttype{#1}% \buff_verbatim_type_indeed} \def\buff_verbatim_typ#1% {\dontleavehmode \bgroup - \edef\currenttype{#1}% + \cdef\currenttype{#1}% \lettypeparameter\c!lines\v!hyphenated \enforced\let\specialobeyedspace\specialstretchedspace \buff_verbatim_type_indeed} -\tolerant\def\buff_verbatim_type_indeed[#1]% +\tolerant\def\buff_verbatim_type_indeed[#S#1]% {\ifarguments\or\setupcurrenttype[#1]\fi \buff_verbatim_left_of_type \futureexpand\bgroup\buff_verbatim_type_a\buff_verbatim_type_one} @@ -309,7 +307,7 @@ {\buff_verbatim_initialize_type_two \dostarttaggedchained\t!verbatim\currenttype\??type \clf_type - data {\detokenize{#1}}% + data {\protecteddetokenize{#1}}% tab {\typeparameter\c!tab}% method {\p_buff_option}% compact {\typeparameter\c!compact}% % none | all | last (all needed in tabulate etc for manuals) @@ -325,6 +323,7 @@ \dostarttaggedchained\t!verbatim\currenttype\??type \clf_type data {\detokenize{#1}}% +% data {\protecteddetokenize{#1}}% tab {\typeparameter\c!tab}% method {\p_buff_option}% % extra visualizer (maybe: nested,\typeparameter\c!option) escape {\typeparameter\c!escape}% % new but rather useless imo (escaping in general is not used much) @@ -368,7 +367,7 @@ \permanent\protected\def\explicitcontrolspace {\optionalcontrolspace\allowbreak} % uses asciispace \appendtoks - \enforced\protected\def\obeyedspace{\hskip\zeropoint\relax\asciispacechar\hskip\zeropoint\relax}% + \enforced\protected\def\obeyedspace{\hskip\zeroskip\relax\asciispacechar\hskip\zeroskip\relax}% \to \everyenableelements \permanent\protected\def\obeyhyphens @@ -444,13 +443,15 @@ \protected\def\buff_verbatim_typing_start#1#2% tricky non standard lookahead {\begingroup - \edef\currenttyping {#1}% + \cdef\currenttyping {#1}% \edef\currenttypingwrapper{#2}% - \obeylines + \begingroup + \obeylines % alternatively \future.. could *not* ignore newlines \futureexpandis[\buff_verbatim_typing_start_yes\buff_verbatim_typing_start_nop} -\def\buff_verbatim_typing_start_yes[#1]% - {\ifhastok={#1}% +\def\buff_verbatim_typing_start_yes[#S#1]% + {\endgroup + \ifhastok={#1}% \setupcurrenttyping[#1]% \orelse\ifcstok{#1}\v!continue \lettypingparameter\c!continue\v!yes @@ -463,7 +464,8 @@ \normalexpanded{\buff_verbatim_type_block{\e!start\currenttypingwrapper}{\e!stop\currenttypingwrapper}}} \def\buff_verbatim_typing_start_nop - {\typingparameter\c!before\relax + {\endgroup + \typingparameter\c!before\relax \startpacked[\v!blank]% \buff_verbatim_setup_line_numbering \buff_verbatim_initialize_typing_one @@ -471,22 +473,20 @@ \normalexpanded{\buff_verbatim_type_block{\e!start\currenttypingwrapper}{\e!stop \currenttypingwrapper}}} \protected\def\buff_verbatim_setup_keep_together - {\edef\p_keeptogether{\typingparameter\c!keeptogether}% - \ifx\p_keeptogether\v!yes - \settrue \c_buff_optimize_linebreaks + {\ifcstok{\typingparameter\c!keeptogether}\v!yes + \c_buff_optimize_linebreaks\conditionaltrue \else - \setfalse\c_buff_optimize_linebreaks + \c_buff_optimize_linebreaks\conditionalfalse \fi} \protected\def\buff_verbatim_type_block#1#2% - {\edef\p_strip{\typingparameter\c!strip}% - \normalexpanded{\buff_pickup + {\normalexpanded{\buff_pickup {_typing_}% {#1}% {#2}% {}% {\buff_verbatim_type_block_verbatim_indeed{#1}{#2}}% - \ifx\p_strip\v!no\zerocount\else\plusone\fi}} + \ifcstok{\typingparameter\c!strip}\v!no\zerocount\else\plusone\fi}} \protected\def\buff_verbatim_type_block_verbatim_indeed#1#2% {\buff_verbatim_initialize_typing_two @@ -498,6 +498,7 @@ strip {\typingparameter\c!strip}% range {\typingparameter\c!range}% tab {\typingparameter\c!tab}% + par {\typingparameter\c!paragraph}% method {\p_buff_option}% escape {\typingparameter\c!escape}% nature {display}% @@ -578,7 +579,7 @@ \frozen\protected\instance\edefcsname\e!type\currenttyping\v!file\endcsname{\typefile[\currenttyping]}% \to \everydefinetyping -\permanent\tolerant\protected\def\typefile[#1]#*[#2]#:#3% +\permanent\tolerant\protected\def\typefile[#S#1]#*[#S#2]#:#3% {\begingroup \ifparameter#2\or \setuptyping[#1][#2]% @@ -616,7 +617,7 @@ \aliased\let\doiftypingfileelse\doifelsetypingfile \def\buff_verbatim_type_file_indeed#1#2% category name - {\edef\currenttyping{#1}% + {\cdef\currenttyping{#1}% \typingparameter\c!before\relax \startpacked[\v!blank] \buff_verbatim_setup_line_numbering @@ -661,11 +662,11 @@ \edef\p_numbering{\typingparameter\c!numbering}% \ifx\p_numbering\v!file \setuplinenumbering[\currenttyping][\c!method=\v!file]% - \settrue\verbatimnumberinglines + \verbatimnumberinglines\conditionaltrue \orelse\ifx\p_numbering\v!line - \settrue\verbatimnumberinglines + \verbatimnumberinglines\conditionaltrue \else - \setfalse\verbatimnumberinglines + \verbatimnumberinglines\conditionalfalse \fi \ifconditional\verbatimnumberinglines \enforced\let\beginofverbatimlines\beginofverbatimlinenumbering @@ -763,9 +764,14 @@ \permanent\protected\def\typedefinedbuffer[#1]% {\buff_verbatim_type_defined_buffer[\v!buffer][\thedefinedbuffer{#1}]}% +% \appendtoks +% \frozen\instance\protected\edefcsname\e!type\currentbuffer\endcsname +% {\buff_verbatim_type_defined_buffer[\v!buffer][\currentdefinedbuffer]}% +% \to \everydefinebuffer + \appendtoks \frozen\instance\protected\edefcsname\e!type\currentbuffer\endcsname - {\buff_verbatim_type_defined_buffer[\v!buffer][\currentdefinedbuffer]}% + {\buff_verbatim_type_defined_buffer[\currentbuffer][\currentdefinedbuffer]}% \to \everydefinebuffer \appendtoks % \e!buffer @@ -773,7 +779,7 @@ {\buff_verbatim_type_buffer_class{\currenttyping}}% \to \everydefinetyping -\tolerant\protected\def\buff_verbatim_type_buffer[#1]#*[#2]% +\tolerant\protected\def\buff_verbatim_type_buffer[#S#1]#*[#S#2]% {\ifarguments \buff_verbatim_type_buffer_indeed\currenttyping\empty% [] \or @@ -793,21 +799,27 @@ \protected\def\buff_verbatim_type_buffer_class#1% {\begingroup - \edef\currenttyping{#1}% + \cdef\currenttyping{#1}% \buff_verbatim_type_buffer} -\tolerant\protected\def\buff_verbatim_type_defined_buffer[#1]#*[#2]#*[#3]% category name settings +\tolerant\protected\def\buff_verbatim_type_defined_buffer[#1]#*[#2]#*[#S#3]% category name settings {\begingroup - \ifarguments\or\or\or - \setuptyping[#1][#3]% + \cdef\currenttyping{\namedbufferparameter{#1}\c!category}% + \ifempty\currenttyping + \let\currenttyping\v!buffer + \fi + \ifhastok={#3}% + \setupcurrenttyping[#3]% + \orelse\ifempty{#3}\else + \cdef\currenttyping{#3} \fi - \buff_verbatim_type_buffer_indeed{#1}{#2}% + \buff_verbatim_type_buffer_indeed{\currenttyping}{#2}% \useindentnextparameter\typingparameter \endgroup \dorechecknextindentation} \protected\def\buff_verbatim_type_buffer_indeed#1#2% category name - {\edef\currenttyping{#1}% + {\cdef\currenttyping{#1}% \typingparameter\c!before\relax \startpacked[\v!blank] \buff_verbatim_setup_line_numbering @@ -822,6 +834,7 @@ range {\typingparameter\c!range}% regime {\currentregime}% tab {\typingparameter\c!tab}% + par {\typingparameter\c!paragraph}% method {\p_buff_option}% escape {\typingparameter\c!escape}% nature {display}% @@ -832,7 +845,7 @@ \stoppacked \typingparameter\c!after\relax} -\permanent\tolerant\protected\def\typeinlinebuffer[#1]#,[#2]% +\permanent\tolerant\protected\def\typeinlinebuffer[#S#1]#,[#S#2]% {\dontleavehmode \begingroup \enforced\let\setupcurrenttyping\setupcurrenttype % a terrible hack but it saves code @@ -853,7 +866,7 @@ \endgroup} \protected\def\buff_verbatim_type_buffer_indeed_inline#1#2% category name - {\edef\currenttype{#1}% + {\cdef\currenttype{#1}% \buff_verbatim_initialize_type_one \dostarttaggedchained\t!verbatim\currenttype\??type \clf_typebuffer @@ -872,13 +885,12 @@ % the next one is obsolete (bad name and used nowhere) so if it stays % the name will change -\permanent\tolerant\protected\def\processbuffer[#1]#*[#2]% +\permanent\tolerant\protected\def\processbuffer[#S#1]#*[#S#2]% {\writestatus{nota bene}{\string\processbuffer\space is obsolete}% \begingroup \ifarguments \buff_verbatim_process_indeed\v!buffer\empty% [] \or - %\ifcondition\validassignment{#1}% \ifhastok={#1}% \setuptyping[\v!buffer][#1]% \buff_verbatim_process_indeed\v!buffer\empty% [settings] @@ -892,11 +904,12 @@ \endgroup} \def\buff_verbatim_process_indeed#1#2% - {\edef\currenttyping{#1}% + {\cdef\currenttyping{#1}% \clf_processbuffer name {#2}% strip {\typingparameter\c!strip}% tab {\typingparameter\c!tab}% + % par {\typingparameter\c!paragraph}% % method {\p_buff_option}% nature {direct}% \relax} @@ -914,7 +927,7 @@ \fi \noindent \buff_verbatim_set_line_margin - \the\everyline % maybe also after starttagged + \expand\everyline % maybe also after starttagged \strut % after starttagged, else break ! \dostarttagged\t!verbatimline\empty} @@ -986,7 +999,7 @@ % \installcommandhandler \??visualizer {visualizer} \??visualizer % % \appendtoks -% \frozen\instance\setuevalue{\currentvisualizer}{\buff_verbatim_visualize{\currentvisualizer}}% +% \frozen\instanceprotected\edefcsname\currentvisualizer\endcsname{\buff_verbatim_visualize{\currentvisualizer}}% % \to \everydefinevisualizer % % \protected\def\buff_verbatim_visualize#1% @@ -995,8 +1008,11 @@ % \usevisualizerstyleandcolor\c!style\c!color % \let\next} +% in footnotes no longer needed as we can preroll + \appendtoks - \enforced\def\type#1{\detokenize\expandafter{\csstring#1}}% or maybe detokenize + % \enforced\def\type#1{\detokenize\expandafter{\csstring#1}}% \protecteddetokenize + \enforced\def\type#1{\detokenize{#1}}% \protecteddetokenize fails \enforced\def\tex #1{\letterbackslash#1}% \to \everysimplifycommands diff --git a/Master/texmf-dist/tex/context/base/mkxl/catc-act.mkxl b/Master/texmf-dist/tex/context/base/mkxl/catc-act.mkxl index 4ccf22a7f68..7a5a1e95f07 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/catc-act.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/catc-act.mkxl @@ -29,17 +29,19 @@ %D not used and not really tested. \permanent\protected\def\installactivecharacter#1 % - {\ifchknum#1\or - \scratchcounter #1\edef\scratchmacro{\expandtoken\othercatcode\scratchcounter}% + {\ifchknumber#1\or + \scratchcounter\lastchknumber + \edef\scratchmacro{\expandtoken\othercatcode\scratchcounter}% \else - \scratchcounter`#1\let \scratchmacro #1% + \scratchcounter`#1% + \let\scratchmacro#1% \fi \normalexpanded{\startextendcatcodetable\ctxcatcodes\catcode\the\scratchcounter\activecatcode\stopextendcatcodetable}% \letcatcodecommand \ctxcatcodes \scratchcounter \scratchmacro \ifnum\currentcatcodetable=\ctxcatcodes \setcatcodetable\ctxcatcodes \fi} \permanent\protected\def\defineactivecharacter #1 #2% - {\ifchknum#1\or\letcharcode#1=#2\relax\else\letcharcode`#1=#2\relax\fi} + {\ifchknumber#1\or\letcharcode\lastchknumber=#2\relax\else\letcharcode`#1=#2\relax\fi} \permanent\protected\def\makecharacteractive #1 % {\catcode`#1\activecatcode} diff --git a/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl index 1bde9877447..ed13fc291c7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl @@ -32,6 +32,31 @@ \ifdefined\tpacatcodes \else \newcatcodetable \tpacatcodes \fi % verbatim: { } \ifdefined\tpbcatcodes \else \newcatcodetable \tpbcatcodes \fi % verbatim: < > \ifdefined\ctdcatcodes \else \newcatcodetable \ctdcatcodes \fi % context definitions +\ifdefined\hshcatcodes \else \newcatcodetable \hshcatcodes \fi + +\startcatcodetable \hshcatcodes + \catcode\tabasciicode \othercatcode + \catcode\endoflineasciicode \othercatcode + \catcode\formfeedasciicode \othercatcode + \catcode\spaceasciicode \othercatcode + \catcode\endoffileasciicode \ignorecatcode + \catcode\circumflexasciicode \othercatcode + \catcode\underscoreasciicode \othercatcode + \catcode\ampersandasciicode \othercatcode + \catcode\tildeasciicode \othercatcode + \catcode\hashasciicode \parametercatcode + \catcode\dollarasciicode \othercatcode + \catcode\commentasciicode \othercatcode + \catcode\lessthanasciicode \othercatcode + \catcode\morethanasciicode \othercatcode + \catcode\leftbraceasciicode \othercatcode + \catcode\rightbraceasciicode \othercatcode + \catcode\doublequoteasciicode \othercatcode + \catcode\singlequoteasciicode \othercatcode + \catcode\forwardslashasciicode\othercatcode + \catcode\backslashasciicode \othercatcode + \catcode\barasciicode \othercatcode +\stopcatcodetable \startcatcodetable \nilcatcodes \catcode\tabasciicode \spacecatcode diff --git a/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl index 4a473b47691..d2614abf61e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl @@ -21,7 +21,7 @@ %D Also, in \MKIV\ less active characters are used. % \begingroup -% \letcharcode\newlineasciicode\relax \xdef\outputnewlinechar{\Uchar\newlineasciicode} +% \letcharcode\newlineasciicode\relax \xdef\outputnewlinechar{\tocharacter\newlineasciicode} % \endgroup % \endlinechar = \endoflineasciicode % appended to input lines @@ -33,7 +33,7 @@ % {\begingroup % \enforced\letcharcode\newlineasciicode\relax % \newlinechar\newlineasciicode -% \xdef\outputnewlinechar{\Uchar\newlineasciicode}% +% \xdef\outputnewlinechar{\tocharacter\newlineasciicode}% % \endgroup} %D We predefine some prefixes ahead of syst-aux and mult-sys. We reserve 8 slots for @@ -55,7 +55,7 @@ \permanent\protected\def\newcatcodetable#1% we could move the cctdefcounter to lua {\global\advanceby\c_syst_catcodes_n\plusone - \gdefcsname\??catcodetablen\number\c_syst_catcodes_n\endcsname{\string#1}% logging + \gdefcsname\??catcodetablen\the\c_syst_catcodes_n\endcsname{\string#1}% logging \immutable\integerdef#1\c_syst_catcodes_n \ctxlua{catcodes.register("\expandafter\gobbleoneargument\string#1",\number#1)}} @@ -71,7 +71,7 @@ \permanent\protected\def\startcatcodetable#1#2\stopcatcodetable {\begingroup \catcodetable\inicatcodes - \the\everysetdefaultcatcodes + \expand\everysetdefaultcatcodes #2% \savecatcodetable#1\relax \endgroup} @@ -81,11 +81,21 @@ \permanent\protected\def\startextendcatcodetable#1#2\stopextendcatcodetable {\begingroup \catcodetable#1\relax - \globaldefs\plusone + \globaldefs\plusone % a bit hackish #2% \globaldefs\zerocount \endgroup} +% doesn't work these tables are global anyway +% +% \permanent\protected\def\startextendcatcodetable#1#2\stopextendcatcodetable +% {\begingroup +% \c_syst_catcodes_n\catcodetable +% \catcodetable#1\relax +% #2% +% \catcodetable\c_syst_catcodes_n +% \endgroup} + \permanent\let\stopextendcatcodetable\relax \permanent\protected\def\permitcircumflexescape % to be used grouped @@ -95,15 +105,6 @@ \newconstant\defaultcatcodetable -% == -% -% \protected\def\startextendcatcodetable#1#2\stopextendcatcodetable -% {\bgroup -% \scratchcounter\the\catcodetable -% \catcodetable #1 #2 -% \catcodetable\scratchcounter -% \egroup} - %D The next command can be defined in a cleaner way in the MkIV way but we want %D to have a fast one with a minimal chance for interference. Do we still need %D this complex mechanism? Probably not. Future versions of \MKIV\ might only use @@ -112,7 +113,7 @@ % %D Once a catcode is assigned, the next assignments will happen faster. However, % %D redefinitions probably happen seldom so it's sort of overkill. We also need to -% %D take care of the initial (shared between catcode regfimes) binding. +% %D take care of the initial (shared between catcode regimes) binding. % % \permanent\protected\def\letcatcodecommand{\afterassignment\syst_catcodes_let_a\c_syst_catcodes_a} % \permanent\protected\def\defcatcodecommand{\afterassignment\syst_catcodes_def_a\c_syst_catcodes_a} % obsolete @@ -125,45 +126,45 @@ % % The two step definition is used because we need to fetch the third argument. % % \def\syst_catcodes_let_b % each time -% {\ifcsname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname +% {\ifcsname\??catcodelet\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname % \expandafter\lastnamedcs % \else % \expandafter\syst_catcodes_let_c % \fi} % % \def\syst_catcodes_def_b % each time -% {\ifcsname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname +% {\ifcsname\??catcodedef\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname % \expandafter\lastnamedcs % \else % \expandafter\syst_catcodes_def_c % \fi} % % \def\syst_catcodes_ued_b % each time -% {\ifcsname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname +% {\ifcsname\??catcodeued\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname % \expandafter\lastnamedcs % \else % \expandafter\syst_catcodes_ued_c % \fi} % % \def\syst_catcodes_let_c % only first time -% {\frozen\enforced\gdefcsname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname\expandafter -% {\expandafter\enforced\letcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}% +% {\frozen\enforced\gdefcsname\??catcodelet\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\expandafter\endcsname\expandafter +% {\expandafter\enforced\letcsname\??catcodeget\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname}% % \syst_catcodes_reinstate_unexpanded -% \csname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname} +% \csname\??catcodelet\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname} % % \def\syst_catcodes_def_c % only first time (we could use \normalexpanded here) -% {\frozen\enforced\gdefcsname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname +% {\frozen\enforced\gdefcsname\??catcodedef\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\expandafter\endcsname % \expandafter##\expandafter1\expandafter -% {\expandafter\frozen\expandafter\enforced\defcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}% +% {\expandafter\frozen\expandafter\enforced\defcsname\??catcodeget\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname{##1}}% % \syst_catcodes_reinstate_normal -% \csname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname} +% \csname\??catcodedef\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname} % % \def\syst_catcodes_ued_c % only first time -% {\frozen\enforced\gdefcsname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname +% {\frozen\enforced\gdefcsname\??catcodeued\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\expandafter\endcsname % \expandafter##\expandafter1\expandafter -% {\expandafter\frozen\expandafter\enforced\expandafter\protected\defcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}% +% {\expandafter\frozen\expandafter\enforced\expandafter\protected\defcsname\??catcodeget\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname{##1}}% % \syst_catcodes_reinstate_unexpanded -% \csname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname} +% \csname\??catcodeued\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname} % % %D We can simplify this a bit (not that critical): % @@ -171,8 +172,8 @@ % {\afterassignment\syst_catcodes_let_c\let\m_syst_catcodes_temp} % % \def\syst_catcodes_let_c -% {\enforced\letcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname\m_syst_catcodes_temp -% \protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}% +% {\enforced\letcsname\??catcodeget\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname\m_syst_catcodes_temp +% \protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\the\c_syst_catcodes_b}}% % \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp} % % \def\syst_catcodes_let_c @@ -181,9 +182,9 @@ % % not that much gain: % % \def\syst_catcodes_let_c % only first time -% {\expandafter\integerdef\csname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname\c_syst_catcodes_b -% \letcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname\m_syst_catcodes_temp -% \protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand\csname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}% +% {\expandafter\integerdef\csname\??catcodelet\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname\c_syst_catcodes_b +% \letcsname\??catcodeget\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname\m_syst_catcodes_temp +% \protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand\csname\??catcodelet\the\c_syst_catcodes_a:\the\c_syst_catcodes_b\endcsname}% % \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp} %D This can be used when a direct definition has been done and the selector has been @@ -194,11 +195,11 @@ % \let\m_syst_catcodes_temp\relax % % \def\syst_catcodes_reinstate_normal -% {\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}% +% {\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\the\c_syst_catcodes_b}}% % \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp} % % \def\syst_catcodes_reinstate_unexpanded -% {\protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}% +% {\protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\the\c_syst_catcodes_b}}% % \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp} % % \permanent\def\catcodecommand#1% @@ -228,12 +229,12 @@ \permanent\protected\def\pushactivechar#1% {\expandafter\let\expandafter\m_active\csname\csactive#1\endcsname - %\expandafter\let\expandafter\m_active\csname\Uchar"FFFF\Uchar\expandafter`\string#1\endcsname + %\expandafter\let\expandafter\m_active\csname\tocharacter"FFFF\tocharacter\expandafter`\string#1\endcsname \pushmacro\m_active} \permanent\protected\def\popactivechar#1% {\popmacro\m_active - %\letcsname\Uchar"FFFF\Uchar\expandafter`\string#1\endcsname\m_active + %\letcsname\tocharacter"FFFF\tocharacter\expandafter`\string#1\endcsname\m_active \letcsname\csactive#1\endcsname\m_active} \mutable\integerdef\c_active_char_code\zerocount @@ -242,14 +243,14 @@ \permanent\protected\def\popactivecharcode {\afterassignment\syst_active_pop \integerdef\c_active_char_code} \permanent\protected\def\syst_active_push - {\expandafter\let\expandafter\m_active\csname\csactive\Uchar\c_active_char_code\endcsname - %\expandafter\let\expandafter\m_active\csname\Uchar"FFFF\Uchar\c_active_char_code\endcsname + {\expandafter\let\expandafter\m_active\csname\csactive\tocharacter\c_active_char_code\endcsname + %\expandafter\let\expandafter\m_active\csname\tocharacter"FFFF\tocharacter\c_active_char_code\endcsname \pushmacro\m_active} \permanent\protected\def\syst_active_pop {\popmacro\m_active - %\letcsname\Uchar"FFFF\Uchar\c_active_char_code\endcsname\m_active - \letcsname\csactive\Uchar\c_active_char_code\endcsname\m_active} + %\letcsname\tocharacter"FFFF\tocharacter\c_active_char_code\endcsname\m_active + \letcsname\csactive\tocharacter\c_active_char_code\endcsname\m_active} %D \macros %D {restorecatcodes,pushcatcodetable,popcatcodetable} @@ -269,25 +270,25 @@ \permanent\protected\def\pushcatcodetable {\advanceby\c_syst_catcodes_level\plusone \syst_catcodes_trace_push - \expandafter\integerdef\csname\??catcodetablet\number\c_syst_catcodes_level\endcsname\currentcatcodetable} + \expandafter\integerdef\csname\??catcodetablet\the\c_syst_catcodes_level\endcsname\currentcatcodetable} \permanent\protected\def\popcatcodetable {\ifcase\c_syst_catcodes_level \syst_catcodes_trace_nesting_error \else - \catcodetable\csname\??catcodetablet\number\c_syst_catcodes_level\endcsname + \catcodetable\csname\??catcodetablet\the\c_syst_catcodes_level\endcsname \syst_catcodes_trace_pop \advanceby\c_syst_catcodes_level\minusone \fi} \protected\def\syst_catcodes_trace_nesting_error {\immediate\write\statuswrite{}% - \immediate\write\statuswrite{Fatal error: catcode push/pop mismatch. Fix this! (restore level: \number\c_syst_catcodes_level)}\wait\end + \immediate\write\statuswrite{Fatal error: catcode push/pop mismatch. Fix this! (restore level: \the\c_syst_catcodes_level)}\wait\end \immediate\write\statuswrite{}} \permanent\protected\def\restorecatcodes % takes previous level {\ifnum\c_syst_catcodes_level>\plusone - \catcodetable\csname\??catcodetablet\number\numexpr\c_syst_catcodes_level-1\relax\endcsname + \catcodetable\csname\??catcodetablet\the\numexpr\c_syst_catcodes_level-1\relax\endcsname \fi} \permanent\protected\def\setcatcodetable#1% @@ -301,15 +302,15 @@ %D \stoptyping \permanent\protected\def\tracecatcodetables - {\def\syst_catcodes_trace_set {\syst_catcodes_trace{set \catcodetablename\space at \number\c_syst_catcodes_level}}% - \def\syst_catcodes_trace_push{\syst_catcodes_trace{push \catcodetablename\space from \syst_catcodes_prev\space at \number\c_syst_catcodes_level}}% - \def\syst_catcodes_trace_pop {\syst_catcodes_trace{pop \catcodetablename\space to \syst_catcodes_prev\space at \number\c_syst_catcodes_level}}} + {\def\syst_catcodes_trace_set {\syst_catcodes_trace{set \catcodetablename\space at \the\c_syst_catcodes_level}}% + \def\syst_catcodes_trace_push{\syst_catcodes_trace{push \catcodetablename\space from \syst_catcodes_prev\space at \the\c_syst_catcodes_level}}% + \def\syst_catcodes_trace_pop {\syst_catcodes_trace{pop \catcodetablename\space to \syst_catcodes_prev\space at \the\c_syst_catcodes_level}}} \def\syst_catcodes_trace#1{\immediate\write\statuswrite{[#1]}} \def\syst_catcodes_prev {\ifnum\numexpr\c_syst_catcodes_level-1\relax>\zerocount - \csname\??catcodetablen\number\csname\??catcodetablet\number\numexpr\c_syst_catcodes_level-1\relax\endcsname\endcsname + \csname\??catcodetablen\number\csname\??catcodetablet\the\numexpr\c_syst_catcodes_level-1\relax\endcsname\endcsname \else -% \fi} diff --git a/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl index baa5426cc03..5d9f32b6550 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl @@ -41,14 +41,14 @@ % % impossible in math mode so there always fallback (till we have gyre): % -% use \normalUchar when possible .. the next one is nice for documents and it also accepts +% use \tocharacter when possible .. the next one is nice for documents and it also accepts % 0x prefixed numbers \permanent\def\utfchar #1{\clf_utfchar {#1}} % todo: define public at lua end \permanent\def\safechar#1{\clf_safechar{#1}} % todo: define public at lua end -\permanent\protected\def\Ux #1{\Uchar\numexpr"#1\relax} % used in xml (sometimes overloaded) -\permanent \def\eUx#1{\Uchar\numexpr"#1\relax} % used in xml (sometimes overloaded) +\permanent\protected\def\Ux #1{\tocharacter\numexpr"#1\relax} % used in xml (sometimes overloaded) +\permanent \def\eUx#1{\tocharacter\numexpr"#1\relax} % used in xml (sometimes overloaded) \permanent\def\expandUx{\enforced\let\Ux\eUx} @@ -125,4 +125,10 @@ \permanent\protected\def\overloaduppercase{\clf_overloaduppercase} % todo: define public at lua end \permanent\protected\def\overloadlowercase{\clf_overloadlowercase} % todo: define public at lua end +%D For old times sake (for now), for Thomas Schmitz (\type {\greekdasiavaria} etc): + +\permanent\protected\def\addcharacternames{\ctxlua{characters.addcharacternames()}} % we could be granular e.g. 'greek' + +% \greekdasiavaria + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt b/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt index 0ac297d599b..50852185bb2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt @@ -68,12 +68,14 @@ local private = { utffilters.private = private -for ch in gmatch(special,".") do - local cb - if type(ch) == "number" then - cb, ch = ch, utfchar(ch) +for chr in gmatch(special,".") do + local cb, ch + if type(chr) == "number" then + ch = utfchar(chr) + cb = chr else - cb = utfbyte(ch) + ch = chr + cb = utfbyte(chr) end if cb < 256 then escapes[ch] = "\\" .. ch @@ -525,11 +527,12 @@ local texsetsfcode = tex.setsfcode local texsetcatcode = tex.setcatcode local contextsprint = context.sprint -local ctxcatcodes = catcodes.numbers.ctxcatcodes local texsetmacro = tokens.setters.macro local texsetchar = tokens.setters.char +local ctxcatcodes = catcodes.numbers.ctxcatcodes + -- function texcharacters.defineaccents() -- local ctx_dodefineaccentcommand = context.dodefineaccent -- local ctx_dodefineaccent = context.dodefineaccent @@ -773,8 +776,39 @@ if not csletters then storage.register("characters/csletters", csletters, "characters.csletters") end + -- These can go now: + -- + -- .acute .apostrophe .bar .breve .breveacute .brevedotbelow .brevegrave .brevehook + -- .brevetilde .caron .cedilla .circumflex .circumflexacute .circumflexdotbelow + -- .circumflexgrave .circumflexhook .circumflextilde .commaaccent .curl .diaeresis + -- .diaeresisacute .diaeresiscaron .diaeresisgrave .diaeresismacron .dotaccent + -- .dotaccentmacron .dotbelow .dotmiddle .doublegrave .grave .horn .hornacute + -- .horndotbelow .horngrave .hornhook .horntilde .hungarumlaut .invertedbreve + -- .macron .ogonek .ogonekmacron .ring .ringacute .sharp .stroke .strokeacute .tail + -- .tilde .tildemacron + + local pattern = P("greek") + P("arabic") + P("hebrew") + P("cyrillic") + P("roman") + + -- Only keep these: + -- + -- copyright dotlessI dotlessi dotlessJ dotlessj emdash endash exclamdown figuredash + -- guilsingleleft guilsingleright periodcentered perthousand questiondown quotedbl + -- quotedblbase quotedblleft quotedblright quoteleft quoteright quotesingle + -- quotesinglebase registered rightguillemot sectionmark textacute textampersand + -- textAngstrom textasciicircum textasciitilde textat textbackslash textbar + -- textbottomcomma textbottomdot textbraceleft textbraceright textbreve + -- textbrokenbar textbullet textcaron textcedilla textcelsius textcent textcircledP + -- textcircumflex textcomma textcontrolspace textcurrency textdag textddag + -- textdegree textdiaeresis textdiv textdollar textdong textdotaccent textellipsis + -- texteuro textfraction textgrave texthash texthorizontalbar texthungarumlaut + -- texthyphen textkelvin textlognot textmacron textmho textminus textmp textmu + -- textmultiply textnumero textogonek textohm textounce textpercent textperiod + -- textpm textring textslash textsterling texttilde textunderscore textyen + local function setname(category,chr,u,contextname) - if is_character[category] then + if lpegmatch(pattern,contextname) then + -- print("ignored",contextname) + elseif is_character[category] then if chr.unicodeslot < 128 then if is_letter[category] then texsetmacro(contextname,utfchar(u),"immutable") @@ -789,7 +823,7 @@ if not csletters then end end - function characters.setcharacternames(ctt) + function characters.setcharacternames() for u, chr in next, data do -- will move up local contextname = chr.contextname local contextspec = chr.contextspec @@ -809,7 +843,24 @@ if not csletters then end else + mark(csletters) + + local pattern = P("greek") + P("arabic") + P("hebrew") + P("cyrillic") + P("roman") + + function characters.addcharacternames() -- we could be granular e.g. 'greek' + for u, chr in next, data do -- will move up + local contextname = chr.contextname + if contextname and lpegmatch(pattern,contextname) then + local category = chr.category + if is_character[category] or is_command[category] then + texsetmacro(contextname,utfchar(u),"immutable") + end + end + end + function characters.addcharacternames() end + end + end lpegpatterns.csletter = utfchartabletopattern(csletters) diff --git a/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl b/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl index a4a974de1da..f6be7240aa1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl @@ -89,7 +89,7 @@ \permanent\protected\tolerant\overloaded\def\definechemical[#1]#:#2% is global (so we don't use the commandhandler) {\startnointerference - \edef\currentdefinedchemical{#1}% + \cdef\currentdefinedchemical{#1}% \enforced\let\chemical\chem_chemical_nested \clf_undefinechemical{#1}% #2% flush @@ -126,7 +126,6 @@ \newtoks \everychemical \newtoks \everystructurechemical -%newconditional\indisplaychemical \newtoks \t_chem_every_box \newbox \b_chem_result @@ -135,28 +134,27 @@ \newdimension \d_chem_height \newdimension \d_chem_depth -\permanent\tolerant\protected\def\startchemical[#1]#*[#2]% +\permanent\tolerant\protected\def\startchemical[#S#1]#*[#S#2]% {\ifmmode\vcenter\else\vbox\fi % vpack ? \bgroup \synchronizestrut{\chemicalparameter\c!strut}% \dontcomplain - %\settrue\indisplaychemical \forgetall \ifparameter#2\or \ifhastok={#1}% \setupcurrentchemical[#1]% same as \currentchemical \else - \edef\currentchemical{#1}% + \cdef\currentchemical{#1}% \setupcurrentchemical[#2]% \fi \orelse\ifparameter#1\or \ifhastok={#1}% \setupcurrentchemical[#1]% same as \currentchemical \else - \edef\currentchemical{#1}% + \cdef\currentchemical{#1}% \fi \fi - \the\everystructurechemical + \expand\everystructurechemical \setbox\b_chem_result\hpack\bgroup \clf_startchemical width {\chemicalparameter\c!width}% @@ -170,10 +168,10 @@ symalign {\chemicalparameter\c!symalign}% axis {\chemicalparameter\c!axis}% was \MPcolor{...} framecolor {\chemicalparameter\c!framecolor}% - rulethickness {\number\dimexpr\chemicalparameter\c!rulethickness}% - offset {\number\dimexpr\chemicalparameter\c!offset}% - unit {\number\dimexpr\chemicalparameter\c!unit}% - factor {\number\chemicalparameter\c!factor}% + rulethickness \dimexpr\chemicalparameter\c!rulethickness\relax + offset \dimexpr\chemicalparameter\c!offset\relax + unit \dimexpr\chemicalparameter\c!unit\relax + factor \numexpr\chemicalparameter\c!factor\relax \relax \startnointerference} @@ -184,8 +182,12 @@ \d_chem_width \wd\b_chem_result \d_chem_height\ht\b_chem_result \d_chem_depth \dp\b_chem_result - \the\t_chem_every_box - \doifelsenothing{\chemicalparameter\c!frame}\chem_framed_nop\chem_framed_yes + \expand\t_chem_every_box + \ifempty{\chemicalparameter\c!frame}% + \chem_framed_nop + \else + \chem_framed_yes + \fi \egroup} \protected\def\chem_framed_yes @@ -208,7 +210,7 @@ \enforced\let\chemical\structurechemical \to\everystructurechemical -\permanent\tolerant\protected\def\structurechemical[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\structurechemical[#1]#*[#2]#*[#S#3]% {\ifparameter#3\or \expandafter\strc_chem_indeed_three \else @@ -225,7 +227,7 @@ \relax \ignorespaces} -\def\strc_chem_indeed_two[#1][#2]% why no [#3] here +\def\strc_chem_indeed_two[#1][#S#2]% why no [#3] here {\clf_chemicalcomponent {#1}% {\detokenize{#2}}% @@ -244,17 +246,18 @@ % kind of compatible, but text sizes instead of math sizes (i.e. tx is larger than scriptsize) \appendtoks - \edef\m_bodyfont{\chemicalparameter\c!bodyfont}% - \ifempty\m_bodyfont - \switchtobodyfont[\m_bodyfont]% - \fi - \begincsname\??chemicalsize\chemicalparameter\c!size\endcsname + \usebodyfontparameter\chemicalparameter + % \edef\m_bodyfont{\chemicalparameter\c!bodyfont}% + % \ifempty\m_bodyfont\else + % \switchtobodyfont[\m_bodyfont]% + % \fi + \begincsname\??chemicalsize\chemicalparameter\c!size\endcsname % \to \everystructurechemical \to \everychemical -\permanent\protected\def\chemicaltoptext#1{\global\settrue\c_chem_some_text\gdef\m_chem_top_text{#1}\ignorespaces} -\permanent\protected\def\chemicalbottext#1{\global\settrue\c_chem_some_text\gdef\m_chem_bot_text{#1}\ignorespaces} -\permanent\protected\def\chemicalmidtext#1{\global\settrue\c_chem_some_text\gdef\m_chem_mid_text{#1}\ignorespaces} +\permanent\protected\def\chemicaltoptext#1{\global\c_chem_some_text\conditionaltrue\gdef\m_chem_top_text{#1}\ignorespaces} +\permanent\protected\def\chemicalbottext#1{\global\c_chem_some_text\conditionaltrue\gdef\m_chem_bot_text{#1}\ignorespaces} +\permanent\protected\def\chemicalmidtext#1{\global\c_chem_some_text\conditionaltrue\gdef\m_chem_mid_text{#1}\ignorespaces} \mutable\lettonothing\toptext \mutable\lettonothing\bottext @@ -264,7 +267,7 @@ \let\toptext\chemicaltoptext \glettonothing\m_chem_top_text \let\bottext\chemicalbottext \glettonothing\m_chem_bot_text \let\midtext\chemicalmidtext \glettonothing\m_chem_mid_text - \global\setfalse\c_chem_some_text + \global\c_chem_some_text\conditionalfalse \to \everystructurechemical \def\chem_add_texts @@ -273,11 +276,11 @@ \setbox\scratchboxthree\hpack to \d_chem_width{\strut\hss\hbox{\strut\m_chem_bot_text}\hss}% \setbox\b_chem_result\hpack \bgroup \box\b_chem_result - \hskip-\d_chem_width + \kern-\d_chem_width \raise\d_chem_height\hpack{\lower\ht\scratchboxtwo\box\scratchboxtwo}% - \hskip-\d_chem_width + \kern-\d_chem_width \lower.5\dimexpr\ht\scratchboxone-\dp\scratchboxone\relax\box\scratchboxone - \hskip-\d_chem_width + \kern-\d_chem_width \lower\d_chem_depth\hpack{\raise\dp\scratchboxthree\box\scratchboxthree}% \hss \egroup} % text on top of chemicals @@ -377,9 +380,9 @@ \permanent\protected\def\chemicaltopright #1{\chemicalright{\chemicallefttop {#1}{}}} \permanent\protected\def\chemicalbottomright#1{\chemicalright{\chemicalleftbottom {#1}{}}} -% \protected\def\chemicalcentered #1{\hbox to \fontcharwd\font`C{\setstrut\strut\hss#1\hss}} -% \protected\def\chemicalleftcentered #1{\hbox to \fontcharwd\font`C{\setstrut\strut #1\hss}} -% \protected\def\chemicalrightcentered#1{\hbox to \fontcharwd\font`C{\setstrut\strut\hss#1}} +% \protected\def\chemicalcentered #1{\hbox to \scaledfontcharwd\font`C{\setstrut\strut\hss#1\hss}} +% \protected\def\chemicalleftcentered #1{\hbox to \scaledfontcharwd\font`C{\setstrut\strut #1\hss}} +% \protected\def\chemicalrightcentered#1{\hbox to \scaledfontcharwd\font`C{\setstrut\strut\hss#1}} % \let\chemicalsmashedmiddle\chemicalcentered % \let\chemicalsmashedleft \chemicalleftcentered @@ -398,7 +401,7 @@ {\dontleavehmode \begingroup \usechemicalstyleandcolor\c!style\c!color - \chem_box_visual_yes to \fontcharwd\font`C\bgroup + \chem_box_visual_yes to \scaledfontcharwd\font`C\bgroup \setstrut\strut #1\molecule{#3}#2% \egroup @@ -409,7 +412,7 @@ \begingroup \scratchcounter\normalmathstyle \usechemicalstyleandcolor\c!style\c!color - \chem_box_visual_yes to \fontcharwd\font`C\bgroup + \chem_box_visual_yes to \scaledfontcharwd\font`C\bgroup \setstrut\strut #1\mathematics{\tf\triggermathstyle\scratchcounter\molecule{#3}}#2% \egroup @@ -426,6 +429,8 @@ \permanent\protected\def\chemicaloxidation#1#2#3% {\chemicaltop{\txx\ifcase#2\relax0\else#1\convertnumber{I}{#2}\fi}{#3}} +% todo: modernize + \permanent\protected\def\chemicaloxidationplus {\dotriplegroupempty\chemicaloxidation{\textplus }} % {} needed! \permanent\protected\def\chemicaloxidationminus{\dotriplegroupempty\chemicaloxidation{\textminus}} % {} needed! \permanent\protected\def\chemicalforeveropen {\dotriplegroupempty\chemicalleft {$\big[$}} % {} needed! @@ -453,7 +458,11 @@ \permanent\let\R\relax \appendtoks - \enforced\let |\chemicalbar % \SR{N|NH} + \amcode\barasciicode\zerocount + \enforced\let|\chemicalbar % \SR{N|NH} +\to \everychemical + +\appendtoks \enforced\let \+\chemicaloxidationplus \enforced\let \-\chemicaloxidationminus \enforced\let \[\chemicalforeveropen @@ -488,7 +497,7 @@ % Should these also be defined in lower case, so as to be case independent? \appendtoks - \the\everychemical + \expand\everychemical \to \everystructurechemical % inline @@ -503,16 +512,8 @@ \permanent\protected\def\indisplaychemical {\mathstylecommand\displaychemical\inlinechemical\inlinechemical} -% \permanent\protected\def\inlinechemical#1% -% {\dontleavehmode -% \begingroup -% \scratchcounter\normalmathstyle -% \usechemicalstyleandcolor\c!style\c!color -% \hbox{\mathematics{\tf\triggermathstyle\scratchcounter\clf_inlinechemical{#1}}}% -% \endgroup} - \permanent\tolerant\protected\def\displaychemical#=#=#=% - {\the\everychemical + {\expand\everychemical \everychemical\emptytoks \quad \vcenter\bgroup @@ -529,12 +530,37 @@ \egroup \quad} +% \permanent\protected\def\inlinechemical#1% +% {\dontleavehmode +% \hbox{\usechemicalstyleandcolor\c!style\c!color\clf_inlinechemical{#1}}} + \permanent\protected\def\inlinechemical#1% - {\dontleavehmode - \hbox{\usechemicalstyleandcolor\c!style\c!color\clf_inlinechemical{#1}}} + {\dontleavehmode\begingroup + %\hbox % will become option + \usechemicalstyleandcolor\c!style\c!color\clf_inlinechemical{#1}% + \endgroup} + +\aliased\let\ic\inlinechemical \permanent\protected\def\chemicalbondrule - {\hpack{\vrule\s!height.75\exheight\s!depth-\dimexpr.75\exheight-\linewidth\relax\s!width\emwidth\relax}} + {\vrule\s!height.75\exheight\s!depth-\dimexpr.75\exheight-\linewidth\relax\s!width\emwidth\relax} + +\permanent\protected\def\chemicalsinglebondrule + {\hpack{\chemicalbondrule}} + +\permanent\protected\def\chemicaldoublebondrule + {\hpack + {\lower.5\exheight\chemicalsinglebondrule + \kern-\emwidth + \raise.5\exheight\chemicalsinglebondrule}} + +\permanent\protected\def\chemicaltriplebondrule + {\hpack + {\chemicalsinglebondrule + \kern-\emwidth + \lower.5\exheight\chemicalsinglebondrule + \kern-\emwidth + \raise.5\exheight\chemicalsinglebondrule}} \definechemicalsymbol[i:space] [\enspace\quad\enspace] \definechemicalsymbol[i:plus] [\enspace\mathematics{+}\enspace] @@ -543,9 +569,9 @@ \definechemicalsymbol[i:gives] [\enspace\mathematics{\xrightarrow{}{}}\enspace] \definechemicalsymbol[i:equilibrium] [\enspace\mathematics{\xrightoverleftarrow{}{}}\enspace] \definechemicalsymbol[i:mesomeric] [\enspace\mathematics{\xleftrightarrow{}{}}\enspace] -\definechemicalsymbol[i:single] [\chemicalbondrule] -\definechemicalsymbol[i:double] [\hpack{\lower.5ex\chemicalbondrule\hskip-1em\raise.5ex\chemicalbondrule}] -\definechemicalsymbol[i:triple] [\hpack{\chemicalbondrule\hskip-1em\lower.5ex\chemicalbondrule\hskip-1em\raise.5ex\chemicalbondrule}] +\definechemicalsymbol[i:single] [\chemicalsinglebondrule] +\definechemicalsymbol[i:double] [\chemicaldoublebondrule] +\definechemicalsymbol[i:triple] [\chemicaltriplebondrule] \permanent\protected\def\chemicalsinglebond {\chemicalsymbol[i:single]} \permanent\protected\def\chemicaldoublebond {\chemicalsymbol[i:double]} @@ -557,7 +583,18 @@ \permanent\protected\def\chemicalminus {\chemicalsymbol[i:minus]} \permanent\protected\def\chemicalequals {\chemicalsymbol[i:equals]} \permanent\protected\def\chemicalspace {\chemicalsymbol[i:space]} -\permanent\protected\def\chemicalinline #1{#1} +% \permanent\protected\def\chemicalinline #1{#1} +% \permanent\protected\def\chemicalspecial #1{#1} + +\permanent\protected\def\chemicalinline#1% + {#1} + +\permanent\protected\def\chemicalspecial#1% + {\penalty\plustenthousand + \hskip.1\emwidth\s!plus.1\emwidth\relax + #1% + \penalty\plusfivehundred + \hskip.1\emwidth\s!plus.1\emwidth\relax} % display @@ -574,48 +611,45 @@ {\mathortext\vcenter\vbox\bgroup \forgetall \inchemicalformulatrue - \the\everychemical + \expand\everychemical \everychemical\emptytoks \t_chem_top\emptytoks % not needed \t_chem_mid\emptytoks % not needed \t_chem_bot\emptytoks % not needed \enforced\let\chemical\formulachemical - \setfalse\c_chem_has_top - \setfalse\c_chem_has_bot} + \c_chem_has_top\conditionalfalse + \c_chem_has_bot\conditionalfalse} \permanent\protected\def\stopchemicalformula {\tabskip\emwidth\relax - \nointerlineskip + \ifvmode\nointerlineskip\fi \ifconditional\c_chem_has_top \ifconditional\c_chem_has_bot - \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\the\t_chem_top\cr\the\t_chem_mid\cr\the\t_chem_bot\cr}% + \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\expand\t_chem_top\cr\expand\t_chem_mid\cr\expand\t_chem_bot\cr}% \else - \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\the\t_chem_top\cr\the\t_chem_mid\cr}% + \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\expand\t_chem_top\cr\expand\t_chem_mid\cr}% \fi \else \ifconditional\c_chem_has_bot - \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\the\t_chem_mid\cr\the\t_chem_bot\cr}% + \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\expand\t_chem_mid\cr\expand\t_chem_bot\cr}% \else - \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\the\t_chem_mid\cr}% + \halign{\aligntab\hss\usechemicalstyleandcolor\c!style\c!color\alignmark\alignmark\hss\cr\expand\t_chem_mid\cr}% \fi \fi \egroup} -% for the moment we have a special set +% for the moment we have a special set .. kind of old \definechemicalsymbol[d:space] [\enspace\quad\enspace] \definechemicalsymbol[d:plus] [\enspace+\enspace] \definechemicalsymbol[d:minus] [\enspace-\enspace] \definechemicalsymbol[d:equals] [\enspace=\enspace] -%definechemicalsymbol[d:gives] [\rightarrowfill] % \chem_arrow_construct\xrightarrow -%definechemicalsymbol[d:equilibrium] [\rightoverleftarrowfill] % \chem_arrow_construct\xrightoverleftarrow -%definechemicalsymbol[d:mesomeric] [\leftarrowfill] % \chem_arrow_construct\xleftrightarrow -\definechemicalsymbol[d:gives] [\crightarrow] -\definechemicalsymbol[d:equilibrium] [\cleftarrow] -\definechemicalsymbol[d:mesomeric] [\crightoverleftarrow] -\definechemicalsymbol[d:single] [\chemicalbondrule] -\definechemicalsymbol[d:double] [\hpack{\lower.5\exheight\chemicalbondrule\hskip-\emwidth\raise.5\exheight\chemicalbondrule}] -\definechemicalsymbol[d:triple] [\hpack{\chemicalbondrule\hskip-\emwidth\lower.5\exheight\chemicalbondrule\hskip-\emwidth\raise.5\exheight\chemicalbondrule}] +\definechemicalsymbol[d:gives] [\cgives] +\definechemicalsymbol[d:equilibrium] [\cequilibrium] +\definechemicalsymbol[d:mesomeric] [\cmesomeric] +\definechemicalsymbol[d:single] [\chemicalsinglebondrule] +\definechemicalsymbol[d:double] [\chemicaldoublebondrule] +\definechemicalsymbol[d:triple] [\chemicaltriplebondrule] \definechemicalsymbol[d:opencomplex] [\mathematics{\Bigg[}] % not yet ok \definechemicalsymbol[d:closecomplex][\mathematics{\Bigg]}] % not yet ok @@ -639,10 +673,10 @@ \chem_formula_bot_nop \or \chem_formula_top_nop - \doifelsenothing{#2}\chem_formula_bot_nop{\chem_formula_bot_yes{#2}}% + \ifempty{#2}\chem_formula_bot_nop\else\chem_formula_bot_yes{#2}\fi \or - \doifelsenothing{#2}\chem_formula_top_nop{\chem_formula_top_yes{#2}}% - \doifelsenothing{#3}\chem_formula_bot_nop{\chem_formula_bot_yes{#3}}% + \ifempty{#2}\chem_formula_top_nop\else\chem_formula_top_yes{#2}\fi + \ifempty{#3}\chem_formula_bot_nop\else\chem_formula_bot_yes{#3}\fi \fi \ifcsname\??chemicalsymbol d:\detokenize{#1}\endcsname \toksapp\t_chem_mid{\chemicalsymbol[d:#1]\aligntab}% @@ -655,8 +689,8 @@ \def\chem_formula_top_nop {\toksapp\t_chem_top{\aligntab}} \def\chem_formula_bot_nop {\toksapp\t_chem_bot{\aligntab}} -\def\chem_formula_top_yes#1{\toksapp\t_chem_top{\chem_formula_top_indeed{#1}\aligntab}\settrue\c_chem_has_top} -\def\chem_formula_bot_yes#1{\toksapp\t_chem_bot{\chem_formula_bot_indeed{#1}\aligntab}\settrue\c_chem_has_bot} +\def\chem_formula_top_yes#1{\toksapp\t_chem_top{\chem_formula_top_indeed{#1}\aligntab}\c_chem_has_top\conditionaltrue} +\def\chem_formula_bot_yes#1{\toksapp\t_chem_bot{\chem_formula_bot_indeed{#1}\aligntab}\c_chem_has_bot\conditionaltrue} \def\chem_formula_top_indeed#1{\strut#1} \def\chem_formula_bot_indeed#1{\strut#1} @@ -736,8 +770,10 @@ %D Compatibility: -\definechemical[+R] {\chemical[RR]} -\definechemical[-R] {\chemical[LR]} +% Now we have + - : shortening and L R : rotating + +% \definechemical[+R] {\chemical[RR]} % fails +% \definechemical[-R] {\chemical[LR]} % fails \definechemical[CARBON:CB] {\chemical[NEWMANSTAGGER,C,SB]} \definechemical[NEWMANSTAGGER:CB] {\chemical[NEWMANSTAGGER,C,SB]} @@ -751,4 +787,179 @@ \definechemical[SIX:FRONT] {\chemical[SIXFRONT]} \definechemical[FIVE:FRONT] {\chemical[FIVEFRONT]} +%D This is new, more in sycn with math. + +\definemathstackers + [\v!chemistry] + [\v!mathematics] + [\c!offset=\v!max, +% \c!order=\v!reverse, + \c!left=\enspace, + \c!right=\enspace, + \c!hoffset=.5\mathemwidth] + +\definemathextensible [\v!chemistry] [creturns] ["2190] +\definemathextensible [\v!chemistry] [cgives] ["2192] +\definemathextensible [\v!chemistry] [cmesomeric] ["2194] +\definemathextensible [\v!chemistry] [cequilibrium] ["21C4] +\definemathextensible [\v!chemistry] [cleaningright] ["21CB] +\definemathextensible [\v!chemistry] [cleaningleft] ["21CC] + +\definemathextensible [\v!chemistry] [clongreturns] ["27F5] +\definemathextensible [\v!chemistry] [clonggives] ["27F6] +\definemathextensible [\v!chemistry] [clongmesomeric] ["27F7] +\definemathextensible [\v!chemistry] [clongequilibrium] ["21C4] +\definemathextensible [\v!chemistry] [clongleaningright] ["21CB] +\definemathextensible [\v!chemistry] [clongleaningleft] ["21CC] + +%permanent\protected\def\cplus {+} +%permanent\protected\def\cminus {-} +%permanent\protected\def\cequals{=} + +\permanent\protected\def\csinglebond{\mathchemicalbond{\chemicalsinglebondrule}} % todo dedicated class +\permanent\protected\def\cdoublebond{\mathchemicalbond{\chemicaldoublebondrule}} % idem +\permanent\protected\def\ctriplebond{\mathchemicalbond{\chemicaltriplebondrule}} % idem + +\aliased\let\csingle\csinglebond +\aliased\let\cdouble\cdoublebond +\aliased\let\ctriple\ctriplebond + +\setmathoptions\mathchemicalbondcode\numexpr + \shortinlineclassoptioncode +\relax + +\setmathpostpenalty\mathchemicalbondcode\plusfivehundred + +\installcorenamespace {chemistry} + +\installswitchcommandhandler \??chemistry {chemistry} + +\setupchemistry + [\c!spacing=\v!chemistry, + %\c!factor=3000, % display + \c!filter=\v!yes, + \c!scale=800] % script + +\defineformula + [\v!chemistry] +% [setups=chemistry:formula] + +\definemathspacing + [\v!chemistry] + [\v!horizontal] + [3000] + +\definemathfence + [ccomplex] + [\c!left="005B, + \c!right="005D] + +\newtoks \everychemistry +\newtoks \everydisplaychemistry + +\permanent\protected\def\chem_ch{\mathtriplet[\v!chemistry]} + +\appendtoks + \setmathignore\Umathxscale\plustwo + \setmathignore\Umathyscale\plustwo + \setmathignore\Umathspacebeforescript \plusone % alternatively we can set the factors + \setmathignore\Umathspacebetweenscript\plusone + \setmathignore\Umathspaceafterscript \plusone + \bitwiseflip\mathscriptsmode\plusone + \scratchcounter\chemistryparameter\c!scale + \glyphscriptscale \numexpr\glyphscriptscale *\scratchcounter/\plusthousand\relax + \glyphscriptscriptscale\numexpr\glyphscriptscriptscale*\scratchcounter/\plusthousand\relax + \enforced\let\math_default\math_upright + \enforced\let\ch\chem_ch +\to \everychemistry + +\appendtoks + \expand\everychemistry + \setupmathspacing[\chemistryparameter\c!spacing]% + % \Umathxscale\allmathstyles\chemistryparameter\c!factor\relax +\to \everydisplaychemistry + +% this will move to math-ini ... digits inherit from ordinary + +\newmuskip\extrafencemuskip + +\appendtoks + \inherited\setmathspacing \mathchemicalbondcode \mathordinarycode \allsplitstyles \tinymuskip + \inherited\setmathspacing \mathchemicalbondcode \mathordinarycode \allunsplitstyles \pettymuskip + \inherited\setmathspacing \mathordinarycode \mathchemicalbondcode \allsplitstyles \tinymuskip + \inherited\setmathspacing \mathordinarycode \mathchemicalbondcode \allunsplitstyles \pettymuskip +\to \everychemistry + +\appendtoks + \inherited\setmathspacing \mathopencode \mathordinarycode \allmathstyles \extrafencemuskip + \inherited\setmathspacing \mathordinarycode \mathclosecode \allmathstyles \extrafencemuskip + \extrafencemuskip \medmuskip +\to \everydisplaychemistry + +% .. upto here + +% \permanent\protected\def\ic#1% +% {\im{% +% \expand\everychemistry +% \mathupright\relax +% \clf_ic{#1}% +% }} + +% \permanent\protected\def\dc#1% +% {\dm{% +% \expand\everydisplaychemistry +% \mathupright\relax +% \clf_ic{#1}% +% }} + +\permanent\protected\def\chem_ic#1% + {\expand\everychemistry + \mathupright\relax + \ifcstok{\chemistryparameter\c!filter}\v!yes + \clf_ic{#1}% + \else + #1\relax + \fi} + +\permanent\protected\def\chem_dc#1% + {\expand\everydisplaychemistry + \mathupright\relax + \ifcstok{\chemistryparameter\c!filter}\v!yes + \clf_ic{#1}% + \else + #1\relax + \fi} + +\permanent\protected\def\ic#1% + {\relax + \ifmmode + \mathconstruct{\forceinlinemath\chem_ic{#1}}% + \else + \startimath\chem_ic{#1}\stopimath + \fi} + +\permanent\protected\def\dc#1% + {\relax\ifmmode + \mathconstruct{\forcedisplaymath\chem_dc{#1}}% + \else % no grouping + \startimath\forcedisplaymath\chem_dc{#1}\stopimath + \fi} + +\aliased\let\stopchemistry\relax + +\permanent\tolerant\protected\def\startchemistry[#1]#:#2\stopchemistry + {\begingroup + \ifhastok={#1}% + \setupcurrentchemistry[#1]% + \fi + \expand\everydisplaychemistry + \startchemistryformula + \ifcstok{\chemistryparameter\c!filter}\v!yes + \clf_ic{#2}% + \else + #2\relax + \fi + \stopchemistryformula + \endgroup} + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt b/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt index 40b2b74a54d..2b12a332a2e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt @@ -31,11 +31,10 @@ local concat = table.concat local context = context local ctxcore = context.core -local variables = interfaces.variables - local ctx_flushnode = context.nuts.flush local ctx_sprint = context.sprint -local txtcatcodes = tex.txtcatcodes + +local txtcatcodes = tex.txtcatcodes local nuts = nodes.nuts local tonode = nuts.tonode @@ -249,8 +248,9 @@ end do - local texset = tex.set - local maxdimen = tex.magicconstants.maxdimen + local texset = tex.set + + local maxdimen = tex.magicconstants.maxdimen function tex.dontcomplain() texset("hbadness",maxdimen) diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-int.lmt b/Master/texmf-dist/tex/context/base/mkxl/cldf-int.lmt index 4a60b469a38..830c92ad662 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cldf-int.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-int.lmt @@ -15,10 +15,11 @@ local byte = string.byte local insert, remove, concat = table.insert, table.remove, table.concat local unpack, type = unpack or table.unpack, type -local ctxcatcodes = catcodes.numbers.ctxcatcodes local context = context local contextsprint = context.sprint +local ctxcatcodes = catcodes.numbers.ctxcatcodes + local trace_define = false trackers.register("context.define", function(v) trace_define = v end) interfaces = interfaces or { } @@ -34,10 +35,10 @@ local scankey = scanners.key local scanvalue = scanners.value local scanskip = scanners.skip -local open = byte('[') -local close = byte(']') -local equal = byte('=') -local comma = byte(',') +local open = byte('[') +local close = byte(']') +local equal = byte('=') +local comma = byte(',') local function scanhash(scanners) if peekchar() == open then diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt index 1eb80ac602b..6ce976a84b5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt @@ -49,15 +49,15 @@ local texgetcount = tex.getcount local texget = tex.get local values = tokens.values -local none_code = values.none -local integer_code = values.integer -local cardinal_code = values.cardinal -local dimension_code = values.dimension -local skip_code = values.skip -local boolean_code = values.boolean -local float_code = values.float +local none_code = values.none +local integer_code = values.integer +local cardinal_code = values.cardinal +local dimension_code = values.dimension +local skip_code = values.skip +local boolean_code = values.boolean +local float_code = values.float -local global_code = tex.flagcodes.global +local global_code = tex.flagcodes.global local context = context @@ -955,8 +955,32 @@ implement { local command = context[scancsname()] local pattern = gsub(scanstring(),"\\.",escape) local input = gsub(scanstring(),"\\.",escape) - for a, b, c, d, e, f, g, h, i in gmatch(input,pattern) do - command(a, b or "", c or "", d or "", e or "", f or "", g or "", h or "", i or "") + for a, b, c, d, e, f, g, h, i, j, k, l, m, n in gmatch(input,pattern) do + command( + a, b or "", c or "", d or "", e or "", f or "", g or "", h or "", i or "", -- #1 .. #9 + j or "", k or "", l or "", m or "", n or "" -- #A .. #E + ) + end + return none_code + end, +} + +implement { + name = "ctxluamatchfile", + public = true, + usage = "value", + actions = function() + local command = context[scancsname()] + local pattern = gsub(scanstring(),"\\.",escape) + local filename = scanstring() + if filename ~= "" then + local input = gsub(io.loaddata(filename),"\\.",escape) + for a, b, c, d, e, f, g, h, i, j, k, l, m, n in gmatch(input,pattern) do + command( + a, b or "", c or "", d or "", e or "", f or "", g or "", h or "", i or "", -- #1 .. #9 + j or "", k or "", l or "", m or "", n or "" -- #A .. #E + ) + end end return none_code end, @@ -969,7 +993,7 @@ do local codes = { } tex.codes = codes - local global_code = tex.flagcodes.global + local global_code = tex.flagcodes.global local savelua = token.savelua local isdefined = token.isdefined diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-pos.lmt b/Master/texmf-dist/tex/context/base/mkxl/cldf-pos.lmt index 9378b01be8c..b9485f8012e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cldf-pos.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-pos.lmt @@ -19,9 +19,8 @@ local fromposit = posit.fromposit local toposit = posit.toposit local posittonumber = posit.tonumber -local values = tokens.values -local boolean_code = values.boolean -local float_code = values.float +local boolean_code = tokens.values.boolean +local float_code = tokens.values.float local scanners = tokens.scanners local scanposit = scanners.posit @@ -33,7 +32,7 @@ do -- these are only for testing and might go to a module eventually local codes = tex.codes - local global_code = tex.flagcodes.global + local global_code = tex.flagcodes.global local savelua = token.savelua ----- isdefined = token.isdefined diff --git a/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl index a7f483bc2cc..4aec6cc468e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl @@ -55,7 +55,7 @@ \newconditional\c_colo_rgb_supported \newconditional\c_colo_cmyk_supported \newconditional\c_colo_spot_supported % backend driven -\newconditional\c_colo_convert_gray \settrue\c_colo_convert_gray +\newconditional\c_colo_convert_gray \c_colo_convert_gray\conditionaltrue \newconditional\c_colo_enabled \newconditional\c_colo_expanded @@ -126,7 +126,7 @@ \permanent\protected\def\transparent[#1]% {\beginsimplegroup - \edef\scratchstringone{#1}% + \cdef\scratchstringone{#1}% % the \relax catches a non existent csname \ifx\scratchstringone\v!reset \c_attr_transparency\attributeunsetvalue @@ -137,7 +137,7 @@ \permanent\protected\def\starttransparent[#1]%$ {\begingroup - \edef\scratchstringone{#1}% + \cdef\scratchstringone{#1}% \ifx\scratchstringone\v!reset \c_attr_transparency\attributeunsetvalue \else @@ -151,7 +151,7 @@ \permanent\protected\def\coloronly[#1]% {\beginsimplegroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop_only \else @@ -161,7 +161,7 @@ \permanent\protected\def\startcoloronly[#1]%$ {\begingroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop_only \else @@ -175,7 +175,7 @@ \permanent\protected\def\color[#1]% {\beginsimplegroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -190,7 +190,7 @@ \permanent\protected\def\startcolor[#1]%$ {\begingroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -216,7 +216,7 @@ \permanent\protected\def\fastcolor[#1]#2% {\begingroup % is this command still needed? - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -226,7 +226,7 @@ \endgroup} \permanent\protected\def\directcolor[#1]% - {\edef\currentcolorname{#1}% + {\cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -241,7 +241,7 @@ \permanent\protected\def\getcolorattributevalue#1#2% obsolete, use \thecolorattribute instead ... {\begingroup \colo_helpers_activate{#1}% - \normalexpanded{\endgroup\edef\noexpand#2{\ifnum\c_attr_color=\attributeunsetvalue\else\number\c_attr_color\fi}}} + \normalexpanded{\endgroup\edef\noexpand#2{\ifnum\c_attr_color=\attributeunsetvalue\else\the\c_attr_color\fi}}} % \aliased\let\grey\graycolor % these macros are only used in tracing @@ -289,20 +289,20 @@ \let\v_colo_freeze_state\s!false \defcsname\??colorconversions\v!yes\endcsname - {\settrue \c_colo_convert_gray} + {\c_colo_convert_gray\conditionaltrue} \defcsname\??colorconversions\v!always\endcsname - {\settrue \c_colo_convert_gray - \setfalse\c_colo_rgb_supported - \setfalse\c_colo_cmyk_supported} + {\c_colo_convert_gray\conditionaltrue + \c_colo_rgb_supported\conditionalfalse + \c_colo_cmyk_supported\conditionalfalse} \appendtoks % - \doifelse{\directcolorsparameter\c!spot }\v!yes \settrue \setfalse\c_colo_spot_supported - \doifelse{\directcolorsparameter\c!expansion}\v!yes \settrue \setfalse\c_colo_expanded - \doifelse{\directcolorsparameter\c!rgb }\v!yes \settrue \setfalse\c_colo_rgb_supported - \doifelse{\directcolorsparameter\c!cmyk }\v!yes \settrue \setfalse\c_colo_cmyk_supported - \doifelse{\directcolorsparameter\c!state }\v!start\settrue \setfalse\c_colo_enabled + \ifcstok{\directcolorsparameter\c!spot }\v!yes \c_colo_spot_supported\conditionaltrue\else\c_colo_spot_supported\conditionalfalse\fi + \ifcstok{\directcolorsparameter\c!expansion}\v!yes \c_colo_expanded\conditionaltrue \else\c_colo_expanded\conditionalfalse \fi + \ifcstok{\directcolorsparameter\c!rgb }\v!yes \c_colo_rgb_supported\conditionaltrue \else\c_colo_rgb_supported\conditionalfalse \fi + \ifcstok{\directcolorsparameter\c!cmyk }\v!yes \c_colo_cmyk_supported\conditionaltrue\else\c_colo_cmyk_supported\conditionalfalse\fi + \ifcstok{\directcolorsparameter\c!state }\v!start\c_colo_enabled\conditionaltrue \else\c_colo_enabled\conditionalfalse \fi % \edef\m_colo_weight_gray{\directcolorsparameter\c!factor}% % @@ -312,7 +312,7 @@ \let\v_colo_freeze_state\s!false \fi % - \setfalse\c_colo_convert_gray + \c_colo_convert_gray\conditionalfalse \begincsname\??colorconversions\directcolorsparameter\c!conversion\endcsname % too often: \ifconditional\c_colo_rgb_supported \colo_helpers_show_message\m!colors{10}\v!rgb \fi @@ -336,7 +336,7 @@ % \def\colo_force_colormodel#1#2% % {\setcolorsparameter\c!rgb {#1}% % \setcolorsparameter\c!cmyk{#2}% -% \the\everysetupcolors} +% \expand\everysetupcolors} %D We provide stacking independent of grouping. @@ -346,7 +346,7 @@ % % \permanent\protected\def\pushcolor[#1]% % {\global\advanceby\c_colo_nesting\plusone -% \edefcsname\??colorstack\number\c_colo_nesting\endcsname +% \edefcsname\??colorstack\the\c_colo_nesting\endcsname % {\c_attr_colormodel \the\c_attr_colormodel % \c_attr_color \the\c_attr_color % \c_attr_transparency\the\c_attr_transparency @@ -354,7 +354,7 @@ % \colo_helpers_activate{#1}} % % \permanent\protected\def\popcolor -% {\csname\??colorstack\number\c_colo_nesting\endcsname +% {\csname\??colorstack\the\c_colo_nesting\endcsname % \global\advanceby\c_colo_nesting\minusone} % % more efficient: @@ -517,7 +517,7 @@ \protected\def\colo_palets_define_a#1#2#3% {\colo_palet_prepare{#1}% - \ifcondition\validassignment{#2}% + \ifhastok={#2}% \edefcsname\??colorpaletspecification#1\endcsname{#2}% \processcommalist[#2]{\colo_palets_define_one{#1}}% \orelse\ifcsname\??colorpaletspecification#2\endcsname @@ -537,7 +537,7 @@ % \or % \or % \colo_palet_prepare{#1}% -% \ifcondition\validassignment{#2}% +% \ifhastok={#2}% % \edefcsname\??colorpaletspecification#1\endcsname{#2}% % \processcommalist[#2]{\colo_palets_define_one{#1}}% % \orelse\ifcsname\??colorpaletspecification#2\endcsname @@ -551,7 +551,7 @@ % \fi} \def\colo_palets_define_one#1#2% get rid of { } - {\ifcondition\validassignment{#2}% catch empty entries + {\ifhastok={#2}% catch empty entries \colo_palets_define_two{#1}[#2]% \else \colo_palets_define_three{#1}{#2}% @@ -586,13 +586,13 @@ % \newtoks\t_colo_prefix % used in mp interface \permanent\tolerant\protected\def\setuppalet[#1]% - {\edef\currentcolorpalet{#1}% + {\cdef\currentcolorpalet{#1}% \ifempty\currentcolorpalet % seems to be a reset \lettonothing\currentcolorprefix %\t_colo_prefix\emptytoks \orelse\ifcsname\??paletlist\currentcolorpalet\endcsname - \edef\currentcolorprefix{#1:}% + \cdef\currentcolorprefix{#1:}% %\t_colo_prefix\expandafter{\currentcolorprefix}% \else \colo_helpers_show_message\m!colors7\currentcolorpalet @@ -600,7 +600,7 @@ \lettonothing\currentcolorprefix %\t_colo_prefix\emptytoks \fi - \the\everysetuppalet + \expand\everysetuppalet \colo_helpers_initialize_maintextcolor} %D \macros @@ -737,7 +737,7 @@ {\colo_helpers_set_model{#1}} % only for local usage \def\colo_helpers_set_model#1% direct - {\edef\currentcolormodel{#1}% + {\cdef\currentcolormodel{#1}% \clf_setcolormodel{\currentcolormodel}{\m_colo_weight_gray}} % sets attribute at lua end \colo_helpers_set_model\s!all @@ -813,7 +813,7 @@ % so far \permanent\protected\def\colo_helpers_activate#1% two-step is not that much faster but less tracing - {\edef\currentcolorname{#1}% + {\cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -1152,7 +1152,9 @@ \clf_registermaintextcolor\thecolorattribute\maintextcolor\relax} \permanent\protected\def\starttextcolor[#1]% - {\doifsomething{#1}{\colo_helpers_switch_to_maintextcolor{#1}}} + {\ifempty{#1}\else + \colo_helpers_switch_to_maintextcolor{#1}% + \fi} \permanent\protected\lettonothing\stoptextcolor @@ -1189,7 +1191,7 @@ \to \everysetupcolors \def\colo_palets_define_set#1#2#3% - {\ifcondition\validassignment{#3}% \definepalet[test][xx={y=.4}] + {\ifhastok={#3}% \definepalet[test][xx={y=.4}] \expandafter\colo_palets_define_assign \orelse\ifcsname\??colorsetter#3\endcsname % \definepalet[test][xx=green] @@ -1354,11 +1356,11 @@ % \normal added else fails in metafun manual (leaders do a hard scan) -% \protected\def\forcecolorhack{\leaders\hrule\hskip\zeropoint\relax} % relax is needed ! +% \protected\def\forcecolorhack{\leaders\hrule\hskip\zeroskip\relax} % relax is needed ! % % I really need to sort this out! -% \permanent\protected\def\normalforcecolorhack{\leaders\hrule\s!height\zeropoint\s!depth\zeropoint\hskip\zeropoint\relax} % relax is needed ! +% \permanent\protected\def\normalforcecolorhack{\leaders\hrule\s!height\zeropoint\s!depth\zeropoint\hskip\zeroskip\relax} % % \installtexexperiment % {disablecolorhack} diff --git a/Master/texmf-dist/tex/context/base/mkxl/colo-nod.lmt b/Master/texmf-dist/tex/context/base/mkxl/colo-nod.lmt index 67487fee522..8bd90d72277 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/colo-nod.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/colo-nod.lmt @@ -12,9 +12,9 @@ local setattrs = nuts.setattrs local privateattributes = attributes.private -local a_colormodel = privateattributes('colormodel') -local a_color = privateattributes('color') -local a_transparency = privateattributes('transparency') +local a_colormodel = privateattributes('colormodel') +local a_color = privateattributes('color') +local a_transparency = privateattributes('transparency') local colors = { } nuts.colors = colors diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl index baf3afeba1c..a17a0fb43c2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl @@ -18,33 +18,58 @@ %D raising and lowering style. In this module we define some of those logos. %D We define the uppercase logo commands as (unfrozen) instances because they can be -%D redefined in the synonyms modules. +%D redefined in the synonyms modules. We use old school definitions. Watch out: when +%D a math font is used the \AMS\ logos can come out ugly but they are ugly anyway. \unprotect +% \frozen\instance\protected\def\TeX +% {\dontleavehmode +% \begingroup +% T% +% \setbox\scratchbox\hbox{M}% +% \kern-.1667\wd\scratchbox +% \lower.5\exheight\hbox{E}% +% \kern-.125\wd\scratchbox +% X% +% \endgroup} + \frozen\instance\protected\def\TeX {\dontleavehmode \begingroup + \scratchdimen\scaledfontcharwd\font`M% T% - \setbox\scratchbox\hbox{M}% - \kern-.1667\wd\scratchbox - \lower.5\exheight\hbox{E}% - \kern-.125\wd\scratchbox + \kern-.1667\scratchdimen + %\lower.3183\scaledfontcharht\font`T\hbox{E}% .318316 but no exact match possible anyway + \lower.5\exheight\hbox{E}% but on the average this looks better + \kern-.125\scratchdimen X% \endgroup} \frozen\instance\protected\def\TeXsuffix{\wordboundary\TeX} \frozen\instance\protected\def\TeXprefix{\TeX\wordboundary} -\frozen\instance\protected\def\ConTeXt - {\dontleavehmode - \begingroup - Con% +\def\syst_logos_context + {Con% \wordboundary \setbox\scratchboxone\hbox{T\kern\zeropoint e}% \setbox\scratchboxtwo\hbox{Te}% \discretionary{-}{}{\kern\dimexpr\wd\scratchboxtwo-\wd\scratchboxone\relax}% - \TeX t% + \TeX t} + +\frozen\instance\protected\def\ConTeXt + {\dontleavehmode + \begingroup + \ifcase\getcharactercasingcategory % todo: also other logos + \syst_logos_context + \or % 1 uppercase + \syst_logos_context + \or % 2 lowercase + \resetcharactercasing + con\-text + \else + Con\-text + \fi \endgroup} \frozen\instance\protected\def\PPCHTeX{ppch\TeX} @@ -81,15 +106,15 @@ \frozen\instance\protected\def\AmSTeX {\dontleavehmode \syst_logos_ams_script A% - \kern-.1667\emwidth\lower.5\exheight\hbox{\syst_logos_ams_script M}% + \kern-.5\emwidth\lower.5\exheight\hbox{\syst_logos_ams_script M}% was .1667 for old math \kern-.125\emwidth\syst_logos_ams_script S% -\TeX} \frozen\instance\protected\def\LamSTeX {L% - \kern-.4\emwidth\raise.3\exheight\hbox{\syst_logos_ams_script A}% - \kern-.25\emwidth\lower.4\exheight\hbox{\syst_logos_ams_script M}% - \kern-.1\emwidth{\syst_logos_ams_script S}% + \kern-.4\emwidth\raise.4\exheight\hbox{\syst_logos_ams_script A}% was .4 .3 for old math + \kern-.5\emwidth\lower.3\exheight\hbox{\syst_logos_ams_script M}% was .25 for old math + \kern-.125\emwidth{\syst_logos_ams_script S}% -\TeX} %D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version: diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl index 030a373aa14..7c5faf52d9f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.05.05 18:36} +\newcontextversion{2024.02.27 09:18} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt b/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt index 448992b4b56..94fbe4ac8db 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt @@ -320,6 +320,9 @@ end -- We have a regular tex file so no \starttext yet as we can -- load fonts. -- context.enabletrackers { "resolvers.*" } + if type(arguments.forceinput) == "string" then + filename = arguments.forceinput or filename + end context.input(filename) -- context.disabletrackers { "resolvers.*" } diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl index edc038e45e2..b3920b9709f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl @@ -58,7 +58,7 @@ \permanent\protected\def\continuewhenmkivmode {\starttext - \startTEXpage[\c!offset=2ex,\c!foregroundstyle=\tttf]% + \startTEXpage[\c!offset=2\exheight,\c!foregroundstyle=\tttf]% This file needs \LuaTeX\ and \ConTeXt\ \MKIV.% \stopTEXpage \stoptext diff --git a/Master/texmf-dist/tex/context/base/mkxl/context.mkxl b/Master/texmf-dist/tex/context/base/mkxl/context.mkxl index 4cfa730914c..97533948b89 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/context.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2023.05.05 18:36} +\immutable\edef\contextversion{2024.02.27 09:18} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error @@ -40,7 +40,7 @@ \immutable\chardef\contextlmtxmode\directlua{tex.print(CONTEXTLMTXMODE or 0)}\relax -\directlua{io.output():setvbuf("line")} +\directlua{io.output():setvbuf("line",512)} %D For those who want to use this: @@ -278,6 +278,9 @@ \loadmkxlfile{spac-def} \loadmklxfile{spac-prf} \loadmkxlfile{spac-grd} +\loadmkxlfile{spac-pas} + +\loadmkxlfile{spac-imp-tests} \loadmklxfile{scrn-ini} \loadmklxfile{scrn-ref} @@ -412,6 +415,7 @@ \loadmkxlfile{tabl-tsp} \loadmklxfile{tabl-xtb} \loadmkxlfile{tabl-mis} +\loadmkxlfile{tabl-ali} \loadmkxlfile{typo-lan} @@ -423,6 +427,8 @@ \loadmkxlfile{trac-vis} \loadmkxlfile{trac-jus} +\loadmkxlfile{trac-riv} % todo: delay loading +\loadmkxlfile{trac-bld} % todo: delay loading \loadmkxlfile{typo-cln} \loadmkxlfile{typo-wrp} @@ -448,6 +454,8 @@ \loadmklxfile{type-ini} \loadmkxlfile{type-set} +\loadmkxlfile{spac-brk} + \loadmkxlfile{scrp-ini} \loadmkxlfile{symb-emj} @@ -606,6 +614,8 @@ \loadmkxlfile{task-ini} +\loadmkxlfile{tabl-itm} % some late plugins + \loadmkxlfile{syst-cmp} % compatibility stuff moved here \loadmkxlfile{libs-ini} @@ -634,13 +644,7 @@ \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkxl","\contextbanner")}% can become automatic \to \everydump -% maybe some day (but also inhibits): -% -% \prependtoks -% \overloadmode 255 -% \to \everyjob - -\overloadmode\zerocount % for now +% \overloadmode\zerocount % for now \errorstopmode \dump \endinput @@ -655,8 +659,7 @@ % % % luat-bas.mkxl l-macro-imp-optimize % this is no longer used -% c:/data/develop/context/sources/buff-par.lua -% c:/data/develop/context/sources/buff-ver.lua +% c:/data/develop/context/sources/buff-par.lua % parallel % % c:/data/develop/context/sources/buff-imp-default.lua % shared % c:/data/develop/context/sources/buff-imp-escaped.lua % shared @@ -758,7 +761,7 @@ % c:/data/develop/context/sources/luat-iop.lua % c:/data/develop/context/sources/luat-mac.lua % will become lmt -% c:/data/develop/context/sources/lxml-aux.lua % the xml interfcace is rather stable +% c:/data/develop/context/sources/lxml-aux.lua % the xml interface is rather stable % c:/data/develop/context/sources/lxml-css.lua % and is also provided/used in lua so % c:/data/develop/context/sources/lxml-dir.lua % might as well share these because they % c:/data/develop/context/sources/lxml-ent.lua % are unlikely to change @@ -787,17 +790,17 @@ % c:/data/develop/context/sources/page-mix.lua % c:/data/develop/context/sources/page-pst.lua -% c:/data/develop/context/sources/publ-aut.lua % shared -% c:/data/develop/context/sources/publ-dat.lua % shared -% c:/data/develop/context/sources/publ-fnd.lua % shared -% c:/data/develop/context/sources/publ-inc.lua % shared -% c:/data/develop/context/sources/publ-ini.lua % shared -% c:/data/develop/context/sources/publ-jrn.lua % shared -% c:/data/develop/context/sources/publ-oth.lua % shared -% c:/data/develop/context/sources/publ-reg.lua % shared -% c:/data/develop/context/sources/publ-sor.lua % shared -% c:/data/develop/context/sources/publ-tra.lua % shared -% c:/data/develop/context/sources/publ-usr.lua % shared +%%c:/data/develop/context/sources/publ-aut.lua % These files are shared and it makes +% c:/data/develop/context/sources/publ-dat.lua % no sense to make lmtx variants (yet), +% c:/data/develop/context/sources/publ-fnd.lua % +% c:/data/develop/context/sources/publ-inc.lua % +% c:/data/develop/context/sources/publ-ini.lua % +% c:/data/develop/context/sources/publ-jrn.lua % +%%c:/data/develop/context/sources/publ-oth.lua % +% c:/data/develop/context/sources/publ-reg.lua % +% c:/data/develop/context/sources/publ-sor.lua % +% c:/data/develop/context/sources/publ-tra.lua % +% c:/data/develop/context/sources/publ-usr.lua % % c:/data/develop/context/sources/scrn-but.lua % c:/data/develop/context/sources/scrn-fld.lua @@ -822,9 +825,7 @@ % c:/data/develop/context/sources/strc-usr.lua % c:/data/develop/context/sources/syst-cmp.lua -- nothing -% c:/data/develop/context/sources/syst-con.lua % c:/data/develop/context/sources/trac-ctx.lua % c:/data/develop/context/sources/trac-lmx.lua % c:/data/develop/context/sources/trac-par.lua -% c:/data/develop/context/sources/trac-tex.lua diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-con.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-con.lmt new file mode 100644 index 00000000000..920b1fabded --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/core-con.lmt @@ -0,0 +1,2262 @@ +if not modules then modules = { } end modules ['core-con'] = { + version = 1.001, + comment = "companion to core-con.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- todo: split into lang-con.lua and core-con.lua + +-- This module implements a bunch of conversions. Some are more efficient than their +-- TeX counterpart, some are even slower but look nicer this way. Some code may move +-- to a module in the language namespace. + +local floor = math.floor +local osdate, ostime, ostimezone = os.date, os.time, os.timezone +local concat, insert, reverse = table.concat, table.insert, table.reverse +local lower, upper, rep, match, gsub, gmatch = string.lower, string.upper, string.rep, string.match, string.gsub, string.gmatch +local utfchar, utfbyte = utf.char, utf.byte +local tonumber, tostring, type, rawset = tonumber, tostring, type, rawset +local P, S, R, Cc, Ct, Cs, C, V, Carg = lpeg.P, lpeg.S, lpeg.R, lpeg.Cc, lpeg.Ct, lpeg.Cs, lpeg.C, lpeg.V, lpeg.Carg +----- Cf, Cg = lpeg.Cf, lpeg.Cg +local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns +local div, mod = math.div, math.mod + +local context = context +local commands = commands +local implement = interfaces.implement + +local settings_to_array = utilities.parsers.settings_to_array +local allocate = utilities.storage.allocate +local setmetatableindex = table.setmetatableindex +local formatters = string.formatters +local variables = interfaces.variables +local constants = interfaces.constants +local addformatter = utilities.strings.formatters.add + +local texset = tex.set + +converters = converters or { } +local converters = converters + +languages = languages or { } +local languages = languages + +local helpers = converters.helpers or { } +converters.helpers = helpers + +local ctx_labeltext = context.labeltext +local ctx_LABELTEXT = context.LABELTEXT +local ctx_space = context.space +local ctx_convertnumber = context.convertnumber +local ctx_highordinalstr = context.highordinalstr + +converters.number = tonumber +converters.numbers = tonumber + +implement { name = "number", actions = context } +implement { name = "numbers", actions = context } + +-- to be reconsidered ... languages namespace here, might become local plus a register command + +local counters = allocate { + ['default'] = { -- no metatable as we do a test on keys + 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, + 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, + 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A + }, + ['slovenian'] = { + 0x0061, 0x0062, 0x0063, 0x010D, 0x0064, + 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, + 0x006F, 0x0070, 0x0072, 0x0073, 0x0161, + 0x0074, 0x0075, 0x0076, 0x007A, 0x017E + }, + ['spanish'] = { + 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, + 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x00F1, + 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, + 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, + 0x0079, 0x007A + }, + ['russian'] = { + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, + 0x0435, 0x0436, 0x0437, 0x0438, 0x043a, + 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, + 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, + 0x044d, 0x044e, 0x044f + }, + ['greek'] = { -- this should be the lowercase table + -- 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, + -- 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, + -- 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, + -- 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, + -- 0x03A6, 0x03A7, 0x03A8, 0x03A9 + 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, + 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, + 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03C3, 0x03C4, 0x03C5, + 0x03C6, 0x03C7, 0x03C8, 0x03C9, + }, + ['arabic'] = { + 0x0627, 0x0628, 0x062C, 0x062F, 0x0647, + 0x0648, 0x0632, 0x062D, 0x0637, 0x0649, + 0x0643, 0x0644, 0x0645, 0x0646, 0x0633, + 0x0639, 0x0641, 0x0635, 0x0642, 0x0631, + 0x0634, 0x062A, 0x062B, 0x062E, 0x0630, + 0x0636, 0x0638, 0x063A, + }, + ['persian'] = { + 0x0627, 0x0628, 0x062C, 0x062F, 0x0647, + 0x0648, 0x0632, 0x062D, 0x0637, 0x0649, + 0x06A9, 0x0644, 0x0645, 0x0646, 0x0633, + 0x0639, 0x0641, 0x0635, 0x0642, 0x0631, + 0x0634, 0x062A, 0x062B, 0x062E, 0x0630, + 0x0636, 0x0638, 0x063A, + }, + ['thai'] = { + 0xE050, 0xE051, 0xE052, 0xE053, 0xE054, + 0xE055, 0xE056, 0xE057, 0xE058, 0xE059 + }, + ['devanagari'] = { + -- ० १ २ ३ ४ ५ ६ ७ ८ ९ + 0x0966, 0x0967, 0x0968, 0x0969, 0x096A, + 0x096B, 0x096C, 0x096D, 0x096E, 0x096F + }, + ['gurmurkhi'] = { + 0x0A66, 0x0A67, 0x0A68, 0x0A69, 0x0A6A, + 0x0A6B, 0x0A6C, 0x0A6D, 0x0A6E, 0x0A6F + }, + ['gujarati'] = { + 0x0AE6, 0x0AE7, 0x0AE8, 0x0AE9, 0x0AEA, + 0x0AEB, 0x0AEC, 0x0AED, 0x0AEE, 0x0AEF + }, + ['tibetan'] = { + 0x0F20, 0x0F21, 0x0F22, 0x0F23, 0x0F24, + 0x0F25, 0x0F26, 0x0F27, 0x0F28, 0x0F29 + }, + ['korean'] = { + 0x3131, 0x3134, 0x3137, 0x3139, 0x3141, + 0x3142, 0x3145, 0x3147, 0x3148, 0x314A, + 0x314B, 0x314C, 0x314D, 0x314E + }, + ['korean-parenthesis'] = { -- + 0x3200, 0x3201, 0x3202, 0x3203, 0x3204, + 0x3205, 0x3206, 0x3207, 0x3208, 0x3209, + 0x320A, 0x320B, 0x320C, 0x320D + }, + ['korean-circle'] = { -- circled + 0x3260, 0x3261, 0x3262, 0x3263, 0x3264, + 0x3265, 0x3266, 0x3267, 0x3268, 0x3269, + 0x326A, 0x326B, 0x326C, 0x326D + }, +} + +languages.counters = counters + +counters['ar'] = counters['arabic'] +counters['gr'] = counters['greek'] +counters['g'] = counters['greek'] +counters['sl'] = counters['slovenian'] +counters['es'] = counters['spanish'] +counters['ru'] = counters['russian'] +counters['kr'] = counters['korean'] +counters['kr-p'] = counters['korean-parenthesis'] +counters['kr-c'] = counters['korean-circle'] + +counters['thainumerals'] = counters['thai'] +counters['devanagarinumerals'] = counters['devanagari'] +counters['gurmurkhinumerals'] = counters['gurmurkhi'] +counters['gujaratinumerals'] = counters['gujarati'] +counters['tibetannumerals'] = counters['tibetan'] +counters['greeknumerals'] = counters['greek'] +counters['arabicnumerals'] = counters['arabic'] +counters['persiannumerals'] = counters['persian'] +counters['arabicexnumerals'] = counters['persian'] +counters['koreannumerals'] = counters['korean'] +counters['koreanparenthesisnumerals'] = counters['korean-parenthesis'] +counters['koreancirclenumerals'] = counters['korean-circle'] + +counters['sloveniannumerals'] = counters['slovenian'] +counters['spanishnumerals'] = counters['spanish'] +counters['russiannumerals'] = counters['russian'] + +local decimals = allocate { + ['arabic'] = { + ["0"] = "٠", ["1"] = "١", ["2"] = "٢", ["3"] = "٣", ["4"] = "٤", + ["5"] = "٥", ["6"] = "٦", ["7"] = "٧", ["8"] = "٨", ["9"] = "٩", + }, + ['persian'] = { + ["0"] = "۰", ["1"] = "۱", ["2"] = "۲", ["3"] = "۳", ["4"] = "۴", + ["5"] = "۵", ["6"] = "۶", ["7"] = "۷", ["8"] = "۸", ["9"] = "۹", + }, + ['devanagari'] = { + ["0"] = "०", ["1"] = "१", ["2"] = "२", ["3"] = "३", ["4"] = "४", + ["5"] = "५", ["6"] = "६", ["7"] = "७", ["8"] = "८", ["9"] = "९", + }, + ['malayalam'] = { + ["0"] = "൦", ["1"] = "൧", ["2"] = "൨", ["3"] = "൩", ["4"] = "൪", + ["5"] = "൫", ["6"] = "൬", ["7"] = "൭", ["8"] = "൮", ["9"] = "൯", + }, + ['tamil'] = { + ["0"] = "௦", ["1"] = "௧", ["2"] = "௨", ["3"] = "௩", ["4"] = "௪", + ["5"] = "௫", ["6"] = "௬", ["7"] = "௭", ["8"] = "௮", ["9"] = "௯", + }, + ['kannada'] = { + ["0"] = "೦", ["1"] = "೧", ["2"] = "೨", ["3"] = "೩", ["4"] = "೪", + ["5"] = "೫", ["6"] = "೬", ["7"] = "೭", ["8"] = "೮", ["9"] = "೯", + }, + ['telugu'] = { + ["0"] = "౦", ["1"] = "౧", ["2"] = "౨", ["3"] = "౩", ["4"] = "౪", + ["5"] = "౫", ["6"] = "౬", ["7"] = "౭", ["8"] = "౮", ["9"] = "౯", + }, + ['bengali'] = { + ["0"] = "০", ["1"] = "১", ["2"] = "২", ["3"] = "৩", ["4"] = "৪", + ["5"] = "৫", ["6"] = "৬", ["7"] = "৭", ["8"] = "৮", ["9"] = "৯", + }, + ['gujarati'] = { + ["0"] = "૦", ["1"] = "૧", ["2"] = "૨", ["3"] = "૩", ["4"] = "૪", + ["5"] = "૫", ["6"] = "૬", ["7"] = "૭", ["8"] = "૮", ["9"] = "૯", + }, + ['gurmurkhi'] = { + ["0"] = "੦", ["1"] = "੧", ["2"] = "੨", ["3"] = "੩", ["4"] = "੪", + ["5"] = "੫", ["6"] = "੬", ["7"] = "੭", ["8"] = "੮", ["9"] = "੯", + }, +} + +languages.decimals = decimals + +local fallback = utfbyte('0') + +local function chr(n,m) + return (n > 0 and n < 27 and utfchar(n+m)) or "" +end + +local function chrs(n,m,t) + if not t then + t = { } + end + if n > 26 then + chrs(floor((n-1)/26),m,t) + n = (n-1)%26 + 1 + end + if n ~= 0 then + t[#t+1] = utfchar(n+m) + end + if n <= 26 then + return concat(t) + end +end + +local function maxchrs(n,m,cmd,t) + if not t then + t = { } + end + if n > m then + maxchrs(floor((n-1)/m),m,cmd) + n = (n-1)%m + 1 + end + t[#t+1] = formatters["%s{%s}"](cmd,n) + if n <= m then + return concat(t) + end +end + +converters.chr = chr +converters.chrs = chrs +converters.maxchrs = maxchrs + +local lowercharacter = characters.lcchars +local uppercharacter = characters.ucchars + +local defaultcounter = counters.default + +local function do_alphabetic(n,mapping,mapper,t) -- todo: make zero based variant (initial n + 1) + if not t then + t = { } + end + local max = #mapping + if n > max then + do_alphabetic(floor((n-1)/max),mapping,mapper,t) + n = (n-1) % max + 1 + end + local chr = mapping[n] or fallback + t[#t+1] = mapper and mapper[chr] or chr + if n <= max then + return concat(t) + end +end + +local function alphabetic(n,code) + return do_alphabetic(n,code and code ~= "" and counters[code] or defaultcounter,lowercharacter) +end + +local function Alphabetic(n,code) + return do_alphabetic(n,code and code ~= "" and counters[code] or defaultcounter,uppercharacter) +end + +converters.alphabetic = alphabetic +converters.Alphabetic = Alphabetic + +-- we could make a replacer + +local function todecimals(n,name) + local stream = tostring(n) + local mapping = decimals[name] + return mapping and gsub(stream,".",mapping) or stream +end + +converters.decimals = todecimals + +local lower_offset = 96 +local upper_offset = 64 + +function converters.character (n) return chr (n,lower_offset) end +function converters.Character (n) return chr (n,upper_offset) end +function converters.characters(n) return chrs(n,lower_offset) end +function converters.Characters(n) return chrs(n,upper_offset) end + +implement { name = "alphabetic", actions = { alphabetic, context }, arguments = { "integer", "string" } } +implement { name = "Alphabetic", actions = { Alphabetic, context }, arguments = { "integer", "string" } } + +implement { name = "character", actions = { chr, context }, arguments = { "integer", lower_offset } } +implement { name = "Character", actions = { chr, context }, arguments = { "integer", upper_offset } } +implement { name = "characters", actions = { chrs, context }, arguments = { "integer", lower_offset } } +implement { name = "Characters", actions = { chrs, context }, arguments = { "integer", upper_offset } } + +implement { name = "decimals", actions = { todecimals, context }, arguments = { "integer", "string" } } + +local weekday = os.weekday -- moved to l-os +local isleapyear = os.isleapyear -- moved to l-os +local nofdays = os.nofdays -- moved to l-os + +local function leapyear(year) + return isleapyear(year) and 1 or 0 +end + +local function textime() + return tonumber(osdate("%H")) * 60 + tonumber(osdate("%M")) +end + +-- For consistenty we need to add day here but that conflicts with the current +-- serializer so then best is to have none from now on: + +-- function converters.year () return osdate("%Y") end +-- function converters.month () return osdate("%m") end -- always two digits +-- function converters.day () return osdate("%d") end -- conflicts +-- function converters.hour () return osdate("%H") end +-- function converters.minute() return osdate("%M") end +-- function converters.second() return osdate("%S") end + +converters.weekday = weekday +converters.isleapyear = isleapyear +converters.leapyear = leapyear +converters.nofdays = nofdays +converters.textime = textime + +implement { name = "weekday", actions = { weekday, context }, arguments = { "integer", "integer", "integer" } } +implement { name = "leapyear", actions = { leapyear, context }, arguments = "integer" } +implement { name = "nofdays", actions = { nofdays, context }, arguments = { "integer", "integer" } } + +implement { name = "year", actions = { osdate, context }, arguments = "'%Y'" } +implement { name = "month", actions = { osdate, context }, arguments = "'%m'" } +implement { name = "day", actions = { osdate, context }, arguments = "'%d'" } +implement { name = "hour", actions = { osdate, context }, arguments = "'%H'" } +implement { name = "minute", actions = { osdate, context }, arguments = "'%M'" } +implement { name = "second", actions = { osdate, context }, arguments = "'%S'" } +implement { name = "textime", actions = { textime, context } } + +implement { + name = "doifelseleapyear", + actions = { isleapyear, commands.doifelse }, + arguments = "integer" +} + +local roman = { + { [0] = '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX' }, + { [0] = '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC' }, + { [0] = '', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM' }, +} + +local function toroman(n) + if n >= 4000 then + return toroman(floor(n/1000)) .. " " .. toroman(n%1000) + else + return rep("M",floor(n/1000)) .. roman[3][floor((n%1000)/100)] .. roman[2][floor((n%100)/10)] .. roman[1][floor((n%10)/1)] + end +end + +converters.toroman = toroman +converters.Romannumerals = toroman +converters.romannumerals = function(n) return lower(toroman(n)) end + +converters['i'] = converters.romannumerals +converters['I'] = converters.Romannumerals +converters['r'] = converters.romannumerals +converters['R'] = converters.Romannumerals +converters['KR'] = converters.Romannumerals +converters['RK'] = converters.Romannumerals + +implement { + name = "romannumerals", + actions = { toroman, lower, context }, + arguments = "integer", +} + +implement { + name = "Romannumerals", + actions = { toroman, context }, + arguments = "integer", +} + +--~ local small = { +--~ 0x0627, 0x066E, 0x062D, 0x062F, 0x0647, 0x0648, 0x0631 +--~ } + +--~ local large = { +--~ { 0x0627, 0x0628, 0x062C, 0x062F, 0x0647, 0x0648, 0x0632, 0x062D, 0x0637, }, +--~ { 0x064A, 0x0643, 0x0644, 0x0645, 0x0646, 0x0633, 0x0639, 0x0641, 0x0635, }, +--~ { 0x0642, 0x0631, 0x0634, 0x062A, 0x062B, 0x062E, 0x0630, 0x0636, 0x0638, }, +--~ { 0x063A }, +--~ } + +local small = { + "ا", "ٮ", "ح", "د", "ه", "و", "ر", +} + +local medium = { + "ا", "ب", "ج", "د", "ه", "و","ز", "ح", "ط" , + "ي", "ك", "ل", "م", "ن", "س", "ع", "ف", "ص" , + "ق", "ر", "ش", "ت", "ث", "خ", "ذ", "ض", "ظ" , + "غ" , +} + +local large = { + { "ا", "ب", "ج", "د", "ه", "و","ز", "ح", "ط" }, + { "ي", "ك", "ل", "م", "ن", "س", "ع", "ف", "ص" }, + { "ق", "ر", "ش", "ت", "ث", "خ", "ذ", "ض", "ظ" }, + { "غ" }, +} + +local function toabjad(n,what) + if n <= 0 or n >= 2000 then + return tostring(n) + elseif what == 2 and n <= 7 then + return small[n] + elseif what == 3 and n <= 28 then + return medium[n] + else + local a, b, c, d + a, n = floor(n/1000), n % 1000 -- mod(n,1000) + b, n = floor(n/ 100), n % 100 -- mod(n, 100) + c, n = floor(n/ 10), n % 10 -- mod(n, 10) + d, n = floor(n/ 1), n % 1 -- mod(n, 1) + return (large[4][a] or "") .. (large[3][b] or "") .. (large[2][c] or "") .. (large[1][d] or "") + end +end + +converters.toabjad = toabjad + +function converters.abjadnumerals (n) return toabjad(n,false) end +function converters.abjadnodotnumerals(n) return toabjad(n,true ) end + +implement { + name = "abjadnumerals", + actions = { toabjad, context }, + arguments = { "integer", false } +} + +implement { + name = "abjadnodotnumerals", + actions = { toabjad, context }, + arguments = { "integer", true } +} + +-- -- - hebrew and jiddish -- -- -- + +local trace_hebrew trackers.register("converters.hebrew", function(v) + trace_hebrew = v +end) + +local list = { + { 400, "ת" }, { 300, "ש" }, { 200, "ר" }, { 100, "ק" }, + { 90, "צ" }, { 80, "פ" }, { 70, "ע" }, { 60, "ס "}, { 50, "נ" }, { 40, "מ" }, { 30, "ל" }, { 20, "כ" }, { 10, "י" }, + { 9, "ט" }, { 8, "ח" }, { 7, "ז", }, { 6, "ו", }, { 5, "ה" }, { 4, "ד" }, { 3, "ג" }, { 2, "ב" }, { 1, "א" }, +} + +local special = { + [15] = "ט״ו", -- exception: avoid mixup with God יה + [16] = "ט״ז", -- exception: avoid mixup with God יו +} + +local function tohebrew(n,gershayim,geresh) + local split = { } + local size = 0 + while n > 1000 do + size = size + 1 + split[size] = n % 1000 + n = floor(n/1000) + end + size = size + 1 + split[size] = n + for i=1,size do + local t = { } + local n = 0 + local s = split[i] + while s > 0 do + for i=1,#list do + ::again:: + local li = list[i] + local l1 = li[1] + local s1 = special[l1] + if s1 then + s = s - l1 + n = n + 1 + t[n] = s1 + goto again + elseif s >= l1 then + s = s - l1 + n = n + 1 + t[n] = li[2] + goto again + end + end + end + ::done:: + split[i] = t + end + if gershayim then + for i=1,size do + local si = split[i] + local ni = #si + if ni >= 2 then + local s = "״" + insert(split[i],ni,trace_hebrew and ("{\\red "..s.."}") or s) + end + end + end + if geresh then + for i=2,#split do + local s = rep("׳",i-1) + insert(split[i],trace_hebrew and ("{\\blue "..s.."}") or s) + end + end + for i=1,size do + split[i] = concat(split[i]) + end + return concat(reverse(split)) +end + +converters.tohebrew = tohebrew +converters.hebrewnumerals = converters.tohebrew + +-- converters['alphabetic:hb'] = converters.hebrewnumerals + +interfaces.implement { + name = "hebrewnumerals", + actions = { tohebrew, context }, + arguments = { "integer", true, true } +} + +-- -- -- + +local vector = { + normal = { + [0] = "〇", + [1] = "一", + [2] = "二", + [3] = "三", + [4] = "四", + [5] = "五", + [6] = "六", + [7] = "七", + [8] = "八", + [9] = "九", + [10] = "十", + [100] = "百", + [1000] = "千", + [10000] = "万", + [100000000] = "亿", + }, + cap = { + [0] = "零", + [1] = "壹", + [2] = "贰", + [3] = "叁", + [4] = "肆", + [5] = "伍", + [6] = "陆", + [7] = "柒", + [8] = "捌", + [9] = "玖", + [10] = "拾", + [100] = "佰", + [1000] = "仟", + [10000] = "萬", + [100000000] = "亿", + }, + all = { + [0] = "〇", + [1] = "一", + [2] = "二", + [3] = "三", + [4] = "四", + [5] = "五", + [6] = "六", + [7] = "七", + [8] = "八", + [9] = "九", + [10] = "十", + [20] = "廿", + [30] = "卅", + [100] = "百", + [1000] = "千", + [10000] = "万", + [100000000] = "亿", + } +} + +local function tochinese(n,name) -- normal, caps, all, date + -- improved version by Li Yanrui, Song Yihan + local result, r = { }, 0 + + if name == "date" then + -- We could do some number juggling instead but this is fast enough. There is + -- no error checking here so we assume a proper year. Maybe a better name is + -- asis (so that it can be used for more than dates). + local vector = vector.normal + for s in gmatch(tostring(n),".") do + r = r + 1 ; result[r] = vector[tonumber(s)] + end + return concat(result) + end + + local vector = vector[name] or vector.normal + while true do + if n == 0 then + break + elseif n >= 100000000 then + local m = floor(n/100000000) + r = r + 1 ; result[r] = tochinese(m,name) + r = r + 1 ; result[r] = vector[100000000] + local z = n - m * 100000000 + if z > 0 and z < 10000000 then r = r + 1 ; result[r] = vector[0] end + n = n % 100000000 + elseif n >= 10000000 then + local m = floor(n/10000) + r = r + 1 ; result[r] = tochinese(m,name) + r = r + 1 ; result[r] = vector[10000] + local z = n - m * 10000 + if z > 0 and z < 1000 then r = r + 1 ; result[r] = vector[0] end + n = n % 10000 + elseif n >= 1000000 then + local m = floor(n/10000) + r = r + 1 ; result[r] = tochinese(m,name) + r = r + 1 ; result[r] = vector[10000] + local z = n - m * 10000 + if z > 0 and z < 1000 then r = r + 1 ; result[r] = vector[0] end + n = n % 10000 + elseif n >= 100000 then + local m = floor(n/10000) + r = r + 1 ; result[r] = tochinese(m,name) + r = r + 1 ; result[r] = vector[10000] + local z = n - m * 10000 + if z > 0 and z < 1000 then r = r + 1 ; result[r] = vector[0] end + n = n % 10000 + elseif n >= 10000 then + local m = floor(n/10000) + r = r + 1 ; result[r] = vector[m] + r = r + 1 ; result[r] = vector[10000] + local z = n - m * 10000 + if z > 0 and z < 1000 then r = r + 1 ; result[r] = vector[0] end + n = n % 10000 + elseif n >= 1000 then + local m = floor(n/1000) + r = r + 1 ; result[r] = vector[m] + r = r + 1 ; result[r] = vector[1000] + local z = n - m * 1000 + if z > 0 and z < 100 then r = r + 1 ; result[r] = vector[0] end + n = n % 1000 + elseif n >= 100 then + local m = floor(n/100) + r = r + 1 ; result[r] = vector[m] + r = r + 1 ; result[r] = vector[100] + local z = n - m * 100 + if z > 0 and z < 10 then r = r + 1 ; result[r] = vector[0] end + n = n % 100 + elseif n >= 10 then + local m = floor(n/10) + if m > 1 and vector[m*10] then + r = r + 1 ; result[r] = vector[m*10] + else + r = r + 1 ; result[r] = vector[m] + r = r + 1 ; result[r] = vector[10] + end + n = n % 10 + else + r = r + 1 ; result[r] = vector[n] + break + end + end + if (result[1] == vector[1] and result[2] == vector[10]) then + result[1] = "" + end + return concat(result) +end + +-- local t = { 1,10,15,25,35,45,11,100,111,1111,10000,11111,100000,111111,1111111,11111111,111111111,100000000,1111111111,11111111111,111111111111,1111111111111 } +-- for k=1,#t do +-- local v = t[k] +-- print(v,tochinese(v),tochinese(v,"all"),tochinese(v,"cap")) +-- end + +converters.tochinese = tochinese + +function converters.chinesenumerals (n,how) return tochinese(n,how or "normal") end +function converters.chinesecapnumerals(n) return tochinese(n,"cap") end +function converters.chineseallnumerals(n) return tochinese(n,"all") end +function converters.chinesedatenumerals(n) return tochinese(n,"date") end + +converters['cn'] = converters.chinesenumerals +converters['cn-c'] = converters.chinesecapnumerals +converters['cn-a'] = converters.chineseallnumerals +converters['cn-d'] = converters.chinesedatenumerals + +implement { + name = "chinesenumerals", + actions = { tochinese, context }, + arguments = { "integer", "string" } +} + +-- this is a temporary solution: we need a better solution when we have +-- more languages + +converters['a'] = converters.characters +converters['A'] = converters.Characters +converters['AK'] = converters.Characters -- obsolete +converters['KA'] = converters.Characters -- obsolete + +function converters.spanishnumerals (n) return alphabetic(n,"es") end +function converters.Spanishnumerals (n) return Alphabetic(n,"es") end +function converters.sloveniannumerals(n) return alphabetic(n,"sl") end +function converters.Sloveniannumerals(n) return Alphabetic(n,"sl") end +function converters.russiannumerals (n) return alphabetic(n,"ru") end +function converters.Russiannumerals (n) return Alphabetic(n,"ru") end + +converters['alphabetic:es'] = converters.spanishnumerals +converters['alphabetic:sl'] = converters.sloveniannumerals +converters['alphabetic:ru'] = converters.russiannumerals + +converters['Alphabetic:es'] = converters.Spanishnumerals +converters['Alphabetic:sl'] = converters.Sloveniannumerals +converters['Alphabetic:ru'] = converters.Russiannumerals + +-- bonus + +converters['a:es'] = converters.spanishnumerals +converters['a:sl'] = converters.sloveniannumerals +converters['a:ru'] = converters.russiannumerals +converters['A:es'] = converters.Spanishnumerals +converters['A:sl'] = converters.Sloveniannumerals +converters['A:ru'] = converters.Russiannumerals + +-- end of bonus + +converters.sequences = converters.sequences or { } +local sequences = converters.sequences + +storage.register("converters/sequences", sequences, "converters.sequences") + +function converters.define(name,set) -- ,language) + -- if language then + -- name = name .. ":" .. language + -- end + sequences[name] = settings_to_array(set) +end + +function converters.max(name) + local s = sequences[name] + return s and #s or 0 +end + +implement { + name = "defineconversion", + actions = converters.define, + arguments = "2 strings", +} + +implement { + name = "nofconversions", + actions = { converters.max, context }, + arguments = "string", +} + +local function convert(method,n,language) + local converter = language and converters[method..":"..language] or converters[method] + if converter then + return converter(n) + else + local lowermethod = lower(method) + local linguistic = counters[lowermethod] + if linguistic then + return do_alphabetic(n,linguistic,lowermethod == method and lowercharacter or uppercharacter) + end + local sequence = sequences[method] + if sequence then + local max = #sequence + if n > max then + return sequence[(n-1) % max + 1] + else + return sequence[n] + end + end + return n + end +end + +converters.convert = convert + +local function valid(method,language) + return converters[method..":"..language] or converters[method] or sequences[method] +end + +implement { + name = "doifelseconverter", + actions = { valid, commands.doifelse }, + arguments = "2 strings", +} + +implement { + name = "checkedconversion", + actions = { convert, context }, + arguments = { "string", "integer" } +} + +-- hebrew data conversion + +local gregorian_to_hebrew do + + -- The next code is based on the c code at https://github.com/hebcal/hebcal + -- + -- Hebcal : A Jewish Calendar Generator + -- Copyright : 1994 - 2004 Danny Sadinoff, 2002 Michael J. Radwin + -- License : GPL + -- + -- Because we only need simple dates, we use part of the code. There is more + -- at that github place. + -- + -- The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. + -- The Gregorian date Sunday, December 31, 1 BC is imaginary. + -- + -- The code is luafied and a little different because we have no assignments + -- in loops and such. We could speed up the code but then we divert from the + -- original. This is not that critical anyway. + + local NISAN = 1 + local IYYAR = 2 + local SIVAN = 3 + local TAMUZ = 4 + local AV = 5 + local ELUL = 6 + local TISHREI = 7 + local CHESHVAN = 8 + local KISLEV = 9 + local TEVET = 10 + local SHVAT = 11 + local ADAR_I = 12 + local ADAR_II = 13 + + local mmap = { + KISLEV, + TEVET, + SHVAT, + ADAR_I, + NISAN, + IYYAR, + SIVAN, + TAMUZ, + TISHREI, + TISHREI, + TISHREI, + CHESHVAN + } + + local function greg2abs(year,month,day) + local y = year - 1 + return y * 365 + div(y,4)- div(y,100) + div(y,400) + os.nofdays(year,month,day) + end + + local function abs2greg(abs) + + local d0 = abs - 1 + + local n400 = div(d0, 146097) + local d1 = mod(d0, 146097) + local n100 = div(d1, 36524) + local d2 = mod(d1, 36524) + local n4 = div(d2, 1461) + local d3 = mod(d2, 1461) + local n1 = div(d3, 365) + + local day = mod(d3, 365) + 1 + local year = 400 * n400 + 100 * n100 + 4 * n4 + n1 + + if n100 == 4 or n1 == 4 then + return year, 12, 31 + else + year = year + 1 + month = 1 + while true do + local mlen = os.nofdays(year,month) + if mlen < day then + day = day - mlen + month = month + 1 + else + break + end + end + return year, month, day + end + end + + local function hebrew_leapyear(year) + return mod(1 + year * 7, 19) < 7 + end + + local function hebrew_months_in_year(year) + return hebrew_leapyear(year) and 13 or 12 + end + + local function hebrew_elapsed_days(year) + local y = year - 1 + local m_elapsed = 235 * div(y,19) + 12 * mod(y,19) + div(((mod(y,19) * 7) + 1),19) + local p_elapsed = 204 + 793 * mod(m_elapsed,1080) + local h_elapsed = 5 + 12 * m_elapsed + 793 * div(m_elapsed,1080) + div(p_elapsed,1080) + local parts = mod(p_elapsed,1080) + 1080 * mod(h_elapsed,24) + local day = 1 + 29 * m_elapsed + div(h_elapsed,24) + local d = mod(day,7) + local alt_day = day + if parts >= 19440 + or (parts >= 9924 and d == 2 and not (hebrew_leapyear(year))) + or (parts >= 16789 and d == 1 and hebrew_leapyear(y )) then + alt_day = alt_day + 1 + end + d = mod(alt_day,7) + if d == 0 or d == 3 or d == 5 then + alt_day = alt_day + 1 + end + return alt_day + end + + local function days_in_hebrew_year(year) + return hebrew_elapsed_days(year + 1) - hebrew_elapsed_days(year) + end + + local function long_cheshvan(year) + return mod(days_in_hebrew_year(year),10) == 5 + end + + local function short_kislev(year) + return mod(days_in_hebrew_year(year),10) == 3 + end + + local function max_days_in_heb_month(month,year) + if month == IYYAR or month == TAMUZ or month == ELUL or month == TEVET or month == ADAR_II or + (month == ADAR_I and not hebrew_leapyear(year)) or + (month == CHESHVAN and not long_cheshvan(year)) or + (month == KISLEV and short_kislev (year)) then + return 29 + else + return 30 + end + end + + local function hebrew2abs(year,month,day) + if month < TISHREI then + for m=TISHREI, hebrew_months_in_year(year), 1 do + day = day + max_days_in_heb_month(m,year) + end + for m=NISAN, month - 1, 1 do + day = day + max_days_in_heb_month(m,year) + end + else + for m=TISHREI, month - 1, 1 do + day = day + max_days_in_heb_month(m,year) + end + end + return hebrew_elapsed_days(year) - 1373429 + day + end + + local function abs2hebrew(abs) + local yy, mm, dd = abs2greg(abs) + local day = 1 + local month = TISHREI + local year = 3760 + yy + while abs >= hebrew2abs(year+1,month,day) do + year = year + 1 + end + if year >= 4635 and year < 10666 then + month = mmap[mm] + end + while abs > hebrew2abs(year,month,max_days_in_heb_month(month,year)) do + month = mod(month,hebrew_months_in_year(year)) + 1 + end + day = abs - hebrew2abs(year,month,1) + 1 + return year, month, day + end + + -- months = { "ניסן" "אייר" "סיון" "תמוז" "אב" "אלול" "תשרי" "חשון" "כסלו" "טבת" "שבט" } + + gregorian_to_hebrew = function(y,m,d) + return abs2hebrew(greg2abs(y,m,d)) + end + + converters.gregorian_to_hebrew = gregorian_to_hebrew + +end + +local gregorian_to_jalali, jalali_to_gregorian do + + -- Well, since the one asking for this didn't test it the following code is not + -- enabled. + -- + -- -- This Lua version is based on a Javascript by Behdad Esfahbod which in turn + -- -- is based on GPL'd code by Roozbeh Pournader of the The FarsiWeb Project + -- -- Group: http://www.farsiweb.info/jalali/jalali.js. + -- -- + -- -- We start tables at one, I kept it zero based in order to stay close to + -- -- the original. + -- -- + -- -- Conversion by Hans Hagen + + local g_days_in_month = { [0] = 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } + local j_days_in_month = { [0] = 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29 } + + + gregorian_to_jalali = function(gy,gm,gd) + local jy, jm, jd, g_day_no, j_day_no, j_np, i + gy, gm, gd = gy - 1600, gm - 1, gd - 1 + g_day_no = 365*gy + div((gy+3),4) - div((gy+99),100) + div((gy+399),400) + i = 0 + while i < gm do + g_day_no = g_day_no + g_days_in_month[i] + i = i + 1 + end + if (gm>1 and ((gy%4==0 and gy%100~=0) or (gy%400==0))) then + g_day_no = g_day_no + 1 + end + g_day_no = g_day_no + gd + j_day_no = g_day_no - 79 + j_np = div(j_day_no,12053) + j_day_no = mod(j_day_no,12053) + jy = 979 + 33*j_np + 4*div(j_day_no,1461) + j_day_no = mod(j_day_no,1461) + if j_day_no >= 366 then + jy = jy + div((j_day_no-1),365) + j_day_no = mod((j_day_no-1),365) + end + i = 0 + while i < 11 and j_day_no >= j_days_in_month[i] do + j_day_no = j_day_no - j_days_in_month[i] + i = i + 1 + end + jm = i + 1 + jd = j_day_no + 1 + return jy, jm, jd + end + + jalali_to_gregorian = function(jy,jm,jd) + local gy, gm, gd, g_day_no, j_day_no, leap, i + jy, jm, jd = jy - 979, jm - 1, jd - 1 + j_day_no = 365*jy + div(jy,33)*8 + div((mod(jy,33)+3),4) + for i=0,jm-1,1 do + j_day_no = j_day_no + j_days_in_month[i] + end + j_day_no = j_day_no + jd + g_day_no = j_day_no + 79 + gy = 1600 + 400*div(g_day_no,146097) + g_day_no = mod(g_day_no, 146097) + leap = 1 + if g_day_no >= 36525 then + g_day_no = g_day_no - 1 + gy = gy + 100*div(g_day_no,36524) + g_day_no = mod(g_day_no, 36524) + if g_day_no >= 365 then + g_day_no = g_day_no + 1 + else + leap = 0 + end + end + gy = gy + 4*div(g_day_no,1461) + g_day_no = mod(g_day_no, 1461) + if g_day_no >= 366 then + leap = 0 + g_day_no = g_day_no - 1 + gy = gy + div(g_day_no, 365) + g_day_no = mod(g_day_no, 365) + end + i = 0 + while true do + local d = g_days_in_month[i] + ((i == 1 and leap) or 0) + if g_day_no >= d then + g_day_no = g_day_no - d + i = i + 1 + else + break + end + end + gm = i + 1 + gd = g_day_no + 1 + return gy, gm, gd + end + + -- local function test(yg,mg,dg,yj,mj,dj) + -- local y1, m1, d1 = jalali_to_gregorian(yj,mj,dj) + -- local y2, m2, d2 = gregorian_to_jalali(yg,mg,dg) + -- print(y1 == yg and m1 == mg and d1 == dg, yg,mg,dg, y1,m1,d1) + -- print(y2 == yj and m2 == mj and d2 == dj, yj,mj,dj, y2,m2,d2) + -- end + + -- test(1953,08,19, 1332,05,28) + -- test(1979,02,11, 1357,11,22) + -- test(2000,02,28, 1378,12,09) + -- test(2000,03,01, 1378,12,11) + -- test(2009,02,24, 1387,12,06) + -- test(2015,03,21, 1394,01,01) + -- test(2016,03,20, 1395,01,01) + + converters.gregorian_to_jalali = gregorian_to_jalali + converters.jalali_to_gregorian = jalali_to_gregorian + +end + +-- -- more efficient but needs testing + +-- local escapes = characters.filters.utf.private.escapes + +-- local function do_alphabetic(n,mapping,chr) +-- local max = #mapping +-- if n > max then +-- do_alphabetic(floor((n-1)/max),mapping,chr) +-- n = (n-1)%max+1 +-- end +-- n = chr(n,mapping) +-- context(escapes[n] or utfchar(n)) +-- end + +-- local lccodes, uccodes, safechar = characters.lccode, characters.uccode, commands.safechar + +-- local function do_alphabetic(n,mapping,chr) +-- local max = #mapping +-- if n > max then +-- do_alphabetic(floor((n-1)/max),mapping,chr) +-- n = (n-1)%max+1 +-- end +-- safechar(chr(n,mapping)) +-- end + +-- local function lowercased(n,mapping) return characters.lccode(mapping[n] or fallback) end +-- local function uppercased(n,mapping) return characters.uccode(mapping[n] or fallback) end + +-- function converters.alphabetic(n,code) +-- do_alphabetic(n,counters[code] or counters.default,lowercased) -- lccode catches wrong tables +-- end + +-- function converters.Alphabetic(n,code) +-- do_alphabetic(n,counters[code] or counters.default,uppercased) +-- end + +local ordinals = { + english = function(n) + local two = n % 100 + if two == 11 or two == 12 or two == 13 then + return "th" + else + local one = n % 10 + if one == 1 then + return "st" + elseif one == 2 then + return "nd" + elseif one == 3 then + return "rd" + else + return "th" + end + end + end, + dutch = function(n) + return "e" + end, + french = function(n) + if n == 1 then + return "er" + else + return "e" + end + end, +} + +ordinals.en = ordinals.english +ordinals.nl = ordinals.dutch +ordinals.fr = ordinals.french + +function converters.ordinal(n,language) + local t = language and ordinals[language] + return t and t(n) +end + +local function ctxordinal(n,language) + local t = language and ordinals[language] + local o = t and t(n) + context(n) + if o then + ctx_highordinalstr(o) + end +end + +implement { + name = "ordinal", + actions = ctxordinal, + arguments = { "integer", "string" } +} + +-- verbose numbers + +local data = allocate() +local verbose = { data = data } +converters.verbose = verbose + +-- verbose english + +local words = { + [0] = "zero", + [1] = "one", + [2] = "two", + [3] = "three", + [4] = "four", + [5] = "five", + [6] = "six", + [7] = "seven", + [8] = "eight", + [9] = "nine", + [10] = "ten", + [11] = "eleven", + [12] = "twelve", + [13] = "thirteen", + [14] = "fourteen", + [15] = "fifteen", + [16] = "sixteen", + [17] = "seventeen", + [18] = "eighteen", + [19] = "nineteen", + [20] = "twenty", + [30] = "thirty", + [40] = "forty", + [50] = "fifty", + [60] = "sixty", + [70] = "seventy", + [80] = "eighty", + [90] = "ninety", + [100] = "hundred", + [1000] = "thousand", + [1000000] = "million", + [1000000000] = "billion", + [1000000000000] = "trillion", +} + +local function translate(n,connector) + local w = words[n] + if w then + return w + end + local t = { } + local function compose_one(n) + local w = words[n] + if w then + t[#t+1] = w + return + end + local a, b = floor(n/100), n % 100 + if a == 10 then + t[#t+1] = words[1] + t[#t+1] = words[1000] + elseif a > 0 then + t[#t+1] = words[a] + t[#t+1] = words[100] + -- don't say 'nine hundred zero' + if b == 0 then + return + end + end + if words[b] then + t[#t+1] = words[b] + else + a, b = floor(b/10), n % 10 + t[#t+1] = words[a*10] + t[#t+1] = words[b] + end + end + local function compose_two(n,m) + if n > (m-1) then + local a, b = floor(n/m), n % m + if a > 0 then + compose_one(a) + end + t[#t+1] = words[m] + n = b + end + return n + end + n = compose_two(n,1000000000000) + n = compose_two(n,1000000000) + n = compose_two(n,1000000) + n = compose_two(n,1000) + if n > 0 then + compose_one(n) + end + return #t > 0 and concat(t,connector or " ") or tostring(n) +end + +data.english = { + words = words, + translate = translate, +} + +data.en = data.english + +-- print(translate(11111111)) +-- print(translate(2221101)) +-- print(translate(1111)) +-- print(translate(1218)) +-- print(translate(1234)) +-- print(translate(12345)) +-- print(translate(12345678900000)) + +-- verbose spanish (unchecked) + +local words = { + [1] = "uno", + [2] = "dos", + [3] = "tres", + [4] = "cuatro", + [5] = "cinco", + [6] = "seis", + [7] = "siete", + [8] = "ocho", + [9] = "nueve", + [10] = "diez", + [11] = "once", + [12] = "doce", + [13] = "trece", + [14] = "catorce", + [15] = "quince", + [16] = "dieciséis", + [17] = "diecisiete", + [18] = "dieciocho", + [19] = "diecinueve", + [20] = "veinte", + [21] = "veintiuno", + [22] = "veintidós", + [23] = "veintitrés", + [24] = "veinticuatro", + [25] = "veinticinco", + [26] = "veintiséis", + [27] = "veintisiete", + [28] = "veintiocho", + [29] = "veintinueve", + [30] = "treinta", + [40] = "cuarenta", + [50] = "cincuenta", + [60] = "sesenta", + [70] = "setenta", + [80] = "ochenta", + [90] = "noventa", + [100] = "ciento", + [200] = "doscientos", + [300] = "trescientos", + [400] = "cuatrocientos", + [500] = "quinientos", + [600] = "seiscientos", + [700] = "setecientos", + [800] = "ochocientos", + [900] = "novecientos", + [1000] = "mil", + [1000000] = "millón", + [1000000000] = "mil millones", + [1000000000000] = "billón", +} + +local function translate(n,connector) + local w = words[n] + if w then + return w + end + local t = { } + local function compose_one(n) + local w = words[n] + if w then + t[#t+1] = w + return + end + -- a, b = hundreds, remainder + local a, b = floor(n/100), n % 100 + -- one thousand + if a == 10 then + t[#t+1] = words[1] + t[#t+1] = words[1000] + -- x hundred (n.b. this will not give thirteen hundred because + -- compose_one(n) is only called after + -- n = compose(two(n, 1000)) + elseif a > 0 then + t[#t+1] = words[a*100] + end + -- the remainder + if words[b] then + t[#t+1] = words[b] + else + -- a, b = tens, remainder + a, b = floor(b/10), n % 10 + t[#t+1] = words[a*10] + t[#t+1] = "y" + t[#t+1] = words[b] + end + end + -- compose_two handles x billion, ... x thousand. When 1000 or less is + -- left, compose_one takes over. + local function compose_two(n,m) + if n > (m-1) then + local a, b = floor(n/m), n % m + if a > 0 then + compose_one(a) + end + t[#t+1] = words[m] + n = b + end + return n + end + n = compose_two(n,1000000000000) + n = compose_two(n,1000000000) + n = compose_two(n,1000000) + n = compose_two(n,1000) + if n > 0 then + compose_one(n) + end + return #t > 0 and concat(t,connector or " ") or tostring(n) +end + +data.spanish = { + words = words, + translate = translate, +} + +data.es = data.spanish + +-- print(translate(31)) +-- print(translate(101)) +-- print(translate(199)) + +-- verbose swedish by Peter Kvillegard + +do + + local words = { + [0] = "noll", + [1] = "ett", + [2] = "två", + [3] = "tre", + [4] = "fyra", + [5] = "fem", + [6] = "sex", + [7] = "sju", + [8] = "åtta", + [9] = "nio", + [10] = "tio", + [11] = "elva", + [12] = "tolv", + [13] = "tretton", + [14] = "fjorton", + [15] = "femton", + [16] = "sexton", + [17] = "sjutton", + [18] = "arton", + [19] = "nitton", + [20] = "tjugo", + [30] = "trettio", + [40] = "fyrtio", + [50] = "femtio", + [60] = "sextio", + [70] = "sjuttio", + [80] = "åttio", + [90] = "nittio", + [100] = "hundra", + [10^3] = "tusen", + [10^6] = "miljon", + [10^9] = "miljard", + [10^12] = "biljon", + [10^15] = "biljard", + } + + local function translate(n,connector) + local w = words[n] + if w then + return w + else + local t = { } + local l = 0 + -- group of three digits to words, e.g. 123 -> etthundratjugotre + local function triplets(n) + if floor(n/100) > 0 then + l = l + 1 ; t[l] = words[floor(n/100)] + l = l + 1 ; t[l] = words[100] + end + if n%100 > 20 then + l = l + 1 ; t[l] = words[n%100-n%10] + if n%10 > 0 then + l = l + 1 ; t[l] = words[n%10] + end + elseif n%100 > 0 then + l = l + 1 ; t[l] = words[n%100] + end + end + -- loops through 10^15,10^12,...10^3, extracting groups of three digits + -- to make words from, then adding names for order of magnitude + for i=15,3,-3 do + local triplet = floor(n/10^i)%10^3 + if triplet > 0 then + -- grammar: "en" instead of "ett" + if i > 3 and triplet == 1 then + l = l + 1 ; t[l] = "en" + else + triplets(triplet) + end + -- grammar: plural form of "millions" etc + l = l + 1 ; t[l] = words[10^i] + if i > 3 and triplet > 1 then + l = l + 1 ; t[l] = "er" + end + end + end + -- add last group of three numbers (no word for magnitude) + n = n%1000 + if n > 0 then + triplets(n) + end + t = concat(t," ") + -- grammar: spacing for numbers < 10^6 and repeated letters + if n < 10^6 then + t = gsub(t,"%stusen%s","tusen") + t = gsub(t,"etttusen","ettusen") + end + return t + end + end + + data.swedish = { + words = words, + translate = translate, + } + + data.sv = data.swedish + +end + +-- verbose handler: + +function converters.verbose.translate(n,language,connector) + local t = language and data[language] + return t and t.translate(n,connector) or n +end + +local function verbose(n,language,connector) + local t = language and data[language] + context(t and t.translate(n,connector) or n) +end + +implement { + name = "verbose", + actions = verbose, + arguments = { "integer", "string", "string" } +} + +-- These are just helpers but not really for the tex end. Do we have to +-- use translate here? + +local whitespace = lpegpatterns.whitespace +local word = lpegpatterns.utf8uppercharacter^-1 * (1-whitespace)^1 +local pattern_one = Cs( whitespace^0 * word^-1 * P(1)^0) +local pattern_all = Cs((whitespace^1 + word)^1) + +function converters.word (s) return s end -- dummies for typos +function converters.words(s) return s end -- dummies for typos + +local function Word (s) return lpegmatch(pattern_one,s) or s end +local function Words(s) return lpegmatch(pattern_all,s) or s end + +converters.Word = Word +converters.Words = Words + +converters.upper = characters.upper +converters.lower = characters.lower + +-- print(converters.Word("foo bar")) +-- print(converters.Word(" foo bar")) +-- print(converters.Word("123 foo bar")) +-- print(converters.Word(" 123 foo bar")) + +-- print(converters.Words("foo bar")) +-- print(converters.Words(" foo bar")) +-- print(converters.Words("123 foo bar")) +-- print(converters.Words(" 123 foo bar")) + +-- -- + +local v_day = variables.day +local v_year = variables.year +local v_month = variables.month +local v_weekday = variables.weekday +local v_referral = variables.referral +local v_space = variables.space + +local v_MONTH = upper(v_month) +local v_WEEKDAY = upper(v_weekday) + +local convert = converters.convert + +local days = { -- not variables + "sunday", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", +} + +local months = { -- not variables + "january", + "february", + "march", + "april", + "may", + "june", + "july", + "august", + "september", + "october", + "november", + "december", +} + +local monthmnems = { -- not variables + -- virtual table +} + +local daymnems = { -- not variables + -- virtual table +} + +setmetatableindex(days, function(t,k) return "unknown" end) +setmetatableindex(daymnems, function(t,k) return days[k] .. ":mnem" end) +setmetatableindex(months, function(t,k) return "unknown" end) +setmetatableindex(monthmnems, function(t,k) return months[k] .. ":mnem" end) + +do + + local function dayname(n) + ctx_labeltext(days[n]) + end + + local function daymnem(n) + ctx_labeltext(daymnems[n]) + end + + local function weekdayname(day,month,year) + ctx_labeltext(days[weekday(day,month,year)]) + end + + local function monthname(n) + ctx_labeltext(months[n]) + end + + local function monthmnem(n) + ctx_labeltext(monthmnems[n]) + end + + implement { + name = "dayname", + actions = dayname, + arguments = "integer", + } + + implement { + name = "daymnem", + actions = daymnem, + arguments = "integer", + } + + implement { + name = "weekdayname", + actions = weekdayname, + arguments = { "integer", "integer", "integer" } + } + + implement { + name = "monthname", + actions = monthname, + arguments = "integer", + } + + implement { + name = "monthmnem", + actions = monthmnem, + arguments = "integer", + } + + -- todo : short week days + + local f_monthlong = formatters["\\monthlong{%s}"] + local f_monthshort = formatters["\\monthshort{%s}"] + local f_daylong = formatters["\\daylong{%s}"] + local f_dayshort = formatters["\\dayshort{%s}"] + local f_weekday = formatters["\\weekday{%s}"] + local f_dayoftheweek = formatters["\\dayoftheweek{%s}{%s}{%s}"] + + local function tomonthlong (m) return f_monthlong (tonumber(m) or 1) end + local function tomonthshort(m) return f_monthshort(tonumber(m) or 1) end + local function todaylong (d) return f_daylong (tonumber(d) or 1) end + local function todayshort (d) return f_dayshort (tonumber(d) or 1) end + local function toweekday (d) return f_weekday (tonumber(d) or 1) end + + local function todayoftheweek(d,m,y) + return f_dayoftheweek(tonumber(d) or 1,tonumber(m) or 1,tonumber(y) or 2000) + end + + addformatter(formatters,"monthlong", [[tomonthlong(%s)]], { tomonthlong = tomonthlong }) + addformatter(formatters,"monthshort", [[tomonthshort(%s)]], { tomonthshort = tomonthshort }) + addformatter(formatters,"daylong", [[todaylong(%s)]], { todaylong = todaylong }) + addformatter(formatters,"dayshort", [[todayshort(%s)]], { todayshort = todayshort }) + addformatter(formatters,"weekday", [[toweekday(%s)]], { toweekday = toweekday }) + addformatter(formatters,"dayoftheweek",[[todayoftheweek(%s,%s,%s)]],{ todayoftheweek = todayoftheweek }) + + -- using %t is slower, even with caching as we seldom use > 3 items per epoch + + local function toeyear (e) return osdate("%Y",tonumber(e)) end + local function toemonth (e) return osdate("%m",tonumber(e)) end + local function toeday (e) return osdate("%d",tonumber(e)) end + local function toeminute(e) return osdate("%M",tonumber(e)) end + local function toesecond(e) return osdate("%S",tonumber(e)) end + + local function toemonthlong(e) + return f_monthlong(tonumber(osdate("%m",tonumber(e)))) + end + + local function toemonthshort(e) + return f_monthshort(tonumber(osdate("%m",tonumber(e)))) + end + + local function toedaylong(e) + return f_datlong(tonumber(osdate("%w",tonumber(e)))) + end + + local function toedayshort(e) + return f_dayshort(tonumber(osdate("%w",tonumber(e)))) + end + + local function toeweek(e) -- we run from 1-7 not 0-6 + return tostring(tonumber(osdate("%w",tonumber(e)))+1) + end + + local function toeweekday(e) + return f_weekday(tonumber(osdate("%w",tonumber(e)))+1) + end + + local function toedate(format,e) + return osdate(format,tonumber(e)) + end + + addformatter(formatters,"eyear", [[toeyear(%s)]], { toeyear = toeyear }) + addformatter(formatters,"emonth", [[toemonth(%s)]], { toemonth = toemonth }) + addformatter(formatters,"eday", [[toeday(%s)]], { toeday = toeday }) + addformatter(formatters,"eweek", [[toeweek(%s)]], { toeweek = toeweek }) + addformatter(formatters,"eminute", [[toeminute(%s)]], { toeminute = toeminute }) + addformatter(formatters,"esecond", [[toesecond(%s)]], { toesecond = toesecond }) + + addformatter(formatters,"emonthlong", [[toemonthlong(%s)]], { toemonthlong = toemonthlong }) + addformatter(formatters,"emonthshort", [[toemonthshort(%s)]], { toemonthshort = toemonthshort }) + addformatter(formatters,"edaylong", [[toedaylong(%s)]], { toedaylong = toedaylong }) + addformatter(formatters,"edayshort", [[toedayshort(%s)]], { toedayshort = toedayshort }) + addformatter(formatters,"eweekday", [[toeweekday(%s)]], { toeweekday = toeweekday }) + + addformatter(formatters,"edate", [[toedate(%s,%s)]], { toedate = toedate }) + +end + +-- a prelude to a function that we can use at the lua end + +-- day:ord month:mmem +-- j and jj obsolete + +local spaced = { + [v_year] = true, + [v_month] = true, + [v_MONTH] = true, + [v_day] = true, + [v_weekday] = true, + [v_WEEKDAY] = true, +} + +local dateconverters = { + ["hebrew:to"] = gregorian_to_hebrew, + ["jalali:to"] = gregorian_to_jalali, + ["jalali:from"] = jalali_to_gregorian, +} + +local variants = { + mnem = { + month = monthmnems, + day = daymnems, + }, + hebrew = { + month = setmetatableindex(function(t,k) return months[k] .. ":hebrew" end), + day = setmetatableindex(function(t,k) return days [k] .. ":hebrew" end), + }, + jalali = { + month = setmetatableindex(function(t,k) return months[k] .. ":jalali" end), + day = setmetatableindex(function(t,k) return days [k] .. ":jalali" end), + }, +} + +do + + local function currentdate(str,currentlanguage,year,month,day) -- second argument false : no label + local list = utilities.parsers.settings_to_array(str) + local splitlabel = languages.labels.split or string.itself -- we need to get the loading order right + -- local year = tex.year + -- local month = tex.month + -- local day = tex.day + local auto = true + if currentlanguage == "" then + currentlanguage = false + end + for i=1,#list do + local entry = list[i] + local convert = dateconverters[entry] + if convert then + year, month, day = convert(year,month,day) + else + local tag, plus = splitlabel(entry) + local ordinal, mnemonic, whatordinal, highordinal = false, false, nil, false + if not tag then + tag = entry + elseif plus == "+" or plus == "ord" then + ordinal = true + elseif plus == "++" or plus == "highord" then + ordinal = true + highordinal = true + elseif plus then -- mnem MNEM etc + mnemonic = variants[plus] + end + if not auto and spaced[tag] then + ctx_space() + end + auto = false + if tag == v_year or tag == "y" or tag == "Y" then + if plus then + plus = converters[plus] + end + if plus then + context(plus(year)) + elseif currentlanguage == false then + context(year) + else + ctx_convertnumber(v_year,year) + end + elseif tag == "yy" or tag == "YY" then + context("%02i",year % 100) + elseif tag == v_month or tag == "m" then + if currentlanguage == false then + context(Word(months[month])) + else + if type(mnemonic) == "table" then + mnemonic = mnemonic.month + end + if mnemonic then + ctx_labeltext(variables[mnemonic[month]]) + else + ctx_labeltext(variables[months[month]]) + end + end + elseif tag == v_MONTH then + if currentlanguage == false then + context(Word(variables[months[month]])) + else + if type(mnemonic) == "table" then + mnemonic = mnemonic.month + end + if mnemonic then + ctx_LABELTEXT(variables[mnemonic[month]]) + else + ctx_LABELTEXT(variables[months[month]]) + end + end + elseif tag == "mm" then + context("%02i",month) + elseif tag == "M" then + context(month) + elseif tag == v_day or tag == "d" then + if plus then + plus = converters[plus] + end + if plus then + context(plus(day)) + elseif currentlanguage == false then + context(day) + else + ctx_convertnumber(v_day,day) + end + whatordinal = day + elseif tag == "dd" then + context("%02i",day) + whatordinal = day + elseif tag == "D" then + context(day) + whatordinal = day + elseif tag == v_weekday or tag == "w" then + local wd = weekday(day,month,year) + if currentlanguage == false then + context(Word(days[wd])) + else + if type(mnemonic) == "table" then + mnemonic = mnemonic.day + end + if mnemonic then + ctx_labeltext(variables[mnemonic[wd]]) + else + ctx_labeltext(variables[days[wd]]) + end + end + elseif tag == v_WEEKDAY then + local wd = weekday(day,month,year) + if currentlanguage == false then + context(Word(days[wd])) + else + if type(mnemonic) == "table" then + mnemonic = mnemonic.day + end + if mnemonic then + ctx_LABELTEXT(variables[mnemonic[wd]]) + else + ctx_LABELTEXT(variables[days[wd]]) + end + end + elseif tag == "W" then + context(weekday(day,month,year)) + elseif tag == v_referral then + context("%04i%02i%02i",year,month,day) + elseif tag == v_space or tag == "\\ " then + ctx_space() + auto = true + elseif tag ~= "" then + context(tag) + auto = true + end + if ordinal and whatordinal then + if currentlanguage == false then + -- ignore + else + context[highordinal and "highordinalstr" or "ordinalstr"](converters.ordinal(whatordinal,currentlanguage)) + end + end + end + end + end + + implement { + name = "currentdate", + arguments = { "string", "string", "string", "integer", "integer", "integer" }, + actions = function(pattern,default,language,year,month,day) + currentdate( + pattern == "" and default or pattern, + language == "" and false or language, + year, month, day + ) + end, + } + + local function todate(s,y,m,d) + if y or m or d then + return formatters["\\date[y=%s,m=%s,d=%s][%s]\\relax"](y or "",m or "",d or "",s or "") + else + return formatters["\\currentdate[%s]\\relax"](s) + end + end + + addformatter(formatters,"date", [[todate(...)]], { todate = todate }) + + -- context("one: %4!date!","MONTH",2020,12,11) context.par() + -- context("one: %4!date!","month",2020,12,11) context.par() + -- context("one: %4!date!","year,-,mm,-,dd",2020,12,11) context.par() + + -- context("two: %3!date!","MONTH",false,12) context.par() + -- context("two: %3!date!","month",false,12) context.par() + -- context("two: %3!date!","year,-,mm,-,dd",false,12) context.par() + +end + +implement { + name = "unihex", + arguments = "integer", + actions = { formatters["U+%05X"], context }, +} + +-- totime might move to utilities.parsers as more general helper + +local n = R("09")^1 / tonumber -- lpegpatterns.digit + +-- local p = Cf( Ct("") +-- -- year is mandate, month and day are optional +-- * Cg(Cc("year") * n) +-- * S("-/")^-1 +-- * Cg(Cc("month") * (n + Cc(1))) +-- * S("-/")^-1 +-- * Cg(Cc("day") * (n + Cc(1))) +-- -- time is optional, hour and minuta are mandate, seconds are optional +-- * ( +-- whitespace^0 +-- * P("T")^-1 +-- * whitespace^0 +-- * Cg(Cc("hour") * n) +-- * P(":")^-1 +-- * Cg(Cc("min") * n) +-- * P(":")^-1 +-- * Cg(Cc("sec") * (n + Cc(0))) +-- )^-1 +-- -- zone is optional, hour is mandate, minutes are optional +-- * ( +-- whitespace^0 +-- * Cg(Cc("tzs") * (P("+") * Cc(1) + P("-") * Cc(-1) + Cc(1))) +-- * whitespace^0 +-- * Cg(Cc("tzh") * n) +-- * P(":")^-1 +-- * Cg(Cc("tzm") * (n + Cc(0))) +-- )^-1 +-- , rawset) + +local p = Ct("") * ( + -- year is mandate, month and day are optional + (Cc("year") * n) % rawset + * S("-/")^-1 + * (Cc("month") * (n + Cc(1))) % rawset + * S("-/")^-1 + * (Cc("day") * (n + Cc(1))) % rawset + -- time is optional, hour and minuta are mandate, seconds are optional + * ( + whitespace^0 + * P("T")^-1 + * whitespace^0 + * (Cc("hour") * n) % rawset + * P(":")^-1 + * (Cc("min") * n) % rawset + * P(":")^-1 + * (Cc("sec") * (n + Cc(0))) % rawset + )^-1 + -- zone is optional, hour is mandate, minutes are optional + * ( + whitespace^0 + * (Cc("tzs") * (P("+") * Cc(1) + P("-") * Cc(-1) + Cc(1))) % rawset + * whitespace^0 + * (Cc("tzh") * n) % rawset + * P(":")^-1 + * (Cc("tzm") * (n + Cc(0))) % rawset + )^-1 +) + +function converters.totime(s) + if not s then + return + elseif type(s) == "table" then + return s + elseif type(s) == "string" then + local t = lpegmatch(p,s) + if not t then + logs.report("system","invalid time specification %a",s) + elseif t.tzh then + local localtzh, localtzm = ostimezone(true) + t.hour = t.hour + localtzh - t.tzs * t.tzh + t.min = t.min + localtzm - t.tzs * t.tzm + end + return t + end + local n = tonumber(s) + if n and n >= 0 then + return osdate("*t",n) + end +end + +function converters.settime(t) + if type(t) ~= "table" then + t = converters.totime(t) + end + if t then + texset("year", t.year or 1000) + texset("month", t.month or 1) + texset("day", t.day or 1) + texset("time", (t.hour or 0) * 60 + (t.min or 0)) + end +end + +-- taken from x-asciimath (where we needed it for a project) + +local d_one = lpegpatterns.digit +local d_two = d_one * d_one +local d_three = d_two * d_one +local d_four = d_three * d_one +local d_split = P(-1) + Carg(2) * (lpegpatterns.period /"") + +local d_spaced = (Carg(1) * d_three)^1 + +local digitized_1 = Cs ( ( + d_three * d_spaced * d_split + + d_two * d_spaced * d_split + + d_one * d_spaced * d_split + + P(1) + )^1 ) + +local p_fourbefore = d_four * d_split +local p_fourafter = d_four * P(-1) + +local p_beforesplit = d_three * d_spaced^0 * d_split + + d_two * d_spaced^0 * d_split + + d_one * d_spaced^0 * d_split + + d_one * d_split + +local p_aftersplit = p_fourafter + + d_three * d_spaced + + d_two * d_spaced + + d_one * d_spaced + +local digitized_2 = Cs ( + p_fourbefore * (p_aftersplit^0) + + p_beforesplit * ((p_aftersplit + d_one^1)^0) + ) + +local p_fourbefore = d_four * d_split +local p_fourafter = d_four +local d_spaced = (Carg(1) * (d_three + d_two + d_one))^1 +local p_aftersplit = p_fourafter * P(-1) + + d_three * d_spaced * P(1)^0 + + d_one^1 + +local digitized_3 = Cs((p_fourbefore + p_beforesplit) * p_aftersplit^0) + +local digits_space = utfchar(0x2008) + +local splitmethods = { + digitized_1, + digitized_2, + digitized_3, +} + +local replacers = table.setmetatableindex(function(t,k) + local v = lpeg.replacer(".",k) + t[k] = v + return v +end) + +function converters.spaceddigits(settings,data) + local data = tostring(data or settings.data or "") + if data ~= "" then + local method = settings.method + local split = splitmethods[tonumber(method) or 1] + if split then + local symbol = settings.symbol + local separator = settings.separator + if not symbol or symbol == "" then + symbol = "." + end + if type(separator) ~= "string" or separator == "" then + separator = digits_space + end + local result = lpegmatch(split,data,1,separator,symbol) + if not result and symbol ~= "." then + result = lpegmatch(replacers[symbol],data) + end + if result then + -- print(method,symbol,separator,data,result) + return result + end + end + end + return str +end + +-- method 2 : split 3 before and 3 after +-- method 3 : split 3 before and 3 after with > 4 before + +-- symbols is extra split (in addition to period) + +-- local setup = { splitmethod = 3, symbol = "," } +-- local setup = { splitmethod = 2, symbol = "," } +-- local setup = { splitmethod = 1, symbol = "," } +-- +-- local t = { +-- "0.00002", +-- "1", "12", "123", "1234", "12345", "123456", "1234567", "12345678", "123456789", +-- "1.1", +-- "12.12", +-- "123.123", +-- "1234.123", +-- "1234.1234", +-- "12345.1234", +-- "1234.12345", +-- "12345.12345", +-- "123456.123456", +-- "1234567.1234567", +-- "12345678.12345678", +-- "123456789.123456789", +-- "0.1234", +-- "1234.0", +-- "1234.00", +-- "0.123456789", +-- "100.00005", +-- "0.80018", +-- "10.80018", +-- "100.80018", +-- "1000.80018", +-- "10000.80018", +-- } +-- +-- for i=1,#t do +-- print(formatters["%-20s : [%s]"](t[i],converters.spaceddigits(setup,t[i]))) +-- end + +implement { + name = "spaceddigits", + actions = { converters.spaceddigits, context }, + arguments = { + { + { "symbol" }, + { "separator" }, + { "data" }, + { "method" }, + } + } +} + +local function field(n) return context(osdate("*t")[n]) end + +implement { name = "actualday", public = true, actions = function() field("day") end } +implement { name = "actualmonth", public = true, actions = function() field("month") end } +implement { name = "actualyear", public = true, actions = function() field("year") end } + +implement { + name = "uuid", + public = true, + actions = { os.uuid, context }, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl index bf607c34d07..ef28b9bca4e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl @@ -13,7 +13,7 @@ \writestatus{loading}{ConTeXt Core Macros / Conversion} -\registerctxluafile{core-con}{} +\registerctxluafile{core-con}{autosuffix} % todo: iso date ranges (from/to) @@ -115,9 +115,10 @@ \aliased \let\koreanparenthesisnumerals\koreannumeralsp \aliased \let\koreancirclenumerals \koreannumeralsc -\permanent\def\chinesenumerals #1{\clf_chinesenumerals\numexpr#1\relax{normal}} -\permanent\def\chinesecapnumerals#1{\clf_chinesenumerals\numexpr#1\relax{cap}} -\permanent\def\chineseallnumerals#1{\clf_chinesenumerals\numexpr#1\relax{all}} +\permanent\def\chinesenumerals #1{\clf_chinesenumerals\numexpr#1\relax{normal}} +\permanent\def\chinesecapnumerals #1{\clf_chinesenumerals\numexpr#1\relax{cap}} +\permanent\def\chineseallnumerals #1{\clf_chinesenumerals\numexpr#1\relax{all}} +\permanent\def\chinesedatenumerals#1{\clf_chinesenumerals\numexpr#1\relax{date}} %D \macros %D {character,Character} @@ -434,7 +435,7 @@ \permanent\tolerant\protected\def\currentdate[#1]% {\dontleavehmode \begingroup - \the\everycurrentdate + \expand\everycurrentdate \edef\m_syst_converters_date{#1}% \syst_converters_check_date_specification\m_syst_converters_date \syst_converters_check_date_specification\currentdatespecification @@ -451,15 +452,15 @@ \getdummyparameters[#1]% \normalexpanded {\endgroup - \iftok{\directdummyparameter\c!d}\emptytoks\else\normalday \number\directdummyparameter\c!d\relax\fi - \iftok{\directdummyparameter\c!m}\emptytoks\else\normalmonth\number\directdummyparameter\c!m\relax\fi - \iftok{\directdummyparameter\c!y}\emptytoks\else\normalyear \number\directdummyparameter\c!y\relax\fi}} + \ifempty{\directdummyparameter\c!d}\else\normalday \number\directdummyparameter\c!d\relax\fi + \ifempty{\directdummyparameter\c!m}\else\normalmonth\number\directdummyparameter\c!m\relax\fi + \ifempty{\directdummyparameter\c!y}\else\normalyear \number\directdummyparameter\c!y\relax\fi}} \permanent\tolerant\protected\def\date[#1]#,[#2]% sets the date ! {\dontleavehmode \begingroup \setdate[#1]% sets the date ! - \the\everycurrentdate + \expand\everycurrentdate \edef\m_syst_converters_date{#2}% \syst_converters_check_date_specification\m_syst_converters_date \syst_converters_check_date_specification\currentdatespecification @@ -767,10 +768,12 @@ \defineconversion [chinesenumerals] [\chinesenumerals] \defineconversion [chinesecapnumerals] [\chinesecapnumerals] \defineconversion [chineseallnumerals] [\chineseallnumerals] +\defineconversion [chinesedatenumerals] [\chinesedatenumerals] \defineconversion [cn] [\chinesenumerals] \defineconversion [cn-c] [\chinesecapnumerals] \defineconversion [cn-a] [\chineseallnumerals] +\defineconversion [cn-d] [\chinesedatenumerals] %D Moved from lang-def.mkiv: %D @@ -984,7 +987,7 @@ \mutable\lettonothing\spaceddigitsmethod % alternative methods : 1 default, 2 and 3 only when > 4 \mutable\lettonothing\spaceddigitssymbol % extra splitter symbol : {,} -\mutable\lettonothing\spaceddigitsseparator % separator symbol : {\Uchar{"2008}} +\mutable\lettonothing\spaceddigitsseparator % separator symbol : {\tocharacter{"2008}} \permanent\protected\def\spaceddigits#1% {\clf_spaceddigits @@ -1009,7 +1012,7 @@ %D \stoptext %D \stoptyping -\permanent\def\zeronumberconversion#1{\number\numexpr#1-\plusone\relax} +\permanent\def\zeronumberconversion#1{\the\numexpr#1-\plusone\relax} \defineconversion [zero] [\zeronumberconversion] diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-dat.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-dat.lmt index fd8aa0fb64a..9201980e4d3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-dat.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/core-dat.lmt @@ -23,13 +23,13 @@ local settings_to_hash = utilities.parsers.settings_to_hash local texgetcount = tex.getcount local texsetcount = tex.setcount -local v_yes = interfaces.variables.yes +local v_yes = interfaces.variables.yes local new_latelua = nodes.pool.latelua local implement = interfaces.implement -local c_realpageno = tex.iscount("realpageno") +local c_realpageno = tex.iscount("realpageno") local collected = allocate() local tobesaved = allocate() @@ -170,8 +170,8 @@ local cache = table.setmetatableindex(function(t,k) return v end) -local function datasetvariable(name,tag,key,cache) - local t = (cache or collected)[name] +local function datasetvariable(jobname,name,tag,key) + local t = (jobname ~= "" and cache[jobname] or collected)[name] if t == nil then if trace_datasets then report_dataset("error: unknown dataset, name %a, tag %a, not passed to tex",name) -- no tag @@ -195,8 +195,9 @@ local function datasetvariable(name,tag,key,cache) end end -local function datasetvariablefromjob(jobnname,name,tag,key) - datasetvariable(name,tag,key,cache[jobnname]) +local function datasetsize(jobname,name) + local t = (jobname ~= "" and cache[jobname] or collected)[name] + context(t and type(t) == "table" and #t or 0) end implement { @@ -215,11 +216,12 @@ implement { implement { name = "datasetvariable", actions = datasetvariable, - arguments = "3 strings", + arguments = "4 strings", } + implement { - name = "datasetvariablefromjob", - arguments = { "string", "string", "string", "string" }, - actions = datasetvariablefromjob + name = "datasetsize", + arguments = "2 strings", + actions = datasetsize, } diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl index 6d7d1bd14ae..9595eceb21b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl @@ -48,9 +48,9 @@ \installcommandhandler \??dataset {dataset} \??dataset -\permanent\tolerant\protected\def\setdataset[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setdataset[#1]#*[#S#2]#*[#S#3]% {\begingroup - \edef\currentdataset{#1}% + \cdef\currentdataset{#1}% \ifparameters\or\or \clf_setdataset name {\currentdataset}% @@ -58,7 +58,7 @@ data {#2}% \relax \or - \edef\currentdataset{#1}% + \cdef\currentdataset{#1}% \clf_setdataset name {\currentdataset}% tag {#2}% @@ -68,14 +68,41 @@ \fi \endgroup} -% \permanent\def\datasetvariable#1#2#3% -% {\clf_datasetvariable{#1}{#2}{#3}} +\permanent\tolerant\def\datasetvariable[#1]{\clf_datasetvariable{#1}} +\permanent\tolerant\def\datasetsize [#1]{\clf_datasetsize {#1}} -\permanent\tolerant\def\datasetvariable[#1]% - {\ifparameter#1\or - \expandafter\clf_datasetvariablefromjob{#1\expandafter}% - \else - \expandafter\clf_datasetvariable +% \startsetups[dataset:demo] +% \datasetvariable{autores}{\recurselevel}{whatever} +% \stopsetups +% \dorecurse{\datasetsize{demo}}{ +% \setups[dataset:demo] +% } + +% \startsetups[dataset:demo] +% \datasetvariable{autores}{\datasetindex}{whatever} +% \stopsetups +% \processdataset[demo][dataset:demo] + +% \startsetups[dataset:demo] +% \datasetentry{whatever} +% \stopsetups +% \processdataset[demo][dataset:demo] + +\mutable\let\datasetindex\!!zerocount +\mutable\let\datasetentry\gobbleoneargument + +\permanent\tolerant\protected\def\processdataset[#1]#*[#2]#*[#3]% + {\ifparameters\or + \or\system_process_dataset {}{#1}{#2}% + \or\system_process_dataset{#1}{#2}{#3}% \fi} +\def\system_process_dataset#1#2#3% + {\pushmacro\datasetindex + \pushmacro\datasetentry + \def\datasetentry{\clf_datasetvariable{#1}{#2}{\datasetindex}}% + \dorecurse{\datasetsize[#1]{#2}}{\let\datasetindex\recurselevel\directsetup{#3}}% + \popmacro\datasetentry + \popmacro\datasetindex} + \protect diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl index 839e9b2602e..59822b2374e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl @@ -136,11 +136,11 @@ \to \everybeforeoutput \appendtoks - \the\everybackendshipout + \expand\everybackendshipout \to \everyshipout \prependtoks - \the\everylastbackendshipout + \expand\everylastbackendshipout \to \everylastshipout \prependtoks diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt index 018a017679b..0072b3159eb 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt @@ -14,6 +14,7 @@ if not modules then modules = { } end modules ['core-env'] = { local rawset = rawset local P, C, S, lpegmatch, patterns = lpeg.P, lpeg.C, lpeg.S, lpeg.match, lpeg.patterns +local gmatch = string.gmatch local context = context local ctxcore = context.core @@ -35,8 +36,7 @@ texconditionals = allocate { } tex.conditionals = texconditionals texifs = allocate { } tex.ifs = texifs texisdefined = allocate { } tex.isdefined = texisdefined -local modes = { } -local systemmodes = { } +local implement = interfaces.implement -- we could use the built-in tex.is[count|dimen|skip|toks] here but caching -- at the lua end is not that bad (and we need more anyway) @@ -46,15 +46,18 @@ local cache = tokens.cache -- we can have a modes cache too local commandcodes = tokens.commands -local iftrue = cache["iftrue"].index --- local dimencode = cache["scratchdimen"] .command -- tokens.commands.register_dimen --- local countcode = cache["scratchcounter"].command -- tokens.commands.register_int --- local tokencode = cache["scratchtoks"] .command -- tokens.commands.register_toks --- local skipcode = cache["scratchskip"] .command -- tokens.commands.register_glue --- local muskipcode = cache["scratchmuskip"] .command -- tokens.commands.register_mu_glue --- local conditioncode = cache["iftrue"] .command -- tokens.commands.if_test +local iftrue = cache["iftrue"].index +local conditioncode = commandcodes.if_test +local integercode = commandcodes.integer + +-- local dimencode = commandcodes.register_dimenension +-- local countcode = commandcodes.register_integer +-- local tokencode = commandcodes.register_toks +-- local skipcode = commandcodes.register_glue +-- local muskipcode = commandcodes.register_mu_glue +-- -- local types = { -- [dimencode] = "dimen", -- [countcode] = "count", @@ -62,51 +65,175 @@ local iftrue = cache["iftrue"].index -- [skipcode] = "skip", -- [muskipcode] = "muskip", -- -- [attributecode] = "attribute", --- [conditioncode] = "condition" +-- [conditioncode] = "condition", +-- [integercode] = "integer", -- } -local dimencode = commandcodes.register_dimen -- cache["scratchdimen"] .command -- tokens.commands.register_dimen -local countcode = commandcodes.register_int -- cache["scratchcounter"].command -- tokens.commands.register_int -local tokencode = commandcodes.register_toks -- ["scratchtoks"] .command -- tokens.commands.register_toks -local skipcode = commandcodes.register_glue -- cache["scratchskip"] .command -- tokens.commands.register_glue -local muskipcode = commandcodes.register_mu_glue -- cache["scratchmuskip"] .command -- tokens.commands.register_mu_glue -local conditioncode = commandcodes.if_test -- cache["iftrue"] .command -- tokens.commands.if_test -local integercode = commandcodes.integer - -local types = { - [dimencode] = "dimen", - [countcode] = "count", - [tokencode] = "token", - [skipcode] = "skip", - [muskipcode] = "muskip", - -- [attributecode] = "attribute", - [conditioncode] = "condition", - [integercode] = "integer", -} - -setmetatableindex(texmodes, function(t,k) - local m = systemmodes[k] - if not m then - local n = "mode>" .. k - m = function() return texgetintegervalue(n) == 1 end - rawset(modes,k,m) +-- setmetatableindex(texmodes, function(t,k) +-- local m = modes[k] +-- if not m then +-- local n = "mode>" .. k +-- m = function() return texgetintegervalue(n) == 1 end +-- rawset(modes,k,m) +-- end +-- return m() +-- end) + +-- setmetatableindex(texsystemmodes, function(t,k) +-- local m = systemmodes[k] +-- if not m then +-- local n = "mode>*" .. k +-- m = function() return texgetintegervalue(n) == 1 end +-- rawset(modes,k,m) +-- end +-- return m() +-- end) + +do + + local modes = { } + local systemmodes = { } + + local texiscount = tex.iscount + local texgetcount = tex.getcount + + local boolean_value = tokens.values.boolean + + local function nomode() + return false end - return m() -end) -setmetatableindex(texsystemmodes, function(t,k) - local m = systemmodes[k] - if not m then - local n = "mode>*" .. k - m = function() return texgetintegervalue(n) == 1 end - rawset(modes,k,m) - end - return m() -end) + setmetatableindex(texmodes, function(t,k) + local m = modes[k] + if not m then + local n = "mode>" .. k + local i = texiscount(n) + if i then + m = i and function() return texgetcount(i) == 1 end or nomode + rawset(modes,k,m) + else + return false + end + end + return m() + end) + + setmetatableindex(texsystemmodes, function(t,k) + local m = systemmodes[k] + if not m then + local n = "mode>*" .. k + local i = texiscount(n) + if i then + m = i and function() return texgetcount(i) == 1 end or nomode + rawset(systemmodes,k,m) + else + return false + end + end + return m() + end) + + local c_trialtypesetting = tex.iscount("mode>*trialtypesetting") + + context.settrialtypesettingmethod(function() + -- return texsystemmodes.trialtypesetting + -- upto three times faster: + return texgetcount(c_trialtypesetting) == 1 + end) + + implement { + name = "ifmode", + public = true, + usage = "condition", + arguments = "argument", + actions = function(m) + return boolean_value, texmodes[m] + end + } + + implement { + name = "ifsystemmode", + public = true, + usage = "condition", + arguments = "argument", + actions = function(m) + return boolean_value, texsystemmodes[m] + end + } + +-- local settings_to_array = utilities.parsers.settings_to_array + +-- local cache = table.setmetatableindex(function(t,k) +-- local v = settings_to_array(k) +-- if #v < 2 then +-- v = false +-- end +-- t[k] = v +-- return v +-- end) + + local cache = utilities.parsers.hashes.settings_to_list + + implement { + name = "ifmodes", + public = true, + usage = "condition", + arguments = "argument", + actions = function(m) + local c = cache[m] + local n = #c + if n > 1 then + for i=1,n do + if texmodes[c[i]] then + return boolean_value, true + end + end + return boolean_value, false + else + return boolean_value, texmodes[m] + end + end + } + + implement { + name = "ifallmodes", + public = true, + usage = "condition", + arguments = "argument", + actions = function(m) + local c = cache[m] + if c then + for i=1,#c do + if not texmodes[c[i]] then + return boolean_value, false + end + end + return boolean_value, true + else + return boolean_value, texmodes[m] + end + end + } --- also a call method +end + +do + + local namespace = interfaces.getnamespace("setup") + + implement { + name = "ifsetups", + public = true, + usage = "condition", + arguments = "argument", + actions = function(m) + return boolean_value, isdefined(namespace .. m) + end + } -context.settrialtypesettingmethod(function() return texsystemmodes.trialtypesetting end) +end + +-- also a call method setmetatablenewindex(texmodes, function(t,k) report_mode("you cannot set the %s named %a this way","mode", k) end) setmetatablenewindex(texsystemmodes, function(t,k) report_mode("you cannot set the %s named %a this way","systemmode", k) end) @@ -132,35 +259,10 @@ end) tex.isdefined = isdefined --- function tex.isdimen(name) --- local hit = cache[name] --- return hit.command == dimencode and hit.index or true --- end --- --- function tex.iscount(name) --- local hit = cache[name] --- return hit.command == countcode and hit.index or true --- end --- --- function tex.istoken(name) --- local hit = cache[name] --- return hit.command == tokencode and hit.index or true --- end --- --- function tex.isskip(name) --- local hit = cache[name] --- return hit.command == skipcode and hit.index or true --- end --- --- function tex.ismuskip(name) --- local hit = cache[name] --- return hit.command == muskipcode and hit.index or true +-- function tex.type(name) +-- return types[cache[name].command] or "macro" -- end -function tex.type(name) - return types[cache[name].command] or "macro" -end - function context.setconditional(name,value) if value then ctxcore.settruevalue(name) @@ -191,20 +293,24 @@ context.conditionals = texconditionals -------.constants = texconstants -------.ifs = texifs -local sep = S("), ") -local str = C((1-sep)^1) -local tag = P("(") * C((1-S(")" ))^1) * P(")") -local arg = P("(") * C((1-S("){"))^1) * P("{") * C((1-P("}"))^0) * P("}") * P(")") - -local pattern = ( - P("lua") * tag / ctxcore.luasetup - + P("xml") * arg / ctxcore.setupwithargument -- or xmlw as xmlsetup has swapped arguments - + (P("tex") * tag + str) / ctxcore.texsetup - + sep^1 -)^1 - -interfaces.implement { - name = "autosetups", - actions = function(str) lpegmatch(pattern,str) end, - arguments = "string" -} +do + + local sep = S("), ") + local str = C((1-sep)^1) + local tag = P("(") * C((1-S(")" ))^1) * P(")") + local arg = P("(") * C((1-S("){"))^1) * P("{") * C((1-P("}"))^0) * P("}") * P(")") + + local pattern = ( + P("lua") * tag / ctxcore.luasetup + + P("xml") * arg / ctxcore.setupwithargument -- or xmlw as xmlsetup has swapped arguments + + (P("tex") * tag + str) / ctxcore.texsetup + + sep^1 + )^1 + + implement { + name = "autosetups", + actions = function(str) lpegmatch(pattern,str) end, + arguments = "string" + } + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl index 0777d282354..bd3e9536045 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl @@ -13,6 +13,8 @@ \writestatus{loading}{ConTeXt Core Macros / Environments} +\installcorenamespace{setup} % is referenced in the lmt file: + \registerctxluafile{core-env}{autosuffix} \unprotect @@ -189,12 +191,12 @@ \expandafter\syst_modes_check_nop \fi#1#2{#3}} -\def\syst_modes_check_ss#1#2[#3]% - {\ifcsname\??mode#3\endcsname - \expandafter\syst_modes_check_yes - \else - \expandafter\syst_modes_check_nop - \fi#1#2{#3}} +% \def\syst_modes_check_ss#1#2[#3]% +% {\ifcsname\??mode#3\endcsname +% \expandafter\syst_modes_check_yes +% \else +% \expandafter\syst_modes_check_nop +% \fi#1#2{#3}} % all @@ -213,47 +215,82 @@ \let\syst_modes_check_all_step\gobbleoneargument \fi} -\def\syst_modes_check_all_lr#1#2#3% - {\let\syst_modes_check_all_step\syst_modes_check_all_indeed - \fastprocesscommacommand[#3]\syst_modes_check_all_step - \ifx\syst_modes_check_all_step\gobbleoneargument - \expandafter#2% - \else - \expandafter#1% - \fi} - -\def\syst_modes_check_all_ss#1#2[#3]% - {\let\syst_modes_check_all_step\syst_modes_check_all_indeed - \fastprocesscommacommand[#3]\syst_modes_check_all_step - \ifx\syst_modes_check_all_step\gobbleoneargument - \expandafter#2% - \else - \expandafter#1% - \fi} +% \def\syst_modes_check_all_lr#1#2#3% +% {\let\syst_modes_check_all_step\syst_modes_check_all_indeed +% \fastprocesscommacommand[#3]\syst_modes_check_all_step +% \ifx\syst_modes_check_all_step\gobbleoneargument +% \expandafter#2% +% \else +% \expandafter#1% +% \fi} -\permanent\protected\def\doifelsemode {\syst_modes_check_lr \firstoftwoarguments \secondoftwoarguments} -\permanent\protected\def\doifmode {\syst_modes_check_lr \firstofoneargument \gobbleoneargument} -\permanent\protected\def\doifnotmode {\syst_modes_check_lr \gobbleoneargument \firstofoneargument} -\permanent\protected\def\startmode {\syst_modes_check_ss \donothing \syst_modes_stop_yes} -\permanent\protected\def\startnotmode {\syst_modes_check_ss \syst_modes_stop_nop \donothing} -\permanent\protected\def\doifelseallmodes{\syst_modes_check_all_lr\firstoftwoarguments \secondoftwoarguments} -\permanent\protected\def\doifallmodes {\syst_modes_check_all_lr\firstofoneargument \gobbleoneargument} -\permanent\protected\def\doifnotallmodes {\syst_modes_check_all_lr\gobbleoneargument \firstofoneargument} -\permanent\protected\def\startallmodes {\syst_modes_check_all_ss\donothing \syst_modes_stop_all_yes} -\permanent\protected\def\startnotallmodes{\syst_modes_check_all_ss\syst_modes_stop_all_nop\donothing} +% \def\syst_modes_check_all_ss#1#2[#3]% +% {\let\syst_modes_check_all_step\syst_modes_check_all_indeed +% \fastprocesscommacommand[#3]\syst_modes_check_all_step +% \ifx\syst_modes_check_all_step\gobbleoneargument +% \expandafter#2% +% \else +% \expandafter#1% +% \fi} -\aliased\let\doifmodeelse \doifelsemode -\aliased\let\doifallmodeselse\doifelseallmodes +% \enablemode[foomode] +% \enablemode[oofmode] +% +% \ifmode {foomode} YES \else NOP \fi \par +% \ifmodes {oofmode,foomode} YES \else NOP \fi \par +% \ifallmodes {oofmode,foomode} YES \else NOP \fi \par +% \doifelsemode {foomode} {YES} {NOP} \par +% \doifelsemode {oofmode,foomode} {YES} {NOP} \par +% \doifelseallmodes{oofmode,foomode} {YES} {NOP} \par + +% \permanent\protected\def\doifelsemode {\syst_modes_check_lr \firstoftwoarguments \secondoftwoarguments} +% \permanent\protected\def\doifmode {\syst_modes_check_lr \firstofoneargument \gobbleoneargument} +% \permanent\protected\def\doifnotmode {\syst_modes_check_lr \gobbleoneargument \firstofoneargument} +% \permanent\protected\def\startmode {\syst_modes_check_ss \donothing \syst_modes_stop_yes} +% \permanent\protected\def\startnotmode {\syst_modes_check_ss \syst_modes_stop_nop \donothing} +% \permanent\protected\def\doifelseallmodes{\syst_modes_check_all_lr\firstoftwoarguments \secondoftwoarguments} +% \permanent\protected\def\doifallmodes {\syst_modes_check_all_lr\firstofoneargument \gobbleoneargument} +% \permanent\protected\def\doifnotallmodes {\syst_modes_check_all_lr\gobbleoneargument \firstofoneargument} +% \permanent\protected\def\startallmodes {\syst_modes_check_all_ss\donothing \syst_modes_stop_all_yes} +% \permanent\protected\def\startnotallmodes{\syst_modes_check_all_ss\syst_modes_stop_all_nop\donothing} +% +% \aliased\let\doifmodeelse \doifelsemode +% \aliased\let\doifallmodeselse\doifelseallmodes +% +% \permanent\protected\def\stopmode {} % no relax +% \permanent\protected\def\stopnotmode {} % no relax +% \permanent\protected\def\stopallmodes {} % no relax +% \permanent\protected\def\stopnotallmodes{} % no relax +% +% \def\syst_modes_stop_yes #-\stopmode {} +% \def\syst_modes_stop_nop #-\stopnotmode {} +% \def\syst_modes_stop_all_yes#-\stopallmodes {} +% \def\syst_modes_stop_all_nop#-\stopnotallmodes{} + +\permanent\protected\def\doifelsemode #1{\ifmodes {#1}\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi} +\permanent\protected\def\doifmode #1{\ifmodes {#1}\expandafter\firstofoneargument \else\expandafter\gobbleoneargument \fi} +\permanent\protected\def\doifnotmode #1{\ifmodes {#1}\expandafter\gobbleoneargument \else\expandafter\firstofoneargument \fi} +\permanent\protected\def\doifelseallmodes#1{\ifallmodes{#1}\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi} +\permanent\protected\def\doifallmodes #1{\ifallmodes{#1}\expandafter\firstofoneargument \else\expandafter\gobbleoneargument \fi} +\permanent\protected\def\doifnotallmodes #1{\ifallmodes{#1}\expandafter\gobbleoneargument \else\expandafter\firstofoneargument \fi} + +% \permanent\protected\def\startmode [#1]{\ifmodes {#1}\else\expandafter\ignoreupto\expandafter\stopmode \fi} +% \permanent\protected\def\startallmodes [#1]{\ifallmodes{#1}\else\expandafter\ignoreupto\expandafter\stopallmodes \fi} +% \permanent\protected\def\startnotmode [#1]{\ifmodes {#1}\expandafter \ignoreupto\expandafter\stopnotmode \fi} +% \permanent\protected\def\startnotallmodes[#1]{\ifallmodes{#1}\expandafter \ignoreupto\expandafter\stopnotallmodes\fi} + +\permanent\protected\def\startmode [#1]{\ifmodes {#1}\else\expandafter\ignorenestedupto\expandafter\startmode \expandafter\stopmode \fi} +\permanent\protected\def\startallmodes [#1]{\ifallmodes{#1}\else\expandafter\ignorenestedupto\expandafter\startallmodes \expandafter\stopallmodes \fi} +\permanent\protected\def\startnotmode [#1]{\ifmodes {#1}\expandafter \ignorenestedupto\expandafter\startnotmode \expandafter\stopnotmode \fi} +\permanent\protected\def\startnotallmodes[#1]{\ifallmodes{#1}\expandafter \ignorenestedupto\expandafter\startnotallmodes\expandafter\stopnotallmodes\fi} \permanent\protected\def\stopmode {} % no relax \permanent\protected\def\stopnotmode {} % no relax \permanent\protected\def\stopallmodes {} % no relax \permanent\protected\def\stopnotallmodes{} % no relax -\def\syst_modes_stop_yes #1\stopmode {} -\def\syst_modes_stop_nop #1\stopnotmode {} -\def\syst_modes_stop_all_yes#1\stopallmodes {} -\def\syst_modes_stop_all_nop#1\stopnotallmodes{} +\aliased\let\doifmodeelse \doifelsemode +\aliased\let\doifallmodeselse\doifelseallmodes %D Pushing/popping: @@ -310,7 +347,7 @@ \permanent\protected\def\startmodeset {\push_macro_c_syst_modes_set_done - \setfalse\c_syst_modes_set_done + \c_syst_modes_set_done\conditionalfalse \syst_modes_set_start} \permanent\protected\lettonothing\stopmodeset @@ -331,7 +368,7 @@ {\syst_modes_check_lr\syst_modes_set_yes\syst_modes_set_nop\m_mode_case} \tolerant\def\syst_modes_set_yes#1% - {\settrue\c_syst_modes_set_done + {\c_syst_modes_set_done\conditionaltrue #1% \syst_modes_set_start} @@ -348,7 +385,7 @@ %D Setups: -\installcorenamespace{setup} % we can probably get rid of some :'s later on +% \installcorenamespace{setup} % we can probably get rid of some :'s later on % \protected\def\startsetups{} % to please dep checker % \protected\def\stopsetups {} % to please dep checker @@ -366,7 +403,7 @@ \letcsname\??setup:\??empty\endcsname\gobbleoneargument \permanent\def\syst_setups#1% the grid option will be extended to other main modes - {\csname\??setup + {\begincsname\??setup \ifgridsnapping \ifcsname\??setup\v!grid:#1\endcsname\v!grid:#1\else:\ifcsname\??setup:#1\endcsname#1\else\??empty\fi\fi \else @@ -376,9 +413,9 @@ % no checking and we assume it being defined: -\permanent\def\fastsetup #1{\csname\??setup:#1\endcsname\empty} -\permanent\def\fastsetupwithargument #1{\csname\??setup:#1\endcsname} % swapped per 2015-08-30 -\permanent\def\fastsetupwithargumentswapped#1#2{\csname\??setup:#2\endcsname{#1}}% swapped per 2015-09-05 +\permanent\def\fastsetup #1{\begincsname\??setup:#1\endcsname\empty} +\permanent\def\fastsetupwithargument #1{\begincsname\??setup:#1\endcsname} % swapped per 2015-08-30 +\permanent\def\fastsetupwithargumentswapped#1#2{\begincsname\??setup:#2\endcsname{#1}}% swapped per 2015-09-05 %D The next one is meant for \c!setups situations, hence the check for a %D shortcut. @@ -528,52 +565,69 @@ \permanent\protected\def\startlocalsetups{\begingroup\doifelsenextoptionalcs\syst_setups_start_loc_yes\syst_setups_start_loc_nop} \permanent\protected\lettonothing\stoplocalsetups \permanent\protected\def\startsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_tex_yes\syst_setups_start_tex_nop} \permanent\protected\lettonothing\stopsetups -\def\syst_setups_start_lua_two#1#2#+\stopluasetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} -\def\syst_setups_start_xml_two#1#2#+\stopxmlsetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} -\def\syst_setups_start_raw_two#1#2#+\stoprawsetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} -\def\syst_setups_start_loc_two#1#2#+\stoplocalsetups{\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} -\def\syst_setups_start_tex_two#1#2#+\stopsetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_lua_two#1#2#+\stopluasetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_xml_two#1#2#+\stopxmlsetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_raw_two#1#2#+\stoprawsetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_loc_two#1#2#+\stoplocalsetups{\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_tex_two#1#2#+\stopsetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}} + +% \def\syst_setups_start_lua_two#1#2#+\stopluasetups {\endgroup\instance\defcsname\??setup#1:#2\endcsname##1{#3}} % + keep braces +% \def\syst_setups_start_xml_two#1#2#+\stopxmlsetups {\endgroup\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_raw_two#1#2#+\stoprawsetups {\endgroup\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_loc_two#1#2#+\stoplocalsetups{\endgroup\instance\defcsname\??setup#1:#2\endcsname##1{#3}} +% \def\syst_setups_start_tex_two#1#2#+\stopsetups {\endgroup\instance\defcsname\??setup#1:#2\endcsname##1{#3}} + +\let\syst_setups_defcsname\defcsname + +\permanent\protected\def\pushglobalsetups{\let\syst_setups_defcsname\gdefcsname} +\permanent\protected\def\popglobalsetups {\let\syst_setups_defcsname\defcsname } + +\def\syst_setups_start_lua_two#1#2#L\startluasetups #R\stopluasetups #+{\endgroup\instance\syst_setups_defcsname\??setup#1:#2\endcsname##1{#3}} % + keep braces +\def\syst_setups_start_xml_two#1#2#L\startxmlsetups #R\stopxmlsetups #+{\endgroup\instance\syst_setups_defcsname\??setup#1:#2\endcsname##1{#3}} +\def\syst_setups_start_raw_two#1#2#L\startrawsetups #R\stoprawsetups #+{\endgroup\instance\syst_setups_defcsname\??setup#1:#2\endcsname##1{#3}} +\def\syst_setups_start_loc_two#1#2#L\startlocalsetups#R\stoplocalsetups#+{\endgroup\instance\syst_setups_defcsname\??setup#1:#2\endcsname##1{#3}} +\def\syst_setups_start_tex_two#1#2#L\startsetups #R\stopsetups #+{\endgroup\instance\syst_setups_defcsname\??setup#1:#2\endcsname##1{#3}} \tolerant\def\syst_setups_start_lua_yes[#1]#*[#2]% - {\the\t_syst_setups_lua + {\expand\t_syst_setups_lua \ifarguments\expandafter\syst_setups_start_lua_one \or \expandafter\syst_setups_start_lua_one \else \expandafter\syst_setups_start_lua_two \fi{#1}{#2}} \tolerant\def\syst_setups_start_xml_yes[#1]#*[#2]% - {\the\t_syst_setups_xml + {\expand\t_syst_setups_xml \ifarguments\expandafter\syst_setups_start_xml_one \or \expandafter\syst_setups_start_xml_one \else \expandafter\syst_setups_start_xml_two \fi{#1}{#2}} \tolerant\def\syst_setups_start_raw_yes[#1]#*[#2]% - {\the\t_syst_setups_raw + {\expand\t_syst_setups_raw \ifarguments\expandafter\syst_setups_start_raw_one \or \expandafter\syst_setups_start_raw_one \else \expandafter\syst_setups_start_raw_two \fi{#1}{#2}} \tolerant\def\syst_setups_start_loc_yes[#1]#*[#2]% - {\the\t_syst_setups_loc + {\expand\t_syst_setups_loc \ifarguments\expandafter\syst_setups_start_loc_one \or \expandafter\syst_setups_start_loc_one \else \expandafter\syst_setups_start_loc_two \fi{#1}{#2}} \tolerant\def\syst_setups_start_tex_yes[#1]#*[#2]% - {\the\t_syst_setups_tex + {\expand\t_syst_setups_tex \ifarguments\expandafter\syst_setups_start_tex_one \or \expandafter\syst_setups_start_tex_one \else \expandafter\syst_setups_start_tex_two \fi{#1}{#2}} -\def\syst_setups_start_lua_nop#1 {\the\t_syst_setups_lua\syst_setups_start_lua_two{}{#1}} % space delimited -\def\syst_setups_start_xml_nop#1 {\the\t_syst_setups_xml\syst_setups_start_xml_two{}{#1}} % space delimited -\def\syst_setups_start_raw_nop#1 {\the\t_syst_setups_raw\syst_setups_start_raw_two{}{#1}} % space delimited -\def\syst_setups_start_loc_nop#1 {\the\t_syst_setups_loc\syst_setups_start_loc_two{}{#1}} % space delimited -\def\syst_setups_start_tex_nop#1 {\the\t_syst_setups_tex\syst_setups_start_tex_two{}{#1}} % space delimited +\def\syst_setups_start_lua_nop#1 {\expand\t_syst_setups_lua\syst_setups_start_lua_two{}{#1}} % space delimited +\def\syst_setups_start_xml_nop#1 {\expand\t_syst_setups_xml\syst_setups_start_xml_two{}{#1}} % space delimited +\def\syst_setups_start_raw_nop#1 {\expand\t_syst_setups_raw\syst_setups_start_raw_two{}{#1}} % space delimited +\def\syst_setups_start_loc_nop#1 {\expand\t_syst_setups_loc\syst_setups_start_loc_two{}{#1}} % space delimited +\def\syst_setups_start_tex_nop#1 {\expand\t_syst_setups_tex\syst_setups_start_tex_two{}{#1}} % space delimited \def\syst_setups_start_lua_one#1#2{\syst_setups_start_lua_two{}{#1}} % [..] \def\syst_setups_start_xml_one#1#2{\syst_setups_start_xml_two{}{#1}} % [..] @@ -618,22 +672,24 @@ \installcorenamespace{variables} -\permanent\protected\def\setvariables {\syst_variables_set[\getrawparameters ]} -\permanent\protected\def\setevariables{\syst_variables_set[\getraweparameters]} -\permanent\protected\def\setgvariables{\syst_variables_set[\getrawgparameters]} -\permanent\protected\def\setxvariables{\syst_variables_set[\getrawxparameters]} +\permanent\protected\def\setvariables {\syst_variables_set\getparameters } +\permanent\protected\def\setevariables{\syst_variables_set\geteparameters} +\permanent\protected\def\setgvariables{\syst_variables_set\getgparameters} +\permanent\protected\def\setxvariables{\syst_variables_set\getxparameters} \mutable\lettonothing\currentvariableclass -\tolerant\def\syst_variables_set[#1]#*[#2]#*[#3]% tricky, test on s-pre-60 - {\doifelse{#2}\currentvariableclass - {#1[\??variables#2:][#3]}% - {\pushmacro\currentvariableclass - \def\currentvariableclass{#2}% - \getvariable{#2}\s!reset - #1[\??variables#2:][#3]% - \getvariable{#2}\s!set - \popmacro\currentvariableclass}} +\tolerant\def\syst_variables_set#1#*[#2]#*[#S#3]% tricky, test on s-pre-60 + {\ifcstok{#2}\currentvariableclass + #1[\??variables#2:][#3]% + \else + \pushmacro\currentvariableclass + \cdef\currentvariableclass{#2}% + \getvariable{#2}\s!reset + #1[\??variables#2:][#3]% + \getvariable{#2}\s!set + \popmacro\currentvariableclass + \fi} \permanent\protected\def\setvariable #1#2#3{\defcsname \??variables#1:#2\endcsname{#3}} \permanent\protected\def\setevariable#1#2#3{\edefcsname\??variables#1:#2\endcsname{#3}} @@ -648,20 +704,36 @@ %D %D I'll probably forget that this on exists. -\lettonothing\m_syst_variables_temp +% \lettonothing\m_syst_variables_temp +% +% \permanent\tolerant\def\checkvariables[#1]#*[#2]% +% {\dogetparameters\syst_variables_check_value[#1][#2]} +% +% \def\syst_variables_check_value#1#2#3% +% {\ifcsname\??variables#1:#2\endcsname +% \edef\m_syst_variables_temp{\lastnamedcs}% +% \ifempty\m_syst_variables_temp +% \defcsname\??variables#1:#2\endcsname{#3}% +% \fi +% \else +% \defcsname\??variables#1:#2\endcsname{#3}% +% \fi} -\permanent\tolerant\def\checkvariables[#1]#*[#2]% - {\dogetparameters\syst_variables_check_value[#1][#2]} +\permanent\protected\def\checkvariables[#1]#*[#S#2]% + {\cdef\m_syst_parameter{#1}% + \syst_variables_check_value#2\ignorearguments\ignorearguments} -\def\syst_variables_check_value#1#2#3% - {\ifcsname\??variables#1:#2\endcsname - \edef\m_syst_variables_temp{\lastnamedcs}% - \ifempty\m_syst_variables_temp - \defcsname\??variables#1:#2\endcsname{#3}% - \fi - \else - \defcsname\??variables#1:#2\endcsname{#3}% - \fi} +\tolerant\def\syst_variables_check_value#*#1=#S#2,#M,% + {\ifarguments + \expandafter\gobbleoneargument + \or + \mult_interfaces_get_parameters_error_indeed\m_syst_parameter{#1}% + \orunless\ifcsname\??variables\m_syst_parameter:#1\endcsname + \defcsname\??variables\m_syst_parameter:#1\endcsname{#2}% + \orelse\ifempty{\lastnamedcs}% + \defcsname\??variables\m_syst_parameter:#1\endcsname{#2}% + \fi + \syst_variables_check_value} %D \macros %D {doifelsevariable,doifvariable,doifnotvariable} @@ -729,8 +801,8 @@ \expandafter\firstofoneargument \fi} -\permanent\tolerant\protected\def\setupenv[#1]% - {\syst_variables_set[\getrawparameters][\s!environment][#1]} +\permanent\tolerant\protected\def\setupenv + {\syst_variables_set\getparameters[\s!environment]} \permanent\protected\def\doifelseenv{\doifelsevariable \s!environment} \permanent\protected\def\doifenv {\doifvariable \s!environment} diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl index a0fd8af1068..a83dee0e155 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl @@ -66,12 +66,12 @@ \newconditional\simplifyingcommands % public -\permanent\protected\def\forgetall {\the\everyforgetall} -\permanent\protected\def\cleanupfeatures {\the\everycleanupfeatures} -\permanent\protected\def\simplifycommands{\the\everysimplifycommands} +\permanent\protected\def\forgetall {\expand\everyforgetall} +\permanent\protected\def\cleanupfeatures {\expand\everycleanupfeatures} +\permanent\protected\def\simplifycommands{\expand\everysimplifycommands} \appendtoks - \settrue\simplifyingcommands + \simplifyingcommands\conditionaltrue \to \everysimplifycommands \appendtoks @@ -104,8 +104,8 @@ \newtoks \everyendofpar %newtoks \everyparflush -\protected\def\bpar{\the\everybeginofpar\ignorespaces} % may interfere with \everypar -\protected\def\epar{\ifhmode\removeunwantedspaces\the\everyendofpar\fi} % test prevents problems with \bpar\epar +\protected\def\bpar{\expand\everybeginofpar\ignorespaces} % may interfere with \everypar +\protected\def\epar{\ifhmode\removeunwantedspaces\expand\everyendofpar\fi} % test prevents problems with \bpar\epar %D Lists: @@ -133,8 +133,11 @@ \newtoks \everybeforedisplayformula \newtoks \everymathematics -\prependtoks \the\everymathematics \to \everymath -\prependtoks \the\everymathematics \to \everydisplay +% \prependtoks \expand\everymathematics \to \everymath +% \prependtoks \expand\everymathematics \to \everydisplay + +\tokspre\everymath {\expand\everymathematics} +\tokspre\everydisplay{\expand\everymathematics} %D Tables: @@ -145,8 +148,8 @@ \newtoks\everystarttextproperties \newtoks\everystoptextproperties -\permanent\protected\def\starttextproperties{\the\everystarttextproperties} -\permanent\protected\def\stoptextproperties {\the\everystoptextproperties} +\permanent\protected\def\starttextproperties{\expand\everystarttextproperties} +\permanent\protected\def\stoptextproperties {\expand\everystoptextproperties} %D \macros %D {trialtypesetting} @@ -204,7 +207,7 @@ \boxedcontenttrue \to \everyboxedcontent -\permanent\protected\def\startboxedcontent{\bgroup\the\everyboxedcontent} +\permanent\protected\def\startboxedcontent{\bgroup\expand\everyboxedcontent} \aliased\let\stopboxedcontent\egroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-lmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-lmt.lmt index ccbdcc0dff6..cccd27af199 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-lmt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/core-lmt.lmt @@ -22,7 +22,7 @@ local getlinedir = tex.getlinedir local getpardir = tex.getpardir local getboxdir = tex.getboxdir -local none_code = tokens.values.none +local none_code = tokens.values.none local context = context diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-pag.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-pag.lmt index 219171d424e..c8a521dfd10 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-pag.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/core-pag.lmt @@ -28,8 +28,8 @@ local new_latelua = nodes.pool.latelua local implement = interfaces.implement local getnamespace = interfaces.getnamespace -local c_realpageno = tex.iscount("realpageno") -local c_realpagestateno = tex.iscount("realpagestateno") +local c_realpageno = tex.iscount("realpageno") +local c_realpagestateno = tex.iscount("realpagestateno") local collected = allocate() local tobesaved = allocate() diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-pag.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-pag.mkxl index 43b398b16cb..6f035ea3e49 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-pag.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-pag.mkxl @@ -36,7 +36,7 @@ \permanent\tolerant\protected\def\setpagestate[#1]#*[#2]% {\begingroup - \edef\currentpagestate{#1}% + \cdef\currentpagestate{#1}% \ifcsname\??pagestatecounter\currentpagestate\endcsname \scratchcounter\lastnamedcs \advanceby\scratchcounter\plusone @@ -47,7 +47,7 @@ \global\csname\??pagestatecounter\currentpagestate\endcsname\scratchcounter \clf_setpagestate name {\currentpagestate}% - tag {\ifparameter#2\or#2\else\number\scratchcounter\fi}% + tag {\ifparameter#2\or#2\else\the\scratchcounter\fi}% delay {\pagestateparameter\c!delay}% \relax \endgroup} diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt index 8615e9f05a7..a6d5f8c80ba 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt @@ -34,7 +34,7 @@ function environment.initializefilenames() end local inputfilebase = basename(inputfilename) - local outputfilename = arguments.result or removesuffix(fulljobname) + local outputfilename = type(arguments.result) =="string" and arguments.result or removesuffix(fulljobname) -- local inputfilename = suffixonly(inputfilename) == "tex" and removesuffix(inputfilename) or inputfilename or "" @@ -86,6 +86,8 @@ implement { name = "outputfilename", public = true, actions = function() co implement { name = "systemlog", arguments = "3 strings", + public = true, + protected = true, actions = function(whereto,category,text) logs.system(whereto,"context",tex.jobname,category,text) end, diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl index 393d85d771f..4c001394129 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl @@ -22,15 +22,17 @@ %D Version checking: \permanent\protected\def\newcontextversion#1% - {\doifelse{#1}\contextversion - {\aliased\let\newcontextversion\gobbleoneargument} - {\writeline - \writestatus{Fatal Error}{Your format does not match the base files!}% - \writeline - \writestatus{Format Version}{\contextversion\space\contextmark}% - \writestatus{Files Version}{#1}% - \batchmode - \normalend}} + {\ifcstok{#1}\contextversion + \aliased\let\newcontextversion\gobbleoneargument + \else + \writeline + \writestatus{Fatal Error}{Your format does not match the base files!}% + \writeline + \writestatus{Format Version}{\contextversion\space\contextmark}% + \writestatus{Files Version}{#1}% + \batchmode + \normalend + \fi} %D End of lines to the output. \TEX\ will map this onto the platform specific %D line ending. I hate this mess. @@ -89,9 +91,11 @@ \permanent\def\jobfullname{\jobfilename.\jobfilesuffix} \permanent\protected\def\setjobfullname#1% #1 = default if not given - {\doifelsenothing\jobfilename - {\lettonothing\jobfullname} - {\doif\jobfilesuffix\c!tex{\edef\jobfullname{\jobfilename.#1}}}} + {\ifempty\jobfilename + \lettonothing\jobfullname + \orelse\ifcstok\jobfilesuffix\c!tex + \edef\jobfullname{\jobfilename.#1}% + \fi} %D There are a couple of system states avaiable: %D @@ -123,21 +127,22 @@ %D \stoptyping \permanent\protected\def\setuprandomize[#1]% - {\doifsomething{#1} - {\begingroup - % tex's time is in minutes - \scratchcounter\normaltime - \processaction - [#1] - [ \v!small=>\divideby\scratchcounter 15, % 900, - \v!medium=>\divideby\scratchcounter 30, % 1800, - \v!big=>\divideby\scratchcounter 60, % 3600, - \v!normal=>\scratchcounter\newrandomseed, - \s!default=>\scratchcounter\newrandomseed, - \s!unknown=>\scratchcounter#1]% - \setrandomseed\scratchcounter - % \writestatus\m!system{randomseed: \the\scratchcounter}% - \endgroup}} + {\ifempty{#1}\else + \begingroup + % tex's time is in minutes + \scratchcounter\normaltime + \processaction + [#1] + [ \v!small=>\divideby\scratchcounter 15, % 900, + \v!medium=>\divideby\scratchcounter 30, % 1800, + \v!big=>\divideby\scratchcounter 60, % 3600, + \v!normal=>\scratchcounter\newrandomseed, + \s!default=>\scratchcounter\newrandomseed, + \s!unknown=>\scratchcounter#1]% + \setrandomseed\scratchcounter + %\writestatus\m!system{randomseed: \the\scratchcounter}% + \endgroup + \fi} \setupsystem [\c!directory=, @@ -189,9 +194,9 @@ \installcommandhandler \??startstop {startstop} \??startstop \appendtoks - \frozen\setuevalue{\e!start\currentstartstop}{\syst_startstop_start {\currentstartstop}}% - \frozen\setuevalue{\e!stop \currentstartstop}{\syst_startstop_stop {\currentstartstop}}% - \frozen\setuevalue {\currentstartstop}{\syst_startstop_indeed{\currentstartstop}}% + \frozen\instance\protected\edefcsname \currentstartstop\endcsname{\syst_startstop_indeed{\currentstartstop}}% + \frozen\instance\protected\edefcsname\e!start\currentstartstop\endcsname{\syst_startstop_start {\currentstartstop}}% + \frozen\instance\protected\edefcsname\e!stop \currentstartstop\endcsname{\syst_startstop_stop {\currentstartstop}}% \to \everydefinestartstop \ifdefined\dotagconstruct \else \aliased\let\dotagconstruct\relax \fi @@ -199,7 +204,7 @@ \protected\def\syst_startstop_start#1% {\namedstartstopparameter{#1}\c!before\relax \bgroup - \def\currentstartstop{#1}% + \cdef\currentstartstop{#1}% % we will keep this for a while: \startstopparameter\c!commands\relax % obsolete % this is the new method: @@ -215,12 +220,12 @@ \protected\def\syst_startstop_indeed#1% {\groupedcommand - {\def\currentstartstop{#1}% + {\cdef\currentstartstop{#1}% \startstopparameter\c!commands\relax % better: setups so that will show op soon \dostarttagged\t!construct\currentstartstop \usestartstopstyleandcolor\c!style\c!color \startstopparameter\c!left\relax} - {\def\currentstartstop{#1}% safeguard, not really needed + {\cdef\currentstartstop{#1}% safeguard, not really needed \startstopparameter\c!right\relax \dostoptagged \startstopparameter\c!inbetween\relax}} @@ -229,7 +234,7 @@ % \protected\def\ignorestartstop[#1]% % {\protected\defcsname\e!start#1\expandafter\endcsname\expandafter -% {\expandafter\gobbleuntil\csname\e!stop#1\endcsname}} +% {\expandafter\ignoreupto\csname\e!stop#1\endcsname}} % % \ignorestartstop[bagger] @@ -266,7 +271,7 @@ \permanent\protected\def\typo_highlights_indeed#1% inline style/color switch {\dontleavehmode\groupedcommand % otherwise wrong par number in tags - {\def\currenthighlight{#1}% + {\cdef\currenthighlight{#1}% \dostarttagged\t!highlight\currenthighlight \usehighlightstyleandcolor\c!style\c!color % \usehighlightstyleandcolor\c!style\c!color @@ -279,7 +284,7 @@ \permanent\protected\def\starthighlight[#1]% {\begingroup - \def\currenthighlight{#1}% + \cdef\currenthighlight{#1}% \dostarttagged\t!highlight\currenthighlight \usehighlightstyleandcolor\c!style\c!color % \usehighlightstyleandcolor\c!style\c!color @@ -323,6 +328,11 @@ #1#3##1##2##3##4##5##6##7{#4}\or #1#3##1##2##3##4##5##6##7##8{#4}\or #1#3##1##2##3##4##5##6##7##8##9{#4}\else + #1#3##1##2##3##4##5##6##7##8##9##A{#4}\else + #1#3##1##2##3##4##5##6##7##8##9##A##B{#4}\else + #1#3##1##2##3##4##5##6##7##8##9##A##B##C{#4}\else + #1#3##1##2##3##4##5##6##7##8##9##A##B##C##D{#4}\else + #1#3##1##2##3##4##5##6##7##8##9##A##B##C##D##E{#4}\else #1#3{#4}\fi \catcode\hashasciicode\c_syst_parameter_catcode} @@ -440,40 +450,28 @@ \permanent\protected\def\macroname#1% brrr {\begincsname#1\endcsname} -% %D A weird one that I probably needed once, so it might as well become -% %D obsolete. -% -% \protected\def\usecommands#1% -% {\begingroup -% \def\docommand##1{\setbox\scratchbox\hbox{\csname\string##1\endcsname##1}}% -% \processcommalist[#1]\docommand -% \endgroup} - -\permanent\protected\def\syst_log_indeed#1#2#3% - {\ctxcommand{systemlog("#1","#2",\!!bs#3\!!es)}} - -\aliased\let\systemlog\syst_log_indeed +% \definedasluacommand\systemlog \permanent\protected\def\systemlogfirst {\ifcase\directsystemparameter\c!n\relax - \expandafter\syst_log_indeed + \expandafter\systemlog \or - \expandafter\syst_log_indeed + \expandafter\systemlog \else \expandafter\gobblethreearguments \fi} \permanent\protected\def\systemloglast {\ifcase\directsystemparameter\c!n\relax - \expandafter\syst_log_indeed + \expandafter\systemlog \or - \expandafter\gobblethreearguments + \expandafter\gobblethreearguments \or \expandafter\gobblethreearguments \or \expandafter\gobblethreearguments \or - \expandafter\syst_log_indeed + \expandafter\systemlog \fi} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl index 10a7eec9ead..1ccbe3e3caf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl @@ -88,7 +88,7 @@ % % % temp hack: needs a proper \starteverytimeluacode % -% \setfalse\twopassdatafound +% \newconditional\twopassdatafound % % \mutable\lettonothing\twopassdata % \mutable\lettonothing\twopassdatalist @@ -97,9 +97,9 @@ % % \def\syst_twopass_check % can be delegated to lua once obsolete is gone % {\ifempty\twopassdata -% \setfalse\twopassdatafound +% \twopassdatafound\conditionalfalse % \else -% \settrue\twopassdatafound +% \twopassdatafound\conditionaltrue % \fi} % % \permanent\protected\def\definetwopasslist #1{\clf_definetwopasslist{#1}} diff --git a/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt index c43bf2a83b3..516c976e00f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt @@ -30,7 +30,7 @@ local shipout = tex.shipout local texgetbox = tex.getbox local texgetcount = tex.getcount -local c_realpageno = tex.iscount("realpageno") +local c_realpageno = tex.iscount("realpageno") function converters.engine(driver,boxnumber,mode,number,specification) return shipout(boxnumber) @@ -65,6 +65,8 @@ local defaulthandlers = { local installwhatsits do + local round = math.round + local leaderlevel = 0 local backends = backends local trace = true @@ -110,8 +112,8 @@ local installwhatsits do local function flushsavepos(current,pos_h,pos_v) local jp = job.positions - jp.lastx = pos_h - jp.lasty = pos_v + jp.lastx = round(pos_h) + jp.lasty = round(pos_v) end local function flushuserdefined() diff --git a/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt b/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt index 0048f4bb868..e0bc2a1d594 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt @@ -45,6 +45,8 @@ local getshift = nuts.getshift local getreplace = nuts.getreplace local setreplace = nuts.setreplace local getfont = nuts.getfont +local getxscale = nuts.getxscale +local getboth = nuts.getboth local getglyphdimensions = nuts.getglyphdimensions local getkerndimension = nuts.getkerndimension @@ -71,29 +73,29 @@ local whatsitcodes = nodes.whatsitcodes local gluecodes = nodes.gluecodes local subtypes = nodes.subtypes -local directioncodes = tex.directioncodes -local lefttoright_code = directioncodes.lefttoright -local righttoleft_code = directioncodes.righttoleft +local lefttoright_code = tex.directioncodes.lefttoright +local righttoleft_code = tex.directioncodes.righttoleft -local glyph_code = nodecodes.glyph -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local dir_code = nodecodes.dir -local disc_code = nodecodes.disc -local math_code = nodecodes.math -local rule_code = nodecodes.rule -local whatsit_code = nodecodes.whatsit +local glyph_code = nodecodes.glyph +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local dir_code = nodecodes.dir +local disc_code = nodecodes.disc +local math_code = nodecodes.math +local rule_code = nodecodes.rule +local whatsit_code = nodecodes.whatsit -local virtualrule_code = nodes.rulecodes.virtual +local virtualrule_code = nodes.rulecodes.virtual -local leaders_code = gluecodes.leaders -local cleaders_code = gluecodes.cleaders -local xleaders_code = gluecodes.xleaders -local gleaders_code = gluecodes.gleaders +local leaders_code = gluecodes.leaders +local cleaders_code = gluecodes.cleaders +local xleaders_code = gluecodes.xleaders +local gleaders_code = gluecodes.gleaders -local spaceskip_code = gluecodes.spaceskip +local spaceskip_code = gluecodes.spaceskip +local xspaceskip_code = gluecodes.xspaceskip local getpagedimensions = layouts.getpagedimensions @@ -109,9 +111,8 @@ local report = logs.reporter("drivers") local lastfont = nil local fontcharacters = nil -local magicconstants = tex.magicconstants -local maxdimen = magicconstants.maxdimen -local runningrule = magicconstants.runningrule +local maxdimen = tex.magicconstants.maxdimen +local runningrule = tex.magicconstants.runningrule local pos_h = 0 local pos_v = 0 @@ -133,6 +134,7 @@ local flushfontchar local flushrule local flushliteral local flushwhatsit +local flushspace -- make local @@ -147,7 +149,7 @@ function drivers.getvpos() return round(pos_v) end local tospace = false directives.register("backends.spaces", function(v) tospace = v end) -local flush_character do +local flush_character, flush_space do local stack = setmetatableindex("table") local level = 0 @@ -165,7 +167,7 @@ local flush_character do -- local alternative = false -- more local, can be an option: vf.commands.local - local function flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,vfcommands) + local function flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,slant,weight,vfcommands) if nesting > 100 then return elseif nesting == 0 then @@ -282,13 +284,15 @@ local flush_character do csy = sy end -- here no current! - -- return flushcharacter(false,pos_h,pos_v,pos_r,fnt,chr,nil,csx,csy,factor,sx,sy) - return flush_character(false,fnt,chr,factor,nest,pos_h,pos_v,pos_r,csx,csy) + -- return flushcharacter(false,pos_h,pos_v,pos_r,fnt,chr,nil,csx,csy,factor,sx,sy,slant,weight) + return flush_character(false,fnt,chr,factor,nest,pos_h,pos_v,pos_r,csx,csy,slant,weight) else return 0 end end + -- virtual t3 fonts have negative font index + for i=1,#vfcommands do local packet = vfcommands[i] if packet then @@ -297,16 +301,14 @@ local flush_character do local chr = packet[2] local csx = packet[3] local csy = packet[4] or csx - pos_h = pos_h + flushchar(fnt,chr,csx,csy) -* sx + pos_h = pos_h + flushchar(fnt,chr,csx,csy) * sx elseif command == "slot" then local index = packet[2] local chr = packet[3] local csx = packet[4] local csy = packet[5] or csx if index == 0 then - pos_h = pos_h + flushchar(font,chr,csx,csy) -* sx + pos_h = pos_h + flushchar(font,chr,csx,csy) * sx else local okay = fonts and fonts[index] if okay then @@ -315,13 +317,11 @@ local flush_character do if fnt == 0 then fnt = font end - pos_h = pos_h + flushchar(fnt,chr,csx,csy) -* sx + pos_h = pos_h + flushchar(fnt,chr,csx,csy) * sx end else -- safeguard, we assume the font itself (often index 1) - pos_h = pos_h + flushchar(font,chr,csx,csy) -* sx + pos_h = pos_h + flushchar(font,chr,csx,csy) * sx end end elseif command == "use" then @@ -433,21 +433,23 @@ local flush_character do local height = packet[3] local depth = packet[4] local wd, ht, dp - if width == true or height == true or depth == true then + if not current then + -- can be a space injected instead of glue + elseif width == true or height == true or depth == true then wd, ht, dp = getwhd(current,true) end if width == true then - width = wd + width = wd or 0 elseif not width then width = 0 end if height == true then - height = ht + height = ht or 0 elseif not height then height = 0 end if depth == true then - depth = dp + depth = dp or 0 elseif not depth then depth = 0 end @@ -603,21 +605,9 @@ local flush_character do if vfcommands then vfcommands = data.commands end - local width, height, depth, naturalwidth, sx, sy + local width, height, depth, naturalwidth, sx, sy, slant, weight if current then - -- if true then - width, height, depth, factor, sx, sy = getglyphdimensions(current) - -- else - -- naturalwidth, height, depth, factor = getwhd(current,true) -- also get corrected width - -- sx, sy = getxyscales(current) - -- if factor == 0 then - -- width = naturalwidth - -- else - -- -- width = (1.0 + factor/1000000.0) * naturalwidth - -- width = naturalwidth + naturalwidth * factor/1000000.0 - -- -- width = naturalwidth + naturalwidth * 0.000001 * factor - -- end - -- end + width, height, depth, factor, sx, sy, slant, weight = getglyphdimensions(current) else width = data.width or 0 height = data.height or 0 @@ -626,28 +616,45 @@ local flush_character do if not factor then factor = 0 end - sx = 1 - sy = 1 + sx = 1 + sy = 1 + slant = 0 + weight = 0 end if pos_r == righttoleft_code then pos_h = pos_h - width -- here ? end if vfcommands then - flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,vfcommands) + flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,slant,weight,vfcommands) else local orientation = data.orientation -- 0 (none), 1, 2, 3 or 4 (none) if orientation and (orientation == 1 or orientation == 3) then -- we can get weird charactersbox tracing here pushorientation(orientation,pos_h,pos_v) - flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy) + flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,slant,weight) poporientation(orientation,pos_h,pos_v) else - flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy) + flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,slant,weight) end end return width, height, depth end + flush_space = function(current,pos_h,pos_v,pos_r) + local font = getfont(current) + if font == lastfont then + -- local char = 32 + -- local data = fontcharacters[32] + -- if not data then + -- return + -- end + -- -- if pos_r == righttoleft_code then + -- -- pos_h = pos_h - (data.width or 0) -- here ? + -- -- end + flushspace(font) + end + end + end -- end of characters @@ -889,19 +896,41 @@ local hlist_out, vlist_out do if id == rule_code then if gluewidth > 0 then local width, height, depth = getwhd(leader) - if height == runningrule then + local runningheight = height == runningrule + local runningdepth = depth == runningrule + if runningheight then height = boxheight end - if depth == runningrule then + if runningdepth then depth = boxdepth end local total = height + depth if total > 0 then + local xoffset, yoffset, top, bottom, on, off = getoffsets(leader) + -- -- only when we have a use case: + -- + -- if pos_r == righttoleft_code then + -- pos_h = pos_h - gluewidth + -- xoffset = - xoffset + -- end + -- if not virtual then + -- if top ~= 0 then + -- -- height = height - top + -- total = total - top + -- end + -- if bottom ~= 0 then + -- depth = depth - bottom + -- total = total - bottom + -- end + -- end + -- pos_v = pos_v - depth + -- flushrule(leader,pos_h + xoffset,pos_v + yoffset,pos_r,gluewidth,total,getsubtype(leader)) + -- if pos_r == righttoleft_code then pos_h = pos_h - gluewidth end pos_v = pos_v - depth - flushrule(leader,pos_h,pos_v,pos_r,gluewidth,total,getsubtype(leader)) + flushrule(leader,pos_h,pos_v,pos_r,gluewidth,total,getsubtype(leader),on,off,runningheight and runningdepth) end cur_h = cur_h + gluewidth end @@ -1018,9 +1047,12 @@ local hlist_out, vlist_out do cur_h = cur_h + gluewidth end else - if tospace and subtype == spaceskip_code then + if tospace and (subtype == spaceskip_code or subtype == xspaceskip_code) then -- kind of tricky because because we can have a different sx sy - flush_character(false,getfont(current),32,false,true,pos_h,pos_v,pos_r) -- we need to pass current for scale? +-- local xscale = getxscale(current) or 1 +-- flush_character(false,getfont(current),32,false,true,pos_h,pos_v,pos_r,xscale,1) +-- local xscale = 1 +flush_space(current) end cur_h = cur_h + gluewidth end @@ -1193,15 +1225,17 @@ local hlist_out, vlist_out do elseif id == rule_code then local width, height, depth, virtual = getruledimensions(current) if width > 0 then - if height == runningrule then + local runningheight = height == runningrule + local runningdepth = depth == runningrule + if runningheight then height = boxheight end - if depth == runningrule then + if runningdepth then depth = boxdepth end local total = height + depth if total > 0 then - local xoffset, yoffset, top, bottom = getoffsets(current) + local xoffset, yoffset, top, bottom, on, off = getoffsets(current) if pos_r == righttoleft_code then pos_h = pos_h - width xoffset = - xoffset @@ -1217,7 +1251,7 @@ local hlist_out, vlist_out do end end pos_v = pos_v - depth - flushrule(current,pos_h + xoffset,pos_v + yoffset,pos_r,width,total,subtype) + flushrule(current,pos_h + xoffset,pos_v + yoffset,pos_r,width,total,subtype,on,off,runningheight and runningdepth) end if not virtual then cur_h = cur_h + width @@ -1252,6 +1286,7 @@ local hlist_out, vlist_out do if dir ~= pos_r then cur_h = new_h end + -- kind of weird but indeed we don't adapt here: pos_r = dir if enddir ~= current then dirstack[enddir] = { cur_h = new_h, @@ -1259,6 +1294,7 @@ local hlist_out, vlist_out do ref_h = ref_h, ref_v = ref_v, } + -- kind of weird but indeed cheat here, so we basically have a bad one now setdirection(enddir,pos_r) end if pos_r == righttoleft_code then @@ -1305,7 +1341,7 @@ local hlist_out, vlist_out do end -- pos_v = ref_v - cur_v pos_v = ref_v - ::synced:: + ::synced:: end pos_h = ref_h pos_v = ref_v @@ -1354,14 +1390,32 @@ local hlist_out, vlist_out do depth = 0 -- hm total = glueheight -- forgotten ... needs testing if total > 0 then - if width == runningrule then + local runningwidth = width == runningrule + if runningwidth then width = boxwidth end if width > 0 then + local xoffset, yoffset, left, right, on, off = getoffsets(leader) + -- -- only when i have a use case: + -- + -- if not virtual then + -- if left ~= 0 then + -- width = width - left + -- xoffset = left + -- end + -- if right ~= 0 then + -- width = width - right + -- end + -- end + -- if pos_r == righttoleft_code then + -- xoffset = - xoffset - width + -- end + -- flushrule(leader,pos_h + xoffset,pos_v - total - yoffset,pos_r,width,total,getsubtype(leader)) + -- if pos_r == righttoleft_code then cur_h = cur_h - width end - flushrule(leader,pos_h,pos_v - total,pos_r,width,total,getsubtype(leader)) + flushrule(leader,pos_h,pos_v - total,pos_r,width,total,getsubtype(leader),on,off,runningwidth) end cur_v = cur_v + total end @@ -1584,11 +1638,12 @@ local hlist_out, vlist_out do local width, height, depth, virtual = getruledimensions(current) local total = height + depth if total > 0 then - if width == runningrule then + local runningwidth = width == runningrule + if runningwidth then width = boxwidth end if width > 0 then - local xoffset, yoffset, left, right = getoffsets(current) + local xoffset, yoffset, left, right, on, off = getoffsets(current) if not virtual then if left ~= 0 then width = width - left @@ -1601,7 +1656,7 @@ local hlist_out, vlist_out do if pos_r == righttoleft_code then xoffset = - xoffset - width end - flushrule(current,pos_h + xoffset,pos_v - total - yoffset,pos_r,width,total,subtype) + flushrule(current,pos_h + xoffset,pos_v - total - yoffset,pos_r,width,total,subtype,on,off,runningwidth) end if not virtual then cur_v = cur_v + total @@ -1619,7 +1674,7 @@ local hlist_out, vlist_out do pos_h = ref_h + cur_h end pos_v = ref_v - cur_v - ::synced:: + ::synced:: end pos_h = ref_h pos_v = ref_v @@ -1663,6 +1718,7 @@ function drivers.converters.lmtx(driver,box,smode,objnum,specification) flushspecialrule = flushers.specialrule flushliteral = flushers.literal flushwhatsit = flushers.whatsit + flushspace = flushers.space reset_directions() reset_anchors() @@ -1817,8 +1873,26 @@ do end end,"provide whatsit details") - local names = attributes.names -- we show the name and number + local names = attributes.names -- we show the name and number + local taglist = structures.tags.taglist + local details = false + + local a_tagged = attributes.private('tagged') + + trackers.register("attributes.tags",function(v) details = v end) - callbacks.register("get_attribute",function(k,v) return attributes.names[k], nil end,"provide verbose attrbute name") + callbacks.register("get_attribute",function(k,v) + local detail = nil + if details and k == a_tagged then + detail = taglist[v] + if detail then + detail = detail.taglist + if detail then + detail = detail[#detail] + end + end + end + return names[k], detail + end,"provide verbose attribute name") end diff --git a/Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt b/Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt index df381f35f4f..a5142d99fc1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt @@ -40,30 +40,29 @@ local dirdimensions = nuts.dirdimensions local nodecodes = nodes.nodecodes local whatsitcodes = nodes.whatsitcodes - local directioncodes = tex.directioncodes -local lefttoright_code = directioncodes.lefttoright -local righttoleft_code = directioncodes.righttoleft - -local glyph_code = nodecodes.glyph -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local dir_code = nodecodes.dir -local disc_code = nodecodes.disc -local math_code = nodecodes.math -local rule_code = nodecodes.rule -local whatsit_code = nodecodes.whatsit - -local userdefined_code = nodes.whatsitcodes.userdefined + +local glyph_code = nodecodes.glyph +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local dir_code = nodecodes.dir +local disc_code = nodecodes.disc +local math_code = nodecodes.math +local rule_code = nodecodes.rule +local whatsit_code = nodecodes.whatsit + +local userdefined_code = whatsitcodes.userdefined + +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft local drivers = drivers local report = logs.reporter("drivers") -local magicconstants = tex.magicconstants -local maxdimen = magicconstants.maxdimen +local maxdimen = tex.magicconstants.maxdimen local pos_h = 0 local pos_v = 0 diff --git a/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl index dfe534f32b8..1593bb5fc2d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl @@ -96,7 +96,7 @@ \permanent\protected\def\definecharacter#1 #2 % {\doifelsenumber{\string#2} - {\edefcsname\string#1\endcsname{\Uchar#2}} + {\edefcsname\string#1\endcsname{\tocharacter#2}} {\protected\defcsname\string#1\endcsname{#2}}} %D specials: \aa \ae \cc \i \ij \l \o \oe \sz \par @@ -182,8 +182,8 @@ \newbox\b_enco_accent -\permanent\protected\def\buildmathaccent#1% - {\mathaccent#1 } +% \permanent\protected\def\buildmathaccent#1% Don't use this! +% {\mathaccent#1 } \permanent\protected\def\buildtextaccent#1#2% we could do all at the lua end {\dontleavehmode\begingroup % but that's no fun (yet) @@ -211,10 +211,10 @@ {\dontleavehmode % why this align mess \vtop {\forgetall - \baselineskip\zeropoint - \lineskip#1% + \baselineskip\zeroskip + \lineskip#1\relax \everycr\emptytoks - \tabskip\zeropoint + \tabskip\zeroskip \lineskiplimit\zeropoint \setbox0\hbox{#4}% \halign @@ -455,9 +455,7 @@ {\doifelseassignment{#1} {\setupcurrentperiods[#1]% \scratchcounter\periodsparameter\c!n} - {\doifelsenothing{#1} - {\scratchcounter\periodsparameter\c!n}% - {\scratchcounter#1}}% + {\scratchcounter\ifempty{#1}\periodsparameter\c!n\else#1\fi}% \enco_periods_finish} \protected\def\enco_periods_nop diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx index 7c4645a9ae5..7f5af2db37e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx @@ -75,11 +75,11 @@ \permanent\protected\def\pushendofline {\advanceby\c_system_files_eol_level\plusone - \expandafter\chardef\csname\??eolstack\number\c_system_files_eol_level\endcsname\catcode\endoflineasciicode + \expandafter\chardef\csname\??eolstack\the\c_system_files_eol_level\endcsname\catcode\endoflineasciicode \catcode\endoflineasciicode\commentcatcode} \permanent\protected\def\popendofline - {\catcode\endoflineasciicode\csname\??eolstack\number\c_system_files_eol_level\endcsname + {\catcode\endoflineasciicode\csname\??eolstack\the\c_system_files_eol_level\endcsname \advanceby\c_system_files_eol_level\minusone} \permanent\protected\def\restoreendofline @@ -96,7 +96,7 @@ \permanent\protected\def\startreadingfile% beter een every en \setnormalcatcodes {\global\advanceby\readingfilelevel\plusone - \the\everystartreadingfile + \expand\everystartreadingfile \pushcatcodetable % saveguard \setcatcodetable\ctxcatcodes \pushregime}% temporarily this way @@ -104,7 +104,7 @@ \permanent\protected\def\stopreadingfile {\popcatcodetable % saveguard \popregime % temporarily this way - \the\everystopreadingfile + \expand\everystopreadingfile \global\advanceby\readingfilelevel\minusone} %D \macros diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt b/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt index c3906468b24..6d0d2556d57 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt @@ -59,24 +59,25 @@ local jobresolvers = resolvers.jobs local registerextrapath = resolvers.registerextrapath local resetextrapaths = resolvers.resetextrapaths -local getextrapaths = resolvers.getextrapath +local getextrapaths = resolvers.getextrapaths local pushextrapath = resolvers.pushextrapath local popextrapath = resolvers.popextrapath ------ v_outer = variables.outer -local v_text = variables.text -local v_project = variables.project -local v_environment = variables.environment -local v_product = variables.product -local v_component = variables.component -local v_yes = variables.yes +----- v_outer = variables.outer +local v_text = variables.text +local v_project = variables.project +local v_environment = variables.environment +local v_product = variables.product +local v_component = variables.component +local v_yes = variables.yes -local v_local = variables["local"] -local v_global = variables["global"] +local v_local = variables["local"] +local v_global = variables["global"] local e_start = elements.start local e_stop = elements.stop + -- main code .. there is some overlap .. here we have loc:// local function findctxfile(name) -- loc ? any ? @@ -405,7 +406,7 @@ end local textlevel = 0 -- inaccessible for user, we need to define counter textlevel at the tex end -local c_textlevel = tex.iscount("textlevel") +local c_textlevel = tex.iscount("textlevel") local function dummyfunction() end @@ -887,7 +888,7 @@ end local scan_delimited = tokens.scanners.delimited local function getname() - return scan_delimited(91,93) or scan_delimited(0,32) -- [name] or name + return scan_delimited(91,93) or scan_delimited(0,32) -- [name] or name - use optional end implement { name = "project", public = true, protected = true, actions = function() process(v_project, getname()) end } @@ -900,6 +901,18 @@ implement { name = "useenvironment", public = true, protected = true, actions = implement { name = "useproduct", public = true, protected = true, actions = function(name) process(v_product, name) end, arguments = "optional" } -- will be overloaded implement { name = "usecomponent", public = true, protected = true, actions = function(name) process(v_component, name) end, arguments = "optional" } +implement { + name = "ignorefile", + public = true, + protected = true, + arguments = "array", + actions = function(s) + for i=1,#s do + resolvers.ignorelibrary(s[i]) + end + end +} + -- todo: setsystemmode to currenttype -- todo: make start/stop commands at the tex end @@ -1125,9 +1138,9 @@ function document.setcommandline() -- has to happen at the tex end in order to e local options = document.options for k, v in next, environment.arguments do - k = gsub(k,"^c:","") -- already done, but better be safe than sorry - if arguments[k] == nil then - arguments[k] = v + local a = gsub(k,"^c:","") -- already done, but better be safe than sorry + if arguments[a] == nil then + arguments[a] = v end end @@ -1155,6 +1168,10 @@ function document.setcommandline() -- has to happen at the tex end in order to e directives.enable("system.nostatistics") end + if arguments.notuc then + directives.disable("job.save") + end + if arguments.paranoid then context.setvalue("maxreadlevel",1) end @@ -1314,7 +1331,7 @@ do logs.startfilelogging(report,"commandline options") if arguments and next(arguments) then for argument, value in sortedhash(arguments) do - report("%s=%A",argument,value) + report(" %s=%A",argument,value) end else report("no arguments") @@ -1445,3 +1462,33 @@ implement { end, arguments = "array", } + +-- don't we have this already? + +implement { + name = "filebasename", + public = true, + arguments = "argument", + actions = { basename, context }, +} + +implement { + name = "filenameonly", + public = true, + arguments = "argument", + actions = { nameonly, context }, +} + +implement { + name = "filedirname", + public = true, + arguments = "argument", + actions = { dirname, context }, +} + +implement { + name = "filesuffix", + public = true, + arguments = "argument", + actions = { dirname, context }, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx b/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx index 1c57a832dfb..127f548259e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx @@ -84,20 +84,24 @@ \permanent\protected\def\dostarttext {\enforced\glet\dostarttext\relax - \the\everystarttext + \expand\everystarttext \global\everystarttext\emptytoks} \permanent\protected\def\dostoptext {\enforced\glet\dostoptext\relax \strc_pagenumbers_flush_final_page \page % hm, bonus - \the\everystoptext + \expand\everystoptext \global\everystoptext\emptytoks - \the\everybye + \expand\everybye \global\everybye\emptytoks - \the\everygoodbye + \expand\everygoodbye \global\everygoodbye\emptytoks - \doifelsesometoks\everynotabene{\writeline\the\everynotabene\writeline}\donothing + \ifempty\everynotabene\else + \writeline + \expand\everynotabene + \writeline + \fi % tex's \end: \normalend} @@ -116,8 +120,8 @@ \newtoks\everystartnotext \newtoks\everystopnotext -\permanent\protected\def\startnotext{\the\everystartnotext} -\permanent\protected\def\stopnotext {\the\everystopnotext\normalend} +\permanent\protected\def\startnotext{\expand\everystartnotext} +\permanent\protected\def\stopnotext {\expand\everystopnotext\normalend} % protect structure @@ -296,7 +300,7 @@ % todo: dostarttagged\t!document -\permanent\tolerant\protected\def\startdocument[#namespace]#spacer[#settings]% +\permanent\tolerant\protected\def\startdocument[#S#namespace]#spacer[#S#settings]% {\pushmacro\currentdocument \ifparameters \or @@ -304,20 +308,20 @@ \lettonothing\currentdocument \setupcurrentdocument[#namespace]% \else - \edef\currentdocument{#namespace}% + \cdef\currentdocument{#namespace}% \fi \or - \edef\currentdocument{#namespace}% + \cdef\currentdocument{#namespace}% \setupcurrentdocument[#settings]% \fi \ifempty\currentdocument\else\setmode\currentdocument\fi \starttext - \the\everystartdocument + \expand\everystartdocument \documentvariable\c!before} \permanent\protected\def\stopdocument % todo: dostoptagged\t!document {\documentvariable\c!after - \the\everystopdocument + \expand\everystopdocument \stoptext \ifempty\currentdocument\else\resetmode\currentdocument\fi \popmacro\currentdocument} @@ -331,7 +335,7 @@ \aliased\let\doifdocumentvariableelse\doifelsedocumentvariable -\permanent\tolerant\protected\def\presetdocument[#namespace]#spacer[#settings]% +\permanent\tolerant\protected\def\presetdocument[#S#namespace]#spacer[#S#settings]% {\pushmacro\currentdocument \ifparameters \or @@ -340,7 +344,7 @@ \setupcurrentdocument[#namespace]% \fi \or - \edef\currentdocument{#namespace}% + \cdef\currentdocument{#namespace}% \setupcurrentdocument[#settings]% \fi \popmacro\currentdocument} @@ -355,7 +359,7 @@ % \fi % \lastnamedcs} -\permanent\protected\def\samplefile#1{\clf_samplefile{#1}} +% \permanent\protected\def\samplefile#1{\clf_samplefile{#1}} % defined at the lua end % \adddefaultsuffix[foo,{},crap] % \adddefaultsuffix[{}] diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx b/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx index a64529dd6d9..126835c19e6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx @@ -49,7 +49,7 @@ \installmacrostack\currentmodulecategory \installmacrostack\currentmoduleparameters -\permanent\tolerant\protected\def\usemodules[#category]#spacer[#name]#spacer[#parameters]% category=t|m|x|p|... +\permanent\tolerant\protected\def\usemodules[#category]#spacer[#S#name]#spacer[#S#parameters]% category=t|m|x|p|... {\push_macro_currentmodule \push_macro_currentmodulecategory \push_macro_currentmoduleparameters @@ -57,21 +57,21 @@ \lettonothing\currentmodule \or \lettonothing\currentmodulecategory - \edef\currentmodule{#category}% + \cdef\currentmodule{#category}% \lettonothing\currentmoduleparameters \or \ifhastok={#name}% \lettonothing\currentmodulecategory - \edef\currentmodule{#category}% + \cdef\currentmodule{#category}% \edef\currentmoduleparameters{#name}% \else \edef\currentmodulecategory{#category}% - \edef\currentmodule{#name}% + \cdef\currentmodule{#name}% \lettonothing\currentmoduleparameters \fi \or \edef\currentmodulecategory {#category}% - \edef\currentmodule {#name}% + \cdef\currentmodule {#name}% \def \currentmoduleparameters{#parameters}% \fi \processcommacommand[\currentmodule]{\strc_modules_use\currentmodulecategory}% @@ -96,7 +96,7 @@ {\global\advanceby\c_syst_modules_nesting\plusone \push_macro_currentmodule \push_macro_currentmoduleparameters - \def\currentmodule{#1#2}} + \cdef\currentmodule{#1#2}} \permanent\protected\def\stopmodule {\ifcase\c_syst_modules_nesting @@ -114,17 +114,19 @@ \expandafter\syst_modules_setup_yes \fi} -\tolerant\def\syst_modules_setup_nop[#name]#spacer[#parameters]% +\tolerant\def\syst_modules_setup_nop[#S#name]#spacer[#S#parameters]% {\ifarguments % nothing \or - \doifassignmentelse{#name}{\getparameters[\??module\currentmodule:][#name]}\donothing + \ifhastok={#name}% + \getparameters[\??module\currentmodule:][#name]% + \fi \or \getparameters[\??module#name:][#parameters]% internal (defaults) \fi - \the\everysetupmodule} + \expand\everysetupmodule} -\tolerant\def\syst_modules_setup_yes[#name]#spacer[#parameters]% +\tolerant\def\syst_modules_setup_yes[#S#name]#spacer[#S#parameters]% {\scratchtoks\expandafter{\currentmoduleparameters}% \ifparameters \normalexpanded{\getparameters[\??module\currentmodule:][\the\scratchtoks]}% @@ -140,7 +142,7 @@ \normalexpanded{\getparameters[\??module#name:][\the\scratchtoks]}% loadtime (user) \fi \lettonothing\currentmoduleparameters - \the\everysetupmodule} + \expand\everysetupmodule} \permanent\def\moduleparameter#name#parameter% should have been \namedmoduleparameter {\begincsname\??module#name:#parameter\endcsname} @@ -176,12 +178,14 @@ \permanent\protected\def\startmoduletestsection {\begingroup \setupmodule % we need to make sure that the vars are set - \doifelse{\currentmoduleparameter\v!test}\v!yes - {\endgroup - \writestatus\currentmodule{loading experimental code}} - {\endgroup - \writestatus\currentmodule{skipping experimental code}% - \gobbleuntil\stopmoduletestsection}} + \ifcstok{\currentmoduleparameter\v!test}\v!yes + \endgroup + \writestatus\currentmodule{loading experimental code}% + \else + \endgroup + \writestatus\currentmodule{skipping experimental code}% + \expandafter\ignoreupto\expandafter\stopmoduletestsection + \fi} \aliased\let\stopmoduletestsection\donothing diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt index dc5f9838292..dd62e944621 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt @@ -305,322 +305,326 @@ do local result = { } local strings = { } - local p_single = - P("\00") / function() - result.version = strings[stack[top]] or "unset" - top = 0 - end - + P("\01") / function() - result.notice = strings[stack[top]] or "unset" - top = 0 - end - + P("\02") / function() - result.fullname = strings[stack[top]] or "unset" - top = 0 - end - + P("\03") / function() - result.familyname = strings[stack[top]] or "unset" - top = 0 - end - + P("\04") / function() - result.weight = strings[stack[top]] or "unset" - top = 0 - end - + P("\05") / function() - result.fontbbox = { unpack(stack,1,4) } - top = 0 - end - + P("\06") / function() - result.bluevalues = { unpack(stack,1,top) } - top = 0 - end - + P("\07") / function() - result.otherblues = { unpack(stack,1,top) } - top = 0 - end - + P("\08") / function() - result.familyblues = { unpack(stack,1,top) } - top = 0 - end - + P("\09") / function() - result.familyotherblues = { unpack(stack,1,top) } - top = 0 - end - + P("\10") / function() - result.stdhw = stack[top] - top = 0 - end - + P("\11") / function() - result.stdvw = stack[top] - top = 0 - end - + P("\13") / function() - result.uniqueid = stack[top] - top = 0 - end - + P("\14") / function() - result.xuid = concat(stack,"",1,top) - top = 0 - end - + P("\15") / function() - result.charset = stack[top] - top = 0 - end - + P("\16") / function() - result.encoding = stack[top] - top = 0 - end - + P("\17") / function() -- valid cff2 - result.charstrings = stack[top] - top = 0 - end - + P("\18") / function() - result.private = { - size = stack[top-1], - offset = stack[top], - } - top = 0 - end - + P("\19") / function() - result.subroutines = stack[top] - top = 0 -- new, forgotten ? - end - + P("\20") / function() - result.defaultwidthx = stack[top] - top = 0 -- new, forgotten ? - end - + P("\21") / function() - result.nominalwidthx = stack[top] - top = 0 -- new, forgotten ? - end - -- + P("\22") / function() -- reserved - -- end - -- + P("\23") / function() -- reserved - -- end - + P("\24") / function() -- new in cff2 - result.vstore = stack[top] - top = 0 - end - + P("\25") / function() -- new in cff2 - result.maxstack = stack[top] - top = 0 - end - -- + P("\26") / function() -- reserved - -- end - -- + P("\27") / function() -- reserved - -- end + local p_dictionary do - local p_double = P("\12") * ( - P("\00") / function() - result.copyright = stack[top] - top = 0 - end - + P("\01") / function() - result.monospaced = stack[top] == 1 and true or false -- isfixedpitch - top = 0 - end - + P("\02") / function() - result.italicangle = stack[top] - top = 0 - end - + P("\03") / function() - result.underlineposition = stack[top] - top = 0 - end - + P("\04") / function() - result.underlinethickness = stack[top] - top = 0 - end - + P("\05") / function() - result.painttype = stack[top] - top = 0 - end - + P("\06") / function() - result.charstringtype = stack[top] - top = 0 - end - + P("\07") / function() -- valid cff2 - result.fontmatrix = { unpack(stack,1,6) } - top = 0 - end - + P("\08") / function() - result.strokewidth = stack[top] - top = 0 - end - + P("\09") / function() - result.bluescale = stack[top] - top = 0 - end - + P("\10") / function() - result.blueshift = stack[top] - top = 0 - end - + P("\11") / function() - result.bluefuzz = stack[top] - top = 0 - end - + P("\12") / function() - result.stemsnaph = { unpack(stack,1,top) } - top = 0 - end - + P("\13") / function() - result.stemsnapv = { unpack(stack,1,top) } - top = 0 - end - + P("\20") / function() - result.syntheticbase = stack[top] - top = 0 - end - + P("\21") / function() - result.postscript = strings[stack[top]] or "unset" - top = 0 - end - + P("\22") / function() - result.basefontname = strings[stack[top]] or "unset" - top = 0 - end - + P("\21") / function() - result.basefontblend = stack[top] - top = 0 - end - + P("\30") / function() - result.cid.registry = strings[stack[top-2]] or "unset" - result.cid.ordering = strings[stack[top-1]] or "unset" - result.cid.supplement = stack[top] - top = 0 - end - + P("\31") / function() - result.cid.fontversion = stack[top] - top = 0 - end - + P("\32") / function() - result.cid.fontrevision= stack[top] - top = 0 - end - + P("\33") / function() - result.cid.fonttype = stack[top] - top = 0 - end - + P("\34") / function() - result.cid.count = stack[top] - top = 0 - end - + P("\35") / function() - result.cid.uidbase = stack[top] - top = 0 - end - + P("\36") / function() -- valid cff2 - result.cid.fdarray = stack[top] - top = 0 - end - + P("\37") / function() -- valid cff2 - result.cid.fdselect = stack[top] - top = 0 - end - + P("\38") / function() - result.cid.fontname = strings[stack[top]] or "unset" - top = 0 - end - ) - - -- Some lpeg fun ... a first variant split the byte and made a new string but - -- the second variant is much faster. Not that it matters much as we don't see - -- such numbers often. - - local remap_1 = { - ["\x00"] = "00", ["\x01"] = "01", ["\x02"] = "02", ["\x03"] = "03", ["\x04"] = "04", ["\x05"] = "05", ["\x06"] = "06", ["\x07"] = "07", ["\x08"] = "08", ["\x09"] = "09", ["\x0A"] = "0.", ["\x0B"] = "0E", ["\x0C"] = "0E-", ["\x0D"] = "0", ["\x0E"] = "0-", ["\x0F"] = "0", - ["\x10"] = "10", ["\x11"] = "11", ["\x12"] = "12", ["\x13"] = "13", ["\x14"] = "14", ["\x15"] = "15", ["\x16"] = "16", ["\x17"] = "17", ["\x18"] = "18", ["\x19"] = "19", ["\x1A"] = "1.", ["\x1B"] = "1E", ["\x1C"] = "1E-", ["\x1D"] = "1", ["\x1E"] = "1-", ["\x1F"] = "1", - ["\x20"] = "20", ["\x21"] = "21", ["\x22"] = "22", ["\x23"] = "23", ["\x24"] = "24", ["\x25"] = "25", ["\x26"] = "26", ["\x27"] = "27", ["\x28"] = "28", ["\x29"] = "29", ["\x2A"] = "2.", ["\x2B"] = "2E", ["\x2C"] = "2E-", ["\x2D"] = "2", ["\x2E"] = "2-", ["\x2F"] = "2", - ["\x30"] = "30", ["\x31"] = "31", ["\x32"] = "32", ["\x33"] = "33", ["\x34"] = "34", ["\x35"] = "35", ["\x36"] = "36", ["\x37"] = "37", ["\x38"] = "38", ["\x39"] = "39", ["\x3A"] = "3.", ["\x3B"] = "3E", ["\x3C"] = "3E-", ["\x3D"] = "3", ["\x3E"] = "3-", ["\x3F"] = "3", - ["\x40"] = "40", ["\x41"] = "41", ["\x42"] = "42", ["\x43"] = "43", ["\x44"] = "44", ["\x45"] = "45", ["\x46"] = "46", ["\x47"] = "47", ["\x48"] = "48", ["\x49"] = "49", ["\x4A"] = "4.", ["\x4B"] = "4E", ["\x4C"] = "4E-", ["\x4D"] = "4", ["\x4E"] = "4-", ["\x4F"] = "4", - ["\x50"] = "50", ["\x51"] = "51", ["\x52"] = "52", ["\x53"] = "53", ["\x54"] = "54", ["\x55"] = "55", ["\x56"] = "56", ["\x57"] = "57", ["\x58"] = "58", ["\x59"] = "59", ["\x5A"] = "5.", ["\x5B"] = "5E", ["\x5C"] = "5E-", ["\x5D"] = "5", ["\x5E"] = "5-", ["\x5F"] = "5", - ["\x60"] = "60", ["\x61"] = "61", ["\x62"] = "62", ["\x63"] = "63", ["\x64"] = "64", ["\x65"] = "65", ["\x66"] = "66", ["\x67"] = "67", ["\x68"] = "68", ["\x69"] = "69", ["\x6A"] = "6.", ["\x6B"] = "6E", ["\x6C"] = "6E-", ["\x6D"] = "6", ["\x6E"] = "6-", ["\x6F"] = "6", - ["\x70"] = "70", ["\x71"] = "71", ["\x72"] = "72", ["\x73"] = "73", ["\x74"] = "74", ["\x75"] = "75", ["\x76"] = "76", ["\x77"] = "77", ["\x78"] = "78", ["\x79"] = "79", ["\x7A"] = "7.", ["\x7B"] = "7E", ["\x7C"] = "7E-", ["\x7D"] = "7", ["\x7E"] = "7-", ["\x7F"] = "7", - ["\x80"] = "80", ["\x81"] = "81", ["\x82"] = "82", ["\x83"] = "83", ["\x84"] = "84", ["\x85"] = "85", ["\x86"] = "86", ["\x87"] = "87", ["\x88"] = "88", ["\x89"] = "89", ["\x8A"] = "8.", ["\x8B"] = "8E", ["\x8C"] = "8E-", ["\x8D"] = "8", ["\x8E"] = "8-", ["\x8F"] = "8", - ["\x90"] = "90", ["\x91"] = "91", ["\x92"] = "92", ["\x93"] = "93", ["\x94"] = "94", ["\x95"] = "95", ["\x96"] = "96", ["\x97"] = "97", ["\x98"] = "98", ["\x99"] = "99", ["\x9A"] = "9.", ["\x9B"] = "9E", ["\x9C"] = "9E-", ["\x9D"] = "9", ["\x9E"] = "9-", ["\x9F"] = "9", - ["\xA0"] = ".0", ["\xA1"] = ".1", ["\xA2"] = ".2", ["\xA3"] = ".3", ["\xA4"] = ".4", ["\xA5"] = ".5", ["\xA6"] = ".6", ["\xA7"] = ".7", ["\xA8"] = ".8", ["\xA9"] = ".9", ["\xAA"] = "..", ["\xAB"] = ".E", ["\xAC"] = ".E-", ["\xAD"] = ".", ["\xAE"] = ".-", ["\xAF"] = ".", - ["\xB0"] = "E0", ["\xB1"] = "E1", ["\xB2"] = "E2", ["\xB3"] = "E3", ["\xB4"] = "E4", ["\xB5"] = "E5", ["\xB6"] = "E6", ["\xB7"] = "E7", ["\xB8"] = "E8", ["\xB9"] = "E9", ["\xBA"] = "E.", ["\xBB"] = "EE", ["\xBC"] = "EE-", ["\xBD"] = "E", ["\xBE"] = "E-", ["\xBF"] = "E", - ["\xC0"] = "E-0", ["\xC1"] = "E-1", ["\xC2"] = "E-2", ["\xC3"] = "E-3", ["\xC4"] = "E-4", ["\xC5"] = "E-5", ["\xC6"] = "E-6", ["\xC7"] = "E-7", ["\xC8"] = "E-8", ["\xC9"] = "E-9", ["\xCA"] = "E-.", ["\xCB"] = "E-E", ["\xCC"] = "E-E-", ["\xCD"] = "E-", ["\xCE"] = "E--", ["\xCF"] = "E-", - ["\xD0"] = "-0", ["\xD1"] = "-1", ["\xD2"] = "-2", ["\xD3"] = "-3", ["\xD4"] = "-4", ["\xD5"] = "-5", ["\xD6"] = "-6", ["\xD7"] = "-7", ["\xD8"] = "-8", ["\xD9"] = "-9", ["\xDA"] = "-.", ["\xDB"] = "-E", ["\xDC"] = "-E-", ["\xDD"] = "-", ["\xDE"] = "--", ["\xDF"] = "-", - } - local remap_2 = { - ["\x0F"] = "0", ["\x1F"] = "1", ["\x2F"] = "2", ["\x3F"] = "3", ["\x4F"] = "4", - ["\x5F"] = "5", ["\x6F"] = "6", ["\x7F"] = "7", ["\x8F"] = "8", ["\x9F"] = "9", - } + local p_single = + P("\00") / function() + result.version = strings[stack[top]] or "unset" + top = 0 + end + + P("\01") / function() + result.notice = strings[stack[top]] or "unset" + top = 0 + end + + P("\02") / function() + result.fullname = strings[stack[top]] or "unset" + top = 0 + end + + P("\03") / function() + result.familyname = strings[stack[top]] or "unset" + top = 0 + end + + P("\04") / function() + result.weight = strings[stack[top]] or "unset" + top = 0 + end + + P("\05") / function() + result.fontbbox = { unpack(stack,1,4) } + top = 0 + end + + P("\06") / function() + result.bluevalues = { unpack(stack,1,top) } + top = 0 + end + + P("\07") / function() + result.otherblues = { unpack(stack,1,top) } + top = 0 + end + + P("\08") / function() + result.familyblues = { unpack(stack,1,top) } + top = 0 + end + + P("\09") / function() + result.familyotherblues = { unpack(stack,1,top) } + top = 0 + end + + P("\10") / function() + result.stdhw = stack[top] + top = 0 + end + + P("\11") / function() + result.stdvw = stack[top] + top = 0 + end + + P("\13") / function() + result.uniqueid = stack[top] + top = 0 + end + + P("\14") / function() + result.xuid = concat(stack,"",1,top) + top = 0 + end + + P("\15") / function() + result.charset = stack[top] + top = 0 + end + + P("\16") / function() + result.encoding = stack[top] + top = 0 + end + + P("\17") / function() -- valid cff2 + result.charstrings = stack[top] + top = 0 + end + + P("\18") / function() + result.private = { + size = stack[top-1], + offset = stack[top], + } + top = 0 + end + + P("\19") / function() + result.subroutines = stack[top] + top = 0 -- new, forgotten ? + end + + P("\20") / function() + result.defaultwidthx = stack[top] + top = 0 -- new, forgotten ? + end + + P("\21") / function() + result.nominalwidthx = stack[top] + top = 0 -- new, forgotten ? + end + -- + P("\22") / function() -- reserved + -- end + -- + P("\23") / function() -- reserved + -- end + + P("\24") / function() -- new in cff2 + result.vstore = stack[top] + top = 0 + end + + P("\25") / function() -- new in cff2 + result.maxstack = stack[top] + top = 0 + end + -- + P("\26") / function() -- reserved + -- end + -- + P("\27") / function() -- reserved + -- end + + local p_double = P("\12") * ( + P("\00") / function() + result.copyright = stack[top] + top = 0 + end + + P("\01") / function() + result.monospaced = stack[top] == 1 and true or false -- isfixedpitch + top = 0 + end + + P("\02") / function() + result.italicangle = stack[top] + top = 0 + end + + P("\03") / function() + result.underlineposition = stack[top] + top = 0 + end + + P("\04") / function() + result.underlinethickness = stack[top] + top = 0 + end + + P("\05") / function() + result.painttype = stack[top] + top = 0 + end + + P("\06") / function() + result.charstringtype = stack[top] + top = 0 + end + + P("\07") / function() -- valid cff2 + result.fontmatrix = { unpack(stack,1,6) } + top = 0 + end + + P("\08") / function() + result.strokewidth = stack[top] + top = 0 + end + + P("\09") / function() + result.bluescale = stack[top] + top = 0 + end + + P("\10") / function() + result.blueshift = stack[top] + top = 0 + end + + P("\11") / function() + result.bluefuzz = stack[top] + top = 0 + end + + P("\12") / function() + result.stemsnaph = { unpack(stack,1,top) } + top = 0 + end + + P("\13") / function() + result.stemsnapv = { unpack(stack,1,top) } + top = 0 + end + + P("\20") / function() + result.syntheticbase = stack[top] + top = 0 + end + + P("\21") / function() + result.postscript = strings[stack[top]] or "unset" + top = 0 + end + + P("\22") / function() + result.basefontname = strings[stack[top]] or "unset" + top = 0 + end + + P("\21") / function() + result.basefontblend = stack[top] + top = 0 + end + + P("\30") / function() + result.cid.registry = strings[stack[top-2]] or "unset" + result.cid.ordering = strings[stack[top-1]] or "unset" + result.cid.supplement = stack[top] + top = 0 + end + + P("\31") / function() + result.cid.fontversion = stack[top] + top = 0 + end + + P("\32") / function() + result.cid.fontrevision= stack[top] + top = 0 + end + + P("\33") / function() + result.cid.fonttype = stack[top] + top = 0 + end + + P("\34") / function() + result.cid.count = stack[top] + top = 0 + end + + P("\35") / function() + result.cid.uidbase = stack[top] + top = 0 + end + + P("\36") / function() -- valid cff2 + result.cid.fdarray = stack[top] + top = 0 + end + + P("\37") / function() -- valid cff2 + result.cid.fdselect = stack[top] + top = 0 + end + + P("\38") / function() + result.cid.fontname = strings[stack[top]] or "unset" + top = 0 + end + ) + + -- Some lpeg fun ... a first variant split the byte and made a new string but + -- the second variant is much faster. Not that it matters much as we don't see + -- such numbers often. + + local remap_1 = { + ["\x00"] = "00", ["\x01"] = "01", ["\x02"] = "02", ["\x03"] = "03", ["\x04"] = "04", ["\x05"] = "05", ["\x06"] = "06", ["\x07"] = "07", ["\x08"] = "08", ["\x09"] = "09", ["\x0A"] = "0.", ["\x0B"] = "0E", ["\x0C"] = "0E-", ["\x0D"] = "0", ["\x0E"] = "0-", ["\x0F"] = "0", + ["\x10"] = "10", ["\x11"] = "11", ["\x12"] = "12", ["\x13"] = "13", ["\x14"] = "14", ["\x15"] = "15", ["\x16"] = "16", ["\x17"] = "17", ["\x18"] = "18", ["\x19"] = "19", ["\x1A"] = "1.", ["\x1B"] = "1E", ["\x1C"] = "1E-", ["\x1D"] = "1", ["\x1E"] = "1-", ["\x1F"] = "1", + ["\x20"] = "20", ["\x21"] = "21", ["\x22"] = "22", ["\x23"] = "23", ["\x24"] = "24", ["\x25"] = "25", ["\x26"] = "26", ["\x27"] = "27", ["\x28"] = "28", ["\x29"] = "29", ["\x2A"] = "2.", ["\x2B"] = "2E", ["\x2C"] = "2E-", ["\x2D"] = "2", ["\x2E"] = "2-", ["\x2F"] = "2", + ["\x30"] = "30", ["\x31"] = "31", ["\x32"] = "32", ["\x33"] = "33", ["\x34"] = "34", ["\x35"] = "35", ["\x36"] = "36", ["\x37"] = "37", ["\x38"] = "38", ["\x39"] = "39", ["\x3A"] = "3.", ["\x3B"] = "3E", ["\x3C"] = "3E-", ["\x3D"] = "3", ["\x3E"] = "3-", ["\x3F"] = "3", + ["\x40"] = "40", ["\x41"] = "41", ["\x42"] = "42", ["\x43"] = "43", ["\x44"] = "44", ["\x45"] = "45", ["\x46"] = "46", ["\x47"] = "47", ["\x48"] = "48", ["\x49"] = "49", ["\x4A"] = "4.", ["\x4B"] = "4E", ["\x4C"] = "4E-", ["\x4D"] = "4", ["\x4E"] = "4-", ["\x4F"] = "4", + ["\x50"] = "50", ["\x51"] = "51", ["\x52"] = "52", ["\x53"] = "53", ["\x54"] = "54", ["\x55"] = "55", ["\x56"] = "56", ["\x57"] = "57", ["\x58"] = "58", ["\x59"] = "59", ["\x5A"] = "5.", ["\x5B"] = "5E", ["\x5C"] = "5E-", ["\x5D"] = "5", ["\x5E"] = "5-", ["\x5F"] = "5", + ["\x60"] = "60", ["\x61"] = "61", ["\x62"] = "62", ["\x63"] = "63", ["\x64"] = "64", ["\x65"] = "65", ["\x66"] = "66", ["\x67"] = "67", ["\x68"] = "68", ["\x69"] = "69", ["\x6A"] = "6.", ["\x6B"] = "6E", ["\x6C"] = "6E-", ["\x6D"] = "6", ["\x6E"] = "6-", ["\x6F"] = "6", + ["\x70"] = "70", ["\x71"] = "71", ["\x72"] = "72", ["\x73"] = "73", ["\x74"] = "74", ["\x75"] = "75", ["\x76"] = "76", ["\x77"] = "77", ["\x78"] = "78", ["\x79"] = "79", ["\x7A"] = "7.", ["\x7B"] = "7E", ["\x7C"] = "7E-", ["\x7D"] = "7", ["\x7E"] = "7-", ["\x7F"] = "7", + ["\x80"] = "80", ["\x81"] = "81", ["\x82"] = "82", ["\x83"] = "83", ["\x84"] = "84", ["\x85"] = "85", ["\x86"] = "86", ["\x87"] = "87", ["\x88"] = "88", ["\x89"] = "89", ["\x8A"] = "8.", ["\x8B"] = "8E", ["\x8C"] = "8E-", ["\x8D"] = "8", ["\x8E"] = "8-", ["\x8F"] = "8", + ["\x90"] = "90", ["\x91"] = "91", ["\x92"] = "92", ["\x93"] = "93", ["\x94"] = "94", ["\x95"] = "95", ["\x96"] = "96", ["\x97"] = "97", ["\x98"] = "98", ["\x99"] = "99", ["\x9A"] = "9.", ["\x9B"] = "9E", ["\x9C"] = "9E-", ["\x9D"] = "9", ["\x9E"] = "9-", ["\x9F"] = "9", + ["\xA0"] = ".0", ["\xA1"] = ".1", ["\xA2"] = ".2", ["\xA3"] = ".3", ["\xA4"] = ".4", ["\xA5"] = ".5", ["\xA6"] = ".6", ["\xA7"] = ".7", ["\xA8"] = ".8", ["\xA9"] = ".9", ["\xAA"] = "..", ["\xAB"] = ".E", ["\xAC"] = ".E-", ["\xAD"] = ".", ["\xAE"] = ".-", ["\xAF"] = ".", + ["\xB0"] = "E0", ["\xB1"] = "E1", ["\xB2"] = "E2", ["\xB3"] = "E3", ["\xB4"] = "E4", ["\xB5"] = "E5", ["\xB6"] = "E6", ["\xB7"] = "E7", ["\xB8"] = "E8", ["\xB9"] = "E9", ["\xBA"] = "E.", ["\xBB"] = "EE", ["\xBC"] = "EE-", ["\xBD"] = "E", ["\xBE"] = "E-", ["\xBF"] = "E", + ["\xC0"] = "E-0", ["\xC1"] = "E-1", ["\xC2"] = "E-2", ["\xC3"] = "E-3", ["\xC4"] = "E-4", ["\xC5"] = "E-5", ["\xC6"] = "E-6", ["\xC7"] = "E-7", ["\xC8"] = "E-8", ["\xC9"] = "E-9", ["\xCA"] = "E-.", ["\xCB"] = "E-E", ["\xCC"] = "E-E-", ["\xCD"] = "E-", ["\xCE"] = "E--", ["\xCF"] = "E-", + ["\xD0"] = "-0", ["\xD1"] = "-1", ["\xD2"] = "-2", ["\xD3"] = "-3", ["\xD4"] = "-4", ["\xD5"] = "-5", ["\xD6"] = "-6", ["\xD7"] = "-7", ["\xD8"] = "-8", ["\xD9"] = "-9", ["\xDA"] = "-.", ["\xDB"] = "-E", ["\xDC"] = "-E-", ["\xDD"] = "-", ["\xDE"] = "--", ["\xDF"] = "-", + } + local remap_2 = { + ["\x0F"] = "0", ["\x1F"] = "1", ["\x2F"] = "2", ["\x3F"] = "3", ["\x4F"] = "4", + ["\x5F"] = "5", ["\x6F"] = "6", ["\x7F"] = "7", ["\x8F"] = "8", ["\x9F"] = "9", + } - local p_last_1 = S("\x0F\x1F\x2F\x3F\x4F\x5F\x6F\x7F\x8F\x9F\xAF\xBF") - local p_last_2 = R("\xF0\xFF") + local p_last_1 = S("\x0F\x1F\x2F\x3F\x4F\x5F\x6F\x7F\x8F\x9F\xAF\xBF") + local p_last_2 = R("\xF0\xFF") - -- tricky, we don't want to append last + -- tricky, we don't want to append last - -- local p_nibbles = P("\30") * Cs(((1-p_last)/remap)^0 * (P(1)/remap)) / function(n) - local p_nibbles = P("\30") * Cs(((1-(p_last_1+p_last_2))/remap_1)^0 * (p_last_1/remap_2 + p_last_2/"")) / function(n) - -- 0-9=digit a=. b=E c=E- d=reserved e=- f=finish - top = top + 1 - stack[top] = tonumber(n) or 0 - end + -- local p_nibbles = P("\30") * Cs(((1-p_last)/remap)^0 * (P(1)/remap)) / function(n) + local p_nibbles = P("\30") * Cs(((1-(p_last_1+p_last_2))/remap_1)^0 * (p_last_1/remap_2 + p_last_2/"")) / function(n) + -- 0-9=digit a=. b=E c=E- d=reserved e=- f=finish + top = top + 1 + stack[top] = tonumber(n) or 0 + end - local p_byte = C(R("\32\246")) / function(b0) - -- -107 .. +107 - top = top + 1 - stack[top] = byte(b0) - 139 - end + local p_byte = C(R("\32\246")) / function(b0) + -- -107 .. +107 + top = top + 1 + stack[top] = byte(b0) - 139 + end - local p_positive = C(R("\247\250")) * C(1) / function(b0,b1) - -- +108 .. +1131 - top = top + 1 - stack[top] = (byte(b0)-247)*256 + byte(b1) + 108 - end + local p_positive = C(R("\247\250")) * C(1) / function(b0,b1) + -- +108 .. +1131 + top = top + 1 + stack[top] = (byte(b0)-247)*256 + byte(b1) + 108 + end - local p_negative = C(R("\251\254")) * C(1) / function(b0,b1) - -- -1131 .. -108 - top = top + 1 - stack[top] = -(byte(b0)-251)*256 - byte(b1) - 108 - end + local p_negative = C(R("\251\254")) * C(1) / function(b0,b1) + -- -1131 .. -108 + top = top + 1 + stack[top] = -(byte(b0)-251)*256 - byte(b1) - 108 + end - -- local p_float = P("\255") * C(1) * C(1) * C(1) * C(1) / function(b0,b1,b2,b3) - -- top = top + 1 - -- stack[top] = 0 - -- end + -- local p_float = P("\255") * C(1) * C(1) * C(1) * C(1) / function(b0,b1,b2,b3) + -- top = top + 1 + -- stack[top] = 0 + -- end - local p_short = P("\28") * C(1) * C(1) / function(b1,b2) - -- -32768 .. +32767 : b1<<8 | b2 - top = top + 1 - local n = 0x100 * byte(b1) + byte(b2) - if n >= 0x8000 then - stack[top] = n - 0xFFFF - 1 - else - stack[top] = n + local p_short = P("\28") * C(1) * C(1) / function(b1,b2) + -- -32768 .. +32767 : b1<<8 | b2 + top = top + 1 + local n = 0x100 * byte(b1) + byte(b2) + if n >= 0x8000 then + stack[top] = n - 0xFFFF - 1 + else + stack[top] = n + end end - end - local p_long = P("\29") * C(1) * C(1) * C(1) * C(1) / function(b1,b2,b3,b4) - -- -2^31 .. +2^31-1 : b1<<24 | b2<<16 | b3<<8 | b4 - top = top + 1 - local n = 0x1000000 * byte(b1) + 0x10000 * byte(b2) + 0x100 * byte(b3) + byte(b4) - if n >= 0x8000000 then - stack[top] = n - 0xFFFFFFFF - 1 - else - stack[top] = n + local p_long = P("\29") * C(1) * C(1) * C(1) * C(1) / function(b1,b2,b3,b4) + -- -2^31 .. +2^31-1 : b1<<24 | b2<<16 | b3<<8 | b4 + top = top + 1 + local n = 0x1000000 * byte(b1) + 0x10000 * byte(b2) + 0x100 * byte(b3) + byte(b4) + if n >= 0x8000000 then + stack[top] = n - 0xFFFFFFFF - 1 + else + stack[top] = n + end end - end - local p_unsupported = P(1) / function(detail) - top = 0 - end + local p_unsupported = P(1) / function(detail) + top = 0 + end - local p_dictionary = ( - p_byte - + p_positive - + p_negative - + p_short - + p_long - + p_nibbles - + p_single - + p_double - -- + p_float - + p_unsupported - )^1 + p_dictionary = ( + p_byte + + p_positive + + p_negative + + p_short + + p_long + + p_nibbles + + p_single + + p_double + -- + p_float + + p_unsupported + )^1 + + end parsedictionaries = function(data,dictionaries,version) stack = { } @@ -740,6 +744,13 @@ do local justpass = false local seacs = { } local procidx = nil + local flexhints = { } + local ignorehint = false + local nofflexhints = 0 + + local encode = { } + local chars = { } + local typeone = false local function showstate(where,i,n) if i then @@ -763,6 +774,156 @@ do -- some back. I inlined some of then and a bit speed can be gained by more -- inlining but not that much. + setmetatableindex(chars,function (t,k) -- also make a helper + local v = char(k) + t[k] = v + return v + end) + + local c_endchar = chars[14] + + local c_closepath = chars[09] + local c_endchar = chars[14] + + local c_command = chars[12] + + local pack_result_tagged, pack_result_untagged do + + local c_vlineto = chars[07] + local c_hlineto = chars[06] + local c_rlineto = chars[05] + + local c_vhcurveto = chars[30] + local c_hvcurveto = chars[31] + local c_rrcurveto = chars[08] + + local c_vmoveto = chars[04] + local c_hmoveto = chars[22] + local c_rmoveto = chars[21] + + local function pack_curveto(result,r,x,y,x1,y1,x2,y2,x3,y3) + local d1 = x2 - x + local d2 = y2 - y + local d3 = x3 - x2 + local d4 = y3 - y2 + local d5 = x1 - x3 + local d6 = y1 - y3 + if d1 == 0 and d6 == 0 then + r = r + 1 ; result[r] = encode[d2] + r = r + 1 ; result[r] = encode[d3] + r = r + 1 ; result[r] = encode[d4] + r = r + 1 ; result[r] = encode[d5] + r = r + 1 ; result[r] = c_vhcurveto + elseif d2 == 0 and d5 == 0 then + r = r + 1 ; result[r] = encode[d1] + r = r + 1 ; result[r] = encode[d3] + r = r + 1 ; result[r] = encode[d4] + r = r + 1 ; result[r] = encode[d6] + r = r + 1 ; result[r] = c_hvcurveto + else + r = r + 1 ; result[r] = encode[d1] + r = r + 1 ; result[r] = encode[d2] + r = r + 1 ; result[r] = encode[d3] + r = r + 1 ; result[r] = encode[d4] + r = r + 1 ; result[r] = encode[d5] + r = r + 1 ; result[r] = encode[d6] + r = r + 1 ; result[r] = c_rrcurveto + end + return r, x1, y1 + end + + local function pack_moveto(result,r,x,y,x1,y1) + x = x1 - x + y = y1 - y + if x == 0 then + r = r + 1 ; result[r] = encode[y] + r = r + 1 ; result[r] = c_vmoveto + elseif y == 0 then + r = r + 1 ; result[r] = encode[x] + r = r + 1 ; result[r] = c_hmoveto + else + r = r + 1 ; result[r] = encode[x] + r = r + 1 ; result[r] = encode[y] + r = r + 1 ; result[r] = c_rmoveto + end + return r, x1, y1 + end + + local function pack_lineto(result,r,x,y,x1,y1) + x = x1 - x + y = y1 - y + if x == 0 then + r = r + 1 ; result[r] = encode[y] + r = r + 1 ; result[r] = c_vlineto + elseif y == 0 then + r = r + 1 ; result[r] = encode[x] + r = r + 1 ; result[r] = c_hlineto + else + r = r + 1 ; result[r] = encode[x] + r = r + 1 ; result[r] = encode[y] + r = r + 1 ; result[r] = c_rlineto + end + return r, x1, y1 + end + + pack_result_tagged = function(t,width,xoffset,yoffset) + local result = { encode[width] } + local r = 1 + local n = #t + local x = xoffset or 0 + local y = yoffset or 0 + if xoffset and yoffset then + r, x, y = pack_moveto(result,r,0,0,x,y) + end + for i=1,n do + local ti = t[i] + local tg = ti[#ti] + if tg == "c" then + r, x, y = pack_curveto(result,r,x,y,ti[5],ti[6],ti[1],ti[2],ti[3],ti[4]) + elseif tg == "l" then + r, x, y = pack_lineto(result,r,x,y,ti[1],ti[2]) + elseif tg == "m" then + r, x, y = pack_moveto(result,r,x,y,ti[1],ti[2]) + elseif tg == "close" then + r = r + 1 ; result[r] = c_closepath + end + end + r = r + 1 ; result[r] = c_closepath + r = r + 1 ; result[r] = c_endchar + return concat(result) + end + + pack_result_untagged = function(t,width,xoffset,yoffset) + local result = { encode[width] } + local r = 1 + local n = #t + local x = xoffset or 0 + local y = yoffset or 0 + if xoffset and yoffset then + r, x, y = pack_moveto(result,r,0,0,x,y) + end + for i=1,n do + local ti = t[i] + local ni = #ti + for j=1,ni do + local tj = ti[j] + local nj = #tj + if nj == 6 then + r, x, y = pack_curveto(result,r,x,y,tj[1],tj[2],tj[3],tj[4],tj[5],tj[6]) + elseif j == 1 then + r, x, y = pack_moveto(result,r,x,y,tj[1],tj[2]) + else + r, x, y = pack_lineto(result,r,x,y,tj[1],tj[2]) + end + end + end + r = r + 1 ; result[r] = c_closepath + r = r + 1 ; result[r] = c_endchar + return concat(result) + end + + end + -- Maybe have several action tables: -- -- keep curve / checked @@ -770,10 +931,158 @@ do -- checked -- not checked - local function xymoveto() + local xycurveto, xylineto, xymoveto + + local function report_hints(verdict) + report("%w%-10s : [%s] n=%i, %s",depth*2,"hints",concat(flexhints," ",1,nofflexhints),nofflexhints,verdict) + end + + local function flushflexhints() + if trace_charstrings then + showstate("flush flex hints") + end + if not ignorehint then + -- whatever + elseif nofflexhints == 14 then + if trace_charstrings then + report_hints("flex curves") + end + local ax = x + flexhints[01] + flexhints[03] + local ay = y + flexhints[02] + flexhints[04] + local bx = ax + flexhints[05] + local by = ay + flexhints[06] + local cx = bx + flexhints[07] + local cy = by + flexhints[08] + local dx = cx + flexhints[09] + local dy = cy + flexhints[10] + local ex = dx + flexhints[11] + local ey = dy + flexhints[12] + x = ex + flexhints[13] + y = ey + flexhints[14] + xycurveto(ax,ay,bx,by,cx,cy) + xycurveto(dx,dy,ex,ey,x,y) + else + if trace_charstrings then + report_hints(nofflexhints == 0 and "no values" or "incomplete") + end + end + ignorehint = false + nofflexhints = 0 + end + + -- Do we need a level counter? + + local function collectflexhints() + if ignorehint then + if trace_charstrings then + showstate("already collecting flex hints") + end + else + nofflexhints = 0 + ignorehint = true + if trace_charstrings then + showstate("collect flex hints") + end + end + end + + local function resetflexhints(where) + if trace_charstrings then + showstate("reset flex hints") + report_hints(where) + end + ignorehint = false + nofflexhints = 0 + end + + local closepath, addmoveto, fixmoveto, setwidthfrommove, setwidthfromstem + + do + + local close_path = { "close", "path" } + local close_move = { "close", "move" } + + closepath = function() + if version == "cff" then + if trace_charstrings then + showstate("closepath") + end + -- maybe also cff 2 + if r > 0 then + local rr = result[r] + local cc = rr == close_move or rr == close_path + local mm = rr[3] == "m" + if cc then + -- don't add close + elseif mm then + -- don't add close and wipe moveto + r = r - 1 + else + r = r + 1 ; result[r] = close_path + end + end + end + top = 0 + end + + addmoveto = function(x,y) + if r > 0 then + local rr = result[r] + local cc = rr == close_move or rr == close_path + local mm = rr[3] == "m" + if cc then + -- don't add close + elseif mm then + -- don't add close and keep moveto + rr[1] = x + rr[2] = y + return + else + r = r + 1 ; result[r] = close_move + end + end + r = r + 1 ; result[r] = { x, y, "m" } + end + + fixmoveto = function() + x = x + flexhints[1] + y = y + flexhints[2] + addmoveto(x,y) + if trace_charstrings then + report_hints("fix moveto") + end + ignorehint = false + nofflexhints = 0 + end + + setwidthfrommove = function() + if top > 1 then + width = stack[1] + if trace_charstrings then + showvalue("width from move",width) + end + else + width = true + end + end + + setwidthfromstem = function() + if width then + remove(stack,1) + else + width = remove(stack,1) + if trace_charstrings then + showvalue("width from stem",width) + end + end + top = top - 1 + end + + end + + xymoveto = function() if keepcurve then - r = r + 1 - result[r] = { x, y, "m" } + addmoveto(x,y) end if checked then if x > xmax then xmax = x elseif x < xmin then xmin = x end @@ -789,8 +1098,7 @@ do local function xmoveto() -- slight speedup if keepcurve then - r = r + 1 - result[r] = { x, y, "m" } + addmoveto(x,y) end if not checked then xmin = x @@ -807,8 +1115,7 @@ do local function ymoveto() -- slight speedup if keepcurve then - r = r + 1 - result[r] = { x, y, "m" } + addmoveto(x,y) end if not checked then xmin = x @@ -823,7 +1130,7 @@ do end end - local function moveto() + local function moveto() -- not used if trace_charstrings then showstate("moveto") end @@ -831,10 +1138,9 @@ do xymoveto() end - local function xylineto() -- we could inline, no blend + xylineto = function() -- we could inline, no blend if keepcurve then - r = r + 1 - result[r] = { x, y, "l" } + r = r + 1 ; result[r] = { x, y, "l" } end if checked then if x > xmax then xmax = x elseif x < xmin then xmin = x end @@ -850,8 +1156,7 @@ do local function xlineto() -- slight speedup if keepcurve then - r = r + 1 - result[r] = { x, y, "l" } + r = r + 1 ; result[r] = { x, y, "l" } end if not checked then xmin = x @@ -868,8 +1173,7 @@ do local function ylineto() -- slight speedup if keepcurve then - r = r + 1 - result[r] = { x, y, "l" } + r = r + 1 ; result[r] = { x, y, "l" } end if not checked then xmin = x @@ -884,13 +1188,12 @@ do end end - local function xycurveto(x1,y1,x2,y2,x3,y3,i,n) -- called local so no blend here + xycurveto = function(x1,y1,x2,y2,x3,y3,i,n) -- called local so no blend here if trace_charstrings then showstate("curveto",i,n) end if keepcurve then - r = r + 1 - result[r] = { x1, y1, x2, y2, x3, y3, "c" } + r = r + 1 ; result[r] = { x1, y1, x2, y2, x3, y3, "c" } end if checked then if x1 > xmax then xmax = x1 elseif x1 < xmin then xmin = x1 end @@ -909,64 +1212,73 @@ do end local function rmoveto() - if not width then - if top > 2 then - width = stack[1] - if trace_charstrings then - showvalue("backtrack width",width) - end - else - width = true + if ignorehint then + if trace_charstrings then + showstate("rmoveto (flex)") end + nofflexhints = nofflexhints + 1 ; flexhints[nofflexhints] = stack[top-1] + nofflexhints = nofflexhints + 1 ; flexhints[nofflexhints] = stack[top] + top = 0 + else + if trace_charstrings then + showstate("rmoveto") + end + if not width then + setwidthfrommove() + end + x = x + stack[top-1] -- dx1 + y = y + stack[top] -- dy1 + top = 0 + xymoveto() end - if trace_charstrings then - showstate("rmoveto") - end - x = x + stack[top-1] -- dx1 - y = y + stack[top] -- dy1 - top = 0 - xymoveto() end local function hmoveto() - if not width then - if top > 1 then - width = stack[1] - if trace_charstrings then - showvalue("backtrack width",width) - end - else - width = true + if ignorehint then + if trace_charstrings then + showstate("hmoveto (flex)") end + nofflexhints = nofflexhints + 1 ; flexhints[nofflexhints] = stack[top] + nofflexhints = nofflexhints + 1 ; flexhints[nofflexhints] = 0 + top = 0 + else + if trace_charstrings then + showstate("hmoveto") + end + if not width then + setwidthfrommove() + end + x = x + stack[top] -- dx1 + top = 0 + xmoveto() end - if trace_charstrings then - showstate("hmoveto") - end - x = x + stack[top] -- dx1 - top = 0 - xmoveto() end local function vmoveto() - if not width then - if top > 1 then - width = stack[1] - if trace_charstrings then - showvalue("backtrack width",width) - end - else - width = true + if ignorehint then + if trace_charstrings then + showstate("vmoveto (flex)") end + nofflexhints = nofflexhints + 1 ; flexhints[nofflexhints] = 0 + nofflexhints = nofflexhints + 1 ; flexhints[nofflexhints] = stack[top] + top = 0 + else + if trace_charstrings then + showstate("vmoveto") + end + if not width then + setwidthfrommove() + end + y = y + stack[top] -- dy1 + top = 0 + ymoveto() end - if trace_charstrings then - showstate("vmoveto") - end - y = y + stack[top] -- dy1 - top = 0 - ymoveto() end local function rlineto() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("rlineto") end @@ -979,6 +1291,9 @@ do end local function hlineto() -- x (y,x)+ | (x,y)+ + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("hlineto") end @@ -988,12 +1303,13 @@ do else local swap = true for i=1,top do + local d = stack[i] if swap then - x = x + stack[i] + x = x + d xlineto() swap = false else - y = y + stack[i] + y = y + d ylineto() swap = true end @@ -1003,6 +1319,9 @@ do end local function vlineto() -- y (x,y)+ | (y,x)+ + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("vlineto") end @@ -1012,12 +1331,13 @@ do else local swap = false for i=1,top do + local d = stack[i] if swap then - x = x + stack[i] + x = x + d xlineto() swap = false else - y = y + stack[i] + y = y + d ylineto() swap = true end @@ -1027,163 +1347,191 @@ do end local function rrcurveto() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("rrcurveto") end -if top == 6 then - local ax = x + stack[1] -- dxa - local ay = y + stack[2] -- dya - local bx = ax + stack[3] -- dxb - local by = ay + stack[4] -- dyb - x = bx + stack[5] -- dxc - y = by + stack[6] -- dyc - xycurveto(ax,ay,bx,by,x,y,1,6) -else --- print("rr",top==6,top) - for i=1,top,6 do - local ax = x + stack[i] -- dxa - local ay = y + stack[i+1] -- dya - local bx = ax + stack[i+2] -- dxb - local by = ay + stack[i+3] -- dyb - x = bx + stack[i+4] -- dxc - y = by + stack[i+5] -- dyc - xycurveto(ax,ay,bx,by,x,y,i,6) + if top == 6 then + local ax = x + stack[1] -- dxa + local ay = y + stack[2] -- dya + local bx = ax + stack[3] -- dxb + local by = ay + stack[4] -- dyb + x = bx + stack[5] -- dxc + y = by + stack[6] -- dyc + xycurveto(ax,ay,bx,by,x,y,1,6) + else + for i=1,top,6 do + local ax = x + stack[i] -- dxa + local ay = y + stack[i+1] -- dya + local bx = ax + stack[i+2] -- dxb + local by = ay + stack[i+3] -- dyb + x = bx + stack[i+4] -- dxc + y = by + stack[i+5] -- dyc + xycurveto(ax,ay,bx,by,x,y,i,6) + end end -end top = 0 end local function hhcurveto() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("hhcurveto") end - local s = 1 - if top % 2 ~= 0 then - y = y + stack[1] -- dy1 - s = 2 - end -if top == 4 then - local ax = x + stack[1] -- dxa + if top == 4 then + local ax = x + stack[1] -- dxa local ay = y local bx = ax + stack[2] -- dxb local by = ay + stack[3] -- dyb x = bx + stack[4] -- dxc y = by xycurveto(ax,ay,bx,by,x,y,1,4) -else - for i=s,top,4 do - local ax = x + stack[i] -- dxa - local ay = y - local bx = ax + stack[i+1] -- dxb - local by = ay + stack[i+2] -- dyb - x = bx + stack[i+3] -- dxc + elseif top == 5 then + local ax = x + stack[2] -- dxa + local ay = y + stack[1] + local bx = ax + stack[3] -- dxb + local by = ay + stack[4] -- dyb + x = bx + stack[5] -- dxc y = by - xycurveto(ax,ay,bx,by,x,y,i,4) + xycurveto(ax,ay,bx,by,x,y,2,4) + else + local s + if top % 2 ~= 0 then + y = y + stack[1] -- dy1 + s = 2 + else + s = 1 + end + for i=s,top,4 do + local ax = x + stack[i] -- dxa + local ay = y + local bx = ax + stack[i+1] -- dxb + local by = ay + stack[i+2] -- dyb + x = bx + stack[i+3] -- dxc + y = by + xycurveto(ax,ay,bx,by,x,y,i,4) + end end -end top = 0 end local function vvcurveto() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("vvcurveto") end - local s = 1 - local d = 0 - if top % 2 ~= 0 then - d = stack[1] -- dx1 - s = 2 - end -if top == 4 then - local ax = x + d - local ay = y + stack[1] -- dya - local bx = ax + stack[2] -- dxb - local by = ay + stack[3] -- dyb - x = bx - y = by + stack[4] -- dyc - xycurveto(ax,ay,bx,by,x,y,1,4) - d = 0 -else - for i=s,top,4 do - local ax = x + d - local ay = y + stack[i] -- dya - local bx = ax + stack[i+1] -- dxb - local by = ay + stack[i+2] -- dyb + if top == 4 then + local ax = x + local ay = y + stack[1] -- dya + local bx = ax + stack[2] -- dxb + local by = ay + stack[3] -- dyb + x = bx + y = by + stack[4] -- dyc + xycurveto(ax,ay,bx,by,x,y,1,4) + elseif top == 5 then + local ax = x + stack[1] + local ay = y + stack[2] -- dya + local bx = ax + stack[3] -- dxb + local by = ay + stack[4] -- dyb x = bx - y = by + stack[i+3] -- dyc - xycurveto(ax,ay,bx,by,x,y,i,4) - d = 0 + y = by + stack[5] -- dyc + xycurveto(ax,ay,bx,by,x,y,2,4) + else + local s + if top % 2 ~= 0 then + x = x + stack[1] -- dx1 + s = 2 + else + s = 1 + end + for i=s,top,4 do + local ax = x + local ay = y + stack[i] -- dya + local bx = ax + stack[i+1] -- dxb + local by = ay + stack[i+2] -- dyb + x = bx + y = by + stack[i+3] -- dyc + xycurveto(ax,ay,bx,by,x,y,i,4) + end end -end top = 0 end + -- just use copy ... can be faster + local function xxcurveto(swap) local last = top % 4 ~= 0 and stack[top] if last then top = top - 1 end -if top == 4 then - local ax, ay, bx, by - if swap then - ax = x + stack[1] - ay = y - bx = ax + stack[2] - by = ay + stack[3] - y = by + stack[4] - if last then - x = bx + last - else - x = bx - end - else - ax = x - ay = y + stack[1] - bx = ax + stack[2] - by = ay + stack[3] - x = bx + stack[4] - if last then - y = by + last - else - y = by - end - end - xycurveto(ax,ay,bx,by,x,y,1 ,4) -else - for i=1,top,4 do + if top == 4 then -- also catches 5 local ax, ay, bx, by if swap then - ax = x + stack[i] + ax = x + stack[1] ay = y - bx = ax + stack[i+1] - by = ay + stack[i+2] - y = by + stack[i+3] - if last and i+3 == top then - x = bx + last - else - x = bx + bx = ax + stack[2] + by = ay + stack[3] + x = bx + y = by + stack[4] + if last then + x = x + last end - swap = false else ax = x - ay = y + stack[i] - bx = ax + stack[i+1] - by = ay + stack[i+2] - x = bx + stack[i+3] - if last and i+3 == top then - y = by + last + ay = y + stack[1] + bx = ax + stack[2] + by = ay + stack[3] + x = bx + stack[4] + y = by + if last then + y = y + last + end + end + xycurveto(ax,ay,bx,by,x,y,1,4) + else + local done = top - 3 + for i=1,top,4 do + local ax, ay, bx, by + if swap then + ax = x + stack[i] + ay = y + bx = ax + stack[i+1] + by = ay + stack[i+2] + y = by + stack[i+3] + x = bx + swap = false else - y = by + ax = x + ay = y + stack[i] + bx = ax + stack[i+1] + by = ay + stack[i+2] + x = bx + stack[i+3] + y = by + swap = true + end + if last and i == done then + if swap then + y = y + last + else + x = x + last + end end - swap = true + xycurveto(ax,ay,bx,by,x,y,i,4) end - xycurveto(ax,ay,bx,by,x,y,i,4) end -end top = 0 end local function hvcurveto() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("hvcurveto") end @@ -1191,6 +1539,9 @@ end end local function vhcurveto() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("vhcurveto") end @@ -1198,6 +1549,9 @@ end end local function rcurveline() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("rcurveline") end @@ -1217,6 +1571,9 @@ end end local function rlinecurve() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("rlinecurve") end @@ -1240,6 +1597,9 @@ end -- flex is not yet tested! no loop local function flex() -- fd not used + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("flex") end @@ -1249,18 +1609,21 @@ end local by = ay + stack[4] -- dy2 local cx = bx + stack[5] -- dx3 local cy = by + stack[6] -- dy3 - xycurveto(ax,ay,bx,by,cx,cy) local dx = cx + stack[7] -- dx4 local dy = cy + stack[8] -- dy4 local ex = dx + stack[9] -- dx5 local ey = dy + stack[10] -- dy5 - x = ex + stack[11] -- dx6 - y = ey + stack[12] -- dy6 + x = ex + stack[11] -- dx6 + y = ey + stack[12] -- dy6 + xycurveto(ax,ay,bx,by,cx,cy) xycurveto(dx,dy,ex,ey,x,y) top = 0 end local function hflex() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("hflex") end @@ -1281,6 +1644,9 @@ end end local function hflex1() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("hflex1") end @@ -1301,6 +1667,9 @@ end end local function flex1() + if nofflexhints > 0 then + fixmoveto() + end if trace_charstrings then showstate("flex1") end @@ -1328,15 +1697,7 @@ end if top == 0 then -- bad elseif top % 2 ~= 0 then - if width then - remove(stack,1) - else - width = remove(stack,1) - if trace_charstrings then - showvalue("width",width) - end - end - top = top - 1 + setwidthfromstem() end if trace_charstrings then showstate("stem") @@ -1349,18 +1710,10 @@ end if top == 0 then -- bad elseif top % 2 ~= 0 then - if width then - remove(stack,1) - else - width = remove(stack,1) - if trace_charstrings then - showvalue("width",width) - end - end - top = top - 1 + setwidthfromstem() end if trace_charstrings then - showstate(operator == 19 and "hintmark" or "cntrmask") + showstate("mask") end stems = stems + (top // 2) top = 0 @@ -1389,28 +1742,29 @@ end -- type 1 (not used in type 2) - local function getstem3() + local function getvstem3() if trace_charstrings then - showstate("stem3") + showstate("vstem3") end top = 0 end - local function divide() - if version == "cff" then - local d = stack[top] - top = top - 1 - stack[top] = stack[top] / d + local function gethstem3() + if trace_charstrings then + showstate("hstem3") end + top = 0 end - local function closepath() + local function divide() if version == "cff" then if trace_charstrings then - showstate("closepath") + showstate("divide") end + local d = stack[top] + top = top - 1 + stack[top] = stack[top] / d end - top = 0 end local function hsbw() @@ -1448,14 +1802,15 @@ end -- These are probably used for special cases i.e. call out to the -- postscript interpreter (p 61 of the spec as well as chapter 8). - -- - -- This needs checking (I have to ask Taco next time we meet.) - local popped = 3 - local hints = 3 + local hints = 3 + local popped = 3 -- arg1 ... argn n othersubr# (on postscript stack) + -- 0 1 2 : implements flex + -- 3 : implements hint + local function callothersubr() if version == "cff" then if trace_charstrings then @@ -1464,7 +1819,7 @@ end if stack[top] == hints then popped = stack[top-2] else - popped = 3 + popped = 3 --ff no, taco yes end local t = stack[top-1] if t then @@ -1480,8 +1835,6 @@ end end end - -- number (from postscript stack) - local function pop() if version == "cff" then if trace_charstrings then @@ -1499,6 +1852,7 @@ end if trace_charstrings then showstate("setcurrentpoint (unsupported)") end + -- can be an option, doesn't always work out well x = x + stack[top-1] y = y + stack[top] end @@ -1624,7 +1978,7 @@ end hlineto, -- 6 vlineto, -- 7 rrcurveto, -- 8 - unsupported, -- 9 -- closepath + closepath, -- 9 -- closepath unsupported, -- 10 -- calllocal, unsupported, -- 11 -- callreturn, unsupported, -- 12 -- elsewhere @@ -1686,35 +2040,48 @@ end local subactions = { -- cff 1 - [000] = dotsection, - [001] = getstem3, - [002] = getstem3, - [006] = seac, - [007] = sbw, - [012] = divide, - [016] = callothersubr, - [017] = pop, - [033] = setcurrentpoint, - -- cff 2 - [034] = hflex, - [035] = flex, - [036] = hflex1, - [037] = flex1, + [000] = dotsection, -- (cff1) + [001] = getvstem3, -- (cff1) + [002] = gethstem3, -- (cff1) + [003] = false, -- (cff2) todo: logicaland, + [004] = false, -- (cff2) todo: logicalor, + [005] = false, -- (cff2) todo: logicalnot, + [006] = seac, -- (cff1) + [007] = sbw, -- (cff1) + [008] = false, -- reserved + [009] = false, -- (cff2) todo: absolute, + [010] = false, -- (cff2) todo: addition, + [011] = false, -- (cff2) todo: subtract, + [012] = divide, -- (cff1/2) + [013] = false, -- reserved + [014] = false, -- (cff2) todo: negate, + [015] = false, -- (cff2) todo: equal, + [016] = callothersubr, -- (cff1) + [017] = pop, -- (cff1) + [018] = false, -- (cff2) todo: drop, + [019] = false, -- reserved + [020] = false, -- (cff2) todo: put, + [021] = false, -- (cff2) todo: get, + [022] = false, -- (cff2) todo: ifelse, + [023] = false, -- (cff2) todo: random, + [024] = false, -- (cff2) todo: multiply, + [025] = false, -- reserved + [026] = false, -- (cff2) todo: sqrt, + [027] = false, -- (cff2) todo: dup, + [028] = false, -- (cff2) todo: exchange, + [029] = false, -- (cff2) todo: index, + [030] = false, -- (cff2) todo: roll, + [032] = false, -- reserved + [033] = false, -- reserved + [033] = setcurrentpoint, -- (cff1) + [034] = hflex, -- (cff2) + [035] = flex, -- (cff2) + [036] = hflex1, -- (cff2) + [037] = flex1, -- (cff2) } - local chars = setmetatableindex(function (t,k) - local v = char(k) - t[k] = v - return v - end) - - local c_endchar = chars[14] - -- todo: round in blend - local encode = { } - local typeone = false - -- this eventually can become a helper setmetatableindex(encode,function(t,i) @@ -1820,273 +2187,342 @@ end -- end of experiment + -- After years of using this I ran into an old font (sabon) that came out bad and + -- after messing around a bit I realized that Taco had added Type1 outlines to mplib + -- so I peeked in there and adapted the flexhint code here to his approach. (In + -- LuaMetaTex we don't have that code in the MetaPost library, otherwise I might + -- have noticed it sooner.) Anyway, here we also need to accumulate the h and v + -- moves in order to get it working and we need to deal with fonts that have bad + -- hitn accumulation. Then I still has some misses and decided to see what + -- fontfforge does, but it does things somewhat different and also seems to catch + -- issues with fonts. The LuaTeX backend has deifferent code for Type1 and OpenType + -- fonts but I never really checked that because with these things I just start from + -- the specifications. All that said, one reason why fonts that have issues often + -- come out well, is because the renderer handles these even-odd cases well. When we + -- want outlines (that feed into for instance MetaPost) we need to avoid artifacts + -- due to border cases where subpaths get connected by for lines. I tested with a + -- few thousand OpenType and Type1 fonts and with a few exceptions (bad font files) + -- it all works okay now. If needed we can now also flatten the OpenType fonts which + -- sometimes gives smaller files but initial caching takes a bit more time. + local process local function call(scope,list,bias) -- ,process) - depth = depth + 1 if top == 0 then - showstate(formatters["unknown %s call %s, case %s"](scope,"?",1)) + showstate(formatters["unknown %s call %s, bias %i, case %s"](scope,"?",bias-1,1)) top = 0 else - local index = stack[top] + bias + local index = bias + stack[top] top = top - 1 if trace_charstrings then showvalue(scope,index,true) end + depth = depth + 1 + -- 0 1 2 : work with flex + -- 3 : work with hint + if version == "cff" then + if index == 0 then + flushflexhints() + elseif index == 1 then + collectflexhints() + -- elseif index == 2 then + -- no-op + -- elseif index == 3 then + -- no-op + end + end local tab = list[index] if tab then process(tab) else - showstate(formatters["unknown %s call %s, case %s"](scope,index,2)) + showstate(formatters["unknown %s call %s, bias %i, case %s"](scope,index,bias-1,2)) top = 0 end + depth = depth - 1 end - depth = depth - 1 end -- precompiling and reuse is much slower than redoing the calls - - process = function(tab) - local i = 1 - local n = #tab - while i <= n do - local t = tab[i] - if t >= 32 then - top = top + 1 - if t <= 246 then - -- -107 .. +107 - stack[top] = t - 139 - i = i + 1 - elseif t <= 250 then - -- +108 .. +1131 - -- stack[top] = (t-247)*256 + tab[i+1] + 108 - -- stack[top] = t*256 - 247*256 + tab[i+1] + 108 - stack[top] = t*256 - 63124 + tab[i+1] - i = i + 2 - elseif t <= 254 then - -- -1131 .. -108 - -- stack[top] = -(t-251)*256 - tab[i+1] - 108 - -- stack[top] = -t*256 + 251*256 - tab[i+1] - 108 - stack[top] = -t*256 + 64148 - tab[i+1] - i = i + 2 - elseif typeone then - local n = 0x1000000 * tab[i+1] + 0x10000 * tab[i+2] + 0x100 * tab[i+3] + tab[i+4] - if n >= 0x8000000 then - n = n - 0xFFFFFFFF - 1 - end - stack[top] = n - i = i + 5 - else - local n1 = 0x100 * tab[i+1] + tab[i+2] - local n2 = 0x100 * tab[i+3] + tab[i+4] - if n1 >= 0x8000 then - n1 = n1 - 0x10000 - end - stack[top] = n1 + n2/0xFFFF - i = i + 5 - end - elseif t == 28 then - -- -32768 .. +32767 : b1<<8 | b2 - top = top + 1 - local n = 0x100 * tab[i+1] + tab[i+2] - if n >= 0x8000 then - -- stack[top] = n - 0xFFFF - 1 - stack[top] = n - 0x10000 - else - stack[top] = n - end - i = i + 3 - elseif t == 11 then -- not in cff2 - if trace_charstrings then - showstate("return") - end - return - elseif t == 10 then - call("local",locals,localbias) -- ,process) - i = i + 1 - elseif t == 14 then -- not in cff2 - if width then - -- okay - elseif top > 0 then - width = stack[1] - if trace_charstrings then - showvalue("width",width) - end - else - width = true - end - if trace_charstrings then - showstate("endchar") - end - return - elseif t == 29 then - call("global",globals,globalbias) -- ,process) - i = i + 1 - elseif t == 12 then - i = i + 1 + -- todo: split into two + + do + + local op_hstem = 1 + -- local op_reserved_1 = 2 + local op_vstem = 3 + -- local op_vmoveto = 4 + -- local op_rlineto = 5 + -- local op_hlineto = 6 + -- local op_vlineto = 7 + local op_rrcurveto = 8 + local op_closepath = 9 + local op_callsubr = 10 + local op_return = 11 + local op_escape = 12 + local op_hsbw = 13 + local op_endchar = 14 + local op_setvsindex = 15 + local op_blend = 16 + -- local op_reserved_2 = 17 + local op_hstemhm = 18 + local op_hintmask = 19 + local op_cntrmask = 20 + -- local op_rmoveto = 21 + -- local op_hmoveto = 22 + local op_vstemhm = 23 + -- local op_rcurveline = 24 + -- local op_rlinecurve = 25 + -- local op_vvcurveto = 26 + -- local op_hhcurveto = 27 + local op_integer = 28 + local op_callgsubr = 29 + -- local op_vhcurveto = 30 + -- local op_hvcurveto = 31 + + process = function(tab) + local i = 1 + local n = #tab + while i <= n do local t = tab[i] - if justpass then - if t >= 34 and t <= 37 then -- flexes - for i=1,top do - r = r + 1 ; result[r] = encode[stack[i]] + if t >= 32 then + top = top + 1 + if t <= 246 then + -- -107 .. +107 + stack[top] = t - 139 + i = i + 1 + elseif t <= 250 then + -- +108 .. +1131 + -- stack[top] = (t-247)*256 + tab[i+1] + 108 + -- stack[top] = t*256 - 247*256 + tab[i+1] + 108 + stack[top] = t*256 - 63124 + tab[i+1] + i = i + 2 + elseif t <= 254 then + -- -1131 .. -108 + -- stack[top] = -(t-251)*256 - tab[i+1] - 108 + -- stack[top] = -t*256 + 251*256 - tab[i+1] - 108 + stack[top] = -t*256 + 64148 - tab[i+1] + i = i + 2 + elseif typeone then + local n = 0x1000000 * tab[i+1] + 0x10000 * tab[i+2] + 0x100 * tab[i+3] + tab[i+4] + if n >= 0x8000000 then + n = n - 0xFFFFFFFF - 1 end - r = r + 1 ; result[r] = chars[12] - r = r + 1 ; result[r] = chars[t] - top = 0 - elseif t == 6 then - seacs[procidx] = { - asb = stack[1], - adx = stack[2], - ady = stack[3], - base = stack[4], - accent = stack[5], - width = width, - lsb = lsb, - } - top = 0 + stack[top] = n + i = i + 5 else - local a = subactions[t] - if a then - a(t) - else - top = 0 + local n1 = 0x100 * tab[i+1] + tab[i+2] + local n2 = 0x100 * tab[i+3] + tab[i+4] + if n1 >= 0x8000 then + n1 = n1 - 0x10000 end + stack[top] = n1 + n2/0xFFFF + i = i + 5 end - else - local a = subactions[t] - if a then - a(t) + elseif t == op_integer then + -- -32768 .. +32767 : b1<<8 | b2 + top = top + 1 + local n = 0x100 * tab[i+1] + tab[i+2] + if n >= 0x8000 then + -- stack[top] = n - 0xFFFF - 1 + stack[top] = n - 0x10000 else + stack[top] = n + end + i = i + 3 + elseif t == op_return then -- not in cff2 + if trace_charstrings then + showstate("return") + end + return + elseif t == op_callsubr then + call("local",locals,localbias) + i = i + 1 + elseif t == op_endchar then -- not in cff2 + if width then + -- okay + elseif top > 0 then + width = stack[1] + if r == 0 and justpass then + -- we need to set the width of space (lm) and other shapeless things + r = r + 1 ; result[r] = encode[width] + r = r + 1 ; result[r] = c_endchar + end if trace_charstrings then - showvalue("",t) + showvalue("width",width) end - top = 0 + else + width = true end - end - i = i + 1 - elseif justpass then - -- todo: local a = passactions - if t == 15 then - p_setvsindex() + if trace_charstrings then + showstate("endchar") + end + return + elseif t == op_callgsubr then + call("global",globals,globalbias) i = i + 1 - elseif t == 16 then - local s = p_blend() or 0 - i = i + s + 1 - -- cff 1: (when cff2 strip them) - elseif t == 1 or t == 3 or t == 18 or operation == 23 then - p_getstem() -- at the start - if version == "cff" then --- if true then - if top > 0 then + elseif t == op_escape then + i = i + 1 + local t = tab[i] + if justpass then + if t >= 34 and t <= 37 then + -- cff2: hflex, flex, hflex1, flex1 for i=1,top do r = r + 1 ; result[r] = encode[stack[i]] end + r = r + 1 ; result[r] = c_command + r = r + 1 ; result[r] = chars[t] top = 0 + elseif t == 6 then + -- cff1: seac + seacs[procidx] = { + asb = stack[1], + adx = stack[2], + ady = stack[3], + base = stack[4], + accent = stack[5], + width = width, + lsb = lsb, + } + top = 0 + else + -- cff1: dotsection, vstem3, hstem3, [seac,] sbw, divide, callothersubr, + -- pop, setcurrentpoint + -- + -- If we end up here something is wrong because cff0 now goes via shapes + -- and opentype cff1 doesn't have this. + local a = subactions[t] + if a then + a(t) + else + top = 0 + end end - r = r + 1 ; result[r] = chars[t] else - top = 0 - end - i = i + 1 - -- cff 1: (when cff2 strip them) - elseif t == 19 or t == 20 then - local s = p_getmask() or 0 -- after the stems --- if version == "cff" then - if true then - if top > 0 then - for i=1,top do - r = r + 1 ; result[r] = encode[stack[i]] + local a = subactions[t] + if a then + a(t) + else + if trace_charstrings then + showvalue("",t) end top = 0 end - r = r + 1 ; result[r] = chars[t] - for j=1,s do - i = i + 1 - r = r + 1 ; result[r] = chars[tab[i]] - end - else - i = i + s - top = 0 - end - i = i + 1 - -- cff 1: closepath - elseif t == 9 then - top = 0 - i = i + 1 - elseif t == 13 then - hsbw() --- if version == "cff" then - if true then - -- we do a moveto over lsb - r = r + 1 ; result[r] = encode[lsb] - r = r + 1 ; result[r] = chars[22] - else - -- lsb is supposed to be zero end i = i + 1 - else - if trace_charstrings then - showstate(reverse[t] or "") - end - if top > 0 then - -- if t == 8 and top > 42 then - if t == 8 and top > 48 then - -- let's assume this only happens for rrcurveto .. the other ones would need some more - -- complex handling (cff2 stuff) - -- - -- dx1 dy1 (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) (dy1+dy2+dy3) rcurveto. - local n = 0 - for i=1,top do - -- if n == 42 then - if n == 48 then --- local zero = encode[0] --- local res3 = result[r-3] --- local res2 = result[r-2] --- local res1 = result[r-1] --- local res0 = result[r] --- result[r-3] = zero --- result[r-2] = zero - r = r + 1 ; result[r] = chars[t] --- r = r + 1 ; result[r] = zero --- r = r + 1 ; result[r] = zero --- r = r + 1 ; result[r] = res3 --- r = r + 1 ; result[r] = res2 --- r = r + 1 ; result[r] = res1 --- r = r + 1 ; result[r] = res0 - n = 1 - else - n = n + 1 + elseif justpass then + -- todo: local a = passactions + if t == op_setvsindex then + p_setvsindex() + i = i + 1 + elseif t == op_blend then + local s = p_blend() or 0 + i = i + s + 1 + -- cff 1: (when cff2 strip them) + elseif t == op_hstem or t == op_vstem or t == op_hstemhm or operation == op_vstemhm then + p_getstem() -- at the start + if version == "cff" then + -- if true then + if top > 0 then + for i=1,top do + r = r + 1 ; result[r] = encode[stack[i]] end - r = r + 1 ; result[r] = encode[stack[i]] + top = 0 end + r = r + 1 ; result[r] = chars[t] else - for i=1,top do - r = r + 1 ; result[r] = encode[stack[i]] + top = 0 + end + i = i + 1 + -- cff 1: (when cff2 strip them) + elseif t == op_hintmask or t == op_cntrmask then + local s = p_getmask() or 0 -- after the stems + -- if version == "cff" then + if true then + if top > 0 then + for i=1,top do + r = r + 1 ; result[r] = encode[stack[i]] + end + top = 0 + end + r = r + 1 ; result[r] = chars[t] + for j=1,s do + i = i + 1 + r = r + 1 ; result[r] = chars[tab[i]] end + else + i = i + s + top = 0 + end + i = i + 1 + elseif t == op_closepath then + if version == "cff" then + r = r + 1 ; result[r] = c_closepath end top = 0 - end - r = r + 1 ; result[r] = chars[t] - i = i + 1 - end - else - local a = actions[t] - if a then - local s = a(t) - if s then - i = i + s + 1 + i = i + 1 + elseif t == op_hsbw then + hsbw() + -- if version == "cff" then + if true then + -- we do a moveto over lsb + r = r + 1 ; result[r] = encode[lsb] + r = r + 1 ; result[r] = chars[22] -- c_hmoveto + else + -- lsb is supposed to be zero + end + i = i + 1 else + if trace_charstrings then + showstate(reverse[t] or "") + end + if top > 0 then + -- if t == op_rrcurveto and top > 42 then + if t == op_rrcurveto and top > 48 then + -- let's assume this only happens for rrcurveto .. the other ones would need some more + -- complex handling (cff2 stuff) + -- + -- dx1 dy1 (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) (dy1+dy2+dy3) rcurveto. + local n = 0 + for i=1,top do + -- if n == 42 then + if n == 48 then + r = r + 1 ; result[r] = chars[t] + n = 1 + else + n = n + 1 + end + r = r + 1 ; result[r] = encode[stack[i]] + end + else + for i=1,top do + r = r + 1 ; result[r] = encode[stack[i]] + end + end + top = 0 + end + r = r + 1 ; result[r] = chars[t] i = i + 1 end else - if trace_charstrings then - showstate(reverse[t] or "") + local a = actions[t] + if a then + local s = a(t) + if s then + i = i + s + 1 + else + i = i + 1 + end + else + if trace_charstrings then + showstate(reverse[t] or "") + end + top = 0 + i = i + 1 end - top = 0 - i = i + 1 end end end + end -- local function calculatebounds(segments,x,y) @@ -2127,25 +2563,81 @@ end -- end -- end - local function setbias(globals,locals,nobias) - if nobias then - return 0, 0 - else - local g = #globals - local l = #locals + -- begin of bonus + + readers.potracetocff = potrace and function(glyph,settings) + local xsize = glyph.xsize or 0 + local ysize = glyph.ysize or 0 + local xoffset = glyph.xoffset or 0 + local yoffset = glyph.yoffset or 0 + local llx = - xoffset + local lly = yoffset - ysize + 1 + local urx = llx + xsize + 1 + local ury = lly + ysize + -- + local b, w, h = fonts.handlers.tfm.readers.showpk(glyph,true) + if not b then return - ((g < 1240 and 107) or (g < 33900 and 1131) or 32768) + 1, - ((l < 1240 and 107) or (l < 33900 and 1131) or 32768) + 1 + end + local t = potrace.convert(b,settings,w,h) + -- + llx = round(10*llx) + lly = round(10*lly) + urx = round(10*urx) + ury = round(10*ury) + xoffset = llx + yoffset = -lly + -- + local width = round(10*glyph.width/65536) + -- + for i=1,#t do + local ti = t[i] + for j=1,#ti do + local tj = ti[j] + for k=1,#tj do + tj[k] = round(10*tj[k]) + end + end + end + return llx, lly, urx, ury, pack_result_untagged(t,width,0,yoffset) + end or function() + return 0, 0, 0, 0, c_endchar + end + + -- end of bonus + + -- (n < 1240 and 107) or (n < 33900 and 1131) or 32768) + 1 + + local function getbias(t) + local n = #t + if n < 1240 then return 108 -- 107 + 1 + elseif n < 33900 then return 1132 -- 1131 + 1 + else return 32769 -- 32768 + 1 end end + -- We have three cases, where (cff == cff1): + -- + -- cff0 : this is cff1 but with the need to process the flex hints + -- cff1 : this is the opentype version that has a bit less than the type one + -- cff2 : this is the latest version with some operators dropped and a few added + -- + -- Because we need to process flexes we now aleays go through shapes for cff0 + -- which is more reliable. + + local force_flatten = false + + directives.register("fonts.cff.flatten", function(v) force_flatten = v end ) + local function processshape(glyphs,tab,index,hack) + local glyphname = charset and charset[index] or nil + if not tab then glyphs[index] = { boundingbox = { 0, 0, 0, 0 }, width = 0, - name = charset and charset[index] or nil, + name = glyphname, } return end @@ -2163,13 +2655,16 @@ end popped = 3 procidx = index + nofflexhints = 0 + ignorehint = false + xmin = 0 xmax = 0 ymin = 0 ymax = 0 checked = false if trace_charstrings then - report("glyph: %i",index) + report("glyph: %i %s",index,glyphname or "") report("data : % t",tab) end @@ -2177,6 +2672,17 @@ end updateregions(vsindex) end + local jp = justpass + + if justpass and version == "cff0" or typeone then + version = "cff" + justpass = false + end + + if force_flatten then + justpass = false + end + process(tab) if hack then return x, y @@ -2196,11 +2702,18 @@ end end local glyph = glyphs[index] -- can be autodefined in otr - if justpass then - r = r + 1 - result[r] = c_endchar - local stream = concat(result) -result = nil + + if jp then + local stream + if justpass then + r = r + 1 + result[r] = c_endchar + stream = concat(result) + result = nil + else + stream = pack_result_tagged(result,width) + justpass = jp + end -- if trace_charstrings then -- report("vdata: %s",stream) -- end @@ -2216,8 +2729,8 @@ result = nil if not glyph.width then glyph.width = width end - if charset and not glyph.name then - glyph.name = charset[index] + if not glyph.name then + glyph.name = glyphname end -- glyph.sidebearing = 0 -- todo elseif keepcurve then @@ -2225,15 +2738,15 @@ result = nil segments = result, boundingbox = boundingbox, width = width, - name = charset and charset[index] or nil, + name = glyphname, -- sidebearing = 0, } -result = nil + result = nil else glyphs[index] = { boundingbox = boundingbox, width = width, - name = charset and charset[index] or nil, + name = glyphname, } end if trace_charstrings then @@ -2264,15 +2777,17 @@ result = nil end stopparsing = function(fontdata,data) - stack = { } - glyphs = false - result = { } - top = 0 - locals = false - globals = false - strings = false - popped = 3 - seacs = { } + stack = { } + glyphs = false + result = { } + top = 0 + locals = false + globals = false + strings = false + popped = 3 + seacs = { } + nofflexhints = 0 + ignorehint = false end local function setwidths(private) @@ -2302,7 +2817,14 @@ result = nil local glyphs = glphs or { } - globalbias, localbias = setbias(globals,locals,nobias) + if nobias then + globalbias = 0 + localbias = 0 + else + globalbias = getbias(globals) + localbias = getbias(locals) + end + nominalwidth, defaultwidth = setwidths(dictionary.private) if charstrings then @@ -2329,8 +2851,8 @@ result = nil -- local base = bglyph.stream local accent = aglyph.stream - local moveto = encode[-x-v.asb+v.adx] .. chars[22] - .. encode[-y +v.ady] .. chars[ 4] + local moveto = encode[-x-v.asb+v.adx] .. chars[22] -- c_hmoveto + .. encode[-y +v.ady] .. chars[04] -- c_vmoveto -- prune an endchar base = sub(base,1,#base-1) -- combine them @@ -2353,6 +2875,7 @@ result = nil strings = data.strings globals = data.routines or { } locals = dictionary.subroutines or { } + typeone = false -- actually unknown but we can use the version cff0 charset = false vsindex = dictionary.vsindex or 0 @@ -2361,7 +2884,14 @@ result = nil justpass = streams == true seacs = { } - globalbias, localbias = setbias(globals,locals,nobias) + if nobias then + globalbias = 0 + localbias = 0 + else + globalbias = getbias(globals) + localbias = getbias(locals) + end + nominalwidth, defaultwidth = setwidths(dictionary.private) processshape(glyphs,tab,index-1) @@ -2371,418 +2901,422 @@ result = nil end -local function readglobals(f,data,version) - local routines = readlengths(f,version == "cff2") - for i=1,#routines do - routines[i] = readbytetable(f,routines[i]) +do + + local function readglobals(f,data,version) + local routines = readlengths(f,version == "cff2") + for i=1,#routines do + routines[i] = readbytetable(f,routines[i]) + end + data.routines = routines end - data.routines = routines -end -local function readencodings(f,data) - data.encodings = { } -end + local function readencodings(f,data) + data.encodings = { } + end -local function readcharsets(f,data,dictionary) - local header = data.header - local strings = data.strings - local nofglyphs = data.nofglyphs - local charsetoffset = dictionary.charset - if charsetoffset and charsetoffset ~= 0 then - setposition(f,header.offset+charsetoffset) - local format = readbyte(f) - local charset = { [0] = ".notdef" } - dictionary.charset = charset - if format == 0 then - for i=1,nofglyphs do - charset[i] = strings[readushort(f)] - end - elseif format == 1 or format == 2 then - local readcount = format == 1 and readbyte or readushort - local i = 1 - while i <= nofglyphs do - local sid = readushort(f) - local n = readcount(f) - for s=sid,sid+n do - charset[i] = strings[s] - i = i + 1 - if i > nofglyphs then - break + local function readcharsets(f,data,dictionary) + local header = data.header + local strings = data.strings + local nofglyphs = data.nofglyphs + local charsetoffset = dictionary.charset + if charsetoffset and charsetoffset ~= 0 then + setposition(f,header.offset+charsetoffset) + local format = readbyte(f) + local charset = { [0] = ".notdef" } + dictionary.charset = charset + if format == 0 then + for i=1,nofglyphs do + charset[i] = strings[readushort(f)] + end + elseif format == 1 or format == 2 then + local readcount = format == 1 and readbyte or readushort + local i = 1 + while i <= nofglyphs do + local sid = readushort(f) + local n = readcount(f) + for s=sid,sid+n do + charset[i] = strings[s] + i = i + 1 + if i > nofglyphs then + break + end end end + else + report("cff parser: unsupported charset format %a",format) end else - report("cff parser: unsupported charset format %a",format) + dictionary.nocharset = true + dictionary.charset = nil end - else - dictionary.nocharset = true - dictionary.charset = nil end -end -local function readprivates(f,data) - local header = data.header - local dictionaries = data.dictionaries - local private = dictionaries[1].private - if private then - setposition(f,header.offset+private.offset) - private.data = readstring(f,private.size) + local function readprivates(f,data) + local header = data.header + local dictionaries = data.dictionaries + local private = dictionaries[1].private + if private then + setposition(f,header.offset+private.offset) + private.data = readstring(f,private.size) + end end -end -local function readlocals(f,data,dictionary,version) - local header = data.header - local private = dictionary.private - if private then - local subroutineoffset = private.data.subroutines - if subroutineoffset ~= 0 then - setposition(f,header.offset+private.offset+subroutineoffset) - local subroutines = readlengths(f,version == "cff2") - for i=1,#subroutines do - subroutines[i] = readbytetable(f,subroutines[i]) - end - dictionary.subroutines = subroutines - private.data.subroutines = nil + local function readlocals(f,data,dictionary,cff2) + local header = data.header + local private = dictionary.private + if private then + local subroutineoffset = private.data.subroutines + if subroutineoffset ~= 0 then + setposition(f,header.offset+private.offset+subroutineoffset) + local subroutines = readlengths(f,version == "cff2") + for i=1,#subroutines do + subroutines[i] = readbytetable(f,subroutines[i]) + end + dictionary.subroutines = subroutines + private.data.subroutines = nil + else + dictionary.subroutines = { } + end else dictionary.subroutines = { } end - else - dictionary.subroutines = { } end -end --- These charstrings are little programs and described in: Technical Note #5177. A truetype --- font has only one dictionary. - -local function readcharstrings(f,data,version) - local header = data.header - local dictionaries = data.dictionaries - local dictionary = dictionaries[1] - local stringtype = dictionary.charstringtype - local offset = dictionary.charstrings - if type(offset) ~= "number" then - -- weird - elseif stringtype == 2 then - setposition(f,header.offset+offset) - -- could be a metatable .. delayed loading - local charstrings = readlengths(f,version=="cff2") - local nofglyphs = #charstrings - for i=1,nofglyphs do - charstrings[i] = readstring(f,charstrings[i]) - end - data.nofglyphs = nofglyphs - dictionary.charstrings = charstrings - else - report("unsupported charstr type %i",stringtype) - data.nofglyphs = 0 - dictionary.charstrings = { } + -- These charstrings are little programs and described in: Technical Note #5177. A truetype + -- font has only one dictionary. + + local function readcharstrings(f,data,version) + local header = data.header + local dictionaries = data.dictionaries + local dictionary = dictionaries[1] + local stringtype = dictionary.charstringtype + local offset = dictionary.charstrings + if type(offset) ~= "number" then + -- weird + elseif stringtype == 2 then + setposition(f,header.offset+offset) + -- could be a metatable .. delayed loading + local charstrings = readlengths(f,version=="cff2") + local nofglyphs = #charstrings + for i=1,nofglyphs do + charstrings[i] = readstring(f,charstrings[i]) + end + data.nofglyphs = nofglyphs + dictionary.charstrings = charstrings + else + report("unsupported charstr type %i",stringtype) + data.nofglyphs = 0 + dictionary.charstrings = { } + end end -end --- cid (maybe do this stepwise so less mem) -- share with above + -- cid (maybe do this stepwise so less mem) -- share with above -local function readcidprivates(f,data) - local header = data.header - local dictionaries = data.dictionaries[1].cid.dictionaries - for i=1,#dictionaries do - local dictionary = dictionaries[i] - local private = dictionary.private - if private then - setposition(f,header.offset+private.offset) - private.data = readstring(f,private.size) + local function readcidprivates(f,data) + local header = data.header + local dictionaries = data.dictionaries[1].cid.dictionaries + for i=1,#dictionaries do + local dictionary = dictionaries[i] + local private = dictionary.private + if private then + setposition(f,header.offset+private.offset) + private.data = readstring(f,private.size) + end end + parseprivates(data,dictionaries) end - parseprivates(data,dictionaries) -end -readers.parsecharstrings = parsecharstrings -- used in font-onr.lua (type 1) + readers.parsecharstrings = parsecharstrings -- used in font-onr.lua (type 1) -local function readnoselect(f,fontdata,data,glyphs,doshapes,version,streams) - local dictionaries = data.dictionaries - local dictionary = dictionaries[1] - local cid = not dictionary.private and dictionary.cid - readglobals(f,data,version) - readcharstrings(f,data,version) - if version == "cff2" then - dictionary.charset = nil - else - readencodings(f,data) - readcharsets(f,data,dictionary) - end - if cid then - local fdarray = cid.fdarray - if fdarray then - setposition(f,data.header.offset + fdarray) - local dictionaries = readlengths(f,version=="cff2") - local nofdictionaries = #dictionaries - if nofdictionaries > 0 then - for i=1,nofdictionaries do - dictionaries[i] = readstring(f,dictionaries[i]) - end - parsedictionaries(data,dictionaries) - dictionary.private = dictionaries[1].private - if nofdictionaries > 1 then - report("ignoring dictionaries > 1 in cid font") + local function readnoselect(f,fontdata,data,glyphs,doshapes,version,streams) + local dictionaries = data.dictionaries + local dictionary = dictionaries[1] + local cid = not dictionary.private and dictionary.cid + readglobals(f,data,version) + readcharstrings(f,data,version) + if version == "cff2" then + dictionary.charset = nil + else + readencodings(f,data) + readcharsets(f,data,dictionary) + end + if cid then + local fdarray = cid.fdarray + if fdarray then + setposition(f,data.header.offset + fdarray) + local dictionaries = readlengths(f,version=="cff2") + local nofdictionaries = #dictionaries + if nofdictionaries > 0 then + for i=1,nofdictionaries do + dictionaries[i] = readstring(f,dictionaries[i]) + end + parsedictionaries(data,dictionaries) + dictionary.private = dictionaries[1].private + if nofdictionaries > 1 then + report("ignoring dictionaries > 1 in cid font") + end end end end - end - readprivates(f,data) - parseprivates(data,data.dictionaries) - readlocals(f,data,dictionary,version) - startparsing(fontdata,data,streams) - parsecharstrings(fontdata,data,glyphs,doshapes,version,streams,false) - stopparsing(fontdata,data) -end - -local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) - local header = data.header - local dictionaries = data.dictionaries - local dictionary = dictionaries[1] - local cid = dictionary.cid - local cidselect = cid and cid.fdselect - readglobals(f,data,version) - readcharstrings(f,data,version) - if version ~= "cff2" then - readencodings(f,data) - end - local charstrings = dictionary.charstrings - local fdindex = { } - local nofglyphs = data.nofglyphs - local maxindex = -1 - setposition(f,header.offset+cidselect) - local format = readbyte(f) - if format == 1 then - for i=0,nofglyphs do -- notdef included (needs checking) - local index = readbyte(f) - fdindex[i] = index - if index > maxindex then - maxindex = index - end - end - elseif format == 3 then - local nofranges = readushort(f) - local first = readushort(f) - local index = readbyte(f) - while true do - local last = readushort(f) - if index > maxindex then - maxindex = index - end - for i=first,last do + readprivates(f,data) + parseprivates(data,data.dictionaries) + readlocals(f,data,dictionary,version) + startparsing(fontdata,data,streams) + parsecharstrings(fontdata,data,glyphs,doshapes,version,streams,false) + stopparsing(fontdata,data) + end + + local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) + local header = data.header + local dictionaries = data.dictionaries + local dictionary = dictionaries[1] + local cid = dictionary.cid + local cidselect = cid and cid.fdselect + readglobals(f,data,version) + readcharstrings(f,data,version) + if version ~= "cff2" then + readencodings(f,data) + end + local charstrings = dictionary.charstrings + local fdindex = { } + local nofglyphs = data.nofglyphs + local maxindex = -1 + setposition(f,header.offset+cidselect) + local format = readbyte(f) + if format == 1 then + for i=0,nofglyphs do -- notdef included (needs checking) + local index = readbyte(f) fdindex[i] = index + if index > maxindex then + maxindex = index + end end - if last >= nofglyphs then - break - else - first = last + 1 - index = readbyte(f) - end - end - else - report("unsupported fd index format %i",format) - end - -- hm, always - if maxindex >= 0 then - local cidarray = cid.fdarray - if cidarray then - setposition(f,header.offset+cidarray) - local dictionaries = readlengths(f,version == "cff2") - if #dictionaries > 0 then - for i=1,#dictionaries do - dictionaries[i] = readstring(f,dictionaries[i]) + elseif format == 3 then + local nofranges = readushort(f) + local first = readushort(f) + local index = readbyte(f) + while true do + local last = readushort(f) + if index > maxindex then + maxindex = index end - parsedictionaries(data,dictionaries) - cid.dictionaries = dictionaries - readcidprivates(f,data) - for i=1,#dictionaries do - readlocals(f,data,dictionaries[i],version) + for i=first,last do + fdindex[i] = index end - startparsing(fontdata,data,streams) - for i=1,#charstrings do - local dictionary = dictionaries[fdindex[i]+1] - if dictionary then - parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams) - else - -- report("no dictionary for %a : %a => %a",version,i,fdindex[i]+1) + if last >= nofglyphs then + break + else + first = last + 1 + index = readbyte(f) + end + end + else + report("unsupported fd index format %i",format) + end + -- hm, always + if maxindex >= 0 then + local cidarray = cid.fdarray + if cidarray then + setposition(f,header.offset+cidarray) + local dictionaries = readlengths(f,version == "cff2") + if #dictionaries > 0 then + for i=1,#dictionaries do + dictionaries[i] = readstring(f,dictionaries[i]) end - -- charstrings[i] = false + parsedictionaries(data,dictionaries) + cid.dictionaries = dictionaries + readcidprivates(f,data) + for i=1,#dictionaries do + readlocals(f,data,dictionaries[i],version) + end + startparsing(fontdata,data,streams) + for i=1,#charstrings do + local dictionary = dictionaries[fdindex[i]+1] + if dictionary then + parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams) + else + -- report("no dictionary for %a : %a => %a",version,i,fdindex[i]+1) + end + -- charstrings[i] = false + end + stopparsing(fontdata,data) + else + report("no cid dictionaries") end - stopparsing(fontdata,data) else - report("no cid dictionaries") + report("no cid array") end - else - report("no cid array") end end -end -local gotodatatable = readers.helpers.gotodatatable + local gotodatatable = readers.helpers.gotodatatable -local function cleanup(data,dictionaries) - -- for i=1,#dictionaries do - -- local d = dictionaries[i] - -- d.subroutines = nil - -- end - -- data.strings = nil - -- if data then - -- data.charstrings = nil - -- data.routines = nil - -- end -end + local function cleanup(data,dictionaries) + -- for i=1,#dictionaries do + -- local d = dictionaries[i] + -- d.subroutines = nil + -- end + -- data.strings = nil + -- if data then + -- data.charstrings = nil + -- data.routines = nil + -- end + end -function readers.cff(f,fontdata,specification) - local tableoffset = gotodatatable(f,fontdata,"cff",specification.details or specification.glyphs) - if tableoffset then - local header = readheader(f) - if header.major ~= 1 then - report("only version %s is supported for table %a",1,"cff") - return - end - local glyphs = fontdata.glyphs - local names = readfontnames(f) - local dictionaries = readtopdictionaries(f) - local strings = readstrings(f) - local data = { - header = header, - names = names, - dictionaries = dictionaries, - strings = strings, - nofglyphs = fontdata.nofglyphs, - } - -- - parsedictionaries(data,dictionaries,"cff") - -- - local dic = dictionaries[1] - local cid = dic.cid - -- - local cffinfo = { - familyname = dic.familyname, - fullname = dic.fullname, - boundingbox = dic.boundingbox, - weight = dic.weight, - italicangle = dic.italicangle, - underlineposition = dic.underlineposition, - underlinethickness = dic.underlinethickness, - defaultwidth = dic.defaultwidthx, - nominalwidth = dic.nominalwidthx, - monospaced = dic.monospaced, - } - fontdata.cidinfo = cid and { - registry = cid.registry, - ordering = cid.ordering, - supplement = cid.supplement, - } - fontdata.cffinfo = cffinfo - -- - local all = specification.shapes or specification.streams or false - if specification.glyphs or all then - if cid and cid.fdselect then - readfdselect(f,fontdata,data,glyphs,all,"cff",specification.streams) - else - readnoselect(f,fontdata,data,glyphs,all,"cff",specification.streams) + function readers.cff(f,fontdata,specification) + local tableoffset = gotodatatable(f,fontdata,"cff",specification.details or specification.glyphs) + if tableoffset then + local header = readheader(f) + if header.major ~= 1 then + report("only version %s is supported for table %a",1,"cff") + return + end + local glyphs = fontdata.glyphs + local names = readfontnames(f) + local dictionaries = readtopdictionaries(f) + local strings = readstrings(f) + local data = { + header = header, + names = names, + dictionaries = dictionaries, + strings = strings, + nofglyphs = fontdata.nofglyphs, + } + -- + parsedictionaries(data,dictionaries,"cff") + -- + local dic = dictionaries[1] + local cid = dic.cid + -- + local cffinfo = { + familyname = dic.familyname, + fullname = dic.fullname, + boundingbox = dic.boundingbox, + weight = dic.weight, + italicangle = dic.italicangle, + underlineposition = dic.underlineposition, + underlinethickness = dic.underlinethickness, + defaultwidth = dic.defaultwidthx, + nominalwidth = dic.nominalwidthx, + monospaced = dic.monospaced, + } + fontdata.cidinfo = cid and { + registry = cid.registry, + ordering = cid.ordering, + supplement = cid.supplement, + } + fontdata.cffinfo = cffinfo + -- + local all = specification.shapes or specification.streams or false + if specification.glyphs or all then + if cid and cid.fdselect then + readfdselect(f,fontdata,data,glyphs,all,"cff",specification.streams) + else + readnoselect(f,fontdata,data,glyphs,all,"cff",specification.streams) + end + end + local private = dic.private + if private then + local data = private.data + if type(data) == "table" then + cffinfo.defaultwidth = data.defaultwidthx or cffinfo.defaultwidth + cffinfo.nominalwidth = data.nominalwidthx or cffinfo.nominalwidth + cffinfo.bluevalues = data.bluevalues + cffinfo.otherblues = data.otherblues + cffinfo.familyblues = data.familyblues + cffinfo.familyotherblues = data.familyotherblues + cffinfo.bluescale = data.bluescale + cffinfo.blueshift = data.blueshift + cffinfo.bluefuzz = data.bluefuzz + cffinfo.stdhw = data.stdhw + cffinfo.stdvw = data.stdvw + cffinfo.stemsnaph = data.stemsnaph + cffinfo.stemsnapv = data.stemsnapv + end end + cleanup(data,dictionaries) end - local private = dic.private - if private then - local data = private.data - if type(data) == "table" then - cffinfo.defaultwidth = data.defaultwidthx or cffinfo.defaultwidth - cffinfo.nominalwidth = data.nominalwidthx or cffinfo.nominalwidth - cffinfo.bluevalues = data.bluevalues - cffinfo.otherblues = data.otherblues - cffinfo.familyblues = data.familyblues - cffinfo.familyotherblues = data.familyotherblues - cffinfo.bluescale = data.bluescale - cffinfo.blueshift = data.blueshift - cffinfo.bluefuzz = data.bluefuzz - cffinfo.stdhw = data.stdhw - cffinfo.stdvw = data.stdvw - cffinfo.stemsnaph = data.stemsnaph - cffinfo.stemsnapv = data.stemsnapv - end - end - cleanup(data,dictionaries) end -end -function readers.cff2(f,fontdata,specification) - local tableoffset = gotodatatable(f,fontdata,"cff2",specification.glyphs) - if tableoffset then - local header = readheader(f) - if header.major ~= 2 then - report("only version %s is supported for table %a",2,"cff2") - return - end - local glyphs = fontdata.glyphs - local dictionaries = { readstring(f,header.dsize) } - local data = { - header = header, - dictionaries = dictionaries, - nofglyphs = fontdata.nofglyphs, - } - -- - parsedictionaries(data,dictionaries,"cff2") - -- - local offset = dictionaries[1].vstore - if offset > 0 then - local storeoffset = dictionaries[1].vstore + data.header.offset + 2 -- cff has a preceding size field - local regions, deltas = readers.helpers.readvariationdata(f,storeoffset,factors) + function readers.cff2(f,fontdata,specification) + local tableoffset = gotodatatable(f,fontdata,"cff2",specification.glyphs) + if tableoffset then + local header = readheader(f) + if header.major ~= 2 then + report("only version %s is supported for table %a",2,"cff2") + return + end + local glyphs = fontdata.glyphs + local dictionaries = { readstring(f,header.dsize) } + local data = { + header = header, + dictionaries = dictionaries, + nofglyphs = fontdata.nofglyphs, + } -- - data.regions = regions - data.deltas = deltas - else - data.regions = { } - data.deltas = { } - end - data.factors = specification.factors - -- - local cid = data.dictionaries[1].cid - local all = specification.shapes or specification.streams or false - if cid and cid.fdselect then - readfdselect(f,fontdata,data,glyphs,all,"cff2",specification.streams) - else - readnoselect(f,fontdata,data,glyphs,all,"cff2",specification.streams) - end - cleanup(data,dictionaries) - end -end + parsedictionaries(data,dictionaries,"cff2") + -- + local offset = dictionaries[1].vstore + if offset > 0 then + local storeoffset = dictionaries[1].vstore + data.header.offset + 2 -- cff has a preceding size field + local regions, deltas = readers.helpers.readvariationdata(f,storeoffset,factors) + -- + data.regions = regions + data.deltas = deltas + else + data.regions = { } + data.deltas = { } + end + data.factors = specification.factors + -- + local cid = data.dictionaries[1].cid + local all = specification.shapes or specification.streams or false + if cid and cid.fdselect then + readfdselect(f,fontdata,data,glyphs,all,"cff2",specification.streams) + else + readnoselect(f,fontdata,data,glyphs,all,"cff2",specification.streams) + end + cleanup(data,dictionaries) + end + end + + -- temporary helper needed for checking backend patches + + -- function readers.cffcheck(filename) + -- local f = io.open(filename,"rb") + -- if f then + -- local fontdata = { + -- glyphs = { }, + -- } + -- local header = readheader(f) + -- if header.major ~= 1 then + -- report("only version %s is supported for table %a",1,"cff") + -- return + -- end + -- local names = readfontnames(f) + -- local dictionaries = readtopdictionaries(f) + -- local strings = readstrings(f) + -- local glyphs = { } + -- local data = { + -- header = header, + -- names = names, + -- dictionaries = dictionaries, + -- strings = strings, + -- glyphs = glyphs, + -- nofglyphs = 0, + -- } + -- -- + -- parsedictionaries(data,dictionaries,"cff") + -- -- + -- local cid = data.dictionaries[1].cid + -- if cid and cid.fdselect then + -- readfdselect(f,fontdata,data,glyphs,false) + -- else + -- readnoselect(f,fontdata,data,glyphs,false) + -- end + -- return data + -- end + -- end --- temporary helper needed for checking backend patches - --- function readers.cffcheck(filename) --- local f = io.open(filename,"rb") --- if f then --- local fontdata = { --- glyphs = { }, --- } --- local header = readheader(f) --- if header.major ~= 1 then --- report("only version %s is supported for table %a",1,"cff") --- return --- end --- local names = readfontnames(f) --- local dictionaries = readtopdictionaries(f) --- local strings = readstrings(f) --- local glyphs = { } --- local data = { --- header = header, --- names = names, --- dictionaries = dictionaries, --- strings = strings, --- glyphs = glyphs, --- nofglyphs = 0, --- } --- -- --- parsedictionaries(data,dictionaries,"cff") --- -- --- local cid = data.dictionaries[1].cid --- if cid and cid.fdselect then --- readfdselect(f,fontdata,data,glyphs,false) --- else --- readnoselect(f,fontdata,data,glyphs,false) --- end --- return data --- end --- end +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt index e70e9083d1d..fc2358fc050 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt @@ -19,7 +19,6 @@ local floor = math.floor local context = context local formatters = string.formatters -local bpfactor = number.dimenfactors.bp local fastcopy = table.fastcopy local sortedkeys = table.sortedkeys local sortedhash = table.sortedhash @@ -66,7 +65,7 @@ local disableaction = tasks.disableaction local implement = interfaces.implement -local glyph_code = nodes.nodecodes.glyph +local glyph_code = nodes.nodecodes.glyph local hpack_node = nodes.hpack @@ -455,6 +454,81 @@ local visualspace_specification = { registerotffeature(visualspace_specification) registerafmfeature(visualspace_specification) +-- local function adddots(tfmdata,unicode) +-- if not tfmdata.characters[unicode] then +-- local period = tfmdata.characters[0x2E] +-- local original = period.height +-- local height = tfmdata.parameters.xheight/2 +-- tfmdata.characters[unicode] = { +-- width = period.width, +-- height = height + original, +-- unicode = unicode, +-- commands = { { "offset", 0, height, 0x2E } }, +-- } +-- end +-- end +-- +-- local function addpunctuationdot(tfmdata) +-- adddots(tfmdata,0x2027) -- hyphenation period : in lucida dejavusans xcharter +-- adddots(tfmdata,0x2E31) -- word separator middle dot +-- end +-- +-- local punctuationdot_specification = { +-- name = "extradots", +-- description = "extra dots", +-- default = true, +-- manipulators = { +-- base = addpunctuationdot, +-- node = addpunctuationdot, +-- } +-- } +-- +-- registerotffeature(punctuationdot_specification) +-- registerafmfeature(punctuationdot_specification) + +-- local function fixdot(tfmdata) +-- if tfmdata.characters[0xB7] then +-- local period = tfmdata.characters[0x2E] +-- local self = tfmdata.characters[0xB7] +-- local original = period.height +-- local height = tfmdata.parameters.xheight/2 +-- self.advance = self.width +-- self.width = period.width +-- self.height = height + original +-- self.commands = { { "offset", 0, height, 0x2E } } +-- end +-- end + +local function fixdot(tfmdata) + local self = tfmdata.characters[0xB7] + local period = tfmdata.characters[0x2E] + local hyphen = tfmdata.characters[0x2D] + if self and period and hyphen then + local swidth = self.width + local pwidth = period.width + if swidth > pwidth then -- maybe also ht here + local sheight = self.height + local hheight = hyphen.height + self.advance = swidth + self.width = pwidth + self.commands = { { "offset", (pwidth-swidth)/2, (hheight-sheight)/2, 0xB7 } } + end + end +end + +local dot_specification = { + name = "fixdot", + description = "fix dot", + default = true, + manipulators = { + base = fixdot, + node = fixdot, + } +} + +registerotffeature(dot_specification) +registerafmfeature(dot_specification) + do @@ -505,7 +579,7 @@ do goto done end end - local fn = lower(metadata.fullname) + local fn = lower(metadata.fullname or fonts.helpers.name(f)) for i=1,3 do local o = order[i] if find(fn,o) then diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt index 2a999ddebc8..325add3e35b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt @@ -45,8 +45,12 @@ fonts.collections = collections local definitions = collections.definitions or { } collections.definitions = definitions +-- why public ? + local vectors = collections.vectors or { } collections.vectors = vectors +local rscales = collections.rscales or { } +collections.rscales = rscales local helpers = fonts.helpers local charcommand = helpers.commands.char @@ -81,6 +85,8 @@ local validvectors = table.setmetatableindex(function(t,k) return v end) +table.setmetatableindex(rscales,"table") + local function checkenabled() -- a bit ugly but nicer than a fuzzy state while defining math if next(vectors) then @@ -220,7 +226,9 @@ function collections.clonevector(name) end local definitions = definitions[name] local vector = { } + local scales = { } vectors[current] = vector + rscales[current] = scales for i=1,#definitions do local definition = definitions[i] local name = definition.font @@ -236,12 +244,15 @@ function collections.clonevector(name) local oldchars = fontdata[current].characters local newchars = fontdata[cloneid].characters local factor = definition.factor - local rscale = definition.rscale + local rscale = false if factor then vector.factor = factor end - if texconditionals["c_font_compact"] and rscale then - vector.rscale = rscale + if texconditionals["c_font_compact"] then + local rs = definition.rscale + if rs and rs ~= 1 then + rscale = rs + end end if trace_collecting then if target then @@ -265,6 +276,9 @@ function collections.clonevector(name) -- not in font elseif force or (not vector[unic] and not oldchars[unic]) then vector[unic] = { cloneid, target } + if rscale then + scales[unic] = rscale + end end target = target + 1 end @@ -279,6 +293,9 @@ function collections.clonevector(name) -- not in font elseif force or (not vector[unic] and not oldchars[unic]) then vector[unic] = cloneid + if rscale then + scales[unic] = rscale + end end end end @@ -290,6 +307,9 @@ function collections.clonevector(name) -- ignore elseif force or (not vector[unic] and not oldchars[unic]) then vector[unic] = { cloneid, target } + if rscale then + scales[unic] = rscale + end end target = target + 1 end @@ -300,6 +320,9 @@ function collections.clonevector(name) -- ignore elseif force or (not vector[unic] and not oldchars[unic]) then vector[unic] = { cloneid, remap[unicode] } + if rscale then + scales[unic] = rscale + end end end else @@ -309,6 +332,9 @@ function collections.clonevector(name) -- ignore elseif force or (not vector[unic] and not oldchars[unic]) then vector[unic] = cloneid + if rscale then + scales[unic] = rscale + end end end end @@ -338,7 +364,7 @@ function collections.prepare(name) -- we can do this in lua now .. todo end local properties = propdata[current] local mathsize = properties.mathsize - if mathsize == 1 or mathsize == 2 or mathsize == 3 then + if mathsize == 1 or mathsize == 2 or mathsize == 3 or properties.math_is_scaled or properties.mathisscaled then return end local d = definitions[name] @@ -351,8 +377,8 @@ function collections.prepare(name) -- we can do this in lua now .. todo context.pushcatcodes("prt") -- context.unprotect() context.font_fallbacks_start_cloning() for i=1,#d do - local f = d[i] - local name = f.font + local f = d[i] + local name = f.font local scale = f.rscale or 1 if texconditionals["c_font_compact"] then scale = 1 @@ -424,14 +450,15 @@ end -- todo: also general one for missing local function apply(n,char,font,vector,vect) - local kind = type(vect) + local kind = type(vect) + local rscale = rscales[font][char] or 1 local newfont, newchar if kind == "table" then newfont = vect[1] newchar = vect[2] if trace_collecting then - report_fonts("remapping character %C in font %a to character %C in font %a%s", - char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or "" + report_fonts("remapping character %C in font %a to character %C in font %a%s, rscale %s", + char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or "",rscale ) end elseif kind == "function" then @@ -443,16 +470,16 @@ local function apply(n,char,font,vector,vect) newchar = char end if trace_collecting then - report_fonts("remapping character %C in font %a to character %C in font %a%s", - char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or "" + report_fonts("remapping character %C in font %a to character %C in font %a%s, rscale %f", + char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or "",rscale ) end vector[char] = { newfont, newchar } else local fakemono = vector.factor if trace_collecting then - report_fonts("remapping font %a to %a for character %C%s", - font,vect,char,not chardata[vect][char] and " (missing)" or "" + report_fonts("remapping font %a to %a for character %C%s, rscale %s", + font,vect,char,not chardata[vect][char] and " (missing)" or "",rscale ) end newfont = vect @@ -462,10 +489,9 @@ local function apply(n,char,font,vector,vect) newchar = char end end - local rscale = vector.rscale if rscale and rscale ~= 1 then local s, x, y = getscales(n) - setscales(n,s*rscale,x*rscale,y*rscale) + setscales(n,s*rscale,x,y) end setfont(n,newfont,newchar) setprop(n, "original", { font = font, char = char }) @@ -477,6 +503,7 @@ function collections.process(head) -- this way we keep feature processing if vector then local vect = vector[char] if vect then +-- print(char,font,vect) apply(n,char,font,vector,vect) end end diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx index 03515201fe4..db4c88ebceb 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx @@ -49,7 +49,7 @@ \def\font_fallbacks_prepare_indeed#fallbacks% {\begingroup - \settrue\c_font_fallbacks_in_progress + \c_font_fallbacks_in_progress\conditionaltrue \lastrawfontcall % sets current font id \font_fallbacks_prepare#fallbacks% \endgroup} @@ -79,13 +79,13 @@ \def\font_fallbacks_clone_unique#specification#scale% kind of dododefinefont {\clf_fontcollectionreport{defining #specification (relative scale: #scale)}% brrr - \setfalse\c_font_auto_size + \c_font_auto_size\conditionalfalse \let\lastfontidentifier\s!dummy \def\v_font_size_relative{#scale}% \let\v_font_size_absolute\fontbody \font_helpers_low_level_define{#specification}\v_font_identifier_basic \csname\v_font_identifier_basic\endcsname - \setfalse\c_font_auto_size} % no \setfontcharacteristics and \the\everyfontswitch needed + \c_font_auto_size\conditionalfalse} % no \setfontcharacteristics and \the\everyfontswitch needed \def\font_fallbacks_clone_inherited#font% also a second argument {\font_fallbacks_clone_unique{#font \m_font_fallbacks_spec}} @@ -96,9 +96,11 @@ % math (experiment, todo clf_) % \def\font_fallbacks_register_math#1#2#3#4% -% {\doifelsenothing{#3}% -% {\definedfont[#2 at #4\scaledpoint]}% -% {\definedfont[#2*#3\space at #4\scaledpoint]}% +% {\ifempty{#3}% +% \definedfont[#2 at #4\scaledpoint]% +% \else +% \definedfont[#2*#3\space at #4\scaledpoint]% +% \fi % \clf_registerfontfallbackid#1\space\fontid\font\space{#2}} % % % \def\font_fallbacks_register_math#1#2#3#4% diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt index 599641e2c01..46f7f5d2af8 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt @@ -268,7 +268,16 @@ local function scaleparts(parts,delta) return t end --- getcharactertagvalues +local abovebaseline_tag = tex.charactertagcodes.abovebaseline +local belowbaseline_tag = tex.charactertagcodes.belowbaseline + +local textcontrolcodes = tex.textcontrolcodes +local collapse_hyphens = textcontrolcodes.collapsehyphens +local base_ligaturing = textcontrolcodes.baseligaturing +local base_kerning = textcontrolcodes.basekerning +local none_protected = textcontrolcodes.noneprotected +local has_italics = textcontrolcodes.hasitalics +local auto_italics = textcontrolcodes.autoitalics function constructors.scale(tfmdata,specification) local target = { } -- the new table @@ -352,6 +361,8 @@ function constructors.scale(tfmdata,specification) local scaledpoints, delta = constructors.calculatescale(tfmdata,scaledpoints,nil,specification) -- no shortcut, dan be redefined -- print("B",mathsize,askedscaledpoints,scaledpoints,delta) -- +-- delta = round(delta) -- TODO + -- local hdelta = delta local vdelta = delta -- @@ -395,41 +406,45 @@ function constructors.scale(tfmdata,specification) target.shrink = expansion.shrink target.step = expansion.step end - -- slanting - local slantfactor = parameters.slantfactor or 0 - if slantfactor ~= 0 then - target.slant = slantfactor * 1000 - else - target.slant = 0 - end - -- widening - local extendfactor = parameters.extendfactor or 0 - if extendfactor ~= 0 and extendfactor ~= 1 then - hdelta = hdelta * extendfactor - target.extend = extendfactor * 1000 --- target.extend = round(target.extend) - else - target.extend = 1000 -- extent ? - end - -- squeezing - local squeezefactor = parameters.squeezefactor or 0 - if squeezefactor ~= 0 and squeezefactor ~= 1 then - vdelta = vdelta * squeezefactor - target.squeeze = squeezefactor * 1000 --- target.squeeze = round(target.squeeze) - else - target.squeeze = 1000 -- extent ? - end - -- effects - local mode = parameters.mode or 0 - if mode ~= 0 then - target.mode = mode - end - local width = parameters.width or 0 - if width ~= 0 then - target.width = width * delta * 1000 / 655360 + -- The official entries are in the effects subtable. Later we will set the + -- values in the parameters table because the backend needs these. + local effect = properties.effect + if effect then -- units ? + local slant = effect.slant or 0 + if slant ~= 0 then + target.slant = slant * 1000 + -- italic : new wd = oldwd + slant * ht + else + target.slant = 0 + end + local extend = effect.extend or 1 + if extend ~= 0 and extend ~= 1 then + hdelta = hdelta * extend + target.extend = extend * 1000 + -- target.extend = round(target.extend) + else + target.extend = 1000 + end + local squeeze = effect.squeeze or 1 + if squeeze ~= 0 and squeeze ~= 1 then + vdelta = vdelta * squeeze + target.squeeze = squeeze * 1000 + -- target.squeeze = round(target.squeeze) + else + target.squeeze = 1000 + end + local mode = effect.mode or 0 + if mode ~= 0 then + target.mode = mode + end + -- target height ! + local width = effect.width or 0 + if width ~= 0 then + target.width = width * 1000 + end end -- + targetproperties.effect = effect targetparameters.factor = delta targetparameters.hfactor = hdelta targetparameters.vfactor = vdelta @@ -439,15 +454,21 @@ function constructors.scale(tfmdata,specification) targetparameters.mode = mode targetparameters.width = width -- + -- local hasquality = parameters.expansion or parameters.protrusion local hasitalics = properties.hasitalics - local autoitalicamount = properties.autoitalicamount + local useditalicangle = properties.useditalicangle or properties.italicangle or 0 + local usedslant = properties.usedslant or properties.usedslant or 0 -- local stackmath = not properties.nostackmath local haskerns = properties.haskerns or properties.mode == "base" -- we can have afm in node mode local hasligatures = properties.hasligatures or properties.mode == "base" -- we can have afm in node mode - local realdimensions = properties.realdimensions local writingmode = properties.writingmode or "horizontal" -- + targetparameters.useditalicangle = useditalicangle + targetproperties.useditalicangle = useditalicangle + targetparameters.usedslant = usedslant + targetproperties.usedslant = usedslant + -- if changed and not next(changed) then changed = false end @@ -464,6 +485,9 @@ function constructors.scale(tfmdata,specification) local targetquad = (parameters.quad or parameters[6] or 0) * hdelta local targetextraspace = (parameters.extraspace or parameters[7] or 0) * hdelta -- + targetparameters.expansion = parameters.expansion + targetparameters.protrusion = parameters.protrusion + -- targetparameters.slant = targetslant -- slantperpoint targetparameters.space = targetspace targetparameters.spacestretch = targetspacestretch @@ -481,26 +505,39 @@ function constructors.scale(tfmdata,specification) targetparameters.vshift = delta * vshift end -- - local ascender = parameters.ascender - if ascender then - targetparameters.ascender = delta * ascender - end - local descender = parameters.descender - if descender then - targetparameters.descender = delta * descender - end + local ascender = parameters.ascender if ascender then targetparameters.ascender = vdelta * ascender end + local descender = parameters.descender if descender then targetparameters.descender = vdelta * descender end + local capheight = parameters.capheight if capheight then targetparameters.capheight = vdelta * capheight end + local ascent = parameters.ascent if ascent then targetparameters.ascent = vdelta * ascent end + local descent = parameters.descent if descent then targetparameters.descent = vdelta * descent end -- constructors.enhanceparameters(targetparameters) -- official copies for us, now virtual -- - local scaledwidth = defaultwidth * hdelta - local scaledheight = defaultheight * vdelta - local scaleddepth = defaultdepth * vdelta + local scaledwidth = defaultwidth * hdelta + local scaledheight = defaultheight * vdelta + local scaleddepth = defaultdepth * vdelta -- local textcontrol = properties.textcontrol or 0 if targetproperties.mode == "base" then - textcontrol = textcontrol | 0x02 | 0x04 -- todo symbolic + textcontrol = textcontrol | base_ligaturing | base_kerning + -- + -- the only drawback is when we add some butthat doesn't happen in base mode so + -- we need to test this as there can be a little gain + -- + -- if haskerns then + -- textcontrol = textcontrol | base_kerning + -- end + -- if hasligatures then + -- textcontrol = textcontrol | base_ligaturing + -- end elseif targetproperties.mode == "none" then - textcontrol = textcontrol | 0x08 -- todo symbolic + textcontrol = textcontrol | none_protected -- or just assign + end + if hasitalics then + textcontrol = textcontrol | has_italics + end + if useditalicangle ~= 0 or usedslant ~= 0 then + textcontrol = textcontrol | auto_italics end targetproperties.textcontrol = textcontrol target.textcontrol = textcontrol @@ -519,9 +556,9 @@ function constructors.scale(tfmdata,specification) targetproperties.compactmath = compactmath target.compactmath = compactmath - local textscale = parameters.textscale -- or 1000 - local scriptscale = parameters.scriptscale -- or 700 - local scriptscriptscale = parameters.scriptscriptscale -- or 500 + local textscale = parameters.textscale -- 1000 + local scriptscale = parameters.scriptscale -- 700 + local scriptscriptscale = parameters.scriptscriptscale -- 500 parameters.textscale = textscale parameters.scriptscale = scriptscale @@ -545,32 +582,6 @@ function constructors.scale(tfmdata,specification) target.mathparameters = nil -- nop end -- - -- During the transition to opentype the engine had troubles with italics so we had some - -- additional code for fixing that. In node mode (text) we don't care much if italics gets - -- passed because the engine does nothing with them then. - -- - if hasmath then - local mathitalics = properties.mathitalics - if mathitalics == false then - if trace_defining then - report_defining("%s italics %s for font %a, fullname %a, filename %a","math",hasitalics and "ignored" or "disabled",name,fullname,filename) - end - hasitalics = false - autoitalicamount = false - end - else - local textitalics = properties.textitalics - if textitalics == false then - if trace_defining then - report_defining("%s italics %s for font %a, fullname %a, filename %a","text",hasitalics and "ignored" or "disabled",name,fullname,filename) - end - hasitalics = false - autoitalicamount = false - end - end - -- - -- end of context specific trickery - -- if trace_defining then report_defining("defining tfm, name %a, fullname %a, filename %a, %spsname %a, hscale %a, vscale %a, math %a, italics %a", name,fullname,filename,psfixed and "(fixed) " or "",psname,hdelta,vdelta, @@ -617,32 +628,11 @@ function constructors.scale(tfmdata,specification) local height = description.height local depth = description.depth local isunicode = description.unicode - if realdimensions then - -- this is mostly for checking issues - if not height or height == 0 then - local bb = description.boundingbox - local ht = bb[4] - if ht ~= 0 then - height = ht - end - if not depth or depth == 0 then - local dp = -bb[2] - if dp ~= 0 then - depth = dp - end - end - elseif not depth or depth == 0 then - local dp = -description.boundingbox[2] - if dp ~= 0 then - depth = dp - end - end - end if width then width = hdelta*width else width = scaledwidth end if height then height = vdelta*height else height = scaledheight end -- if depth then depth = vdelta*depth else depth = scaleddepth end if depth and depth ~= 0 then - depth = delta*depth + depth = vdelta*depth if isunicode then chr = { index = index, @@ -675,6 +665,14 @@ function constructors.scale(tfmdata,specification) } end end + local bb = description.boundingbox + if bb then + if bb[2] > 0 then + chr.tag = abovebaseline_tag + elseif bb[4] < 0 then + chr.tag = belowbaseline_tag + end + end if hasquality then -- we could move these calculations elsewhere (saves calculations) local ve = character.expansion @@ -712,11 +710,13 @@ function constructors.scale(tfmdata,specification) end local va = character.topanchor if va and va ~= 0 then - chr.topanchor = va*vdelta + -- chr.topanchor = va*vdelta + chr.topanchor = va*hdelta end va = character.bottomanchor if va and va ~= 0 then - chr.bottomanchor = va*vdelta + -- chr.bottomanchor = va*vdelta + chr.bottomanchor = va*hdelta end -- local mk = character.mathkerns @@ -779,21 +779,6 @@ function constructors.scale(tfmdata,specification) if fa then chr.flataccent = fa end - elseif autoitalicamount then -- itlc feature - local vi = description.italic - if not vi then - local bb = description.boundingbox - if bb then - local vi = bb[3] - description.width + autoitalicamount - if vi > 0 then -- < 0 indicates no overshoot or a very small auto italic - chr.italic = vi*hdelta - end - else - -- report_defining("no boundingbox for character %C in font %a, fullname %a, filename %a",unicode,name,fullname,filename) - end - elseif vi ~= 0 then - chr.italic = vi*hdelta - end elseif hasitalics then -- unlikely local vi = character.italic if vi and vi ~= 0 then @@ -867,6 +852,10 @@ function constructors.scale(tfmdata,specification) target.fonts = { { id = 0 } } end -- + if trace_defining then + report_defining("font %a, size %N, delta %N",name,scaledpoints,delta) + end + -- return target end @@ -884,6 +873,7 @@ function constructors.finalize(tfmdata) end -- local parameters = tfmdata.parameters + local properties = tfmdata.properties if not parameters then return nil end @@ -900,26 +890,24 @@ function constructors.finalize(tfmdata) parameters.size = tfmdata.size end -- - if not parameters.mode then - parameters.mode = 0 - end - -- - if not parameters.width then - parameters.width = 0 - end - -- - if not parameters.slantfactor then - parameters.slantfactor = (tfmdata.slant or 0)/1000 - end - -- - if not parameters.extendfactor then - parameters.extendfactor = (tfmdata.extend or 1000)/1000 - end + -- In the backend we need to know what effects have been applied. The font + -- has been scaled contrary to the effects that we apply per glyph as these + -- are delayed. We can actually also use the font specific effects there. -- - if not parameters.squeezefactor then - parameters.squeezefactor = (tfmdata.squeeze or 1000)/1000 + local effect = properties and properties.effect + if effect then + parameters.mode = effect.mode + parameters.width = effect.width + parameters.slantfactor = effect.slant + parameters.extendfactor = effect.extend + parameters.squeezefactor = effect.squeeze + else + parameters.mode = 0 + parameters.width = 0 + parameters.slantfactor = 0 + parameters.extendfactor = 1 + parameters.squeezefactor = 1 end - -- local designsize = parameters.designsize if designsize then parameters.minsize = tfmdata.minsize or designsize diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt index 113cade52d4..c0d2c00ba9a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt @@ -31,7 +31,8 @@ local round = math.round local context, commands = context, commands -local P, R, S, C, Cc, Cf, Cg, Ct, Cs, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cf, lpeg.Cg, lpeg.Ct, lpeg.Cs, lpeg.match +local P, R, S, C, Cc, Ct, Cs, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Ct, lpeg.Cs, lpeg.match +----- Cf, Cg = lpeg.Cf, lpeg.Cg local trace_features = false trackers.register("fonts.features", function(v) trace_features = v end) local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end) @@ -121,7 +122,7 @@ local registerotffeature = otffeatures.register local sequencers = utilities.sequencers local appendgroup = sequencers.appendgroup -local appendaction = sequencers.appendaction +----- appendaction = sequencers.appendaction specifiers.contextsetups = specifiers.contextsetups or { } specifiers.contextnumbers = specifiers.contextnumbers or { } @@ -188,10 +189,12 @@ constructors.noffontsloaded = 0 -- font.getcopy = font.getfont -- we always want the table that context uses local accuratefactors = false +local accuratescale = false ----- compactfontmode = false experiments.register("fonts.accurate", function(v) accuratefactors = v end) experiments.register("fonts.compact", function() accuratefactors = true end) +experiments.register("fonts.rescale", function() accuratescale = true end) do @@ -1043,7 +1046,8 @@ local truevalue = P("+") * spaces * sometext * Cc(tru local falsevalue = P("-") * spaces * sometext * Cc(false) local somevalue = sometext * spaces * Cc(true) local keyvalue = sometext * spaces * equal * spaces * sometext -local pattern = Cf(Ct("") * (space + separator + Cg(falsevalue + truevalue + keyvalue + somevalue))^0, rawset) +----- pattern = Cf(Ct("") * (space + separator + Cg(falsevalue + truevalue + keyvalue + somevalue))^0, rawset) +local pattern = Ct("") * (space + separator + ((falsevalue + truevalue + keyvalue + somevalue) % rawset))^0 local function colonized(specification) specification.features.normal = normalize_features(lpegmatch(pattern,specification.detail)) @@ -1080,7 +1084,8 @@ local sizepattern, splitpattern, specialscale do local scale_at = (P("at") + P("@")) * Cc(1) * spaces * dimension -- dimension local scale_sa = P("sa") * Cc(2) * spaces * dimension_x -- number or string local scale_mo = P("mo") * Cc(3) * spaces * dimension_x -- number or string - local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- number + local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- number -- unrealiable and will be dropped +-- local scale_scaled = P("scaled") * Cc(2) * spaces * (dimension / function(s) return s / 1000 end) -- cheat, not related to design size local scale_ht = P("ht") * Cc(5) * spaces * dimension -- dimension local scale_cp = P("cp") * Cc(6) * spaces * dimension -- dimension local scale_sx = P("sx") * spaces * scaler -- scale @@ -1124,12 +1129,13 @@ do -- else too many locals local stoptiming = statistics.stoptiming local setmacro = tokens.setters.macro - local ctxcatcodes = tex.ctxcatcodes local texconditionals = tex.conditionals - local c_scaledfontmode = texiscount("scaledfontmode") - local c_scaledfontsize = texiscount("scaledfontsize") - local c_lastfontid = texiscount("lastfontid") + local ctxcatcodes = tex.ctxcatcodes + + local c_scaledfontmode = texiscount("scaledfontmode") + local c_scaledfontsize = texiscount("scaledfontsize") + local c_lastfontid = texiscount("lastfontid") local reported = setmetatableindex(function(t,k) local v = setmetatableindex(function(t,k) @@ -1169,7 +1175,6 @@ do -- else too many locals -- we can also use a count for the size if size and size ~= "" then local mode, fontsize, sx, sy = lpegmatch(sizepattern,size) --- print(size,mode,fontsize,sx,sy) if mode and fontsize and fontsize ~= "" then texsetcount(c_scaledfontmode,mode) -- ctx_setsomefontsize(fontsize) @@ -1214,6 +1219,10 @@ do -- else too many locals combinefeatures = v end) + function fonts.mode() + return texconditionals["c_font_compact"] and "compact" or "normal" + end + implement { name = "definefont_two", arguments = { @@ -1246,6 +1255,7 @@ do -- else too many locals if trace_defining then report_defining("start stage two: %s, size %s, features %a & %a, mode %a",str,size,classfeatures,fontfeatures,inheritancemode) end + local compact = texconditionals["c_font_compact"] -- name is now resolved and size is scaled cf sa/mo local lookup, name, sub, method, detail = getspecification(str or "") -- new (todo: inheritancemode) @@ -1263,7 +1273,7 @@ do -- else too many locals name = o_name sub = o_sub end - if texconditionals["c_font_compact"] then + if compact then size = 655360 end -- so far @@ -1368,10 +1378,21 @@ do -- else too many locals end end -- - local tfmdata = definers.read(specification,size) -- id not yet known (size in spec?) - -- +-- local tfmdata = definers.read(specification,size) -- id not yet known (size in spec?) + local tfmdata, extend, squeeze, slant, weight = definers.read(specification,size,nil,compact) -- id not yet known (size in spec?) local lastfontid = 0 local tfmtype = type(tfmdata) + if compact then + setmacro("somefontextend", extend ~= 1 and round(extend *1000) or "") + setmacro("somefontsqueeze",squeeze ~= 1 and round(squeeze*1000) or "") + setmacro("somefontslant", slant ~= 0 and round(slant *1000) or "") + setmacro("somefontweight", weight ~= 0 and round(weight *1000) or "") + else -- actually we can omit this as it's not used there + setmacro("somefontextend") + setmacro("somefontsqueeze") + setmacro("somefontslant") + setmacro("somefontweight") + end if tfmtype == "table" then -- setting the extra characters will move elsewhere local characters = tfmdata.characters @@ -1394,13 +1415,15 @@ do -- else too many locals end -- resolved (when designsize is used): local size = round(tfmdata.parameters.size or 655360) - setmacro("somefontsize",size.."sp") + if scaledfontmode ~= 4 then + setmacro("somefontsize",size.."sp") + end texsetcount(c_scaledfontsize,size) lastfontid = id else -- case 1: same as ** local nice = nice_cs(cs) - if not reported[name][nice] then + if name and not reported[name][nice] then report_defining("unable to define %a as %a",name,nice) end lastfontid = -1 @@ -1412,18 +1435,20 @@ do -- else too many locals name,tfmdata,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,classgoodies,goodies,classdesignsize,fontdesignsize) end csnames[tfmdata] = specification.cs --- \definedfont ends up here + -- \definedfont ends up here texdefinefont(global,cs,tfmdata) -- texdefinefont(cs,tfmdata,global and "global") -- resolved (when designsize is used): local size = round(fontdata[tfmdata].parameters.size or 0) - setmacro("somefontsize",size.."sp") + if scaledfontmode ~= 4 then + setmacro("somefontsize",size.."sp") + end texsetcount(c_scaledfontsize,size) lastfontid = tfmdata else -- case 2: same as ** local nice = nice_cs(cs) - if not reported[name][nice] then + if name and not reported[name][nice] then report_defining("unable to define %a as %a",name,nice) end lastfontid = -1 @@ -1559,7 +1584,7 @@ do -- else too many locals local n = 0 - local d_bodyfontsize = tex.isdimen("bodyfontsize") + local d_bodyfontsize = tex.isdimen("bodyfontsize") function definers.internal(specification,cs) specification = specification or { } @@ -1601,13 +1626,14 @@ do -- else too many locals -- here - local infofont = 0 + local infofont = table.setmetatableindex(function(t,k) + local v = define { name = "dejavusansmono", size = texsp("6pt") } + t[k] = v + return v + end) - function fonts.infofont() - if infofont == 0 then - infofont = define { name = "dejavusansmono", size = texsp("6pt") } - end - return infofont + function fonts.infofont(small) + return infofont[small == true and "3pt" or "6pt"] end -- abstract interfacing : we could actually do a runmacro or so @@ -1625,7 +1651,7 @@ end -- have delayed definitions and so we never know what style is taken -- as start. -local c_font_scaled_points = texiscount("c_font_scaled_points") +local c_font_scaled_points = texiscount("c_font_scaled_points") function constructors.calculatescale(tfmdata,scaledpoints,relativeid,specification) local parameters = tfmdata.parameters @@ -1642,7 +1668,8 @@ function constructors.calculatescale(tfmdata,scaledpoints,relativeid,specificati scaledpoints = scaledpoints / height end end - if scaledpoints < 0 then + local negative = scaledpoints < 0 + if negative then scaledpoints = (- scaledpoints/1000) * (tfmdata.designsize or parameters.designsize) -- already in sp end -- a temp hack till we have upgraded all mechanisms @@ -1652,7 +1679,9 @@ function constructors.calculatescale(tfmdata,scaledpoints,relativeid,specificati delta = round(delta) end texsetcount(c_font_scaled_points,size) - -- + if accuratescale and not negative then + size = round(delta * 1000) + end return size, delta end @@ -1661,7 +1690,66 @@ local designsizes = constructors.designsizes -- called quite often when in mp labels -- otf.normalizedaxis -function constructors.hashinstance(specification,force) +-- function constructors.hashinstance(specification,force) +-- local hash = specification.hash +-- local size = specification.size +-- local fallbacks = specification.fallbacks +-- if force or not hash then +-- hash = constructors.hashfeatures(specification) +-- specification.hash = hash +-- end +-- if size < 1000 and designsizes[hash] then +-- size = round(constructors.scaled(size,designsizes[hash])) +-- else +-- size = round(size) +-- end +-- specification.size = size +-- if fallbacks then +-- hash = hash .. ' @ ' .. size .. ' @ ' .. fallbacks +-- else +-- local scalemode = specification.scalemode +-- local special = scalemode and specialscale[scalemode] +-- if special then +-- hash = hash .. ' @ ' .. size .. ' @ ' .. special +-- else +-- hash = hash .. ' @ ' .. size +-- end +-- end +-- return hash +-- end + +function constructors.hashinstance(specification,force,compact) + -- + local normal = compact and specification.features.normal + local extend, squeeze, slant, weight, auto + if normal then + local effect = normal.effect + if effect then + extend = effect.extend or 1 + squeeze = effect.squeeze or 1 + slant = effect.slant or 0 + weight = effect.weight or 0 + auto = effect.auto or false + else + extend = normal.extend or 1 + squeeze = normal.squeeze or 1 + slant = normal.slant or 0 + weight = normal.weight or 0 + auto = false + end + normal.extend = nil + normal.squeeze = nil + normal.slant = nil + normal.weight = nil + weight = weight / 2 + else + extend = 1 + squeeze = 1 + slant = 0 + weight = 0 + auto = false + end + -- local hash = specification.hash local size = specification.size local fallbacks = specification.fallbacks @@ -1686,7 +1774,7 @@ function constructors.hashinstance(specification,force) hash = hash .. ' @ ' .. size end end - return hash + return hash, extend, squeeze, slant, weight, auto end -- We overload the (generic) resolver: @@ -1745,10 +1833,13 @@ local pattern = P("P") * (lpeg.patterns.hexdigit^4 / function(s) return tonumber(s,16) end) * P(-1) -local function nametoslot(name) -- also supports PXXXXX (4+ positions) +local function nametoslot(name,id) -- also supports PXXXXX (4+ positions) local t = type(name) if t == "string" then - local unic = unicodes[true] + if not id then + id = true + end + local unic = unicodes[id] local slot = unic[name] if slot then return slot @@ -1764,7 +1855,7 @@ local function nametoslot(name) -- also supports PXXXXX (4+ positions) if not aglunicodes then aglunicodes = encodings.agl.unicodes end - local char = characters[true] + local char = characters[id] local slot = aglunicodes[name] if slot and char[slot] then return slot @@ -1775,7 +1866,7 @@ local function nametoslot(name) -- also supports PXXXXX (4+ positions) end -- not in font elseif t == "number" then - if characters[true][name] then + if characters[id][name] then return slot else -- not in font @@ -2126,7 +2217,7 @@ function fonts.definetypeface(name,t) ctx_definefontsynonym( { formatters["%sBoldItalic"](Shape) }, { formatters["spec:%s-%s-italic-%s"] (fontname, boldweight, boldwidth ) } ) ctx_definefontsynonym( { formatters["%sItalic"] (Shape) }, { formatters["spec:%s-%s-italic-%s"] (fontname, normalweight, normalwidth) } ) ctx_stopfontclass() - local settings = sequenced({ features= t.features },",") + local settings = sequenced({ features = t.features },",") ctx_dofastdefinetypeface(name, shortcut, shape, size, settings) end @@ -2525,13 +2616,14 @@ do local analyzers = fonts.analyzers local methods = analyzers.methods - local unsetvalue = attributes.unsetvalue + local unsetvalue = attributes.unsetvalue - local a_color = attributes.private('color') - local a_colormodel = attributes.private('colormodel') - local m_color = attributes.list[a_color] or { } + local a_color = attributes.private('color') + local a_colormodel = attributes.private('colormodel') - local glyph_code = nodes.nodecodes.glyph + local glyph_code = nodes.nodecodes.glyph + + local m_color = attributes.list[a_color] or { } local states = analyzers.states @@ -3220,3 +3312,67 @@ function fonts.helpers.collectanchors(tfmdata) return anchors end + +do + + -- We can make these real font dimens instead: + + local yscaled = font.yscaled + + local dimen_code = tokens.values.dimension + + implement { + name = "ascender", + public = true, + protected = true, + usage = "value", + actions = function(index) + -- return dimen_code, yscaled(parameters[true].ascender or 0) -- unreliable + -- return dimen_code, yscaled(parameters[true].ascent or 0) -- too much + local c = characters[true][0x28] -- ( + return dimen_code, yscaled(c and c.height or 0) + end + } + implement { + name = "descender", + public = true, + protected = true, + usage = "value", + actions = function(index) + -- return dimen_code, yscaled(parameters[true].descender or 0) -- unreliable + -- return dimen_code, yscaled(parameters[true].descent or 0) -- too much + local c = characters[true][0x28] -- ( + return dimen_code, yscaled(c and c.depth or 0) + end + } + implement { + name = "capheight", + public = true, + protected = true, + usage = "value", + actions = function(index) + -- return dimen_code, yscaled(parameters[true].capheight or 0) -- unreliable + local c = characters[true][0x58] -- X + return dimen_code, yscaled(c and c.height or 0) + end + } + + -- This has similar performance but then we need to define at the tex end so ... + -- + -- local properties = { + -- [130] = "ascender", + -- [133] = "descender", + -- [132] = "capheight", + -- } + -- + -- implement { + -- name = "fontproperty", + -- public = true, + -- protected = true, + -- usage = "value", + -- actions = function(index) + -- return dimen_code, yscaled(parameters[true][properties[index]] or 0) + -- end + -- } + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt index ea6b2d0c039..affff508d0a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt @@ -343,7 +343,9 @@ local function checkfeatures(tfmdata) end local reported = setmetatableindex(function(t,k) - t[k] = true + if k then + t[k] = true + end return false end) @@ -355,8 +357,8 @@ function definers.loadfont(specification) if not tfmdata then -- normally context will not end up here often (if so there is an issue somewhere) local forced = specification.forced or "" -local id = nextfont(true) -specification.id = id + local id = nextfont(true) + specification.id = id if forced ~= "" then local reader = readers[lower(forced)] -- normally forced is already lowered tfmdata = reader and reader(specification) @@ -443,7 +445,7 @@ function definers.register(tfmdata,id) end end -function definers.read(specification,size,id) -- id can be optional, name can already be table +function definers.read(specification,size,id,compact) -- id can be optional, name can already be table statistics.starttiming(fonts) if type(specification) == "string" then specification = definers.analyze(specification,size) @@ -453,8 +455,8 @@ function definers.read(specification,size,id) -- id can be optional, name can al specification = variants[method](specification) end specification = definers.resolve(specification) - local hash = constructors.hashinstance(specification) --- inspect(hash) +-- local hash = constructors.hashinstance(specification,false,true) + local hash, extend, squeeze, slant, weight, auto = constructors.hashinstance(specification,false,compact) local tfmdata = definers.registered(hash) -- id local name = specification.name if tfmdata then @@ -490,7 +492,22 @@ function definers.read(specification,size,id) -- id can be optional, name can al properties.fullname, basename(properties.filename)) end statistics.stoptiming(fonts) - return tfmdata + if compact and weight ~= 0 then + local parameters = (tfmtype == "table" and tfmdata or fontdata[tfmdata]).parameters + local amount = 65536 * weight + if auto then + if not squeeze or squeeze == 1 then + local xheight = parameters.xheight + squeeze = xheight / (xheight + amount) + end + if not extend or extend == 1 then + local emwidth = parameters.quad + extend = emwidth / (emwidth + 2 * amount) + end + end + parameters.hshift = amount -- * extend -- weight + end + return tfmdata, extend, squeeze, slant, weight end function font.getfont(id) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt index a1bf6f641d1..8044a0c5ff2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt @@ -101,10 +101,10 @@ local readcardinaltable = streamreader.readcardinaltable local readintegertable = streamreader.readintegertable local readfword = readshort -local short = 2 -local ushort = 2 -local uoffset = 3 -local ulong = 4 +local short = 2 +local ushort = 2 +local uoffset = 3 +local ulong = 4 directives.register("fonts.streamreader",function() @@ -143,7 +143,7 @@ local helpers = readers.helpers local gotodatatable = helpers.gotodatatable local setvariabledata = helpers.setvariabledata -local lookupidoffset = -1 -- will become 1 when we migrate (only -1 for comparign with old) +local lookupidoffset = -1 -- will become 1 when we migrate (only -1 for comparing with old) local classes = { "base", @@ -755,8 +755,8 @@ local function readposition(f,format,mainoffset,getdelta) local Y = (format & 0x20) ~= 0 and skipshort(f) or 0 local H = (format & 0x40) ~= 0 and skipshort(f) or 0 local V = (format & 0x80) ~= 0 and skipshort(f) or 0 - -- local s = skips[extract(format,4,4)] - local s = skips[(format >> 4) & 0xF] + -- local s = skips[extract(format,4,4)] + local s = skips[(format >> 4) & 0xF] if s > 0 then skipshort(f,s) end @@ -2138,7 +2138,7 @@ do return features end - local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) setposition(f,lookupoffset) local noflookups = readushort(f) local lookups = readcardinaltable(f,noflookups,ushort) @@ -2156,13 +2156,12 @@ do end -- which one wins? local markclass = (flagbits & 0x0010) ~= 0 -- usemarkfilteringset + local markset = (flagbits >> 8) & 0xFFFFFFFF if markclass then - markclass = readushort(f) -- + 1 + markclass = nofmarkclasses + markset end - -- local markset = rshift(flagbits,8) - local markset = (flagbits >> 8) & 0xFFFFFFFF if markset > 0 then - markclass = markset -- + 1 + markclass = nofmarkclasses + markset end lookups[lookupid] = { type = lookuptype, @@ -2564,7 +2563,10 @@ do return end -- - local lookups = readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local markclasses = fontdata.markclasses + local marksets = fontdata.marksets + local nofmarkclasses = (markclasses and #markclasses or 0) - (marksets and #marksets or 0) + local lookups = readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) -- if lookups then resolvelookups(f,lookupoffset,fontdata,lookups,lookuptypes,lookuphandlers,what,tableoffset) @@ -2746,8 +2748,9 @@ function readers.gdef(f,fontdata,specification) end end end - -- mark sets : todo: just make the same as class sets above + -- mark sets if marksetsoffset ~= 0 then + local nofmarkclasses = fontdata.markclasses and #fontdata.markclasses or 0 marksetsoffset = tableoffset + marksetsoffset setposition(f,marksetsoffset) local format = readushort(f) @@ -2757,7 +2760,8 @@ function readers.gdef(f,fontdata,specification) for i=1,nofsets do local offset = sets[i] if offset ~= 0 then - marksets[i] = readcoverage(f,marksetsoffset+offset) + markclasses[nofmarkclasses + i] = readcoverage(f,marksetsoffset+offset) + marksets[i] = { } end end end @@ -3073,14 +3077,8 @@ local function readmathvariants(f,fontdata,offset) end end end - - -- if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then - get(offset,hcoverage,hnofglyphs,hconstruction,"variants","parts","partsitalic","partsorientation","horizontal") - get(offset,vcoverage,vnofglyphs,vconstruction,"variants","parts","partsitalic","partsorientation","vertical") - -- else - -- get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic") - -- get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic") - -- end + get(offset,hcoverage,hnofglyphs,hconstruction,"variants","parts","partsitalic","partsorientation","horizontal") + get(offset,vcoverage,vnofglyphs,vconstruction,"variants","parts","partsitalic","partsorientation","vertical") end function readers.math(f,fontdata,specification) @@ -3145,9 +3143,18 @@ do local linesdata -- for the moment verbose, will be just indexed local affinedata -- for the moment verbose, will be just indexed +local layerlistoffset +local layeroffset + +local paintindex + local function getpaintoffset(f,offset) - offset = offset + readuoffset(f) - return paintdata[offset] and offset or nil + local o = readuoffset(f) + if o == 0 then + -- + else + return paintdata[offset+o] -- and offset or nil + end end local function getlinesoffset(f,offset,var) @@ -3166,138 +3173,138 @@ do return offset end - paintreaders = { + local paintreaders = { -- uint8 numLayers Number of offsets to paint tables to read from LayerList. -- uint32 firstLayerIndex Index (base 0) into the LayerList. - [1] = function(f,format) - return { - format = format, - name = "PaintColrLayers", - count = readuinteger(f), - index = readulong(f), - list = false, - } - end, - -- uint16 paletteIndex Index for a CPAL palette entry. - -- F2DOT14 alpha Alpha value. - [2] = function(f,format) - return { - format = format, - name = "Paintsolid", - palette = readushort(f), - alpha = read2dot14(f), - } - end, - -- uint16 paletteIndex Index for a CPAL palette entry. - -- F2DOT14 alpha Alpha value. For variation, use varIndexBase + 0. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [3] = function(f,format) - return { - format = format, - name = "Paintsolid", - palette = readushort(f), - alpha = read2dot14(f), - varbase = readulong(f), - } - end, - -- Offset24 colorLineOffset Offset to VarColorLine table. - -- FWORD x0 Start point (p₀) x coordinate. For variation, use varIndexBase + 0. - -- FWORD y0 Start point (p₀) y coordinate. For variation, use varIndexBase + 1. - -- FWORD x1 End point (p₁) x coordinate. For variation, use varIndexBase + 2. - -- FWORD y1 End point (p₁) y coordinate. For variation, use varIndexBase + 3. - -- FWORD x2 Rotation point (p₂) x coordinate. For variation, use varIndexBase + 4. - -- FWORD y2 Rotation point (p₂) y coordinate. For variation, use varIndexBase + 5. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [4] = function(f,format,offset) - return { - format = format, - name = "PaintLinearGradient", - color = getlinesoffset(f,offset,false), - x0 = readfword(f), - y0 = readfword(f), - x1 = readfword(f), - y1 = readfword(f), - x2 = readfword(f), - y2 = readfword(f), - } - end, - [5] = function(f,format,offset) - return { - format = format, - name = "PaintLinearGradient", - color = getlinesoffset(f,offset,true), - x0 = readfword(f), - y0 = readfword(f), - x1 = readfword(f), - y1 = readfword(f), - x2 = readfword(f), - y2 = readfword(f), - varbase = readulong(f), - } - end, - -- Offset24 colorLineOffset Offset to VarColorLine table. - -- FWORD x0 Start circle center x coordinate. For variation, use varIndexBase + 0. - -- FWORD y0 Start circle center y coordinate. For variation, use varIndexBase + 1. - -- UFWORD radius0 Start circle radius. For variation, use varIndexBase + 2. - -- FWORD x1 End circle center x coordinate. For variation, use varIndexBase + 3. - -- FWORD y1 End circle center y coordinate. For variation, use varIndexBase + 4. - -- UFWORD radius1 End circle radius. For variation, use varIndexBase + 5. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [6] = function(f,format) - return { - format = format, - name = "PaintRadialGradient", - color = getlinesoffset(f,offset,false), - x0 = readfword(f), - y0 = readfword(f), - radius0 = readfword(f), - x1 = readfword(f), - y1 = readfword(f), - radius1 = readfword(f), - } - end, - [7] = function(f,format) - return { - format = format, - name = "PaintRadialGradient", - color = getlinesoffset(f,offset,true), - x0 = readfword(f), - y0 = readfword(f), - radius0 = readfword(f), - x1 = readfword(f), - y1 = readfword(f), - radius1 = readfword(f), - varbase = readulong(f), - } - end, - -- Offset24 colorLineOffset Offset to VarColorLine table. - -- FWORD centerX Center x coordinate. For variation, use varIndexBase + 0. - -- FWORD centerY Center y coordinate. For variation, use varIndexBase + 1. - -- F2DOT14 startAngle Start of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 2. - -- F2DOT14 endAngle End of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 3. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [8] = function(f,format) - return { - format = format, - name = "PaintSweepGradient", - color = getlinesoffset(f,offset,false), - centerx = readfword(f), - centery = readfword(f), - startangle = read2dot14(f), - endangle = read2dot14(f), - } - end, - [9] = function(f,format) - return { - format = format, - name = "PaintSweepGradient", - color = getlinesoffset(f,offset,true), - centerx = readfword(f), - centery = readfword(f), - startangle = read2dot14(f), - endangle = read2dot14(f), - varbase = readulong(f), - } + [1] = function(f,format) + return { + format = format, + name = "PaintColrLayers", + count = readuinteger(f), + index = readulong(f), + list = false, + } + end, + -- uint16 paletteIndex Index for a CPAL palette entry. + -- F2DOT14 alpha Alpha value. + [2] = function(f,format) + return { + format = format, + name = "Paintsolid", + palette = readushort(f), + alpha = read2dot14(f), + } + end, + -- uint16 paletteIndex Index for a CPAL palette entry. + -- F2DOT14 alpha Alpha value. For variation, use varIndexBase + 0. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [3] = function(f,format) + return { + format = format, + name = "Paintsolid", + palette = readushort(f), + alpha = read2dot14(f), + varbase = readulong(f), + } + end, + -- Offset24 colorLineOffset Offset to VarColorLine table. + -- FWORD x0 Start point (p₀) x coordinate. For variation, use varIndexBase + 0. + -- FWORD y0 Start point (p₀) y coordinate. For variation, use varIndexBase + 1. + -- FWORD x1 End point (p₁) x coordinate. For variation, use varIndexBase + 2. + -- FWORD y1 End point (p₁) y coordinate. For variation, use varIndexBase + 3. + -- FWORD x2 Rotation point (p₂) x coordinate. For variation, use varIndexBase + 4. + -- FWORD y2 Rotation point (p₂) y coordinate. For variation, use varIndexBase + 5. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [4] = function(f,format,offset) + return { + format = format, + name = "PaintLinearGradient", + color = getlinesoffset(f,offset,false), + x0 = readfword(f), + y0 = readfword(f), + x1 = readfword(f), + y1 = readfword(f), + x2 = readfword(f), + y2 = readfword(f), + } + end, + [5] = function(f,format,offset) + return { + format = format, + name = "PaintLinearGradient", + color = getlinesoffset(f,offset,true), + x0 = readfword(f), + y0 = readfword(f), + x1 = readfword(f), + y1 = readfword(f), + x2 = readfword(f), + y2 = readfword(f), + varbase = readulong(f), + } + end, + -- Offset24 colorLineOffset Offset to VarColorLine table. + -- FWORD x0 Start circle center x coordinate. For variation, use varIndexBase + 0. + -- FWORD y0 Start circle center y coordinate. For variation, use varIndexBase + 1. + -- UFWORD radius0 Start circle radius. For variation, use varIndexBase + 2. + -- FWORD x1 End circle center x coordinate. For variation, use varIndexBase + 3. + -- FWORD y1 End circle center y coordinate. For variation, use varIndexBase + 4. + -- UFWORD radius1 End circle radius. For variation, use varIndexBase + 5. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [6] = function(f,format,offset) + return { + format = format, + name = "PaintRadialGradient", + color = getlinesoffset(f,offset,false), + x0 = readfword(f), + y0 = readfword(f), + radius0 = readfword(f), + x1 = readfword(f), + y1 = readfword(f), + radius1 = readfword(f), + } + end, + [7] = function(f,format,offset) + return { + format = format, + name = "PaintRadialGradient", + color = getlinesoffset(f,offset,true), + x0 = readfword(f), + y0 = readfword(f), + radius0 = readfword(f), + x1 = readfword(f), + y1 = readfword(f), + radius1 = readfword(f), + varbase = readulong(f), + } + end, + -- Offset24 colorLineOffset Offset to VarColorLine table. + -- FWORD centerX Center x coordinate. For variation, use varIndexBase + 0. + -- FWORD centerY Center y coordinate. For variation, use varIndexBase + 1. + -- F2DOT14 startAngle Start of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 2. + -- F2DOT14 endAngle End of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 3. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [8] = function(f,format,offset) + return { + format = format, + name = "PaintSweepGradient", + color = getlinesoffset(f,offset,false), + centerx = readfword(f), + centery = readfword(f), + startangle = read2dot14(f), + endangle = read2dot14(f), + } + end, + [9] = function(f,format,offset) + return { + format = format, + name = "PaintSweepGradient", + color = getlinesoffset(f,offset,true), + centerx = readfword(f), + centery = readfword(f), + startangle = read2dot14(f), + endangle = read2dot14(f), + varbase = readulong(f), + } end, -- Offset24 paintOffset Offset to a Paint table. -- uint16 glyphID Glyph ID for the source outline. @@ -3310,269 +3317,273 @@ do } end, -- uint16 glyphID Glyph ID for a BaseGlyphList base glyph. - [11] = function(f,format) - return { - format = format, - name = "PaintColrGlyph", - glyph = readushort(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- Offset24 transformOffset Offset to an (Var)Affine2x3 table. - [12] = function(f,format,offset) - return { - format = format, - name = "PaintTransform", - affine = getaffineoffset(f,offset,false), - paint = getpaintoffset(f,offset), - } - end, - [13] = function(f,format,offset) - return { - format = format, - name = "PaintTransform", - affine = getaffineoffset(f,offset,true), - paint = getpaintoffset(f,offset), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- FWORD dx Translation in x direction. For variation, use varIndexBase + 0. - -- FWORD dy Translation in y direction. For variation, use varIndexBase + 1. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [14] = function(f,format,offset) - return { - format = format, - name = "PaintTranslate", - paint = getpaintoffset(f,offset), - dx = readfword(f), - dy = readfword(f), - } - end, - [15] = function(f,format,offset) - return { - format = format, - name = "PaintTranslate", - paint = getpaintoffset(f,offset), - dx = readfword(f), - dy = readfword(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 scaleX Scale factor in x direction. For variation, use varIndexBase + 0. - -- F2DOT14 scaleY Scale factor in y direction. For variation, use varIndexBase + 1. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [16] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scalex = read2dot14(f), - scaley = read2dot14(f), - } - end, - [17] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scalex = read2dot14(f), - scaley = read2dot14(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 scaleX Scale factor in x direction. For variation, use varIndexBase + 0. - -- F2DOT14 scaleY Scale factor in y direction. For variation, use varIndexBase + 1. - -- FWORD centerX x coordinate for the center of scaling. For variation, use varIndexBase + 2. - -- FWORD centerY y coordinate for the center of scaling. For variation, use varIndexBase + 3. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [18] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scalex = read2dot14(f), - scaley = read2dot14(f), - centerx = readfword(f), - centery = readfword(f), - } - end, - [19] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scalex = read2dot14(f), - scaley = read2dot14(f), - centerx = readfword(f), - centery = readfword(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 scale Scale factor in x and y directions. For variation, use varIndexBase + 0. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [20] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scale = read2dot14(f), - } - end, - [21] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scale = read2dot14(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 scale Scale factor in x and y directions. For variation, use varIndexBase + 0. - -- FWORD centerX x coordinate for the center of scaling. For variation, use varIndexBase + 1. - -- FWORD centerY y coordinate for the center of scaling. For variation, use varIndexBase + 2. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [22] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scale = read2dot14(f), - centerx = readfword(f), - centery = readfword(f), - } - end, - [23] = function(f,format,offset) - return { - format = format, - name = "PaintScale", - paint = getpaintoffset(f,offset), - scale = read2dot14(f), - centerx = readfword(f), - centery = readfword(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 angle Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [24] = function(f,format,offset) - return { - format = format, - angle = read2dot14(f), - paint = getpaintoffset(f,offset), - name = "PaintRotate", - } - end, - [25] = function(f,format,offset) - return { - format = format, - name = "PaintRotate", - paint = getpaintoffset(f,offset), - angle = read2dot14(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 angle Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. - -- FWORD centerX x coordinate for the center of rotation. For variation, use varIndexBase + 1. - -- FWORD centerY y coordinate for the center of rotation. For variation, use varIndexBase + 2. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [26] = function(f,format,offset) - return { - format = format, - name = "PaintRotate", - paint = getpaintoffset(f,offset), - centerx = readfword(f), - centery = readfword(f), - } - end, - [27] = function(f,format,offset) - return { - format = format, - name = "PaintRotate", - paint = getpaintoffset(f,offset), - centerx = read2dot14(f), - centery = read2dot14(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 xSkewAngle Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. - -- F2DOT14 ySkewAngle Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [28] = function(f,format,offset) - return { - format = format, - name = "PaintSkew", - paint = getpaintoffset(f,offset), - xangle = read2dot14(f), - yangle = read2dot14(f), - } - end, - [29] = function(f,format,offset) - return { - format = format, - name = "PaintSkew", - paint = getpaintoffset(f,offset), - xangle = read2dot14(f), - yangle = read2dot14(f), - varbase = readulong(f), - } - end, - -- Offset24 paintOffset Offset to a Paint subtable. - -- F2DOT14 xSkewAngle Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. - -- F2DOT14 ySkewAngle Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1. - -- FWORD centerX x coordinate for the center of rotation. For variation, use varIndexBase + 2. - -- FWORD centerY y coordinate for the center of rotation. For variation, use varIndexBase + 3. - -- uint32 varIndexBase Base index into DeltaSetIndexMap. - [30] = function(f,format,offset) - return { - format = format, - name = "PaintSkew", - paint = getpaintoffset(f,offset), - xangle = read2dot14(f), - yangle = read2dot14(f), - centerx = readfword(f), - centery = readfword(f), - } - end, - [31] = function(f,format,offset) - return { - format = format, - name = "PaintSkew", - paint = getpaintoffset(f,offset), - xangle = read2dot14(f), - yangle = read2dot14(f), - centerx = readfword(f), - centery = readfword(f), - varbase = readulong(f), - } - end, - -- Offset24 sourcePaintOffset Offset to a source Paint table. - -- uint8 compositeMode A CompositeMode enumeration value. - -- Offset24 backdropaintOffset Offset to a backdrop Paint table. - [32] = function(f,format,offset) - return { - format = format, - name = "PaintComposite", - source = getpaintoffset(f,offset), - mode = readuinteger(f), - backdrop = getpaintoffset(f,offset), - } - end, + [11] = function(f,format) + return { + format = format, + name = "PaintColrGlyph", + glyph = readushort(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- Offset24 transformOffset Offset to an (Var)Affine2x3 table. + [12] = function(f,format,offset) + return { + format = format, + name = "PaintTransform", + affine = getaffineoffset(f,offset,false), + paint = getpaintoffset(f,offset), + } + end, + [13] = function(f,format,offset) + return { + format = format, + name = "PaintTransform", + affine = getaffineoffset(f,offset,true), + paint = getpaintoffset(f,offset), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- FWORD dx Translation in x direction. For variation, use varIndexBase + 0. + -- FWORD dy Translation in y direction. For variation, use varIndexBase + 1. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [14] = function(f,format,offset) + return { + format = format, + name = "PaintTranslate", + paint = getpaintoffset(f,offset), + dx = readfword(f), + dy = readfword(f), + } + end, + [15] = function(f,format,offset) + return { + format = format, + name = "PaintTranslate", + paint = getpaintoffset(f,offset), + dx = readfword(f), + dy = readfword(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 scaleX Scale factor in x direction. For variation, use varIndexBase + 0. + -- F2DOT14 scaleY Scale factor in y direction. For variation, use varIndexBase + 1. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [16] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scalex = read2dot14(f), + scaley = read2dot14(f), + } + end, + [17] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scalex = read2dot14(f), + scaley = read2dot14(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 scaleX Scale factor in x direction. For variation, use varIndexBase + 0. + -- F2DOT14 scaleY Scale factor in y direction. For variation, use varIndexBase + 1. + -- FWORD centerX x coordinate for the center of scaling. For variation, use varIndexBase + 2. + -- FWORD centerY y coordinate for the center of scaling. For variation, use varIndexBase + 3. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [18] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scalex = read2dot14(f), + scaley = read2dot14(f), + centerx = readfword(f), + centery = readfword(f), + } + end, + [19] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scalex = read2dot14(f), + scaley = read2dot14(f), + centerx = readfword(f), + centery = readfword(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 scale Scale factor in x and y directions. For variation, use varIndexBase + 0. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [20] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scale = read2dot14(f), + } + end, + [21] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scale = read2dot14(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 scale Scale factor in x and y directions. For variation, use varIndexBase + 0. + -- FWORD centerX x coordinate for the center of scaling. For variation, use varIndexBase + 1. + -- FWORD centerY y coordinate for the center of scaling. For variation, use varIndexBase + 2. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [22] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scale = read2dot14(f), + centerx = readfword(f), + centery = readfword(f), + } + end, + [23] = function(f,format,offset) + return { + format = format, + name = "PaintScale", + paint = getpaintoffset(f,offset), + scale = read2dot14(f), + centerx = readfword(f), + centery = readfword(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 angle Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [24] = function(f,format,offset) + return { + format = format, + angle = read2dot14(f), + paint = getpaintoffset(f,offset), + name = "PaintRotate", + } + end, + [25] = function(f,format,offset) + return { + format = format, + name = "PaintRotate", + paint = getpaintoffset(f,offset), + angle = read2dot14(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 angle Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. + -- FWORD centerX x coordinate for the center of rotation. For variation, use varIndexBase + 1. + -- FWORD centerY y coordinate for the center of rotation. For variation, use varIndexBase + 2. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [26] = function(f,format,offset) + return { + format = format, + name = "PaintRotate", + paint = getpaintoffset(f,offset), + centerx = readfword(f), + centery = readfword(f), + } + end, + [27] = function(f,format,offset) + return { + format = format, + name = "PaintRotate", + paint = getpaintoffset(f,offset), + centerx = read2dot14(f), + centery = read2dot14(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 xSkewAngle Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. + -- F2DOT14 ySkewAngle Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [28] = function(f,format,offset) + return { + format = format, + name = "PaintSkew", + paint = getpaintoffset(f,offset), + xangle = read2dot14(f), + yangle = read2dot14(f), + } + end, + [29] = function(f,format,offset) + return { + format = format, + name = "PaintSkew", + paint = getpaintoffset(f,offset), + xangle = read2dot14(f), + yangle = read2dot14(f), + varbase = readulong(f), + } + end, + -- Offset24 paintOffset Offset to a Paint subtable. + -- F2DOT14 xSkewAngle Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0. + -- F2DOT14 ySkewAngle Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1. + -- FWORD centerX x coordinate for the center of rotation. For variation, use varIndexBase + 2. + -- FWORD centerY y coordinate for the center of rotation. For variation, use varIndexBase + 3. + -- uint32 varIndexBase Base index into DeltaSetIndexMap. + [30] = function(f,format,offset) + return { + format = format, + name = "PaintSkew", + paint = getpaintoffset(f,offset), + xangle = read2dot14(f), + yangle = read2dot14(f), + centerx = readfword(f), + centery = readfword(f), + } + end, + [31] = function(f,format,offset) + return { + format = format, + name = "PaintSkew", + paint = getpaintoffset(f,offset), + xangle = read2dot14(f), + yangle = read2dot14(f), + centerx = readfword(f), + centery = readfword(f), + varbase = readulong(f), + } + end, + -- Offset24 sourcePaintOffset Offset to a source Paint table. + -- uint8 compositeMode A CompositeMode enumeration value. + -- Offset24 backdropaintOffset Offset to a backdrop Paint table. + [32] = function(f,format,offset) + return { + format = format, + name = "PaintComposite", + source = getpaintoffset(f,offset), + mode = readuinteger(f), + backdrop = getpaintoffset(f,offset), + } + end, } local unsupported = function() - return nil + return false end setmetatableindex(paintreaders,function(t,format) - report("unsupported colr type 2 paint format %i",format) - t[format] = unsupported + if format then + report("unsupported colr type 2 paint format %S",format) + t[format] = unsupported -- problem: we don't know what to skip, so maybe best is to quit + else + report("possible error reading colr type 2 paint format") + end return unsupported end) @@ -3595,10 +3606,12 @@ do local glyphs = fontdata.glyphs local nofglyphs = readushort(f) local baseoffset = readulong(f) - local layeroffset = readulong(f) +-- local layeroffset = readulong(f) +layeroffset = readulong(f) local noflayers = readushort(f) local glyphlistoffset = 0 - local layerlistoffset = 0 +-- local layerlistoffset = 0 +layerlistoffset = 0 local cliplistoffset = 0 local varindexmapoffset = 0 local variationoffset = 0 @@ -3614,7 +3627,7 @@ do -- The special value 0xFFFF is foreground (but we index from 1). It -- more looks like indices into a palette so 'class' is a better name -- than 'palette'. - if layeroffset > 0 then + if layeroffset > 0 and noflayers > 0 then setposition(f,tableoffset + layeroffset) for i=1,noflayers do local slot = readushort(f) @@ -3632,7 +3645,7 @@ do end end fontdata.maxcolorclass = maxclass - if baseoffset > 0 then + if baseoffset > 0 and nofglyphs > 0 then setposition(f,tableoffset + baseoffset) for i=0,nofglyphs-1 do local glyphindex = readushort(f) @@ -3645,66 +3658,84 @@ do glyphs[glyphindex].colors = t end end -if next(layerrecords) then - report("table version %a of %a is %s supported for font %s",version,"colr","partially",fontdata.filename) - return -end - -- if not (CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0) then + if next(layerrecords) then + report("table version %a of %a is %s supported for font %s",version,"colr","partially",fontdata.filename) + return + end + -- if true then -- return -- end if layerlistoffset > 0 and glyphlistoffset > 0 then local layers = { } local paints = { } - local count, offset - -- - setposition(f,tableoffset + layerlistoffset) - count = readulong(f) - -- layers = readcardinaltable(f,count,uoffset) - for i=1,count do -- zero ? +layeroffset = tableoffset + layerlistoffset + setposition(f,layeroffset) + local layercount = readulong(f) + -- layers = readcardinaltable(f,layercount,uoffset) + for i=1,layercount do -- zero ? layers[i] = readulong(f) -- offsets to painttable end -- - offset = tableoffset + glyphlistoffset - setposition(f,offset) - count = readulong(f) - for i=1,count do + glyphoffset = tableoffset + glyphlistoffset + setposition(f,glyphoffset) + local glyphcount = readulong(f) + for i=1,glyphcount do -- glyph index -> paintrecord paints[readushort(f)] = readulong(f) -- paintrecord offset (32 formats) end paintdata = setmetatableindex(function(t,k) + local p = getposition(f) setposition(f,k) local format = readuinteger(f) local v = paintreaders[format](f,format,k) + setposition(f,p) t[k] = v return v end) linesdata = { } affinedata = { } + for i=1,layercount do -- zero ? + local o = layeroffset + layers[i] + local l = paintdata[o] + if not l then + report("color table in font %a has an invalid layer entry %i, offset %i",i,layers[i]) + end + layers[i] = l + end +-- io.savedata("e:/tmp/oeps.lua",table.serialize({ root = paintdata })) +-- io.savedata("e:/tmp/oeps.lua",table.serialize(layers)) for k, v in next, paints do - local o = offset + v + local o = glyphoffset + v - layeroffset if paintdata[o] then paints[k] = o -- first paint end end -- expand format 1 - offset = tableoffset + layerlistoffset for k, v in next, paints do v = paintdata[v] - local format = v.format - if format == 1 then - -- name - local count = v.count - local index = v.index - local list = { } - v.count = nil - v.index = nil - v.list = list - for i=1,count do - local o = offset + layers[index+i] - if paintdata[o] then - list[i] = o + if v then + local format = v.format + if format == 1 then + -- name + local count = v.count + if count then + local index = v.index + 1 + local list = { } + v.count = nil + v.index = nil + v.list = list + for i=1,count do +-- local o = layeroffset + layers[index+i] +-- if paintdata[o] then + list[i] = layers[index] + index = index + 1 + end + else + -- already done end end + else + -- missing end end -- @@ -3732,18 +3763,27 @@ end local extend = readuinteger(f) local count = readushort(f) local stops = { } - for i=1,count do - stops[i] = { - stop = read2dot14(f), - pallette = readushort(f), - alpha = read2dot14(f), - varbase = v and readulong(f) or nil, + if count then + for i=1,count do + stops[i] = { + stop = read2dot14(f), + pallette = readushort(f), + alpha = read2dot14(f), + varbase = v and readulong(f) or nil, + } + end + linesdata[k] = { + extend = readuinteger(f), + stops = stops, } + else + report("running out of linedata in colr reading") + linesdata[k] = { + extend = 0, + stops = stops, + } + break end - linesdata[k] = { - extend = readuinteger(f), - stops = stops, - } end -- for k, v in next, affinedata do @@ -3775,6 +3815,9 @@ end local lhash, ldata = rehash(linesdata) local ahash, adata = rehash(affinedata) for k, v in next, paintdata do +if not v then + print("todo",k,v) +else local c = v.color if c then v.color = lhash[c] @@ -3801,6 +3844,7 @@ end v.backdrop = phash[v.backdrop] -- goto done end +end ::done:: end paintdata = pdata @@ -3815,16 +3859,21 @@ end local paint = paintdata[v] local format = paint.format if format == 1 then - local list = paint.list - local done = { } + local list = paint.list + local done = { } + local count = 0 for i=1,#list do local p = paintdata[list[i]] local f = p.format if f == 10 or f == 11 then - done[i] = { + count = count + 1 + done[count] = { slot = p.glyph, class = i, } + else + -- print(f) + -- missing end end glyphs[k].colors = done @@ -3837,6 +3886,7 @@ end -- fontdata.coloraffinedata = affinedata end end + ::done:: fontdata.hascolor = true end @@ -3884,8 +3934,7 @@ end local compress = gzip and gzip.compress local compressed = compress and gzip.compressed --- At some point I will delay loading and only store the offsets (in context lmtx --- only). +-- At some point I will delay loading and only store the offsets. -- compressed = false @@ -3960,7 +4009,7 @@ function readers.sbix(f,fontdata,specification) end end) local glyphs = { } - -- local delayed = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 or fonts.handlers.typethree + -- local delayed = fonts.handlers.typethree for i=1,nofstrikes do local strike = strikes[i] local strikeppem = strike.ppem @@ -4199,7 +4248,7 @@ do local default = { width = 0, height = 0 } local glyphs = fontdata.glyphs - -- local delayed = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 or fonts.handlers.typethree + -- local delayed = fonts.handlers.typethree for index, subtable in sortedhash(shapes) do if type(subtable) == "table" then @@ -4666,3 +4715,7 @@ function readers.mvar(f,fontdata,specification) -- setvariabledata(fontdata,"mregions",regions) end end + +function readers.dsig(f,fontdata,specification) + -- We're not going to deal with this security crap. +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx index dfb97426cda..4805ee551e6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx @@ -157,9 +157,9 @@ \permanent\protected\def\em {\relax \ifdim\slantperpoint>\zeropoint - \settrue\c_font_emphasis_needed + \c_font_emphasis_needed\conditionaltrue \else - \setfalse\c_font_emphasis_needed + \c_font_emphasis_needed\conditionalfalse \fi \font_emphasis_set_emphasis_boldface % new \ifx\fontalternative\s!it diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx index 3e6a4b2eb38..83eaddfa89a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx @@ -172,7 +172,7 @@ \edef\m_font_feature_list{\m_font_feature_list+\m_font_feature_asked}% also + at the lua end \c_font_feature_state\plusone \let\currentfeature\m_font_feature_asked - \the\everyfontfeatureswitch} + \expand\everyfontfeatureswitch} \protected\def\font_feature_subtract {\ifnum\c_font_feature_state=\minusone @@ -188,7 +188,7 @@ \edef\m_font_feature_list{\m_font_feature_list-\m_font_feature_asked}% also - at the lua end \c_font_feature_state\minusone \let\currentfeature\m_font_feature_asked - \the\everyfontfeatureswitch} + \expand\everyfontfeatureswitch} \protected\def\font_feature_replace {\ifzero\c_font_feature_state @@ -204,7 +204,7 @@ \edef\m_font_feature_list{\m_font_feature_list=\m_font_feature_asked}% also = at the lua end \c_font_feature_state\zerocount \let\currentfeature\m_font_feature_asked - \the\everyfontfeatureswitch} + \expand\everyfontfeatureswitch} \permanent\protected\def\resetfeature {\ifx\currentfeature\s!current \else @@ -239,7 +239,7 @@ \edef\m_font_feature_list{\s!current+\m_font_feature_asked}% also + at the lua end \c_font_feature_state\plusone \let\currentfeature\m_font_feature_asked - \the\everyfontfeatureswitch} + \expand\everyfontfeatureswitch} \installcorenamespace{featureshortcut} diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx index 89ec2f5c433..45799670fc1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx @@ -43,9 +43,13 @@ \permanent\protected\tolerant\protected\def\startfontclass[#class]% {\push_macro_fontclass - \doifelse{#class}\v!each - {\lettonothing\fontclass} - {\doifsomething{#class}{\def\fontclass{#class}}}} + \ifcstok{#class}\v!each + \lettonothing\fontclass + % \orelse\iftok{#class}\emptytoks + % % keep old + \else + \cdef\fontclass{#class}% + \fi} \permanent\protected\def\stopfontclass {\pop_macro_fontclass} @@ -299,59 +303,108 @@ % pre-expansion. \def\font_helpers_update_font_class_parameters - {%edef\m_font_class_direction {\begincsname\??fontclass\fontclass\fontstyle\s!direction \endcsname}% - \edef\m_font_class_features {\begincsname\??fontclass\fontclass\fontstyle\s!features \endcsname}% + {\edef\m_font_class_features {\begincsname\??fontclass\fontclass\fontstyle\s!features \endcsname}% \edef\m_font_class_fallbacks {\begincsname\??fontclass\fontclass\fontstyle\s!fallbacks \endcsname}% \edef\m_font_class_goodies {\begincsname\??fontclass\fontclass\fontstyle\s!goodies \endcsname}% \edef\m_font_class_designsize{\begincsname\??fontclass\fontclass\fontstyle\s!designsize\endcsname}} % resolve +% \def\font_helpers_set_features_yes#name% +% {\ifcsname\??fontfile\fontclass#name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse % class + symbolic_name +% \ifcsname\??fontfile #name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse % symbolic_name +% \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \orelse % class + parent_name +% \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \else % parent_name +% \lettonothing\m_font_features\fi} +% +% \def\font_helpers_set_fallbacks_yes#name% +% {\ifcsname\??fontfile\fontclass#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse +% \ifcsname\??fontfile #name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse +% \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \orelse +% \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \else +% \lettonothing\m_font_fallbacks\fi} +% +% \def\font_helpers_set_goodies_yes#name% +% {\ifcsname\??fontfile\fontclass#name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse +% \ifcsname\??fontfile #name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse +% \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \orelse +% \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \else +% \lettonothing\m_font_goodies\fi} +% +% \def\font_helpers_set_designsize_yes#name% +% {\ifcsname\??fontfile\fontclass#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse +% \ifcsname\??fontfile #name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse +% \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \orelse +% \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \else +% \lettonothing\m_font_designsize\fi} +% +% \def\font_helpers_set_features_nop#name% +% {\ifcsname\??fontfile#name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse +% \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_features_nop\lastnamedcs \else +% \lettonothing\m_font_features\fi} +% +% \def\font_helpers_set_fallbacks_nop#name% +% {\ifcsname\??fontfile#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse +% \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_fallbacks_nop\lastnamedcs \else +% \lettonothing\m_font_fallbacks\fi} +% +% \def\font_helpers_set_goodies_nop#name% +% {\ifcsname\??fontfile#name\s!goodies\endcsname \edef\m_font_goodies{\lastnamedcs}\orelse +% \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_goodies_nop\lastnamedcs \else +% \lettonothing\m_font_goodies\fi} +% +% \def\font_helpers_set_designsize_nop#name% +% {\ifcsname\??fontfile#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse +% \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_designsize_nop\lastnamedcs \else +% \lettonothing\m_font_designsize\fi} +% +% a bit less tracing: + \def\font_helpers_set_features_yes#name% - {\ifcsname\??fontfile\fontclass#name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse % class + symbolic_name - \ifcsname\??fontfile #name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse % symbolic_name + {\ifcsname\??fontfile\fontclass#name\s!features\endcsname \lettolastnamedcs\m_font_features \orelse % class + symbolic_name + \ifcsname\??fontfile #name\s!features\endcsname \lettolastnamedcs\m_font_features \orelse % symbolic_name \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \orelse % class + parent_name \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \else % parent_name \lettonothing\m_font_features\fi} \def\font_helpers_set_fallbacks_yes#name% - {\ifcsname\??fontfile\fontclass#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse - \ifcsname\??fontfile #name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse + {\ifcsname\??fontfile\fontclass#name\s!fallbacks\endcsname \lettolastnamedcs\m_font_fallbacks \orelse + \ifcsname\??fontfile #name\s!fallbacks\endcsname \lettolastnamedcs\m_font_fallbacks \orelse \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \orelse \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \else \lettonothing\m_font_fallbacks\fi} \def\font_helpers_set_goodies_yes#name% - {\ifcsname\??fontfile\fontclass#name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse - \ifcsname\??fontfile #name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse + {\ifcsname\??fontfile\fontclass#name\s!goodies \endcsname \lettolastnamedcs\m_font_goodies \orelse + \ifcsname\??fontfile #name\s!goodies \endcsname \lettolastnamedcs\m_font_goodies \orelse \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \orelse \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \else \lettonothing\m_font_goodies\fi} \def\font_helpers_set_designsize_yes#name% - {\ifcsname\??fontfile\fontclass#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse - \ifcsname\??fontfile #name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse + {\ifcsname\??fontfile\fontclass#name\s!designsize\endcsname\lettolastnamedcs\m_font_designsize \orelse + \ifcsname\??fontfile #name\s!designsize\endcsname\lettolastnamedcs\m_font_designsize \orelse \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \orelse \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \else \lettonothing\m_font_designsize\fi} \def\font_helpers_set_features_nop#name% - {\ifcsname\??fontfile#name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse + {\ifcsname\??fontfile#name\s!features\endcsname \lettolastnamedcs\m_font_features \orelse \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_features_nop\lastnamedcs \else \lettonothing\m_font_features\fi} \def\font_helpers_set_fallbacks_nop#name% - {\ifcsname\??fontfile#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse + {\ifcsname\??fontfile#name\s!fallbacks\endcsname \lettolastnamedcs\m_font_fallbacks \orelse \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_fallbacks_nop\lastnamedcs \else \lettonothing\m_font_fallbacks\fi} \def\font_helpers_set_goodies_nop#name% - {\ifcsname\??fontfile#name\s!goodies\endcsname \edef\m_font_goodies{\lastnamedcs}\orelse + {\ifcsname\??fontfile#name\s!goodies\endcsname \lettolastnamedcs\m_font_goodies \orelse \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_goodies_nop\lastnamedcs \else \lettonothing\m_font_goodies\fi} \def\font_helpers_set_designsize_nop#name% - {\ifcsname\??fontfile#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse + {\ifcsname\??fontfile#name\s!designsize\endcsname\lettolastnamedcs\m_font_designsize \orelse \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_designsize_nop\lastnamedcs \else \lettonothing\m_font_designsize\fi} @@ -374,13 +427,12 @@ % we can pack them (don't use \setxvalue!) -\permanent\protected\def\savefontclassparameters#style#rscale#features#fallbacks#goodies#designsize#direction% +\permanent\protected\def\savefontclassparameters#style#rscale#features#fallbacks#goodies#designsize% {\gletcsname\??fontclass\fontclass#style\s!rscale \endcsname#rscale% \gletcsname\??fontclass\fontclass#style\s!features \endcsname#features% \gletcsname\??fontclass\fontclass#style\s!fallbacks \endcsname#fallbacks% \gletcsname\??fontclass\fontclass#style\s!goodies \endcsname#goodies% - \gletcsname\??fontclass\fontclass#style\s!designsize\endcsname#designsize% - \gletcsname\??fontclass\fontclass#style\s!direction \endcsname#direction}% math + \gletcsname\??fontclass\fontclass#style\s!designsize\endcsname#designsize} % bonus diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-gds.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-gds.mklx index 897478273ff..431da2228f0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-gds.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-gds.mklx @@ -66,10 +66,10 @@ % \definefontfeature[husayni-colored][goodies=husayni,colorscheme=default,featureset=default] % -% \definedfont[husayni*husayni-colored at 36pt] -% % \starttext \righttoleft % +% \definedfont[husayni*husayni-colored at 36pt] +% % \setfontcolorscheme[1] % % اَلْحَمْ‍دُ لِلّٰهِ حَمْدَ مُعْتَرِفٍ بِحَمْدِهٖ، مُغْتَرِفٌ مِنْ بِحَارِ diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt index 594f4733274..ab1e65f3597 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt @@ -293,7 +293,7 @@ setmetatableindex(italics, function(t,k) -- is test ! return italics[currentfont()] else local properties = identifiers[k].properties - local hasitalics = properties and properties.hasitalics + local hasitalics = properties and properties.hasitalics or (properties.autoitalicamount and properties.autoitalicamount ~= 0) if hasitalics then hasitalics = characters[k] -- convenient return else diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-dimensions.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-dimensions.lmt new file mode 100644 index 00000000000..5a1068bce23 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-dimensions.lmt @@ -0,0 +1,177 @@ +if not modules then modules = { } end modules ['font-imp-dimensions'] = { + version = 1.001, + comment = "companion to font-ini.mkiv and hand-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local next, type, tonumber = next, type, tonumber +local ceil = math.ceil + +local fonts = fonts +local utilities = utilities + +local helpers = fonts.helpers +local prependcommands = helpers.prependcommands +local charcommand = helpers.commands.char +local rightcommand = helpers.commands.right + +local handlers = fonts.handlers +local otf = handlers.otf +local afm = handlers.afm + +local registerotffeature = otf.features.register +local registerafmfeature = afm.features.register + +local settings_to_array = utilities.parsers.settings_to_array +local gettexdimen = tex.getdimen + +-- For Wolfgang Schuster: +-- +-- \definefontfeature[thisway][default][script=hang,language=zhs,dimensions={2,2,2}] +-- \definedfont[file:kozminpr6nregular*thisway] + +local function initialize(tfmdata,key,value) + if type(value) == "string" and value ~= "" then + local characters = tfmdata.characters + local parameters = tfmdata.parameters + local emwidth = parameters.quad + local exheight = parameters.xheight + local newwidth = false + local newheight = false + local newdepth = false + local newshift = false + if value == "strut" then + newheight = gettexdimen("strutht") + newdepth = gettexdimen("strutdp") + elseif value == "mono" then + newwidth = emwidth + elseif value == "halfmono" then + newwidth = emwidth / 2 + else + -- there are fonts out there with no x_height ... + local spec = settings_to_array(value) + newwidth = spec[1] + newheight = spec[2] + newdepth = spec[3] + newshift = spec[4] + local quad = parameters.quad or 0 + local ascender = parameters.ascender or 0 + local descender = parameters.descender or 0 + if newwidth == "max" then + newwidth = quad + else + newwidth = tonumber(newwidth) + if newwidth then + newwidth = newwidth * emwidth + end + end + if newheight == "max" then + newheight = ascender + else + newheight = tonumber(newheight) + if newheight then + newheight = newheight * exheight + end + end + if newdepth == "max" then + newdepth = descender + else + newdepth = tonumber(newdepth) + if newdepth then + newdepth = newdepth * exheight + end + end + if parameters.x_heigth == 0 then + -- maybe a fourth parameter + parameters.x_heigth = (ascender + descender) / 2 + end + end + -- todo: hshift too + if newwidth or newheight or newdepth then + for unicode, character in next, characters do + local oldwidth = character.width + local oldheight = character.height + local olddepth = character.depth + local width = newwidth or oldwidth or 0 + local height = newheight or oldheight or 0 + local depth = newdepth or olddepth or 0 + if oldwidth ~= width or oldheight ~= height or olddepth ~= depth then + character.width = width +-- character.advance = oldwidth + character.height = height + character.depth = depth + if oldwidth ~= width then + -- todo: see below + local commands = character.commands + local hshift = rightcommand[newshift or ((width - oldwidth) / 2)] + if commands then + character.commands = prependcommands ( + commands, + hshift + ) + else + character.commands = { + hshift, + charcommand[unicode], + } + end + end + end + end + end + end +end + +local specification = { + name = "dimensions", + description = "force dimensions", + manipulators = { + base = initialize, + node = initialize, + } +} + +registerotffeature(specification) +registerafmfeature(specification) + +local function initialize(tfmdata,key,value) + if value then + local characters = tfmdata.characters + local parameters = tfmdata.parameters + local emwidth = parameters.quad + local factor = parameters.size/655360 + local fixedwidth = (tonumber(value) or 1)*factor*655360 + parameters.space = 2*fixedwidth +-- parameters.space = fixedwidth * ceil(parameters.space/fixedwidth) + for unicode, character in next, characters do + local oldwidth = character.width + if oldwidth ~= 0 then + local newwidth = false + if oldwidth > fixedwidth then + newwidth = fixedwidth * ceil(oldwidth/fixedwidth) + elseif oldwidth < fixedwidth then + newwidth = fixedwidth + end + if newwidth then + character.width = newwidth + character.advance = oldwidth + character.xoffset = (newwidth - oldwidth)/2 + end + end + end + end +end + +local specification = { + name = "fixedwidth", + description = "force fixed widths", + manipulators = { + base = initialize, + node = initialize, + } +} + +registerotffeature(specification) +registerafmfeature(specification) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt index f366bc89ed8..0c523deef1d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt @@ -6,13 +6,12 @@ if not modules then modules = { } end modules ['font-imp-effects'] = { license = "see context related readme files" } --- todo: pickup from goodies: if type(effect) then ... +-- upgrading musical timestamp: archive, utrecht, oct 2013 (hopefully the mix below is +-- as good as the excellent stage sound mix, and the performance as exceptional) local next, type, tonumber = next, type, tonumber -local is_boolean = string.is_boolean local fonts = fonts - local handlers = fonts.handlers local registerotffeature = handlers.otf.features.register local registerafmfeature = handlers.afm.features.register @@ -20,30 +19,160 @@ local registerafmfeature = handlers.afm.features.register local settings_to_hash = utilities.parsers.settings_to_hash_colon_too local report_effect = logs.reporter("fonts","effect") -local report_slant = logs.reporter("fonts","slant") -local report_extend = logs.reporter("fonts","extend") -local report_squeeze = logs.reporter("fonts","squeeze") local trace = false trackers.register("fonts.effect", function(v) trace = v end) -trackers.register("fonts.slant", function(v) trace = v end) -trackers.register("fonts.extend", function(v) trace = v end) -trackers.register("fonts.squeeze",function(v) trace = v end) -local function initializeslant(tfmdata,value) - value = tonumber(value) - if not value then - value = 0 - elseif value > 1 then - value = 1 - elseif value < -1 then - value = -1 +-- This will be a backend function (codeinjection). + +local effects = { + [0] = 0, [1] = 1, [2] = 2, [3] = 3, + inner = 0, + normal = 0, + outer = 1, + outline = 1, + both = 2, + hidden = 3, +} + +-- Math is to be redone, we use characters anyway ... + +local rules = { + "RadicalRuleThickness", + "OverbarRuleThickness", + "FractionRuleThickness", + "UnderbarRuleThickness", +} + +-- local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) +-- if dy ~= 0 then +-- for i=1,#rules do +-- local name = rules[i] +-- local value = mathparameters[name] +-- if value then +-- mathparameters[name] = (squeeze or 1) * (value + dy) +-- end +-- end +-- end +-- end + +local function applyeffect(tfmdata) + local effect = tfmdata.properties.effect + if effect and not effect.done then + local characters = tfmdata.characters + local parameters = tfmdata.parameters + local mathparameters = tfmdata.mathparameters + local extend = effect.extend + local squeeze = effect.squeeze + -- local slant = effect.slant + local weight = effect.weight or 0 + if weight ~= 0 then + + weight = weight / 2 + + local fraction = (parameters.designsize or parameters.size) / parameters.size + if not texconditionals["c_font_compact"] then + local f = 65536 * fraction * weight + local fw = f * 2 + local fh = f + local fd = f + local fi = f + for unicode, character in next, characters do + local v = character.width + if v and v > 0 then + if not character.advance then + character.advance = v + end + character.width = v + fw + end + v = character.height + if v and v > 0 then + character.height = v + fh + end + v = character.depth + if v and v > 0 then + character.depth = v + fd + end + v = character.italic + if v and v > 0 then + character.italic = v + fi + end + v = character.topanchor + if v and v > 0 then + character.topanchor = v + fh + end + v = character.bottomanchor + if v and v > 0 then + character.bottomanchor = v - fd + end +-- v = character.parts +-- if v then +-- for i=1,#v do +-- local vi = v[i] +-- vi.advance = vi.advance + fw +-- vi["end"] = vi["end"] + fh +-- vi.start = vi.start + fd +-- end +-- end + end +-- needs re-checking + parameters.hshift = weight * fraction + +if mathparameters then + -- when we have extensibles we need to use those widths .. engine + for i=1,#rules do + local name = rules[i] + local value = mathparameters[name] + if value then + mathparameters[name] = value + f + f -- ht and dp + end end - if trace then - report_slant("applying %0.3f",value) +end + end + effect.weight = weight -- we divided + else + effect.weight = 0 + end + effect.done = true + end +end + +-- begin of direct setters + +-- When we use the setters a composite effect is ignored. + +local function seteffect(tfmdata,key,value,min,max) + if value then + value = tonumber(value) or 0 + if not value then + value = 0 + elseif value > max then + value = max + elseif value < min then + value = min + end + local properties = tfmdata.properties + local parameters = tfmdata.parameters + local effect = properties.effect + if not effect then + effect = { } + properties.effect = effect + end + if trace then + report_effect("applying %s %0.3f",key,value) + end + effect[key] = value + effect.done = false + if key == "slant" then + properties.usedslant = value + parameters.usedslant = value + end end - tfmdata.parameters.slantfactor = value +end + +local function initializeslant(tfmdata,value) + seteffect(tfmdata,"slant",value,-1,1) end local specification = { @@ -52,25 +181,18 @@ local specification = { initializers = { base = initializeslant, node = initializeslant, - } + }, + manipulators = { + base = applyeffect, + node = applyeffect, + }, } registerotffeature(specification) registerafmfeature(specification) local function initializeextend(tfmdata,value) - value = tonumber(value) - if not value then - value = 0 - elseif value > 10 then - value = 10 - elseif value < -10 then - value = -10 - end - if trace then - report_extend("applying %0.3f",value) - end - tfmdata.parameters.extendfactor = value + seteffect(tfmdata,"extend",value,0,10) end local specification = { @@ -79,25 +201,18 @@ local specification = { initializers = { base = initializeextend, node = initializeextend, - } + }, + manipulators = { + base = applyeffect, + node = applyeffect, + }, } registerotffeature(specification) registerafmfeature(specification) local function initializesqueeze(tfmdata,value) - value = tonumber(value) - if not value then - value = 0 - elseif value > 10 then - value = 10 - elseif value < -10 then - value = -10 - end - if trace then - report_squeeze("applying %0.3f",value) - end - tfmdata.parameters.squeezefactor = value + seteffect(tfmdata,"squeeze",value,0,10) end local specification = { @@ -106,198 +221,110 @@ local specification = { initializers = { base = initializesqueeze, node = initializesqueeze, - } + }, + manipulators = { + base = applyeffect, + node = applyeffect, + }, } registerotffeature(specification) registerafmfeature(specification) -local effects = { - inner = 0, - normal = 0, - outer = 1, - outline = 1, - both = 2, - hidden = 3, -} +local function initializeweight(tfmdata,value) + seteffect(tfmdata,"weight",value,0,1) +end -local rules = { - "RadicalRuleThickness", - "OverbarRuleThickness", - "FractionRuleThickness", - "UnderbarRuleThickness", +local specification = { + name = "weight", + description = "bolden glyphs", + initializers = { + base = initializeweight, + node = initializeweight, + }, + manipulators = { + base = applyeffect, + node = applyeffect, + }, } --- radicals are not yet ok +registerotffeature(specification) +registerafmfeature(specification) -local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) - -- hm, this was "if delta ~= 0 then" but delta was gone - if dy ~= 0 then - for i=1,#rules do - local name = rules[i] - local value = mathparameters[name] - if value then - mathparameters[name] = (squeeze or 1) * (value + dy) - end - end +local function initializeoutline(tfmdata,value) + value = tonumber(value) + if not value then + value = 0 + else + value = tonumber(value) or 0 + end + local parameters = tfmdata.parameters + local properties = tfmdata.properties + if trace then + report_effect("applying outline %0.3f",value) end +-- parameters.mode = effects.outline +-- parameters.weight = value * 1000 -- todo + properties.effect = { + mode = effects.outline, + weight = value, + } end -local function initializeeffect(tfmdata,value) - local spec - if type(value) == "number" then - spec = { width = value } - else - spec = settings_to_hash(value) - end - local effect = spec.effect or "both" - local width = tonumber(spec.width) or 0 - local mode = effects[effect] - if not mode then - report_effect("invalid effect %a",effect) - elseif width == 0 and mode == 0 then - report_effect("invalid width %a for effect %a",width,effect) - else +local specification = { + name = "outline", + description = "outline glyphs", + initializers = { + base = initializeoutline, + node = initializeoutline, + }, + manipulators = { + base = applyeffect, + node = applyeffect, + }, +} + +registerotffeature(specification) +registerafmfeature(specification) + +-- end of direct setters + +local function initializeoption(tfmdata,key,value) + if value then local parameters = tfmdata.parameters local properties = tfmdata.properties - parameters.mode = mode - parameters.width = width * 1000 - if is_boolean(spec.auto) == true then - local squeeze = 1 - width/20 - local average = (1 - squeeze) * width * 100 - spec.squeeze = squeeze - spec.extend = 1 + width/2 - spec.wdelta = average - spec.hdelta = average/2 - spec.ddelta = average/2 - spec.vshift = average/2 - end - local factor = tonumber(spec.factor) or 0 - local hfactor = tonumber(spec.hfactor) or factor - local vfactor = tonumber(spec.vfactor) or factor - local delta = tonumber(spec.delta) or 1 - local wdelta = tonumber(spec.wdelta) or delta - local hdelta = tonumber(spec.hdelta) or delta - local ddelta = tonumber(spec.ddelta) or hdelta - local vshift = tonumber(spec.vshift) or 0 - local slant = spec.slant - local extend = spec.extend - local squeeze = spec.squeeze - if slant then - initializeslant(tfmdata,slant) - end - if extend then - initializeextend(tfmdata,extend) + if trace then + report_effect("applying effect %a",value) end - if squeeze then - initializesqueeze(tfmdata,squeeze) + local effect = properties.effect + if not effect then + effect = { } + properties.effect = effect end - effect = { - effect = effect, - width = width, - factor = factor, - hfactor = hfactor, - vfactor = vfactor, - wdelta = wdelta, - hdelta = hdelta, - ddelta = ddelta, - vshift = vshift, - slant = tfmdata.parameters.slantfactor, - extend = tfmdata.parameters.extendfactor, - squeeze = tfmdata.parameters.squeezefactor, - } - properties.effect = effect + effect[key] = value end end --- local show_effect = { "lua", function(f,c) --- report_effect("font id %i, char %C",f,c) --- inspect(fonts.hashes.characters[f][c]) --- end } - -local function manipulateeffect(tfmdata) - local effect = tfmdata.properties.effect - if effect then - local characters = tfmdata.characters - local parameters = tfmdata.parameters - local mathparameters = tfmdata.mathparameters - local multiplier = effect.width * 100 - local factor = parameters.factor - local hfactor = parameters.hfactor - local vfactor = parameters.vfactor - local wdelta = effect.wdelta * hfactor * multiplier - local hdelta = effect.hdelta * vfactor * multiplier - local ddelta = effect.ddelta * vfactor * multiplier - local vshift = effect.vshift * vfactor * multiplier - local squeeze = effect.squeeze - local hshift = wdelta / 2 - local dx = multiplier * vfactor - local dy = vshift - local factor = (1 + effect.factor) * factor - local hfactor = (1 + effect.hfactor) * hfactor - local vfactor = (1 + effect.vfactor) * vfactor - parameters.hshift = hshift - parameters.vshift = vshift - -- - -- For now we assume that the properties of parts wrt advance and such still - -- apply and that the extensible piece kicks in if needed. Beware of creating - -- virtual extensibles because these could get squeeze twice. - -- - -- local allparts = { } - -- for unicode, character in next, characters do - -- local parts = character.parts - -- if parts then - -- for i=1,#parts do - -- allparts[parts[i].glyph] = true - -- end - -- end - -- end - -- - for unicode, character in next, characters do - local oldwidth = character.width - local oldheight = character.height - local olddepth = character.depth - local olditalic = character.italic - local oldtopanchor = character.topanchor - local oldbottomanchor = character.bottomanchor - if oldwidth and oldwidth > 0 then - character.width = oldwidth + wdelta - end - if oldheight and oldheight > 0 then - character.height = oldheight + hdelta - end - if olddepth and olddepth > 0 then - character.depth = olddepth + ddelta - end - if olditalic or oldtopaccent or oldbottomaccent then - local factor = character.width / oldwidth - if olditalic and olditalic > 0 then - character.italic = olditalic * factor - end - if oldtopanchor and oldtopanchor > 0 then - character.topanchor = oldtopanchor * factor - end - if oldbottomanchor and oldbottomanchor > 0 then - character.bottomanchor = oldbottomanchor * factor - end - end - end - if mathparameters then - setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) +local function initializeeffect(tfmdata,value) + if tfmdata.properties.effect then + report_effect("ignored effect %a",effect) + elseif type(value) == "string" then + local specification = settings_to_hash(value) + if specification.width and not specification.weight then + specification.weight = specification.width + specification.width = nil end - parameters.factor = factor - parameters.hfactor = hfactor - parameters.vfactor = vfactor - if trace then - report_effect("applying") - report_effect(" effect : %s", effect.effect) - report_effect(" width : %s => %s", effect.width, multiplier) - report_effect(" factor : %s => %s", effect.factor, factor ) - report_effect(" hfactor : %s => %s", effect.hfactor,hfactor) - report_effect(" vfactor : %s => %s", effect.vfactor,vfactor) - report_effect(" wdelta : %s => %s", effect.wdelta, wdelta) - report_effect(" hdelta : %s => %s", effect.hdelta, hdelta) - report_effect(" ddelta : %s => %s", effect.ddelta, ddelta) + initializeextend (tfmdata,specification.extend) + initializesqueeze(tfmdata,specification.squeeze) + initializeslant (tfmdata,specification.slant) + initializeweight (tfmdata,specification.weight) + initializeoption (tfmdata,"mode",effects[specification.effect or specification.mode or "both"]) + initializeoption (tfmdata,"auto",specification.auto) + + else + value = tonumber(value) + if value then + initializeextend(tfmdata,value) end end end @@ -310,38 +337,44 @@ local specification = { node = initializeeffect, }, manipulators = { - base = manipulateeffect, - node = manipulateeffect, + base = applyeffect, + node = applyeffect, }, } registerotffeature(specification) registerafmfeature(specification) -local function initializeoutline(tfmdata,value) - value = tonumber(value) - if not value then - value = 0 - else - value = tonumber(value) or 0 +local function checkautoeffect(tfmdata) + local effect = tfmdata.properties.effect + if effect and effect.auto then + local weight = effect.weight + if weight and weight ~= 0 and not texconditionals["c_font_compact"] then + local parameters = tfmdata.parameters + local extend = effect.extend + local squeeze = effect.squeeze + local amount = 65.536 * weight + if not squeeze then -- or squeeze == 1 then + local xheight = parameters.xheight + effect.squeeze = xheight / (xheight + amount) + end + if not extend then -- or extend == 1 then + local emwidth = parameters.quad + effect.extend = emwidth / (emwidth + 2 * amount) +-- effect.extend = emwidth / (emwidth + amount) + end + end end - local parameters = tfmdata.parameters - local properties = tfmdata.properties - parameters.mode = effects.outline - parameters.width = value * 1000 - properties.effect = { - effect = effect, - width = width, - } end local specification = { - name = "outline", - description = "outline glyphs", + name = "checkautoeffect", + description = "check auto effect", + default = true, initializers = { - base = initializeoutline, - node = initializeoutline, - } + base = checkautoeffect, + node = checkautoeffect, + }, } registerotffeature(specification) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-italics.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-italics.lmt new file mode 100644 index 00000000000..f63d536ed60 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-italics.lmt @@ -0,0 +1,45 @@ +if not modules then modules = { } end modules ['font-imp-italics'] = { + version = 1.001, + comment = "companion to font-ini.mkiv and hand-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local tonumber = tonumber + +local handlers = fonts.handlers + +-- Instead of a factor we now expect an angle or just "yes". There are some fonts +-- out there that are italic but have no angle but 'fixing' that runtime is just +-- too fragile. + +local function initialize(tfmdata,value) -- hm, always value + if value then + local parameters = tfmdata.parameters + local italicangle = parameters.italicangle or 0 + if italicangle == 0 then + italicangle = tonumber(value) + end + if italicangle ~= 0 then + local properties = tfmdata.properties + if not properties.hasitalics then + -- properties.hasitalics = true -- no! + properties.useditalicangle = italicangle + parameters.useditalicangle = italicangle + end + end + end +end + +local specification = { + name = "itlc", + description = "italic correction", + initializers = { + base = initialize, + node = initialize, + } +} + +handlers.otf.features.register(specification) +handlers.afm.features.register(specification) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt index bd445caeaa2..4ec8a865e75 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt @@ -7,6 +7,7 @@ if not modules then modules = { } end modules ['font-imp-math'] = { } local next, type, tonumber = next, type, tonumber +local round = math.round local fonts = fonts local helpers = fonts.helpers @@ -16,6 +17,8 @@ local setmetatableindex = table.setmetatableindex local sortedhash = table.sortedhash local copytable = table.copy +local getmacro = token.getmacro + local texconditionals = tex.conditionals -- tfmdata.properties.mathnolimitsmode = tonumber(value) or 0 @@ -163,10 +166,23 @@ local function initialize(tfmdata,value) if mathconstants then local parameters = tfmdata.parameters local properties = tfmdata.properties - parameters.textscale = 1000 - parameters.scriptscale = mathconstants.ScriptPercentScaleDown * 10 - parameters.scriptscriptscale = mathconstants.ScriptScriptPercentScaleDown * 10 + local sizes = { + 1000, + mathconstants.ScriptPercentScaleDown * 10, + mathconstants.ScriptScriptPercentScaleDown * 10, + } + for i=1,3 do + value = getmacro("font_basics_mapped_fontsize_"..i,true) + local s = tonumber(value) + if s then + sizes[i] = s + end + end + parameters.textscale = sizes[1] + parameters.scriptscale = sizes[2] + parameters.scriptscriptscale = sizes[3] properties.compactmath = true + -- logs.report("compact math","scales: % t",sizes) end end end diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt index 6637fa07f8f..247e7f3e1da 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt @@ -145,43 +145,45 @@ local function initialize(tfmdata,value) shrink = 10 * shrink, step = 10 * step, factor = factor, + class = class, + vector = vector, } - local data = characters and characters.data - for i, chr in next, tfmdata.characters do -- todo unicode - local v = vector[i] - if data and not v then -- we could move the data test outside (needed for plain) - local d = data[i] - if d then - local s = d.shcode - if not s then - -- sorry - elseif type(s) == "table" then - v = ((vector[s[1]] or 0) + (vector[s[#s]] or 0)) / 2 - else - v = vector[s] or 0 - end - end - end - -- So, factor influences all shapes but we now obey zero when set! - if v then - if type(v) == "table" then - local e = v[1] - local c = v[2] or 0 - if e ~= 0 then - chr.expansion = e*factor - end - if c ~= 0 then - chr.compression = c*factor - end - elseif v == 0 then - -- chr.expansion = 0 - else - chr.expansion = v*factor - end - elseif factor ~= 1 then -- test is new - chr.expansion = factor - end - end +-- local data = characters and characters.data +-- for i, chr in next, tfmdata.characters do -- todo unicode +-- local v = vector[i] +-- if data and not v then -- we could move the data test outside (needed for plain) +-- local d = data[i] +-- if d then +-- local s = d.shcode +-- if not s then +-- -- sorry +-- elseif type(s) == "table" then +-- v = ((vector[s[1]] or 0) + (vector[s[#s]] or 0)) / 2 +-- else +-- v = vector[s] or 0 +-- end +-- end +-- end +-- -- So, factor influences all shapes but we now obey zero when set! +-- if v then +-- if type(v) == "table" then +-- local e = v[1] +-- local c = v[2] or 0 +-- if e ~= 0 then +-- chr.expansion = e*factor +-- end +-- if c ~= 0 then +-- chr.compression = c*factor +-- end +-- elseif v == 0 then +-- -- chr.expansion = 0 +-- else +-- chr.expansion = v*factor +-- end +-- elseif factor ~= 1 then -- test is new +-- chr.expansion = factor +-- end +-- end elseif trace_expansion then report_expansions("unknown vector %a in class %a",class.vector,value) end @@ -400,144 +402,148 @@ vectors['quality'] = table.merged( vectors['alpha'] ) --- As this is experimental code, users should not depend on it. The implications are still --- discussed on the ConTeXt Dev List and we're not sure yet what exactly the spec is (the --- next code is tested with a gyre font patched by / fea file made by Khaled Hosny). The --- double trick should not be needed it proper hanging punctuation is used in which case --- values < 1 can be used. --- --- preferred (in context, usine vectors): --- --- \definefontfeature[whatever][default][mode=node,protrusion=quality] --- --- using lfbd and rtbd, with possibibility to enable only one side : --- --- \definefontfeature[whocares][default][mode=node,protrusion=yes, opbd=yes,script=latn] --- \definefontfeature[whocares][default][mode=node,protrusion=right,opbd=yes,script=latn] +-- As with math, this kind of optimal correction is likely to be messed up when defined in a font and +-- heuristics work more reliable then. We keep this experiment around for a while but it has been +-- disabled. + +-- -- As this is experimental code, users should not depend on it. The implications are still +-- -- discussed on the ConTeXt Dev List and we're not sure yet what exactly the spec is (the +-- -- next code is tested with a gyre font patched by / fea file made by Khaled Hosny). The +-- -- double trick should not be needed it proper hanging punctuation is used in which case +-- -- values < 1 can be used. +-- -- +-- -- preferred (in context, usine vectors): +-- -- +-- -- \definefontfeature[whatever][default][mode=node,protrusion=quality] +-- -- +-- -- using lfbd and rtbd, with possibibility to enable only one side : +-- -- +-- -- \definefontfeature[whocares][default][mode=node,protrusion=yes, opbd=yes,script=latn] +-- -- \definefontfeature[whocares][default][mode=node,protrusion=right,opbd=yes,script=latn] +-- -- +-- -- idem, using multiplier +-- -- +-- -- \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn] +-- -- \definefontfeature[whocares][default][mode=node,protrusion=double,opbd=yes,script=latn] +-- -- +-- -- idem, using named feature file (less frozen): +-- -- +-- -- \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn,featurefile=texgyrepagella-regularxx.fea] -- --- idem, using multiplier +-- classes['double'] = { -- for testing opbd +-- factor = 2, +-- left = 1, +-- right = 1, +-- } -- --- \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn] --- \definefontfeature[whocares][default][mode=node,protrusion=double,opbd=yes,script=latn] --- --- idem, using named feature file (less frozen): --- --- \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn,featurefile=texgyrepagella-regularxx.fea] - -classes['double'] = { -- for testing opbd - factor = 2, - left = 1, - right = 1, -} - -local function map_opbd_onto_protrusion(tfmdata,value,opbd) - local characters = tfmdata.characters - local descriptions = tfmdata.descriptions - local properties = tfmdata.properties - local parameters = tfmdata.parameters - local resources = tfmdata.resources - local rawdata = tfmdata.shared.rawdata - local lookuphash = rawdata.lookuphash - local lookuptags = resources.lookuptags - local script = properties.script - local language = properties.language - local units = parameters.units - local done, factor, left, right = false, 1, 1, 1 - local class = classes[value] - if class then - factor = class.factor or 1 - left = class.left or 1 - right = class.right or 1 - else - factor = tonumber(value) or 1 - end - local lfactor = left * factor - local rfactor = right * factor - if trace_protrusion then - report_protrusions("left factor %0.3F, right factor %0.3F",lfactor,rfactor) - end - tfmdata.parameters.protrusion = { - factor = factor, - left = left, - right = right, - } - if opbd ~= "right" then - local validlookups, lookuplist = otf.collectlookups(rawdata,"lfbd",script,language) - if validlookups then - for i=1,#lookuplist do - local lookup = lookuplist[i] - local steps = lookup.steps - if steps then - if trace_protrusion then - report_protrusions("setting left using lfbd") - end - for i=1,#steps do - local step = steps[i] - local coverage = step.coverage - if coverage then - for k, v in next, coverage do - if v == true then - -- zero - else - local w = descriptions[k].width - local d = - v[1] - if w == 0 or d == 0 then - -- ignored - else - local p = lfactor * d/units - characters[k].leftprotrusion = p - if trace_protrusion then - report_protrusions("lfbd -> %0.3F %C",p,k) - end - end - end - end - end - end - done = true - end - end - end - end - if opbd ~= "left" then - local validlookups, lookuplist = otf.collectlookups(rawdata,"rtbd",script,language) - if validlookups then - for i=1,#lookuplist do - local lookup = lookuplist[i] - local steps = lookup.steps - if steps then - if trace_protrusion then - report_protrusions("setting right using rtbd") - end - for i=1,#steps do - local step = steps[i] - local coverage = step.coverage - if coverage then - for k, v in next, coverage do - if v == true then - -- zero - else - local w = descriptions[k].width - local d = - v[3] - if w == 0 or d == 0 then - -- ignored - else - local p = rfactor * d/units - characters[k].rightprotrusion = p - if trace_protrusion then - report_protrusions("rtbd -> %0.3F %C",p,k) - end - end - end - end - end - end - end - done = true - end - end - end -end +-- local function map_opbd_onto_protrusion(tfmdata,value,opbd) +-- local characters = tfmdata.characters +-- local descriptions = tfmdata.descriptions +-- local properties = tfmdata.properties +-- local parameters = tfmdata.parameters +-- local resources = tfmdata.resources +-- local rawdata = tfmdata.shared.rawdata +-- local lookuphash = rawdata.lookuphash +-- local lookuptags = resources.lookuptags +-- local script = properties.script +-- local language = properties.language +-- local units = parameters.units +-- local done, factor, left, right = false, 1, 1, 1 +-- local class = classes[value] +-- if class then +-- factor = class.factor or 1 +-- left = class.left or 1 +-- right = class.right or 1 +-- else +-- factor = tonumber(value) or 1 +-- end +-- local lfactor = left * factor +-- local rfactor = right * factor +-- if trace_protrusion then +-- report_protrusions("left factor %0.3F, right factor %0.3F",lfactor,rfactor) +-- end +-- tfmdata.parameters.protrusion = { +-- factor = factor, +-- left = left, +-- right = right, +-- } +-- if opbd ~= "right" then +-- local validlookups, lookuplist = otf.collectlookups(rawdata,"lfbd",script,language) +-- if validlookups then +-- for i=1,#lookuplist do +-- local lookup = lookuplist[i] +-- local steps = lookup.steps +-- if steps then +-- if trace_protrusion then +-- report_protrusions("setting left using lfbd") +-- end +-- for i=1,#steps do +-- local step = steps[i] +-- local coverage = step.coverage +-- if coverage then +-- for k, v in next, coverage do +-- if v == true then +-- -- zero +-- else +-- local w = descriptions[k].width +-- local d = - v[1] +-- if w == 0 or d == 0 then +-- -- ignored +-- else +-- local p = lfactor * d/units +-- characters[k].leftprotrusion = p +-- if trace_protrusion then +-- report_protrusions("lfbd -> %0.3F %C",p,k) +-- end +-- end +-- end +-- end +-- end +-- end +-- done = true +-- end +-- end +-- end +-- end +-- if opbd ~= "left" then +-- local validlookups, lookuplist = otf.collectlookups(rawdata,"rtbd",script,language) +-- if validlookups then +-- for i=1,#lookuplist do +-- local lookup = lookuplist[i] +-- local steps = lookup.steps +-- if steps then +-- if trace_protrusion then +-- report_protrusions("setting right using rtbd") +-- end +-- for i=1,#steps do +-- local step = steps[i] +-- local coverage = step.coverage +-- if coverage then +-- for k, v in next, coverage do +-- if v == true then +-- -- zero +-- else +-- local w = descriptions[k].width +-- local d = - v[3] +-- if w == 0 or d == 0 then +-- -- ignored +-- else +-- local p = rfactor * d/units +-- characters[k].rightprotrusion = p +-- if trace_protrusion then +-- report_protrusions("rtbd -> %0.3F %C",p,k) +-- end +-- end +-- end +-- end +-- end +-- end +-- end +-- done = true +-- end +-- end +-- end +-- end -- The opbd test is just there because it was discussed on the context development list. However, -- the mentioned fxlbi.otf font only has some kerns for digits. So, consider this feature not supported @@ -545,11 +551,11 @@ end local function initialize(tfmdata,value) if value then - local opbd = tfmdata.shared.features.opbd - if opbd then - -- possible values: left right both yes no (experimental) - map_opbd_onto_protrusion(tfmdata,value,opbd) - else + -- local opbd = tfmdata.shared.features.opbd + -- if opbd then + -- -- possible values: left right both yes no (experimental) + -- map_opbd_onto_protrusion(tfmdata,value,opbd) + -- else local class, vector = get_class_and_vector(tfmdata,value,"protrusions") if class then if vector then @@ -570,56 +576,58 @@ local function initialize(tfmdata,value) factor = factor, left = left, right = right, + class = class, + vector = vector, } - for i, chr in next, tfmdata.characters do - local v = vector[i] - local pl = nil - local pr = nil - if v then - pl = v[1] - pr = v[2] - else - local d = data[i] - if d then - local s = d.shcode - if not s then - -- sorry - elseif type(s) == "table" then - local vl = vector[s[1]] - local vr = vector[s[#s]] - if vl then pl = vl[1] end - if vr then pr = vr[2] end - else - v = vector[s] - if v then - pl = v[1] - pr = v[2] - end - end - end - end - if pl and pl ~= 0 then - local p = pl * lfactor - chr.leftprotrusion = p - if trace_protrusion then - report_protrusions("left -> %0.3F %C ",p,i) - end - end - if pr and pr ~= 0 then - local p = pr * rfactor - chr.rightprotrusion = p - if trace_protrusion then - report_protrusions("right -> %0.3F %C",p,i) - end - end - end +-- for i, chr in next, tfmdata.characters do +-- local v = vector[i] +-- local pl = nil +-- local pr = nil +-- if v then +-- pl = v[1] +-- pr = v[2] +-- else +-- local d = data[i] +-- if d then +-- local s = d.shcode +-- if not s then +-- -- sorry +-- elseif type(s) == "table" then +-- local vl = vector[s[1]] +-- local vr = vector[s[#s]] +-- if vl then pl = vl[1] end +-- if vr then pr = vr[2] end +-- else +-- v = vector[s] +-- if v then +-- pl = v[1] +-- pr = v[2] +-- end +-- end +-- end +-- end +-- if pl and pl ~= 0 then +-- local p = pl * lfactor +-- chr.leftprotrusion = p +-- if trace_protrusion then +-- report_protrusions("left -> %0.3F %C ",p,i) +-- end +-- end +-- if pr and pr ~= 0 then +-- local p = pr * rfactor +-- chr.rightprotrusion = p +-- if trace_protrusion then +-- report_protrusions("right -> %0.3F %C",p,i) +-- end +-- end +-- end elseif trace_protrusion then report_protrusions("unknown vector %a in class %a",class.vector,value) end elseif trace_protrusion then report_protrusions("unknown class %a",value) end - end + -- end end end @@ -674,3 +682,120 @@ local specification = { registerotffeature(specification) registerafmfeature(specification) + +-- + +local function addquality(id) + local tfmdata = fonts.hashes.identifiers[id] + if tfmdata then + local expansion = tfmdata.parameters.expansion + if expansion then + local class = expansion.class + local vector = expansion.vector + if class and vector then + local stretch = class.stretch or 0 + local shrink = class.shrink or 0 + local step = class.step or 0 + local factor = class.factor or 1 + local data = characters and characters.data + for i, chr in next, tfmdata.characters do -- todo unicode + local v = vector[i] + if data and not v then -- we could move the data test outside (needed for plain) + local d = data[i] + if d then + local s = d.shcode + if not s then + -- sorry + elseif type(s) == "table" then + v = ((vector[s[1]] or 0) + (vector[s[#s]] or 0)) / 2 + else + v = vector[s] or 0 + end + end + end + -- So, factor influences all shapes but we now obey zero when set! + if v then + if type(v) == "table" then + local e = v[1] + local c = v[2] or 0 + if e ~= 0 then + chr.expansion = e * factor * 1000 + end + if c ~= 0 then + chr.compression = c * factor * 1000 + end + elseif v == 0 then + -- chr.expansion = 0 + else + chr.expansion = v * factor * 1000 + end + elseif factor ~= 1 then -- test is new + chr.expansion = factor * 1000 + end + end + end + end + -- + local protrusion = tfmdata.parameters.protrusion + if protrusion then + local class = protrusion.class + local vector = protrusion.vector + if class and vector then + local factor = class.factor or 1 + local left = class.left or 1 + local right = class.right or 1 + local data = characters.data + local lfactor = left * factor + local rfactor = right * factor + for i, chr in next, tfmdata.characters do + local v = vector[i] + local pl = nil + local pr = nil + if v then + pl = v[1] + pr = v[2] + else + local d = data[i] + if d then + local s = d.shcode + if not s then + -- sorry + elseif type(s) == "table" then + local vl = vector[s[1]] + local vr = vector[s[#s]] + if vl then pl = vl[1] end + if vr then pr = vr[2] end + else + v = vector[s] + if v then + pl = v[1] + pr = v[2] + end + end + end + end + if pl and pl ~= 0 then + pl = pl * lfactor * chr.width + if trace_protrusion then + report_protrusions("left -> %0.3F %C ",pl,i) + end + chr.leftprotrusion = pl + end + if pr and pr ~= 0 then + pr = pr * rfactor * chr.width + chr.rightprotrusion = pr + if trace_protrusion then + report_protrusions("right -> %0.3F %C",pr,i) + end + end + end + end + end + -- + if expansion or protrusion then + font.addquality(id,tfmdata) + end + end +end + +callback.register("quality_font",addquality) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt index 00e3aaa50cf..7b24d6cbb99 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt @@ -28,10 +28,10 @@ local charcommand = helpers.commands.char local variables = interfaces.variables -local v_background = variables.background -local v_frame = variables.frame -local v_empty = variables.empty -local v_none = variables.none +local v_background = variables.background +local v_frame = variables.frame +local v_empty = variables.empty +local v_none = variables.none -- d:width d:height d:depth d:rulethickness b:outline b:advance b:baseline s:color @@ -143,7 +143,9 @@ local function initialize(tfmdata,key,value) rule = { rule } end for unicode, character in next, characters do - if showchar then + if characters == 32 then + -- maybe skip all spacing + elseif showchar then local commands = character.commands if commands then character.commands = prependcommands ( commands, rule ) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx index ea727bde4dc..b7c825fa516 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx @@ -12,6 +12,20 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% maybe: + +% \glyphweight +% \glyphslant +% +% in backend get from lua: (when 'true' passed) +% +% width -> width + 2 * weight +% height -> height + weight +% depth -> depth + weight +% xoffset -> xoffset - weight +% yoffset -> yoffset - weight +% weight -> weight + % todo: frozen tolerant iftok etc % todo: < 3 pt => 3pt @@ -324,14 +338,14 @@ \newtoks\t_font_tracers_definitions \permanent\protected\def\tracefontdefinitions - {\the\t_font_tracers_definitions} + {\expand\t_font_tracers_definitions} %D Some housekeeping macros: \permanent\protected\def\setfontparameters - {\setfalse\c_font_synchronize - \the\everybodyfont - \settrue\c_font_synchronize} + {\c_font_synchronize\conditionalfalse + \expand\everybodyfont + \c_font_synchronize\conditionaltrue} \mutable\lettonothing\savedfont @@ -374,7 +388,7 @@ \font_basics_define_font_without_parameters{thedefinedfont}{#specification}% \fi \thedefinedfont - \the\everydefinedfont} + \expand\everydefinedfont} %D \macros{startfont} @@ -401,10 +415,53 @@ %D local (sometimes in the textflow) size. We store these dimensions in two %D \DIMENSION\ registers. These registers are not to be misused in calculations. +%D Ascender, descender and capheight are unreliable and often wrong. One can use +%D alternatives in the OS/2 table but these then can be too large. We therefore +%D just use ( and X as template characters to derive these properties. + +% \protected\def\ShowScenders +% {\dontleavehmode +% \hpack\bgroup +% \setbox\scratchbox\hpack{(\showstruts\strut X\textbar g)}% +% {\lightgray \srule height 1fa depth 1fd width \wd\scratchbox\relax}% +% \kern-\wd\scratchbox +% \box\scratchbox +% \egroup} +% +% {\switchtobodyfont[modern,10pt] \ShowScenders}\blank +% {\switchtobodyfont[pagella,10pt] \ShowScenders}\blank +% {\switchtobodyfont[cambria,10pt] \ShowScenders}\blank + \ifdefined\globalbodyfontsize \else \newdimension\globalbodyfontsize \fi \globalbodyfontsize=12pt \ifdefined\localbodyfontsize \else \newdimension\localbodyfontsize \fi \localbodyfontsize =\globalbodyfontsize \ifdefined\bodyfontsize \else \newdimension\bodyfontsize \fi \bodyfontsize =\globalbodyfontsize +\permanent\protected\def\widthofzero{\scaledfontcharwd\font\zeroasciicode} + +% \definedatluaend\ascender +% \definedatluaend\descender +% \definedatluaend\capheight + +\pushoverloadmode + \newuserunit\globalbodyfontsize fs % normally locas is the same as em + \newuserunit\widthofzero ch % from css + \newuserunit\ascender fa + \newuserunit\descender fd + \newuserunit\capheight fc +\popoverloadmode + +% this would also work +% +% \permanent\protected\untraced\def\ascender {\dimexpr1fa\relax} +% \permanent\protected\untraced\def\descender{\dimexpr1fd\relax} +% \permanent\protected\untraced\def\capheight{\dimexpr1fc\relax} +% +% \pushoverloadmode +% \newuserunit\fontproperty fa % more a proof of concept +% \newuserunit\fontproperty fd +% \newuserunit\fontproperty fc +% \popoverloadmode + %D When we assign for instance 12pt to a \DIMENSION\ register the \type {\the}'d %D value comes out as 12.0pt, which is often not the way users specify the bodyfont %D size. Therefore we use normalized values. They are cached to save overhead in @@ -412,15 +469,26 @@ \installcorenamespace{fontnormalizedbody} +% \permanent\protected\def\normalizebodyfontsize#macro#body% +% {\expandafter\let\expandafter#macro\csname\??fontnormalizedbody\number\dimexpr#body\endcsname +% \ifrelax#macro% +% \normalizebodyfontsize_indeed#macro{#body}% +% \fi} +% +% \def\normalizebodyfontsize_indeed#macro#body% +% {\edef#macro{\clf_normalizedbodyfontsize\dimexpr#body\relax}% +% \gletcsname\??fontnormalizedbody\number\dimexpr#body\endcsname#macro} + \permanent\protected\def\normalizebodyfontsize#macro#body% - {\expandafter\let\expandafter#macro\csname\??fontnormalizedbody\number\dimexpr#body\endcsname + {\scratchdimen\ifchkdimension#body\or\lastchkdimension\else#body\dimexpr\fontbody\relax\fi + \expandafter\let\expandafter#macro\csname\??fontnormalizedbody\number\scratchdimen\endcsname \ifrelax#macro% - \normalizebodyfontsize_indeed#macro{#body}% + \normalizebodyfontsize_indeed#macro% \fi} -\def\normalizebodyfontsize_indeed#macro#body% - {\edef#macro{\clf_normalizedbodyfontsize\dimexpr#body\relax}% - \gletcsname\??fontnormalizedbody\number\dimexpr#body\endcsname#macro} +\def\normalizebodyfontsize_indeed#macro% + {\edef#macro{\clf_normalizedbodyfontsize\scratchdimen}% + \gletcsname\??fontnormalizedbody\number\scratchdimen\endcsname#macro} \permanent\def\thenormalizedbodyfontsize#body% {\clf_normalizedbodyfontsize\dimexpr#body\relax} @@ -447,7 +515,6 @@ %D \definefont[test][Serif mo 5]\test TEST \par %D \definefont[test][Serif sa d]\test TEST \par %D \definefont[test][Serif at 60pt]\test TEST \par -%D \definefont[test][Serif scaled 6000]\test TEST \par %D \stopbuffer %D %D \typebuffer @@ -456,17 +523,9 @@ %D \getbuffer %D \stoppacked -\installcorenamespace{mappedfontsize} - -% \permanent\tolerant\protected\def\mapfontsize[#from]#spacer[#to]% -% {\ifarguments\or\or\defcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname{#to}\fi} -% -% \def\font_basics_set_mapped_fontsize#from% -% {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname -% \lastnamedcs\else#from% -% \fi} +%D Size mapping only applies to math fonts. -% will become: mapmathfontsize +\installcorenamespace{mappedfontsize} %letcsname\??mappedfontsize\s!text \endcsname\!!plusone \letcsname\??mappedfontsize\s!script \endcsname\!!plustwo @@ -491,7 +550,7 @@ \endcsname{#to}% \fi} -\permanent\tolerant\protected\def\checkedmapfontsize[#class]#spacer[#from]#spacer[#to]% +\permanent\tolerant\protected\def\checkedmapfontsize[#class]#spacer[#from]#spacer[#to]% used in typescripts {\ifcsname\??mappedfontsize#class:\begincsname\??mappedfontsize#from\endcsname\endcsname % keep (user) value \else @@ -514,6 +573,52 @@ #from% \fi} +\appendtoks + \def\font_basics_set_mapped_fontsize#from% + {\ifcsname\??mappedfontsize\fontclass:\fontface\endcsname % really ? + \the\dimexpr\lastnamedcs\dimexpr\normalizedbodyfontsize\relax\relax + \else % we could use default + #from% + \fi}% +\to \everycompactfontmode + +% \defcsname font_basics_mapped_fontsize_1\endcsname{\begincsname\??mappedfontsize\fontclass:1\endcsname} +% \defcsname font_basics_mapped_fontsize_2\endcsname{\begincsname\??mappedfontsize\fontclass:2\endcsname} +% \defcsname font_basics_mapped_fontsize_3\endcsname{\begincsname\??mappedfontsize\fontclass:3\endcsname} + +% Somehow moving rscale into here doesn't work out ok, so for now we don't do that +% +% \the\floatexpr\v_font_size_relative*\plusthousand\relax + +\defcsname font_basics_mapped_fontsize_1\endcsname + {\the\plusthousand} + +\defcsname font_basics_mapped_fontsize_2\endcsname + {\the\numexpr + \plusthousand + *\dimexpr + \ifcsname\??mappedfontsize\fontclass:2\endcsname + \lastnamedcs\dimexpr\textface\relax + \else + \scriptface + \fi + \relax + /\dimexpr\textface\relax + \relax} + +\defcsname font_basics_mapped_fontsize_3\endcsname + {\the\numexpr + \plusthousand + *\dimexpr + \ifcsname\??mappedfontsize\fontclass:3\endcsname + \lastnamedcs\dimexpr\textface\relax + \else + \scriptscriptface + \fi + \relax + /\dimexpr\textface\relax + \relax} + \installcorenamespace{fontbodyknown} \installcorenamespace{fontclassyes} % fontclass \installcorenamespace{fontclassnop} % nofontclass @@ -561,7 +666,7 @@ \v_font_rscale_default \fi} -\def\font_helpers_register_fontbody#body% +\protected\def\font_helpers_register_fontbody#body% {\letcsname\??fontbodyknown#body\endcsname\empty} %D \macros @@ -591,9 +696,9 @@ \setnewmacro\m_font_size_command \gobbleoneargument \setnewmacro\m_font_alternative_command\gobbleoneargument -\def\font_helpers_process_style_list #command{\def\m_font_style_command {#command}\the\t_font_style_commands} -\def\font_helpers_process_size_list #command{\def\m_font_size_command {#command}\the\t_font_size_commands} -\def\font_helpers_process_alternative_list#command{\def\m_font_alternative_command{#command}\the\t_font_alternative_commands} +\def\font_helpers_process_style_list #command{\def\m_font_style_command {#command}\expand\t_font_style_commands} +\def\font_helpers_process_size_list #command{\def\m_font_size_command {#command}\expand\t_font_size_commands} +\def\font_helpers_process_alternative_list#command{\def\m_font_alternative_command{#command}\expand\t_font_alternative_commands} \def\font_helpers_register_style #style{\letcsname\??fontstyleknown #style\endcsname\empty} \def\font_helpers_register_size #size{\letcsname\??fontsizeknown #size\endcsname\empty} @@ -608,7 +713,7 @@ \def\font_basics_define_fontstyle_indeed#style#command% {\defcsname\??fontshortstyle#command\endcsname{#style}% - \defcsname\??fontstyle #command\endcsname{\csname#style\endcsname}} + \defcsname\??fontstyle #command\endcsname{\csname#style\endcsname}} % we could pre-expand \permanent\protected\def\definefontsize[#size]% {\ifcsname\??fontsizeknown#size\endcsname \else @@ -728,16 +833,15 @@ \aliased\let\c_font_feature_inheritance_fontfirst \plusthree % fontfirst \aliased\let\c_font_feature_inheritance_classfirst\plusfour % classfirst -\aliased\let\c_font_feature_inheritance_default \c_font_feature_inheritance_fontfirst +\aliased\let\c_font_feature_inheritance_default\c_font_feature_inheritance_fontfirst -\setnewconstant\c_font_feature_inheritance_mode \c_font_feature_inheritance_default +\setnewconstant\c_font_feature_inheritance_mode\c_font_feature_inheritance_default \newdimension \d_font_scaled_text_face \newdimension \d_font_scaled_font_size \newconditional\c_font_body_scale \newfraction \f_font_body_scale -\newconditional\c_font_compact \newinteger \c_font_scaled_glyph_scale \immutable\dimensiondef\d_font_scaled_default 10pt @@ -765,15 +869,9 @@ \lettonothing\m_font_fallbacks \lettonothing\m_font_goodies -\protected\def\font_helpers_low_level_define - {\ifconditional\c_font_compact - \expandafter\font_helpers_low_level_define_compact - \else - \expandafter\font_helpers_low_level_define_normal - \fi} - -\protected\def\font_helpers_low_level_define_normal#specification#csname% - {% we can now set more at the lua end +\protected\def\font_helpers_low_level_define#specification#csname% normal mode + {\font_ignore_compact_font_mode + % we can now set more at the lua end \glet\somefontname\defaultfontfile \lettonothing\somefontsize \lettonothing\somefontsizex @@ -781,7 +879,8 @@ \clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen % sets \scaledfontmode and \somefontname and \somefontsize \ifcase\fontface\relax - % \let\v_font_size_absolute\textface % fontbody + % this was commented but we need it in order to be compatible to compact mode + \let\v_font_size_absolute\textface \or \let\v_font_size_absolute\textface \or @@ -795,9 +894,6 @@ \fi % \ifcase\scaledfontmode\relax - % mkiv, fails with glyphscale: - % \d_font_scaled_font_size-\plusthousand\scaledpoint - % so we just assume \d_font_scaled_font_size\d_font_default_size \or % at @@ -811,7 +907,7 @@ \d_font_scaled_font_size\font_basics_set_mapped_fontsize\v_font_size_absolute \d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size \or - % scaled, don't use this one as it's unpredictable + % scaled, don't use this one as it's unpredictable (we fallback on scaled 1200 -> sa 1.2) \d_font_scaled_font_size-\somefontsize\scaledpoint \else % ht cp % experiment, yet undocumented @@ -865,12 +961,17 @@ \let\lastrawfontcall\relax \mutable\letcsname#csname\endcsname\relax \else - \edef\somefontspec{at \number\scaledfontsize sp}% we need the resolved designsize (for fallbacks) + \edef\somefontspec{at \number\scaledfontsize sp}% we need the resolved designsize (for fallbacks) % \the\scaledfontsize \expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname - \the\everydefinefont + \expand\everydefinefont \fi \c_font_feature_inheritance_mode\c_font_feature_inheritance_default} +\mutable\lettonothing\somefontslant +\mutable\lettonothing\somefontweight +\mutable\lettonothing\somefontextend +\mutable\lettonothing\somefontsqueeze + \protected\def\font_helpers_low_level_define_compact#specification#csname% {% we can now set more at the lua end \glet\somefontname\defaultfontfile @@ -878,42 +979,24 @@ \lettonothing\somefontsizex \lettonothing\somefontsizey \clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen - % sets \scaledfontmode and \somefontname and \somefontsize - \ifcase\fontface\relax - % \let\v_font_size_absolute\textface % fontbody - \or - \let\v_font_size_absolute\textface - \or - \let\v_font_size_absolute\scriptface - \or - \let\v_font_size_absolute\scriptscriptface - \or - \let\v_font_size_absolute\xtextface - \or - \let\v_font_size_absolute\xxtextface - \fi % \ifcase\scaledfontmode\relax - % mkiv, fails with glyphscale: - % \d_font_scaled_font_size-\plusthousand\scaledpoint - % so we just assume \d_font_scaled_font_size\d_font_default_size \or % at \d_font_scaled_font_size\somefontsize \or % sa - \d_font_scaled_font_size\v_font_size_absolute\relax + \d_font_scaled_font_size\textface \d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size % uses \somefontsize set by lua \or % mo - \d_font_scaled_font_size\font_basics_set_mapped_fontsize\v_font_size_absolute + \d_font_scaled_font_size\font_basics_set_mapped_fontsize\textface \d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size \or - % scaled, don't use this one as it's unpredictable + % scaled, don't use this one as it's unpredictable (we fallback on scaled 1200 -> sa 1.2) \d_font_scaled_font_size-\somefontsize\scaledpoint \else % ht cp - % experiment, yet undocumented \d_font_scaled_font_size\somefontsize \fi \relax @@ -938,10 +1021,6 @@ \scaledfontmode\zerocount \fi \c_font_future_glyph_scale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax - % \glyphscale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax % needed ? for math i guess - \glyphscale\numexpr\c_font_future_glyph_scale % needed ? for math i guess - % \d_font_scaled_font_size\d_font_scaled_default - % \d_font_scaled_text_face\d_font_scaled_default % \edef\somefontspec{at \number\d_font_scaled_font_size sp}% % this has to happen at the tex end ... @@ -963,7 +1042,7 @@ \m_font_features \m_font_class_fallbacks \m_font_fallbacks - \fontface + \zerocount \d_font_scaled_default \m_font_class_goodies \m_font_goodies @@ -977,83 +1056,82 @@ \let\lastrawfontcall\relax \mutable\letcsname#csname\endcsname\relax \else - \edef\somefontspec{at \number\scaledfontsize sp}% we need the resolved designsize (for fallbacks) + \edef\somefontspec{at \number\scaledfontsize sp}% we need the resolved designsize (for fallbacks) % \the\scaledfontsize % - \glyphscale - \ifnum\c_font_scaled_font_mode_saved>\plusfour - % \c_font_scaled_points is set when we pass the font to the engine - \numexpr\plusthousand*\dimexpr\d_font_scaled_default\relax/\c_font_scaled_points\relax - \else - \c_font_future_glyph_scale - \fi - % experiment + \glyphscale\c_font_future_glyph_scale \glyphxscale\ifempty\somefontsizex\plusthousand\else\somefontsizex\fi\relax \glyphyscale\ifempty\somefontsizey\plusthousand\else\somefontsizey\fi\relax - % experiment + % \expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname \ifrelax\lastrawfontcall \lettonothing\somefontspec \else - % - % \ifempty\fontclass\else\global\fi - % \mutable\protected\edefcsname#csname\endcsname - % {\setfontid\the\fontid\csname#csname\endcsname\relax - % \glyphscale\the\glyphscale\relax - % \somefontsizex - % \somefontsizey}% - % \expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname - % - % \mutable\protected\edef\lastrawfontcall - % {\setfontid\the\fontid\csname#csname\endcsname\relax - % \glyphscale\the\glyphscale\relax - % \somefontsizex - % \somefontsizey}% - % \mutable\ifempty\fontclass\letcsname\else\gletcsname\fi#csname\endcsname\lastrawfontcall - % + \ifempty\somefontextend \else\glyphxscale\somefontextend \relax\fi + \ifempty\somefontsqueeze\else\glyphyscale\somefontsqueeze\relax\fi + \glyphslant \ifempty\somefontslant \zerocount\else\somefontslant \fi\relax + \glyphweight\ifempty\somefontweight\zerocount\else\somefontweight\fi\relax \mutable\fontspecdef\lastrawfontcall \lastnamedcs - % scale \glyphscale - % xscale \glyphxscale - % yscale \glyphyscale - all \glyphscale \glyphxscale \glyphyscale + all \glyphscale \glyphxscale \glyphyscale \glyphslant \glyphweight \relax \mutable\ifempty\fontclass\letcsname\else\gletcsname\fi#csname\endcsname\lastrawfontcall - % - \the\everydefinefont + \expand\everydefinefont \fi \fi \c_font_feature_inheritance_mode\c_font_feature_inheritance_default} +\appendtoks + \enforced\let\font_helpers_low_level_define\font_helpers_low_level_define_compact +\to \everycompactfontmode + \def\font_helpers_check_body_scale#fontsize% gets character (x xx a etc) - {\ifcsname\??fontenvironments\fontclass\fontbody#fontsize\endcsname - \expandafter\let\expandafter\f_font_body_scale\lastnamedcs - \setfalse\c_font_body_scale % ! + {\ifcsname\??fontenvironments\fontclass:\fontstyle\fontbody#fontsize\endcsname + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionalfalse % ! + \orelse\ifcsname\??fontenvironments\fontclass:\fontstyle\s!default#fontsize\endcsname + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionaltrue + \orelse\ifcsname\??fontenvironments\fontclass\fontbody#fontsize\endcsname + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionalfalse % ! \orelse\ifcsname\??fontenvironments\fontclass\s!default#fontsize\endcsname - \expandafter\let\expandafter\f_font_body_scale\lastnamedcs - \settrue\c_font_body_scale + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionaltrue + % bonus: + \orelse\ifcsname\??fontenvironments\fontclass\s!default\s!parent\endcsname + \ifcsname\??fontenvironments\lastnamedcs#fontsize\endcsname + \lettolastnamedcs\f_font_body_scale + \else + \let\f_font_body_scale\plusone + \fi + \c_font_body_scale\conditionaltrue + % + \orelse\ifcsname\??fontenvironments\fontbody:\fontstyle#fontsize\endcsname + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionalfalse % ! \orelse\ifcsname\??fontenvironments\fontbody#fontsize\endcsname - \expandafter\let\expandafter\f_font_body_scale\lastnamedcs - \setfalse\c_font_body_scale % ! + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionalfalse % ! \orelse\ifcsname\??fontenvironments\s!default#fontsize\endcsname - \expandafter\let\expandafter\f_font_body_scale\lastnamedcs - \settrue\c_font_body_scale + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionaltrue \orelse\ifcsname\??fontenvironments\fontclass\s!default\s!text\endcsname - \expandafter\let\expandafter\f_font_body_scale\lastnamedcs - \settrue\c_font_body_scale + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionaltrue \orelse\ifcsname\??fontenvironments\s!default\s!text\endcsname - \expandafter\let\expandafter\f_font_body_scale\lastnamedcs - \settrue\c_font_body_scale + \lettolastnamedcs\f_font_body_scale + \c_font_body_scale\conditionaltrue \else \let\f_font_body_scale\plusone - \settrue\c_font_body_scale + \c_font_body_scale\conditionaltrue \fi} \newif\ifskipfontcharacteristics \skipfontcharacteristicstrue % \tracingfonts\plussix % -%D When fontclasses are used, we define the font global, since namespaces are -%D used. Otherwise we parse the specs each time. +%D When fontclasses are used, we define the font global, since namespaces are used. +%D Otherwise we parse the specs each time. \mutable\let\fontfile\s!unknown @@ -1097,7 +1175,7 @@ \ifdefined\everyfont \else \newtoks\everyfont \fi \ifdefined\everyfontswitch \else \newtoks\everyfontswitch \fi -\permanent\def\setfontcharacteristics{\the\everyfont} +\permanent\def\setfontcharacteristics{\expand\everyfont} % \appendtoks % \ifcase\c_fonts_auto_language @@ -1118,7 +1196,6 @@ %D %D \starttyping %D \definefont[Some][LucidaBright at 100pt] \Some some -%D \definefont[More][LucidaBright scaled 3000] \More more %D \definefont[Nice][LucidaBright mo 2] \Nice nice %D \definefont[Text][LucidaBright sa 5.4] \Text last %D \stoptyping @@ -1132,10 +1209,17 @@ \expandafter\font_basics_define_font_b \fi[#1][#2][#3]} +% \def\font_basics_define_font_a[#name][#specification][#settings]% [name][spec][1.6 | line=10pt | setup_id] +% {\doifelsesetups{#settings}% +% {\mutable\protected\defcsname#name\endcsname{\font_basics_define_font_with_setups {#name}{#specification}{#settings}}} +% {\mutable\protected\defcsname#name\endcsname{\font_basics_define_font_with_parameters{#name}{#specification}{#settings}}}} + \def\font_basics_define_font_a[#name][#specification][#settings]% [name][spec][1.6 | line=10pt | setup_id] - {\doifelsesetups{#settings}% - {\mutable\protected\defcsname#name\endcsname{\font_basics_define_font_with_setups {#name}{#specification}{#settings}}} - {\mutable\protected\defcsname#name\endcsname{\font_basics_define_font_with_parameters{#name}{#specification}{#settings}}}} + {\ifsetups{#settings}% + \mutable\protected\defcsname#name\endcsname{\font_basics_define_font_with_setups {#name}{#specification}{#settings}}% + \else + \mutable\protected\defcsname#name\endcsname{\font_basics_define_font_with_parameters{#name}{#specification}{#settings}}% + \fi} \def\font_basics_define_font_b[#name][#specification][#dummy]% {\mutable\protected\defcsname#name\endcsname{\font_basics_define_font_without_parameters{#name}{#specification}}} @@ -1147,7 +1231,7 @@ \def\font_basics_define_font_with_setups#name#specification#settings% {\font_basics_define_font_without_parameters{#name}{#specification}% - \setups[#settings]} + \directsetup{#settings}} %D Beware, in the frozen variants no settings are supported yet, but that might happen %D some day. @@ -1172,7 +1256,7 @@ \ifdefined\??fontinstancebasic \else \installcorenamespace{fontinstancebasic} \fi \ifdefined\??fontinstanceclass \else \installcorenamespace{fontinstanceclass} \fi -\newconditional\c_font_auto_size \settrue\c_font_auto_size +\newconditional\c_font_auto_size \c_font_auto_size\conditionaltrue \mutable\lettonothing\lastfontidentifier @@ -1182,23 +1266,29 @@ \let\v_font_identifier_basic_saved\v_font_identifier_basic \let\v_font_identifier_class_saved\v_font_identifier_class -% \def\v_font_identifier_class{\??fontinstanceclass\fontclass-\lastfontidentifier-\fontstyle-\fontsize} % no \fontface +\appendtoks + \def\v_font_identifier_basic{\??fontinstancebasic \lastfontidentifier-\fontsize}% + \def\v_font_identifier_class{\??fontinstanceclass\fontclass-\lastfontidentifier-\fontsize}% + % + \let\v_font_identifier_basic_saved\v_font_identifier_basic + \let\v_font_identifier_class_saved\v_font_identifier_class +\to \everycompactfontmode \def\font_basics_define_font_without_parameters#identifier#2% {\relax % intercept lookahead, in case we scan for a number \c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly - \edef\lastfontidentifier{#identifier}% + \cdef\lastfontidentifier{#identifier}% \let\v_font_size_relative\v_font_rscale_default \let\v_font_size_absolute\fontbody \font_helpers_low_level_define{#2}\v_font_identifier_basic \csname\v_font_identifier_basic\endcsname - \setfalse\c_font_auto_size - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch + \c_font_auto_size\conditionalfalse + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch \let\v_font_identifier_basic\v_font_identifier_basic_saved} \protected\def\font_helpers_trigger#identifier% make a traced variant - {\edef\lastfontidentifier{#identifier}% + {\cdef\lastfontidentifier{#identifier}% \ifcsname\v_font_identifier_class\endcsname % \writestatus{fonts}{trigger: reusing \v_font_identifier_class}% \expandafter\font_helpers_trigger_reuse @@ -1212,19 +1302,19 @@ \def\v_font_size_absolute{#absolute}% \font_helpers_low_level_define{#specification}\v_font_identifier_class \csname\v_font_identifier_class\endcsname - \setfalse\c_font_auto_size + \c_font_auto_size\conditionalfalse \ifskipfontcharacteristics \else - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch \fi \let\v_font_identifier_class\v_font_identifier_class_saved} \def\font_helpers_trigger_reuse#relative#absolute#specification% {\csname\v_font_identifier_class\endcsname - \setfalse\c_font_auto_size + \c_font_auto_size\conditionalfalse \ifskipfontcharacteristics \else - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch \fi \let\v_font_identifier_class\v_font_identifier_class_saved} @@ -1237,9 +1327,26 @@ \installcorenamespace{fontenvironments} +% \permanent\def\currentfontbodysize % gets number (the normal sa 1 etc) +% {\ifcsname\??fontenvironments\fontclass\s!default\somefontsize\endcsname +% \lastnamedcs +% \orelse\ifcsname\??fontenvironments\s!default\somefontsize\endcsname +% \lastnamedcs +% \else +% \somefontsize +% \fi} + \permanent\def\currentfontbodysize % gets number (the normal sa 1 etc) - {\ifcsname\??fontenvironments\fontclass\s!default\somefontsize\endcsname + {\ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\somefontsize\endcsname + \lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass\s!default\somefontsize\endcsname \lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass\s!default\s!parent\endcsname + \ifcsname\??fontenvironments\lastnamedcs\somefontsize\endcsname + \lastnamedcs + \else + \somefontsize + \fi \orelse\ifcsname\??fontenvironments\s!default\somefontsize\endcsname \lastnamedcs \else @@ -1248,46 +1355,46 @@ \permanent\def\currentfontbodyscale % gets character (x xx a etc) {\csname\??fontenvironments - \ifcsname\??fontenvironments\fontclass\s!default\fontsize\endcsname\fontclass\s!default\fontsize\orelse - \ifcsname\??fontenvironments \s!default\fontsize\endcsname \s!default\fontsize\orelse - \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\fontclass\s!default\s!text \orelse - \ifcsname\??fontenvironments \s!default\s!text \endcsname \s!default\s!text \else - \s!default \fi + \ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\fontsize\endcsname\fontclass:\fontstyle\s!default\fontsize\orelse + \ifcsname\??fontenvironments\fontclass \s!default\fontsize\endcsname\fontclass \s!default\fontsize\orelse + \ifcsname\??fontenvironments \s!default\fontsize\endcsname \s!default\fontsize\orelse + \ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\s!text \endcsname\fontclass:\fontstyle\s!default\s!text \orelse + \ifcsname\??fontenvironments\fontclass \s!default\s!text \endcsname\fontclass \s!default\s!text \orelse + \ifcsname\??fontenvironments \s!default\s!text \endcsname \s!default\s!text \else + \s!default \fi \endcsname} -\def\font_currentfontbodyscale % gets character (x xx a etc) - {\ifcsname\??fontenvironments\fontclass\s!default\fontsize\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments \s!default\fontsize\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments \s!default\s!text \endcsname\lastnamedcs\else - \csname\??fontenvironments \s!default \endcsname \fi} - \permanent\def\currentfontscale % used in default definition {\csname\??fontenvironments - \ifcsname\??fontenvironments\fontclass\s!default\xfontsize\endcsname\fontclass\s!default\fontsize\orelse - \ifcsname\??fontenvironments \s!default\xfontsize\endcsname \s!default\fontsize\orelse - \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\fontclass\s!default\s!text \orelse - \ifcsname\??fontenvironments \s!default\s!text \endcsname \s!default\s!text \else - \s!default \fi + \ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\wildcardfontsize\endcsname\fontclass:\fontstyle\s!default\fontsize\orelse + \ifcsname\??fontenvironments\fontclass \s!default\wildcardfontsize\endcsname\fontclass \s!default\fontsize\orelse + \ifcsname\??fontenvironments \s!default\wildcardfontsize\endcsname \s!default\fontsize\orelse + \ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\s!text \endcsname\fontclass:\fontstyle\s!default\s!text \orelse + \ifcsname\??fontenvironments\fontclass \s!default\s!text \endcsname\fontclass \s!default\s!text \orelse + \ifcsname\??fontenvironments \s!default\s!text \endcsname \s!default\s!text \else + \s!default \fi \endcsname} +% \def\font_currentfontbodyscale % gets character (x xx a etc) +% {\ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\fontsize\endcsname\lastnamedcs\orelse +% \ifcsname\??fontenvironments\fontclass \s!default\fontsize\endcsname\lastnamedcs\orelse +% \ifcsname\??fontenvironments \s!default\fontsize\endcsname\lastnamedcs\orelse +% \ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\s!text \endcsname\lastnamedcs\orelse +% \ifcsname\??fontenvironments\fontclass \s!default\s!text \endcsname\lastnamedcs\orelse +% \ifcsname\??fontenvironments \s!default\s!text \endcsname\lastnamedcs\else +% \csname\??fontenvironments \s!default \endcsname \fi} + \def\font_currentfontscale % used in default definition - {\ifcsname\??fontenvironments\fontclass\s!default\xfontsize\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments \s!default\xfontsize\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments \s!default\s!text \endcsname\lastnamedcs\else - \csname\??fontenvironments \s!default \endcsname \fi} + {\ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\wildcardfontsize\endcsname\lastnamedcs\orelse + \ifcsname\??fontenvironments\fontclass \s!default\wildcardfontsize\endcsname\lastnamedcs\orelse + \ifcsname\??fontenvironments \s!default\wildcardfontsize\endcsname\lastnamedcs\orelse + \ifcsname\??fontenvironments\fontclass:\fontstyle\s!default\s!text \endcsname\lastnamedcs\orelse + \ifcsname\??fontenvironments\fontclass \s!default\s!text \endcsname\lastnamedcs\orelse + \ifcsname\??fontenvironments \s!default\s!text \endcsname\lastnamedcs\else + \csname\??fontenvironments \s!default \endcsname \fi} \defcsname\??fontenvironments\s!default\endcsname{1} -%D In the following macros we use \type {\currentxfontsize} to hold the current -%D x||size of the font. This enables us to support for instance \type {\sl} inside a -%D \type {\tx} switch. - -\newconstant\currentxfontsize - -\permanent\def\xfontsize{\ifcase\currentxfontsize\fontsize\or\s!x\else\s!xx\fi} - %D Now we enter the area of font switching. The switching mechanism has to take care %D of several situations, like: %D @@ -1373,54 +1480,105 @@ % todo: class:size % todo: make assignments global +% \setupbodyfontenvironment [all] [12pt] [x=4pt,small=4pt] +% \setupbodyfontenvironment [pagella] [12pt] [x=4pt,small=4pt] +% +% \setupbodyfont[pagella,12pt] +% +% \starttext normal {\tx tx} {\small small} \stoptext + \letcsname\??fontenvironments\endcsname\empty % so we default to empty \permanent\def\bodyfontvariable#parameter% {\begincsname\??fontenvironments - \ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\fontclass\normalizedbodyfontsize#parameter\orelse - \ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse - \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname \normalizedbodyfontsize#parameter\orelse - \ifcsname\??fontenvironments\s!default #parameter\endcsname\s!default #parameter\fi + \ifcsname\??fontenvironments\fontclass:\fontstyle\normalizedbodyfontsize#parameter\endcsname\fontclass:\fontstyle\normalizedbodyfontsize#parameter% + \orelse\ifcsname\??fontenvironments\fontclass \normalizedbodyfontsize#parameter\endcsname\fontclass \normalizedbodyfontsize#parameter% + \orelse\ifcsname\??fontenvironments\fontclass:\fontstyle #parameter\endcsname\fontclass:\fontstyle #parameter% + \orelse\ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter% + \orelse\ifcsname\??fontenvironments\fontclass \s!default \s!parent\endcsname\lastnamedcs #parameter% + \orelse\ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname \normalizedbodyfontsize#parameter% + \orelse\ifcsname\??fontenvironments \s!default #parameter\endcsname\s!default #parameter\fi \endcsname} -\def\font_bodyfontvariable#parameter% - {\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi} - \permanent\def\bodyfontsizevariable#size#parameter% used in s-fonts-show {\begincsname\??fontenvironments - \ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\fontclass#size#parameter\orelse - \ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse - \ifcsname\??fontenvironments\v!all #size#parameter\endcsname\v!all #size#parameter\orelse - \ifcsname\??fontenvironments #size#parameter\endcsname #size#parameter\orelse - \ifcsname\??fontenvironments\s!default #parameter\endcsname\s!default #parameter\fi + \ifcsname\??fontenvironments\fontclass:\fontstyle#size#parameter\endcsname\fontclass:\fontstyle#size#parameter% + \orelse\ifcsname\??fontenvironments\fontclass #size#parameter\endcsname\fontclass #size#parameter% + \orelse\ifcsname\??fontenvironments\fontclass:\fontstyle #parameter\endcsname\fontclass:\fontstyle#parameter% + \orelse\ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter% + \orelse\ifcsname\??fontenvironments\fontclass \s!default \s!parent\endcsname\lastnamedcs #parameter% + \orelse\ifcsname\??fontenvironments #size#parameter\endcsname #size#parameter% + \orelse\ifcsname\??fontenvironments \s!default #parameter\endcsname\s!default #parameter\fi \endcsname} \def\font_bodyfontvariable#parameter% - {\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\v!all \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi} + {\ifcsname\??fontenvironments\fontclass:\fontstyle\normalizedbodyfontsize#parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass \normalizedbodyfontsize#parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass:\fontstyle #parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass\s!default \s!parent\endcsname\begincsname\??fontenvironments\lastnamedcs#parameter\endcsname + \orelse\ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments \s!default #parameter\endcsname\lastnamedcs\fi} \def\font_bodyfontsizevariable#size#parameter% - {\ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments #size#parameter\endcsname\lastnamedcs\orelse - \ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi} + {\ifcsname\??fontenvironments\fontclass:\fontstyle #size#parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass #size#parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass:\fontstyle #parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\fontclass\s!default \s!parent\endcsname\begincsname\??fontenvironments\lastnamedcs#parameter\endcsname + \orelse\ifcsname\??fontenvironments #size#parameter\endcsname\lastnamedcs + \orelse\ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi} -\permanent\def\bodyfontinterlinespace{\bodyfontvariable\c!interlinespace} % used elsewhere +\permanent\def\currentbodyfontdimension#parameter% there can be factors here + {\the\dimexpr + \ifcsname\??fontenvironments\fontclass:\fontstyle\normalizedbodyfontsize#parameter\endcsname + \orelse\ifcsname\??fontenvironments\fontclass:\fontstyle\s!default #parameter\endcsname + \orelse\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname + \orelse\ifcsname\??fontenvironments\fontclass\s!default#parameter\endcsname + % bonus: + \orelse\ifcsname\??fontenvironments\fontclass\s!default\s!parent\endcsname + \ifcsname\??fontenvironments\lastnamedcs#parameter\endcsname\fi + % + \orelse\ifcsname\??fontenvironments\normalizedbodyfontsize#parameter\endcsname + \orelse\ifcsname\??fontenvironments\s!default#parameter\endcsname + \fi + \lastnamedcs + \ifchkdim\lastnamedcs\or\else + \dimexpr\normalizedbodyfontsize\relax % we need a cheaper one + \fi + \relax} \permanent\def\bodyfontdimension#class#size#parameter#body% {\the\dimexpr - \ifcsname\??fontenvironments #class#size#parameter\endcsname \lastnamedcs \orelse - \ifcsname\??fontenvironments#class\s!default#parameter\endcsname \lastnamedcs\dimexpr#body\relax\orelse % factor - \ifcsname\??fontenvironments #size#parameter\endcsname \lastnamedcs \else - \lastnamedcs\dimexpr#body\relax\fi % factor + \ifcsname\??fontenvironments#class:\fontstyle#size#parameter\endcsname + \orelse\ifcsname\??fontenvironments#class:\fontstyle\s!default#parameter\endcsname + \orelse\ifcsname\??fontenvironments#class#size#parameter\endcsname + \orelse\ifcsname\??fontenvironments#class\s!default#parameter\endcsname + % bonus: + \orelse\ifcsname\??fontenvironments#class\s!default\s!parent\endcsname + \ifcsname\??fontenvironments\lastnamedcs#parameter\endcsname\fi + % + \orelse\ifcsname\??fontenvironments#size#parameter\endcsname + \orelse\ifcsname\??fontenvironments\s!default#parameter\endcsname + \fi + \lastnamedcs + \ifchkdim\lastnamedcs\or\else + \dimexpr#body\relax % we need a cheaper one + \fi \relax} +%D In the following macros we use \type {\currentxfontsize} to hold the current +%D x||size of the font. This enables us to support for instance \type {\sl} inside a +%D \type {\tx} switch. + +\newconstant\currentxfontsize + +\permanent\def\wildcardfontsize {\ifcase\currentxfontsize\fontsize\or\s!x\else\s!xx\fi} +\permanent\def\wildcardfontscale{\normalexpanded{\noexpand\bodyfontvariable{\ifcase\currentxfontsize\fontsize\or\s!x\else\s!xx\fi}}} + +\permanent\def\bodyfontinterlinespace{\bodyfontvariable \c!interlinespace} % used elsewhere +%permanent\def\bodyfontinterlinespace{\font_bodyfontvariable\c!interlinespace} % used elsewhere + \installcorenamespace{fontenvironmentknown} \def\font_helpers_register_environment#class#body% @@ -1429,7 +1587,7 @@ \newmacro\m_font_body \newmacro\m_font_body_normalized -\permanent\tolerant\protected\def\definebodyfontenvironment[#1]#*[#2]#*[#3]% todo +\permanent\tolerant\protected\def\definebodyfontenvironment[#1]#*[#2]#*[#3]#*[#4]% {\ifarguments \expandafter\font_basics_define_body_font_environment_unset \or @@ -1438,7 +1596,9 @@ \expandafter\font_basics_define_body_font_environment_empty \or \expandafter\font_basics_define_body_font_environment_class - \fi[#1][#2][#3]} + \or + \expandafter\font_basics_define_body_font_environment_detail + \fi[#1][#2][#3][#4]} \aliased\let\setupbodyfontenvironment\definebodyfontenvironment @@ -1452,30 +1612,35 @@ \permanent\def\bodyfontenvironmentlist {\clf_getbodyfontsizes} -\def\font_basics_define_body_font_environment_class[#class][#body][#settings]% +\def\font_basics_define_body_font_environment_detail[#class][#style][#body][#settings]% + {\font_basics_define_body_font_environment_class[#class:#style][#body][#settings][]} + +\def\font_basics_define_body_font_environment_class[#class][#body][#settings][#dummy]% {\edef\m_font_body{#body}% - \ifx\m_font_body\s!default - % these are the last resort within a class - \getrawparameters[\??fontenvironments#class\s!default][#settings]% - \else + \ifchkdim\m_font_body\or \normalizebodyfontsize\m_font_body_normalized\m_font_body \font_basics_define_body_font_environment_size[#class][\m_font_body_normalized][#settings]% \clf_registerbodyfontsize{\m_font_body_normalized}% + \orelse\ifhastok={#settings}% + \getparameters[\??fontenvironments#class#body][#settings]% old fashioned setter + \else + \setvalue{\??fontenvironments#class#body\s!parent}{#settings}% old fashioned setter + %\getparameters[\??fontenvironments#class#body][\s!parent=#settings]% old fashioned setter \fi} %D The empty case uses the same code but needs to ignore the current class settings %D (just to be sure, as it's not really needed). -\def\font_basics_define_body_font_environment_empty[#body][#settings][#dummy]% +\def\font_basics_define_body_font_environment_empty[#body][#settings][#dummya][#dummyb]% {\push_macro_fontclass \lettonothing\fontclass - \font_basics_define_body_font_environment_class[][#body][#settings]% + \font_basics_define_body_font_environment_class[][#body][#settings][#dummya]% \pop_macro_fontclass} -\def\font_basics_define_body_font_environment_unset[#body][#dummya][#dummyb]% +\def\font_basics_define_body_font_environment_unset[#body][#dummya][#dummyb][#dummyc]% {\push_macro_fontclass \lettonothing\fontclass - \font_basics_define_body_font_environment_class[][#body][]% + \font_basics_define_body_font_environment_class[][#body][][]% \pop_macro_fontclass} %D We don't check too soon as we can refer to later definitions. @@ -1483,16 +1648,16 @@ \newconditional\c_font_defining_environment_state % controls messages \def\font_basics_define_body_font_environment_size[#class][#normalizedbody][#settings]% normalized body - {\getrawparameters[\??fontenvironments#class#normalizedbody][#settings]% + {\getparameters[\??fontenvironments#class#normalizedbody][#settings]% \ifcsname\??fontenvironmentknown#class#normalizedbody\endcsname % environment and size already defined \orelse\ifproductionrun \push_macro_fontclass - \edef\fontclass{#class}% + \cdef\fontclass{#class}% \font_helpers_register_environment{#class}{#normalizedbody}% - \settrue\c_font_defining_environment_state + \c_font_defining_environment_state\conditionaltrue \font_helpers_define_unknown_font{#normalizedbody}% current class - \setfalse\c_font_defining_environment_state + \c_font_defining_environment_state\conditionalfalse \pop_macro_fontclass \fi \font_helpers_register_fontbody{#normalizedbody}} @@ -1549,10 +1714,10 @@ %D sl=cmsl12, %D bi=cmbxti10 at 12pt, %D bs=cmbxsl10 at 12pt, -%D tfa=cmr12 scaled 1.200, -%D tfb=cmr12 scaled 1.440, -%D tfc=cmr12 scaled 1.728, -%D tfd=cmr12 scaled 2.074, +%D tfa=cmr12 sa a, % scaled 1.200 dropped from lmtx +%D tfb=cmr12 sa b, % scaled 1.440 dropped from lmtx +%D tfc=cmr12 sa c, % scaled 1.728 dropped from lmtx +%D tfd=cmr12 sa d, % scaled 2.074 dropped from lmtx %D sc=cmcsc10 at 12pt] %D %D \definebodyfont [12pt,11pt,10pt,9pt,8pt] [rm] @@ -1562,11 +1727,11 @@ %D sl=lbsl sa 1, %D bi=lbdi sa 1, %D bs=lbdi sa 1, -%D tfa=lbr sa 1.200, -%D tfb=lbr sa 1.440, -%D tfc=lbr sa 1.728, -%D tfd=lbr sa 2.074, -%D sc=lbr sa 0.833] +%D tfa=lbr sa a, % scaled 1.200 dropped from lmtx +%D tfb=lbr sa b, % scaled 1.440 dropped from lmtx +%D tfc=lbr sa c, % scaled 1.728 dropped from lmtx +%D tfd=lbr sa d, % scaled 2.074 dropped from lmtx +%D sc=lbr sa x] % scaled 0.833 dropped from lmtx %D \stoptyping %D %D The second example shows that we can define more sizes at once. The main @@ -1614,16 +1779,25 @@ \protected\def\font_basics_define_body_font[#whatever]% {\doifelsenumber{#whatever}\font_basics_define_body_font_body\font_basics_define_body_font_name[#whatever]} +% \protected\def\font_basics_define_body_font[#whatever]% +% {\ifchknum#whatever\or +% \expandafter\font_basics_define_body_font_body +% \else +% \expandafter\font_basics_define_body_font_name +% \fi[#whatever]} + \protected\def\font_basics_define_body_font_class_given[#1][#2][#3]#4% {\push_macro_fontclass - \doifelse{#4}\s!default - {\lettonothing\fontclass} - {\def\fontclass{#4}}% + \ifcstok{#4}\s!default + \lettonothing\fontclass + \else + \cdef\fontclass{#4}% + \fi \definebodyfont[#1][#2][#3]% \pop_macro_fontclass} \protected\def\font_basics_define_body_font_body[#body][#style][#specification]% - {\ifcondition\validassignment{#specification}% + {\ifhastok={#specification}% \expandafter\font_basics_define_body_font_body_assignment \else \expandafter\font_basics_define_body_font_body_identifier @@ -1631,7 +1805,7 @@ [#body][#style][#specification]}% \protected\def\font_basics_define_body_font_name[#name][#style][#specification]% - {\ifcondition\validassignment{#specification}% + {\ifhastok={#specification}% \expandafter\font_basics_define_body_font_name_assignment \else \expandafter\font_basics_define_body_font_name_identifier @@ -1726,6 +1900,22 @@ {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest-5}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}% } +\appendtoks + % the undefined need checking here + \protected\def\font_basics_define_body_font_nop_xx[#one#two#rest=#value]% local + {\ifcsname\m_font_asked_style#one#two#rest\endcsname\else\font_basics_check_fontname_combination\m_font_asked_style{#one#two}{#rest}\fi + \letcsname\??fontinstanceclass\m_font_asked_body-\m_font_asked_style-#one#two-#rest\endcsname\undefined + \protected\edefcsname\??fontinstanceready\m_font_asked_body-\m_font_asked_style-#one#two-#rest\endcsname + {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest}{\noexpand\font_rscale_xx{\m_font_asked_style}}{\m_font_asked_body}{\normalunexpanded{#value}}}% + }% + \protected\def\font_basics_define_body_font_yes_xx[#one#two#rest=#value]% global + {\ifcsname\m_font_asked_style#one#two#rest\endcsname\else\font_basics_check_fontname_combination\m_font_asked_style{#one#two}{#rest}\fi + \gletcsname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest\endcsname\undefined + \protected\xdefcsname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest\endcsname + {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}% + }% +\to \everycompactfontmode + % \writestatus{fonts}{define \m_asked_style\space yes: {\expandafter\meaning\csname\fontclass\m_font_asked_body\m_font_asked_style#one#two#rest\endcsname} %D Here the rest concerns rl or lr so in this case it is not a size specifier but @@ -1753,6 +1943,19 @@ {\font_helpers_trigger{\m_font_asked_body-\s!mm-#one#two#rest}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}% } +\appendtoks + \protected\def\font_basics_define_body_font_nop_mm[#one#two#rest=#value]% local + {\letcsname\??fontinstanceclass\m_font_asked_body-\s!mm-#one#two#rest\endcsname\undefined + \protected\xdefcsname\??fontinstanceready\m_font_asked_body-\s!mm-#one#two#rest\endcsname + {\font_helpers_trigger{\m_font_asked_body-\s!mm-#one#two#rest}{\noexpand\font_rscale_mm}{\m_font_asked_body}{\normalunexpanded{#value}}}% + }% + \protected\def\font_basics_define_body_font_yes_mm[#one#two#rest=#value]% global + {\gletcsname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest\endcsname\undefined + \protected\xdefcsname\??fontinstanceready\fontclass-\m_font_asked_body-\s!mm-#one#two#rest\endcsname + {\font_helpers_trigger{\m_font_asked_body-\s!mm-#one#two#rest}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}% + }% +\to \everycompactfontmode + % \writestatus{fonts}{define \m_asked_style\space yes: \expandafter\meaning\csname\fontclass\m_font_asked_body\m_font_asked_style#one#two#rest\endcsname}% \protected\def\font_basics_define_body_font_body_identifier[#bodylist][#stylelist][#name]% @@ -1793,32 +1996,35 @@ \protected\def\font_helpers_define_unknown_font#body% one level only {\font_helpers_register_fontbody{#body}% prevents loop, can go - \setfalse\c_font_defining_state + \c_font_defining_state\conditionalfalse \font_helpers_process_relative_size_list{\font_helpers_define_unknown_check_sizes{#body}}% \ifconditional\c_font_defining_state - \setfalse\c_font_defining_state + \c_font_defining_state\conditionalfalse \font_helpers_process_style_list{\font_helpers_define_unknown_check_definitions{#body}}% \ifconditional\c_font_defining_state \ifconditional\c_font_defining_environment_state\else %\showmessage\m!fonts{14}{#body}% main \clf_registerunknownbodysize{#body}% \fi - \setfalse\c_font_defining_state + \c_font_defining_state\conditionalfalse \font_helpers_register_fontbody{#body}% % needed ? - \ifconditional\c_font_defining_unknown - \else - \settrue\c_font_defining_unknown - \font_helpers_process_relative_size_list{\font_helpers_define_unknown_check_relatives{#body}}% - \setfalse\c_font_defining_unknown - \fi +% +% Otherwise no math when we define [class][style][size] +% +% \ifconditional\c_font_defining_unknown +% \else +% \c_font_defining_unknown\conditionaltrue +% \font_helpers_process_relative_size_list{\font_helpers_define_unknown_check_relatives{#body}}% +% \c_font_defining_unknown\conditionalfalse +% \fi \fi \fi} \def\font_helpers_define_unknown_check_sizes#body#relativesize% {\ifcsname\??fontenvironments\s!default#relativesize\endcsname % fontclass ? \expandafter\normalizebodyfontsize\csname\??fontenvironments#body#relativesize\endcsname{\csname\??fontenvironments\s!default#relativesize\endcsname\dimexpr#body\relax}% - \settrue\c_font_defining_state + \c_font_defining_state\conditionaltrue \fi} \def\font_helpers_define_unknown_check_definitions#body#style% @@ -1826,13 +2032,13 @@ \edef\m_font_asked_body{#body}% \edef\m_font_asked_style{#style}% \lastnamedcs - \settrue\c_font_defining_state + \c_font_defining_state\conditionaltrue \fi} \def\font_helpers_define_unknown_check_relatives#body#relativesize% {\ifcsname\??fontbodyknown\csname\??fontenvironments#body#relativesize\endcsname\endcsname \else \expandafter\font_helpers_define_unknown_font\csname\??fontenvironments#body#relativesize\endcsname - \settrue\c_font_defining_state + \c_font_defining_state\conditionaltrue \fi} \protected\def\font_basics_define_body_font_default#assignments% @@ -1858,26 +2064,31 @@ \font_helpers_check_bodyfont_environment\normalizedbodyfontsize\normalizedbodyfontsize % !! \else \showmessage\m!fonts4{#body}% - \fi - \ifconditional\c_font_compact - \glyphscale\numexpr\plushundred*\dimexpr\normalizedbodyfontsize\relax/\maxcard\relax \fi} -% \prependtoks -% \ifconditional\c_font_compact -% % better in lua ... accuracy -% \glyphtextscale \numexpr\plusthousand*\dimexpr\textface \relax/\d_font_scaled_default\relax -% \glyphscriptscale \numexpr\plusthousand*\dimexpr\scriptface \relax/\d_font_scaled_default\relax -% \glyphscriptscriptscale \numexpr\plusthousand*\dimexpr\scriptscriptface\relax/\d_font_scaled_default\relax -% \fi -% \to \everymathematics +\appendtoks + \protected\def\font_basics_switch_points#body% + {\ifcsname\??fontbodyknown#body\endcsname \else + % we need to check the relative sizes for this body + \font_helpers_define_unknown_font{#body}% + \fi% + \ifcsname\??fontbodyknown#body\endcsname % always true now + \font_basics_complete_switch{#body}% + \localbodyfontsize#body\relax + \normalizebodyfontsize\normalizedbodyfontsize\localbodyfontsize + \font_helpers_check_bodyfont_environment\normalizedbodyfontsize\normalizedbodyfontsize % !! + \else + \showmessage\m!fonts4{#body}% + \fi + \glyphscale\numexpr\plushundred*\dimexpr\normalizedbodyfontsize\relax/\maxcard\relax} +\to \everycompactfontmode \protected\def\font_basics_switch_style#style% {\ifcsname\??fontstyle#style\endcsname \lastnamedcs - \edef\fontstyle{#style}% + \cdef\fontstyle{#style}% \ifmmode\mr\fi % in order to be compatible with \rm in math mode - % \the\everybodyfont % cleaner, in setting size as well as style + % \expand\everybodyfont % cleaner, in setting size as well as style \else \showmessage\m!fonts5{#style}% \fi} @@ -1892,9 +2103,9 @@ \ifempty\m_font_specification \else \ifx\m_font_specification\v!global % we can have all kind of presets \restoreglobalbodyfont - \else - \processcommacommand[\m_font_specification]{\font_helpers_set_font_check_size}% + \else % order swapped per nov 2023 \processcommacommand[\m_font_specification]{\font_helpers_set_font_set_font{#method}}% + \processcommacommand[\m_font_specification]{\font_helpers_set_font_check_size}% \ifproductionrun \font_preloads_at_definition \font_basics_switch_points\normalizedbodyfontsize @@ -1908,16 +2119,21 @@ \fi} \def\font_helpers_set_font_check_size#option% - {\doifelsenumber{#option}{\font_helpers_check_bodyfont_environment{#option}{#option}}\donothing} + {\ifchkdimension#option\or + \font_helpers_check_bodyfont_environment{#option}{#option}% + \fi} \def\font_helpers_set_font_set_font#method#option% method=1: set, method=2: switch - {\doifsomething{#option}{\font_helpers_set_font_set_font_option{#method}{#option}}} + {\ifempty{#option}\else + \font_helpers_set_font_set_font_option{#method}{#option}% + \fi} \def\font_helpers_set_font_set_font_option#method#option% - {\doifelsenumber{#option}% - \font_helpers_set_font_set_font_option_body - \font_helpers_set_font_set_font_option_keyword - {#method}{#option}{#option}} + {\ifchkdimension#option\or + \expandafter\font_helpers_set_font_set_font_option_body + \else + \expandafter\font_helpers_set_font_set_font_option_keyword + \fi{#method}{#option}{#option}} \newmacro\m_font_keyword @@ -1959,12 +2175,14 @@ % we need to check the fontclass -\permanent\def\registerfontclass#class% +\permanent\protected\def\registerfontclass#class% {\gletcsname\??fontclassyes#class\endcsname\v!yes} % global ? -\permanent\def\setcurrentfontclass#class% - {\ifcsname\??fontclassyes#class\endcsname - \edef\fontclass{#class}% +\permanent\protected\def\setcurrentfontclass#class% + {\ifcsname\??bodyfontalias#class\endcsname + \constant\lettolastnamedcs\fontclass + \orelse\ifcsname\??fontclassyes#class\endcsname + \cdef\fontclass{#class}% \orelse\ifcsname\??fontclassnop#class\endcsname % already tried \else % too messy: \ifcase\currentgrouplevel % (unpredictable) @@ -1981,15 +2199,15 @@ %D So far for synchronisation. (We can inline the following macros.) \permanent\protected\def\setcurrentfont#body#style#alternative#size% not used - {\edef\fontbody {#body}% - \edef\fontstyle {#style}% - \edef\fontalternative{#alternative}% - \edef\fontsize {#size}% + {\cdef\fontbody {#body}% + \cdef\fontstyle {#style}% + \cdef\fontalternative{#alternative}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization \font_helpers_synchronize_font} \permanent\protected\def\setcurrentfontbody#body% % not used - {\edef\fontbody{#body}% + {\cdef\fontbody{#body}% \font_helpers_synchronize_font} % For Taco: optional fall backs: @@ -1999,67 +2217,105 @@ \fi \protected\def\font_helpers_set_current_font_style#style% - {\edef\fontstyle{#style}% + {\cdef\fontstyle{#style}% \font_typescripts_inherit_check\fontstyle \ifmmode\mr\fi % otherwise \rm not downward compatible ... not adapted yet \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_xsize_alternative#xsize#alternative% - {\edef\fontface{#xsize}% - \edef\fontalternative{#alternative}% + {\cdef\fontface{#xsize}% + \cdef\fontalternative{#alternative}% \font_helpers_synchronize_font} +\appendtoks +% \protected\def\font_helpers_set_current_xsize_alternative#xsize#alternative% +% {\cdef\fontface{0}% % not used in compact mode +% \cdef\fontalternative{#alternative}% +% \ifnum#xsize=\plusfour % best just pass the number +% \currentxfontsize\plusone +% \else +% \currentxfontsize\plustwo +% \fi +% \font_helpers_synchronize_font}% + \protected\def\font_helpers_set_current_xsize_alternative#xsize#alternative% + {\cdef\fontface{0}% % not used in compact mode + \cdef\fontalternative{#alternative}% + \currentxfontsize#xsize\relax + \font_helpers_synchronize_font}% +\to \everycompactfontmode + \protected\def\font_helpers_set_current_font_alternative#alternative% - {\edef\fontalternative{#alternative}% + {\cdef\fontalternative{#alternative}% \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_size#size% - {\edef\fontsize{#size}% + {\cdef\fontsize{#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_style_alternative#style#alternative% \rmsl - {\edef\fontstyle {#style}% - \edef\fontalternative{#alternative}% + {\cdef\fontstyle {#style}% + \cdef\fontalternative{#alternative}% \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_style_size#style#size% \rma - {\edef\fontstyle{#style}% - \edef\fontsize {#size}% + {\cdef\fontstyle{#style}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_alternative_size#alternative#size% \sla - {\edef\fontalternative{#alternative}% - \edef\fontsize {#size}% + {\cdef\fontalternative{#alternative}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_style_alternative_size#style#alternative#size% \rmsla - {\edef\fontstyle {#style}% - \edef\fontalternative{#alternative}% - \edef\fontsize {#size}% + {\cdef\fontstyle {#style}% + \cdef\fontalternative{#alternative}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} -\protected\def\font_helpers_synchronize_font % we can have dups i.e. no need to let fontstrategy +\protected\def\font_helpers_synchronize_font {\ifempty\fontclass \applyfontstrategies \else \applyfontclassstrategies \fi - \setfalse\c_font_auto_size - \ifskipfontcharacteristics - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch + \c_font_auto_size\conditionalfalse + \ifskipfontcharacteristics \else + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch \fi} +\appendtoks + \protected\def\font_helpers_synchronize_font + {\ifempty\fontclass + \applyfontstrategies + \else + \applyfontclassstrategies + \fi + \c_font_auto_size\conditionalfalse + \ifcase\currentxfontsize + % nothing + \or + \normaltx + \else + \normaltxx + \fi + \ifskipfontcharacteristics \else + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch + \fi}% +\to \everycompactfontmode + %D This is the resolver for special cases (sizes) and in practice it is not called %D that often so further optimization makes no sense. \def\font_helpers_check_strategy_class_a % --- --- --- --- % pt tt bf a {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\fontalternative-\fontsize-\fontface\endcsname - \setfalse\c_font_auto_size + \c_font_auto_size\conditionalfalse \lastnamedcs \else \expandafter\font_helpers_check_strategy_class_b @@ -2067,7 +2323,7 @@ \def\font_helpers_check_strategy_class_b % --- --- --- def % pt tt bf {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\fontalternative-\defaultfontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \else \expandafter\font_helpers_check_strategy_class_c @@ -2075,7 +2331,7 @@ \def\font_helpers_check_strategy_class_c % --- --- def --- % pt tt tf a {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\defaultfontalternative-\fontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \else \expandafter\font_helpers_check_strategy_class_d @@ -2083,7 +2339,7 @@ \def\font_helpers_check_strategy_class_d % --- --- def def % pt tt tf {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \else \expandafter\font_helpers_check_strategy_class_e @@ -2091,7 +2347,7 @@ \def\font_helpers_check_strategy_class_e % --- def def def % pt rm tf {\ifcsname\??fontinstanceready\fontclass-\fontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname - \setfalse\c_font_auto_size + \c_font_auto_size\conditionalfalse \lastnamedcs \else \expandafter\font_helpers_check_strategy_class_f @@ -2099,17 +2355,67 @@ \def\font_helpers_check_strategy_class_f % def def def def % rm tf {\ifcsname\??fontinstanceready\fontclass-\defaultfontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \else \expandafter\font_helpers_check_strategy_a \fi} +\appendtoks + \def\font_helpers_check_strategy_class_a % --- --- --- --- % pt tt bf a + {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\fontalternative-\fontsize\endcsname + \c_font_auto_size\conditionalfalse + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_class_b + \fi}% + % + \def\font_helpers_check_strategy_class_b % --- --- --- def % pt tt bf + {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\fontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_class_c + \fi}% + % + \def\font_helpers_check_strategy_class_c % --- --- def --- % pt tt tf a + {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\defaultfontalternative-\fontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_class_d + \fi}% + % + \def\font_helpers_check_strategy_class_d % --- --- def def % pt tt tf + {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\defaultfontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_class_e + \fi}% + % + \def\font_helpers_check_strategy_class_e % --- def def def % pt rm tf + {\ifcsname\??fontinstanceready\fontclass-\fontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionalfalse + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_class_f + \fi}% + % + \def\font_helpers_check_strategy_class_f % def def def def % rm tf + {\ifcsname\??fontinstanceready\fontclass-\defaultfontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_a + \fi}% +\to \everycompactfontmode + % no class \def\font_helpers_check_strategy_a % --- --- --- --- % pt tt bf a {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\fontalternative-\fontsize-\fontface\endcsname - \setfalse\c_font_auto_size + \c_font_auto_size\conditionalfalse \lastnamedcs \else \expandafter\font_helpers_check_strategy_b @@ -2117,7 +2423,7 @@ \def\font_helpers_check_strategy_b % --- --- --- --- % pt tt bf a {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\fontalternative-\defaultfontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \else \expandafter\font_helpers_check_strategy_c @@ -2125,7 +2431,7 @@ \def\font_helpers_check_strategy_c % --- --- --- --- % pt tt bf a {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\defaultfontalternative-\fontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \else \expandafter\font_helpers_check_strategy_d @@ -2133,7 +2439,7 @@ \def\font_helpers_check_strategy_d % --- --- --- --- % pt tt bf a {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \else \expandafter\font_helpers_check_strategy_e @@ -2141,7 +2447,7 @@ \def\font_helpers_check_strategy_e % --- --- --- --- % pt tt bf a {\ifcsname\??fontinstanceready\fontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname - \setfalse\c_font_auto_size + \c_font_auto_size\conditionalfalse \lastnamedcs \else \expandafter\font_helpers_check_strategy_f @@ -2149,16 +2455,69 @@ \def\font_helpers_check_strategy_f % --- --- --- --- % pt tt bf a {\ifcsname\??fontinstanceready\defaultfontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname - \settrue\c_font_auto_size + \c_font_auto_size\conditionaltrue \lastnamedcs \fi} +\appendtoks + \def\font_helpers_check_strategy_a % --- --- --- --- % pt tt bf a + {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\fontalternative-\fontsize\endcsname + \c_font_auto_size\conditionalfalse + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_b + \fi}% + % + \def\font_helpers_check_strategy_b % --- --- --- --- % pt tt bf a + {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\fontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_c + \fi}% + % + \def\font_helpers_check_strategy_c % --- --- --- --- % pt tt bf a + {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\defaultfontalternative-\fontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_d + \fi}% + % + \def\font_helpers_check_strategy_d % --- --- --- --- % pt tt bf a + {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\defaultfontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_e + \fi}% + % + \def\font_helpers_check_strategy_e % --- --- --- --- % pt tt bf a + {\ifcsname\??fontinstanceready\fontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionalfalse + \lastnamedcs + \else + \expandafter\font_helpers_check_strategy_f + \fi}% + % + \def\font_helpers_check_strategy_f % --- --- --- --- % pt tt bf a + {\ifcsname\??fontinstanceready\defaultfontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize\endcsname + \c_font_auto_size\conditionaltrue + \lastnamedcs + \fi}% +\to \everycompactfontmode + \permanent\let\applyfontstrategies \font_helpers_check_strategy_a \permanent\let\applyfontclassstrategies\font_helpers_check_strategy_class_a +\appendtoks + \enforced\permanent\let\applyfontstrategies \font_helpers_check_strategy_a + \enforced\permanent\let\applyfontclassstrategies\font_helpers_check_strategy_class_a +\to \everycompactfontmode + %D Let's synchronize: -\newconditional\c_font_synchronize \settrue\c_font_synchronize +\newconditional\c_font_synchronize \c_font_synchronize\conditionaltrue \prependtoks \ifconditional\c_font_synchronize @@ -2173,6 +2532,62 @@ %D the values defined by the bodyfontenvironment are used. Here we also set \type %D {\currentxfontsize}. +\permanent\protected\def\resettx + {\ifzeronum\currentxfontsize\else + \currentxfontsize\zerocount + \enforced\let\tx\normaltx + \enforced\let\txx\normaltxx + %\enforced\let\sx\normalsx + %\enforced\let\sxx\normalsxx + \let\fontsize\empty + \font_scale_defined + %\font_helpers_check_big_math_synchronization + %\font_helpers_synchronize_font + \fi} + +% \prependtoks +% \currentxfontsize\zerocount +% \enforced\let\tx \normaltx +% \enforced\let\txx\normaltxx +% \to \everysetupbodyfont + +% \prependtoks +% \currentxfontsize\zerocount +% \enforced\let\tx \normaltx +% \enforced\let\txx\normaltxx +% \to \everyswitchtobodyfont + +% \appendtoks +\prependtoks + \currentxfontsize\zerocount + \enforced\let\tx \normaltx + \enforced\let\txx\normaltxx + \font_scale_defined +\to \everysetupbodyfont + +\prependtoks +% \appendtoks + \currentxfontsize\zerocount + \enforced\let\tx \normaltx + \enforced\let\txx\normaltxx + \font_scale_defined +\to \everyswitchtobodyfont + +% \appendtoks +% \enforced\permanent\protected\def\resettx +% {\ifzeronum\currentxfontsize\else +% \currentxfontsize\zerocount +% \enforced\let\tx\normaltx +% \enforced\let\txx\normaltxx +% \let\fontsize\empty +% %\enforced\let\sx\normalsx +% %\enforced\let\sxx\normalsxx +% \font_scale_defined +% %\font_helpers_check_big_math_synchronization +% %\font_helpers_synchronize_font +% \fi}% +% \to \everycompactfontmode + \def\font_helpers_set_current_font_xxx_alternative#alternative#xsize#scriptstyle% {\ifmmode #scriptstyle% @@ -2180,29 +2595,43 @@ \font_helpers_set_current_xsize_alternative{#xsize}{#alternative}% \fi} -\def\font_helpers_reset_x_fontsize - {\ifcase\currentxfontsize\else - \currentxfontsize\zerocount - % also \sx and \sxx ? - \enforced\let\tx \normaltx - \enforced\let\txx\normaltxx - \fi} +% \def\font_helpers_reset_x_fontsize +% {\ifcase\currentxfontsize\else +% \currentxfontsize\zerocount +% % also \sx and \sxx ? +% \enforced\let\tx \normaltx +% \enforced\let\txx\normaltxx +% \fi} -\let\font_helpers_check_nested_x_fontsize\relax +% \let\font_helpers_check_nested_x_fontsize\relax \def\font_helpers_set_current_font_x_alternative#alternative% - {\font_helpers_check_nested_x_fontsize + {%\font_helpers_check_nested_x_fontsize \font_helpers_set_current_font_xxx_alternative{#alternative}{4}\scriptstyle \currentxfontsize\plusone \enforced\let\tx\txx} \def\font_helpers_set_current_font_xx_alternative#alternative% - {\font_helpers_check_nested_x_fontsize + {%\font_helpers_check_nested_x_fontsize \font_helpers_set_current_font_xxx_alternative{#alternative}{5}\scriptscriptstyle \currentxfontsize\plustwo \enforced\lettonothing\tx \enforced\lettonothing\txx} +\appendtoks + \def\font_helpers_set_current_font_x_alternative#alternative% + {%\font_helpers_check_nested_x_fontsize + \currentxfontsize\plusone + \font_helpers_set_current_font_xxx_alternative{#alternative}\plusone\scriptstyle + \enforced\let\tx\txx}% + \def\font_helpers_set_current_font_xx_alternative#alternative% + {%\font_helpers_check_nested_x_fontsize + \currentxfontsize\plusone + \font_helpers_set_current_font_xxx_alternative{#alternative}\plustwo\scriptscriptstyle + \enforced\lettonothing\tx + \enforced\lettonothing\txx}% +\to \everycompactfontmode + %D This alternative is not really needed, but for old time's sake we keep it there. %D We can speed it up when needed. @@ -2230,135 +2659,48 @@ %D Setting the main size involves the style list and therefore takes a bit more %D time. Keep in mind that the fontsize is represented by a character or empty. -\installcorenamespace{fontscalex} -\installcorenamespace{fontscalexx} - -\newconditional\c_font_inherit_scale - -\def\font_scale_inherit_normal#1% - {\begingroup - \scratchcounterone\fontid\font\relax - \currentxfontsize\plusone - \normalexpanded{\definedfont[\clf_specifiedfont\scratchcounterone\font_currentfontscale\relax]}% - \scratchcountertwo\fontid\font\relax - \currentxfontsize\plustwo - \normalexpanded{\definedfont[\clf_specifiedfont\scratchcounterone\font_currentfontscale\relax]}% - \scratchcounterthree\fontid\font\relax - % parent -> x -> xx - % parent -> xx - \global\expandafter\integerdef\csname\??fontscalex \number\scratchcounterone\endcsname\scratchcountertwo - \global\expandafter\integerdef\csname\??fontscalexx\number\scratchcounterone\endcsname\scratchcounterthree - \global\expandafter\integerdef\csname\??fontscalex \number\scratchcountertwo\endcsname\scratchcounterthree - \global\expandafter\integerdef\csname\??fontscalexx\number\scratchcountertwo\endcsname\scratchcounterthree - \endgroup - \setfontid\csname#1\number\fontid\font\endcsname} - -\def\font_scale_inherit_normal_x - {\ifcsname\??fontscalex\number\fontid\font\endcsname - \setfontid\lastnamedcs - \else - \font_scale_inherit_normal\??fontscalex - \fi - \ifskipfontcharacteristics - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch - \fi} - -\def\font_scale_inherit_normal_xx - {\ifcsname\??fontscalexx\number\fontid\font\endcsname - \setfontid\lastnamedcs - \else - \font_scale_inherit_normal\??fontscalexx - \fi - \ifskipfontcharacteristics - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch - \fi} - -\def\font_scale_inherit_compact#1% - {\begingroup - \scratchcounterone\fontid\font\relax - \currentxfontsize\plusone - \scratchcountertwo\numericscale\font_currentfontscale - \currentxfontsize\plustwo - \scratchcounterthree\numericscale\font_currentfontscale - % parent -> x -> xx - % parent -> xx - \global\expandafter\fontspecdef\csname\??fontscalex \number\scratchcounterone:\number\glyphscale\endcsname - \scratchcounterone - scale \numexpr\glyphscale*\scratchcountertwo/1000\relax - % scale \glyphscale - % xscale \scratchcountertwo - % yscale \scratchcountertwo - \relax - \global\expandafter\fontspecdef\csname\??fontscalexx\number\scratchcounterone:\number\glyphscale\endcsname - \scratchcounterone - scale \numexpr\glyphscale*\scratchcounterthree/1000\relax - % scale \glyphscale - % xscale \scratchcounterthree - % yscale \scratchcounterthree - \relax - \global\expandafter\fontspecdef\csname\??fontscalex \number\scratchcountertwo:\number\glyphscale\endcsname - \scratchcounterone - scale \numexpr\glyphscale*\scratchcounterthree/1000\relax - % scale \glyphscale - % xscale \scratchcounterthree - % yscale \scratchcounterthree - \relax - \global\expandafter\fontspecdef\csname\??fontscalexx\number\scratchcountertwo:\number\glyphscale\endcsname - \scratchcounterone - scale \numexpr\glyphscale*\scratchcounterthree/1000\relax - % scale \glyphscale - % xscale \scratchcounterthree - % yscale \scratchcounterthree - \relax - \endgroup - \csname#1\number\fontid\font:\number\glyphscale\endcsname} - -\def\font_scale_inherit_compact_x - {\ifcsname\??fontscalex\number\fontid\font:\number\glyphscale\endcsname - \lastnamedcs - \else - \font_scale_inherit_compact\??fontscalex - \fi - \ifskipfontcharacteristics - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch - \fi} - -\def\font_scale_inherit_compact_xx - {\ifcsname\??fontscalexx\number\fontid\font:\number\glyphscale\endcsname - \lastnamedcs - \else - \font_scale_inherit_compact\??fontscalexx - \fi - \ifskipfontcharacteristics - \the\everyfont % \setfontcharacteristics - \the\everyfontswitch - \fi} +\def\font_scale_defined + {\let\fontface\!!zerocount + %\let\fontalternative\fontalternative + \font_helpers_synchronize_font} \def\font_scale_defined_x {\let\fontface\!!plusfour - \let\fontalternative\fontalternative + %\let\fontalternative\fontalternative \font_helpers_synchronize_font} \def\font_scale_defined_xx {\let\fontface\!!plusfive - \let\fontalternative\fontalternative + %\let\fontalternative\fontalternative \font_helpers_synchronize_font} +\appendtoks + \def\font_scale_defined + {\glyphscale\dimexpr\textface*\plushundred/\onepoint\relax + \ifskipfontcharacteristics \else + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch + \fi}% + \def\font_scale_defined_x + {\glyphscale\dimexpr\xtextface*\plushundred/\onepoint\relax + \ifskipfontcharacteristics \else + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch + \fi}% + \def\font_scale_defined_xx + {\glyphscale\dimexpr\xxtextface*\plushundred/\onepoint\relax + \ifskipfontcharacteristics \else + \expand\everyfont % \setfontcharacteristics + \expand\everyfontswitch + \fi}% +\to \everycompactfontmode + % to freeze or not ... \permanent\protected\def\tx {\currentxfontsize\plusone \ifmmode \scriptstyle - \orelse\ifconditional\c_font_inherit_scale - \ifconditional\c_font_compact - \font_scale_inherit_compact_x - \else - \font_scale_inherit_normal_x - \fi \else \font_scale_defined_x \fi @@ -2368,12 +2710,6 @@ {\currentxfontsize\plustwo \ifmmode \scriptscriptstyle - \orelse\ifconditional\c_font_inherit_scale - \ifconditional\c_font_compact - \font_scale_inherit_compact_xx - \else - \font_scale_inherit_normal_xx - \fi \else \font_scale_defined_xx \fi @@ -2385,11 +2721,7 @@ \ifmmode \scriptstyle \else - \ifconditional\c_font_compact - \font_scale_inherit_compact_x - \else - \font_scale_inherit_normal_x - \fi + \font_scale_defined_x \fi \enforced\let\tx\txx \enforced\let\sx\sxx} @@ -2399,26 +2731,22 @@ \ifmmode \scriptscriptstyle \else - \ifconditional\c_font_compact - \font_scale_inherit_compact_xx - \else - \font_scale_inherit_normal_xx - \fi + \font_scale_defined_xx \fi \enforced\lettonothing\tx \enforced\lettonothing\txx \enforced\lettonothing\sx \enforced\lettonothing\sxx} -\permanent\protected\def\useinheritxsizes{\settrue \c_font_inherit_scale} % not yet public, playground for WS and me -\permanent\protected\def\usedefinedxsizes{\setfalse\c_font_inherit_scale} % not yet public, playground for WS and me - \aliased\let\normaltx \tx \aliased\let\normaltxx\txx \aliased\let\normalsx \sx \aliased\let\normalsxx\sxx +\lettonothing\useinheritxsizes % will go +\lettonothing\usedefinedxsizes % will go + %D When asking for a complete font switch, for instance from 10 to 12~points, the %D next macro does the job. First we normalize the size, next we define the current %D range of text, script and scriptscript sizes, then we set the text fonts and the @@ -2433,65 +2761,9 @@ \permanent\protected\def\xtextface {\currentbodyfontdimension\s!x } \permanent\protected\def\xxtextface {\currentbodyfontdimension\s!xx } -\installcorenamespace{fontbodyfaces} - \protected\def\font_basics_complete_switch#size% {\bodyfontsize#size\relax - \normalizebodyfontsize\normalizedbodyfontsize\bodyfontsize - \expandafter\let\expandafter\font_basics_set_faces\csname\??fontbodyfaces\fontbody\endcsname - \ifrelax\font_basics_set_faces - \font_basics_set_faces_preset - \fi - \font_basics_set_faces} - -\def\font_basics_set_faces_preset - {\edef\font_basics_set_faces{% 0.2 sec on 10K \tfa - \enforced\permanent\protected\def\textface {\currentbodyfontdimension\s!text }% - \enforced\permanent\protected\def\scriptface {\currentbodyfontdimension\s!script }% - \enforced\permanent\protected\def\scriptscriptface{\currentbodyfontdimension\s!scriptscript}% - \enforced\permanent\protected\def\xtextface {\currentbodyfontdimension\s!x }% - \enforced\permanent\protected\def\xxtextface {\currentbodyfontdimension\s!xx }% - }% - \gletcsname\??fontbodyfaces\fontbody\endcsname\font_basics_set_faces} - -% \permanent\def\currentbodyfontdimension#parameter% there can be factors here -% {\the\dimexpr -% \ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname -% \lastnamedcs -% \orelse\ifcsname\??fontenvironments\fontclass\s!default#parameter\endcsname -% \lastnamedcs -% \dimexpr\normalizedbodyfontsize\relax -% \orelse\ifcsname\??fontenvironments\normalizedbodyfontsize#parameter\endcsname -% \lastnamedcs -% \else -% \csname\??fontenvironments\s!default#parameter\endcsname -% \dimexpr\normalizedbodyfontsize\relax -% \fi -% \relax} - -% \setupbodyfontenvironment [all] [12pt] [x=4pt,small=4pt] -% \setupbodyfontenvironment [pagella] [12pt] [x=4pt,small=4pt] -% -% \setupbodyfont[pagella,12pt] -% -% \starttext normal {\tx tx} {\small small} \stoptext - -\permanent\def\currentbodyfontdimension#parameter% there can be factors here - {\the\dimexpr - \ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname - \lastnamedcs - \orelse\ifcsname\??fontenvironments\fontclass\s!default#parameter\endcsname - \lastnamedcs - \dimexpr\normalizedbodyfontsize\relax - \orelse\ifcsname\??fontenvironments\v!all\normalizedbodyfontsize#parameter\endcsname - \lastnamedcs - \orelse\ifcsname\??fontenvironments\normalizedbodyfontsize#parameter\endcsname - \lastnamedcs - \else - \csname\??fontenvironments\s!default#parameter\endcsname - \dimexpr\normalizedbodyfontsize\relax - \fi - \relax} + \normalizebodyfontsize\normalizedbodyfontsize\bodyfontsize} %D \macros %D {setupbodyfont,switchtobodyfont} @@ -2525,25 +2797,48 @@ % \newtoks \everysetupbodyfont % \newtoks \everyswitchtobodyfont -\permanent\protected\def\setupbodyfont - {\doifelsenextoptionalcs\font_basics_setupbodyfont_yes\font_basics_setupbodyfont_nop} +% \permanent\protected\def\setupbodyfont +% {\doifelsenextoptionalcs\font_basics_setupbodyfont_yes\font_basics_setupbodyfont_nop} +% +% \def\font_basics_setupbodyfont_nop +% {\restoreglobalbodyfont +% \saveinterlinespace} +% +% \def\font_basics_setupbodyfont_yes[#specification]% +% {\ifempty{#specification}\else +% \font_helpers_set_font\plusone{#specification}% +% \globalbodyfontsize\localbodyfontsize +% \normalizebodyfontsize\normalizedglobalbodyfontsize\globalbodyfontsize +% \let\globalfontstyle\fontstyle +% \ifproductionrun +% \expand\everybodyfont +% \expand\everyglobalbodyfont +% \saveinterlinespace +% \fi +% \expand\everysetupbodyfont +% \fi} -\def\font_basics_setupbodyfont_nop - {\restoreglobalbodyfont - \saveinterlinespace} +\permanent\protected\tolerant\def\setupbodyfont[#specification]% + {\ifparameter#specification\or + \font_helpers_set_font\plusone{#specification}% + \globalbodyfontsize\localbodyfontsize + \normalizebodyfontsize\normalizedglobalbodyfontsize\globalbodyfontsize + \let\globalfontstyle\fontstyle + \ifproductionrun + \expand\everybodyfont + \expand\everyglobalbodyfont + \saveinterlinespace + \fi + \expand\everysetupbodyfont + \else + \restoreglobalbodyfont + \saveinterlinespace + \fi} -\def\font_basics_setupbodyfont_yes[#specification]% - {\doifsomething{#specification} - {\font_helpers_set_font\plusone{#specification}% - \globalbodyfontsize\localbodyfontsize - \normalizebodyfontsize\normalizedglobalbodyfontsize\globalbodyfontsize - \let\globalfontstyle\fontstyle - \ifproductionrun - \the\everybodyfont - \the\everyglobalbodyfont - \saveinterlinespace - \fi - \the\everysetupbodyfont}} +\permanent\protected\def\switchtobodyfont[#specification]% could become an ifx + {\ifparameter#specification\or + \font_basics_switchtobodyfont{#specification}% + \fi} \protected\def\font_basics_switchtobodyfont#specification% {\edef\m_font_step{\font_bodyfontvariable{#specification}}% @@ -2552,11 +2847,11 @@ \else \font_helpers_switch_bodyfont_step % so we have a fast [small] switch \fi - \the\everybodyfont - \the\everyswitchtobodyfont} - -\permanent\protected\def\switchtobodyfont[#specification]% could become an ifx - {\doifsomething{#specification}{\font_basics_switchtobodyfont{#specification}}} + \expand\everybodyfont + \expand\everyswitchtobodyfont +\expand\everyfont +\expand\everyfontswitch + } \permanent\protected\def\usebodyfontparameter#1% {\edef\m_font_bodyfont_asked{#1\c!bodyfont}% @@ -2573,14 +2868,17 @@ \permanent\protected\def\fastswitchtobodyfont#name% {\ifcsname\??fontenvironments\normalizedbodyfontsize#name\endcsname - \edef\p_bodyfont{\lastnamedcs}% + % \edef\p_bodyfont{\lastnamedcs}% + \lettolastnamedcs\p_bodyfont \ifcsname\??fontbodyknown\p_bodyfont\endcsname \font_basics_complete_switch\p_bodyfont \localbodyfontsize\p_bodyfont\relax \fi \fi \csname\??fontstyle\fontstyle\endcsname - \the\everybodyfont} + \expand\everybodyfont +\expand\everyfontswitch + } %D \starttyping %D $\cases{& \ccaron}$ $x=\hbox{\ccaron $x=\hbox{\ccaron}$}$ @@ -2602,6 +2900,16 @@ %D test %D \stoptext %D \stoptyping +%D +%D You can define an meaningfull alias but beware, the font will be partially +%D preloaded: +%D +%D \starttyping +%D \aliasbodyfont[mainfont][pagella] +%D \switchtobodyfont[mainfont] +%D \stoptyping + +\installcorenamespace{bodyfontalias} \permanent\protected\def\usebodyfont[#1]% {\ifempty\fontclass @@ -2611,6 +2919,11 @@ \fullrestoreglobalbodyfont \fi} +\permanent\protected\def\aliasbodyfont[#1]#*[#2]% + {\ifparameter#2\or + \cdefcsname\??bodyfontalias#1\endcsname{#2}% + \fi} + \fetchmodulecommand \showbodyfontstate \f!font_run %D Handy for manuals: @@ -2656,11 +2969,11 @@ \def\font_basics_switch_style_only_arg#name% stupid version {\font_helpers_set_current_font_style{\csname\??fontshortstyle\checkedstrippedcsname#name\endcsname}% - \the\everybodyfont} % needed ? + \expand\everybodyfont} % needed ? \def\font_basics_switch_style_only_opt[#name]% todo : check {\font_helpers_set_current_font_style{\csname\??fontshortstyle#name\endcsname}% - \the\everybodyfont} % needed ? + \expand\everybodyfont} % needed ? %D \macros %D {definebodyfontswitch} @@ -2692,14 +3005,14 @@ \font_basics_switch_points\m_font_step \font_basics_switch_style \fontstyle} -\permanent\protected\def\setsmallbodyfont{\font_helpers_set_bodyfont_step\v!small\the\everybodyfont} -\permanent\protected\def\setbigbodyfont {\font_helpers_set_bodyfont_step\v!big \the\everybodyfont} +\permanent\protected\def\setsmallbodyfont{\font_helpers_set_bodyfont_step\v!small\expand\everybodyfont} +\permanent\protected\def\setbigbodyfont {\font_helpers_set_bodyfont_step\v!big \expand\everybodyfont} \permanent\protected\def\setmainbodyfont {\font_basics_switch_points\normalizedbodyfontsize \font_basics_switch_style\fontstyle - \the\everybodyfont - \the\everyglobalbodyfont + \expand\everybodyfont + \expand\everyglobalbodyfont \saveinterlinespace} %D \macros @@ -2727,8 +3040,8 @@ \font_basics_switch_style\globalfontstyle \redoconvertfont % just in case a pagebreak occurs \tf - \the\everybodyfont - \the\everyglobalbodyfont + \expand\everybodyfont + \expand\everyglobalbodyfont \saveinterlinespace} \permanent\protected\def\partialrestoreglobalbodyfont @@ -2738,8 +3051,8 @@ \currentxfontsize\zerocount \redoconvertfont \tf - \the\everybodyfont % indeed needed - \the\everyglobalbodyfont % indeed needed + \expand\everybodyfont % indeed needed + \expand\everyglobalbodyfont % indeed needed \saveinterlinespace} \permanent\protected\def\restoreglobalbodyfont % ook style etc @@ -2798,21 +3111,25 @@ % \permanent\protected\def\savedefinedfont[#1]% hm, how about scales % {\bgroup % \definedfont[#1]% -% \xdef\saveddefinedfontid {\number\fontid\font}% +% \xdef\saveddefinedfontid {\the\fontid\font}% % \xdef\saveddefinedfontname{\fontname\font}% % \egroup} % -% \mutable\def\saveddefinedfontid {\number\fontid\font} +% \mutable\def\saveddefinedfontid {\the\fontid\font} % \mutable\def\saveddefinedfontname{\fontname\font} %D Ugly helper: +% we can use a \fontspecdef as container + \permanent\protected\def\saverunningstyleandcolor {\enforced\permanent\protected\edef\restorerunningstyleandcolor - {\setfontid \number\fontid\font + {\setfontid \the\fontid\font \glyphscale \the\glyphscale \glyphxscale \the\glyphxscale \glyphyscale \the\glyphyscale + \glyphslant \the\glyphslant + \glyphweight \the\glyphweight \c_attr_colormodel \the\c_attr_colormodel \c_attr_color \the\c_attr_color \c_attr_transparency\the\c_attr_transparency @@ -2900,4 +3217,64 @@ \fi \to \everysetupfonts +%D Handy for testing environments. Options determine position and shift: \typ {[-]}, +%D \typ {[.4]}, \typ {[-.4]}, etc. + +\definecolor[currentfont] [darkgray] + +\permanent\tolerant\protected\def\showcurrentfont[#1]% + {\dontleavehmode\bgroup\setbox\scratchbox\hpack\bgroup + \startcolor[currentfont]% + \scratchdimen #1\exheight + \ifdim\scratchdimen<\zeropoint + \scratchheight\strutht + \scratchdepth \strutdp % \dimexpr\strutdp-\scratchdimen\relax + \else + \scratchheight\strutht % \dimexpr\strutht+0\scratchdimen\relax + \scratchdepth \strutdp + \fi + \virtualvrule + \s!height \scratchheight + \s!depth \scratchdepth + \s!width .5\onepoint + \relax + \ifdim\scratchdimen>\zeropoint + \raise\dimexpr\strutht+\scratchdimen-1.5\exheight\relax + \else + \lower\dimexpr\strutdp-\scratchdimen-1.5\exheight\relax + \fi + \hpack to \zeropoint \bgroup\normalexpanded{% + \tinyinfofont + \hpack to \zeropoint\bgroup + \hss + \iftok{\fontspecifiedname\font}{\fontname\font}\else + (\fontspecifiedname\font)% + \fi + (\fontname\font)% + \kern.5\onepoint + \egroup + \kern\onepoint + (% + \ifempty\fontclass.\else\fontclass\fi,% + \ifempty\fontstyle.\else\fontstyle\fi,% + \fontbody% + )% + (% + \ifnum\glyphscale =\plusthousand .\else\the\glyphscale \fi,% + \ifnum\glyphxscale=\plusthousand .\else\the\glyphxscale\fi,% + \ifnum\glyphyscale=\plusthousand .\else\the\glyphyscale\fi + )% + (% + \ifnum\glyphslant =\zerocount .\else\the\glyphslant \fi,% + \ifnum\glyphweight=\zerocount .\else\the\glyphweight\fi + )% + (\toscaled\xtextface,\toscaled\xxtextface)\hss + }% + \egroup + \stopcolor + \egroup + \smashbox\scratchbox + \box\scratchbox + \egroup} + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx index 9214a8b5232..8510f63b384 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx @@ -88,7 +88,7 @@ % shapes -\registerctxluafile{font-shp}{} +\registerctxluafile{font-shp}{autosuffix} % so far @@ -121,7 +121,7 @@ \registerctxluafile{font-imp-notused}{} \registerctxluafile{font-imp-effects}{autosuffix} \registerctxluafile{font-imp-quality}{autosuffix} -\registerctxluafile{font-imp-italics}{} +\registerctxluafile{font-imp-italics}{autosuffix} \registerctxluafile{font-imp-dimensions}{} \registerctxluafile{font-imp-spacekerns}{} \registerctxluafile{font-imp-tweaks}{} diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-map.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-map.lmt index be132138453..2eb9b132b53 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-map.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-map.lmt @@ -7,12 +7,13 @@ if not modules then modules = { } end modules ['font-map'] = { license = "see context related readme files" } -local tonumber, next, type = tonumber, next, type +local next, type = next, type local match, format, find, concat, gsub, lower = string.match, string.format, string.find, table.concat, string.gsub, string.lower local P, R, S, C, Ct, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.match local formatters = string.formatters local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys +local hextointeger, dectointeger = string.hextointeger, string.dectointeger local trace_loading = false trackers.register("fonts.loading", function(v) trace_loading = v end) local trace_mapping = false trackers.register("fonts.mapping", function(v) trace_mapping = v end) @@ -30,9 +31,9 @@ fonts.mappings = mappings local allocate = utilities.storage.allocate local hex = R("AF","af","09") -local hexfour = (hex*hex*hex^-2) / function(s) return tonumber(s,16) end -local hexsix = (hex*hex*hex^-4) / function(s) return tonumber(s,16) end -local dec = (R("09")^1) / tonumber +local hexfour = (hex*hex*hex^-2) / function(s) return hextointeger(s) end +local hexsix = (hex*hex*hex^-4) / function(s) return hextointeger(s) end +local dec = (R("09")^1) / dectointeger local period = P(".") local unicode = (P("uni") + P("UNI")) * (hexfour * (period + P(-1)) * Cc(false) + Ct(hexfour^1) * Cc(true)) -- base planes local ucode = (P("u") + P("U") ) * (hexsix * (period + P(-1)) * Cc(false) + Ct(hexsix ^1) * Cc(true)) -- extended @@ -71,7 +72,7 @@ local function tounicode16(unicode) return s_unknown else unicode = unicode - 0x10000 - return f_double((k//0x400)+0xD800,unicode%0x400+0xDC00) + return f_double((unicode//0x400)+0xD800,unicode%0x400+0xDC00) end end @@ -92,7 +93,7 @@ local function tounicode16sequence(unicodes) t[l] = s_unknown else u = u - 0x10000 - t[l] = f_double((k//0x400)+0xD800,u%0x400+0xDC00) + t[l] = f_double((u//0x400)+0xD800,u%0x400+0xDC00) end end return concat(t) @@ -137,10 +138,10 @@ end local function fromunicode16(str) if #str == 4 then - return tonumber(str,16) + return hextointeger(str) else local l, r = match(str,"(....)(....)") - return 0x10000 + (tonumber(l,16)-0xD800)*0x400 + tonumber(r,16) - 0xDC00 + return 0x10000 + (hextointeger(l)-0xD800)*0x400 + hextointeger(r) - 0xDC00 end end @@ -148,9 +149,9 @@ end -- -- local p = C(4) * (C(4)^-1) / function(l,r) -- if r then --- return (tonumber(l,16))*0x400 + tonumber(r,16) - 0xDC00 +-- return (hextointeger(l))*0x400 + hextointeger(r) - 0xDC00 -- else --- return tonumber(l,16) +-- return hextointeger(l) -- end -- end -- diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx index a93174e3799..79dcd534f14 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx @@ -11,6 +11,9 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% because we cannot mix we can just 'redefine' the relevant +% macro when \ifconditional\c_font_compact + \writestatus{loading}{ConTeXt Font Macros / Math} \unprotect @@ -23,7 +26,7 @@ %D pseudobold normal=6 l2r=7 r2l=8 %D %D where l2r is just an alias. Because we're now using the mirror lookup (like -%D we do a smaller lookup) in the engine we not just have: +%D we do a smaller lookup) in the engine we now just have: %D %D regular normal=0 %D bold normal=3 @@ -67,12 +70,12 @@ %D repository pre October 2022. \newtoks \t_font_math_strategies -\newconditional\c_font_synchronize_math_fonts \settrue\c_font_synchronize_math_fonts +\newconditional\c_font_synchronize_math_fonts \c_font_synchronize_math_fonts\conditionaltrue \protected\def\font_helpers_synchronize_math % math stuff in mmode - {\ifconditional\c_font_synchronize_math_fonts\the\t_font_math_strategies\fi} + {\ifconditional\c_font_synchronize_math_fonts\expand\t_font_math_strategies\fi} -\permanent\protected\def\textonly{\setfalse\c_font_synchronize_math_fonts} % document this +\permanent\protected\def\textonly{\c_font_synchronize_math_fonts\conditionalfalse} % document this %D The main math font definer. We have removed some optimized code simply because we %D now always have a fontclass. We could check for fontclass being default or empty @@ -88,7 +91,7 @@ % when we are always true we can as well remove this test: -\newconditional\c_font_complete_bold_mathstrategy \settrue\c_font_complete_bold_mathstrategy +\newconditional\c_font_complete_bold_mathstrategy \c_font_complete_bold_mathstrategy\conditionaltrue \immutable\def\mathtextsuffix {-text} \immutable\def\mathscriptsuffix {-script} @@ -98,27 +101,27 @@ %D some interference here, which is why we use a different method for bold. \def\font_helpers_set_math_family_a - {\ifcsname\??fontinstanceready\fontclass -\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size + {\ifcsname\??fontinstanceready\fontclass -\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \c_font_auto_size\conditionalfalse \lastnamedcs \orelse - \ifcsname\??fontinstanceready\fontclass -\fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size + \ifcsname\??fontinstanceready\fontclass -\fontbody-\s!mm-\fontfamily \endcsname \c_font_auto_size\conditionaltrue \lastnamedcs \else \font_helpers_set_math_family_b \fi} \def\font_helpers_set_math_family_b - {\ifcsname\??fontinstanceready\defaultfontclass-\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size + {\ifcsname\??fontinstanceready\defaultfontclass-\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \c_font_auto_size\conditionalfalse \lastnamedcs \orelse - \ifcsname\??fontinstanceready\defaultfontclass-\fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size + \ifcsname\??fontinstanceready\defaultfontclass-\fontbody-\s!mm-\fontfamily \endcsname \c_font_auto_size\conditionaltrue \lastnamedcs \else \font_helpers_set_math_family_c \fi} \def\font_helpers_set_math_family_c - {\ifcsname\??fontinstanceready \fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size + {\ifcsname\??fontinstanceready \fontbody-\s!mm-\fontfamily-\fontsize\endcsname \c_font_auto_size\conditionalfalse \lastnamedcs \orelse - \ifcsname\??fontinstanceready \fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size + \ifcsname\??fontinstanceready \fontbody-\s!mm-\fontfamily \endcsname \c_font_auto_size\conditionaltrue \lastnamedcs \else - \settrue \c_font_auto_size + \c_font_auto_size\conditionaltrue \fi} \mutable\lettonothing\mathsizesuffix @@ -129,8 +132,10 @@ \def\font_helpers_set_math_family_indeed_normal#mrtag#family% \fontface etc are also used later on {\let\savedfontbody\fontbody + \let\savedfontstyle\fontstyle + \let\fontstyle\s!mm \let\fontfamily#family% -\c_math_last_family_used\zerocount + \c_math_last_family_used\zerocount % the order is important as we depend on known id's when completing fonts % enabling is needed when we have fallbacks which spoils the families; per % mid 2022 this is no longer true as we do fallbacks differently @@ -148,52 +153,67 @@ \font_helpers_set_math_family_a\textfont #mrtag\font % enables / still needed ? \lettonothing\mathsizesuffix \let\fontface\!!zerocount + \let\fontstyle\savedfontstyle \let\fontbody\savedfontbody - \setfalse\c_font_auto_size} - -\def\font_helpers_set_math_family_set_scales_compact - {% these are used when no font setting is there, the settings come before setting the parameters - % and are stored with the family ... this is not really needed because the size is used otherwise - \glyphtextscale \plusthousand - \glyphscriptscale \numexpr\plusthousand*\dimexpr\scriptface \relax/\dimexpr\textface\relax\relax - \glyphscriptscriptscale \numexpr\plusthousand*\dimexpr\scriptscriptface\relax/\dimexpr\textface\relax\relax} + \c_font_auto_size\conditionalfalse} \def\font_helpers_set_math_family_set_scales_normal {\glyphtextscale \plusthousand \glyphscriptscale \plusthousand \glyphscriptscriptscale\plusthousand} -\def\font_helpers_set_math_family_indeed_compact#mrtag#family% \fontface etc are also used later on +\def\font_helpers_set_math_family_set_scales_compact + {\glyphtextscale \plusthousand + \glyphscriptscale \plusthousand + \glyphscriptscriptscale\plusthousand} + +\installcorenamespace{compactmathrscale} + +\def\font_helpers_set_math_scales_compact + {\glyphtextscale \the\floatexpr\v_font_size_relative*\plusthousand\relax + \glyphscriptscale \glyphtextscale + \glyphscriptscriptscale\glyphtextscale + \global\expandafter\integerdef\csname\??compactmathrscale\the\fontid\font\endcsname\glyphtextscale} + +\def\font_helpers_get_math_scales_compact + {\ifcsname\??compactmathrscale\the\fontid\font\endcsname + \glyphtextscale \lastnamedcs + \glyphscriptscale \glyphtextscale + \glyphscriptscriptscale\glyphtextscale + \fi} + +\def\font_helpers_set_math_family_indeed_compact#mrfam#family% \fontface etc are also used later on {\let\savedfontbody\fontbody + \let\savedfontstyle\fontstyle + \let\fontstyle\s!mm \let\fontfamily#family% -\c_math_last_family_used\zerocount - \font_helpers_set_math_family_set_scales_compact + \c_math_last_family_used\zerocount % the order is important as we depend on known id's when completing fonts % enabling is needed when we have fallbacks which spoils the families \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone - \font_helpers_set_math_family_a\textfont #mrtag\font % defines - \font_helpers_set_math_family_a\textfont #mrtag\font % enables / still needed ? - \scriptfont #mrtag\font % reuses - \scriptscriptfont#mrtag\font % reuses + % todo: set them al on one go + \font_helpers_set_math_family_a\textfont #mrfam\font % defines + \font_helpers_set_math_family_a\textfont #mrfam\font % enables / still needed ? + \scriptfont #mrfam\font % reuses + \scriptscriptfont#mrfam\font % reuses + \font_helpers_set_math_scales_compact \lettonothing\mathsizesuffix \let\fontface\!!zerocount + \let\fontstyle\savedfontstyle \let\fontbody\savedfontbody - \setfalse\c_font_auto_size} + \c_font_auto_size\conditionalfalse} -\def\font_helpers_set_math_family_indeed - {\ifconditional\c_font_compact - \expandafter\font_helpers_set_math_family_indeed_compact - \else - \expandafter\font_helpers_set_math_family_indeed_normal - \fi} +% why somewhat more save here than normal -\def\font_helpers_set_math_family_bold_indeed_normal#mbfam#familytag#mrfam% \c_font_fam_mb \s!mb \c_font_fam_mr +\def\font_helpers_set_math_family_bold_indeed_normal#mbfam#family#mrfam% \c_font_fam_mb \s!mb \c_font_fam_mr {\let\savedfontclass\defaultfontclass \let\defaultfontclass\fontclass % else truefontname falls back on the wrong one \let\savedfontbody\fontbody - \let\fontfamily#familytag% -\c_math_last_family_used\zerocount + \let\savedfontstyle\fontstyle + \let\fontstyle\s!mm + \let\fontfamily#family% + \c_math_last_family_used\zerocount \font_helpers_set_math_family_set_scales_normal \let\mathsizesuffix\mathscriptscriptsuffix \let\fontface\!!plusthree @@ -209,16 +229,19 @@ \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables / still needed ? \lettonothing\mathsizesuffix \let\fontface\!!zerocount + \let\fontstyle\savedfontstyle \let\fontbody\savedfontbody \let\defaultfontclass\savedfontclass - \setfalse\c_font_auto_size} + \c_font_auto_size\conditionalfalse} -\def\font_helpers_set_math_family_bold_indeed_compact#mbfam#familytag#mrfam% \c_font_fam_mb \s!mb \c_font_fam_mr +\def\font_helpers_set_math_family_bold_indeed_compact#mbfam#family#mrfam% \c_font_fam_mb \s!mb \c_font_fam_mr {\let\savedfontclass\defaultfontclass \let\defaultfontclass\fontclass % else truefontname falls back on the wrong one \let\savedfontbody\fontbody - \let\fontfamily#familytag% -\c_math_last_family_used\zerocount + \let\savedfontstyle\fontstyle + \let\fontstyle\s!mm + \let\fontfamily#family% + \c_math_last_family_used\zerocount \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% defines @@ -227,21 +250,15 @@ \scriptscriptfont#mbfam\textfont#mbfam% reuses \lettonothing\mathsizesuffix \let\fontface\!!zerocount + \let\fontstyle\savedfontstyle \let\fontbody\savedfontbody \let\defaultfontclass\savedfontclass - \setfalse\c_font_auto_size} - -\def\font_helpers_set_math_family_bold_indeed - {\ifconditional\c_font_compact - \expandafter\font_helpers_set_math_family_bold_indeed_compact - \else - \expandafter\font_helpers_set_math_family_bold_indeed_normal - \fi} + \c_font_auto_size\conditionalfalse} \def\font_helpers_set_math_family_bold_a#font#mbfam#mrfam% - {\ifcsname\??fontinstanceready\fontclass-\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size + {\ifcsname\??fontinstanceready\fontclass-\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \c_font_auto_size\conditionalfalse \lastnamedcs #font#mbfam\font \orelse - \ifcsname\??fontinstanceready\fontclass-\fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size + \ifcsname\??fontinstanceready\fontclass-\fontbody-\s!mm-\fontfamily \endcsname \c_font_auto_size\conditionaltrue \lastnamedcs #font#mbfam\font \else #font#mbfam#font#mrfam% \fi} @@ -251,35 +268,66 @@ % sort of tricky: we cannot reset in \everybeforedefinetypeface as we don't know % all sizes so we postpone the optimization to the first starttext % -% pitfall: we should reset 'm when a fontclass name is reused +% pitfall: we should reset them when a fontclass name is reused -\newconditional\optimizemathfontdefinitions \settrue\optimizemathfontdefinitions +\newconditional\optimizemathfontdefinitions \optimizemathfontdefinitions\conditionaltrue -\def\font_helpers_set_math_family#mrfam#familytag% +\def\font_helpers_set_math_family_normal#mrfam#familytag% {\ifconditional\optimizemathfontdefinitions \ifcsname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname % \writestatus{fonts}{math: reusing \fontclass\fontbody\s!mm#familytag\fontsize1}% \font_helpers_preset_math_family_indeed#mrfam#familytag% \else % \writestatus{fonts}{math: defining \fontclass\fontbody\s!mm#familytag\fontsize1}% - \font_helpers_set_math_family_indeed#mrfam#familytag% + \font_helpers_set_math_family_indeed_normal#mrfam#familytag% \fi \else - \font_helpers_set_math_family_indeed#mrfam#familytag% + \font_helpers_set_math_family_indeed_normal#mrfam#familytag% \fi} -\def\font_helpers_set_math_family_bold#mbfam#familytag#mrfam% +\def\font_helpers_set_math_family_bold_normal#mbfam#familytag#mrfam% {\ifconditional\optimizemathfontdefinitions - %\ifcsname\??fontinstanceclass\fontclass-\textface-\s!mm-#familytag-\fontsize-1\endcsname \ifcsname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname \font_helpers_preset_math_family_indeed#mbfam#familytag% \else - \font_helpers_set_math_family_bold_indeed#mbfam#familytag#mrfam% + \font_helpers_set_math_family_bold_indeed_normal#mbfam#familytag#mrfam% + \fi + \else + \font_helpers_set_math_family_bold_indeed_normal#mbfam#familytag#mrfam% + \fi} + +\def\font_helpers_set_math_family_compact#mrfam#familytag% + {\ifconditional\optimizemathfontdefinitions + \ifcsname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize\endcsname + % \writestatus{fonts}{math: reusing \fontclass\fontbody\s!mm#familytag\fontsize1}% + \font_helpers_preset_math_family_indeed#mrfam#familytag% + \else + % \writestatus{fonts}{math: defining \fontclass\fontbody\s!mm#familytag\fontsize1}% + \font_helpers_set_math_family_indeed_compact#mrfam#familytag% + \fi + \else + \font_helpers_set_math_family_indeed_compact#mrfam#familytag% + \fi} + +\def\font_helpers_set_math_family_bold_compact#mbfam#familytag#mrfam% + {\ifconditional\optimizemathfontdefinitions + \ifcsname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize\endcsname + \font_helpers_preset_math_family_indeed#mbfam#familytag% + \else + \font_helpers_set_math_family_bold_indeed_compact#mbfam#familytag#mrfam% \fi \else - \font_helpers_set_math_family_bold_indeed#mbfam#familytag#mrfam% + \font_helpers_set_math_family_bold_indeed_compact#mbfam#familytag#mrfam% \fi} +\aliased\let\font_helpers_set_math_family \font_helpers_set_math_family_normal +\aliased\let\font_helpers_set_math_family_bold\font_helpers_set_math_family_bold_normal + +\appendtoks + \aliased\let\font_helpers_set_math_family \font_helpers_set_math_family_compact + \aliased\let\font_helpers_set_math_family_bold\font_helpers_set_math_family_bold_compact +\to \everycompactfontmode + %D It can happen that we use a bodyfont with no math in which case we have a problem %D with setting the global bodyfont size in the page builder. For instance in: %D @@ -308,23 +356,22 @@ \font_math_last_font \textfont #fam\font} \def\font_helpers_preset_math_family_indeed_compact#fam#familytag% - {\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname + {\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize\endcsname \ifnum\fontid\textfont#fam=\fontid\font\else \font_helpers_preset_math_family_indeed_changed_compact#fam% \fi} \def\font_helpers_preset_math_family_indeed_changed_compact#fam% - {\font_helpers_set_math_family_set_scales_compact - \scriptscriptfont#fam\font + {\scriptscriptfont#fam\font \scriptfont #fam\font - \textfont #fam\font} + \textfont #fam\font + \font_helpers_get_math_scales_compact} -\def\font_helpers_preset_math_family_indeed - {\ifconditional\c_font_compact - \expandafter\font_helpers_preset_math_family_indeed_compact - \else - \expandafter\font_helpers_preset_math_family_indeed_normal - \fi} +\aliased\let\font_helpers_preset_math_family_indeed\font_helpers_preset_math_family_indeed_normal + +\appendtoks + \enforced\let\font_helpers_preset_math_family_indeed\font_helpers_preset_math_family_indeed_compact +\to \everycompactfontmode \let\font_helpers_reset_fontclass_math_families\gobbleoneargument @@ -423,8 +470,8 @@ \newconditional\c_font_pseudo_bold_math_state -\def\font_helpers_set_math_partial_bold_strategy{\settrue \c_font_pseudo_bold_math_state} -\def\font_helpers_set_math_full_bold_strategy {\setfalse\c_font_pseudo_bold_math_state} +\def\font_helpers_set_math_partial_bold_strategy{\c_font_pseudo_bold_math_state\conditionaltrue} +\def\font_helpers_set_math_full_bold_strategy {\c_font_pseudo_bold_math_state\conditionalfalse} \appendtoks \font_helpers_synchronize_math_bold_strategy @@ -446,7 +493,7 @@ \font_helpers_set_current_font_alternative\s!mr \fi \mathdefault - \setfalse\c_math_bold} + \c_math_bold\conditionalfalse} \permanent\protected\def\mb % math bold {\ifmmode @@ -455,7 +502,7 @@ \font_helpers_set_current_font_alternative\s!mb \fi \mathdefault - \settrue\c_math_bold} + \c_math_bold\conditionaltrue} \appendtoks \font_helpers_synchronize_math_family % auto bold @@ -493,9 +540,7 @@ \mutable\lettonothing\bigmathfontsize \permanent\protected\def\synchronizebigmath - {\ifconditional\c_font_compact - % no need - \orelse\ifx\bigmathfontsize\fontsize + {\ifx\bigmathfontsize\fontsize % already in sync \else \let\bigmathfontsize\fontsize @@ -511,12 +556,19 @@ \synchronizebigmath \fi} -%D This is an experiment! +\appendtoks + \enforced\lettonothing\synchronizebigmath + \enforced\lettonothing\font_helpers_check_big_math_synchronization +\to \everycompactfontmode -\permanent\protected\def\mx {\ifmmode\scaledmathstyle\dimexpression\plusthousand*(\xtextface /\textface)\relax\fi} -\permanent\protected\def\mxx{\ifmmode\scaledmathstyle\dimexpression\plusthousand*(\xxtextface/\textface)\relax\fi} +%D This is an experiment! -% permanent\protected\def\setmscale#1{\ifmmode\scaledmathstyle\numericscale#1\relax\fi} +% x$ x \beginmathgroup\scaledmathstyle600 x\endmathgroup x$x +% $ x{\setmscale{.5}x{\setmscale{.25}x}x}x$ +% $ x{\setmscale{x}x{\setmscale{xx}x}x}x$ +% $x \beginmathgroup\mxx x\endmathgroup x $ +% $x \begingroup\mxx x\endgroup x $ % this one is like style, bleeds over group +% $x {\mxx x} x $ \installcorenamespace{mscaled} @@ -530,6 +582,10 @@ \c_math_m_scaled\numexpr(\numericscale\mathscalefactor)*\c_math_m_scaled/\plusthousand\relax \orelse\iftok{#1}{=}% \c_math_m_scaled\plusthousand + \orelse\iftok{#1}{x}% + \c_math_m_scaled\numexpr\plusthousand*\dimexpression\xtextface\relax/\dimexpression\textface\relax\relax + \orelse\iftok{#1}{xx}% + \c_math_m_scaled\numexpr\plusthousand*\dimexpression\xxtextface\relax/\dimexpression\textface\relax\relax \else \c_math_m_scaled\numericscale#1\relax \fi @@ -541,6 +597,18 @@ \fi \fi} +\permanent\protected\def\setmxscale {\ifmmode\scaledmathstyle\numexpr\glyphscale*\dimexpression\xtextface \relax/\dimexpression\textface\relax\relax\fi} +\permanent\protected\def\setmxxscale{\ifmmode\scaledmathstyle\numexpr\glyphscale*\dimexpression\xxtextface\relax/\dimexpression\textface\relax\relax\fi} + +\permanent\protected\def\mx + {\enforced\let\mx\mxx + \setmxscale} + +\permanent\protected\def\mxx + {\enforced\let\mx\relax + \enforced\let\mxx\relax + \setmxxscale} + %D This is nasty, as the engine only stores the last set family parameters (per style) which %D in our case can be bold. @@ -579,7 +647,7 @@ \def\math_synchronize_setup {\let\currentmathfontclass\fontclass - \fastsetup\fontclass} + \fastsetup{\s!math:\fontclass}} \appendtoks \ifx\fontclass\currentmathfontclass\else diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt index 18f3365db9a..a907b6400de 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt @@ -108,9 +108,7 @@ local function initializempf(tfmdata,kind,value) if value then local font = tfmdata.properties.id for char, spec in sortedhash(metafont) do - if type(char) == "string" then - char = newprivateslot(char) - end + local char = type(char) == "string" and newprivateslot(char) or char register(font,char,function(font,char) return setmetaglyphs(value,font,char,spec) end) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt index 3b4f9f86784..41b80e4b1bf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt @@ -459,8 +459,8 @@ end local sharedpalettes = { } do - local colors = attributes.list[attributes.private('color')] or { } - local transparencies = attributes.list[attributes.private('transparency')] or { } + local colors = attributes.list[attributes.private('color')] or { } + local transparencies = attributes.list[attributes.private('transparency')] or { } function otf.registerpalette(name,values) sharedpalettes[name] = values @@ -531,7 +531,12 @@ local initializeoverlay do -- todo: use extender local u = { "use", 0 } for i=1,#colorlist do - u[i+2] = colorlist[i].slot + local c = colorlist[i] + if c then + u[i+2] = c.slot + else + -- some error + end end v.commands = { u, slotcommand[slot][idx] } -- hack to prevent that type 3 also gets 'use' flags .. todo diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-one.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-one.lmt index 71694dcca84..c549005b94a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-one.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-one.lmt @@ -58,7 +58,7 @@ local registerafmfeature = afmfeatures.register local afmenhancers = constructors.enhancers.afm local registerafmenhancer = afmenhancers.register -afm.version = 1.513 -- incrementing this number one up will force a re-cache +afm.version = 1.540 -- incrementing this number one up will force a re-cache afm.cache = containers.define("fonts", "one", afm.version, true) afm.autoprefixed = true -- this will become false some day (catches texnansi-blabla.*) @@ -363,8 +363,8 @@ local function enhance_add_extra_kerns(rawdata) -- using shcodes is not robust h if kerns then local extrakerns for complex, simple in next, what do - complex = unicodes[complex] - simple = unicodes[simple] + local complex = unicodes[complex] + local simple = unicodes[simple] if complex and simple then local ks = kerns[simple] if ks and not kerns[complex] then @@ -386,8 +386,8 @@ local function enhance_add_extra_kerns(rawdata) -- using shcodes is not robust h local function do_it_copy(what) if what then for complex, simple in next, what do - complex = unicodes[complex] - simple = unicodes[simple] + local complex = unicodes[complex] + local simple = unicodes[simple] if complex and simple then local complexdescription = descriptions[complex] if complexdescription then -- optional @@ -579,6 +579,9 @@ local function copytotfm(data) parameters.designsize = (metadata.designsize or 10)*65536 parameters.ascender = abs(metadata.ascender or 0) parameters.descender = abs(metadata.descender or 0) + parameters.capheight = abs(metadata.capheight or 0) + parameters.ascent = abs(metadata.ascent or parameters.ascender or 0) + parameters.descent = abs(metadata.descent or parameters.descender or 0) parameters.units = 1000 -- properties.spacer = spacer @@ -590,10 +593,6 @@ local function copytotfm(data) properties.name = filename or fullname or fontname properties.private = properties.private or data.private or privateoffset -- -if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then - properties.encodingbytes = 2 -end - -- if next(characters) then return { characters = characters, @@ -712,7 +711,7 @@ local function read_from_afm(specification) if tfmdata then tfmdata.properties.name = specification.name tfmdata.properties.id = specification.id - tfmdata = constructors.scale(tfmdata, specification) + tfmdata = constructors.scale(tfmdata,specification) local allfeatures = tfmdata.shared.features or specification.features.normal constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm) fonts.loggers.register(tfmdata,'afm',specification) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt index 04f9d3bb2c8..aef0a4b90d7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt @@ -25,7 +25,8 @@ local match, lower, gsub, strip, find = string.match, string.lower, string.gsub, local char, byte, sub = string.char, string.byte, string.sub local abs = math.abs ----- bxor, rshift = bit32.bxor, bit32.rshift -local P, S, R, V, Cmt, C, Ct, Cs, Carg, Cf, Cg, Cc = lpeg.P, lpeg.S, lpeg.R, lpeg.V, lpeg.Cmt, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg, lpeg.Cf, lpeg.Cg, lpeg.Cc +local P, S, R, V, Cmt, C, Ct, Cs, Carg, Cc = lpeg.P, lpeg.S, lpeg.R, lpeg.V, lpeg.Cmt, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg, lpeg.Cc +----- Cf, Cg = lpeg.Cf, lpeg.Cg local lpegmatch, patterns = lpeg.match, lpeg.patterns local trace_indexing = false trackers.register("afm.indexing", function(v) trace_indexing = v end) @@ -38,7 +39,7 @@ local handlers = fonts.handlers local afm = handlers.afm or { } handlers.afm = afm -afm.version = 1.513 -- incrementing this number one up will force a re-cache +afm.version = 1.514 -- incrementing this number one up will force a re-cache local pfb = handlers.pfb or { } handlers.pfb = pfb @@ -179,11 +180,15 @@ do -- 0 1 255 {1 index exch /.notdef put} for -- dup 0 /Foo put + -- local p_filterencoding = + -- (1-encoding)^0 * encoding * spaces * digits * spaces * array * (1-dup)^0 + -- * Cf( + -- Ct("") * Cg(spacing * dup * spaces * cardinal * spaces * name * spaces * put)^1 + -- ,rawset) + local p_filterencoding = (1-encoding)^0 * encoding * spaces * digits * spaces * array * (1-dup)^0 - * Cf( - Ct("") * Cg(spacing * dup * spaces * cardinal * spaces * name * spaces * put)^1 - ,rawset) + * Ct("") * ((spacing * dup * spaces * cardinal * spaces * name * spaces * put) % rawset)^1 -- if one of first 4 not 0-9A-F then binary else hex @@ -275,7 +280,6 @@ do end binary = decrypt(binary,55665,4) - if not encoding then encoding = lpegmatch(p_filterencoding,ascii) end @@ -303,7 +307,7 @@ do } local version = metadata.FontType or 1 -- only cff 1 in type 1 fonts - fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams,true,true) + fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff0",streams,true,true) elseif not names then lpegmatch(p_filternames,binary,1,filename) end @@ -328,6 +332,14 @@ do end + function pfb.filtermetadata(str) + return lpegmatch(p_filtermetadata,str,1,{}) + end + + function pfb.filterencoding(str) + return lpegmatch(p_filterencoding,str) + end + pfb.loadvector = loadpfbvector get_indexes = function(data,pfbname) @@ -529,10 +541,10 @@ local function read(filename,parser) local afmblob = io.loaddata(filename) if afmblob then local data = { + creator = "context mkiv", resources = { filename = resolvers.unresolve(filename), version = afm.version, - creator = "context mkiv", }, properties = { hasitalics = false, diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt index 6e81307418b..3a88f862d90 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt @@ -45,8 +45,8 @@ local isnextchar = nuts.isnextchar local endofmath = nuts.endofmath local nodecodes = nodes.nodecodes -local disc_code = nodecodes.disc -local math_code = nodecodes.math +local disc_code = nodecodes.disc +local math_code = nodecodes.math local fontdata = fonts.hashes.identifiers local descriptiondata = fonts.hashes.descriptions diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt index 5ef3fd5c3a5..f3adb1af179 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt @@ -71,10 +71,10 @@ local setcolor = tracers and tracers.colors.set local resetcolor = tracers and tracers.colors.reset local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue local nuts = nodes.nuts local nodepool = nuts.pool @@ -124,7 +124,7 @@ local insertnodeafter = nuts.insertafter local properties = nodes.properties.data local fontkern = nuts.pool and nuts.pool.fontkern -local italickern = nuts.pool and nuts.pool.italickern +local spacefontkern = nuts.pool and nuts.pool.spacefontkern local function somekern(makekern,amount,current) local kern = makekern(amount) @@ -132,14 +132,14 @@ local function somekern(makekern,amount,current) return kern end -local useitalickerns = false +local usespacefontkerns = false local useadvance = false -directives.register("fonts.injections.useitalics", function(v) +directives.register("fonts.injections.usespacefontkerns", function(v) if v then - report_injections("using italics for space kerns (tracing only)") + report_injections("using spacefontkerns for space kerns (tracing only)") end - useitalickerns = v + usespacefontkerns = v end) registerdirective("fonts.injections.method", function(v) @@ -666,8 +666,8 @@ end -- if useadvance then -- addmargins(current,-leftkern) -- elseif prev and getid(prev) == glue_code then --- if useitalickerns then --- head = insertnodebefore(head,current,italickern(leftkern)) +-- if usespacefontkerns then +-- head = insertnodebefore(head,current,spacefontkern(leftkern)) -- else -- setwidth(prev, getwidth(prev) + leftkern) -- end @@ -849,8 +849,8 @@ local function inject_kerns_only_kerns(head,where) if leftkern and leftkern ~= 0 then leftkern = xscaled(current,leftkern) if prev and getid(prev) == glue_code then - if useitalickerns then - head = insertnodebefore(head,current,italickern(leftkern)) + if usespacefontkerns then + head = insertnodebefore(head,current,spacefontkern(leftkern)) else setwidth(prev,getwidth(prev) + leftkern) end @@ -1142,8 +1142,8 @@ end -- addxoffset(current,leftkern) -- rightkern = 0 -- elseif prev and getid(prev) == glue_code then --- if useitalickerns then --- head = insertnodebefore(head,current,italickern(leftkern)) +-- if usespacefontkerns then +-- head = insertnodebefore(head,current,spacefontkern(leftkern)) -- else -- setwidth(prev,getwidth(prev)+leftkern) -- end @@ -1153,8 +1153,8 @@ end -- end -- if rightkern ~= 0 then -- if next and getid(next) == glue_code then --- if useitalickerns then --- insertnodeafter(head,current,italickern(rightkern)) +-- if usespacefontkerns then +-- insertnodeafter(head,current,spacefontkern(rightkern)) -- else -- setwidth(next, getwidth(next)+rightkern) -- end @@ -1455,8 +1455,8 @@ local function inject_positions_only_kerns(head,where) addxoffset(current,leftkern) rightkern = 0 elseif prev and getid(prev) == glue_code then - if useitalickerns then - head = insertnodebefore(head,current,italickern(leftkern)) + if usespacefontkerns then + head = insertnodebefore(head,current,spacefontkern(leftkern)) else setwidth(prev,getwidth(prev)+leftkern) end @@ -1466,8 +1466,8 @@ local function inject_positions_only_kerns(head,where) end if rightkern ~= 0 then if next and getid(next) == glue_code then - if useitalickerns then - insertnodeafter(head,current,italickern(rightkern)) + if usespacefontkerns then + insertnodeafter(head,current,spacefontkern(rightkern)) else setwidth(next, getwidth(next)+rightkern) end @@ -2042,8 +2042,8 @@ local function inject_everything(head,where) addxoffset(current,leftkern) rightkern = 0 elseif prev and getid(prev) == glue_code then - if useitalickerns then - head = insertnodebefore(head,current,italickern(leftkern)) + if usespacefontkerns then + head = insertnodebefore(head,current,spacefontkern(leftkern)) else setwidth(prev, getwidth(prev) + leftkern) end @@ -2054,8 +2054,8 @@ local function inject_everything(head,where) if rightkern and rightkern ~= 0 then rightkern = xscaled(current,rightkern) if next and getid(next) == glue_code then - if useitalickerns then - insertnodeafter(head,current,italickern(rightkern)) + if usespacefontkerns then + insertnodeafter(head,current,spacefontkern(rightkern)) else setwidth(next, getwidth(next) + rightkern) end @@ -2326,7 +2326,7 @@ function nodes.injections.setspacekerns(font,sequence) end end -local threshold = 1 -- todo: add a few methods for context +local threshold = 1 -- todo: add a few methods for context directives.register("otf.threshold", function(v) threshold = tonumber(v) or 1 end) @@ -2357,8 +2357,8 @@ end -- local getprev = nodes.direct.getprev -- local getnext = nodes.direct.getnext -- --- local whatsit_code = nodes.nodecodes.whatsit --- local glyph_code = nodes.nodecodes.glyph +-- local whatsit_code = nodes.nodecodes.whatsit +-- local glyph_code = nodes.nodecodes.glyph -- -- local function getspaceboth(n) -- fragile: what it prev/next has no width field -- local prev, next = getboth(n) @@ -2413,8 +2413,10 @@ local function injectspaces(head) end if rightkerns then rightkern = rightkerns[nextchar] + if rightkern then + xscale = getxscale(next) + end end - xscale = getxscale(next) end end if prevchar then @@ -2425,15 +2427,17 @@ local function injectspaces(head) end if leftkerns then leftkern = leftkerns[prevchar] + if leftkern then + xscale = getxscale(prev) + end end - xscale = getxscale(prev) end end if leftkern then local old = getwidth(n) - if old > threshold then + if old > xscale*threshold then if rightkern then - if useitalickerns then + if usespacefontkerns then local lnew = leftkern * factor local rnew = rightkern * factor if trace_spaces then @@ -2441,10 +2445,10 @@ local function injectspaces(head) end lnew = lnew * xscale rnew = rnew * xscale - head = insertnodebefore(head,n,italickern(lnew)) - insertnodeafter(head,n,italickern(rnew)) + head = insertnodebefore(head,n,spacefontkern(lnew)) + insertnodeafter(head,n,spacefontkern(rnew)) else - local new = old + (leftkern + rightkern) * factor + local new = old + (leftkern + rightkern) * factor * xscale if trace_spaces then report_spaces("%C [%p -> %p] %C",prevchar,old,new,nextchar) end @@ -2452,13 +2456,12 @@ local function injectspaces(head) end rightkern = false else - if useitalickerns then - local new = leftkern * factor + if usespacefontkerns then + local new = leftkern * factor * xscale if trace_spaces then report_spaces("%C [%p + %p]",prevchar,old,new) end - new = new * xscale - insertnodeafter(head,n,italickern(new)) -- tricky with traverse but ok + insertnodeafter(head,n,spacefontkern(new)) -- tricky with traverse but ok else local new = old + leftkern * factor * xscale if trace_spaces then @@ -2471,13 +2474,13 @@ local function injectspaces(head) leftkern = false elseif rightkern then local old = getwidth(n) - if old > threshold then + if old > xscale*threshold then local new = rightkern * factor * xscale - if useitalickerns then + if usespacefontkerns then if trace_spaces then report_spaces("[%p + %p] %C",old,new,nextchar) end - insertnodeafter(head,n,italickern(new)) + insertnodeafter(head,n,spacefontkern(new)) else new = old + new if trace_spaces then diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt index 065a2c2eee3..df1ac79c895 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt @@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading") local fonts = fonts local otf = fonts.handlers.otf -otf.version = 3.133 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version = 3.140 -- beware: also sync font-mis.lua and in mtx-fonts and even font-otl.lua otf.cache = containers.define("fonts", "otl", otf.version, true) otf.svgcache = containers.define("fonts", "svg", otf.version, true) otf.pngcache = containers.define("fonts", "png", otf.version, true) @@ -347,12 +347,12 @@ end -- end local function copytotfm(data,cache_id) - if data then + if data and data.descriptions then local metadata = data.metadata local properties = derivetable(data.properties) local descriptions = derivetable(data.descriptions) local goodies = derivetable(data.goodies) - local characters = { } -- newtable if we knwo how many + local characters = { } -- newtable if we know how many local parameters = { } local mathparameters = { } -- @@ -393,24 +393,31 @@ local function copytotfm(data,cache_id) local parts = m.parts local partsitalic = m.partsitalic local partsorientation = m.partsorientation + local mainunicode = d.unicode if variants then local c = character for i=1,#variants do local un = variants[i] c.next = un c = characters[un] +-- if not c.unicode then +-- descriptions[un].unicode = mainunicode +-- c.unicode = mainunicode +-- end end -- c is now last in chain c.parts = parts c.partsorientation = partsorientation if partsitalic and partsitalic ~= 0 then c.partsitalic = partsitalic end +-- parts[#parts//2+1].unicode = mainunicode elseif parts then character.parts = parts character.partsorientation = partsorientation if partsitalic and partsitalic ~= 0 then character.partsitalic = partsitalic end +-- parts[#parts//2+1].unicode = mainunicode end -- local topanchor = m.topanchor or m.accent -- for now @@ -436,7 +443,7 @@ local function copytotfm(data,cache_id) local units = metadata.units or 1000 -- if units == 0 then -- catch bugs in fonts - units = 1000 -- maybe 2000 when ttf + units = 1000 -- maybe 2048 when ttf metadata.units = 1000 report_otf("changing %a units to %a",0,units) end @@ -516,6 +523,9 @@ local function copytotfm(data,cache_id) parameters.maxsize = (maxsize /10)*65536 parameters.ascender = abs(metadata.ascender or 0) parameters.descender = abs(metadata.descender or 0) + parameters.capheight = abs(metadata.capheight or 0) + parameters.ascent = abs(metadata.ascent or parameters.ascender or 0) + parameters.descent = abs(metadata.descent or parameters.descender or 0) parameters.units = units parameters.vheight = metadata.defaultvheight -- @@ -528,30 +538,27 @@ local function copytotfm(data,cache_id) properties.name = filename or fullname properties.subfont = subfont -- -if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then - -- - properties.encodingbytes = 2 -elseif CONTEXTLMTXMODE then - local duplicates = resources and resources.duplicates - if duplicates then - local maxindex = data.nofglyphs or metadata.nofglyphs - if maxindex then - for u, d in sortedhash(duplicates) do - local du = descriptions[u] - if du then - for uu in sortedhash(d) do - maxindex = maxindex + 1 - descriptions[uu].dupindex = du.index - descriptions[uu].index = maxindex + local duplicates = resources and resources.duplicates + if duplicates then + local maxindex = data.nofglyphs or metadata.nofglyphs + if maxindex then + for u, d in sortedhash(duplicates) do + local du = descriptions[u] + if du then + for uu in sortedhash(d) do + local duu = descriptions[uu] + if duu then + maxindex = maxindex + 1 + duu.dupindex = du.index + duu.index = maxindex + end + end + else + -- report_otf("no %U in font %a, duplicates ignored",u,filename) end - else - -- report_otf("no %U in font %a, duplicates ignored",u,filename) end end end - end - -- -end -- -- properties.name = specification.name -- properties.sub = specification.sub @@ -612,9 +619,7 @@ local function otftotfm(specification) local cache_id = specification.hash local tfmdata = containers.read(constructors.cache,cache_id) if not tfmdata then - checkconversion(specification) -- for the moment here - local name = specification.name local sub = specification.sub local subindex = specification.subindex diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-oto.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-oto.lmt index f2269627311..563d34f4dee 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-oto.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-oto.lmt @@ -419,55 +419,23 @@ local function initializehashes(tfmdata) -- already done end -local function checkmathreplacements(tfmdata,fullname,fixitalics) - if tfmdata.mathparameters then - local characters = tfmdata.characters - local changed = tfmdata.changed - if next(changed) then - if trace_preparing or trace_baseinit then - report_prepare("checking math replacements for %a",fullname) - end - for unicode, replacement in next, changed do - local u = characters[unicode] - local r = characters[replacement] - if u and r then - local n = u.next - local v = u.vert_variants - local h = u.horiz_variants - if fixitalics then - -- quite some warnings on stix ... - local ui = u.italic - if ui and not r.italic then - if trace_preparing then - report_prepare("using %i units of italic correction from %C for %U",ui,unicode,replacement) - end - r.italic = ui -- print(ui,ri) - end - end - if n and not r.next then - if trace_preparing then - report_prepare("forcing %s for %C substituted by %U","incremental step",unicode,replacement) - end - r.next = n - end - if v and not r.vert_variants then - if trace_preparing then - report_prepare("forcing %s for %C substituted by %U","vertical variants",unicode,replacement) - end - r.vert_variants = v - end - if h and not r.horiz_variants then - if trace_preparing then - report_prepare("forcing %s for %C substituted by %U","horizontal variants",unicode,replacement) - end - r.horiz_variants = h - end - else - if trace_preparing then - report_prepare("error replacing %C by %U",unicode,replacement) - end - end - end +local function relocatessty(sequences,fullname) + local position = false + local sstydata = false + local nofsequences = #sequences + for s=1,#sequences do + local sequence = sequences[s] + local features = sequence.features + if features and features.ssty then + position = s + sstydata = sequence + end + end + if position and position ~= nofsequences then + table.remove(sequences,position) + sequences[nofsequences-1] = sstydata + if trace_preparing then + report_prepare("ssty feature relocated to the end in %a",fullname) end end end @@ -476,8 +444,8 @@ local function featuresinitializer(tfmdata,value) if true then -- value then local starttime = trace_preparing and os.clock() local features = tfmdata.shared.features - local fullname = tfmdata.properties.fullname or "?" - if features then + local fullname = tfmdata.properties.fullname + if features and fullname then initializehashes(tfmdata) local collectlookups = otf.collectlookups local rawdata = tfmdata.shared.rawdata @@ -493,6 +461,9 @@ local function featuresinitializer(tfmdata,value) -- if basesubstitutions or basepositionings then local sequences = tfmdata.resources.sequences + if basesubstitutions.ssty then +-- relocatessty(sequences,fullname) + end for s=1,#sequences do local sequence = sequences[s] local sfeatures = sequence.features @@ -504,9 +475,6 @@ local function featuresinitializer(tfmdata,value) local value = features[feature] if value then local validlookups, lookuplist = collectlookups(rawdata,feature,script,language) --- if not validlookups and not lookuplist and script == "math" then --- validlookups, lookuplist = collectlookups(rawdata,feature,"dflt","dflt") --- end if not validlookups then -- skip elseif basesubstitutions and basesubstitutions[feature] then @@ -530,11 +498,6 @@ local function featuresinitializer(tfmdata,value) end end end - -- - if substitutionsdone then - checkmathreplacements(tfmdata,fullname,features.fixitalics) - end - -- registerbasehash(tfmdata) end if trace_preparing then diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt index 9e7fdb1ab1e..1d24f038392 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt @@ -243,19 +243,18 @@ local setmetatableindex = table.setmetatableindex local nextnode = nuts.traversers.node local nodecodes = nodes.nodecodes -local glyphcodes = nodes.glyphcodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue -local disc_code = nodecodes.disc -local math_code = nodecodes.math -local dir_code = nodecodes.dir -local par_code = nodecodes.par +local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue +local disc_code = nodecodes.disc +local math_code = nodecodes.math +local dir_code = nodecodes.dir +local par_code = nodecodes.par -local lefttoright_code = tex.directioncodes.lefttoright -local righttoleft_code = tex.directioncodes.righttoleft +local lefttoright_code = tex.directioncodes.lefttoright +local righttoleft_code = tex.directioncodes.righttoleft -local discretionarydisc_code = nodes.disccodes.discretionary +local discretionarydisc_code = nodes.disccodes.discretionary local injections = nodes.injections local setmark = injections.setmark @@ -513,10 +512,10 @@ end local glyphoptioncodes = tex.glyphoptioncodes -local no_left_ligature_code = glyphoptioncodes.noleftligature -local no_right_ligature_code = glyphoptioncodes.norightligature ------ no_left_kern_code = glyphoptioncodes.noleftkern -local no_right_kern_code = glyphoptioncodes.norightkern +local no_left_ligature_code = glyphoptioncodes.noleftligature +local no_right_ligature_code = glyphoptioncodes.norightligature +----- no_left_kern_code = glyphoptioncodes.noleftkern +local no_right_kern_code = glyphoptioncodes.norightkern local hasglyphoption = nuts.hasglyphoption @@ -584,7 +583,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou componentindex = countcomponents(start,marks) -- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])" -- and such: - elseif not deletemarks then + elseif not deletemarks or (skiphash and skiphash[char]) then -- we can get a loop when the font expects otherwise (i.e. unexpected deletemarks) setligaindex(start,baseindex + getligaindex(start,componentindex)) if trace_marks then @@ -1094,7 +1093,7 @@ end -- to explicitly test for basechar, baselig and basemark entries. function handlers.gpos_mark2base(head,start,dataset,sequence,markanchors,rlmode,skiphash) - local markchar = getchar(start) + local markchar = getchar(start) -- combine with getprev if marks[markchar] then local base = getprev(start) -- [glyph] [start=mark] if base then @@ -1982,26 +1981,14 @@ end -- but in order to handle that we need more complex code which also slows down even -- more. The main loop variant could deal with that: test, collapse, backtrack. -local userkern = nuts.pool and nuts.pool.newkern -- context - -do if not userkern then -- generic - - local thekern = nuts.new("kern",1) -- userkern - local setkern = nuts.setkern -- not injections.setkern - - userkern = function(k) - local n = copynode(thekern) - setkern(n,k) - return n - end - -end end +local newuserkern = nuts.pool.newkern +local newboundary = nuts.pool.boundary local function checked(head) local current = head while current do if getid(current) == glue_code then - local kern = userkern(getwidth(current)) + local kern = newuserkern(getwidth(current)) if head == current then local next = getnext(current) if next then @@ -2623,17 +2610,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if last then local nxt, char, id = isnextchar(last,currentfont,currentdynamic,currentscale,currentxscale,currentyscale) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n < l then + last = nxt + end + n = n + 1 + elseif skiphash and skiphash[char] then skipped = true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end last = nxt - elseif seq[n][char] then - if n < l then - last = nxt - end - n = n + 1 elseif discfound then notmatchreplace[discfound] = true if notmatchpre[discfound] then @@ -2732,17 +2719,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if prev then local prv, char, id = isprevchar(prev,currentfont,currentdynamic,currentscale,currentxscale,currentyscale) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n > 1 then + prev = prv + end + n = n - 1 + elseif skiphash and skiphash[char] then skipped = true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end prev = prv - elseif seq[n][char] then - if n > 1 then - prev = prv - end - n = n - 1 elseif discfound then notmatchreplace[discfound] = true if notmatchpost[discfound] then @@ -2864,17 +2851,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if current then local nxt, char, id = isnextchar(current,currentfont,currentdynamic,currentscale,currentxscale,currentyscale) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n < s then + current = nxt + end + n = n + 1 + elseif skiphash and skiphash[char] then skipped = true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end - current = nxt -- was absent - elseif seq[n][char] then - if n < s then -- new test - current = nxt -- was absent - end - n = n + 1 + current = nxt elseif discfound then notmatchreplace[discfound] = true if notmatchpre[discfound] then @@ -3368,7 +3355,10 @@ local function testrun(disc,t_run,c_run,...) local prev, next = getboth(disc) if not next then -- weird discretionary - return + -- return + -- better, removing it is tricky + next = newboundary() + setlink(disc,next) end local pre, post, replace, pretail, posttail, replacetail = getdisc(disc,true) local renewed = false @@ -3991,22 +3981,19 @@ do while start do local nxt, char, id = isnextchar(start,font,dynamic,state) -- we can move the data/state checks here if char then - if skiphash and skiphash[char] then -- we never needed it here but let's try - start = nxt - else - local lookupmatch = lookupcache[char] - if lookupmatch then - currentscale, currentxscale, currentyscale = getscales(start) - local ok, df - head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if df then - -- print("restart 1",typ) - elseif start then - start = getnext(start) -- can be a new start - end - else - start = nxt + -- no skiphash check here + local lookupmatch = lookupcache[char] + if lookupmatch then + currentscale, currentxscale, currentyscale = getscales(start) + local ok, df + head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if df then + -- print("restart 1",typ) + elseif start then + start = getnext(start) -- can be a new start end + else + start = nxt end elseif char == false or id == glue_code then -- a different font|state or glue (happens often) @@ -4040,39 +4027,36 @@ do while start do local nxt, char, id = isnextchar(start,font,dynamic,state) if char then - if skiphash and skiphash[char] then -- we never needed it here but let's try - start = nxt - else - local m = merged[char] - if m then - currentscale, currentxscale, currentyscale = getscales(start) - local ok, df - for i=m[1],m[2] do - local step = steps[i] - local lookupcache = step.coverage - local lookupmatch = lookupcache[char] - if lookupmatch then - -- we could move all code inline but that makes things even more unreadable + -- no skiphash check here + local m = merged[char] + if m then + currentscale, currentxscale, currentyscale = getscales(start) + local ok, df + for i=m[1],m[2] do + local step = steps[i] + local lookupcache = step.coverage + local lookupmatch = lookupcache[char] + if lookupmatch then + -- we could move all code inline but that makes things even more unreadable -- local ok, df - head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if df then - break - elseif ok then - break - elseif not start then - -- don't ask why ... shouldn't happen - break - end + head, start, ok, df = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if df then + break + elseif ok then + break + elseif not start then + -- don't ask why ... shouldn't happen + break end end - if df then - -- print("restart 2",typ) - elseif start then - start = getnext(start) -- can be a new next - end - else - start = nxt end + if df then + -- print("restart 2",typ) + elseif start then + start = getnext(start) -- can be a new next + end + else + start = nxt end elseif char == false or id == glue_code then -- a different font|state or glue (happens often) @@ -4171,32 +4155,29 @@ do position = position + 1 local m = merged[char] if m then - if skiphash and skiphash[char] then -- we never needed it here but let's try - start = nxt - else - for i=m[1],m[2] do - local step = steps[i] - local lookupcache = step.coverage - local lookupmatch = lookupcache[char] - if lookupmatch then - currentscale, currentxscale, currentyscale = getscales(start) - local ok - head, start, ok = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if ok then - -- if matches then - -- matches[position] = i - -- else - -- matches = { [position] = i } - -- end - break - elseif not start then - break - end + -- no skiphash check here + for i=m[1],m[2] do + local step = steps[i] + local lookupcache = step.coverage + local lookupmatch = lookupcache[char] + if lookupmatch then + currentscale, currentxscale, currentyscale = getscales(start) + local ok + head, start, ok = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if ok then + -- if matches then + -- matches[position] = i + -- else + -- matches = { [position] = i } + -- end + break + elseif not start then + break end end - if start then - start = getnext(start) -- start can be new - end + end + if start then + start = getnext(start) -- start can be new end else -- start = getnext(start) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt index fb2251abe40..5cfd0ecbac7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt @@ -64,6 +64,10 @@ if not modules then modules = { } end modules ['font-phb-imp-internal'] = { -- font plugin > hb > text : U+00066 U+00069 U+00065 U+00074 U+00073 -- font plugin > hb > result : U+0FB01 U+00065 U+00074 U+00073 +-- In the meantime a single dll is not enough and we need some more which interferes with +-- the idea of a simple dll in the lib path ... too many dependencies now .. and having +-- some shared bin path is not what we want in tex so ... + local report = utilities.hb.report or print local hblib = optional and (optional.hb or optional.test) @@ -95,7 +99,7 @@ local fontdata = fonts.hashes.identifiers local initialized = nil local loaded = { } local shared = { } -local libname = os.name == "windows" and "libharfbuzz-0" or "libharfbuzz" +local libfile = os.name == "windows" and "libharfbuzz-0" or "libharfbuzz" local shapers = { native = { "ot", "uniscribe", "fallback" }, @@ -104,11 +108,11 @@ local shapers = { fallback = { "fallback" }, } -local mode = 32 +local mode = 8 -- now 32 bit crashes (random, needs checking, probably zero end of string issue) function utilities.hb.methods.internal(font,data,rlmode,text,leading,trailing) if initialized == nil then - local filename = findlib(libname) + local filename = findlib(libfile) initialized = hb_initialize(filename) if initialized then report("using hb library version %a, supported shapers: %,t",hb_getversion(),hb_getshapers()) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt index 67b068885b9..ec2badad5d6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt @@ -23,7 +23,11 @@ if not modules then modules = { } end modules ['font-phb'] = { -- probably strip away even more code. I might pick up this thread when Idris picks -- up his font making. -- --- Todo: use the new (context) advance and offset features. +-- Todo: use the new (context) advance and offset features. On the other hand, it is +-- too much of a moving target and I don't want to keep track of it. It has become +-- one of the most frequently updated optional components in luatex which then sort +-- of contradicts long term stability and makes it very dependent too, apart from +-- possible make complications. local next, tonumber, pcall, rawget = next, tonumber, pcall, rawget @@ -63,9 +67,8 @@ local nodepool = nuts.pool local new_kern = nodepool.fontkern local new_glyph = nodepool.glyph -local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue +local glyph_code = nodes.nodecodes.glyph +local glue_code = nodes.nodecodes.glue local skipped = { -- we assume that only valid features are set but maybe we need a list diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl b/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl index 701362dced2..d73a9fa7fc6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl @@ -70,7 +70,8 @@ \definefontfeature [default] [always] - [liga=yes] + [itlc=yes, % new per 10-2023 + liga=yes] % ccmp=yes, % maybe too % locl=yes, % maybe too @@ -434,10 +435,6 @@ % \variablefam 63 % \fi -\definefontfeature - [collapseitalics] - [collapseitalics=yes] - \definefontfeature[virtualmath] [mathematics] \definefontfeature[math-text] [mathematics] [ssty=no] @@ -563,7 +560,12 @@ one=f:y:t, mix=f:b:t] -%D Now we're up to some definitions. +%D Now we're up for some definitions. + +%D \starttyping +%D \definebodyfontenvironment[pagella][default][default] +%D \definebodyfontenvironment[pagella][default][metric] +%D \stoptyping \definebodyfontenvironment [\s!default] @@ -574,7 +576,24 @@ \s!b=1.440, \s!c=1.728, \s!d=2.074, - *=\font_currentfontscale, % wildcard + *=\wildcardfontscale, + \s!x=0.8, + \s!xx=0.6, + \v!big=1.2, + \v!small=0.8, + \c!interlinespace=, + \s!em=\v!slanted] + +\definebodyfontenvironment + [metric] + [ \s!text=1.0, + \s!script=0.7, + \s!scriptscript=0.5, + \s!a=1.25, + \s!b=1.50, + \s!c=1.75, + \s!d=2.00, + *=\wildcardfontscale, \s!x=0.8, \s!xx=0.6, \v!big=1.2, @@ -903,22 +922,12 @@ \pushoverloadmode -% \let\infofont \relax -% \let\infofontbold \relax -% \let\smallinfofont \relax -% \let\smallinfofontbold\relax -% -% \definefont[infofont] [file:dejavusansmono*none at 6pt] -% \definefont[infofontbold] [file:dejavusansmono-bold*none at 6pt] -% \definefont[smallinfofont] [file:dejavusansmono*none at 3pt] -% \definefont[smallinfofontbold][file:dejavusansmono-bold*none at 3pt] -% -% after testing for quite a while moved from cont-loc.mkxl - \protected\def\infofont {\definefrozenfont[infofont] [file:dejavusansmono*none at 6pt]\infofont} \protected\def\infofontbold {\definefrozenfont[infofontbold] [file:dejavusansmono-bold*none at 6pt]\infofontbold} \protected\def\smallinfofont {\definefrozenfont[smallinfofont] [file:dejavusansmono*none at 3pt]\smallinfofont} \protected\def\smallinfofontbold{\definefrozenfont[smallinfofontbold][file:dejavusansmono-bold*none at 3pt]\smallinfofontbold} +\protected\def\tinyinfofont {\definefrozenfont[tinyinfofont] [file:dejavusansmono*none at 2pt]\tinyinfofont} +\protected\def\tinyinfofontbold {\definefrozenfont[tinyinfofontbold] [file:dejavusansmono-bold*none at 2pt]\tinyinfofontbold} %D Optimization (later we overload in math). Also needed in order to get \type {\ss} %D properly defined. @@ -947,29 +956,6 @@ \popoverloadmode -% experiment: - -\startsetups experiment:fonts:compact - \settrue\c_font_compact -% \definefontfeature[virtualmath] [mathematics] [compactmath=yes] -% \definefontfeature[virtualmath-l2r] [mathematics-l2r][compactmath=yes] -% \definefontfeature[virtualmath-r2l] [mathematics-r2l][compactmath=yes] -% \definefontfeature[math-text] [mathematics] [compactmath=yes] -% \definefontfeature[math-script] [mathematics] [compactmath=yes] -% \definefontfeature[math-scriptscript] [mathematics] [compactmath=yes] -% \definefontfeature[math-text-l2r] [mathematics-l2r][compactmath=yes] -% \definefontfeature[math-script-l2r] [mathematics-l2r][compactmath=yes] -% \definefontfeature[math-scriptscript-l2r][mathematics-l2r][compactmath=yes] -% \definefontfeature[math-text-r2l] [mathematics-r2l][compactmath=yes] -% \definefontfeature[math-script-r2l] [mathematics-r2l][compactmath=yes] -% \definefontfeature[math-scriptscript-r2l][mathematics-r2l][compactmath=yes] -\stopsetups - -\installtexexperiment - {fonts.compact} - {\directsetup{experiment:fonts:compact}} - {} - \protect \endinput % LM math vs CM math (analysis by Taco): diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx index 421217c8b98..b07ecd75701 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx @@ -36,19 +36,6 @@ \lettonothing\m_font_fallback_name -% keep as reference: -% -% \def\font_preloads_reset_nullfont % this is needed because some macro packages (tikz) misuse \nullfont -% {\dorecurse\plusseven{\fontdimen\recurselevel\nullfont\zeropoint}% keep en eye on this as: -% \clf_resetnullfont % in luatex 0.70 this will also do the previous -% \glet\font_preloads_reset_nullfont\relax} - -% \def\font_preload_check_mode -% {\doifelsemode{lmmath} -% {\def\m_font_fallback_name{modern-designsize-virtual}}% this will stay -% {\def\m_font_fallback_name{modern-designsize}}% % this might become 'modern' -% \glet\font_preload_check_mode\relax} - \def\font_preload_check_mode {\def\m_font_fallback_name{modern}% \glet\font_preload_check_mode\relax} @@ -92,8 +79,7 @@ {\glet\font_preload_default_fonts_tt\relax \glet\font_preload_default_fonts_mm\relax \glet\font_preloads_third_stage \relax - \glet\font_preloads_fourth_stage \relax - } + \glet\font_preloads_fourth_stage \relax} \def\font_preloads_zero_stage_indeed {\definedfont[\s!file:lmmono10-regular sa 1]} @@ -104,10 +90,12 @@ \font_preloads_zero_stage} \protected\def\font_preloads_first_stage % % *nofonts -> *preloadfonts - {\doifelsemode{*preloadfonts} - {\font_preload_default_fonts - \writestatus\m!fonts{preloading latin modern fonts (first stage)}} - {\writestatus\m!fonts{latin modern fonts are not preloaded}}} + {\ifmode{*preloadfonts}% + \font_preload_default_fonts + \writestatus\m!fonts{preloading latin modern fonts (first stage)}% + \else + \writestatus\m!fonts{latin modern fonts are not preloaded}% + \fi} \protected\def\font_preloads_second_stage {\writestatus\m!fonts{preloading latin modern fonts (second stage)}% @@ -134,7 +122,7 @@ \protected\def\font_preloads_fourth_stage {\begingroup - %ifzeropt\fontcharwd\font\number`!\relax + %ifzeropt\scaledfontcharwd\font\number`!\relax \setbox\scratchbox\hpack{\tf c o n t e x t}% \ifzeropt\wd\scratchbox \writeline diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-shp.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-shp.lmt new file mode 100644 index 00000000000..40c68a45c67 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/font-shp.lmt @@ -0,0 +1,406 @@ +if not modules then modules = { } end modules ['font-shp'] = { + version = 1.001, + comment = "companion to font-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local tonumber, next = tonumber, next +local concat = table.concat +local formatters, lower = string.formatters, string.lower + +local otf = fonts.handlers.otf +local afm = fonts.handlers.afm +local pfb = fonts.handlers.pfb + +local hashes = fonts.hashes +local identifiers = hashes.identifiers + +local version = otf.version or 0.015 +local shapescache = containers.define("fonts", "shapes", version, true) +local streamscache = containers.define("fonts", "streams", version, true) + +-- shapes (can be come a separate file at some point) + +local compact_streams = false +local pack_outlines = true + +directives.register("fonts.streams.compact", function(v) compact_streams = v end) +directives.register("fonts.streams.pack", function(v) pack_outlines = v end) + +local function packoutlines(data,makesequence) + if not pack_outlines then + return + end + local subfonts = data.subfonts + if subfonts then + for i=1,#subfonts do + packoutlines(subfonts[i],makesequence) + end + return + end + local common = data.segments + if common then + return + end + local glyphs = data.glyphs + if not glyphs then + return + end + if makesequence then + for index=0,#glyphs do + local glyph = glyphs[index] + if glyph then + local segments = glyph.segments + if segments then + local sequence = { } + local nofsequence = 0 + for i=1,#segments do + local segment = segments[i] + local nofsegment = #segment + -- why last first ... needs documenting + nofsequence = nofsequence + 1 + sequence[nofsequence] = segment[nofsegment] + for i=1,nofsegment-1 do + nofsequence = nofsequence + 1 + sequence[nofsequence] = segment[i] + end + end + glyph.sequence = sequence + glyph.segments = nil + end + end + end + else + local hash = { } + local common = { } + local reverse = { } + local last = 0 + for index=0,#glyphs do + local glyph = glyphs[index] + if glyph then + local segments = glyph.segments + if segments then + for i=1,#segments do + local h = concat(segments[i]," ") + hash[h] = (hash[h] or 0) + 1 + end + end + end + end + for index=0,#glyphs do + local glyph = glyphs[index] + if glyph then + local segments = glyph.segments + if segments then + for i=1,#segments do + local segment = segments[i] + local h = concat(segment," ") + if hash[h] > 1 then -- minimal one shared in order to hash + local idx = reverse[h] + if not idx then + last = last + 1 + reverse[h] = last + common[last] = segment + idx = last + end + segments[i] = idx + end + end + end + end + end + if last > 0 then + data.segments = common + end + end +end + +local function unpackoutlines(data) + local subfonts = data.subfonts + if subfonts then + for i=1,#subfonts do + unpackoutlines(subfonts[i]) + end + return + end + local common = data.segments + if not common then + return + end + local glyphs = data.glyphs + if not glyphs then + return + end + for index=0,#glyphs do + local glyph = glyphs[index] + if glyph then + local segments = glyph.segments + if segments then + for i=1,#segments do + local c = common[segments[i]] + if c then + segments[i] = c + end + end + end + end + end + data.segments = nil +end + +-- todo: loaders per format + +local readers = otf.readers +local cleanname = otf.readers.helpers.cleanname + +-- todo: shared hash for this but not accessed often + +-- local function makehash(filename,sub,instance) +-- local name = cleanname(file.basename(filename)) +-- if instance then +-- return formatters["%s-%s-%s"](name,sub or 0,cleanname(instance)) +-- else +-- return formatters["%s-%s"] (name,sub or 0) +-- end +-- end + +local function makehash(filename,sub,instance,extrahash) + return formatters["%s-%s-%s-%s"]( + cleanname(file.basename(filename)), + sub or 0, + instance and instance ~= "" and cleanname(instance) or "0", + extrahash and extrahash ~= "" and cleanname(extrahash) or "0" + ) +end + +local function loadoutlines(cache,filename,sub,instance,extrahash) + local base = file.basename(filename) + local name = file.removesuffix(base) + local kind = file.suffix(filename) + local attr = lfs.attributes(filename) + local size = attr and attr.size or 0 + local time = attr and attr.modification or 0 + local sub = tonumber(sub) + + -- fonts.formats + if size > 0 and (kind == "otf" or kind == "ttf" or kind == "tcc") then + local hash = makehash(filename,sub,instance,extrahash) + data = containers.read(cache,hash) + if not data or data.time ~= time or data.size ~= size then + data = otf.readers.loadshapes(filename,sub,instance) + if data then + data.size = size + data.format = data.format or (kind == "otf" and "opentype") or "truetype" + data.time = time + packoutlines(data) + containers.write(cache,hash,data) + data = containers.read(cache,hash) -- frees old mem + end + end + unpackoutlines(data) + elseif size > 0 and (kind == "pfb") then + local hash = containers.cleanname(base) -- including suffix + data = containers.read(cache,hash) + if not data or data.time ~= time or data.size ~= size then + data = afm.readers.loadshapes(filename) + if data then + data.size = size + data.format = "type1" + data.time = time + packoutlines(data) + containers.write(cache,hash,data) + data = containers.read(cache,hash) -- frees old mem + end + end + unpackoutlines(data) + else + data = { + filename = filename, + size = 0, + time = time, + format = "unknown", + units = 1000, + glyphs = { } + } + end + return data +end + +local function cachethem(cache,hash,data) + containers.write(cache,hash,data,compact_streams) -- arg 4 aka fast + return containers.read(cache,hash) -- frees old mem +end + +local function loadstreams(cache,filename,sub,instance,extrahash) + local base = file.basename(filename) + local name = file.removesuffix(base) + local kind = lower(file.suffix(filename)) + local attr = lfs.attributes(filename) + local size = attr and attr.size or 0 + local time = attr and attr.modification or 0 + local sub = tonumber(sub) + if size > 0 and (kind == "otf" or kind == "ttf" or kind == "ttc") then + local hash = makehash(filename,sub,instance,extrahash) + data = containers.read(cache,hash) + if not data or data.time ~= time or data.size ~= size then + data = otf.readers.loadshapes(filename,sub,instance,true) -- how about extrahash + if data then + local glyphs = data.glyphs + local streams = { } + -- local widths = { } + if glyphs then + for i=0,#glyphs do + local glyph = glyphs[i] + if glyph then + streams[i] = glyph.stream or "" + -- widths [i] = glyph.width or 0 + else + streams[i] = "" + -- widths [i] = 0 + end + end + end + data.streams = streams + -- data.widths = widths -- maybe more reliable! + data.glyphs = nil + data.size = size + data.format = data.format or (kind == "otf" and "opentype") or "truetype" + data.time = time + data = cachethem(cache,hash,data) + end + end + elseif size > 0 and (kind == "pfb") then + local hash = makehash(filename,sub,instance) + data = containers.read(cache,hash) + if not data or data.time ~= time or data.size ~= size then + local names, encoding, streams, metadata = pfb.loadvector(filename,false,true) + if streams then + local fontbbox = metadata.fontbbox or { 0, 0, 0, 0 } + -- local widths = { } + for i=0,#streams do + local s = streams[i] + streams[i] = s.stream or "\14" + -- widths [i] = s.width or 0 + end + data = { + filename = filename, + size = size, + time = time, + format = "type1", + streams = streams, + -- widths = widths, + fontheader = { + fontversion = metadata.version, + units = 1000, -- can this be different? + xmin = fontbbox[1], + ymin = fontbbox[2], + xmax = fontbbox[3], + ymax = fontbbox[4], + }, + horizontalheader = { + ascender = 0, + descender = 0, + }, + maximumprofile = { + nofglyphs = #streams + 1, + }, + names = { + copyright = metadata.copyright, + family = metadata.familyname, + fullname = metadata.fullname, + fontname = metadata.fontname, + subfamily = metadata.subfamilyname, + trademark = metadata.trademark, + notice = metadata.notice, + version = metadata.version, + }, + cffinfo = { + familyname = metadata.familyname, + fullname = metadata.fullname, + italicangle = metadata.italicangle, + monospaced = metadata.isfixedpitch and true or false, + underlineposition = metadata.underlineposition, + underlinethickness = metadata.underlinethickness, + weight = metadata.weight, + }, + } + data = cachethem(cache,hash,data) + end + end + else + data = { + filename = filename, + size = 0, + time = time, + format = "unknown", + streams = { } + } + end + return data +end + +local loadedshapes = { } +local loadedstreams = { } + +local function loadoutlinedata(fontdata,streams) + local properties = fontdata.properties + local filename = properties.filename + local subindex = fontdata.subindex + local instance = properties.instance + local extrahash = properties.extrahash + local hash = makehash(filename,subindex,instance,extrahash) + local loaded = loadedshapes[hash] + if not loaded then + loaded = loadoutlines(shapescache,filename,subindex,instance,extrahash) + loadedshapes[hash] = loaded + end + return loaded +end + +hashes.shapes = table.setmetatableindex(function(t,k) + local f = identifiers[k] + if f then + return loadoutlinedata(f) + end +end) + +local function getstreamhash(fontid) + local fontdata = identifiers[fontid] + if fontdata then + local properties = fontdata.properties + local fonthash = makehash(properties.filename,properties.subfont,properties.instance,properties.extrahash) + return fonthash, fontdata + end +end + +local function loadstreamdata(fontdata) + local properties = fontdata.properties + local shared = fontdata.shared + local rawdata = shared and shared.rawdata + local metadata = rawdata and rawdata.metadata + local filename = properties.filename + local subindex = metadata and metadata.subfontindex + local instance = properties.instance + local extrahash = properties.extrahash + local hash = makehash(filename,subindex,instance) + local loaded = loadedstreams[hash] + if not loaded then + loaded = loadstreams(streamscache,filename,subindex,instance,extrahash) + loadedstreams[hash] = loaded + end + return loaded +end + +hashes.streams = table.setmetatableindex(function(t,k) + local f = identifiers[k] + if f then + return loadstreamdata(f) + end +end) + +otf.loadoutlinedata = loadoutlinedata -- not public +otf.loadstreamdata = loadstreamdata -- not public +otf.loadshapes = loadshapes +otf.getstreamhash = getstreamhash -- not public, might move to other namespace diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx index 064f39b9d1d..c27b9513bdd 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx @@ -97,7 +97,7 @@ \to \everydefinefontsolution \permanent\protected\def\setfontsolution[#solution]% just one - {\edef\currentfontsolution{#solution}% + {\cdef\currentfontsolution{#solution}% \clf_setfontsolution {\currentfontsolution}% {% diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx index 49fa52d3882..7491150129d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx @@ -86,9 +86,12 @@ {\begincsname\??alternativestyle#name\endcsname} \appendtoks - \doifelse{\alternativestylesparameter\c!method}\v!auto - {\c_fonts_basics_alternative_style_method\plusone}% - {\c_fonts_basics_alternative_style_method\zerocount}% + \c_fonts_basics_alternative_style_method + \ifcstok{\alternativestylesparameter\c!method}\v!auto + \plusone + \else + \zerocount + \fi \to \everysetupalternativestyles %D Maybe too generic, but probably ok is the following. (Maybe one day we will use a @@ -178,12 +181,12 @@ %D The new one: -\setfalse\fontattributeisset +\newconditional\fontattributeisset \mutable\lettonothing\currentdetokenizedstyleparameter \permanent\protected\def\dousestyleparameter#value% - {\edef\currentstyleparameter{#value}% + {\cdef\currentstyleparameter{#value}% \ifempty\currentstyleparameter\else \expandafter\dousecurrentstyleparameter \fi} @@ -194,8 +197,8 @@ \fi} \permanent\protected\def\dousecurrentstyleparameter % empty check outside here - {\edef\currentdetokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}% - \settrue\fontattributeisset % reset is done elsewhere + {\cdef\currentdetokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}% + \fontattributeisset\conditionaltrue % reset is done elsewhere \ifcsname\??alternativestyle\currentdetokenizedstyleparameter\endcsname \lastnamedcs \orelse\ifcsname\currentdetokenizedstyleparameter\endcsname @@ -232,8 +235,7 @@ \appendtoks \letcsname\??stylecheck\currentstyle\endcsname\relax - \edef\p_method{\styleparameter\c!method}% - \ifx\p_method\v!command + \ifcstok{\styleparameter\c!method}\v!command \frozen\instance\protected\edefcsname\e!start\currentstyle\endcsname{\font_styles_apply_start{\currentstyle}}% \frozen\instance\protected\edefcsname\e!stop \currentstyle\endcsname{\font_styles_apply_stop}% \frozen\instance\protected\edefcsname \currentstyle\endcsname{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here @@ -249,12 +251,12 @@ \protected\def\font_styles_apply_grouped#name% assumes that the next is { or \bgroup {\bgroup % \beginsimplegroup - \def\currentstyle{\font_styles_use_defined{#name}}% + \cdef\currentstyle{\font_styles_use_defined{#name}}% \afterassignment\currentstyle \let\nexttoken} \protected\def\font_styles_use_defined#name% - {\edef\currentstyle{#name}% + {\cdef\currentstyle{#name}% \usestylestyleandcolor\c!style\c!color} \protected\def\font_styles_use_generic#specification% @@ -296,9 +298,6 @@ \defcsname\??stylehack\s!math\endcsname% dirty trick {\groupedcommandcs\normalstartimath\normalstopimath} -% \def\font_styles_assignment#specification{\groupedcommand{\font_styles_use_generic{#specification}}{}} -% \def\font_styles_direct #specification{\groupedcommand{\definedfont[#specification]}{}} - \def\font_styles_assignment#specification{\triggergroupedcommand{\font_styles_use_generic{#specification}}} \def\font_styles_direct #specification{\triggergroupedcommand{\definedfont[#specification]}} @@ -356,7 +355,7 @@ \permanent\tolerant\protected\def\definestylecollection[#name]% {\ifarguments\or - \setuvalue{#name}{\styleinstance[#name]}% + \protected\instance\edefcsname#name\endcsname{\styleinstance[#name]}% \frozen ? \def\font_styles_define_style_collection_a#style% {\def\font_styles_define_style_collection_b#alternative{\undefinevalue{\??stylecollection#name:#style:#alternative}}% \font_helpers_process_alternative_list\font_styles_define_style_collection_b @@ -401,8 +400,8 @@ %D \mathematics {\utfchar{0x2229}\vsone{}} %D \stoptyping -\permanent\protected\edef\vsone#character{#character\normalUchar"FE00 } % used -\permanent\protected\edef\vstwo#character{#character\normalUchar"FE01 } % not used but handy for testing +\permanent\protected\edef\vsone#character{#character\tocharacter"FE00 } % used +\permanent\protected\edef\vstwo#character{#character\tocharacter"FE01 } % not used but handy for testing %D For historic reasons we keep the following around but they are no longer that %D relevant for \MKIV. But \unknown\ they will be dropped in \LMTX ! @@ -426,7 +425,7 @@ \newconditional\c_font_styles_math \protected\def\font_styles_math_reset - {\setfalse\c_font_styles_math} + {\c_font_styles_math\conditionalfalse} \protected\def\font_styles_math_start {\ifconditional\c_font_styles_math @@ -440,6 +439,6 @@ \stopimath \fi} -\definealternativestyle[\v!math][\settrue\c_font_styles_math] +\definealternativestyle[\v!math][\c_font_styles_math\conditionaltrue] \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt index c8727de72b3..6cece4eaf69 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt @@ -28,9 +28,12 @@ local currentfont = font.current local makesetups = formatters["box:%s:%S"] +local a_exportstatus = attributes.private('exportstatus') + local function makeglyphbox(char,spec) token.expand_macro("makeglyphbox",true,spec.setups or tostring(char)) local b = tex.takebox("glyphbox") +-- b[a_exportstatus] = 0 spec.code = { width = b.width, height = b.height, @@ -85,18 +88,20 @@ local function setboxglyph(specification) end end -local function setboxdirectly(font,unicode,box) -- hash based on wd/ht/dp +local function setboxdirectly(font,unicode,box,expose) -- hash based on wd/ht/dp if box then local tfmdata = fontdata[font] local glyphboxes = (tfmdata.glyphboxes or 0) + 1 tfmdata.glyphboxes = glyphboxes local private = newprivateslot(formatters["BG:%05X"](glyphboxes)) +-- box[a_exportstatus] = 0 local newdata = { width = box.width or 0, height = box.height or 0, depth = box.depth or 0, unicode = unicode, objnum = tex.boxresources.save(box,nil,nil,true), + expose = expose, -- permit color etc } local specification = { code = newdata @@ -128,9 +133,7 @@ local function initializebox(tfmdata,kind,value) -- just preregister the list for char, spec in sortedhash(boxes) do spec.setups = makesetups(value,char) - if type(char) == "string" then - char = newprivateslot(name) - end + local char = type(char) == "string" and newprivateslot(name) or char -- check if spec.code register(font,char,function(font,char) local action = spec.action diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt index d6857b39ed1..393a255149e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt @@ -12,6 +12,7 @@ local next, type = next, type local match, format = string.match, string.format local concat, sortedhash = table.concat, table.sortedhash local idiv = number.idiv +local addsuffix = file.addsuffix local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end) local trace_features = false trackers.register("tfm.features", function(v) trace_features = v end) @@ -29,6 +30,8 @@ local readers = fonts.readers local constructors = fonts.constructors local encodings = fonts.encodings +local slotcommand = helpers.commands.slot + local tfm = constructors.handlers.tfm tfm.version = 1.000 tfm.maxnestingdepth = 5 @@ -150,7 +153,7 @@ local function read_from_tfm(specification) end local newtfmdata = (depth[filename] == 1) and tfm.reencode(tfmdata,specification) if newtfmdata then - tfmdata = newtfmdata + tfmdata = newtfmdata end local resources = tfmdata.resources or { } @@ -162,15 +165,15 @@ local function read_from_tfm(specification) shared.resources = resources -- properties.id = specification.id - properties.name = tfmdata.name -- todo: fallback - properties.fontname = tfmdata.fontname -- todo: fallback - properties.psname = tfmdata.psname -- todo: fallback - properties.fullname = tfmdata.fullname -- todo: fallback - properties.filename = specification.filename -- todo: fallback + properties.name = tfmdata.name -- todo: fallback + properties.fontname = tfmdata.fontname -- todo: fallback + properties.psname = tfmdata.psname -- todo: fallback + properties.fullname = tfmdata.fullname -- todo: fallback + properties.filename = tfmdata.filename -- todo: fallback properties.format = tfmdata.format or fonts.formats.tfm -- better than nothing - properties.usedbitmap = tfmdata.usedbitmap - properties.designsize = tfmdata.designsize -- let's be nice - parameters.designsize = tfmdata.designsize -- needed because of pdf position synchronzing + properties.usedbitmap = tfmdata.usedbitmap -- only one .. a bit weak when we have a vf then calls for bitmaps + properties.designsize = tfmdata.designsize -- let's be nice + parameters.designsize = tfmdata.designsize -- needed because of pdf position synchronzing -- if getmapentry and newtfmdata then properties.filename = features.pfbfile @@ -229,7 +232,7 @@ local function read_from_tfm(specification) -- otf.readers.unifymissing(tfmdata) -- - -- Next we fill in the gaps, based on names from teh agl. Probably not much will + -- Next we fill in the gaps, based on names from the agl. Probably not much will -- happen here. -- fonts.mappings.addtounicode(tfmdata,filename) @@ -246,9 +249,9 @@ local function read_from_tfm(specification) -- that information is not carried with those fonts (there is no name info, nor -- proper index info, nor unicodes at that end). So, we provide it ourselves. -- - if tfmdata.usedbitmap then - tfm.addtounicode(tfmdata) - end +-- if tfmdata.usedbitmap then +-- tfm.addtounicode(tfmdata) +-- end end -- shared.processes = next(features) and tfm.setfeatures(tfmdata,features) or nil @@ -272,8 +275,9 @@ local function read_from_tfm(specification) -- constructors.enhanceparameters(parameters) -- official copies for us -- - properties.private = properties.private or tfmdata.private or privateoffset + properties.private = properties.private or tfmdata.private or privateoffset -- +-- inspect(tfmdata.fonts) if newtfmdata then -- -- We do nothing as we assume flat tfm files. It would become real messy @@ -305,8 +309,42 @@ local function read_from_tfm(specification) properties.haskerns = true properties.hasligatures = true properties.hasitalics = true - resources.unicodes = { } - resources.lookuptags = { } + properties.bitmapped = tfmdata.bitmapped + properties.resolution = features.resolution or 7200 + -- + -- We support all kind of combinations but only because we want to + -- document it. Normally we only use 7200 dpi and default settings. + -- + local bitmap = features.bitmap + if bitmap == "cff" or bitmap == "outline" or bitmap == "pk" then + local resolution = features.resolution or 7200 + local settings = nil + local potrace = features.potrace + if potrace then + settings = utilities.parsers.settings_to_hash_colon_too(potrace) + settings.resolution = resolution + else + settings = {resolution = resolution } + end + if bitmap == "cff" then + parameters.size = parameters.size / 10 * 7200 / resolution + settings.bmp = "c" + properties.potrace = settings + elseif bitmap == "outline" then + settings.bmp = "o" + properties.potrace = settings + else + settings.bmp = "p" + end + properties.extrahash = table.sequenced(settings,",") -- or "" + else + end + -- + resources.unicodes = { } + resources.lookuptags = { } + -- +-- tfmdata.subfont = tfmdata.potraced and 1 or 0 -- for now, we'd better use a foo .. pk hash as with otf + tfmdata.subfont = 0 -- for now, we'd better use a foo .. pk hash as with otf -- depth[filename] = depth[filename] - 1 -- @@ -367,7 +405,7 @@ do local encdone = table.setmetatableindex("table") - function tfm.reencode(tfmdata,specification) + function tfm.reencode(tfmdata,specification) -- overlaps with lpdf-emb local features = specification.features @@ -385,11 +423,9 @@ do local encfile = features.reencode -- or features.enc local pfbfile = features.pfbfile -- or features.pfb local bitmap = features.bitmap -- or features.pk - if not encfile then return end - local pfbfile = pfbfile or outfiles[tfmfile] if pfbfile == nil then @@ -399,7 +435,7 @@ do pfbfile = tfmfile end if type(pfbfile) == "string" then - pfbfile = file.addsuffix(pfbfile,"pfb") + pfbfile = addsuffix(pfbfile,"pfb") -- pdf.mapline(tfmfile .. "<" .. pfbfile) report_tfm("using type1 shapes from %a for %a",pfbfile,tfmfile) else @@ -411,6 +447,7 @@ do local encoding = false local vector = false + local hash = false if type(pfbfile) == "string" then local pfb = constructors.handlers.pfb if pfb and pfb.loadvector then @@ -424,23 +461,29 @@ do end end if type(encfile) == "string" and encfile ~= "auto" then - encoding = fonts.encodings.load(file.addsuffix(encfile,"enc")) + encoding = fonts.encodings.load(addsuffix(encfile,"enc")) if encoding then + if not vector then + hash = encoding.hash -- works with duplicates as this one is sparse + end encoding = encoding.vector + -- if not vector then + -- vector = encoding -- only works when no duplicates + -- end end end + if not encoding then report_tfm("bad encoding for %a, quitting",tfmfile) return end - local unicoding = fonts.encodings.agl and fonts.encodings.agl.unicodes local virtualid = tfmcache[tfmdata] local tfmdata = table.copy(tfmdata) -- good enough for small fonts local characters = { } local originals = tfmdata.characters local indices = { } - local parentfont = { "font", 1 } -- can be zero (self referencing) + -- local parentfont = { "font", 1 } -- can be zero (self referencing) local private = tfmdata.privateoffset or constructors.privateoffset local reported = encdone[tfmfile][encfile] -- bah, encdone for tfm or pfb ? -- create characters table @@ -456,7 +499,8 @@ do v.order = k end - local backmap = vector and table.swapped(vector) + -- local backmap = vector and table.swapped(vector) + local backmap = vector and table.swapped(vector) or hash -- otherwise duplicates in cmr that overload local done = { } -- prevent duplicate for tfmindex, name in sortedhash(encoding) do -- predictable order @@ -478,8 +522,10 @@ do if backmap then original.index = backmap[name] -- the pfb index else -- probably bitmap - original.commands = { parentfont, charcommand[tfmindex] } -- or "slot" - original.oindex = tfmindex + -- original.commands = { parentfont, charcommand[tfmindex] } -- or "slot" + original.commands = slotcommand[tfmindex] + -- original.oindex = tfmindex + original.index = tfmindex end done[name] = true elseif not done[name] then @@ -491,10 +537,6 @@ do -- redo kerns and ligatures --- for k, v in next, characters do --- print(k,v.width) --- end - for k, v in next, characters do local kerns = v.kerns if kerns then @@ -540,15 +582,27 @@ do -- wrap up - tfmdata.fonts = { { id = virtualid } } + -- tfmdata.fonts = { { id = virtualid } } tfmdata.characters = characters tfmdata.fullname = tfmdata.fullname or tfmdata.name - tfmdata.psname = file.nameonly(pfbfile or tfmdata.name) - tfmdata.filename = pfbfile - -- tfmdata.format = bitmap and "type3" or "type1" + tfmdata.filename = pfbfile or tfmdata.name + tfmdata.psname = file.nameonly(tfmdata.filename) tfmdata.format = "type1" + + if bitmap == "outline" or bitmap == "potrace" then + tfmdata.potraced = true + bitmap = "pk" + elseif bitmap == "cff" then + tfmdata.potraced = true + tfmdata.format = "pkcff" + bitmap = false + else + tfmdata.filename = addsuffix(tfmdata.filename,"pfb") + end + tfmdata.usedbitmap = bitmap and virtualid tfmdata.private = private + tfmdata.bitmapped = bitmap and true or false return tfmdata end diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt index fc6789402fa..773067bbdf2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt @@ -20,6 +20,9 @@ local concat, insert, remove, copy = table.concat, table.insert, table.remove, t local tobitstring = number.tobitstring local formatters = string.formatters local round = math.round +local addsuffix, basename, nameonly, pathpart, joinfile = file.addsuffix, file.basename, file.nameonly, file.pathpart, file.join + +local findbinfile = resolvers.findbinfile local streams = utilities.streams local openstream = streams.open @@ -44,7 +47,7 @@ if not fonts then fonts = { handlers = { tfm = { } } } end local handlers = fonts.handlers local tfm = handlers.tfm or { } handlers.tfm = tfm -tfm.version = 1.006 +tfm.version = 1.007 local readers = tfm.readers or { } tfm.readers = readers @@ -52,6 +55,7 @@ tfm.readers = readers -- Performance is no real issue here so I didn't optimize too much. After -- all, these files are small and we mostly use opentype or type1 fonts. + do local function readbitmap(glyph,s,flagbyte) @@ -68,7 +72,7 @@ do bitweight = 16 inputbyte = readbyte(s) -- return extract(inputbyte,4,4) - return (inputbyte >> 4) & 0xF + return (inputbyte >> 4) & 0xF -- no need for & 0xF else bitweight = 0 return inputbyte & 15 @@ -77,7 +81,7 @@ do local function getbit() -- can be inlined -- bitweight = rshift(bitweight,1) - bitweight = (bitweight >> 1) & 0xFFFFFFFF + bitweight = (bitweight >> 1) & 0xFFFFFFFF -- no need for & if bitweight == 0 then -- actually we can check for 1 inputbyte = readbyte(s) bitweight = 128 @@ -85,34 +89,9 @@ do return inputbyte & bitweight end - local function pkpackednum() - local i = getnyb(s) - if i == 0 then - repeat - j = getnyb() - i = i + 1 - until (j ~= 0) - if i > 3 then - return handlehuge(i,j) - else - for i=1,i do - j = j * 16 + getnyb() - end - return j - 15 + (13 - dynf) * 16 + dynf - end - elseif i <= dynf then - return i - elseif i < 14 then - return (i - dynf - 1) * 16 + getnyb() + dynf + 1 - elseif i == 14 then - repeatcount = pkpackednum() - else - repeatcount = 1 - end - return realfunc() - end + local rest, handlehuge, pkpackednum - local function rest() + rest = function() if remainder < 0 then remainder = -remainder return 0 @@ -130,10 +109,10 @@ do end end - local function handlehuge(i,j) + handlehuge = function (i,j) while i ~= 0 do -- j = lshift(j,4) + getnyb() - j = ((j << 4) & 0xFFFFFFFF) + getnyb() + j = ((j << 4) & 0xFFFFFFFF) + getnyb() -- no need for & i = i - 1 end remainder = j - 15 + (13 - dynf) * 16 + dynf @@ -141,6 +120,33 @@ do return rest() end + pkpackednum = function() + local i = getnyb(s) + if i == 0 then + repeat + j = getnyb() + i = i + 1 + until (j ~= 0) + if i > 3 then + return handlehuge(i,j) + else + for i=1,i do + j = j * 16 + getnyb() + end + return j - 15 + (13 - dynf) * 16 + dynf + end + elseif i <= dynf then + return i + elseif i < 14 then + return (i - dynf - 1) * 16 + getnyb() + dynf + 1 + elseif i == 14 then + repeatcount = pkpackednum() + else + repeatcount = 1 + end + return realfunc() + end + local gpower = { [0] = 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, @@ -174,7 +180,7 @@ do word = word + wordweight end -- wordweight = rshift(wordweight,1) - wordweight = (wordweight >> 1) & 0xFFFFFFFF + wordweight = (wordweight >> 1) & 0xFFFFFFFF -- no need for & if wordweight == 0 then r = r + 1 raster[r] = word @@ -242,10 +248,7 @@ do end - function readers.showpk(glyph) - local xsize = glyph.xsize - local ysize = glyph.ysize - local stream = glyph.stream + local function showpk(stream,xsize,ysize,oneline) local result = { } local rr = { } local r = 0 @@ -264,17 +267,25 @@ do if extra then r = r + 1 ; rr[r] = tobitstring(b,16,16) else - -- r = r + 1 ; rr[r] = tobitstring(extract(b,8+(8-cw),cw),cw,cw) - r = r + 1 ; rr[r] = tobitstring((b >> (8+(8-cw))) &~ (-1 << cw),cw,cw) + r = r + 1 ; rr[r] = tobitstring(b>>8,8,8) end result[y] = concat(rr) end - return concat(result,"\n") + if oneline then + return concat(result),ysize > 0 and #result[1]or 0,ysize + else + return concat(result,"\n") + end + end + + function readers.showpk(glyph,oneline) + if glyph then + return showpk(glyph.stream,glyph.xsize,glyph.ysize,oneline) + end end local template = formatters [ [[ -%.3N 0 %i %i %i %i d1 -q +%N 0 %i %i %i %i d1 %i 0 0 %i %i %i cm BI /W %i @@ -283,22 +294,22 @@ BI /BPC 1 /D [1 0] ID %t -EI -Q]] ] +EI]] ] function readers.pktopdf(glyph,data,factor) local width = data.width * factor +width = round(width) local xsize = glyph.xsize or 0 local ysize = glyph.ysize or 0 local xoffset = glyph.xoffset or 0 local yoffset = glyph.yoffset or 0 local stream = glyph.stream - local dpi = 1 - local newdpi = 1 - - local xdpi = dpi * xsize / newdpi - local ydpi = dpi * ysize / newdpi + -- local dpi = 1 + -- local newdpi = 1 + -- + -- local xdpi = dpi * xsize / newdpi + -- local ydpi = dpi * ysize / newdpi local llx = - xoffset local lly = yoffset - ysize + 1 @@ -315,121 +326,177 @@ Q]] ] for y=1,ysize do for x=1,rw-1 do s = s + 1 ; b = stream[s] - -- r = r + 1 ; result[r] = char(extract(b,8,8),extract(b,0,8)) - r = r + 1 ; result[r] = char((b >> 8) & 0xFF,b & 0xFF) +-- r = r + 1 ; result[r] = char(extract(b,8,8),extract(b,0,8)) + r = r + 1 ; result[r] = char((b >> 8) & 0xFF,b & 0xFF) end s = s + 1 ; b = stream[s] if extra then - -- r = r + 1 ; result[r] = char(extract(b,8,8),extract(b,0,8)) - r = r + 1 ; result[r] = char((b >> 8) & 0xFF,b & 0xFF) +-- r = r + 1 ; result[r] = char(extract(b,8,8),extract(b,0,8)) + r = r + 1 ; result[r] = char((b >> 8) & 0xFF,b & 0xFF) else - -- r = r + 1 ; result[r] = char(extract(b,8,8)) - r = r + 1 ; result[r] = char((b >> 8) & 0xFF) +-- r = r + 1 ; result[r] = char(extract(b,8,8)) + r = r + 1 ; result[r] = char((b >> 8) & 0xFF) end end - return template(width,llx,lly,urx,ury,xdpi,ydpi,llx,lly,xsize,ysize,result), width + -- return template(width,llx,lly,urx,ury,xdpi,ydpi,llx,lly,xsize,ysize,result), width + return template(width,llx,lly,urx,ury,xsize,ysize,llx,lly,xsize,ysize,result), width end - function readers.loadpk(filename) - local s = openstream(filename) - local preamble = readcardinal1(s) - local version = readcardinal1(s) - local comment = readstring(s,readcardinal1(s)) - local designsize = readcardinal4(s) - local checksum = readcardinal4(s) - local hppp = readcardinal4(s) - local vppp = readcardinal4(s) - if preamble ~= 247 or version ~= 89 or not vppp then - return { error = "invalid preamble" } + local template = formatters [ [[ +%N 0 %N %N %N %N d1 +1 0 0 1 %N %N cm +%t h f +]] ] + +-- S + + local f_curveto = formatters["%N %N %N %N %N %N c"] + local f_moveto = formatters["%N %N m"] + local f_lineto = formatters["%N %N l"] + + function readers.potracedtopdf(glyph,data,factor,settings) + local width = data.width * factor +-- width = round(10*width/65536) +width = round(width) + local xsize = glyph.xsize or 0 + local ysize = glyph.ysize or 0 + local xoffset = glyph.xoffset or 0 + local yoffset = glyph.yoffset or 0 + local stream = glyph.stream + + local llx = - xoffset + local lly = yoffset - ysize + 1 + local urx = llx + xsize + 1 + local ury = lly + ysize + + local bytes, w, h = showpk(stream,xsize,ysize,true) + local result = potrace.convert(bytes,settings,w,h) + if result then + for i=1,#result do + local ri = result[i] + local ni = #ri + for j=1,ni do + local tj = ri[j] + local nj = #tj + local x1 = tj[1] + local y1 = tj[2] + if nj == 6 then + ri[j] = f_curveto(tj[3],tj[4],tj[5],tj[6],x1,y1) + elseif j == 1 then + ri[j] = f_moveto(x1,y1) + else + ri[j] = f_lineto(x1,y1) + end + end + ri[ni+1] = " " + result[i] = concat(ri," ") + end +llx = round(llx) +lly = round(lly) +urx = round(urx) +ury = round(ury) + return template(width,llx,lly,urx,ury,llx,lly,result), width end - local glyphs = { } - local data = { - designsize = designsize, - comment = comment, - hppp = hppp, - vppp = vppp, - glyphs = glyphs, - } - while true do - local flagbyte = readcardinal1(s) - if flagbyte < 240 then - local c = flagbyte & 7 - local length, index, width, pixels, xsize, ysize, xoffset, yoffset - if c >= 0 and c <= 3 then - length = (flagbyte & 7) * 256 + readcardinal1(s) - 3 - index = readcardinal1(s) - width = readinteger3(s) - pixels = readcardinal1(s) - xsize = readcardinal1(s) - ysize = readcardinal1(s) - xoffset = readcardinal1(s) - yoffset = readcardinal1(s) - if xoffset > 127 then - xoffset = xoffset - 256 + + end + + function readers.loadpk(filename) + local s = openstream(filename) + if s then + local preamble = readcardinal1(s) + local version = readcardinal1(s) + local comment = readstring(s,readcardinal1(s)) + local designsize = readcardinal4(s) + local checksum = readcardinal4(s) + local hppp = readcardinal4(s) + local vppp = readcardinal4(s) + if preamble ~= 247 or version ~= 89 or not vppp then + return { error = "invalid preamble" } + end + local glyphs = { } + local data = { + designsize = designsize, + comment = comment, + hppp = hppp, + vppp = vppp, + glyphs = glyphs, + resolution = round(72.27*hppp/65536), + } + while true do + local flagbyte = readcardinal1(s) + if flagbyte < 240 then + local c = flagbyte & 7 + local length, index, width, pixels, xsize, ysize, xoffset, yoffset + if c >= 0 and c <= 3 then + length = (flagbyte & 7) * 256 + readcardinal1(s) - 3 + index = readcardinal1(s) + width = readinteger3(s) + pixels = readcardinal1(s) + xsize = readcardinal1(s) + ysize = readcardinal1(s) + xoffset = readinteger1(s) + yoffset = readinteger1(s) + elseif c >= 4 and c <= 6 then + length = (flagbyte & 3) * 65536 + readcardinal1(s) * 256 + readcardinal1(s) - 4 + index = readcardinal1(s) + width = readinteger3(s) + pixels = readcardinal2(s) + xsize = readcardinal2(s) + ysize = readcardinal2(s) + xoffset = readinteger2(s) + yoffset = readinteger2(s) + else -- 7 + length = readcardinal4(s) - 9 + index = readcardinal4(s) + width = readinteger4(s) + pixels = readcardinal4(s) + readcardinal4(s) + xsize = readcardinal4(s) + ysize = readcardinal4(s) + xoffset = readinteger4(s) + yoffset = readinteger4(s) end - if yoffset > 127 then - yoffset = yoffset - 256 + local glyph = { + index = index, + width = width, + pixels = pixels, + xsize = xsize, + ysize = ysize, + xoffset = xoffset, + yoffset = yoffset, + } + if length <= 0 then + data.error = "bad packet" + return data end - elseif c >= 4 and c <= 6 then - length = (flagbyte & 3) * 65536 + readcardinal1(s) * 256 + readcardinal1(s) - 4 - index = readcardinal1(s) - width = readinteger3(s) - pixels = readcardinal2(s) - xsize = readcardinal2(s) - ysize = readcardinal2(s) - xoffset = readcardinal2(s) - yoffset = readcardinal2(s) - else -- 7 - length = readcardinal4(s) - 9 - index = readcardinal4(s) - width = readinteger4(s) - pixels = readcardinal4(s) - readcardinal4(s) - xsize = readcardinal4(s) - ysize = readcardinal4(s) - xoffset = readcardinal4(s) - yoffset = readcardinal4(s) - end - local glyph = { - index = index, - width = width, - pixels = pixels, - xsize = xsize, - ysize = ysize, - xoffset = xoffset, - yoffset = yoffset, - } - if length <= 0 then - data.error = "bad packet" - return data + readbitmap(glyph,s,flagbyte) + glyphs[index] = glyph + elseif flagbyte == 240 then + -- k[1] x[k] + skipbytes(s,readcardinal1(s)) + elseif flagbyte == 241 then + -- k[2] x[k] + skipbytes(s,readcardinal2(s)*2) + elseif flagbyte == 242 then + -- k[3] x[k] + skipbytes(s,readcardinal3(s)*3) + elseif flagbyte == 243 then + -- k[4] x[k] + skipbytes(s,readcardinal4(s)*4) -- readinteger4 + elseif flagbyte == 244 then + -- y[4] + skipbytes(s,4) + elseif flagbyte == 245 then + break + elseif flagbyte == 246 then + -- nop + else + data.error = "unknown pk command" + break end - readbitmap(glyph,s,flagbyte) - glyphs[index] = glyph - elseif flagbyte == 240 then - -- k[1] x[k] - skipbytes(s,readcardinal1(s)) - elseif flagbyte == 241 then - -- k[2] x[k] - skipbytes(s,readcardinal2(s)*2) - elseif flagbyte == 242 then - -- k[3] x[k] - skipbytes(s,readcardinal3(s)*3) - elseif flagbyte == 243 then - -- k[4] x[k] - skipbytes(s,readcardinal4(s)*4) -- readinteger4 - elseif flagbyte == 244 then - -- y[4] - skipbytes(s,4) - elseif flagbyte == 245 then - break - elseif flagbyte == 246 then - -- nop - else - data.error = "unknown pk command" - break end + return data end - return data end end @@ -492,7 +559,7 @@ do local filesize = fileattr and fileattr.size or 0 local filetime = fileattr and fileattr.modification or 0 local fileformat = "tfm" - local filehash = cleanname(file.basename(filename)) + local filehash = cleanname(basename(filename)) -- data = caching and containers.read(filecache,filehash) -- @@ -878,9 +945,19 @@ do if op >= 128 then local kern = allkerns[256 * (op - 128) + rem] if nxt == bchar then - kerns[rightboundary] = kern + local k = kerns[rightboundary] + if k then + logs.report("tfm reader","duplicate boundary for index 0x%X: %p -> %p",i,rightboundary,k,kern) + else + kerns[rightboundary] = kern + end + end + local k = kerns[nxt] + if k then + logs.report("tfm reader","duplicate between index 0x%X and 0x%X: %p -> %p",i,nxt,k,kern) + else + kerns[nxt] = kern end - kerns[nxt] = kern else local ligature = { type = op * 2 + 1, char = rem } if nxt == bchar then @@ -919,8 +996,8 @@ do -- end -- data = { - name = file.nameonly(filename), - fontarea = file.pathpart(filename), + name = nameonly(filename), + fontarea = pathpart(filename), glyphs = glyphs, parameters = parameters, designsize = designsize, @@ -1267,8 +1344,8 @@ do return data else return { - name = file.nameonly(filename), - fontarea = file.pathpart(filename), + name = nameonly(filename), + fontarea = pathpart(filename), glyphs = glyphs, designsize = designsize, header = header, @@ -1280,9 +1357,9 @@ do -- the replacement loader (not sparse): function readers.loadtfmvf(tfmname,size) - local vfname = file.addsuffix(file.nameonly(tfmfile),"vf") + local vfname = addsuffix(nameonly(tfmfile),"vf") local tfmfile = tfmname - local vffile = resolvers.findbinfile(vfname,"ovf") + local vffile = findbinfile(vfname,"ovf") if tfmfile and tfmfile ~= "" then if size < 0 then size = (65536 * -size) // 100 @@ -1389,6 +1466,16 @@ do end +function resolvers.findpk(font,resolution) + local filename = addsuffix(font,(resolution or "") .. "pk") + local fullname = findbinfile(filename) or "" + if fullname == "" then + filename = addsuffix(font,"pk") + fullname = findbinfile(filename) or "" + end + return fullname +end + -- inspect(readers.loadtfmvf(resolvers.findfile("mi-iwonari.tfm"))) -- inspect(readers.loadtfm(resolvers.findfile("texnansi-palatinonova-regular.tfm"))) -- inspect(readers.loadtfm(resolvers.findfile("cmex10.tfm"))) diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt index fa0e3c494bd..b28b7c4e3a2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt @@ -785,8 +785,8 @@ end -- optimize for zero -local c_zero = char(0) -local s_zero = char(0,0) +local c_zero = char(0) +local s_zero = char(0,0) -- local shorthash = setmetatableindex(function(t,k) -- -- t[k] = char(band(rshift(k,8),0xFF),band(k,0xFF)) return t[k] diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt index c42a3a655e3..0d691436f8c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt @@ -114,15 +114,15 @@ local startofpar = nuts.startofpar local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue -local disc_code = nodecodes.disc -local kern_code = nodecodes.kern -local math_code = nodecodes.math -local dir_code = nodecodes.dir -local par_code = nodecodes.par - -local righttoleft_code = tex.directioncodes.righttoleft +local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue +local disc_code = nodecodes.disc +local kern_code = nodecodes.kern +local math_code = nodecodes.math +local dir_code = nodecodes.dir +local par_code = nodecodes.par + +local righttoleft_code = tex.directioncodes.righttoleft local txtdirstate = otf.helpers.txtdirstate local pardirstate = otf.helpers.pardirstate diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx index aeec18054d4..afe24fce25f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx @@ -56,4 +56,38 @@ % we can use an indirect mapping for fontclasses (map string onto numbers) and indeed this % is somewhat more efficient but also makes the code messy ... maybe some day ... +\newtoks\everycompactfontmode + +\newconditional\c_font_compact + +\appendtoks + \c_font_compact\conditionaltrue +\to \everycompactfontmode + +\protected\def\font_enable_compact_font_mode + {\ifcase\currentgrouplevel + \the\everycompactfontmode + \global\everycompactfontmode\emptytoks + \glettonothing\font_enable_compact_font_mode + \writestatus\m!fonts\empty + \writestatus\m!fonts{compact font mode enabled}% + \writestatus\m!fonts\empty + \else + \font_ignore_compact_font_mode + \font_enable_compact_font_mode + \fi} + +\protected\def\font_ignore_compact_font_mode + {\gdef\font_enable_compact_font_mode + {\writestatus\m!fonts\empty + \writestatus\m!fonts{compact font mode cannot be enabled}% + \writestatus\m!fonts\empty + \glettonothing\font_enable_compact_font_mode + \glettonothing\font_ignore_compact_font_mode}} + +\installtexexperiment + {fonts.compact} + {\font_enable_compact_font_mode} + {} + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt b/Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt index 49b37930470..fb3b35c594f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt @@ -21,7 +21,6 @@ local texsp = tex.sp local fontgoodies = fonts.goodies or { } local findfile = resolvers.findfile - local typefaces = fonts.typefaces or { } fonts.typefaces = typefaces @@ -125,14 +124,27 @@ end fontgoodies.register("filenames", initialize) +local getfilename = fonts.names.getfilename + function fontgoodies.filenames.resolve(name) local fd = filedata[name] if fd and findfile(name) == "" then + -- maybe not: + name = getfilename(name) + if findfile(name) ~= "" then + return name + end + -- till here for i=1,#fd do local fn = fd[i] if findfile(fn) ~= "" then return fn end + -- new: + fn = getfilename(fn) + if findfile(fn) ~= "" then + return fn + end end elseif filesuffix(name) == "any" then -- This is a bit weird place but it's a kind of fallback option in case @@ -198,7 +210,7 @@ function fontgoodies.designsizes.register(name,size,specification) end function fontgoodies.designsizes.filename(name,spec,size,force) -- returns nil of no match - local data = designdata[lower(name)] + local data = name and designdata[lower(name)] if data then if not spec or spec == "" or spec == "default" then return data.default diff --git a/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt b/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt index 6b0c320b247..552203ba9a0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt @@ -64,6 +64,8 @@ end fontgoodies.register("mathematics", initialize) +-- This is used in the koeieletters font: + local function mathradicalaction(n,h,v,font,mchar,echar) local characters = fontcharacters[font] local mchardata = characters[mchar] diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt index 505599fff18..bfef34c855b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt @@ -15,14 +15,14 @@ local trace = false trackers.register("figures.merging", function(v) trace = v local report = logs.reporter("backend","merging") local function mergegoodies(optionlist) - local options = settings_to_hash(optionlist) - local yes = options[variables.yes] - local all = options[variables.all] + local options = settings_to_hash(optionlist) + local yes = options[variables.yes] + local all = options[variables.all] if next(options) then report("% t",table.sortedkeys(options)) end if all or yes or options[variables.reference] then - codeinjections.mergereferences() + codeinjections.mergereferences(nil,options) -- first can be specification end if all or options[variables.comment] then codeinjections.mergecomments() @@ -30,8 +30,8 @@ local function mergegoodies(optionlist) if all or yes or options[variables.bookmark] then codeinjections.mergebookmarks() end - if all or options[variables.field] then - codeinjections.mergefields() + if all or options[variables.field] or options[variables.data] then + codeinjections.mergefields(nil,options[variables.data]) end if all or options[variables.layer] then codeinjections.mergeviewerlayers() diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl index a26ee3235f0..ab432da7f28 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl @@ -41,7 +41,11 @@ \appendtoks \iflocation - \doif\figurefiletype{pdf}{\doifnot{\externalfigureparameter\c!interaction}\v!none\grph_epdf_add_overlay}% + \iftok{\figurefiletype}{pdf}% a lua call + \ifcstok{\externalfigureparameter\c!interaction}\v!none\else + \grph_epdf_add_overlay + \fi + \fi \fi \to \externalfigurepostprocessors @@ -72,6 +76,26 @@ \definesymbol[Draft] [\epdfstampsymbol{Draft}] \definesymbol[ForPublicRelease] [\epdfstampsymbol{ForPublicRelease}] +%D For team Ramkumar: + +\defineframed + [epdftextfield] + [\c!frame=\v!off, + \c!offset=\v!overlay, + \c!foregroundstyle=\epdffieldfont, + \c!align={\v!middle,\v!lohi}] + +\defineframed + [epdflinefield] + [\c!frame=\v!off, + \c!offset=\v!overlay, + \c!foregroundstyle=\epdffieldfont, + \c!align={\v!middle,\v!lohi}] + +\definefont + [epdffieldfont] + [\directframedparameter{epdf:font}*\s!default\space @ \directframedparameter{epdf:size}] + \protect \endinput % /Properties << /xxxx 22 0 R >> diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl index e25c9cf3291..e7bf209d271 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl @@ -36,7 +36,7 @@ \permanent\protected\def\typesetbuffer {\bgroup\setconstant\c_grph_buffers_mode\plusone \grph_buffers_typeset} \permanent\protected\def\typesetbufferonly{\bgroup\setconstant\c_grph_buffers_mode\zerocount\grph_buffers_typeset} -\tolerant\permanent\protected\def\grph_buffers_typeset[#1]#*[#2]% +\tolerant\permanent\protected\def\grph_buffers_typeset[#1]#*[#S#2]% {\ifparameters \grph_buffers_typeset_indeed\jobname\empty \or @@ -50,7 +50,9 @@ \fi} \def\grph_buffers_typeset_indeed#1#2% we could use the via files - {\doifnot{#1}{*}{\xdef\lasttypesetbuffer{\clf_typesetbuffer{#1}}}% + {\iftok{#1}{*}\else + \xdef\lasttypesetbuffer{\clf_typesetbuffer{#1}}% + \fi \ifcase\c_grph_buffers_mode % typesetonly \or @@ -58,7 +60,7 @@ \fi \egroup} -\tolerant\permanent\protected\def\runbuffer[#1]#*[#2]% +\tolerant\permanent\protected\def\runbuffer[#1]#*[#S#2]% {\xdef\lasttypesetbuffer{\clf_runbuffer{#1}{#2}}} % For manuals and such: @@ -77,12 +79,12 @@ \installcorenamespace{typesettingfile} -\tolerant\permanent\protected\def\definetypesetting[#1]#*[#2]#*[#3]% options settings-a +\tolerant\permanent\protected\def\definetypesetting[#1]#*[#2]#*[#S#3]% options settings-a {\ifparameter#1\or \frozen\instance\protected\defcsname\??typesettingfile#1\endcsname{\grph_typesetting_process_indeed{#2}{#3}}% \fi} -\tolerant\permanent\protected\def\typesetfile[#1]#*[#2]#*[#3]% filename settings-b | filename options settings +\tolerant\permanent\protected\def\typesetfile[#1]#*[#S#2]#*[#S#3]% filename settings-b | filename options settings {\ifcsname\??typesettingfile#1\endcsname \lastnamedcs{#2}{#3}% \orelse\ifparameter#3\or @@ -154,10 +156,10 @@ \ifvoid\b_grph_steps_colorbar\else\box\b_grph_steps_colorbar\fi \egroup} -\protected\def\grph_steps_one_referring(#1,#2)#*(#3,#4)#*[#5]% +\protected\def\grph_steps_one_referring(#1,#2)#*(#3,#4)#*[#S#5]% {\position(#1,#2){\grph_steps_goto(#3,#4){\externalfigureparameter\c!frames}[#5]}} -\protected\def\grph_steps_one_marking(#1,#2)#*(#3,#4)#*[#5]% +\protected\def\grph_steps_one_marking(#1,#2)#*(#3,#4)#*[#S#5]% {\position(#1,#2){\grph_steps_this_is(#3,#4){\externalfigureparameter\c!frames}[#5]}} \protected\def\grph_steps_one_remark (#-,#-)#*(#-,#-)#*[#-]#*#:#-{}% (x,y)(h,b)[...]{tekst} @@ -184,10 +186,12 @@ \endgraf} \permanent\protected\def\startfigure[#1]#*[#2]#*[#3]#:#4\stopfigure - {\doifelse{\externalfigureparameter\c!option}\v!test - {\grph_steps_test_figure{#1}{#2}{#3}{#4}% - \letexternalfigureparameter\c!frames\v!on}% - {\letexternalfigureparameter\c!frames\v!off}% + {\ifcstok{\externalfigureparameter\c!option}\v!test + \grph_steps_test_figure{#1}{#2}{#3}{#4}% + \letexternalfigureparameter\c!frames\v!on + \else + \letexternalfigureparameter\c!frames\v!off + \fi \tolerant\defcsname\??externalfigureinstance#1\endcsname[##1]% {\grph_steps_place_figure{#1}{#2}{#3}{#4}{##1}% % this is a dirty hack but ok for an old macro @@ -244,7 +248,7 @@ \setbox\scratchboxtwo\vbox % \vpack ? {\forgetall \begingroup - \tfa\doifelsenothing{#1}{#2}{#1}% + \tfa\ifempty{#1}#1\else#2\fi \endgroup \blank \tfxx#4% @@ -302,7 +306,7 @@ \d_grph_steps_y\figureheight \divideby\d_grph_steps_y \externalfigureparameter\c!ymax\relax \fi} -\tolerant\def\grph_steps_comment#1(#2,#3)#*(#4,#5)#*[#6]#*#:#7% {kader}(x,y)(h,b)[...]{tekst} +\tolerant\def\grph_steps_comment#1(#2,#3)#*(#4,#5)#*[#S#6]#*#:#7% {kader}(x,y)(h,b)[...]{tekst} {\position(#2,#3)% {\setnostrut \framed[\c!width=#4\d_grph_steps_x,\c!height=#5\d_grph_steps_y,\c!offset=\v!none,\c!frame=#1,#6]{#7}}} diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt index e55ac471b1e..33c9af2efef 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt @@ -47,25 +47,28 @@ run TeX code from within Lua. Some more functionality will move to Lua. local tonumber, tostring, next, unpack = tonumber, tostring, next, unpack local format, lower, find, match, gsub = string.format, string.lower, string.find, string.match, string.gsub -local longtostring = string.longtostring +local longtostring, texhashed = string.longtostring, string.texhashed local contains = table.contains local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys -local concat, insert, remove = table.concat, table.insert, table.remove +local concat, insert, remove, unique = table.concat, table.insert, table.remove, table.unique local todimen = string.todimen local collapsepath = file.collapsepath local formatters = string.formatters local odd = math.odd local isfile, isdir, modificationtime = lfs.isfile, lfs.isdir, lfs.modification +local joinfile, is_qualified_path = file.join, file.is_qualified_path local P, R, S, Cc, C, Cs, Ct, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.Cc, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.match local settings_to_array = utilities.parsers.settings_to_array local settings_to_hash = utilities.parsers.settings_to_hash +local settings_to_set = utilities.parsers.settings_to_set local allocate = utilities.storage.allocate local setmetatableindex = table.setmetatableindex local replacetemplate = utilities.templates.replace -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp +local maxdimen = tex.magicconstants.maxdimen images = images or { } local images = images @@ -105,15 +108,16 @@ local report = logs.reporter("graphics") local report_inclusion = logs.reporter("graphics","inclusion") local f_hash_part = formatters["%s->%s->%s->%s"] -local f_hash_full = formatters["%s->%s->%s->%s->%s->%s->%s->%s"] +local f_hash_full = formatters["%s->%s->%s->%s->%s->%s->%s->%s->%s->%s"] -local v_yes = variables.yes -local v_global = variables["global"] -local v_local = variables["local"] -local v_default = variables.default -local v_auto = variables.auto - -local maxdimen = tex.magicconstants.maxdimen -- 0x3FFFFFFF -- 2^30-1 +local v_yes = variables.yes +local v_always = variables.always +local v_embed = variables.embed +local v_fix = variables.fix +local v_global = variables["global"] +local v_local = variables["local"] +local v_default = variables.default +local v_auto = variables.auto local ctx_doscalefigure = context.doscalefigure local ctx_relocateexternalfigure = context.relocateexternalfigure @@ -539,7 +543,9 @@ function figures.setpaths(locationset,pathlist) -- this function can be called each graphic so we provide this optimization return end - local t, h = figure_paths, settings_to_hash(locationset) + local t = figure_paths + local h = settings_to_hash(locationset) + local p = environment.arguments.path if last_locationset ~= locationset then -- change == reset (actually, a 'reset' would indeed reset if h[v_local] then @@ -549,6 +555,11 @@ function figures.setpaths(locationset,pathlist) end figures.defaultsearch = h[v_default] last_locationset = locationset + if p then + for i=1,#t do + t[#t+1] = joinfile(p,t[i]) + end + end end if h[v_global] then local list = settings_to_array(pathlist) @@ -558,11 +569,19 @@ function figures.setpaths(locationset,pathlist) t[#t+1] = s end end + if p then + for i=1,#t do + if not is_qualified_path(t[i]) then + t[#t+1] = joinfile(p,t[i]) + end + end + end end -- new - if environment.arguments.path then - table.insert(t,1,environment.arguments.path) + if p then + insert(t,1,p) end + t = unique(t) -- figure_paths = t last_pathlist = pathlist @@ -658,7 +677,7 @@ function figures.initialize(request) request.cache = request.cache ~= "" and request.cache request.prefix = request.prefix ~= "" and request.prefix request.format = request.format ~= "" and request.format - request.compact = request.compact == v_yes + request.compact = backends.codeinjections.validcompactor(request.compact) table.merge(figuredata.request,request) end return figuredata @@ -689,12 +708,17 @@ function figures.setconversion(format,conversion) conversions[format] = conversion end +local hash = { name = true, label = true, fullname = true } + local function get(category,tag,default) local value = lastfiguredata and lastfiguredata[category] value = value and value[tag] if not value or value == "" or value == true then return default or "" else + if hash[tag] then + value = texhashed(value) + end return value end end @@ -1512,6 +1536,7 @@ function checkers.generic(data) -- called by checkers.pdf/png/jpg local size = dr.size or "crop" local color = dr.color or "natural" local mask = dr.mask or "none" + local range = dr.range or "none" local crop = dr.crop or "none" local conversion = dr.conversion local resolution = dr.resolution @@ -1534,6 +1559,7 @@ function checkers.generic(data) -- called by checkers.pdf/png/jpg size, color, mask, + range, crop, conversion, resolution, @@ -1578,6 +1604,12 @@ function checkers.generic(data) -- called by checkers.pdf/png/jpg -- tricky as img doesn't allow it f.attr = figure.attr end + if figure.newmask then + f.newmask = figure.newmask + end + if figure.newranges then + f.newranges = figure.newranges + end if dr.cmyk == v_yes then f.enforcecmyk = true elseif dr.cmyk == v_auto and attributes.colors.model == "cmyk" then @@ -2130,6 +2162,7 @@ implement { { "preview" }, { "display" }, { "mask" }, + { "range" }, { "crop" }, { "conversion" }, { "resolution" }, @@ -2139,6 +2172,7 @@ implement { { "repeat" }, { "transform" }, { "compact" }, + { "metadata" }, { "width", "dimen" }, { "height", "dimen" }, { "userpassword" }, @@ -2309,3 +2343,34 @@ do } end + +local function register(name,specification,setter) + -- could be a helper + specification = loadstring("return " .. specification) + if type(specification) == "function" then + specification = specification() + if specification then + setter(name,specification) + end + end +end + +implement { + name = "registerfiguremask", + public = true, + protected = true, + arguments = { "optional", "string" }, -- "lua" + actions = function(name,specification) + register(name,specification,codeinjections.registerfiguremask) + end +} + +implement { + name = "registerfigurerange", + public = true, + protected = true, + arguments = { "optional", "string" }, -- "lua" + actions = function(name,specification) + register(name,specification,codeinjections.registerfigurerange) + end +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl index b8fd40a8991..45723eace38 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl @@ -62,6 +62,7 @@ \c!file =, \c!display =, \c!mask =, + \c!range =, \c!preset =\v!yes, \c!split =, \c!color =, @@ -113,6 +114,7 @@ \c!userpassword =, \c!ownerpassword =, \c!compact =, + \c!metadata =\v!page, % page | document | yes | no \c!cmyk =, \c!crop =\v!yes, ] @@ -176,8 +178,8 @@ \installtextracker {graphics.inheritance} - {\settrue \c_grph_include_trace_inheritance} - {\setfalse\c_grph_include_trace_inheritance} + {\c_grph_include_trace_inheritance\conditionaltrue} + {\c_grph_include_trace_inheritance\conditionalfalse} \installcorenamespace{externalfiguredefinition} @@ -187,16 +189,16 @@ % label file settings % label file parent -\permanent\tolerant\protected\def\useexternalfigure[#1]#*[#2]#*[#3]#*[#4]% - {\iftok{#1}\emptytoks - \iftok{#2}\emptytoks\else +\permanent\tolerant\protected\def\useexternalfigure[#1]#*[#2]#*[#S#3]#*[#S#4]% + {\ifempty{#1}% + \ifempty{#2}\else \ifhastok={#3}% \grph_include_use_indeed{#2}{#2}{#3}{#4}% \else \grph_include_use_indeed{#2}{#2}\empty{#4}% \fi \fi - \orelse\iftok{#2}\emptytoks + \orelse\ifempty{#2}% \ifhastok={#3}% \grph_include_use_indeed{#1}{#1}\empty{#3}% \else @@ -211,12 +213,12 @@ \fi} \def\grph_include_use_indeed#1#2#3#4% - {\dodoglobal\defcsname\??externalfigureinstance#1\endcsname{\grph_include_setup{#2}{#3}{#4}}% + {\gdefcsname\??externalfigureinstance#1\endcsname{\grph_include_setup{#2}{#3}{#4}}% \grph_include_analyze_collection[#2][#4]} % inclusion -\permanent\tolerant\protected\def\externalfigure[#1]#,[#2]#,[#3]% +\permanent\tolerant\protected\def\externalfigure[#1]#,[#2]#,[#S#3]% {\ifhastok={#2}% \grph_include_place[#1][][#2]% \else @@ -226,8 +228,8 @@ % todo: chain them \def\grph_include_setup#1#2#3% name parent settings - {\edef\m_grph_include_name {#1}% - \edef\m_grph_include_parent{#2}% + {\cdef\m_grph_include_name {#1}% + \cdef\m_grph_include_parent{#2}% \ifempty\m_grph_include_name \else \let\p_grph_include_name\m_grph_include_name \fi @@ -272,13 +274,13 @@ \grph_include_inherit_from_parent\p_grph_include_label \fi} -\def\grph_include_place[#1][#2][#3]% [label][file][settings] | [file][settings] | [file][parent][settings] +\def\grph_include_place[#1][#S#2][#S#3]% [label][file][settings] | [file][settings] | [file][parent][settings] {\bgroup \advanceby\c_grph_include_nesting\plusone - \edef\currentexternalfigure{\the\c_grph_include_nesting}% + \cdef\currentexternalfigure{\the\c_grph_include_nesting}% \checkexternalfigureparent % each inherits from the root % - \the\everyexternalfigureresets + \expand\everyexternalfigureresets % \edef\p_grph_include_label{#1}% \let\p_grph_include_name\p_grph_include_label @@ -297,9 +299,9 @@ \setupcurrentexternalfigure[#3]% \fi % - \the\everyexternalfigurechecks + \expand\everyexternalfigurechecks % - \the\t_grph_include_local_settings + \expand\t_grph_include_local_settings % \edef\p_width {\externalfigureparameter\c!width}% \edef\p_height {\externalfigureparameter\c!height}% @@ -323,6 +325,7 @@ preview {\externalfigureparameter\c!preview}% display {\externalfigureparameter\c!display}% mask {\externalfigureparameter\c!mask}% + range {\externalfigureparameter\c!range}% conversion {\externalfigureparameter\c!conversion}% resolution {\externalfigureparameter\c!resolution}% color {\externalfigureparameter\c!color}% unprocessed raw key @@ -331,6 +334,7 @@ repeat {\externalfigureparameter\c!repeat}% transform {\externalfigureparameter\c!transform}% compact {\externalfigureparameter\c!compact}% experiment, share fonts + metadata {\externalfigureparameter\c!metadata}% userpassword {\externalfigureparameter\c!userpassword}% ownerpassword{\externalfigureparameter\c!ownerpassword}% crop {\externalfigureparameter\c!crop}% @@ -561,8 +565,8 @@ \newconditional\c_grph_include_skip \newconditional\c_grph_include_test_only -\newconditional\c_grph_include_level \setfalse\c_grph_include_level % true=background false=normal -\newconditional\c_grph_include_flush \settrue \c_grph_include_flush % true=place false=ignore +\newconditional\c_grph_include_level \c_grph_include_level\conditionalfalse % true=background false=normal +\newconditional\c_grph_include_flush \c_grph_include_flush\conditionaltrue % true=place false=ignore \newsystemmode\v!figure @@ -587,13 +591,13 @@ \appendtoks \edef\p_option{\externalfigureparameter\c!option}% \ifx\p_option\v!frame - \setfalse\c_grph_include_skip + \c_grph_include_skip\conditionalfalse \letexternalfigureparameter\c!frame\v!on \orelse\ifx\p_option\v!empty - \settrue\c_grph_include_skip + \c_grph_include_skip\conditionaltrue \letexternalfigureparameter\c!frame\v!off \else - \setfalse\c_grph_include_skip + \c_grph_include_skip\conditionalfalse \fi % fake color in gray bitmaps, assumes that % a transparent color is used @@ -667,8 +671,8 @@ \stopfoundexternalfigure} % \doifmodeelse{*\v!last} -% {\settrue \c_grph_include_flush} -% {\setfalse\c_grph_include_flush}% +% {\c_grph_include_flush\conditionaltrue} +% {\c_grph_include_flush\conditionalfalse}% \def\grph_include_finalize {\global\setbox\foundexternalfigure\vbox @@ -683,12 +687,12 @@ \orelse\ifcase\figurestatus % nothing \else - \the\externalfigurepostprocessors + \expand\externalfigurepostprocessors \box\foundexternalfigure \fi \else \iftrialtypesetting \else \feedbackexternalfigure \fi - \settrue\c_grph_include_level + \c_grph_include_level\conditionaltrue \ifconditional\c_grph_include_skip \ifcase\figurestatus \grph_include_replacement\figurelabel\figurefileoriginal{unknown}% @@ -698,7 +702,7 @@ \orelse\ifcase\figurestatus \grph_include_replacement\figurelabel\figurefileoriginal{unknown}% \else - \the\externalfigurepostprocessors + \expand\externalfigurepostprocessors \edef\p_reset{\externalfigureparameter\c!reset}% \ifx\p_reset\v!yes \wd\foundexternalfigure\figurewidth @@ -714,15 +718,15 @@ \fi \fi \else - % maybe also \the\externalfigurepostprocessors + % maybe also \expand\externalfigurepostprocessors \iftrialtypesetting \else \feedbackexternalfigure \fi \fi}} \mutable\let\feedbackexternalfigure\relax % hook -\permanent\tolerant\protected\def\getfiguredimensions[#1]#*[#2]% +\permanent\tolerant\protected\def\getfiguredimensions[#1]#*[#S#2]% {\startnointerference % we can use \nospaces\plusone - \settrue\c_grph_include_test_only + \c_grph_include_test_only\conditionaltrue \externalfigure[#1][#2,\c!display=,\c!mask=,\c!object=\v!no]% \stopnointerference} @@ -738,10 +742,10 @@ % No placement, handy for preprocessing: -\permanent\tolerant\protected\def\registerexternalfigure[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\registerexternalfigure[#1]#*[#S#2]#*[#S#3]% {\startnointerference \c_grph_include_test_only - \setfalse\c_grph_include_flush % == test ? + \c_grph_include_flush\conditionalfalse % == test ? \externalfigure[#1][#2][#3]% or \externalfigure[#1][#2,\c!display=,\c!mask=,\c!object=\v!no]% \stopnointerference} @@ -778,10 +782,13 @@ \setexternalfigureparameter\c!backgroundcolor{missingfigurecolor}% \setexternalfigureparameter\c!align{\v!middle,\v!lohi}% we default to \v!none \inheritedexternalfigureframed - {\tt\tfxx \nohyphens - name: \expanded{\verbatimstring{#1}}\\% - file: \expanded{\verbatimstring{#2}}\\% - state: \expanded{\verbatimstring{#3}}}% + {\ttxx \nohyphens +% name: \detokenize\expandafter{\normalexpanded{#1}}\crlf +% file: \detokenize\expandafter{\normalexpanded{#2}}\crlf + name: \expandeddetokenize{#1}\crlf + file: \expandeddetokenize{#2}\crlf + state: #3 + }% \egroup} % maybe setuphandler @@ -793,11 +800,11 @@ \newdimension \d_grph_include_collection_minheight \newdimension \d_grph_include_collection_maxheight -\def\grph_include_analyze_collection[#1][#2]% +\def\grph_include_analyze_collection[#1][#S#2]% {\ifconditional\c_grph_include_in_collection - \setfalse\c_grph_include_in_collection + \c_grph_include_in_collection\conditionalfalse \getfiguredimensions[#1][#2]% - \settrue\c_grph_include_in_collection + \c_grph_include_in_collection\conditionaltrue \scratchdimen\naturalfigurewidth \ifdim\scratchdimen>\d_grph_include_collection_maxwidth \d_grph_include_collection_maxwidth \scratchdimen \fi \ifdim\scratchdimen<\d_grph_include_collection_minwidth \d_grph_include_collection_minwidth \scratchdimen \fi @@ -810,8 +817,8 @@ \permanent\protected\def\startexternalfigurecollection[#1]% {\begingroup - \def\currentexternalfigurecollection{#1}% - \settrue\c_grph_include_in_collection + \cdef\currentexternalfigurecollection{#1}% + \c_grph_include_in_collection\conditionaltrue \d_grph_include_collection_minwidth \maxdimen \d_grph_include_collection_maxwidth \zeropoint \d_grph_include_collection_minheight\maxdimen @@ -862,13 +869,13 @@ % Experimental (will become cleaner): -\permanent\tolerant\protected\def\includesvgfile[#1]#*[#2]% +\permanent\tolerant\protected\def\includesvgfile[#1]#*[#S#2]% {\hbox\bgroup % no \dontleavehmode \getdummyparameters[\c!offset=\zeropoint,#2]% \clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax \egroup} -\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#2]% +\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#S#2]% {\hbox\bgroup % no \dontleavehmode \getdummyparameters[\c!offset=\zeropoint,#2]% \clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax @@ -887,17 +894,26 @@ [\v!inline] [\c!height=\lineheight] +\permanent\protected\def\combinationwidth + {\dimexpr + (\textwidth + -\effectiveleftskip + -\effectiverightskip + -\numexpr\combinationparameter\c!nx-\plusone\relax\dimexpr\combinationparameter\c!distance\relax + )/\combinationparameter\c!nx + \relax} + +\pushoverloadmode + \newuserunit \combinationwidth cx % combination width +\popoverloadmode + \definemeasure [\v!combination] - [(\textwidth - -\effectiveleftskip - -\effectiverightskip - -\numexpr\combinationparameter\c!nx-\plusone\relax\dimexpr\combinationparameter\c!distance\relax - )/\combinationparameter\c!nx] + [\combinationwidth] \defineexternalfigure [\v!combination] - [\c!width=\measure{\v!combination}] + [\c!width=\combinationwidth] % \startcombination[nx=2,ny=1] % {\externalfigure[dummy][combination]} {} @@ -937,6 +953,25 @@ \definelayer[epdfcontent] +%D Experiment: +%D +%D \starttyping +%D \registerfiguremask[mymask] { +%D { +%D { 0, 100, 0x00 }, +%D { 101, 200, 0x7F }, +%D { 201, 255, 0xFF }, +%D } +%D } +%D +%D \dontleavehmode \externalfigure +%D [proofs.png] +%D [background=color, +%D backgroundcolor=yellow, +%D mask=mymask, +%D width=5cm] +%D \stOPtyping + \protect \endinput %D Moved here because this already old code is nowhere documents (so I need to check diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl index 3b51dc25873..80f04a8d311 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl @@ -24,14 +24,14 @@ \registerctxluafile{grph-pat}{} -\permanent\tolerant\protected\def\registerpattern[#1]#*[#2]% +\permanent\tolerant\protected\def\registerpattern[#S#1]#*[#S#2]% {\begingroup \letdummyparameter\c!name \s!dummy \letdummyparameter\c!width \v!auto \letdummyparameter\c!height \v!auto \letdummyparameter\c!hoffset\zeropoint \letdummyparameter\c!voffset\zeropoint - \unless\iftok{#2}\emptytoks + \unless\ifempty{#2}% \setdummyparameter\c!name{#1}% \getdummyparameters[#2]% \orelse\ifhastok={#1}% @@ -63,12 +63,12 @@ \relax \endgroup} -\permanent\tolerant\protected\def\applypattern[#1]#*[#2]% +\permanent\tolerant\protected\def\applypattern[#S#1]#*[#S#2]% {\hpack\bgroup \letdummyparameter\c!name \s!dummy \letdummyparameter\c!width \zeropoint \letdummyparameter\c!height\zeropoint - \unless\iftok{#2}\emptytoks + \unless\ifempty{#2}% \setdummyparameter\c!name{#1}% \getdummyparameters[#2]% \orelse\ifhastok={#1}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl index c84a3682fd3..019465a1345 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl @@ -43,7 +43,7 @@ \unprotect -\permanent\protected\def\bitmapimage[#1]#2% +\permanent\protected\def\bitmapimage[#S#1]#2% {\hbox\bgroup \getdummyparameters[\c!color=rgb,\c!width=,\c!height=,\c!x=,\c!y=,#1]% \clf_bitmapimage @@ -56,7 +56,7 @@ \relax \egroup} -\permanent\protected\def\startbitmapimage[#1]#2\stopbitmapimage +\permanent\protected\def\startbitmapimage[#S#1]#2\stopbitmapimage {\bitmapimage[#1]{#2}} \permanent\protected\lettonothing\stopbitmapimage diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt index c33319658a1..c5183ee3979 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt @@ -22,11 +22,11 @@ local tonode = nuts.tonode local getattribute = tex.getattribute -local direct_value = tokens.values.direct +local direct_value = tokens.values.direct -local a_color = attributes.private('color') -local a_transparency = attributes.private('transparency') -local a_colormodel = attributes.private('colormodel') +local a_color = attributes.private('color') +local a_transparency = attributes.private('transparency') +local a_colormodel = attributes.private('colormodel') local floor = math.floor local getrandom = utilities.randomizer.get diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt index 7ca15e2a067..027f55ef031 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt @@ -13,15 +13,15 @@ local sind, cosd, tand, abs = math.sind, math.cosd, math.tand, math.abs local isdimen = tex.isdimen local setdimension = tex.setdimensionvalue -local d_grph_rotate_x_size = isdimen("d_grph_rotate_x_size") -local d_grph_rotate_y_size = isdimen("d_grph_rotate_y_size") -local d_grph_rotate_x_position = isdimen("d_grph_rotate_x_position") -local d_grph_rotate_y_position = isdimen("d_grph_rotate_y_position") -local d_grph_rotate_x_offset = isdimen("d_grph_rotate_x_offset") -local d_grph_rotate_y_offset = isdimen("d_grph_rotate_y_offset") -local d_grph_rotate_new_width = isdimen("d_grph_rotate_new_width") -local d_grph_rotate_new_height = isdimen("d_grph_rotate_new_height") -local d_grph_rotate_new_depth = isdimen("d_grph_rotate_new_depth") +local d_grph_rotate_x_size = isdimen("d_grph_rotate_x_size") +local d_grph_rotate_y_size = isdimen("d_grph_rotate_y_size") +local d_grph_rotate_x_position = isdimen("d_grph_rotate_x_position") +local d_grph_rotate_y_position = isdimen("d_grph_rotate_y_position") +local d_grph_rotate_x_offset = isdimen("d_grph_rotate_x_offset") +local d_grph_rotate_y_offset = isdimen("d_grph_rotate_y_offset") +local d_grph_rotate_new_width = isdimen("d_grph_rotate_new_width") +local d_grph_rotate_new_height = isdimen("d_grph_rotate_new_height") +local d_grph_rotate_new_depth = isdimen("d_grph_rotate_new_depth") local function analyzerotate(rotation,width,height,depth,total,notfit,obeydepth) -- diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl index 53080b6a13f..e2f2522c5f7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl @@ -51,18 +51,16 @@ \newconditional\c_grph_scale_done \newconditional\c_grph_scale_scaling_done -\newconditional\c_grph_scale_limit_factors \settrue\c_grph_scale_limit_factors - -\newconditional\c_grph_scale_swap_factor +\newconditional\c_grph_scale_limit_factors \c_grph_scale_limit_factors\conditionaltrue \newdimension\d_grph_scale_wd \newdimension\d_grph_scale_ht \newdimension\d_grph_scale_dp -% global +\newconditional\c_grph_scale_swap_factor % global -\newdimension\d_grph_scale_used_x_size -\newdimension\d_grph_scale_used_y_size +\newdimension\d_grph_scale_used_x_size % global +\newdimension\d_grph_scale_used_y_size % global \newinteger\c_grph_scale_used_x_scale \newinteger\c_grph_scale_used_y_scale @@ -113,20 +111,51 @@ \c!maxwidth=\scaleparameter\c!width, \c!maxheight=\scaleparameter\c!height] -\permanent\tolerant\protected\def\scale[#1]#*[#2]% +% \permanent\tolerant\protected\def\scale[#1]#*[#2]% +% {\bgroup +% % this is quite common so we might make this a helper +% \ifarguments +% \lettonothing\currentscale +% \or +% \ifhastok={#1}% +% \lettonothing\currentscale +% \setupcurrentscale[#1]% +% \else +% \cdef\currentscale{#1}% +% \fi +% \or +% \cdef\currentscale{#1}% +% \setupcurrentscale[#2]% +% \fi +% % +% \dowithnextboxcs\grph_scale_finish\naturalhbox} % intercept direction + +\newinteger\c_grph_scale_nesting + +\def\grph_scale_set_nesting + {\advanceby\c_grph_scale_nesting\plusone + \letcsname\??scale>\the\c_grph_scale_nesting:\s!parent\endcsname\??scale + \cdef\currentscale{>\the\c_grph_scale_nesting}} + +\permanent\tolerant\protected\def\scale[#S#1]#*[#S#2]% {\bgroup - % this is quite common so we might make this a helper \ifarguments - \lettonothing\currentscale + \grph_scale_set_nesting \or \ifhastok={#1}% - \lettonothing\currentscale + \grph_scale_set_nesting \setupcurrentscale[#1]% \else - \edef\currentscale{#1}% + \cdef\currentscale{#1}% + \ifempty\currentscale + \grph_scale_set_nesting + \fi \fi \or - \edef\currentscale{#1}% + \cdef\currentscale{#1}% + \ifempty\currentscale + \grph_scale_set_nesting + \fi \setupcurrentscale[#2]% \fi % @@ -169,7 +198,7 @@ \forgetall \dontcomplain % - \setfalse\c_grph_scale_done + \c_grph_scale_done\conditionalfalse \grph_scale_calculate \ifconditional\c_grph_scale_done \grph_scale_apply @@ -239,7 +268,7 @@ {\thewithoutunit\dimexpr#1\points*100+32768\scaledpoint\relax} \def\grph_scale_calculations_nop - {\settrue\c_grph_scale_done + {\c_grph_scale_done\conditionaltrue \xdef\finalscaleboxwidth {\the\dimexpr\p_sx\d_grph_scale_wd\relax}% \xdef\finalscaleboxheight{\the\dimexpr\p_sy\d_grph_scale_ht\relax}% \glet\finalscaleboxxscale\p_sx @@ -250,7 +279,7 @@ \let\grph_scale_calculations_report\relax \def\grph_scale_calculations_yes - {\settrue\c_grph_scale_done + {\c_grph_scale_done\conditionaltrue % initial values \d_grph_scale_x_offset\zeropoint \d_grph_scale_y_offset\zeropoint @@ -264,7 +293,7 @@ \let\m_grph_scale_used_x_scale \!!plusone \let\m_grph_scale_used_y_scale \!!plusone % preparations - \setfalse\c_grph_scale_scaling_done + \c_grph_scale_scaling_done\conditionalfalse \grph_scale_check_parameters % calculators % beware, they operate in sequence, and calculate missing dimensions / messy @@ -305,7 +334,7 @@ % \placefigure{none}{\rotate[frame=on,offset=overlay]{\externalfigure[t:/sources/cow.pdf][width-6]}} \page % \placefigure{none}{\framed[frame=on,offset=overlay]{\externalfigure[t:/sources/cow.pdf][width-7]}} -%D The \typpe {min} option makes sure that the smallest available space determines +%D The \type {min} option makes sure that the smallest available space determines %D the max size (so we can get a bleed on the other axis): %D %D \startlinecorrection @@ -320,13 +349,15 @@ \def\m_grph_scale_factor_set{\v!min,\v!max,\v!fit,\v!broad,\v!auto} % can be an \edef \def\grph_scale_by_factor - {\doifelseinset\p_factor\m_grph_scale_factor_set + {\ifinset\p_factor\m_grph_scale_factor_set \grph_scale_by_factor_a - {\doifelseinset\p_hfactor\m_grph_scale_factor_set - \grph_scale_by_factor_b - {\doifelseinset\p_wfactor\m_grph_scale_factor_set - \grph_scale_by_factor_c - \grph_scale_by_factor_d}}} + \orelse\ifinset\p_hfactor\m_grph_scale_factor_set + \grph_scale_by_factor_b + \orelse\ifinset\p_wfactor\m_grph_scale_factor_set + \grph_scale_by_factor_c + \else + \grph_scale_by_factor_d + \fi} \def\grph_scale_by_factor_a {\grph_scale_apply_size @@ -362,7 +393,7 @@ \def\grph_scale_by_factor_indeed {\grph_scale_calculate_fact\p_factor - \settrue\c_grph_scale_scaling_done + \c_grph_scale_scaling_done\conditionaltrue \ifconditional\c_grph_scale_limit_factors \ifdim\d_grph_scale_used_x_size\ifconditional\c_grph_scale_swap_factor<\else>\fi\d_grph_scale_h_size \global\d_grph_scale_used_y_size\zeropoint @@ -474,8 +505,8 @@ \defcsname\??scalenorm\empty \endcsname#1#-#2#-#-{\ifempty#2\else\global#1#2\fi} \defcsname\??scalenorm\s!default\endcsname#1#-#2#-#-{\ifempty#2\else\global#1#2\fi} -\defcsname\??scalefact\v!min \endcsname{\global\settrue \c_grph_scale_swap_factor} -\defcsname\??scalefact\s!unknown\endcsname{\global\setfalse\c_grph_scale_swap_factor} +\defcsname\??scalefact\v!min \endcsname{\global\c_grph_scale_swap_factor\conditionaltrue} +\defcsname\??scalefact\s!unknown\endcsname{\global\c_grph_scale_swap_factor\conditionalfalse} \defcsname\??scalenorm\v!min\endcsname#-#-#-#-#-% an ugly hack {\d_grph_scale_used_x_size\hsize @@ -629,7 +660,7 @@ \installdirectcommandhandler \??clipping {clipping} -\permanent\tolerant\protected\def\clip[#1]% nb top->bottom left->right +\permanent\tolerant\protected\def\clip[#S#1]% nb top->bottom left->right {\bgroup \ifparameter#1\or \setupcurrentclipping[#1]% @@ -637,9 +668,11 @@ \dowithnextboxcs\grph_clip_finish\hbox} \def\grph_clip_finish - {\doifelse{\clippingparameter\c!state}\v!start + {\ifcstok{\clippingparameter\c!state}\v!start \grph_clip_yes_finish - \grph_clip_nop_finish} + \else + \grph_clip_nop_finish + \fi} \def\grph_clip_yes_finish {\ifdim\clippingparameter\c!width>\zeropoint @@ -811,7 +844,7 @@ \lettonothing\p_rotation_location \lettonothing\p_rotation_rotation -\permanent\tolerant\protected\def\rotate[#1]% \bgroup: \rotate kan argument zijn +\permanent\tolerant\protected\def\rotate[#S#1]% \bgroup: \rotate kan argument zijn {\bgroup \ifparameter#1\or \setupcurrentrotate[#1]% @@ -837,41 +870,41 @@ \egroup} \def\grph_rotate_default - {\setfalse\c_grph_rotate_not_fit - \setfalse\c_grph_rotate_center - \settrue \c_grph_rotate_obey_depth + {\c_grph_rotate_not_fit\conditionalfalse + \c_grph_rotate_center\conditionalfalse + \c_grph_rotate_obey_depth\conditionaltrue \grph_rotate_framed} \letcsname\??rotatelocation\v!default\endcsname\grph_rotate_default \defcsname\??rotatelocation\v!depth\endcsname - {\setfalse\c_grph_rotate_not_fit - \setfalse\c_grph_rotate_center - \settrue \c_grph_rotate_obey_depth + {\c_grph_rotate_not_fit\conditionalfalse + \c_grph_rotate_center\conditionalfalse + \c_grph_rotate_obey_depth\conditionaltrue \grph_rotate_normal} \defcsname\??rotatelocation\v!fit\endcsname - {\settrue \c_grph_rotate_not_fit - \setfalse\c_grph_rotate_center - \settrue \c_grph_rotate_obey_depth + {\c_grph_rotate_not_fit\conditionaltrue + \c_grph_rotate_center\conditionalfalse + \c_grph_rotate_obey_depth\conditionaltrue \grph_rotate_normal} \defcsname\??rotatelocation\v!broad\endcsname - {\setfalse\c_grph_rotate_not_fit - \setfalse\c_grph_rotate_center - \setfalse\c_grph_rotate_obey_depth + {\c_grph_rotate_not_fit\conditionalfalse + \c_grph_rotate_center\conditionalfalse + \c_grph_rotate_obey_depth\conditionalfalse \grph_rotate_normal} \defcsname\??rotatelocation\v!high\endcsname - {\setfalse\c_grph_rotate_not_fit - \setfalse\c_grph_rotate_center - \setfalse\c_grph_rotate_obey_depth + {\c_grph_rotate_not_fit\conditionalfalse + \c_grph_rotate_center\conditionalfalse + \c_grph_rotate_obey_depth\conditionalfalse \grph_rotate_framed} \defcsname\??rotatelocation\v!middle\endcsname - {\setfalse\c_grph_rotate_not_fit - \settrue \c_grph_rotate_center - \setfalse\c_grph_rotate_obey_depth % hm, depth ? + {\c_grph_rotate_not_fit\conditionalfalse + \c_grph_rotate_center\conditionaltrue + \c_grph_rotate_obey_depth\conditionalfalse % hm, depth ? \grph_rotate_normal} \permanent\protected\def\dorotatebox#1% {angle} \hbox/\vbox/\vtop % a fast low level one @@ -888,9 +921,9 @@ \dowithnextboxcs\grph_rotate_finish_box} \def\grph_rotate_finish_box - {\setfalse\c_grph_rotate_not_fit % this is the same as broad but - \setfalse\c_grph_rotate_center % without the following grab as - \setfalse\c_grph_rotate_obey_depth % we call finish directly + {\c_grph_rotate_not_fit\conditionalfalse % this is the same as broad but + \c_grph_rotate_center\conditionalfalse % without the following grab as + \c_grph_rotate_obey_depth\conditionalfalse % we call finish directly \grph_rotate_finish_indeed \egroup \egroup} @@ -985,7 +1018,7 @@ % \dostepwiserecurse{0}{360}{10} % {\startlinecorrection[blank] % \hbox -% {\expanded{\setuprotate[rotation=\recurselevel]}% +% {\setuprotate[rotation=#1]% % \traceboxplacementtrue % \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=depth] {\ruledhbox{\bfb (depth)}}}}% % \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=fit] {\ruledhbox{\bfb (fit)}}}}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl index 3a4193f1aba..b94f641b2d6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl @@ -87,7 +87,7 @@ \installcommandhandler \??expansion {expansion} \??expansion \appendtoks - \setuevalue{\??expansion:\currentexpansion}% + \protected\instance\edefcsname\??expansion:\currentexpansion\endcsname {\adjustspacingstep \expansionparameter\c!step\relax \adjustspacingstretch\expansionparameter\c!stretch\relax \adjustspacingshrink \expansionparameter\c!shrink\relax}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/l-bit32.lmt b/Master/texmf-dist/tex/context/base/mkxl/l-bit32.lmt new file mode 100644 index 00000000000..e98aa712ecc --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/l-bit32.lmt @@ -0,0 +1,109 @@ +if not modules then modules = { } end modules ['l-bit32'] = { + version = 1.001, + license = "the same as regular Lua", + source = "bitwise.lua, v 1.24 2014/12/26 17:20:53 roberto", + comment = "drop-in for bit32, adapted a bit by Hans Hagen", + +} + +if bit32 then + return +end + +local select = select -- instead of: arg = { ... } + +bit32 = { + + bnot = function (a) + return ~a & 0xFFFFFFFF + end, + + band = function (x, y, z, ...) + if not z then + return ((x or -1) & (y or -1)) & 0xFFFFFFFF + else + local res = x & y & z + for i=1,select("#",...) do + res = res & select(i,...) + end + return res & 0xFFFFFFFF + end + end, + + bor = function (x, y, z, ...) + if not z then + return ((x or 0) | (y or 0)) & 0xFFFFFFFF + else + local res = x | y | z + for i=1,select("#",...) do + res = res | select(i,...) + end + return res & 0xFFFFFFFF + end + end, + + bxor = function (x, y, z, ...) + if not z then + return ((x or 0) ~ (y or 0)) & 0xFFFFFFFF + else + local res = x ~ y ~ z + for i=1,select("#",...) do + res = res ~ select(i,...) + end + return res & 0xFFFFFFFF + end + end, + + btest = function (x, y, z, ...) + if not z then + return (((x or -1) & (y or -1)) & 0xFFFFFFFF) ~= 0 + else + local res = x & y & z + for i=1,select("#",...) do + res = res & select(i,...) + end + return (res & 0xFFFFFFFF) ~= 0 + end + end, + + lshift = function (a, b) + return ((a & 0xFFFFFFFF) << b) & 0xFFFFFFFF + end, + + rshift = function (a, b) + return ((a & 0xFFFFFFFF) >> b) & 0xFFFFFFFF + end, + + arshift = function (a, b) + a = a & 0xFFFFFFFF + if b <= 0 or (a & 0x80000000) == 0 then + return (a >> b) & 0xFFFFFFFF + else + return ((a >> b) | ~(0xFFFFFFFF >> b)) & 0xFFFFFFFF + end + end, + + lrotate = function (a ,b) + b = b & 31 + a = a & 0xFFFFFFFF + a = (a << b) | (a >> (32 - b)) + return a & 0xFFFFFFFF + end, + + rrotate = function (a, b) + b = -b & 31 + a = a & 0xFFFFFFFF + a = (a << b) | (a >> (32 - b)) + return a & 0xFFFFFFFF + end, + + extract = function (a, f, w) + return (a >> f) & ~(-1 << (w or 1)) + end, + + replace = function (a, v, f, w) + local mask = ~(-1 << (w or 1)) + return ((a & ~(mask << f)) | ((v & mask) << f)) & 0xFFFFFFFF + end, + +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/l-lua.lmt b/Master/texmf-dist/tex/context/base/mkxl/l-lua.lmt new file mode 100644 index 00000000000..8273e4dad5c --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/l-lua.lmt @@ -0,0 +1,88 @@ +if not modules then modules = { } end modules ['l-lua'] = { + version = 1.001, + comment = "companion to luat-lib.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- compatibility hacks and helpers + +LUAMAJORVERSION = status.lua_version_major +LUAMINORVERSION = status.lua_version_minor +LUAVERSION = status.lua_version + +if not loadstring then loadstring = load end +if not table.unpack then table.unpack = _G.unpack end +if not unpack then _G.unpack = table.unpack end +if not package.loaders then package.loaders = package.searchers end -- brr, searchers is a special "loadlib function" userdata type + +do + + local print, select, tostring, type, next = print, select, tostring, type, next + + local inspectors = { } + + function setinspector(kind,inspector) -- global function + inspectors[kind] = inspector + end + + function inspect(...) -- global function + for s=1,select("#",...) do + local value = select(s,...) + if value == nil then + print("nil") + else + local done = false + -- type driven (table) + local kind = type(value) + local inspector = inspectors[kind] + if inspector then + done = inspector(value) + if done then + break + end + end + -- whatever driven (token, node, ...) + for kind, inspector in next, inspectors do + done = inspector(value) + if done then + break + end + end + if not done then + print(tostring(value)) + end + end + end + end + +end + +do + + local xpcall = xpcall + + local dummy = function() end + + function optionalrequire(...) + local ok, result = xpcall(require,dummy,...) + if ok then + return result + end + end + +end + +do + + local flush = io.flush + local execute = os.execute + local popen = io.popen + + function os.execute(...) flush() return execute(...) end + function io.popen (...) flush() return popen (...) end + +end + +os.setenv("engine",string.lower(status.luatex_engine or "unknown")) diff --git a/Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt b/Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt index f2c94b1c2d2..d5cc6ecbb73 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt @@ -703,37 +703,9 @@ end -- -- local utf32 = table.setmetatableindex(function(t,k) local v = toutf32(k) t[k] = v return v end) -do - - local extract = bit32.extract - local char = string.char - - function utf.toutf32string(n) - if n <= 0xFF then - return - char(n) .. - "\000\000\000" - elseif n <= 0xFFFF then - return - char(extract(n, 0,8)) .. - char(extract(n, 8,8)) .. - "\000\000" - elseif n <= 0xFFFFFF then - return - char(extract(n, 0,8)) .. - char(extract(n, 8,8)) .. - char(extract(n,16,8)) .. - "\000" - else - return - char(extract(n, 0,8)) .. - char(extract(n, 8,8)) .. - char(extract(n,16,8)) .. - char(extract(n,24,8)) - end - end - -end +-- local function utf.toutf32string(n) -- unused, le or be ... +-- return char(n&0xFF,(n>>8)&0xFF,(n>>16)&0xFF,(n>>24)&0xFF) +-- end -- goodie: diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl index 192c9c6f9d7..3f4c8ec744d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl @@ -720,7 +720,7 @@ \c!rightquote=\rightguillemot, \c!leftquotation=\leftguillemot, \c!rightquotation=\rightguillemot, - \c!time={h,{\Uchar104 },m},% we need to cheat in order to get the h + \c!time={h,{\tocharacter104 },m},% we need to cheat in order to get the h \c!date={\v!day:mnem,\v!space,\v!month,\v!space,\v!year}] \installlanguage diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt index 36fea59c02d..b241cea13c3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt @@ -46,19 +46,20 @@ local new_disc = nuts.pool.disc local nodecodes = nodes.nodecodes local disccodes = nodes.disccodes +local discoptioncodes = tex.discoptioncodes -local disc_code = nodecodes.disc -local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local glyph_code = nodecodes.glyph -local discoptioncodes = tex.discoptioncodes -local pre_part_code = discoptioncodes.pre -local post_part_code = discoptioncodes.post -local replace_part_code = discoptioncodes.replace -local always_part_code = discoptioncodes.always +local pre_part_code = discoptioncodes.pre +local post_part_code = discoptioncodes.post +local replace_part_code = discoptioncodes.replace +local always_part_code = discoptioncodes.always + +local explicitdisc_code = disccodes.explicit -local explicitdisc_code = disccodes.explicit +local a_visualize = attributes.private("visualizediscretionary") -local a_visualize = attributes.private("visualizediscretionary") local setattribute = tex.setattribute local getlanguagedata = languages.getdata diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl index 7a35b8d510a..be6269157e2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl @@ -73,9 +73,9 @@ \or #2\dimexpr\exheight\relax \or - #2\fontcharwd\font`#1% + #2\scaledfontcharwd\font`#1% \or - \dimexpr100\fontcharwd\font`#1/\charactertsize\charwidthlanguage\relax % ugly hack + \dimexpr100\scaledfontcharwd\font`#1/\charactertsize\charwidthlanguage\relax % ugly hack \else #2\dimexpr\exheight\relax \fi)} diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt index 2099f9d1b7c..eaafa28a4a3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt @@ -18,15 +18,19 @@ local is_letter = characters.is_letter local is_hyphenator = characters.is_hyphenator local specialskips = nodes.specialskipcodes + local nodecodes = nodes.nodecodes -local disc_code = nodecodes.disc -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist -local kern_code = nodecodes.kern -local par_code = nodecodes.par -local line_code = nodes.listcodes.line -local fontkern_code = nodes.kerncodes.fontkern + +local disc_code = nodecodes.disc +local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local kern_code = nodecodes.kern +local par_code = nodecodes.par + +local line_code = nodes.listcodes.line +local fontkern_code = nodes.kerncodes.fontkern + local nuts = nodes.nuts local getlist = nuts.getlist local getnext = nuts.getnext @@ -222,7 +226,7 @@ end) -- local char = chardata[f][c] -- if char and type(char.unicode) == "table" then -- hackery test -local ligature_code = 0x8000 + nodes.glyphcodes.ligature +local ligature_code = 0x8000 + nodes.glyphcodes.ligature -- still valid? local ligature_mode = false local color_n = { "red", "green", "blue" } diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt index 1ac2604f209..e67d8027b66 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt @@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['lang-hyp'] = { license = "see context related readme files" } +-- This one needs checking wrt luametatex additions! + -- In an automated workflow hypenation of long titles can be somewhat problematic -- especially when demands conflict. For that reason I played a bit with a Lua based -- variant of the traditional hyphenation machinery. This mechanism has been extended @@ -621,13 +623,13 @@ if context then local nodecodes = nodes.nodecodes local disccodes = nodes.disccodes - local glyph_code = nodecodes.glyph - local disc_code = nodecodes.disc - local math_code = nodecodes.math - local hlist_code = nodecodes.hlist + local glyph_code = nodecodes.glyph + local disc_code = nodecodes.disc + local math_code = nodecodes.math + local hlist_code = nodecodes.hlist - local automaticdisc_code = disccodes.automatic - local regulardisc_code = disccodes.regular + local automaticdisc_code = disccodes.automatic + local regulardisc_code = disccodes.regular local nuts = nodes.nuts local tonode = nodes.tonode @@ -670,14 +672,13 @@ if context then local setcolor = nodes.tracers.colors.set local variables = interfaces.variables - local v_reset = variables.reset - local v_yes = variables.yes - local v_word = variables.word - local v_all = variables.all + local v_reset = variables.reset + local v_yes = variables.yes + local v_word = variables.word + local v_all = variables.all local settings_to_array = utilities.parsers.settings_to_array - local unsetvalue = attributes.unsetvalue local texsetattribute = tex.setattribute local prehyphenchar = language.prehyphenchar @@ -685,7 +686,8 @@ if context then local preexhyphenchar = language.preexhyphenchar local postexhyphenchar = language.postexhyphenchar - local a_hyphenation = attributes.private("hyphenation") + local a_hyphenation = attributes.private("hyphenation") + local unsetvalue = attributes.unsetvalue local interwordpenalty = 5000 diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl index 355804ca3fb..20ec084ef56 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl @@ -75,9 +75,7 @@ \s!lefthyphenchar=0] % number \appendtoks - % \edef\p_hyphens{\roothyphenationparameter\c!hyphens}% - \edef\p_hyphens{\hyphenationparameter\c!hyphens}% - \ifx\p_hyphens\v!no + \ifcstok{\hyphenationparameter\c!hyphens}\v!no \nohyphencollapsing \else \dohyphencollapsing @@ -106,7 +104,7 @@ % \setuphyphenation % [\c!method=\s!traditional] % no translations -\permanent\tolerant\protected\def\definehyphenationfeatures[#1]#*[#2]% +\permanent\tolerant\protected\def\definehyphenationfeatures[#1]#*[#S#2]% {\begingroup % maybe simple handler \resetdummyparameter\c!characters % maybe \s!characters \resetdummyparameter\c!hyphens % maybe \s!hyphens @@ -152,16 +150,16 @@ % todo: \start ... \stop too -\permanent\tolerant\protected\def\registerhyphenationpattern[#1]#*[#2]% +\permanent\tolerant\protected\def\registerhyphenationpattern[#S#1]#*[#S#2]% {\clf_registerhyphenationpattern\ifparameter#2\or{#1}{#2}\else{\currentlanguage}{#1}\fi\s!true\relax} -\permanent\tolerant\protected\def\unregisterhyphenationpattern[#1]#*[#2]% +\permanent\tolerant\protected\def\unregisterhyphenationpattern[#S#1]#*[#S#2]% {\clf_registerhyphenationpattern\ifparameter#2\or{#1}{#2}\else{\currentlanguage}{#1}\fi\s!false\relax} -\permanent\tolerant\protected\def\registerhyphenationexception[#1]#*[#2]% +\permanent\tolerant\protected\def\registerhyphenationexception[#S#1]#*[#S#2]% {\clf_registerhyphenationexception\ifparameter#2\or{#1}{#2}\else{\currentlanguage}{#1}\fi\relax} -\permanent\tolerant\protected\def\showhyphenationtrace[#1]#*[#2]% +\permanent\tolerant\protected\def\showhyphenationtrace[#S#1]#*[#S#2]% {\begingroup \tt \clf_showhyphenationtrace\ifparameter#2\or{#1}{#2}\else{\currentlanguage}{#1}\fi\relax @@ -210,6 +208,59 @@ % \sethyphenationfeatures % [default,fences] +%D When we have \OPENTYPE\ fonts with many replacements we can end up with collapsed +%D discretionaries with relative long snippets. When investigating a buglet in the +%D font handler (a final discretionary with no trailing glyph got no ligatures) I +%D got an empty line due to an empty post. +%D +%D \startbuffer +%D \showmakeup[line] +%D \discretionaryoptions\zerocount +%D % We need to force an end of line situation: +%D \hsize\widthofstring{sciencefiction} +%D % We had no ligatures in the replacement (fixed): +%D science\discretionary{\red fict-}{\green ion}{\blue fiction}\par +%D % We got an empty line in the par builder: +%D science\discretionary{\red f\kern0ptiction}{}{\blue fiction}\par +%D % Regular cases (with a simple hyphen only pre): +%D science\-fiction\par +%D % Just a (par builder criterium) test case: +%D science\discretionary{-}{}{\blue fiction}\par +%D \hyphenation{science-fiction} +%D % Nothing special: +%D sciencefiction\par +%D \stopbuffer +%D +%D \typebuffer % \startpacked \getbuffer \stoppacked +%D +%D Changes are slim that this will happen in real documents (the buglet was more +%D likely to show up). Anyhow, we now catch the border case in the linebreak +%D routine: + +\discretionaryoptions\prefernobreakdiscoptioncode + +%D Here is an example with optional content (at least, the original idea as +%D we now do it differently: +%D +%D \start +%D \tttf +%D \hsize\widthofstring{short} +%D --:\par +%D \discretionaryoptions\zerocount +%D \discretionary{before}{after}{short}\par +%D \discretionary{before}{}{short}\blank +%D nb:\par +%D \discretionaryoptions\prefernobreakdiscoptioncode +%D \discretionary{before}{after}{short}\par +%D \discretionary{before}{}{short}\blank +%D br:\par +%D \discretionaryoptions\preferbreakdiscoptioncode +%D \discretionary{before}{after}{short}\par +%D \discretionary{before}{}{short}\blank +%D \stop +%D +%D Todo: examples with break and nobreak keywords. + \protect \endinput % \starttext diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt index 64f1e82d029..7ded9e98f32 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt @@ -76,10 +76,8 @@ storage.register("languages/associated",associated,"languages.associated") storage.register("languages/numbers", numbers, "languages.numbers") storage.register("languages/data", data, "languages.data") -local variables = interfaces.variables - -local v_reset = variables.reset -local v_yes = variables.yes +local v_reset = interfaces.variables.reset +local v_yes = interfaces.variables.yes local nofloaded = 0 @@ -435,6 +433,7 @@ function languages.define(tag,parent) report_initialization("assigning number %a to %a",noflanguages,tag) end numbers[noflanguages] = tag + numbers[tag] = noflanguages registered[tag] = { tag = tag, parent = parent or "", @@ -651,7 +650,7 @@ local expand ; do -- can be a helper - local compound_disc_code = tex.discoptioncodes.preword | tex.discoptioncodes.postword + local compound_disc_code = tex.discoptioncodes.preword | tex.discoptioncodes.postword local function setcompound(current,id,first,last,lh,rh,hyphen) local prev = getprev(current) @@ -747,8 +746,8 @@ local expand ; do -- local optioncodes = table.copy(glyphoptioncodes) -- - -- optioncodes.nokerns = optioncodes.noleftkern | optioncodes.norightkern - -- optioncodes.noligatures = optioncodes.noleftligature | optioncodes.norightligature + -- optioncodes.nokerns = optioncodes.noleftkern | optioncodes.norightkern + -- optioncodes.noligatures = optioncodes.noleftligature | optioncodes.norightligature local lh, rh = false, false @@ -1027,10 +1026,10 @@ local expand ; do end end - local norightligature_option = glyphoptioncodes.norightligature - local noleftligature_option = glyphoptioncodes.noleftligature - local norightkern_option = glyphoptioncodes.norightkern - local noleftkern_option = glyphoptioncodes.noleftkern + local norightligature_option = glyphoptioncodes.norightligature + local noleftligature_option = glyphoptioncodes.noleftligature + local norightkern_option = glyphoptioncodes.norightkern + local noleftkern_option = glyphoptioncodes.noleftkern local function applyaction(oc,v,n) if oc == "noligature" then diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl index 1f4b741c292..7d211508daf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl @@ -71,7 +71,7 @@ \installcorenamespace{language} \installcorenamespace{languagelinked} -\mutable\def\currentusedlanguage{\currentlanguage} +\mutable\def\currentusedlanguage{\currentlanguage} % no \cdef \permanent\def\defaultlanguage#1% {\ifcsname\??language#1\s!default\endcsname @@ -119,7 +119,7 @@ \fi} \permanent\protected\def\setusedlanguage#1% - {\edef\currentusedlanguage{\reallanguagetag{#1}}% + {\cdef\currentusedlanguage{\reallanguagetag{#1}}% \ifempty\currentusedlanguage \let\currentusedlanguage \currentlanguage \enforced\let\usedlanguageparameter\languageparameter @@ -193,16 +193,16 @@ \mutable\lettonothing\currentsetuplanguage -\permanent\tolerant\protected\def\installlanguage[#1]#*[#2]% - {\ifcondition\validassignment{#2}% +\permanent\tolerant\protected\def\installlanguage[#1]#*[#S#2]% + {\ifhastok={#2}% \doifelselanguage{#1} {\getparameters[\??language#1][#2]} {\defcsname\??languagelinked#1\endcsname{#1}% \getparameters[\??language#1][\c!state=\v!start,#2]% \lang_basics_install_indeed{#1}{#1}}% - \edef\currentsetuplanguage{#1}% + \cdef\currentsetuplanguage{#1}% \clf_definelanguage{#1}{\specificlanguageparameter{#1}\s!default}% - \the\everysetuplanguage + \expand\everysetuplanguage \else \defcsname\??languagelinked#1\endcsname{#2}% \clf_setlanguagesynonym{#1}{#2}% @@ -244,20 +244,19 @@ \installmacrostack\currentlanguage -\permanent\tolerant\protected\def\setuplanguage[#1]#*[#2]% +\permanent\tolerant\protected\def\setuplanguage[#S#1]#*[#S#2]% {\ifarguments % only synchronize \or \let\currentsetuplanguage\currentlanguage \getparameters[\??language\currentsetuplanguage][#1]% - \the\everysetuplanguage + \expand\everysetuplanguage \or \push_macro_currentlanguage % can be default - \edef\currentsetuplanguage{\reallanguagetag{#1}}% + \cdef\currentsetuplanguage{\reallanguagetag{#1}}% \getparameters[\??language\currentsetuplanguage][#2]% - \the\everysetuplanguage + \expand\everysetuplanguage \pop_macro_currentlanguage - %\doif\currentsetuplanguage\currentlanguage we can have influenced inheritance (default) \fi \lang_basics_synchronize} @@ -392,7 +391,7 @@ \fi \endcsname \relax - \the\everylanguage + \expand\everylanguage \relax} \newinteger\hyphenstate @@ -447,7 +446,8 @@ + \collapsehyphenationcode % collapse -- and --- \relax -\hccode"002D "002D +\hccode"002D "002D % hyphen +\hccode"00B7 "00B7 % centered text period (used in some languages) \permanent\protected\def\keephyphensequences {\hccode"2010 \zerocount @@ -463,8 +463,8 @@ % maybe a (un)setter for handlers -\permanent\protected\def\dohyphens {\hyphenationmode\completehyphenationcode} -\permanent\protected\def\nohyphens {\hyphenationmode\partialhyphenationcode} +\permanent\protected\def\dohyphens{\hyphenationmode\completehyphenationcode} +\permanent\protected\def\nohyphens{\hyphenationmode\partialhyphenationcode} % \permanent\protected\def\dohyphens % {\ifbitwiseand\hyphenationmode\collapsehyphenationcode @@ -487,8 +487,7 @@ \permanent\protected\def\noexplicithyphens{\hyphenationmode\bitwiseflip\hyphenationmode-\explicithyphenationcode} \permanent\protected\def\usehyphensparameter#1% - {\edef\p_hyphens{#1\c!hyphens}% - \ifx\p_hyphens\v!no + {\ifcstok{#1\c!hyphens}\v!no \ifbitwiseand\hyphenationmode\collapsehyphenationcode \nohyphens \else @@ -562,8 +561,7 @@ % this will move to core-spa ! \appendtoks - \edef\p_spacing{\languageparameter\c!spacing}% - \ifx\p_spacing\v!broad + \ifcstok{\languageparameter\c!spacing}\v!broad \nonfrenchspacing \else \frenchspacing @@ -662,8 +660,14 @@ %D Used at all? -\permanent\def\splitsequence#1#2% - {\doifelse{#1}\v!no{#2}{\doifelse{#1}\v!yes{\languageparameter\c!limittext}{#1}}} +\permanent\def\splitsequence#1#2% append periods etc + {\ifcstok{#1}\v!no + #2% + \orelse\ifcstok{#1}\v!yes + \languageparameter\c!limittext + \else + #1% + \fi} \permanent\def\splitsymbol#1% {\splitsequence{#1}{\languageparameter\c!limittext}} @@ -855,20 +859,20 @@ %D {ef{\norightligaturing f}icient ff fi}\par %D \stoptyping -\immutable\chardef\nokerningcode \numexpr\noleftkernglyphoptioncode +\norightkernglyphoptioncode \relax -\immutable\chardef\noligaturingcode\numexpr\noleftligatureglyphoptioncode+\norightligatureglyphoptioncode\relax - -\permanent\protected\def\nokerning {\bitwiseflip\glyphoptions\nokerningcode} -\permanent\protected\def\noligaturing{\bitwiseflip\glyphoptions\noligaturingcode} +\immutable\integerdef\nokerningcode \numexpr\noleftkernglyphoptioncode +\norightkernglyphoptioncode \relax +\immutable\integerdef\noligaturingcode\numexpr\noleftligatureglyphoptioncode +\norightligatureglyphoptioncode \relax +\immutable\integerdef\noitalicscode \numexpr\noitaliccorrectionglyphoptioncode+\nozeroitaliccorrectionglyphoptioncode\relax -\permanent\protected\def\noleftkerning {\bitwiseflip\glyphoptions\noleftkernglyphoptioncode} -\permanent\protected\def\noleftligaturing {\bitwiseflip\glyphoptions\noleftligatureglyphoptioncode} -\permanent\protected\def\norightkerning {\bitwiseflip\glyphoptions\norightkernglyphoptioncode} -\permanent\protected\def\norightligaturing{\bitwiseflip\glyphoptions\norightligatureglyphoptioncode} +\permanent\protected\def\nokerning {\bitwiseflip\glyphoptions\nokerningcode} +\permanent\protected\def\noligaturing {\bitwiseflip\glyphoptions\noligaturingcode} +\permanent\protected\def\noitaliccorrection{\bitwiseflip\glyphoptions\noitalicscode} -% This is not really language related but let's define it here: +\permanent\protected\def\noleftkerning {\bitwiseflip\glyphoptions\noleftkernglyphoptioncode} +\permanent\protected\def\noleftligaturing {\bitwiseflip\glyphoptions\noleftligatureglyphoptioncode} +\permanent\protected\def\norightkerning {\bitwiseflip\glyphoptions\norightkernglyphoptioncode} +\permanent\protected\def\norightligaturing {\bitwiseflip\glyphoptions\norightligatureglyphoptioncode} -\permanent\protected\def\noitaliccorrection{\bitwiseflip\glyphoptions\noitaliccorrectionglyphoptioncode} +\bitwiseflip\glyphoptions\nozeroitaliccorrectionglyphoptioncode % for the moment default avoid the side effect %D Also \LMTX: diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt index f1f9b358087..ea5a6206478 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt @@ -11,19 +11,20 @@ local next, rawget, type = next, rawget, type local lpegmatch = lpeg.match local formatters = string.formatters -local prtcatcodes = catcodes.numbers.prtcatcodes -- todo: use different method - local trace_labels = false trackers.register("languages.labels", function(v) trace_labels = v end) local report_labels = logs.reporter("languages","labels") -languages.labels = languages.labels or { } -local labels = languages.labels +languages.labels = languages.labels or { } +local labels = languages.labels + +local context = context +local implement = interfaces.implement -local context = context -local implement = interfaces.implement +local prtcatcodes = catcodes.numbers.prtcatcodes -- todo: use different method +local ctxcatcodes = catcodes.numbers.ctxcatcodes -- todo: use different method -local variables = interfaces.variables -local settings_to_array = utilities.parsers.settings_to_array +local variables = interfaces.variables +local settings_to_array = utilities.parsers.settings_to_array local splitter = lpeg.splitat(":") @@ -46,6 +47,8 @@ local f_raw_raw = formatters["%s:%s"] local f_key = formatters["\\v!%s"] local f_raw = formatters["%s"] +-- setmacro("\??label#1:\reallanguagetag{#2}:#3","{{#4}{#5}}}") -- class tag key left right + local function definelanguagelabels(data,class,tag,rawtag) for language, text in next, data.labels do if text == "" then @@ -89,8 +92,8 @@ function labels.define(class,name,prefixed) local list = languages.data.labels[name] if list then report_labels("defining label set %a",name) - for tag, data in next, list do - tag = variables[tag] or tag + for key, data in next, list do + local tag = variables[key] or key if not data.hidden then local key = tag if prefixed then @@ -120,6 +123,39 @@ function labels.define(class,name,prefixed) end end +--Todo: first check if defined at the tex end otherwise fetch it from lua. + +interfaces.implement { + name = "fetchlanguagetext", + public = true, + arguments = { "string", "string", "string", "integer" }, + actions = function(language,name,label,n) + local found = languages.data.labels[name] + if not found then + return + end + found = found[label] + if not found then + return + end + found = found.labels -- hidden + if not found then + return + end + found = found[language] + if not found or found == "" then + return + end + if type(found) == "table" then + found = found[n] or found[1] + end + if found and found ~= "" then + -- contextsprint(found) + contextsprint(ctxcatcodes,found) + end + end +} + -- function labels.check() -- for category, list in next, languages.data.labels do -- for tag, specification in next, list do @@ -140,7 +176,7 @@ end interfaces.implement { name = "definelabels", actions = labels.define, - arguments = { "string", "string", "boolean" } + arguments = { "string", "string", "boolean" } } -- function commands.setstrippedtextprefix(str) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl index c8dc33cccf7..04c2482d731 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl @@ -11,6 +11,9 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% TODO: only preload English and delay loading of other languages +% till some related command is used. + \writestatus{loading}{ConTeXt Language Macros / Labels} \registerctxluafile{lang-lab}{autosuffix} @@ -21,7 +24,7 @@ %D Left-overs: \ifdefined\sixperemspace \else - \permanent\edef\sixperemspace{\normalUchar"2006} + \permanent\edef\sixperemspace{\tocharacter"2006} \fi %D In this module we deal with language dependant labels and prefixes, like in {\em @@ -62,11 +65,12 @@ % \lettonothing\currentlabelcategory + \permanent\tolerant\protected\def\definelabelclass[#1]#*[#2]% {\normalexpanded {\lang_labels_define_class_indeed {#1}% - {\ifchknum#2\or#2\else\zerocount\fi}% + {\ifchknumber#2\or#2\else\zerocount\fi}% not \lastchknumber as we need expansion \expandafter\noexpand\csname lang_labels_#1_text_1\endcsname \expandafter\noexpand\csname #1language\endcsname \expandafter\noexpand\csname lang_labels_#1_text_2\endcsname @@ -182,11 +186,11 @@ \tolerant\def\lang_labels_text_prefix_start[#1]#*[#2]#*[#3]% class language name {\ifarguments\or\or - \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% - \edef\currenttextprefixname{#2}% + \cdef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% + \cdef\currenttextprefixname{#2}% \else - \edef\currenttextprefixtag{\reallanguagetag{#2}}% - \edef\currenttextprefixname{#3}% + \cdef\currenttextprefixtag{\reallanguagetag{#2}}% + \cdef\currenttextprefixname{#3}% \fi \grabuntil{stop#1text}\lang_labels_text_prefix_start_indeed} @@ -195,10 +199,10 @@ \tolerant\def\lang_labels_text_prefix_setup[#1]#*[#2]% {\ifarguments\or - \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% + \cdef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% \processcommalist[#1]\lang_labels_text_prefix_setup_indeed \else - \edef\currenttextprefixtag{\reallanguagetag{#1}}% + \cdef\currenttextprefixtag{\reallanguagetag{#1}}% \processcommalist[#2]\lang_labels_text_prefix_setup_indeed \fi} @@ -253,10 +257,10 @@ \tolerant\def\lang_labels_text_prefix_copy[#1]#*[#2]% {\ifarguments\or - \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% + \cdef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% \processcommalist[#1]\lang_labels_text_prefix_copy_indeed \else - \edef\currenttextprefixtag{\reallanguagetag{#1}}% + \cdef\currenttextprefixtag{\reallanguagetag{#1}}% \processcommalist[#2]\lang_labels_text_prefix_copy_indeed \fi} diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl index 374379a0b3f..f1cbbaed53c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl @@ -142,8 +142,8 @@ %D compound characters like |-| or || to be separated from the words. \TEX\ hackers %D will recognise the next two macro's: -\ifdefined\prewordbreak \else \permanent\protected\def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} \fi -\ifdefined\postwordbreak\else \permanent\protected\def\postwordbreak {\penalty\zerocount \hskip\zeropoint\relax} \fi +\ifdefined\prewordbreak \else \permanent\protected\def\prewordbreak {\penalty\plustenthousand\hskip\zeroskip\relax} \fi +\ifdefined\postwordbreak\else \permanent\protected\def\postwordbreak {\penalty\zerocount \hskip\zeroskip\relax} \fi \ifdefined\hspaceamount \else \def\hspaceamount#1#2{.16667\emwidth} \fi % will be overloaded \permanent\protected\def\permithyphenation{\ifhmode\wordboundary\fi} % doesn't remove spaces @@ -217,14 +217,14 @@ \fi} \def\lang_discretionaries_check_after - {\setfalse\punctafterdiscretionary - \setfalse\spaceafterdiscretionary - \ifx\blankspace\nexttoken \settrue \spaceafterdiscretionary \orelse - \ifx\space \nexttoken \settrue \spaceafterdiscretionary \orelse - \ifx .\nexttoken \settrue \punctafterdiscretionary \orelse - \ifx ,\nexttoken \settrue \punctafterdiscretionary \orelse - \ifx :\nexttoken \settrue \punctafterdiscretionary \orelse - \ifx ;\nexttoken \settrue \punctafterdiscretionary \fi} + {\punctafterdiscretionary\conditionalfalse + \spaceafterdiscretionary\conditionalfalse + \ifx\blankspace\nexttoken \spaceafterdiscretionary\conditionaltrue \orelse + \ifx\space \nexttoken \spaceafterdiscretionary\conditionaltrue \orelse + \ifx .\nexttoken \punctafterdiscretionary\conditionaltrue \orelse + \ifx ,\nexttoken \punctafterdiscretionary\conditionaltrue \orelse + \ifx :\nexttoken \punctafterdiscretionary\conditionaltrue \orelse + \ifx ;\nexttoken \punctafterdiscretionary\conditionaltrue \fi} \edefcsname\??discretionarymode n\endcsname {\detokenize{|}} @@ -422,7 +422,7 @@ \def\lang_compounds_fake_hyphen {\enforced\permanent\protected\def##1|% - {\doifelsenothing{##1}\compoundhyphen{##1}% + {\ifempty{##1}\compoundhyphen\else##1\fi \wordboundary % was a signal \allowbreak}} @@ -472,17 +472,11 @@ %D so test\compound{}test can be used instead of test||test %D \stoptyping -% \bgroup -% -% \catcode\barasciicode\activecatcode - - \permanent\protected\gdef\compound#1{|#1|} +\permanent\protected\gdef\compound#1{|#1|} - \doglobal \appendtoks - \enforced\permanent\protected\def|#1|{\ifx#1\empty\empty-\else#1\fi}% - \to \everysimplifycommands - -% \egroup +\appendtoks + \enforced\permanent\protected\def|#1|{\ifx#1\empty\empty-\else#1\fi}% +\to \everysimplifycommands %D Here we hook some code into the clean up mechanism needed for verbatim data. diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt index fcaff523a35..a01c17303c2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt @@ -21,7 +21,8 @@ local utfbyte, utfsplit = utf.byte, utf.split local P, C, U, Cc, Ct, Cs, lpegmatch = lpeg.P, lpeg.C, lpeg.patterns.utf8character, lpeg.Cc, lpeg.Ct, lpeg.Cs, lpeg.match local find = string.find -local zwnj = 0x200C +local zwnj = 0x200C + local grouped = P("{") * ( Ct((U/utfbyte-P("}"))^1) + Cc(false) ) * P("}")-- grouped local splitter = Ct(( #P("{") * ( @@ -39,11 +40,11 @@ local trace_details = false trackers.register("languages.replacements.deta local report_replacement = logs.reporter("languages","replacements") -local glyph_code = nodes.nodecodes.glyph -local glue_code = nodes.nodecodes.glue +local glyph_code = nodes.nodecodes.glyph +local glue_code = nodes.nodecodes.glue -local spaceskip_code = nodes.gluecodes.spaceskip -local xspaceskip_code = nodes.gluecodes.xspaceskip +local spaceskip_code = nodes.gluecodes.spaceskip +local xspaceskip_code = nodes.gluecodes.xspaceskip local nuts = nodes.nuts @@ -63,8 +64,9 @@ local setattrlist = nuts.setattrlist local setoptions = nuts.setoptions local glyphoptioncodes = tex.glyphoptioncodes -local norightligature_option = glyphoptioncodes.norightligature -local noleftligature_option = glyphoptioncodes.noleftligature + +local norightligature_option = glyphoptioncodes.norightligature +local noleftligature_option = glyphoptioncodes.noleftligature local insertbefore = nuts.insertbefore local insertafter = nuts.insertafter @@ -76,11 +78,12 @@ local nodepool = nuts.pool local new_disc = nodepool.disc local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue + +local unsetvalue = attributes.unsetvalue local enableaction = nodes.tasks.enableaction -local v_reset = interfaces.variables.reset +local v_reset = interfaces.variables.reset local implement = interfaces.implement @@ -90,7 +93,7 @@ local splitprocessor = processors.split local replacements = languages.replacements or { } languages.replacements = replacements -local a_replacements = attributes.private("replacements") +local a_replacements = attributes.private("replacements") local lists = { } local last = 0 @@ -111,28 +114,48 @@ lists[v_reset].attribute = unsetvalue -- so we discard 0 -- todo: glue kern attr local function add(root,word,replacement) - local processor, replacement = splitprocessor(replacement,true) -- no check - replacement = lpegmatch(stripper,replacement) or replacement - local list = utfsplit(word) -- ,true) - local size = #list - for i=1,size do - local l = utfbyte(list[i]) - if not root[l] then - root[l] = { } + if type(replacement) == "function" then + local list = utfsplit(word) -- ,true) + local size = #list + for i=1,size do + local l = utfbyte(list[i]) + if not root[l] then + root[l] = { } + end + if i == size then + root[l].final = { + word = word, + replacer = replacement, + processor = processor, + oldlength = size, + } + end + root = root[l] end - if i == size then - local special = find(replacement,"{",1,true) - local newlist = lpegmatch(splitter,replacement) - root[l].final = { - word = word, - replacement = replacement, - processor = processor, - oldlength = size, - newcodes = newlist, - special = special, - } + else + local processor, replacement = splitprocessor(replacement,true) -- no check + replacement = lpegmatch(stripper,replacement) or replacement + local list = utfsplit(word) -- ,true) + local size = #list + for i=1,size do + local l = utfbyte(list[i]) + if not root[l] then + root[l] = { } + end + if i == size then + local special = find(replacement,"{",1,true) + local newlist = lpegmatch(splitter,replacement) + root[l].final = { + word = word, + replacement = replacement, + processor = processor, + oldlength = size, + newcodes = newlist, + special = special, + } + end + root = root[l] end - root = root[l] end end @@ -192,16 +215,29 @@ local ispunctuation = characters.is_punctuation -- for punctuation was added. local function replace(head,first,last,final,hasspace,overload) - local current = first - local prefirst = getprev(first) or head - local postlast = getnext(last) - local oldlength = final.oldlength - local newcodes = final.newcodes + local current = first + local prefirst = getprev(first) or head + local postlast = getnext(last) + local oldlength = final.oldlength + local newcodes = final.newcodes + local word = final.word + local replacement = final.replacement + local replacer = final.replacer + local special = final.special + if type(replacer) == "function" then + replacement = replacer(word) + if type(replacement) == "string" then + special = find(replacement,"{",1,true) + newcodes = lpegmatch(splitter,replacement) + else + return + end + end local newlength = newcodes and #newcodes or 0 if trace_replacements then - report_replacement("replacing word %a by %a",final.word,final.replacement) + report_replacement("replacing word %a by %a",word,replacement) end - if hasspace or final.special then + if hasspace or special then -- It's easier to delete and insert so we do just that. On the todo list is -- turn injected spaces into glue but easier might be to let the char break -- handler do that ... @@ -245,9 +281,9 @@ local function replace(head,first,last,final,hasspace,overload) if i == 1 then setoptions(new,norightligature_option) elseif i == n then - setoptions(new,glyphoptioncodes.noleftligature | norightligature_option) + setoptions(new,noleftligature_option | norightligature_option) else - setoptions(new,glyphoptioncodes.noleftligature) + setoptions(new,noleftligature_option) end head, current = insertafter(head,current,new) end @@ -271,13 +307,13 @@ local function replace(head,first,last,final,hasspace,overload) elseif newlength == 0 then -- we overload elseif oldlength == newlength then - if final.word ~= final.replacement then + if word ~= replacement then for i=1,newlength do setchar(current,newcodes[i]) current = getnext(current) end end - current = getnext(final) + -- current = getnext(final) -- some left over? no next! elseif oldlength < newlength then for i=1,newlength-oldlength do local n = copy_node(current) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl index 03b761bb746..798bbde4299 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl @@ -23,6 +23,7 @@ \definesystemattribute[replacements][public,global] +%D \starttyping %D \startluacode %D %D -- todo: other nodes (prelude to more experiments with auto dropped caps) @@ -43,12 +44,27 @@ %D \replaceword[more][---][—] %D \replaceword[basics][special][veryspe{>>>}{<<<}{=}cial] %D -%D \starttyping %D \start \setreplacements[basics] What the heck, it's now or never, isn't it new? \par \stop %D \start \setreplacements[more] Do we --- {\it really} --- need this kind of crap? \par \stop %D \start \setreplacements[basics] All kinds of special thingies! \par \stop %D \start \setreplacements[basics] \hsize1mm special \par \stop %D \stoptyping +%D +%D Only in \LUA, functions: +%D +%D \startluacode +%D languages.replacements.add("basics", { +%D ["one"] = "cool", +%D ["two"] = function(s) +%D return "warm" +%D end +%D }) +%D \stopluacode +%D +%D \starttyping +%D \start \setreplacements[basics] It's one in here! \stop \par +%D \start \setreplacements[basics] It's two in here! \stop \par +%D \stoptyping \permanent\protected\def\setreplacements[#1]% {\clf_setreplacements{#1}} @@ -56,7 +72,7 @@ \permanent\protected\def\resetreplacements {\c_attr_replacements\attributeunsetvalue} -\permanent\tolerant\protected\def\replaceword[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\replaceword[#1]#*[#S#2]#*[#S#3]% {\ifarguments\or\or \clf_addreplacementslist{#1}{#2}% \or diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt index 2591659280a..29a60df1390 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt @@ -40,13 +40,13 @@ local getvalue = attributes.getvalue local transliteration = { } languages.transliteration = transliteration -local a_transliteration = attributes.private("transliteration") -local unsetvalue = attributes.unsetvalue +local a_transliteration = attributes.private("transliteration") +local unsetvalue = attributes.unsetvalue local implement = interfaces.implement local context = context -local zwj = utf.char(0x200D) +local zwj = utf.char(0x200D) -- local lastmapping = 0 local loadedmappings = { } @@ -87,13 +87,14 @@ local converters = { -- end, ["mapping"] = function(m) local t_mapping = m.mapping +-- inspect(t_mapping) if t_mapping then local t_exceptions = m.exceptions local p = Cs ( ( utfchartabletopattern(t_mapping) / t_mapping + C(utfcharacterpattern) )^0 ) - -- lpeg.print(p) +-- lpeg.print(p) return function(s,e) return (e and e[s]) or t_exceptions[s] or lpegmatch(p,s) or s end @@ -114,7 +115,7 @@ function transliteration.use(library) if lib == nil then -- todo: use library loader local data = require("lang-imp-" .. library) - if data then + if type(data) == "table" then local transliterations = data.transliterations if transliterations then for name, d in table.sortedhash(transliterations) do diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl index 66a020a141d..adfc5c2c75f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl @@ -37,18 +37,18 @@ {\usetransliterationstyleandcolor\c!style\c!color \uselanguageparameter\transliterationparameter \clf_settransliteration{\currenttransliteration}{\transliterationparameter\c!vector}% - \the\everytransliterations} + \expand\everytransliterations} \permanent\tolerant\protected\def\settransliteration[#1]#;#2% - {\edef\currenttransliteration{#1#2}% + {\cdef\currenttransliteration{#1#2}% \lang_transliteration_common} \permanent\protected\def\transliterationexception[#1]#2#3% {\clf_transliterationexception{#1}{#2}{#3}} -\permanent\tolerant\protected\def\starttransliteration[#1]#*[#2]% +\permanent\tolerant\protected\def\starttransliteration[#1]#*[#S#2]% {\begingroup - \edef\currenttransliteration{#1}% + \cdef\currenttransliteration{#1}% \ifparameter#2\or \setupcurrenttransliteration[#2]% \fi @@ -61,7 +61,7 @@ \permanent\tolerant\protected\def\transliteration[#1]#;#2% {\groupedcommand - {\edef\currenttransliteration{#1#2}% + {\cdef\currenttransliteration{#1#2}% \lang_transliteration_common \transliterationparameter\c!left\relax} {\transliterationparameter\c!right\relax}} @@ -87,53 +87,163 @@ \protect \endinput -% \setupbodyfont[dejavu] +% \starttext +% +% \switchtobodyfont[shobhika] +% +% \usetransliteration[indic] +% +% \definetransliteration +% [MyDeva] +% [color=blue, +% vector={iast to deva}] +% +% \definetransliteration +% [MyDevaB] +% [MyDeva] +% [color=green] +% +% \transliterationexception[iast to deva]{kauśika}{whoever} +% \transliterationexception[MyDeva] {kauśika}{hans} +% \transliterationexception[MyDevaB] {kauśika}{knuth} % -% \input lang-tra.mkiv +% \starttransliteration[MyDeva] +% idaṁ adbhutam kauśika tisraḥ garuḍavāhanan% +% \stoptransliteration % -% \definetransliteration[serbian][serbian to latin] +% \starttransliteration[MyDevaB] +% idaṁ adbhutam kauśika tisraḥ garuḍavāhanan% +% \stoptransliteration +% +% \stoptext +% +% \setupbodyfont[dejavu] +% +% \setupalign[tolerant,stretch] % % \starttext % -% \settransliteration[serbian to latin] +% % \enabletrackers[languages.transliteration] % -% \startchapter[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}] -% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ -% \start -% \settransliteration[serbian to latin] -% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ -% \stop -% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ -% \stopchapter +% \usetransliteration[serbian] %at some point we can preload % -% \resettransliteration +% \definetransliteration +% [MySerbian] +% [color=red, +% language=en, +% vector={serbian to latin}] % -% \startchapter[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}] +% \definetransliteration +% [MySerbianX] +% [MySerbian] +% [color=blue] +% +% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ +% \start +% \settransliteration[serbian to latin] % АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ -% \start -% \settransliteration[serbian to latin] -% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ -% \stop +% \stop +% \starttransliteration[MySerbian]% % АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ -% \stopchapter +% \stoptransliteration +% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ +% \transliteration[MySerbianX]{АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ} +% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ +% \starttransliteration[MySerbian][color=green]% +% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ +% \stoptransliteration +% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ % -% \definehead[ChapterA][chapter] -% \definehead[ChapterB][chapter] +% \switchtobodyfont[rachana] % -% \startsetups s-to-l -% \settransliteration[serbian to latin] -% \red -% \stopsetups +% \usetransliteration[indic] +% +% \definebuffer[passage] +% \startbuffer[passage] +% तिस्रः खलु विधेर्विधाः – अपूर्वविधिः नियमविधिः परिसङ्ख्याविधिश्च इति। तत्र +% कालत्रयेऽपि कथमप्यप्राप्तस्य प्राप्तिफलको विधिराद्यः। यथा ‘व्रीहीन् प्रोक्षति’ +% ... +% तदनुनिष्पादिन्या अविधेयगतत्वेन विप्रकृष्टाया इतरनिवृत्तेः सन्निकृष्टफलसम्भवे +% फलत्वानौचित्यात् । +% \stopbuffer +% +% \language[sa] +% +% \definedfont[file:arialuni.ttf*devanagari-two at 12pt] +% +% \definedfont[file:shobhika-regular.otf*devanagari-two at 12pt] +% +% \getbuffer[passage] +% +% % \page +% % {\settransliteration[deva to mlym]\getbuffer[passage]} +% +% \page +% +% \startlines +% \transliterate[deva to iast]{आनन्दः} +% \transliterate[deva to iast]{अक्षयं} +% \transliterate[deva to iast]{अवप्लुतं} +% \transliterate[deva to iast]{त्रैयी} +% \transliterate[deva to iast]{वार्त्तां} +% \transliterate[deva to iast]{सान्द्रानन्दावबोधात्मकं} +% \transliterate[deva to iast]{गरुडवाहनन्} +% \stoplines +% +% \page % -% % maybe we need a setups key for this -% % hm, \definesetups [xxx] [aa,bb,cc] +% \startlines +% \transliterate[iast to deva]{ānandaḥ} +% \transliterate[iast to deva]{ati} +% \transliterate[iast to deva]{ānandaḥ} +% \transliterate[iast to deva]{ati} +% \transliterate[iast to deva]{krauñca} +% \transliterate[iast to deva]{krodhaṁ} +% \transliterate[iast to deva]{kruddhaṁ} +% \transliterate[iast to deva]{upahvarāyi} +% \transliterate[iast to deva]{hārdika} +% \transliterate[iast to deva]{śaunaśśepaḥ} +% \transliterate[iast to deva]{tiśṣitaḥ} +% \transliterate[iast to deva]{agryīṁ} +% \transliterate[iast to deva]{saṅkulam} +% \transliterate[iast to deva]{śrīrāman} +% \transliterate[iast to deva]{niścitavantaḥ} +% \transliterate[iast to deva]{idam adbhutama ai kr} +% \transliterate[iast to deva]{kr saṁdhi} +% \transliterate[iast to deva]{a} +% \transliterate[iast to deva]{akr} +% \transliterate[iast to deva]{āhriyate iast} +% \transliterate[iast to deva]{utkaṁpita iast} +% \transliterate[iast to deva]{śagdhyūṣū} +% \transliterate[iast to deva]{tretā} +% \transliterate[iast to deva]{ati} +% \transliterate[iast to deva]{"ai"} +% \transliterate[iast to deva]{dhavaḻa} +% \transliterate[iast to deva]{śrīrāman} +% \transliterate[iast to deva]{ś} +% \transliterate[iast to deva]{śra} +% \transliterate[iast to deva]{​arkau} +% \transliterate[iast to deva]{kāvikrato} +% \transliterate[iast to deva]{saṅkulam} +% \transliterate[iast to deva]{sundaraṁ} +% \transliterate[iast to deva]{bhirarkiṇaḥ} +% \transliterate[iast to deva]{bhirarkkiṇaḥ} +% \transliterate[iast to deva]{karkki khārkki} +% \transliterate[iast to deva]{cacchā} +% \transliterate[iast to deva]{karkki khakhārkki "kr"} +% \transliterate[iast to deva]{i‍​ast śrotṝn} +% \transliterate[iast to deva]{test ati krarkkṛ au} +% \stoplines % -% \setuphead[ChapterB][commandbefore=\setups{s-to-l}] +% सङ्कुलम्​ श्रीरामन् निश्चितवन्तः इदम् अद्भुतम् ऐ % -% \startChapterA[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}] -% \stopChapterA +% \transliterate [deva to iast] {सौन्दर्य सुन्दर सुंदर सौंदर्य आनन्दः कर्तृत्त्व +% सिद्धम् सिद्धं बद्धैः भकार शब्दः बभ्रूवाहन गरुडवाहनन् सान्द्रानन्दावबोधात्मकं। +% auṣadhi madhumattamaḥ इअस्त षट्त्रिंशत् तीर्थास्पदं शिवविरिञ्चिनुतं शरण्यं +% ऐन्द्र पर्व अभ्यर्च्चैर चँद्रम् सदाऽत्मा, "तेस्त" % -% \startChapterB[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}] -% \stopChapterB +% अ॒ग्निमी᳚ळे पुरोहि॑तम् +% खखार्क्कि क्रर्क्कृ +% } % % \stoptext diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt index 7607d7d8472..a2f6b3f7bf5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt @@ -16,13 +16,11 @@ local ctx_pushcatcodes = context.pushcatcodes local ctx_popcatcodes = context.popcatcodes local implement = interfaces.implement -local variables = interfaces.variables - -local v_before = variables.before -local v_after = variables.after - local is_letter = characters.is_letter +local v_before = interfaces.variables.before +local v_after = interfaces.variables.after + -- Hyphenating URL's is somewhat tricky and a matter of taste. I did consider using -- a dedicated hyphenation pattern or dealing with it by node parsing, but the -- following solution suits as well. After all, we're mostly dealing with ASCII diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl index 2d41c6c3258..4311105a048 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl @@ -101,7 +101,7 @@ \permanent\protected\def\hyphenatedurl#1% {\dontleavehmode \begingroup - \the\everyhyphenatedurl + \expand\everyhyphenatedurl \normallanguage\zerocount % \nohyphens in mkiv \scratchskipone\zeropoint\s!plus\dimexpr\emwidth/12\s!minus\dimexpr\emwidth/24\relax % 1.00pt @ 12pt \scratchskiptwo\zeropoint\s!plus\dimexpr\emwidth/48\s!minus\dimexpr\emwidth/96\relax % 0.25pt @ 12pt diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-wrd.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-wrd.mkxl index ba1cfc5710d..ca6d6645c69 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lang-wrd.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lang-wrd.mkxl @@ -49,7 +49,7 @@ \fi \to \everysetupspellchecking -\permanent\tolerant\protected\def\loadspellchecklist[#1]#*[#2]% can be public implementor +\permanent\tolerant\protected\def\loadspellchecklist[#1]#*[#S#2]% can be public implementor {\clf_loadspellchecklist{#1}{#2}} \setupspellchecking diff --git a/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt index 2d922b16a08..f35ae3e2be4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt @@ -12,8 +12,8 @@ if not modules then modules = { } end modules ['layo-ini'] = { local texgetcount = tex.getcount local conditionals = tex.conditionals -local c_realpageno = tex.iscount("realpageno") -local c_pagenoshift = tex.iscount("pagenoshift") +local c_realpageno = tex.iscount("realpageno") +local c_pagenoshift = tex.iscount("pagenoshift") layouts = { status = { }, diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mysql.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mysql.lmt index 3e938a6de48..2749bb631d7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mysql.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mysql.lmt @@ -172,6 +172,7 @@ end local wraptemplate = [[ local converters = utilities.sql.converters local deserialize = utilities.sql.deserialize +local fromjson = utilities.sql.fromjson local tostring = tostring local tonumber = tonumber diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-openssl.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-openssl.lmt new file mode 100644 index 00000000000..dd423e4839f --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-openssl.lmt @@ -0,0 +1,116 @@ +if not modules then modules = { } end modules ['libs-imp-openssl'] = { + version = 1.001, + comment = "companion to luat-lib.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local type = type +local dirname = file.dirname + +local libname = "openssl" +local libfiles = os.name == "windows" + and { "libcrypto-3-x64", "libssl-3-x64" } + or { "libcrypto", "libssl" } + +local openssllib = resolvers.libraries.validoptional(libname) + +if not openssllib then return end + +local openssl_sign = openssllib.sign +local openssl_verify = openssllib.verify +local openssl_getversion = openssllib.getversion + +local report = logs.reporter(libname) + +local function okay() + if resolvers.libraries.optionalloaded(libname,libfiles) then + -- openssllib.initialize() + okay = function() return true end + else + okay = function() return false end + end + return okay() +end + +local messages = { + "invalid certificate file", + "invalid certificate", + "invalid private key", + "invalid data file", + "invalid signature", + "unable to open output file", + "unable to reset file", + "unable to save signature", + "incomplete specification", + "library is unitialized", +} + +-- this : datafile = "oeps.tmp" +-- or that : data = io.loaddata("oeps.tmp") +-- mandate : certfile = "cert.pem" +-- mandate : password = "test" +-- optional : resultfile = "oeps.sig" + +local function sign(specification) + if okay() then + local t = type(specification) + if t == "table" then + local result, message = openssl_sign(specification) + if result then + return true, message + else + report(messages[message] or "unknown error") + end + else + report("invalid argument") + end + else + report("no openssl library loaded") + end + return false +end + +local function verify(specification) + if okay() then + local t = type(specification) + if t == "table" then + local result, message = openssl_verify(specification) + if result then + return true, message + else + report(messages[message] or "unknown error") + end + else + report("invalid argument") + end + else + report("no openssl library loaded") + end + return false +end + +local function getversion() + return okay() and openssl_getversion() +end + +local openssl = { + getversion = getversion, + sign = sign, + verify = verify, + libfiles = libfiles, + libfile = libfiles[1], + libpath = dirname(libfiles[1]), +} + +package.loaded[libname] = openssl + +return openssl + +-- local result, message = openssl.sign { +-- datafile = "oeps.pdf", +-- certfile = "cert.pem", +-- password = "test", +-- resultfile = "oeps.xxx", +-- } diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-postgress.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-postgress.lmt index 629079b01a5..2ffd2b002b1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-postgress.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-postgress.lmt @@ -171,6 +171,7 @@ end local wraptemplate = [[ local converters = utilities.sql.converters local deserialize = utilities.sql.deserialize +local fromjson = utilities.sql.fromjson local tostring = tostring local tonumber = tonumber diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl index 9905e047095..bf256dedb10 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl @@ -30,7 +30,7 @@ \definefont[usedzintfont][dejavusansmono at 10bp] -\permanent\protected\def\barcode[#1]% [alternative=,text=] +\permanent\protected\def\barcode[#S#1]% [alternative=,text=] {\bgroup \usedzintfont \getdummyparameters @@ -123,5 +123,3 @@ end \stopluacode \stoptext - - diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt index 4d9af002c79..aaeecc2248a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt @@ -22,7 +22,7 @@ if not modules then modules = { } end modules ['lpdf-ano'] = { -- much without looking critical at how it performs. local next, tostring, tonumber, rawget, type = next, tostring, tonumber, rawget, type -local rep, format, find = string.rep, string.format, string.find +local rep, format, find, match = string.rep, string.format, string.find, string.match local min = math.min local lpegmatch = lpeg.match local formatters = string.formatters @@ -41,11 +41,11 @@ local report_destinations = logs.reporter("backend","destinations") local report_bookmarks = logs.reporter("backend","bookmarks") local variables = interfaces.variables -local v_auto = variables.auto -local v_page = variables.page -local v_name = variables.name +local v_auto = variables.auto +local v_page = variables.page +local v_name = variables.name -local factor = number.dimenfactors.bp +local factor = number.dimenfactors.bp local settings_to_array = utilities.parsers.settings_to_array @@ -248,13 +248,49 @@ lpdf.makenametree = pdfmakenametree -- is used. Also, we default to a non-intrusive gray and the outline is kept -- thin without dashing lines. This is as far as I'm prepared to go. This way -- it can also be used as a debug feature. +-- +-- A bit of granularity is possible by specifying colors per kind (+special) but +-- it assumes that one knows what categories there are (we report unknown ones +-- once). This is an undocumented feature (at least in manuals). Keep in mind that +-- after decades of pdf being around borders are not supported widely. They are +-- ugly anyway and they basically contradict quality typesetting. Directives are: +-- +-- references.border=color +-- +-- references.border=inner:red +-- references.border=special operation:blue +-- references.border=special operation+url:green + +-- This will become a plugin once I have time for it: the directive can load the +-- code then: lpdf-ano-imp-border.lmt or so. local pdf_border_style = pdfarray { 0, 0, 0 } -- radius radius linewidth local pdf_border_color = nil local set_border = false +local use_borders = false -local function pdfborder() +local function pdfborder(actions) set_border = true + if use_borders and actions then + local action = actions[1] + if action then + local kind = action.kind + local special = action.special or "" + local border = use_borders[kind] + if not border then + report_references("no border color defined for %a",kind) + use_borders[kind] = { [""] = pdf_border_color } + else + border = border[special] + if border then + return pdf_border_style, border + else + report_references("no border color defined for %a : %a",kind,special) + use_borders[kind] = { [special] = pdf_border_color } + end + end + end + end return pdf_border_style, pdf_border_color end @@ -263,18 +299,32 @@ lpdf.border = pdfborder directives.register("references.border",function(v) if v and not set_border then if type(v) == "string" then - local m = attributes.list[attributes.private('color')] or { } - local c = m and m[v] - local v = c and attributes.colors.value(c) - if v then - local r = v[3] - local g = v[4] - local b = v[5] - -- if r == g and g == b then - -- pdf_border_color = pdfarray { r } -- reduced, not not ... bugged viewers - -- else - pdf_border_color = pdfarray { r, g, b } -- always rgb - -- end + local function f(v) + local m = attributes.list[attributes.private('color')] or { } + local c = m and m[v] + local v = c and attributes.colors.value(c) + if v then + return pdfarray { v[3], v[4], v[5] } -- always rgb + end + end + if find(v,":") then + if not use_borders then + use_borders = { } + end + local kind, special, color = match(v,"^([a-z%s]+)+*([a-z%s]*):(.+)$") + if kind then + local c = f(color) + if c then + local k = use_borders[kind] + if k then + k[special] = c + else + use_borders[kind] = { [special] = c } + end + end + end + else + pdf_border_color = f(v) end end if not pdf_border_color then @@ -399,7 +449,7 @@ local v_minheight = variables.minheight local v_fit = variables.fit local v_tight = variables.tight -local c_realpageno = tex.iscount("realpageno") +local c_realpageno = tex.iscount("realpageno") -- nicer is to create dictionaries and set properties but it's a bit overkill @@ -807,10 +857,9 @@ lpdf.action = pdfaction function codeinjections.prerollreference(actions) -- share can become option if actions then --- inspect(actions) local main, n = pdfaction(actions) if main then - local bs, bc = pdfborder() + local bs, bc = pdfborder(actions) main = pdfdictionary { Subtype = pdf_link, -- Border = bs, diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt index 441f4cf9c3a..ace79e4cb90 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt @@ -6,12 +6,12 @@ if not modules then modules = { } end modules ['lpdf-aux'] = { license = "see context related readme files" } -local tonumber = tonumber local format, concat = string.format, table.concat local utfchar, utfbyte, char = utf.char, utf.byte, string.char local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns local P, C, R, S, Cc, Cs, V = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cc, lpeg.Cs, lpeg.V ----- rshift = bit32.rshift +local hextointeger, octtointeger = string.hextointeger,string.octtointeger lpdf = lpdf or { } @@ -54,12 +54,12 @@ end -- * Cs( ( -- zero / "" -- + two / function(a,b) --- a = (tonumber(a,16) - 0xD800) * 1024 --- b = (tonumber(b,16) - 0xDC00) +-- a = (hextointeger(a) - 0xD800) * 1024 +-- b = (hextointeger(b) - 0xDC00) -- return utfchar(a+b) -- end -- + one / function(a) --- return utfchar(tonumber(a,16)) +-- return utfchar(hextointeger(a)) -- end -- )^1 ) * P(-1) -- } @@ -71,7 +71,7 @@ end local more = 0 local pattern = C(4) / function(s) -- needs checking ! - local now = tonumber(s,16) + local now = hextointeger(s) if more > 0 then now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000 more = 0 @@ -99,7 +99,7 @@ end local b_pattern = Cs((P("\\")/"" * ( S("()") + S("nrtbf")/ { n = "\n", r = "\r", t = "\t", b = "\b", f = "\f" } - + lpegpatterns.octdigit^-3 / function(s) return char(tonumber(s,8)) end) + + lpegpatterns.octdigit^-3 / function(s) return char(octtointeger(s)) end) + P(1))^0) local u_pattern = lpegpatterns.utfbom_16_be * lpegpatterns.utf16_to_utf8_be -- official @@ -119,12 +119,12 @@ local x_pattern = P { "start", * Cs( ( zero / "" + two / function(a,b) - a = (tonumber(a,16) - 0xD800) * 1024 - b = (tonumber(b,16) - 0xDC00) + a = (hextointeger(a) - 0xD800) * 1024 + b = (hextointeger(b) - 0xDC00) return utfchar(a+b) end + one / function(a) - return utfchar(tonumber(a,16)) + return utfchar(hextointeger(a)) end )^1 ) * P(-1) } diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt index c1499b75e4e..eb025e4503d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt @@ -53,7 +53,7 @@ local registertransparancy = transparencies.register local transparenciesvalue = transparencies.value local transparencytoattribute = transparencies.toattribute -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue local setmetatableindex = table.setmetatableindex diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt index f63dcf6ef75..c503d7ac618 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt @@ -32,10 +32,9 @@ if not modules then modules = { } end modules ['lpdf-ini'] = { -- and subjected to change. local next, type, unpack, rawget = next, type, unpack, rawget -local char, byte, gsub, sub, match, rep, gmatch = string.char, string.byte, string.gsub, string.sub, string.match, string.rep, string.gmatch -local formatters = string.formatters -local format = string.format -local concat, sortedhash, sort = table.concat, table.sortedhash, table.sort +local char, byte, gsub, sub, match, rep, gmatch, find = string.char, string.byte, string.gsub, string.sub, string.match, string.rep, string.gmatch, string.find +local formatters, format = string.formatters, string.format +local concat, sortedhash, sortedkeys, sort, count = table.concat, table.sortedhash, table.sortedkeys, table.sort, table.count local utfchar = utf.char local random, round, max, abs, ceiling = math.random, math.round, math.max, math.abs, math.ceiling local setmetatableindex = table.setmetatableindex @@ -56,9 +55,8 @@ local report_fonts = logs.reporter("backend","fonts") local trace_fonts = false local trace_details = false -local dimenfactors = number.dimenfactors -local bpfactor = dimenfactors.bp -local ptfactor = dimenfactors.pt +local bpfactor = number.dimenfactors.bp +local ptfactor = number.dimenfactors.pt trackers.register("backend.fonts", function(v) trace_fonts = v end) trackers.register("backend.fonts.details",function(v) trace_details = v end) @@ -120,7 +118,7 @@ end -- A couple of shared helpers. -local tounicodedictionary, widtharray, collectindices, subsetname, includecidset, forcecidset, tocidsetdictionary +local tounicodedictionary, widtharray, lmtxregistry, collectindices, subsetname, includecidset, forcecidset, tocidsetdictionary do @@ -231,6 +229,80 @@ end return widths end + local includebackmap = true + + directives.register("backend.pdf.includebackmap", function(v) + -- directives.register("backend.pdf.lmtxregistry", function(v) + includebackmap = v + end) + + lmtxregistry = function(details,include,blobs,minindex,maxindex) + if includebackmap and maxindex > 0 then + local backmap = pdfarray() + local streamhash = details.hash + local properties = details.properties + local filename = file.basename(properties.filename) + local filetype = file.suffix(filename) -- for now + local fontname = properties.name or file.nameonly(filename) + local instance = properties.instance or "" + if filename and (filetype == "otf" or filetype == "ttf") then + local streams = details.streams + if streams then + local fontheader = streams.fontheader + if fontheader then + local streams = streams.streams + if streams then + local subfont = details.properties.subfont or 1 + local length = 0 + local lastindex = -1 + local sublist = nil + for index=minindex,maxindex do + local idx = include[index] + if idx then + local data = blobs[index] + if index == lastindex + 1 then + sublist[#sublist+1] = idx + else + if sublist then + length = length + 1 + backmap[length] = sublist + end + sublist = pdfarray { idx } + length = length + 1 + backmap[length] = index + end + lastindex = index + end + end + length = length + 1 + backmap[length] = sublist + if instance == "" then + instance = nil + elseif find(instance,"=") then + local i = fonts.handlers.otf.readers.helpers.axistofactors(instance) + instance = pdfdictionary(i) + end + if subfont == 1 then + subfont = nil + end + return pdfreference(pdfflushobject(pdfdictionary { + IndexMap = pdfreference(pdfflushobject(backmap)) or nil, + StreamHash = streamhash or nil, + FileName = filename, + FontName = fontname, + SubFont = subfont, + Instance = instance, + Version = fontheader.fontversion, + GlyphCount = #streams + (streams[0] and 1 or 0), + FontMode = fonts.mode(), + } )) + end + end + end + end + end + end + -- we need to go through indices because descriptions can be different (take -- basemode remappings) @@ -267,7 +339,7 @@ end report_fonts("embedded: hash %a, minindex %i, maxindex %i",hash,minindex,maxindex) for k, v in sortedhash(include) do local d = resolved[k] - if d.dupindex then + if d and d.dupindex then report_fonts(" 0x%04X : 0x%04X (duplicate 0x%05X)",k,v,d.index) else report_fonts(" 0x%04X : 0x%04X",k,v) @@ -277,7 +349,7 @@ end return resolved, include, minindex, maxindex end - includecidset = false + includecidset = true -- nicer for standard checking forcecidset = false -- for private testing only function lpdf.setincludecidset(v) @@ -290,22 +362,45 @@ end forcecidset = v end) + -- tocidsetdictionary = function(indices,min,max) -- also works ok + -- if includecidset or forcecidset then + -- local s = sparse.new(1) + -- sparse.set(s,0) + -- for i=min,max do + -- if indices[i] then + -- sparse.set(s,i) + -- end + -- end + -- s = sparse.concat(s,nil,nil,2) -- msb first + -- return pdfreference(pdfflushstreamobject(s)) + -- end + -- end + + local function tocidset(indices,min,max,forcenotdef) + if not max then + max = count(indices) + end + local b = { } + local m = (max // 8) + 1 + for i=0,m do + b[i] = 0 -- we can do a newtable instead + end + if forcenotdef then + b[0] = b[0] | (1 << 7) -- force notdef into the file + end + for i in next, indices do + local bi = i // 8 + local ni = i % 8 + b[bi] = b[bi] | (1 << (7-ni)) + end + return char(unpack(b,0,#b)) -- use helper + end + + lpdf.tocidset = tocidset + tocidsetdictionary = function(indices,min,max) if includecidset or forcecidset then - local b = { } - local m = (max + 7) // 8 - for i=0,max do - b[i] = 0 - end - b[0] = b[0] | (1 << 7) -- force notdef into the file - for i=min,max do - if indices[i] then - local bi = i // 8 - local ni = i % 8 - b[bi] = b[bi] | (1 << (7-ni)) - end - end - b = char(unpack(b,0,#b)) + local b = tocidset(indices,min,max,true) return pdfreference(pdfflushstreamobject(b)) end end @@ -660,23 +755,32 @@ do -- if fontfile.streams.cffinfo then -- error -- end - fontfile.maxp = concat { - tocardinal4(0x00010000), - tocardinal2(n), - tocardinal2(t.points), - tocardinal2(t.contours), - tocardinal2(t.compositepoints), - tocardinal2(t.compositecontours), - tocardinal2(t.zones), - tocardinal2(t.twilightpoints), - tocardinal2(t.storage), - tocardinal2(t.functiondefs), - tocardinal2(t.instructiondefs), - tocardinal2(t.stackelements), - tocardinal2(t.sizeofinstructions), - tocardinal2(t.componentelements), - tocardinal2(t.componentdepth), - } + local version = tocardinal4(0x00010000) + local count = tocardinal2(n) + if t.points then + fontfile.maxp = concat { + version, count, + tocardinal2(t.points), + tocardinal2(t.contours), + tocardinal2(t.compositepoints), + tocardinal2(t.compositecontours), + tocardinal2(t.zones), + tocardinal2(t.twilightpoints), + tocardinal2(t.storage), + tocardinal2(t.functiondefs), + tocardinal2(t.instructiondefs), + tocardinal2(t.stackelements), + tocardinal2(t.sizeofinstructions), + tocardinal2(t.componentelements), + tocardinal2(t.componentdepth), + } + else -- catch bugged font that felt through the checking + local zero = tocardinal2(0) + fontfile.maxp = concat { + version, count, zero, zero, zero, zero, zero, + zero, zero, zero, zero, zero, zero, zero, zero, + } + end end tablecreators.loca = function(fontfile) return create(fontfile,"loca") end @@ -702,6 +806,15 @@ do end + local sharedmetadata = setmetatableindex(function(t,fontmeta) + local v = fontmeta or false + if fontmeta then + v = pdfreference(pdfflushstreamobject(fontmeta)) + end + t[fontmeta] = v + return v + end) + mainwriters["truetype"] = function(details) -- local fontfile = openfontfile(details) @@ -834,6 +947,7 @@ do local fontbbox = pdfarray { unpack(metabbox) } local ascender = metadata.ascender local descender = metadata.descender +-- local averagewidth= metadata.averagewidth local capheight = metadata.capheight or fontbbox[4] local stemv = metadata.weightclass local italicangle = metadata.italicangle @@ -851,13 +965,15 @@ do end end -- - local reserved = pdfreserveobject() + local registry = lmtxregistry(details,include,blobs,minindex,maxindex) + local reserved = pdfreserveobject() local child = pdfdictionary { Type = pdfconstant("Font"), Subtype = pdfconstant("CIDFontType2"), BaseFont = basefont, FontDescriptor = pdfreference(reserved), W = pdfreference(pdfflushobject(widths)), + LMTXRegistry = registry or nil, CIDToGIDMap = pdfconstant("Identity"), CIDSystemInfo = pdfdictionary { Registry = pdfstring("Adobe"), @@ -876,13 +992,14 @@ do -- FontMatrix = pdfarray { 0.001, 0, 0, 0.001, 0, 0 }, Ascent = scale(ascender), Descent = scale(descender), +-- AvgWidth = scale(averagewidth), ItalicAngle = round(italicangle or 0), CapHeight = scale(capheight), StemV = scale(stemv), XHeight = scale(xheight), FontFile2 = pdfreference(pdfflushstreamobject(fontdata)), CIDSet = tocidset, -- no longer needed but verifyers want it - Metadata = fontmeta and pdfreference(pdfflushstreamobject(fontmeta)) or nil, + Metadata = sharedmetadata[fontmeta] or nil, } local parent = pdfdictionary { Type = pdfconstant("Font"), @@ -1210,7 +1327,7 @@ do -- local charstrings = fontfile.charstrings local nofglyphs = #charstrings + 1 --- local fontmatrix = { 0.001, 0, 0, 0.001, 0, 0 } -- todo + -- local fontmatrix = { 0.001, 0, 0, 0.001, 0, 0 } -- todo, best not local fontbbox = fontfile.fontbbox local defaultwidth = cffinfo.defaultwidth or 0 local nominalwidth = cffinfo.nominalwidth or 0 @@ -1251,7 +1368,7 @@ do local underlineposition = todictnumber(cffinfo.underlineposition) local underlinethickness = todictnumber(cffinfo.underlinethickness) local charstringtype = todictnumber(2) --- local fontmatrix = todictarray(fontmatrix) + -- local fontmatrix = todictarray(fontmatrix) local ros = todictstring(fontfile,"Adobe") -- registry .. todictstring(fontfile,"Identity") -- identity .. todictnumber(0) -- supplement @@ -1322,7 +1439,7 @@ do .. underlineposition .. todictkey(12, 3) .. underlinethickness .. todictkey(12, 4) .. charstringtype .. todictkey(12, 6) --- .. fontmatrix .. todictkey(12, 7) + -- .. fontmatrix .. todictkey(12, 7) .. strokewidth .. todictkey(12, 8) .. topvars } @@ -1445,18 +1562,17 @@ do -- correction = correction * bpfactor / ptfactor local factor = 1000 / (units * correction) if false then --- if true then for k, v in sortedhash(chars) do if descriptions[k] then local w1 = descriptions[k].width local w2 = round((v.advance or v.width or 0) * factor) if w1 ~= w2 then local w = v.advance or v.width or 0 - print( - u,k,utf.char(k), - w1,w2, - ((v.advance or v.width or 0)*param.designsize/param.size) / 1000 - ) + -- print( + -- u,k,utf.char(k), + -- w1,w2, + -- ((v.advance or v.width or 0)*param.designsize/param.size) / 1000 + -- ) end else descriptions[k] = { @@ -1545,7 +1661,7 @@ do fontfile = closefontfile(fontfile) -- local units = fontheader.units or metadata.units - if units ~= 1000 then + if not units or units ~= 1000 then -- maybe only otf -- public sans has 2000 so we need to mess different from e.g. ttf report_fonts("width units in %a are %i, forcing 1000 instead",basefontname,units) @@ -1560,6 +1676,7 @@ do local fontbbox = pdfarray { unpack(metabbox) } local ascender = metadata.ascender or 0 local descender = metadata.descender or 0 + -- local averagewidth= metadata.averagewidth local capheight = metadata.capheight or fontbbox[4] local stemv = metadata.weightclass local italicangle = metadata.italicangle @@ -1578,13 +1695,15 @@ do end end -- - local reserved = pdfreserveobject() + local registry = lmtxregistry(details,include,blobs,minindex,maxindex) + local reserved = pdfreserveobject() local child = pdfdictionary { Type = pdfconstant("Font"), Subtype = pdfconstant("CIDFontType0"), BaseFont = basefont, FontDescriptor = pdfreference(reserved), W = pdfreference(pdfflushobject(widths)), + LMTXRegistry = registry or nil, CIDSystemInfo = pdfdictionary { Registry = pdfstring("Adobe"), Ordering = pdfstring("Identity"), @@ -1602,16 +1721,17 @@ do FontName = basefont, Flags = 4, FontBBox = fontbbox, --- FontMatrix = pdfarray { 0.001, 0, 0, 0.001, 0, 0 }, + -- FontMatrix = pdfarray { 0.001, 0, 0, 0.001, 0, 0 }, Ascent = scale(ascender), Descent = scale(descender), + -- AvgWidth = scale(averagewidth), ItalicAngle = round(italicangle or 0), CapHeight = scale(capheight), StemV = scale(stemv), XHeight = scale(xheight), CIDSet = tocidset, FontFile3 = pdfreference(pdfflushstreamobject(fontdata,fontstream())), - Metadata = fontmeta and pdfreference(pdfflushstreamobject(fontmeta)) or nil, + Metadata = sharedmetadata[fontmeta] or nil, } local parent = pdfdictionary { Type = pdfconstant("Font"), @@ -1651,6 +1771,128 @@ do mainwriters["opentype"](details) end + do + + local version = 0.003 + local cache = containers.define("fonts","converted",version,true) + local loaded = { } + + local loadpk = fonts.handlers.tfm.readers.loadpk + local findpk = resolvers.findpk + local pktocff = fonts.handlers.otf.readers.potracetocff + + local function loadstreams(filename,details,resolution,settings) + -- when we have a tfm and pfb but no afm filename can have a pfb suffix + filename = file.removesuffix(filename) -- unless pk? + local fullname = findpk(filename,resolution) + local instance = fullname and fullname ~= "" and loadpk(fullname) + if not instance then + report_fonts("unable to locate %a",filename) + return + end + local resolution = instance.resolution + local streams = { } + local glyphs = instance.glyphs or { } + local settings = setting or { } + local xmin = false + local ymin = false + local xmax = false + local ymax = false + local count = 0 + -- local size = 0 + for i=0,255 do + local glyph = glyphs[i] + if glyph then + local llx, lly, urx, ury, cff = pktocff(glyph,settings,resolution,i) + streams[i] = cff + if not xmin then + xmin = llx + ymin = lly + xmax = urx + ymax = ury + else + if xmin < llx then llx = xmin end + if ymin < lly then lly = ymin end + if xmax < urx then urx = xmax end + if ymax < ury then ury = ymax end + end + count = count + 1 + -- size = size + #cff + end + end + -- print(filename,size) + local filename = details.filename or "unknown" + return { + resolution = resolution, + format = "opentype", + filename = filename, + fullname = fullname, + streams = streams or { }, -- bad + names = { + family = filename, + fontname = filename, + fullname = filename, + notice = "Converted from MetaFont bitmaps by ConTeXt LMTX.", + version = "1.00", + }, + fontheader = { + fontversion = "2.004", + units = 1000, + xmin = xmin or 0, + ymin = ymin or 0, + xmax = xmax or 0, + ymax = ymax or 0, + }, + cffinfo = { + familyname = filename, + fullname = filename, + -- italicangle = 0, + -- monospaced = false, + -- underlineposition = -100, + -- underlinethickness = 50, + -- weight = "Medium", + bluescale = 0, + blueshift = 0, + bluefuzz = 0, + expansionfactor = 0, + }, + horizontalheader = { + ascender = 0, + descender = 0, + }, + maximumprofile = { + nofglyphs = count, + }, + } + end + + mainwriters["pkcff"] = function(details) + local filename = details.filename + local properties = details.properties + local resolution = properties.resolution or 7200 + local extrahash = properties.extrahash or resolution + local cachename = filename .. "-" .. extrahash + local converted = loaded[cachename] + if not converted then + converted = containers.read(cache,cachename) + if not converted or converted.version ~= version or converted.resolution ~= resolution or converted.extrahash ~= extrahash then + converted = loadstreams(filename,details,resolution,properties.potrace) + if converted then + converted.version = version + -- converted.resolution = resolution + converted.extrahash = extrahash + containers.write(cache,cachename,converted) + converted = containers.read(cache,cachename) -- frees old mem + loaded[cachename] = converted + end + end + end + details.streams = converted + mainwriters["type1"](details) + end + + end + do -- The methods might become plugins. @@ -1693,23 +1935,81 @@ do -- pk inclusion (not really tested but not really used either) - function methods.pk(filename) - local pkfullname = resolvers.findpk(filename,resolution) + -- Maybe this needs to be in font-shp .. but this is cheaper and it is only for + -- demos anyway. + + local version = 0.011 + local cache = containers.define("fonts","traced",version,true) + local loaded = { } + + function methods.pk(filename,details) + local resolution = details.properties.resolution or 7200 + local extrahash = details.properties.extrahash or resolution + local potraced = details.fontdata.potraced + local pkfullname = resolvers.findpk(filename,resolution) if not pkfullname or pkfullname == "" then + report_fonts("no pk file found: %a @ %i",filename,resolution) return end local readers = fonts.handlers.tfm.readers - local result = readers.loadpk(pkfullname) - local convert = readers.pktopdf + local result = readers.loadpk(pkfullname) -- not cached (yet) if not result or result.error then return end - local resolution = 600 +-- hm, maybe just resolution and fault on a missing file + resolution = result.resolution local widthfactor = resolution / 72 local scalefactor = 72 / resolution / 10 local factor = widthfactor / 65536 - local function pktopdf(glyph,data) - return convert(glyph,data,factor) -- return pdfcode, width + * (details.parameters.designsize / details.parameters.size) -- normalize width + local pktopdf = nil + -- + if potraced then -- we can also use properties.potrace + local cachename = filename .. "-" .. extrahash + local traced = loaded[cachename] + if not traced then + traced = containers.read(cache,cachename) + if not traced or traced.version ~= version or traced.resolution ~= resolution or traced.extrahash ~= extrahash then + local streams = { } + local convert = readers.potracedtopdf + -- we have this as helper already + local descriptions = details.fontdata.descriptions + local indices = { } + local widths = { } + for unicode, data in next, descriptions do + local di = data.index + if di then + indices[di] = data + end + end + -- + local settings = details.properties.potrace + for index, glyph in sortedhash(result.glyphs) do + streams[index], widths[index] = convert(glyph,indices[index],factor,settings) + end + traced = { + version = version, + resolution = resolution, + streams = streams, + widths = widths, + extrahash = extrahash, + } + containers.write(cache,cachename,traced) + traced = containers.read(cache,cachename) -- frees old mem + loaded[cachename] = traced + end + end + local streams = traced.streams + local widths = traced.widths + pktopdf = function(glyph,data) + local index = glyph.index + return streams[index], widths[index] + end + else + local convert = readers.pktopdf + pktopdf = function (glyph,data) + return convert(glyph,data,factor) -- return pdfcode, width + end end return result.glyphs, scalefactor, pktopdf, false, false end @@ -1718,16 +2018,18 @@ do local used = setmetatableindex("table") - -- function lpdf.registerfontmethod(name,f) - -- if f and not methods[name] then - -- methods[name] = f - -- end - -- end + function lpdf.registerfontmethod(name,f) + if type(f) == "function" and not methods[name] then + report_fonts("registering font method %a, continue on your own risk",name) + methods[name] = f + end + end function methods.pdf(filename,details) local properties = details.properties local pdfshapes = properties.indexdata[1] - local pdfdoc = openpdf(pdfshapes.filename) + local filename = pdfshapes.filename + local pdfdoc = openpdf(filename) local xforms = pdfdictionary() local nofglyphs = 0 if pdfdoc then @@ -1741,7 +2043,11 @@ do local image = useddoc[glyph] local reference = nil if not image then - image = embedimage(copypage(pdfdoc,glyph)) + image = embedimage(copypage(pdfdoc,glyph)) + if not image then + report_fonts("bad image in file %a",filenameme) + return + end nofglyphs = nofglyphs + 1 local name = f_glyph(nofglyphs) local stream = nil @@ -1804,7 +2110,12 @@ do image.embedded_stream = stream image.embedded_reference = pdfreference(image.objnum) xforms[name] = image.embedded_reference - return f_image_w(width,stream), width + if image.expose then + -- support color etc + return stream, width + else + return f_image_w(width,stream), width + end end local function wrapup() end @@ -2050,10 +2361,10 @@ do mainwriters["type3"] = function(details) local properties = details.properties - local basefontname = properties.basefontname or details.basefontname or properties.name -- messy + local basefontname = properties.basefontname or properties.name local askedmethod = properties.method or "pk" local method = methods[askedmethod] or methods.pk - if not method then + if not method or not basefontname or basefontname == "" then return end local glyphs, scalefactor, glyphtopdf, reset, getresources = method(basefontname,details) @@ -2090,11 +2401,9 @@ do differences[2] = c_notdef charprocs[".notdef"] = r_notdef end - for i=1,maxindex-minindex+1 do widths[i] = 0 end - for index, data in sortedhash(indices) do local name = f_index(index) local glyph = glyphs[include[index]] @@ -2167,14 +2476,11 @@ local noffonts = 0 -- The main injector. --- here we need to test for sharing otherwise we reserve too many --- objects +-- here we need to test for sharing otherwise we reserve too many objects local getstreamhash = fonts.handlers.otf.getstreamhash local loadstreamdata = fonts.handlers.otf.loadstreamdata --- we can actually now number upwards (so not use fontid in /F) - local objects = setmetatableindex(lpdf.usedfontobjects,function(t,k) -- defined in lpdf-lmt.lmt local v if type(k) == "number" then @@ -2227,23 +2533,19 @@ function lpdf.flushfonts() -- don't have the id. -- we can combine the two for loops .. todo --- inspect(lpdf.usedcharacters) for fontid, used in sortedhash(lpdf.usedcharacters) do - -- for a bitmap we need a different hash unless we stick to a fixed high -- resolution which makes much sense - local hash = getstreamhash(fontid) if hash then local parent = mainfonts[hash] if not parent then local fontdata = usedfonts[fontid] local rawdata = fontdata.shared and fontdata.shared.rawdata - local resources = fontdata.resources + local resources = fontdata.resources -- not always there, nullfont local properties = fontdata.properties -- writingmode and type3 local parameters = fontdata.parameters -- used in type3 --- print("before",fontid,hash,parent,rawdata) if not rawdata then -- we have a virtual font that loaded directly ... at some point i will -- sort this out (in readanddefine we need to do a bit more) .. the problem @@ -2263,11 +2565,11 @@ function lpdf.flushfonts() end end end - if rawdata then + -- if rawdata then -- we don't have these when we nest vf's (as in antykwa) parent = { hash = hash, fontdata = fontdata, - filename = resources.filename or properties.filename or "unset", + filename = (resources and resources.filename) or properties.filename or "unset", indices = { }, usedfonts = { [fontid] = true }, used = used, @@ -2281,9 +2583,8 @@ function lpdf.flushfonts() } mainfonts[hash] = parent noffonts = noffonts + 1 - end + -- end end --- print("after ",fontid,hash,parent) if parent then parent.usedfonts[fontid] = true local indices = parent.indices @@ -2294,14 +2595,66 @@ function lpdf.flushfonts() end end - -- this is no not yet ok for tfm / type 1 .. we need to move the nested blobs ourside the loop +-- local function identifywriter(details) +-- local filename = details.filename +-- local encoding, pfbfile, encfile = getmapentry(filename) +-- if trace_fonts then +-- report_fonts("file %a resolved to encoding %a and file %a",filename,encoding,pfbfile) +-- end +-- if not pfbfile or pfbfile == "" then +-- pfbfile = file.replacesuffix(filename,"pfb") +-- end +-- if encoding and pfbfile then +-- local properties = details.properties +-- local descriptions = { } +-- local characters = details.fontdata.characters +-- -- +-- local size = details.fontdata.parameters.size +-- local factor = details.fontdata.parameters.factor +-- -- +-- local names, _, _, metadata = fonts.constructors.handlers.pfb.loadvector(pfbfile) +-- local reverse = table.swapped(names) +-- local vector = encoding.vector +-- local indices = details.indices +-- local remapped = { } +-- local factor = bpfactor * size / 65536 +-- for k, v in next, indices do +-- local name = vector[k] +-- local index = reverse[name] or 0 +-- local width = factor * (characters[k].width or 0) +-- descriptions[k] = { +-- width = width, +-- index = index, +-- name = name, +-- } +-- remapped[index] = true +-- end +-- details.indices = remapped +-- -- +-- details.rawdata.descriptions = descriptions +-- details.filename = pfbfile -- hm +-- details.rawdata.metadata = { } +-- -- +-- properties.filename = pfbfile -- hm +-- properties.format = "type1" +-- end +-- end + +-- local function identifywriter(details) +-- local descriptions = details.fontdata.characters +-- for k, v in next, descriptions do +-- v.index = v.index or v.order or k +-- end +-- end for hash, details in sortedhash(mainfonts) do + -- the filename can be somewhat weird if we have a virtual font that starts out with some local filename = details.filename if next(details.indices) then local properties = details.properties local bitmap = properties.usedbitmap local method = properties.method -- will be pk | pdf | svg | ... + local format = properties.format if trace_fonts then if method then report_fonts("embedding %a hashed as %a using method %a",filename,hash,method) @@ -2316,98 +2669,21 @@ function lpdf.flushfonts() report_fonts("using main writer %a",format) end writer(details) - else - local format = properties.format + elseif format == "pkcff" then local writer = mainwriters[format] - if not writer then - -- This will move to the tpk module where we will also deal - -- with bitmaps then. - local encoding, pfbfile, encfile = getmapentry(filename) - if trace_fonts then - report_fonts("file %a resolved to encoding %a and file %a",filename,encoding,pfbfile) - end - if encoding and pfbfile then - filename = pfbfile - format = "type1" - -- - -- another (temp) hack - local size = details.fontdata.parameters.size - local factor = details.fontdata.parameters.factor - local descriptions = { } - local characters = details.fontdata.characters - -- - local names, _, _, metadata = fonts.constructors.handlers.pfb.loadvector(pfbfile) - local reverse = table.swapped(names) - local vector = encoding.vector - local indices = details.indices - local remapped = { } - local factor = bpfactor * size / 65536 - for k, v in next, indices do - local name = vector[k] - local index = reverse[name] or 0 - local width = factor * (characters[k].width or 0) - descriptions[k] = { - width = width, - index = index, - name = name, - } - remapped[index] = true - end - details.indices = remapped - -- - details.rawdata.descriptions = descriptions - details.filename = filename - details.rawdata.metadata = { } - -- - properties.filename = filename - properties.format = format - writer = mainwriters[format] - end - end - if not writer then - local pfbfile = file.replacesuffix(filename,"pfb") - if encoding and pfbfile then - filename = pfbfile - format = "type1" - -- - -- another (temp) hack - local size = details.fontdata.parameters.size - local factor = details.fontdata.parameters.factor - local descriptions = { } - local characters = details.fontdata.characters - -- - local names, _, _, metadata = fonts.constructors.handlers.pfb.loadvector(pfbfile) - local reverse = table.swapped(names) - local vector = encoding.vector - local indices = details.indices - local remapped = { } - local factor = bpfactor * size / 65536 - for k, v in next, indices do - local name = vector[k] - local index = reverse[name] or 0 - local width = factor * (characters[k].width or 0) - descriptions[k] = { - width = width, - index = index, - name = name, - } - remapped[index] = true - end - details.indices = remapped - -- - details.rawdata.descriptions = descriptions - details.filename = filename - details.rawdata.metadata = { } - -- - properties.filename = filename - properties.format = format - writer = mainwriters[format] - end + if trace_fonts then + report_fonts("using main writer %a",format) end + writer(details) + else + local writer = mainwriters[format] if writer then if trace_fonts then report_fonts("using main writer %a",format) end +-- if format == "type1" then +-- identifywriter(details) +-- end -- better move this test to the writers .. cleaner local streams = loadstreamdata(details.fontdata) if streams and streams.fontheader and streams.names then @@ -2429,7 +2705,7 @@ function lpdf.flushfonts() if trace_fonts then local indices = details.indices if indices and next(indices) then - report_fonts("embedded indices: % t",table.sortedkeys(details.indices)) + report_fonts("embedded indices: % t",sortedkeys(details.indices)) end end mainfonts[details.hash] = false -- done diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt index 26bb9f70318..7d1e54b650a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt @@ -11,7 +11,7 @@ if not modules then modules = { } end modules ['lpdf-epa'] = { -- embedded files ... not bound to a page local type, tonumber, next = type, tonumber, next -local format, gsub, lower, find = string.format, string.gsub, string.lower, string.find +local format, gsub, lower, find, match = string.format, string.gsub, string.lower, string.find, string.match local formatters = string.formatters local concat, merged = table.concat, table.merged local abs = math.abs @@ -70,9 +70,8 @@ local escapetex = characters.filters.utf.private.escape local bookmarks = structures.bookmarks -local maxdimen = 0x3FFFFFFF -- 2^30-1 - -local bpfactor = number.dimenfactors.bp +local maxdimen = tex.magicconstants.maxdimen +local bpfactor = number.dimenfactors.bp local layerspec = { "epdfcontent" @@ -126,7 +125,7 @@ local function getmediasize(specification,pagedata) return llx, lly, urx, ury, width, height, xscale, yscale end -local function getdimensions(annotation,llx,lly,xscale,yscale,width,height,report) +local function getdimensions(annotation,llx,lly,xscale,yscale,width,height,report,minheight) local rectangle = annotation.Rect local a_llx = rectangle[1] local a_lly = rectangle[2] @@ -140,6 +139,13 @@ local function getdimensions(annotation,llx,lly,xscale,yscale,width,height,repor report("broken rectangle [%.6F %.6F %.6F %.6F] (max: %.6F)",a_llx,a_lly,a_urx,a_ury,maxdimen/2) return end + if minheight and minheight ~= 0 then + local dh = minheight - h + if dh > 0 then + y = y - dh/2 + h = h + dh + end + end return x, y, w, h, a_llx, a_lly, a_urx, a_ury end @@ -200,7 +206,7 @@ local function add_link(x,y,w,h,destination,what) ) end -local function link_goto(x,y,w,h,document,annotation,pagedata,namespace) +local function link_goto(x,y,w,h,document,annotation,pagedata,namespace,pageoffset) local a = annotation.A if a then local destination = a.D -- [ 18 0 R /Fit ] @@ -215,7 +221,12 @@ local function link_goto(x,y,w,h,document,annotation,pagedata,namespace) if pagedata then local destinationpage = pagedata.number if destinationpage then - add_link(x,y,w,h,namespace .. destinationpage,what) + if pageoffset then + destinationpage = "page(" .. (destinationpage+pageoffset) .. ")" + else + destinationpage = namespace .. destinationpage + end + add_link(x,y,w,h,destinationpage,what) end end end @@ -283,8 +294,32 @@ local function link_file(x,y,w,h,document,annotation) end -- maybe handler per subtype and then one loop but then what about order ... +-- +-- specification is normally nil + +local function getpageoffset(options) + if options then + for k in next, options do + local p = tonumber(match(k,"pageoffset:([%+%-]*%d+)")) + if p then + return p + end + end + end +end + +local function getminheight(options) + if options then + for k in next, options do + local p = tonumber(match(k,"minheight:([%+%-]*%d+)")) + if p then + return p + end + end + end +end -function codeinjections.mergereferences(specification) +function codeinjections.mergereferences(specification,options) local specification, fullname, document = validdocument(specification) if not document then return "" @@ -294,6 +329,8 @@ function codeinjections.mergereferences(specification) local annotations = pagedata and pagedata.Annots local namespace = makenamespace(fullname) local reference = namespace .. pagenumber + local pageoffset = getpageoffset(options) + local minheight = getminheight(options) if annotations and #annotations > 0 then local llx, lly, urx, ury, width, height, xscale, yscale = getmediasize(specification,pagedata,xscale,yscale) initializelayer(height,width) @@ -305,17 +342,18 @@ function codeinjections.mergereferences(specification) if not a then local d = annotation.Dest if d then - annotation.A = { S = "GoTo", D = d } -- no need for a dict + a = { S = "GoTo", D = d } -- no need for a dict + annotation.A = a end end if not a then report_link("missing link annotation") else - local x, y, w, h = getdimensions(annotation,llx,lly,xscale,yscale,width,height,report_link) + local x, y, w, h = getdimensions(annotation,llx,lly,xscale,yscale,width,height,report_link,minheight) if x then local linktype = a.S if linktype == "GoTo" then - link_goto(x,y,w,h,document,annotation,pagedata,namespace) + link_goto(x,y,w,h,document,annotation,pagedata,namespace,pageoffset) elseif linktype == "GoToR" then link_file(x,y,w,h,document,annotation) elseif linktype == "URI" then @@ -735,7 +773,7 @@ end -- RV : rich -- Q : quadding (0=left 1=middle 2=right) -function codeinjections.mergefields(specification) +function codeinjections.mergefields(specification,dataonly) local specification, fullname, document = validdocument(specification) if not document then return "" @@ -773,8 +811,8 @@ function codeinjections.mergefields(specification) preset = "leftbottom", } -- - local aflags = flagstoset(annotation.F or parent.F, annotationflags) - local wflags = flagstoset(annotation.Ff or parent.Ff, widgetflags) + local aflags = flagstoset(annotation.F or parent.F or 0, annotationflags) + local wflags = flagstoset(annotation.Ff or parent.Ff or 0, widgetflags) if what == "Tx" then -- DA DV F FT MaxLen MK Q T V | AA OC if wflags.MultiLine then @@ -783,21 +821,58 @@ function codeinjections.mergefields(specification) else what = "line" end + -- via context - local fieldspec = { - width = w, - height = h, - offset = variables.overlay, - frame = trace_links and variables.on or variables.off, - n = annotation.MaxLen or (parent and parent.MaxLen), - type = what, - option = concat(merged(aflags,wflags),","), - } - context.setlayer (layerspec,locationspec,function() - context.definefieldbody ( { name } , fieldspec ) - context.fieldbody ( { name } ) - end) - -- + local frame = trace_links and variables.on or variables.off + local default = annotation.V or "" + if default == "" then + local parent = annotation.Parent + if parent then + default = parent.V or "" + end + end + if dataonly then + if type(default) == "string" and default ~= "" then + local data = lpdf.epdf.parsecontent(tostring(annotation.DA or "") or "") or { } + local font = "Normal" + local size = "10bp" + for i=1,#data do + local d = data[i] + if d[3] == "Tf" then + font = d[1][2] + size = d[2][2] .. "bp" + break + end + end + local fieldspec = { + width = w, + height = h, + frame = frame, + -- + ["epdf:font"] = font, + ["epdf:size"] = size, + } +report_field("field %a, type %a, data %a",name,what,default) + context.setlayer (layerspec,locationspec,function() + context["epdf"..what.."field"](fieldspec,default) + end) + end + else + local fieldspec = { + width = w, + height = h, + offset = variables.overlay, + frame = frame, + n = annotation.MaxLen or (parent and parent.MaxLen), + type = what, + option = concat(merged(aflags,wflags),","), + default = default, + } + context.setlayer (layerspec,locationspec,function() + context.definefieldbody ( { name } , fieldspec ) + context.fieldbody ( { name } ) + end) + end elseif what == "Btn" then if wflags.Radio or wflags.RadiosInUnison then -- AP AS DA F Ff FT H MK T V | AA OC @@ -816,30 +891,34 @@ function codeinjections.mergefields(specification) -- AP AS DA F Ff FT H MK T V | OC AA what = "check" -- direct - local AP = annotation.AP or (parent and parent.AP) - if AP then - local a = document.__xrefs__[AP] - if a and pdfe.copyappearance then - local o = pdfe.copyappearance(document,a) - if o then - AP = pdfreference(o) + if dataonly then + report_field("field %a, type %a, todo: render value",name,what) + else + local AP = annotation.AP or (parent and parent.AP) + if AP then + local a = document.__xrefs__[AP] + if a and pdfe.copyappearance then + local o = pdfe.copyappearance(document,a) + if o then + AP = pdfreference(o) + end end end + local dictionary = pdfdictionary { + Subtype = pdfconstant("Widget"), + FT = pdfconstant("Btn"), + T = pdfcopyunicode(annotation.T or parent.T), + F = pdfcopyinteger(annotation.F or parent.F), + Ff = pdfcopyinteger(annotation.Ff or parent.Ff), + AS = pdfcopyconstant(annotation.AS or (parent and parent.AS)), + AP = AP and pdfreference(AP), + -- V = annotation.V, + } + local finalize = dictionary() + context.setlayer(layerspec,locationspec,function() + context(hpack_node(nodeinjections.annotation(W/bpfactor,H/bpfactor,0,finalize))) + end) end - local dictionary = pdfdictionary { - Subtype = pdfconstant("Widget"), - FT = pdfconstant("Btn"), - T = pdfcopyunicode(annotation.T or parent.T), - F = pdfcopyinteger(annotation.F or parent.F), - Ff = pdfcopyinteger(annotation.Ff or parent.Ff), - AS = pdfcopyconstant(annotation.AS or (parent and parent.AS)), - AP = AP and pdfreference(AP), - } - local finalize = dictionary() - context.setlayer(layerspec,locationspec,function() - context(hpack_node(nodeinjections.annotation(W/bpfactor,H/bpfactor,0,finalize))) - end) - -- end elseif what == "Ch" then -- F Ff FT Opt T | AA OC (rest follows) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt new file mode 100644 index 00000000000..0c02c3b65f3 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt @@ -0,0 +1,711 @@ +if not modules then modules = { } end modules ['lpdf-fix-imp-contents'] = { + version = 1.001, + comment = "companion to lpdf-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- This is preliminary code. The \PDF\ inclusion interface has never been designed +-- for manipulation so we need to cheat every now and then and signal what objects +-- are adapted. It's okay but a nicer interface is on the agenda so that the __raw__ +-- trickery gets hidden. + +local trace_fixes = false trackers.register("graphics.fixes", function(v) trace_fixes = v end) +local trace_operators = false trackers.register("graphics.operators",function(v) trace_operators = v end) + +local report_fixes = logs.reporter("graphics","fixes") + +local type, tonumber = type, tonumber +local char = string.char +local setmetatableindex, setmetatablecall, sortedhash, concat, insert = table.setmetatableindex, table.setmetatablecall, table.sortedhash, table.concat, table.insert +local round = math.round + +local expanded = lpdf.epdf.expanded + +local function fix_colorspace(v) + if not v.__content_remapped__ then + local objref = false + local space = v.__raw__.ColorSpace + if space == "DeviceCMYK" then + objref = backends.registered.pdf.codeinjections.defaultprofile(4) + elseif space == "DeviceRGB" then + objref = backends.registered.pdf.codeinjections.defaultprofile(3) + elseif space == "DeviceGray" then + objref = backends.registered.pdf.codeinjections.defaultprofile(1) + else + -- inspect(space) -- indexed, has to be done with the global intent + return + end + if objref then + v.__raw__.ColorSpace = { lpdf.epdf.objectcodes.lpdf, lpdf.reference(objref) } + v.__content_remapped__ = true + return true + end + end +end + +-- mask clean up code has been removed .. to big of a mess + +do + + function document.pdf_strip_page(pdfdoc,page,pagenumber,resources,compactor) + if resources then + local g_done = compactor.strip.group and 0 or false + local e_done = compactor.strip.extgstate and 0 or false + local m_done = compactor.strip.metadata and 0 or false + local p_done = compactor.strip.properties and 0 or false + local c_done = compactor.strip.colorspace and 0 or false + local s_done = compactor.report.smask and 0 or false + if g_done and page.__raw__.Group then + page.__raw__.Group = nil + g_done = g_done + 1 + -- todo: + resources.__raw__.Group = nil + g_done = g_done + 1 + end + if e_done and resources.__raw__.ExtGState then + resources.__raw__.ExtGState = nil + e_done = e_done + 1 + end + if p_done and resources.__raw__.Properties then + resources.__raw__.Properties = nil + p_done = p_done + 1 + end + if s_done and resources.__raw__.SMask then + s_done = s_done + 1 + end + -- todo : recursely do xforms, only do when not yet done + local x = resources.XObject + if x then + for k, v in expanded(x) do + if g_done and v.__raw__.Group then + v.__raw__.Group = nil + g_done = g_done + 1 + end + if e_done and v.__raw__.ExtGState then + resources.__raw__.ExtGState = nil + e_done = e_done + 1 + end + if m_done and v.__raw__.Metadata then + v.__raw__.Metadata = nil + m_done = m_done + 1 + end + local subtype = v.__raw__.Subtype + if c_done and subtype == "Image" then + if fix_colorspace(v) then + c_done = c_done + 1 + end + end + end + end + if trace_fixes and (g_done or e_done or m_done or p_done or s_done or c_done or s_done) then + report_fixes( + "page %i of %a cleaned up resources, %i groups, %i graphic states, %i metadata, %i properties, %i colorspaces, %i smasks", + pagenumber,file.basename(pdfdoc.filename),g_done or 0,e_done or 0,m_done or 0,p_done or 0,c_done or 0, s_done or 0 + ) + end + end + + -- test +-- if pagenumber == 1 then +-- print(pdfdoc.Catalog.StructTreeRoot) +-- end + end + +end + +do + + local tocidsetdictionary = lpdf.tocidset + + function document.pdf_add_cidsets(pdfdoc,page,pagenumber,resources,compactor) + if resources and compactor.add.cidset then + local f = resources.Font + if f then + local done = document.cidsetdone or { } + document.cidsetdone = done + for k, v in next, f.__raw__ do + local objref = v[1] == lpdf.epdf.objectcodes.reference and v[3] + if objref and not done[objref] then + done[objref] = true + -- + local v = pdfdoc.objects[objref] + if v.Subtype ~= "Type0" then + return + end + local d = v.DescendantFonts + if not d then + return + end + local vd = false + local fd = false + if d then + if #d == 1 then + vd = d[1] + fd = vd.FontDescriptor + end + else + vd = v + fd = vd.FontDescriptor + end + if not fd then + return + end + if not fd.CIDSet then + local w = vd.W + if w then + local u, min, max = lpdf.epdf.expandwidths(w()) + local c = tocidsetdictionary(u,min,max) + local o = lpdf.flushstreamobject(c) + local r = lpdf.reference(o) + -- load the object + local object = pdfdoc.objects[vd.__raw__.FontDescriptor] + if object then + if trace_fixes then + report_fixes( + "page %i of %a, font %a, adding CIDSet", + pagenumber,file.basename(pdfdoc.filename),v.BaseFont + ) + end + object.__raw__.CIDSet = { lpdf.epdf.objectcodes.lpdf, r } + end + end + end + if not vd.__raw__.CIDToGIDMap then + if trace_fixes then + report_fixes( + "page %i of %a, font %a, adding CIDToGIDMap", + pagenumber,file.basename(pdfdoc.filename),v.BaseFont + ) + end + vd.__raw__.CIDToGIDMap = { lpdf.epdf.objectcodes.lpdf, lpdf.constant("Identity") } + end + -- + end + end + end + end + end + +end + +do + + local cmyktorgb = attributes.colors.cmyktorgb + local cmyktogray = attributes.colors.cmyktogray + local rgbtocmyk = attributes.colors.rgbtocmyk + local rgbtogray = attributes.colors.rgbtogray + +-- local remapcmyk = { } + + local function reducecmyk(c,op) + local c1 = tonumber(c[1]) + local c2 = tonumber(c[2]) + local c3 = tonumber(c[3]) + local c4 = tonumber(c[4]) + local cc = c1 == c2 and c2 == c3 + if cc then + if c1 == 0 then + -- no color, only black + c[1] = tostring(1 - c4) + elseif c1 == 1 then + -- brownish, so assume black + c[1] = "0" + else + c4 = c4 + c1 + c[1] = c4 > 1 and "0" or tostring(1 - c4) + end + c[2] = op == "K" and "G" or "g" + c[3] = nil + c[4] = nil + c[5] = nil + -- else -- can be an option + -- local r, g, b = cmyktorgb(c1,c2,c3,c4) + -- c[1] = tostring(r) + -- c[2] = tostring(g) + -- c[3] = tostring(b) + -- c[4] = op == "K" and "RG" or "rg" + -- c[5] = nil + end + end + + local function reducergb(c,op) + local c1 = c[1] + local c2 = c[2] + local c3 = c[3] + if c1 == c2 and c2 == c3 then + c[1] = c1 + c[2] = op == "rg" and "g" or "G" + c[3] = nil + c[4] = nil + end + end + + local cmykmap = false + local rgbmap = false + + local function convertcmyk(c,op) + local c1 = tonumber(c[1]) + local c2 = tonumber(c[2]) + local c3 = tonumber(c[3]) + local c4 = tonumber(c[4]) + local cc = c1 == c2 and c2 == c3 + if cc then + if c1 == 0 then + -- no color, only black + c[1] = tostring(1 - c4) + elseif c1 == 1 then + -- brownish, so assume black + c[1] = "0" + else + c4 = c4 + c1 + c[1] = c4 > 1 and "0" or tostring(1 - c4) + end + c[2] = op == "K" and "G" or "g" + c[3] = nil + c[4] = nil + c[5] = nil + else -- can be an option + local r, g, b + if cmykmap then + -- cmykmap = { + -- { 1, 1, 0, 0, .5, .6. 7 } -- todo: speed up + -- } + for i=1,#cmykmap do + local map = cmykmap[i] + local factor = map[1] + local r1 = round(c1*factor) + local r2 = round(c2*factor) + local r3 = round(c3*factor) + local r4 = round(c4*factor) + if map[2] == r1 and map[3] == r2 and map[4] == r3 and map[5] == r4 then + r = (map[6] or 0)/factor + g = (map[7] or 0)/factor + b = (map[8] or 0)/factor + goto DONE + end + end + end + r, g, b = cmyktorgb(c1,c2,c3,c4) + ::DONE:: + c[1] = tostring(r) + c[2] = tostring(g) + c[3] = tostring(b) + c[4] = op == "K" and "RG" or "rg" + c[5] = nil + end + end + + local function convertgb(c,op) + local c1 = c[1] + local c2 = c[2] + local c3 = c[3] + if c1 == c2 and c2 == c3 then + c[1] = c1 + c[2] = op == "rg" and g or "G" + c[3] = nil + c[4] = nil + else + local c, m, y, k + if rgbmap then + for i=1,#rgbmap do + local map = rgbmap[i] + local factor = map[1] + local r1 = round(c1*factor) + local r2 = round(c2*factor) + local r3 = round(c3*factor) + if map[2] == r1 and map[3] == r2 and map[4] == r3 then + c = (map[5] or 0)/factor + m = (map[6] or 0)/factor + y = (map[7] or 0)/factor + k = (map[8] or 0)/factor + goto DONE + end + end + end + c, m, y, k = rgbtocmyk(c1,c2,c3) + ::DONE:: + c[1] = tostring(c) + c[2] = tostring(m) + c[3] = tostring(y) + c[4] = tostring(k) + c[5] = op == "RG" and "K" or "k" + end + end + + local g1, g2, g3, g4 + + local function recolorcmyk_gray(c,op) + local s = cmyktogray(c) + c[1] = s + c[2] = op == "K" and "G" or "g" + c[3] = nil + c[4] = nil + c[5] = nil + end + local function recolorcmyk_rgb(c,op) + local s = cmyktogray(c) + c[1] = g1 * s + c[2] = g2 * s + c[3] = g3 * s + c[4] = op == "K" and "RG" or "rg" + c[5] = nil + end + local function recolorcmyk_cmyk(c,op) + local s = cmyktogray(c) + c[1] = g1 * s + c[2] = g2 * s + c[3] = g3 * s + c[3] = g4 * s + c[4] = op + c[5] = nil + end + + local function recolorrgb_gray(c,op) + local s = rgbtogray(c) + c[1] = s + c[2] = op == "RG" and "G" or "g" + c[3] = nil + c[4] = nil + end + local function recolorrgb_rgb(c,op) + local s = rgbtogray(c) + c[1] = g1 * s + c[2] = g2 * s + c[3] = g3 * s + c[4] = op + end + local function recolorrgb_cmyk(c,op) + local s = rgbtogray(c) + c[1] = g1 * s + c[2] = g2 * s + c[3] = g3 * s + c[4] = g4 * s + c[5] = op == "RG" and "K" or "k" + end + + local function recolorgray_gray(c,op) + local s = 1 - tonumber(c[1]) + c[1] = g1 * s + end + local function recolorgray_rgb(c,op) + local s = 1 - tonumber(c[1]) + c[1] = g1 * s + c[2] = g2 * s + c[3] = g3 * s + c[4] = op == "G" and "RG" or "rg" + end + local function recolorgray_cmyk(c,op) + local s = 1 - tonumber(c[1]) + c[1] = g1 * s + c[2] = g2 * s + c[3] = g3 * s + c[4] = g4 * s + c[5] = op == "G" and "K" or "k" + end + + local function removestate(c,op,contents,i) + contents[i] = { } + end + + local function removetags(c,op,contents,i) + contents[i] = { } + end + + local contenttostring = lpdf.epdf.contenttostring + local getpagecontent = lpdf.epdf.getpagecontent + local parsecontent = lpdf.epdf.parsecontent + + local function checkbt(c,op,contents,i) + if contents[i-1] == "ET" then + contents[i] = { } + contents[i-1] = { } + end + end + + local actions = { + rg = reducergb, + RG = reducergb, + k = reducecmyk, + K = reducecmyk, + gs = removestate, + GS = removestate, + BMC = removetags, + EMC = removetags, + BDC = removetags, + -- BT = checkbt, + } + + local function useactions(compactor) + local used = { } + local strip = compactor.strip + local reduce = compactor.reduce + local convert = compactor.convert + local recolor = compactor.recolor + cmykmap = false + rgbmap = false + actions = { } + if strip.marked then + actions.BMC = removetags + actions.EMC = removetags + actions.BDC = removetags + end + if strip.extgstate then + actions.gs = removestate + actions.GS = removestate + end + if reduce.color then + actions.rg = reducergb + actions.RG = reducergb + actions.k = reducecmyk + actions.K = reducecmyk + elseif reduce.rgb then + actions.rg = reducergb + actions.RG = reducergb + elseif reduce.cmyk then + actions.k = reducecmyk + actions.K = reducecmyk + end + if convert.cmyk then + actions.k = convertcmyk + actions.K = convertcmyk + cmykmap = type(convert.cmyk) == "table" and convert.cmyk or false + elseif convert.rgb then + actions.rg = convertrgb + actions.RG = convertrgb + rgbmap = type(convert.rgb) == "table" and convert.rgb or false + end + local viagray = recolor.viagray + if viagray then + g1 = viagray[1] + g2 = viagray[2] + g3 = viagray[3] + g4 = viagray[4] + if g4 then + actions.k = recolorcmyk_cmyk + actions.K = recolorcmyk_cmyk + actions.rg = recolorrgb_cmyk + actions.RG = recolorrgb_cmyk + actions.g = recolorgray_cmyk + actions.G = recolorgray_cmyk + elseif g3 then + actions.k = recolorcmyk_rgb + actions.K = recolorcmyk_rgb + actions.rg = recolorrgb_rgb + actions.RG = recolorrgb_rgb + actions.g = recolorgray_rgb + actions.G = recolorgray_rgb + elseif g1 then + actions.k = recolorcmyk_gray + actions.K = recolorcmyk_gray + actions.rg = recolorrgb_gray + actions.RG = recolorrgb_gray + actions.g = recolorgray_gray + actions.G = recolorgray_gray + end + else + g1, g2, g3, g4 = nil, nil, nil, nil + end + if compactor.identify == "all" then + compactor.identify= { + content = true, + resources = true, + page = true, + } + end + end + + local identify_content + + identify_content = function(pdfdoc,contents,fonts,xobjects,counts) + if contents then + for i=1,#contents do + local ci = contents[i] + if ci then + local op = ci[#ci] + if op then + counts[op] = counts[op] + 1 + if xobjects and op == "Do" then + -- can be recursive + local object = xobjects[ci[1][2]] + if object then + local subtype = object.Subtype + if subtype == "Form" then + if not object.__content_remapped__ then + local r = object.Resources + if r then + local contents = object() + local fonts = r.Font + local xobjects = r.XObject + if contents then + contents = parsecontent(contents,true) + if contents then + identify_content(pdfdoc,contents,fonts,xobjects,counts) + end + end + end + end + end + end + end + end + end + end + end + end + + local function countoperators(pdfdoc,contents,fonts,xobjects,pagenumber,when) + local counts = setmetatableindex("number") + identify_content(pdfdoc,contents,fonts,xobjects,counts) + report_fixes("page %i of file %a: %s",pagenumber,pdfdoc.filename,when) + for k, v in sortedhash(counts) do + report_fixes("%4i : %s",v,k) + end + end + + local strip_content + + local function form(pdfdoc,object,pagenumber,compactor) + if not object.__content_remapped__ then + local r = object.Resources + if r then + local contents = object() + local fonts = r.Font + local xobjects = r.XObject + if contents then + contents = parsecontent(contents,true) + if contents then + contents = strip_content(pdfdoc,contents,fonts,xobjects,pagenumber,compactor) + contents = contenttostring(contents) + object.__raw__.Length = #contents + object.__raw__.Filter = nil + getmetatable(object).__call = function() return contents end + object.__content_remapped__ = true + end + end + end + end + end + + local function image(pdfdoc,object,pagenumber,compactor) + if compactor.strip.colorspace and fix_colorspace(object) then + -- c_done = c_done + 1 + end + end + + strip_content = function(pdfdoc,contents,fonts,xobjects,pagenumber,compactor) + if contents then + for i=1,#contents do + local ci = contents[i] + local op = ci[#ci] + local action = actions[op] + if action then + action(ci,op,contents,i) + elseif xobjects and op == "Do" then + -- can be recursive + local object = xobjects[ci[1][2]] + if object then + local subtype = object.Subtype + if subtype == "Form" then + form(pdfdoc,object,pagenumber,compactor) + end + if subtype == "Image" then + image(pdfdoc,object,pagenumber,compactor) + end + end + end + end + return contents + end + end + + function document.pdf_strip_content(pdfdoc,page,pagenumber,resources,compactor) + local fonts = resources.Font + local xobjects = resources.XObject + local contents = getpagecontent(pdfdoc,pagenumber,true,true) + if contents then + if g1 then + insert(contents,1, { 0, "G" }) + insert(contents,1, { 0, "g" }) + end + contents = strip_content(pdfdoc,contents,fonts,xobjects,pagenumber,compactor) + resources.Font = fonts -- really needed + if contents then + if trace_operators then + countoperators(pdfdoc,contents,fonts,xobjects,pagenumber,"after") + end + page.Contents = contenttostring(contents) + end + end + end + + function document.pdf_identify_content(pdfdoc,page,pagenumber,resources,compactor) + if compactor.identify.content or compactor.identify == "all" then + local fonts = resources.Font + local xobjects = resources.XObject + local contents = getpagecontent(pdfdoc,pagenumber,true,true) + if contents then + if trace_operators then + countoperators(pdfdoc,contents,fonts,xobjects,pagenumber,"before") + end + useactions(compactor) + end + end + end + +end + +utilities.sequencers.appendaction("pdfcontentmanipulators","before","document.pdf_identify_content") +utilities.sequencers.appendaction("pdfcontentmanipulators","before","document.pdf_strip_content") +utilities.sequencers.appendaction("pdfpagemanipulators", "after", "document.pdf_strip_page") +utilities.sequencers.appendaction("pdfpagemanipulators", "after", "document.pdf_add_cidsets") + +utilities.sequencers.enableaction("pdfcontentmanipulators","document.pdf_identify_content") +utilities.sequencers.enableaction("pdfcontentmanipulators","document.pdf_strip_content") +utilities.sequencers.enableaction("pdfpagemanipulators", "document.pdf_strip_page") +utilities.sequencers.enableaction("pdfpagemanipulators", "document.pdf_add_cidsets") + +-- extreme example, also test case, dedicated to team ramkumar, + +-- backends.codeinjections.registercompactor("preset:cs", { +-- identify = { +-- content = true, +-- resources = true, +-- page = true, +-- }, +-- embed = { +-- type0 = true, +-- truetype = true, +-- type1 = true, +-- }, +-- merge = { +-- type0 = true, -- check if a..z A..Z 0..9 +-- truetype = true, +-- type1 = true, +-- LMTX = true, +-- }, +-- strip = { +-- group = true, +-- extgstate = true, +-- marked = true, +-- }, +-- reduce = { +-- color = true, +-- rgb = true, +-- cmyk = true, +-- }, +-- convert = { +-- rgb = true, +-- cmyk = true, +-- cmyk = { +-- { 100, 100, 55, 0, 57, 0, 22, 40.8 } -- factor, c, m, y, k, r, g, b +-- } +-- }, +-- recolor = { +-- gray = { 1, 0, 0 }, +-- }, +-- add = { +-- cidset, -- when missing or even fix +-- }, +-- }) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-fonts.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-fonts.lmt new file mode 100644 index 00000000000..86a9359adbe --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix-imp-fonts.lmt @@ -0,0 +1,1100 @@ +if not modules then modules = { } end modules ['lpdf-fix-imp-fonts'] = { + version = 1.001, + comment = "companion to lpdf-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- In LMTX we have to do this different than in MkIV. We also prepare ourselves +-- variable fonts and such. In LuaTeX we use the original index but in LMTX we +-- use a decent sequence which means that we need to resolve the original. This +-- kind of hackery is fragile anyway, so we only merge files that are produced +-- by ConTeXt. + +local next, type, getmetatable = next, type, getmetatable +local gsub, format, match, find, gmatch = string.gsub, string.format, string.match, string.find, string.gmatch +local setmetatableindex, sortedhash, sequenced = table.setmetatableindex, table.sortedhash, table.sequenced +local nameonly, basename = file.nameonly, file.basename +local hextointeger, chrtointeger = string.hextointeger, string.chrtointeger +local f6 = string.f6 +local concat = table.concat + +local pdfe = lpdf.epdf +local pdfreference = lpdf.reference +local pdfreserveobject = lpdf.reserveobject + +local trace_merge = false trackers.register("graphics.fonts",function(v) trace_merge = v end) +local report_merge = logs.reporter("graphics","fonts") + +local expanded = pdfe.expanded +local contenttostring = pdfe.contenttostring +local getpagecontent = pdfe.getpagecontent +local parsecontent = pdfe.parsecontent + +----- definefont = fonts.definers.internal +local definefont = fonts.definers.define +local getstreamhash = fonts.handlers.otf.getstreamhash +local loadstreamdata = fonts.handlers.otf.loadstreamdata +local cleanfontname = fonts.names.cleanname +local chardata = fonts.hashes.characters + +local defined = setmetatableindex(function(t,filename) + local v = setmetatableindex(function(t,subfont) + local v = { } + t[subfont] = v + return v + end) + t[filename] = v + return v +end) + +local function toinstance(instance) + if type(instance) == "table" then + return nil, "axis={" .. sequenced(instance.__raw__,",") .. "}" + elseif instance and instance ~= "" then + return instance, nil + else + return nil, nil + end +end + +-- This is a bit of a hack ... we need to be able to set the instance directly +-- on a file. + +local function isdefinedlmtx(filename,subfont,instance,hash,version,glyphcount) + local fontname = "file:" .. filename + local instance, features = toinstance(instance) + if instance then + fontname = "name:" .. nameonly(filename) .. instance -- not ok as it's not fontname + instance = nil + end + local id = defined[fontname][subfont][instance or features or false] + if not id then + -- we can try to avoid this + id = definefont { + name = fontname, + instance = instance, + detail = features, + } + if id > 0 then + local dummy = lpdf.usedcharacters[id] -- force embedding + else + id = false + end + defined[fontname][subfont][instance or features or false] = id + end + if id then + -- We double check here! + local shash, sdata = getstreamhash(id) + if hash ~= shash then + report_merge("inconsistent %s in %a","hashes",filename) + return false + end + sdata = loadstreamdata(sdata) + if not sdata then + report_merge("inconsistent %s in %a","streamdata",filename) + return false + end + local fontheader = sdata.fontheader + if version and fontheader and version ~= fontheader.fontversion then + report_merge("inconsistent %s in %a","versions",filename) + return false + end + local streams = sdata.streams + if glyphcount and streams and glyphcount ~= (#streams + (streams[0] and 1 or 0)) then + report_merge("inconsistent %s in %a","glyphcount",filename) + return false + end + return id + end + return false +end + +-- todo: check some more + +local cleanname = fonts.names.cleanname + +local remap = { + -- ["helvetica"] = { target = "file:uhvr8a.afm" }, + -- ["helvetica-bold"] = { target = "file:uhvb8a.afm" }, + -- ["helveticabold"] = { target = "file:uhvb8a.afm" }, + -- ["courier"] = { target = "file:ucrr8a.afm" }, -- notdef issues width + -- ["courier-bold"] = { target = "file:ucrb8a.afm" }, + -- ["courierbold"] = { target = "file:ucrb8a.afm" }, + ["helvetica"] = { target = "file:texgyre-heros-regular.otf" }, + ["helveticabold"] = { target = "file:texgyre-heros-bold.otf" }, + ["helveticaitalic"] = { target = "file:texgyre-heros-italic.otf" }, + ["helveticabolditalic"] = { target = "file:texgyre-heros-bolditalic.otf" }, + ["courier"] = { target = "file:texgyre-cursor-regular.otf" }, + ["courierbold"] = { target = "file:texgyre-cursor-bold.otf" }, + ["courieritalic"] = { target = "file:texgyre-cursor-italic.otf" }, + ["courierbolditalic"] = { target = "file:texgyre-cursor-bolditalic.otf" }, + ["timesroman"] = { target = "file:texgyre-termes-regular.otf" }, + ["timesromanbold"] = { target = "file:texgyre-termes-bold.otf" }, + ["timesromanitalic"] = { target = "file:texgyre-termes-italic.otf" }, + ["timesromanbolditalic"] = { target = "file:texgyre-termes-bolditalic.otf" }, +} + +local function registerfont(specification) + local source = specification.source + if source then + remap[cleanfontname(source)] = specification + end +end + +backends.codeinjections.registerfont = registerfont + +function graphics.registerpdffont(...) + -- todo: message + registerfont(...) +end + +local function isdefinedunknown(fontname) + local c = cleanfontname(fontname) + local m = remap[c] + local r = m and m.target + if r then + report_merge("remapping %a to %a",fontname,r) + name = r + else + name = "name:" .. fontname + end + local id = definefont { + name = name, + } + if id > 0 then + local dummy = lpdf.usedcharacters[id] -- force embedding + else + id = false + end + if id then + local shash, sdata = getstreamhash(id) + -- sdata = loadstreamdata(sdata) -- no checking here + return shash, id + end + return false +end + +-- todo: we can share the map within a pdfdoc .. using the object number + +local status = { + files = { }, + pages = 0, + xobjects = 0, + charprocs = 0, + merged = 0, + notmerged = 0, + indices = 0, +} + +statistics.register("compact font inclusion", function() + if status.pages > 0 or status.xobjects > 0 or status.charprocs > 0 then + return string.format( + "%i files, %i pages, %i indices, %i xobjects, %i chrprocs, %i times merged, %i times not merged", + table.count(status.files), + status.pages, + status.indices, + status.xobjects, + status.charprocs, + status.merged, + status.notmerged + ) + end +end) + +local function checkedfontreference(k,v,key,value,o) + if key ~= k then +-- print("different keys",key,k) + return value -- different keys + elseif v[1] ~= 10 or value[1] ~= 10 then +-- print("different objects",key,k) + return value -- different objects + elseif v[3] ~= value[3] then +-- print("different values",key,k) + return value -- different values + else + return pdfreference(o) + end +end + +local getstates, getindexstate_composite, getindexstate_simple do + + local fromunicode16 = fonts.mappings.fromunicode16 + local expandwidths = pdfe.expandwidths + local mergewidths = pdfe.mergewidths + + local function initialize(t,k) + local v = { + unicodes = { }, + widths = { }, + fontname = k, + } + t[k] = v + return v + end + + getstates = function(pdfdoc) + local states = pdfdoc.fontstates + if not states then + states = { + Type1 = setmetatableindex(initialize), -- simple fonts, 1 byte index + Type3 = setmetatableindex(initialize), -- idem + TrueType = setmetatableindex(initialize), -- idem + OpenType = setmetatableindex(initialize), -- composite fonts, 2 byte index + } + pdfdoc.fontstates = states + end + return states + end + + local splitsixteen do + + local lpegmatch = lpeg.match + + local more = 0 + + -- local pattern = lpeg.P(true) / function() more = 0 end * ( + local pattern = ( + lpeg.C(4) / function(s) -- needs checking ! + local now = hextointeger(s) + if more > 0 then + now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000 + more = 0 + return now + elseif now >= 0xD800 and now <= 0xDBFF then + more = now + else + return now + end + end + )^0 + + splitsixteen = function(str) + if str and str ~= "" then + more = 0 + return lpegmatch(pattern,str) + end + end + + end + + -- This could be an lpeg but there is not that much to gain here. + + local function register1(pdfdoc,unicodes,index,uni,fontname) + local old = unicodes[index] + if not old then + unicodes[index] = uni + elseif old ~= uni then + report_merge("inconsistent unicode file %a, font %a, index 0x%04X, old %U, new %U, %s", + pdfdoc.filename,fontname,index,old,uni,"bfrange") + end + end + + local function register2(pdfdoc,unicodes,index,uni,fontname) + local old = unicodes[index] -- unicode + local new, more = splitsixteen(uni) -- unicode16 or ligature + if more then + if not old then + unicodes[index] = uni -- string + elseif old ~= uni then + report_merge("inconsistent unicode file %a, font %a, index 0x%04X, old %a, new %a, %s", + pdfdoc.filename,fontname,index,old,uni,"bfchar") + end + else + if not old then + unicodes[index] = new + elseif old ~= new then + report_merge("inconsistent unicode file %a, font %a, index 0x%04X, old %U, new %U, %s", + pdfdoc.filename,fontname,index,old,uni,"bfchar") + end + end + end + + local function getunicodes(pdfdoc,fontname,str,unicodes) + -- <0000> <005E> <0020> : first index, last index, first unicode + for s in gmatch(str,"beginbfrange%s*(.-)%s*endbfrange") do + for first, last, offset in gmatch(s,"<([^>]+)>%s*<([^>]+)>%s*<([^>]+)>") do + local first = tonumber(first,16) -- index + local last = tonumber(last,16) -- index + local uni = fromunicode16(offset) -- unicode16 + for index=first,last do + register1(pdfdoc,unicodes,index,uni,fontname) + uni = uni + 1 + end + end + end + -- <005F> <0061> [<00660066> <00660069> <00660066006C>] -- untested as not seen yet + for s in gmatch(str,"beginbfrange%s*(.-)%s*endbfrange") do + for first, last, offset in gmatch(s,"<([^>]+)>%s*<([^>]+)>%s*%[([^%]]+)%]") do + local index = tonumber(first,16) -- index + for uni in gmatch("%s*<([^>]+)>") do + register2(pdfdoc,unicodes,index,uni,fontname) + index = index + 1 + end + end + end + -- <0000> <0020> : index, single + -- <005F> <00660066> : index, ligature + for s in gmatch(str,"beginbfchar%s*(.-)%s*endbfchar") do + for idx, uni in gmatch(s,"<([^>]+)>%s*<([^>]+)>") do + local index = tonumber(idx,16) -- index + register2(pdfdoc,unicodes,index,uni,fontname) + end + end + end + + local function isembedded(descriptor) + return descriptor and (descriptor.FontFile or descriptor.FontFile2 or descriptor.FontFile3) and true or false + end + + getindexstate_composite = function(pdfdoc,somefont,descendant,states) + local basefont = somefont.BaseFont + if basefont then + local fontname = match(basefont,"^[A-Z]+%+(.+)$") + if fontname then + local descriptor = descendant.FontDescriptor + if descriptor then + local widths = descendant.W + local tounicode = somefont.ToUnicode + -- todo: when no tounicode, maybe just use the index + if widths and tounicode then + local fontstate = states[fontname] + local f_widths = fontstate.widths + local f_unicodes = fontstate.unicodes + expandwidths(widths,f_widths) + getunicodes(pdfdoc,fontname,tounicode(),f_unicodes) + fontstate.embedded = isembedded(descriptor) + return fontstate + end + end + end + end + end + + getindexstate_simple = function(pdfdoc,somefont,states) + local basefont = somefont.BaseFont + if basefont then + local fontname = match(basefont,"^[A-Z]+%+(.+)$") or basefont + if fontname then + local descriptor = somefont.FontDescriptor + if descriptor then + local widths = somefont.Widths + local tounicode = somefont.ToUnicode + if widths and tounicode then + local fontstate = states[fontname] + local f_widths = fontstate.widths + local f_unicodes = fontstate.unicodes + fontstate.narrow = true + mergewidths(widths,f_widths) + getunicodes(pdfdoc,fontname,tounicode(),f_unicodes) + fontstate.embedded = isembedded(descriptor) + return fontstate + end + end + -- tricky when we have the same fontname twice, once as type 1 or truetype + -- and once as opentype .. it really happens + local encoding = somefont.Encoding + if encoding == "WinAnsiEncoding" then + local r = table.load(resolvers.findfile("regi-cp1252.lua")) + local fontstate = states[fontname] + fontstate.unicodes = r + fontstate.narrow = true + fontstate.embedded = isembedded(descriptor) + return fontstate + elseif descriptor then + local fontfile = descriptor.FontFile + if fontfile then + local data = fontfile() + local first = fontfile.Length1 + if first and data then + data = string.sub(data,1,first) + local metadata = fonts.handlers.pfb.filtermetadata(data) + if metadata then + local fullname = metadata.fullname + if fontname == fullname then + local encoding = fonts.handlers.pfb.filterencoding(data) + if encoding then + local name, id = isdefinedunknown(fullname) + if id > 0 then + local unicodes = { } + local nametoslot = fonts.helpers.nametoslot + for index, name in next, encoding do + -- todo: check for missing hits + unicodes[index] = nametoslot(name,id) + end + local fontstate = states[fontname] + fontstate.custom = encoding + fontstate.fullname = fullname + fontstate.narrow = true + fontstate.unicodes = unicodes + fontstate.embedded = isembedded(descriptor) + return fontstate + end + end + end + end + end + end + else + report_merge("no encoding or descriptor in file %a for font %a",pdfdoc.filename,fontname) + end + end + end + end + +end + +local function makemap(fontname,id,state,unicode) + local map = { } + local r = remap[cleanfontname(fontname)] + if r and r.unicode ~= nil then + unicode = r.unicode + end + if unicode then + local chr = chardata[id] + for k, v in next, state.unicodes do + local d = chr[v] + if d then +-- print(string.formatters["index in pdf %i unicode %C index in font %i"](k,v,d.index)) + map[k] = d.index + else + -- issue + end + end + else + for k, v in next, state.unicodes do + map[k] = k + end + end + return map +end + +local function dontembed(basefont,state,embedding) + if not state.embedded then + report_merge("font %a is not embedded",basefont) + end + if embedding then + return false + elseif not state.embedded then + return false + else + return true + end +end + +local function getstate_OpenType(pdfdoc,v,d,embedding) + local state = getindexstate_composite(pdfdoc,v,d,getstates(pdfdoc).OpenType) + if state then + local basefont = d.BaseFont + if basefont then + if dontembed(basefont,state,embedding) then + return false + end + local fontname = match(basefont,"^[A-Z]+%+(.+)$") or basefont + local cleanname = cleanfontname(fontname) + local streamhash, id = isdefinedunknown(fontname) + if streamhash then + return { + id = id, + map = makemap(fontname,id,state,false), + streamhash = streamhash, + filename = fontname, + -- subfont = subfont, + -- instance = instance, + used = lpdf.usedindices[streamhash], + } + end + end + end +end + +local function getstate_TrueType(pdfdoc,v,embedding) + local state = getindexstate_simple(pdfdoc,v,getstates(pdfdoc).TrueType) + if state then + -- needs checking when unicode ... NOT OK + local basefont = v.BaseFont + if basefont then + if dontembed(basefont,state,embedding) then + return false + end + local fontname = match(basefont,"^[A-Z]+%+(.+)$") or basefont + local cleanname = cleanfontname(fontname) + local streamhash, id = isdefinedunknown(fontname) + if streamhash then + return { + id = id, + map = makemap(fontname,id,state,true), + narrow = state.narrow, + streamhash = streamhash, + filename = fontname, + -- subfont = subfont, + -- instance = instance, + used = lpdf.usedindices[streamhash], + } + end + end + end +end + +local function getstate_Type1(pdfdoc,v,embedding) + local state = getindexstate_simple(pdfdoc,v,getstates(pdfdoc).Type1) + if state then + local basefont = v.BaseFont + if basefont then + if dontembed(basefont,state,embedding) then + return false + end + local fontname = match(basefont,"^[A-Z]+%+(.+)$") or basefont + local cleanname = cleanfontname(fontname) + local streamhash, id = isdefinedunknown(fontname) + if streamhash then + return { + id = id, + map = makemap(fontname,id,state,true), + narrow = state.narrow, + streamhash = streamhash, + filename = fontname, + -- subfont = subfont, + -- instance = instance, + used = lpdf.usedindices[streamhash], + } + end + end + end +end + +local function getstate_LMTX(pdfdoc,r) + local indexmap = r.IndexMap + local streamhash = r.StreamHash + local filename = r.FileName + local subfont = r.SubFont or 1 + local instance = r.Instance or "" + local version = r.Version or "0" + local glyphcount = r.GlyphCount or 0 + if indexmap then + local index = -1 + local map = { } + for i=1,#indexmap do + local li = indexmap[i] + if type(li) == "number" then + index = li + else + for j=1,#li do + map[index] = li[j] + index = index + 1 + end + end + end + if isdefinedlmtx(filename,subfont,instance,streamhash,version,glyphcount) then + return { + map = map, + streamhash = streamhash, + filename = filename, + subfont = subfont, + instance = instance, + used = lpdf.usedindices[streamhash], + } + end + end +end + +-- yes : merge when we have a context file +-- always : merge and assume original indices +-- embed : add missing fonts +-- fix : convert decimal into hexadecimal + +do + + local h_hex_2 = lpdf.h_hex_2 + local h_hex_4 = lpdf.h_hex_4 + + local function report_sharing(pdfdoc,what,v,shared,pagenumber,lmtx) + local encoding = v.Encoding + report_merge("page %i of %a, font %a, type %a, encoding %a, %sshared%s", + pagenumber, + basename(pdfdoc.filename), + v.BaseFont or "?", + what, + type(encoding) == "string" and encoding or "custom", + shared and "" or "not ", + lmtx and ", lmtx registry found" or "" + ) + end + + local function plugin_Type0(pdfdoc,k,v,sharedfonts,data,compactor,pagenumber) + -- The v table is unique and can be shared + local shared = sharedfonts[v] + if type(shared) == "table" then + data[k] = shared + elseif shared == nil then + shared = false + if v.Encoding == "Identity-H" then + local d = v.DescendantFonts[1] -- how about more + if d and d.Subtype == "CIDFontType0" or d.Subtype == "CIDFontType2" then + local r = d.LMTXRegistry + if r then + -- if compactor.merge and (compactor.merge.lmtx or compactor.merge.LMTX) then + if compactor.merge.lmtx or compactor.merge.LMTX then + shared = getstate_LMTX(pdfdoc,r) + data[k] = shared + end + elseif find(pdfe.producer(pdfdoc),"^LuaMetaTeX") then +-- todo: check vector by name + -- This is a no go because for sure we have a different index order. Older + -- versions append the version to the producer string. +-- elseif compactor.merge.type0 then +-- shared = getstate_OpenType(pdfdoc,v,d) +-- data[k] = shared +-- elseif compactor.embed.type0 then +-- shared = getstate_OpenType(pdfdoc,v,d,true) +-- data[k] = shared +-- end + elseif compactor.merge.type0 or compactor.embed.type0 then + shared = getstate_OpenType(pdfdoc,v,d,compactor.merge.type0) + data[k] = shared + end + if trace_merge then + report_sharing(pdfdoc,"type0",v,shared,pagenumber,r and true or false) + end + end + sharedfonts[v] = shared + end + else + -- what ... + -- print("case 1",encoding) + end + end + + local function plugin_TrueType(pdfdoc,k,v,sharedfonts,data,compactor,pagenumber) + local shared = sharedfonts[v] + if type(shared) == "table" then + data[k] = shared + elseif shared == nil then + shared = false +-- if compactor.merge.truetype then +-- shared = getstate_TrueType(pdfdoc,v) +-- data[k] = shared +-- else + if compactor.embed.truetype or compactor.merge.truetype then + shared = getstate_TrueType(pdfdoc,v,compactor.merge.truetype) + data[k] = shared + end + if trace_merge then + report_sharing(pdfdoc,"truetype",v,shared,pagenumber) + end + sharedfonts[v] = shared + end + end + + local function plugin_Type1(pdfdoc,k,v,sharedfonts,data,compactor,pagenumber) + local shared = sharedfonts[v] + if type(shared) == "table" then + data[k] = shared + elseif shared == nil then + shared = false +-- if compactor.merge.type1 then +-- shared = getstate_Type1(pdfdoc,v) +-- data[k] = shared +-- elseif compactor.embed.type1 then +-- shared = getstate_Type1(pdfdoc,v,true) +-- data[k] = shared +-- end + if compactor.embed.type1 or compactor.merge.type1 then + shared = getstate_Type1(pdfdoc,v,compactor.merge.type1) + data[k] = shared + end + if trace_merge then + report_sharing(pdfdoc,"type1",v,shared,pagenumber) + end + end + sharedfonts[v] = shared + end + + local plugin -- defined after the next one + + local function plugin_Type3(pdfdoc,k,v,sharedfonts,data,compactor,pagenumber) + local charprocs = v.CharProcs + if charprocs then + local resources = v.Resources + if resources then + local fonts = resources.Font + local xobjects = resources.XObject + if fonts or xobjects then + for k, object in expanded(charprocs) do + if not object.__fonts_remapped__ then + local contents = object() + contents = parsecontent(contents,true) + if plugin(pdfdoc,contents,fonts,xobjects,pagenumber,compactor,{}) then + contents = contenttostring(contents) + object.__raw__.Length = #contents -- nil + object.__raw__.Filter = nil + getmetatable(object).__call = function() return contents end + end + object.__fonts_remapped__ = true + status.charprocs = status.charprocs + 1 + status.indices = status.indices + indices + end + end + end + end + end + end + + local handlers = { + Type0 = plugin_Type0, + TrueType = plugin_TrueType, + Type1 = plugin_Type1, + Type3 = plugin_Type3, + } + + -- not always ok .. every page can have different font references but let's + -- assume it for now + + -- ... Tw : what a mess, why not via tounicode ... + -- + -- Word spacing shall be applied to every occurrence of the single-byte character code 32 in a string + -- when using a simple font (including Type 3) or a composite font that defines code 32 as a single-byte + -- code. It shall not apply to occurrences of the byte value 32 in multiple-byte codes. + + plugin = function(pdfdoc,contents,fonts,xobjects,pagenumber,compactor,adapted,depth) + + local data = { } + local indices = 0 + + local sharedfonts = pdfdoc.sharedfonts or { } + pdfdoc.sharedfonts = sharedfonts + if fonts or xobjects then + + if fonts then + + -- check if ref for k is the same + for k, v in expanded(fonts) do + local subtype = v.Subtype + local handler = subtype and handlers[subtype] + if handler then + handler(pdfdoc,k,v,sharedfonts,data,compactor,pagenumber) + else + -- weird + end + end + + end + + local r = false + local f = false + local n = false + local m = false + local u = false + + local new = { } + local old = { } + + local process_hex = false + + -- if we move h and m outside the function we can use lpegs .. todo + + local function process_hex_hexified(h) + local b = hextointeger(h) + local i = m[b] + if i then + local n = h_hex_4[u[i]] + if h ~= n then + indices = indices + 1 + end + return n + else + return h_hex_4[b] + end + end + + local function process_hex_narrow(s) return (gsub(s,"..", process_hex_hexified)) end + local function process_hex_wide (s) return (gsub(s,"....",process_hex_hexified)) end + + local Tw = false -- a horrible pdf feature + local spaces = { } + + -- if we have Tw then we also have 0x20 as space + + for i=1,#contents do + local ti = contents[i] + local op = ti[#ti] + if op == "Tf" then + -- maybe use /R for replacement + f = ti[1][2] + d = data[f] + if d then + m = d.map + u = d.used + r = i + new[f] = d.streamhash + if d.narrow then + process_hex = process_hex_narrow + else + process_hex = process_hex_wide + end +if not spaces[f] then + spaces[f] = process_hex_wide("0020") +end + else + if d == false then + old[f] = true + end + f = false + end + elseif op == "Tj" then + if f then + local ci = ti[1] + if type(ci) == "table" then + local tp = ci[1] + if tp == "hex" then + ci[2] = process_hex(ci[2]) + end + end + end + elseif op == "TJ" then + if f then + local c = ti[1][2] + if c then + for i=1,#c do + local ci = c[i] + if type(ci) == "table" then + local tp = ci[1] + if tp == "hex" then + ci[2] = process_hex(ci[2]) + end + end + end + end + end + elseif op == "Tw" then + Tw = true + elseif xobjects and op == "Do" then + -- can be recursive + local object = xobjects[ti[1][2]] + if object and object.Subtype == "Form" then + local r = object.Resources + if r then + if not object.__fonts_remapped__ then + local contents = object() + local fonts = r.Font + local xobjects = r.XObject +-- print("PROCESSING CONTENT",pagenumber,ti[1][2]) + contents = parsecontent(contents,true) + if plugin(pdfdoc,contents,fonts,xobjects,pagenumber,compactor,adapted,depth+1) then + contents = contenttostring(contents) + object.__raw__.Length = #contents -- nil + object.__raw__.Filter = nil + getmetatable(object).__call = function() return contents end + object.__fonts_remapped__ = true + status.xobjects = status.xobjects + 1 + r.Font = fonts + end + else +-- print("CONTENT ALREADY PROCESSED",pagenumber,ti[1][2]) + end + end + end + end + end + + if Tw then -- can be optimized + local value + local space + + local hexed = setmetatableindex(function(t,k) + local v = { "hex", k } + t[k] = v + return v + end) + + local function collapse(cc) + local c = { } + local n = 0 + local t = { } + local m = 0 + for i=1,#cc do + local ci = cc[i] + if type(ci) == "table" then + m = m + 1 ; t[m] = ci[2] + else + if m > 0 then + n = n + 1 ; c[n] = { "hex", concat(t,"",1,m) } + m = 0 + end + n = n + 1 ; c[n] = ci + end + end + if m > 0 then + n = n + 1 ; c[n] = { "hex", concat(t,"",1,m) } + end + return c + end + + local scale = 1 + + for i=1,#contents do + local ti = contents[i] + local op = ti[#ti] + if op == "Tf" then + scale = tonumber(ti[2]) or 1 + f = ti[1][2] + space = spaces[f] + elseif op == "Tj" then + if value and space then + local ci = ti[1] + local tp = ci[1] + if tp == "hex" then + local cc = { } + local nn = 0 + local ok = false + local ci2 = ci[2] + for s in gmatch(ci2,"....") do -- todo: narrow + nn = nn + 1 ; cc[nn] = hexed[s] + if s == space then + nn = nn + 1 ; cc[nn] = f6(value/scale) + ok = true + end + end + if ok then + -- contents[i] = { { "array", cc }, "TJ" } +-- print("B",contenttostring { contents[i] } ) +-- print("A",contenttostring { { { "array", collapse(cc) }, "TJ" } } ) + contents[i] = { { "array", collapse(cc) }, "TJ" } + end + end + end + elseif op == "TJ" then + if value and space then + local c = ti[1][2] + if c then + local cc = { } + local nn = 0 + local nm = false + local ok = false + -- combine these loops + for i=1,#c do + local ci = c[i] + if type(ci) == "table" then + local tp = ci[1] + if tp == "hex" then + local ci2 = ci[2] + for s in gmatch(ci2,"....") do -- todo: narrow + nn = nn + 1 ; cc[nn] = { "hex", s } -- cache this + if s == space then + nn = nn + 1 ; cc[nn] = f6(value/scale) + nm = true + ok = true + else + nm = false + end + end + else + -- can't happen + nn = nn + 1 ; cc[nn] = ci + nm = false + end + elseif nm then + -- print("collapse") + cc[nn] = f6(tonumber(ci) + tonumber(cc[nn])) + else + nn = nn + 1 ; cc[nn] = ci + end + end + if ok then + -- ti[1][2] = cc + ti[1][2] = collapse(cc) + end + end + end + elseif op == "Tw" then + value = ti[1] * -1000 + if value == 0 then + value = false + end + contents[i] = { } -- constant +-- elseif op == "BT" or op == "ET" then +-- value = false + end + end + + + end + + local state = trace_merge and { } or false + + if fonts then + for k, v in next, fonts.__raw__ do -- we need the raw values here + -- for k, v in expanded(fonts) do -- we need the raw values here + +-- -- goes wrong on nested objects +-- if adapted[k] then +-- -- already done +-- else + + if new[k] then + local o = lpdf.getfontobjectnumber(new[k]) + fonts.__raw__[k] = { pdfe.objectcodes.lpdf, pdfreference(o) } + adapted[k] = true + -- adapted[k] = function(_,_,_,key,value) + -- local ref = checkedfontreference(k,v,key,value,o) + -- return ref + -- end + if state then + state[k] = true + end + elseif state and old[k] then + state[k] = false + end + end + end + + if state then + local filename = basename(pdfdoc.filename) + for k, v in sortedhash(state) do + if v then + local d = data[k] + report_merge( + "page %i of %a, font reference %a to %a, subfont %a, instance %a, merged", + pagenumber,filename,k,d.filename,d.subfont,toinstance(d.instance) + ) + status.merged = status.merged + 1 + else + report_merge( + "page %i of %a, font reference %a, not merged", + pagenumber,filename,k + ) + status.notmerged = status.notmerged + 1 + end + end + end + + status.indices = status.indices + indices + + end + + return indices ~= 0 + end + + function pdfe.fontplugin(pdfdoc,page,pagenumber,resources,compactor) + local fonts = resources.Font + local xobjects = resources.XObject + if fonts or xobjects then + local contents = getpagecontent(pdfdoc,pagenumber,true,true) +-- if plugin ... +-- print("before",contenttostring(contents)) + plugin(pdfdoc,contents,fonts,xobjects,pagenumber,compactor,{},1) + resources.Font = fonts -- really needed + if contents then + page.Contents = contenttostring(contents) +-- inspect("after",page.Contents) + end + status.pages = status.pages + 1 + status.files[pdfdoc.filename] = (status.files[pdfdoc.filename] or 0) + 1 + end + end + + utilities.sequencers.appendaction("pdfcontentmanipulators","system","lpdf.epdf.fontplugin") + utilities.sequencers.enableaction("pdfcontentmanipulators","lpdf.epdf.fontplugin") + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix.lmt new file mode 100644 index 00000000000..37578c56dff --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fix.lmt @@ -0,0 +1,131 @@ +if not modules then modules = { } end modules ['lpdf-fix'] = { + version = 1.001, + comment = "companion to lpdf-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- todo: keep table representation + +-- local everything = { +-- embed = { +-- type0 = true, +-- truetype = true, +-- type1 = true, +-- }, +-- merge = { +-- type0 = true, -- check if a..z A..Z 0..9 +-- truetype = true, +-- type1 = true, +-- type3 = true, +-- LMTX = true, +-- }, +-- strip = { +-- transparency = true, -- when zero +-- extgstate = true, +-- cmyk = true, +-- }, +-- add = { +-- cidset, -- when missing or even fix +-- }, +-- } + +-- local report = logs.reporter("graphics","compactors") + +do + + local pdfbackend = backends.registered.pdf + local codeinjections = pdfbackend.codeinjections + local setmetatableindex = table.setmetatableindex + + local compactors = { + -- [interfaces.variables.no] = false, + -- [interfaces.variables.nono] = false, + -- [""] = false, + } + + local function registercompactor(name,data) + if not data then + data = name + name = data.name + data.name = nil + end + compactors[name] = setmetatableindex(data,"table") + end + + codeinjections.registercompactor = registercompactor + + function codeinjections.validcompactor(name) + return name and compactors[name] or false + end + + registercompactor ( "preset:yes", { + merge = { + lmtx = true, + }, + } ) + + registercompactor ( "preset:merge", { + merge = { + type0 = true, + truetype = true, + type1 = true, + -- type3 = true, + lmtx = true, + }, + } ) + + compactors[interfaces.variables.yes] = compactors["preset:yes"] + + function graphics.registerpdfcompactor(...) + -- todo: message + registercompactor(...) + end + +end + +do + + local sequencers = utilities.sequencers + local appendgroup = sequencers.appendgroup + + local pdfcontentmanipulators = sequencers.new { + name = "pdfcontentmanipulators", + arguments = "pdfdoc,page,pagenumber,resources,compactor", + } + + appendgroup(pdfcontentmanipulators,"before") -- user + appendgroup(pdfcontentmanipulators,"system") -- private + appendgroup(pdfcontentmanipulators,"after" ) -- user + + function lpdf.epdf.contentplugin(pdfdoc,page,pagenumber,resources,compactor) + local runner = pdfcontentmanipulators.runner + if runner then + runner(pdfdoc,page,pagenumber,resources,compactor) + end + end + + -- todo: contents: table first time, concat last time .. automatic .. when + -- performance becomes an issue + + local pdfpagemanipulators = sequencers.new { + name = "pdfpagemanipulators", + arguments = "pdfdoc,page,pagenumber,resources,compactor", + } + + appendgroup(pdfpagemanipulators,"before") -- user + appendgroup(pdfpagemanipulators,"system") -- private + appendgroup(pdfpagemanipulators,"after" ) -- user + + sequencers.appendaction("pdfpagemanipulators","system","lpdf.epdf.contentplugin") + sequencers.enableaction("pdfpagemanipulators","lpdf.epdf.contentplugin") + + function lpdf.epdf.pageplugin(pdfdoc,page,pagenumber,resources,compactor) + local runner = pdfpagemanipulators.runner + if runner then + runner(pdfdoc,page,pagenumber,resources,compactor) + end + end + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt index 3077b19c006..1b27cd491e9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt @@ -56,15 +56,16 @@ if not modules then modules = { } end modules ['lpdf-fld'] = { local tostring, tonumber, next = tostring, tonumber, next local gmatch, lower, format, formatters = string.gmatch, string.lower, string.format, string.formatters local lpegmatch = lpeg.match -local bpfactor, todimen = number.dimenfactors.bp, string.todimen +local todimen = string.todimen local sortedhash = table.sortedhash local trace_fields = false trackers.register("backends.fields", function(v) trace_fields = v end) local report_fields = logs.reporter("backend","fields") -local variables = interfaces.variables local context = context +local bpfactor = number.dimenfactors.bp + local references = structures.references local settings_to_array = utilities.parsers.settings_to_array @@ -110,6 +111,8 @@ local pdf_n = pdfconstant("N") -- None Invert Outline Push -- local pdf_no_rect = pdfarray { 0, 0, 0, 0 } +local signature = nil + local splitter = lpeg.splitat("=>") local formats = { @@ -942,10 +945,16 @@ local function finishfields() end if #collected > 0 then local acroform = pdfdictionary { - NeedAppearances = pdfmajorversion() == 1 or nil, Fields = pdfreference(pdfflushobject(collected)), CO = fieldsetlist(calculationset), } + if signature then + acroform.SigFlags = 3 + elseif pdfmajorversion() == 1 then + acroform.NeedAppearances = true + else + -- depricated + end if sometext or somefont then checkpdfdocencoding() if sometext then @@ -1108,6 +1117,7 @@ end local function makesignatureparent(field,specification) local text = pdfunicode(field.default) local length = tonumber(specification.length or 0) or 0 + local value = lpdf.registersignature(field.values) local d = pdfdictionary { Subtype = pdf_widget, T = pdfunicode(specification.title), @@ -1119,8 +1129,8 @@ local function makesignatureparent(field,specification) FT = pdf_sig, Q = fieldalignment(specification), MaxLen = length == 0 and 1000 or length, - DV = text, - V = text, + DV = not value and text or nil, + V = value or text, } save_parent(field,specification,d) end @@ -1160,6 +1170,9 @@ local function makesignaturechild(name,specification) AA = fieldactions(specification), MK = fieldrendering(specification), Q = fieldalignment(specification), +-- AP = pdfdictionary { +-- N = pdfreference(lpdf.flushstreamobject("q 0 0 100 100 re f Q")) +-- } } return save_kid(parent,specification,d) end @@ -1167,6 +1180,44 @@ end function methods.signature(name,specification) return makesignaturechild(name,specification) end + +-- + +function methods.signed(name,specification) + local field = fields[name] + if field then + specification.option = "hidden" -- for now + local value = lpdf.registersignature(field.values) + if not value or value == "" then + value = "pkcs7" + end + local d = pdfdictionary { + Subtype = pdf_widget, + T = pdfunicode(specification.title), + F = fieldplus(specification), + Ff = fieldflag(specification), + OC = fieldlayer(specification), + -- DA = fieldsurrounding(specification), + -- AA = fieldactions(specification), + FT = pdf_sig, + -- Q = fieldalignment(specification), + V = lpdf.registersignature(value), + } + -- + local kn = pdfreserveobject() + local width = specification.width or 0 + local height = specification.height or 0 + local depth = specification.depth or 0 + local box = hpack_node(nodeinjections.annotation(width,height,depth,d(),kn)) + -- redundant + box.width = width + box.height = height + box.depth = depth + collected[#collected+1] = pdfreference(kn) + return box + end +end + -- local function makechoiceparent(field,specification) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt index 7ceacc62d68..e8693d9b062 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt @@ -41,6 +41,7 @@ local pdfflushstreamfileobject = lpdf.flushstreamfileobject local addtoinfo = lpdf.addtoinfo local injectxmpinfo = lpdf.injectxmpinfo local insertxmpinfo = lpdf.insertxmpinfo +local replacexmpinfo = lpdf.replacexmpinfo local settings_to_array = utilities.parsers.settings_to_array local settings_to_hash = utilities.parsers.settings_to_hash @@ -142,7 +143,14 @@ local formats = utilities.storage.allocate { attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-1a:2001") - injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2001",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-1a:2001 + +]] + ) end }, ["pdf/x-1a:2003"] = { @@ -159,7 +167,14 @@ local formats = utilities.storage.allocate { attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-1a:2003") - injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2003",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-1a:2003 + +]] + ) end }, ["pdf/x-3:2002"] = { @@ -225,9 +240,24 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","PDF/X-4",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-4 + +]] + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[1]], + false + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[default]], + false + ) end }, ["pdf/x-4p"] = { @@ -253,9 +283,24 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","PDF/X-4p",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + PDF/X-4p + +]] + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[1]], + false + ) + insertxmpinfo( + "xml://rdf:Description/xmpMM:InstanceID", + [[default]], + false + ) end }, ["pdf/x-5g"] = { @@ -356,7 +401,15 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","1A",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 1 + A + +]] + ) end }, ["pdf/a-1b:2005"] = { @@ -377,7 +430,15 @@ local formats = utilities.storage.allocate { include_charsets = true, attachments = false, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","1B",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 1 + B + +]] + ) end }, -- Only PDF/A Attachments are allowed but we don't check the attachments @@ -405,7 +466,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, -- new inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","2A",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 2 + A + +]] + ) end }, ["pdf/a-2b"] = { @@ -431,7 +500,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","2B",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 2 + B + +]] + ) end }, -- This is like the b variant, but it requires Unicode mapping of fonts @@ -459,7 +536,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","2U",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 2 + U + +]] + ) end }, -- Any type of attachment is allowed but we don't check the quality @@ -487,7 +572,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3A",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + A + +]] + ) end }, ["pdf/a-3b"] = { @@ -513,7 +606,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3B",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + B + +]] + ) end }, ["pdf/a-3u"] = { @@ -539,7 +640,15 @@ local formats = utilities.storage.allocate { include_charsets = false, attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3U",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + U + +]] + ) end }, ["pdf/ua-1"] = { -- based on PDF/A-3a, but no 'gts_flag' @@ -564,8 +673,18 @@ local formats = utilities.storage.allocate { include_charsets = true, --- really ? attachments = true, inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3A",false) - injectxmpinfo("xml://rdf:RDF","1",false) + replacexmpinfo( + "xml://rdf:RDF/pdfaid-placeholder", +[[ + + 3 + A + + + 1 + +]] + ) end }, } @@ -651,6 +770,7 @@ local function profilename(filename) end local internalprofiles = { } +local defaultprofiles = { } local function handleinternalprofile(s,include) local filename, colorspace = s.filename or "", s.colorspace or "" @@ -664,6 +784,9 @@ local function handleinternalprofile(s,include) if include then -- local fullname = resolvers.findctxfile(filename) or "" local fullname = locatefile(filename) + if fullname == "" then + fullname = locatefile("colo-imp-" .. filename) + end local channel = channels[colorspace] or nil if fullname == "" then report_backend("error, couldn't locate profile %a",filename) @@ -672,6 +795,7 @@ local function handleinternalprofile(s,include) else profile = pdfflushstreamfileobject(fullname,pdfdictionary{ N = channel },false) -- uncompressed internalprofiles[tag] = profile + defaultprofiles[channel] = profile if trace_format then report_backend("including %a color profile from %a",colorspace,fullname) end @@ -687,6 +811,11 @@ local function handleinternalprofile(s,include) end end +function codeinjections.defaultprofile(channel) + -- print("get profile",channel,defaultprofiles[channel]) + return defaultprofiles[channel] +end + local externalprofiles = { } local function handleexternalprofile(s,include) -- specification (include ignored here) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt deleted file mode 100644 index 36f2961055a..00000000000 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt +++ /dev/null @@ -1,189 +0,0 @@ -if not modules then modules = { } end modules ['lpdf-fnt'] = { - version = 1.001, - comment = "companion to lpdf-ini.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- This is experimental code. - -local match, gmatch = string.match, string.gmatch -local tonumber, rawget = tonumber, rawget - -local pdfe = lpdf.epdf -local pdfreference = lpdf.reference -local pdfreserveobject = lpdf.reserveobject - -local tobemerged = { } -local trace_merge = false trackers.register("graphics.fonts",function(v) trace_merge = v end) -local report_merge = logs.reporter("graphics","fonts") - -local function register(usedname,cleanname) - local cleanname = cleanname or fonts.names.cleanname(usedname) - local fontid = fonts.definers.internal { name = cleanname } - if fontid then - local objref = pdfreserveobject() - if trace_merge then - report_merge("registering %a with name %a, id %a and object %a",usedname,cleanname,fontid,objref) - end - return { - id = fontid, - reference = objref, - indices = { }, - cleanname = cleanname, - } - end - return false -end - -function lpdf.registerfont(usedname,cleanname) - local v = register(usedname,cleanname) - tobemerged[usedname] = v - return v -end - -table.setmetatableindex(tobemerged,function(t,k) - return lpdf.registerfont(k) -end) - -local function finalizefont(v) - local indextoslot = fonts.helpers.indextoslot - if v then - local id = v.id - local n = 0 - for i in next, v.indices do - local u = indextoslot(id,i) - n = n + 1 - end - v.n = n - end -end - -statistics.register("merged fonts", function() - if next(tobemerged) then - local t = { } - for k, v in table.sortedhash(tobemerged) do - t[#t+1] = string.formatters["%s (+%i)"](k,v.n) - end - return table.concat(t," ") - end -end) - -function lpdf.finalizefonts() - for k, v in next, tobemerged do - finalizefont(v) - end -end - -callback.register("font_descriptor_objnum_provider",function(name) - local m = rawget(tobemerged,name) - if m then - -- finalizefont(m) - local r = m.reference or 0 - if trace_merge then - report_merge("using object %a for font descriptor of %a",r,name) - end - return r - end - return 0 -end) - -local function getunicodes1(str,indices) - for s in gmatch(str,"beginbfrange%s*(.-)%s*endbfrange") do - for first, last, offset in gmatch(s,"<([^>]+)>%s+<([^>]+)>%s+<([^>]+)>") do - for i=tonumber(first,16),tonumber(last,16) do - indices[i] = true - end - end - end - for s in gmatch(str,"beginbfchar%s*(.-)%s*endbfchar") do - for old, new in gmatch(s,"<([^>]+)>%s+<([^>]+)>") do - indices[tonumber(old,16)] = true - end - end -end - -local function getunicodes2(widths,indices) - for i=1,#widths,2 do - local start = widths[i] - local count = #widths[i+1] - if start and count then - for i=start,start+count-1 do - indices[i] = true - end - end - end -end - -local function checkedfonts(pdfdoc,xref,copied,page) - local list = page.Resources.Font - local done = { } - for k, somefont in pdfe.expanded(list) do - if somefont.Subtype == "Type0" and somefont.Encoding == "Identity-H" then - local descendants = somefont.DescendantFonts - if descendants then - for i=1,#descendants do - local d = descendants[i] - if d then - local subtype = d.Subtype - if subtype == "CIDFontType0" or subtype == "CIDFontType2" then - local basefont = somefont.BaseFont - if basefont then - local fontname = match(basefont,"^[A-Z]+%+(.+)$") - local fontdata = tobemerged[fontname] - if fontdata then - local descriptor = d.FontDescriptor - if descriptor then - local okay = false - local widths = d.W - if widths then - getunicodes2(widths,fontdata.indices) - okay = true - else - local tounicode = somefont.ToUnicode - if tounicode then - getunicodes1(tounicode(),fontdata.indices) - okay = true - end - end - if okay then - local r = xref[descriptor] - done[r] = fontdata.reference - end - end - end - end - end - end - end - end - end - end - return next(done) and done -end - -function lpdf.epdf.plugin(pdfdoc,xref,copied,page) -- needs checking - local done = checkedfonts(pdfdoc,xref,copied,page) - if done then - return { - FontDescriptor = function(xref,copied,object,key,value,copyobject) - local r = value[3] - local d = done[r] - if d then - return pdfreference(d) - else - return copyobject(xref,copied,object,key,value) - end - end - } - end -end - -lpdf.registerdocumentfinalizer(lpdf.finalizefonts) - --- already defined in font-ocl but the context variatn will go here --- --- function lpdf.vfimage(wd,ht,dp,data,name) --- return { "image", { filename = name, width = wd, height = ht, depth = dp } } --- end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt index 585d114599a..3fd8f9b4aab 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt @@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['lpdf-grp'] = { local type, tonumber = type, tonumber local formatters, gsub = string.formatters, string.gsub -local concat = table.concat +local concat, sort = table.concat, table.sort local round = math.round local colors = attributes.colors @@ -50,6 +50,22 @@ local function shade(stype,name,domain,color_a,color_b,n,colorspace,coordinates, local list = pdfarray() local bounds = pdfarray() local encode = pdfarray() + -- The bounds need to be sorted and we can have illustrator output + -- that violates this rule. + local tmp = { } + for i=1,steps do + tmp[i] = { fractions[i], color_a[i], color_b[i] } + end + sort(tmp, function(a,b) + return a[1] < b[1] + end) + for i=1,steps do + local t = tmp[i] + fractions[i] = t[1] + color_a [i] = t[2] + color_b [i] = t[3] + end + -- So far for a fix. for i=1,steps do if i < steps then bounds[i] = fractions[i] or 1 @@ -331,34 +347,76 @@ function codeinjections.getpreviewfigure(request) return figure end +local masks = { + demomask = { + { 0, 63, 0 }, + { 64, 127, 127 }, + { 128, 195, 195 }, + { 196, 255, 255 }, + } +} + +local ranges = { +-- [".75"] = .75, +-- [".50"] = .50, +-- [".25"] = .25, +} + +function codeinjections.registerfiguremask(name,specification) + masks[name] = specification +end + +function codeinjections.registerfigurerange(name,specification) + ranges[name] = specification +end + function codeinjections.setfiguremask(data,figure) -- mark local request = data.request local mask = request.mask + local range = request.range if mask and mask ~= "" then - figures.push { - name = mask, - page = request.page, - size = request.size, - prefix = request.prefix, - cache = request.cache, - width = request.width, - height = request.height, - } - mask = figures.identify() - mask = figures.check(mask) - if mask then - local image = mask.status.private - if image then - figures.include(mask) - embedimage(image) - local d = pdfdictionary { - Interpolate = false, - SMask = pdfreference(mask.status.objectnumber), - } - figure.attr = d() + local m = masks[mask] + if m then + if type(m) == "function" then + m = m() end + figure.newmask = m + else + figures.push { + name = mask, + page = request.page, + size = request.size, + prefix = request.prefix, + cache = request.cache, + width = request.width, + height = request.height, + } + mask = figures.identify() + mask = figures.check(mask) + if mask then + local image = mask.status.private + if image then + figures.include(mask) + embedimage(image) + local d = pdfdictionary { + Interpolate = false, + SMask = pdfreference(mask.status.objectnumber), + } + figure.attr = d() + end + end + figures.pop() + end + end + if range and range ~= "" then + local r = ranges[range] + if not r then + r = tonumber(range) + end + if type(r) == "function" then + r = r() end - figures.pop() + figure.newranges = r end end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt index e7dc663d6f0..5bf3add70de 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt @@ -120,6 +120,66 @@ local chars = setmetatableindex(function(t,k) -- share this one return v end) +-- newmask = 150 +-- +-- newmask = { +-- { 0, 100, 0x00 }, +-- { 101, 200, 0x7F }, +-- { 201, 255, 0xFF }, +-- } + +-- newranges = .75 +-- +-- newranges = { 0, 0.4, 0, 0.5, 0, 0.6 } } +-- newranges = { 0.4, 0.5, 0.6 } +-- newranges = { 0.5 } + +local function todecode(newranges,colors) + local kind = type(newranges) + if colors == 1 then + if kind == "table" then + local n = #newranges + if n == 1 then + return { 0, newranges[1] } + elseif n == 2 then + return { newranges[1], newranges[2] } + end + else + return { 0, newranges } + end + elseif colors == 3 then + if kind == "table" then + local n = #newranges + if n == 1 then + return { 0, newranges, 0, newranges, 0, newranges } + elseif n == 2 then + local n1, n2 = newranges[1], newranges[2] + return { n1, n2, n1, n2, n1, n2 } + elseif n == 6 then + return newranges + end + else + return { 0, newranges, 0, newranges, 0, newranges } + end + elseif colors == 4 then + if kind == "table" then + local n = #newranges + if n == 1 then + return { 0, newranges, 0, newranges, 0, newranges, 0, newranges } + elseif n == 2 then + local n1, n2 = newranges[1], newranges[2] + return { n1, n2, n1, n2, n1, n2, n1, n2 } + elseif n == 8 then + return newranges + end + else + return { 0, newranges, 0, newranges, 0, newranges, 0, newranges } + end + end +end + +-- + do function injectors.jpg(specification,method) @@ -132,16 +192,24 @@ do end local colorspace = specification.colorspace or jpg_gray local decodearray = nil + local colors = 1 ----- procset = colorspace == 0 and "image b" or "image c" if colorspace == 1 then colorspace = "DeviceGray" elseif colorspace == 2 then colorspace = "DeviceRGB" + colors = 3 elseif colorspace == 3 then colorspace = "DeviceCMYK" + colors = 4 decodearray = pdfarray { 1, 0, 1, 0, 1, 0, 1, 0 } end -- todo: set filename + local newranges = specification.newranges + if newranges then + decodearray = newranges and pdfarray(todecode(newranges,colors)) or nil + end + -- todo: set filename local xsize = specification.xsize local ysize = specification.ysize local colordepth = specification.colordepth @@ -234,6 +302,7 @@ do local pngexpand = pngdecode.expand local pngtocmyk = pngdecode.tocmyk local pngtomask = pngdecode.tomask + local pngmakemask = pngdecode.makemask local filtermask, decodemask, decodestrip, transpose, expand, tocmyk @@ -1093,6 +1162,13 @@ do end end -- + local newmask = specification.newmask + local newranges = specification.newranges + -- + if newranges then + newranges = todecode(newranges,colors) + end + -- if interlace then local r, p = deinterlace(content,xsize,ysize,colordepth,colorspace,palette,mask) if not r then @@ -1161,6 +1237,21 @@ do return end decode = true -- due to enforcecmyk + elseif newmask and colordepth == 8 and colorspace == "DeviceGray" then + local bytes = analyze(colordepth,colorspace) + if bytes then + content = zlibdecompress(content) + content = decodestrip(openstring(content),xsize,ysize,bytes) + mask = pngmakemask(content,newmask) + if compresslevel > 0 then + content = zlibcompress(content,compresslevel) + else + filter = nil + end + else + return + end + decode = true -- due to enforcecmyk else -- print("PASS ON") end @@ -1190,7 +1281,7 @@ do Filter = filter, ColorSpace = palette or pdfconstant(colorspace), Length = #content, --- Decode = pdfarray { 0, .5, 0, .5, 0, .5 } -- darker (test for luatex list) + Decode = newranges and pdfarray(newranges) or nil, } + specification.attr if mask then local d = pdfdictionary { @@ -1200,11 +1291,12 @@ do Height = ysize, BitsPerComponent = palette and 8 or colordepth, ColorSpace = pdfconstant("DeviceGray"), --- Decode = pdfarray { 0, .5, 0, .5, 0, .5 }, -- lighter (test for luatex list) + Decode = newranges and pdfarray(newranges) or nil, } xobject.SMask = pdfreference(pdfflushstreamobject(mask,d())) end if not decode then + -- not if Decode set? xobject.DecodeParms = pdfdictionary { Colors = colors, Columns = xsize, diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt index d4b0ccc64e4..29b3af6d918 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt @@ -65,6 +65,7 @@ local P, C, R, S, Cc, Cs, V = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cc, lpeg.Cs, local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns local formatters = string.formatters local isboolean = string.is_boolean +local hextointeger, octtointeger = string.hextointeger,string.octtointeger local report_objects = logs.reporter("backend","objects") local report_finalizing = logs.reporter("backend","finalizing") @@ -96,6 +97,47 @@ end) local trace_finalizers = false trackers.register("backend.finalizers", function(v) trace_finalizers = v end) local trace_resources = false trackers.register("backend.resources", function(v) trace_resources = v end) + -- helpers + +local f_hex_4 = formatters["%04X"] +local f_hex_2 = formatters["%02X"] + +local h_hex_4 = table.setmetatableindex(function(t,k) -- we already have this somewhere + if k < 0 then + --report("fatal h_hex_4 error: %i",k) + return "0000" + elseif k < 256 then -- maybe 512 + -- not sparse in this range + for i=0,255 do + t[i] = f_hex_4(i) + end + return t[k] + else + local v = f_hex_4(k) + t[k] = v + return v + end +end) + +local h_hex_2 = table.setmetatableindex(function(t,k) -- we already have this somewhere + if type(k) == "string" then + local v = f_hex_2(byte(k)) + t[k] = v + return v + elseif k < 0 or k > 255 then + -- report("fatal h_hex_2 error: %i",k) + return "00" + else + local v = f_hex_2(k) + t[k] = v + return v + end +end) + +lpdf.h_hex_2 = h_hex_2 +lpdf.h_hex_4 = h_hex_4 + + do -- This is for a future feature (still under investigation and consideration). So, @@ -228,7 +270,7 @@ do local more = 0 local pattern = C(4) / function(s) -- needs checking ! - local now = tonumber(s,16) + local now = hextointeger(s) if more > 0 then now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000 more = 0 @@ -253,7 +295,15 @@ do local toregime = regimes and regimes.toregime local fromregime = regimes and regimes.fromregime - local escaped = Cs(Cc("(") * (S("\\()\n\r\t\b\f")/"\\%0" + P(1))^0 * Cc(")")) + local escaped = Cs( + Cc("(") + * ( + S("()\n\r\t\b\f")/"\\%0" + + P("\\")/"\\\\" + + P(1) + )^0 + * Cc(")") + ) topdfdoc = function(str,default) if not str or str == "" then @@ -282,11 +332,19 @@ do end end - local b_pattern = Cs((P("\\")/"" * ( - S("()") - + S("nrtbf") / { n = "\n", r = "\r", t = "\t", b = "\b", f = "\f" } - + lpegpatterns.octdigit^-3 / function(s) return char(tonumber(s,8)) end) - + P(1))^0) + -- use an oct hash + + local unescape = Cs(( + P("\\")/"" * ( + S("()") + + S("\n\r")^1 / "" + + S("nrtbf") / { n = "\n", r = "\r", t = "\t", b = "\b", f = "\f" } + + (lpegpatterns.octdigit * lpegpatterns.octdigit^-2) / function(s) return char(octtointeger(s)) end + ) + + P("\\\\") / "\\" + + P(1) +-- - P(")") -- when inlined + )^0) fromeight = function(str) if not str or str == "" then @@ -296,6 +354,8 @@ do end end + lpegpatterns.pdffromeight = unescape + local u_pattern = lpegpatterns.utfbom_16_be * lpegpatterns.utf16_to_utf8_be -- official + lpegpatterns.utfbom_16_le * lpegpatterns.utf16_to_utf8_le -- we've seen these @@ -313,12 +373,12 @@ do * Cs( ( zero / "" + two / function(a,b) - a = (tonumber(a,16) - 0xD800) * 1024 - b = (tonumber(b,16) - 0xDC00) + a = (hextointeger(a) - 0xD800) * 1024 + b = (hextointeger(b) - 0xDC00) return utfchar(a+b) end + one / function(a) - return utfchar(tonumber(a,16)) + return utfchar(hextointeger(a)) end )^1 ) * P(-1) } @@ -342,7 +402,7 @@ do return u end end - return lpegmatch(b_pattern,s) + return lpegmatch(unescape,s) end lpdf.tosixteen = tosixteen diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt index 7f3e53f285a..c7efdb29f04 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt @@ -8,7 +8,8 @@ if not modules then modules = { } end modules ['lpdf-lmt'] = { } -- The code below was originally in back-lpd.lua but it makes more sense in this --- namespace. I will rename variables. +-- namespace. I will rename variables. Because we run into the 200 locals this file +-- has to be split. -- There is no way that a lua based backend can compete performance wise with the -- original one for relative simple text runs. And we're talking seconds here on say @@ -46,8 +47,6 @@ local osuuid = os.uuid local zlibcompresssize = xzip.compresssize local nuts = nodes.nuts -local tonut = nodes.tonut -local tonode = nuts.tonode local pdfreference = lpdf.reference local pdfdictionary = lpdf.dictionary @@ -121,19 +120,40 @@ local flushers = { } local pdf_h = 0 local pdf_v = 0 -local need_tm, need_tf, need_font, cur_tmrx, cur_factor -local need_width, need_mode, done_width, done_mode +local need_tm +local need_tf +local need_font +----- cur_tmrx +local need_width +local need_mode +local done_width +local done_mode local mode -local f_pdf_cur, f_pdf, fs_cur, fs, f_cur, f_x_scale, f_y_scale -local tj_delta, cw -local usedfonts, usedxforms, usedximages, usedxgroups -local getxformname, getximagename -local boundingbox, shippingmode, objectnumber -local tmrx, tmry, tmsx, tmsy, tmtx, tmty +local current_pdf +----- f_pdf_cur +local current_font +local current_effect +local current_slant +local current_weight +local current_sx +local current_sy +local current_factor +local f_x_scale +local f_y_scale +local tj_scale +local tj_delta +local tj_position +----- tmrx, tmry, tmsx, tmsy, tmtx, tmty +local tmrx, tmry, tmsy, tmtx, tmty ----- cmrx, cmry, cmsx, cmsy, cmtx, cmty local cmrx, cmry, cmtx, cmty local tmef -local c_effect +local tmef_f_x_scale +local tmef_f_w_scale + +local usedfonts, usedxforms, usedximages, usedxgroups +local getxformname, getximagename +local boundingbox, shippingmode, objectnumber local function usefont(t,k) -- a bit redundant hash -- local v = pdfgetfontname(k) @@ -143,41 +163,47 @@ local function usefont(t,k) -- a bit redundant hash end local function reset_variables(specification) - pdf_h, pdf_v = 0, 0 - cmrx, cmry = 1.0, 1.0 - -- cmsx, cmsy = 0.0, 0.0 - cmtx, cmty = 0.0, 0.0 - tmrx, tmry = 1.0, 1.0 - tmsx, tmsy = 0.0, 0.0 - tmtx, tmty = 0.0, 0.0 - tmef = 1.0 - need_tm = false - need_tf = false - need_font = true - need_width = 0 - need_mode = 0 - done_width = false - done_mode = false - mode = "page" - shippingmode = specification.shippingmode - objectnumber = specification.objectnumber - cur_tmrx = 0.0 - f_cur = 0 - f_pdf_cur = 0 -- nullfont - f_pdf = 0 -- nullfont - fs_cur = 0 - fs = 0 - f_x_scale = 1.0 - f_y_scale = 1.0 - cur_factor = 0 - tj_delta = 0.0 - cw = 0.0 - c_effect = nil - usedfonts = setmetatableindex(usefont) - usedxforms = { } - usedximages = { } - -- usedxgroups = { } - boundingbox = specification.boundingbox + pdf_h, pdf_v = 0, 0 + cmrx, cmry = 1.0, 1.0 + -- cmsx, cmsy = 0.0, 0.0 + cmtx, cmty = 0.0, 0.0 + tmrx, tmry = 1.0, 1.0 + -- tmsx, tmsy = 0.0, 0.0 + tmsy = 0.0 -- sy makes no sense + tmtx, tmty = 0.0, 0.0 + tmef = 1.0 + need_tm = false + need_tf = false + need_font = true + need_width = 0 + need_mode = 0 + done_width = false + done_mode = false + mode = "page" + shippingmode = specification.shippingmode + objectnumber = specification.objectnumber + -- cur_tmrx = 0.0 + -- f_pdf_cur = 0 -- nullfont + tj_scale = 1 + tj_delta = 0.0 + tj_position = 0.0 + current_font = 0 + current_pdf = 0 -- nullfont + current_effect = nil + current_slant = 0 + current_weight = 0 + current_factor = 0 + current_sx = 1 + current_sy = 1 + f_x_scale = 1.0 + f_y_scale = 1.0 + tmef_f_x_scale = 1 + tmef_f_w_scale = 1 + usedfonts = setmetatableindex(usefont) + usedxforms = { } + usedximages = { } + -- usedxgroups = { } + boundingbox = specification.boundingbox end -- buffer @@ -191,6 +217,49 @@ end -- fonts +-- The text in a PDF file ends up in the page stream. Right from the start PDF files +-- were supposed to be efficient but over time that concept was messed up by for +-- instance mixed in tagging. One can argue if that was a good idea: just embed the +-- source and use that as for special purposes instead of trying to turn something +-- visual into something structure. We have these angle bracket formats for that +-- already. Anyway, here we assume an uninterupted stream. +-- +-- A sequence of characters in the same font and with the same scale (and other +-- rendering properties). When we started with the backend in Lua I just followed +-- the same approach as in LuaTeX (which was modelled after pdfTeX) but at some +-- point a (stepwise) transition took place. For instance, we always use a 10bp font +-- size (instead of the scale in the document) and delegate all scaling to the font +-- transform matrix. Because the text stream uses a different coordinate system +-- (font units combined with 1000 based kerning) we need to keep track of where we +-- are and when we drift too much we need to restart. In the engines this is +-- complicated by integer math so there drift really plays a role, but in our case +-- we can now approach it a bit different, although we don't really know the +-- acceptable thresholds. This code evolved over time, also because we introduced +-- additional scaling options. +-- +-- So, in the backend we have to deal with this: +-- +-- - positioning in target space (page) +-- - positioning in the stream (text) +-- - glyph scale (!), glyph xscale (!), glyph yscale +-- - font scale (!) +-- - horizontal extend (!) +-- - vertical squeeze +-- - slant +-- - expansion factor (!) +-- - font effects (mode and width/line) +-- - temporary glyph effects (extend, squeeze, slant, mode, width/line) +-- - drift (synchronization and check for threshold) +-- +-- This means that we have to check if one of these properties has changed and the +-- horizontal scale is the most demanding one. We also need to mix the check for +-- font specific changes and glyph specific effects. For now we assume that slanted +-- font is just a copy but in the future we could just make it a glyph property like +-- scale, xscale and yscale. An even more advanced approach is to integrate +-- boldening but then we also need 4 offsets and runtime calculation, while it might +-- also complicate e.g. extensibles in math. There is much more overhead so it will +-- also impact performance. + local fontcharacters ----- fontdescriptions local fontparameters @@ -199,7 +268,7 @@ local pdfcharacters local getstreamhash = fonts.handlers.otf.getstreamhash -local usedfontstreams = { } +local usedfontstreams = utilities.storage.allocate() local usedindices = setmetatableindex(function(t,k) local n = 0 @@ -239,10 +308,10 @@ lpdf.usedindices = usedindices -- [streamhash][index] -> realindex (can local horizontalmode = true local scalefactor = 1 local threshold = 655360 ------ thresfactor = 100 local tjfactor = 100 / 65536 function flushers.updatefontstate(font) + -- virtual t3 fonts have negative font index fontcharacters = characters[font] -- fontdescriptions = descriptions[font] fontparameters = parameters[font] @@ -252,25 +321,19 @@ function flushers.updatefontstate(font) pdfcharacters = usedcharacters[font] horizontalmode = fontparameters.writingmode ~= "vertical" scalefactor = (designsize/size) * tjfactor - -- - local fthreshold = fontproperties.threshold - threshold = (fthreshold and (size * fthreshold / 100)) or 655360 - -- when we bolden the threshold should be smaller .. a hack .. i need to redo all this - if (fontparameters.extendfactor or 1) == 1 then - -- we're probably okay - elseif fontparameters.hshift or fontparameters.vshift then - -- we could be okay - else - -- some vf magic going on - threshold = threshold / 5 - end end --- helpers (maybe in collapse mode we have to go %.9N) - local f_cm = formatters["%.6N %.6N %.6N %.6N %.6N %.6N cm"] local f_cz = formatters["%.6N 0 0 %.6N %.6N %.6N cm"] -local f_tm = formatters["%.6N %.6N %.6N %.6N %.6N %.6N Tm"] +----- f_tm = formatters["%.6N %.6N %.6N %.6N %.6N %.6N Tm"] +local f_tm = formatters["%.6N 0 %.6N %.6N %.6N %.6N Tm"] + +directives.register("backend.pdf.accurate", function() + f_cm = formatters["%.9N %.9N %.9N %.9N %.9N %.9N cm"] + f_cz = formatters["%.9N 0 0 %.9N %.9N %.9N cm"] + -- f_tm = formatters["%.9N %.9N %.9N %.9N %.9N %.9N Tm"] + f_tm = formatters["%.9N 0 %.9N %.9N %.9N %.9N Tm"] +end) local saved_text_pos_v = 0 local saved_text_pos_h = 0 @@ -279,12 +342,14 @@ local function begin_text() saved_text_pos_h = pdf_h saved_text_pos_v = pdf_v b = b + 1 ; buffer[b] = "BT" - need_tf = true - need_font = true - need_width = 0 - need_mode = 0 - c_effect = nil - mode = "text" + need_tf = true + need_font = true + need_width = 0 + need_mode = 0 + current_effect = nil + current_slant = 0 + current_weight = 0 + mode = "text" end local function end_text() @@ -312,7 +377,7 @@ local begin_chararray, end_chararray do begin_chararray = function() saved_chararray_pos_h = pdf_h saved_chararray_pos_v = pdf_v - cw = horizontalmode and saved_chararray_pos_h or - saved_chararray_pos_v + tj_position = horizontalmode and saved_chararray_pos_h or - saved_chararray_pos_v tj_delta = 0 saved_b = b b = b + 1 ; buffer[b] = " [" @@ -352,11 +417,11 @@ local function calc_pdfpos(h,v) return h ~= pdf_h or v ~= pdf_v elseif horizontalmode then tmty = v - saved_text_pos_v - tj_delta = cw - h + tj_delta = tj_position - h return tj_delta ~= 0 or v ~= pdf_v else tmtx = h - saved_text_pos_h - tj_delta = cw + v + tj_delta = tj_position + v return tj_delta ~= 0 or h ~= pdf_h end end @@ -386,13 +451,13 @@ local function pdf_reset_pos() end elseif horizontalmode then tmty = - saved_text_pos_v - tj_delta = cw + tj_delta = tj_position if tj_delta == 0 and pdf_v == 0 then return end else tmtx = - saved_text_pos_h - tj_delta = cw + tj_delta = tj_position if tj_delta == 0 and pdf_h == 0 then return end @@ -480,6 +545,24 @@ do local hshift = false local vshift = false + local dupx = 100 / bpfactor -- 6578176.0 + local dumx = - dupx + local dupy = dupx + local dumy = dumx + + directives.register("backend.pdf.drift", function(v) + dupx = tonumber(v) or 100 + if dupx < 10 then + dupx = 10 + elseif dupx > 100 then + dupx = 100 + end + dupx = dupx / bpfactor + end) + + local h_hex_2 = lpdf.h_hex_2 + local h_hex_4 = lpdf.h_hex_4 + -- The width array uses the original dimensions! This is different from e.g. -- luatex where we have more widths arrays and these reflect the cheated -- widths (goes wrong elsewhere). @@ -494,11 +577,6 @@ do local w local e = c and c[char] if e then --- w = e.width or 0 --- local a = e.advance --- if a then --- w = a --- end local a = e.advance if a then w = a @@ -525,78 +603,93 @@ do return v end) - -- it's about time to get rid of the pdftex based model but i'll wait with that till after - -- the first release so that we have some test period ... when we go compact even less - -- the descriptions are used for the width array - local collapse = true + local extend = 1 -- some more can move here + local squeeze = 1 + local tohex = h_hex_4 - experiments.register("backend.pdf.collapsefonts",function(v) - collapse = v - end) + local function setup_fontparameters(font,factor,sx,sy,slant,weight,effect) + -- + current_sx = sx + current_sy = sy + -- + if fontproperties.bitmapped then + tohex = h_hex_2 + elseif font < 0 then + tohex = h_hex_2 + else + tohex = h_hex_4 + end - local function setup_fontparameters(font,factor,sx,sy,effect) local format = fontproperties.format local expand = 1 + factor / 1000000 - tmef = expand - - -- local slant = fontparameters.slantfactor or 0 - -- local squeeze = fontparameters.squeezefactor or 1 - -- local extend = fontparameters.extendfactor or 1 - -- tmrx = extend * expand - -- tmry = squeeze - -- tmsy = slant - -- need_width = fontparameters.width or 0 - -- need_mode = fontparameters.mode or 0 - if effect then - if effect ~= c_effect then - tmsy = effect.slant or fontparameters.slantfactor or 0 - tmry = effect.squeeze or fontparameters.squeezefactor or 1 - tmrx = effect.extend or fontparameters.extendfactor or 1 - need_mode = effect.mode or fontparameters.mode or 0 - need_width = effect.line or fontparameters.width or 0 -- scale sensitive! - c_effect = effect + -- We have glyph specific effects and these have a higher priority than + -- the font specific effects. + if effect ~= current_effect then + current_effect = effect + tmrx = 1 + tmry = 1 + tmsy = effect.slant or fontparameters.slantfactor or slant or 0 + extend = effect.extend or fontparameters.extendfactor or 1 + squeeze = effect.squeeze or fontparameters.squeezefactor or 1 + need_mode = effect.mode or fontparameters.mode or 0 + need_width = effect.weight or fontparameters.weight or 0 + sx = extend * sx + sy = squeeze * sy else -- we could check if effects have changed but effects use unique tables; for -- now they win over font effects (only used in math) end else - tmsy = fontparameters.slantfactor or 0 - tmry = fontparameters.squeezefactor or 1 - tmrx = fontparameters.extendfactor or 1 - need_mode = fontparameters.mode or 0 - need_width = fontparameters.width or 0 - c_effect = nil + -- These are the font specific effects and the scales are part of the main + -- font setup, so we use the factors and not the properties.effect data. + current_effect = nil + tmrx = 1 + tmry = 1 + -- + local e = fontproperties.effect + if e then + tmsy = e.slant or slant or 0 + extend = e.extend or 1 + squeeze = e.squeeze or 1 + need_mode = e.mode or 0 + need_width = e.weight or 0 + sx = extend * sx + sy = squeeze * sy + else + tmsy = slant or 0 + extend = 1 + squeeze = 1 + need_mode = 0 + need_width = weight + end end - tmrx = expand * tmrx + tmef = expand + tmrx = expand * tmrx - f_cur = font - f_pdf = usedfonts[font] -- cache - cur_factor = factor - tj_delta = 0 - cw = 0 - -- - fs = fontparameters.size * bpfactor - if collapse then - local sc = fs / 10 - -- kind of special: - if format == "opentype" or format == "type1" then - sc = sc * 1000 / fontparameters.units -- can we avoid this ? - end - -- - fs = 10 - -- - tmrx = tmrx * sc - tmry = tmry * sc + current_font = font + current_pdf = usedfonts[font] -- cache + current_factor = factor + current_slant = tmsy + current_weight = weight + + local sc = fontparameters.size * bpfactor / 10 + -- kind of special: + if format == "opentype" or format == "type1" then + sc = sc * 1000 / fontparameters.units + tj_scale = fontparameters.units / 1000 else - -- kind of special: - if format == "opentype" or format == "type1" then - fs = fs * 1000 / fontparameters.units -- can we avoid this ? - end + tj_scale = 1 end + tj_delta = 0 + tj_position = 0 + -- + tmsy = tmsy * sc + tmrx = tmrx * sc + tmry = tmry * sc -- f_x_scale = sx if f_x_scale ~= 1.0 then @@ -604,26 +697,52 @@ do end f_y_scale = sy if f_y_scale ~= 1.0 then + tmsy = tmsy * f_y_scale tmry = tmry * f_y_scale end -- + tmef_f_x_scale = tmef * f_x_scale + -- + if tmef_f_x_scale == 1.0 then + tmef_f_x_scale = 1 + end + -- + tj_scale = tj_scale * scalefactor / tmef_f_x_scale + -- + tmef_f_w_scale = tmef_f_x_scale / extend + -- characterwidth = characterwidths[font] -- descriptionwidth = descriptionwidths[font] -- hshift = fontparameters.hshift vshift = fontparameters.vshift + + if need_width > 0 then + if not need_mode or need_mode == 0 then + need_mode = 2 + end + need_width = need_width * 2 +need_width = need_width * tmrx +-- if hshift then +-- hshift = hshift * tmrx +-- end + end + + if current_weight > 0 then +-- hshift = (hshift or 0) + current_weight + end + end local f_width = formatters["%.6N w"] local f_mode = formatters["%i Tr"] -- can be hash - local f_font = formatters["/F%i %.6N Tf"] -- can be hash + local f_font = formatters["/F%i 10 Tf"] local s_width = "0 w" local s_mode = "0 Tr" - local width_factor = 72.27 / 72000.0 + local width_factor = 72.27 / 72.0 - local last_fs local last_fpdf local function set_font() @@ -644,53 +763,28 @@ do done_mode = false end -- no need when the same - if need_font or last_fs ~= fs or last_pdf ~= f_pdf then - b = b + 1 ; buffer[b] = f_font(f_pdf,fs) - last_fs = fs - last_pdf = f_pdf + if need_font or last_pdf ~= current_pdf then + b = b + 1 ; buffer[b] = f_font(current_pdf) + last_pdf = current_pdf need_font = false end - f_pdf_cur = f_pdf - fs_cur = fs - need_tf = false - need_tm = true + -- f_pdf_cur = current_pdf + need_tf = false + need_tm = true end local function set_textmatrix(h,v) local move = calc_pdfpos(h,v) if need_tm or move then - b = b + 1 ; buffer[b] = f_tm(tmrx, tmsx, tmsy, tmry, tmtx*bpfactor, tmty*bpfactor) + -- b = b + 1 ; buffer[b] = f_tm(tmrx, tmsx, tmsy, tmry, tmtx*bpfactor, tmty*bpfactor) + b = b + 1 ; buffer[b] = f_tm(tmrx, tmsy, tmry, tmtx*bpfactor, tmty*bpfactor) pdf_h = saved_text_pos_h + tmtx pdf_v = saved_text_pos_v + tmty need_tm = false end - cur_tmrx = tmrx + -- cur_tmrx = tmrx end - local f_hex_4 = formatters["%04X"] - local f_hex_2 = formatters["%02X"] - - local h_hex_4 = setmetatableindex(function(t,k) -- we already have this somewhere - if k < 256 then -- maybe 512 - -- not sparse in this range - for i=0,255 do - t[i] = f_hex_4(i) - end - return t[k] - else - local v = f_hex_4(k) - t[k] = v - return v - end - end) - local h_hex_2 = setmetatableindex(function(t,k) -- we already have this somewhere - local v = k < 256 and f_hex_2(k) or "00" - t[k] = v - return v - end) - - local trace_threshold = false trackers.register("backends.pdf.threshold", function(v) trace_threshold = v end) - ----- f_skip = formatters["%.2N"] -- I will redo this mess ... we no longer have the mkiv pdf generator that we used in @@ -699,11 +793,13 @@ do -- factor is for hz - flushers.character = function(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy) -- ,naturalwidth,width) + flushers.character = function(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,slant,weight) -- ,naturalwidth,width) local s = data.scale local x = data.xoffset local y = data.yoffset + local effect = data.effect + if s then sx = s * sx sy = s * sy @@ -716,27 +812,32 @@ do sy = sy * csy csy = 1 end - - local effect = data.effect - - -- if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur then - if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur + if sx ~= current_sx -- was: f_x_scale + or sy ~= current_sy -- was: f_x_scale + or need_tf + or font ~= current_font + -- or current_pdf ~= f_pdf_cur or mode == "page" - or effect ~= c_effect + or slant ~= current_slant + or weight ~= current_weight + or effect ~= current_effect then pdf_goto_textmode() - setup_fontparameters(font,factor,sx,sy,effect) -- too often due to page + setup_fontparameters(font,factor,sx,sy,slant,weight,effect) -- too often due to page set_font() -- elseif mode == "page" then -- pdf_goto_textmode() -- set_font() - elseif cur_tmrx ~= tmrx or cur_factor ~= factor then - setup_fontparameters(font,factor,sx,sy,effect) + elseif current_factor ~= factor + -- or cur_tmrx ~= tmrx + then + -- check if this happens and when + setup_fontparameters(font,factor,sx,sy,slant,weight,effect) need_tm = true end if x then - pos_h = pos_h + x * tmef * f_x_scale + pos_h = pos_h + x * tmef_f_x_scale end if y then pos_v = pos_v + y * f_y_scale @@ -744,30 +845,22 @@ do local move = calc_pdfpos(pos_h,pos_v) - if trace_threshold then - report_fonts( - "before: font %i, char %C, factor %i, naturalwidth %p, move %l, tm %l, hpos %p, delta %p, threshold %p, cw %p", - font,char,factor,characterwidth[char],move,need_tm,pos_h,tj_delta,threshold,cw - ) - end - if move or need_tm then if not need_tm then if horizontalmode then if (saved_text_pos_v + tmty) ~= pdf_v then need_tm = true - elseif tj_delta >= threshold or tj_delta <= -threshold then + elseif tj_delta >= dupx or tj_delta <= dumx then need_tm = true end else if (saved_text_pos_h + tmtx) ~= pdf_h then need_tm = true - elseif tj_delta >= threshold or tj_delta <= -threshold then + elseif tj_delta >= dupy or tj_delta <= dumy then need_tm = true end end end - if hshift then pos_h = pos_h + hshift end if vshift then pos_v = pos_v - vshift end if need_tm then @@ -777,40 +870,78 @@ do move = calc_pdfpos(pos_h,pos_v) end if move then - local d = tj_delta * scalefactor / (tmef * f_x_scale) + local d = tj_delta * tj_scale if d <= -0.5 or d >= 0.5 then if mode == "char" then end_charmode() end b = b + 1 ; buffer[b] = round(d) -- or f_skip(d) +-- print(d,buffer[b]) end - cw = cw - tj_delta + tj_position = tj_position - tj_delta + -- tj_position = tj_position - tj_delta * tmef_f_x_scale end end - if trace_threshold then - report_fonts( - "after : font %i, char %C, factor %i, naturalwidth %p, move %l, tm %l, hpos %p, delta %p, threshold %p, cw %p", - font,char,factor,characterwidth[char],move,need_tm,pos_h,tj_delta,threshold,cw - ) - end - if mode == "chararray" then begin_charmode() end - cw = cw + characterwidth[char] * tmef * f_x_scale + -- When we have say 100 x without spaces we do accumulate some error but in practice + -- we have spaces so we sync. This is the same as in pdftex and luatex. + + tj_position = tj_position + characterwidth[char] * tmef_f_w_scale local slot = pdfcharacters[data.index or char] -- registers usage - b = b + 1 ; buffer[b] = font > 0 and h_hex_4[slot] or h_hex_2[slot] +-- b = b + 1 ; buffer[b] = font > 0 and h_hex_4[slot] or h_hex_2[slot] + b = b + 1 ; buffer[b] = tohex[slot] + + end + + do + + -- We like a little bit of optimization, just for the fun of it. + + local spaces = setmetatableindex(function(t,font) + local bytes = false + local data = characters[font] + if data then + data = data[32] + if data then + local index = data.index + if index then + local dummy = usedfonts[font] + local slot = usedcharacters[font][index] + if slot then +-- bytes = font > 0 and h_hex_4[slot] or h_hex_2[slot] + bytes = tohex[slot] + end + end + end + end + t[font] = bytes + return bytes + end) + + -- We have to be in the current font stream. + + flushers.space = function(font) + if mode == "char" and font == current_font then + local slot = spaces[font] + if slot then + tj_position = tj_position + characterwidth[32] * tmef_f_w_scale + b = b + 1 ; buffer[b] = slot + end + end + end end flushers.fontchar = function(font,char,data) local dummy = usedfonts[font] local slot = pdfcharacters[data.index or char] -- registers usage - return dummy + return dummy, slot end end @@ -822,12 +953,12 @@ local flushliteral do local nodeproperties = nodes.properties.data local literalvalues = nodes.literalvalues - local originliteral_code = literalvalues.origin - local pageliteral_code = literalvalues.page - local alwaysliteral_code = literalvalues.always - local rawliteral_code = literalvalues.raw - local textliteral_code = literalvalues.text - local fontliteral_code = literalvalues.font + local originliteral_code = literalvalues.origin + local pageliteral_code = literalvalues.page + local alwaysliteral_code = literalvalues.always + local rawliteral_code = literalvalues.raw + local textliteral_code = literalvalues.text + local fontliteral_code = literalvalues.font flushliteral = function(current,pos_h,pos_v) local p = nodeproperties[current] @@ -1099,6 +1230,9 @@ local localconverter = nil -- will be set local flushimage do + local tonut = nodes.tonut + local tonode = nuts.tonode + local pdfbackend = backends.registered.pdf local nodeinjections = pdfbackend.nodeinjections local codeinjections = pdfbackend.codeinjections @@ -1109,23 +1243,27 @@ local flushimage do local setprop = nuts.setprop local getprop = nuts.getprop local setattrlist = nuts.setattrlist + local getoptions = nuts.getoptions local getwhd = nuts.getwhd local flushlist = nuts.flushlist local getdata = nuts.getdata local rulecodes = nodes.rulecodes - local normalrule_code = rulecodes.normal - local boxrule_code = rulecodes.box - local imagerule_code = rulecodes.image - local emptyrule_code = rulecodes.empty - local userrule_code = rulecodes.user - local overrule_code = rulecodes.over - local underrule_code = rulecodes.under - local fractionrule_code = rulecodes.fraction - local radicalrule_code = rulecodes.radical - local outlinerule_code = rulecodes.outline - ----- virtualrule_code = rulecodes.virtual + local normalrule_code = rulecodes.normal + local boxrule_code = rulecodes.box + local imagerule_code = rulecodes.image + local emptyrule_code = rulecodes.empty + local userrule_code = rulecodes.user + local overrule_code = rulecodes.over + local underrule_code = rulecodes.under + local fractionrule_code = rulecodes.fraction + local radicalrule_code = rulecodes.radical + local outlinerule_code = rulecodes.outline + ----- virtualrule_code = rulecodes.virtual + + local vertical_rule = tex.ruleoptioncodes.vertical + local horizontal_rule = tex.ruleoptioncodes.horizontal local processrule = nodes.rules.process @@ -1136,16 +1274,22 @@ local flushimage do local s_b = "q" local s_e = "Q" - local f_v = formatters["[] 0 d 0 J %.6N w 0 0 m %.6N 0 l S"] - local f_h = formatters["[] 0 d 0 J %.6N w 0 0 m 0 %.6N l S"] + local f_v = formatters["[] 0 d 0 J %.6N w 0 0 m %.6N 0 l S"] + local f_h = formatters["[] 0 d 0 J %.6N w 0 0 m 0 %.6N l S"] - local f_f = formatters["0 0 %.6N %.6N re f"] - local f_o = formatters["[] 0 d 0 J 0 0 %.6N %.6N re S"] - local f_w = formatters["[] 0 d 0 J %.6N w 0 0 %.6N %.6N re S"] + local f_f = formatters["0 0 %.6N %.6N re f"] + local f_o = formatters["[] 0 d 0 J 0 0 %.6N %.6N re S"] + local f_w = formatters["[] 0 d 0 J %.6N w 0 0 %.6N %.6N re S"] - local f_b = formatters["%.6N w 0 %.6N %.6N %.6N re f"] - local f_x = formatters["[] 0 d 0 J %.6N w %.6N %.6N %.6N %.6N re S"] - local f_y = formatters["[] 0 d 0 J %.6N w %.6N %.6N %.6N %.6N re S %.6N 0 m %.6N 0 l S"] + local f_b = formatters["%.6N w 0 %.6N %.6N %.6N re f"] + local f_x = formatters["[] 0 d 0 J %.6N w %.6N %.6N %.6N %.6N re S"] + local f_y = formatters["[] 0 d 0 J %.6N w %.6N %.6N %.6N %.6N re S %.6N 0 m %.6N 0 l S"] + + local f_v_d = formatters["[%.6N %.6N] 0 d 0 J %.6N w 0 0 m %.6N 0 l S"] + local f_h_d = formatters["[%.6N %.6N] 0 d 0 J %.6N w 0 0 m 0 %.6N l S"] + + local f_d_h = formatters["[%.6N %.6N] 0 d 0 J %.6N w 0 %.6N m %.6N %.6N l S"] + local f_d_v = formatters["[%.6N %.6N] 0 d 0 J %.6N w %.6N 0 m %.6N %.6N l S"] -- Historically the index is an object which is kind of bad. @@ -1483,7 +1627,21 @@ local flushimage do -- never because the next are like the other engines and compensate for -- small sizes which is needed for inaccurate viewers. - flushers.rule = function(current,pos_h,pos_v,pos_r,size_h,size_v,subtype) + local function onoff(on,off,dim) + on = on * bpfactor + off = off * bpfactor + if on + off > dim then + return dim, 0 + else + local n = ((dim -on) // (on + off)) + 1 + if n > 1 then + off = (dim - n * on)/(n - 1) + end + return on, off + end + end + + flushers.rule = function(current,pos_h,pos_v,pos_r,size_h,size_v,subtype,on,off,running) if subtype == emptyrule_code then return elseif subtype == boxrule_code then @@ -1518,6 +1676,26 @@ local flushimage do else rule = f_o(dim_h,dim_v) end + elseif on ~= 0 and off ~= 0 then -- and subtype ~= strutrule_code + local options = getoptions(current) + local horizontal = (options & horizontal_rule) == 1 + local vertical = (options & vertical_rule ) == 1 + if not horizontal and not vertical then + horizontal = true -- and no check for running, see autorule in tabulate + elseif not running then + horizontal = not horizontal + end + if horizontal then + local offset = dim_v/2 + on, off = onoff(on,off,dim_h) + pdf_set_pos_temp(pos_h,pos_v) + rule = f_d_h(on,off,dim_v,offset,dim_h,offset) + else + local offset = dim_h/2 + on, off = onoff(on,off,dim_v) + pdf_set_pos_temp(pos_h,pos_v) + rule = f_d_v(on,off,dim_h,offset,offset,dim_v) + end elseif dim_v <= one_bp then pdf_set_pos_temp(pos_h,pos_v + 0.5 * size_v) rule = f_v(dim_v,dim_h) @@ -2097,7 +2275,7 @@ do local oldsize = 0 local newsize = 0 - directives.register("pdf.compact", function(v) + directives.register("backend.pdf.compact", function(v) compact = v and function(s) oldsize = oldsize + #s s = lpegmatch(pattern,s) or s @@ -2170,7 +2348,6 @@ local finalize do if next(usedfonts) then fonts = pdfdictionary { } for k, v in next, usedfonts do --- fonts[f_font(v)] = pdfreference(pdfgetfontobjectnumber(k)) -- we can overload for testing fonts[f_font(v)] = pdfreference(usedfontobjects[k]) -- we can overload for testing end end @@ -2214,10 +2391,10 @@ local finalize do boundingbox[4] * bpfactor, } - local contentsobj = pdfflushstreamobject(content,false,true) + local contentsobj = content ~= "" and pdfflushstreamobject(content,false,true) or false -- empty /Contents are forbidden pageattributes.Type = pdf_page - pageattributes.Contents = pdfreference(contentsobj) + pageattributes.Contents = contentsobj and pdfreference(contentsobj) or nil pageattributes.Resources = pageresources -- pageattributes.Resources = pdfreference(pdfflushobject(pageresources)) -- pageattributes.MediaBox = bbox @@ -2227,25 +2404,25 @@ local finalize do -- resources can be indirect -if state == "ignore" or state == false then + if state == "ignore" or state == false then -else + else - registerpage(pageattributes) + registerpage(pageattributes) - lpdf.finalizepage(true) + lpdf.finalizepage(true) - local TrimBox = pageattributes.TrimBox - local CropBox = pageattributes.CropBox - local BleedBox = pageattributes.BleedBox + local TrimBox = pageattributes.TrimBox + local CropBox = pageattributes.CropBox + local BleedBox = pageattributes.BleedBox - -- Indirect objects don't work in all viewers. + -- Indirect objects don't work in all viewers. - if TrimBox then pageattributes.TrimBox = pdfsharedobject(checkedbox(bbox,TrimBox,"TrimBox")) end - if CropBox then pageattributes.CropBox = pdfsharedobject(checkedbox(bbox,CropBox,"CropBox")) end - if BleedBox then pageattributes.BleedBox = pdfsharedobject(checkedbox(bbox,BleedBox,"BleedBox")) end + if TrimBox then pageattributes.TrimBox = pdfsharedobject(checkedbox(bbox,TrimBox,"TrimBox")) end + if CropBox then pageattributes.CropBox = pdfsharedobject(checkedbox(bbox,CropBox,"CropBox")) end + if BleedBox then pageattributes.BleedBox = pdfsharedobject(checkedbox(bbox,BleedBox,"BleedBox")) end -end + end else @@ -2350,7 +2527,6 @@ local nofobjects = 0 local offset = 0 local f = false local flush = false -local threshold = 40 -- also #("/Filter /FlateDecode") (compression threshold) local objectstream = true local compress = true local cache = false @@ -2358,14 +2534,6 @@ local info = "" local catalog = "" local lastdeferred = false -directives.register("backend.pdf.threshold",function(v) - if v then - threshold = tonumber(v) or 40 - else - threshold = -1000 - end -end) - local f_object = formatters["%i 0 obj\010%s\010endobj\010"] local f_stream_n_u = formatters["%i 0 obj\010<< /Length %i >>\010stream\010%s\010endstream\010endobj\010"] local f_stream_n_c = formatters["%i 0 obj\010<< /Filter /FlateDecode /Length %i >>\010stream\010%s\010endstream\010endobj\010"] @@ -2521,7 +2689,8 @@ do local nofpages = 0 local texgetcount = tex.getcount - local c_realpageno = tex.iscount("realpageno") + + local c_realpageno = tex.iscount("realpageno") pdfreserveobject = function(name) nofobjects = nofobjects + 1 @@ -2719,103 +2888,140 @@ local function flushnormalobj(data,n) return n end -local function flushstreamobj(data,n,dict,comp,nolength) - if not data then - report("no data for %S",dict) - return - end - if not n then - nofobjects = nofobjects + 1 - n = nofobjects - end - local size = #data - if comp ~= false then - comp = compress and size > threshold - end - if encryptobject then - dict = encryptobject(dict) +local flushstreamobj, streamstatus do + + local uncompressed = 0 + local compressed = 0 + local notcompressed = 0 + + local threshold = 40 -- also #("/Filter /FlateDecode") (compression threshold) + + -- directives.register("backend.pdf.threshold",function(v) + -- if v then + -- threshold = tonumber(v) or 40 + -- else + -- threshold = -1000 + -- end + -- end) + + streamstatus = function() + return { + nofstreams = uncompressed + compressed + notcompressed, + uncompressed = uncompressed, + compressed = compressed, + notcompressed = notcompressed, + threshold = threshold, + compresslevel = lpdf.compresslevel(), + objectcompresslevel = lpdf.objectcompresslevel(), + + } end - if level == 0 then - local b = nil - local e = s_stream_e - if nolength then - -- probleem: we need to adapt length! - b = f_stream_b_d_r(n,dict) -- raw object, already treated - if encryptstream then - print("check length") - data = encryptstream(data) - size = #data - end - else - if comp then - local compdata = compressdata(data,size) - if compdata then - local compsize = #compdata - if compsize <= size - threshold then - data = compdata - size = compsize + + flushstreamobj = function(data,n,dict,comp,nolength) + if not data then + report("no data for %S",dict) + return + end + if not n then + nofobjects = nofobjects + 1 + n = nofobjects + end + local size = #data + if comp ~= false then + comp = compress and size > threshold + end + if encryptobject then + dict = encryptobject(dict) + end + if level == 0 then + local b = nil + local e = s_stream_e + if nolength then + -- probleem: we need to adapt length! + b = f_stream_b_d_r(n,dict) -- raw object, already treated + if encryptstream then + print("check length") + data = encryptstream(data) + size = #data + end + uncompressed = uncompressed + 1 + else + if comp then + local compdata = compressdata(data,size) + if compdata then + local compsize = #compdata + if compsize <= size - threshold then + data = compdata + size = compsize + else + comp = false + end else comp = false end + end + if encryptstream then + data = encryptstream(data) + size = #data + end + if comp then + b = dict and f_stream_b_d_c(n,dict,size) or f_stream_b_n_c(n,size) + compressed = compressed + 1 else - comp = false + b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size) + notcompressed = notcompressed + 1 end end - if encryptstream then - data = encryptstream(data) - size = #data - end - if comp then - b = dict and f_stream_b_d_c(n,dict,size) or f_stream_b_n_c(n,size) - else - b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size) - end - end - flush(f,b) - flush(f,data) - flush(f,e) - objects[n] = offset - offset = offset + #b + size + #e - else - if nolength then - if encryptstream then - print("check length") - data = encryptstream(data) - end - data = f_stream_d_r(n,dict,data) -- raw object, already treated + flush(f,b) + flush(f,data) + flush(f,e) + objects[n] = offset + offset = offset + #b + size + #e else - if comp then - local compdata = compressdata(data,size) - if compdata then - local compsize = #compdata - if compsize <= size - threshold then - data = compdata - size = compsize + if nolength then + if encryptstream then + print("check length") + data = encryptstream(data) + end + data = f_stream_d_r(n,dict,data) -- raw object, already treated + uncompressed = uncompressed + 1 + else + if comp then + local compdata = compressdata(data,size) + if compdata then + local compsize = #compdata + if compsize <= size - threshold then + data = compdata + size = compsize + else + comp = false + end else comp = false end + end + if encryptstream then + data = encryptstream(data) + size = #data + end + if comp then + data = dict and f_stream_d_c(n,dict,size,data) or f_stream_n_c(n,size,data) + compressed = compressed + 1 else - comp = false + data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data) + notcompressed = notcompressed + 1 end end - if encryptstream then - data = encryptstream(data) - size = #data - end - if comp then - data = dict and f_stream_d_c(n,dict,size,data) or f_stream_n_c(n,size,data) - else - data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data) + if not lastdeferred then + lastdeferred = n + elseif n < lastdeferred then + lastdeferred = n end + objects[n] = data end - if not lastdeferred then - lastdeferred = n - elseif n < lastdeferred then - lastdeferred = n - end - objects[n] = data + return n end - return n + end flushdeferred = function() -- was forward defined @@ -2933,6 +3139,8 @@ local openfile, closefile do local inmemory = false local close = false local update = false + local usedname = false + local usedsize = false directives.enable("backend.pdf.inmemory", function(v) inmemory = true end) @@ -2959,6 +3167,7 @@ local openfile, closefile do end close = function(f) f = concat(f) + usedsize = #f io.savedata(filename,f) f = false end @@ -2997,6 +3206,7 @@ local openfile, closefile do flush(f,version) flush(f,banner) offset = offset + #version + #banner + usedname = filename end closefile = function(abort) @@ -3032,11 +3242,13 @@ local openfile, closefile do -- local info = lpdf.getinfo() local trailerid = lpdf.gettrailerid() - + -- if objectstream then flushdeferred() flushcache() -- + offset = lpdf.preparesignature and lpdf.preparesignature(flush,f,offset,objects) or offset + -- xrefoffset = offset -- nofobjects = nofobjects + 1 @@ -3200,6 +3412,8 @@ local openfile, closefile do else flushdeferred() -- + offset = lpdf.preparesignature and lpdf.preparesignature(flush,f,offset,objects) or offset + -- -- if encryptstream then -- -- unencrypted ! -- local eo = encryptobject @@ -3238,8 +3452,11 @@ local openfile, closefile do flush(f,f_trailer_no(trailer(),xrefoffset)) end end - update(f,f_pdf_tag(majorversion,minorversion)) + update(f,f_pdf_tag(majorversion,minorversion)) -- check this + usedsize = f:seek("end") close(f) + io.flush() + if lpdf.finalizesignature then lpdf.finalizesignature(usedname,usedsize) end end io.flush() closefile = function() end @@ -3263,6 +3480,7 @@ do local imagetypes = images.types -- pdf png jpg jp2 jbig2 stream local img_none = imagetypes.none + local tonode = nuts.tonode local newimagerule = nuts.pool.imagerule local setattrlist = nuts.setattrlist local setprop = nuts.setprop @@ -3450,9 +3668,20 @@ do lpdf.registerdocumentfinalizer(wrapupdocument,nil,"wrapping up") -- statistics.register("result saved in file", function() + local status = streamstatus() local outputfilename = environment.outputfilename or environment.jobname or tex.jobname or "" outputfilename = string.gsub(outputfilename,"^%./+","") -- todo: make/use a helper - return string.format("%s.%s, compresslevel %s, objectcompresslevel %s",outputfilename,"pdf",lpdf.getcompression()) + return string.format( + "%s.pdf, compresslevel %s, objectcompresslevel %s, %i streams, %i uncompressed, %i compressed, %i not compressed, threshold %i", + outputfilename, + status.compresslevel, + status.objectcompresslevel, + status.nofstreams or 0, + status.uncompressed or 0, + status.compressed or 0, + status.notcompressed or 0, + status.threshold or 0 + ) end) -- luatex.registerstopactions(function() diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt index 577dbed5a96..0f21cf9a35f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt @@ -59,26 +59,26 @@ local texset = tex.set local variables = interfaces.variables -local v_stop = variables.stop -local v_none = variables.none -local v_max = variables.max -local v_bookmark = variables.bookmark -local v_fit = variables.fit -local v_doublesided = variables.doublesided -local v_singlesided = variables.singlesided -local v_default = variables.default -local v_auto = variables.auto -local v_fixed = variables.fixed -local v_landscape = variables.landscape -local v_portrait = variables.portrait -local v_page = variables.page -local v_paper = variables.paper -local v_attachment = variables.attachment -local v_layer = variables.layer -local v_lefttoright = variables.lefttoright -local v_righttoleft = variables.righttoleft -local v_title = variables.title -local v_nomenubar = variables.nomenubar +local v_stop = variables.stop +local v_none = variables.none +local v_max = variables.max +local v_bookmark = variables.bookmark +local v_fit = variables.fit +local v_doublesided = variables.doublesided +local v_singlesided = variables.singlesided +local v_default = variables.default +local v_auto = variables.auto +local v_fixed = variables.fixed +local v_landscape = variables.landscape +local v_portrait = variables.portrait +local v_page = variables.page +local v_paper = variables.paper +local v_attachment = variables.attachment +local v_layer = variables.layer +local v_lefttoright = variables.lefttoright +local v_righttoleft = variables.righttoleft +local v_title = variables.title +local v_nomenubar = variables.nomenubar local positive = register(setstate("/GSpositive gs")) local negative = register(setstate("/GSnegative gs")) @@ -415,7 +415,7 @@ local function documentspecification() addtocatalog("Lang", pdfstring(tokens.getters.macro("currentmainlanguage"))) end -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp local function pagespecification() local canvas = getcanvas() diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt index 4e5d73e0467..5104d9c5aed 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt @@ -42,13 +42,14 @@ if not modules then modules = { } end modules ['lpdf-epd'] = { -- PPCRYPT_FAIL -2 invalid or unsupported encryption (eg. undocumented in pdf spec) local setmetatable, type, next = setmetatable, type, next -local tostring, tonumber, unpack = tostring, tonumber, unpack +local tostring, unpack = tostring, unpack local char, byte, find = string.char, string.byte, string.find local abs = math.abs local concat, swapped, sortedhash, sortedkeys = table.concat, table.swapped, table.sortedhash, table.sortedkeys local utfchar = string.char local setmetatableindex = table.setmetatableindex local ioopen = io.open +local octtointeger, dectointeger, hextointeger = string.octtointeger, string.dectointeger, string.hextointeger local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns local P, C, S, R, Ct, Cc, V, Carg, Cs, Cf, Cg = lpeg.P, lpeg.C, lpeg.S, lpeg.R, lpeg.Ct, lpeg.Cc, lpeg.V, lpeg.Carg, lpeg.Cs, lpeg.Cf, lpeg.Cg @@ -85,12 +86,13 @@ local pagestotable = pdfe.pagestotable local readwholestream = pdfe.readwholestream local getfromreference = pdfe.getfromreference local getfromobject = pdfe.getfromobject +local getobjectrange = pdfe.getobjectrange local report_epdf = logs.reporter("epdf") local allocate = utilities.storage.allocate -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp local objectcodes = { [0] = "none", @@ -104,6 +106,7 @@ local objectcodes = { [0] = "dictionary", "stream", "reference", + "lpdf", } local encryptioncodes = { @@ -116,25 +119,21 @@ local encryptioncodes = { objectcodes = allocate(swapped(objectcodes,objectcodes)) encryptioncodes = allocate(swapped(encryptioncodes,encryptioncodes)) -pdfe.objectcodes = objectcodes -pdfe.encryptioncodes = encryptioncodes - --- lpdf_epdf.objectcodes = objectcodes - -local null_object_code = objectcodes.null -local reference_object_code = objectcodes.reference - -local none_object_code = objectcodes.none -local null_object_code = objectcodes.null -local bool_object_code = objectcodes.bool -local integer_object_code = objectcodes.integer -local number_object_code = objectcodes.number -local name_object_code = objectcodes.name -local string_object_code = objectcodes.string -local array_object_code = objectcodes.array -local dictionary_object_code = objectcodes.dictionary -local stream_object_code = objectcodes.stream -local reference_object_code = objectcodes.reference +lpdf_epdf.objectcodes = objectcodes +lpdf_epdf.encryptioncodes = encryptioncodes + +local none_object_code = objectcodes.none +local null_object_code = objectcodes.null +local bool_object_code = objectcodes.bool +local integer_object_code = objectcodes.integer +local number_object_code = objectcodes.number +local name_object_code = objectcodes.name +local string_object_code = objectcodes.string +local array_object_code = objectcodes.array +local dictionary_object_code = objectcodes.dictionary +local stream_object_code = objectcodes.stream +local reference_object_code = objectcodes.reference +local lpdf_object_code = objectcodes.lpdf -- We need to convert the string from utf16 although there is no way to -- check if we have a regular string starting with a bom. So, we have @@ -165,7 +164,7 @@ function lpdf_epdf.objecttype(object) end local function get_value(document,t,key) - if not key then + if not key or not t then return end local value = t[key] @@ -232,7 +231,7 @@ if lpdf.dictionary then elseif kind == reference_object_code then return pdfreference(value[3]) else - -- report("weird: %s", objecttypes[kind] or "?") + -- report("weird: %s", objectcodes[kind] or "?") end end @@ -302,7 +301,7 @@ else end -some_dictionary = function (d,document) +some_dictionary = function(d,document) local f = dictionarytotable(d,true) local t = setmetatable({ __raw__ = f, __type__ = dictionary_object_code }, { __index = function(t,k) @@ -315,7 +314,7 @@ some_dictionary = function (d,document) return t, "dictionary" end -some_array = function (a,document) +some_array = function(a,document) local f = arraytotable(a,true) local n = #f local t = setmetatable({ __raw__ = f, __type__ = array_object_code, n = n }, { @@ -366,12 +365,20 @@ some_reference = function(r,document) elseif kind == string_object_code then cached = some_string(object,document) else - cached = { kind, object, b, c } -- really cache this? + cached = { kind, object, b, c } end document.__cache__[objnum] = cached document.__xrefs__[cached] = objnum end +-- local handles = document.handles +-- if handles then +-- local h = handles[objnum] +-- if h then +-- -- handles[objnum] = nil +-- h(document,cached,objnum) -- todo: pass less +-- end +-- end return cached end @@ -551,7 +558,7 @@ function lpdf_epdf.load(filename,userpassword,ownerpassword,fromstring) unencrypt(__data__,nil,ownerpassword) end if getstatus(__data__) < 0 then - report_epdf("the document is encrypted, provide proper passwords",getstatus(__data__)) + report_epdf("the document is encrypted, provide proper passwords") __data__ = false end if __data__ then @@ -579,18 +586,28 @@ function lpdf_epdf.load(filename,userpassword,ownerpassword,fromstring) -- we could also use cached but this proxy hides it -- setmetatableindex(__cache__,function(t,objnum) document.objects = setmetatableindex(function(t,objnum) - local cached = __cache__[objnum] - if not cached then - cached = some_object(document,objnum) - __cache__[objnum] = cached - __xrefs__[cached] = objnum + local kind = type(objnum) + if kind == "table" and objnum[1] == reference_object_code then + objnum = objnum[3] + kind = type(objnum) + end + if kind == "number" then + local cached = __cache__[objnum] + if not cached then + cached = some_object(document,objnum) + __cache__[objnum] = cached + __xrefs__[cached] = objnum + end + return cached end - return cached end) else document = false end else + if not __data_ then + report_epdf("the document is damaged or empty") + end document = false end loaded[filename] = document @@ -604,6 +621,13 @@ function lpdf_epdf.load(filename,userpassword,ownerpassword,fromstring) return document or nil end +function lpdf_epdf.objectrange(filename,n) + local document = loaded[filename] + if document then + return getobjectrange(document.__data__,n) + end +end + function lpdf_epdf.unload(filename) if type(filename) == "table" then filename = filename.filename @@ -618,9 +642,17 @@ function lpdf_epdf.unload(filename) end end +function lpdf.close(document) + if loaded[document] then + loaded[document] = nil + loaded[document.filename] = nil + pdfclose(document.__data__) + end +end + -- for k, v in expanded(t) do -local function expanded(t) +local function expanded(t) -- maybe also a sorted variant local function iterator(raw,k) local k, v = next(raw,k) if v then @@ -636,29 +668,107 @@ lpdf_epdf.expanded = expanded -- we could resolve the text stream in one pass if we directly handle the -- font but why should we complicate things +-- local unescape = Cs(( +-- p_remap / remapper +-- + P("\\")/"" * (lpegpatterns.octdigit * lpegpatterns.octdigit^-2) / remapper +-- + P(1) / h_hex_2 +-- )^0) + +-- decstring = Ct(Cc("dec") * P("(") * Cs((numchar+1-(P")"))^1) * P(")")), -- untested +-- decstring = Ct(Cc("dec") * P("(") * (Cs((P("\\")*P(1)+1-(P")"))^1)/lpdf.fromeight) * P(")")), -- untested +-- decstring = Ct(Cc("dec") * P("(") * (Cs((P("\\")*P(1)+1-(P")"))^1)) * P(")")), -- untested +-- decstring = Ct(Cc("dec") * P("(") * (C((P("\\)")+1-(P")"))^1)/lpdf.fromeight) * P(")")), -- untested +-- decstring = Ct(Cc("dec") * P("(") * (lpegpatterns.pdffromeight - P(")")) * P(")")), -- untested + +-- We normalize to hex because when strings move through lua we sometimes get escaping +-- (ff) that I can't figure out. + + +local h_hex_2 = lpdf.h_hex_2 + +local remapper = { + ["\\("] = h_hex_2["("], + ["\\)"] = h_hex_2[")"], + ["\\n"] = h_hex_2["\n"], + ["\\r"] = h_hex_2["\r"], + ["\\t"] = h_hex_2["\t"], + ["\\b"] = h_hex_2["\b"], + ["\\f"] = h_hex_2["\f"], + ["\\\n"] = "", + ["\\\r"] = "", + ["\\\\"] = h_hex_2["\\"], +} + +local p_remap = lpeg.utfchartabletopattern(remapper) + +setmetatableindex(remapper,function(t,k) + local v = h_hex_2[char(octtointeger(k))] + t[k] = v + return v +end) + +local p_hex_string = Ct(Cc("hex") * + P("<") + * Cs((1 - P(">"))^0) + * P(">") +) + +local p_dec_string = Ct(Cc("hex") * + P("(") + * Cs( + ( + p_remap / remapper + + P("\\")/"" * ((lpegpatterns.octdigit * lpegpatterns.octdigit^-2) / remapper) + + P(1) / h_hex_2 + - P(")") + )^0 + ) + * P(")") +) + local spaces = lpegpatterns.whitespace^1 local optspaces = lpegpatterns.whitespace^0 local comment = P("%") * (1 - lpegpatterns.newline)^0 -local numchar = P("\\")/"" * (R("09")^3/function(s) return char(tonumber(s,8)) end) + +local numchar = P("\\")/"" * (R("09")^3/function(s) return char(octtointeger(s)) end) + P("\\") * P(1) -local key = P("/") * C(R("AZ","az","09","__")^1) -local number = Ct(Cc("number") * (lpegpatterns.number/tonumber)) + +local key = P("/") * C(R("AZ","az","09","__","--")^1) +local number = Ct(Cc("number") * (lpegpatterns.number/dectointeger)) local keyword = Ct(Cc("name") * key) local operator = C((R("AZ","az")+P("*")+P("'")+P('"'))^1) -local grammar = P { "start", +local grammar = P { "start", start = (comment + keyword + number + V("dictionary") + V("array") + V("hexstring") + V("decstring") + spaces)^1, keyvalue = key * optspaces * V("start"), - array = Ct(Cc("array") * P("[") * Ct(V("start")^1) * P("]")), - dictionary = Ct(Cc("dict") * P("<<") * Ct(V("keyvalue")^1) * P(">>")), - hexstring = Ct(Cc("hex") * P("<") * Cs(( 1-P(">"))^1) * P(">")), - decstring = Ct(Cc("dec") * P("(") * Cs((numchar+1-(P")"))^1) * P(")")), -- untested + dictionary = Ct(Cc("dict") * P("<<") * Ct(V("keyvalue")^0) * P(">>")), + array = Ct(Cc("array") * P("[") * Ct(V("start")^0) * P("]")), + hexstring = p_hex_string, + decstring = p_dec_string, } -local operation = Ct(grammar^1 * operator) +local operation = Ct(grammar^1 * operator + operator) local parser = Ct((operation + P(1))^1) --- todo: speed this one up +local number = C(lpegpatterns.number) + +local fastgrammar = P { "start", + start = (comment + keyword + number + V("dictionary") + V("array") + V("hexstring") + V("decstring") + spaces)^1, + keyvalue = key * optspaces * V("start"), + dictionary = Ct(Cc("dict") * P("<<") * Ct(V("keyvalue")^0) * P(">>")), + array = Ct(Cc("array") * P("[") * Ct(V("start")^0) * P("]")), + hexstring = p_hex_string, + decstring = p_dec_string, +} + +local fastoperation = Ct(fastgrammar^1 * operator + operator) +local fastparser = Ct((fastoperation + P(1))^1) + +function lpdf_epdf.parsecontent(str,fast) + return lpegmatch(fast and fastparser or parser,str) +end + +-- this will go as we can better run over the list -- local numchar = P("\\") * (R("09")^3 + P(1)) local number = lpegpatterns.number @@ -685,10 +795,6 @@ local grammar = P { "skip", local stripper = Cs((grammar + P(1))^1) -function lpdf_epdf.parsecontent(str) - return lpegmatch(parser,str) -end - function lpdf_epdf.stripcontent(str) if find(str,"EMC") then return lpegmatch(stripper,str) @@ -697,6 +803,8 @@ function lpdf_epdf.stripcontent(str) end end +--------------------------------------------------------------------------- + -- beginbfrange : -- [ ] -- beginbfchar : @@ -704,19 +812,19 @@ end local fromsixteen = lpdf.fromsixteen -- maybe inline the lpeg ... but not worth it local function f_bfchar(t,a,b) - t[tonumber(a,16)] = fromsixteen(b) + t[hextointeger(a)] = fromsixteen(b) end local function f_bfrange_1(t,a,b,c) print("todo 1",a,b,c) -- c is string - -- todo t[tonumber(a,16)] = fromsixteen(b) + -- todo t[hextointeger(a)] = fromsixteen(b) end local function f_bfrange_2(t,a,b,c) print("todo 2",a,b,c) -- c is table - -- todo t[tonumber(a,16)] = fromsixteen(b) + -- todo t[hextointeger(a)] = fromsixteen(b) end local optionals = spaces^0 @@ -731,6 +839,14 @@ local fromunicode = ( P(1) )^1 * Carg(1) +lpdf_epdf.helpers = { } + +function lpdf_epdf.helpers.tounicodetable(tounicode) + return tounicode and lpegmatch(fromunicode,tounicode,1,{}) +end + +--------------------------------------------------------------------------- + local function analyzefonts(document,resources) -- unfinished, see mtx-pdf for better code local fonts = document.__fonts__ if resources then @@ -761,7 +877,7 @@ local more = 0 local unic = nil -- cheaper than passing each time as Carg(1) local p_hex_to_utf = C(4) / function(s) -- needs checking ! - local now = tonumber(s,16) + local now = hextointeger(s) if more > 0 then now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000 -- the 0x10000 smells wrong more = 0 @@ -774,7 +890,7 @@ local p_hex_to_utf = C(4) / function(s) -- needs checking ! end end -local p_dec_to_utf = C(1) / function(s) -- needs checking ! +local p_dec_to_utf = C(1) / function(s) -- needs checking ! not needed now that we always go hex local now = byte(s) return unic[now] or utfchar(now) end @@ -782,7 +898,27 @@ end local p_hex_to_utf = P(true) / function() more = 0 end * Cs(p_hex_to_utf^1) local p_dec_to_utf = P(true) / function() more = 0 end * Cs(p_dec_to_utf^1) -function lpdf_epdf.getpagecontent(document,pagenumber) +-- also xform? + +local function allcontent(content) + if type(content) == "table" then + local ctype = content.__type__ + if ctype == stream_object_code then + content = content() + elseif ctype == array_object_code then + local c = { } + for i=1,#content do + c[i] = content[i]() + end + content = concat(c," ") + end + end + return content +end + +lpdf_epdf.allcontent = allcontent + +function lpdf_epdf.getpagecontent(document,pagenumber,asis,fast) local page = document.pages[pagenumber] @@ -790,12 +926,16 @@ function lpdf_epdf.getpagecontent(document,pagenumber) return end - local fonts = analyzefonts(document,page.Resources) + local content = allcontent(page.Contents or "") + local list = lpegmatch(fast and fastparser or parser,content) + + if asis then + return list -- , fonts + end - local content = page.Contents() or "" - local list = lpegmatch(parser,content) - local font = nil - -- local unic = nil + local fonts = analyzefonts(document,page.Resources) + local font = nil + -- local unic = nil for i=1,#list do local entry = list[i] @@ -807,6 +947,7 @@ function lpdf_epdf.getpagecontent(document,pagenumber) elseif operator == "TJ" then local data = entry[1] -- { "array", { ... } } local list = data[2] -- { { ... }, { ... } } + -- inspect(list) for i=1,#list do local li = list[i] -- if type(li) == "table" then @@ -902,6 +1043,59 @@ function lpdf_epdf.contenttotext(document,list) -- maybe signal fonts return concat(text) end +function lpdf_epdf.contenttostring(contents) + local r = 0 + local result = { } + local compact = false + local rr = false + + local flatten ; flatten = function(t) + local nt = #t + compact = t[nt] == "TJ" + for i=1,nt do + local ti = t[i] + if type(ti) == "table" then + local t1 = ti[1] + local t2 = ti[2] + if t1 == "array" then + if compact then + local sr, sresult = r, result + r, result = 1, { "[" } + flatten(t2) + r = r + 1 ; result[r] = "]" + sr = sr + 1; sresult[sr] = concat(result) + r, result = sr, sresult + else + r = r + 1 ; result[r] = "[" + flatten(t2) + r = r + 1 ; result[r] = "]" + end + elseif t1 == "dict" then + r = r + 1 ; result[r] = "<<" + flatten(t2) + r = r + 1 ; result[r] = ">>" + elseif t1 == "hex" then + r = r + 1 ; result[r] = "<" .. t2 .. ">" + elseif t1 == "dec" then -- can't happen anymore + -- r = r + 1 ; result[r] = "(" .. t2 .. ")" + r = r + 1 ; result[r] = lpdf.toeight(t2) + elseif type(t2) == "number" then + r = r + 1 ; result[r] = t2 -- todo formatter %N + else -- name + r = r + 1 ; result[r] = "/" .. t2 + end + else + r = r + 1 ; result[r] = ti + end + end + end + + for i=1,#contents do + flatten(contents[i]) + end + return concat(result," ") +end + function lpdf_epdf.getstructure(document,list) -- just a test local depth = 0 for i=1,#list do @@ -1003,8 +1197,7 @@ if images then do local s = entry() -- get uncompressed stream pdfflushstreamobject(s,d,true,usednum) -- compress stream else - -- keep as-is, even Length which indicates the - -- decompressed length + -- keep as-is, even Length which indicates the decompressed length local s = entry(false) -- get compressed stream -- pdfflushstreamobject(s,d,false,usednum,true) -- don't compress stream pdfflushstreamobject(s,d,"raw",usednum) -- don't compress stream @@ -1059,18 +1252,19 @@ if images then do elseif kind == array_object_code then return copyarray(xref,copied,object[key]) elseif kind == dictionary_object_code then - return copydictionary(xref,copied,object[key]) + return copydictionary(xref,copied,object[key]) -- value elseif kind == null_object_code then return pdfnull() elseif kind == reference_object_code then - -- expand return deepcopyobject(xref,copied,object[key]) + elseif kind == lpdf_object_code then + return value[2] else - report("weird: %s", objecttypes[kind] or "?") + -- report("weird: %s", objectcodes[kind] or "?") end end - copyarray = function (xref,copied,object) + copyarray = function(xref,copied,object) local target = pdfarray() local source = object.__raw__ for i=1,#source do @@ -1079,63 +1273,34 @@ if images then do return target end - local plugins = nil +-- local plugins = nil -- Sorting the hash slows down upto 5% bit but it is still as fast as the C -- code. We could loop over the index instead but sorting might be nicer in -- the end. + -- This is fragile because keys can be the same in different objects. + copydictionary = function (xref,copied,object) local target = pdfdictionary() local source = object.__raw__ -- hm .. no need to sort here as we create a hash - -- for key, value in next, source do - for key, value in sortedhash(source) do - if plugins then - local p = plugins[key] - if p then - target[key] = p(xref,copied,object,key,value,copyobject) -- maybe a table of methods - else - target[key] = copyobject(xref,copied,object,key,value) - end - else + for key, value in next, source do + -- for key, value in sortedhash(source) do +-- if plugins then +-- local p = plugins[key] +-- if p then +-- target[key] = p(xref,copied,object,key,value,copyobject) -- maybe a table of methods +-- else +-- target[key] = copyobject(xref,copied,object,key,value) +-- end +-- else target[key] = copyobject(xref,copied,object,key,value) - end +-- end end return target end - -- local function copyresources(pdfdoc,xref,copied,pagedata) - -- local Resources = pagedata.Resources - -- if Resources then - -- local r = pdfreserveobject() - -- local d = copydictionary(xref,copied,Resources) - -- pdfflushobject(r,tostring(d)) - -- return pdfreference(r) - -- end - -- end - - local function copyresources(pdfdoc,xref,copied,pagedata) - local Resources = pagedata.Resources - -- - -- -- This needs testing: - -- - -- if not Resources then - -- local Parent = page.Parent - -- while (Parent and (Parent.__type__ == dictionary_object_code or Parent.__type__ == reference_object_code) do - -- Resources = Parent.Resources - -- if Resources then - -- break - -- end - -- Parent = Parent.Parent - -- end - -- end - if Resources then - local d = copydictionary(xref,copied,Resources) - return shareobjectreference(d) - end - end - local openpdf = lpdf_epdf.load local closepdf = lpdf_epdf.unload @@ -1164,35 +1329,86 @@ if images then do local sizetag = sizes[size or "crop"] or sizes.crop local mediabox = page.MediaBox or { 0, 0, 0, 0 } local cropbox = page[sizetag] or mediabox - return { - filename = pdfdoc.filename, - pagenumber = pagenumber, - nofpages = pdfdoc.nofpages, - boundingbox = scaledbbox(cropbox), - cropbox = cropbox, - mediabox = mediabox, - bleedbox = page.BleedBox or cropbox, - trimbox = page.TrimBox or cropbox, - artbox = page.ArtBox or cropbox, - rotation = page.Rotate or 0, - xsize = cropbox[3] - cropbox[1], - ysize = cropbox[4] - cropbox[2], - } + local filename = pdfdoc.filename + if cropbox[4] then + return { + filename = filename, + pagenumber = pagenumber, + nofpages = pdfdoc.nofpages, + boundingbox = scaledbbox(cropbox), + cropbox = cropbox, + mediabox = mediabox, + bleedbox = page.BleedBox or cropbox, + trimbox = page.TrimBox or cropbox, + artbox = page.ArtBox or cropbox, + rotation = page.Rotate or 0, + xsize = cropbox[3] - cropbox[1], + ysize = cropbox[4] - cropbox[2], + } + else + report("bad page %i in file %a",pagenumber,filename or "?") + end + end + end + end + + local function copyresources(pdfdoc,xref,copied,Resources) + if Resources then + local d = copydictionary(xref,copied,Resources) + return shareobjectreference(d) + end + end + + local variables = interfaces.variables + + local function allcontents(contents) + local ctype = contents.__type__ + if ctype == stream_object_code then + return contents() + elseif ctype == array_object_code then + content = { } + for i=1,#contents do + content[i] = contents[i]() -- uncompressed end + return concat(content," ") + else + return contents end end - local function copypage(pdfdoc,pagenumber,attributes,compact,width,height,attr) + local function copypage(pdfdoc,pagenumber,attributes,compact,width,height,attr,copymeta) if pdfdoc then local root = pdfdoc.Catalog local page = pdfdoc.pages[pagenumber or 1] local pageinfo = querypdf(pdfdoc,pagenumber) - local contents = page.Contents - if contents then - local xref = pdfdoc.__xrefs__ - local copied = pdfdoc.__copied__ - if compact and lpdf_epdf.plugin then - plugins = lpdf_epdf.plugin(pdfdoc,xref,copied,page) + if pageinfo then + local contents = page.Contents + local xref = pdfdoc.__xrefs__ + local copied = pdfdoc.__copied__ + local resources = page.Resources + if compact and resources and lpdf_epdf.pageplugin then + lpdf_epdf.pageplugin(pdfdoc,page,pagenumber,resources,compact) +-- local old = allcontents(contents) + contents = page.Contents +-- local new = contents +-- old = string.gsub(old,"%% mps graphic.-[\n\r]+","") +-- old = string.gsub(old,"%s+"," ") +-- old = string.gsub(old,"Tm %(.-%)Tj"," ") +-- new = string.gsub(new,"Tm <.-> Tj"," ") +-- print(#old,old) +-- print(#new,new) + end + local metadata = nil + -- page : only page (default, compatibility) + -- document : only document + -- yes : page or document + if copymeta == variables.page or copymeta == variables.yes then + -- We seldom have metadata with a page. + metadata = copyobject(xref,copied,page,"Metadata") + end + if not metadata and (copymeta == variables.document or copymeta == variables.yes) then + -- For our own documents we don't need this. + metadata = copyobject(xref,copied,root,"Metadata") end local xobject = pdfdictionary { Type = pdfconstant("XObject"), @@ -1200,9 +1416,11 @@ if images then do FormType = 1, Group = copyobject(xref,copied,page,"Group"), LastModified = copyobject(xref,copied,page,"LastModified"), - Metadata = copyobject(xref,copied,page,"Metadata"), + -- Metadata = copyobject(xref,copied,page,"Metadata"), + Metadata = metadata, PieceInfo = copyobject(xref,copied,page,"PieceInfo"), - Resources = copyresources(pdfdoc,xref,copied,page), + Resources = copyresources(pdfdoc,xref,copied,resources), + -- Resources = copyobject(xref,copied,page,"Resources"), SeparationInfo = copyobject(xref,copied,page,"SeparationInfo"), } + attr if attributes then @@ -1212,40 +1430,46 @@ if images then do end local content = "" local nolength = nil - local ctype = contents.__type__ - -- we always recompress because image object streams can not be - -- influenced (yet) - if ctype == stream_object_code then - if stripmarked then - content = contents() -- uncompressed - local stripped = lpdf_epdf.stripcontent(content) - if stripped ~= content then - -- report("%i bytes stripped on page %i",#content-#stripped,pagenumber or 1) - content = stripped - end - elseif recompress then - content = contents() -- uncompressed - else - local Filter = copyobject(xref,copied,contents,"Filter") - local Length = copyobject(xref,copied,contents,"Length") - if Length and Filter then - nolength = true - xobject.Length = Length - xobject.Filter = Filter - content = contents(false) -- uncompressed - else + if type(contents) == "string" then + content = contents -- can be result of plugin + elseif contents then + local ctype = contents.__type__ + -- we always recompress because image object streams can not be + -- influenced (yet) + if ctype == stream_object_code then + if stripmarked then + content = contents() -- uncompressed + local stripped = lpdf_epdf.stripcontent(content) + if stripped ~= content then + -- report("%i bytes stripped on page %i",#content-#stripped,pagenumber or 1) + content = stripped + end + elseif recompress then content = contents() -- uncompressed + else + local Filter = copyobject(xref,copied,contents,"Filter") + local Length = copyobject(xref,copied,contents,"Length") + if Length and Filter then + nolength = true + xobject.Length = Length + xobject.Filter = Filter + content = contents(false) -- uncompressed + else + content = contents() -- uncompressed + end end + elseif ctype == array_object_code then + content = { } + for i=1,#contents do + content[i] = contents[i]() -- uncompressed + end + content = concat(content," ") end - elseif ctype == array_object_code then - content = { } - for i=1,#contents do - content[i] = contents[i]() -- uncompressed - end - content = concat(content," ") + else + content = "" end -- still not nice: we double wrap now - plugins = nil +-- plugins = nil local rotation = pageinfo.rotation local boundingbox = pageinfo.boundingbox local transform = nil @@ -1276,7 +1500,7 @@ if images then do kind = images.types.stream, } else - -- maybe report an error + report("bad page %i in file %a",pagenumber or "0",pdfdoc.filename or "?") end end end @@ -1297,6 +1521,83 @@ if images then do end end +function lpdf_epdf.producer(pdfdoc) + local producer = false + if pdfdoc then + local info = pdfdoc.Info + if info then + producer = info.Producer + end + if not producer then + local metadata = pdfdoc.Catalog.Metadata + if metadata then + local x = xml.convert(metadata()) + if x then + producer = xml.text(x,"rdf:Description/pdf:Producer") + if not producer or producer == "" then + producer = xml.text(x,"Producer") + end + end + end + end + end + return producer or "" +end + +function lpdf_epdf.expandwidths(widths,expanded) + if not expanded then + expanded = { } + end + local min = false + local max = false + local i = 1 + local n = #widths -- - 1 + while i < n do + local w1 = widths[i] ; i = i + 1 + local w2 = widths[i] ; i = i + 1 + if type(w2) == "table" then + local k = 1 + local wn = w1 + #w2 - 1 + for j=w1,wn do + expanded[j] = w2[k] + k = k + 1 + end + if not min then + min = w1 + max = wn + elseif wn > max then + max = wn + end + else + local w3 = widths[i] ; i = i + 1 + if w3 then + for j=w1,w2 do + expanded[j] = w3 + end + if not min then + min = w1 + max = w2 + elseif w2 > max then + max = w2 + end + end + end + end + return expanded, min or 0, max or 0 +end + +function lpdf_epdf.mergewidths(widths,expanded) + if not expanded then + expanded = { } + end + local min = 1 + local max = #widths + for i=1,#widths do + expanded[i] = widths[i] + end + return expanded, min, max +end + -- local d = lpdf_epdf.load("e:/tmp/oeps.pdf") -- inspect(d) -- inspect(d.Catalog.Lang) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt index ea34505fab9..54975a29d57 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt @@ -28,13 +28,13 @@ local executers = references.executers local variables = interfaces.variables -local v_no = variables.no -local v_yes = variables.yes -local v_start = variables.start -local v_stop = variables.stop -local v_reset = variables.reset -local v_auto = variables.auto -local v_random = variables.random +local v_no = variables.no +local v_yes = variables.yes +local v_start = variables.start +local v_stop = variables.stop +local v_reset = variables.reset +local v_auto = variables.auto +local v_random = variables.random local lpdf = lpdf local pdfconstant = lpdf.constant @@ -78,8 +78,10 @@ local pdf_intent = { } local pdf_export = { - [v_yes] = pdf_on, - [v_no] = pdf_off, + -- [v_yes] = pdf_on, + -- [v_no] = pdf_off, + [v_yes] = pdfdictionary { ExportState = pdf_on }, + [v_no] = pdfdictionary { ExportState = pdf_on }, } -- We can have references to layers before they are places, for instance from @@ -103,15 +105,6 @@ end) local specifications = { } local initialized = { } -function codeinjections.defineviewerlayer(specification) - if viewerlayers.supported and textlayers then - local tag = specification.tag - if not specifications[tag] then - specifications[tag] = specification - end - end -end - local function useviewerlayer(name) -- move up so that we can use it as local if not environment.initex and not initialized[name] then local specification = specifications[name] @@ -160,6 +153,25 @@ local function useviewerlayer(name) -- move up so that we can use it as local end end +function codeinjections.defineviewerlayer(specification) + if viewerlayers.supported and textlayers then + local tag = specification.tag + if not specifications[tag] then + specifications[tag] = specification + end + end +end + +function codeinjections.setupviewerlayer(specification) + if viewerlayers.supported and textlayers then + local tag = specification.tag + local set = tag and specifications[tag] + if set then + for k, v in next, specification do set[k] = v end + end + end +end + codeinjections.useviewerlayer = useviewerlayer local function layerreference(name) diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt index ce90488bd44..7c0308b080e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt @@ -14,14 +14,14 @@ local concat, setmetatableindex = table.concat, table.setmetatableindex local attributes = attributes local nodes = nodes -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp local nuts = nodes.nuts local ruleactions = nuts.rules.ruleactions local getwhd = nuts.getwhd -local lefttoright_code = tex.directioncodes.lefttoright +local lefttoright_code = tex.directioncodes.lefttoright local mpcolor = attributes.colors.mpcolor @@ -39,14 +39,14 @@ local setmacro = tokens.setters.macro local codeinjections = backends.registered.pdf.codeinjections -local d_rule_width = isdimen("d_rule_width") -local d_rule_height = isdimen("d_rule_height") -local d_rule_depth = isdimen("d_rule_depth") -local d_rule_h = isdimen("d_rule_h") -local d_rule_v = isdimen("d_rule_v") -local d_rule_line = isdimen("d_rule_line") -local d_rule_offset = isdimen("d_rule_offset") -local d_rule_factor = isdimen("d_rule_factor") +local d_rule_width = isdimen("d_rule_width") +local d_rule_height = isdimen("d_rule_height") +local d_rule_depth = isdimen("d_rule_depth") +local d_rule_h = isdimen("d_rule_h") +local d_rule_v = isdimen("d_rule_v") +local d_rule_line = isdimen("d_rule_line") +local d_rule_offset = isdimen("d_rule_offset") +local d_rule_factor = isdimen("d_rule_factor") -- This is very pdf specific. Maybe move some to lpdf-rul.lua some day. @@ -183,9 +183,9 @@ end do - -- This is the old oval method that we keep it for compatibility reasons. Of - -- course one can use mp instead. It could be improved but at the cost of more - -- code than I'm willing to add for something hardly used. + -- This is the old oval method that we keep it for compatibility reasons. Of course one can use mp + -- instead. It could be improved but at the cost of more code than I'm willing to add for something + -- hardly used. local linemapping = { [interfaces.variables.round] = "ltrb", @@ -194,7 +194,7 @@ do ["1"] = "ltrb", ["2"] = "ltrb", ["3"] = "ltrb", ["4"] = "ltrb", ["5"] = "ltrb", ["6"] = "ltrb", ["7"] = "ltrb", ["8"] = "ltrb", -- - [ "9"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", + [ "9"] = "trb", ["trb"] = "trb", ["rtl"] = "trb", ["10"] = "tlb", ["tlb"] = "tlb", ["blt"] = "tlb", ["11"] = "ltr", ["ltr"] = "ltr", ["rtl"] = "lrt", ["12"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", @@ -217,7 +217,7 @@ do [interfaces.variables.round] = "ltrb", [ "0"] = "ltrb", ["ltrb"] = "ltrb", ["trbl"] = "ltrb", ["rblt"] = "ltrb", ["bltr"] = "ltrb", -- - [ "9"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", + [ "9"] = "trb", ["trb"] = "trb", ["rtl"] = "trb", ["10"] = "tlb", ["tlb"] = "tlb", ["blt"] = "tlb", ["11"] = "ltr", ["ltr"] = "ltr", ["rtl"] = "lrt", ["12"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr", @@ -236,27 +236,21 @@ do ["31"] = "t", ["t"] = "t", } - setmetatableindex(linemapping,function(t,k) + local function register(t,k) local v = tonumber(k) if v then v = tostring(v) - else - v = "ltrb" end - t[k] = v - return v - end) - - setmetatableindex(roundmapping,function(t,k) - local v = tonumber(k) - if v then - v = tostring(v) - else + v = v and rawget(t,v) or v + if not v then v = "ltrb" end t[k] = v return v - end) + end + + setmetatableindex(linemapping, register) + setmetatableindex(roundmapping,register) local function round(p,kind,corner) local width = p.width or 0 @@ -274,47 +268,74 @@ do local ymax = yymax - half local ymin = yymin + half local list = nil + local done = kind ~= "fill" and "S" or "f" if radius == 0 then local method = linemapping[corner] if method == "ltrb" then - list = { - "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xmin, ymax, - kind == "fill" and "l h f Q" or "l h S Q" - } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l h %s Q"] + (line,xmin,ymin,xmax,ymin,xmax,ymax,xmin,ymax,done) elseif method == "l" then - list = { "q", line, "w", xmin, yymin, "m", xmin, yymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l S Q"] + (line,xmin,yymin,xmin,yymax) elseif method == "r" then - list = { "q", line, "w", xmax, yymin, "m", xmax, yymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l S Q"] + (line,xmax,yymin,xmax,yymax) elseif method == "b" then - list = { "q", line, "w", xxmin, ymin, "m", xxmax, ymin, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l S Q"] + (line,xxmin,ymin,xxmax,ymin) elseif method == "t" then - list = { "q", line, "w", xxmin, ymax, "m", xxmax, ymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l S Q"] + (line,xxmin,ymax,xxmax,ymax) elseif method == "lr" then - list = { "q", line, "w", xmin, yymin, "m", xmin, yymax, "l", xmax, yymin, "m", xmax, yymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N m %.6N %.6N %.6N l S Q"] + (line,xmin,yymin,xmin,yymax,xmax,yymin,xmax,yymax) elseif method == "tb" then - list = { "q", line, "w", xxmin, ymin, "m", xxmax, ymin, "l", xxmin, ymax, "m", xxmax, ymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N m %.6N %.6N %.6N l S Q"] + (line,xxmin,ymin,xxmax,ymin,xxmin,ymax,xxmax,ymax) elseif method == "lbr" then - list = { "q", line, "w", xmin, yymax, "m", xmin, ymin, "l", xmax, ymin, "l", xmax, yymax, "l S Q" } - elseif method == "tlb" then - list = { "q", line, "w", xxmax, ymax, "m", xmin, ymax, "l", xmin, ymin, "l", xxmax, ymin, "l S Q" } - elseif method == "ltr" then - list = { "q", line, "w", xmin, yymin, "m", xmin, ymax, "l", xmax, ymax, "l", xmax, yymin, "l S Q" } - elseif method == "lbr" then - list = { "q", line, "w", xxmin, ymax, "m", xmax, ymax, "l", xmax, ymin, "l", xxmin, ymin, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l S Q"] + (line,xmin,yymax,xmin,ymin,xmax,ymin,xmax,yymax) + elseif method == "tlb" then -- 10 + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l S Q"] + (line,xxmax,ymax,xmin,ymax,xmin,ymin,xxmax,ymin) + elseif method == "ltr" then -- 11 + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l S Q"] + (line,xmin,yymin,xmin,ymax,xmax,ymax,xmax,yymin) + elseif method == "trb" then + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l S Q"] + (line,xxmin,ymax,xmax,ymax,xmax,ymin,xxmin,ymin) elseif method == "rt" then - list = { "q", line, "w", xxmin, ymax, "m", xmax, ymax, "l", xmax, yymin, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l S Q"] + (line,xxmin,ymax,xmax,ymax,xmax,yymin) elseif method == "rb" then - list = { "q", line, "w", xmax, yymax, "m", xmax, ymin, "l", xxmin, ymin, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l S Q"] + (line,xmax,yymax,xmax,ymin,xxmin,ymin) elseif method == "bl" then - list = { "q", line, "w", xxmax, ymin, "m", xmin, ymin, "l", xmin, yymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l S Q"] + (line,xxmax,ymin,xmin,ymin,xmin,yymax) elseif method == "tl" then - list = { "q", line, "w", xmin, yymin, "m", xmin, ymax, "l", xxmax, ymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l S Q"] + (line,xmin,yymin,xmin,ymax,xxmax,ymax) else return end else local method = roundmapping[corner] - local done = kind ~= "fill" and "h S Q" or "h f Q" -- todo local full = ( radius + half) local xxxmin = full * bpfactor local xxxmax = ( width - full) * bpfactor @@ -323,100 +344,154 @@ do if xxxmin > xxxmax or yyymin > yyymax then return elseif method == "ltrb" then - list = { - "q", line, "w", xxxmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", - xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done, - } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y h %s Q"] + (line,xxxmin,ymin,xxxmax,ymin,xmax,ymin,xmax,yyymin,xmax,yyymax,xmax,ymax,xxxmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax,xmin,yyymin,xmin,ymin,xxxmin,ymin,done) elseif method == "1" then -- ll lr - list = { "q", line, "w", xxxmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, ymax, "l", xmin, ymax, "l", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N l %.6N %.6N l %.6N %.6N %.6N %.6N y h %s Q"] + (line,xxxmin,ymin,xxxmax,ymin,xmax,ymin,xmax,yyymin,xmax,ymax,xmin,ymax,xmin,yyymin,xmin,ymin,xxxmin,ymin,done) elseif method == "2" then -- ll ul - list = { "q", line, "w", xxxmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y h %s Q"] + (line,xxxmin,ymin,xmax,ymin,xmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax,xmin,yyymin,xmin,ymin,xxxmin,ymin,done) elseif method == "3" then -- ul ur - list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, ymin, "l", done } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l h %s Q"] + (line,xmin,ymin,xmax,ymin,xmax,yyymax,xmax,ymax,xxxmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax,xmin,ymin,done) elseif method == "4" then -- ur lr - list = { "q", line, "w", xmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xmin, ymax, "l", xmin, ymin, "l", done } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N l h %s Q"] + (line,xmin,ymin,xxxmax,ymin,xmax,ymin,xmax,yyymin,xmax,yyymax,xmax,ymax,xxxmax,ymax,xmin,ymax,xmin,ymin,done) elseif method == "5" then -- ur - list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xmin, ymax, "l", xmin, ymin, "l", done } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N l h %s Q"] + (line,xmin,ymin,xmax,ymin,xmax,yyymax,xmax,ymax,xxxmax,ymax,xmin,ymax,xmin,ymin,done) elseif method == "6" then -- lr - list = { "q", line, "w", xmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, ymax, "l", xmin, ymax, "l", xmin, ymin, "l", done } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N l %.6N %.6N l h %s Q"] + (line,xmin,ymin,xxxmax,ymin,xmax,ymin,xmax,yyymin,xmax,ymax,xmin,ymax,xmin,ymin,done) elseif method == "7" then -- ur - list = { "q", line, "w", xxxmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xmin, ymax, "l", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done } -- outlier + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l %.6N %.6N l %.6N %.6N %.6N %.6N y h %s Q"] -- outlier + (line,xxxmin,ymin,xmax,ymin,xmax,ymax,xmin, ymax,xmin,yyymin,xmin,ymin,xxxmin,ymin,done) elseif method == "8" then -- ul - list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, ymin, "l", done } - elseif method == "lbr" then - list = { "q", line, "w", xmin, yymax, "m", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, yymax, "l S Q" } - elseif method == "tlb" then - list = { "q", line, "w", xxmax, ymax, "m", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", xxmax, ymin, "l S Q" } - elseif method == "ltr" then - list = { "q", line, "w", xmax, yymin, "m", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yymin, "l S Q" } - elseif method == "lbr" then - list = { "q", line, "w", xxmin, ymax, "m", xxxmax, ymax, "l", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y", xxmin, ymin, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N l %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l h %s Q"] + (line,xmin,ymin,xmax,ymin,xmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax,xmin,ymin,done) + elseif method == "lbr" then -- 12 + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xmin,yymax,xmin,yyymin,xmin,ymin,xxxmin,ymin,xxxmax,ymin,xmax,ymin,xmax,yyymin,xmax,yymax) + elseif method == "tlb" then -- 10 + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xxmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax,xmin,yyymin,xmin,ymin,xxxmin,ymin,xxmax,ymin) + elseif method == "ltr" then -- 11 + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xmax,yymin,xmax,yyymax,xmax,ymax,xxxmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax,xmin,yymin) + elseif method == "trb" then -- 9 + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xxmin,ymax,xxxmax,ymax,xmax,ymax,xmax,yyymax,xmax,yyymin,xmax,ymin,xxxmax,ymin,xxmin,ymin) elseif method == "lr" then - list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "l", xmin, ymax, xxxmin, ymax, "y", - xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmin,ymin,xmin,ymin,xmin,yyymin,xmin,yyymax,xmin,ymax,xxxmin,ymax,xxxmax,ymax,xmax,ymax,xmax,yyymax,xmax,yyymin,xmax,ymin,xxxmax,ymin) elseif method == "tb" then - list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "l", xmin, ymin, xmin, yyymin, "y", - xmax, yyymax, "m", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y S Q"] + (line,xmax,yyymin,xmax,ymin,xxxmax,ymin,xxxmin,ymin,xmin,ymin,xmin,yyymin,xmax,yyymax,xmax,ymax,xxxmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax) elseif method == "rt" then - list = { "q", line, "w", xxmin, ymax, "m", xxxmax, ymax, "l", xmax, ymax, xmax, yyymax, "y", xmax, yymin, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xxmin,ymax,xxxmax,ymax,xmax,ymax,xmax,yyymax,xmax,yymin) elseif method == "rb" then - list = { "q", line, "w", xmax, yymax, "m", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y", xxmin, ymin, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xmax,yymax,xmax,yyymin,xmax,ymin,xxxmax,ymin,xxmin,ymin) elseif method == "bl" then - list = { "q", line, "w", xxmax, ymin, "m", xxxmin, ymin, "l", xmin, ymin, xmin, yyymin, "y", xmin, yymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xxmax,ymin,xxxmin,ymin,xmin,ymin,xmin,yyymin,xmin,yymax) elseif method == "tl" then - list = { "q", line, "w", xmin, yymin, "m", xmin, yyymax, "l", xmin, ymax, xxxmin, ymax, "y", xxmax, ymax, "l S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l S Q"] + (line,xmin,yymin,xmin,yyymax,xmin,ymax,xxxmin,ymax,xxmax,ymax) elseif method == "17" then -- urx - list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmax,ymax,xmax,ymax,xmax,yyymax) elseif method == "18" then -- lrt - list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xmax,yyymin,xmax,ymin,xxxmax,ymin) elseif method == "19" then -- llx - list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmin,ymin,xmin,ymin,xmin,yyymin) elseif method == "20" then -- urx - list = { "q", line, "w", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xmin,yyymax,xmin,ymax,xxxmin,ymax) elseif method == "21" then -- ulx urx - list = { "q", line, "w", xmax, yyymax, "m", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "m", xmin, ymax, xmin, yyymax, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xmax,yyymax,xmax,ymax,xxxmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax) elseif method == "22" then -- urt lrt - list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmax,ymax,xmax,ymax,xmax,yyymax,xmax,yyymin,xmax,ymin,xxxmax,ymin) elseif method == "23" then -- llx lrx - list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xmax,yyymin,xmax,ymin,xxxmax,ymin,xxxmin,ymin,xmin,ymin,xmin,yyymin) elseif method == "24" then -- ulx llx - list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmin,ymin,xmin,ymin,xmin,yyymin,xmin,yyymax,xmin,ymax,xxxmin,ymax) elseif method == "25" then -- llx lrx urx ulx - list = { - "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "m", - xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q", - } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmax,ymax,xmax,ymax,xmax,yyymax,xmax,yyymin,xmax,ymin,xxxmax,ymin,xxxmin,ymin,xmin,ymin,xmin,yyymin,xmin,yyymax,xmin,ymax,xxxmin,ymax) elseif method == "26" then - list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xmax,yyymin,xmax,ymin,xxxmax,ymin,xmin,yyymax,xmin,ymax,xxxmin,ymax) elseif method == "27" then - list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N m %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmax,ymax,xmax,ymax,xmax,yyymax,xxxmin,ymin,xmin,ymin,xmin,yyymin) elseif method == "l" then - list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "l", xmin, ymax, xxxmin, ymax, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmin,ymin,xmin,ymin,xmin,yyymin,xmin,yyymax,xmin,ymax,xxxmin,ymax) elseif method == "r" then - list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y S Q"] + (line,xxxmax,ymax,xmax,ymax,xmax,yyymax,xmax,yyymin,xmax,ymin,xxxmax,ymin) elseif method == "b" then - list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "l", xmin, ymin, xmin, yyymin, "y S Q" } + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y S Q"] + (line,xmax,yyymin,xmax,ymin,xxxmax,ymin,xxxmin,ymin,xmin,ymin,xmin,yyymin) elseif method == "t" then - list = { "q", line, "w", xmax, yyymax, "m", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y S Q" } - else + list = formatters + ["q %.6N w %.6N %.6N m %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y S Q"] + (line,xmax,yyymax,xmax,ymax,xxxmax,ymax,xxxmin,ymax,xmin,ymax,xmin,yyymax) + else return end end - pdfprint("direct",concat(list," ")) + -- print(list) + pdfprint("direct",list) end local f_rectangle = formatters["q %.6N w %.6N %.6N %.6N %.6N re %s Q"] local f_baselined = formatters["q %.6N w %.6N %.6N %.6N %.6N re s %.6N %.6N m %.6N %.6N l s Q"] local f_dashlined = formatters["q %.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s Q"] local f_dashtwice = formatters["q %.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s %.6N %.6N m %.6N %.6N l s Q"] - local f_radtangle = formatters[ -[[q %.6N w %.6N %.6N m -%.6N %.6N l %.6N %.6N %.6N %.6N y -%.6N %.6N l %.6N %.6N %.6N %.6N y -%.6N %.6N l %.6N %.6N %.6N %.6N y -%.6N %.6N l %.6N %.6N %.6N %.6N y -h %s Q]] - ] + local f_radtangle = formatters["q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y h %s Q"] local rule_any = function(p,h,v,i,n) local corner = p.corner diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-sig.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-sig.lmt new file mode 100644 index 00000000000..52e417adfab --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-sig.lmt @@ -0,0 +1,430 @@ +if not modules then modules = { } end modules ['lpdf-sig'] = { + version = 1.001, + optimize = true, + comment = "companion to back-imp-pdf.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- experiment and playground + +local find, gsub, rep, format = string.find, string.gsub, string.rep, string.format + +-- M = "D:20231118193724Z", +-- Reference = pdfdictionary { +-- Data = catalog, +-- TransformMethod = pdfconstant("FieldMDP"), +-- Type = pdfconstant("SigRef"), +-- TransformParams = pdfdictionary { +-- Action = pdfconstant("Include"), +-- Fields = pdfarray(), +-- Type = pdfconstant("TransformParams"), +-- V = 1.2, +-- } +-- }, + +local function updatesignature(signature,...) + local updated = gsub(signature, + -- "/ByteRange %[ 2000000000 2000000000 2000000000 2000000000 %]", + "/ByteRange %[ .......... .......... .......... .......... %]", + format("/ByteRange [ %010i %010i %010i %010i ]",...) + ) + return updated ~= signature and updated or false +end + +local function getbyteranges(signature,position,filesize) + local leftangle = find(signature,"<0") + local rightangle = find(signature,"0>") + local b1 = 0 + local n1 = position + leftangle - 2 + local b2 = position + rightangle + 1 + local n2 = filesize - b2 + return { b1, n1, b2, n2 } +end + +if lpdf and context then + + local pdfreserveobject = lpdf.reserveobject + local pdfflushobject = lpdf.flushobject + local pdfreference = lpdf.reference + local pdfconstant = lpdf.constant + local pdfdictionary = lpdf.dictionary + local pdfarray = lpdf.array + local pdfliteral = lpdf.literal + local pdfunicode = lpdf.unicode + + local status = { + signature = false, + position = false, + filename = false, + filesize = false, + } + + local reference = nil + + function lpdf.registersignature(value) + if value == "pkcs7" then + local signature = pdfreserveobject() + status.signature = signature + -- reference = pdfreference(pdfflushobject(pdfdictionary { + -- DigestMethod = pdfconstant("SHA256"), + -- })) + return pdfreference(signature) + end + end + + function lpdf.preparesignature(flush,f,offset,objects) + local signature = status.signature + if signature then + local d = pdfdictionary { + ByteRange = pdfarray { 2000000000, 2000000000, 2000000000, 2000000000 }, + Contents = pdfliteral(rep("0",4096),true), -- should be enough + Filter = pdfconstant("Adobe.PPKLite"), + SubFilter = pdfconstant("adbe.pkcs7.detached"), + Type = pdfconstant("Sig"), + -- Reasons = pdfunicode("just to be sure"), + Reference = reference, + } + objects[signature] = offset + local object = signature .. " 0 obj\n" .. tostring(d) .. "\nendobj\n" + status.reference = signature + status.position = offset + status.signature = object + flush(f,object) + offset = offset + #object + end + return offset + end + + function lpdf.finalizesignature(filename,usedsize) + if not filename then + return + end + local signature = status.signature + if not signature then + return + end + local signame = file.replacesuffix(filename,"sig") + local filesize = file.size(filename) + local samesize = usedsize ~= filesize + local handle = samesize and io.open(filename,"r+b") + local position = status.position + status.ranges = getbyteranges(signature,position,filesize) + status.signature = signature + status.length = #signature + status.filename = filename + status.filesize = filesize + table.save(signame, status) + if handle then + local updated = updatesignature(signature,b1,n1,b2,n2) + if updated then + handle:seek("set",position) + handle:write(updated) + handle:close() + status.updated = true + end + end + end + +else + + -- "openssl cms -verify -noverify -cmsout -print -inform DER -in ".. binfile + -- -binary is needed, otherwise \nopdfcompression output will be real slow + + lpdf = lpdf or { } + local report = logs.reporter("sign pdf") + + local openssl = nil + + local runner = sandbox and sandbox.registerrunner { + name = "openssl", + program = "openssl", + template = "cms -sign -binary -passin pass:%password% -in %datafile% -out %signature% -outform der -signer %certificate%", + reporter = report, + } + + local function checklibrary(uselibrary) + if uselibrary and openssl == nil then + dofile(resolvers.findfile("libs-imp-openssl.lmt","tex")) + openssl = require("openssl") + if not openssl then + openssl = false + end + end + return openssl + end + + -- Here we use the status file so that we don't need to load the pdf file + -- which saves time and memory. + + local function getsigdata(pdffile,f) + if not lpdf.epdf then + report("epdf support is not loaded") + return + end + local pdf = lpdf.epdf.load(pdffile) + if not pdf then + report("file %a can't be loaded",pdffile) + return + end + local widgets = pdf.widgets + if not widgets then + lpdf.close(pdf) + return + end + local position = nil + local length = nil + for i=1,#widgets do + local annotation = widgets[i] + local parent = annotation.Parent or { } + local what = annotation.FT or parent.FT + if what == "Sig" then + local obj = annotation.__raw__.V + if obj and obj[1]== 10 then + position, length = lpdf.epdf.objectrange(pdf,obj[3]) + break + end + end + end + lpdf.close(pdf) + if position then + local p = f:seek() + f:seek("set",position) + local signature = f:read(length), + f:seek("set",p) + local filesize = file.size(pdffile) + return { + position = position, + length = length, + signature = signature, + filename = pdffile, + filesize = filesize, + ranges = getbyteranges(signature,position,filesize) + } + end + end + + function lpdf.sign(specification) + local report = specification.report or report + local pdffile = specification.filename or "" + local certificate = specification.certificate or "" + local password = specification.password or "" + if pdffile == "" or certificate == "" or password == "" then + report("invalid specification") + return + end + -- + local openssl = checklibrary(specification.uselibrary or false) + -- + local sigfile = file.replacesuffix(pdffile,"sig") + local tmpfile = file.replacesuffix(pdffile,"tmp") + local binfile = file.replacesuffix(pdffile,"bin") + -- + local f = io.open(pdffile,"r+b") + if not f then + report("unable to open %a for reading and writing",pdffile) + return + end + -- + local data = table.load(sigfile) + if not data then + data = getsigdata(pdffile,f) + end + if not data then + report("unable to open %a",sigfile) + return + end + local filename = data.filename + if filename ~= pdffile then + report("file mismatch %a",pdffile) + return + end + -- + local signature = data.signature + local position = data.position + local ranges = data.ranges + local filesize = data.filesize + statistics.starttiming("sign pdf") + local before = f:read(position) + local insert = f:seek() + local middle = f:read(#signature) + local after = f:read(filesize) -- no problem if we overshoot + if not before or not after then + report("invalid status") + return + end + if middle ~= signature then + report("no prestine signature") + return + end + -- + -- if not data.updated then + signature = updatesignature(signature,unpack(ranges)) or signature + -- end + -- + middle = string.gsub(signature," <0.-0> "," ") + local data = before .. middle .. after -- we can nil before and after + statistics.starttiming("sign ssh") + report("signing %a",pdffile) + local digest = nil + if openssl then + local result, message = openssl.sign { + data = data, + certfile = certificate, + password = password, + } + if result then + digest = message + else + report("ssh error: %a",message) + end + else + io.savedata(tmpfile,data) + runner { + password = password, + datafile = tmpfile, + signature = binfile, + certificate = certificate, + } + statistics.stoptiming("sign ssh") + digest = io.loaddata(binfile) + if not digest or digest == "" then + report("invalid digest from ssh") + return + end + if status.purge then + os.remove(tmpfile) + os.remove(binfile) + end + end + if digest then + digest = string.tohex(digest) + signature = string.gsub(signature, + "(/Contents <)([^>]+)(>)", + function(b,s,e) return b .. digest .. string.rep("0",#s-#digest) .. e end + ) + f:seek("set",insert) + f:write(signature) + f:close() + end + if status.purge then + os.remove(sigfile) + end + statistics.stoptiming("sign pdf") + status.sshtime = statistics.elapsedtime("sign ssh") + status.pdftime = statistics.elapsedtime("sign pdf") + report("filesize %i bytes, ssh time %0.3f seconds, total time %0.3f seconds", + filesize, + statistics.elapsedtime("sign ssh"), + statistics.elapsedtime("sign pdf") + ) + return status + end + + -- local runner = sandbox and sandbox.registerrunner { + -- name = "openssl", + -- program = "openssl", + -- template = "...", -- signature and datafile + -- reporter = report, + -- } + + -- Here we load the to be checked pdf file because the status file is not present + -- and the pdf file can be diferent anyway. + + function lpdf.verify(specification) + if not lpdf.epdf then + report("epdf support is not loaded") + return + end + -- + local report = specification.report or report + local pdffile = specification.filename or "" + local certificate = specification.certificate or "" + local password = specification.password or "" + if pdffile == "" or certificate == "" or password == "" then + report("invalid specification") + return + end + -- + local openssl = checklibrary(specification.uselibrary or false) + -- + local pdf = lpdf.epdf.load(pdffile) + if not pdf then + report("file %a can't be loaded",pdffile) + return + end + -- + local widgets = pdf.widgets + if not widgets then + report("file %a has no signature widgets",pdffile) + lpdf.close(pdf) + return + end + local signature = nil + local byterange = nil + for i=1,#widgets do + local annotation = widgets[i] + local parent = annotation.Parent or { } + local what = annotation.FT or parent.FT + if what == "Sig" then + local value = annotation.V + if value then + signature = string.tobytes(tostring(value.Contents) or "") + byterange = value.ByteRange + end + end + end + lpdf.close(pdf) + if not signature or signature == "" or not byterange then + report("file %a has no signature",pdffile) + return + end + -- + local f = io.open(pdffile,"rb") + if not f then + report("unable to open %a for reading",pdffile) + return + end + f:seek("set",byterange[1]) + local before = f:read(byterange[2] + 1) + -- f:seek("set",byterange[2] + 2) + -- local existing = f:read(byterange[3] - byterange[2] - 3) + f:seek("set",byterange[3]) + local after = f:read(byterange[4]) + -- we could check the size + if not before or not after then + report("invalid byteranges in %a",pdffile) + return + end + local okay = false + local data = before .. after + if openssl then + okay = openssl.verify { + data = data, + certfile = certificate, + password = password, + signature = signature, + } + else + report("verifying with the binary is not yet implemented") + -- local tmpfile = file.replacesuffix(pdffile,"tmp") + -- local binfile = file.replacesuffix(pdffile,"bin") + -- + -- io.savedata(binfile,signature) + -- io.savedata(tmpfile,data) + -- runner { + -- datafile = tmpfile, + -- signature = binfile, + -- } + -- os.remove(tmpfile) + -- os.remove(binfile) + end + if okay then + report("signature in file %a matches the content",pdffile) + else + report("signature in file %a doesn't match the content",pdffile) + end + end + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt index f6a881208f3..3cb3f44a0a3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt @@ -7,14 +7,22 @@ if not modules then modules = { } end modules ['lpdf-tag'] = { } local next, type = next, type -local format, match, gmatch = string.format, string.match, string.gmatch +local format, match, gmatch, find = string.format, string.match, string.gmatch, string.find local concat, sortedhash = table.concat, table.sortedhash local lpegmatch, P, S, C = lpeg.match, lpeg.P, lpeg.S, lpeg.C local settings_to_hash = utilities.parsers.settings_to_hash local formatters = string.formatters -local trace_tags = false trackers.register("structures.tags", function(v) trace_tags = v end) -local trace_info = false trackers.register("structures.tags.info", function(v) trace_info = v end) +local trace_tags = false trackers.register("structures.tags", function(v) + trace_tags = v +end) +local trace_info = false trackers.register("structures.tags.info", function(v) + trace_info = v +end) +local trace_math = false trackers.register("structures.tags.math", function(v) + trace_math = v + attributes.viewerlayers.enable() -- somehow has to happen +end) local report_tags = logs.reporter("backend","tags") @@ -46,12 +54,13 @@ local texgetcount = tex.getcount local nodes = nodes local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local glyph_code = nodecodes.glyph -local a_tagged = attributes.private('tagged') -local a_image = attributes.private('image') +local a_tagged = attributes.private('tagged') +local a_image = attributes.private('image') +local a_mathblob = attributes.private('mathblob') local nuts = nodes.nuts @@ -61,11 +70,13 @@ local register = nodepool.register local getid = nuts.getid local getattr = nuts.getattr +local getattrs = nuts.getattrs local getprev = nuts.getprev local getnext = nuts.getnext local getlist = nuts.getlist local getchar = nuts.getchar +local tailoflist = nuts.tail local setlink = nuts.setlink local setlist = nuts.setlist @@ -96,7 +107,8 @@ local usedmapping = { } ----- tagsplitter = structurestags.patterns.splitter local embeddedtags = false -- true will id all, for tracing, otherwise table -local f_tagid = formatters["%s-%04i"] +local f_tagid = formatters["%s-%04X"] -- todo: auto adapt to nofblobs +local f_tagfn = formatters["%s-%04X.xml"] local embeddedfilelist = pdfarray() -- /AF crap -- for testing, not that it was ever used: @@ -161,10 +173,10 @@ local function finishstructure() local rolemaps = usenamespace and { } local rolemap = pdfdictionary() -- main one for k, v in next, usedmapping do - k = usedlabels[k] or k + local k = usedlabels[k] or k local p = properties[k] if not p then - print("UNDEFINED", k) + report_tags("beware: missing property %s", k) end local n = p and p.namespace if rolemaps and n then @@ -288,6 +300,10 @@ local function makeattribute(t) end end +local shared = { } +local bindex = 0 +local btags = { } + local function makeelement(fulltag,parent) local specification = specifications[fulltag] local tagname = specification.tagname @@ -319,29 +335,76 @@ local function makeelement(fulltag,parent) ColSpan = cols > 1 and cols or nil, } end - end + -- elseif tagname == "math" then + -- if specification.mode == "display" then + -- tagnameused = "displaymath" + -- else + -- tagnameused = "inlinemath" + -- end end -- - local detail = specification.detail - local userdata = specification.userdata + local detail = specification.detail + local userdata = specification.userdata + local actualtext = nil -- usedmapping[tagname] = true -- -- specification.attribute is unique -- - local id = nil - local af = nil + local af = nil + local id = nil if embeddedtags then local tagindex = specification.tagindex if embeddedtags == true or embeddedtags[tagname] then id = f_tagid(tagname,tagindex) - af = job.fileobjreferences.collected[id] - if af then - local r = pdfreference(af) - af = pdfarray { r } - -- embeddedfilelist[#embeddedfilelist+1] = r + local blob = specification.blob + if blob then + local blobindex = mathematics.getblobindex(blob) + if blobindex then + local index = shared[blobindex] + if index then + af = index[1] + btags[blob] = index[2] + else + bindex = bindex + 1 + local blobname = f_tagid(tagname,blobindex) + local blobfile = f_tagfn(tagname,blobindex) + local blobdata = mathematics.getmathblob(blobindex) + af = codeinjections.embedfile { + force = true, + data = blobdata, + name = blobname, + file = blobfile, + -- hash = hash, + hash = id, + forcereference = true, + -- title = "whatever", + mimetype = "application/mathml+xml", + relation = "Supplement", -- bah + } + -- af = pdfarray { af } -- maybe also share this + af = pdfreference(pdfflushobject(pdfarray { af })) -- maybe also share this + shared[blobindex] = { af, blobname } + btags[blob] = blobname + end + actualtext = mathematics.gettextblob(specification.language or "en",blobindex) + if actualtext then + actualtext = pdfunicode(actualtext) + end + end + + else + + -- af = job.fileobjreferences.collected[id] + -- if af then + -- local r = pdfreference(af) + -- af = pdfarray { r } + -- -- embeddedfilelist[#embeddedfilelist+1] = r + -- end + end + end end -- @@ -359,8 +422,8 @@ local function makeelement(fulltag,parent) K = pdfreference(r), -- A = a and makeattribute(a) or nil, A = attributes, - -- Alt = " Who cares ", - -- ActualText = " Hi Hans ", + -- Alt = "Who cares", + ActualText = actualtext or nil, AF = af, } local s = pdfreference(pdfflushobject(d)) @@ -382,8 +445,8 @@ end local f_BDC = formatters["/%s <> BDC"] -local a_destination = attributes.private('destination') -local a_reference = attributes.private('reference') +local a_destination = attributes.private('destination') +local a_reference = attributes.private('reference') local function makecontent(start,parent,id,specification) local tag = parent.tag @@ -434,13 +497,26 @@ end -- no need to adapt head, as we always operate on lists -local EMCliteral = nil -local visualize = nil +local EMCliteral = nil +local visualizetags = nil +local visualizeblobs = nil local enabled = true +local reduced = false + +updaters.register("tagging.state.disable", function() enabled = false end) +updaters.register("tagging.state.enable", function() enabled = true end) + +directives.register("tagging.state.reduced", function(v) reduced = v end) + +function codeinjections.reducetags() + report_tags("only outer level document tag used") + reduced = true +end + +local detailedmath = false -updaters.register("tagging.state.disable",function() enabled = false end) -updaters.register("tagging.state.enable", function() enabled = true end) +directives.register("structures.tags.math.detail", function(v) detailedmath = v end) function nodeinjections.addtags(head) @@ -465,41 +541,87 @@ function nodeinjections.addtags(head) names = pdfarray() end - local function collectranges(head,list) - for n, id in nextnode, head do - if id == glyph_code then - -- maybe also disc - if getchar(n) ~= 0 then - local at = getattr(n,a_tagged) or false -- false: pagebody or so, so artifact - if last ~= at then - range = { at, "glyph", n, n, list } -- attr id start stop list - nofranges = nofranges + 1 - ranges[nofranges] = range - last = at - elseif range then - range[4] = n -- stop + initializepage() + + if reduced then + + local list = getlist(head) + + if list then + + ranges = { + { 1, "glyph", list, tailoflist(list), head } + } + + nofranges = 1 + + taglist = { + { + attribute = 1, + metadata = { }, + tagindex = 1, + taglist = { "document>1" }, + tagname = "document", + }, + } + + end + + else + + local mblob = false + + local function collectranges(head,list) + + for n, id, subtype in nextnode, head do + if id == glyph_code then + -- maybe also disc + if getchar(n) ~= 0 then + local at, blob = getattrs(n,a_tagged,a_mathblob) + if not at then + at = false + end + if detailedmath then + -- skip + elseif blob then + if blob == mblob then + ranges[nofranges] = range + last = at + else + mblob = blob + end + else + mblob = false + end + if last ~= at then + range = { at, "glyph", n, n, list, blob } -- attr id start stop list + nofranges = nofranges + 1 + ranges[nofranges] = range + last = at + elseif range then + range[4] = n -- stop + end end - end - elseif id == hlist_code or id == vlist_code then - local at = getattr(n,a_image) - if at then - local at = getattr(n,a_tagged) or false -- false: pagebody or so, so artifact - nofranges = nofranges + 1 - ranges[nofranges] = { at, "image", n, n, list } -- attr id start stop list - last = nil - else - local list = getlist(n) - if list then - collectranges(list,n) + elseif id == hlist_code or id == vlist_code then + local at = getattr(n,a_image) --todo: gettags + if at then + local at = getattr(n,a_tagged) or false -- false: pagebody or so, so artifact + nofranges = nofranges + 1 + ranges[nofranges] = { at, "image", n, n, list } -- attr id start stop list + last = nil + else + local list = getlist(n) + if list then + collectranges(list,n) + end end end end end - end - initializepage() + collectranges(head) - collectranges(head) + end -- inspect(taglist) -- inspect(ranges) @@ -521,6 +643,8 @@ function nodeinjections.addtags(head) local top = nil local noftop = 0 + local blobdone = { } + local function inject(start,stop,list,literal,left,right) local prev = getprev(start) if prev then @@ -555,11 +679,14 @@ function nodeinjections.addtags(head) for i=1,nofranges do local range = ranges[i] + local mblob = false + local attr = range[1] local id = range[2] local start = range[3] local stop = range[4] local list = range[5] + local blob = range[6] if attr then @@ -582,18 +709,39 @@ function nodeinjections.addtags(head) local prev = common > 0 and elements[taglist[common]] or root - for j=common+1,noftags do - local tag = taglist[j] - local prv = elements[tag] or makeelement(tag,prev) - if prv == false then - -- ignore this one - prev = false - ignore = true - break - elseif prv == true then - -- skip this one - else - prev = prv + if blob and not detailedmath then + for j=common+1,noftags do + local tag = taglist[j] + local prv = elements[tag] or makeelement(tag,prev) + if prv == false then + -- ignore this one + prev = false + ignore = true + break + elseif prv == true then + -- skip this one + else + prev = prv + end + -- this is an ugly hack but ok for now + if find(tag,"^math>") then + break + end + end + else + for j=common+1,noftags do + local tag = taglist[j] + local prv = elements[tag] or makeelement(tag,prev) + if prv == false then + -- ignore this one + prev = false + ignore = true + break + elseif prv == true then + -- skip this one + else + prev = prv + end end end if prev then @@ -609,11 +757,50 @@ function nodeinjections.addtags(head) if trace_info then local name = specification.tagname if name then - if not visualize then - visualize = nodes.visualizers.register("tags") + if not visualizetags then + visualizetags = nodes.visualizers.register("tags") + visualizeblobs = nodes.visualizers.register("blobs",nil,nil,2.5,true) + end + if blob and not blobdone[blob] then + local bname = btags[blob] + if bname then + bname = "M " .. blob .. " " .. bname + else + bname = "M " .. blob + end + blobdone[blob] = true + if detailedmath then + left = visualizeblobs(bname,name) + right = visualizeblobs() + else + left = visualizetags(bname) + right = visualizetags() + end + else + left = visualizetags(name) + right = visualizetags() + end + end + elseif trace_math then + if not visualizetags then + visualizetags = nodes.visualizers.register("tags") + visualizeblobs = nodes.visualizers.register("blobs",nil,nil,2.5,true) + end + if blob and not blobdone[blob] then + local bname = btags[blob] + if bname then + bname = "M " .. blob .. " " .. bname + else + bname = "M " .. blob + end + blobdone[blob] = true + if detailedmath then + left = visualizeblobs(bname,name) + right = visualizeblobs() + else + left = visualizetags(bname) + right = visualizetags() end - left = visualize(name) - right = visualize() end end inject(start,stop,list,literal,left,right) @@ -638,165 +825,22 @@ function nodeinjections.addtags(head) end --- variant: more structure but funny collapsing in viewer - --- function nodeinjections.addtags(head) --- --- local last, ranges, range = nil, { }, nil --- --- local function collectranges(head,list) --- for n, id in nextnode, head do --- if id == glyph_code then --- local at = getattr(n,a_tagged) --- if not at then --- range = nil --- elseif last ~= at then --- range = { at, "glyph", n, n, list } -- attr id start stop list --- ranges[#ranges+1] = range --- last = at --- elseif range then --- range[4] = n -- stop --- end --- elseif id == hlist_code or id == vlist_code then --- local at = getattr(n,a_image) --- if at then --- local at = getattr(n,a_tagged) --- if not at then --- range = nil --- else --- ranges[#ranges+1] = { at, "image", n, n, list } -- attr id start stop list --- end --- last = nil --- else --- local nl = getlist(n) --- collectranges(nl,n) --- end --- end --- end --- end --- --- initializepage() --- --- collectranges(head) --- --- if trace_tags then --- for i=1,#ranges do --- local range = ranges[i] --- local attr = range[1] --- local id = range[2] --- local start = range[3] --- local stop = range[4] --- local tags = taglist[attr] --- if tags then -- not ok ... only first lines --- report_tags("%s => %s : %05i % t",tosequence(start,start),tosequence(stop,stop),attr,tags.taglist) --- end --- end --- end --- --- local top = nil --- local noftop = 0 --- local last = nil --- --- for i=1,#ranges do --- local range = ranges[i] --- local attr = range[1] --- local id = range[2] --- local start = range[3] --- local stop = range[4] --- local list = range[5] --- local specification = taglist[attr] --- local taglist = specification.taglist --- local noftags = #taglist --- local tag = nil --- local common = 0 --- -- local prev = root --- --- if top then --- for i=1,noftags >= noftop and noftop or noftags do --- if top[i] == taglist[i] then --- common = i --- else --- break --- end --- end --- end --- --- local result = { } --- local r = noftop - common --- if r > 0 then --- for i=1,r do --- result[i] = "EMC" --- end --- end --- --- local prev = common > 0 and elements[taglist[common]] or root --- --- for j=common+1,noftags do --- local tag = taglist[j] --- local prv = elements[tag] or makeelement(tag,prev) --- -- if prv == false then --- -- -- ignore this one --- -- prev = false --- -- break --- -- elseif prv == true then --- -- -- skip this one --- -- else --- prev = prv --- r = r + 1 --- result[r] = makecontent(start,prev,id) --- -- end --- end --- --- if r > 0 then --- local literal = setstate(concat(result,"\n")) --- -- use insert instead: --- local literal = setstate(result) --- local prev = getprev(start) --- if prev then --- setlink(prev,literal) --- end --- setlink(literal,start) --- if list and getlist(list) == start then --- setlist(list,literal) --- end --- end --- --- top = taglist --- noftop = noftags --- last = stop --- --- end --- --- if last and noftop > 0 then --- local result = { } --- for i=1,noftop do --- result[i] = "EMC" --- end --- local literal = setstate(concat(result,"\n")) --- -- use insert instead: --- local next = getnext(last) --- if next then --- setlink(literal,next) --- end --- setlink(last,literal) --- end --- --- finishpage() --- --- return head --- --- end +-- variant: more structure but funny collapsing in viewer, only in lua +-- file as commented anyway -- this belongs elsewhere (export is not pdf related) local permitted = true local enabled = false +local shipout = true + +directives.register("structures.tags.shipout",function(v) shipout = v end) function codeinjections.settaggingsupport(option) if option == false then if enabled then disableaction("shipouts","structures.tags.handler") - disableaction("shipouts","nodes.handlers.accessibility") -- maybe not this one + -- disableaction("shipouts","nodes.handlers.accessibility") -- maybe not this one disableaction("math","noads.handlers.tags") enabled = false end @@ -812,10 +856,18 @@ end function codeinjections.enabletags() if permitted and not enabled then structures.tags.handler = nodeinjections.addtags - enableaction("shipouts","structures.tags.handler") - enableaction("shipouts","nodes.handlers.accessibility") + if shipout then + enableaction("shipouts","structures.tags.handler") + end + -- enableaction("shipouts","nodes.handlers.accessibility") enableaction("math","noads.handlers.tags") - -- maybe also textblock + -- + if embeddedtags then + embeddedtags.math = true + else + embeddedtags = { math = true } + end + -- if trace_tags then report_tags("enabling structure tags") end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt index 3047402bc93..99610338ae0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt @@ -55,15 +55,15 @@ local registrations = pdfbackend.registrations local executers = structures.references.executers local variables = interfaces.variables -local v_hidden = variables.hidden -local v_auto = variables.auto -local v_embed = variables.embed -local v_max = variables.max -local v_yes = variables.yes -local v_no = variables.no -local v_compress = variables.compress -local v_list = variables.list -local v_title = variables.title +local v_hidden = variables.hidden +local v_auto = variables.auto +local v_embed = variables.embed +local v_max = variables.max +local v_yes = variables.yes +local v_no = variables.no +local v_compress = variables.compress +local v_list = variables.list +local v_title = variables.title local lpdf = lpdf @@ -285,8 +285,10 @@ end lpdf.registerdocumentfinalizer(flushembeddedfiles,"embeddedfiles") +-- relation: Supplement, Data, Source, Alternative, Data + function codeinjections.embedfile(specification) - if enabled then + if enabled or specification.force then local data = specification.data local filename = specification.file local name = specification.name or "" @@ -297,6 +299,7 @@ function codeinjections.embedfile(specification) local filetype = specification.filetype local compress = specification.compress local mimetype = specification.mimetype or specification.mime + local relation = specification.relation or "Unspecified" if filename == "" then filename = nil end @@ -371,7 +374,7 @@ function codeinjections.embedfile(specification) UF = pdfunicode(savename), EF = pdfdictionary { F = pdfreference(f) }, Desc = title ~= "" and pdfunicode(title) or nil, - AFRelationship = pdfconstant("Unspecified"), -- Supplement, Data, Source, Alternative, Data + AFRelationship = pdfconstant(relation), } local r = pdfreference(pdfflushobject(d)) filestreams[hash] = r diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt index aec12b22f85..a1e7a1a8d54 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt @@ -8,13 +8,13 @@ if not modules then modules = { } end modules ['lpdf-xmp'] = { } local tostring, type = tostring, type -local format, gsub, match = string.format, string.gsub, string.match +local format, gsub, match, rep, count = string.format, string.gsub, string.match, string.rep, string.count local concat = table.concat -local settings_to_array = utilities.parsers.settings_to_array local utfchar = utf.char -local xmlfillin = xml.fillin local md5HEX = md5.HEX +local xmlfillin, xmldelete, xmltext = xml.fillin, xml.delete, xml.text local osdate, ostime, ostimezone, osuuid = os.date, os.time, os.timezone, os.uuid +local settings_to_array = utilities.parsers.settings_to_array local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end) local trace_info = false trackers.register("backend.info", function(v) trace_info = v end) @@ -52,7 +52,6 @@ local mapping = table.setmetatableindex ( { ["ConTeXt.Url"] = { "context", "rdf:Description/pdfx:ConTeXt.Url" }, ["ConTeXt.Support"] = { "context", "rdf:Description/pdfx:ConTeXt.Support" }, ["ConTeXt.Version"] = { "context", "rdf:Description/pdfx:ConTeXt.Version" }, - ["ConTeXt.LMTX"] = { "context", "rdf:Description/pdfx:ConTeXt.LMTX" }, ["TeX.Support"] = { "metadata","rdf:Description/pdfx:TeX.Support" }, ["LuaTeX.Version"] = { "metadata","rdf:Description/pdfx:LuaTeX.Version" }, ["LuaTeX.Functionality"] = { "metadata","rdf:Description/pdfx:LuaTeX.Functionality" }, @@ -60,19 +59,23 @@ local mapping = table.setmetatableindex ( { ["LuaTeX.Platform"] = { "metadata","rdf:Description/pdfx:LuaTeX.Platform" }, ["ID"] = { "id", "rdf:Description/pdfx:ID" }, -- has date -- Adobe PDF schema - ["Keywords"] = { "metadata","rdf:Description/pdf:Keywords" }, - ["Producer"] = { "metadata","rdf:Description/pdf:Producer" }, + ["Keywords"] = { "metadata","rdf:Description/pdf:Keywords", true }, + ["Producer"] = { "metadata","rdf:Description/pdf:Producer", true }, -- ["Trapped"] = { "pdf", "rdf:Description/pdf:Trapped" }, -- '/False' in /Info, but 'False' in XMP -- Dublin Core schema ["Format"] = { "metadata","rdf:Description/dc:format" }, -- optional, but nice to have - -- These were dc:.../rdf:Seq/rdf:li but there was a (invalidating) bug in the iso - ["Author"] = { "metadata","rdf:Description/dc:creator" }, - ["Subject"] = { "metadata","rdf:Description/dc:description" }, - ["Title"] = { "metadata","rdf:Description/dc:title" }, + -- see xml file for comment: + -- ["Author"] = { "metadata","rdf:Description/dc:creator" }, + -- ["Subject"] = { "metadata","rdf:Description/dc:description" }, + -- ["Title"] = { "metadata","rdf:Description/dc:title" }, + ["Author"] = { "metadata","rdf:Description/dc:creator/rdf:Seq/rdf:li", true }, + ["Subject"] = { "metadata","rdf:Description/dc:description/rdf:Alt/rdf:li", true }, + ["Title"] = { "metadata","rdf:Description/dc:title/rdf:Alt/rdf:li", true }, -- XMP Basic schema ["CreateDate"] = { "date", "rdf:Description/xmp:CreateDate" }, ["CreationDate"] = { "date", "rdf:Description/xmp:CreationDate" }, -- dummy - ["Creator"] = { "metadata","rdf:Description/xmp:CreatorTool" }, + ["CreatorTool"] = { "metadata","rdf:Description/xmp:CreatorTool" }, + -- ["Creator"] = { "metadata","rdf:Description/xmp:CreatorTool" }, ["MetadataDate"] = { "date", "rdf:Description/xmp:MetadataDate" }, ["ModDate"] = { "date", "rdf:Description/xmp:ModDate" }, -- dummy ["ModifyDate"] = { "date", "rdf:Description/xmp:ModifyDate" }, @@ -95,6 +98,8 @@ local mapping = table.setmetatableindex ( { ["AuthorsPosition"] = { "metadata", "rdf:Description/photoshop:AuthorsPosition" }, ["Copyright"] = { "metadata", "rdf:Description/photoshop:Copyright" }, ["CaptionWriter"] = { "metadata", "rdf:Description/photoshop:CaptionWriter" }, + -- + ["Placeholder"] = { "metadata", "pdfaid-placeholder", true } }, function() return unknown end ) @@ -107,7 +112,7 @@ local function pdftimestamp(str) local t = type(str) if t == "string" then local Y, M, D, h, m, s, Zs, Zh, Zm = match(str,"^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)([%+%-])(%d%d):(%d%d)$") - return Y and format("D:%s%s%s%s%s%s%s%s'%s'",Y,M,D,h,m,s,Zs,Zh,Zm) + return Y and format("D:%s%s%s%s%s%s%s%s'%s",Y,M,D,h,m,s,Zs,Zh,Zm) else return osdate("D:%Y%m%d%H%M%S",t == "number" and str or ostime()) -- maybe "!D..." : universal time end @@ -116,14 +121,21 @@ end local function pdfgetmetadata() if not metadata then local contextversion = environment.version - local luatexversion = format("%1.2f",LUATEXVERSION) + local luatexversion = LUATEXVERBOSE local luatexfunctionality = tostring(LUATEXFUNCTIONALITY) local jobname = environment.jobname or tex.jobname or "unknown" local documentid = trailerid and ("uuid:" .. osuuid()) or "no unique document id here" local instanceid = trailerid and ("uuid:" .. osuuid()) or "no unique instance id here" + local producer = "LuaMetaTeX" + local creator = format("LuaMetaTeX %s %s + ConTeXt LMTX %s",luatexversion,luatexfunctionality,contextversion) metadata = creationdate and { - producer = format("LuaMetaTeX-%s",luatexversion), - creator = format("LuaMetaTeX %s %s + ConTeXt LMTX %s",luatexversion,luatexfunctionality,contextversion), + producer = producer, + creator = creator, + id = format("%s | %s",jobname,creationdate), + documentid = documentid, + instanceid = instanceid, + jobname = jobname, + -- luatexversion = luatexversion, contextversion = contextversion, luatexfunctionality = luatexfunctionality, @@ -131,13 +143,9 @@ local function pdfgetmetadata() platform = os.platform, creationdate = creationdate, modificationdate = modificationdate, - id = format("%s | %s",jobname,creationdate), - documentid = documentid, - instanceid = instanceid, - jobname = jobname, } or { - producer = "LuaMetaTeX", - creator = "LuaMetaTeX + ConTeXt LMTX", + producer = producer, + creator = creator, id = jobname, documentid = documentid, instanceid = instanceid, @@ -244,7 +252,12 @@ end function lpdf.addxmpinfo(tag,value,check) local pattern = mapping[tag][2] if type(pattern) == "string" then - xmlfillin(xmp or valid_xmp(),pattern,value,check) + if not xmp then + xmp = valid_xmp() + end + if xmp and value then + xmlfillin(xmp,pattern,value,check) + end end end @@ -279,20 +292,41 @@ function lpdf.injectxmpinfo(pattern,whatever,prepend) xml.inject(xmp or valid_xmp(),pattern,whatever,prepend) end +function lpdf.replacexmpinfo(pattern,whatever) + xml.replace(xmp or valid_xmp(),pattern,whatever) +end + -- flushing local add_xmp_blob = true -local indentity_done = false -- using "setupidentity = function() end" fails as the meaning is frozen in register +-- indentity_done = false -- using "setupidentity = function() end" fails as the meaning is frozen in register + +local checkidentity + +checkidentity = function(metadata) + local identity = interactions.general.getidentity() + metadata.title = identity.title + metadata.subtitle = identity.subtitle + metadata.author = identity.author + metadata.date = identity.date + metadata.keywords = identity.keywords + checkidentity = false +end local function setupidentity() - if not done then + -- if not identity_done then -- - local identity = interactions.general.getidentity() - local title = identity.title - local subtitle = identity.subtitle - local author = identity.author - local date = identity.date - local keywords = identity.keywords + local metadata = pdfgetmetadata() + + if checkidentity then + checkidentity(metadata) + end + + local title = metadata.title + local subtitle = metadata.subtitle + local author = metadata.author + local date = metadata.date + local keywords = metadata.keywords -- if date and date ~= "" then pdfsetmetadate(date) @@ -301,12 +335,10 @@ local function setupidentity() keywords = concat(settings_to_array(keywords), " ") end -- - local metadata = pdfgetmetadata() local creator = metadata.creator local contextversion = metadata.contextversion local id = metadata.id local jobname = metadata.jobname - local creator = metadata.creator local creation = metadata.creationdate local modification = metadata.modificationdate -- @@ -323,14 +355,14 @@ local function setupidentity() pdfaddtoinfo("ID",pdfstring(id),id) -- needed for pdf/x end -- - if title ~= "" then + if title and title ~= "" then pdfaddtoinfo("Title",pdfunicode(title),title) end - if subtitle ~= "" then + if subtitle and subtitle ~= "" then pdfaddtoinfo("Subject",pdfunicode(subtitle),subtitle) end - if author ~= "" then - pdfaddtoinfo("Author",pdfunicode(author),author) -- '/Author' in /Info, 'Creator' in XMP + if author and author ~= "" then + pdfaddtoinfo("Author",pdfunicode(author),author) end if keywords and keywords ~= "" then pdfaddtoinfo("Keywords",pdfunicode(keywords),keywords) @@ -351,27 +383,33 @@ local function setupidentity() pdfaddtoinfo("ConTeXt.Support","contextgarden.net") pdfaddtoinfo("TeX.Support","tug.org") -- - done = true - else - -- no need for a message - end + -- identity_done = true + -- else + -- -- no need for a message + -- end + return metadata end local function flushxmpinfo() commands.pushrandomseed() commands.setrandomseed(ostime()) - local metadata = pdfgetmetadata() - local time = metadata.time - local producer = metadata.producer - local creator = metadata.creator - local documentid = metadata.documentid - local instanceid = metadata.instanceid + local metadata = setupidentity() -- tod: merge into here and save code + -- local metadata = pdfgetmetadata() + -- if checkidentity then + -- checkidentity(metadata) + -- end + local creation = metadata.time or metadata.creationdate or creationdate + local modification = metadata.time or metadata.modificationdate or modificationdate or creation + local producer = metadata.producer + local creator = metadata.creator + local documentid = metadata.documentid + local instanceid = metadata.instanceid pdfaddtoinfo("Producer",producer) pdfaddtoinfo("Creator",creator) - pdfaddtoinfo("CreationDate",time) - pdfaddtoinfo("ModDate",time) + pdfaddtoinfo("CreationDate",creation) + pdfaddtoinfo("ModDate",modification) if add_xmp_blob then @@ -379,14 +417,47 @@ local function flushxmpinfo() pdfaddxmpinfo("InstanceID",instanceid) pdfaddxmpinfo("Producer",producer) pdfaddxmpinfo("CreatorTool",creator) - pdfaddxmpinfo("CreateDate",time) - pdfaddxmpinfo("ModifyDate",time) - pdfaddxmpinfo("MetadataDate",time) + pdfaddxmpinfo("CreateDate",creation) + pdfaddxmpinfo("ModifyDate",modification) + pdfaddxmpinfo("MetadataDate",creation) pdfaddxmpinfo("LuaTeX.Version",metadata.luatexversion) pdfaddxmpinfo("LuaTeX.Functionality",metadata.luatexfunctionality) pdfaddxmpinfo("LuaTeX.LuaVersion",metadata.luaversion) pdfaddxmpinfo("LuaTeX.Platform",metadata.platform) + local title = metadata.title + local subtitle = metadata.subtitle + local author = metadata.author + local keywords = metadata.keywords + + -- We need to wipe some fields in the xml because otherwise validators + -- complain ... they don't see an empty (nonexistent, default) info field + -- as being the same as an empty element. + + if title and title ~= "" then + pdfaddxmpinfo("Title",pdfunicode(title),title) + end + if subtitle and subtitle ~= "" then + pdfaddxmpinfo("Subject",pdfunicode(subtitle),subtitle) + end + if author and author ~= "" then + pdfaddxmpinfo("Author",pdfunicode(author),author) + end + if keywords and keywords ~= "" then + pdfaddxmpinfo("Keywords",pdfunicode(author),author) + end + + -- checks for empty: + + for tag, map in next, mapping do + if map[3] == true then + local pattern = map[2] + if type(pattern) == "string" and xmltext(xmp,pattern) == "" then + xmldelete(xmp,pattern .. rep("/..",count(pattern,"/")-1)) + end + end + end + local blob = xml.tostring(xml.first(xmp or valid_xmp(),"/x:xmpmeta")) local md = pdfdictionary { Subtype = pdfconstant("XML"), @@ -405,6 +476,16 @@ local function flushxmpinfo() blob = format(xpacket,blob) if not verbose and lpdf.compresslevel() > 0 then blob = gsub(blob,">%s+<","><") + else + -- todo: lpeg + while true do + local b = gsub(blob,"\n +\n( +<)","\n%1") + if b == blob then + break + else + blob = b + end + end end local r = pdfflushstreamobject(blob,md,false) -- uncompressed lpdf.addtocatalog("Metadata",pdfreference(r)) @@ -414,7 +495,7 @@ local function flushxmpinfo() commands.poprandomseed() -- hack end -lpdf.registerpagefinalizer(setupidentity,"identity") +-- lpdf.registerpagefinalizer(setupidentity,"identity") lpdf.registerdocumentfinalizer(flushxmpinfo,1,"metadata") directives.register("backend.xmp", function(v) add_xmp_blob = v end) diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl b/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl index 20d6c88fcab..1f9ec006c91 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl @@ -13,9 +13,9 @@ \writestatus{loading}{ConTeXt Lua Macros / Basic Lua Libraries} -\registerctxluafile{l-bit32} {} % before sandbox -\registerctxluafile{l-lua} {} % before sandbox -\registerctxluafile{l-macro} {} +\registerctxluafile{l-bit32} {autosuffix} % before sandbox +\registerctxluafile{l-lua} {autosuffix} % before sandbox +%registerctxluafile{l-macro} {} \registerctxluafile{l-sandbox} {} \registerctxluafile{l-package} {} \registerctxluafile{l-lpeg} {} @@ -36,7 +36,7 @@ \registerctxluafile{l-url} {} \registerctxluafile{l-set} {} -\registerctxluafile{l-macro-imp-optimize}{} +%registerctxluafile{l-macro-imp-optimize}{} % \registerctxluafile{socket}{} % \registerctxluafile{ltn12} {} diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-cbk.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-cbk.lmt index 1726f1e5a63..a2a319a1950 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-cbk.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-cbk.lmt @@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['luat-cbk'] = { local insert, remove, concat = table.insert, table.remove, table.concat local find, format = string.find, string.format -local collectgarbage, type, next = collectgarbage, type, next +local type, next = type, next local round = math.round local sortedhash, sortedkeys, tohash = table.sortedhash, table.sortedkeys, table.tohash diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt index 5859411731a..510ed5ad6af 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt @@ -43,41 +43,29 @@ function texconfig.init() libraries = { -- we set it here as we want libraries also 'indexed' basiclua = { - -- always "string", "table", "coroutine", "debug", "file", "io", "lpeg", "math", "os", "package", - -- bonus - "bit32", "utf8", + "utf8", }, basictex = { - -- always "callback", "font", "lua", "node", "status", "tex", "texconfig", "texio", "token", - -- not in luametatex - "img", "pdf", "lang", - -- in luametatex - "language", + "font", "language", }, extralua = { - -- not in luametatex - "unicode", "utf", "gzip", "zip", "zlib", - -- in luametatex - "xzip", "xmath", "xcomplex", "xdecimal", "basexx", "posit", - -- maybe some day in luametatex - "lz4", "lzo", - -- always (mime can go) - "lfs","socket", "mime", "md5", "sha2", "fio", "sio", + "library", "luac", + "xzip", "xmath", "xcomplex", "xdecimal", "basexx", "posit", "sparse", + "md5", "sha2", "aes", "fio", "sio", + "lfs","socket", }, extratex = { - -- not in luametatex - "kpse", - -- always - "pdfe", "mplib", - -- in luametatex + "pdfe", "mplib", "potrace", "pdfdecode", "pngdecode", }, + optional = { + "cerf", "curl", "foreign", "ghostscript", "graphicsmagick", "hb", "imagemagick", + "kpse", "lzma", "lzo", "lz4", "mujs", "mysql", "optional", "postgress", "sqlite", + "zint", "zstd", + }, obsolete = { - "epdf", - "fontloader", -- can be filled by luat-log - "kpse", }, functions = { "assert", "pcall", "xpcall", "error", "collectgarbage", @@ -122,6 +110,7 @@ function texconfig.init() libraries.extratex = collect(libraries.extratex) libraries.functions = collect(libraries.functions,true) libraries.obsolete = collect(libraries.obsolete) + libraries.optional = collect(libraries.optional) -- shortcut and helper diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt index f96f5c57757..7647544c199 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt @@ -79,7 +79,7 @@ function lua.registercode(filename,options) if barename == filename then filename = filename .. (opts.autosuffix and ".lmt" or ".lua") end - local code = environment.luafilechunk(filename,false,opts.optimize) + local code = environment.luafilechunk(filename,false,opts.optimize,opts.optional) if code then bytedone[basename] = true if environment.initex and not opts.initexonly then @@ -92,6 +92,8 @@ function lua.registercode(filename,options) end lua.lastbytecode = n end + elseif opts.optional then + -- we're fine elseif environment.initex then texio.writenl(format("\nerror loading file: %s (aborting)",filename)) os.exit() @@ -123,7 +125,11 @@ if LUATEXENGINE == nil then end if LUATEXVERSION == nil then - LUATEXVERSION = status.luatex_version/100 + tonumber(status.luatex_revision)/10000 + LUATEXVERSION = status.version +end + +if LUATEXVERBOSE == nil then + LUATEXVERBOSE = status.luatex_verbose end if CONTEXTLMTXMODE == nil then @@ -138,16 +144,14 @@ if LUATEXFORMATID == nil then LUATEXFORMATID = status.format_id or 0 end -JITSUPPORTED = false - if INITEXMODE == nil then INITEXMODE = status.run_state == 0 -- initializing updating production end environment.luatexengine = LUATEXENGINE environment.luatexversion = LUATEXVERSION +environment.luatexverbose = LUATEXVERBOSE environment.luatexfunctionality = LUATEXFUNCTIONALITY -environment.jitsupported = JITSUPPORTED environment.initex = INITEXMODE environment.initexmode = INITEXMODE diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt index 56e3bd1c18d..a42503d537c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt @@ -23,11 +23,11 @@ if not global then global = _G end -LUATEXVERSION = status.luatex_version/100 + tonumber(status.luatex_revision)/10000 +LUATEXVERSION = status.version +LUATEXVERBOSE = status.luatex_verbose LUATEXENGINE = string.lower(status.luatex_engine or "luametatex") LUATEXFUNCTIONALITY = status.development_id or 6346 LUATEXFORMATID = status.format_id or 0 -JITSUPPORTED = false INITEXMODE = status.ini_version CONTEXTLMTXMODE = 1 diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl index d1a84f60cc3..cf10550c9d5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl @@ -136,7 +136,7 @@ \permanent\protected\def\obeyluatokens {\setcatcodetable\luacatcodes - \the\everyluacode} + \expand\everyluacode} \immutable\edef\luamajorversion{\ctxwrite{LUAMINORVERSION}} \immutable\edef\luaminorversion{\ctxwrite{LUAMAJORVERSION}} @@ -309,8 +309,11 @@ {\edef\m_syst_name{\csstring#1}% \global\protected\expandafter\normalluadef\csname\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name",\!!bs#2\!!es,true)}\relax} +% \permanent\protected\def\resetctxscanner#1% +% {\edef\m_syst_name{\csstring#1}% +% \gletcsname\m_syst_name\endcsname\relax} % or better nothing + \permanent\protected\def\resetctxscanner#1% - {\edef\m_syst_name{\csstring#1}% - \gletcsname\m_syst_name\endcsname\relax} + {\global\expandafter\lettonothing\csname\csstring#1\endcsname} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl b/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl index d701fd2937e..91bea70b080 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl @@ -19,7 +19,7 @@ \registerctxluafile{util-sac}{autosuffix} \registerctxluafile{util-sto}{} % could also be done in trac-deb.mkiv \registerctxluafile{util-pck}{autosuffix} -\registerctxluafile{util-prs}{} +\registerctxluafile{util-prs}{autosuffix} \registerctxluafile{util-fmt}{} \registerctxluafile{util-dim}{} @@ -78,7 +78,6 @@ \registerctxluafile{luat-run}{autosuffix} \registerctxluafile{luat-fio}{autosuffix} \registerctxluafile{luat-cnf}{autosuffix,initexonly} -\registerctxluafile{luat-lua}{} \registerctxluafile{luat-sto}{} \registerctxluafile{luat-ini}{autosuffix} \registerctxluafile{util-env}{} diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt index 0c2405b7598..d4efd4119ad 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt @@ -22,8 +22,6 @@ local format, gmatch, find = string.format, string.gmatch, string.find local concat, insert, remove = table.concat, table.insert, table.remove local topattern = string.topattern local utfchar = utf.char -local datetime = os.date -local openfile = io.open local writenl = texio.writeselectornl local writelf = texio.writeselectorlf @@ -162,6 +160,18 @@ do targets = variants.default.targets, } +-- do +-- local iosize = 512 +-- local iomode = "line" +-- local ioflush = io.flush +-- local iooutput = io.output +-- iooutput():setvbuf(iomode,iosize) +-- io.flush = function() +-- -- ioflush() +-- -- iooutput():setvbuf(iomode,iosize) +-- end +-- end + logs.flush = io.flush writer = function(...) @@ -340,6 +350,8 @@ do end +-- io.output():setvbuf("line",1024) + logs.report = report logs.subreport = subreport logs.status = status @@ -452,9 +464,9 @@ local function setblocked(category,value) -- v.state == value == true : disable if v then v.state = value else - c = topattern(c,true,true) + local p = topattern(c,true,true) for k, v in next, data do - if find(k,c) then + if find(k,p) then v.state = value end end @@ -604,8 +616,8 @@ end -- we don't have show_open and show_close callbacks yet do - local texerror = tex and tex.error or print - local formatters = string.formatters + + local texerror = tex and tex.error or print function logs.texerrormessage(fmt,first,...) -- for the moment we put this function here texerror(first and formatters[fmt](first,...) or fmt) @@ -774,3 +786,29 @@ function logs.application(t) version = dummy, } end + +-- for old times sake + +do + + local datetime = os.date + local sleep = os.sleep + local openfile = io.open + + local f_syslog = formatters["%s %s => %s => %s => %s\r"] + + function logs.system(whereto,process,jobname,category,fmt,arg,...) + local message = f_syslog(datetime("%d/%m/%y %H:%m:%S"),process,jobname,category,arg == nil and fmt or format(fmt,arg,...)) + for i=1,10 do + local f = openfile(whereto,"a") -- we can consider keeping the file open + if f then + f:write(message) + f:close() + break + else + sleep(0.1) + end + end + end + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt index 7796bb4b924..174ddfa7e7b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt @@ -47,7 +47,6 @@ local function start_run() if logs.start_run then logs.start_run() end - -- logs.report("engine","%s version %s, format id %s",LUATEXENGINE,LUATEXVERSION,LUATEXFORMATID) for i=1,#startactions do startactions[i]() end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lxml-css.lmt b/Master/texmf-dist/tex/context/base/mkxl/lxml-css.lmt new file mode 100644 index 00000000000..c94409a5117 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/lxml-css.lmt @@ -0,0 +1,1193 @@ +if not modules then modules = { } end modules ['lxml-css'] = { + version = 1.001, + comment = "companion to lxml-css.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local tonumber, rawset, type, select = tonumber, rawset, type, select +local lower, format, find, gmatch = string.lower, string.format, string.find, string.gmatch +local topattern, is_empty = string.topattern, string.is_empty +local P, S, C, R, Cb, Cg, Carg, Ct, Cc, Cs = lpeg.P, lpeg.S, lpeg.C, lpeg.R, lpeg.Cb, lpeg.Cg, lpeg.Carg, lpeg.Ct, lpeg.Cc, lpeg.Cs +----- Cf = lpeg.Cf +local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns +local sort = table.sort +local setmetatableindex = table.setmetatableindex + +xml.css = xml.css or { } +local css = xml.css + +local report_css = logs and logs.reporter("xml","css") or function(...) print(string.format(...)) end + +local getid = lxml and lxml.getid + +if not number.dimenfactors then + require("util-dim.lua") +end + +local dimenfactors = number.dimenfactors +local bpf = 1/dimenfactors.bp +local cmf = 1/dimenfactors.cm +local mmf = 1/dimenfactors.mm +local inf = 1/dimenfactors["in"] + +local whitespace = lpegpatterns.whitespace +local skipspace = whitespace^0 + +local percentage, exheight, emwidth, pixels + +if tex then + + local exheights = fonts.hashes.exheights + local emwidths = fonts.hashes.emwidths + local texget = tex.get + + percentage = function(s,pcf) return tonumber(s) * (pcf or texget("hsize")) end + exheight = function(s,exf) return tonumber(s) * (exf or exheights[true]) end + emwidth = function(s,emf) return tonumber(s) * (emf or emwidths[true]) end + pixels = function(s,pxf) return tonumber(s) * (pxf or emwidths[true]/300) end + +else + + local function generic(s,unit) return tonumber(s) * unit end + + percentage = generic + exheight = generic + emwidth = generic + pixels = generic + +end + +local validdimen = Cg(lpegpatterns.number,'a') * ( + Cb('a') * P("pt") / function(s) return tonumber(s) * bpf end + + Cb('a') * P("cm") / function(s) return tonumber(s) * cmf end + + Cb('a') * P("mm") / function(s) return tonumber(s) * mmf end + + Cb('a') * P("in") / function(s) return tonumber(s) * inf end + + Cb('a') * P("px") * Carg(1) / pixels + + Cb('a') * P("%") * Carg(2) / percentage + + Cb('a') * P("ex") * Carg(3) / exheight + + Cb('a') * P("em") * Carg(4) / emwidth + + Cb('a') * Carg(1) / pixels + ) + +local pattern = (validdimen * skipspace)^1 + +-- todo: default if "" + +local function dimension(str,pixel,percent,exheight,emwidth) + return (lpegmatch(pattern,str,1,pixel,percent,exheight,emwidth)) +end + +local function padding(str,pixel,percent,exheight,emwidth) + local top, bottom, left, right = lpegmatch(pattern,str,1,pixel,percent,exheight,emwidth) + if not bottom then + bottom, left, right = top, top, top + elseif not left then + bottom, left, right = top, bottom, bottom + elseif not right then + bottom, left, right = left, bottom, bottom + end + return top, bottom, left, right +end + +css.dimension = dimension +css.padding = padding + +-- local hsize = 655360*100 +-- local exheight = 65536*4 +-- local emwidth = 65536*10 +-- local pixel = emwidth/100 +-- +-- print(padding("10px",pixel,hsize,exheight,emwidth)) +-- print(padding("10px 20px",pixel,hsize,exheight,emwidth)) +-- print(padding("10px 20px 30px",pixel,hsize,exheight,emwidth)) +-- print(padding("10px 20px 30px 40px",pixel,hsize,exheight,emwidth)) +-- +-- print(padding("10%",pixel,hsize,exheight,emwidth)) +-- print(padding("10% 20%",pixel,hsize,exheight,emwidth)) +-- print(padding("10% 20% 30%",pixel,hsize,exheight,emwidth)) +-- print(padding("10% 20% 30% 40%",pixel,hsize,exheight,emwidth)) +-- +-- print(padding("10",pixel,hsize,exheight,emwidth)) +-- print(padding("10 20",pixel,hsize,exheight,emwidth)) +-- print(padding("10 20 30",pixel,hsize,exheight,emwidth)) +-- print(padding("10 20 30 40",pixel,hsize,exheight,emwidth)) +-- +-- print(padding("10pt",pixel,hsize,exheight,emwidth)) +-- print(padding("10pt 20pt",pixel,hsize,exheight,emwidth)) +-- print(padding("10pt 20pt 30pt",pixel,hsize,exheight,emwidth)) +-- print(padding("10pt 20pt 30pt 40pt",pixel,hsize,exheight,emwidth)) + +-- print(padding("0",pixel,hsize,exheight,emwidth)) + +local context = context + +if context then + + local currentfont = font.current + local texget = tex.get + local hashes = fonts.hashes + local quads = hashes.quads + local xheights = hashes.xheights + + local function todimension(str) + local font = currentfont() + local exheight = xheights[font] + local emwidth = quads[font] + local hsize = texget("hsize")/100 + local pixel = emwidth/100 + return dimension(str,pixel,hsize,exheight,emwidth) + end + + css.todimension = todimension + + function context.cssdimension(str) + -- context("%ssp",todimension(str)) + context(todimension(str) .. "sp") + end + +end + + +do + + local p_digit = lpegpatterns.digit + local p_unquoted = Cs(lpegpatterns.unquoted) + local p_size = (S("+-")^0 * (p_digit^0 * P(".") * p_digit^1 + p_digit^1 * P(".") + p_digit^1)) / tonumber + * C(P("p") * S("txc") + P("e") * S("xm") + S("mc") * P("m") + P("in") + P("%")) + +-- local pattern = Cf( Ct("") * ( +-- Cg( +-- Cc("style") * ( +-- C("italic") +-- + C("oblique") +-- + C("slanted") / "oblique" +-- ) +-- + Cc("variant") * ( +-- (C("smallcaps") + C("caps")) / "small-caps" +-- ) +-- + Cc("weight") * ( +-- C("bold") +-- ) +-- + Cc("family") * ( +-- (C("mono") + C("type")) / "monospace" -- just ignore the "space(d)" +-- + (C("sansserif") + C("sans")) / "sans-serif" -- match before serif +-- + C("serif") +-- ) +-- + Cc("size") * Ct(p_size) +-- ) +-- + P(1) +-- )^0 , rawset) + + local pattern = Ct("") * ( + Cg( + Cc("style") * ( + C("italic") + + C("oblique") + + C("slanted") / "oblique" + ) + + Cc("variant") * ( + (C("smallcaps") + C("caps")) / "small-caps" + ) + + Cc("weight") * ( + C("bold") + ) + + Cc("family") * ( + (C("mono") + C("type")) / "monospace" -- just ignore the "space(d)" + + (C("sansserif") + C("sans")) / "sans-serif" -- match before serif + + C("serif") + ) + + Cc("size") * Ct(p_size) + ) % rawset + + P(1) + )^0 + + function css.fontspecification(str) + return str and lpegmatch(pattern,lower(str)) + end + + -- These map onto context! + + function css.style(str) + if str and str ~= "" then + str = lower(str) + if str == "italic" then + return "italic" + elseif str == "slanted" or str == "oblique" then + return "slanted" + end + end + return "normal" + end + + function css.variant(str) -- will change to a feature + if str and str ~= "" then + str = lower(str) + if str == "small-caps" or str == "caps" or str == "smallcaps" then + return "caps" + end + end + return "normal" + end + + function css.weight(str) + if str and str ~= "" then + str = lower(str) + if str == "bold" then + return "bold" + end + end + return "normal" + end + + function css.family(str) + if str and str ~= "" then + str = lower(str) + if str == "mono" or str == "type" or str == "monospace" then + return "mono" + elseif str == "sansserif" or str == "sans" then + return "sans" + elseif str == "serif" then + return "serif" + else + -- what if multiple ... + return lpegmatch(p_unquoted,str) or str + end + end + end + + function css.size(str,factors, pct) + local size, unit + if type(str) == "table" then + size, unit = str[1], str[2] + elseif str and str ~= "" then + size, unit = lpegmatch(p_size,lower(str)) + end + if size and unit then + if unit == "%" and pct then + return size * pct + elseif factors then + return (factors[unit] or 1) * size + else + return size, unit + end + end + end + + function css.colorspecification(str) + if str and str ~= "" then + local c = attributes.colors.values[tonumber(str)] + if c then + return format("rgb(%s%%,%s%%,%s%%)",c[3]*100,c[4]*100,c[5]*100) + end + end + end + +end + +-- The following might be handy. It hooks into the normal parser as +-- and should work ok with the rest. It's sometimes even a bit faster but that might +-- change. It's somewhat optimized but not too aggressively. + +-- element-1 > element-2 : element-2 with parent element-1 + +local function s_element_a(list,collected,c,negate,str,dummy,dummy,n) + local all = str == "*" + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + local ok = all or ll.tg == str + if negate then + ok = not ok + end + if ok then + c = c + 1 + collected[c] = ll + end + if (not n or n > 1) and dt then + c = s_element_a(dt,collected,c,negate,str,dummy,dummy,n and n+1 or 1) + end + end + end + return c +end + +-- element-1 + element-2 : element-2 preceded by element-1 + +local function s_element_b(list,collected,c,negate,str) + local all = str == "*" + for l=1,#list do + local ll = list[l] + local pp = ll.__p__ + if pp then + local dd = pp.dt + if dd then + local ni = ll.ni + local d = dd[ni+1] + local dt = d and d.dt + if not dt then + d = dd[ni+2] + dt = d and d.dt + end + if dt then + local ok = all or d.tg == str + if negate then + ok = not ok + end + if ok then + c = c + 1 + collected[c] = d + end + end + end + end + end + return c +end + +-- element-1 ~ element-2 : element-2 preceded by element-1 -- ? + +local function s_element_c(list,collected,c,negate,str) + local all = str == "*" + for l=1,#list do + local ll = list[l] + local pp = ll.__p__ + if pp then + local dt = pp.dt + if dt then + local ni = ll.ni + for i=ni+1,#dt do + local d = dt[i] + local dt = d.dt + if dt then + local ok = all or d.tg == str + if negate then + ok = not ok + end + if ok then + c = c + 1 + collected[c] = d + end + end + end + end + end + end + return c +end + +-- element +-- element-1 element-2 : element-2 inside element-1 + +local function s_element_d(list,collected,c,negate,str) + if str == "*" then + if not negate then + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + if not ll.special then + c = c + 1 + collected[c] = ll + end + c = s_element_d(dt,collected,c,negate,str) + end + end + end + else + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + if not ll.special then + local ok = ll.tg == str + if negate then + ok = not ok + end + if ok then + c = c + 1 + collected[c] = ll + end + end + c = s_element_d(dt,collected,c,negate,str) + end + end + end + return c +end + +-- [attribute] +-- [attribute=value] equals +-- [attribute~=value] contains word +-- [attribute^="value"] starts with +-- [attribute$="value"] ends with +-- [attribute*="value"] contains + +-- .class (no need to optimize) +-- #id (no need to optimize) + +local function s_attribute(list,collected,c,negate,str,what,value) + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + local at = ll.at + if at then + local v = at[str] + local ok = negate + if v then + if not what then + ok = not negate + elseif what == 1 then + if v == value then + ok = not negate + end + elseif what == 2 then + -- todo: lpeg + if find(v,value) then -- value can be a pattern + ok = not negate + end + elseif what == 3 then + -- todo: lpeg + if find(v," ",1,true) then + for s in gmatch(v,"[^ ]+") do + if s == value then + ok = not negate + break + end + end + elseif v == value then + ok = not negate + end + end + end + if ok then + c = c + 1 + collected[c] = ll + end + end + c = s_attribute(dt,collected,c,negate,str,what,value) + end + end + return c +end + +-- :nth-child(n) +-- :nth-last-child(n) +-- :first-child +-- :last-child + +local function filter_down(collected,c,negate,dt,a,b) + local t = { } + local n = 0 + for i=1,#dt do + local d = dt[i] + if type(d) == "table" then + n = n + 1 + t[n] = i + end + end + if n == 0 then + return 0 + end + local m = a + while true do + if m > n then + break + end + if m > 0 then + t[m] = -t[m] -- sign signals match + end + m = m + b + end + if negate then + for i=n,1-1 do + local ti = t[i] + if ti > 0 then + local di = dt[ti] + c = c + 1 + collected[c] = di + end + end + else + for i=n,1,-1 do + local ti = t[i] + if ti < 0 then + ti = - ti + local di = dt[ti] + c = c + 1 + collected[c] = di + end + end + end + return c +end + +local function filter_up(collected,c,negate,dt,a,b) + local t = { } + local n = 0 + for i=1,#dt do + local d = dt[i] + if type(d) == "table" then + n = n + 1 + t[n] = i + end + end + if n == 0 then + return 0 + end + if not b then + b = 0 + end + local m = n - a + while true do + if m < 1 then + break + end + if m < n then + t[m] = -t[m] -- sign signals match + end + m = m - b + end + if negate then + for i=1,n do + local ti = t[i] + if ti > 0 then + local di = dt[ti] + c = c + 1 + collected[c] = di + end + end + else + for i=1,n do + local ti = t[i] + if ti < 0 then + ti = - ti + local di = dt[ti] + c = c + 1 + collected[c] = di + end + end + end + return c +end + +local function just(collected,c,negate,dt,a,start,stop,step) + local m = 0 + for i=start,stop,step do + local d = dt[i] + if type(d) == "table" then + m = m + 1 + if negate then + if a ~= m then + c = c + 1 + collected[c] = d + end + else + if a == m then + c = c + 1 + collected[c] = d + break + end + end + end + end + return c +end + +local function s_nth_child(list,collected,c,negate,a,n,b) + if n == "n" then + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + c = filter_up(collected,c,negate,dt,a,b) + end + end + else + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + c = just(collected,c,negate,dt,a,1,#dt,1) + end + end + end + return c +end + +local function s_nth_last_child(list,collected,c,negate,a,n,b) + if n == "n" then + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + c = filter_down(collected,c,negate,dt,a,b) + end + end + else + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + c = just(collected,c,negate,dt,a,#dt,1,-1) + end + end + end + return c +end + +-- :nth-of-type(n) +-- :nth-last-of-type(n) +-- :first-of-type +-- :last-of-type + +local function s_nth_of_type(list,collected,c,negate,a,n,b) + if n == "n" then + return filter_up(collected,c,negate,list,a,b) + else + return just(collected,c,negate,list,a,1,#list,1) + end +end + +local function s_nth_last_of_type(list,collected,c,negate,a,n,b) + if n == "n" then + return filter_down(collected,c,negate,list,a,b) + else + return just(collected,c,negate,list,a,#list,1,-1) + end +end + +-- :only-of-type + +local function s_only_of_type(list,collected,c,negate) + if negate then + for i=1,#list do + c = c + 1 + collected[c] = list[i] + end + else + if #list == 1 then + c = c + 1 + collected[c] = list[1] + end + end + return c +end + +-- :only-child + +local function s_only_child(list,collected,c,negate) + if negate then + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + for i=1,#dt do + local di = dt[i] + if type(di) == "table" then + c = c + 1 + collected[c] = di + end + end + end + end + else + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt and #dt == 1 then + local di = dt[1] + if type(di) == "table" then + c = c + 1 + collected[c] = di + end + end + end + end + return c +end + +-- :empty + +local function s_empty(list,collected,c,negate) + for l=1,#list do + local ll = list[l] + local dt = ll.dt + if dt then + local dn = #dt + local ok = dn == 0 + if not ok and dn == 1 then + local d = dt[1] + if type(d) == "string" and is_empty(d) then + ok = true + end + end + if negate then + ok = not ok + end + if ok then + c = c + 1 + collected[c] = ll + end + end + end + return c +end + +-- :root + +local function s_root(list,collected,c,negate) + for l=1,#list do + local ll = list[l] + if type(ll) == "table" then + local r = xml.root(ll) + if r then + if r.special and r.tg == "@rt@" then + r = r.dt[r.ri] + end + c = c + 1 + collected[c] = r + break + end + end + end + return c +end + +local P, R, S, C, Cs, Ct, Cc, Carg, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.Cc, lpeg.Carg, lpeg.match + +local p_number = lpegpatterns.integer / tonumber + +local p_key = C((R("az","AZ","09") + S("_-"))^1) +local p_left = S("#.[],:()") +local p_right = S("#.[],:() ") +local p_tag = C((1-p_left) * (1-p_right)^0) +local p_value = C((1-P("]"))^0) +local p_unquoted = (P('"')/"") * C((1-P('"'))^0) * (P('"')/"") + + (1-P("]"))^1 +local p_element = Ct( ( + P(">") * skipspace * Cc(s_element_a) + + P("+") * skipspace * Cc(s_element_b) + + P("~") * skipspace * Cc(s_element_c) + + Cc(s_element_d) + ) * p_tag ) +local p_attribute = P("[") * Ct(Cc(s_attribute) * p_key * ( + P("=" ) * Cc(1) * Cs( p_unquoted) + + P("^=") * Cc(2) * Cs(Cc("^") * (p_unquoted / topattern)) + + P("$=") * Cc(2) * Cs( p_unquoted / topattern * Cc("$")) + + P("*=") * Cc(2) * Cs( p_unquoted / topattern) + + P("~=") * Cc(3) * Cs( p_unquoted) + )^0 * P("]")) + +local p_separator = skipspace * P(",") * skipspace + +local p_formula = skipspace * P("(") + * skipspace + * ( + p_number * skipspace * (C("n") * skipspace * (p_number + Cc(0)))^-1 + + P("even") * Cc(0) * Cc("n") * Cc(2) + + P("odd") * Cc(-1) * Cc("n") * Cc(2) + ) + * skipspace + * P(")") + +local p_step = P(".") * Ct(Cc(s_attribute) * Cc("class") * Cc(3) * p_tag) + + P("#") * Ct(Cc(s_attribute) * Cc("id") * Cc(1) * p_tag) + + p_attribute + + p_element + + P(":nth-child") * Ct(Cc(s_nth_child) * p_formula) + + P(":nth-last-child") * Ct(Cc(s_nth_last_child) * p_formula) + + P(":first-child") * Ct(Cc(s_nth_child) * Cc(1)) + + P(":last-child") * Ct(Cc(s_nth_last_child) * Cc(1)) + + P(":only-child") * Ct(Cc(s_only_child) ) + + P(":nth-of-type") * Ct(Cc(s_nth_of_type) * p_formula) + + P(":nth-last-of-type") * Ct(Cc(s_nth_last_of_type) * p_formula) + + P(":first-of-type") * Ct(Cc(s_nth_of_type) * Cc(1)) + + P(":last-of-type") * Ct(Cc(s_nth_last_of_type) * Cc(1)) + + P(":only-of-type") * Ct(Cc(s_only_of_type) ) + + P(":empty") * Ct(Cc(s_empty) ) + + P(":root") * Ct(Cc(s_root) ) + +local p_not = P(":not") * Cc(true) * skipspace * P("(") * skipspace * p_step * skipspace * P(")") +local p_yes = Cc(false) * skipspace * p_step + +local p_stepper = Ct((skipspace * (p_not+p_yes))^1) +local p_steps = Ct((p_stepper * p_separator^0)^1) * skipspace * (P(-1) + function() report_css("recovering from error") end) + +local cache = setmetatableindex(function(t,k) + local v = lpegmatch(p_steps,k) or false + t[k] = v + return v +end) + +local function selector(root,s) + -- local steps = lpegmatch(p_steps,s) + local steps = cache[s] + if steps then + local done = { } + local collected = { } + local nofcollected = 0 + local nofsteps = #steps + for i=1,nofsteps do + local step = steps[i] + local n = #step + if n > 0 then + local r = root + local m = 0 + local c = { } + for i=1,n,2 do + local s = step[i+1] -- function + data + m = s[1](r,c,0,step[i],s[2],s[3],s[4]) + if m == 0 then + break + else + r = c + c = { } + end + end + if m > 0 then + if nofsteps > 1 then + for i=1,m do + local ri = r[i] + if done[ri] then + -- print("duplicate",i) + -- elseif ri.special then + -- done[ri] = true + else + nofcollected = nofcollected + 1 + collected[nofcollected] = ri + done[ri] = true + end + end + else + return r + end + end + end + end + if nofcollected > 1 then + -- local n = 0 + -- local function traverse(e) + -- if done[e] then + -- n = n + 1 + -- done[e] = n + -- end + -- local dt = e.dt + -- if dt then + -- for i=1,#dt do + -- local e = dt[i] + -- if type(e) == "table" then + -- traverse(e) + -- end + -- end + -- end + -- end + -- traverse(root[1]) + -- + local n = 0 + local function traverse(dt) + for i=1,#dt do + local e = dt[i] + if done[e] then + n = n + 1 + done[e] = n + if n == nofcollected then + return + end + end + local d = e.dt + if d then + traverse(d) + if n == nofcollected then + return + end + end + end + end + local r = root[1] + if done[r] then + n = n + 1 + done[r] = n + end + traverse(r.dt) + -- + sort(collected,function(a,b) return done[a] < done[b] end) + end + return collected + else + return { } + end +end + +xml.applyselector= selector + +-- local t = [[ +-- +-- +-- +-- +-- +-- +-- +-- +-- +-- d e +-- d e +-- d e e +-- d f +-- +-- +-- +-- +-- +-- +-- +-- +-- +-- +-- +-- g gg f +-- +-- g gg f +-- g gg f +-- g f +-- g f +-- +-- +-- ]] +-- +-- local s = [[ .one ]] +-- local s = [[ .one, .two ]] +-- local s = [[ .one, .two, #first ]] +-- local s = [[ .one, .two, #first, c, e, [foo], [bar=foo] ]] +-- local s = [[ .one, .two, #first, c, e, [foo], [bar=foo], [bar~=foo] [bar^="foo"] ]] +-- local s = [[ [bar^="foo"] ]] +-- local s = [[ g f .one, g f .three ]] +-- local s = [[ g > f .one, g > f .three ]] +-- local s = [[ * ]] +-- local s = [[ d + e ]] +-- local s = [[ d ~ e ]] +-- local s = [[ d ~ e, g f .one, g f .three ]] +-- local s = [[ :not(d) ]] +-- local s = [[ [whatever~="five"] ]] +-- local s = [[ :not([whatever~="five"]) ]] +-- local s = [[ e ]] +-- local s = [[ :not ( e ) ]] +-- local s = [[ a:nth-child(3) ]] +-- local s = [[ a:nth-child(3n+1) ]] +-- local s = [[ a:nth-child(2n+8) ]] +-- local s = [[ g:nth-of-type(3) ]] +-- local s = [[ a:first-child ]] +-- local s = [[ a:last-child ]] +-- local s = [[ e:first-of-type ]] +-- local s = [[gg d:only-of-type ]] +-- local s = [[ a:nth-child(even) ]] +-- local s = [[ a:nth-child(odd) ]] +-- local s = [[ g:empty ]] +-- local s = [[ g:root ]] + +-- local c = css.applyselector(xml.convert(t),s) for i=1,#c do print(xml.tostring(c[i])) end + +function css.applyselector(x,str) + -- the wrapping needs checking so this is a placeholder + return applyselector({ x },str) +end + +-- -- Some helpers to map e.g. style attributes: +-- +-- -- string based (2.52): +-- +-- local match = string.match +-- local topattern = string.topattern +-- +-- function css.stylevalue(root,name) +-- local list = getid(root).at.style +-- if list then +-- local pattern = topattern(name) .. ":%s*([^;]+)" +-- local value = match(list,pattern) +-- if value then +-- context(value) +-- end +-- end +-- end +-- +-- -- string based, cached (2.28 / 2.17 interfaced): +-- +-- local match = string.match +-- local topattern = string.topattern +-- +-- local patterns = table.setmetatableindex(function(t,k) +-- local v = topattern(k) .. ":%s*([^;]+)" +-- t[k] = v +-- return v +-- end) +-- +-- function css.stylevalue(root,name) +-- local list = getid(root).at.style +-- if list then +-- local value = match(list,patterns[name]) +-- if value then +-- context(value) +-- end +-- end +-- end +-- +-- -- lpeg based (4.26): +-- +-- the lpeg variant also removes trailing spaces and accepts spaces before a colon + +local ctx_sprint = context.sprint +local ctx_xmlvalue = context.xmlvalue + +local colon = P(":") +local semicolon = P(";") +local eos = P(-1) +local somevalue = (1 - (skipspace * (semicolon + eos)))^1 +local someaction = skipspace * colon * skipspace * (somevalue/ctx_sprint) + +-- function css.stylevalue(root,name) +-- local list = getid(root).at.style +-- if list then +-- lpegmatch(P(name * someaction + 1)^0,list) +-- end +-- end + +-- -- cache patterns (2.13): + +local patterns = setmetatableindex(function(t,k) + local v = P(k * someaction + 1)^0 + t[k] = v + return v +end) + +function css.stylevalue(root,name) + local list = getid(root).at.style -- hard coded style + if list then + lpegmatch(patterns[name],list) + end +end + +local somevalue = (1 - whitespace - semicolon - eos)^1 +local someaction = skipspace * colon * (skipspace * Carg(1) * C(somevalue)/function(m,s) + ctx_xmlvalue(m,s,"") -- use one with two args +end)^1 + +local patterns= setmetatableindex(function(t,k) + local v = P(k * someaction + 1)^0 + t[k] = v + return v +end) + +function css.mappedstylevalue(root,map,name) + local list = getid(root).at.style -- hard coded style + if list then + lpegmatch(patterns[name],list,1,map) + end +end + +-- -- faster interface (1.02): + +interfaces.implement { + name = "xmlcssstylevalue", + public = true, + actions = css.stylevalue, + arguments = "2 strings", +} + +interfaces.implement { + name = "xmlcssmappedstylevalue", + public = true, + actions = css.mappedstylevalue, + arguments = "3 strings", +} + +-- more (for mm) + +local containsws = string.containsws +local classsplitter = lpeg.tsplitat(whitespace^1) + +function xml.functions.classes(e,class) -- cache + if class then + local at = e.at + local data = at[class] or at.class + if data then + return lpegmatch(classsplitter,data) or { } + end + end + return { } +end + +-- function xml.functions.hasclass(e,class,name) +-- if class then +-- local at = e.at +-- local data = at[class] or at.class +-- if data then +-- return data == name or containsws(data,name) +-- end +-- end +-- return false +-- end +-- +-- function xml.expressions.hasclass(attribute,name) +-- if attribute then +-- return attribute == name or containsws(attribute,name) +-- end +-- return false +-- end + +function xml.functions.hasclass(e,class,name,more,...) + if class and name then + local at = e.at + local data = at[class] or at.class + if not data or data == "" then + return false + end + if data == name or data == more then + return true + end + if containsws(data,name) then + return true + end + if not more then + return false + end + if containsws(data,more) then + return true + end + for i=1,select("#",...) do + if containsws(data,select(i,...)) then + return true + end + end + end + return false +end + +function xml.expressions.hasclass(data,name,more,...) + if data then + if not data or data == "" then + return false + end + if data == name or data == more then + return true + end + if containsws(data,name) then + return true + end + if not more then + return false + end + if containsws(data,more) then + return true + end + for i=1,select("#",...) do + if containsws(data,select(i,...)) then + return true + end + end + end + return false +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl index 8515e618730..61bfec72b10 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl @@ -20,9 +20,9 @@ \unprotect -\settrue \xmllshowbuffertoo -\setfalse\xmllshowtitletoo -\settrue \xmllshowwarningtoo +\newconditional\xmllshowbuffertoo \xmllshowbuffertoo\conditionaltrue +\newconditional\xmllshowtitletoo \xmllshowtitletoo\conditionalfalse +\newconditional\xmllshowwarningtoo \xmllshowwarningtoo\conditionaltrue \definehead [lshowtitle] diff --git a/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl index a185efd124d..6bab1f24902 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl @@ -12,7 +12,7 @@ %C details. %D Todo: auto apply setups (manage at lua end) -%D Todo: manuak: \xmlinclusion \xmlinclusions +%D Todo: manual: \xmlinclusion \xmlinclusions \writestatus{loading}{ConTeXt XML Support / Initialization} @@ -189,9 +189,7 @@ %xmlpushdocument{#3}% #2{#3}{#4}% \setcatcodetable\notcatcodes - \doifelsenothing{#5}% - {\xmlsetup{#3}{xml:process}}% - {\xmlsetup{#3}{#5}}% + \xmlsetup{#3}{\ifempty{#5}xml:process\else#5\fi}% %xmlpopdocument \endgroup} @@ -205,9 +203,7 @@ % #2{#3}{#4}% % \pushcatcodetable % \setcatcodetable\notcatcodes -% \doifelsenothing{#5}% -% {\xmlsetup{#3}{xml:process}}% -% {\xmlsetup{#3}{#5}}% +% \xmlsetup{#3}{\ifempty{#5}xml:process\else#5\fi}% % \popcatcodetable % \popmacro\xmldocument % }%\endgroup} @@ -261,11 +257,11 @@ \permanent\tolerant\protected\def\startxmldisplayverbatim[#1]% {\startpacked - \edef\currenttyping{#1}% + \cdef\currenttyping{#1}% \ifempty\currenttyping \let\currenttyping\v!typing \else % maybe test for existence - \edef\currenttyping{xml:\currenttyping}% + \cdef\currenttyping{xml:\currenttyping}% \fi \enforced\protected\def\stopxmldisplayverbatim {\endofverbatimlines @@ -277,11 +273,11 @@ \permanent\tolerant\protected\def\startxmlinlineverbatim[#1]% {\begingroup - \edef\currenttype{#1}% + \cdef\currenttype{#1}% \ifempty\currenttype \let\currenttype\v!type \else % maybe test for existence - \edef\currenttype{xml:\currenttype}% + \cdef\currenttype{xml:\currenttype}% \fi \enforced\let\stopxmlinlineverbatim\endgroup \doinitializeverbatim} @@ -348,7 +344,9 @@ \c!entities=\v!no] % load big entity file \appendtoks - \doif{\directxmlparameter\c!entities}\v!yes\clf_xmlloadentities + \ifcstok{\directxmlparameter\c!entities}\v!yes + \clf_xmlloadentities + \fi \to \everysetupxml \permanent\def\xmlmapvalue #1#2#3{\defcsname\??xmlmapvalue#1:#2\endcsname{#3}} % keep #3 to grab spaces diff --git a/Master/texmf-dist/tex/context/base/mkxl/lxml-mms.lmt b/Master/texmf-dist/tex/context/base/mkxl/lxml-mms.lmt new file mode 100644 index 00000000000..f2b8cae191d --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/lxml-mms.lmt @@ -0,0 +1,1120 @@ +if not modules then modules = { } end modules ['lxml-mms'] = { + version = 1.001, + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + comment = "written together with Mikael Sundqvist", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- Although it sits in the lxml name space this module is pretty much hooked into +-- ConTeXt math rendering and backend code. It is one of the first applications of +-- math dictionary support. After experimenting with hooking serialization of math +-- into the rendering we decided that it made more sense to use the export +-- facilities instead. It is also a fun project that might lead so more similar +-- functionality. Of course we don't limit ourselves to English, if only because +-- our test more advanced cases are Swedish math books. +-- +-- The rationale for this serialization can be found in demands for documents to be +-- accessible and math is a tricky part of that. We embed MathML in tagged PDF +-- documents and the serialization hooks into the actual text features. This is +-- needed in order to make accessibility validators (like the ones used at Lunds +-- University) happy. We let users decide how useful and reliable it is. In ConTeXt +-- you can overload and adapt bits and pieces as part of the document style. For the +-- record: we are not involved in accesibility projects, so we might get some things +-- wrong. +-- +-- This is experimental code that will be optimized. Also, some of it can be a bit +-- more general (shared) but we do that once we're done. + +-- Timestamp: yet another entertaining drum track by Gavin Harrison "Pick Up The +-- Pieces" | Zildjian 400th UK (posted 2024/2/5) - three weeks before a PT concert +-- (YT: "The Pineapple Thief - It Leads to This). + +local tonumber, tostring, type, next = tonumber, tostring, type, next +local concat = table.concat +local formatters = string.formatters + +local xmlall = xml.all +local xmlfirst = xml.first +local xmltext = xml.text +local xmlconvert = xml.convert +local xmlcollected = xml.collected + +local report = logs.reporter("mms") + +local getname = mathematics.dictionaries.name +local classes = mathematics.classes +local getverboselabel = mathematics.getverboselabel +local getoptionallabel = mathematics.getoptionallabel +local functions = mathematics.categories.functions +local functiontype = mathematics.functiontype + +local function xmlevery(x) + local dt = x.dt + local tt + local nn = 0 + for i=1,#dt do + local di = dt[i] + if di.tg and not di.special then + if tt then + nn = nn + 1 + tt[nn] = di + else + nn = 1 + tt = { di } + end + end + end + return tt, nn +end + +local function xmlfixattributes(x) + for c in xmlcollected(x,"*") do + local at = c.at + for k, v in next, at do + at[k] = tostring(v) + end + end +end + +local function xmlwipeattributes(x) + local at = { } + for c in xmlcollected(x,"*") do + c.at = { } -- Don't set them afterwards because they are shared! + end +end + +local prepare do + + local expandtimes, expandtimesone + + expandtimesone = function(c,all,i,start,stop) + if c then + local tg = c.tg + if tg == "mrow" then + local at = c.at + if at.mathunit then + -- nothing + else + local a, na = xmlevery(c) + if na > 0 then + -- local mfs = at.mathfractionstack + -- if mfs then + -- local a = xmlall(c,"/mfrac") or { } + -- expandtimesone(a[1],a,1) + -- goto DONE + -- end + local times = false + local block = true + local closed = false + for i=1,na do + local ai = a[i] + local tg = ai.tg + local at = ai.at + local class = at.mathclass + if at.mathfunction + -- or at.mathfractionstack -- ADDED + or at.mathfunctionstack + or class == "integral" + or at.mathgroup == "unary set" + or at.mathgroup == "number set" + -- or at.mathapplication + then + at.checkfunction = true -- saves a check later + if closed then + at.mathtimes = 1 + closed = false + elseif block then + block = false + else + at.mathtimes = 2 + end + if at.mathsymbolic then + block = false -- registered functions like f and g + else + block = true -- lim etc .. we need to intercept kind == 1 + end + times = false + expandtimesone(ai,a,i) + elseif tg == "mo" then + -- combine more here + if class == "open" then + if closed then + at.mathtimes = 3 + closed = false + elseif times and not block then + at.mathtimes = 4 + end + elseif i > 1 and class == "close" then -- block ? + closed = true + else + closed = false + end + expandtimes(ai) + times = false + block = true + elseif tg == "mn" or tg == "mtext" or tg == "ms" then + if closed then + at.mathtimes = 5 + closed = false + end + expandtimesone(ai) + times = false + block = false + elseif tg == "msub" or tg == "msup" or tg == "msubsup" then + local first = xmlfirst(ai,"/*") + local fat = first and first.at + if closed then + at.mathtimes = 6 + closed = false + elseif first and at.mathclass == "close" then + closed = true + elseif times and not block then + at.mathtimes = 7 + end + if first then + if fat.mathfunction + or fat.mathfunctionstack + or fat.mathclass == "integral" + or fat.mathclass == "operator" + or fat.mathclass == "differential" + then + if not fat.mathfunction then + fat.mathfunction = true -- maybe also needed for the stack + end + at.checkfunction = true -- saves a check later + expandtimesone(ai,a,i) + block = true + times = false + else + expandtimesone(ai,a,i) + block = false + times = true + end + else + expandtimesone(ai,a,i) + block = false + times = true + end + elseif at.mathfractionstack or tg == "mroot" or tg == "mfrac" or tg == "msqrt" or at.mathsymbolic then + if closed then + at.mathtimes = 8 + closed = false + elseif block then + block = false + else + at.mathtimes = 9 + end + times = true + expandtimesone(ai,a,i) + elseif class == "differential" then + closed = false + block = true + times = true + expandtimesone(ai,a,i) + elseif class == "variable" then + -- local c = at.mathcharacter + -- if c == "." or c == "," then -- period comma + -- block = true + -- times = false + -- else + if closed then + at.mathtimes = 10 + closed = false + elseif times and not block then + at.mathtimes = 11 + end + block = false + times = true + -- end + expandtimesone(ai,a,i) + elseif tg == "mrow" then + if closed or times then + at.mathtimes = 12 + closed = false + end + times = true + expandtimesone(ai,a,i) + else + if closed then + at.mathtimes = 13 + closed = false + end + times = false + expandtimesone(ai,a,i) + end + end + end + end + ::DONE:: + elseif tg == "mtable" then + for cell in xmlcollected(c,"mtd") do + local a, na = xmlevery(cell) + if a then + expandtimes(a) + end + end + elseif tg == "mtext" or tg == "mspace" or tg == "ms" then + -- nothing to do + elseif tg == "mfrac" then + local a, na = xmlevery(c) + if i > 1 and na == 2 and all[i-1].tg == "mn" and a[1].tg == "mn" and a[2].tg == "mn" and not c.__p__.at.mathfractionstack then + -- mark not times + c.at.mathplus = 1 -- invisible plus + end + else + local a, na = xmlevery(c) + if a then + expandtimes(a) + end + end + end + end + + expandtimes = function(all) + if all then + for i=1,#all do + expandtimesone(all[i],all,i) + end + end + end + + prepare = function(x) + local all = xmlall(x,"mi[not @mathfunction]") + if all then + for i=1,#all do + local a = all[i] + local t = a.dt[1] + local f = functions[t] + if f then + local at = a.at + at.mathfunction = "true" + at.mathsymbolic = "true" + end + end + end + -- left is a function, right is an operator + for c in xmlcollected(x,"mrow[@mathfunctionstack]") do + local cat = c.at + local s = cat.mathstack + for cc in xmlcollected(c,"(mi|mo)[@mathstack]") do + local ccat = cc.at + if ccat.mathstack == s then + cat.mathfunction = ccat.mathfunction or cat.mathfunction + cat.mathcharacter = ccat.mathcharacter or cat.mathcharacter + cat.mathgroup = ccat.mathgroup or cat.mathgroup + if cc.tg == "mo" then + ccat.mathignore = "true" + end + end + end + end + -- + local all = xmlall(x,"(msub|msup|msubsup)/mo[@mathclass='open' or @mathclass='close' or @mathclass='middle']") + if all then + for i=1,#all do + local ai = all[i] + local at = ai.at + at.mathignore = "true" + ai.__p__.at.mathclass = at.mathclass + end + end + -- + expandtimesone(x) + end + +end + +local tomeaning, getlast do + + -- we don't really need to handle mfenced + + local t, n, expand, expandone, okay, language, domain + + -- todo: a getlabel wrapper so that we don't need to pass language and domain + + local function getlabel(tag) + return getverboselabel(tag,language,domain) + end + + local function getoptional(tag) + return getoptionallabel(tag,language,domain) + end + + local function expandsymbol(c) + local at = c.at + if not at.mathignore then + local result = at.mathidentity + if not result then + local group = at.mathgroup + if group then + local character = tonumber(at.mathcharacter) + local index = tonumber(at.mathindex) + local s = getname(group,character) or getname(group,index) + if type(s) == "string" then + result = getlabel(s) + else + result = xmltext(c) + end + else + result = xmltext(c) + end + end + if result ~= "" then + n = n + 1 ; t[n] = result + end + end + end + + -- replace method by category and kind + + local function hasmiddle(a) + if a then + for i=1,#a do + local class = a[i].at.mathclass + if class == "middle" then + return true + end + end + end + return false + end + + local function haslimits(at) + local f = at.mathfunction + if f then + f = functions[f] + if f then + return f.method == "limits" + end + end + return false + end + + local function isintegral(at) + return at.mathclass == "integral" + end + + local function isoperator(at) + return at.mathclass == "operator" + end + + -- see if we can avoid passing all and i + + local function expandsupindex(c,a,all,i) + if c.at.mathsupindex then + n = n + 1 ; t[n] = getlabel("supindex") + expandone(a,all,i) + else + n = n + 1 ; t[n] = getlabel("to the power of") + expandone(a,all,i) + local last = t[n] + if last == "2" then + n = n - 1 ; t[n] = getlabel("squared") + elseif last == "3" then + n = n - 1 ; t[n] = getlabel("cubed") + end + end + end + + local function expandsubindex(c,a,all,i) + if c.at.mathsubindex then + n = n + 1 ; t[n] = getlabel("subindex") + else + n = n + 1 ; t[n] = getlabel("sub") + end + expandone(a,all,i) + end + + local function checkfunction(a,i,na) + if i + 3 <= na then + local a1 = a[i+1] + if a1.tg == "mo" then + local a3 = a[i+3] + if a3.tg == "mo" then + local a2 = a[i+2] + local t2 = a2.tg + if t2 == "mn" or t2 == "mi" then + local at1 = a1.at + local at3 = a3.at + local class1 = at1.mathclass + local class2 = at3.mathclass + if class1 and class2 and class1 == "open" and class2 == "close" then + at1.mathnogroup = true + at3.mathnogroup = true + end + end + end + end + end + end + + local partials = { + ["∂"] = "d", -- todo: bold math + } + + local function isdifferential(a) + local a1 = a[1] + local a2 = a[2] + if a1 and a2 then + local tg2 = a2.tg + local ps = false + if tg2 == "mrow" or tg2 == "msub" or tg2 == "msup" or tg2 == "msubsup" then + local aa = xmlfirst(a2,"/*") + if aa then + if aa.tg == "mi" and aa.at.mathclass == "differential" then + ps = aa + else + local aa = xmlfirst(aa,"/*") + if aa and aa.tg == "mi" and aa.at.mathclass == "differential" then + ps = aa + else + return false + end + end + else + return false + end + end + -- can be helper + local tg1 = a1.tg + if tg1 == "mrow" or tg1 == "msub" or tg1 == "msup" or tg1 == "msubsup" then + local aa = xmlfirst(a1,"/*") + if aa then + if aa.tg == "mi" and aa.at.mathclass == "differential" then + local p = partials[aa.dt[1]] + if p then + -- aa.at.mathidentity = p + -- ps.at.mathidentity = p + return true, true + else + return true, false + end + else + local aa = xmlfirst(aa,"/*") + if aa and aa.tg == "mi" and aa.at.mathclass == "differential" then + local p = partials[aa.dt[1]] + if p then + -- aa.at.mathidentity = p + -- ps.at.mathidentity = p + return true, true + else + return true, false + end + else + return false + end + end + else + return false + end + elseif tg1 == "mi" and a1.at.mathclass == "differential" then + local p = partials[a1.dt[1]] + if partials[a1.dt[1]] then + -- a1.at.mathidentity = p + -- ps.at.mathidentity = p + return true, true + else + return true, false + end + end + end + return false + end + + local function applyof(all,i,label) + local ai1 = all[i + 1] + if ai1 and ai1.tg == "mo" then + local c = ai1.at.mathclass + if c == "open" then + n = n + 1 ; t[n] = getlabel(label) + end + end + end + + local function expandfenced(ai,fenced,all,i) + local at = ai.at + local class = at.mathclass + if not class then + if at.mathnogroup then + -- ignore + else + expandone(ai,all,i) + end + elseif class == "open" then + if fenced or at.mathnogroup then + -- ignore + else + n = n + 1 ; t[n] = getlabel("begin group") + end + at.mathignore = "true" + expandone(ai) + elseif class == "close" then + if fenced or at.mathnogroup then + -- ignore + else + n = n + 1 ; t[n] = getlabel("end group") + end + at.mathignore = "true" + expandone(ai) + elseif class == "middle" then + if fenced then + n = n + 1 ; t[n] = getlabel(fenced.tag .. ":fence") + at.mathignore = "true" + expandone(ai) + +local aa = all and all[i+1] +if aa then + aa.at.mathnogroup = true +end + + else + expandone(ai) + end + else + expandone(ai,all,i) + end + end + + local trace_times = false + + trackers.register("structures.tags.math.times", function(v) trace_times = v end) + + expandone = function(c,all,i,start,stop) + if c then + local tg = c.tg + if tg == "mrow" then + local at = c.at + if at.mathunit then + n = n + 1 ; t[n] = at.mathunit + else + local category = tonumber(at.mathcategory) + local kind = category and functiontype(category) + local fenced = kind == "fence" and functions[category] + local a, na = xmlevery(c) + if na > 0 then + local subfence = hasmiddle(a) + if at.mathfunctionstack then + expandsymbol(c) + at.mathnogroup = "true" + else + local mfs = at.mathfractionstack -- matbe also cgheckj for tg == "mfrac" + if mfs then + at.mathnogroup = "true" + -- fenced = false + local s = getlabel(mfs) + if na > 1 and s and s ~= "" then -- maybe check if there is a meaning set + at.nofraction = mfs + n = n + 1 ; t[n] = s + end + local a = xmlall(c,"/mfrac") or { } + expandone(a[1],a,1) + goto DONE + end + end + -- how about na == 1 + local isgroup = false + if fenced then + -- isgroup = false + elseif at.mathnogroup then + -- isgroup = false + else + isgroup = n > 1 + end + if fenced then + local s = getlabel(fenced.tag) + n = n + 1 ; t[n] = getlabel("optional begin") + if s == "" then + n = n + 1 ; t[n] = getlabel("fenced") + else + n = n + 1 ; t[n] = s + end + elseif isgroup then + n = n + 1 ; t[n] = getlabel(start or "begin group") + end + if fenced then + if na == 3 then + a[2].at.mathnogroup = true + elseif na == 5 and hasmiddle then + a[2].at.mathnogroup = true + a[3].at.mathnogroup = true + end + end + -- + for i=1,na do + local ai = a[i] + local tg = ai.tg + local at = ai.at + if at.mathtimes then + local s + -- if at.mathplus then + -- s = getlabel("fractionplus") + -- else + s = getlabel("times") + -- end + if s and s ~= "" then + if trace_times then + n = n + 1 ; t[n] = s .. at.mathtimes + else + n = n + 1 ; t[n] = s + end + end + end + if at.checkfunction then + checkfunction(a,i,na) + expandone(ai,a,i) + elseif tg == "mo" then + expandfenced(ai,fenced,a,i) +-- n = n + 1 ; t[n] = "!" + -- elseif tg == "mn" or tg == "mtext" or tg == "ms" then + -- expandone(ai) + elseif tg == "msub" or tg == "msup" or tg == "msubsup" then + local first = xmlfirst(ai,"/*") + local fat = first and first.at + if first then + if fat.checkfunction then + checkfunction(a,i,na) + expandone(ai,a,i) + else + expandfenced(ai,fenced,a,i) + end + else + expandfenced(ai,fenced,a,i) + end + else + expandone(ai,a,i) + end + end + -- + if fenced then + local s = getlabel(fenced.tag) + n = n + 1 ; t[n] = getlabel("end") + if s == "" then + n = n + 1 ; t[n] = getlabel("fenced") + else + n = n + 1 ; t[n] = s + end + elseif isgroup then + n = n + 1 ; t[n] = getlabel(stop or "end group") + end + end + end + ::DONE:: + elseif tg == "mo" then + expandsymbol(c) + elseif tg == "mn" then + n = n + 1 ; t[n] = xmltext(c) + elseif tg == "mi" then + local at = c.at + if at.mathunit then + n = n + 1 ; t[n] = at.mathunit + elseif at.mathsymbolic then + n = n + 1 ; t[n] = getlabel("function") + expandsymbol(c) -- can be done directly + local tg = c.__p__.tg + if tg == "msub" or tg == "msup" or tg == "msubsup" then + else + if all then + applyof(all,i,"functionof") + end + end + elseif at.mathfunction then + n = n + 1 ; t[n] = getlabel(c.dt[1]) + local tg = c.__p__.tg + if tg == "msub" or tg == "msup" or tg == "msubsup" then + else + if all then + applyof(all,i,"functionof") + end + end + else + local s = getoptional(c.dt[1]) + if s and s ~= "" then + n = n + 1 ; t[n] = s + end + expandsymbol(c) + end + elseif tg == "msub" then + local a, na = xmlevery(c) + if a then + local a1 = a[1] + local at = a1.at + expandone(a1,all,i) + if haslimits(at) or isintegral(at) or isoperator(at) then + if isintegral(at) or isoperator(at) then + n = n + 1 ; t[n] = getlabel("integralsub") -- integral with lower limit + else + n = n + 1 ; t[n] = getlabel("limitsub") -- limit type with lower limit + end + expandone(a[2],all,i) + n = n + 1 ; t[n] = getlabel("pause") + if all and #all > i then + n = n + 1 ; t[n] = getlabel("operatorof") + end + else + expandsubindex(c,a[2],all,i) + if at.mathfunction or at.mathsymbolic then + applyof(all,i,"functionof") + end + end + end + elseif tg == "msup" then + local a, na = xmlevery(c) + if a then + local a1 = a[1] + local a2 = a[2] + local at = a1.at + local group = a2.at.mathgroup + if group == "postfix operator" then + expandone(a2) + expandone(a1) + if all and #all > i then + n = n + 1 ; t[n] = getlabel("operatorof") + end + elseif group == "prime" then + expandone(a1) + expandone(a2) + if all then + applyof(all,i,"primeof") + end + elseif haslimits(at) or isintegral(at) or isoperator(at) then + expandone(a1,all,i) + n = n + 1 ; t[n] = getlabel("operatorsup") + expandone(a2,all,i) + n = n + 1 ; t[n] = getlabel("pause") + if all and #all > i then + n = n + 1 ; t[n] = getlabel("operatorof") + end + else + expandone(a1,all,i) + expandsupindex(c,a2,all,i) + if at.mathfunction or at.mathsymbolic then + applyof(all,i,"functionof") + end + end + end + elseif tg == "msubsup" then + local a, na = xmlevery(c) + if a then + local a1 = a[1] + local a2 = a[2] + local a3 = a[3] + local at = a1.at + if a2.at.mathclass == "prime" then + expandone(a2) + expandone(a1) + if haslimits(at) or isintegral(at) or isoperator(at) then + n = n + 1 ; t[n] = getlabel("operatorsubsupfrom") -- from was: with lower limit + expandone(a3,all,i) + n = n + 1 ; t[n] = getlabel("pause") + end + if all and #all > i then + n = n + 1 ; t[n] = getlabel("operatorof") + end + elseif haslimits(at) or isintegral(at) or isoperator(at) then + expandone(a1,all,i) + n = n + 1 ; t[n] = getlabel("operatorsubsupfrom") -- from was: with lower limit + expandone(a2,all,i) + n = n + 1 ; t[n] = getlabel("operatorsubsupto") -- upto was: and upper limit + expandone(a3,all,i) + n = n + 1 ; t[n] = getlabel("pause") + if all and #all > i then + n = n + 1 ; t[n] = getlabel("operatorof") + end + else + expandone(a1,all,i) + expandsubindex(c,a2,all,i) + expandsupindex(c,a3,all,i) + if at.mathfunction or at.mathsymbolic then + applyof(all,i,"functionof") + end + end + end + elseif tg == "mfrac" then + local a, na = xmlevery(c) + if a then + local ok, partial = isdifferential(a) + if ok then + if partial then + n = n + 1 ; t[n] = getlabel("the partial derivative") + else + n = n + 1 ; t[n] = getlabel("the derivative") + end + expandone(a[1],all,i,"","") + n = n + 1 ; t[n] = getlabel("over") + expandone(a[2],all,i,"","end derivative") + elseif c.__p__.at.nofraction then -- uggly + expandone(a[1],all,i,"","") + n = n + 1 ; t[n] = getlabel("over") + expandone(a[2],all,i,"","") + n = n + 1 ; t[n] = getlabel("end " .. c.__p__.at.nofraction) + -- n = n + 1 ; t[n] = getlabel(c.__p__.at.nofraction) + else + n = n + 1 ; t[n] = getlabel("the fraction of") + expandone(a[1],all,i,"begin numerator","end numerator") + n = n + 1 ; t[n] = getlabel("and") + expandone(a[2],all,i,"begin denominator","end denominator") + end + end + elseif tg == "msqrt" then + n = n + 1 ; t[n] = getlabel("the square root") + local a, na = xmlevery(c) + if a then + n = n + 1 ; t[n] = getlabel("rootof") + expand(a,all,i) + end + elseif tg == "mroot" then + local a, na = xmlevery(c) + n = n + 1 ; t[n] = getlabel("the root with degree") + if a then + expandone(a[2],all,i) + n = n + 1 ; t[n] = getlabel("rootof") + expandone(a[1],all,i) + end + elseif tg == "munder" then -- needs checking + local a, na = xmlevery(c) + if a then + local category = tonumber(c.at.mathcategory) + if functiontype(category) == "accent" then + local fnc = functions[category] + n = n + 1 ; t[n] = getlabel(fnc.tag) + expandone(a[1],all,i) + else + expandone(a[1],all,i) + n = n + 1 ; t[n] = getlabel("under") + expandone(a[2],all,i) + end + end + elseif tg == "mover" then -- needs checking + local a, na = xmlevery(c) + if a then + local category = tonumber(c.at.mathcategory) + if functiontype(category) == "accent" then + local fnc = functions[category] + n = n + 1 ; t[n] = getlabel(fnc.tag) + expandone(a[1],all,i) + else + expandone(a[1],all,i) + n = n + 1 ; t[n] = getlabel("over") + expandone(a[2],all,i) + end + end + elseif tg == "munderover" then -- needs checking + local a, na = xmlevery(c) + if a then + expandone(a[1],all,i) + n = n + 1 ; t[n] = getlabel("under") + expandone(a[2],all,i) + n = n + 1 ; t[n] = getlabel("and over") + expandone(a[3],all,i) + end + elseif tg == "mtext" then + n = n + 1 ; t[n] = xmltext(c) + elseif tg == "mspace" then + n = n + 1 ; t[n] = "" + elseif tg == "ms" then + n = n + 1 ; t[n] = xmltext(c) + elseif tg == "mmultiscripts" then -- needs checking, todo prime + local a, na = xmlevery(c) + if a then + local p = false + local s = true + expandone(a[1],all,i) + for i=2,#a do + local ai = a[i] + if ai.tg == "mprescripts" then + p = true + n = n + 1 ; t[n] = getlabel("prescripts") + elseif p then + if ai.tg ~= "mtext" then + n = n + 1 ; t[n] = getlabel(s and "presub" or "presuper") + expandone(ai,all,i) + end + s = not s + end + end + s = true + for i=2,#a do + local ai = a[i] + if ai.tg == "mprescripts" then + break + elseif i == 2 then + n = n + 1 ; t[n] = getlabel("postscripts") + end + if ai.tg ~= "mtext" then + n = n + 1 ; t[n] = getlabel(s and "postsub" or "postsuper") + expandone(ai,all,i) + end + s = not s + end + n = n + 1 ; t[n] = getlabel("end scripts") + end + elseif tg == "math" then + local a, na = xmlevery(c) + if a then + expand(a,all,i) + end + elseif tg == "mtable" then + local detail = c.at.detail + if detail == "cases" then + n = n + 1 ; t[n] = getlabel("begin cases") + local nr = 0 + for row in xmlcollected(c,"/mtr") do + nr = nr + 1 + n = n + 1 ; t[n] = getlabel("case") + n = n + 1 ; t[n] = tostring(nr) + for cell in xmlcollected(row,"/mtd") do + local a, na = xmlevery(cell) + if a then + expand(a) + end + end + -- n = n + 1 ; t[n] = getlabel("end case") + end + n = n + 1 ; t[n] = getlabel("end cases") + else + n = n + 1 ; t[n] = getlabel("begin table") + local nr = 0 + for row in xmlcollected(c,"/mtr") do + local nc = 0 + nr = nr + 1 + -- n = n + 1 ; t[n] = getlabel("row") + -- n = n + 1 ; t[n] = tostring(nr) + for cell in xmlcollected(row,"/mtd") do + nc = nc + 1 + -- n = n + 1 ; t[n] = getlabel("column") + -- n = n + 1 ; t[n] = tostring(nc) + n = n + 1 ; t[n] = getlabel("cell") + n = n + 1 ; t[n] = tostring(nr) + n = n + 1 ; t[n] = tostring(nc) + local a, na = xmlevery(cell) + if a then + expand(a) + end + end + end + n = n + 1 ; t[n] = getlabel("end table") + end + elseif not c.special then + okay = false + print("todo: " .. tg) + end + end + end + + expand = function(all) + if all then + for i=1,#all do + expandone(all[i],all,i) + end + end + end + + local keep_last = false + + trackers.register("structures.tags.math.keeplast", function(v) keep_last = v end) + + tomeaning = function(x,l) + t = { } + n = 0 + okay = true + language = l or "en" + domain = x.at.domain or "default" + -- + expandone(x) + if okay then + -- we can have a helper for this + local m = false + for i=1,n do + local ti = t[i] + if ti == "" then + if not m then + m = i - 1 + end + elseif m then + m = m + 1 + t[m] = ti + end + end + if m then + n = m + end + if t[n] == "." then + n = n - 1 + end + if keep_last then + xmlfixattributes(x) + buffers.assign(type(keep_last) == "string" and keep_last or "lastmms",tostring(x)) + else + lastxml = false + end + return concat(t," ",1,n) + end + end + + getlast = function() + return lastxml or "" + end + +end + +local stripped do + + local strip = true + + directives.register("structures.tags.math.strip", function(v) strip = v end) + + stripped = function(s) + if strip then + local x = xmlconvert(s) + xmlwipeattributes(x) + return tostring(x) + else + return s + end + end + +end + +local verbose do + + -- We could save the prepared if we do more languages but that is only relevant when + -- we develop so it has little gain. + + local warned = false + -- local saved = false + -- local saving = false + + -- trackers.register("structures.tags.math.save",function(v) + -- saving = v + -- if saving and not saved then + -- saved = table.setmetatableindex("table") + -- luatex.registerstopactions(function() table.save(tex.jobname .. "-mms-meanings.lua",saved) end) + -- end + -- end) + + verbose = function(s,l) + if not warned then + report("this feature is experimental and under construction") + warned = true + end + local root = xmlconvert(s) + if not root.error then + local x = xmlfirst(root,"/math") + if x then + prepare(x) + local meaning = tomeaning(x,l) + -- if saving then + -- saved[s][l] = meaning + -- end + return meaning + end + end + end + +end + +xml.mml = { + verbose = verbose, + stripped = stripped, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx index 2201ed88635..5c0db0d1890 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx @@ -90,7 +90,8 @@ \c!alignsymbol=\v!yes, %\c!stretch=\v!no, %\c!shrink=\v!no, - \c!define=\v!yes] % not used + \c!define=\v!yes, % not used + \c!snap=\mathematicsparameter\c!snap] \definemathaccent [\v!both] @@ -117,23 +118,23 @@ \permanent\tolerant\protected\def\definemathtopaccent[#1]#*[#2]#*[#3]% class name top {\ifparameter#3\or - \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}\plusone{\number#3}\zerocount}% + \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}{#2}\plusone{\number#3}\zerocount}% \else - \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent\plusone{\number#2}\zerocount}% + \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent{#1}\plusone{\number#2}\zerocount}% \fi} \permanent\tolerant\protected\def\definemathbottomaccent[#1]#*[#2]#*[#3]% class name bottom {\ifparameter#3\or - \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}\plustwo\zerocount{\number#3}}% + \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}{#2}\plustwo\zerocount{\number#3}}% \else - \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent\plustwo\zerocount{\number#2}}% + \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent{#1}\plustwo\zerocount{\number#2}}% \fi} \permanent\tolerant\protected\def\definemathdoubleaccent[#1]#*[#2]#*[#3]#*[#4]% class name top bottom {\ifparameter#4\or - \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}\plusthree{\number#3}{\number#4}}% + \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}{#2}\plusthree{\number#3}{\number#4}}% \else - \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent\plusthree{\number#2}{\number#3}}% + \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent{#1}\plusthree{\number#2}{\number#3}}% \fi} \installlocalcurrenthandler \??mathaccents {mathaccent} @@ -147,7 +148,7 @@ %D } %D \stoptyping -\tolerant\protected\def\math_accent_make_double#class#kind#top#bottom#*[#settings]#:#content% +\tolerant\protected\def\math_accent_make_double#class#name#kind#top#bottom#*[#settings]#:#content% {\beginmathgroup \setlocalmathaccentcurrent{#class}% \edef\currentmathaccent{#class}% \startusemathstyleparameter\mathaccentparameter\c!mathstyle @@ -160,18 +161,23 @@ \else \let\m_fixed\s!fixed \fi + \math_tags_mfunctionlab\plustwo{#name}{\ifcase#kind\or\v!top\or\v!bottom\else\v!both\fi}% \Umathaccent \usedcolorparameterattributes{\mathaccentparameter\c!color}% % nooverflow % there is never na overflow anyway but we do accept the key \ifcstok{\mathaccentparameter\c!align }\v!middle\s!center \space\fi \ifcstok{\mathaccentparameter\c!stretch}\v!yes \s!stretch\space\fi \ifcstok{\mathaccentparameter\c!shrink }\v!yes \s!shrink \space\fi + \ifcstok{\mathaccentparameter\c!snap }\v!yes \s!single \space\fi \ifx\p_scale\v!keep \s!keepbase\space \fi \ifcstok{\mathaccentparameter\c!alignsymbol}\v!yes \s!nooverflow\space \fi + \ifcstok{\mathaccentparameter\c!offset}\v!auto + \s!base\space + \fi \ifcase#kind\or \s!top\space \m_fixed @@ -192,7 +198,7 @@ %D Relative new: -% \newconditional\c_math_accent_auto_dotless \settrue\c_math_accent_auto_dotless % cf opentype math +% \newconditional\c_math_accent_auto_dotless \c_math_accent_auto_dotless\conditionaltrue % cf opentype math % \aliased\let\normalgrave\grave % \aliased\let\normalddot \ddot @@ -275,6 +281,11 @@ [\v!both] [\c!scale=\v!keep,\c!stretch=\v!yes,\c!shrink=\v!yes] +\definemathaccent + [\v!top:\v!dot] + [\v!top:\v!stretch] + [i=] + %D We have a problem. We can use stackers but then we need to adapt the dimensions %D which is font dependent. So, for now we keep them as accents. @@ -306,8 +317,35 @@ \definemathbottomaccent[\v!bottom:\v!stretch][wideunderleftarrow] ["20EE] \definemathbottomaccent[\v!bottom:\v!stretch][wideunderrightarrow] ["20EF] +% For complex conjugate: i below keeps the dot +% +% \im { \widebar {\cos\theta + \ii \sin\theta} = \cos\theta - \ii\sin\theta }\par +% \im { \conjugate{\cos\theta + \ii \sin\theta} = \cos\theta - \ii\sin\theta } + +\definemathtopaccent[\v!top:\v!dot][conjugate]["0305] +\definemathtopaccent[\v!top:\v!dot][closure] ["0305] +\definemathtopaccent[\v!top:\v!dot][conjugate]["0305] + \aliased\let\mathring\ring % for a while +% \permanent\protected\def\not#1{\Umathaccent class \mathordinarycode exact overlay 0 0 "338 {#1}} +% \permanent\protected\def\not#1{\Umathaccent class \mathrelationcode exact overlay 0 0 "338 {#1}} +% \permanent\protected\def\not#1{\Umathaccent class \mathbinarycode exact overlay 0 0 "338 {#1}} +% +% \definemathcommand[slashD][ordinary]{\Umathaccent class \mathordinarycode exact overlay 0 0 "338 {D}} +% \definemathcommand[slashD][ordinary]{\Umathaccent class \mathordinarycode center overlay 0 0 "338 {D}} + +\permanent\tolerant\protected\def\slashed[#1]#:#2% + {\Umathaccent + \s!class \mathcodechecked{#1}% + \s!center \space + \s!overlay\space + \zerocount \zerocount \forwardslashasciicode + {#2}} % exact when = + +% \definemathcommand[slashD]{\slashed[ordinary]{D}} +% \definemathcommand[slashD]{\slashed{D}} + \popoverloadmode \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt index ee9e56f8fab..1e74ac9cf07 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt @@ -39,7 +39,6 @@ local context = context local commands = commands local mathematics = mathematics local texsetdimen = tex.setdimen -local texisdimen = tex.isdimen local abs = math.abs local blocks = characters.blocks @@ -67,12 +66,23 @@ local fontproperties = fonts.hashes.properties local mathgaps = mathematics.gaps -local d_scratchleftoffset = texisdimen("scratchleftoffset") -local d_scratchrightoffset = texisdimen("scratchrightoffset") +local d_scratchleftoffset = tex.isdimen("scratchleftoffset") +local d_scratchrightoffset = tex.isdimen("scratchrightoffset") local use_math_goodies = true directives.register("math.nogoodies", function(v) use_math_goodies = not v end) local checkitalics = false trackers .register("math.checkitalics", function(v) checkitalics = v end) +local function registerdone(done,unicode) + if not trace_tweaking then + done = true + elseif done then + done[unicode] = true + else + done = { [unicode] = true } + end + return done +end + local mathfontparameteractions = sequencers.new { name = "mathparameters", arguments = "target,original", @@ -113,7 +123,9 @@ function mathematics.initializeparameters(target,original,nodimensions) if not mathparameters.PrimeShiftUpCramped then mathparameters.PrimeShiftUpCramped = mathparameters.SuperscriptShiftUpCramped end if not mathparameters.PrimeSpaceAfter then mathparameters.PrimeSpaceAfter = 0 end if not mathparameters.PrimeWidthPercent then mathparameters.PrimeWidthPercent = 50 end + if not mathparameters.SpaceAfterScript then mathparameters.SpaceAfterScript = 0 end if not mathparameters.SpaceBeforeScript then mathparameters.SpaceBeforeScript = mathparameters.SpaceAfterScript end + if not mathparameters.SpaceBetweenScript then mathparameters.SpaceBetweenScript = mathparameters.SpaceAfterScript end if not mathparameters.NoLimitSupFactor then mathparameters.NoLimitSupFactor = 0 end if not mathparameters.NoLimitSubFactor then mathparameters.NoLimitSubFactor = 0 end if not mathparameters.AccentTopShiftUp then mathparameters.AccentTopShiftUp = 0 end @@ -129,8 +141,19 @@ function mathematics.initializeparameters(target,original,nodimensions) if not mathparameters.AccentExtendMargin then mathparameters.AccentExtendMargin = 50 end if not mathparameters.DelimiterPercent then mathparameters.DelimiterPercent = 100 end if not mathparameters.DelimiterShortfall then mathparameters.DelimiterShortfall = 0 end + if not mathparameters.DelimiterDisplayPercent then mathparameters.DelimiterDisplayPercent = 100 end + if not mathparameters.DelimiterDisplayShortfall then mathparameters.DelimiterDisplayShortfall = 0 end if not mathparameters.RadicalKernAfterExtensible then mathparameters.RadicalKernAfterExtensible = 0 end if not mathparameters.RadicalKernBeforeExtensible then mathparameters.RadicalKernBeforeExtensible = 0 end + if not mathparameters.SuperscriptSnap then mathparameters.SuperscriptSnap = 750 end + if not mathparameters.SubscriptSnap then mathparameters.SubscriptSnap = 250 end + -- +-- if mathparameters.RadicalDisplayStyleVerticalGap then +-- mathparameters.RadicalDisplayStyleVerticalGap = mathparameters.RadicalDisplayStyleVerticalGap - 100 +-- end +-- if mathparameters.RadicalVerticalGap then +-- mathparameters.RadicalVerticalGap = mathparameters.RadicalVerticalGap - 100 +-- end -- target.mathparameters = mathparameters end @@ -153,6 +176,7 @@ local how = { AccentBottomOvershoot = "unscaled", AccentSuperscriptPercent = "unscaled", DelimiterPercent = "unscaled", + DelimiterDisplayPercent = "unscaled", -- RadicalRuleThickness = "vertical", OverbarRuleThickness = "vertical", @@ -325,6 +349,7 @@ mathtweaks.subsets = { i = { 0x1D456 }, mw = { 0x1D45A, 0x1D464 }, p = { 0x1D45D }, + letterlike = { 0x02202 }, dotless = { 0x00049, 0x0004A, 0x00131, 0x00237, 0x1D6A4, 0x1D6A5 }, integrals = { 0x0222B, 0x0222C, 0x0222D, 0x0222E, 0x0222F, 0x02230, 0x02231, 0x02232, 0x02233, 0x02A0B, 0x02A0C, 0x02A0D, 0x02A0E, 0x02A0F, 0x02A10, 0x02A11, 0x02A12, 0x02A13, 0x02A14, 0x02A15, 0x02A16, 0x02A17, 0x02A18, 0x02A19, 0x02A1A, 0x02A1B, 0x02A1C, 0x02320, 0x02321 }, horizontalfences = { 0x0203E, 0x023B4, 0x023B5, 0x023DC, 0x023DD, 0x023DE, 0x023DF, 0x023E0, 0x023E1 }, -- not really used @@ -372,13 +397,15 @@ end local detail do local splitter = lpeg.tsplitat(".") + local private = fonts.helpers.privateslot detail = function(characters,k) if type(k) == "string" then local t = lpegmatch(splitter,k) local n = #t if n > 0 then - local base = tonumber(t[1]) or tonumber(t[1],16) + local slot = t[1] + local base = tonumber(slot) or tonumber(slot,16) or private(slot) if base then local c = characters[base] if c and n > 1 then @@ -548,7 +575,7 @@ do axis = target.mathparameters.AxisHeight * axis end - local factor = v.factor + local factor = v.factor if factor then local m = v v = setmetatableindex({ @@ -752,7 +779,6 @@ do end - do function mathtweaks.wipevariants(target,original,parameters) @@ -769,6 +795,7 @@ do local cnt = v if nxt then local prt = nil + local pro = nil local lst = { } while nxt do local chr = targetcharacters[nxt] @@ -776,6 +803,7 @@ do nxt = chr.next if not nxt then prt = chr.parts + pro = chr.partsorientation break end end @@ -788,14 +816,9 @@ do ori = lst[cnt] end ori.parts = prt + ori.partsorientation = pro end - if not trace_tweaking then - done = true - elseif done then - done[k] = true - else - done = { [k] = true } - end + done = registerdone(done,k) end end feedback_tweak("wipevariants",target,original,done) @@ -804,6 +827,66 @@ do end +do + + -- This is a horrible tweak for lm that has bars inconsistent with other fences. + + local function find(targetcharacters,slot,n) + local chr = targetcharacters[slot] + while chr do + slot = chr.next + if not slot then + break + elseif n == 1 then + return slot + end + n = n - 1 + chr = targetcharacters[slot] + end + return nil + end + + function mathtweaks.fixvariants(target,original,parameters) + local list = parameters.list + if list then + local targetcharacters = target.characters + local done = false + for k, v in sortedhash(list) do + local tmp = v.template + local idx = v.index + local dy = v.yoffset or 0 + if tmp and idx then + local olduni = find(targetcharacters,k,idx) + local tmpuni = find(targetcharacters,tmp,idx) + local axis = target.mathparameters.AxisHeight + if axis then + while olduni and tmpuni do + local oldchr = targetcharacters[olduni] + local tmpchr = targetcharacters[tmpuni] + local oldht = oldchr.height or 0 + local olddp = oldchr.depth or 0 + local tmpht = tmpchr.height or 0 + local tmpdp = tmpchr.depth or 0 + local scale = (tmpht + tmpdp) / (oldht + olddp) + local total = (oldht - olddp) * scale + local yoffset = axis - total/2 + oldchr.effect = { squeeze = scale } + oldchr.height = scale * oldht + yoffset + oldchr.depth = scale * olddp - yoffset + oldchr.yoffset = yoffset + olduni = oldchr.next + tmpuni = tmpchr.next + end + done = registerdone(done,k) + end + end + end + feedback_tweak("addvariants",target,original,done) + end + end + +end + do function mathtweaks.replace(target,original,parameters) @@ -875,13 +958,7 @@ do local t = mathgaps[nn] or nn if t then kerns[t] = vv * width - if not trace_tweaking then - done = true - elseif done then - done[t] = true - else - done = { [t] = true } - end + done = registerdone(done,t) end end) end @@ -922,16 +999,14 @@ end do - local nps = fonts.helpers.newprivateslot - local list = { - { 0x2032, nps("delimited ghost 0x2032"), 1 }, - { 0x2033, nps("delimited ghost 0x2033"), 2, 0x2032 }, - { 0x2034, nps("delimited ghost 0x2034"), 3, 0x2032 }, - { 0x2057, nps("delimited ghost 0x2057"), 4, 0x2032 }, - { 0x2035, nps("delimited ghost 0x2035"), 1 }, - { 0x2036, nps("delimited ghost 0x2036"), 2, 0x2035 }, - { 0x2037, nps("delimited ghost 0x2037"), 3, 0x2035 }, + { 0x2032, 1 }, + { 0x2033, 2, 0x2032 }, + { 0x2034, 3, 0x2032 }, + { 0x2057, 4, 0x2032 }, + { 0x2035, 1 }, + { 0x2036, 2, 0x2035 }, + { 0x2037, 3, 0x2035 }, } datasets.fixprimes = list @@ -943,7 +1018,7 @@ do for i=1,#list do local entry = list[i] local unicode = entry[1] - local count = entry[3] + local count = entry[2] local used = fonts.handlers.otf.getsubstitution(target,unicode,"ssty",true,"math","dflt") or unicode local data = targetcharacters[used] if data then @@ -960,10 +1035,10 @@ do if fake then for i=1,#list do local entry = list[i] - local count = entry[3] + local count = entry[2] if count > 1 then local unicode = entry[1] - local original = entry[4] + local original = entry[3] local data = targetcharacters[original] if data then local oldwidth = data.width @@ -986,51 +1061,6 @@ do end end - function mathtweaks.addprimed(target,original,parameters) - local characters = target.characters - for i=1,#list do - local entry = list[i] - local basecode = entry[1] - local movecode = entry[2] - local basedata = characters[basecode] - if basedata then - local baseheight = basedata.height or 0 - local basewidth = basedata.width or 0 - local used = baseheight - local total = baseheight - characters[movecode] = { -- todo:share - width = basewidth, - height = used, - unicode = basecode, -- 0xFFFD or space or so - -- callback = "devirtualize", - commands = { - downcommand[used], - { "rule", used, 0 }, - }, - } - basedata.partsorientation = "vertical" - basedata.parts = { - { - advance = used, - ["end"] = used, - extender = 1, - glyph = movecode, - start = used, - }, - { - advance = total, - ["end"] = 0, - glyph = basecode, - start = total, - }, - } - if trace_tweaking then - report_tweak("primed %U added",target,original,basecode) - end - end - end - end - end do @@ -1155,13 +1185,7 @@ end -- if a and a > 0 then -- v.topanchor = a * factor -- count = count + 1 --- if not trace_tweaking then --- done = true --- elseif done then --- done[u] = true --- else --- done = { [u] = true } --- end +-- done = registerdone(done,u) -- end -- end -- end @@ -1236,13 +1260,7 @@ do end end v.mathkerns = nil - if not trace_tweaking then - done = true - elseif done then - done[u] = true - else - done = { [u] = true } - end + done = registerdone(done,u) end end feedback_tweak("simplifykerns",target,original,done) @@ -1250,6 +1268,21 @@ do end + +-- In TeX The Program we find in section 543 a remark about the second use of math +-- italic: it is always added to the width except with respect to the position of +-- the subscript. That paragraph also mentions that the number of different widths +-- is normally small so they can be shared (there is an eight bit index into a width +-- array). Actually the limits of at most 16 heights and depths has as side effect +-- that we get some snapping of sizes. Now, because many math characters have an +-- italic correction, the saving on shared widths is negated by the amount of (at +-- most 64) italics. So in practice there is no gain and the italic correction could +-- have served as bottom kern. We think that the following approach (that we actualy +-- came to by a different reasonsing: inconsistent open type fonts) is quite valid +-- and robust. It's just that the opentype math fonts should never have gone that +-- TeX italic route. Italic usage is more clear from section 543 than from the math +-- rendering code. + do local function wipe(whatever,target,original,parameters,field,move,integrals) @@ -1318,13 +1351,7 @@ c.bottomanchor = width/2 -- maybe optional okay = true end if okay then - if not trace_tweaking then - done = true - elseif done then - done[u] = true - else - done = { [u] = true } - end + done = registerdone(done,u) else goto smaller end @@ -1418,16 +1445,7 @@ do local w = c.width if w and w ~= 0 then c.topanchor = v * w - if trace_tweaking then - -- todo - end - if not trace_tweaking then - done = true - elseif done then - done[u] = true - else - done = { [u] = true } - end + done = registerdone(done,u) end end end @@ -1454,8 +1472,10 @@ do if italic ~= 0 then local width = c.width or 0 local half = (italic/2) * factor + -- kind of weird ... needs to be in sync with engine .. needs checking c.topanchor = width + half c.bottomanchor = width - half +-- print(width/65536,c.topanchor/65536) c.bottomright = - italic * (parameters.icfactor or 1) if trace_tweaking then -- todo @@ -1536,13 +1556,7 @@ do local k = data.topright ; if k and k ~= 0 then chardata.topright = k * width end local k = data.bottomleft ; if k and k ~= 0 then chardata.bottomleft = k * width end local k = data.bottomright ; if k and k ~= 0 then chardata.bottomright = k * width end - if not trace_tweaking then - done = true - elseif done then - done[unicode] = true - else - done = { [unicode] = true } - end + done = registerdone(done,unicode) end end local unicode = detail(characters,uc) @@ -1566,31 +1580,60 @@ end do +-- function mathtweaks.margins(target,original,parameters) +-- local margins = parameters.list +-- if margins then +-- local characters = target.characters +-- local done = false +-- local function setone(unicode,data) +-- unicode = mathgaps[unicode] or unicode +-- local chardata = characters[unicode] +-- if chardata then +-- local width = chardata.width or 0 +-- local total = (chardata.height or 0) + (chardata.depth or 0) +-- local k = data.left ; if k and k ~= 0 then chardata.leftmargin = k * width end +-- local k = data.right ; if k and k ~= 0 then chardata.rightmargin = k * width end +-- local k = data.top ; if k and k ~= 0 then chardata.topmargin = k * total end +-- local k = data.bottom ; if k and k ~= 0 then chardata.bottommargin = k * total end +-- done = registerdone(done,unicode) +-- end +-- end +-- for unicode, data in next, margins do +-- setone(unicode,data) -- withscriptcode(tfmdata,unicode,data,kernone) +-- -- also smaller +-- end +-- feedback_tweak("margins",target,original,done) +-- end +-- end + function mathtweaks.margins(target,original,parameters) - local margins = parameters.list - if margins then + local kerns = parameters.list + if kerns then local characters = target.characters local done = false - local function setone(unicode,data) - unicode = mathgaps[unicode] or unicode - local chardata = characters[unicode] - if chardata then - local width = chardata.width or 0 - local total = (chardata.height or 0) + (chardata.depth or 0) - local k = data.left ; if k and k ~= 0 then chardata.leftmargin = k * width end - local k = data.right ; if k and k ~= 0 then chardata.rightmargin = k * width end - local k = data.top ; if k and k ~= 0 then chardata.topmargin = k * total end - local k = data.bottom ; if k and k ~= 0 then chardata.bottommargin = k * total end - if not trace_tweaking then - done = true - elseif done then - done[unicode] = true - else - done = { [unicode] = true } + local function setone(uc,data) + local function set(unicode) + unicode = mathgaps[unicode] or unicode + local chardata = characters[unicode] + if chardata then + local width = chardata.width or 0 + local k = data.left ; if k and k ~= 0 then chardata.leftmargin = k * width end + local k = data.right ; if k and k ~= 0 then chardata.rightmargin = k * width end + local k = data.top ; if k and k ~= 0 then chardata.topmargin = k * width end + local k = data.bottom ; if k and k ~= 0 then chardata.bottommargin = k * width end + done = registerdone(done,unicode) end end + local unicode = detail(characters,uc) + if type(unicode) == "table" then + for i=1,#unicode do + set(unicode[i]) + end + elseif unicode then + set(unicode) + end end - for unicode, data in next, margins do + for unicode, data in next, kerns do setone(unicode,data) -- withscriptcode(tfmdata,unicode,data,kernone) -- also smaller end @@ -1598,6 +1641,7 @@ do end end + end do @@ -1822,18 +1866,22 @@ do local privateslot = fonts.helpers.privateslot local newprivateslot = fonts.helpers.newprivateslot + -- no checking for present extensibles + function mathtweaks.addrules(target,original,parameters) local characters = target.characters local thickness = target.mathparameters.OverbarRuleThickness - local width = target.parameters.emwidth / 2 local width = target.parameters.emwidth / 3 --- local step = 0.8 * width - local step = 0.5 * width + local step = width / 2 + local quarter = thickness / 4 + local half = thickness / 2 + local double = thickness * 2 + local done = false characters[0x203E] = { -- middle used for all kind width = width, - height = thickness / 2, - depth = thickness / 2, - yoffset = - thickness / 2, + height = half, + depth = half, + yoffset = - half, unicode = 0x203E, commands = { { "rule", thickness, width } }, parts = { @@ -1849,7 +1897,7 @@ do local right = rightarrow.parts if left and right then local leftline = right[1].glyph - local rightline = left [#left].glyph + local rightline = left[#left].glyph local leftdata = characters[leftline] local rightdata = characters[rightline] local leftwidth = leftdata.width @@ -1874,6 +1922,7 @@ do { advance = rightwidth, glyph = rightline, ["end"] = .1*leftwidth, start = .9*rightwidth, extender = 1 }, } result.partsorientation = "horizontal" + done = registerdone(done,target) end end end @@ -1882,63 +1931,79 @@ do -- -- lucida lacks them ... -- - local half = thickness / 2 - local double = thickness * 2 - -- if not characters[0x23B4] then + local depth = 0 + local height = 5 * thickness local tpiece = addprivate(target,"bracket-piece-top",{ width = thickness, - height = half, - depth = double, - yoffset = - double, - commands = { { "rule", thickness * 2.5, thickness } }, + height = height, + depth = depth, + commands = { upcommand[thickness], { "rule", 4 * thickness, thickness } }, + }) + local mpiece = addprivate(target,"bracket-piece-top-middle",{ + width = width, + height = height, + depth = depth, + commands = { upcommand[4*thickness], { "rule", thickness, width } }, }) characters[0x23B4] = { -- over --- width = width, - width = 2*thickness+width, - height = half, - depth = double, + width = double + width, + height = height, + depth = depth, unicode = 0x23B4, +extensible = false, commands = { slotcommand[0][tpiece], - slotcommand[0][0x203E], + slotcommand[0][mpiece], slotcommand[0][tpiece], }, parts = { - { advance = thickness, glyph = tpiece, ["end"] = 0, start = half }, - { advance = width, glyph = 0x203E, ["end"] = step, start = step, extender = 1 }, + { advance = thickness, glyph = tpiece, ["end"] = 0, start = half }, + { advance = width, glyph = mpiece, ["end"] = step, start = step, extender = 1 }, { advance = thickness, glyph = tpiece, ["end"] = half, start = 0 }, }, partsorientation = "horizontal", } + done = registerdone(done,0x23B4) end if not characters[0x23B5] then + local depth = 0 + local height = 5 * thickness local bpiece = addprivate(target,"bracket-piece-bottom",{ width = thickness, - height = double, - depth = half, - yoffset = - half, - commands = { { "rule", thickness * 2.5, thickness } }, + height = height, + depth = depth, + yoffset = depth, + commands = { { "rule", 4 * thickness, thickness } }, + }) + local mpiece = addprivate(target,"bracket-piece-bottom-middle",{ + width = width, + height = height, + depth = depth, + commands = { { "rule", thickness, width } }, }) characters[0x23B5] = { -- under - width = 2*thickness+width, - height = double, - depth = half, + width = double + width, + height = height, + depth = depth, unicode = 0x23B5, +extensible = false, commands = { slotcommand[0][bpiece], - slotcommand[0][0x203E], + slotcommand[0][mpiece], slotcommand[0][bpiece], }, parts = { - { advance = thickness, glyph = bpiece, ["end"] = 0, start = half }, - { advance = width, glyph = 0x203E, ["end"] = step, start = step, extender = 1 }, + { advance = thickness, glyph = bpiece, ["end"] = 0, start = half }, + { advance = width, glyph = mpiece, ["end"] = step, start = step, extender = 1 }, { advance = thickness, glyph = bpiece, ["end"] = half, start = 0 }, }, partsorientation = "horizontal", } + done = registerdone(done,0x23B5) end -- + feedback_tweak("rules",target,original,done) end -- vfmath.builders.extension(target) @@ -1964,6 +2029,8 @@ do newprivateslot("minus rule right piece"), } + local forceextensible_tag = tex.charactertagcodes.forceextensible + local function useminus(target,unicode,characters,parameters,skipfirst,what,tounicode) local minus = characters[0x2212] local parts = minus.parts @@ -1971,8 +2038,9 @@ do parameters = { } end if parts then - what = copytable(what) - parts = copytable(parts) + minus.tag = forceextensible_tag + what = copytable(what) + parts = copytable(parts) local xscale = parameters.xscale or 1 -- why not applied to width ? local yscale = parameters.yscale or 1 local mwidth = minus.width @@ -1999,28 +2067,31 @@ do xshift = loverlap * width width = width - xshift elseif i == #parts and roverlap ~= 0 then - width = width + roverlap * width + width = width - roverlap * width end characters[what[i]] = { height = height, depth = height, width = width, advance = gdata.width, + unicode = 0xFFFD, -- we have no unicode ignore ... maybe zws commands = { leftcommand[xshift], downcommand[yshift], { "slot", 0, glyph, xscale, yscale }, }, } -if part["start"] >= width then - part["start"] = width -end -if part["end"] >= width then - part["end"] = width -end -part.advance = width + -- we should overlap more ... + if part["start"] >= width then + part["start"] = width + end + if part["end"] >= width then + part["end"] = width + end + part.advance = width part.glyph = what[i] end + characters[what[1]].unicode = unicode -- nice for tagging xshift = loffset * mwidth + loverlap * mwidth width = mwidth - xshift - roffset * mwidth - roverlap * mwidth characters[unicode] = { @@ -2028,6 +2099,8 @@ part.advance = width height = height, depth = height, width = width, + tag = forceextensible_tag, + -- not needed as we force: commands = { leftcommand[xshift], downcommand[yshift], @@ -2307,10 +2380,13 @@ end if trace_tweaking then report_tweak("arrows added",target,original) end + end end + + do -- this could be combined with the previous function mathtweaks.addparts(target,original,parameters) @@ -2323,8 +2399,9 @@ do -- this could be combined with the previous local source = characters[template] local target = characters[unicode] if source and target then - local sequence = data.sequence + local sequence = data.sequence if sequence then + -- we should follow the next chain first local parts = source.parts if parts then local p = { } @@ -2456,6 +2533,34 @@ do 0x221A, } +-- local function fix(target,original,characters,unicode) +-- local data = characters[unicode] +-- if data then +-- local height = data.height or 0 +-- local depth = data.depth or 0 +-- if depth > height then +-- if trace_tweaking then +-- report_tweak("swapping height and depth of radical %U",target,original,unicode) +-- end +-- data.height = depth +-- data.depth = height +-- if data.rorrim then +-- -- the original does the magic +-- else +-- data.yoffset = depth - height +-- end +-- end +-- local smaller = data.smaller +-- if smaller then +-- fix(target,original,characters,smaller) +-- end +-- local mirror = data.mirror +-- if mirror then +-- fix(target,original,characters,mirror) +-- end +-- end +-- end + local function fix(target,original,characters,unicode) local data = characters[unicode] if data then @@ -2465,21 +2570,31 @@ do if trace_tweaking then report_tweak("swapping height and depth of radical %U",target,original,unicode) end - data.height = depth - data.depth = height if data.rorrim then -- the original does the magic else - data.yoffset = depth - height + data.height = (data.height or 0) + (data.depth or 0) + data.yoffset = data.depth + data.depth = 0 end end local smaller = data.smaller if smaller then fix(target,original,characters,smaller) end - local mirror = data.mirror - if mirror then - fix(target,original,characters,mirror) + -- local mirror = data.mirror + -- if mirror then + -- fix(target,original,characters,mirror) + -- end + local next = data.next + if next then + fix(target,original,characters,next) + else + -- -- assume no depth + -- local parts = data.parts + -- if parts then + -- fix(target,original,characters,parts[1].glyph) + -- end end end end @@ -2519,6 +2634,31 @@ do end end + local function fix(target,original,characters,u,l) + local data = characters[u] + if data then + data.leftmargin = (l.left or 1) * (data.width or 0) + data.rightmargin = (l.right or 1) * (data.width or 0) + end + end + + function mathtweaks.radicalbodymargins(target,original,parameters) + local list = parameters.list + if list then + local characters = target.characters + for unicode, l in sortedhash(list) do -- resolve variants + local u = detail(characters,unicode) or unicode + if type(u) == "table" then + for i=1,#u do + fix(target,original,characters,u[i],l) + end + else + fix(target,original,characters,u,l) + end + end + end + end + end do @@ -2634,13 +2774,7 @@ do depth = 0, unicode = unicode, } - if not trace_tweaking then - done = true - elseif done then - done[unicode] = true - else - done = { [unicode] = true } - end + done = registerdone(done,unicode) end feedback_tweak("wipecues",target,original,done) end @@ -2663,13 +2797,7 @@ do local weirdone = characters[weird] if normalone and weirdone and not normalone.next then normalone.next = weirdone.next - -- if not trace_tweaking then - -- done = true - -- elseif done then - -- done[normal] = true - -- else - -- done = { [normal] = true } - -- end + -- done = registerdone(done,normal) end weirdone = copytable(normalone) characters[weird] = weirdone @@ -2731,7 +2859,7 @@ if false then if b then local llx = b[1] * target.parameters.hfactor local urx = b[3] * target.parameters.hfactor - width = urx - llx + local width = urx - llx stretchingdata.width = width stretchingdata.xoffset = - llx stretchingdata.advance = urx @@ -2747,13 +2875,7 @@ else stretchingdata.topanchor = topanchor stretchingdata.commands = { rightcommand[width + topanchor], charcommand[stretching] } end - if not trace_tweaking then - done = true - elseif done then - done[stretching] = true - else - done = { [stretching] = true } - end + done = registerdone(done,stretching) end end feedback_tweak("fixaccents",target,original,done) @@ -2769,12 +2891,16 @@ end local d = chardata[data.unicode or unicode] local c = d and d.category if c == "mn" or c == "sk" or c == "lm" then -- we can probably can go - local b = target.descriptions[unicode].boundingbox + local b = target.descriptions[unicode] + if b then + b = b.boundingbox + end if b then local topanchor = data.topanchor or 0 local llx = b[1] * factor local urx = b[3] * factor -- if topanchor < 0 then +data.advance = data.width if true then -- width = - topanchor width = 2 * (topanchor - llx) @@ -2786,7 +2912,6 @@ if true then data.xoffset = -llx else width = urx - llx - -- data.advance = urx data.commands = { leftcommand[llx], slotcommand[0][unicode] @@ -2796,13 +2921,7 @@ end data.topanchor = width/2 data.bottomanchor = width/2 end - if not trace_tweaking then - done = true - elseif done then - done[unicode] = true - else - done = { [unicode] = true } - end + done = registerdone(done,unicode) end end end @@ -2846,13 +2965,7 @@ end cnt = cnt + 1 end if okay then - if not trace_tweaking then - done = true - elseif done then - done[stretching] = true - else - done = { [stretching] = true } - end + done = registerdone(done,stretching) end end end @@ -2899,13 +3012,7 @@ characters[slot] = { -- end last.flataccent = slot - if not trace_tweaking then - done = true - elseif done then - done[stretching] = true - else - done = { [stretching] = true } - end + done = registerdone(done,stretching) end code = last.next if code then @@ -2938,13 +3045,7 @@ characters[slot] = { -- unicode = stretching, -- when we alias to combiners unicode = alias, -- when we keep the original } - if not trace_tweaking then - done = true - elseif done then - done[stretching] = true - else - done = { [stretching] = true } - end + done = registerdone(done,stretching) end end end @@ -2964,13 +3065,7 @@ characters[slot] = { local chardata = characters[unicode] if chardata then chardata.keepbase = true - if not trace_tweaking then - done = true - elseif done then - done[unicode] = true - else - done = { [unicode] = true } - end + done = registerdone(done,unicode) end end else @@ -3120,10 +3215,17 @@ do local nps = fonts.helpers.newprivateslot - local radical = 0x0221A - local actuarian = nps("delimited right annuity") -- 0x020E7 - local nairautca = nps("delimited left annuity" ) - local placehold = nps("delimited ghost annuity") + local radical = 0x0221A + local actuarianrightlong = nps("delimited right annuity long") -- 0x020E7 + local actuarianrightshort = nps("delimited right annuity short") + local actuarianleftlong = nps("delimited left annuity long" ) + local actuarianleftshort = nps("delimited left annuity short" ) + local placehold = nps("delimited ghost annuity") + + local actuarianbottomrightlong = nps("delimited bottom right annuity long") -- 0x020E7 + local actuarianbottomrightshort = nps("delimited bottom right annuity short") + local actuarianbottomleftlong = nps("delimited bottom left annuity long" ) + local actuarianbottomleftshort = nps("delimited bottom left annuity short" ) function mathtweaks.addactuarian(target,original,parameters) local characters = target.characters @@ -3135,6 +3237,19 @@ do local basetotal = baseheight + basedepth local used = baseheight -- + characters[placehold] = { + width = 2*linewidth, + height = baseheight, + depth = basedepth, + unicode = actuarian, -- whatever + callback = "devirtualize", + commands = { + rightcommand[linewidth], + downcommand[basedepth], + { "rule", basetotal, 0 }, + }, + } + -- characters[0x020E7] = { width = 6*linewidth, height = baseheight, @@ -3149,7 +3264,7 @@ do }, } -- - characters[actuarian] = { + characters[actuarianrightlong] = { width = 2*linewidth, height = baseheight, depth = basedepth, @@ -3163,19 +3278,74 @@ do { advance = basetotal, ["end"] = used, - glyph = actuarian, + glyph = actuarianrightlong, start = 0, }, { advance = basetotal, ["end"] = 0, extender = 1, - glyph = actuarian, + glyph = actuarianrightlong, start = used, }, } } - characters[placehold] = { + characters[actuarianbottomrightlong] = + characters[actuarianrightlong] + characters[actuarianrightshort] = { + width = 2*linewidth, + height = baseheight, + depth = basedepth, + unicode = actuarian, + callback = "devirtualize", + commands = { + upcommand[baseheight-4*linewidth], + { "rule", 4*linewidth, linewidth }, + }, + parts = { + { + advance = basetotal, + ["end"] = used, + glyph = actuarianrightshort, + start = 0, + }, + { + advance = basetotal, + ["end"] = 0, + extender = 1, + glyph = actuarianrightshort, + start = used, + }, + } + } + characters[actuarianbottomrightshort] = { + width = 2*linewidth, + height = linewidth, + depth = basedepth, + unicode = actuarian, + callback = "devirtualize", + commands = { + downcommand[basedepth], + { "rule", 4*linewidth, linewidth }, + }, + parts = { + { + advance = basetotal, + ["end"] = used, + glyph = actuarianrightshort, + start = 0, + }, + { + advance = basetotal, + ["end"] = 0, + extender = 1, + glyph = actuarianrightshort, + start = used, + }, + } + } + + characters[actuarianleftlong] = { width = 2*linewidth, height = baseheight, depth = basedepth, @@ -3184,20 +3354,32 @@ do commands = { rightcommand[linewidth], downcommand[basedepth], - { "rule", basetotal, 0 }, + { "rule", basetotal, linewidth }, }, + parts = { + { + advance = basetotal, + ["end"] = used, + extender = 1, + glyph = placehold, + start = 0, + }, + { + advance = basetotal, + ["end"] = 0, + glyph = actuarianleftlong, + start = used, + }, + } } - characters[nairautca] = { + characters[actuarianbottomleftlong] = + characters[actuarianleftlong] + characters[actuarianleftshort] = { width = 2*linewidth, height = baseheight, depth = basedepth, unicode = actuarian, -- whatever callback = "devirtualize", - -- commands = { - -- rightcommand[linewidth], - -- downcommand[basedepth], - -- { "rule", basetotal, linewidth }, - -- }, commands = { rightcommand[linewidth], upcommand[baseheight-4*linewidth], @@ -3214,11 +3396,40 @@ do { advance = basetotal, ["end"] = 0, - glyph = nairautca, + glyph = actuarianleftshort, + start = used, + }, + } + } + characters[actuarianbottomleftshort] = { + width = 2*linewidth, + -- height = baseheight, + height = linewidth, + depth = basedepth, + unicode = actuarian, -- whatever + callback = "devirtualize", + commands = { + rightcommand[linewidth], + downcommand[basedepth], + { "rule", 4*linewidth, linewidth }, + }, + parts = { + { + advance = basetotal, + ["end"] = used, + extender = 1, + glyph = placehold, + start = 0, + }, + { + advance = basetotal, + ["end"] = 0, + glyph = actuarianleftshort, start = used, }, } } + -- if trace_tweaking then report_tweak("actuarian %U added",target,original,actuarian) end @@ -3246,6 +3457,14 @@ do { 0x0303, nps("delimited right tilde"), nps("delimited ghost tilde") }, { 0x20DB, nps("delimited right dddot"), nps("delimited ghost dddot") }, + { 0x2032, nps("delimited right prime"), nps("delimited ghost prime"), false, 1 }, + { 0x2033, nps("delimited right dprime"), nps("delimited ghost dprime"), false, 1 }, + { 0x2034, nps("delimited right tprime"), nps("delimited ghost tprime"), false, 1 }, + { 0x2057, nps("delimited right qprime"), nps("delimited ghost qprime"), false, 1 }, + { 0x2035, nps("delimited right rprime"), nps("delimited ghost rprime"), false, 1 }, + { 0x2036, nps("delimited right drprime"), nps("delimited ghost rdprime"), false, 1 }, + { 0x2037, nps("delimited right dtprime"), nps("delimited ghost rtprime"), false, 1 }, + { 0x231C, nps("delimited left upper corner"), nps("delimited ghost upper corner") }, { 0x231D, nps("delimited right upper corner"), nps("delimited ghost upper corner") }, { 0x231E, nps("delimited left lower corner"), nps("delimited ghost lower corner"), true }, @@ -3275,6 +3494,7 @@ do local size = entry[5] or 0 local basechar = characters[basecode] local compactscale = 1 + -- bah ... if basechar and target.properties.compactmath and size > 0 then compactscale = target.parameters[size > 1 and "scriptscriptscale" or "scriptscale"] / 1000 for i=1,size do @@ -3307,8 +3527,7 @@ do characters[movecode] = { width = basewidth, height = used, - unicode = basecode, - -- callback = "devirtualize", + unicode = 0xFFFD, commands = { downcommand[used], { "rule", used, 0 }, @@ -3319,13 +3538,13 @@ do advance = used, ["end"] = used, extender = 1, - glyph = movecode, + glyph = movecode, -- bottom start = used, }, { advance = total, ["end"] = 0, - glyph = fouriercode, + glyph = fouriercode, -- top start = total, }, } @@ -3334,15 +3553,16 @@ do end characters[fouriercode] = { width = basewidth, - height = baseheight, + height = baseheight, -- somehow no \primed antykwa (unless we double the height) depth = basedepth, unicode = basecode, - -- callback = "devirtualize", commands = { scale == 1 and charcommand[basecode] or { "slot", 0, basecode, scale, scale }, }, partsorientation = "vertical", - parts = parts, + parts = parts, +-- keepvirtual = basechar.commands and true or false, + -- callback = "devirtualize", } if trace_tweaking then report_tweak("fourier %U added using %U",target,original,basecode,fouriercode) @@ -3365,18 +3585,19 @@ do local function variantlist(unicode,chardata,total,used) chardata.varianttemplate = 0x0028 + -- chardata.next = nil -- better use wipe variants but for testign we keep them chardata.parts = { { advance = total, ["end"] = used, glyph = unicode, start = 0, - -- start = used/5, }, { advance = total, -- ["end"] = 0, - ["end"] = used/5, -- prevents small gap with inward curved endpoints + -- ["end"] = used/5, -- prevents small gap with inward curved endpoints + ["end"] = 4*used/5, -- is this better? extender = 1, glyph = unicode, start = used, @@ -3385,52 +3606,80 @@ do chardata.partsorientation = "vertical" end + -- This is such an inconsistent mess that we cannot simply copy variants so we + -- just accept some middle ground for the missing ones. See goodie files for when + -- 'check' and/or 'variant' is used. + function mathtweaks.addbars(target,original,parameters) local characters = target.characters - local basechar = characters[single] - local width = basechar.width - local height = basechar.height - local depth = basechar.depth - local advance = (parameters.advance or 1/10) * width - local used = 1.2*height -- large overlap because no smaller pieces - local total = height + depth - -- - -- variantlist(characters,single,basechar,"single bar",total,used) - variantlist(single,basechar,total,used) + local template = single + local basechar = characters[template] + local tempchar = basechar + local check = parameters.check + -- local variant = false -- alas ... too large: tonumber(parameters.variant) + -- if variant then + -- for i=1,variant do + -- local n = tempchar.next + -- if n then + -- template = n + -- tempchar = characters[template] + -- else + -- break + -- end + -- end + -- end + local width = tempchar.width + local height = tempchar.height + local depth = tempchar.depth + local advance = (parameters.advance or 1/10) * width + local used = 1.2*height -- large overlap because no smaller pieces + local total = height + depth -- - basechar = { - unicode = double, - width = 2*width - 1*advance, - height = height, - depth = depth, --- callback = "devirtualize", - commands = { - charcommand[single], - leftcommand[advance], - charcommand[single], - }, - } - characters[double] = basechar - -- variantlist(characters,double,basechar,"double bar",total,used) - variantlist(double,basechar,total,used) - -- - basechar = { - unicode = triple, - width = 3*width - 2*advance, - height = height, - depth = depth, --- callback = "devirtualize", - commands = { - charcommand[single], - leftcommand[advance], - charcommand[single], - leftcommand[advance], - charcommand[single], - }, - } - characters[triple] = basechar - -- variantlist(characters,triple,basechar,"triple bar",total,used) - variantlist(triple,basechar,total,used) + if not check or not basechar.parts then + variantlist(template,basechar,total,used) + end + if not check or not characters[double] then + basechar = { + unicode = double, + width = 2*width - 1*advance, + height = height, + depth = depth, + -- callback = "devirtualize", + commands = { + charcommand[template], + leftcommand[advance], + charcommand[template], + }, + } + characters[double] = basechar + else + basechar = characters[double] + end + if not check or not basechar.parts then + variantlist(double,basechar,total,used) + end + if not check or not characters[triple] then + basechar = { + unicode = triple, + width = 3*width - 2*advance, + height = height, + depth = depth, + -- callback = "devirtualize", + commands = { + charcommand[template], + leftcommand[advance], + charcommand[template], + leftcommand[advance], + charcommand[template], + }, + } + characters[triple] = basechar + else + basechar = characters[triple] + end + if not check or not basechar.parts then + variantlist(triple,basechar,total,used) + end -- if trace_tweaking then report_tweak("single, double and triple bars added",target,original) @@ -3791,6 +4040,31 @@ end -- -- end +do + + local placeholder = { + width = 0, + height = 0, + depth = 0, + commands = { + { "rule" , 0, 0 } + } + } + + local list = { 0x2061 } + + function mathtweaks.wipeweirdones(target,original,parameters) + local characters = target.characters + for i=1,#list do + local l = list[i] + -- if characters[l] then -- applyfunction + characters[l] = placeholder + -- end + end + end + +end + do function mathtweaks.setoptions(target,original,parameters) @@ -3853,13 +4127,7 @@ do local data = characters[unicode] if data then data.topovershoot = top * (quad or data.width or 0) - if not trace_tweaking then - done = true - elseif done then - done[r] = true - else - done = { [r] = true } - end + done = registerdone(done,r) end end end @@ -3902,34 +4170,42 @@ do fonts[1] = { id = 0, size = size } -- self, will be resolved later end for i=1,#list do - local entry = list[i] - local filename = entry.filename or parameters.filename - local feature = entry.feature - local thesource = entry.source - local thetarget = entry.target or thesource - local keep = (entry.keep == true) or (parameters.keep == true) - if thesource and thetarget then - local sourcerange = type(thesource) == "table" and thesource or blocks[thesource] -- .gaps - local targetrange = type(thetarget) == "table" and thetarget or blocks[thetarget] -- .gaps - if sourcerange and targetrange then - local firsttarget = targetrange.first - local firstsource = sourcerange.first - local lastsource = sourcerange.last or firstsource - if firstsource and firsttarget then - local offset = firsttarget - firstsource - if filename then - local rscale = entry.rscale or 1 -- todo - size = size * rscale -- maybe use scale in vf command - -- load font, todo: set language and script, the effect hack is ugly - local fullname = filename - local effect = features.effect - if effect then - fullname = fullname .. "*" .. effects["effect={"..effect.."}"] - end - local id = definedfont { - name = fullname, - size = size, - } + local entry = list[i] + local filename = entry.filename or parameters.filename + local feature = entry.feature + local thesource = entry.source + local thetarget = entry.target or thesource + local theunicode = entry.unicode + local unicodes = entry.unicodes + local keep = (entry.keep == true) or (parameters.keep == true) + if (thesource and thetarget) or unicodes then + local function getrange(t) + return (type(t) == "table" and t) or (type(t) == "string" and blocks[t]) -- .gaps + end + local sourcerange = thesource and getrange(thesource) + local targetrange = thetarget and getrange(thetarget) + local unicoderange = theunicode and getrange(theunicode) + local firsttarget = targetrange and targetrange.first + local firstsource = sourcerange and sourcerange.first + local lastsource = sourcerange and sourcerange.last or firstsource + if (firstsource and firsttarget) or unicodes then + local offset = unicodes and 0 or (firsttarget - firstsource) + if filename then + local rscale = entry.rscale or 1 -- todo + size = size * rscale -- maybe use scale in vf command + -- load font, todo: set language and script, the effect hack is ugly + local fullname = filename + local effect = features.effect + if effect then + fullname = fullname .. "*" .. effects["effect={"..effect.."}"] + end + local id = definedfont { + name = fullname, + size = size, + } + if id <= 0 then + report_math("font %a doesn't exist",fullname) + else local chars = fontchars[id] local dropin = fontdata[id] local index = false @@ -3945,21 +4221,29 @@ do fonts[index] = { id = id, size = size } end -- copy characters - for s=firstsource,lastsource do - local t = s + offset - local sourceunicode = mathgaps[s] or s - if chars[sourceunicode] then - local targetunicode = mathgaps[t] or t - if keep and characters[targetunicode] then - -- okay - else - if feature then - sourceunicode = getsubstitution(dropin,sourceunicode,feature,true,"math","dflt") or sourceunicode - end --- if trace_tweaking then --- report_tweak("copying %s %U from file %a to %s %U",target,original,thesource,sourceunicode,filename,thetarget,targetunicode) --- end - characters[targetunicode] = copiedglyph(target,characters,chars,sourceunicode,index) + local function use(sourceunicode,targetunicode) + if keep and characters[targetunicode] then + -- okay + else + if feature then + sourceunicode = getsubstitution(dropin,sourceunicode,feature,true,"math","dflt") or sourceunicode + end + characters[targetunicode] = copiedglyph(target,characters,chars,sourceunicode,index) + end + end + if unicodes then + for i=1,#unicodes do + local unicode = unicodes[i] + if chars[unicode] then + use(unicode,unicode) + end + end + else + for s=firstsource,lastsource do + local t = s + offset + local sourceunicode = mathgaps[s] or s + if chars[sourceunicode] then + use(sourceunicode,mathgaps[t] or t) end end end @@ -3977,22 +4261,33 @@ do end end end - -- - elseif feature then + end + elseif feature then + local function use(sourceunicode,targetunicode) + local variant = getsubstitution(original,sourceunicode,feature,true,"math","dflt") + local data = characters[variant] + if data then + characters[targetunicode] = copytable(data) + end + end + if unicodes then + for i=1,#unicodes do + local unicode = unicodes[i] + use(unicode,unicode) + end + else for s=firstsource,lastsource do local t = s + offset - local sourceunicode = mathgaps[s] or s - local targetunicode = mathgaps[t] or t - local variant = getsubstitution(original,sourceunicode,feature,true,"math","dflt") - local data = characters[variant] - if data then --- if trace_tweaking then --- report_tweak("copying %s %U from feature %a to %s %U",target,original,thesource,sourceunicode,feature,thetarget,targetunicode) --- end - characters[targetunicode] = copytable(data) - end + use(mathgaps[s] or s,mathgaps[t] or t) end + end + else + -- this is a hack for stix providing alphabets without proper unicodes + if unicodes then + -- not supported else + local firstcode = unicoderange and unicoderange.first + local descriptions = original.descriptions for s=firstsource,lastsource do local t = s + offset local sourceunicode = mathgaps[s] or s @@ -4000,16 +4295,19 @@ do if sourceunicode ~= targetunicode then local data = characters[sourceunicode] if data then --- if trace_tweaking then --- report_tweak("copying %s %U to %s %U",target,original,thesource,sourceunicode,thetarget,targetunicode) --- end + if firstcode then + local d = descriptions[sourceunicode] + if d then + d.unicode = firstcode -- wins + end + data.unicode = firstcode + firstcode = firstcode + 1 + end characters[targetunicode] = copytable(data) end end end end - else - -- error end end end @@ -4130,6 +4428,7 @@ end function mathematics.tweakaftercopyingfont(target,original) if use_math_goodies and tweakable(target) then applytweaks("aftercopying",target,original) + target.properties.hasitalics = false end end @@ -4220,9 +4519,6 @@ do goto NEXTSTEP end end - - target.properties.mathitalics = false - target.properties.textitalics = false ::NEXTSTEP:: -- more to come end diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl index 7b61fd234df..4ddbe405a87 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl @@ -44,6 +44,8 @@ \else \displaywidth \fi + -\leftskip + -\rightskip \relax} \permanent\def\maximizeddisplaywidth % larger than zero but within hsize @@ -55,6 +57,8 @@ \else \displaywidth \fi + -\leftskip + -\rightskip \relax} %D \macros @@ -71,8 +75,6 @@ % \stopalign % \stopformula -\newtoks \mathdisplayaligntweaks - \newtoks \t_math_align_a \newtoks \t_math_align_b \newtoks \t_math_align_c @@ -83,12 +85,77 @@ \mutable\def\displayopenupvalue{.25\bodyfontsize} +\installcorenamespace{mathalignendclass} % maybe {complexmathendclass} + +\global\expandafter\integerdef\csname\??mathalignendclass\the\zerocount\endcsname\mathendcode + \protected\def\math_eqalign_distance - {%global\expandafter\integerdef\csname\??mathbeginclass\the\c_math_eqalign_column\endcsname\mathbegincode - \global\expandafter\integerdef\csname\??mathendclass \the\c_math_eqalign_column\endcsname\mathendcode + {\global\expandafter\integerdef\csname\??mathalignendclass\the\c_math_eqalign_column\endcsname\mathendcode \mathalignmentparameter\c!separator \relax} +% \def\math_build_eqalign +% {\scratchtoks\emptytoks +% \d_math_eqalign_distance\mathalignmentparameter\c!distance\relax +% \ifcstok{\mathalignmentparameter\c!align}\v!auto +% \d_math_eqalign_number_distance\mathalignmentparameter\c!numberdistance\relax +% \letmathalignmentparameter\c!align\v!middle +% \else +% \d_math_eqalign_number_distance\zeropoint +% \fi +% \scratchcounterone\mathalignmentparameter\c!m +% \scratchcountertwo\mathalignmentparameter\c!n +% \toksapp\scratchtoks\t_math_align_a +% \toksapp\scratchtoks{\global\c_math_eqalign_repeat\zerocount}% +% \scratchcounter\plusone +% \localcontrolledrepeat \numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax +% {\ifnum\scratchcounter=\scratchcountertwo +% \scratchcounter\plusone +% % preamble expansion hell ... +% \toksapp\scratchtoks {\tabskip\d_math_eqalign_distance}% +% % so ... +% \toksapp\scratchtoks {\relax\math_eqalign_distance}% +% \etoksapp\scratchtoks{\global\advanceby\c_math_eqalign_repeat\the\scratchcountertwo\relax}% +% \else +% \advanceby\scratchcounter\plusone +% \fi +% \toksapp\scratchtoks\t_math_align_b}% +% \toksapp\scratchtoks\t_math_align_c +% \toksapp\scratchtoks{\global\c_math_eqalign_repeat\zerocount}} + +%D For compatibility we have this location stuff. It is kind of messy and uses +%D tabskip magick plus signal 0x08 for an exception. Contrary to normal left +%D aligned formulas we keep the number inline. +% +% \startbuffer +% \startformula +% A = B +% \stopformula +% +% \startplaceformula \startformula +% A = B +% \stopformula \stopplaceformula +% +% \startformula \startalign +% \NC A \EQ B \NR +% \NC A \EQ B \NR +% \stopalign \stopformula +% +% \startplaceformula \startformula \startalign +% \NC A \EQ B \NR[+] +% \NC A \EQ B \NR[+] +% \stopalign \stopformula \stopplaceformula +% \stopbuffer +% +% \startbuffer[all] +% \section[title=middle] \setupmathalignment[location={center,middle}] \getbuffer +% \section[title=left] \setupmathalignment[location={center,left}] \getbuffer +% \section[title=right] \setupmathalignment[location={center,right}] \getbuffer +% \stopbuffer +% +% {\setupformula[location=right] \getbuffer[all] \page} +% {\setupformula[location=left] \getbuffer[all] \page} + \def\math_build_eqalign {\scratchtoks\emptytoks \d_math_eqalign_distance\mathalignmentparameter\c!distance\relax @@ -100,56 +167,95 @@ \fi \scratchcounterone\mathalignmentparameter\c!m \scratchcountertwo\mathalignmentparameter\c!n - \toksapp\scratchtoks\t_math_align_a + \etoksapp\scratchtoks\t_math_align_a \toksapp\scratchtoks{\global\c_math_eqalign_repeat\zerocount}% \scratchcounter\plusone - \dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax} + \localcontrolledrepeat \numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax {\ifnum\scratchcounter=\scratchcountertwo \scratchcounter\plusone % preamble expansion hell ... - \toksapp\scratchtoks {\tabskip\d_math_eqalign_distance}% + \toksapp\scratchtoks {\tabskip\d_math_eqalign_distance\relax}% % so ... \toksapp\scratchtoks {\relax\math_eqalign_distance}% \etoksapp\scratchtoks{\global\advanceby\c_math_eqalign_repeat\the\scratchcountertwo\relax}% \else \advanceby\scratchcounter\plusone \fi - \toksapp\scratchtoks\t_math_align_b}% - \toksapp\scratchtoks\t_math_align_c + \etoksapp\scratchtoks\t_math_align_b}% + \etoksapp\scratchtoks\t_math_align_c \toksapp\scratchtoks{\global\c_math_eqalign_repeat\zerocount}} \def\math_eqalign_set_defaults - {\normalbaselines % hm, spacing ? + {%\normalbaselines % per januari 2024 commented \mathsurround\zeropoint - \tabskip\zeropoint + \mathsurroundskip\zeroskip + \tabskip\zeroskip \everycr\emptytoks} -%installcorenamespace{mathbeginclass} % not needed currently -\installcorenamespace{mathendclass} +% \protected\def\math_math_in_eqalign#1% +% {\mathbeginclass +% \ifcase\c_math_eqalign_column\or +% \mathunsetcode +% \orelse\ifcsname\??mathalignendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname +% \lastnamedcs +% \else +% \mathunsetcode +% \fi +% \startforceddisplaymath +% \usemathstyleparameter\mathalignmentparameter\c!mathstyle +% \tabskip\zeroskip +% \everycr\emptytoks +% #1% +% \stopforceddisplaymath +% \ifnum\lastrightclass<\mathunsetcode +% \global\expandafter\integerdef\csname\??mathalignendclass\the\c_math_eqalign_column\endcsname\lastrightclass +% \fi} +\protected\def\math_math_in_eqalign_start + {\mathbeginclass + \ifconditional\c_math_eqalign_force_text + % really? check mtext + \mathordcode + \orelse\ifcase\c_math_eqalign_column\or + \mathunsetcode + \orelse\ifcsname\??mathalignendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname + \lastnamedcs + \else + \mathunsetcode + \fi + \ifconditional\c_math_eqalign_force_text + \usemathstyleparameter\mathalignmentparameter\c!textstyle + \else + \startforceddisplaymath + \usemathstyleparameter\mathalignmentparameter\c!mathstyle + \fi} -%global\expandafter\integerdef\csname\??mathbeginclass\the\zerocount\endcsname\mathbegincode -\global\expandafter\integerdef\csname\??mathendclass \the\zerocount\endcsname\mathendcode +\protected\def\math_math_in_eqalign_stop + {\ifconditional\c_math_eqalign_force_text + % really? check mtext + \global\expandafter\integerdef\csname\??mathalignendclass\the\c_math_eqalign_column\endcsname\mathordcode + \else + \stopforceddisplaymath + \ifnum\lastrightclass<\mathunsetcode + \global\expandafter\integerdef\csname\??mathalignendclass\the\c_math_eqalign_column\endcsname\lastrightclass + \fi + \fi + \global\setfalse\c_math_eqalign_force_text} -\protected\def\math_math_in_eqalign#1% - {\mathbeginclass\ifcsname\??mathendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname\lastnamedcs\else\mathunsetcode\fi - \startforceddisplaymath - \tabskip\zeropoint +\protected\def\math_math_in_eqalign#1% protected is not obeyed with \span + {% preamble \span ... i really need some extension + \tabskip\zeroskip \everycr\emptytoks + \math_math_in_eqalign_start % protected #1% - \stopforceddisplaymath - \ifnum\lastrightclass<\mathunsetcode - %global\expandafter\integerdef\csname\??mathbeginclass\the\c_math_eqalign_column\endcsname\lastleftclass - \global\expandafter\integerdef\csname\??mathendclass \the\c_math_eqalign_column\endcsname\lastrightclass - \fi - } + \math_math_in_eqalign_stop} % protected \noaligned\protected\def\math_text_in_eqalign#1% {\mathbeginclass\mathordcode \mathendclass \mathordcode \startimath - \tabskip\zeropoint + \tabskip\zeroskip \everycr\emptytoks - #1% + #1% huh, imath? \stopimath} % the preamble is scanned for tabskips so we need the span to prevent an error @@ -186,9 +292,9 @@ % \stopformula % \stopplaceformula -\newconditional\c_math_align_overflow_mode \settrue\c_math_align_overflow_mode -\newconditional\c_math_align_reformat_mode \settrue\c_math_align_reformat_mode -\newconditional\c_strc_formulas_overlay_number \settrue\c_strc_formulas_overlay_number +\newconditional\c_math_align_overflow_mode \c_math_align_overflow_mode\conditionaltrue +\newconditional\c_math_align_reformat_mode \c_math_align_reformat_mode\conditionaltrue +\newconditional\c_strc_formulas_overlay_number \c_strc_formulas_overlay_number\conditionaltrue \protected\def\math_text_in_align {\scratchcounter\numexpr\c_math_eqalign_row+\plusone\relax @@ -200,175 +306,264 @@ \def\math_align_initialize_class_states {} -\def\math_align_reset_class_states +\protected\def\math_align_reset_class_states {\lastleftclass \mathbegincode \lastrightclass\mathendcode} +% the fill skips are somewhat hackery here ... + +% left + +\def\math_prepare_l_eqalign_no_a + {\relax + \strut + \math_text_in_align + \aligncontent % for picking up the number + \ifcase\c_strc_formulas_align_alignment + \ifnum\c_strc_math_ragged_status=\plusthree + \tabskip\zeroskip + \else + \tabskip\centeringskip + \fi + \or + \ifnum\c_strc_math_ragged_status=\plusthree + \tabskip\zeroskip + \else + \tabskip\centeringskip + \fi + \or + \tabskip\stretchingfillskip + \fi + \boundary\c_math_align_l_marker + \math_align_reset_class_states + \aligntab + \math_first_in_eqalign + \hfil + \math_left_of_eqalign + \span + \math_math_in_eqalign{\aligncontent}% + \math_right_of_eqalign + \tabskip\zeroskip} + +\def\math_prepare_l_eqalign_no_b + {\aligntab + \math_next_in_eqalign + \math_left_of_eqalign + \span + \math_math_in_eqalign{\aligncontent}% + \math_right_of_eqalign + \tabskip\zeroskip + } + +\def\math_prepare_l_eqalign_no_c_three + {\hfil + \tabskip\zeroskip + \aligntab + \span + \boundary\c_math_align_r_marker + \math_alignment_rbox{\aligncontent}% + \tabskip\zeroskip} + +\def\math_prepare_l_eqalign_no_c_one + {\hfil + \tabskip\stretchingfillskip + \aligntab + \span + \boundary\c_math_align_r_marker + \math_alignment_rbox{\aligncontent}% + \tabskip\zeroskip} + +\def\math_prepare_l_eqalign_no_c_other + {\hfil + \tabskip\centeringskip + \aligntab + \span + \boundary\c_math_align_r_marker + \math_alignment_rbox{\aligncontent}% + \ifcase\c_strc_formulas_align_alignment + \tabskip\zeroskip + \or + \ifconditional\c_strc_formulas_handle_number + \tabskip\zeroskip +\tabskip\stretchingfillskip + \or + \tabskip\stretchingfillskip + \fi + \or + \tabskip\zeroskip + \fi + } + \def\math_prepare_l_eqalign_no % \checkeddisplaymath {\math_align_initialize_class_states - \t_math_align_a - {\relax - \strut - \math_text_in_align - \aligncontent % for picking up the number - \ifnum\c_strc_math_ragged_status=\plusthree - \tabskip\zeropoint\relax - \else - \tabskip\centeringskip - \fi - \boundary\c_math_align_l_marker - \math_align_reset_class_states - \aligntab - \math_first_in_eqalign - \hfil - \math_left_of_eqalign - \span - \math_math_in_eqalign{\aligncontent}% - \math_right_of_eqalign - \tabskip\zeropoint}% - \t_math_align_b - {\aligntab - \math_next_in_eqalign - \math_left_of_eqalign - \span - \math_math_in_eqalign{\aligncontent}% - \math_right_of_eqalign - \tabskip\zeropoint}% + \t_math_align_a{\math_prepare_l_eqalign_no_a}% + \t_math_align_b{\math_prepare_l_eqalign_no_b}% \ifnum\c_strc_math_ragged_status=\plusthree - \t_math_align_c - {\hfil - \tabskip\zeropoint - \aligntab - \span - \boundary\c_math_align_r_marker - \math_alignment_rbox{\aligncontent}% - \tabskip\zeropoint}% + \t_math_align_c{\math_prepare_l_eqalign_no_c_three}% \orelse\ifnum\c_strc_math_ragged_status=\plusone - \t_math_align_c - {\hfil - \tabskip\stretchingfillskip - \aligntab - \span - \boundary\c_math_align_r_marker - \math_alignment_rbox{\aligncontent}% - \tabskip\zeropoint}% + \t_math_align_c{\math_prepare_l_eqalign_no_c_one}% \else - \t_math_align_c - {\hfil - \tabskip\centeringskip - \aligntab - \span - \boundary\c_math_align_r_marker - \math_alignment_rbox{\aligncontent}% - \tabskip\zeropoint}% + \t_math_align_c{\math_prepare_l_eqalign_no_c_other}% \fi \math_build_eqalign - \the\mathdisplayaligntweaks - \tabskip\zeropoint \ifnum\c_strc_math_ragged_status=\plusthree \tabskip\stretchingfillskip + \else + \tabskip\zeroskip + \fi} + +% right + +\def\math_prepare_r_eqalign_no_a + {\relax + \strut + \math_text_in_align + \tabskip\centeringskip + \aligncontent % for picking up the number + \ifcase\c_strc_formulas_align_alignment + % middle + \boundary\c_math_align_l_marker% This is flush left when number + \tabskip\centeringskip + \or + % left + \tabskip\zeroskip + \or + % right + \tabskip\stretchingfilllskip + \fi + \math_align_reset_class_states + \aligntab + \math_first_in_eqalign + \hfil + \math_left_of_eqalign + \span + \math_math_in_eqalign{\aligncontent}% + \math_right_of_eqalign + \tabskip\zeroskip} + +\def\math_prepare_r_eqalign_no_b + {\aligntab + \math_next_in_eqalign + \math_left_of_eqalign + \span + \math_math_in_eqalign{\aligncontent}% + \math_right_of_eqalign + \tabskip\zeroskip} + +\def\math_prepare_r_eqalign_no_c_three + {\hfil + \aligntab + \hfill % the only one ! + \span + \boundary\c_math_align_r_marker + \math_alignment_lbox{\aligncontent}% + \tabskip\zeroskip} + +\def\math_prepare_r_eqalign_no_c_one_one + {\hfil + \tabskip\stretchingfillskip + \aligntab + \span + \boundary\c_math_align_r_marker + \math_alignment_lbox{\aligncontent}% + \tabskip\zeroskip} + +\def\math_prepare_r_eqalign_no_c_one_other + {\hfil + \tabskip\zeroskip + \aligntab + \span + \boundary\c_math_align_r_marker + \math_alignment_lbox{\aligncontent}% + \tabskip\stretchingfillskip} + +\def\math_prepare_r_eqalign_no_c_other + {\hfil + \ifcase\c_strc_formulas_align_alignment + % middle + \tabskip\centeringskip % fails in some cases + \or + % left + \ifconditional\c_strc_formulas_handle_number + \tabskip\stretchingfillskip + \else + \tabskip\zeroskip + \fi + \or + % right + \ifconditional\c_strc_formulas_handle_number + \tabskip\stretchingfillskip + \else + \tabskip\zeroskip + \fi + \fi + \aligntab + \span + \hss % for MS to test this + \boundary\c_math_align_r_marker + \math_alignment_lbox{\aligncontent}% + \ifcase\c_strc_formulas_align_alignment + % middle + \tabskip\zeroskip + \or + % left + \ifconditional\c_strc_formulas_handle_number + \tabskip\zeroskip + \else + \tabskip\stretchingfillskip + \fi + \or + % right + \ifconditional\c_strc_formulas_handle_number + \tabskip\stretchingfillskip + \else + \tabskip\zeroskip + \fi \fi} \def\math_prepare_r_eqalign_no {\math_align_initialize_class_states - \t_math_align_a - {\relax - \strut - \math_text_in_align - \tabskip\centeringskip - \aligncontent % for picking up the number - \boundary\c_math_align_l_marker - \math_align_reset_class_states - \aligntab - \math_first_in_eqalign - \hfil - \math_left_of_eqalign - \span - \math_math_in_eqalign{\aligncontent}% - \math_right_of_eqalign - \tabskip\zeropoint}% - \t_math_align_b - {\aligntab - \math_next_in_eqalign - \math_left_of_eqalign - \span - \math_math_in_eqalign{\aligncontent}% - \math_right_of_eqalign - \tabskip\zeropoint}% + \t_math_align_a{\math_prepare_r_eqalign_no_a}% + \t_math_align_b{\math_prepare_r_eqalign_no_b}% \ifnum\c_strc_math_ragged_status=\plusthree - \t_math_align_c - {\hfil - \aligntab - \hfill % the only one ! - \span - \boundary\c_math_align_r_marker - \math_alignment_lbox{\aligncontent}% - \tabskip\zeropoint}% + \t_math_align_c{\math_prepare_r_eqalign_no_c_three}% \orelse\ifnum\c_strc_math_ragged_status=\plusone \ifnum\c_strc_math_number_variant=\plusone - \t_math_align_c - {\hfil - \tabskip\stretchingfillskip - \aligntab - \span - \boundary\c_math_align_r_marker - \math_alignment_lbox{\aligncontent}% - \tabskip\zeropoint}% + \t_math_align_c{\math_prepare_r_eqalign_no_c_one_one}% \else - \t_math_align_c - {\hfil - \tabskip\zeropoint - \aligntab - \span - \boundary\c_math_align_r_marker - \math_alignment_lbox{\aligncontent}% - \tabskip\stretchingfillskip}% + \t_math_align_c{\math_prepare_r_eqalign_no_c_one_other}% \fi \else - \t_math_align_c - {\hfil - \tabskip\centeringskip % fails in some cases - \aligntab - \span -\hss % for MS to test this - \boundary\c_math_align_r_marker - \math_alignment_lbox{\aligncontent}% - \tabskip\zeropoint}% + \t_math_align_c{\math_prepare_r_eqalign_no_c_other}% \fi \math_build_eqalign - \the\mathdisplayaligntweaks - \tabskip\zeropoint} - -% \def\math_halign_checked_nop -% {\halign -% \ifconditional\c_math_align_overflow_mode -% callback -% attr -% \mathnumberlocationattribute -% \numexpr\ifconditional\c_math_align_reformat_mode\plusfour\else\plustwo\fi * \plussixteen\relax % just a signal -% \fi} -% -% \def\math_halign_checked_yes -% {\math_halign_checked_nop -% \ifcase\c_strc_formulas_check_width\else -% to \checkeddisplaywidth -% \fi} -% -% \def\math_halign_checked -% {\ifnum\c_strc_formulas_place_number_mode =\plusthree \math_halign_checked_yes \orelse -% \ifnum\c_strc_formulas_number_mode =\plusthree \math_halign_checked_yes \orelse -% \ifnum\c_strc_formulas_sub_number_mode =\plusthree \math_halign_checked_yes \orelse -% \ifnum\c_strc_formulas_nested_number_mode=\plusthree \math_halign_checked_yes \else -% \math_halign_checked_nop \fi} + \tabskip\zeroskip} + +% done \def\math_halign_checked - {\enablematrixalign + {\enablemathalignrelocate \halign \ifconditional\c_math_align_overflow_mode - callback + \s!callback + \align_callback_mathalign \s!attr - \mathnumberlocationattribute - \numexpr\ifconditional\c_math_align_reformat_mode\plusfour\else\plustwo\fi * \plussixteen\relax % just a signal + \mathnumberlocationattribute \numexpr % on whole, different on l/rbox + \unless\ifcase\c_strc_formulas_align_alignment + \plustwo + \orelse\ifconditional\c_math_align_reformat_mode + \plusfour + \orelse\ifnum\c_strc_formulas_align_alignment=\plusone + \ifcstok{\formulaparameter\c!location}\v!left + \pluseight + \else + \plustwo + \fi + \else + \plustwo + \fi + * \plussixteen % just a signal + \relax \fi \ifcase\c_strc_formulas_check_width\else to \checkeddisplaywidth @@ -376,9 +571,38 @@ \installcorenamespace {mathalignlocation} -\defcsname\??mathalignlocation\v!top \endcsname{\tpack } -\defcsname\??mathalignlocation\v!bottom\endcsname{\vpack } -\defcsname\??mathalignlocation\v!center\endcsname{\vcenter} +\setnewconstant\c_strc_formulas_align_alignment\zerocount % 1=left 2=right +\setnewconstant\c_strc_formulas_align_packed \zerocount + +\defcsname\??mathalignlocation\v!top \endcsname{\let\math_alignment_location_box\tpack} +\defcsname\??mathalignlocation\v!bottom\endcsname{\let\math_alignment_location_box\vpack} +\defcsname\??mathalignlocation\v!center\endcsname{\let\math_alignment_location_box\vcenter} + +\defcsname\??mathalignlocation\v!middle\endcsname{\c_strc_formulas_align_alignment\zerocount} +\defcsname\??mathalignlocation\v!left \endcsname{\c_strc_formulas_align_alignment\plusone} +\defcsname\??mathalignlocation\v!right \endcsname{\c_strc_formulas_align_alignment\plustwo} + +\defcsname\??mathalignlocation\v!packed\endcsname + {\c_strc_formulas_align_packed\plusone} + +\defcsname\??mathalignlocation\v!formula\endcsname + {\c_strc_formulas_align_alignment + \ifcstok{\formulaparameter\c!align}\v!flushleft + \plusone + % \orelse\expandafter\ifx\lastnamedcs\v!flushright + \orelse\ifcstok{\lastnamedcs}\v!flushright + \plustwo + \else + \zerocount + \fi} + +\def\math_alignment_location_box_set#1{\begincsname\??mathalignlocation#1\endcsname} + +\def\math_alignment_location_check#1% + {\c_strc_formulas_align_alignment\zerocount + \c_strc_formulas_align_packed\zerocount + \let\math_alignment_location_box\vcenter + \processcommacommand[#1]\math_alignment_location_box_set} %D Here we implement the user interface part. We start with basic math alignments: @@ -398,12 +622,18 @@ {\begingroup \setbox\scratchbox\hbox{\resetformulaparameter\c!location#1}% \ifzeropt\wd\scratchbox\else - %\enablematrixalign \hpack - \s!attr \mathnumberlocationattribute \numexpr\c_strc_math_ragged_status * \plussixteen + \plusone\relax - \s!attr \mathnumberthresholdattribute \numexpr\d_math_eqalign_number_threshold\relax + \s!attr \mathnumberlocationattribute \numexpr + \c_math_alignment_packed_signal + + \c_strc_math_ragged_status * \plussixteen + \plusone + \relax + \s!attr \mathnumberthresholdattribute \numexpr + \d_math_eqalign_number_threshold + \relax {\strc_formulas_add_distance \plustwo\v!left\mathalignmentparameter - \box\scratchbox}% + \box\scratchbox + \hskip\d_math_alignment_packed_margin + }% \fi \global\d_math_eqalign_number_threshold\zeropoint % move to begin of row \endgroup} @@ -412,11 +642,16 @@ {\begingroup \setbox\scratchbox\hbox{\resetformulaparameter\c!location#1}% \ifzeropt\wd\scratchbox\else - %\enablematrixalign \hpack - \s!attr \mathnumberlocationattribute \numexpr\c_strc_math_ragged_status * \plussixteen + \plustwo\relax - \s!attr \mathnumberthresholdattribute \numexpr\d_math_eqalign_number_threshold\relax - {\box\scratchbox + \s!attr \mathnumberlocationattribute \numexpr + \c_math_alignment_packed_signal + + \c_strc_math_ragged_status * \plussixteen + \plustwo + \relax + \s!attr \mathnumberthresholdattribute \numexpr + \d_math_eqalign_number_threshold + \relax + {\hskip\d_math_alignment_packed_margin + \box\scratchbox \strc_formulas_add_distance \plustwo\v!right\mathalignmentparameter}% \fi \global\d_math_eqalign_number_threshold\zeropoint % move to begin of row @@ -431,7 +666,7 @@ \dostoptagged % finish cell \strc_formulas_place_number_nested{#1}{#2}% \math_number_right_of_eqalign - \global\settrue\c_math_eqalign_first + \global\c_math_eqalign_first\conditionaltrue \crcr \noalign{\dostoptagged}} % finish row @@ -441,9 +676,23 @@ \ifx\p_math_alignment_number\v!auto \strc_formulas_place_number_nested{+}{}% \fi - \global\setfalse\c_math_eqalign_first + \global\c_math_eqalign_first\conditionalfalse + \fi + \math_number_left_of_eqalign + \aligntab} + +\newconditional\c_math_eqalign_force_text + +\permanent\protected\def\math_alignment_TC + {\relax + \ifconditional\c_math_eqalign_first + \ifx\p_math_alignment_number\v!auto + \strc_formulas_place_number_nested{+}{}% + \fi + \global\c_math_eqalign_first\conditionalfalse \fi \math_number_left_of_eqalign + \global\settrue\c_math_eqalign_force_text \aligntab} \permanent\protected\def\math_alignment_EQ @@ -453,6 +702,7 @@ {\noalign{\blank[#1]}} \installmacrostack\NC % maybe more to shared table definitions +\installmacrostack\TC % maybe more to shared table definitions \installmacrostack\NN % maybe more to shared table definitions \installmacrostack\EQ % maybe more to shared table definitions \installmacrostack\NR % maybe more to shared table definitions @@ -462,16 +712,18 @@ \appendtoks \push_macro_NC + \push_macro_TC \push_macro_NN \push_macro_EQ \push_macro_NR \push_macro_TB \enforced\let\NC\math_alignment_NC + \enforced\let\TC\math_alignment_TC \enforced\let\NN\math_alignment_NN \enforced\let\EQ\math_alignment_EQ \enforced\let\NR\math_alignment_NR \enforced\let\TB\math_common_TB - \global\settrue\c_math_eqalign_first + \global\c_math_eqalign_first\conditionaltrue \global\s_strc_math_alignment_inbetween\zeroskip \to \everymathalignment @@ -480,34 +732,11 @@ \pop_macro_NR \pop_macro_EQ \pop_macro_NN + \pop_macro_TC \pop_macro_NC \global\s_strc_math_alignment_inbetween\zeroskip \to \everymathalignmentdone -% % experimental: -% -% \def\math_alignment_snap_start -% {\ifgridsnapping -% \edef\p_math_alignment_grid{\mathalignmentparameter\c!grid}% -% \ifx\p_math_alignment_grid\v!no\else -% \snaptogrid[\p_math_alignment_grid]\vbox\bgroup -% \fi -% \fi} -% -% \def\math_alignment_snap_stop -% {\ifgridsnapping -% \ifx\p_math_alignment_grid\v!no\else -% \egroup -% \fi -% \fi} -% -% % doesn't work well, so: - -\let\math_alignment_snap_start\relax -\let\math_alignment_snap_stop \relax - -% end of experimental - \newconditional\c_math_alignment_auto_number % \begingroup not permitted ($$...assignments...\halign... ).. check in luametatex @@ -534,53 +763,139 @@ \fi \endgroup} -\permanent\tolerant\protected\def\math_alignment_start[#1]#*[#2]% +\newinteger \c_math_alignment_packed_signal +\newdimension\d_math_alignment_packed_margin + +\def\math_alignment_packed_start + {%\math_eqalign_set_defaults + \c_strc_formulas_check_width\zerocount + \c_math_alignment_packed_signal"100\relax + \d_math_alignment_packed_margin\rightskip + \mathatom + \s!class \mathwrappedcode + \s!attr \mathnumberlocationattribute \c_math_alignment_packed_signal + \bgroup + % \scratchdimen\mathalignmentparameter\c!leftmargin\relax + % \ifzeropt\scratchdimen\else\kern\scratchdimen\fi + % \mathalignmentparameter\c!left\relax + \math_fenced_start_wrap{\mathalignmentparameter\c!fences}% + \mathatom + \s!class \mathconstructcode + \bgroup} + +\def\math_alignment_packed_stop + {\egroup + \math_fenced_stop_wrap + % \mathalignmentparameter\c!right\relax + % \scratchdimen\mathalignmentparameter\c!rightmargin\relax + % \ifzeropt\scratchdimen\else\kern\scratchdimen\fi + % \setbox\scratchbox\hbox{\mathalignmentparameter\c!text}% + % \ifvoid\scratchbox\else + % \kern\mathalignmentparameter\c!textdistance + % \vcenter{\box\scratchbox}% + % \fi + \egroup + \d_math_alignment_packed_margin\zeropoint + \c_math_alignment_packed_signal\zerocount} + +% \permanent\tolerant\protected\def\math_alignment_start[#1]#*[#S#2]% +% {\begingroup +% \cdef\currentmathalignment{#1}% +% \ifarguments\or\or +% \setupmathalignment[#1][#2]% +% \fi +% \ifcstok{\mathalignmentparameter\c!adaptive}\v!yes +% \c_math_align_reformat_mode\conditionaltrue +% \else +% \c_math_align_reformat_mode\conditionalfalse +% \fi +% \math_alignment_location_check{\mathalignmentparameter\c!location}% vcenter etc +% \ifcase\c_strc_formulas_align_packed\or +% \math_alignment_packed_start +% \fi +% \expand\everymathalignment +% \c_math_eqalign_row \zerocount +% \c_math_eqalign_column\zerocount +% \edef\p_math_alignment_number{\mathalignmentparameter\c!number}% +% \processcommacommand +% [\mathalignmentparameter\c!align]% +% {\advanceby\c_math_eqalign_column\plusone\math_eqalign_set_column}% takes argument +% \global\c_math_eqalign_column\plusone +% \strc_math_setup_spacing_aligned\mathalignmentparameter +% \dostarttagged\t!math\empty +% \dostarttagged\t!mtable\currentmathalignment +% \everycr{\ifcase\c_math_eqalign_row\else\noalign{\penalty\interdisplaylinepenalty}\fi}% +% \math_alignment_location_box +% \bgroup +% \ifcstok{\formulaparameter\c!location}\v!left +% \math_prepare_l_eqalign_no +% \else +% \math_prepare_r_eqalign_no +% \fi +% \math_halign_checked\expandafter\bgroup\the\scratchtoks\crcr} +% +% \def\math_alignment_stop % can be protected +% {\crcr +% \egroup +% \egroup +% \dostoptagged +% \dostoptagged +% \expand\everymathalignmentdone +% \ifcase\c_strc_formulas_align_packed\or +% \math_alignment_packed_stop +% \fi +% \endgroup} + +\permanent\tolerant\protected\def\math_alignment_start[#1]#*[#S#2]% {\begingroup - \edef\currentmathalignment{#1}% + \currentmathblobnesting\minusone + \cdef\currentmathalignment{#1}% \ifarguments\or\or \setupmathalignment[#1][#2]% \fi \ifcstok{\mathalignmentparameter\c!adaptive}\v!yes - \settrue\c_math_align_reformat_mode + \c_math_align_reformat_mode\conditionaltrue \else - \setfalse\c_math_align_reformat_mode + \c_math_align_reformat_mode\conditionalfalse \fi - \math_alignment_snap_start - \the\everymathalignment + \math_alignment_location_check{\mathalignmentparameter\c!location}% vcenter etc + % + \expand\everymathalignment \c_math_eqalign_row \zerocount \c_math_eqalign_column\zerocount - \edef\p_math_alignment_number{\mathalignmentparameter\c!number}% \processcommacommand [\mathalignmentparameter\c!align]% {\advanceby\c_math_eqalign_column\plusone\math_eqalign_set_column}% takes argument \global\c_math_eqalign_column\plusone + % + \edef\p_math_alignment_number{\mathalignmentparameter\c!number}% \strc_math_setup_spacing_aligned\mathalignmentparameter - \dostarttagged\t!math\empty - \dostarttagged\t!mtable\currentmathalignment - % is this check still valid? - \ifmmode - % we're always in mathmode - \the\mathdisplayaligntweaks - \ifcsname\??mathalignlocation\mathalignmentparameter\c!location\endcsname - \lastnamedcs % top|bottom|center as suggested by HM - \else - \vcenter - \fi - \fi - \bgroup + % make preamble \ifcstok{\formulaparameter\c!location}\v!left \math_prepare_l_eqalign_no \else \math_prepare_r_eqalign_no \fi + % + \ifcase\c_strc_formulas_align_packed\or + \math_alignment_packed_start + \fi + % \everycr{\ifcase\c_math_eqalign_row\else\noalign{\penalty\interdisplaylinepenalty}\fi}% + \math_alignment_location_box \bgroup + \dostarttagged\t!math\empty + \dostarttagged\t!mtable\currentmathalignment \math_halign_checked\expandafter\bgroup\the\scratchtoks\crcr} \def\math_alignment_stop % can be protected - {\crcr\egroup\egroup + {\crcr + \egroup \dostoptagged \dostoptagged - \the\everymathalignmentdone - \math_alignment_snap_stop + \egroup + \ifcase\c_strc_formulas_align_packed\or + \math_alignment_packed_stop + \fi + \expand\everymathalignmentdone \endgroup} \installcorenamespace{mathalignment} @@ -603,7 +918,13 @@ \setupmathalignment [\c!n=2, \c!m=1, +\c!leftmargin=\zeropoint, +\c!rightmargin=\zeropoint, +\c!fences=, +\c!left=, +\c!right=, \c!distance=\emwidth, + \c!location=\v!formula, \c!spaceinbetween=\formulaparameter\c!spaceinbetween, \c!numberthreshold=\zeropoint, \c!grid=\v!math] @@ -611,15 +932,6 @@ \definemathalignment[align] % default case (this is what amstex users expect) \definemathalignment[\v!mathalignment] % prefered case (this is cleaner, less clashing) -% this needs some consideration, it might be obsolete now: - -\protected\def\math_display_align_hack - {\everycr{\noalign{\penalty\interdisplaylinepenalty}}} - -\appendtoks - \math_display_align_hack -\to \mathdisplayaligntweaks - % special case.. in case one mistypes .. \ifdefined \startalignment @@ -666,66 +978,68 @@ % -\def\math_first_in_eqalign +\protected\def\math_first_in_eqalign % protection prevents tagging expansion {\global\c_math_eqalign_column\plusone \global\advanceby\c_math_eqalign_row\plusone + \currentmathblobnesting\minusone \dostarttagged\t!mtablerow \empty \dostarttagged\t!mtablecell\empty} -\def\math_next_in_eqalign +\protected\def\math_next_in_eqalign % protection prevents tagging expansion {\global\advanceby\c_math_eqalign_column\plusone \dostoptagged % finish cell + \currentmathblobnesting\minusone \dostarttagged\t!mtablecell\empty} -\def\math_left_of_eqalign - {\ifcsname\??mathalignmentvariant\number\c_math_eqalign_column\endcsname +\protected\def\math_left_of_eqalign + {\ifcsname\??mathalignmentvariant\the\c_math_eqalign_column\endcsname \ifcase\lastnamedcs \or \relax \or \hfill \or \hfill \fi - \orelse\ifcsname\??mathalignmentvariant\number\zerocount\endcsname + \orelse\ifcsname\??mathalignmentvariant\the\zerocount\endcsname \ifcase\lastnamedcs \or \relax \or \hfill \or \hfill \fi - \orelse\ifcsname\??mathalignmentvariant\number\numexpr\c_math_eqalign_column-\c_math_eqalign_repeat\relax\endcsname + \orelse\ifcsname\??mathalignmentvariant\the\numexpr\c_math_eqalign_column-\c_math_eqalign_repeat\relax\endcsname \ifcase\lastnamedcs \or \relax \or \hfill \or \hfill \fi \fi} -\def\math_right_of_eqalign - {\ifcsname\??mathalignmentvariant\number\c_math_eqalign_column\endcsname +\protected\def\math_right_of_eqalign + {\ifcsname\??mathalignmentvariant\the\c_math_eqalign_column\endcsname \ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi - \orelse\ifcsname\??mathalignmentvariant\number\zerocount\endcsname + \orelse\ifcsname\??mathalignmentvariant\the\zerocount\endcsname \ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi - \orelse\ifcsname\??mathalignmentvariant\number\numexpr\c_math_eqalign_column-\c_math_eqalign_repeat\relax\endcsname + \orelse\ifcsname\??mathalignmentvariant\the\numexpr\c_math_eqalign_column-\c_math_eqalign_repeat\relax\endcsname \ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi \fi} \newconditional\c_math_alignment_local_number % not used but when true puts in front (todo) \def\math_number_right_of_eqalign - {\ifcase\wd\b_strc_formulas_number\else + {\ifcase\d_strc_formulas_number\else \ifconditional\c_math_alignment_local_number \ifcase\c_strc_math_number_location\or\or - \box\b_strc_formulas_number + \strc_math_flush_number_box \fi \else - \box\b_strc_formulas_number + \strc_math_flush_number_box \fi \fi} \def\math_number_left_of_eqalign - {\ifcase\wd\b_strc_formulas_number\else + {\ifcase\d_strc_formulas_number\else \ifconditional\c_math_alignment_local_number \ifcase\c_strc_math_number_location\or - \box\b_strc_formulas_number + \strc_math_flush_number_box \fi \fi \fi} \protected\def\math_eqalign_set_column_indeed[#1:#2:#3]% we don't really check for all (so * will do too) ... yet - {\ifcstok{#2}\emptytoks + {\ifempty{#2}% % current counter - \orelse\ifchknum#1\or - \c_math_eqalign_column#1\relax + \orelse\ifchknumber#1\or + \c_math_eqalign_column\lastchknumber \else \c_math_eqalign_column\zerocount \fi - \expandafter\integerdef\csname\??mathalignmentvariant\number\c_math_eqalign_column\endcsname + \expandafter\integerdef\csname\??mathalignmentvariant\the\c_math_eqalign_column\endcsname \ifcsname\??mathalignmentvariant#2\endcsname\lastnamedcs\else\zerocount\fi\relax} \def\math_eqalign_set_column#1% @@ -909,7 +1223,7 @@ \permanent\tolerant\protected\def\math_cases_simple[#1]#*[#2]#:#3% {\begingroup - \edef\currentmathcases{#1}% + \cdef\currentmathcases{#1}% \setupcurrentmathcases[#2]% \math_cases_start[\currentmathcases]% \clf_simplecases{\mathcasesparameter\c!action}{#3}% @@ -931,9 +1245,13 @@ {\ifmmode\else\startimath\fi} \def\math_cases_NC_one - {\ifmmode\stopimath\fi + {\mathcasesparameter\c!lefttext\relax + \ifmmode\stopimath\fi \aligntab - \ifmmode\else\startimath\fi} + \ifmmode\else + \startimath + \fi + \mathcasesparameter\c!righttext\relax} \def\math_cases_NC_two {\ifmmode\stopimath\fi} @@ -979,13 +1297,17 @@ \ifmmode\stopimath\fi \aligntab \global\c_math_cases_nc\zerocount - \strc_formulas_place_number_nested{#1}{#2}\crcr} + \strc_formulas_place_number_nested{#1}{#2}% + \math_number_right_of_eqalign + \box\b_strc_formulas_number + \crcr} \installglobalmacrostack\c_math_cases_nc -\permanent\tolerant\protected\def\math_cases_start[#1]#*[#2]% +\permanent\tolerant\protected\def\math_cases_start[#1]#*[#S#2]% {\begingroup - \edef\currentmathcases{#1}% + \currentmathblobnesting\minusone + \cdef\currentmathcases{#1}% \ifarguments\or\or \setupcurrentmathcases[#2]% \fi @@ -1013,26 +1335,46 @@ \global\c_math_eqalign_row\plusone \global\c_math_cases_nc\zerocount \strc_math_setup_spacing_aligned\mathcasesparameter - \enablematrixalign - \halign callback \s!attr \mathnumberlocationattribute \zerocount \bgroup % use \indexofregister here + \enablemathalignrelocate + \dostarttagged\t!math{cases}% \empty + \dostarttagged\t!mtable\currentmathcases + \halign + \s!callback + \align_callback_mathalign + \s!attr + \mathnumberlocationattribute \zerocount + \bgroup % use \indexofregister here + \dostarttagged\t!mtablerow\empty \ifmmode\else\startimath\fi \mathcasesparameter\c!style + \dostarttagged\t!mtablecell\empty \aligncontent + \dostoptagged % cell \ifmmode\stopimath\fi \hfil \aligntab - \kern\mathcasesparameter\c!distance\relax % hskip + \kern\mathcasesparameter\c!distance\relax \math_cases_strut % looks better + \dostarttagged\t!mtablecell\empty \aligncontent + \dostoptagged % cell \hfil \aligntab - \kern\mathcasesparameter\c!numberdistance\relax % hskip - \span\math_text_in_eqalign{\aligncontent}% + \kern\mathcasesparameter\c!numberdistance\relax + \span + \math_text_in_eqalign{% + \dostarttagged\t!mtablecell\empty + \aligncontent + \dostoptagged % cell + \dostoptagged % row + }% \crcr} % todo: number \noaligned\permanent\protected\def\math_cases_stop {\crcr \egroup + \dostoptagged % table + \dostoptagged % math \egroup \egroup \math_fenced_stop_wrap @@ -1110,8 +1452,8 @@ %D different which is a side effect of getting the tagging right. In %D retrospect the main alignment could be done this way but \unknown -%D In the end is is way easier to not use alignments and just paste boxes together -%D but let's be a bit texie. +%D In the end is is way easier to not use alignments and just paste boxes +%D together but let's be a bit texie. \installcorenamespace{mathmatrix} @@ -1161,7 +1503,8 @@ \endlocalcontrol} \protected\def\math_matrix_start_cell - {\dostarttagged\t!mtablecell\empty + {\currentmathblobnesting\minusone + \dostarttagged\t!mtablecell\empty \hss \math_left_of_eqalign \startimath @@ -1226,7 +1569,7 @@ \tolerant\permanent\def\math_matrix_HF[#1]#*[#2]% [n] [name] | [name] | [n] {\expandedloop \plusone - \numexpr\ifchknum#1\or#1\else(\c_math_matrix_columns+\minusone)\fi*\plustwo\relax + \numexpr\ifchknumber#1\or\lastchknumber\else(\c_math_matrix_columns+\minusone)\fi*\plustwo\relax \plusone {\omit\span}% \normalexpanded{\filler[% @@ -1323,7 +1666,7 @@ \aligntab \aligntab \math_matrix_anchor - \kern.5\d_math_eqalign_distance % hskip + \kern.5\d_math_eqalign_distance \aligncontent \aligntab \global\advanceby\c_math_eqalign_column\plusone @@ -1345,8 +1688,8 @@ \expandafter\math_matrix_NC_nop \fi} -\permanent\protected\def\math_matrix_pickup{\global\settrue \c_math_matrix_first} -\permanent\protected\def\math_matrix_NC_yes{\global\setfalse\c_math_matrix_first} +\permanent\protected\def\math_matrix_pickup{\global\c_math_matrix_first\conditionaltrue} +\permanent\protected\def\math_matrix_NC_yes{\global\c_math_matrix_first\conditionalfalse} \permanent\protected\def\math_matrix_NC_nop{\aligntab\aligntab} % avoids lookahead \def\math_matrix_check_rule_step#1% @@ -1362,7 +1705,7 @@ {\d_math_eqalign_rulethickness\mathmatrixparameter\c!rulethickness\relax \scratchdimen\d_math_eqalign_rulethickness \edef\p_rulecolor{\mathmatrixparameter\c!rulecolor}% - \iftok{#1}\emptytoks\else + \ifempty{#1}\else \rawprocesscommalist[#1]\math_matrix_check_rule_step \fi \ifempty\p_rulecolor\else @@ -1403,81 +1746,83 @@ \definesystemattribute[mathalignmentvrule][public] \definesystemattribute[mathalignmenthrule][public] +\definesystemattribute[mathalignmenttop] [public] +\definesystemattribute[mathalignmentmid] [public] +\definesystemattribute[mathalignmentbot] [public] \setupmathmatrix - [%c!toffset=\zeropoint, - \c!toffset=.25\exheight, + [\c!moffset=.25\exheight, + \c!toffset=\mathmatrixparameter\c!moffset, \c!boffset=\mathmatrixparameter\c!toffset] -% \noaligned\permanent\tolerant\protected\def\math_matrix_HL[#1]#*% -% {\noalign\bgroup -% \math_matrix_check_rule[#1]% -% \divideby\scratchdimen\plustwo -% \ifdim\scratchdimen>\zeropoint -% % \autorule\s!height\scratchdimen\s!depth\scratchdimen\relax -% \scratchdistance\mathmatrixparameter\c!toffset\relax -% \ifdim\scratchdistance>\zeropoint -% \nohrule -% \s!attr \mathalignmentvruleattribute\plustwo -% \s!height\scratchdistance -% \s!depth \zeropoint -% \relax -% \fi -% \hrule -% \s!attr \mathalignmentvruleattribute\plusthree -% \s!height\scratchdimen -% \s!depth \scratchdimen -% \relax -% \scratchdistance\mathmatrixparameter\c!boffset\relax -% \ifdim\scratchdistance>\zeropoint -% \nohrule -% \s!attr \mathalignmentvruleattribute\plusfour -% \s!height\zeropoint -% \s!depth \scratchdistance -% \relax -% \fi -% \else -% % zero dimensions disable the rule -% \fi -% \egroup} +\newconditional\c_math_matrix_trace_hl + +\installtextracker + {math.matrices.hl} + {\settrue\c_math_matrix_trace_hl} + {\setfalse\c_math_matrix_trace_hl} \def\math_matrix_HL_indeed#1#2% {\noalign\bgroup \math_matrix_check_rule[#2]% \divideby\scratchdimen\plustwo \ifdim\scratchdimen>\zeropoint - % \autorule\s!height\scratchdimen\s!depth\scratchdimen\relax - \scratchdistance\mathmatrixparameter\c!toffset\relax +\attribute\mathalignmenttopattribute\dimexpr\mathmatrixparameter\c!toffset\relax +\attribute\mathalignmentbotattribute\dimexpr\mathmatrixparameter\c!boffset\relax + \scratchdistance\mathmatrixparameter\c!moffset\relax \ifdim\scratchdistance>\zeropoint +\begingroup +\ifconditional\c_math_matrix_trace_hl + \darkred + \hrule + \s!width \onepoint +\else \nohrule - \s!attr \mathalignmentvruleattribute\plustwo - \s!height\scratchdistance - \s!depth \zeropoint +\fi + \s!attr \mathalignmentvruleattribute\plustwo + \s!height\scratchdistance + \s!depth \zeropoint \relax +\endgroup \fi \hrule - \s!attr \mathalignmentvruleattribute\plusthree - \s!height\scratchdimen - \s!depth \scratchdimen + \s!attr \mathalignmentvruleattribute\plusthree + \s!height\scratchdimen + \s!depth \scratchdimen \relax + \scratchdimentwo\zeropoint \ifnum#1>\plusone + \scratchdimenone.125\d_math_eqalign_distance \localcontrolledloop\plustwo#1\plusone - {\kern.125\d_math_eqalign_distance % hskip + {\kern\scratchdimenone + \advanceby\scratchdimentwo\scratchdimenone \hrule - \s!attr \mathalignmentvruleattribute\plusthree - \s!height\scratchdimen - \s!depth \scratchdimen - \relax}% - \kern-2\scratchdimen - \kern-.125\d_math_eqalign_distance % hskip + \s!attr \mathalignmentvruleattribute\plusthree + \s!height\scratchdimen + \s!depth \scratchdimen + \relax + \advanceby\scratchdimentwo\scratchdimen + \advanceby\scratchdimentwo\scratchdimen + }% +% \kern-2\scratchdimen +% \kern-.125\d_math_eqalign_distance \fi - \scratchdistance\mathmatrixparameter\c!boffset\relax +% \scratchdistance\mathmatrixparameter\c!moffset\relax \ifdim\scratchdistance>\zeropoint +\begingroup +\ifconditional\c_math_matrix_trace_hl + \darkgreen + \hrule + \s!width \onepoint +\else \nohrule - \s!attr \mathalignmentvruleattribute\plusfour - \s!height\zeropoint - \s!depth \scratchdistance +\fi + \s!attr \mathalignmentvruleattribute\plusfour + \s!attr \mathalignmentmidattribute\scratchdimentwo + \s!height\zeropoint + \s!depth \scratchdistance \relax +\endgroup \fi \else % zero dimensions disable the rule @@ -1507,9 +1852,11 @@ \protected\def\math_matrix_horizontal_rule_indeed#1#2% {\math_matrix_check_rule[#2]% - \global\setfalse\c_math_matrix_first - \global\settrue \c_math_matrix_sl_seen + \global\c_math_matrix_first\conditionalfalse + \global\c_math_matrix_sl_seen\conditionaltrue \enablematrixrules + % \begingroup + % \attribute\mathalignmenthruleattribute\plusone % we check the glue \leaders#1% \s!attr \mathalignmenthruleattribute\plusone \s!height .5\scratchdimen @@ -1517,6 +1864,7 @@ % \s!top -\dimexpr\mathmatrixparameter\c!toffset\relax % \s!bottom-\dimexpr\mathmatrixparameter\c!boffset\relax \hfilll + % \endgroup \kern\dimexpr.5\d_math_eqalign_distance\relax \aligntab} @@ -1526,14 +1874,14 @@ \def\math_matrix_hrule_progress_rest#1% {\expandedloop \plusone - \numexpr(\ifchknum#1\or#1\else\c_math_matrix_columns\fi)*\plustwo+\minusone\relax + \numexpr(\ifchknumber#1\or\lastchknumber\else\c_math_matrix_columns\fi)*\plustwo+\minusone\relax \plusone {\span\omit}}% \def\math_matrix_hrule_progress_first#1% {\expandedloop \plusone - \numexpr(\ifchknum#1\or#1\else\c_math_matrix_columns\fi+\minusone)*\plustwo+\plusone\relax + \numexpr(\ifchknumber#1\or\lastchknumber\else\c_math_matrix_columns\fi+\minusone)*\plustwo+\plusone\relax \plusone {\span\omit}}% @@ -1569,11 +1917,11 @@ % \permanent\tolerant\protected\def\math_matrix_VL[#1]#*% % {\span\omit % \ifconditional\c_math_matrix_first\else -% \kern.5\d_math_eqalign_distance % hskip +% \kern.5\d_math_eqalign_distance % \fi % \math_matrix_vertical_rule_yes{#1}% -% \kern.5\d_math_eqalign_distance % hskip -% \global\setfalse\c_math_matrix_first +% \kern.5\d_math_eqalign_distance +% \global\c_math_matrix_first\conditionalfalse % \aligntab % \boundary\c_math_matrix_vl_boundary % \enforced\let\NR\math_matrix_NL_NR @@ -1582,14 +1930,14 @@ \def\math_matrix_VL_indeed#1#2%% {\span\omit \ifconditional\c_math_matrix_first\else - \kern.5\d_math_eqalign_distance % hskip + \kern.5\d_math_eqalign_distance \fi \math_matrix_vertical_rule_yes{#2}% \localcontrolledloop\plustwo#1\plusone - {\kern.125\d_math_eqalign_distance % hskip + {\kern.125\d_math_eqalign_distance \math_matrix_vertical_rule_yes{#2}}% \kern.5\d_math_eqalign_distance - \global\setfalse\c_math_matrix_first + \global\c_math_matrix_first\conditionalfalse \aligntab \boundary\c_math_matrix_vl_boundary \enforced\let\NR\math_matrix_NL_NR @@ -1601,11 +1949,11 @@ \permanent\tolerant\protected\def\math_matrix_NL[#1]#*% {\span\omit \ifconditional\c_math_matrix_first\else - \kern.5\d_math_eqalign_distance % hskip + \kern.5\d_math_eqalign_distance \fi \math_matrix_vertical_rule_nop{#1}% - \kern.5\d_math_eqalign_distance % hskip - \global\setfalse\c_math_matrix_first + \kern.5\d_math_eqalign_distance + \global\c_math_matrix_first\conditionalfalse \aligntab \boundary\c_math_matrix_vl_boundary \enforced\let\NR\math_matrix_NL_NR} @@ -1613,9 +1961,9 @@ \permanent\protected\def\math_matrix_NL_NR {\ifnum\lastboundary=\c_math_matrix_vl_boundary \ifconditional \c_math_matrix_sl_seen - \kern-1.5\d_math_eqalign_distance % hskip + \kern-1.5\d_math_eqalign_distance \else - \kern-.5\d_math_eqalign_distance % hskip + \kern-.5\d_math_eqalign_distance \fi \fi \math_matrix_anchor_last @@ -1626,7 +1974,7 @@ \appendtoks \enforced\let\NL\math_matrix_NL - \global\setfalse\c_math_matrix_sl_seen + \global\c_math_matrix_sl_seen\conditionalfalse \to \everymathmatrix \permanent\tolerant\protected\def\math_matrix_VC[#1]#*% @@ -1661,7 +2009,7 @@ \enforced\let\HLHL\math_matrix_HLHL \to \everymathmatrix -\definesystemattribute[mathmatrixornament][public] +% \definesystemattribute[mathmatrixornament][public] \newdimension\d_math_matrix_margin_l \newdimension\d_math_matrix_margin_r @@ -1687,7 +2035,7 @@ \def\math_matrix_ornaments#1#2% {\NC \enablematrixornaments - \global\settrue\c_math_matrix_text + \global\c_math_matrix_text\conditionaltrue \global\settrue#1% \boundary#2% \ignorespaces} @@ -1698,22 +2046,33 @@ \permanent\protected\def\math_matrix_BT{\math_matrix_ornaments\c_math_matrix_text_b\c_math_matrix_ornament_b} \appendtoks - \global\setfalse\c_math_matrix_text - \global\setfalse\c_math_matrix_text_l - \global\setfalse\c_math_matrix_text_r - \global\setfalse\c_math_matrix_text_t - \global\setfalse\c_math_matrix_text_b + \global\c_math_matrix_text\conditionalfalse + \global\c_math_matrix_text_l\conditionalfalse + \global\c_math_matrix_text_r\conditionalfalse + \global\c_math_matrix_text_t\conditionalfalse + \global\c_math_matrix_text_b\conditionalfalse \enforced\let\LT\math_matrix_LT \enforced\let\RT\math_matrix_RT \enforced\let\TT\math_matrix_TT \enforced\let\BT\math_matrix_BT \to \everymathmatrix +\newconditional\c_math_matrix_text_mode + \def\math_matrix_start_processing - {\ifmmode - \mathatom \s!class \mathwrappedcode + {% + \ifmmode + \setfalse\c_math_matrix_text_mode \else + \settrue\c_math_matrix_text_mode + \fi + \ifconditional\c_math_matrix_text_mode \dontleavehmode + \else + \mathmatrixparameter\c!left\relax + \math_fenced_start_wrap{\mathmatrixparameter\c!fences}% +% \mathatom \s!class \mathwrappedcode + \mathatom \s!class \mathconstructcode \fi \bgroup \d_math_matrix_margin_l\mathmatrixparameter\c!leftmargin \relax @@ -1723,17 +2082,15 @@ \global\d_math_matrix_max_left \zeropoint \global\d_math_matrix_max_right\zeropoint %\tabskip.5\d_math_eqalign_distance - \tabskip\zeropoint + \tabskip\zeroskip \math_matrix_pickup - \the\everymathmatrix + \expand\everymathmatrix % \setbox\nextbox\vbox\bgroup \math_matrix_start_table \halign - callback - \s!attr \mathmatrixornamentattribute "10 - \s!attr \mathalignmentvruleattribute \plusone - \s!attr \mathalignmenthruleattribute \plusone + \s!callback + \align_callback_mathmatrix \bgroup % preamble \span\math_matrix_preamble @@ -1750,7 +2107,11 @@ \mathmatrixleft % experimental hook \math_matrix_finish_nextbox \mathmatrixright % experimental hook - \egroup} + \egroup + \ifconditional\c_math_matrix_text_mode\else + \math_fenced_stop_wrap + \mathmatrixparameter\c!right\relax + \fi} \permanent\protected\def\mathmatrixmaxleftwidth {\d_math_matrix_max_left } \permanent\protected\def\mathmatrixmaxrightwidth{\d_math_matrix_max_right} @@ -1778,13 +2139,14 @@ % \installglobalmacrostack\c_math_matrix_first -\tolerant\protected\def\math_matrix_start[#1]#*[#2]% +\tolerant\protected\def\math_matrix_start[#1]#*[#S#2]% {\begingroup + \currentmathblobnesting\minusone \globalpushmacro\c_math_matrix_first % hm, does that work? \c_math_eqalign_column_saved\c_math_eqalign_column \c_math_eqalign_row_saved\c_math_eqalign_row \globalpushmacro\c_math_eqalign_first - \edef\currentmathmatrix{#1}% + \cdef\currentmathmatrix{#1}% \setupcurrentmathmatrix[#2]% \math_matrix_check_settings \math_eqalign_set_defaults @@ -1811,6 +2173,8 @@ \mutable\lettonothing\mathmatrixleft % experimental hook \mutable\lettonothing\mathmatrixright % experimental hook +% This alignment option will either go away or become a atom property (key). + \defcsname\??mathmatrixalignlocation\v!top \endcsname{\raise\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\mathstyle\relax} \defcsname\??mathmatrixalignlocation\v!high \endcsname{\raise\dimexpr(\nextboxdp-\nextboxht)/2\relax} \defcsname\??mathmatrixalignlocation\v!center\endcsname{\relax} @@ -1822,20 +2186,26 @@ \def\math_matrix_finish_nextbox {\scratchcounter\mathstyle\relax \scratchwidth\wd\nextbox - \setbox\scratchbox\begincsname\??mathmatrixalignlocation\mathmatrixparameter\c!location\endcsname\hbox\bgroup +\setbox\scratchbox\hbox\bgroup + \begincsname\??mathmatrixalignlocation\mathmatrixparameter\c!location\endcsname\hbox\bgroup \normalstartimath - \Ustyle\scratchcounter + \givenmathstyle\scratchcounter \ifzeropt\d_math_matrix_margin_l\else\kern\d_math_matrix_margin_l\fi - \mathmatrixparameter\c!left\relax - \math_fenced_start_wrap{\mathmatrixparameter\c!fences}% - \mathatom \s!class \mathconstructcode {\vcenter{\box\nextbox}}% \was \vcenter - \math_fenced_stop_wrap - \mathmatrixparameter\c!right\relax + \ifconditional\c_math_matrix_text_mode + \mathmatrixparameter\c!left\relax + \math_fenced_start_wrap{\mathmatrixparameter\c!fences}% + \mathatom \s!class \mathconstructcode {\vcenter{\box\nextbox}}% \was \vcenter + \math_fenced_stop_wrap + \mathmatrixparameter\c!right\relax + \else + \vcenter{\box\nextbox}% \was \vcenter + \fi \ifzeropt\d_math_matrix_margin_r\else\kern\d_math_matrix_margin_r\fi \normalstopimath \egroup +\egroup \ifconditional\c_math_matrix_text - \ifcstok{\mathmatrixparameter\c!left\mathmatrixparameter\c!right\mathmatrixparameter\c!fences}\emptytoks\else + \ifempty{\mathmatrixparameter\c!left\mathmatrixparameter\c!right\mathmatrixparameter\c!fences}\else \scratchdistance\dimexpr(\wd\scratchbox-\scratchwidth)/\plustwo\relax \advanceby\d_math_matrix_margin_l\scratchdistance \advanceby\d_math_matrix_margin_r\scratchdistance @@ -1853,10 +2223,15 @@ \ifempty\p_leftedge\else \hskip\dimexpr\d_math_matrix_max_left+\p_leftedge\relax \fi - \box\scratchbox +% \ifconditional\c_math_matrix_text_mode + \box\scratchbox +% \else +% \mathatom \s!class \mathconstructcode {\box\scratchbox}% +% \fi \ifempty\p_rightedge\else \hskip\dimexpr\d_math_matrix_max_right+\p_rightedge\relax - \fi} + \fi + } \definemathmatrix[matrix] \definemathmatrix[\v!mathmatrix] @@ -1988,9 +2363,9 @@ %D Handy for the \type {m-matrix} module: -\permanent\tolerant\protected\def\startnamedmatrix[#1]#*[#2]% +\permanent\tolerant\protected\def\startnamedmatrix[#1]#*[#S#2]% {\begingroup - \edef\currentmathmatrix{#1}% + \cdef\currentmathmatrix{#1}% \setupcurrentmathmatrix[#2]% \math_matrix_start[\currentmathmatrix]} @@ -2023,9 +2398,9 @@ %D %D \typebuffer \getbuffer -\permanent\tolerant\protected\def\math_matrix_simple[#1]#*[#2]#:#3% +\permanent\tolerant\protected\def\math_matrix_simple[#1]#*[#S#2]#:#3% {\begingroup - \edef\currentmathmatrix{#1}% + \cdef\currentmathmatrix{#1}% \setupcurrentmathmatrix[#2]% \math_matrix_start[\currentmathmatrix]% \clf_simplematrix{\mathmatrixparameter\c!action}{#3}% @@ -2207,10 +2582,12 @@ \permanent\protected\def\startsubstack {\begingroup \vcenter\bgroup + \currentmathblobnesting\minusone \baselineskip\mathstacktotal \lineskip\mathstackvgap \lineskiplimit\lineskip \mathsurround\zeropoint + \mathsurroundskip\zeroskip \everycr\emptytoks \enforced\let\NC\relax \enforced\let\MC\relax @@ -2255,7 +2632,10 @@ {\defcsname\??mathinnerstart#1\endcsname{#2}% \defcsname\??mathinnerstop #1\endcsname{#3}} -\def\strc_math_flush_number_box{\box\b_strc_formulas_number} +\def\strc_math_flush_number_box_normal{\box\b_strc_formulas_number} +\def\strc_math_flush_number_box_visual{\ruledhbox{\box\b_strc_formulas_number}} + +\let\strc_math_flush_number_box\strc_math_flush_number_box_normal % \newdimension \d_strc_math_display_width % \newdimension \d_strc_math_indent @@ -2283,7 +2663,7 @@ \def\strc_math_flush_aligned_boxed_direct_yes {\dontleavehmode \box\b_strc_math_display - \llap{\box\b_strc_formulas_number}} + \llap{\strc_math_flush_number_box}} \def\strc_math_flush_aligned_boxed_direct_nop {\dontleavehmode @@ -2291,119 +2671,220 @@ \def\strc_math_flush_aligned_left_number_indeed {\ifvoid\b_strc_formulas_number\else - \scratchwidth\wd\b_strc_formulas_number - \setbox\b_strc_formulas_number\hbox to \displaywidth{\hss\hbox{\box\b_strc_formulas_number}}% + \setbox\b_strc_formulas_number\hbox to \displaywidth\bgroup + \hss + \hbox{\strc_math_flush_number_box}% + \egroup \ifcase\c_strc_math_number_location\or - \boxxoffset\b_strc_formulas_number\dimexpr-\displaywidth+\scratchwidth\relax + \boxxoffset\b_strc_formulas_number\dimexpr-\displaywidth+\d_strc_formulas_number+\s_strc_formulas_margin_left\relax % brrrrr \boxyoffset\b_strc_formulas_number-\d_strc_math_first_height \htdp\b_strc_formulas_number\zeropoint - \box\b_strc_formulas_number % left + \strc_math_flush_number_box % left \fi \fi} \def\strc_math_flush_aligned_right_number_indeed {\ifvoid\b_strc_formulas_number\else - \scratchwidth\wd\b_strc_formulas_number - \setbox\b_strc_formulas_number\hbox to \displaywidth{\hss\hbox{\box\b_strc_formulas_number}}% + \setbox\b_strc_formulas_number\hbox to \displaywidth\bgroup + \hss + \hbox{\strc_math_flush_number_box}% + \egroup \ifcase\c_strc_math_number_location\or\else + \boxxoffset\b_strc_formulas_number\dimexpr-\s_strc_formulas_margin_right\relax % brrrrr \boxyoffset\b_strc_formulas_number\d_strc_math_last_depth \htdp\b_strc_formulas_number\zeropoint - \box\b_strc_formulas_number % right + \strc_math_flush_number_box % right \fi \fi} -\protected\def\strc_math_flush_aligned_indeed - {\ifcase\c_strc_math_ragged_status - % align: error - \strc_math_flush_aligned_boxed_direct_yes - \or - % align: flushleft, number right - \strc_math_flush_aligned_boxed_direct_yes - \or - % align: middle - \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode - \leftskip \zeropoint - \rightskip\zeropoint - \strc_math_flush_aligned_boxed_direct_yes - \orelse\ifnum\c_strc_math_split_mode=\c_strc_math_wrap_mode - \dontleavehmode - \vbox\bgroup - \strc_math_flush_aligned_left_number_indeed - \unvbox\b_strc_math_display - \strc_math_flush_aligned_right_number_indeed - \egroup - \orelse\ifhmode - % untested - \dontleavehmode - \strc_math_flush_aligned_left_number_indeed - \box\b_strc_math_display - \strc_math_flush_aligned_right_number_indeed - \orelse\ifvbox\b_strc_math_display +% \c_strc_math_ignore_number\conditionaltrue + +% cleanup timestamp: tales of time, joe bonamassa (live blu-ray in loop mode, 2023) + +\dimensiondef\d_strc_math_number_eps 5\scaledpoint + +% line mode + +\def\strc_math_flush_line_mode + {\ifcase\c_strc_math_ragged_status\or\or\hfill\or\hfill\fi + \box\b_strc_math_display + \ifcase\c_strc_math_ragged_status\or\hfill\or\hfill\or\fi} + +% wrap mode + +\def\strc_math_flush_wrap_mode + {\strc_math_setup_align_auto + \bgroup + \leftskip \zeroskip + \rightskip\zeroskip + \global\c_strc_math_positioning\plustwo + \dontleavehmode + \vbox\bgroup \strc_math_flush_aligned_left_number_indeed \unvbox\b_strc_math_display \strc_math_flush_aligned_right_number_indeed - \else - % untested - \dontleavehmode - \strc_math_flush_aligned_left_number_indeed - \box\b_strc_math_display - \strc_math_flush_aligned_right_number_indeed + \egroup + \egroup + \ifvmode + \nointerlineskip + \fi} + +% flow mode + +\def\strc_math_flush_v_box_bottom + {\ifdone + \global\c_strc_math_positioning42\relax + \unvbox\b_strc_math_display + \strc_math_flush_number_box + \else + \global\c_strc_math_positioning43\relax + \unvbox\b_strc_math_display + \nointerlineskip + \ht\b_strc_formulas_number\zeropoint + \dp\b_strc_formulas_number\zeropoint + \boxyoffset\b_strc_formulas_number\d_strc_math_last_depth + \strc_math_flush_number_box % right + \prevdepth\d_strc_math_last_depth + \fi} + +\def\strc_math_flush_v_box_top + {\ifdone + \global\c_strc_math_positioning45\relax + \dontleavehmode + \strc_math_flush_number_box + \unvbox\b_strc_math_display + \else + \scratchdepth\dp\b_strc_formulas_number + \global\c_strc_math_positioning46\relax + \ht\b_strc_formulas_number\strutht + \dp\b_strc_formulas_number\strutdp + \dontleavehmode + \vkern\dimexpr\d_strc_math_first_height+\scratchdepth-\lineheight\relax +% or \ht\b_strc_formulas_number\dimexpr\d_strc_math_first_height+\scratchdepth-\strutdp\relax + \nointerlineskip + \strc_math_flush_number_box % left + \vkern-\dimexpr\d_strc_math_first_height+\scratchdepth\relax + \unvbox\b_strc_math_display + \fi} + +\def\strc_math_flush_v_box_right + {\ifconditional\c_strc_math_ignore_number + \d_strc_formulas_number\zeropoint + \fi + \strc_formulas_start_side_box + \ifzeropt\d_strc_formulas_number + \global\c_strc_math_positioning41\relax + \unvbox\b_strc_math_display + \else + % better verbose than compact so some overlap in code here + \ifcase\c_strc_math_number_variant\or + \s_strc_formulas_margin_right\zeroskip \fi - \or - % align: flushright - % packaged, number (kind of ugly as we now stick in the margin) - \ifcase\c_strc_math_n_of_lines\or - \dontleavehmode - \kern-\wd\b_strc_formulas_number - \box\b_strc_math_display - \ifcase\c_strc_math_n_of_lines\or - \box\b_strc_formulas_number + \setbox\b_strc_formulas_number\hbox to \displaywidth\bgroup + \hss + \strc_math_flush_number_box + \kern\s_strc_formulas_margin_right + \egroup + \ifcstok{\formulaparameter\c!order}\v!reverse + \ifdim\dimexpr\d_strc_math_first_right-\s_strc_formulas_margin_right\relax<\dimexpr\d_strc_formulas_number-\d_strc_math_number_eps\relax + \donetrue \else - \llap{\box\b_strc_formulas_number}% + \donefalse \fi - \orelse\iftrue % can become option - \ifdim\d_strc_math_last_width>\wd\b_strc_formulas_number - \ifdim\d_strc_math_max_width<\d_strc_math_last_width - \strc_math_flush_aligned_boxed_direct_yes - \else - \dontleavehmode - \kern-\wd\b_strc_formulas_number - \box\b_strc_math_display - \box\b_strc_formulas_number - \fi + \strc_math_flush_v_box_top + \else + \ifdim\dimexpr\d_strc_math_last_right-\s_strc_formulas_margin_right\relax<\dimexpr\d_strc_formulas_number-\d_strc_math_number_eps\relax + \donetrue + \else + \donefalse + \fi + \strc_math_flush_v_box_bottom + \fi + \fi + \strc_formulas_stop_side_box} + +\def\strc_math_flush_v_box_left + {\ifconditional\c_strc_math_ignore_number + \d_strc_formulas_number\zeropoint + \fi + \strc_formulas_start_side_box + \ifzeropt\d_strc_formulas_number + \global\c_strc_math_positioning44\relax + \unvbox\b_strc_math_display + \else + % better verbose than compact so some overlap in code here + \ifcase\c_strc_math_number_variant\or + \s_strc_formulas_margin_left\zeroskip + \fi + \setbox\b_strc_formulas_number\hbox to \displaywidth\bgroup + \kern\s_strc_formulas_margin_left + \strc_math_flush_number_box + \hss + \egroup + \ifcstok{\formulaparameter\c!order}\v!reverse + \ifdim\dimexpr\d_strc_math_last_left-\s_strc_formulas_margin_left\relax<\dimexpr\d_strc_formulas_number-\d_strc_math_number_eps\relax + \donetrue \else - % delay number till later - \strc_math_flush_aligned_boxed_direct_nop + \donefalse \fi + \strc_math_flush_v_box_bottom \else - % delay number till later - \strc_math_flush_aligned_boxed_direct_nop + \ifdim\dimexpr\d_strc_math_first_left-\s_strc_formulas_margin_left\relax<\dimexpr\d_strc_formulas_number-\d_strc_math_number_eps\relax + \donetrue + \else + \donefalse + \fi + \strc_math_flush_v_box_top \fi \fi + \strc_formulas_stop_side_box} + +\def\strc_math_flush_h_mode + {\global\c_strc_math_positioning\plusthree + \dontleavehmode + \strc_math_flush_aligned_left_number_indeed + \box\b_strc_math_display + \strc_math_flush_aligned_right_number_indeed} + +\def\strc_math_flush_h_box + {\global\c_strc_math_positioning\plusfive + \dontleavehmode + \strc_math_flush_aligned_left_number_indeed + \box\b_strc_math_display + \strc_math_flush_aligned_right_number_indeed} + +\def\strc_math_flush_text_mode + {\strc_math_setup_align_auto + \bgroup + \leftskip \zeroskip + \rightskip\zeroskip + \ifhmode + % nil the tracing + \strc_math_flush_h_mode + \orelse\ifvbox\b_strc_math_display + \ifnum\c_strc_math_number_location=\plusone + \strc_math_flush_v_box_left + \else + \strc_math_flush_v_box_right + \fi + \else + % nil the tracing, might never happen + \strc_math_flush_h_box + \fi + \egroup \ifvmode - \nointerlineskip + \nointerlineskip \fi} -\protected\def\strc_math_flush_aligned_simple - {\ifcase\c_strc_math_ragged_status\or\or\hfill\or\hfill\fi - \box\b_strc_math_display - \ifcase\c_strc_math_ragged_status\or\hfill\or\hfill\or\fi} +% all modes: \protected\def\strc_math_flush_aligned {\ifnum\c_strc_math_split_mode=\c_strc_math_line_mode - \strc_math_flush_aligned_simple - \orelse\ifconditional\c_strc_math_indent - % in this case the already set text align is overloaded - \strc_math_setup_align_auto - \strc_math_flush_aligned_indeed + \strc_math_flush_line_mode + \orelse\ifnum\c_strc_math_split_mode=\c_strc_math_wrap_mode + \strc_math_flush_wrap_mode \else - % normally we don't end up here - \strc_math_setup_spacing_aligned\mathalignmentparameter - \begingroup - \forgetall - \unhbox\b_strc_math_display - \par - \endgroup + \strc_math_flush_text_mode \fi} \def\strc_math_flush_box_normal @@ -2520,7 +3001,7 @@ \def\strc_math_number_right_overflow_outside {\vpack\bgroup \strc_math_flush_box_framed_fit_inline - %\hskip\zeropoint % nicely breaks the line without introducing funny vertical spacing ... why o why + %\hskip\zeroskip % nicely breaks the line without introducing funny vertical spacing ... why o why \hpack to \displaywidth\bgroup \hss \strc_math_flush_number_box @@ -2533,7 +3014,7 @@ \strc_math_flush_number_box \hss \egroup - \hskip\zeropoint % nicely breaks the line without introducing funny vertical spacing ... why o why + \hskip\zeroskip % nicely breaks the line without introducing funny vertical spacing ... why o why \strc_math_flush_box_framed_fit_inline \egroup} @@ -2566,9 +3047,9 @@ \protected\def\d_strc_math_total_display_width {\dimexpr - \d_strc_math_display_width+\wd\b_strc_formulas_number + \d_strc_math_display_width+\d_strc_formulas_number \ifconditional\c_strc_formulas_overlay_number - \ifcase\c_strc_math_ragged_status\or\or+\wd\b_strc_formulas_number\or\fi + \ifcase\c_strc_math_ragged_status\or\or+\d_strc_formulas_number\or\fi \fi \relax} @@ -2576,31 +3057,31 @@ {\d_strc_math_display_width\wd\b_strc_math_display \ifconditional\c_strc_formulas_tight \ifdim\d_strc_math_total_display_width>\displaywidth - \settrue\c_strc_math_display_overflow + \c_strc_math_display_overflow\conditionaltrue \else \displaywidth\d_strc_math_total_display_width - \setfalse\c_strc_math_display_overflow + \c_strc_math_display_overflow\conditionalfalse \fi \else \ifdim\dimexpr\d_strc_math_total_display_width+\formulaparameter\c!numberthreshold\relax>\displaywidth - \settrue\c_strc_math_display_overflow + \c_strc_math_display_overflow\conditionaltrue \else - \setfalse\c_strc_math_display_overflow + \c_strc_math_display_overflow\conditionalfalse \fi \fi} \def\strc_math_number_check_outside {\d_strc_math_display_width\naturalwd\b_strc_math_display \ifdim\dimexpr\d_strc_math_total_display_width+\d_framed_locator_lo+\d_framed_locator_ro\relax>\displaywidth - \settrue\c_strc_math_display_overflow + \c_strc_math_display_overflow\conditionaltrue \else - \setfalse\c_strc_math_display_overflow + \c_strc_math_display_overflow\conditionalfalse \fi % still ok? \ifnum\c_strc_math_ragged_status=\plustwo - \d_strc_math_framed_width\dimexpr\displaywidth-2\wd\b_strc_formulas_number\relax + \d_strc_math_framed_width\dimexpr\displaywidth-2\d_strc_formulas_number\relax \else - \d_strc_math_framed_width\dimexpr\displaywidth- \wd\b_strc_formulas_number\relax + \d_strc_math_framed_width\dimexpr\displaywidth- \d_strc_formulas_number\relax \fi} \let\strc_math_number_check_inside\strc_math_number_check_outside @@ -2638,17 +3119,27 @@ \defcsname\??mathboxlocation\v!left \endcsname {\c_strc_math_number_location\plusone} -\defcsname\??mathboxlocation\v!flushright\endcsname - {\c_strc_math_number_location\plusone} \defcsname\??mathboxlocation\v!right\endcsname {\c_strc_math_number_location\plustwo} -\defcsname\??mathboxlocation\v!flushleft\endcsname - {\c_strc_math_number_location\plustwo} + +\defcsname\??mathboxlocation\v!atleftmargin\endcsname + {\c_strc_math_number_location\plusone + \ifzeropt\s_strc_formulas_margin_left + % this can be a helper as now mixed in math-ali + \parinitleftskip\zeroskip + \else + \c_strc_math_number_variant \plusone + \fi} \defcsname\??mathboxlocation\v!atrightmargin\endcsname {\c_strc_math_number_location\plustwo - \c_strc_math_number_variant \plusone} + \ifzeropt\s_strc_formulas_margin_right + % this can be a helper as now mixed in math-ali + \parfillrightskip\zeroskip + \else + \c_strc_math_number_variant \plusone + \fi} \protected\def\strc_math_box_start#1% {\c_strc_math_ragged_status#1\relax % already set @@ -2687,24 +3178,28 @@ \hbox to \displaywidth \bgroup \else \bgroup - \strc_math_show_margins \fi \ifcase\c_strc_math_number_location \strc_math_flush_box \or % number left - \ifzeropt\wd\b_strc_formulas_number + \ifzeropt\d_strc_formulas_number \strc_math_flush_number_no \else \strc_math_flush_number_left \fi \else % number right - \ifzeropt\wd\b_strc_formulas_number + \ifzeropt\d_strc_formulas_number \strc_math_flush_number_no \else \strc_math_flush_number_right \fi \fi - \egroup} + \egroup + \ifnum\c_strc_math_split_mode=\c_strc_math_flow_mode + \ifhmode \else + \strc_math_show_margins + \fi + \fi} \defineinnermathhandler\v!left {\strc_math_box_start\plusthree}{\strc_math_box_stop} \defineinnermathhandler\v!flushright{\strc_math_box_start\plusthree}{\strc_math_box_stop} @@ -2762,7 +3257,7 @@ \fi \fi \else - % \box\b_strc_formulas_number + % \strc_math_flush_number_box % \hfill \strc_math_flush_aligned % we flush in here, otherwise wrong positioning of number (we need to unvbox) \fi} @@ -2789,7 +3284,7 @@ \else \strc_math_flush_aligned % \hfill - % \box\b_strc_formulas_number % we flush in here + % \strc_math_flush_number_box % we flush in here \fi} %D Some inline math tweak. @@ -2803,7 +3298,7 @@ \ifzeropt\glueshrink\mathsurroundskip \mathsurroundmode\plussix \else - \mathsurroundskip\zeropoint + \mathsurroundskip\zeroskip \mathsurroundmode\plusfour \fi \else @@ -2814,15 +3309,15 @@ \fi \else \mathsurroundmode\plusfour - \mathsurroundskip\zeropoint + \mathsurroundskip\zeroskip \fi \to \everymathematics \setupmathematics [\c!textdistance=\zeropoint] -%D This is an experiment. No fancy spacing and alignments here. If we ever -%D go that route it might result in incompatible rendering. +%D This is an experiment. No fancy spacing and alignments here. If we ever go that +%D route it might result in incompatible rendering. \permanent\protected\def\startsplitformula {\ifhmode @@ -2832,7 +3327,7 @@ \beforedisplayspace % subset of \everydisplay: \c_attr_mathmode\plusone - \settrue \indisplaymath + \indisplaymath\conditionaltrue % end of subset \informulatrue} @@ -2885,18 +3380,207 @@ \permanent\protected\def\math_simplealign_NC {\aligntab} +% \permanent\protected\def\math_simplealign_EQ +% {\aligntab=\aligntab} + \permanent\protected\def\math_simplealign_EQ - {\aligntab=\aligntab} + {\aligntab=} \noaligned\tolerant\permanent\protected\def\math_simplealign_NR[#1]#*[#2]% {\unskip - \strc_formulas_place_number_nested{#1}{#2}\crcr} + \strc_formulas_place_number_nested{#1}{#2}% + \math_number_right_of_eqalign + \crcr} \aliased\let\math_align_strut\relax -\permanent\tolerant\protected\def\math_simplealign_start[#1]#*[#2]% +\newconditional\c_math_align_text + +\permanent\protected\def\math_simplealign_NC{\relax\global\setfalse\c_math_align_text\aligntab} +\permanent\protected\def\math_simplealign_EQ{\relax\global\setfalse\c_math_align_text\aligntab=} +\permanent\protected\def\math_simplealign_TC{\relax\global\settrue \c_math_align_text\aligntab} + +\installcorenamespace{mathsimpleendclass} + +\global\expandafter\integerdef\csname\??mathsimpleendclass\the\zerocount\endcsname\mathendcode + +% \permanent\tolerant\protected\def\math_simplealign_start[#1]#*[#S#2]% +% {\begingroup +% \cdef\currentmathsimplealign{#1}% +% \ifarguments\or\or +% \setupcurrentmathsimplealign[#2]% +% \fi +% \edef\p_strut{\mathsimplealignparameter\c!strut}% +% \ifx\p_strut\v!yes +% \enforced\let\math_align_strut\strut +% \else +% \enforced\let\math_align_strut\relax +% \fi +% \mathatom \s!class \mathwrappedcode \bgroup +% \scratchdimen\mathsimplealignparameter\c!leftmargin\relax +% \ifzeropt\scratchdimen\else\kern\scratchdimen\fi +% \mathsimplealignparameter\c!left\relax +% \math_fenced_start_wrap{\mathsimplealignparameter\c!fences}% +% \mathatom \s!class \mathconstructcode \bgroup +% \math_alignment_location_check{\mathsimplealignparameter\c!location}% vcenter etc +% \math_alignment_location_box +% \bgroup +% \enforced\let\MC\math_simplealign_NC +% \enforced\let\NC\math_simplealign_NC +% \enforced\let\TC\math_simplealign_TC +% \enforced\let\NR\math_simplealign_NR +% \enforced\let\EQ\math_simplealign_EQ +% \enforced\let\TB\math_common_TB +% \math_eqalign_set_defaults +% \math_eqalign_set_columns{\mathsimplealignparameter\c!align}% +% \global\c_math_eqalign_column\zerocount +% \global\c_math_eqalign_row\plusone +% \edef\m_simplealign_distance{\mathsimplealignparameter\c!distance}% +% \strc_math_setup_spacing_aligned\mathsimplealignparameter +% \enablemathalignrelocate +% \halign +% \s!callback +% \align_callback_mathalign +% \s!attr +% \mathnumberlocationattribute \zerocount +% \bgroup +% \global\c_math_eqalign_column\zerocount +% \global\advanceby\c_math_eqalign_row\zerocount +% \ignorespaces +% \aligncontent % dummy +% \removeunwantedspaces +% \lastleftclass \mathbegincode +% \lastrightclass\mathendcode +% \aligntab +% \global\advanceby\c_math_eqalign_column\plusone +% \math_left_of_eqalign % \hfil +% \ignorespaces +% \math_align_strut +% % \mathbeginclass\ifcsname\??mathsimpleendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname\lastnamedcs\else\mathunsetcode\fi +% \mathbeginclass\mathbegincode +% \startforceddisplaymath +% \aligncontent +% \stopforceddisplaymath +% \ifnum\lastrightclass<\mathunsetcode +% \global\expandafter\integerdef\csname\??mathsimpleendclass\the\c_math_eqalign_column\endcsname\lastrightclass +% \fi +% \removeunwantedspaces +% \math_right_of_eqalign % \hfil +% \aligntab +% \aligntab +% % repeater +% \global\advanceby\c_math_eqalign_column\plusone +% \math_left_of_eqalign % \hfil +% \ifx\m_simplealign_distance\v!math +% \mathbeginclass\ifcsname\??mathsimpleendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname\lastnamedcs\else\mathunsetcode\fi +% \else +% \kern\m_simplealign_distance +% \fi +% \ignorespaces +% \math_align_strut +% \ifconditional\c_math_align_text +% % somehow we can't use content as an argument +% \else +% \startforceddisplaymath +% \fi +% \aligncontent +% \ifmmode +% \stopforceddisplaymath +% \fi +% \ifnum\lastrightclass<\mathunsetcode +% \global\expandafter\integerdef\csname\??mathsimpleendclass\the\c_math_eqalign_column\endcsname\lastrightclass +% \fi +% \removeunwantedspaces +% \math_right_of_eqalign % \hfil +% \crcr} +% +% \noaligned\permanent\protected\def\math_simplealign_stop +% {\crcr +% \egroup +% \egroup +% \egroup +% \math_fenced_stop_wrap +% \mathsimplealignparameter\c!right\relax +% \scratchdimen\mathsimplealignparameter\c!rightmargin\relax +% \ifzeropt\scratchdimen\else\kern\scratchdimen\fi +% \setbox\scratchbox\hbox{\mathsimplealignparameter\c!text}% +% \ifvoid\scratchbox\else +% \kern\mathsimplealignparameter\c!textdistance +% \vcenter{\box\scratchbox}% +% \fi +% \egroup +% \endgroup} + +% Split up so we can better compare to the normal align: + +\newtoks\everymathsimplealign +\newtoks\everymathsimplealigndone + +\def\math_simplealign_preamble + {\global\c_math_eqalign_column\zerocount + \global\advanceby\c_math_eqalign_row\zerocount + \ignorespaces + \aligncontent % dummy + \removeunwantedspaces + \lastleftclass \mathbegincode + \lastrightclass\mathendcode + \aligntab + \global\advanceby\c_math_eqalign_column\plusone + \math_left_of_eqalign % \hfil + \ignorespaces + \math_align_strut + \mathbeginclass\ifcsname\??mathsimpleendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname\lastnamedcs\else\mathunsetcode\fi + \mathbeginclass\mathbegincode + \startforceddisplaymath + \aligncontent + \stopforceddisplaymath + \ifnum\lastrightclass<\mathunsetcode + \global\expandafter\integerdef\csname\??mathsimpleendclass\the\c_math_eqalign_column\endcsname\lastrightclass + \fi + \removeunwantedspaces + \math_right_of_eqalign % \hfil + \aligntab + \aligntab + % repeater + \global\advanceby\c_math_eqalign_column\plusone + \math_left_of_eqalign % \hfil + \ifx\m_simplealign_distance\v!math + \mathbeginclass\ifcsname\??mathsimpleendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname\lastnamedcs\else\mathunsetcode\fi + \else + \kern\m_simplealign_distance + \fi + \startforceddisplaymath + \aligncontent + \stopforceddisplaymath + \ifnum\lastrightclass<\mathunsetcode + \global\expandafter\integerdef\csname\??mathsimpleendclass\the\c_math_eqalign_column\endcsname\lastrightclass + \fi + \math_right_of_eqalign} % \hfil + +\appendtoks + \enforced\let\MC\math_simplealign_NC + \enforced\let\NC\math_simplealign_NC + \enforced\let\TC\math_simplealign_TC + \enforced\let\NR\math_simplealign_NR + \enforced\let\EQ\math_simplealign_EQ + \enforced\let\TB\math_common_TB +\to \everymathsimplealign + +\appendtoks +\to \everymathsimplealigndone + +\def\math_simple_halign_checked + {\enablemathalignrelocate + \halign + \s!callback + \align_callback_mathalign + \s!attr + \mathnumberlocationattribute \zerocount} + +\permanent\tolerant\protected\def\math_simplealign_start[#1]#*[#S#2]% {\begingroup - \edef\currentmathsimplealign{#1}% + \currentmathblobnesting\minusone + \cdef\currentmathsimplealign{#1}% \ifarguments\or\or \setupcurrentmathsimplealign[#2]% \fi @@ -2906,76 +3590,40 @@ \else \enforced\let\math_align_strut\relax \fi + \expand\everymathsimplealign + \global\c_math_eqalign_column\zerocount + \global\c_math_eqalign_row\plusone + \math_eqalign_set_defaults + \math_eqalign_set_columns{\mathsimplealignparameter\c!align}% + \math_alignment_location_check{\mathsimplealignparameter\c!location}% vcenter etc + \edef\m_simplealign_distance{\mathsimplealignparameter\c!distance}% + \strc_math_setup_spacing_aligned\mathsimplealignparameter + % \mathatom \s!class \mathwrappedcode \bgroup \scratchdimen\mathsimplealignparameter\c!leftmargin\relax \ifzeropt\scratchdimen\else\kern\scratchdimen\fi \mathsimplealignparameter\c!left\relax \math_fenced_start_wrap{\mathsimplealignparameter\c!fences}% \mathatom \s!class \mathconstructcode \bgroup - \vcenter\bgroup - \enforced\let\MC\math_simplealign_NC - \enforced\let\NC\math_simplealign_NC - \enforced\let\NR\math_simplealign_NR - \enforced\let\EQ\math_simplealign_EQ - \enforced\let\TB\math_common_TB - \math_eqalign_set_defaults - \math_eqalign_set_columns{\mathsimplealignparameter\c!align}% - \global\c_math_eqalign_column\zerocount - \global\c_math_eqalign_row\plusone - \edef\m_simplealign_distance{\mathsimplealignparameter\c!distance}% - \strc_math_setup_spacing_aligned\mathcasesparameter - \enablematrixalign - \halign callback \s!attr \mathnumberlocationattribute \zerocount \bgroup - \global\c_math_eqalign_column\zerocount - \global\advanceby\c_math_eqalign_row\zerocount - \ignorespaces - \aligncontent % dummy - \removeunwantedspaces - \lastleftclass \mathbegincode - \lastrightclass\mathendcode - \aligntab - \global\advanceby\c_math_eqalign_column\plusone - \math_left_of_eqalign % \hfil - \ignorespaces - \math_align_strut - \startforceddisplaymath - \aligncontent - \stopforceddisplaymath - \removeunwantedspaces - \math_right_of_eqalign % \hfil - \aligntab - \aligntab - \global\advanceby\c_math_eqalign_column\plusone - \math_left_of_eqalign % \hfil - \ifx\m_simplealign_distance\v!math - \mathbeginclass\lastrightclass - \else - \kern\m_simplealign_distance - \fi - \ignorespaces - \math_align_strut - \startforceddisplaymath - \aligncontent - \stopforceddisplaymath - \removeunwantedspaces - \math_right_of_eqalign % \hfil - \crcr} + \math_alignment_location_box \bgroup + \math_simple_halign_checked\expandafter\bgroup\math_simplealign_preamble\crcr} \noaligned\permanent\protected\def\math_simplealign_stop {\crcr - \egroup - \egroup - \egroup + \egroup % halign + \egroup % box + \egroup % construct \math_fenced_stop_wrap \mathsimplealignparameter\c!right\relax \scratchdimen\mathsimplealignparameter\c!rightmargin\relax \ifzeropt\scratchdimen\else\kern\scratchdimen\fi \setbox\scratchbox\hbox{\mathsimplealignparameter\c!text}% \ifvoid\scratchbox\else - \kern\mathsimplealignparameter\c!textdistance % hskip + \kern\mathsimplealignparameter\c!textdistance \vcenter{\box\scratchbox}% \fi - \egroup + \egroup % wrapped + \expand\everymathsimplealigndone \endgroup} %D It's not that spectacular apart from spacing being proper inter atom spacing @@ -2994,9 +3642,9 @@ %D %D \startformula %D \startwhatever[text=simple] -%D \NC x \NC = \NC r \NC \cos\theta \NR -%D \NC y \NC = \NC \frac{1}{2} \NC \sin\theta \NR -%D \NC 9 \NC = \NC 123 \NC \sin\theta \NR +%D \NC x \NC = r \cos\theta \NR +%D \NC y \NC = \frac{1}{2} \sin\theta \NR +%D \NC 9 \NC = 123 \sin\theta \NR %D \stopwhatever %D \stopformula %D \stoptyping @@ -3006,7 +3654,7 @@ \permanent\protected\def\mstack#1% todo: make it configurable {\begingroup \scratchtoks\emptytoks \setcharstrut(\relax - \processcommalist[#1]{\iftok\scratchtoks\emptytoks\else\toksapp\scratchtoks{\mathstrut\NR}\fi\toksapp\scratchtoks}% + \processcommalist[#1]{\ifempty\scratchtoks\else\toksapp\scratchtoks{\mathstrut\NR}\fi\toksapp\scratchtoks}% \expandafter\startsubstack\the\scratchtoks\mathstrut\stopsubstack \endgroup} @@ -3026,9 +3674,9 @@ %D \stopformula %D \stoptyping -\permanent\tolerant\protected\def\math_align_simple[#1]#*[#2]#:#3% +\permanent\tolerant\protected\def\math_align_simple[#1]#*[#S#2]#:#3% {\begingroup - \edef\currentmathsimplealign{#1}% + \cdef\currentmathsimplealign{#1}% \setupcurrentmathsimplealign[#2]% \math_simplealign_start[\currentmathsimplealign]% \clf_simplealign{\mathsimplealignparameter\c!alternative}{\mathsimplealignparameter\c!action}{#3}% @@ -3065,6 +3713,39 @@ \c!left={\startmathfenced[sesac]}, \c!right=\stopmathfenced] +%D There are users who use this so let's for now keep it (I also need to adapt +%D x-mathml.mkxl): + +\newskip \math_old_hideskip \math_old_hideskip = -1000pt plus 1fill +\newskip \math_old_centering \math_old_centering = 0pt plus 1000pt minus 1000pt + +\permanent\protected\def\eqalign#1% rather plain, is this used at all ... + {\dontleavehmode + \mskip\thinmuskip\vcenter\bgroup % \vcenter \s!class \mathwrappercode \bgroup + \currentmathblobnesting\minusone + \mathsurround\zeropoint % \math_eqalign_set_defaults + \everycr\emptytoks + \tabskip\zeroskip + \enforced\let\hideskip\math_old_hideskip + \enforced\let\centering\math_old_centering + \enforced\def\hidewidth{\hskip\hideskip} % for alignment entries that can stick out + \amcode\ampersandasciicode\alignmentcatcode + \halign + {\strut + \hfil + \mathbeginclass\mathordcode + \mathendclass \mathordcode + \startforceddisplaymath\aligncontent\stopforceddisplaymath + \aligntab + \mathbeginclass\mathordcode + \mathendclass \mathordcode + \startforceddisplaymath\aligncontent\stopforceddisplaymath + \hfil + \crcr + #1% + \crcr}% + \egroup\mskip\thinmuskip} % \egroup + \protect \endinput % \placeformula \startformula[-] \startmatrix diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl index 27f014d4409..e311c26d9d0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl @@ -60,7 +60,7 @@ \defcsname\??combinationmethod\v!formula:\v!start\endcsname {\startformula \dostarttagged\t!formulaset\empty - \global\settrue\c_strc_formulas_inside_formulas + \global\c_strc_formulas_inside_formulas\conditionaltrue \bgroup \setupformulas[\c!width=\combinationwidth]% \enforced\tolerant\protected\def\startformula[##1]% @@ -76,10 +76,10 @@ \defcsname\??combinationmethod\v!formula:\v!stop\endcsname {\egroup - \global\setfalse\c_strc_formulas_inside_formulas + \global\c_strc_formulas_inside_formulas\conditionalfalse \dostoptagged \stopformula - \the\everyresetformulas} + \expand\everyresetformulas} \definecombination[\v!formula][method=formula,width=\hsize] diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl index 3e4d724aeae..48eb0648bd5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl @@ -57,9 +57,9 @@ \definemathfunction [injlim] [\c!mathlimits=\v!auto] \definemathfunction [ker] \definemathfunction [lg] -\definemathfunction [liminf] [\c!mathlimits=\v!auto] -\definemathfunction [limsup] [\c!mathlimits=\v!auto] -\definemathfunction [lim] [\c!mathlimits=\v!auto] +\definemathfunction [liminf] [\c!mathlimits=\v!auto,\c!method=limits] +\definemathfunction [limsup] [\c!mathlimits=\v!auto,\c!method=limits] +\definemathfunction [lim] [\c!mathlimits=\v!auto,\c!method=limits] \definemathfunction [ln] \definemathfunction [log] \definemathfunction [median] [\c!mathlimits=\v!yes] @@ -77,11 +77,29 @@ \definemathfunction [tan] \definemathfunction [diff] +\definemathfunction [adj] +\definemathfunction [coker] + % When [\c!command=] the label kicks in: \definemathfunction [cs:median] [\c!command=\widetilde] \definemathfunction [sk:median] [\c!command=\widetilde] +% \definemathfunction[partial] [class=differential] +% \definemathfunction[gradient] [class=differential] +\definemathfunction[adjoint] [right=\adjointsymbol] +\definemathfunction[transpose] [right=\transposesymbol] +\definemathfunction[derivative] [right=\derivativesymbol] +\definemathfunction[secondderivative][right=\secondderivativesymbol] +\definemathfunction[thirdderivative] [right=\thirdderivativesymbol] +\definemathfunction[fourthderivative][right=\fourthderivativesymbol] + +% \definemathfunction[laplace] [class=differential] +% \definemathfunction[crossproduct] [class=binary] +% \definemathfunction[scalarproduct][class=binary] +% \definemathfunction[complement] +\definemathfunction[neg] + \aliased\let\normalmatharg\arg % todo: maybe automatically %D This needs checking: diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl index 35d71460baa..92c2c23a87d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl @@ -86,14 +86,14 @@ \appendtoks \ifcstok{\mathdelimiterparameter\c!define}\v!yes % we can intercept auto here - \frozen\instance\setuevalue\currentmathdelimiter{\mathdelimiter[\currentmathdelimiter]}% + \frozen\instance\protected\edefcsname\currentmathdelimiter\endcsname{\mathdelimiter[\currentmathdelimiter]}% \fi \to \everydefinemathdelimiter -\permanent\tolerant\protected\def\mathdelimiter[#1]#*[#2]% so not really used (for now) +\permanent\tolerant\protected\def\mathdelimiter[#1]#*[#S#2]% so not really used (for now) {\mathop - {\edef\currentmathdelimiter{#1}% - \iftok{#2}\emptytoks + {\cdef\currentmathdelimiter{#1}% + \ifempty{#2}% \edef\p_factor{\mathdelimiterparameter\c!factor}% \orelse\ifhastok={#2}% \setupcurrentmathdelimiter[#2]% @@ -101,19 +101,17 @@ \else \edef\p_factor{#2}% \fi - \edef\p_exact{\mathdelimiterparameter\c!exact}% - \edef\p_axis {\mathdelimiterparameter\c!axis}% \edef\p_leftoffset{\mathdelimiterparameter\c!leftoffset}% \edef\p_rightoffset{\mathdelimiterparameter\c!rightoffset}% \ifempty\p_leftoffset\else \mskip\p_leftoffset \fi \Uvextensible - \ifx\p_exact\v!yes exact \fi - \ifx\p_axis \v!yes axis \fi + \ifcstok{\mathdelimiterparameter\c!exact}\v!yes exact \fi + \ifcstok{\mathdelimiterparameter\c!axis }\v!yes axis \fi height \p_factor\dimexpr\mathdelimiterparameter\c!height\relax depth \p_factor\dimexpr\mathdelimiterparameter\c!depth \relax - \Udelimiter\zerocount\zerocount\mathdelimiterparameter\c!symbol + \Umathchar\zerocount\zerocount\mathdelimiterparameter\c!symbol \relax \ifempty\p_rightoffset\else \mskip\p_rightoffset @@ -143,20 +141,20 @@ {\ifmmode \setbox\nextbox\mathstylehbox{#3}% \scratchdimen\ifdim\nextboxht>\nextboxdp\nextboxht\else\nextboxdp\fi - \mathlimop{% + \mathatom \mathintegralcode {% \Uvextensible height \scratchdimen depth \scratchdimen exact% axis% - \Udelimiter \plusfour \zerocount "222B% + \Umathchar \plusfour \zerocount "222B% }% \limits % nolimits needs more work: kerning and so \normalsuperscript{#1}% \normalsubscript{#2}% \box\nextbox \else - \char"222B\relax + \char"222B\relax % hard coded but obsolete anyway \fi} % \startformula diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl index 4c11177260a..425ddf9dc36 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl @@ -15,34 +15,32 @@ \unprotect -\pushoverloadmode - - % For new times sake: - - \ifdefined\dd \aliased\let\normal_math_dd\dd \else \lettonothing\normal_math_dd \fi - \ifdefined\DD \aliased\let\normal_math_DD\DD \else \lettonothing\normal_math_DD \fi - - \def\c!differentiald{differentiald} % for now - - \def\upright_math_dd{\mathatom \s!unpack \mathdifferentialcode{\mathupright d}} - \def\upright_math_DD{\mathatom \s!unpack \mathdifferentialcode{\mathupright D}} - - \permanent\protected\def\dd - {\ifcstok{\mathematicsparameter\c!differentiald}\s!upright - \upright_math_dd - \else - \normal_math_dd - \fi} - - \permanent\protected\def\DD - {\ifcstok{\mathematicsparameter\c!differentiald}\s!upright - \upright_math_DD - \else - \normal_math_DD - \fi} - - % \setupmathematics[differentiald=upright] - -\popoverloadmode +%D The shapes are defined in \type {char-def.lua} where they get the right class +%D too. +%D +%D \starttyping +%D \setupmathematics +%D [differentiald=upright] +%D \stoptyping + +\permanent\protected\def\dd + {\ifcstok{\mathematicsparameter\c!differentiald}\s!upright + \begingroup + \mathupright + \mathduprightshape + \endgroup + \else + \mathditalicshape + \fi} + +\permanent\protected\def\DD + {\ifcstok{\mathematicsparameter\c!differentiald}\s!upright + \begingroup + \mathupright + \mathDuprightshape + \endgroup + \else + \mathDitalicshape + \fi} \protect diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx index 281ccedb2c0..ae9e14c3e4a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx @@ -51,9 +51,9 @@ \mutable\lettonothing\currentmathdelimited -\tolerant\protected\def\math_delimited_handle#tag#*[#settings]#:#body% +\tolerant\protected\def\math_delimited_handle#tag#*[#S#settings]#:#body% {\begingroup - \edef\currentmathdelimited{#tag}% + \cdef\currentmathdelimited{#tag}% \setupcurrentmathdelimited[#settings]% \math_delimited_alternative{% \begincsname\??mathwhateverstrut\mathdelimitedparameter\c!strut\endcsname @@ -250,13 +250,29 @@ % $ \autofences \fourier{(z+\frac12)} + \courier{(z+\frac12)} + \xourier{(z+\frac12)} $ -\definemathdelimited [primed] [\c!right="2032,\c!size=1,\c!topoffset=.2\exheight] -\definemathdelimited [doubleprimed] [primed] [\c!right="2033] -\definemathdelimited [tripleprimed] [primed] [\c!right="2034] -\definemathdelimited [quadrupleprimed] [primed] [\c!right="2057] -\definemathdelimited [reverseprimed] [primed] [\c!right="2035] -\definemathdelimited [doublereverseprimed] [primed] [\c!right="2036] -\definemathdelimited [triplereverseprimed] [primed] [\c!right="2037] +\integerdef\delimitedrightprimeuc \privatecharactercode{delimited right prime} +\integerdef\delimitedrightdprimeuc \privatecharactercode{delimited right dprime} +\integerdef\delimitedrighttprimeuc \privatecharactercode{delimited right tprime} +\integerdef\delimitedrightqprimeuc \privatecharactercode{delimited right qprime} +\integerdef\delimitedrightrprimeuc \privatecharactercode{delimited right rprime} +\integerdef\delimitedrightrdprimeuc \privatecharactercode{delimited right rdprime} +\integerdef\delimitedrightrtprimeuc \privatecharactercode{delimited right rtprime} + +%definemathdelimited [primed] [\c!right="2032,\c!size=1,\c!topoffset=.2\exheight] +%definemathdelimited [doubleprimed] [primed] [\c!right="2033] +%definemathdelimited [tripleprimed] [primed] [\c!right="2034] +%definemathdelimited [quadrupleprimed] [primed] [\c!right="2057] +%definemathdelimited [reverseprimed] [primed] [\c!right="2035] +%definemathdelimited [doublereverseprimed] [primed] [\c!right="2036] +%definemathdelimited [triplereverseprimed] [primed] [\c!right="2037] + +\definemathdelimited [primed] [\c!right=\delimitedrightprimeuc,\c!topoffset=.2\exheight,\c!size=1] +\definemathdelimited [doubleprimed] [primed] [\c!right=\delimitedrightdprimeuc] +\definemathdelimited [tripleprimed] [primed] [\c!right=\delimitedrighttprimeuc] +\definemathdelimited [quadrupleprimed] [primed] [\c!right=\delimitedrightqprimeuc] +\definemathdelimited [reverseprimed] [primed] [\c!right=\delimitedrightrprimeuc] +\definemathdelimited [doublereverseprimed] [primed] [\c!right=\delimitedrightrdprimeuc] +\definemathdelimited [triplereverseprimed] [primed] [\c!right=\delimitedrightrtprimeuc] % diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl index 53c34c56716..1724634ada1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl @@ -56,7 +56,11 @@ \c!distance=\zerocount, \c!topspace=\zeropoint, \c!bottomspace=\zeropoint, - \c!factor=\v!auto] + % \c!overflow=\v!no, + \c!overflow=\v!auto, + \c!alternative=\v!big, + \c!factor=\v!auto, + \c!snap=\mathematicsparameter\c!snap] % "28 \appendtoks \ifcstok{\mathfenceparameter\c!define}\v!yes @@ -64,8 +68,6 @@ \fi \to \everydefinemathfence -% we need the direct use of \Udelimiter because of { etc - %D So we can do: %D %D \starttyping @@ -96,8 +98,8 @@ % todo : class -> number -\newconditional\c_math_fenced_mirror \settrue \c_math_fenced_mirror -\newconditional\c_math_fenced_sized \setfalse\c_math_fenced_sized +\newconditional\c_math_fenced_mirror \c_math_fenced_mirror\conditionaltrue +\newconditional\c_math_fenced_sized \c_math_fenced_sized \conditionalfalse \newinteger \c_math_fence_nesting \installcorenamespace {mathfencesize} @@ -109,17 +111,12 @@ \let\math_fenced_trace\donothing -\def\math_fenced_force_size#1#2% - {\c_attr_mathsize\numexpr - #1*\plushundred - +\ifcsname\??mathfencesize#2\endcsname\lastnamedcs\else#2\fi - \relax} - -\def\math_fenced_common_factor_none - {\math_fenced_force_size\bigmathdelimitervariant\c_math_fence_nesting\relax - \Uvextensible - \s!axis - \s!exact} +\def\math_fenced_common_factor_none % a weird one anyway + {\Uvextensible + \s!axis\space + \s!exact\space + \s!variant \mathvariantslot\fam \numexpr\c_math_fence_nesting\relax} + % \s!variant \mathvariantslot\fam \numexpr\c_math_fence_nesting+\plusone\relax} \def\math_fenced_common_factor_fixed {\Uvextensible @@ -141,6 +138,42 @@ \s!axis \s!exact} +\def\math_fenced_common_factor_size + {\Uvextensible + \math_fenced_set_variant} + +\def\math_fenced_common_factor_empty#1% + {\ifconditional\c_math_fenced_level_mode + \Uvextensible + \else + #1% \Uleft \Umiddle \Uleft + \ifx#1\Umiddle + \ifx\p_overflow\v!auto + middle % + nooverflow % + \orelse\ifx\p_overflow\v!no + nooverflow % + \fi + \fi + \fi} + +\def\math_fenced_common_factor_auto#1% + {\ifconditional\c_math_fenced_level_mode + \Uvextensible + \math_fenced_set_variant + \else + #1% \Uleft \Umiddle \Uleft + \math_fenced_set_variant + \ifx#1\Umiddle + \ifx\p_overflow\v!auto + middle % + nooverflow % + \orelse\ifx\p_overflow\v!no + nooverflow % + \fi + \fi + \fi} + % \startTEXpage[offset=1dk] % \dm { \fenced[brace][middle="7C] { \frac{p}{q} \fence p,q \in \naturalnumbers} }\par % \dm { \fenced[brace][middle=`|] { \frac{p}{q} \fence p,q \in \naturalnumbers} }\par @@ -151,19 +184,21 @@ \newconstant\c_math_fenced_class \newinteger \c_math_fence_check +\integerdef\c_math_factor_fenced\zerocount + +\installglobalmacrostack\c_math_factor_fenced + \protected\def\math_fenced_common#1#2#3#4% \Uwhatever class symbol source {\c_math_fenced_class\math_class_by_parameter\mathfenceparameter#2% \math_fenced_check_size_mismatch % we need to catch an unbalanced \F as we are sequential \ifconditional\c_math_fenced_sized \orelse\ifconditional\c_math_fenced_level_mode \ifnum\c_math_fenced_class=\mathopencode - % \hpack{\infofont}% - \integerdef\c_math_fenced_stack\c_attr_mathsize + \integerdef\c_math_fenced_stack\c_math_fenced_level \push_macro_c_math_fenced_stack \orelse\ifnum\c_math_fenced_class=\mathclosecode \pop_macro_c_math_fenced_stack - \c_attr_mathsize\c_math_fenced_stack - % \hpack{\infofont}% + \c_math_fenced_level\c_math_fenced_stack \fi \fi \edef\p_fence{#3}% @@ -171,40 +206,43 @@ \ifnum\c_math_fenced_class=\mathmiddlecode\else#1.\relax\fi \else \edef\p_factor {\mathfenceparameter\c!factor}% + \edef\p_overflow {\mathfenceparameter\c!overflow}% \edef\p_size {\mathfenceparameter\c!size}% \edef\p_mathclass{\mathfenceparameter\c!mathclass}% + \edef\p_inline_factor{\ifconditional\indisplaymath\mathfenceparameter\c!displayfactor\else\mathfenceparameter\c!inlinefactor\fi}% + \scratchcounter\math_tags_mfunctionlabattribute\plusthree{\currentglobalmathfence}{\mathfenceparameter\c!mathmeaning}\relax + \ifempty\p_inline_factor + % nothing + \orelse\ifx#1\Uleft + \push_macro_c_math_factor_fenced + \integerdef\c_math_factor_fenced\p_inline_factor\relax + \orelse\ifx#1\Uright + \pop_macro_c_math_factor_fenced + \fi \ifnum\c_math_fenced_level>\zerocount \math_fenced_common_factor_fixed + \math_fenced_set_variant \orelse\ifconditional\c_math_fenced_sized \math_fenced_common_factor_fixed \orelse\ifempty\p_factor - \ifconditional\c_math_fenced_level_mode - \Uvextensible - \else - #1% \Uleft \Umiddle \Uleft - \ifx#1\Umiddle - nooverflow % - \fi - \fi + \math_fenced_common_factor_empty#1% \orelse\ifx\p_factor\v!auto - \ifconditional\c_math_fenced_level_mode - \Uvextensible - \else - #1% \Uleft \Umiddle \Uleft - \ifx#1\Umiddle - nooverflow % - \fi - \fi + \math_fenced_common_factor_auto#1% \orelse\ifx\p_factor\v!none \math_fenced_common_factor_none \orelse\ifx\p_factor\v!fixed \math_fenced_common_factor_fixed \orelse\ifx\p_factor\v!force \math_fenced_common_factor_force + \orelse\ifx\p_factor\v!size + \math_fenced_common_factor_size \else \math_fenced_common_factor_unknown \fi \usedcolorparameterattributes{\mathfenceparameter\c!color}% + \ifcase\scratchcounter\else + \s!attr \mathcategoryattribute \scratchcounter % will change + \fi \s!class \ifx\p_fence\v!none \mathghostcode @@ -213,25 +251,41 @@ \else \mathcodechecked\p_mathclass \fi - \s!source - \numexpr\namedboxanchor{\mathfenceparameter#4}\relax + \s!source \numexpr\namedboxanchor{\mathfenceparameter#4}\relax % \s!top \mathfenceparameter\c!topspace \s!bottom \mathfenceparameter\c!bottomspace % + \ifzero\c_math_factor_fenced\else + \s!factor \c_math_factor_fenced + \fi + % + \ifcstok{\mathfenceparameter\c!snap}\v!yes + \s!single\space + \fi + % \math_fenced_trace \ifx\p_fence\v!none - \Udelimiter\mathghostcode\fam\zerocount - \orelse\ifchknum\p_fence\or - \Udelimiter\mathghostcode\fam\p_fence + % todo: test with \nomathchar + \Umathchar\mathghostcode\fam\zerocount + \orelse\ifchknumber\p_fence\or + \Umathchar\mathghostcode\fam\lastchknumber \else \p_fence \fi - \fi - % we could use \s!attr \c_math_fenced_stack here - \ifconditional\c_math_fenced_sized - \orelse\ifcase\c_math_fenced_level - \c_attr_mathsize\attributeunsetvalue + \fi} + +\def\math_fenced_set_variant + {\ifconditional\c_math_fenced_level_mode + \s!variant \mathvariantslot\fam \c_math_fenced_level + \orelse\ifempty\p_size + % nothing + \orelse\ifcsname\??mathfencesize\p_size\endcsname + \s!variant \mathvariantslot\fam \numexpr\lastnamedcs\relax + \orelse\ifcstok{\mathfenceparameter\c!alternative}\v!big + \s!variant \mathvariantslot\fam \numexpr\p_size\relax + \orelse\ifcstok{\lastnamedcs}\v!small + \s!variant \numexpr\p_size\relax \fi} \def\math_fenced_left @@ -246,9 +300,9 @@ {\math_fenced_common\Umiddle\c!middleclass\math_fenced_p_middle\c!middlesource} \def\math_fenced_middle_sized - {\settrue\c_math_fenced_sized + {\c_math_fenced_sized\conditionaltrue \math_fenced_middle_normal - \setfalse\c_math_fenced_sized} + \c_math_fenced_sized\conditionalfalse} \appendtoks \let\math_fenced_middle\math_fenced_middle_normal @@ -319,12 +373,12 @@ \protected\def\math_fenced_fenced_start#1% {\begingroup %{\beginmathgroup - \edef\currentmathfence{#1}% + \cdef\currentmathfence{#1}% \math_fenced_fenced_common \math_fenced_left} \protected\def\math_fenced_fenced_stop#1% - {\edef\currentmathfence{#1}% + {\cdef\currentmathfence{#1}% \math_fenced_right \stopusemathstyleparameter \endgroup} @@ -340,7 +394,7 @@ % \definemathfence [tupdownarrows] [text] [\c!left="2191,\c!right="2193] \def\math_fenced_check#1% - {\iftok{\mathfenceparameter#1}\emptytoks\letmathfenceparameter#1\v!none\fi} + {\ifempty{\mathfenceparameter#1}\letmathfenceparameter#1\v!none\fi} \appendtoks \math_fenced_check\c!left @@ -361,12 +415,11 @@ \s!rightclass \mathunspacedcode \s!class \mathunspacedcode \s!source \numexpr\namedboxanchor{\mathfenceparameter#4}\relax - \Udelimiter\mathghostcode\fam\p_fence} + \Umathchar\mathghostcode\fam\p_fence} -\tolerant\protected\def\math_fenced_horizontal#1#*[#2]#:#*#3#4% - {% \csname math\mathfenceparameter\c!mathclass\endcsname - \mathord \bgroup % class here - \setlocalmathfencecurrent{#1}% \edef\currentmathfence{#1}% +\tolerant\protected\def\math_fenced_horizontal#1#*[#S#2]#:#*#3#4% + {\mathord \bgroup % class here + \setlocalmathfencecurrent{#1}% \cdef\currentmathfence{#1}% \setupcurrentmathfence[#2]% % \usemathstyleparameter\mathfenceparameter\c!mathstyle \setmathsmalltextbox\scratchboxone\hbox{\usemathfencestyleandcolor\c!leftstyle \c!leftcolor #3}% @@ -404,56 +457,51 @@ \c!define=\v!yes, \c!distance=.125\emwidth] -\tolerant\protected\def\math_fenced_vertical#1#*[#2]% - {\begingroup +% \tolerant\protected\def\math_fenced_vertical#1#*[#S#2]% +% {\begingroup +% %{\beginmathgroup +% \setlocalmathfencecurrent{#1}% \cdef\currentmathfence{#1}% +% \c_math_fenced_level_mode\conditionalfalse +% \resetmathfenceparameter\c!size +% \letmathfenceparameter\c!factor\v!auto +% \ifparameter#2\or +% \setupcurrentmathfence[#2]% +% \fi +% \math_fenced_fenced_common +% \math_fenced_fenced_indeed_adapt} + +% \protected\def\math_fenced_fenced_indeed_adapt#1% +% {\c_math_fenced_sized\conditionalfalse +% \math_fenced_left +% #1% +% \c_math_fenced_sized\conditionalfalse +% \math_fenced_right +% \math_fenced_fenced_indeed_finish} + +% \protected\def\math_fenced_fenced_indeed_finish +% {\stopusemathstyleparameter +% \endgroup} +% %\endmathgroup} + +\tolerant\protected\def\math_fenced_vertical#1#*[#S#2]#:#3% %{\beginmathgroup - \setlocalmathfencecurrent{#1}% \edef\currentmathfence{#1}% - % under test: - \setfalse\c_math_fenced_level_mode - \c_attr_mathsize\attributeunsetvalue - % + {\begingroup + \setlocalmathfencecurrent{#1}% \cdef\currentmathfence{#1}% + \c_math_fenced_level_mode\conditionalfalse \resetmathfenceparameter\c!size \letmathfenceparameter\c!factor\v!auto - % so far \ifparameter#2\or \setupcurrentmathfence[#2]% - \bigmathdelimitervariant\mathfenceparameter\c!alternative\relax \fi \math_fenced_fenced_common - \edef\p_size{\mathfenceparameter\c!size}% - \ifempty\p_size - \expandafter\math_fenced_fenced_indeed_adapt - \else - \expandafter\math_fenced_fenced_indeed_fixed - \fi} - -\protected\def\math_fenced_fenced_indeed_finish - {\stopusemathstyleparameter - \endgroup} - %\endmathgroup} - -\protected\def\math_fenced_fenced_indeed_fixed#1% - {\math_fenced_force_size\bigmathdelimitervariant\p_size - \settrue\c_math_fenced_sized - \math_fenced_left - \setfalse\c_math_fenced_sized - \let\math_fenced_middle\math_fenced_middle_sized - % \enforced\let\middle\math_fenced_middle_sized -\begingroup - #1% otherwise middle interferes -\endgroup - \settrue\c_math_fenced_sized - \math_fenced_right - \setfalse\c_math_fenced_sized - \math_fenced_fenced_indeed_finish} - -\protected\def\math_fenced_fenced_indeed_adapt#1% - {\setfalse\c_math_fenced_sized + \c_math_fenced_sized\conditionalfalse \math_fenced_left - #1% - \setfalse\c_math_fenced_sized + #3% + \c_math_fenced_sized\conditionalfalse \math_fenced_right - \math_fenced_fenced_indeed_finish} + \stopusemathstyleparameter + \endgroup} + %\endmathgroup} \protected\def\math_fenced_direct[#1]% {\math_fenced_fenced{#1}} @@ -462,9 +510,9 @@ \enforced\let\fenced\math_fenced_direct \to \everymathematics -\permanent\tolerant\protected\def\startmathfenced[#1]#*[#2]% +\permanent\tolerant\protected\def\startmathfenced[#1]#*[#S#2]% {\begingroup - \def\currentmathfence{#1}% + \cdef\currentmathfence{#1}% \setupcurrentmathfence[#2]% \math_fenced_fenced_start{#1}} @@ -557,14 +605,13 @@ \defcsname\??fencelevels+\endcsname{\advanceby\c_math_fenced_level\plusone } \defcsname\??fencelevels-\endcsname{\advanceby\c_math_fenced_level\minusone } -\defcsname\??fencelevels=\endcsname {\c_math_fenced_level\zerocount} +\defcsname\??fencelevels=\endcsname {\c_math_fenced_level\zerocount} \letcsname\??fencelevels*\endcsname\donothing \def\math_fenced_check_size_mismatch {\ifnum\c_math_fence_check=\c_math_fence_nesting - \c_attr_mathsize\attributeunsetvalue - \setfalse\c_math_fenced_level_mode + \c_math_fenced_level_mode\conditionalfalse \c_math_fenced_level\zerocount \fi} @@ -572,32 +619,31 @@ {\ifconditional\c_math_fenced_level_mode\else \c_math_fence_check\c_math_fence_nesting \fi - \settrue\c_math_fenced_level_mode + \c_math_fenced_level_mode\conditionaltrue \ifchknum#1\or \c_math_fenced_level#1\relax \orelse\ifcsname\??fencelevels#1\endcsname \lastnamedcs \else \c_math_fenced_level\zerocount - \fi - \math_fenced_force_size\bigmathdelimitervariant\c_math_fenced_level\relax} + \fi} % \appendtoks % \enforced\aliased\let|\letterbar % %\enforced\aliased\let\bar\letterbar % \to \everymathematics -\definemathfence [parenthesis] [\c!left="0028,\c!right="0029] -\definemathfence [bracket] [\c!left="005B,\c!right="005D] -\definemathfence [brace] [\c!left="007B,\c!right="007D] +\definemathfence [parenthesis] [\c!left="0028,\c!right="0029,define=yes]% some kind of meaning +\definemathfence [bracket] [\c!left="005B,\c!right="005D,define=yes]% some kind of meaning +\definemathfence [brace] [\c!left="007B,\c!right="007D,define=yes]% some kind of meaning \definemathfence [bar] [\c!left="007C,\c!right="007C] \definemathfence [doublebar] [\c!left="2016,\c!right="2016] \definemathfence [triplebar] [\c!left="2980,\c!right="2980] \definemathfence [angle] [\c!left="27E8,\c!right="27E9] \definemathfence [doubleangle] [\c!left="27EA,\c!right="27EB] \definemathfence [solidus] [\c!left="2044,\c!right="2044] -\definemathfence [ceiling] [\c!left="2308,\c!right="2309] -\definemathfence [floor] [\c!left="230A,\c!right="230B] +\definemathfence [ceiling] [\c!left="2308,\c!right="2309,define=yes]% Have meaning +\definemathfence [floor] [\c!left="230A,\c!right="230B,define=yes]% Have meaning \definemathfence [moustache] [\c!left="23B0,\c!right="23B1] \definemathfence [uppercorner] [\c!left="231C,\c!right="231D] \definemathfence [lowercorner] [\c!left="231E,\c!right="231F] @@ -676,14 +722,15 @@ % Different intervals. The variants are the ones suggested by Bourbaki. -\definemathfence [interval] [\c!left="005B,\c!right="005D] -\definemathfence [openinterval] [interval] [\c!left="0028,\c!right="0029] -\definemathfence [closedinterval] [interval] [\c!left="005B,\c!right="005D] -\definemathfence [leftopeninterval] [interval] [\c!left="0028,\c!right="005D] -\definemathfence [rightopeninterval] [interval] [\c!left="005B,\c!right="0029] -\definemathfence [varopeninterval] [interval] [\c!left="005D,\c!right="005B] -\definemathfence [varleftopeninterval] [interval] [\c!left="005D,\c!right="005D] -\definemathfence [varrightopeninterval] [interval] [\c!left="005B,\c!right="005B] +\definemathfence [interval] [\c!left="005B,\c!right="005D,define=yes] +\definemathfence [openinterval] [interval] [\c!left="0028,\c!right="0029,define=yes] +\definemathfence [closedinterval] [interval] [\c!left="005B,\c!right="005D,define=yes] +\definemathfence [leftopeninterval] [interval] [\c!left="0028,\c!right="005D,define=yes] +\definemathfence [rightopeninterval] [interval] [\c!left="005B,\c!right="0029,define=yes] +\definemathfence [varopeninterval] [interval] [\c!left="005D,\c!right="005B,define=yes] +\definemathfence [varleftopeninterval] [interval] [\c!left="005D,\c!right="005D,define=yes] +\definemathfence [varrightopeninterval] [interval] [\c!left="005B,\c!right="005B,define=yes] +\definemathfence [integerinterval] [interval] [\c!left="27E6,\c!right="27E7,define=yes] \immutable\protected\def\Linterval {\math_fenced_fenced_start{interval}} \immutable\protected\def\Lointerval {\math_fenced_fenced_start{openinterval}} @@ -737,7 +784,7 @@ \def\math_fenced_x_middle {\math_fenced_common\Umiddle\c!middleclass\math_fenced_x_p_middle\c!middlesource} -% the expandafter permits \left\Uchar... +% the expandafter permits \left\tocharacter... \protected\def\lfence{\afterassignment\math_fenced_x_left \expandafter\let\expandafter\math_fenced_x_p_left} \protected\def\rfence{\afterassignment\math_fenced_x_right \expandafter\let\expandafter\math_fenced_x_p_right} @@ -751,7 +798,7 @@ % \let\leftorright\relax -\newconditional\c_math_fenced_unknown \settrue\c_math_fenced_unknown +\newconditional\c_math_fenced_unknown \c_math_fenced_unknown\conditionaltrue % \permanent\protected\def\installmathfencepair#1#2#3#4% % {\letcsname\??mathleft \normalmeaningless#1\endcsname#2% @@ -968,32 +1015,24 @@ %D As we have overloaded \type {\left} and \type {\right} we also need a more %D clever version of the following: -% variants: +% alternatives: % -% 1: step 1 -% 2: step 2 -% 3: htdp * 1.33^n -% 4: size * 1.33^n - -\setnewconstant\bigmathdelimitervariant\plusthree - -\appendtoks - \bigmathdelimitervariant\mathfenceparameter\c!alternative\relax % controls lua -\to \everysetupmathfence - -\setupmathfence[\c!alternative=5] % the rest will probably go +% small: step 1 +% big : take step from lfg \permanent\protected\def\choosemathbig {\mathortext\math_choosemathbig_math\math_choosemathbig_text} \protected\def\math_choosemathbig_math#1#2% so we accept \big{||} as well - {\math_fenced_force_size\bigmathdelimitervariant{#1}\relax + {\begingroup + \edef\p_size{#1}% \Uvextensible \s!axis \s!exact + \math_fenced_set_variant #2% \relax - \c_attr_mathsize\attributeunsetvalue} + \endgroup} \protected\def\math_choosemathbig_text#1#2% so we accept \big{||} as well {\naturalhbox\bgroup @@ -1005,14 +1044,12 @@ \egroup} \permanent\protected\def\mathdelimiterstep#1#2% not used, only in example - {\begingroup - \math_fenced_force_size\plusone{#1}% - \Uvextensible + {\Uvextensible \s!axis \s!exact + \s!variant\numexpr#1\relax % always from original sizes not lfg #2% - \relax - \endgroup} + \relax} \definemathcommand [big] {\choosemathbig1} \definemathcommand [Big] {\choosemathbig2} @@ -1074,13 +1111,13 @@ \permanent\protected\def\enableautofences {\clf_enableautofences - \setfalse\c_math_fences_auto + \c_math_fences_auto\conditionalfalse \glet\clf_enableautofences\relax % onlyonce anyway - \enforced\permanent\protected\gdef\enableautofences{\settrue\c_math_fences_auto}% + \enforced\permanent\protected\gdef\enableautofences{\c_math_fences_auto\conditionaltrue}% \enableautofences} \permanent\protected\def\disableautofences - {\setfalse\c_math_fences_auto} + {\c_math_fences_auto\conditionalfalse} \permanent\protected\def\math_fences_used_left {\ifconditional\c_math_fences_auto @@ -1172,7 +1209,7 @@ \s!yoffset -.1\exheight \s!target \registeredboxanchor \s!to \zeropoint - {\darkblue\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting}\hss}% + {\darkblue\hss\mathindexfont\ruledhbox{\the\c_math_fence_nesting}\hss}% \endlocalcontrol \s!source \registeredboxanchor } @@ -1189,7 +1226,7 @@ % \s!yoffset -.1\exheight % \s!target \registeredboxanchor % \s!to \zeropoint -% {\darkblue\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting B}\hss}% +% {\darkblue\hss\mathindexfont\ruledhbox{\the\c_math_fence_nesting B}\hss}% % \registeranchorbox % \registeredboxanchor % \plusone @@ -1198,7 +1235,7 @@ % \s!yoffset .1\exheight % \s!target \registeredboxanchor % \s!to \zeropoint -% {\darkgreen\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting T}\hss}% +% {\darkgreen\hss\mathindexfont\ruledhbox{\the\c_math_fence_nesting T}\hss}% % \registeranchorbox % \registeredboxanchor % \plusone @@ -1207,7 +1244,7 @@ % \s!xoffset -.1\emwidth % \s!target \registeredboxanchor % \s!to \zeropoint -% {\darkred\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting L}}% +% {\darkred\hss\mathindexfont\ruledhbox{\the\c_math_fence_nesting L}}% % \registeranchorbox % \registeredboxanchor % \plusone @@ -1216,7 +1253,7 @@ % \s!xoffset .1\emwidth % \s!target \registeredboxanchor % \s!to \zeropoint -% {\darkyellow\mathindexfont\ruledhbox{\number\c_math_fence_nesting R}\hss}% +% {\darkyellow\mathindexfont\ruledhbox{\the\c_math_fence_nesting R}\hss}% % \endlocalcontrol % \s!source \registeredboxanchor % } @@ -1258,4 +1295,13 @@ \definemathfence [tuparrow] [\v!text][\c!middle="2191] \definemathfence [tdownarrow] [\v!text][\c!middle="2193] +% A few meaningful definitions +\definemathfence [abs] [bar] [define=yes] +\definemathfence [innerproduct][angle] [define=yes,middle=`|] +\definemathfence [integerpart] [bracket] [define=yes] +\definemathfence [norm] [doublebar] [define=yes] +\definemathfence [set] [brace] [define=yes,middle=`|] +\definemathfence [sequence] [parenthesis][define=yes] +\definemathfence [tuple] [parenthesis][define=yes] + \protect diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt index 87dfe16e52a..c7865d90be5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt @@ -6,6 +6,9 @@ if not modules then modules = { } end modules ['math-fnt'] = { license = "see context related readme files" } +-- It is a pitty that we don't have a unicode character that can be used but that never +-- gets copied when we cut and paste. Not all pdf viewers ignore 0xFFFD for instance. + local round = math.round local setmetatableindex = table.setmetatableindex @@ -14,7 +17,7 @@ local tonut = nodes.tonut local tonode = nodes.tonode local nodepool = nuts.pool -local vlist_code = nodes.nodecodes.vlist +local vlist_code = nodes.nodecodes.vlist local new_hlist = nodepool.hlist local new_vlist = nodepool.vlist @@ -56,53 +59,61 @@ end) local enabled = "vertical" directives.register("math.extensibles", function(v) enabled = v end) -- default per 2022-08-25 -local function register_extensible(font,char,style,box) +local function register_extensible(font,char,style,att,box) if enabled then -- We don't share (yet)! local fontdata = chardata[font] local oldchar = fontdata[char] if oldchar and not oldchar.keepvirtual then -if enabled == true or enabled == "both" or oldchar.partsorientation == enabled then - -- we're okay -else - return + if enabled == true or enabled == "both" or oldchar.partsorientation == enabled then + -- we're okay + else + return + end +if not box then -- pending build bot + box = att end local bx = tonut(box) -- actually we don't want colors and such so if we do finalize we - -- should be more selctive: + -- should be more selective: -- updaters.apply("tagging.state.disable") -- nodes.handlers.finalizelist(bx) -- updaters.apply("tagging.state.enable") +-- updaters.apply("tagging.state.disable") local id = getid(bx) - local al = getattrlst(bx) +if not att then -- pending build bot + att = getattrlst(box) +end + local al = tonut(att) local wd, ht, dp = getwhd(bx) - local unicode = oldchar.unicode or char - -- we cannot have self referencing t3 fonts + local unicode = oldchar.unicode or char + -- we cannot have self referencing t3 fonts .. see devirtualize code local oldcommands = oldchar.oldcommands local newcommands = oldchar.commands if oldcommands then oldchar.commands = oldcommands end - -- + -- these need to be applied here local p = fonts.hashes.parameters[font] - local sx = round(1000/p.extendfactor) - local sy = round(1000/p.squeezefactor) - -- we saved a scaled glyph stream so we now use an unscaled one ... horrible hack: - if sx ~= 1000 then - wd = wd * 7200/7227 - end - if sy ~= 1000 then - ht = ht * 7200/7227 - dp = dp * 7200/7227 - end + local sx = round(1000/(p.extendfactor or 1)) or 1000 + local sy = round(1000/(p.squeezefactor or 1)) or 1000 +-- -- we saved a scaled glyph stream so we now use an unscaled one ... horrible hack: +-- if sx ~= 1000 then +-- wd = wd * 7200/7227 +-- end +-- if sy ~= 1000 then +-- ht = ht * 7200/7227 +-- dp = dp * 7200/7227 +-- end -- - -- local private = fonts.helpers.setboxdirectly(font,unicode,box) + -- local private = fonts.helpers.setboxdirectly(font,unicode,box) -- maybe cache in setboxdirectly local private = cache[wd][ht][dp][font][unicode] if not private then - private = fonts.helpers.setboxdirectly(font,unicode,box) + private = fonts.helpers.setboxdirectly(font,unicode,box,true) -- expose=true so we get color cache[wd][ht][dp][font][unicode] = private end local glyph = new_glyph(font,private,al) + setattrlst(glyph,al) nuts.setscales(glyph,1000,sx,sy) -- -- if fonts.hashes.properties[font].compactmath then @@ -123,7 +134,7 @@ end -- height = ht, -- depth = dp, -- } - -- local p = oldchar.vparts + -- local p = oldchar.parts -- if p then -- local first = fontdata[p[#p].glyph] -- local last = fontdata[p[ 1].glyph] diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl index 7e6f7c5ce4d..8e3e86e0cef 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl @@ -83,11 +83,14 @@ % color only applies to rule, use regular color for rest +\integerdef\math_frac_no_delim "2E % or just \zerocount + \setupmathfractions [\c!mathstyle=, \c!method=\v!vertical, \c!mathnumeratorstyle=\mathfractionparameter\c!mathstyle, \c!mathdenominatorstyle=\mathfractionparameter\c!mathstyle, + \c!mathmeaning=\currentglobalmathfraction, \c!mathclass=\mathfractioncode, \c!alternative=\v!inner, \c!margin=\zeropoint, @@ -127,7 +130,7 @@ % why only displaystyle .. a bit weak .. will become a set \protected\def\math_fraction_set_distance_top - {\Umathfractionnumup \displaystyle\m_math_fraction_distance_top + {\Umathfractionnumup\displaystyle\m_math_fraction_distance_top \relax} \protected\def\math_fraction_set_distance_bot @@ -207,7 +210,7 @@ \installlocalcurrenthandler\??mathfractions {mathfraction} -\tolerant\protected\def\math_frac#1#*[#2]%% +\tolerant\protected\def\math_frac#1#*[#S#2]%% {\beginmathgroup % \setlocalmathfractioncurrent{#1}% \edef\currentmathfraction{#1}% @@ -215,6 +218,7 @@ \ifparameter#2\or\setupcurrentmathfraction[#2]\fi % \edef\p_math_fraction_fences{\mathfractionparameter\c!fences}% + \dostarttagged\t!mfractionstack{\mathfractionparameter\c!mathmeaning}% % \math_atom_by_parameter\mathfractionparameter\bgroup \ifempty\p_math_fraction_fences \else @@ -235,17 +239,20 @@ \math_frac_no_strut \fi % + % This only adds a level of structure so that we don't get the everthing tagged + % fractionstack. + \dostarttagged\t!mfraction\currentglobalmathfraction \expandnamespaceparameter\??mathfractionalternative\mathfractionparameter\c!alternative\v!inner} \protected\def\math_frac_wrapup {\ifempty\p_math_fraction_fences \else \math_fenced_fenced_stop\p_math_fraction_fences \fi + \dostoptagged \egroup + \dostoptagged \endmathgroup} -\integerdef\math_frac_no_delim "2E % or just \zerocount - % Having a \withmarginornot{#1}{#2} makes not much sense nor do 4 tests or 4 redundant % kerns (longer node lists plus possible interference). A split in normal and margin % also makes testing easier. When left and right margins are needed we might merge the @@ -259,48 +266,60 @@ % timestamp: 01/2022 : (re)watching eNerd⁴ - Time Capsule 2020 a.k.a. Farewell Party % for Normalcy (UHD) with the soekris/neumanns combination +% Todo: \Umathfrac for all of them as we're keyword driven anyway. + \installcorenamespace{fractionmethods} \defcsname\??fractionmethods\v!vertical \v!no \v!none\endcsname{\Uatop} \defcsname\??fractionmethods\v!vertical \v!no \endcsname{\Uatopwithdelims - \Udelimiter\zerocount\fam\scratchcounterone - \Udelimiter\zerocount\fam\scratchcountertwo} + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo} \defcsname\??fractionmethods\v!vertical \v!yes \v!none\endcsname{\Uabove} \defcsname\??fractionmethods\v!vertical \v!yes \endcsname{\Uabovewithdelims - \Udelimiter\zerocount\fam\scratchcounterone - \Udelimiter\zerocount\fam\scratchcountertwo} + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo} \defcsname\??fractionmethods\v!vertical \v!hidden \v!none\endcsname{\Uabove} \defcsname\??fractionmethods\v!vertical \v!hidden \endcsname{\Uabovewithdelims - \Udelimiter\zerocount\fam\scratchcounterone - \Udelimiter\zerocount\fam\scratchcountertwo} + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo} \defcsname\??fractionmethods\v!vertical \v!auto \v!none\endcsname{\Uover} \defcsname\??fractionmethods\v!vertical \v!auto \endcsname{\Uoverwithdelims - \Udelimiter\zerocount\fam\scratchcounterone - \Udelimiter\zerocount\fam\scratchcountertwo} + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo} \defcsname\??fractionmethods\v!vertical \v!symbol \v!none\endcsname{\Ustretched - \Udelimiter\zerocount\fam\scratchcounterthree} + \Umathchar\zerocount\fam\scratchcounterthree} \defcsname\??fractionmethods\v!vertical \v!symbol \endcsname{\Ustretchedwithdelims - \Udelimiter\zerocount\fam\scratchcounterone - \Udelimiter\zerocount\fam\scratchcountertwo - \Udelimiter\zerocount\fam\scratchcounterthree} + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo + \Umathchar\zerocount\fam\scratchcounterthree} \defcsname\??fractionmethods\v!horizontal \v!none\endcsname{\Uskewed - \Udelimiter\zerocount\fam\scratchcounterthree + \Umathchar\zerocount\fam\scratchcounterthree \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax} \defcsname\??fractionmethods\v!horizontal \endcsname{\Uskewedwithdelims - \Udelimiter\zerocount\fam\scratchcounterone - \Udelimiter\zerocount\fam\scratchcountertwo - \Udelimiter\zerocount\fam\scratchcounterthree + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo + \Umathchar\zerocount\fam\scratchcounterthree \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax} \defcsname\??fractionmethods\v!line \v!none\endcsname{\Uskewed - \Udelimiter\zerocount\fam\scratchcounterthree + \Umathchar\zerocount\fam\scratchcounterthree \s!noaxis \space \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax} \defcsname\??fractionmethods\v!line \endcsname{\Uskewedwithdelims - \Udelimiter\zerocount\fam\scratchcounterone - \Udelimiter\zerocount\fam\scratchcountertwo - \Udelimiter\zerocount\fam\scratchcounterthree + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo + \Umathchar\zerocount\fam\scratchcounterthree \s!noaxis \space \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax} +\defcsname\??fractionmethods\v!center \v!none\endcsname{\Uskewed + \Umathchar\zerocount\fam\scratchcounterthree + \s!noaxis \space \s!center + \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax} +\defcsname\??fractionmethods\v!center \endcsname{\Uskewedwithdelims + \Umathchar\zerocount\fam\scratchcounterone + \Umathchar\zerocount\fam\scratchcountertwo + \Umathchar\zerocount\fam\scratchcounterthree + \s!noaxis \space \s!center + \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax} \setupmathfractions % we now inherit ! [\c!topcolor=\mathfractionparameter\c!color, @@ -318,6 +337,8 @@ \mathfractionparameter\c!middle \orelse\ifx\p_method\v!line \mathfractionparameter\c!middle + \orelse\ifx\p_method\v!center + \mathfractionparameter\c!middle \else \mathfractionparameter\c!symbol \fi @@ -327,6 +348,7 @@ \p_method \ifx\p_method\v!horizontal \orelse\ifx\p_method\v!line + \orelse\ifx\p_method\v!center \orelse\ifcsname\??fractionmethods\p_method\p_rule\endcsname % \v!vertical \p_rule \else @@ -490,15 +512,15 @@ \def\math_fraction_set_threshold_display_auto {\Umathfractiondelsize\alldisplaystyles\maxdimen} -\def\math_fraction_set_threshold_inline_ratio +\def\math_fraction_set_threshold_inline_ratio % watch the reverse compensation {\edef\p_threshold{\mathfractionparameter\c!inlinethreshold}% - \Umathfractiondelsize\alltextstyles \p_threshold\dimexpr\textface\relax - \Umathfractiondelsize\allscriptstyles \p_threshold\dimexpr\scriptface\relax - \Umathfractiondelsize\allscriptscriptstyles\p_threshold\dimexpr\scriptscriptface\relax} + \Umathfractiondelsize\alltextstyles \p_threshold\glyphscaled\textface + \Umathfractiondelsize\allscriptstyles \p_threshold\glyphscaled\scriptface + \Umathfractiondelsize\allscriptscriptstyles\p_threshold\glyphscaled\scriptscriptface} -\def\math_fraction_set_threshold_display_ratio +\def\math_fraction_set_threshold_display_ratio % watch the reverse compensation {\edef\p_threshold{\mathfractionparameter\c!displaythreshold}% - \Umathfractiondelsize\alldisplaystyles\p_threshold\dimexpr\textface\relax} + \Umathfractiondelsize\alldisplaystyles\p_threshold\glyphscaled\textface} \setupmathfractions [\c!inlinethreshold=1.2, % no unit but fraction @@ -558,58 +580,19 @@ %D \ShowMathFractions{1}{b}\par %D \blank -% % There is no real need to support ams styling so this is now obsolete: +%D There is no real need to support ams styling any longer so we removed the +%D related code. \permanent\protected\def\frac {\csname\inlineordisplaymath id:frac\endcsname} \permanent\protected\def\tfrac{\csname\inlineordisplaymath id:tfrac\endcsname} \permanent\protected\def\sfrac{\csname\inlineordisplaymath id:sfrac\endcsname} \permanent\protected\def\dfrac{\csname\inlineordisplaymath id:dfrac\endcsname} -% \definemathfraction[ams] [\c!strut=\v!no,\c!alternative=\v!outer] -% \definemathfraction[i:ams:frac][ams][\c!mathstyle={\s!cramped,\s!text}] -% \definemathfraction[d:ams:frac][ams][\c!mathstyle={\s!cramped,\s!display}] -% -% \permanent\protected\def\ctxfrac{\csname\inlineordisplaymath id:frac\endcsname} -% \permanent\protected\def\amsfrac{\csname\inlineordisplaymath id:ams:frac\endcsname} -% -% \appendtoks -% \doifelse{\mathematicsparameter\c!fractions}{ams}% -% {\enforced\let\frac\amsfrac}% -% {\enforced\let\frac\ctxfrac}% -% \to \everysetupmathematics - -% % Also gone: -% -% \definemathfraction[ddfrac][\c!mathstyle=\s!display] -% \definemathfraction[ttfrac][\c!mathstyle=\s!text] -% \definemathfraction[ssfrac][\c!mathstyle=\s!script] -% -% \protected\def\binom #1#2{{\Ustack {{#1}\normalabovewithdelims()\zeropoint{#2}}}} -% \protected\def\dbinom#1#2{{\displaystyle{{#1}\normalabovewithdelims()\zeropoint{#2}}}} -% \protected\def\tbinom#1#2{{\textstyle {{#1}\normalabovewithdelims()\zeropoint{#2}}}} -% -% \definemathfraction -% [binom] -% [\c!alternative=\v!outer, -% \c!rule=\v!no, -% \c!left="28, -% \c!right="29, -% \c!mathstyle=\s!auto] -% -% \definemathfraction -% [dbinom] -% [binom] -% [\c!mathstyle=\s!display] -% -% \definemathfraction -% [tbinom] -% [binom] -% [\c!mathstyle=\s!text] - \definemathfraction [d:binom] [d:frac] [\c!rule=\v!no, + \c!mathmeaning=binom, % \c!mathstyle=\s!display, \c!left="28, \c!right="29] @@ -618,6 +601,7 @@ [i:binom] [i:frac] [\c!rule=\v!no, + \c!mathmeaning=binom, %\c!mathstyle=\s!text, \c!left="28, \c!right="29] @@ -716,12 +700,12 @@ \defcsname\??mathalignsimple\v!split:\v!flushleft\endcsname#1% {#1% - \ifchkdim\mathfractionparameter\c!distance\or\hskip\lastchkdim\fi + \ifchkdimension\mathfractionparameter\c!distance\or\hkern\lastchkdimension\fi \hfill} \defcsname\??mathalignsimple\v!split:\v!flushright\endcsname#1% {\hfill - \ifchkdim\mathfractionparameter\c!distance\or\hskip\lastchkdim\fi + \ifchkdimension\mathfractionparameter\c!distance\or\hkern\lastchkdimension\fi \mathatom \s!class \mathordcode \s!unroll {}% prevents +/- seen as sign, unroll prevents empty box #1} @@ -754,8 +738,14 @@ \definemathfraction [\s!vfrac] [\v!horizontal] - [\c!hfactor=20, - \c!vfactor=10] + [\c!hfactor=20, % quite small, as we have 1000 as default + \c!vfactor=10] % quite small, as we have 1000 as default + +\definemathfraction + [hfrac] + [\c!method=\v!center, + \c!hfactor=\zerocount, + \c!vfactor=\zerocount] %D And a cheat (for Mikael): @@ -806,87 +796,3 @@ \definemathfraction [Rightleftarrowtext] [relfraction] [\c!middle="27FA] \protect \endinput - -% I have no clue what \mthfrac and \mthsqrt are supposed to do but -% I guess that it can be done with tweaking luatex's math parameters. -% Otherwise I'll write something from scratch. - -% \def\math_stylebuilders_frac#1#2#3#4#5#6#7% -% {\begingroup -% \mathsurround\zeropoint -% \setbox0\hbox{$#1 #6$}% -% \setbox2\hbox{$#1 #7$}% -% \dimen0\wd\ifdim\wd2>\wd0 2\else 0\fi -% \setbox4\hbox to \dimen0{\leaders\hbox{#4}\hss#5}% -% \mathord{\vcenter{{\offinterlineskip -% \hbox to \dimen0{\hss\box0\hss}% -% \kern\ht4% -% \hbox to \dimen0{\hss\copy4\hss}% -% \kern\ht4% -% \hbox to \dimen0{\hss\box2\hss}}}}% -% \endgroup} -% -% \def\math_stylebuilders_sqrt#1#2#3#4#5% -% {\begingroup -% \mathsurround\zeropoint -% \setbox0\hbox{$#1 #5$}% -% \ht0\dimexpr1.05\ht0+\onepoint\relax -% \dp0\dimexpr1.05\dp0+\onepoint\relax -% \setbox4\hbox to \wd0{\mr#2\leaders\hbox{#3}\hfill#4}% -% \delimitershortfall\zeropoint -% \nulldelimiterspace\zeropoint -% \setbox2\hbox{$\left\delimiter"0270370 \vrule \s!height\ht0 \s!depth \dp0 \s!width\zeropoint\right.$}% is this the right code point? -% \mathord{\vcenter{\hbox{\copy2\rlap{\raise\dimexpr\ht2-\ht4\relax\copy4}\copy0}}}% -% \endgroup} -% -% \def\mthfrac#1#2#3#4#5{\mathchoice -% {\math_stylebuilders_frac\displaystyle \textface {#1}{#2}{#3}{#4}{#5}}% -% {\math_stylebuilders_frac\textstyle \textface {#1}{#2}{#3}{#4}{#5}}% -% {\math_stylebuilders_frac\scriptstyle \scriptface {#1}{#2}{#3}{#4}{#5}}% -% {\math_stylebuilders_frac\scriptscriptstyle\scriptscriptface{#1}{#2}{#3}{#4}{#5}}} -% -% \def\mthsqrt#1#2#3{\mathchoice -% {\math_stylebuilders_sqrt\displaystyle \textface{#1}{#2}{#3}}% -% {\math_stylebuilders_sqrt\textstyle \textface{#1}{#2}{#3}}% -% {\math_stylebuilders_sqrt\scriptstyle \textface{#1}{#2}{#3}}% -% {\math_stylebuilders_sqrt\scriptscriptstyle\textface{#1}{#2}{#3}}} - -% \protected\def\mthfrac#1#2#3{[mthfrac: #1 #2 #3]} -% \protected\def\mthsqrt#1#2#3{[mthsqrt: #1 #2 #3]} - -% used for prototyping \Uskewed -% -% \protected\def\skewedfractiona#1#2{% -% \raise -% \Umathskewedfractionvgap\textstyle -% \hbox\bgroup -% $\scriptstyle#1\hskip\dimexpr\Umathskewedfractionhgap\scriptstyle/2\relax$% -% \egroup -% \hbox to \zeropoint\bgroup -% \hss$\textstyle/$\hss -% \egroup -% \lower -% \Umathskewedfractionvgap\textstyle -% \hbox\bgroup -% $\hskip\dimexpr\Umathskewedfractionhgap\scriptstyle/2\relax\scriptstyle#2$% -% \egroup -% } -% -% \protected\def\skewedfractionb#1#2{% -% \raise -% \Umathskewedfractionvgap\textstyle -% \hbox\bgroup -% $\scriptstyle#1\hskip\dimexpr\Umathskewedfractionhgap\textstyle/2\relax$% -% \egroup -% \hbox to \zeropoint\bgroup -% \hss$\textstyle/$\hss -% \egroup -% \lower -% \Umathskewedfractionvgapskewedfractionvgap\textstyle -% \hbox\bgroup -% $\hskip\dimexpr\Umathskewedfractionhgap\textstyle/2\relax\scriptstyle#2$% -% \egroup -% } -% -% $\skewedfractiona{1}{2}$ -% $\skewedfractionb{1}{2}$ diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl index e2a44217d3d..2bb7ae646bd 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl @@ -31,12 +31,12 @@ \permanent\protected\def\lxml_add_mml_blob#1#2% {\relax - \clf_xmlformulatobuffer\number\c_strc_formulas_n{temp-xml-export}% + \clf_xmlformulatobuffer\the\c_strc_formulas_n{temp-xml-export}% #2% [\c!symbol=#1,% \c!space=\v!yes,% \c!buffer=temp-xml-export,% - \c!name={formula-\number\c_strc_formulas_n.xml}]% + \c!name={formula-\the\c_strc_formulas_n.xml}]% \relax} \permanent\protected\def\xmlattachmml diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt index 904b98d790b..217dde9c545 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt @@ -27,7 +27,6 @@ local sortedhash = table.sortedhash local toboolean = toboolean local context = context -local commands = commands local implement = interfaces.implement local ctx_doifelsesomething = commands.doifelsesomething @@ -42,232 +41,20 @@ local mathematics = mathematics mathematics.extrabase = fonts.privateoffsets.mathextrabase -- here we push some virtuals mathematics.privatebase = fonts.privateoffsets.mathbase -- here we push the ex -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue + local allocate = utilities.storage.allocate local chardata = characters.data local texsetattribute = tex.setattribute local setmathcode = tex.setmathcode -local setdelcode = tex.setdelcode +----- setdelcode = tex.setdelcode -- we no longer set these as the engine also accepts otherwise local texintegerdef = tex.integerdef -setdelcode = function() end - --- This is relatively new and experimental: - -do +local getfontoffamily = tex.getfontoffamily - local dictionaries = mathematics.dictionaries or { } - mathematics.dictionaries = dictionaries - - local names = dictionaries.names or utilities.storage.allocate() - local groups = dictionaries.groups or utilities.storage.allocate() - local data = dictionaries.data or utilities.storage.allocate() - local sets = dictionaries.sets or utilities.storage.allocate() - local variants = dictionaries.variants or utilities.storage.allocate() -- todo: get from char-def - local defaults = dictionaries.defaults or utilities.storage.allocate() -- todo: get from char-def - - storage.register("mathematics/dictionaries/names", names, "mathematics.dictionaries.names") - storage.register("mathematics/dictionaries/groups", groups, "mathematics.dictionaries.groups") - storage.register("mathematics/dictionaries/data", data, "mathematics.dictionaries.data") - storage.register("mathematics/dictionaries/sets", sets, "mathematics.dictionaries.sets") - storage.register("mathematics/dictionaries/variants", variants, "mathematics.dictionaries.variants") - storage.register("mathematics/dictionaries/defaults", defaults, "mathematics.dictionaries.defaults") - - dictionaries.names = dictionaries.names or names - dictionaries.groups = dictionaries.groups or groups - dictionaries.data = dictionaries.data or data - dictionaries.sets = dictionaries.sets or sets - dictionaries.variants = dictionaries.variants or variants - dictionaries.defaults = dictionaries.defaults or defaults - - if not sets.n then - sets.n = 0 - end - - function dictionaries.registergroup(name) - local group = rawget(names,name) - if not group then - group = #groups + 1 - names[name] = group - names[group] = group - groups[group] = name - data[group] = { } - local csname = "math" .. nospaces(name) .. "dictionary" - texintegerdef(csname,group,"immutable") - end - return group - end - - function dictionaries.registergroupset(name,set) - local s = sets[name] - if not s then - local d = dictionaries.registergroup(name) - local n = sets.n + 1 - local l = utilities.parsers.settings_to_array(set) - local g = { } - for i=1,#l do - local n = names[l[i]] - if n then - g[#g+1] = n -- ordered - end - end - s = { - names = l, - groups = g, - group = d, - } - sets[name] = s - sets[d] = s - - end - end - - function dictionaries.groupset(name) - return sets[name] or { } - end - - function dictionaries.groupsetgroup(name) - local s = sets[name] - if s then - return s.group - else - return names[name] or 0 - end - end - - function dictionaries.registercharacter(group,index,description,class) - local d = names[group] -- can be number or string - if d then - data[d][index] = description or true - local v = variants[index] - if not class then - class = true - end - if v then - v[d] = class - else - variants[index] = { [d] = class} - end - if not defaults[index] then - defaults[index] = d - end - end - end - - implement { - name = "registergroupset", - arguments = "2 strings", - actions = dictionaries.registergroupset, - } - - implement { - name = "groupsetgroup", - arguments = "string", - actions = { dictionaries.groupsetgroup, context }, - } - - local fontchardata = fonts.hashes.characters - local f_dictionary = false - local whatdetail = "all" - - local function trace(n,properties,group,index,font,char) - -- local properties, group, index, font, char = nodes.nuts.getchardict(nodes.nuts.tonut(n)) - if whatdetail and (properties ~= 0 or group ~= 0 or index ~= 0) then - local char = fontchardata[font][char] - if char or whatdetail == "all" then - local unicode = char and char.unicode - if unicode then - local groupname = groups[group] - local indexname = false - if groupname then - indexname = data[group][index] -- dictionaries.data - else - groupname = "unknown" - end - if not indexname or indexname == true then - indexname = chardata[unicode] - indexname = indexname and indexname.description or "unknown" - end - if not f_dictionary then - f_dictionary = formatters["properties [%04X:%04X:%04X] [%s] %U : %s"] - end - return f_dictionary(properties,group,index,groupname,unicode,indexname) - end - end - end - end - - trackers.register("math.dictionaries",function(v) whatdetail = v end) - - callbacks.register("get_math_dictionary",trace,"provide math dictionary details") - - -- This is experimental and a prelude to the long pending "relate math rendering to - -- some field" wish. In TeX characters and symbols are grouped by class but that is - -- mostly related to spacing etc. while we actually want to group by meaning. A - -- reasonable but incomplete starting point is: - -- - -- https://www.w3.org/TR/MathML3/appendixa.html#parsing_DefEncAtt - -- - -- But it has some weird short names mixed with long ones (and a strange suddenly - -- uppercase: Differential-Operator) but we are not bound to that at all. We will - -- probably remove and add categories anyway. This openmath stuff looks a bit - -- abandoned but we can use it as a start and playground anyway. - -- - -- The char-def.lua file will have mathgroup entries reflecting this. - -- - -- This is a good one (with nice roll-overs too): - -- - -- https://en.wikipedia.org/wiki/List_of_mathematical_symbols_by_subject - - if environment.initex then - - local registergroup = mathematics.dictionaries.registergroup - - registergroup("default") - registergroup("binary arithmetic") - registergroup("binary linear algebra") - registergroup("binary logical") - registergroup("binary relation") - registergroup("binary set") - registergroup("constant arithmetic") - registergroup("constant set") - registergroup("differential") - registergroup("integral") - registergroup("interval") - registergroup("lambda") - registergroup("limit") - registergroup("nary arithmetic") - registergroup("nary constructor") - registergroup("nary functional") - registergroup("nary linear algebra") - registergroup("nary logical") - registergroup("nary minmax") - registergroup("nary relation") - registergroup("nary set list") - registergroup("nary set relation") - registergroup("nary set") - registergroup("nary statistics") - registergroup("partial") -- partial differential - registergroup("product") - registergroup("quantifier") - registergroup("unary arithmetic") - registergroup("unary elementary") - registergroup("unary functional") - registergroup("unary linear algebra") - registergroup("unary logical") - registergroup("unary set") - registergroup("unary vector") - - end - - -- \Umathdictdef\vdash 1 \mathbinarylogicaldictionary "22A2 \mathrelationcode 0 "22A2 - -- - -- \startluacode - -- mathematics.dictionaries.registercharacter("binary logical",0x22A2,"implies") - -- \stopluacode - -end +local fontdata = fonts.hashes.identifiers +local fontchardata = fonts.hashes.characters -- These are different from mkiv with luatex. @@ -295,6 +82,7 @@ local binary_class = classes.binary local relation_class = classes.relation local open_class = classes.open local close_class = classes.close +local variable_class = classes.variable local punctuation_class = classes.punctuation local middle_class = classes.middle local accent_class = classes.accent @@ -330,6 +118,8 @@ classes.largeoperator = operator_class -- special in the engine : variable active inner vcenter +local glyphcodes = nodes.glyphcodes + local function registerengineclass(name,short) local class = classes[name] if not class then @@ -345,6 +135,9 @@ local function registerengineclass(name,short) end classes[class] = name classes[name] = class + local subtype = class + 31 -- todo magic constant + glyphcodes[subtype] = name + glyphcodes[name] = subtype return class end @@ -376,10 +169,10 @@ registerengineclass("explicit", "xpl") registerengineclass("imaginary", "img") registerengineclass("differential", "dif") registerengineclass("exponential", "exp") +registerengineclass("integral", "int") registerengineclass("ellipsis", "ell") registerengineclass("function", "fnc") -registerengineclass("digit", "dig") -local division_class = +registerengineclass("digit", "dig") local division_class = registerengineclass("division", "div") registerengineclass("factorial", "fac") registerengineclass("wrapped", "wra") @@ -396,6 +189,11 @@ registerengineclass("maybeordinary", "mor") registerengineclass("mayberelation", "mre") registerengineclass("maybebinary", "mbi") +registerengineclass("chemicalbond", "chb") +registerengineclass("implication", "imp") + +registerengineclass("continuation", "ctn") + local specialclasses = tex.specialmathclasscodes classes["all"] = specialclasses["all"] classnames[specialclasses["all"] ] = "all" @@ -404,6 +202,8 @@ classes["end"] = specialclasses["end"] classnames[specialclasses["end"] ] callbacks.register("get_noad_class", function(n) return classnames[n] end,"provide math class name") +-- inspect(classes) os.exit() + local function registerprivateclass(name,parent) local class = parent and classes[parent] or classes[name] if not class then @@ -437,7 +237,7 @@ local topaccent_class = registerprivateclass("topaccent") local bottomaccent_class = registerprivateclass("bottomaccent") local delimiter_class = registerprivateclass("delimiter") local root_class = registerprivateclass("root") -local prime_class = registerprivateclass("prime") +----- prime_class = registerprivateclass("prime") registerprivateclass("botaccent","bottomaccent") @@ -451,7 +251,7 @@ local accents = allocate { unknown = false, } -local integer_value = tokens.values.integer +local integer_value = tokens.values.integer implement { name = "mathclassvalue", @@ -468,6 +268,7 @@ implement { -- mathml local codes = allocate { + variable = variable_class, [variable_class] = "variable", ordinary = ordinary_class, [ordinary_class] = "ordinary", largeoperator = operator_class, [operator_class] = "largeoperator", binaryoperator = binary_class, [binary_class] = "binaryoperator", @@ -526,6 +327,298 @@ mathematics.codes = codes -----------.accents = codes mathematics.virtualized = virtualized +-- This is relatively new and experimental: + +do + + local dictionaries = mathematics.dictionaries or { } + mathematics.dictionaries = dictionaries + + local names = dictionaries.names or utilities.storage.allocate() + local groups = dictionaries.groups or utilities.storage.allocate() + local data = dictionaries.data or utilities.storage.allocate() + local sets = dictionaries.sets or utilities.storage.allocate() + local variants = dictionaries.variants or utilities.storage.allocate() -- todo: get from char-def + local defaults = dictionaries.defaults or utilities.storage.allocate() -- todo: get from char-def + + storage.register("mathematics/dictionaries/names", names, "mathematics.dictionaries.names") + storage.register("mathematics/dictionaries/groups", groups, "mathematics.dictionaries.groups") + storage.register("mathematics/dictionaries/data", data, "mathematics.dictionaries.data") + storage.register("mathematics/dictionaries/sets", sets, "mathematics.dictionaries.sets") + storage.register("mathematics/dictionaries/variants", variants, "mathematics.dictionaries.variants") + storage.register("mathematics/dictionaries/defaults", defaults, "mathematics.dictionaries.defaults") + + dictionaries.names = dictionaries.names or names + dictionaries.groups = dictionaries.groups or groups + dictionaries.data = dictionaries.data or data + dictionaries.sets = dictionaries.sets or sets + dictionaries.variants = dictionaries.variants or variants + dictionaries.defaults = dictionaries.defaults or defaults + + local i_everygroup = 0xFFFF + local s_everygroup = "everygroup" + + names [s_everygroup] = i_everygroup + names [i_everygroup] = i_everygroup + groups[i_everygroup] = s_everygroup + data [i_everygroup] = { } + + if not sets.n then + sets.n = 0 + end + + function dictionaries.registergroup(name) + local group = rawget(names,name) + if not group then + group = #groups + 1 + names[name] = group + names[group] = group -- hm + groups[group] = name + data[group] = { } + local csname = "math" .. nospaces(name) .. "dictionary" + texintegerdef(csname,group,"immutable") + end + return group + end + + function dictionaries.registergroupset(name,set) + local s = sets[name] + if not s then + if set == "every" then + s = { + group = i_everygroup, + } + sets[name] = s + else + local d = dictionaries.registergroup(name) + local n = sets.n + 1 + local l = utilities.parsers.settings_to_array(set) + local g = { } + for i=1,#l do + local n = names[l[i]] + if n then + g[#g+1] = n -- ordered + end + end + s = { + names = l, + groups = g, + group = d, + } + sets[name] = s + sets[d] = s + end + end + end + + -- TODO: check 'minus' as it reports true + + function dictionaries.groupset(name) + return sets[name] or { } + end + + function dictionaries.groupsetgroup(name) + if name == "every" or name == s_everygroup then + return i_everygroup + else + local s = sets[name] + if s then + return s.group + else + return names[name] or 0 + end + end + end + + function dictionaries.registercharacter(group,index,description,class,name) -- name is diagnostic + local d = names[group] -- can be number or string + if d then + data[d][index] = description or true + local v = variants[index] + if type(class) == "string" then + class = classes[class] + end + if not class then + class = true + end + if v then + v[d] = class + else + variants[index] = { [d] = class } + end + if not defaults[index] then + defaults[index] = d + end + end +-- print(group,index,description,class,name) + end + + function dictionaries.name(group,index) -- number, number + group = names[group] or i_everygroup + if group == i_everygroup then + for i=1,#groups do + local d = data[i] + local n = d[index] + if type(n) == "string" then + return n + end + end + elseif group then + local d = data[group] + if d then + local n = d[index] + if type(n) == "string" then + return n + end + end + local s = sets[group] + if s then + local g = s.groups + for i=1,#g do + d = data[g[i]] + local n = d[index] + if type(n) == "string" then + return n + end + end + end + end + return false + end + + implement { + name = "registergroupset", + arguments = "2 strings", + actions = dictionaries.registergroupset, + } + + implement { + name = "groupsetgroup", + arguments = "string", + actions = { dictionaries.groupsetgroup, context }, + } + + local f_dictionary = false + local whatdetail = "all" + + local function trace(n,properties,group,index,font,char) + -- local properties, group, index, font, char = nodes.nuts.getchardict(nodes.nuts.tonut(n)) + if whatdetail and (properties ~= 0 or group ~= 0 or index ~= 0) then + local char = fontchardata[font][char] + if char or whatdetail == "all" then + local unicode = char and char.unicode + if unicode then + local groupname = groups[group] + local indexname = false + if groupname then + indexname = data[group][index] -- dictionaries.data + else + groupname = "unknown" + end + if not indexname or indexname == true then + indexname = chardata[unicode] + indexname = indexname and indexname.description or "unknown" + end + if not f_dictionary then + f_dictionary = formatters["properties [%04X:%04X:%04X] [%s] %U : %s"] + end + return f_dictionary(properties,group,index,groupname,unicode,indexname) + end + end + end + end + + trackers.register("math.dictionaries",function(v) whatdetail = v end) + + callbacks.register("get_math_dictionary",trace,"provide math dictionary details") + + -- This is experimental and a prelude to the long pending "relate math rendering to + -- some field" wish. In TeX characters and symbols are grouped by class but that is + -- mostly related to spacing etc. while we actually want to group by meaning. A + -- reasonable but incomplete starting point is: + -- + -- https://www.w3.org/TR/MathML3/appendixa.html#parsing_DefEncAtt + -- + -- But it has some weird short names mixed with long ones (and a strange suddenly + -- uppercase: Differential-Operator) but we are not bound to that at all. We will + -- probably remove and add categories anyway. This openmath stuff looks a bit + -- abandoned but we can use it as a start and playground anyway. + -- + -- The char-def.lua file will have mathgroup entries reflecting this. + -- + -- This is a good one (with nice roll-overs too): + -- + -- https://en.wikipedia.org/wiki/List_of_mathematical_symbols_by_subject + + if environment.initex then + + local registergroup = mathematics.dictionaries.registergroup + + registergroup("default") + + registergroup("binary relation") + registergroup("binary set relation") + registergroup("integral") + registergroup("limit") + registergroup("number set") + registergroup("postfix operator") + registergroup("prime") + registergroup("binary operator") + registergroup("binary vector") + registergroup("binary arithmetic") -- operator + registergroup("binary logical") + registergroup("binary set") + registergroup("constant arithmetic") + registergroup("constant set") + registergroup("differential") + registergroup("differential2") + registergroup("factorial") + registergroup("interval") + registergroup("quantifier") + registergroup("unary set") -- check forall exists etc + registergroup("constant logical") -- new one + registergroup("partial") -- partial differential + registergroup("nary operator") -- new one + registergroup("nary logical") + registergroup("specifier") + registergroup("specifier2") + registergroup("pause") + registergroup("punctuation") + -- registergroup("grouped") + registergroup("unary logical") + registergroup("whatever") + registergroup("whatever2") + + -- registergroup("binary linear algebra") + -- registergroup("lambda") + -- registergroup("nary arithmetic") -- see operator + -- registergroup("nary constructor") + -- registergroup("nary functional") + -- registergroup("nary linear algebra") + -- registergroup("nary minmax") + -- registergroup("nary relation") + -- registergroup("nary set list") + -- registergroup("nary set relation") + -- registergroup("nary set") + -- registergroup("nary statistics") + -- registergroup("product") + -- registergroup("unary arithmetic") -- operator + -- registergroup("unary elementary") -- sin cos ln sqrt + -- registergroup("unary functional") + -- registergroup("unary linear algebra") + -- registergroup("unary logical") + -- registergroup("unary vector") + + end + + -- \Umathdictdef\vdash 1 \mathbinarylogicaldictionary "22A2 \mathrelationcode 0 "22A2 + -- + -- \startluacode + -- mathematics.dictionaries.registercharacter("binary logical",0x22A2,"implies") + -- \stopluacode + +end + do local skip = { @@ -541,24 +634,20 @@ do local registercharacter = mathematics.dictionaries.registercharacter local groupnames = mathematics.dictionaries.names - local setmathcharacter = function(class,family,slot,unicode,mset,dset,group) + local setmathcharacter = function(class,family,slot,unicode,mset,group,meaning) if mset and class ~= ordinary_class then setmathcode("global",slot,class,family,unicode) mset = false end - -- if dset and (class == open_class or class == close_class or class == middle_class or class == division_class) then - -- setdelcode("global",slot,family,unicode,0,0) - -- dset = false - -- end if group then group = groupnames[group] or 0 if group ~= 0 then -- which one - registercharacter(group,unicode,nil,class) - -- registercharacter(group,slot,nil,class) + registercharacter(group,unicode,meaning,class) + -- registercharacter(group,slot,meaning,class) end end - return mset, dset + return mset end local function report(class,family,unicode,name) @@ -574,27 +663,7 @@ do local texmathchardef = tex.mathchardef - -- local setmathsymbol = function(name,class,family,slot,stretch,group) -- hex is nicer for tracing - -- if skip[class] then - -- return -- only in mkiv - -- elseif class == open_class or class == close_class or class == middle_class then - -- setdelcode("global",slot,family,slot,0,0) -- can go - -- elseif class == delimiter_class then -- open close or middle (bars) - -- setdelcode("global",slot,family,slot,0,0) -- can go - -- class = 0 - -- else - -- if group then - -- group = groupnames[group] or 0 - -- if group ~= 0 then - -- texmathchardef(name,class,family,slot,"permanent",0x1,group,slot) - -- return - -- end - -- end - -- end - -- texmathchardef(name,class,family,slot,"permanent") - -- end - - local setmathsymbol = function(name,class,family,slot,stretch,group) -- hex is nicer for tracing + local setmathsymbol = function(name,class,family,slot,stretch,group,meaning) -- hex is nicer for tracing if skip[class] then return -- only in mkiv -- elseif class == open_class or class == close_class or class == middle_class then @@ -606,6 +675,12 @@ do group = groupnames[group] or 0 if group ~= 0 then texmathchardef(name,class,family,slot,"permanent",0x1,group,slot) + if group then + group = groupnames[group] or 0 + if group ~= 0 then + registercharacter(group,slot,meaning,class,name) + end + end return end end @@ -629,12 +704,17 @@ do remap("A","Z") remap("a","z") -- - setdelcode("global",0x2E,0,0,0,0) -- period is special + -- setdelcode("global",0x2E,0,0,0,0) -- period is special -- still? -- for unicode, character in sortedhash(data) do - local symbol = character.mathsymbol - local mset = true - local dset = true + local symbol = character.mathsymbol + local mset = true + local class = character.mathclass + local spec = character.mathspec + local name = character.mathname + local stretch = character.mathstretch + local group = character.mathgroup + local meaning = character.mathmeaning if symbol then local other = data[symbol] local class = other.mathclass @@ -643,7 +723,7 @@ do if trace_defining then report(engine,family,unicode,symbol) end - mset, dset = setmathcharacter(engine,family,unicode,symbol,mset,dset,group) + mset = setmathcharacter(engine,family,unicode,symbol,mset,group,meaning) end local spec = other.mathspec if spec then @@ -653,16 +733,11 @@ do if class then local engine = toengineclass(class) -- todo: trace - mset, dset = setmathcharacter(engine,family,unicode,symbol,mset,dset,group) + mset = setmathcharacter(engine,family,unicode,symbol,mset,group,meaning) end end end end - local class = character.mathclass - local spec = character.mathspec - local name = character.mathname - local stretch = character.mathstretch - local group = character.mathgroup if spec then local done = false if class then @@ -675,7 +750,7 @@ do if trace_defining then report(engine,family,unicode) end - mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group) + mset = setmathcharacter(engine,family,unicode,unicode,mset,group,meaning) done = true end end @@ -685,6 +760,7 @@ do local class = m.class or class local group = m.group or group local stretch = m.stretch or stretch + local meaning = m.meaning or meaning if class then class = classes[class] or ordinary_class else @@ -696,15 +772,15 @@ do if trace_defining then report(engine,family,unicode,name) end - setmathsymbol(name,engine,family,unicode,stretch,group) + setmathsymbol(name,engine,family,unicode,stretch,group,meaning) else - name = (class == classes.ordinary or class == classes.digit) and character.adobename -- bad + name = (class == classes.ordinary or class == classes.digit) and "no name" -- character.adobename -- bad if name and trace_defining then report(engine,family,unicode,name) end end if not done then - mset, dset = setmathcharacter(engine,family,unicode,m.unicode or unicode,mset,dset,group) -- see solidus + mset = setmathcharacter(engine,family,unicode,m.unicode or unicode,mset,group,meaning) -- see solidus done = true end end @@ -721,7 +797,7 @@ do if trace_defining then report(engine,family,unicode,name) end - mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group) + mset = setmathcharacter(engine,family,unicode,unicode,mset,group,meaning) else -- if not name then -- name = character.contextname -- too dangerous, we loose textslash and a few more @@ -730,20 +806,20 @@ do if trace_defining then report(engine,family,unicode,name) end - setmathsymbol(name,engine,family,unicode,stretch,group) + setmathsymbol(name,engine,family,unicode,stretch,group,meaning) else if trace_defining then - report(engine,family,unicode,character.adobename) + report(engine,family,unicode,"no name") -- character.adobename) end end - mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group) + mset = setmathcharacter(engine,family,unicode,unicode,mset,group,meaning) end elseif class ~= ordinary_class then local engine = toengineclass(class) if trace_defining then - report(engine,family,unicode,character.adobename) + report(engine,family,unicode,"no name") -- character.adobename) end - mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group) + mset = setmathcharacter(engine,family,unicode,unicode,mset,group,meaning) end end end @@ -785,7 +861,7 @@ do local function utfmathlimop(chr) local cd = somechar[chr] - return cd and cd.mathclass == "limop" or false + return cd and (cd.mathclass == "operator" or cd.mathclass == "integral") or false end local function utfmathaccent(chr,default,asked1,asked2) @@ -989,141 +1065,145 @@ do end --- helpers --- --- 1: step 1 --- 2: step 2 --- 3: htdp * 1.33^n --- 4: size * 1.33^n --- 5: use lfg - -function mathematics.big(tfmdata,unicode,n,method) - local t = tfmdata.characters - local c = t[unicode] - if c and n > 0 then - if method == 1 or method == 2 or method == 5 then - if method == 5 then - local b = tfmdata.bigslots - if b then - n = (n > #b and b[#b]) or b[n] or n - end - elseif method == 2 then -- large steps - n = n * 2 +do + + -- 1: step 1 + -- 2: step 2 + -- 3: htdp * 1.33^n + -- 4: size * 1.33^n + -- 5: use lfg + + implement { + name = "mathvariantslot", + public = true, + usage = "value", + arguments = "2 integers", + actions = function(fam,n) + local b = fontdata[getfontoffamily(fam)].bigslots + if b then + n = (n > #b and b[#b]) or b[n] or n end - local next = c.next - while next do - if n <= 1 then - return next - else - n = n - 1 - local tn = t[next].next - if tn then - next = tn - else - return next + return integer_value, n + end + } + + function mathematics.big(tfmdata,unicode,n,method) + local t = tfmdata.characters + local c = t[unicode] + if c and n > 0 then + if method == 1 or method == 2 or method == 5 then + if method == 5 then + local b = tfmdata.bigslots + if b then + n = (n > #b and b[#b]) or b[n] or n end + elseif method == 2 then -- large steps + n = n * 2 end - end - elseif method >= 3 then - local size = 1.33^n - if method == 4 then - size = tfmdata.parameters.size * size - else -- if method == 3 then - size = (c.height + c.depth) * size - end - local next = c.next - while next do - local cn = t[next] - if (cn.height + cn.depth) >= size then - return next - else - local tn = cn.next - if tn then - next = tn + local next = c.next + while next do + if n <= 1 then + return next else + n = n - 1 + local tn = t[next].next + if tn then + next = tn + else + return next + end + end + end + elseif method >= 3 then + local size = 1.33^n + if method == 4 then + size = tfmdata.parameters.size * size + else -- if method == 3 then + size = (c.height + c.depth) * size + end + local next = c.next + while next do + local cn = t[next] + if (cn.height + cn.depth) >= size then return next + else + local tn = cn.next + if tn then + next = tn + else + return next + end end end end end + return unicode end - return unicode -end -do -- experimental +end - -- local categories = { } -- indexed + hashed - -- - -- local a_mathcategory = attributes.private("mathcategory") - -- - -- local function registercategory(category,tag,data) -- always same data for tag - -- local c = categories[category] - -- if not c then - -- c = { } - -- categories[category] = c - -- end - -- local n = c[tag] - -- if not n then - -- n = #c + 1 - -- c[n] = data - -- n = n * 1000 + category - -- c[tag] = n - -- end - -- return n - -- end - -- - -- function mathematics.getcategory(n) - -- local category = n % 1000 - -- return category, categories[category][floor(n/1000)] - -- end - -- - -- mathematics.registercategory = registercategory - -- - -- function commands.taggedmathfunction(tag,label) - -- if label then - -- texsetattribute(a_mathcategory,registercategory(1,tag,tag)) - -- context.mathlabeltext(tag) - -- else - -- texsetattribute(a_mathcategory,1) - -- context(tag) - -- end - -- end +do -- experimental, not stored in the format local categories = { } mathematics.categories = categories - local a_mathcategory = attributes.private("mathcategory") + local a_mathcategory = attributes.private("mathcategory") + local a_mathstack = attributes.private("mathstack") local functions = storage.allocate() categories.functions = functions - local noffunctions = 1000 -- offset + local noffunctions = 0 + + local function identify(kind,tag,method) + local n = functions[tag] + if n then + n = n.index + else + n = noffunctions + 1 --- + local t = { + kind = kind, + tag = tag, + method = method, + index = n, + } + functions[n] = t + functions[tag] = t + noffunctions = n + end + return n + end implement { - name = "tagmfunctiontxt", - arguments = { "string", "conditional" }, - actions = function(tag,apply) - local delta = apply and 1000 or 0 - texsetattribute(a_mathcategory,1000 + delta) + name = "tagmfunctionlab", -- this one will be replaced by the next + arguments = { "integer", "string", "string" }, + actions = function(kind,tag,method) + texsetattribute(a_mathcategory,identify(kind,tag,method)) end } implement { - name = "tagmfunctionlab", - arguments = { "string", "conditional" }, - actions = function(tag,apply) - local delta = apply and 1000 or 0 - local n = functions[tag] - if not n then - noffunctions = noffunctions + 1 - functions[noffunctions] = tag - functions[tag] = noffunctions - texsetattribute(a_mathcategory,noffunctions + delta) - else - texsetattribute(a_mathcategory,n + delta) - end + name = "tagmfunctionlabattribute", + usage = "value", + arguments = { "integer", "string", "string" }, + actions = function(kind,tag,method) + return integer_value, identify(kind,tag,method) end } + function mathematics.functiontype(n) + local func = n and functions[n] + local kind = func and func.kind or 0 + if kind == 1 then + return "function" + elseif kind == 2 then + return "accent" + elseif kind == 3 then + return "fence" + else + return "unknown" + end + end + end do @@ -1160,3 +1240,79 @@ implement { onlyonce = true, actions = resolvers.macros.enablecomment, } + +implement { + name = "nofmathvariants", + public = true, + usage = "value", + arguments = "integer", + actions = function(n) + local char = fontchardata[getfontoffamily(0)] + local data = char[n] + local size = 1 + while data do + local next = data.next + if next then + size = size + 1 + data = char[next] + else + break + end + end + return integer_value, size + end, +} + +implement { + name = "getmathvariant", + public = true, + usage = "value", + arguments = "2 integers", + actions = function(m,n) + local char = fontchardata[getfontoffamily(0)] + local data = char[n] + local slot = n + if data then + while data and m > 1 do + local next = data.next + if next then + m = m - 1 + data = char[next] + slot = next + else + break + end + end + end + return integer_value, slot + end, +} + +implement { + name = "getmathcharone", + public = true, + usage = "value", + arguments = "integer", + actions = function(n) + local char = fontchardata[getfontoffamily(0)] + local data = char[n] + return integer_value, data and data.smaller or n + end, +} + +implement { + name = "getmathchartwo", + public = true, + usage = "value", + arguments = "integer", + actions = function(n) + local char = fontchardata[getfontoffamily(0)] + local data = char[n] + local slot = data and data.smaller + if slot then + data = char[slot] + n = slot + end + return integer_value, data and data.smaller or n + end, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl index f9b733d9cb2..3adc7caac5c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl @@ -13,6 +13,15 @@ \writestatus{loading}{ConTeXt Math Macros / Initializations} +% Needs checking: +% +% \Umathruleheight +% \Umathruledepth +% \Umathfractionnumup +% \Umathfractionnumdown +% \Umathfractiondelsize +% \Umathskeweddelimitertolerance + %D This is the \LMTX\ version of math support what evolved over decades. We started %D out with native display math, battled for years with the heuristic spacing, %D assumptions wrt number locations etc. Advanced alignments were implemented with @@ -55,16 +64,29 @@ \newdimension \mathstrutdp \newinteger \mathnestinglevel +\newcount \c_math_strc_hangafter +\newdimen \d_math_strc_hangindent + \newcount \c_strc_math_n_of_lines -\newdimension \d_strc_math_max_width -\newdimension \d_strc_math_first_width -\newdimension \d_strc_math_last_width + +\newdimension \d_strc_math_max_right +\newdimension \d_strc_math_first_right +\newdimension \d_strc_math_last_right + +\newdimension \d_strc_math_max_left +\newdimension \d_strc_math_first_left +\newdimension \d_strc_math_last_left + \newdimension \d_strc_math_first_height \newdimension \d_strc_math_last_depth + \newdimension \d_strc_math_display_width \newdimension \d_strc_math_indent \newconditional\c_strc_math_indent +\newinteger \currentmathblob +\newinteger \currentmathblobnesting % could be a primitive + \registerctxluafile{math-ini}{autosuffix} \registerctxluafile{math-dim}{autosuffix} %registerctxluafile{math-act}{autosuffix} @@ -81,6 +103,19 @@ \registerctxluafile{math-spa}{autosuffix} \registerctxluafile{math-fnt}{autosuffix} \registerctxluafile{math-pre}{autosuffix} +\registerctxluafile{math-txt}{autosuffix} + +%D Some neat units: + +\aliased\let\Umathemwidth\Umathquad + +\protected\def\mathaxisunit {\scaledmathaxis \mathstyle\norelax} +\protected\def\mathexheightunit{\scaledmathexheight\mathstyle\norelax} +\protected\def\mathquadunit {\scaledmathemwidth \mathstyle\norelax} + +\newuserunit \mathaxisunit ma +\newuserunit \mathexheightunit mx +\newuserunit \mathquadunit mq %D Basic spacing: @@ -89,6 +124,23 @@ \delimiterfactor \plusthousand \delimitershortfall \zeropoint +%D Low level only: + +% \fixedsuperorsubscriptsmodecode +% \fixedsuperandsubscriptsmodecode +% +% Needed for multiple scripts: +% +% \mathscriptsmode\ignoreemptyscriptsmodecode + +\integerdef\ignoreemptyscriptsmodecode\numexpr + \ignoreemptysuperscriptsmodecode + + \ignoreemptysubscriptsmodecode + + \ignoreemptyprimescriptsmodecode +\relax + +\mathscriptsmode\ignoreemptyscriptsmodecode % we default to this but in manuals we can set it to zero + % These need to be set because otherwise the engine will not honor some font % properties. It also permits tracing. These might become engine defaults. As a % consequence we no longer check for traditional fonts but one can use font control @@ -144,18 +196,23 @@ \immutable\mugluespecdef\halftinymuskip 1mu minus 0.5mu \immutable\mugluespecdef\halfpettymuskip 0.5mu minus 0.25mu -\immutable\mugluespecdef\hairmuskip .15mu +\immutable\mugluespecdef\hairmuskip .15mu \immutable\integerdef \defaultrelpenalty 500 \immutable\integerdef \defaultbinoppenalty 700 \immutable\integerdef \defaultprerelpenalty -100 \immutable\integerdef \defaultprebinoppenalty -100 -\newmuskip\thickermuskip \thickermuskip \defaultthickermuskip +\newmuskip\thickermuskip \thickermuskip \defaultthickermuskip +\newmuskip\fencemuskip \fencemuskip \defaultpettymuskip +\newmuskip\continuationmuskip \continuationmuskip \zeromuskip % Beware: we don't support mathinner any longer. We do have construct, wrapper, ellipsis etc % as replacements and all inner spacing is basically unset. +\setnewconstant\mathallcode \mathclassvalue all +\setnewconstant\mathbegincode \mathclassvalue begin +\setnewconstant\mathendcode \mathclassvalue end \setnewconstant\mathunsetcode \mathclassvalue unset \setnewconstant\mathordinarycode \mathclassvalue ordinary \aliased\let\mathordcode \mathordinarycode @@ -165,40 +222,39 @@ \setnewconstant\mathopencode \mathclassvalue open \setnewconstant\mathclosecode \mathclassvalue close \setnewconstant\mathpunctuationcode \mathclassvalue punctuation \aliased\let\mathpunctcode\mathpunctuationcode +\setnewconstant\mathvariablecode \mathclassvalue variable +\setnewconstant\mathactivecode \mathclassvalue active \setnewconstant\mathinnercode \mathclassvalue inner -\setnewconstant\mathovercode \mathclassvalue over \setnewconstant\mathundercode \mathclassvalue under +\setnewconstant\mathovercode \mathclassvalue over \setnewconstant\mathfractioncode \mathclassvalue fraction \setnewconstant\mathradicalcode \mathclassvalue radical \setnewconstant\mathmiddlecode \mathclassvalue middle +\setnewconstant\mathprimecode \mathclassvalue prime \setnewconstant\mathaccentcode \mathclassvalue accent \setnewconstant\mathfencedcode \mathclassvalue fenced % unlikely to be seen but can be used \setnewconstant\mathghostcode \mathclassvalue ghost % transparent for classes -\setnewconstant\mathvariablecode \mathclassvalue variable -\setnewconstant\mathactivecode \mathclassvalue active \setnewconstant\mathvcentercode \mathclassvalue vcenter +\setnewconstant\mathexplicitcode \mathclassvalue explicit % only for for control \setnewconstant\mathimaginarycode \mathclassvalue imaginary \setnewconstant\mathdifferentialcode \mathclassvalue differential \setnewconstant\mathexponentialcode \mathclassvalue exponential +\setnewconstant\mathintegralcode \mathclassvalue integral \setnewconstant\mathellipsiscode \mathclassvalue ellipsis % replacement for inner \setnewconstant\mathfunctioncode \mathclassvalue function \setnewconstant\mathdigitcode \mathclassvalue digit -\setnewconstant\mathexplicitcode \mathclassvalue explicit % only for for control \setnewconstant\mathdivisioncode \mathclassvalue division \setnewconstant\mathfactorialcode \mathclassvalue factorial \setnewconstant\mathwrappedcode \mathclassvalue wrapped % replacement for inner \setnewconstant\mathconstructcode \mathclassvalue construct % replacement for inner \setnewconstant\mathdimensioncode \mathclassvalue dimension +\setnewconstant\mathunarycode \mathclassvalue unary % dedicated to Alan \setnewconstant\mathtextpunctuationcode \mathclassvalue textpunctuation % for punctuation in text font followed by interword spacing \setnewconstant\mathunspacedcode \mathclassvalue unspaced % for cases where we don't want spacing at all \setnewconstant\mathexperimentalcode \mathclassvalue experimental % for MS and HH testing purposed only -\setnewconstant\mathunarycode \mathclassvalue unary % dedicated to Alan -\setnewconstant\mathnumbergroupcode \mathclassvalue numbergroup - -\setnewconstant\mathbegincode \mathclassvalue begin -\setnewconstant\mathendcode \mathclassvalue end -\setnewconstant\mathallcode \mathclassvalue all \setnewconstant\mathfakecode \mathclassvalue fake +\setnewconstant\mathnumbergroupcode \mathclassvalue numbergroup +\setnewconstant\mathcontinuationcode \mathclassvalue continuation %D \starttyping %D \enabletrackers[math.suspicious] @@ -220,9 +276,14 @@ %D mathematics > suspicious > class 37, U+0003D = %D \stoptyping -\setnewconstant\mathmaybeordinarycode \mathclassvalue maybeordinary -\setnewconstant\mathmayberelationcode \mathclassvalue mayberelation -\setnewconstant\mathmaybebinarycode \mathclassvalue maybebinary +\setnewconstant\mathmaybeordinarycode \mathclassvalue maybeordinary +\setnewconstant\mathmayberelationcode \mathclassvalue mayberelation +\setnewconstant\mathmaybebinarycode \mathclassvalue maybebinary + +%D Chemistry + +\setnewconstant\mathchemicalbondcode \mathclassvalue chemicalbond +\setnewconstant\mathimplicationcode \mathclassvalue implication %setnewconstant\mathtopaccentcode \mathclassvalue topaccent % these are private and above 31 %setnewconstant\mathbottomaccentcode \mathclassvalue bottomaccent % these are private and above 31 @@ -236,24 +297,41 @@ %letmathspacing \mathfunctioncode \mathordinarycode \mathordinarycode \mathordinarycode \mathordinarycode %letmathspacing \mathdigitcode \mathordinarycode \mathordinarycode \mathordinarycode \mathordinarycode -\copymathspacing \mathimaginarycode \mathordinarycode -\copymathspacing \mathdifferentialcode \mathordinarycode -\copymathspacing \mathfactorialcode \mathordinarycode -\copymathspacing \mathexponentialcode \mathordinarycode -\copymathspacing \mathdigitcode \mathordinarycode -\copymathspacing \mathfunctioncode \mathoperatorcode -\copymathspacing \mathwrappedcode \mathfractioncode -\copymathspacing \mathunarycode \mathordinarycode +\copymathspacing \mathimaginarycode \mathordinarycode +\copymathspacing \mathdifferentialcode \mathordinarycode +\copymathspacing \mathfactorialcode \mathordinarycode +\copymathspacing \mathexponentialcode \mathordinarycode +\copymathspacing \mathintegralcode \mathoperatorcode +\copymathspacing \mathdigitcode \mathordinarycode +\copymathspacing \mathfunctioncode \mathoperatorcode +\copymathspacing \mathwrappedcode \mathfractioncode +\copymathspacing \mathunarycode \mathordinarycode + +\copymathspacing \mathvariablecode \mathordinarycode \copymathspacing \mathmaybeordinarycode \mathordinarycode \copymathspacing \mathmayberelationcode \mathrelationcode \copymathspacing \mathmaybebinarycode \mathbinarycode -%copymathspacing \mathnumbergroupcode \mathpunctuationcode -\copymathspacing \mathnumbergroupcode \mathrelationcode % for now +%copymathspacing \mathnumbergroupcode \mathpunctuationcode +\copymathspacing \mathnumbergroupcode \mathrelationcode % for now + +\copymathspacing \mathchemicalbondcode \mathordinarycode +\copymathspacing \mathimplicationcode \mathrelationcode + +\setnewconstant\mathlimopcode \plusone % these will go away +\setnewconstant\mathnolopcode \plusone % these will go away + +\pushoverloadmode % so we drop \mathaccent ! -\setnewconstant\mathlimopcode \plusone -\setnewconstant\mathnolopcode \plusone +\aliased\let\mathordinary \normalmathord +\aliased\let\mathoperator \normalmathop +\aliased\let\mathbinary \normalmathbin +\aliased\let\mathrelation \normalmathrel +\aliased\let\mathopen \normalmathopen +\aliased\let\mathclose \normalmathclose +\aliased\let\mathpunctuation\normalmathpunct +\aliased\let\mathinner \normalmathinner %untraced\protected\def\mathordinary {\mathatom \s!class \mathordinarycode } % use \mathord %untraced\protected\def\mathoperator {\mathatom \s!class \mathoperatorcode } % use \mathop @@ -265,18 +343,19 @@ %untraced\protected\def\mathinner {\mathatom \s!class \mathinnercode } % primitive %untraced\protected\def\mathover {\mathatom \s!class \mathovercode } % macro %untraced\protected\def\mathunder {\mathatom \s!class \mathundercode } % macro -%untraced\protected\def\mathfraction {\mathatom \s!class \mathfractioncode } % use \mathfrac -%untraced\protected\def\mathradical {\mathatom \s!class \mathradicalcode } % use \mathrad -%untraced\protected\def\mathmiddle {\mathatom \s!class \mathmiddlecode } % primitive -%untraced\protected\def\mathaccent {\mathatom \s!class \mathaccentcode } % primitive -%untraced\protected\def\mathfenced {\mathatom \s!class \mathfencedcode } % primitive -%untraced\protected\def\mathghost {\mathatom \s!class \mathghostcode } % primitive -%untraced\protected\def\mathvariable {\mathatom \s!class \mathvariablecode } % useless -%untraced\protected\def\mathactive {\mathatom \s!class \mathactivecode } % useless -%untraced\protected\def\mathvcenter {\mathatom \s!class \mathvcentercode } % useless +\untraced\protected\def\mathfraction {\mathatom \s!class \mathfractioncode } % use \mathfrac +\untraced\protected\def\mathradical {\mathatom \s!class \mathradicalcode } % use \mathrad +\untraced\protected\def\mathmiddle {\mathatom \s!class \mathmiddlecode } % primitive +\untraced\protected\def\mathaccent {\mathatom \s!class \mathaccentcode } % primitive +\untraced\protected\def\mathfenced {\mathatom \s!class \mathfencedcode } % primitive +\untraced\protected\def\mathghost {\mathatom \s!class \mathghostcode } % primitive +\untraced\protected\def\mathvariable {\mathatom \s!class \mathvariablecode } % alphabetical +\untraced\protected\def\mathactive {\mathatom \s!class \mathactivecode } % useless +\untraced\protected\def\mathvcenter {\mathatom \s!class \mathvcentercode } % useless \untraced\protected\def\mathimaginary {\mathatom \s!class \mathimaginarycode } \untraced\protected\def\mathdifferential{\mathatom \s!class \mathdifferentialcode} \untraced\protected\def\mathexponential {\mathatom \s!class \mathexponentialcode } +%untraced\protected\def\mathintegral {\mathatom \s!class \mathintegralcode } %untraced\protected\def\mathfunction {\mathatom \s!class \mathfunctioncode } % macro \untraced\protected\def\mathdigit {\mathatom \s!class \mathdigitcode } %untraced\protected\def\mathexplicit {\mathatom \s!class \mathexplicitcode } % dangerous @@ -284,11 +363,15 @@ \untraced\protected\def\mathfactorial {\mathatom \s!class \mathfactorialcode } \untraced\protected\def\mathwrapped {\mathatom \s!class \mathwrappedcode } \untraced\protected\def\mathconstruct {\mathatom \s!class \mathconstructcode } +\untraced\protected\def\mathchemicalbond{\mathatom \s!class \mathchemicalbondcode} +\untraced\protected\def\mathimplication {\mathatom \s!class \mathimplicationcode } \untraced\protected\def\mathdimension {\mathatom \s!class \mathdimensioncode } %untraced\protected\def\mathbegin {\mathatom \s!class \mathbegincode } % dangerous %untraced\protected\def\mathend {\mathatom \s!class \mathendcode } % dangerous \untraced\protected\def\mathunary {\mathatom \s!class \mathunarycode } +\popoverloadmode + % obsolete \setnewconstant\mathboxcode \zerocount @@ -306,173 +389,27 @@ \untraced\permanent\protected\def\prerelpenalty {\setmathprepenalty \mathrelationcode} \popoverloadmode -% %D These verbose commands are obsolete because there are plenty more classes in -% %D \LMTX\ than in \MKIV. -% -% \permanent\protected\def\ordordspacing {\setmathspacing \mathordinarycode \mathordinarycode } -% \permanent\protected\def\ordopspacing {\setmathspacing \mathordinarycode \mathoperatorcode } -% \permanent\protected\def\ordbinspacing {\setmathspacing \mathordinarycode \mathbinarycode } -% \permanent\protected\def\ordrelspacing {\setmathspacing \mathordinarycode \mathrelationcode } -% \permanent\protected\def\ordopenspacing {\setmathspacing \mathordinarycode \mathopencode } -% \permanent\protected\def\ordclosespacing {\setmathspacing \mathordinarycode \mathclosecode } -% \permanent\protected\def\ordpunctspacing {\setmathspacing \mathordinarycode \mathpunctuationcode} -% %permanent\protected\def\ordinnerspacing {\setmathspacing \mathordinarycode \mathinnercode } -% %permanent\protected\def\ordfractionspacing {\setmathspacing \mathordinarycode \mathfractioncode } -% %permanent\protected\def\ordradicalspacing {\setmathspacing \mathordinarycode \mathradicalcode } -% \permanent\protected\def\ordmiddlespacing {\setmathspacing \mathordinarycode \mathmiddlecode } -% %permanent\protected\def\ordaccentspacing {\setmathspacing \mathordinarycode \mathaccentcode } -% -% \permanent\protected\def\opordspacing {\setmathspacing \mathoperatorcode \mathordinarycode } -% \permanent\protected\def\opopspacing {\setmathspacing \mathoperatorcode \mathoperatorcode } -% \permanent\protected\def\opbinspacing {\setmathspacing \mathoperatorcode \mathbinarycode } -% \permanent\protected\def\oprelspacing {\setmathspacing \mathoperatorcode \mathrelationcode } -% \permanent\protected\def\opopenspacing {\setmathspacing \mathoperatorcode \mathopencode } -% \permanent\protected\def\opclosespacing {\setmathspacing \mathoperatorcode \mathclosecode } -% \permanent\protected\def\oppunctspacing {\setmathspacing \mathoperatorcode \mathpunctuationcode} -% %permanent\protected\def\opinnerspacing {\setmathspacing \mathoperatorcode \mathinnercode } -% %permanent\protected\def\opfractionspacing {\setmathspacing \mathoperatorcode \mathfractioncode } -% %permanent\protected\def\opradicalspacing {\setmathspacing \mathoperatorcode \mathradicalcode } -% \permanent\protected\def\opmiddlespacing {\setmathspacing \mathoperatorcode \mathmiddlecode } -% %permanent\protected\def\opaccentspacing {\setmathspacing \mathoperatorcode \mathaccentcode } -% -% \permanent\protected\def\binordspacing {\setmathspacing \mathbinarycode \mathordinarycode } -% \permanent\protected\def\binopspacing {\setmathspacing \mathbinarycode \mathoperatorcode } -% \permanent\protected\def\binbinspacing {\setmathspacing \mathbinarycode \mathbinarycode } -% \permanent\protected\def\binrelspacing {\setmathspacing \mathbinarycode \mathrelationcode } -% \permanent\protected\def\binopenspacing {\setmathspacing \mathbinarycode \mathopencode } -% \permanent\protected\def\binclosespacing {\setmathspacing \mathbinarycode \mathclosecode } -% \permanent\protected\def\binpunctspacing {\setmathspacing \mathbinarycode \mathpunctuationcode} -% %permanent\protected\def\bininnerspacing {\setmathspacing \mathbinarycode \mathinnercode } -% %permanent\protected\def\binfractionspacing {\setmathspacing \mathbinarycode \mathfractioncode } -% %permanent\protected\def\binradicalspacing {\setmathspacing \mathbinarycode \mathradicalcode } -% \permanent\protected\def\binmiddlespacing {\setmathspacing \mathbinarycode \mathmiddlecode } -% %permanent\protected\def\binaccentspacing {\setmathspacing \mathbinarycode \mathaccentcode } -% -% \permanent\protected\def\relordspacing {\setmathspacing \mathrelationcode \mathordinarycode } -% \permanent\protected\def\relopspacing {\setmathspacing \mathrelationcode \mathoperatorcode } -% \permanent\protected\def\relbinspacing {\setmathspacing \mathrelationcode \mathbinarycode } -% \permanent\protected\def\relrelspacing {\setmathspacing \mathrelationcode \mathrelationcode } -% \permanent\protected\def\relopenspacing {\setmathspacing \mathrelationcode \mathopencode } -% \permanent\protected\def\relclosespacing {\setmathspacing \mathrelationcode \mathclosecode } -% \permanent\protected\def\relpunctspacing {\setmathspacing \mathrelationcode \mathpunctuationcode} -% %permanent\protected\def\relinnerspacing {\setmathspacing \mathrelationcode \mathinnercode } -% %permanent\protected\def\relfractionspacing {\setmathspacing \mathrelationcode \mathfractioncode } -% %permanent\protected\def\relradicalspacing {\setmathspacing \mathrelationcode \mathradicalcode } -% \permanent\protected\def\relmiddlespacing {\setmathspacing \mathrelationcode \mathmiddlecode } -% %permanent\protected\def\relaccentspacing {\setmathspacing \mathrelationcode \mathaccentcode } -% -% \permanent\protected\def\openordspacing {\setmathspacing \mathopencode \mathordinarycode } -% \permanent\protected\def\openopspacing {\setmathspacing \mathopencode \mathoperatorcode } -% \permanent\protected\def\openbinspacing {\setmathspacing \mathopencode \mathbinarycode } -% \permanent\protected\def\openrelspacing {\setmathspacing \mathopencode \mathrelationcode } -% \permanent\protected\def\openopenspacing {\setmathspacing \mathopencode \mathopencode } -% \permanent\protected\def\openclosespacing {\setmathspacing \mathopencode \mathclosecode } -% \permanent\protected\def\openpunctspacing {\setmathspacing \mathopencode \mathpunctuationcode} -% %permanent\protected\def\openinnerspacing {\setmathspacing \mathopencode \mathinnercode } -% %permanent\protected\def\openfractionspacing {\setmathspacing \mathopencode \mathfractioncode } -% %permanent\protected\def\openradicalspacing {\setmathspacing \mathopencode \mathradicalcode } -% \permanent\protected\def\openmiddlespacing {\setmathspacing \mathopencode \mathmiddlecode } -% %permanent\protected\def\openaccentspacing {\setmathspacing \mathopencode \mathaccentcode } -% -% \permanent\protected\def\closeordspacing {\setmathspacing \mathclosecode \mathordinarycode } -% \permanent\protected\def\closeopspacing {\setmathspacing \mathclosecode \mathoperatorcode } -% \permanent\protected\def\closebinspacing {\setmathspacing \mathclosecode \mathbinarycode } -% \permanent\protected\def\closerelspacing {\setmathspacing \mathclosecode \mathrelationcode } -% \permanent\protected\def\closeopenspacing {\setmathspacing \mathclosecode \mathopencode } -% \permanent\protected\def\closeclosespacing {\setmathspacing \mathclosecode \mathclosecode } -% \permanent\protected\def\closepunctspacing {\setmathspacing \mathclosecode \mathpunctuationcode} -% %permanent\protected\def\closeinnerspacing {\setmathspacing \mathclosecode \mathinnercode } -% %permanent\protected\def\closefractionspacing {\setmathspacing \mathclosecode \mathfractioncode } -% %permanent\protected\def\closeradicalspacing {\setmathspacing \mathclosecode \mathradicalcode } -% \permanent\protected\def\closemiddlespacing {\setmathspacing \mathclosecode \mathmiddlecode } -% %permanent\protected\def\closeaccentspacing {\setmathspacing \mathclosecode \mathaccentcode } -% -% \permanent\protected\def\punctordspacing {\setmathspacing \mathpunctuationcode \mathordinarycode } -% \permanent\protected\def\punctopspacing {\setmathspacing \mathpunctuationcode \mathoperatorcode } -% \permanent\protected\def\punctbinspacing {\setmathspacing \mathpunctuationcode \mathbinarycode } -% \permanent\protected\def\punctrelspacing {\setmathspacing \mathpunctuationcode \mathrelationcode } -% \permanent\protected\def\punctopenspacing {\setmathspacing \mathpunctuationcode \mathopencode } -% \permanent\protected\def\punctclosespacing {\setmathspacing \mathpunctuationcode \mathclosecode } -% \permanent\protected\def\punctpunctspacing {\setmathspacing \mathpunctuationcode \mathpunctuationcode} -% %permanent\protected\def\punctinnerspacing {\setmathspacing \mathpunctuationcode \mathinnercode } -% %permanent\protected\def\punctfractionspacing {\setmathspacing \mathpunctuationcode \mathfractioncode } -% %permanent\protected\def\punctradicalspacing {\setmathspacing \mathpunctuationcode \mathradicalcode } -% \permanent\protected\def\punctmiddlespacing {\setmathspacing \mathpunctuationcode \mathmiddlecode } -% %permanent\protected\def\punctaccentspacing {\setmathspacing \mathpunctuationcode \mathaccentcode } -% -% %permanent\protected\def\innerordspacing {\setmathspacing \mathinnercode \mathordinarycode } -% %permanent\protected\def\inneropspacing {\setmathspacing \mathinnercode \mathoperatorcode } -% %permanent\protected\def\innerbinspacing {\setmathspacing \mathinnercode \mathbinarycode } -% %permanent\protected\def\innerrelspacing {\setmathspacing \mathinnercode \mathrelationcode } -% %permanent\protected\def\inneropenspacing {\setmathspacing \mathinnercode \mathopencode } -% %permanent\protected\def\innerclosespacing {\setmathspacing \mathinnercode \mathclosecode } -% %permanent\protected\def\innerpunctspacing {\setmathspacing \mathinnercode \mathpunctuationcode} -% %permanent\protected\def\innerinnerspacing {\setmathspacing \mathinnercode \mathinnercode } -% %permanent\protected\def\innerfractionspacing {\setmathspacing \mathinnercode \mathfractioncode } -% %permanent\protected\def\innerradicalspacing {\setmathspacing \mathinnercode \mathradicalcode } -% %permanent\protected\def\innermiddlespacing {\setmathspacing \mathinnercode \mathmiddlecode } -% %permanent\protected\def\inneraccentspacing {\setmathspacing \mathinnercode \mathaccentcode } -% -% \permanent\protected\def\fractionordspacing {\setmathspacing \mathfractioncode \mathordinarycode } -% \permanent\protected\def\fractionopspacing {\setmathspacing \mathfractioncode \mathoperatorcode } -% \permanent\protected\def\fractionbinspacing {\setmathspacing \mathfractioncode \mathbinarycode } -% \permanent\protected\def\fractionrelspacing {\setmathspacing \mathfractioncode \mathrelationcode } -% \permanent\protected\def\fractionopenspacing {\setmathspacing \mathfractioncode \mathopencode } -% \permanent\protected\def\fractionclosespacing {\setmathspacing \mathfractioncode \mathclosecode } -% \permanent\protected\def\fractionpunctspacing {\setmathspacing \mathfractioncode \mathpunctuationcode} -% %permanent\protected\def\fractioninnerspacing {\setmathspacing \mathfractioncode \mathinnercode } -% %permanent\protected\def\fractionfractionspacing{\setmathspacing \mathfractioncode \mathfractioncode } -% %permanent\protected\def\fractionradicalspacing {\setmathspacing \mathfractioncode \mathradicalcode } -% \permanent\protected\def\fractionmiddlespacing {\setmathspacing \mathfractioncode \mathmiddlecode } -% %permanent\protected\def\fractionaccentspacing {\setmathspacing \mathfractioncode \mathaccentcode } -% -% \permanent\protected\def\radicalordspacing {\setmathspacing \mathradicalcode \mathordinarycode } -% \permanent\protected\def\radicalopspacing {\setmathspacing \mathradicalcode \mathoperatorcode } -% \permanent\protected\def\radicalbinspacing {\setmathspacing \mathradicalcode \mathbinarycode } -% \permanent\protected\def\radicalrelspacing {\setmathspacing \mathradicalcode \mathrelationcode } -% \permanent\protected\def\radicalopenspacing {\setmathspacing \mathradicalcode \mathopencode } -% \permanent\protected\def\radicalclosespacing {\setmathspacing \mathradicalcode \mathclosecode } -% \permanent\protected\def\radicalpunctspacing {\setmathspacing \mathradicalcode \mathpunctuationcode} -% %permanent\protected\def\radicalinnerspacing {\setmathspacing \mathradicalcode \mathinnercode } -% %permanent\protected\def\radicalfractionspacing {\setmathspacing \mathradicalcode \mathfractioncode } -% %permanent\protected\def\radicalradicalspacing {\setmathspacing \mathradicalcode \mathradicalcode } -% \permanent\protected\def\radicalmiddlespacing {\setmathspacing \mathradicalcode \mathmiddlecode } -% %permanent\protected\def\radicalaccentspacing {\setmathspacing \mathradicalcode \mathaccentcode } -% -% \permanent\protected\def\middleordspacing {\setmathspacing \mathmiddlecode \mathordinarycode } -% \permanent\protected\def\middleopspacing {\setmathspacing \mathmiddlecode \mathoperatorcode } -% \permanent\protected\def\middlebinspacing {\setmathspacing \mathmiddlecode \mathbinarycode } -% \permanent\protected\def\middlerelspacing {\setmathspacing \mathmiddlecode \mathrelationcode } -% \permanent\protected\def\middleopenspacing {\setmathspacing \mathmiddlecode \mathopencode } -% \permanent\protected\def\middleclosespacing {\setmathspacing \mathmiddlecode \mathclosecode } -% \permanent\protected\def\middlepunctspacing {\setmathspacing \mathmiddlecode \mathpunctuationcode} -% %permanent\protected\def\middleinnerspacing {\setmathspacing \mathmiddlecode \mathinnercode } -% %permanent\protected\def\middlefractionspacing {\setmathspacing \mathmiddlecode \mathfractioncode } -% %permanent\protected\def\middleradicalspacing {\setmathspacing \mathmiddlecode \mathradicalcode } -% \permanent\protected\def\middlemiddlespacing {\setmathspacing \mathmiddlecode \mathmiddlecode } -% %permanent\protected\def\middleaccentspacing {\setmathspacing \mathmiddlecode \mathaccentcode } -% -% \permanent\protected\def\accentordspacing {\setmathspacing \mathaccentcode \mathordinarycode } -% \permanent\protected\def\accentopspacing {\setmathspacing \mathaccentcode \mathoperatorcode } -% \permanent\protected\def\accentbinspacing {\setmathspacing \mathaccentcode \mathbinarycode } -% \permanent\protected\def\accentrelspacing {\setmathspacing \mathaccentcode \mathrelationcode } -% \permanent\protected\def\accentopenspacing {\setmathspacing \mathaccentcode \mathopencode } -% \permanent\protected\def\accentclosespacing {\setmathspacing \mathaccentcode \mathclosecode } -% \permanent\protected\def\accentpunctspacing {\setmathspacing \mathaccentcode \mathpunctuationcode} -% %permanent\protected\def\accentinnerspacing {\setmathspacing \mathaccentcode \mathinnercode } -% %permanent\protected\def\accentfractionspacing {\setmathspacing \mathaccentcode \mathfractioncode } -% %permanent\protected\def\accentradicalspacing {\setmathspacing \mathaccentcode \mathradicalcode } -% \permanent\protected\def\accentmiddlespacing {\setmathspacing \mathaccentcode \mathmiddlecode } -% %permanent\protected\def\accentaccentspacing {\setmathspacing \mathaccentcode \mathaccentcode } - -%D In the end Mikael and I prefer this but we need a high level interface: +%D These verbose commands are obsolete because there are plenty more classes in +%D \LMTX\ than in \MKIV, so \typ {\ordordspacing}, typ {\fractionclosespacing} +%D are gone now. % \setmathignore\Umathspacebeforescript \plusone % \setmathignore\Umathspaceafterscript \plusone % \setmathignore\Umathradicaldegreebefore\plusone % done in math-rad.mklx -\setmathignore \Umathspacebeforescript\zerocount -\setmathignore \Umathspaceafterscript \zerocount +\setmathignore\Umathspacebeforescript\zerocount +\setmathignore\Umathspaceafterscript \zerocount + +% \setmathignore \Umathspacebeforescript\plustwo % can be set but does not init +% \setmathignore \Umathspaceafterscript \plustwo % can be set but does not init + +% \setmathignore\Umathxscale\plustwo +% \setmathignore\Umathyscale\plustwo + +% can become +% +% \setmathignore \Umathspacebeforescript\plustwo % can be set but does not init +% \setmathignore \Umathspaceafterscript \plustwo % idem \mathslackmode \plusone \mathgroupingmode \plusone @@ -491,14 +428,10 @@ % $x ^^1__2 ^3_4 ^5_6 ^7_8 $ -\mathdoublescriptmode - "\tohexadecimal\mathfakecode - \tohexadecimal\mathfakecode - \tohexadecimal\mathfakecode - \integerdef\defaultmathclassoptions\numexpr - \nopreslackclassoptioncode - +\nopostslackclassoptioncode + \zerocount + % +\nopreslackclassoptioncode + % +\nopostslackclassoptioncode % +\lefttopkernclassoptioncode % applied in a late stage e.g. division % +\righttopkernclassoptioncode % applied in a late stage e.g. division % +\leftbottomkernclassoptioncode % applied in a late stage e.g. division @@ -519,19 +452,88 @@ % +\preferdelimiterdimensionsclassoptioncode \relax +% \showmakeup[penalty] +% +% \preinlinepenalty 23 \postinlinepenalty 56 x$xx$x\par x$x$x\par x$x^2$x\par x$!$x\par +% \preshortinlinepenalty 123 \postshortinlinepenalty456 x$xx$x\par x$x$x\par x$x^2$x\par x$!$x\par + +% \immutable\integerdef\defaultpreshortinlinepenalty 150 + +% when we want \preshortinlinepenalty to kick in here we need to have a bit more shrink +% maybe advance it by \shortinlinemaththreshold/100 +% +% \startbuffer[1] +% The Pythagorean theorem states that for a right triangle with legs \im{a} and \im{b}, and hypotenuse \im{c}, it holds that \im{a^2 + b^2 = c^2}. This is a famous theorem with many different proofs. +% \stopbuffer +% \startbuffer[2] +% The Pythagorean theorem states that for a right triangle with legs \im{\frac{a}{b}} and \im{\hat{b}}, and hypotenuse \im{\hat{c}}, it holds that \im{\hat{a}^2 + \hat{b}^2 = \hat{c}^2}. This is a famous theorem with many different proofs. +% \stopbuffer +% \hsize 12.25cm +% \bgroup +% \preshortinlinepenalty 300 +% \getbuffer[1] +% \egroup +% \bgroup +% \xspaceskip\interwordspace plus \interwordstretch minus 2\interwordshrink +% \spaceskip \interwordspace plus \interwordstretch minus 2\interwordshrink +% \preshortinlinepenalty 300 +% \getbuffer[2] +% \egroup + +\preshortinlinepenalty 150 + +\appendtoks + \shortinlinemaththreshold\emwidth % only for boxed stuff like accents and fractions +\to \everybodyfont + +%D Actually a bit low level so it might move: + +\permanent\protected\untraced\def\setmathoption + {\afterassigned + {\afterassigned + {\scratchcounter\setmathoptions\scratchcounterone + \bitwiseflip\scratchcounter\scratchcountertwo + \setmathoptions\scratchcounterone\scratchcounter}% + \scratchcountertwo}% + \scratchcounterone} + +\permanent\protected\untraced\def\resetmathoption + {\afterassigned + {\afterassigned + {\scratchcounter\setmathoptions\scratchcounterone + \bitwiseflip\scratchcounter-\scratchcountertwo + \setmathoptions\scratchcounterone\scratchcounter}% + \scratchcountertwo}% + \scratchcounterone} + +% \midaligned{\infofont open : \showbits{classoptioncodes}\setmathoptions\mathopencode} +% \midaligned{\infofont close : \showbits{classoptioncodes}\setmathoptions\mathclosecode} + +%D The initial values, best don't change these: + \setmathoptions\mathordinarycode\numexpr - \noitaliccorrectionclassoptioncode + \zerocount + +\noitaliccorrectionclassoptioncode % +\checkligatureclassoptioncode +\checkkernpairclassoptioncode % +\flattenclassoptioncode + +\shortinlineclassoptioncode \relax \setmathoptions\mathoperatorcode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode + % +\checkligatureclassoptioncode + +\checkkernpairclassoptioncode +\relax + +\setmathoptions\mathintegralcode\numexpr + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode % +\checkligatureclassoptioncode +\checkkernpairclassoptioncode - % up to Mikael to decide, ok with italic chars, maybe less so with raw ints: - % +\operatoritaliccorrectionclassoptioncode \relax % we tweak away weird italics so only special cases see this: @@ -547,55 +549,84 @@ % $\mathop{f}^a_b (x) \quad \mathop{f}\limits^a_b (x) \quad \mathop{f}\nolimits^a_b (x)$\blank \setmathoptions\mathbinarycode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode +\lookaheadforendclassoptioncode +\noitaliccorrectionclassoptioncode % +\checkligatureclassoptioncode +\checkkernpairclassoptioncode % +\flattenclassoptioncode + +\obeynestingclassoptioncode \relax \setmathoptions\mathrelationcode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode + +\noitaliccorrectionclassoptioncode + % +\checkligatureclassoptioncode + +\checkkernpairclassoptioncode + % +\flattenclassoptioncode + % +\omitpenaltyclassoptioncode + +\obeynestingclassoptioncode +\relax + +\setmathoptions\mathimplicationcode\numexpr + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode +\noitaliccorrectionclassoptioncode % +\checkligatureclassoptioncode +\checkkernpairclassoptioncode % +\flattenclassoptioncode % +\omitpenaltyclassoptioncode + +\obeynestingclassoptioncode \relax \setmathoptions\mathopencode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + % +\nopostslackclassoptioncode +\noitaliccorrectionclassoptioncode % +\openfenceclassoptioncode % +\checkligatureclassoptioncode +\checkkernpairclassoptioncode + +\pushnestingclassoptioncode \relax \setmathoptions\mathclosecode\numexpr - \defaultmathclassoptions + \zerocount + % +\nopreslackclassoptioncode + +\nopostslackclassoptioncode +\noitaliccorrectionclassoptioncode % +\closefenceclassoptioncode % +\checkligatureclassoptioncode +\checkkernpairclassoptioncode +\raiseprimeclassoptioncode + +\popnestingclassoptioncode \relax \setmathoptions\mathpunctuationcode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode +\noitaliccorrectionclassoptioncode % +\checkligatureclassoptioncode % +\flattenclassoptioncode +\checkkernpairclassoptioncode +\removeitaliccorrectionclassoptioncode + +\obeynestingclassoptioncode \relax \setmathoptions\mathvariablecode\numexpr - \noitaliccorrectionclassoptioncode + \zerocount + +\noitaliccorrectionclassoptioncode \relax \setmathoptions\mathactivecode\numexpr - \noitaliccorrectionclassoptioncode + \zerocount + +\noitaliccorrectionclassoptioncode \relax %setmathoptions\mathinnercode\numexpr @@ -604,7 +635,8 @@ %relax \setmathoptions\mathmiddlecode\numexpr - \noitaliccorrectionclassoptioncode + \zerocount + +\noitaliccorrectionclassoptioncode % +\middlefenceclassoptioncode +\raiseprimeclassoptioncode +\carryoverlefttopkernclassoptioncode @@ -615,34 +647,48 @@ \relax \setmathoptions\mathfractioncode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode +\raiseprimeclassoptioncode +\carryoverlefttopkernclassoptioncode +\carryoverleftbottomkernclassoptioncode +\carryoverrighttopkernclassoptioncode +\carryoverrightbottomkernclassoptioncode +\preferdelimiterdimensionsclassoptioncode + +\shortinlineclassoptioncode \relax \setmathoptions\mathradicalcode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode +\raiseprimeclassoptioncode +\carryoverlefttopkernclassoptioncode +\carryoverleftbottomkernclassoptioncode +\carryoverrighttopkernclassoptioncode +\carryoverrightbottomkernclassoptioncode +\preferdelimiterdimensionsclassoptioncode + +\shortinlineclassoptioncode \relax \setmathoptions\mathaccentcode\numexpr - \defaultmathclassoptions + \zerocount + +\nopreslackclassoptioncode + +\nopostslackclassoptioncode +\autoinjectclassoptioncode + +\shortinlineclassoptioncode + +\lefttopkernclassoptioncode + +\leftbottomkernclassoptioncode + +\righttopkernclassoptioncode + +\rightbottomkernclassoptioncode \relax % ord spacing but with support for \m{m^2/x__3} \setmathoptions\mathdivisioncode\numexpr - \nopreslackclassoptioncode + \zerocount + +\nopreslackclassoptioncode +\nopostslackclassoptioncode +\lefttopkernclassoptioncode % +\righttopkernclassoptioncode @@ -651,11 +697,13 @@ \relax \setmathoptions\mathbegincode\numexpr - \nopostslackclassoptioncode + \zerocount + +\nopostslackclassoptioncode \relax \setmathoptions\mathendcode\numexpr - \nopreslackclassoptioncode + \zerocount + +\nopreslackclassoptioncode \relax % Fenced is only used internally as these fences become open, middle and close @@ -663,7 +711,8 @@ % spacing rules. \setmathoptions\mathfencedcode\numexpr - \unpackclassoptioncode + \zerocount + +\unpackclassoptioncode +\carryoverlefttopkernclassoptioncode +\carryoverleftbottomkernclassoptioncode +\carryoverrighttopkernclassoptioncode @@ -671,6 +720,28 @@ +\preferdelimiterdimensionsclassoptioncode \relax +% MS will check + +\setmathoptions\mathexponentialcode\numexpr + \zerocount + +\shortinlineclassoptioncode +\relax + +\setmathoptions\mathimaginarycode\numexpr + \zerocount + +\shortinlineclassoptioncode +\relax + +\setmathoptions\mathdifferentialcode\numexpr + \zerocount + +\shortinlineclassoptioncode +\relax + +\setmathoptions\mathdigitcode\numexpr + \zerocount + +\shortinlineclassoptioncode +\relax + % test case for \lefttopkernclassoptioncode and \leftbottomkernclassoptioncode in cambria close: % % \setupbodyfont[cambria] @@ -700,16 +771,16 @@ \appendtoks \ifconditional\c_math_discretionaries - \the\everymathdiscretionaries + \expand\everymathdiscretionaries \fi \to \everymathematics -\setfalse\c_math_discretionaries +\newconditional\c_math_discretionaries \installtexexperiment {mathematics.discretionaries} - {\settrue \c_math_discretionaries} - {\setfalse\c_math_discretionaries} + {\c_math_discretionaries\conditionaltrue} + {\c_math_discretionaries\conditionalfalse} %D This is moved here from supp-mat: @@ -744,23 +815,24 @@ %D The attributes that we will use (todo: pack some into one but uglier code): \definesystemattribute[mathalphabet] [public] -\definesystemattribute[mathsize] [public] +%definesystemattribute[mathsize] [public] % we now use the engine features \definesystemattribute[mathpunctuation][public] \definesystemattribute[mathgreek] [public] % will become generic \definesystemattribute[mathalternate] [public] \definesystemattribute[mathrendering] [public] \definesystemattribute[mathcategory] [public] \definesystemattribute[mathmode] [public] -\definesystemattribute[mathitalics] [public] +%definesystemattribute[mathitalics] [public] \definesystemattribute[mathkernpairs] [public] \definesystemattribute[mathbidi] [public] -%definesystemattribute[mathdomain] [public] +\definesystemattribute[mathdomain] [public] \definesystemattribute[mathcollapsing] [public] \definesystemattribute[mathunstack] [public] \definesystemattribute[mathvariant] [public] \definesystemattribute[mathnumbers] [public] \definesystemattribute[mathspacing] [public] \definesystemattribute[mathfencing] [public] +\definesystemattribute[mathintervals] [public] \definesystemattribute[displaymath] [public] @@ -777,7 +849,7 @@ \fi \appendtoks - \c_attr_mathmode\plusone + \c_attr_mathmode\plusone % actually we don't use display math \to \everydisplay \appendtoks @@ -792,11 +864,11 @@ \newconditional\indisplaymath \appendtoks - \setfalse\indisplaymath + \indisplaymath\conditionalfalse \to \everymath \appendtoks - \settrue\indisplaymath + \indisplaymath\conditionaltrue % actually we don't use display math \to \everydisplay \permanent\def\inlineordisplaymath{\ifconditional\indisplaymath\expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments\fi} @@ -804,32 +876,21 @@ \permanent\protected\def\forcedisplaymath {\ifmmode \displaystyle - \settrue\indisplaymath + \indisplaymath\conditionaltrue \fi} \permanent\protected\def\forceinlinemath {\ifmmode \textstyle - \setfalse\indisplaymath + \indisplaymath\conditionalfalse \fi} -% \permanent\protected\def\startforceddisplaymath -% {\startimath -% \displaystyle -% \begingroup -% \settrue\indisplaymath} -% -% \permanent\protected\def\stopforceddisplaymath -% {\endgroup -% \stopimath} - -% \def\startidmath{\Ustartmathmode \displaystyle} -% \def\stopidmath {\Ustopmathmode} - \permanent\protected\def\startforceddisplaymath - {\Ustartmathmode \displaystyle + {\Ustartmathmode\displaystyle \begingroup % can go - \settrue\indisplaymath} + \indisplaymath\conditionaltrue +\expand\everyinsidemathematics\relax % check +} \permanent\protected\def\stopforceddisplaymath {\endgroup % can go @@ -840,21 +901,12 @@ \startforceddisplaymath \enforced\let\stoppickupmath\stopforceddisplaymath \else - \startimath + \startimath % maybe also forced and conditional etc \enforced\let\stoppickupmath\stopimath \fi} \aliased\let\stoppickupmath\relax -% \protected\def\rawmathcharacter#1% slow but only for tracing -% {\begingroup -% \ifmmode -% \resetmathattributes\Uchar#1% -% \else -% \startimath\resetmathattributes\Uchar#1\stopimath -% \fi -% \endgroup} - \permanent\protected\def\rawmathematics#1% slow but only for tracing {\begingroup \ifmmode @@ -884,12 +936,12 @@ \permanent\protected\tolerant\def\startmathematics[#1]% no grouping, if ever then also an optional second {\push_macro_currentmathematics - \edef\currentmathematics{#1}% check for valid - \the\everyswitchmathematics} + \cdef\currentmathematics{#1}% check for valid + \expand\everyswitchmathematics} \permanent\protected\def\stopmathematics {\pop_macro_currentmathematics - \the\everyswitchmathematics} % only needed at level zero + \expand\everyswitchmathematics} % only needed at level zero \definemathematics[\v!default] % not needed, but nicer when nesting back to normal @@ -900,7 +952,6 @@ \aliased\let\m \mathematics % we keep the simple versions \aliased\let\math\mathematics % we keep the simple versions - \popoverloadmode \def\math_m_yes @@ -914,15 +965,16 @@ \def\math_m_yes_math[#1]#2% {#2} % grouping permits \mathbf etc -\def\math_m_yes_text[#1]% +\def\math_m_yes_text[#S#1]% {\begingroup - \ifcondition\validassignment{#1}% + \ifhastok={#1}% \setupcurrentmathematics[#1]% \else - \edef\currentmathematics{#1}% check for valid + \cdef\currentmathematics{#1}% todo: check for valid \fi - \edef\p_openup{\mathematicsparameter\c!openup}% - \ifx\p_openup\v!yes + \expand\everysetupmathematics % kind of special here as we append to it/ check + \usemathematicscolorparameter\c!color + \ifcstok{\mathematicsparameter\c!openup}\v!yes \expandafter\math_m_yes_text_openedup \else \expandafter\math_m_yes_text_normal @@ -930,10 +982,14 @@ \def\math_m_yes_text_openedup#1% {\setbox\scratchbox\hbox\bgroup - \the\everyswitchmathematics\relax - \normalstartimath + \expand\everyswitchmathematics\relax +% \normalstartimath +% \usemathstyleparameter\mathematicsparameter\c!mathstyle + \Ustartmathmode\expandedmathstyleparameter\mathematicsparameter\c!mathstyle + \expand\everyinsidemathematics\relax #1% - \normalstopimath +% \normalstopimath + \Ustopmathmode \egroup \ifdim\ht\scratchbox>\strutht \math_inline_openup_start_yes @@ -947,10 +1003,14 @@ \endgroup} \def\math_m_yes_text_normal#1% - {\the\everyswitchmathematics\relax - \normalstartimath + {\expand\everyswitchmathematics\relax +% \normalstartimath +% \usemathstyleparameter\mathematicsparameter\c!mathstyle + \Ustartmathmode\expandedmathstyleparameter\mathematicsparameter\c!mathstyle + \expand\everyinsidemathematics\relax \begingroup#1\endgroup % grouping permits aftergroups trickery - \normalstopimath +% \normalstopimath + \Ustopmathmode \endgroup} \def\math_m_nop#1% @@ -959,6 +1019,8 @@ #1% \else \normalstartimath + \usemathstyleparameter\mathematicsparameter\c!mathstyle + \expand\everyinsidemathematics\relax \begingroup#1\endgroup % grouping permits aftergroups trickery \normalstopimath \fi} @@ -972,25 +1034,82 @@ %D \stopformula %D \stoptyping +\let\math_trace_blobs\relax + +\protected\def\math_trace_blobs_indeed + {\dontleavehmode + \hbox to \zeropoint \bgroup + \resetinteractionparameter\c!contrastcolor + \resetinteractionparameter\c!style + \scratchcounter\getblobindex\currentmathblob + \bgroup + \darkgray + \vrule \s!height .9\strutht \s!depth .9\strutdp \s!width \onepoint \relax + \hbox to \zeropoint \bgroup + \smallinfofont + \the\currentmathblob\hss + \hbox to \zeropoint \s!yoffset -.6\strutdp \bgroup + \currentlanguage + \hss + \egroup + \egroup + \egroup + \ifblobindexdone{\currentlanguage}\scratchcounter + \note[\v!mathnote:\currentlanguage:\the\scratchcounter]% + \else + \markblobindexdone{\currentlanguage}\scratchcounter + \normalexpanded{\mathnote + [\v!mathnote:\currentlanguage:\the\scratchcounter] + {\definedfont[\s!MathRoman]\gettextblob{\currentlanguage}\the\currentmathblob}}% + \fi + \hss + \egroup} + +\protected\def\math_trace_blobs_checked + {\ifnum\currentmathblobnesting<\zerocount\else + \aftergroup\math_trace_blobs_indeed + \fi} + +\installtextracker + {math.textblobs} + {\let\math_trace_blobs\math_trace_blobs_checked} + {\let\math_trace_blobs\relax} + +\appendtoks + \math_trace_blobs +\to \everymathematics + \permanent\protected\def\dm#1% {\relax \ifmmode %\beginmathgroup\forcedisplaymath#1\endmathgroup - \mathconstruct{\forcedisplaymath#1}% + %\mathconstruct{\forcedisplaymath#1}% + \mathconstruct{\displaystyle\indisplaymath\conditionaltrue#1}% \else - \startimath\begingroup\forcedisplaymath#1\endgroup\stopimath + %\startimath\begingroup\forcedisplaymath#1\endgroup\stopimath + \Ustartmathmode\displaystyle + \indisplaymath\conditionaltrue +\expand\everyinsidemathematics\relax % check + #1% + \Ustopmathmode % grouping for \aftergroup ? \fi} \permanent\protected\def\im#1% {\relax \ifmmode %\beginmathgroup\forceinlinemath#1\endmathgroup - \mathconstruct{\forceinlinemath#1}% + %\mathconstruct{\forceinlinemath#1}% + \mathconstruct{\textstyle\indisplaymath\conditionalfalse#1}% \else - \startimath#1\stopimath + %\startimath#1\stopimath + \Ustartmathmode\textstyle + \indisplaymath\conditionalfalse +\expand\everyinsidemathematics\relax % check + #1% + \Ustopmathmode \fi} -% \aliased\let\m \mathematics % we keep the simple versions +% \aliased\let\m\mathematics % we keep the simple versions % e.g.: \definemathematics[i:mp][setups=i:tight,openup=yes] @@ -1130,13 +1249,13 @@ % \inherited\setmathspacing \mathordinarycode \mathopencode \allmathstyles \zeromuskip \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allunsplitstyles \pettymuskip - % \inherited\setmathspacing \mathordinarycode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathordinarycode \mathclosecode \allmathstyles \fencemuskip % \inherited\setmathspacing \mathordinarycode \mathpunctuationcode \allmathstyles \zeromuskip \inherited\setmathspacing \mathordinarycode \mathconstructcode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathordinarycode \mathconstructcode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathordinarycode \mathellipsiscode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathordinarycode \mathellipsiscode \allunsplitstyles \pettymuskip - \inherited\setmathspacing \mathordinarycode \mathfractioncode \allsplitstyles \tinymuskip + \inherited\setmathspacing \mathordinarycode \mathfractioncode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathordinarycode \mathfractioncode \allunsplitstyles \pettymuskip % \inherited\setmathspacing \mathordinarycode \mathradicalcode \allsplitstyles \tinymuskip % 220705 Results in an unwanted space % \inherited\setmathspacing \mathordinarycode \mathradicalcode \allunsplitstyles \pettymuskip % 220705 Results in an unwanted space @@ -1149,7 +1268,7 @@ % \inherited\setmathspacing \mathoperatorcode \mathopencode \allmathstyles \zeromuskip \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allunsplitstyles \pettymuskip - % \inherited\setmathspacing \mathoperatorcode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathoperatorcode \mathclosecode \allmathstyles \fencemuskip % \inherited\setmathspacing \mathoperatorcode \mathpunctuationcode \allmathstyles \zeromuskip \inherited\setmathspacing \mathoperatorcode \mathconstructcode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathoperatorcode \mathconstructcode \allunsplitstyles \pettymuskip @@ -1168,7 +1287,7 @@ \inherited\setmathspacing \mathbinarycode \mathopencode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allunsplitstyles \pettymuskip - %% \inherited\setmathspacing \mathbinarycode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathbinarycode \mathclosecode \allmathstyles \fencemuskip \inherited\setmathspacing \mathbinarycode \mathpunctuationcode \allsplitstyles \medmuskip \inherited\setmathspacing \mathbinarycode \mathpunctuationcode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathbinarycode \mathconstructcode \allsplitstyles \medmuskip @@ -1190,7 +1309,7 @@ \inherited\setmathspacing \mathrelationcode \mathopencode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allunsplitstyles \thinmuskip - % \inherited\setmathspacing \mathrelationcode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathrelationcode \mathclosecode \allmathstyles \fencemuskip \inherited\setmathspacing \mathrelationcode \mathpunctuationcode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathrelationcode \mathpunctuationcode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathrelationcode \mathconstructcode \allsplitstyles \thickmuskip @@ -1202,18 +1321,19 @@ \inherited\setmathspacing \mathrelationcode \mathradicalcode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathrelationcode \mathradicalcode \allunsplitstyles \pettymuskip % - % \inherited\setmathspacing \mathopencode \mathordinarycode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathoperatorcode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathbinarycode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathrelationcode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathopencode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathmiddlecode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathclosecode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathpunctuationcode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathopencode \mathellipsiscode \allmathstyles \zeromuskip - \inherited\setmathspacing \mathopencode \mathfractioncode \allmathstyles \pettymuskip - % \inherited\setmathspacing \mathopencode \mathradicalcode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathopencode \mathordinarycode \allmathstyles \fencemuskip + \inherited\setmathspacing \mathopencode \mathoperatorcode \allmathstyles \fencemuskip + \inherited\setmathspacing \mathopencode \mathbinarycode \allmathstyles \fencemuskip + \inherited\setmathspacing \mathopencode \mathrelationcode \allmathstyles \fencemuskip + \inherited\setmathspacing \mathopencode \mathopencode \allmathstyles \fencemuskip + \inherited\setmathspacing \mathopencode \mathmiddlecode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathopencode \mathclosecode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathopencode \mathpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathopencode \mathellipsiscode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathopencode \mathradicalcode \allmathstyles \fencemuskip + \inherited\setmathspacing \mathopencode \mathfractioncode \allsplitstyles \pettymuskip + \inherited\setmathspacing \mathopencode \mathfractioncode \allunsplitstyles \pettymuskip % \inherited\setmathspacing \mathclosecode \mathordinarycode \allmathstyles \tinymuskip \inherited\setmathspacing \mathclosecode \mathoperatorcode \allmathstyles \thinmuskip @@ -1224,8 +1344,14 @@ \inherited\setmathspacing \mathclosecode \mathopencode \alltextstyles \tinymuskip \inherited\setmathspacing \mathclosecode \mathopencode \alldisplaystyles \thinmuskip \inherited\setmathspacing \mathclosecode \mathopencode \allunsplitstyles \pettymuskip +% +% todo: see asciimath or at least to be checked +% +% \inherited\setmathspacing \mathclosecode \mathmiddlecode \alldisplaystyles \thickmuskip +% \inherited\setmathspacing \mathclosecode \mathmiddlecode \allunsplitstyles \pettymuskip +% % \inherited\setmathspacing \mathclosecode \mathmiddlecode \allmathstyles \zeromuskip - % \inherited\setmathspacing \mathclosecode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathclosecode \mathclosecode \allmathstyles \fencemuskip % \inherited\setmathspacing \mathclosecode \mathpunctuationcode \allmathstyles \zeromuskip \inherited\setmathspacing \mathclosecode \mathconstructcode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathclosecode \mathconstructcode \allunsplitstyles \pettymuskip @@ -1271,7 +1397,7 @@ \inherited\setmathspacing \mathconstructcode \mathopencode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathconstructcode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathconstructcode \mathmiddlecode \allunsplitstyles \pettymuskip - % \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \pettymuskip \inherited\setmathspacing \mathconstructcode \mathpunctuationcode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathconstructcode \mathpunctuationcode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathconstructcode \mathconstructcode \allsplitstyles \thinmuskip @@ -1292,7 +1418,7 @@ \inherited\setmathspacing \mathellipsiscode \mathopencode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathellipsiscode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathellipsiscode \mathmiddlecode \allunsplitstyles \pettymuskip - % \inherited\setmathspacing \mathellipsiscode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathellipsiscode \mathclosecode \allmathstyles \pettymuskip \inherited\setmathspacing \mathellipsiscode \mathpunctuationcode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathellipsiscode \mathpunctuationcode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathellipsiscode \mathconstructcode \allsplitstyles \thinmuskip @@ -1304,7 +1430,7 @@ \inherited\setmathspacing \mathellipsiscode \mathradicalcode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathellipsiscode \mathradicalcode \allunsplitstyles \pettymuskip % - \inherited\setmathspacing \mathfractioncode \mathordinarycode \allsplitstyles \tinymuskip + \inherited\setmathspacing \mathfractioncode \mathordinarycode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathfractioncode \mathordinarycode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathfractioncode \mathoperatorcode \allsplitstyles \medmuskip \inherited\setmathspacing \mathfractioncode \mathoperatorcode \allunsplitstyles \pettymuskip @@ -1317,6 +1443,7 @@ \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathfractioncode \mathclosecode \allmathstyles \pettymuskip + % \inherited\setmathspacing \mathfractioncode \mathclosecode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathfractioncode \mathpunctuationcode \allsplitstyles \tinymuskip \inherited\setmathspacing \mathfractioncode \mathpunctuationcode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \tinymuskip @@ -1326,8 +1453,10 @@ \inherited\setmathspacing \mathfractioncode \mathellipsiscode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathfractioncode \mathfractioncode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathfractioncode \mathfractioncode \allunsplitstyles \pettymuskip - \inherited\setmathspacing \mathfractioncode \mathradicalcode \allsplitstyles \tinymuskip + \inherited\setmathspacing \mathfractioncode \mathradicalcode \allsplitstyles \thinmuskip \inherited\setmathspacing \mathfractioncode \mathradicalcode \allunsplitstyles \pettymuskip + \inherited\setmathspacing \mathfractioncode \mathdifferentialcode \allsplitstyles \medmuskip + \inherited\setmathspacing \mathfractioncode \mathdifferentialcode \allunsplitstyles \pettymuskip % \inherited\setmathspacing \mathradicalcode \mathordinarycode \allsplitstyles \tinymuskip \inherited\setmathspacing \mathradicalcode \mathordinarycode \allunsplitstyles \pettymuskip @@ -1339,7 +1468,7 @@ % \inherited\setmathspacing \mathradicalcode \mathopencode \allmathstyles \zeromuskip \inherited\setmathspacing \mathradicalcode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathradicalcode \mathmiddlecode \allunsplitstyles \pettymuskip - % \inherited\setmathspacing \mathradicalcode \mathclosecode \allmathstyles \zeromuskip + \inherited\setmathspacing \mathradicalcode \mathclosecode \allmathstyles \pettymuskip \inherited\setmathspacing \mathradicalcode \mathpunctuationcode \allsplitstyles \pettymuskip \inherited\setmathspacing \mathradicalcode \mathpunctuationcode \allunsplitstyles \tinymuskip \inherited\setmathspacing \mathradicalcode \mathconstructcode \allsplitstyles \thinmuskip @@ -1359,7 +1488,7 @@ \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathmiddlecode \mathopencode \allsplitstyles \thickmuskip - \inherited\setmathspacing \mathmiddlecode \mathopencode \allsplitstyles \pettymuskip + \inherited\setmathspacing \mathmiddlecode \mathopencode \allscriptstyles \pettymuskip \inherited\setmathspacing \mathmiddlecode \mathmiddlecode \allsplitstyles \thickmuskip \inherited\setmathspacing \mathmiddlecode \mathmiddlecode \allunsplitstyles \pettymuskip \inherited\setmathspacing \mathmiddlecode \mathclosecode \allsplitstyles \thickmuskip @@ -1396,6 +1525,14 @@ \inherited\setmathspacing \mathfunctioncode \mathbinarycode \allsplitstyles \medmuskip \inherited\setmathspacing \mathfunctioncode \mathbinarycode \allunsplitstyles \pettymuskip % + % integral inherited from operator, with the differences below + \inherited\setmathspacing \mathintegralcode \mathordinarycode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathintegralcode \mathdigitcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathintegralcode \mathoperatorcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathintegralcode \mathdifferentialcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathintegralcode \mathexponentialcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathintegralcode \mathimaginarycode \allmathstyles \pettymuskip + % % \im{1\unit{hour} 20 \unit{minute} 56 \unit{second}} % \inherited\setmathspacing \mathdimensioncode \mathdigitcode \allmathstyles \thickmuskip @@ -1436,6 +1573,24 @@ \inherited\setmathspacing \mathradicalcode \mathtextpunctuationcode \allmathstyles \pettymuskip \inherited\setmathspacing \mathdifferentialcode \mathtextpunctuationcode \allmathstyles \pettymuskip \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \pettymuskip + % + % todo: check with relation and see where it differs + % + \inherited\setmathspacing \mathimplicationcode \mathordinarycode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathimplicationcode \mathbinarycode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathimplicationcode \mathdigitcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathordinarycode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathbinarycode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathdigitcode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathclosecode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathradicalcode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathfractioncode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathfunctioncode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathoperatorcode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathellipsiscode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathconstructcode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathghostcode \mathimplicationcode \alldisplaystyles \thickermuskip + \inherited\setmathspacing \mathwrappedcode \mathimplicationcode \alldisplaystyles \thickermuskip \stopsetups \directsetup{math:spacing:default} @@ -1471,7 +1626,7 @@ \expandafter\setmathfontalternate\lastnamedcs \fi} -\permanent\tolerant\protected\def\setupmathrendering[#1]#*[#2]% the name might change +\permanent\tolerant\protected\def\setupmathrendering[#1]#*[#S#2]% the name might change {\ifparameter#2\or \getparameters[\??mathstylealternative#1:][#2]% \else @@ -1509,6 +1664,7 @@ \permanent\protected\def\mathaltitalic {\setmathfontalternate{italic}} % set via goody file \permanent\protected\def\mathslashedzero {\begingroup\setmathfontalternate{zero}∅\endgroup} % set via goody file or automatic \permanent\protected\def\mathdotless {\setmathfontalternate{dotless}} % set via goody file or automatic +\permanent\protected\def\mathdotfull {\setmathfontalternate{-dotless}} \permanent\protected\def\mathdotlessi {\begingroup\mathdotless i\endgroup} \permanent\protected\def\mathdotlessj {\begingroup\mathdotless j\endgroup} @@ -1573,8 +1729,7 @@ \aliased\let\mathdefault \math_italic \appendtoks - \edef\p_default{\mathematicsparameter\c!default}% - \ifx\p_default\v!normal + \ifcstok{\mathematicsparameter\c!default}\v!normal \enforced\let\mathdefault \math_upright \enforced\let\math_default\math_upright \else @@ -1719,12 +1874,12 @@ \permanent\def\mathcodechecked#1% {\numexpr - \iftok{#1}\emptytoks + \ifempty{#1}% \mathordinarycode - \orelse\ifchknum#1\or - \lastchknum - \orelse\ifchknum\begincsname math#1code\endcsname\or % maybe some day a hash for this - \lastchknum + \orelse\ifchknumber#1\or + \lastchknumber + \orelse\ifchknumber\begincsname math#1code\endcsname\or % maybe some day a hash for this + \lastchknumber \else \mathordinarycode \fi @@ -1780,6 +1935,21 @@ \permanent\protected\def\mathcommand#1% {\begincsname\??mathcommand#1\endcsname} +% \definemathsymbol[wedontlikethisone][3]["2979] +% \definemathsymbol[wedontlikethisone][relation]["2979] + +\permanent\tolerant\protected\def\definemathsymbol[#1]#*[#2]#*[#3]% + {\frozen\expandafter\Umathchardef\csname#1\endcsname + \ifparameter#3\or + \mathcodechecked{#2}% + \zerocount + \numexpr#3% \relax + \else + \zerocount + \zerocount + \numexpr#2% \relax + \fi\relax} + %D Let's define a few comands here: %definemathcommand [mathstrut] {\vphantom{(}} @@ -1836,8 +2006,8 @@ \permanent\protected\def\mathdepthstrut {\math_strut_depth} \popoverloadmode -\permanent\protected\def\topstrut{\srule\s!width\zeropoint\s!height\strutht \s!depth\zeropoint\relax} -\permanent\protected\def\botstrut{\srule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp \relax} +\permanent\protected\def\topstrut{\normalsrule\s!width\zeropoint\s!height\strutht \s!depth\zeropoint\relax} +\permanent\protected\def\botstrut{\normalsrule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp \relax} % \newdimension\mathstrutht % see top % \newdimension\mathstrutdp % see top @@ -1894,7 +2064,10 @@ \endgroup} \permanent\protected\def\mtext#1% - {\text{\usemathematicsstyleandcolor\c!textstyle\c!textcolor#1}} + {\begingroup + \currentmathblobnesting\minusone + \text{\usemathematicsstyleandcolor\c!textstyle\c!textcolor#1}% + \endgroup} %D The next hack is needed needed for sine, cosine etc. @@ -1903,11 +2076,11 @@ \let\math_tags_function \firstofoneunexpanded \let\math_tags_functionlabeltext\mathlabeltext -\let\math_tags_mo\firstofoneunexpanded -\let\math_tags_mi\firstofoneunexpanded +% \let\math_tags_mo\firstofoneunexpanded +% \let\math_tags_mi\firstofoneunexpanded -\protected\def\math_tags_mn#1{\begingroup\math_upright\math_set_o_both#1\endgroup} -\protected\def\math_tags_ms#1{\begingroup\math_upright\math_set_p_both#1\endgroup} % why not just \text +% \protected\def\math_tags_mn#1{\begingroup\math_upright\math_set_o_both#1\endgroup} +% \protected\def\math_tags_ms#1{\begingroup\math_upright\math_set_p_both#1\endgroup} % why not just \text % Once this is stable we can store the number at the tex end which is % faster. Functions getnumbers >= 1000. @@ -1929,7 +2102,7 @@ % \Umathcode"2064 = \mathghostcode \zerocount "2063 % \invisibleplus %D For previous variants of the function styling you can check the git repository -%D end April 2022. +%D end April 2022. We dropped the optional apply feature. % \startTEXpage[offset=1dk] % $\sin(x) = 10$ @@ -1938,37 +2111,6 @@ % \startformula[functionstyle=sans] \sin(x) = 10 \stopformula % \stopTEXpage -% \protected\def\math_function_handle#1#2#3% -% {\begingroup -% \resetdummyparameter\c!mathlimits -% \getdummyparameters[#1]% -% \edef\p_limits{\dummyparameter\c!mathlimits}% -% \mathatom -% mathfont -% class \mathfunctioncode -% \ifx\p_limits\v!no -% nolimits -% \orelse\ifx\p_limits\v!yes -% limits -% \orelse\ifx\p_limits\v!auto -% nolimits -% limits -% \fi -% \bgroup % textfont -% \math_tags_mfunctionlab{#3}\c_apply_function -% \usemathematicscolorparameter\c!functioncolor -% \edef\p_functionstyle{\mathematicsparameter\c!functionstyle}% -% \ifempty\p_functionstyle -% \expandafter\math_upright -% \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname -% \expandafter\lastnamedcs -% \else -% \expandafter\p_functionstyle -% \fi -% #2{#3}% -% \egroup -% \endgroup} - \installcorenamespace{mathfunction} \installcommandhandler \??mathfunction {mathfunction} \??mathfunction @@ -1981,54 +2123,100 @@ \setupmathfunctions [\c!color=\mathematicsparameter\c!functioncolor, - \c!style=\mathematicsparameter\c!functionstyle] + \c!style=\mathematicsparameter\c!functionstyle, + \s!class=function] + +\newconstant\c_function_method \def\math_function_handle_normal#1#2#3% {\begingroup - \edef\currentmathfunction{#2}% - \setupcurrentmathfunction[#3]% - \edef\p_limits{\mathfunctionparameter\c!mathlimits}% - \mathatom - mathfont - class \mathfunctioncode - \ifx\p_limits\v!no - nolimits - \orelse\ifx\p_limits\v!yes - limits - \orelse\ifx\p_limits\v!auto - nolimits - limits - \fi - \bgroup % textfont -% -% for now we reserve command for languages and it completely bypasses -% the atom! -% -% \edef\p_command{\mathfunctionparameter\c!command}% -% \ifempty\p_command - \math_tags_mfunctionlab{#2}\c_apply_function - \usemathfunctioncolorparameter\c!color - \edef\p_functionstyle{\mathfunctionparameter\c!style}% - \ifempty\p_functionstyle - \expandafter\math_upright - \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname - \expandafter\lastnamedcs - \else - \expandafter\p_functionstyle - \fi - \ifcase#1\relax - \expandafter\firstofoneargument - \or - \expandafter\mathlabeltext - \fi{#2}% -% \else -% \p_command\relax -% \fi - \egroup + \mathdotfull + \cdef\currentmathfunction{#2}% + \setupcurrentmathfunction[#3]% + \edef\p_limits{\mathfunctionparameter\c!mathlimits}% + \edef\p_left{\mathfunctionparameter\c!left}% + \edef\p_right{\mathfunctionparameter\c!right}% + \c_function_method + \ifempty\p_left + \ifempty\p_right + \zerocount % prefix no argument + \else + \plustwo % postfix with argument + \fi + \orelse\ifempty\p_right + \plusone % prefix with argument + \else + \plusthree % pre- and postfix with argument + \fi + \ifcase\c_function_method + \expandafter\math_function_handle_normal_string + \else + \expandafter\math_function_handle_normal_symbol + \fi#1} % constant + +\def\math_function_handle_normal_string#1% + {\dostarttagged\t!mfunction\currentmathfunction% todo: pass lab id + \math_tags_mfunctionlab\plusone{\currentmathfunction}{\mathfunctionparameter\c!method}% + \mathatom + mathfont + single % behave like a character + class \mathcodechecked{\mathfunctionparameter\s!class} + \ifx\p_limits\v!no + nolimits + \orelse\ifx\p_limits\v!yes + limits + \orelse\ifx\p_limits\v!auto + nolimits + limits + \fi + % \ifcstok{\mathfunctionparameter\c!mathlimits}\v!no + % nolimits + % \orelse\iflastnamedcs\v!yes + % limits + % \orelse\iflastnamedcs\v!auto + % nolimits + % limits + % \fi + \bgroup % textfont but can be anything + \usemathfunctioncolorparameter\c!color + \edef\p_functionstyle{\mathfunctionparameter\c!style}% + % no need for \expandafter here + \ifempty\p_functionstyle + \expandafter\math_upright + \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname + \expandafter\lastnamedcs + \else + \expandafter\p_functionstyle + \fi + \ifcase#1\or + \mathlabeltext{\currentmathfunction}% + \fi + \egroup + \dostoptagged + \endgroup} + +\definesystemattribute[mathstack][public] + +\newinteger\c_mathfunctionstack + +\def\math_function_handle_normal_symbol#1#2% + {\global\advanceby\c_mathfunctionstack\plusone + \attribute\mathstackattribute\c_mathfunctionstack + \math_tags_mfunctionlab\plusone{\currentmathfunction}{\mathfunctionparameter\c!method}% + \dostarttagged\t!mfunctionstack\currentmathfunction + \mathghost unpack \bgroup + \p_left + \begingroup + \attribute\mathstackattribute\attributeunsetvalue + #2% + \endgroup + \p_right + \egroup + \dostoptagged \endgroup} \def\math_function_handle_language_indeed#1#2#3% - {\edef\currentmathfunction{#2}% + {\cdef\currentmathfunction{#2}% \setupcurrentmathfunction[#3]% \edef\p_command{\mathfunctionparameter\c!command}% \ifempty\p_command @@ -2078,25 +2266,25 @@ \fi \to \everybeforedisplayformula -\let\math_tags_mfunctiontxt\gobbletwoarguments -\let\math_tags_mfunctionlab\gobbletwoarguments +\let\math_tags_mfunctionlab \gobblethreearguments +\def\math_tags_mfunctionlabattribute#-#-#-{\zerocount} -\permanent\protected\def\math_tags_mo_indeed#1{\begingroup \c_attr_mathcategory\plusone #1\endgroup} -\permanent\protected\def\math_tags_mi_indeed#1{\begingroup \c_attr_mathcategory\plustwo #1\endgroup} -\permanent\protected\def\math_tags_mn_indeed#1{\begingroup\math_upright\c_attr_mathcategory\plusthree\math_set_o_both#1\endgroup} -\permanent\protected\def\math_tags_ms_indeed#1{\begingroup\math_upright\c_attr_mathcategory\plusfour \math_set_p_both#1\endgroup} % todo: mathoptext +% \permanent\protected\def\math_tags_mo_indeed#1{\begingroup \c_attr_mathcategory\plusone #1\endgroup} +% \permanent\protected\def\math_tags_mi_indeed#1{\begingroup \c_attr_mathcategory\plustwo #1\endgroup} +% \permanent\protected\def\math_tags_mn_indeed#1{\begingroup\math_upright\c_attr_mathcategory\plusthree\math_set_o_both#1\endgroup} +% \permanent\protected\def\math_tags_ms_indeed#1{\begingroup\math_upright\c_attr_mathcategory\plusfour \math_set_p_both#1\endgroup} % todo: mathoptext -\newconditional\c_apply_function +\permanent\protected\def\math_tags_mo#1{\mathatom \s!class \mathoperatorcode {#1}} +\permanent\protected\def\math_tags_mi#1{\mathatom \s!class \mathordinarycode {#1}} +%permanent\protected\def\math_tags_mn#1{\mathatom \s!class \mathdigitcode {\math_upright #1}} +\permanent\protected\def\math_tags_ms#1{\mathatom \s!class \mathtextpunctuationcode {\math_upright #1}} -\permanent\protected\def\math_tags_apply#1#2% - {\begingroup - \settrue\c_apply_function - #1% - \endgroup - \begingroup - % todo: auto () - #2% - \endgroup} +\permanent\protected\def\math_tags_mn#1% + {\dostarttagged\t!mdigits\empty + \mathatom \s!class \mathdigitcode {\math_upright #1}% + \dostoptagged} + +\newconditional\c_apply_function \ifdefined\apply \else \aliased\let\apply\relax \fi @@ -2106,14 +2294,33 @@ \mutable\let\ms\relax \appendtoks - \enforced\let\math_tags_mfunctiontxt\clf_tagmfunctiontxt - \enforced\let\math_tags_mfunctionlab\clf_tagmfunctionlab - \enforced\let\math_tags_mo \math_tags_mo_indeed - \enforced\let\math_tags_mi \math_tags_mi_indeed - \enforced\let\math_tags_mn \math_tags_mn_indeed - \enforced\let\math_tags_ms \math_tags_ms_indeed + \enforced\let\math_tags_mfunctionlab \clf_tagmfunctionlab + \enforced\let\math_tags_mfunctionlabattribute\clf_tagmfunctionlabattribute \to \everyenableelements + +\permanent\protected\def\registermathfunction[#1]% experimental + {\begingroup + \scratchcounter\clf_tagmfunctionlabattribute + \plusone + {#1}% + {}% + \endgroup} + + +% domain language name meaning +% language name meaning +% name meaning + +\permanent\protected\def\registermathsymbol[#1]#*[#2]#*[#3]#*[#4]% experimental + {\ifparameter#4\or + \clf_registerverbosemathlabel{#1}{#2}{#3}{#4}% + \orelse\ifparameter#3\or + \clf_registerverbosemathlabel{\s!default}{#1}{#2}{#3}% + \else + \clf_registerverbosemathlabel{\s!default}{\s!en}{#1}{#2}% + \fi} + \appendtoks \enforced\let\mo \math_tags_mo \enforced\let\mi \math_tags_mi @@ -2286,10 +2493,7 @@ % \enforced\let ^\normalsuperscript % } % -% \doglobal\appendtoks -% \enforced\let _\normalsubscript -% \enforced\let ^\normalsuperscript -% \to \everymathematics +% \gtoksapp\everymathematics{\obeymathcatcodes}% % % \egroup @@ -2306,14 +2510,14 @@ % \def\nonknuthmode % {\pushcatcodetable % \setcatcodetable\ctxcatcodes -% \the\everynonknuthmode +% \expand\everynonknuthmode % \let\nonknuthmode\relax % \popcatcodetable} % % \def\donknuthmode % {\pushcatcodetable % \setcatcodetable\ctxcatcodes -% \the\everydonknuthmode +% \expand\everydonknuthmode % \popcatcodetable} % % \bgroup @@ -2331,14 +2535,14 @@ % \egroup % % \appendtoks -% \setfalse\knuthmode +% \knuthmode\conditionalfalse % \catcode\underscoreasciicode\othercatcode % \catcode\circumflexasciicode\othercatcode % \catcode\ampersandasciicode \othercatcode % \to \everynonknuthmode % % \appendtoks -% \settrue\knuthmode +% \knuthmode\conditionaltrue % \catcode\underscoreasciicode\subscriptcatcode % \catcode\circumflexasciicode\superscriptcatcode % \catcode\ampersandasciicode \alignmentcatcode @@ -2403,8 +2607,12 @@ %D Memory saver: \def\math_basics_check_compact - {\doifelse{\mathematicsparameter\c!compact}\v!yes - \enabledirectives\disabledirectives[math.virtual.optional]} + {\ifcstok{\mathematicsparameter\c!compact}\v!yes + \expandafter\enabledirectives + \else + \expandafter\disabledirectives + \fi + [math.virtual.optional]} \appendtoks \ifempty\currentmathematics @@ -2450,14 +2658,14 @@ \installcorenamespace{mathaligndirection} -\defcsname\??mathaligndirection r2l\endcsname{\settrue\c_math_right_to_left} -\defcsname\??mathaligndirection\v!righttoleft\endcsname{\settrue\c_math_right_to_left} +\defcsname\??mathaligndirection r2l\endcsname{\c_math_right_to_left\conditionaltrue} +\defcsname\??mathaligndirection\v!righttoleft\endcsname{\c_math_right_to_left\conditionaltrue} \appendtoks \ifcsname\??mathaligndirection\mathematicsparameter\c!align\endcsname \lastnamedcs \else - \setfalse\c_math_right_to_left + \c_math_right_to_left\conditionalfalse \fi \to \everyswitchmathematics @@ -2584,82 +2792,6 @@ \setupmathematics [\s!collapsing=1] % so that we at least do primes -%D Math italics (experiment) - -%D We need keys but what names to use and because we have hardcoded solution -%D we can stick to numbers. At some point this will change because we can now -%D control in in the engine and goodies per font. - -% \installcorenamespace{mathitalics} -% -% \setnewconstant\c_math_italics_attribute\attributeunsetvalue -% -% \letcsname\??mathitalics 1\endcsname\plusone % fontitalics -% \letcsname\??mathitalics 2\endcsname\plustwo % fontdata -% \letcsname\??mathitalics 3\endcsname\plusthree % quad based -% \letcsname\??mathitalics 4\endcsname\plusfour % combination of 1 and 3 -% \letcsname\??mathitalics \v!none\endcsname\attributeunsetvalue -% \letcsname\??mathitalics\v!reset\endcsname\attributeunsetvalue -% -% \def\math_italics_initialize -% {\ifnum\c_math_italics_attribute=\attributeunsetvalue \else -% \clf_initializemathitalics % one time -% \glet\math_italics_initialize\relax -% \fi} -% -% \appendtoks -% \edef\p_italics{\mathematicsparameter\s!italics}% -% \c_math_italics_attribute -% \ifcsname\??mathitalics\p_italics\endcsname\lastnamedcs\else\attributeunsetvalue\fi -% \relax -% % \math_italics_initialize -% \to \everyswitchmathematics % only in mathematics -% -% \appendtoks -% \math_italics_initialize -% \c_attr_mathitalics\c_math_italics_attribute -% \to \everymathematics - -\setnewconstant\c_math_italics_attribute\attributeunsetvalue - -% merge these: - -\def\math_italics_initialize - {\ifnum\c_math_italics_attribute=\attributeunsetvalue \else - \clf_initializemathitalics % one time - \glet\math_italics_initialize\relax - \fi} - -\appendtoks - \edef\p_italics{\mathematicsparameter\s!italics}% - \c_math_italics_attribute - \ifx\p_italics\v!none - \attributeunsetvalue - \orelse\ifx\p_italics\v!reset - \attributeunsetvalue - \else - \plusone - \fi - \relax -\to \everyswitchmathematics % only in mathematics - -\appendtoks - \math_italics_initialize - \c_attr_mathitalics\c_math_italics_attribute -\to \everymathematics - -% looks nicer but can generate bogus csnames -% -% \setvalue{\??mathitalics1}{\math_italics_initialize\c_math_italics_attribute\plusone } % fontitalics -% \setvalue{\??mathitalics2}{\math_italics_initialize\c_math_italics_attribute\plustwo } % fontdata -% \setvalue{\??mathitalics3}{\math_italics_initialize\c_math_italics_attribute\plusthree} % quad based -% \setvalue{\??mathitalics4}{\math_italics_initialize\c_math_italics_attribute\plusfour } % combination of 1 and 3 -% -% \appendtoks -% \c_math_italics_attribute\attributeunsetvalue -% \csname\??mathitalics\mathematicsparameter\s!italics\endcsname -% \to \everyswitchmathematics % only in mathematics - %D Math kerns (experiment) \installcorenamespace{mathkernpairs} @@ -2698,11 +2830,15 @@ % \newconditional\automathpunctuation % -% \protected\def\enablemathpunctuation {\settrue \automathpunctuation} -% \protected\def\disablemathpunctuation{\setfalse\automathpunctuation} +% \protected\def\enablemathpunctuation {\automathpunctuation\conditionaltrue} +% \protected\def\disablemathpunctuation{\automathpunctuation\conditionalfalse} % % \appendtoks -% \doifelse{\mathematicsparameter\c!autopunctuation}\v!yes\settrue\setfalse\automathpunctuation +% \ifcstok{\mathematicsparameter\c!autopunctuation}\v!yes +% \automathpunctuation\conditionaltrue +% \else +% \automathpunctuation\conditionalfalse +% \fi % \to \everyswitchmathematics % % \setupmathematics @@ -2934,6 +3070,9 @@ %D The next replaces the above: +% [0x2E] = { 0x2E, 0x2C, 0x002E, 0x002C, 0x2008, 0x2008 }, +% [0x2C] = { 0x2C, 0x2E, 0x2008, 0x2008, 0x002E, 0x002C }, + % \startbuffer % \im{x + 1,222,333.44 + x}\par % \im{x + 1.222.333,44 + x}\par @@ -3036,31 +3175,6 @@ %D \TestB{1}{(1;2)=(1; 2)} %D \stoptabulate -%D \macros -%D {mathstyle} -%D -%D If one want to be sure that something is typeset in the appropriate style, \type -%D {\mathstyle} can be used: -%D -%D \starttyping -%D \mathstyle{something} -%D \stoptyping - -% \def\mathstyle#1% -% {\mathchoice -% {\displaystyle #1}% -% {\textstyle #1}% -% {\scriptstyle #1}% -% {\scriptscriptstyle#1}} -% -% We now have a primitive operation for this. As the macro overloads a new -% primitive introduced in \LUATEX, we need to use \type {\normalmathstyle} when we -% consult the current math style. -% -% \let \mathstyle \Ustack % spoils cramped -% -% \let \mathstyle \firstofoneargument -% % 0 = display % 1 = crampeddisplay % 2 = text @@ -3090,11 +3204,11 @@ #1% \endmathgroup} -\permanent\def\triggermathstyle#1{\Ustyle\numexpr#1\relax} +\permanent\def\triggermathstyle#1{\givenmathstyle\numexpr#1\relax} %permanent\def\mathstyletrigger#1{\numexpr#1\relax} \permanent\let\mathstyletrigger \firstofoneargument -\def\triggeredmathstyle#1{\Ustyle\numexpr\number#1\relax} % expandable +\def\triggeredmathstyle#1{\givenmathstyle\numexpr\number#1\relax} % expandable \permanent\def\triggeredmathstyleparameter#1% to bypass the relax {\ifcase\numexpr\normalmathstyle\relax @@ -3231,9 +3345,9 @@ %D Handy too: -\permanent\def\mathcharwd{\fontcharwd\mathstylefont\normalmathstyle} -\permanent\def\mathcharht{\fontcharht\mathstylefont\normalmathstyle} -\permanent\def\mathchardp{\fontchardp\mathstylefont\normalmathstyle} +\permanent\def\mathcharwd{\scaledfontcharwd\mathstylefont\normalmathstyle} +\permanent\def\mathcharht{\scaledfontcharht\mathstylefont\normalmathstyle} +\permanent\def\mathchardp{\scaledfontchardp\mathstylefont\normalmathstyle} %D Some dimension fun: @@ -3298,7 +3412,7 @@ % \protected\def\math_style_hbox#1#2% sensitive for: a \over b => {a\over b} or \frac{a}{b} % {\normalexpanded{\setbox\scratchbox\hbox#1\bgroup % \mathbeginclass\lastrightclass -% \startimath\Ustyle\the\mathstyle\relax}% +% \startimath\givenmathstyle\the\mathstyle\relax}% % \mathsurround\zeropoint#2\stopimath\egroup % \box\scratchbox % \mathrightclass\lastrightclass } @@ -3402,17 +3516,27 @@ \permanent\def\triggeruncrampedstyle {\ifmathstyle - \or \displaystyle \or - \or \textstyle \or - \or \scriptstyle \or - \or \scriptscriptstyle \fi} + \currentlysetmathstyle\or + \displaystyle \or + \currentlysetmathstyle\or + \textstyle \or + \currentlysetmathstyle\or + \scriptstyle \or + \currentlysetmathstyle\or + \scriptscriptstyle + \fi} \permanent\def\triggercrampedstyle {\ifmathstyle - \crampeddisplaystyle \or \or - \crampedtextstyle \or \or - \crampedscriptstyle \or \or - \crampedscriptscriptstyle \fi} + \crampeddisplaystyle \or + \currentlysetmathstyle \or + \crampedtextstyle \or + \currentlysetmathstyle \or + \crampedscriptstyle \or + \currentlysetmathstyle \or + \crampedscriptscriptstyle\or + \currentlysetmathstyle + \fi} \permanent\def\triggersmallstyle {\ifmathstyle @@ -3497,7 +3621,8 @@ \fi} \installcorenamespace{mathstylecommand} -\installcorenamespace{mathstylecache} +\installcorenamespace{mathstylecachem} +\installcorenamespace{mathstylecachet} \newconstant\c_math_styles_state_style \newconstant\c_math_styles_state_cramped @@ -3507,72 +3632,62 @@ \ifcase\c_math_styles_state_size \ifcase\c_math_styles_state_style \ifcase\c_math_styles_state_cramped - \relax \or - \noexpand\triggeruncrampedstyle \or - \noexpand\triggercrampedstyle \fi + \mathstyle \or + \triggeruncrampedstyle\or + \triggercrampedstyle \fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerdisplaystyle \or - \displaystyle \or - \crampeddisplaystyle \fi + \ifmode\triggerdisplaystyle\else\displaystyle\fi + \or\displaystyle\or\crampeddisplaystyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggertextstyle \or - \textstyle \or - \crampedtextstyle \fi + \ifmode\triggertextstyle\else\textstyle\fi + \or\textstyle\or\crampedtextstyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerscriptstyle \or - \scriptstyle \or - \crampedscriptstyle \fi + \ifmode\triggerscriptstyle\else\scriptstyle\fi + \or\scriptstyle\or\crampedscriptstyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerscriptscriptstyle \or - \scriptscriptstyle \or - \crampedscriptscriptstyle \fi + \ifmode\triggerscriptscriptstyle\else\scriptscriptstyle\fi + \or\scriptscriptstyle\or\crampedscriptscriptstyle\fi \fi \or % small \ifcase\c_math_styles_state_style \ifcase\c_math_styles_state_cramped - \noexpand\triggersmallstyle \or - \noexpand\triggeruncrampedsmallstyle \or - \noexpand\triggercrampedsmallstyle \fi + \triggersmallstyle \or + \triggeruncrampedsmallstyle\or + \triggercrampedsmallstyle \fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerscriptstyle \or - \scriptstyle \or - \crampedscriptstyle \fi + \ifmode\triggerscriptstyle\else\scriptstyle\fi + \or\scriptstyle\or\crampedscriptstyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerscriptstyle \or - \scriptstyle \or - \crampedscriptstyle \fi + \ifmode\triggerscriptstyle\else\scriptstyle\fi + \or\scriptstyle\or\crampedscriptstyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerscriptscriptstyle \or - \scriptscriptstyle \or - \crampedscriptscriptstyle \fi + \ifmode\triggerscriptscriptstyle\else\scriptscriptstyle\fi + \or\scriptscriptstyle\or\crampedscriptscriptstyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerscriptscriptstyle \or - \scriptscriptstyle \or - \crampedscriptscriptstyle \fi + \ifmode\triggerscriptscriptstyle\else\scriptscriptstyle\fi + \or\scriptscriptstyle\or\crampedscriptscriptstyle\fi \fi \or % large \ifcase\c_math_styles_state_style \ifcase\c_math_styles_state_cramped - \noexpand\triggerbigstyle \or - \noexpand\triggeruncrampedbigstyle \or - \noexpand\triggercrampedbigstyle \fi + \triggerbigstyle \or + \triggeruncrampedbigstyle\or + \triggercrampedbigstyle \fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerdisplaystyle \or - \displaystyle \or - \crampeddisplaystyle \fi + \ifmode\triggerdisplaystyle\else\displaystyle\fi + \or\displaystyle\or\crampeddisplaystyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggertextstyle \or - \textstyle \or - \crampedtextstyle \fi + \ifmode\triggertextstyle\else\textstyle\fi + \or\textstyle\or\crampedtextstyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggertextstyle \or - \textstyle \or - \crampedtextstyle \fi + \ifmode\triggertextstyle\else\textstyle\fi + \or\textstyle\or\crampedtextstyle\fi \or\ifcase\c_math_styles_state_cramped - \noexpand\triggerscriptstyle \or - \scriptstyle \or - \crampedscriptstyle \fi + \ifmode\triggerscriptstyle\else\scriptstyle\fi + \or\scriptstyle\or\crampedscriptstyle\fi \fi + \else + \mathstyle \fi } @@ -3597,6 +3712,23 @@ \defcsname\??mathstylecommand\v!small \endcsname{\c_math_styles_state_size \plusone} \defcsname\??mathstylecommand\v!big \endcsname{\c_math_styles_state_size \plustwo} +%D A \type {mathstyle} is a set of: +%D +%D \starttabulate[|lT|lT|] +%D \BC style \NC display text script scriptscript \NC \NR +%D \BC variant \NC uncramped cramped normal packed \NC \NR +%D \BC size \NC small big \NC \NR +%D \stoptabulate +%D +%D \startbuffer +%D \m{x\foo} +%D \m[mathstyle=text]{x\foo} +%D \m[mathstyle={cramped,text}]{x\foo} +%D \m[mathstyle=scriptscript]{x\foo \scriptstyle\foo} +%D \stopbuffer +%D +%D \typebuffer \getbuffer +%D %D \startbuffer %D \definemathstyle[mystyle][scriptscript] %D @@ -3609,13 +3741,17 @@ \installcorenamespace {mathstyle} -\letcsname\??mathstyle \endcsname\empty -\letcsname\??mathstylecache\endcsname\empty +\letcsname\??mathstyle \endcsname\empty +%letcsname\??mathstylecachem\endcsname\empty +%letcsname\??mathstylecachet\endcsname\empty + +\defcsname\??mathstyle\v!normal\endcsname{\givenmathstyle\normalmathstyle} +\defcsname\??mathstyle \endcsname{\givenmathstyle\normalmathstyle} \def\math_style_set_indeed {\ifcsname\??mathstyle\m_math_style_asked\endcsname \lastnamedcs - \orelse\ifcsname\??mathstylecache\m_math_style_asked\endcsname + \orelse\ifcsname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi\m_math_style_asked\endcsname \lastnamedcs \else \math_style_set_mathstyle_mathstylecache\m_math_style_asked @@ -3625,9 +3761,9 @@ {\normalexpanded{\noexpand\math_style_set_expanded{#1#2}}} \def\math_style_set_expanded#1% - {\ifcsname\??mathstyle#1e\endcsname + {\ifcsname\??mathstyle#1\endcsname \lastnamedcs - \orelse\ifcsname\??mathstylecache#1\endcsname + \orelse\ifcsname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi#1\endcsname \lastnamedcs \else \math_style_set_mathstyle_mathstylecache{#1}% @@ -3658,9 +3794,9 @@ \c_math_styles_state_cramped\zerocount \c_math_styles_state_size \zerocount \rawprocesscommacommand[\m_math_style_asked]\math_style_collect - \gletcsname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}% + \gletcsname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}% \endlocalcontrol - \csname\??mathstylecache#1\endcsname} + \csname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi\m_math_style_asked\endcsname} % \letcsname\??mathstyle \??mathstyle \endcsname\math_style_set_mathstyle_mathstyle % still needed? % \letcsname\??mathstylecache\??mathstylecache\endcsname\math_style_set_mathstyle_mathstylecache % still needed? @@ -3794,17 +3930,17 @@ \newtoks\everymathtext -\tolerant\protected\def\math_text_handle_indeed#1#*[#2]#:#3#% +\tolerant\protected\def\math_text_handle_indeed#1#*[#S#2]#:#3#% {\begingroup - \edef\currentmathtext{#1}% + \cdef\currentmathtext{#1}% \setupcurrentmathtext[#2]% \normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}% \ifcstok{\mathtextparameter\c!alternative}\v!split \mathatom unroll - class \mathtextparameter\s!class - leftclass \mathtextparameter\s!leftclass - rightclass \mathtextparameter\s!rightclass + class \mathcodechecked{\mathtextparameter\s!class} + leftclass \mathcodechecked{\mathtextparameter\s!leftclass} + rightclass \mathcodechecked{\mathtextparameter\s!rightclass} \bgroup \hbox#3\bgroup \aftergroup\egroup @@ -3820,7 +3956,7 @@ \fi \font_basics_switchtobodyfont\m_math_text_choice_face \usemathtextstyleandcolor\c!style\c!color - \the\everymathtext\relax + \expand\everymathtext\relax \let\next} \protected\def\math_text_handle#1% @@ -3854,7 +3990,7 @@ % $ % { x\! \neq x!} \quad {\ss x\! \neq x!} \qquad % {\it x\! \neq x!} \quad {\ss \it x\! \neq x!} \qquad -% {\fi x\! \neq x!} \quad {\ss \fi x\! \neq x!} \qquad +% {\bf x\! \neq x!} \quad {\ss \bf x\! \neq x!} \qquad % {\bi x\! \neq x!} \quad {\ss \bi x\! \neq x!} % $ % \stopbuffer @@ -3863,9 +3999,9 @@ % \getbuffer \par \automathtext \getbuffer % \stopTEXpage -\newconditional\c_mathtextauto % we need aproper key: \settrue\c_mathtextauto +\newconditional\c_mathtextauto % we need aproper key: \c_mathtextauto\conditionaltrue -\permanent\protected\def\automathtext{\settrue\c_mathtextauto} +\permanent\protected\def\automathtext{\c_mathtextauto\conditionaltrue} \let\currentmathalphabet \s!rm \let\currentmathfontstyle\s!tf @@ -3898,10 +4034,8 @@ \permanent\protected\def\?{\mathtextauto{?}{?}} \popoverloadmode -% \appendtoks -% \reinstatecatcodecommand\barasciicode -% \obeydiscretionaries -% \to \everymathtext +\appendtoks \obeydiscretionaries \to \everymathtext +\appendtoks \ignorediscretionaries \to \everymathematics %D Safeguard against redefinitions: @@ -3934,12 +4068,22 @@ % \protected\def\mathoptext#1{\mathop{\text{#1}}} +\newtoks\everymathoptext + +\appendtoks + \let|\textbar +\to \everymathoptext + \permanent\protected\def\mathoptext {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}% %\showmathstyle \dowithnextbox {\mathop{\box\nextbox}}% - \hbox\bgroup\font_basics_switchtobodyfont\m_math_text_choice_face\let\next} + \hbox\bgroup + \expandtoks\everymathoptext + \font_basics_switchtobodyfont + \m_math_text_choice_face + \let\next} % new: @@ -3950,12 +4094,15 @@ % \setupmathematics % [setups=math:morespacing] +\newtoks\everyinsidemathematics + \appendtoks \edef\p_setups{\mathematicsparameter\c!setups}% \ifempty\p_setups\else \directsetup\p_setups \fi -\to \everyswitchmathematics +%to \everyswitchmathematics +\to \everyinsidemathematics % new: @@ -4134,10 +4281,22 @@ % \c_attr_mathdomain\c_math_domain_attribute % \to \everymathematics -\setupmathematics - [\s!italics=3] % for the moment only this one makes sense .. still experimental +\newinteger\c_math_domain_attribute -%D For special purposed we set this one: +\appendtoks + \edef\p_domain{\mathematicsparameter\c!domain}% + \ifempty\p_domain + \c_math_domain_attribute\attributeunsetvalue + \else + \c_math_domain_attribute\clf_domainattribute{\p_domain}\relax + \fi +\to \everyswitchmathematics % only in mathematics + +\appendtoks + \c_attr_mathdomain\c_math_domain_attribute +\to \everymathematics + +%D For special purposes (koeieletters) we set this one: \installcorenamespace{mathrules} @@ -4328,36 +4487,36 @@ \normalsupmarkmode\plusone % 2 also disable ^[^+] in text mode \permanent\protected\tolerant\def\supscr[#1]#:#2% - {\ifchkdim#1\or\Umathopenupheight#1\relax\fi - \Usuperscript{#2}} + {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\fi + \superscript{#2}} \permanent\protected\tolerant\def\subscr[#1]#:#2% - {\ifchkdim#1\or\Umathopenupdepth #1\relax\fi - \Usubscript{#2}} + {\ifchkdimension#1\or\Umathopenupdepth\lastchkdimension\fi + \subscript{#2}} \permanent\protected\tolerant\def\supsubscr[#1]#:#2#3% - {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi - \Usuperscript{#2}\Usubscript{#3}} + {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\relax\fi + \superscript{#2}\subscript{#3}} \permanent\protected\tolerant\def\subsupscr[#1]#:#*#2#3% - {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi - \Usubscript{#2}\Usuperscript{#3}} + {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\relax\fi + \subscript{#2}\superscript{#3}} \permanent\protected\tolerant\def\supprescr[#1]#:#2% - {\ifchkdim#1\or\Umathopenupheight#1\relax\fi - \Usuperprescript{#2}} + {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\fi + \superprescript{#2}} \permanent\protected\tolerant\def\subprescr[#1]#:#2% - {\ifchkdim#1\or\Umathopenupdepth #1\relax\fi - \Usubprescript{#2}} + {\ifchkdimension#1\or\Umathopenupdepth\lastchkdimension\fi + \subprescript{#2}} \permanent\protected\tolerant\def\supsubprescr[#1]#:#2#3% - {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi - \Usuperprescript{#2}\Usubprescript{#3}} + {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\fi + \superprescript{#2}\subprescript{#3}} \permanent\protected\tolerant\def\subsupprescr[#1]#:#*#2#3% - {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi - \Usubprescript{#2}\Usuperprescript{#3}} + {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\fi + \subprescript{#2}\superprescript{#3}} %D For now (needed in asciimath): @@ -4373,35 +4532,21 @@ %D as well as: %D %D \starttyping -%D \setupmathspacing[narrow] +%D $\Umathxscale\textstyle 800 a + b + x + d + e = f $\par +%D $\Umathxscale\textstyle 1000 a + b + x + d + e = f $\par +%D $\Umathxscale\textstyle 1200 a + b + x + d + e = f $\blank +%D +%D $\showboxes\setupmathspacing[narrow] a + b + x + d + e = f $\par +%D $\showboxes\setupmathspacing[normal] a + b + x + d + e = f $\par +%D $\showboxes\setupmathspacing[wide] a + b + x + d + e = f $\blank +%D +%D $\showboxes\setupmathspacing[tight] x^2_1$\quad +%D $\showboxes\setupmathspacing[normal] x^2_1$\quad +%D $\showboxes\setupmathspacing[loose] x^2_1$\blank %D \stoptyping \installcorenamespace{mathspacing} -% \protected\def\math_spacing_set#1#2% maybe some day \allmathstyles -% {\relax -% #1\displaystyle #2% -% #1\crampeddisplaystyle#2% -% #1\textstyle #2% -% #1\scriptstyle #2% -% #1\crampedscriptstyle #2% -% #1\scriptstyle #2% -% #1\crampedscriptstyle #2% -% \relax} -% -% \permanent\tolerant\protected\def\definemathspacing[#1]#*[#2]#*[#3]% -% {\ifcstok{#2}\v!horizontal -% \edefcsname\??mathspacing#1\endcsname -% {\math_spacing_set\Umathxscale{\ifchknum#3\or#3\else\plusthousand\fi\relax}}% -% \orelse\ifcstok{#2}\v!vertical -% \edefcsname\??mathspacing#1\endcsname -% {\math_spacing_set\Umathyscale{\ifchknum#3\or#3\else\plusthousand\fi\relax}}% -% \else -% \edefcsname\??mathspacing#1\endcsname -% {\math_spacing_set\Umathxscale{\ifchknum#2\or\number#2\else\plusthousand\fi\relax}% -% \math_spacing_set\Umathyscale{\ifchknum#3\or\number#3\orelse\ifchknum#2\or\number#2\else\plusthousand\fi\relax}}% -% \fi} - \permanent\tolerant\protected\def\definemathspacing[#1]#*[#2]#*[#3]% {\ifcstok{#2}\v!horizontal \edefcsname\??mathspacing#1\endcsname @@ -4426,27 +4571,6 @@ \permanent\protected\def\setupmathspacing[#1]% {\begincsname\??mathspacing#1\endcsname} -% \defcsname\??mathspacing +\endcsname -% {\expandedloop\zerocount\plusseven\plusone -% {\Umathxscale -% \the\currentloopiterator -% \numexpr\Umathxscale\the\currentloopiterator+\plushundred\relax -% \Umathyscale -% \the\currentloopiterator -% \numexpr\Umathxscale\the\currentloopiterator+\plushundred\relax}} -% -% \defcsname\??mathspacing -\endcsname -% {\expandedloop\zerocount\plusseven\plusone -% {\Umathxscale -% \the\currentloopiterator -% \numexpr\Umathxscale\the\currentloopiterator-\plushundred\relax -% \Umathyscale -% \the\currentloopiterator -% \numexpr\Umathxscale\the\currentloopiterator-\plushundred\relax}} - -% can become a lua call that globally defined it, then we can have -% partials - %D We're done with the double dollars: %D %D \startbuffer @@ -4479,20 +4603,42 @@ \relax \appendtoks - \ifcstok{\mathematicsparameter\v!hz}\v!yes + \ifcstok{\mathematicsparameter\c!hz}\v!yes \glyphoptions\c_math_glyph_options_hz \else \glyphoptions\c_math_glyph_options_default \fi \to \everymathematics +%D Math italics: see \MKIV\ files for how this was done because in \LMTX\ we ditched +%D them. The flags that we set with glyphoptions no longer apply. Correction with +%D surrounding text is also set elsewhere. + +% \def\math_italics_initialize +% {\clf_initializemathitalics +% \gdef\math_italics_initialize +% {%bitwiseflip\discretionaryoptions-\textcheckitalicdiscoptioncode % is this really needed +% \bitwiseflip\glyphoptions-\textcheckitalicglyphoptioncode % is this really needed +% \bitwiseflip\glyphoptions \mathcheckitalicglyphoptioncode}% +% \math_italics_initialize} + +\def\math_italics_initialize + {\clf_initializemathitalics % one time, so permanent + \glettonothing\math_italics_initialize} + +\appendtoks + \ifcstok{\mathematicsparameter\s!italics}\v!yes + \math_italics_initialize + \fi +\to \everymathematics + %D Bonus for testing: % styles : regular sansserif monospaced fraktur script blackboard % alternatives : normal bold italic bolditalic % sets : ucletters lcletters digits ucgreek lcgreek symbols -% \def\CheckMathHat#1{\ruledhbox{\im{\widehat{\Uchar#1}_1^2__3^^4}}} +% \def\CheckMathHat#1{\ruledhbox{\im{\widehat{\tocharacter#1}_1^2__3^^4}}} % % \dontleavehmode \traversemath{regular}{bold}{digits}{\CheckMathHat{#1}\hskip1em} @@ -4535,9 +4681,11 @@ %D Just in case someone uses it: -\appendtoks - \scriptspace.05\Umathquad\textstyle % for Mikael -\to \everymathematics +% \appendtoks +% \scriptspace.05\Umathquad\textstyle % for Mikael +% \to \everymathematics + +\scriptspace\zeropoint %D New: @@ -4587,8 +4735,22 @@ \def\math_axis_inject_indeed#1% {\srule - \s!height \dimexpr(\scratchdimentwo+\scratchdimenone)*\c_math_m_scaled/\plusthousand\relax - \s!depth -\dimexpr(\scratchdimentwo-\scratchdimenone)*\c_math_m_scaled/\plusthousand\relax + \s!height + \dimexpr (\scratchdimentwo+\scratchdimenone)*% + \ifnum\c_math_m_scaled=\plusthousand + \glyphscale/\plusthousand + \else + \c_math_m_scaled*\glyphscale/\plusthousand/\plusthousand + \fi + \relax + \s!depth - + \dimexpr (\scratchdimentwo-\scratchdimenone)*% + \ifnum\c_math_m_scaled=\plusthousand + \glyphscale/\plusthousand + \else + \c_math_m_scaled*\glyphscale/\plusthousand/\plusthousand + \fi + \relax \s!attr \mathaxisattribute#1% \relax} @@ -4620,6 +4782,248 @@ \permanent\protected\def\mathscriptbelow{\math_axis_inject\plustwo\plusone} \permanent\protected\def\mathscriptontop{\math_axis_inject\plustwo\plustwo} +%D \macros{kt} +%D +%D Bonus (keep together): +%D +%D \startbuffer +%D test $a + b + c + d + x + x + e + f + g = h$ test +%D test $a + b + c + \keeptogether{\red d + x + x + e + f} + g = h$ test +%D \stopbuffer +%D +%D \typebuffer +%D +%D \startlines \getbuffer \stoplines + +\mathinlinepenaltyfactor = 1500 % a reasonable default +\mathdisplaypenaltyfactor = 1000 + +\setmathpostpenalty\mathpunctuationcode\plustenthousand + +\installcorenamespace{mathnesting} + +\installcommandhandler \??mathnesting {mathnesting} \??mathnesting + +\appendtoks + \frozen\protected\instance\edefcsname\currentmathnesting\endcsname{\math_nesting[\currentmathnesting]}% +\to \everydefinemathnesting + +\newconstant\c_math_boundary_old +\newconstant\c_math_boundary_new + +\protected\tolerant\def\math_nesting[#1]#*[#S#2]% + {\groupedcommand + {\cdef\currentmathnesting{#1}% + \setupcurrentmathnesting[#2]% \ifparameter#2\or...\fi can't work here due to nesting + \mathnestingparameter\c!left + \c_math_boundary_old\c_math_boundary_new + \c_math_boundary_new + \ifconditional\indisplaymath + \ifchknum\mathnestingparameter\c!displayfactor\or\lastnamedcs\else\mathdisplaypenaltyfactor\fi + \else + \ifchknum\mathnestingparameter\c!inlinefactor \or\lastnamedcs\else\mathinlinepenaltyfactor \fi + \fi + \relax + \mathboundary\plustwo \c_math_boundary_new}% + {\mathboundary\plusthree\c_math_boundary_old + \mathnestingparameter\c!right}} + +\permanent\tolerant\protected\def\mathnesting[#1]% + {\groupedcommand + {\c_math_boundary_old\c_math_boundary_new + \c_math_boundary_new\ifchknum#1\or#1\orelse\ifconditional\indisplaymath\mathdisplaypenaltyfactor\else\mathinlinepenaltyfactor\fi\relax + \mathboundary\plustwo \c_math_boundary_new}% + {\mathboundary\plusthree\c_math_boundary_old}} + +% \definemathnesting[triplet][left=(,right=),inlinefactor=500] +% $ (a,b,c) + \triplet{1,2,3} + (p,q,r) $ + +\definemathnesting[mathtogether][\c!inlinefactor=1500] +\definemathnesting[mathloose] [\c!inlinefactor=0500] + +% \nofmathvariants % defined at lua end +% \getmathvariant % defined at lua end +% \getmathcharone % defined at lua end +% \getmathchartwo % defined at lua end + +%D Snapping scripts: +%D +%D \startbuffer +%D \setupmathematics[snap=yes] +%D +%D \im { +%D \mathscriptbelow \mathaxisbelow +%D (x)^1_2 + \left(x\right)^1_2 + \left(\frac{1}{2}\right)^1_2 +%D } +%D \stopbuffer +%D +%D \typebuffer +%D +%D This will align scripts as in: \inlinebuffer. + +\setupmathematics + [\c!snap=\v!no] + +%D Here is a new one (that abstracts the scripts being abused): +%D +%D \startbuffer +%D \startformula +%D \showstruts +%D \mathannotation[top=my text here,bottom=my text there]{\underbrace{x+y+z}} +%D \stopformula +%D \stopbuffer +%D +%D \typebuffer +%D +%D \getbuffer + +\installcorenamespace {mathannotation} + +\installcommandhandler \??mathannotation {mathannotation} \??mathannotation + +\setupmathannotation + [\c!top=, + \c!bottom=, + \c!strut=\v!yes, + \c!mathclass=\mathconstructcode] + +\appendtoks + \frozen\protected\tolerant\edefcsname\currentmathannotation\endcsname{\math_annotation{\currentmathannotation}} +\to \everydefinemathannotation + +\tolerant\protected\def\math_annotation#1[#S#2]#:#3% + {\beginmathgroup + \edef\currentmathannotation{#1}% + \setupcurrentmathannotation[#2]% + \edef\p_strut{\mathannotationparameter\c!strut}% + \mathatom + limits + \s!class\mathcodechecked{\mathannotationparameter\c!mathclass}% + {#3}% + \ifempty{\mathannotationparameter\c!top}\else + % todo: tag this differently + \superscript{% + \ifx\p_strut\v!yes\botstrut\fi + \mtext{\mathannotationparameter\c!top}% + }% + \fi + \ifempty{\mathannotationparameter\c!bottom}\else + % todo: tag this differently + \subscript{% + \ifx\p_strut\v!yes\topstrut\fi + \mtext{\mathannotationparameter\c!bottom}% + }% + \fi + \endmathgroup} + +\definemathannotation[mathannotation] + +%D By default we enable proper tensor multiple script alignment: + +\mathdoublescriptmode + "\tohexadecimal\numexpr + \inheritclassdoublescriptmodecode + + \discardshapekerndoublescriptmodecode + + \realignscriptsdoublescriptmodecode + + \reorderprescriptsdoublescriptmodecode + \relax + \tohexadecimal\mathcontinuationcode % 2 bytes + \tohexadecimal\mathcontinuationcode % 2 bytes + \tohexadecimal\mathcontinuationcode % 2 bytes + +\immutable\integerdef\c_math_alignscripts_bits\numexpr + "1000000 * \realignscriptsdoublescriptmodecode +\relax + +\immutable\integerdef\c_math_obeyempty_bits\numexpr + \ignoreemptysuperscriptsmodecode + +\ignoreemptysubscriptsmodecode + +\ignoreemptyprimescriptsmodecode +\relax + +\letempty\m_math_alignscripts + +\def\m_math_update_alignscripts + {\ifx\m_alignscripts\v!yes + \bitwiseflip\mathdoublescriptmode \c_math_alignscripts_bits % align + \bitwiseflip\mathscriptsmode -\c_math_obeyempty_bits % obey empty + \orelse\ifx\m_alignscripts\v!always + \bitwiseflip\mathdoublescriptmode \c_math_alignscripts_bits % align + \bitwiseflip\mathscriptsmode \c_math_obeyempty_bits % ignore empty + \orelse\ifx\m_alignscripts\v!empty + \bitwiseflip\mathdoublescriptmode-\c_math_alignscripts_bits % don't align + \bitwiseflip\mathscriptsmode \c_math_obeyempty_bits % ignore empty + \else + \bitwiseflip\mathdoublescriptmode-\c_math_alignscripts_bits % don't align + \bitwiseflip\mathscriptsmode -\c_math_obeyempty_bits % obey empty + \fi + \let\m_math_alignscripts\m_alignscripts} + +\appendtoks + \cdef\m_alignscripts{\mathematicsparameter\c!alignscripts}% + \ifx\m_math_alignscripts\m_alignscripts\else + \m_math_update_alignscripts + \fi +\to \everysetupmathematics + +\appendtoks + \scriptspacebetweenfactor\numericscale\mathematicsparameter\c!interscriptfactor\relax +\to \everysetupmathematics + +\setupmathematics + [\c!alignscripts=\v!always, + \c!interscriptfactor=-.5] + +%D Needed for spacing, tagging, etc. + +\appendtoks + \attribute\mathintervalsattribute + \ifcstok{\mathematicsparameter\c!autointervals}\v!yes + \plusone + \else + \attributeunsetvalue + \fi +\to \everysetupmathematics + +\setupmathematics + [\c!autointervals=\v!yes] + +%D This is needed for tagging blobs: + +\definesystemattribute[mathblob][public] + +% \newinteger\currentmathblob +% \newinteger\currentmathblobnesting % could be a primitive + +\protected\def\math_bump_blob_state + {\ifnum\currentmathblobnesting<\zerocount\else + \ifcase\currentmathblobnesting + \global\advanceby\currentmathblob\plusone + \attribute\mathblobattribute\currentmathblob + \fi + \advanceby\currentmathblobnesting\plusone + \fi} + +\appendtoks + \math_bump_blob_state +\to \everymathematics + +\appendtoks + \ifcstok{\taggingparameter\c!state}\v!start + \clf_enablecollectingmath + \fi +\to \everysetuptagging + +% needed for verbose: \im {C \of (a,b) \neq C^2 \of (a,b)} + +\permanent\protected\def\math_application_of +% {\mathatom class \mathghostcode unpack {\Umathchar \mathghostcode \zerocount "2061}} % only lists gets upacked ! + {\mathatom class \mathghostcode unpack {\applyfunctionof}} % only lists gets upacked ! + +\appendtoks + \aliased\let\of\math_application_of +\to \everymathematics + \protect \endinput % % not used (yet) @@ -4627,8 +5031,8 @@ % \newtoks \everystartimath % \newtoks \everystopimath % -% \protected\def\startimath{\Ustartmath\the\everystartimath} -% \protected\def\stopimath {\the\everystopimath\Ustopmath} +% \protected\def\startimath{\Ustartmath\expand\everystartimath} +% \protected\def\stopimath {\expand\everystopimath\Ustopmath} % % \protected\def\m% % {\relax diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl index d4dbfa448a0..f759489ee8a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl @@ -24,10 +24,13 @@ \installcorenamespace{mathoperators} \installcorenamespace{mathoperatormethod} +\mathlimitsmode\plusone % make long script look right ... font dependent! + \installcommandhandler \??mathoperators {mathoperator} \??mathoperators \setupmathoperator - [\c!left=\zerocount]% so we always have something + [\c!left=\zerocount, + \c!mathclass=\mathoperatorcode] \aliased\let\setupmathoperators\setupmathoperator @@ -61,44 +64,45 @@ \protected\def\math_operator_operator#1#2% {\setlocalmathoperatorcurrent{#1}% \edef\currentmathoperator{#1}% \setupcurrentmathoperator[#2]% + \scratchclass\mathcodechecked{\mathoperatorparameter\c!mathclass}\relax \Uoperator \usedcolorparameterattributes{\mathoperatorparameter\c!color}% \begincsname\??mathoperatormethod\mathoperatorparameter\c!method\endcsname - \ifchkdim\mathoperatorparameter\c!size\or - \s!depth \mathoperatorparameter\c!size - \s!height\mathoperatorparameter\c!size + \ifchkdimension\mathoperatorparameter\c!size\or + \s!depth \lastchkdimension + \s!height\lastchkdimension \s!axis % variants \s!noaxis % extensibles (assumes also axis) \s!exact % make sure we don't overshoot when there are no variants and extensibles \orelse\ifcstok{\mathoperatorparameter\c!size}\v!auto \s!auto \fi - \s!class \mathoperatorcode - \s!attr \indexofregister \c_attr_mathsize \attributeunsetvalue + \s!class \scratchclass + % \s!attr \indexofregister \c_attr_mathsize \attributeunsetvalue % todo: find a way to pick up or pass sup/sub to here - \Udelimiter \zerocount \fam \mathoperatorparameter\c!left + \Umathchar \scratchclass \fam \mathoperatorparameter\c!left {\edef\m_operator_text{\mathoperatorparameter\c!top}% \ifempty\m_operator_text\else \mathstrut % todo: make option - \dousecolorparameter{\mathoperatorparameter\c!topcolor} + \dousecolorparameter{\mathoperatorparameter\c!topcolor}% \m_operator_text \fi}% {\edef\m_operator_text{\mathoperatorparameter\c!bottom}% \ifempty\m_operator_text\else \mathstrut % todo: make option - \dousecolorparameter{\mathoperatorparameter\c!bottomcolor} + \dousecolorparameter{\mathoperatorparameter\c!bottomcolor}% \m_operator_text \fi}} -\tolerant\protected\def\math_operator#1#*[#2]#*#:#=% mandate braces +\tolerant\protected\def\math_operator#1#*[#S#2]#*#:#=% mandate braces {\math_operator_operator{#1}{#2}#3\Uright.} -\tolerant\protected\def\math_operator_start#1#*[#2]% +\tolerant\protected\def\math_operator_start#1#*[#S#2]% {\math_operator_operator{#1}{#2}} \protected\def\math_operator_stop {\Uright.} -% {\Uright\Udelimiter\zerocount \fam \zerocount } +% {\Uright\Umathchar\zerocount \fam \zerocount } % \def\math_operator_default_size % is now the auto option % {\ifconditional\indisplaymath\ifcase\Umathoperatorsize=\maxdimen\else @@ -113,11 +117,15 @@ \definemathoperator [products] \definemathoperator [operators] -\setupmathoperators [integrals] [\c!size=\v!auto,\c!method=\mathematicsparameter\c!integral] % cf Mikael's wish \setupmathoperators [summations] [\c!size=\v!auto] \setupmathoperators [products] [\c!size=\v!auto] \setupmathoperators [operators] [\c!size=\v!auto] +\setupmathoperators [integrals] + [\c!size=\v!auto, + \c!mathclass=\mathintegralcode, + \c!method=\mathematicsparameter\c!integral] % cf Mikael's wish + \setupmathematics[\c!integral=nolimits] \definemathoperator [integral] [integrals] [\c!left="222B] % these might go unless we decide @@ -140,9 +148,9 @@ \definemathoperator [barint] [integrals] [\c!left="2A0D] % Integral with bar \definemathoperator [doublebarint] [integrals] [\c!left="2A0E] % Integral with double bar \definemathoperator [slashint] [integrals] [\c!left="2A0F] % Integral with slash -\definemathoperator [aodownintc] [integrals] [\c!left="2A11] +\definemathoperator [aodownintc] [integrals] [\c!left="2A11] \definemathoperator [rectangularpoleintc] [integrals] [\c!left="2A12] -\definemathoperator [semicirclepoleintc] [integrals] [\c!left="2A13] +\definemathoperator [semicirclepoleintc] [integrals] [\c!left="2A13] \definemathoperator [circlepoleoutsideintc] [integrals] [\c!left="2A14] \definemathoperator [circlepoleinsideintc] [integrals] [\c!left="2A15] \definemathoperator [squareintc] [integrals] [\c!left="2A16] @@ -186,5 +194,4 @@ \definemathoperator [bigdoublewedge] [operators] [\c!left="2A07] % big double wedge \definemathoperator [bigdoublevee] [operators] [\c!left="2A08] % big double vee - \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-map.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-map.lmt index 0bd75d74894..add556791ef 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-map.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-map.lmt @@ -10,9 +10,7 @@ if not modules then modules = { } end modules ['math-map'] = { -- persian: we will also provide mappers for other scripts -- todo : alphabets namespace -- maybe : script/scriptscript dynamic, --- check : (U+2202,U+1D715) : upright --- (U+2202,U+1D715) : italic --- (U+2202,U+1D715) : upright +-- check : (U+2202,U+1D715) : upright / italic -- add them to the regular vectors below so that they honor \it etc local type, next = type, next @@ -149,10 +147,11 @@ registerotffeature { -- following approach permits easier remapping of a-a, A-Z and 0-9 to -- fallbacks; symbols is currently mostly greek -local function todigit (n) local t = { } for i=0, 9 do t[0x00030+i] = n+i end return t end -local function toupper (n) local t = { } for i=0,25 do t[0x00041+i] = n+i end return t end -local function tolower (n) local t = { } for i=0,25 do t[0x00061+i] = n+i end return t end -local function tovector(t) return t end +local function todigit (n) local t = { } for i=0, 9 do t[0x00030+i] = n+i end return t end +local function toupper (n) local t = { } for i=0,25 do t[0x00041+i] = n+i end return t end +local function tolower (n) local t = { } for i=0,25 do t[0x00061+i] = n+i end return t end +local function torange (n,m) local t = { } for i=0,25 do t[n+i] = m+i end return t end +local function tovector(t) return t end -- how about 0x2A (ast) cq. 0x2217 -- 0x2D (hyphen) cq. 0x2212 @@ -168,7 +167,7 @@ local regular_tf = { [0x039B]=0x039B, [0x039C]=0x039C, [0x039D]=0x039D, [0x039E]=0x039E, [0x039F]=0x039F, [0x03A0]=0x03A0, [0x03A1]=0x03A1, [0x03A3]=0x03A3, [0x03A4]=0x03A4, [0x03A5]=0x03A5, [0x03A6]=0x03A6, [0x03A7]=0x03A7, [0x03A8]=0x03A8, [0x03A9]=0x03A9, - }, + }, lcgreek = { [0x03B1]=0x03B1, [0x03B2]=0x03B2, [0x03B3]=0x03B3, [0x03B4]=0x03B4, [0x03B5]=0x03B5, [0x03B6]=0x03B6, [0x03B7]=0x03B7, [0x03B8]=0x03B8, [0x03B9]=0x03B9, [0x03BA]=0x03BA, @@ -289,8 +288,10 @@ local sansserif_tf = { digits = todigit(0x1D7E2), ucletters = toupper(0x1D5A0), lcletters = tolower(0x1D5BA), - lcgreek = tovector(regular_tf.lcgreek), - ucgreek = tovector(regular_tf.ucgreek), +-- lcgreek = tovector(regular_tf.lcgreek), +-- ucgreek = tovector(regular_tf.ucgreek), +lcgreek = torange(0x03B1,0x100080), +ucgreek = torange(0x0391,0x1000A0), symbols = tovector(regular_tf.symbols), } @@ -298,8 +299,10 @@ local sansserif_it = { digits = tovector(regular_tf.digits), ucletters = toupper(0x1D608), lcletters = tolower(0x1D622), - lcgreek = tovector(regular_tf.lcgreek), - ucgreek = tovector(regular_tf.ucgreek), +-- lcgreek = tovector(regular_tf.lcgreek), +-- ucgreek = tovector(regular_tf.ucgreek), +lcgreek = torange(0x03B1,0x1000C0), +ucgreek = torange(0x0391,0x1000E0), symbols = tovector(regular_tf.symbols), } @@ -652,7 +655,7 @@ end -- of course we could do some div/mod trickery instead -local mathalphabet = attributes.private("mathalphabet") +local mathalphabet = attributes.private("mathalphabet") function mathematics.getboth(alphabet,style) local data = alphabet and alphabets[alphabet] or regular diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt index cbcf6164d1f..cc6c30c365e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt @@ -30,8 +30,7 @@ if not modules then modules = { } end modules ['math-noa'] = { -- nota bene: uunderdelimiter uoverdelimiter etc are radicals (we have 5 types) local next, tonumber = next, tonumber -local utfchar, utfbyte = utf.char, utf.byte -local formatters, gmatch = string.formatters, string.gmatch +local formatters, gmatch, match = string.formatters, string.gmatch, string.match local sortedhash = table.sortedhash local insert, remove = table.insert, table.remove local div, round = math.div, math.round @@ -40,11 +39,6 @@ local fonts = fonts local nodes = nodes local node = node local mathematics = mathematics -local context = context - -local otf = fonts.handlers.otf -local otffeatures = fonts.constructors.features.otf -local registerotffeature = otffeatures.register local privateattribute = attributes.private local registertracker = trackers.register @@ -59,24 +53,24 @@ local colortracers = nodes.tracers.colors -- most trace/report will move into the closures -local trace_remapping = false registertracker("math.remapping", function(v) trace_remapping = v end) -local trace_processing = false registertracker("math.processing", function(v) trace_processing = v end) -local trace_analyzing = false registertracker("math.analyzing", function(v) trace_analyzing = v end) -local trace_normalizing = false registertracker("math.normalizing", function(v) trace_normalizing = v end) -local trace_collapsing = false registertracker("math.collapsing", function(v) trace_collapsing = v end) -local trace_goodies = false registertracker("math.goodies", function(v) trace_goodies = v end) +local trace_remapping = false registertracker("math.remapping", function(v) trace_remapping = v end) +local trace_processing = false registertracker("math.processing", function(v) trace_processing = v end) +local trace_analyzing = false registertracker("math.analyzing", function(v) trace_analyzing = v end) +local trace_normalizing = false registertracker("math.normalizing", function(v) trace_normalizing = v end) +local trace_collapsing = false registertracker("math.collapsing", function(v) trace_collapsing = v end) +local trace_goodies = false registertracker("math.goodies", function(v) trace_goodies = v end) -local check_coverage = true registerdirective("math.checkcoverage", function(v) check_coverage = v end) -local use_math_goodies = true registerdirective("math.nogoodies", function(v) use_math_goodies = not v end) +local check_coverage = true registerdirective("math.checkcoverage", function(v) check_coverage = v end) +local use_math_goodies = true registerdirective("math.nogoodies", function(v) use_math_goodies = not v end) -local report_processing = logreporter("mathematics","processing") -local report_remapping = logreporter("mathematics","remapping") -local report_normalizing = logreporter("mathematics","normalizing") -local report_collapsing = logreporter("mathematics","collapsing") -local report_goodies = logreporter("mathematics","goodies") +local report_processing = logreporter("mathematics","processing") +local report_remapping = logreporter("mathematics","remapping") +local report_normalizing = logreporter("mathematics","normalizing") +local report_collapsing = logreporter("mathematics","collapsing") +local report_goodies = logreporter("mathematics","goodies") -local a_mathrendering = privateattribute("mathrendering") -local a_exportstatus = privateattribute("exportstatus") +local a_mathrendering = privateattribute("mathrendering") +local a_exportstatus = privateattribute("exportstatus") local nuts = nodes.nuts local nodepool = nuts.pool @@ -122,6 +116,8 @@ local getwhd = nuts.getwhd local getdelimiter = nuts.getdelimiter local getleftdelimiter = nuts.getleftdelimiter local getrightdelimiter = nuts.getrightdelimiter +local gettopdelimiter = nuts.gettopdelimiter +local getbottomdelimiter = nuts.getbottomdelimiter local getnumerator = nuts.getnumerator local getdenominator = nuts.getdenominator local getdegree = nuts.getdegree @@ -150,6 +146,8 @@ local setoffsets = nuts.setoffsets local getoptions = nuts.getoptions local setoptions = nuts.setoptions +local setprop = nuts.setprop + local flushnode = nuts.flush local copy_node = nuts.copy local slide_nodes = nuts.slide @@ -173,14 +171,14 @@ local variables = interfaces.variables local texsetattribute = tex.setattribute local texgetattribute = tex.getattribute local getfontoffamily = tex.getfontoffamily -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue local implement = interfaces.implement -local v_reset = variables.reset -local v_small = variables.small -local v_medium = variables.medium -local v_big = variables.big -local v_line = variables.line +local v_reset = variables.reset +local v_small = variables.small +local v_medium = variables.medium +local v_big = variables.big +local v_line = variables.line local chardata = characters.data @@ -202,38 +200,38 @@ local nodecodes = nodes.nodecodes local fencecodes = nodes.fencecodes local classes = mathematics.classes -- or nodes.noadcodes -local ordinary_class = classes.ordinary -local operator_class = classes.operator -local binary_class = classes.binary -local relation_class = classes.relation -local open_class = classes.open -local close_class = classes.close -local middle_class = classes.middle -local punctuation_class = classes.punctuation -local fenced_class = classes.fenced -local fraction_class = classes.fraction -local radical_class = classes.radical -local accent_class = classes.accent -local numbergroup_class = classes.numbergroup -local digit_class = classes.digit - -local noad_code = nodecodes.noad -local accent_code = nodecodes.accent -local radical_code = nodecodes.radical -local fraction_code = nodecodes.fraction -local subbox_code = nodecodes.subbox -local submlist_code = nodecodes.submlist -local mathchar_code = nodecodes.mathchar -local mathtextchar_code = nodecodes.mathtextchar -local delimiter_code = nodecodes.delimiter ------ style_code = nodecodes.style ------ parameter_code = nodecodes.parameter -local math_choice = nodecodes.choice -local fence_code = nodecodes.fence - -local leftfence_code = fencecodes.left -local middlefence_code = fencecodes.middle -local rightfence_code = fencecodes.right +local ordinary_class = classes.ordinary +local operator_class = classes.operator +local binary_class = classes.binary +local relation_class = classes.relation +local open_class = classes.open +local close_class = classes.close +local middle_class = classes.middle +local punctuation_class = classes.punctuation +local fenced_class = classes.fenced +local fraction_class = classes.fraction +local radical_class = classes.radical +local accent_class = classes.accent +local numbergroup_class = classes.numbergroup +local digit_class = classes.digit + +local noad_code = nodecodes.noad +local accent_code = nodecodes.accent +local radical_code = nodecodes.radical +local fraction_code = nodecodes.fraction +local subbox_code = nodecodes.subbox +local submlist_code = nodecodes.submlist +local mathchar_code = nodecodes.mathchar +local mathtextchar_code = nodecodes.mathtextchar +local delimiter_code = nodecodes.delimiter +----- style_code = nodecodes.style +----- parameter_code = nodecodes.parameter +local math_choice = nodecodes.choice +local fence_code = nodecodes.fence + +local leftfence_code = fencecodes.left +local middlefence_code = fencecodes.middle +local rightfence_code = fencecodes.right -- this initial stuff is tricky as we can have removed and new nodes with the same address -- the only way out is a free-per-page list of nodes (not bad anyway) @@ -253,10 +251,11 @@ local function process(start,what,n,parent) -- local initial = start -- - slide_nodes(start) -- we still miss a prev in noads -- fences test code +-- slide_nodes(start) -- we still miss a prev in noads -- fences test code -- while start do - local id = getid(start) + local noad = nil + local id = getid(start) if trace_processing then if id == noad_code then report_processing("%w%S, class %a",n*2,nutstring(start),classes[getsubtype(start)]) @@ -290,51 +289,53 @@ local function process(start,what,n,parent) end elseif id == noad_code then -- single characters are like this - local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list - noad = getsup(start) if noad then process(noad,what,n,start) end -- list - noad = getsub(start) if noad then process(noad,what,n,start) end -- list - noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list - noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list - noad = getprime(start) if noad then process(noad,what,n,start) end -- list + noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list + noad = getsup(start) if noad then process(noad,what,n,start) end -- list + noad = getsub(start) if noad then process(noad,what,n,start) end -- list + noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list + noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list + noad = getprime(start) if noad then process(noad,what,n,start) end -- list elseif id == mathchar_code or id == mathtextchar_code or id == delimiter_code then break elseif id == subbox_code or id == submlist_code then - local noad = getlist(start) if noad then process(noad,what,n,start) end -- list (not getlist !) + noad = getlist(start) if noad then process(noad,what,n,start) end -- list (not getlist !) elseif id == fraction_code then - local noad = getnumerator(start) if noad then process(noad,what,n,start) end -- list - noad = getdenominator(start) if noad then process(noad,what,n,start) end -- list - noad = getleftdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter - noad = getdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter - noad = getrightdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter - elseif id == math_choice then - local noad = getchoice(start,1) if noad then process(noad,what,n,start) end -- list - noad = getchoice(start,2) if noad then process(noad,what,n,start) end -- list - noad = getchoice(start,3) if noad then process(noad,what,n,start) end -- list - noad = getchoice(start,4) if noad then process(noad,what,n,start) end -- list + noad = getnumerator(start) if noad then process(noad,what,n,start) end -- list + noad = getdenominator(start) if noad then process(noad,what,n,start) end -- list + noad = getleftdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter + noad = getdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter + noad = getrightdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter elseif id == fence_code then - local noad = getdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter - noad = gettop(start) if noad then process(noad,what,n,start) end -- list - noad = getbottom(start) if noad then process(noad,what,n,start) end -- list + noad = getdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter + noad = gettop(start) if noad then process(noad,what,n,start) end -- list + noad = getbottom(start) if noad then process(noad,what,n,start) end -- list elseif id == radical_code then - local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list - noad = getsup(start) if noad then process(noad,what,n,start) end -- list - noad = getsub(start) if noad then process(noad,what,n,start) end -- list - noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list - noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list - noad = getprime(start) if noad then process(noad,what,n,start) end -- delimiter - noad = getleftdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter - noad = getrightdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter - noad = getdegree(start) if noad then process(noad,what,n,start) end -- list + noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list + noad = getsup(start) if noad then process(noad,what,n,start) end -- list + noad = getsub(start) if noad then process(noad,what,n,start) end -- list + noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list + noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list + noad = getprime(start) if noad then process(noad,what,n,start) end -- delimiter + noad = getleftdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter + noad = getrightdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter + noad = gettopdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter + noad = getbottomdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter + noad = getdegree(start) if noad then process(noad,what,n,start) end -- list elseif id == accent_code then - local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list - noad = getsup(start) if noad then process(noad,what,n,start) end -- list - noad = getsub(start) if noad then process(noad,what,n,start) end -- list - noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list - noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list - noad = getprime(start) if noad then process(noad,what,n,start) end -- list - noad = gettop(start) if noad then process(noad,what,n,start) end -- list - noad = getmiddle(start) if noad then process(noad,what,n,start) end -- list - noad = getbottom(start) if noad then process(noad,what,n,start) end -- list + noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list + noad = getsup(start) if noad then process(noad,what,n,start) end -- list + noad = getsub(start) if noad then process(noad,what,n,start) end -- list + noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list + noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list + noad = getprime(start) if noad then process(noad,what,n,start) end -- list + noad = gettop(start) if noad then process(noad,what,n,start) end -- list + noad = getmiddle(start) if noad then process(noad,what,n,start) end -- list + noad = getbottom(start) if noad then process(noad,what,n,start) end -- list + elseif id == math_choice then + noad = getchoice(start,1) if noad then process(noad,what,n,start) end -- list + noad = getchoice(start,2) if noad then process(noad,what,n,start) end -- list + noad = getchoice(start,3) if noad then process(noad,what,n,start) end -- list + noad = getchoice(start,4) if noad then process(noad,what,n,start) end -- list -- elseif id == style_code then -- -- has a next -- elseif id == parameter_code then @@ -353,49 +354,51 @@ local function processnested(current,what,n) local noad = nil local id = getid(current) if id == noad_code then - noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list - noad = getsup(current) if noad then process(noad,what,n,current) end -- list - noad = getsub(current) if noad then process(noad,what,n,current) end -- list - noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list - noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list - noad = getprime(current) if noad then process(noad,what,n,current) end -- list + noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list + noad = getsup(current) if noad then process(noad,what,n,current) end -- list + noad = getsub(current) if noad then process(noad,what,n,current) end -- list + noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list + noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list + noad = getprime(current) if noad then process(noad,what,n,current) end -- list elseif id == subbox_code or id == submlist_code then - noad = getlist(current) if noad then process(noad,what,n,current) end -- list (not getlist !) + noad = getlist(current) if noad then process(noad,what,n,current) end -- list (not getlist !) elseif id == fraction_code then - noad = getnumerator(current) if noad then process(noad,what,n,current) end -- list - noad = getdenominator(current) if noad then process(noad,what,n,current) end -- list - noad = getleftdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter - noad = getdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter - noad = getrightdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter - elseif id == math_choice then - noad = getchoice(start,1) if noad then process(noad,what,n,current) end -- list - noad = getchoice(start,2) if noad then process(noad,what,n,current) end -- list - noad = getchoice(start,3) if noad then process(noad,what,n,current) end -- list - noad = getchoice(start,4) if noad then process(noad,what,n,current) end -- list + noad = getnumerator(current) if noad then process(noad,what,n,current) end -- list + noad = getdenominator(current) if noad then process(noad,what,n,current) end -- list + noad = getleftdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter + noad = getdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter + noad = getrightdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter elseif id == fence_code then - noad = getdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter - noad = gettop(current) if noad then process(noad,what,n,current) end -- list - noad = getbottom(current) if noad then process(noad,what,n,current) end -- list + noad = getdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter + noad = gettop(current) if noad then process(noad,what,n,current) end -- list + noad = getbottom(current) if noad then process(noad,what,n,current) end -- list elseif id == radical_code then - noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list - noad = getsup(current) if noad then process(noad,what,n,current) end -- list - noad = getsub(current) if noad then process(noad,what,n,current) end -- list - noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list - noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list - noad = getprime(current) if noad then process(noad,what,n,current) end -- list - noad = getleftdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter - noad = getrightdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter - noad = getdegree(current) if noad then process(noad,what,n,current) end -- list + noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list + noad = getsup(current) if noad then process(noad,what,n,current) end -- list + noad = getsub(current) if noad then process(noad,what,n,current) end -- list + noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list + noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list + noad = getprime(current) if noad then process(noad,what,n,current) end -- list + noad = getleftdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter + noad = getrightdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter + noad = gettopdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter + noad = getbottomdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter + noad = getdegree(current) if noad then process(noad,what,n,current) end -- list elseif id == accent_code then - noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list - noad = getsup(current) if noad then process(noad,what,n,current) end -- list - noad = getsub(current) if noad then process(noad,what,n,current) end -- list - noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list - noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list - noad = getprime(current) if noad then process(noad,what,n,current) end -- list - noad = gettop(current) if noad then process(noad,what,n,current) end -- list - noad = getmiddle(current) if noad then process(noad,what,n,current) end -- list - noad = getbottom(current) if noad then process(noad,what,n,current) end -- list + noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list + noad = getsup(current) if noad then process(noad,what,n,current) end -- list + noad = getsub(current) if noad then process(noad,what,n,current) end -- list + noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list + noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list + noad = getprime(current) if noad then process(noad,what,n,current) end -- list + noad = gettop(current) if noad then process(noad,what,n,current) end -- list + noad = getmiddle(current) if noad then process(noad,what,n,current) end -- list + noad = getbottom(current) if noad then process(noad,what,n,current) end -- list + elseif id == math_choice then + noad = getchoice(start,1) if noad then process(noad,what,n,current) end -- list + noad = getchoice(start,2) if noad then process(noad,what,n,current) end -- list + noad = getchoice(start,3) if noad then process(noad,what,n,current) end -- list + noad = getchoice(start,4) if noad then process(noad,what,n,current) end -- list end end @@ -403,49 +406,51 @@ local function processstep(current,process,n,id) local noad = nil local id = id or getid(current) if id == noad_code then - noad = getnucleus(current) if noad then process(noad,n,current) end -- list - noad = getsup(current) if noad then process(noad,n,current) end -- list - noad = getsub(current) if noad then process(noad,n,current) end -- list - noad = getsuppre(current) if noad then process(noad,n,current) end -- list - noad = getsubpre(current) if noad then process(noad,n,current) end -- list - noad = getprime(current) if noad then process(noad,n,current) end -- list + noad = getnucleus(current) if noad then process(noad,n,current) end -- list + noad = getsup(current) if noad then process(noad,n,current) end -- list + noad = getsub(current) if noad then process(noad,n,current) end -- list + noad = getsuppre(current) if noad then process(noad,n,current) end -- list + noad = getsubpre(current) if noad then process(noad,n,current) end -- list + noad = getprime(current) if noad then process(noad,n,current) end -- list elseif id == subbox_code or id == submlist_code then - noad = getlist(current) if noad then process(noad,n,current) end -- list (not getlist !) + noad = getlist(current) if noad then process(noad,n,current) end -- list (not getlist !) elseif id == fraction_code then - noad = getnumerator(current) if noad then process(noad,n,current) end -- list - noad = getdenominator(current) if noad then process(noad,n,current) end -- list - noad = getleftdelimiter(current) if noad then process(noad,n,current) end -- delimiter - noad = getdelimiter(current) if noad then process(noad,n,current) end -- delimiter - noad = getrightdelimiter(current) if noad then process(noad,n,current) end -- delimiter - elseif id == math_choice then - noad = getchoice(start,1) if noad then process(noad,n,current) end -- list - noad = getchoice(start,2) if noad then process(noad,n,current) end -- list - noad = getchoice(start,3) if noad then process(noad,n,current) end -- list - noad = getchoice(start,4) if noad then process(noad,n,current) end -- list + noad = getnumerator(current) if noad then process(noad,n,current) end -- list + noad = getdenominator(current) if noad then process(noad,n,current) end -- list + noad = getleftdelimiter(current) if noad then process(noad,n,current) end -- delimiter + noad = getdelimiter(current) if noad then process(noad,n,current) end -- delimiter + noad = getrightdelimiter(current) if noad then process(noad,n,current) end -- delimiter elseif id == fence_code then - noad = getdelimiter(current) if noad then process(noad,n,current) end -- delimiter - noad = gettop(current) if noad then process(noad,n,current) end -- list - noad = getbottom(current) if noad then process(noad,n,current) end -- list + noad = getdelimiter(current) if noad then process(noad,n,current) end -- delimiter + noad = gettop(current) if noad then process(noad,n,current) end -- list + noad = getbottom(current) if noad then process(noad,n,current) end -- list elseif id == radical_code then - noad = getnucleus(current) if noad then process(noad,n,current) end -- list - noad = getsup(current) if noad then process(noad,n,current) end -- list - noad = getsub(current) if noad then process(noad,n,current) end -- list - noad = getsuppre(current) if noad then process(noad,n,current) end -- list - noad = getsubpre(current) if noad then process(noad,n,current) end -- list - noad = getprime(current) if noad then process(noad,n,current) end -- delimiter - noad = getleftdelimiter(current) if noad then process(noad,n,current) end -- delimiter - noad = getrightdelimiter(current) if noad then process(noad,n,current) end -- delimiter - noad = getdegree(current) if noad then process(noad,n,current) end -- list + noad = getnucleus(current) if noad then process(noad,n,current) end -- list + noad = getsup(current) if noad then process(noad,n,current) end -- list + noad = getsub(current) if noad then process(noad,n,current) end -- list + noad = getsuppre(current) if noad then process(noad,n,current) end -- list + noad = getsubpre(current) if noad then process(noad,n,current) end -- list + noad = getprime(current) if noad then process(noad,n,current) end -- delimiter + noad = getleftdelimiter(current) if noad then process(noad,n,current) end -- delimiter + noad = getrightdelimiter(current) if noad then process(noad,n,current) end -- delimiter + noad = gettopdelimiter(current) if noad then process(noad,n,current) end -- delimiter + noad = getbottomdelimiter(current) if noad then process(noad,n,current) end -- delimiter + noad = getdegree(current) if noad then process(noad,n,current) end -- list elseif id == accent_code then - noad = getnucleus(current) if noad then process(noad,n,current) end -- list - noad = getsup(current) if noad then process(noad,n,current) end -- list - noad = getsub(current) if noad then process(noad,n,current) end -- list - noad = getsuppre(current) if noad then process(noad,n,current) end -- list - noad = getsubpre(current) if noad then process(noad,n,current) end -- list - noad = getprime(current) if noad then process(noad,n,current) end -- list - noad = gettop(current) if noad then process(noad,n,current) end -- list - noad = getmiddle(current) if noad then process(noad,n,current) end -- list - noad = getbottom(current) if noad then process(noad,n,current) end -- list + noad = getnucleus(current) if noad then process(noad,n,current) end -- list + noad = getsup(current) if noad then process(noad,n,current) end -- list + noad = getsub(current) if noad then process(noad,n,current) end -- list + noad = getsuppre(current) if noad then process(noad,n,current) end -- list + noad = getsubpre(current) if noad then process(noad,n,current) end -- list + noad = getprime(current) if noad then process(noad,n,current) end -- list + noad = gettop(current) if noad then process(noad,n,current) end -- list + noad = getmiddle(current) if noad then process(noad,n,current) end -- list + noad = getbottom(current) if noad then process(noad,n,current) end -- list + elseif id == math_choice then + noad = getchoice(start,1) if noad then process(noad,n,current) end -- list + noad = getchoice(start,2) if noad then process(noad,n,current) end -- list + noad = getchoice(start,3) if noad then process(noad,n,current) end -- list + noad = getchoice(start,4) if noad then process(noad,n,current) end -- list end end @@ -524,7 +529,7 @@ end do local families = { } - local a_mathfamily = privateattribute("mathfamily") + local a_mathfamily = privateattribute("mathfamily") local boldmap = mathematics.boldmap local trace_families = false registertracker("math.families", function(v) trace_families = v end) @@ -542,20 +547,6 @@ do "pseudobold", } - families[fraction_code] = function(pointer,what,n,parent) - local a = getattr(pointer,a_mathfamily) - if a and a >= 0 then - if a > 0 then - setattr(pointer,a_mathfamily,0) - if a > 5 then - a = a - 3 - end - end - setfam(pointer,a) - end - processnested(pointer,families,n+1) - end - families[noad_code] = function(pointer,what,n,parent) local a = getattr(pointer,a_mathfamily) if a and a >= 0 then @@ -570,6 +561,11 @@ do processnested(pointer,families,n+1) end + families[fraction_code] = families[noad_code] + families[accent_code] = families[noad_code] -- added 2023-07 + families[radical_code] = families[noad_code] -- added 2023-07 + families[fence_code] = families[noad_code] -- added 2023-07 + families[mathchar_code] = function(pointer) if getfam(pointer) == 0 then local a = getattr(pointer,a_mathfamily) @@ -616,37 +612,6 @@ do end end - -- families[delimiter_code] = function(pointer) - -- if getfield(pointer,"smallfamily") == 0 then - -- local a = getattr(pointer,a_mathfamily) - -- if a and a > 0 then - -- setattr(pointer,a_mathfamily,0) - -- if a > 5 then - -- -- no bold delimiters in unicode - -- a = a - 3 - -- end - -- local fam = getfontoffamily(a) - -- local char = getfield(pointer,"smallchar") - -- local okay = fontcharacters[fam][char] - -- if okay then - -- setfield(pointer,"smallfamily",a) - -- elseif a > 2 then - -- setfield(pointer,"smallfamily",a-3) - -- end - -- local char = getfield(pointer,"largechar") - -- local okay = fontcharacters[fam][char] - -- if okay then - -- setfield(pointer,"largefamily",a) - -- elseif a > 2 then - -- setfield(pointer,"largefamily",a-3) - -- end - -- else - -- setfield(pointer,"smallfamily",0) - -- setfield(pointer,"largefamily",0) - -- end - -- end - -- end - -- has become: families[delimiter_code] = function(pointer) @@ -683,8 +648,8 @@ end do - local a_mathalphabet = privateattribute("mathalphabet") - local a_mathgreek = privateattribute("mathgreek") + local a_mathalphabet = privateattribute("mathalphabet") + local a_mathgreek = privateattribute("mathgreek") local relocate = { } @@ -707,7 +672,7 @@ do local char, font = getcharspec(pointer) local data = fontcharacters[font] if not data[char] then - local specials = characters.data[char].specials + local specials = chardata[char].specials if specials and (specials[1] == "char" or specials[1] == "font") then local newchar = specials[#specials] if trace_remapping then @@ -853,95 +818,86 @@ do end --- some resize options (this works ok because the content is --- empty and no larger next will be forced) +-- -- We now use the engine feature and a bit of different lua interfacing to it but +-- -- that code is located elsewhere. -- --- beware: we don't use \delcode but \Udelcode and as such have --- no largefamily; also, we need to check for subtype and/or --- smallfamily not being 0 because \. sits in 0,0 by default +-- do -- --- todo: just replace the character by an ord noad --- and remove the right delimiter as well - -do - - -- todo: use registerattribute - - local a_mathsize = privateattribute("mathsize") -- this might move into other fence code - local resize = { } - - local trace_fences = false registertracker("math.fences", function(v) trace_fences = v end) - local report_fences = logreporter("mathematics","fences") - - resize[fence_code] = function(pointer) - local subtype = getsubtype(pointer) - -- if subtype == leftfence_code or subtype == rightfence_code then - local a = getattr(pointer,a_mathsize) - if a and a > 0 then - local method = div(a,100) - local size = a % 100 - setattr(pointer,a_mathsize,0) - if size ~= 0 then - local delimiter = getdelimiter(pointer) - if delimiter then - local oldchar, font, fam = getcharspec(delimiter) - if oldchar > 0 and font > 0 then - local ht = getheight(pointer) - local dp = getdepth(pointer) - local data = fontdata[font] - local characters = data.characters - local olddata = characters[oldchar] - if olddata then - local template = olddata.varianttemplate - local newchar = mathematics.big(data,template or oldchar,size,method) - local newdata = characters[newchar] - local newheight = newdata.height or 0 - local newdepth = newdata.depth or 0 - if template then - setheight(pointer,newheight) - setdepth(pointer,newdepth) - if not olddata.extensible then - -- check this on bonum and antykwa - setoptions(pointer,0) - end - setoptions(pointer,getoptions(pointer)| tex.noadoptioncodes.scale ) - if trace_fences then - report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template) - end - else - -- 1 scaled point is a signal, for now - if ht == 1 then - setheight(pointer,newheight) - end - if dp == 1 then - setdepth(pointer,newdepth) - end - setchar(delimiter,newchar) - if trace_fences then - report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size) - end - end - elseif trace_fences then - report_fences("not replacing %C using method %a and size %a",oldchar,method,size) - end - end - end - end - end - -- end - end - - function handlers.resize(head,style,penalties) - processnoads(head,resize,"resize") - end - -end +-- local a_mathsize = privateattribute("mathsize") -- this might move into other fence code +-- local resize = { } +-- +-- local trace_fences = false registertracker("math.fences", function(v) trace_fences = v end) +-- local report_fences = logreporter("mathematics","fences") +-- +-- resize[fence_code] = function(pointer) +-- local subtype = getsubtype(pointer) +-- -- if subtype == leftfence_code or subtype == rightfence_code then +-- local a = getattr(pointer,a_mathsize) +-- if a and a > 0 then +-- local method = div(a,100) +-- local size = a % 100 +-- setattr(pointer,a_mathsize,0) +-- if size ~= 0 then +-- local delimiter = getdelimiter(pointer) +-- if delimiter then +-- local oldchar, font, fam = getcharspec(delimiter) +-- if oldchar > 0 and font > 0 then +-- local ht = getheight(pointer) +-- local dp = getdepth(pointer) +-- local data = fontdata[font] +-- local characters = data.characters +-- local olddata = characters[oldchar] +-- if olddata then +-- local template = olddata.varianttemplate +-- local newchar = mathematics.big(data,template or oldchar,size,method) +-- local newdata = characters[newchar] +-- local newheight = newdata.height or 0 +-- local newdepth = newdata.depth or 0 +-- if template then +-- setheight(pointer,newheight) +-- setdepth(pointer,newdepth) +-- if not olddata.extensible then +-- -- check this on bonum and antykwa +-- setoptions(pointer,0) +-- end +-- setoptions(pointer,getoptions(pointer)| tex.noadoptioncodes.scale ) +-- if trace_fences then +-- report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template) +-- end +-- else +-- -- 1 scaled point is a signal, for now +-- if ht == 1 then +-- setheight(pointer,newheight) +-- end +-- if dp == 1 then +-- setdepth(pointer,newdepth) +-- end +-- setchar(delimiter,newchar) +-- if trace_fences then +-- report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size) +-- end +-- end +-- elseif trace_fences then +-- report_fences("not replacing %C using method %a and size %a",oldchar,method,size) +-- end +-- end +-- end +-- end +-- end +-- -- end +-- end +-- +-- function handlers.resize(head,style,penalties) +-- processnoads(head,resize,"resize") +-- end +-- +-- end -- still not perfect: do - local a_autofence = privateattribute("mathautofence") + local a_autofence = privateattribute("mathautofence") local autofences = { } local dummyfencechar = 0x2E @@ -1295,11 +1251,14 @@ do local unstack = { } noads.processors.unstack = unstack local enabled = false - local a_unstack = privateattribute("mathunstack") + local a_unstack = privateattribute("mathunstack") local trace_unstacking = false registertracker("math.unstack", function(v) trace_unstacking = v end) local report_unstacking = logreporter("mathematics","unstack") + local shiftedsubscript_code = tex.noadoptioncodes.shiftedsubscript + local shiftedsuperscript_code = tex.noadoptioncodes.shiftedsuperscript + unstack[noad_code] = function(pointer) local a = getattr(pointer,a_unstack) if a then @@ -1310,9 +1269,9 @@ do -- report_unstacking() -- todo ... what to show ... -- end if a == 1 then - a = tex.noadoptioncodes.shiftedsubscript + a = shiftedsubscript_code elseif a == 2 then - a = tex.noadoptioncodes.shiftedsuperscript + a = shiftedsuperscript_code else a = 0 end @@ -1457,6 +1416,10 @@ do end + local otf = fonts.handlers.otf + local registerotffeature = fonts.constructors.features.otf.register + ----- getalternate = otf.getalternate (runtime new method so ...) + registerotffeature { name = "mathalternates", description = "additional math alternative shapes", @@ -1466,11 +1429,9 @@ do } } - -- local getalternate = otf.getalternate (runtime new method so ...) - -- todo: not shared but copies ... one never knows - local a_mathalternate = privateattribute("mathalternate") + local a_mathalternate = privateattribute("mathalternate") local alternate = { } -- processors.alternate = alternate local fontdata = fonts.hashes.identifiers local fontresources = fonts.hashes.resources @@ -1490,13 +1451,18 @@ do attribute = 0 local alternates = mathalternates.alternates for s in gmatch(tag,"[^, ]+") do + local n, s = match(s,"^([+-]*)(.*)$") if s == v_reset then resets[tag] = true current = unsetvalue else local a = alternates[s] -- or known[s] if a then - attribute = attribute | a + if n == "-" then + attribute = attribute & ~a + else + attribute = attribute | a + end end end end @@ -1561,14 +1527,14 @@ do local alt = hashes[i][char] if alt == nil then local what = attributes[r] -local list = what.list -if not list or list[char] then + local list = what.list + if not list or list[char] then alt = otf.getalternate(fontdata[fontid],char,what.feature,what.value) or false - if alt == char then - alt = false + if alt == char then + alt = false + end + hashes[i][char] = alt end - hashes[i][char] = alt -end end if alt then if trace_alternates then @@ -1598,171 +1564,8 @@ end end --- italics: we assume that only characters matter --- --- = we check for correction first because accessing nodes is slower --- = the actual glyph is not that important (we can control it with numbers) - --- Italic correction in luatex math is (was) a mess. There are all kind of assumptions based on --- old fonts and new fonts. Eventually there should be a flag that can signal to ignore all --- those heuristics. We want to deal with it ourselves also in the perspective of mixed math --- and text. Also, for a while in context we had to deal with a mix of virtual math fonts and --- real ones. - --- in opentype the italic correction of a limop is added to the width and luatex does --- some juggling that we want to avoid but we need to do something here (in fact, we could --- better fix the width of the character) - --- do --- --- local a_mathitalics = privateattribute("mathitalics") --- --- local trace_italics = false registertracker("math.italics", function(v) trace_italics = v end) --- local report_italics = logreporter("mathematics","italics") --- --- local italics = { } --- --- local function getcorrection(method,font,char) -- -- or character.italic -- (this one is for tex) --- --- local visual = chardata[char].visual --- --- if method == 1 then --- -- check on state --- local italics = fontitalics[font] --- if italics then --- local character = fontcharacters[font][char] --- if character then --- local correction = character.italic --- if correction and correction ~= 0 then --- return correction, visual --- end --- end --- end --- elseif method == 2 then --- -- no check --- local character = fontcharacters[font][char] --- if character then --- local correction = character.italic --- if correction and correction ~= 0 then --- return correction, visual --- end --- end --- elseif method == 3 then --- -- check on visual --- if visual == "it" or visual == "bi" then --- local character = fontcharacters[font][char] --- if character then --- local correction = character.italic --- if correction and correction ~= 0 then --- return correction, visual --- end --- end --- end --- elseif method == 4 then --- -- combination of 1 and 3 --- local italics = fontitalics[font] --- if italics and (visual == "it" or visual == "bi") then --- local character = fontcharacters[font][char] --- if character then --- local correction = character.italic --- if correction and correction ~= 0 then --- return correction, visual --- end --- end --- end --- end --- --- end --- --- -- basically the engine should set it --- --- italics[mathchar_code] = function(pointer,what,n,parent) --- local method = getattr(pointer,a_mathitalics) --- if method and method > 0 and method < 100 then --- local char, font = getcharspec(pointer) --- local correction, visual = getcorrection(method,font,char) --- if correction and correction ~= 0 then --- local next_noad = getnext(parent) --- if not next_noad then --- if n == 1 then --- -- only at the outer level .. will become an option (always,endonly,none) --- if trace_italics then --- report_italics("method %a, flagging italic correction %p between %C and end math",method,correction,char) --- end --- if correction > 0 then --- correction = correction + 100 --- else --- correction = correction - 100 --- end --- correction = round(correction) --- setattr(pointer,a_mathitalics,correction) --- setattr(parent,a_mathitalics,correction) --- return -- so no reset later on --- end --- end --- end --- end --- setattr(pointer,a_mathitalics,unsetvalue) --- end --- --- function handlers.italics(head,style,penalties) --- processnoads(head,italics,"italics") --- end --- --- local enable = function() --- enableaction("math", "noads.handlers.italics") --- if trace_italics then --- report_italics("enabling math italics") --- end --- -- we enable math (unless already enabled elsewhere) --- typesetters.italics.enablemath() --- enable = false --- end --- --- -- best do this only on math mode (less overhead) --- --- function mathematics.setitalics(name) --- if enable then --- enable() --- end --- texsetattribute(a_mathitalics,name and name ~= v_reset and tonumber(name) or unsetvalue) -- maybe also v_none --- end --- --- function mathematics.getitalics(name) --- if enable then --- enable() --- end --- context(name and name ~= v_reset and tonumber(name) or unsetvalue) --- end --- --- function mathematics.resetitalics() --- texsetattribute(a_mathitalics,unsetvalue) --- end --- --- implement { --- name = "initializemathitalics", --- actions = enable, --- onlyonce = true, --- } --- --- implement { --- name = "setmathitalics", --- actions = mathematics.setitalics, --- arguments = "string", --- } --- --- implement { --- name = "getmathitalics", --- actions = mathematics.getitalics, --- arguments = "string", --- } --- --- implement { --- name = "resetmathitalics", --- actions = mathematics.resetitalics --- } --- --- end +-- Italic correction control has been removed here. You can find it in the files +-- for \MKIV. The left-over code deals with text-math boundaries. do @@ -1795,7 +1598,7 @@ do -- }, -- } - local a_kernpairs = privateattribute("mathkernpairs") + local a_kernpairs = privateattribute("mathkernpairs") local kernpairs = { } local trace_kernpairs = false registertracker("math.kernpairs", function(v) trace_kernpairs = v end) @@ -1866,9 +1669,9 @@ end do - local a_numbers = privateattribute("mathnumbers") - local a_spacing = privateattribute("mathspacing") - local a_fencing = privateattribute("mathfencing") + local a_numbers = privateattribute("mathnumbers") + local a_spacing = privateattribute("mathspacing") + local a_fencing = privateattribute("mathfencing") local numbers = { } local spacing = { } @@ -1909,7 +1712,7 @@ do 0x2980, } - local followedbyspace_code = tex.noadoptioncodes.followedbyspace + local followedbyspace_code = tex.noadoptioncodes.followedbyspace local function followedbyspace(n) return n and (getoptions(n) & followedbyspace_code == followedbyspace_code) @@ -1935,7 +1738,9 @@ do if digits[rc] then local newchar = found[alternative] local class = followedbyspace(parent) and punctuation_class or ordinary_class - setsubtype(parent,class) + -- noad class == subtype +-- setsubtype(parent,class) +setclass(parent,class) if newchar ~= oldchar then setchar(pointer,newchar) end @@ -1981,12 +1786,13 @@ do if prev then local class = followedbyspace(prev) and relation_class or punctuation_class local newchar = found[class] - setsubtype(parent,class) +-- setsubtype(parent,class) +setclass(parent,class) if newchar ~= oldchar then setchar(pointer,newchar) end -- if trace_spacing then - -- report_spacinf("spacer colon") + -- report_spacing("spacer colon") -- end end return @@ -2038,8 +1844,8 @@ do local f2 = makefence(chr,fam,middlefence_code,middle_class,pointer) setlink(prev,f1,f2,next) flushnode(parent) -followbyspace(f1) -followbyspace(f2) + followbyspace(f1) + followbyspace(f2) return true, f2 else return true, parent @@ -2116,7 +1922,7 @@ do -- is validpair stil needed? why not always now? - local a_mathcollapsing = privateattribute("mathcollapsing") + local a_mathcollapsing = privateattribute("mathcollapsing") local collapse = { } local mathlists = characters.mathlists local validpair = { @@ -2134,12 +1940,20 @@ do local reported = setmetatableindex("table") + -- We could move primes to its own handler but we need to run this one anyway + -- so for now we keep it here. + mathlists[39] = { [39] = { [39] = { enforced = 0x2034, [39] = { enforced = 0x2057 } }, enforced = 0x2033 }, enforced = 0x2032 } mathlists[96] = { [96] = { [96] = { enforced = 0x2037 }, enforced = 0x2036 }, enforced = 0x2035 } + local getchardict = nuts.getchardict + local setchardict = nuts.setchardict + + local groups = mathematics.dictionaries.groups + collapse[mathchar_code] = function(pointer,what,n,parent) if parent and mathlists[getchar(pointer)] then - local found, last, lucleus, lsup, lsub, category + local found, last, lucleus, lsup, lsub, lprime, category local tree = mathlists local current = parent while current and validpair[getsubtype(current)] do @@ -2170,9 +1984,10 @@ do lucleus = nucleus lsup = sup lsub = sub + lprime = prime end tree = match - if sub or sup then + if sub or sup or prime then break else current = getnext(current) @@ -2199,6 +2014,22 @@ do elseif trace_collapsing then report_collapsing("%s ligature %C from %s","creating",found,category) end +-- we need to use the chardict of the replacement + +local properties, group = getchardict(pointer) +local c = chardata[found] +if c then + local g = c.mathgroup + if g then + group = groups[g] or 0xFFFF + else + group = 0xFFFF + end +else + group = 0xFFFF +end +setchardict(pointer,properties,group,found) + setchar(pointer,found) local l = getnext(last) local c = getnext(parent) @@ -2210,6 +2041,10 @@ do setsup(parent,lsup) setsup(last) end + if lprime then + setprime(parent,lprime) + setprime(last) + end while c ~= l do local n = getnext(c) flushnode(c) @@ -2240,84 +2075,11 @@ do end -do - - local fixscripts = { } - - local primes = { - -- primes - [0x2032] = true, - [0x2033] = true, - [0x2034] = true, - [0x2057] = true, - -- reverse primes - [0x2035] = true, - [0x2036] = true, - [0x2037] = true, - } - - local fixable = { - [noad_code] = true, - [accent_code] = true, - [radical_code] = true, - [fraction_code] = true, - } - - -- [prime|sub|sup]first - - fixscripts[mathchar_code] = function(pointer,what,n,parent,nested) -- todo: switch to turn it on and off - if parent then - local char = getchar(pointer) - if char and primes[char] then - local nuc = getnucleus(parent) - if pointer == nuc then - local prev = getprev(parent) - if prev and fixable[getid(prev)] then - local prevsup = getsup(prev) - local prevsub = getsub(prev) - local primesup = getsup(parent) - local primesub = getsub(parent) - setfield(prev,"scriptorder",prevsub and 2 or 1) -- sub first, then prime - if primesup and not prevsup then - setsup(prev,primesup) - primesup = nil - end - if primesub and not prevsub then - setsub(prev,primesub) - primesub = nil - end - setprime(prev,nuc) - setnucleus(parent) - if not primesup then - setsup(parent) - end - if not primesub then - setsub(parent) - end - if not (primesup or primesub) then - setlink(prev,getnext(parent)) - flushnode(parent) - return true, prev, prev - end - end - end - end - end - end - - function noads.handlers.fixscripts(head,style,penalties) - processnoads(head,fixscripts,"fixscripts") - end - -end - --- variants (upgraded for script too) - do local variants = { } - local chardata = characters.data - local a_variant = privateattribute("mathvariant") + ----- chardata = characters.data + local a_variant = privateattribute("mathvariant") local trace_variants = false registertracker("math.variants", function(v) trace_variants = v end) local report_variants = logreporter("mathematics","variants") @@ -2461,7 +2223,6 @@ do end - do local traversehlist = nuts.traversers.hlist @@ -2510,11 +2271,11 @@ do local newkern = nuts.pool.kern local setcolor = nodes.tracers.colors.set - local a_mathsnap = attributes.private("mathsnap") + local a_mathsnap = privateattribute("mathsnap") - local d_mathstrutht = tex.isdimen("mathstrutht") - local d_mathstrutdp = tex.isdimen("mathstrutdp") - local c_mathnesting = tex.iscount("mathnestinglevel") + local d_mathstrutht = tex.isdimen("mathstrutht") + local d_mathstrutdp = tex.isdimen("mathstrutdp") + local c_mathnesting = tex.iscount("mathnestinglevel") local trace_snapping = false registertracker("math.snapping", function(v) trace_snapping = v end) local report_snapping = logreporter("mathematics","snapping") @@ -2664,7 +2425,7 @@ end -- local domains = { } -- local categories = { } -- local numbers = { } --- local a_mathdomain = privateattribute("mathdomain") +-- local a_mathdomain = privateattribute("mathdomain") -- mathematics.domains = categories -- local permitted = { -- ordinary = ordinary_class, @@ -2843,7 +2604,9 @@ end do - local trace_dictionaries = false registertracker("math.dictionaries", function(v) trace_dictionaries = v end) + local trace_dictionaries = false registertracker("math.dictionaries", function(v) trace_dictionaries = v end) + local trace_details = false registertracker("math.dictionaries.details", function(v) trace_details = v end) + local report_dictionaries = logreporter("mathematics","dictionaries") local setnodecolor = colortracers.set @@ -2858,8 +2621,11 @@ do local function check(pointer,group,index) local v = variants[index] - if v and v[group] then - return group, class + if v then + local c = v[group] + if c then + return group, c + end end return 1 end @@ -2868,7 +2634,8 @@ do local properties, oldgroup, index, font, char = getchardict(pointer) local newgroup = 1 local newclass = false - local oldclass = getsubtype(pointer) +-- local oldclass = getsubtype(pointer) + local oldclass = getsubtype(parent) if (properties & 0x1) == 0x1 then newclass = oldclass newgroup = oldgroup @@ -2879,14 +2646,17 @@ do local nofgroups = groups and #groups if nofgroups > 0 then for i=1,nofgroups do - real, class = check(pointer,groups[i],index) - if real ~= 1 then + local group = groups[i] + local real, class = check(pointer,group,index) + if real ~= 1 then + newclass = class + newgroup = group goto done end end end else - newgroup, newclass = check(pointer,group,index) + newgroup, newclass = check(pointer,oldgroup,index) end ::done:: if newgroup == 1 then @@ -2894,19 +2664,23 @@ do end setchardict(pointer,properties,newgroup,index) if type(newclass) == "number" then +-- print(newgroup,newclass,oldclass) setsubtype(parent,newclass) +-- setsubtype(pointer,newclass) else newclass = oldclass end end - if trace_dictionaries then + if trace_dictionaries or trace_details then if newgroup > 1 then local groupname = groups[newgroup] if groupname then setnodecolor(pointer,"dictionary:"..groupname) end end - report_dictionaries("group 0x%02X -> 0x%02X, class 0x%02X -> 0x%02X, index %05X, %U %c",oldgroup,newgroup,oldclass,newclass,index,char,char) + if trace_details then + report_dictionaries("properties 0x%02X, group 0x%02X -> 0x%02X, class 0x%02X -> 0x%02X, index %05X, %U %c",properties,oldgroup,newgroup,oldclass,newclass,index,char,char) + end end end @@ -2950,6 +2724,89 @@ do end +do -- we don't need to support nesting here unless we run over sublists + + local trace_intervals = false registertracker("math.intervals", function(v) trace_intervals = v end) + local report_intervals = logreporter("mathematics","intervals") + + local a_mathintervals = privateattribute("mathintervals") + + local intervals = { } noads.processors.intervals = intervals + + -- ] a,b [ | [ a,b ] | ] a, b ] | [ a, b [ + + local firstclass = false + local firstparent = false + local firstpointer = false + local punctuation = false + + local ignored = { + [relation_class] = true, + [middle_class] = true, + [fenced_class] = true, + [fraction_class] = true, + [radical_class] = true, + [accent_class] = true, + } + + intervals[mathchar_code] = function(pointer,what,n,parent) + local class = getsubtype(pointer) + if class == open_class or class == close_class then + local c = getchar(pointer) + if c == 0x5B or c == 0x5D then -- c = 0x27E6 or c = 0x27E7 double ones + local a = getattr(pointer,a_mathintervals) + if not a then + firstclass = false + punctuation = false + elseif firstclass then + if not punctuation then + -- + else + if firstclass ~= open_class then + setclass(firstparent, open_class) + setprop(firstpointer,"swappedclass",open_class) + if trace_intervals then + report_intervals("setting class of %C to %a",getchar(firstpointer),"open") + end + end + if class ~= close_class then + setclass(parent, close_class) + setprop(pointer,"swappedclass",close_class) + if trace_intervals then + report_intervals("setting class of %C to %a",getchar(pointer),"close") + end + end + end + firstclass = false + punctuation = false + else + firstclass = class + firstpointer = pointer + firstparent = parent + end + else + firstclass = false + punctuation = false + end + elseif class == punctuation_class then + local c = getchar(pointer) + if c == 0x2C or c == 0x3A or c == 0x3B then -- , : ; + punctuation = true + else + punctuation = false + end + elseif ignored[class] then + firstclass = false + punctuation = false + end + end + + function handlers.intervals(head,style,penalties) + processnoads(head,intervals,"intervals") + end + +end + -- the normal builder -- do diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl index fa44fda2cec..ad42b70070f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl @@ -43,6 +43,33 @@ \mkern18mu (\mfunction{mod}\mskip\medmuskip#1)} +%D For the moment we use this in mathml: + +\protected\def\matrix#1% not permanent so we can overload + {\emptyhbox + \mskip\thinmuskip + \vcenter + {\normalbaselines + \mathsurround\zeropoint + \everycr\emptytoks + \tabskip\zeroskip + \halign{% + \hfil\normalstartimath\alignmark\alignmark\normalstopimath\hfil + \aligntab + \aligntab + \quad\hfil\normalstartimath\alignmark\alignmark\normalstopimath\hfil + \crcr + \mathstrut + \crcr + \noalign{\kern-\baselineskip} + #1\crcr + \mathstrut + \crcr + \noalign{\kern-\baselineskip}}}% + \mskip\thinmuskip} + +\permanent\aliased\let\plainmatrix\matrix + %D This comes from plain but I gave it a \CONTEXT\ touch. When Mikael and I are in %D the mood we will redo them in a more modern way. diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx index ee91243e0ae..849c7c4f6be 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx @@ -105,8 +105,11 @@ \c!height=\zeropoint, \c!depth=\zeropoint, \c!strut=\v!height, + % \c!mindepth=\zeropoint, + \c!mindepth=.20\exheight, % a reasonable default for: \im { \sqrt{1+x} + \sqrt{1-x} } \c!source=\zerocount, \c!left="221A, + \c!mathstyle=\v!normal, \c!right=\zerocount, \c!leftmargin=\zeropoint, \c!rightmargin=\zeropoint] @@ -128,9 +131,9 @@ \defcsname\??mathwhateverstrut\v!yes \endcsname{\strut} %letcsname\??mathwhateverstrut\v!no \endcsname\relax -\tolerant\protected\def\math_radical_handle#tag#*[#settings]#*[#degree]#:#body% +\tolerant\protected\def\math_radical_handle#tag#*[#S#settings]#*[#degree]#:#body% {\begingroup - \edef\currentmathradical{#tag}% + \cdef\currentmathradical{#tag}% \ifhastok={#settings}% \lettonothing\currentmathradicaldegree \setupcurrentmathradical[#settings]% @@ -188,7 +191,7 @@ % We use a strut in the degree because not all fonts have the right gaps set up but % as struts are sort of predictable we can now fix all fonts in the lfg file. -\protected\def\math_radical_common#degree% +\protected\def\math_radical_common#degree#body% {\scratchcounter\ifcstok{\mathradicalparameter\c!rule}\v!symbol \mathradicalparameter\c!top\relax \else @@ -198,33 +201,47 @@ \s!height\dimexpr\ifcstok{\mathradicalparameter\c!height}\v!none\scaledpoint\else\mathradicalparameter\c!height\fi\relax \s!depth \dimexpr\ifcstok{\mathradicalparameter\c!depth }\v!none\scaledpoint\else\mathradicalparameter\c!depth \fi\relax \s!source\numexpr\namedboxanchor{\mathradicalparameter\c!source}\relax - \s!style \normalmathstyle + \s!style \normalmathstyle % not needed \ifzeronum\scratchcounter\else top % \s!top \fi + \ifcstok{\mathradicalparameter\c!rule}\v!no + norule + \orelse\ifcstok{\lastnamedcs}\v!bottom + reflected % + \fi \zerocount \mathradicalparameter\c!left \zerocount \mathradicalparameter\c!right \ifzeronum\scratchcounter\else - \zerocount\scratchcounter + \zerocount\scratchcounter \fi \relax - {\mathstrut#degree}} + {\mathstrut#degree}% + {% we need to also adapt the strut + \expandedmathstyleparameter\mathradicalparameter\c!mathstyle + #body}} + +\protected\def\math_radical_mindepth + {\scratchdepth\mathradicalparameter\c!mindepth\relax + \ifzerodim\scratchdepth\else + \srule \s!depth\scratchdepth\s!height\zeropoint\s!width\zeropoint\relax + \fi} -\defcsname\??mathradicalalternative\v!default\endcsname % #body% - {\math_radical_common{\currentmathradicaldegree}} % {#body}} +\defcsname\??mathradicalalternative\v!default\endcsname#body% + {\math_radical_common{\currentmathradicaldegree}{\math_radical_mindepth#body}} \defcsname\??mathradicalalternative\v!normal\endcsname#body% {\edef\p_color{\mathradicalparameter\c!color}% \ifempty\p_color - \math_radical_common{\currentmathradicaldegree}{#body}% {} really needed as \rootradical expands first + \math_radical_common{\currentmathradicaldegree}{\math_radical_mindepth#body}% {} really needed as \rootradical expands first \orelse\ifempty\currentmathradicaldegree \pushcolor[\p_color]% \math_radical_common{}% - {\popcolor#body}% + {\popcolor\math_radical_mindepth#body}% \else \pushcolor[\p_color]% \math_radical_common{\popcolor\currentmathradicaldegree\pushcolor[\p_color]}% - {\popcolor#body}% + {\popcolor\math_radical_mindepth#body}% \fi} \startMPextensions @@ -285,7 +302,7 @@ \pushoverloadmode -\definemathradical[root][mp=minifun::math:radical:default] +\definemathradical[root][mp=minifun::math:radical:default] % hm \definemathradical[sqrt][root] \popoverloadmode @@ -313,7 +330,7 @@ \protected\def\math_ornament_handle#tag#body% {\begingroup - \edef\currentmathornament{#tag}% + \cdef\currentmathornament{#tag}% \csname\??mathornamentalternative\mathornamentparameter\c!alternative\endcsname{#body}% \endgroup} @@ -372,11 +389,19 @@ % % \dorecurse{8}{$\mathhat{\blackrule[width=#1ex,color=gray]}$ } -% \annuity {(x+1)} \Uchar"20E7 +% \annuity {(x+1)} \tocharacter"20E7 + +\integerdef\radicalbarextenderuc\privatecharactercode{radical bar extender} -\integerdef\delimitedleftanutityuc \privatecharactercode{delimited left annuity} -\integerdef\delimitedrightanutityuc \privatecharactercode{delimited right annuity} -\integerdef\radicalbarextenderuc \privatecharactercode{radical bar extender} +\integerdef\delimitedleftannuitylonguc \privatecharactercode{delimited left annuity long} +\integerdef\delimitedleftannuityshortuc \privatecharactercode{delimited left annuity short} +\integerdef\delimitedrightannuitylonguc \privatecharactercode{delimited right annuity long} +\integerdef\delimitedrightannuityshortuc\privatecharactercode{delimited right annuity short} + +\integerdef\delimitedbottomleftannuitylonguc \privatecharactercode{delimited bottom left annuity long} +\integerdef\delimitedbottomleftannuityshortuc \privatecharactercode{delimited bottom left annuity short} +\integerdef\delimitedbottomrightannuitylonguc \privatecharactercode{delimited bottom right annuity long} +\integerdef\delimitedbottomrightannuityshortuc\privatecharactercode{delimited bottom right annuity short} %D We now default to nice bars: @@ -386,21 +411,31 @@ \definemathradical [rannuity] - [\c!left=\zerocount, - \c!right=\delimitedrightanutityuc, + [\c!rule=\v!yes, + \c!left=\zerocount, + \c!right=\delimitedrightannuitylonguc, \c!rightmargin=.05\emwidth] \definemathradical [lannuity] - [\c!left=\delimitedleftanutityuc, + [\c!rule=\v!yes, + \c!left=\delimitedleftannuitylonguc, \c!right=\zerocount, + \c!leftmargin=.05\emwidth] + +\definemathradical + [lrannuity] + [\c!rule=\v!yes, + \c!left=\delimitedleftannuityshortuc, + \c!right=\delimitedrightannuitylonguc, \c!leftmargin=.05\emwidth, \c!rightmargin=.05\emwidth] \definemathradical - [lrannuity] - [\c!left=\delimitedleftanutityuc, - \c!right=\delimitedrightanutityuc, + [rlannuity] + [\c!rule=\v!yes, + \c!left=\delimitedleftannuitylonguc, + \c!right=\delimitedrightannuityshortuc, \c!leftmargin=.05\emwidth, \c!rightmargin=.05\emwidth] @@ -408,4 +443,30 @@ [annuity] [rannuity] +\definemathradical + [lbannuity] + [lannuity] + [\c!rule=\v!bottom, + \c!left=\delimitedbottomleftannuitylonguc] + +\definemathradical + [rbannuity] + [rannuity] + [\c!rule=\v!bottom, + \c!right=\delimitedbottomrightannuitylonguc] + +\definemathradical + [rlbannuity] + [rlannuity] + [\c!rule=\v!bottom, + \c!left=\delimitedbottomleftannuityshortuc, + \c!right=\delimitedbottomrightannuitylonguc] + +\definemathradical + [lrbannuity] + [lrannuity] + [\c!rule=\v!bottom, + \c!left=\delimitedbottomleftannuitylonguc, + \c!right=\delimitedbottomrightannuityshortuc] + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt index cf429cb3a69..0a00c2c75aa 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt @@ -24,6 +24,8 @@ renderings.numbers = numbers local sets = allocate() renderings.sets = sets +local unsetvalue = attributes.unsetvalue + mappings["blackboard-to-bold"] = { [0x1D538] = 0x1D400, [0x1D539] = 0x1D401, [0x02102] = 0x1D402, [0x1D53B] = 0x1D403, [0x1D53C] = 0x1D404, [0x1D53D] = 0x1D405, [0x1D53E] = 0x1D406, [0x0210D] = 0x1D407, [0x1D540] = 0x1D408, [0x1D541] = 0x1D409, @@ -58,7 +60,7 @@ local function renderset(list) -- order matters n = #numbers + 1 numbers[n] = mapping else - n = attributes.unsetvalue + n = unsetvalue end sets[tag] = n end diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt index a575b17142e..e66ef3d041b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt @@ -10,16 +10,25 @@ if not modules then modules = { } end modules ['math-spa'] = { local setmetatableindex = table.setmetatableindex -local boundary_code = nodes.nodecodes.boundary -local hlist_code = nodes.nodecodes.hlist -local kern_code = nodes.nodecodes.kern -local penalty_code = nodes.nodecodes.penalty -local glue_code = nodes.nodecodes.glue -local line_code = nodes.listcodes.line -local ghost_code = nodes.listcodes.ghost -local middle_code = nodes.listcodes.middle -local leftskip_code = nodes.gluecodes.leftskip -local rightskip_code = nodes.gluecodes.rightskip +local nodecodes = nodes.nodecodes +local listcodes = nodes.listcodes + +local boundary_code = nodecodes.boundary +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local kern_code = nodecodes.kern +local penalty_code = nodecodes.penalty +local glue_code = nodecodes.glue + +local line_code = listcodes.line +local ghost_code = listcodes.ghost +local middle_code = listcodes.middle +local wrapped_code = listcodes.wrapped +local mathpack_code = listcodes.mathpack +local construct_code = listcodes.construct +local alignment_code = listcodes.alignment +local row_code = listcodes.row +local fence_code = listcodes.fence local nuts = nodes.nuts local tonut = nodes.tonut @@ -29,6 +38,8 @@ local getid = nuts.getid local getsubtype = nuts.getsubtype local getnext = nuts.getnext local getprev = nuts.getprev +local getattr = nuts.getattr +local getprop = nuts.getprop local getwidth = nuts.getwidth local getdata = nuts.getdata local getdepth = nuts.getdepth @@ -37,11 +48,11 @@ local getlist = nuts.getlist local setglue = nuts.setglue local setwhd = nuts.setwhd local getdimensions = nuts.dimensions -local getnormalizedline = node.direct.getnormalizedline +local getnormalizedline = nuts.getnormalizedline local getbox = nuts.getbox -local setoffsets = nuts.setoffsets local addxoffset = nuts.addxoffset local setattrlist = nuts.setattrlist +local rangedimensions = nuts.rangedimensions local nextglue = nuts.traversers.glue local nextlist = nuts.traversers.list @@ -59,21 +70,26 @@ local texsetcount = tex.setcount local texisdimen = tex.isdimen local texiscount = tex.iscount -local boundary = tex.boundaries.system("mathalign") local stages = { } local initial = { } -local c_strc_math_n_of_lines = texiscount("c_strc_math_n_of_lines") -local d_strc_math_max_width = texisdimen("d_strc_math_max_width") -local d_strc_math_first_width = texisdimen("d_strc_math_first_width") -local d_strc_math_last_width = texisdimen("d_strc_math_last_width") -local d_strc_math_first_height = texisdimen("d_strc_math_first_height") -local d_strc_math_last_depth = texisdimen("d_strc_math_last_depth") -local d_strc_math_indent = texisdimen("d_strc_math_indent") +local boundary = tex.boundaries.system("mathalign") +local a_location = attributes.system("mathnumberlocation") + +local c_strc_math_n_of_lines = texiscount("c_strc_math_n_of_lines") +local d_strc_math_max_right = texisdimen("d_strc_math_max_right") +local d_strc_math_first_right = texisdimen("d_strc_math_first_right") +local d_strc_math_last_right = texisdimen("d_strc_math_last_right") +local d_strc_math_max_left = texisdimen("d_strc_math_max_left") +local d_strc_math_first_left = texisdimen("d_strc_math_first_left") +local d_strc_math_last_left = texisdimen("d_strc_math_last_left") +local d_strc_math_first_height = texisdimen("d_strc_math_first_height") +local d_strc_math_last_depth = texisdimen("d_strc_math_last_depth") +local d_strc_math_indent = texisdimen("d_strc_math_indent") local report = logs.reporter("mathalign") -local trace = false trackers.register("mathalign",function(v) trace = v end ) +local trace = false trackers.register("math.align",function(v) trace = v end ) local function moveon(s) for n, id, subtype in nextnode, getnext(s) do @@ -119,7 +135,7 @@ stages[1] = function(specification,stage) for s in nextboundary, head do local data = getdata(s) if data == boundary then - s = moveon(s) + local s = moveon(s) found[#found+1] = { s, 0, head } end end @@ -134,7 +150,8 @@ stages[1] = function(specification,stage) local p = n while p do if getid(p) == penalty_code and getpenalty(p) == -10000 then - local d = distance + getdimensions(p,n) + local w = getdimensions(p,n) + local d = distance + w f[2] = d f[3] = p if d > max then @@ -150,7 +167,7 @@ stages[1] = function(specification,stage) local w = f[2] local d = i == 1 and (max-w) or -w local k = newkern(d) - local r = newstrutrule(0,2*65536,2*65536) + local r = newstrutrule(0,2*65536,2*65536) -- hm, this adds height and depth ! local s = moveon(f[3]) if trace then report("row %i, width %p, delta %p",i,w,d) @@ -169,6 +186,67 @@ stages[1] = function(specification,stage) end end +local function handlepacked(parent,plist,position) + if plist then + local current = plist +-- print("") +-- nuts.show(current) +-- print("") + while current do + if getid(current) == hlist_code and getsubtype(current) == wrapped_code then + local packed = ((getattr(current,a_location) or 0) >> 8) & 0xF +-- print(packed,a_location,getattr(current,a_location)) +-- packed = 1 + if packed > 0 then + -- print("") + -- nuts.show(current) + -- print("") + local linewidth, wrapwidth, leading, trailing + local wlist = getlist(current) + if wlist and getid(wlist) == hlist_code and getsubtype(wlist) == fence_code then + wlist = getlist(wlist) -- left=none demands this + end + for wrapped, id, subtype, list in nextlist, wlist do + if id == hlist_code and subtype == construct_code then -- mathpack_code + while getid(list) == vlist_code do + list = getlist(list) + end + for a, id, subtype, alist in nextlist, list do + if subtype == alignment_code then + for cell, id, subtype, clist in nextlist, alist do + for n, id, subtype in nextlist, clist do + local p = getprop(n,"mathalignshift") + if p == "right" then + if not leading then + linewidth = getwidth(parent) + wrapwidth = getwidth(current) + leading = rangedimensions(parent,plist,current) + end + local shift = rangedimensions(parent,getnext(wrapped)) + addxoffset(n,shift + linewidth - wrapwidth - leading - position) + elseif p == "left" then + if not leading then + linewidth = getwidth(parent) + wrapwidth = getwidth(current) + leading = rangedimensions(parent,plist,current) + end + local shift = nuts.rangedimensions(parent,wlist,wrapped) + addxoffset(n,- shift - leading - position) + end + end + end + end + end + end + -- wrapped = getnext(wrapped) -- some left-over bad in 5.5 anyway + end + end + end + current = getnext(current) + end + end +end + local function reposition(n,offset) -- We need to relocate the local boxes that we use to push something left or -- right ... quite horrible and one needs a bit twisted mindset for this. @@ -185,15 +263,50 @@ end stages[2] = function(specification,stage) local head = getlist(getbox(specification.box)) local align = specification.alignstate - local maxwidth = false local cnt = 0 + local maxwidth = false + local firstwidth = 0 local lastwidth = 0 + local maxright = false + local firstright = false + local lastright = false + local maxleft = false + local firstleft = false + local lastleft = false local firstheight = 0 local lastdepth = 0 + local linenumber = 0 + local leftmargin = specification.leftmargin + local rightmargin = specification.rightmargin + if trace then + report("stage 2") + end for n, id, subtype, list in nextlist, head do if subtype == line_code then local t = getnormalizedline(n) - local m = t.rightskip + t.parfillrightskip + -- local m = t.rightskip + t.parfillrightskip + local l = t.leftskip + t.lefthangskip + t.parinitleftskip + t.parfillleftskip + t.indent + local r = t.rightskip + t.righthangskip + t.parinitrightskip + t.parfillrightskip + local w = getwidth(n) + local m = r + linenumber = linenumber + 1 + if trace then + report("line %i, width %p, left %p, right %p, used %p",linenumber,w,l,r,w-l-r) + end + if not maxleft or m > maxleft then + maxleft = l + end + if not maxright or m > maxright then + maxright = r + end + if not firstleft then + firstleft = l + end + if not firstright then + firstright = r + end + lastleft = l + lastright = r if not maxwidth then maxwidth = m firstheight = getheight(n) @@ -206,25 +319,52 @@ stages[2] = function(specification,stage) lastdepth = getdepth(n) end end - if stage == 2 and (align == 2 or align == 3) then + + local position = 0 + if align == 1 then -- flushleft + if trace then + report("reposition %p, %s",0, "flush left") + -- todo + end + -- position = leftmargin + elseif align == 2 then -- middle + position = (maxwidth-rightmargin)/2 + if trace then + report("reposition %p, %s",position, "center") + end + elseif align == 3 then -- flushright + position = maxwidth - rightmargin -- a nasty interplay with the tex end (TODO !!!) + if trace then + report("reposition %p, %s",maxwidth, "flush right") + end + end + if stage == 2 and position ~= 0 then for n, id, subtype, list in nextlist, head do - if subtype == line_code then - if align == 1 then -- flushleft - -- todo - elseif align == 2 then -- middle - reposition(n,maxwidth/2) - elseif align == 3 then -- flushright - reposition(n,maxwidth) - end - end + reposition(n,position) end + firstleft = firstleft + position + lastleft = lastleft + position + maxleft = maxleft + position + firstright = firstright - position + lastright = lastright - position + maxright = maxright - position + else + position = 0 end + + for n, id, subtype, list in nextlist, head do + handlepacked(n,list,position) + end + texsetcount("global",c_strc_math_n_of_lines,cnt) - texsetdimen("global",d_strc_math_max_width,maxwidth) - texsetdimen("global",d_strc_math_first_width,firstwidth) - texsetdimen("global",d_strc_math_last_width,lastwidth) texsetdimen("global",d_strc_math_first_height,firstheight) texsetdimen("global",d_strc_math_last_depth,lastdepth) + texsetdimen("global",d_strc_math_first_left,firstleft) + texsetdimen("global",d_strc_math_first_right,firstright) + texsetdimen("global",d_strc_math_last_left,lastleft) + texsetdimen("global",d_strc_math_last_right,lastright) + texsetdimen("global",d_strc_math_max_left,maxleft) + texsetdimen("global",d_strc_math_max_right,maxright) end stages[3] = stages[2] @@ -249,6 +389,8 @@ interfaces.implement { { "height", "dimension" }, { "depth", "dimension" }, { "splitmethod" }, + { "leftmargin", "dimension" }, + { "rightmargin", "dimension" }, } }, actions = function(specification) diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx index 1e488af2cbd..cae400db5c9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx @@ -16,6 +16,8 @@ \unprotect +% is subtype for tagged needed: dosettagproperty only used here .. maybe for tagged pdf? + %D WARNING: If the code here changes, the export needs to be checked! Stackers are %D rather special because the order in mathml matters, so we flush in [base under %D over] order. We also do some analysis at the \TEX\ end (passing the right @@ -85,11 +87,15 @@ % simply ignore the lack. Better choose a font that matches expectations that some % fragile imperfect hackery. +%D The extensible gets sort of inlined so we loose tagging applied to the box +%D which actually is an nested mlist_to_list call then. Kind of messy in the +%D tagging code. + \def\math_stackers_fallback {\mathstylehbox to \scratchwidth{\usemathstackerscolorparameter\c!color \hss \hskip\mathstackersparameter\c!topoffset\relax % for manual italic correction - % \ifcsname\??mathextensiblefallbacks\number\scratchunicode\endcsname + % \ifcsname\??mathextensiblefallbacks\the\scratchunicode\endcsname % \lastnamedcs % \else \Umathchar\zerocount\zerocount\scratchunicode @@ -147,15 +153,26 @@ \def\math_stackers_skip_indeed#amount% {\filledhboxk{\strut\hskip#amount}} -\let\math_stackers_start_tagged_mid\relax -\let\math_stackers_start_tagged_top\relax -\let\math_stackers_start_tagged_bot\relax -\let\math_stackers_stop_tagged \relax +\lettonothing\math_stackers_start_tagged_mid +\lettonothing\math_stackers_start_tagged_top +\lettonothing\math_stackers_start_tagged_bot +\lettonothing\math_stackers_stop_tagged + +\def\math_stackers_unicode{\ifcase\scratchunicode\else\the\scratchunicode\fi} + +\def\math_stackers_reset_variables + {\scratchunicode\zerocount + \edef\p_offset {\mathstackersparameter\c!offset}% + \edef\p_location {\mathstackersparameter\c!location}% + \edef\p_strut {\mathstackersparameter\c!strut}% + \edef\p_alternative{\mathstackersparameter\c!alternative}% + \scratchleftoffset \zeropoint + \scratchrightoffset\zeropoint} \appendtoks - \def\math_stackers_start_tagged_mid{\dostarttagged\t!mstackermid\empty\hbox\bgroup}% - \def\math_stackers_start_tagged_top{\dostarttagged\t!mstackertop\empty\hbox\bgroup}% - \def\math_stackers_start_tagged_bot{\dostarttagged\t!mstackerbot\empty\hbox\bgroup}% + \def\math_stackers_start_tagged_mid{\dostarttagged\t!mstackermid{\math_stackers_unicode}\hbox\bgroup}% + \def\math_stackers_start_tagged_top{\dostarttagged\t!mstackertop{\math_stackers_unicode}\hbox\bgroup}% + \def\math_stackers_start_tagged_bot{\dostarttagged\t!mstackerbot{\math_stackers_unicode}\hbox\bgroup}% \def\math_stackers_stop_tagged {\egroup\dostoptagged}% \to \everysetuptagging @@ -208,17 +225,22 @@ \lettonothing\m_math_stackers_text_bottom \lettonothing\m_math_stackers_text_middle -\def\math_stackers_flushtext#command#text% - {\ifdim\scratchleftoffset >\zeropoint\math_stackers_skip\scratchleftoffset \fi +\def\math_stackers_flushtext#command#style#color#text% + {\ifdim\scratchleftoffset>\zeropoint + \math_stackers_skip\scratchleftoffset + \fi \ifx\p_strut\v!no \else \strut \fi + \usemathstackersstyleandcolor#style#color% \mathstackersparameter#command#text% - \ifdim\scratchrightoffset>\zeropoint\math_stackers_skip\scratchrightoffset\fi} + \ifdim\scratchrightoffset>\zeropoint + \math_stackers_skip\scratchrightoffset + \fi} -\def\math_stackers_toptext {\math_stackers_flushtext\c!topcommand \m_math_stackers_text_top } -\def\math_stackers_bottomtext{\math_stackers_flushtext\c!bottomcommand\m_math_stackers_text_bottom} -\def\math_stackers_middletext{\math_stackers_flushtext\c!middlecommand\m_math_stackers_text_middle} +\def\math_stackers_toptext {\math_stackers_flushtext\c!topcommand \c!topstyle \c!topcolor \m_math_stackers_text_top } +\def\math_stackers_bottomtext{\math_stackers_flushtext\c!bottomcommand\c!bottomstyle\c!bottomcolor\m_math_stackers_text_bottom} +\def\math_stackers_middletext{\math_stackers_flushtext\c!middlecommand\c!middlestyle\c!middlecolor\m_math_stackers_text_middle} \def\math_stackers_content {\ifcase\scratchcounter @@ -239,7 +261,7 @@ \letcsname\??mathstackersalternative\v!default\endcsname\math_stackers_content \setupmathstackers - [\c!mp=math:stacker:\number\scratchunicode, + [\c!mp=math:stacker:\the\scratchunicode, \c!mpheight=\mathcharht\scratchunicode, \c!mpdepth=\mathchardp\scratchunicode, \c!mpoffset=.25\mathexheight] @@ -339,27 +361,22 @@ \protected\def\math_stackers_triplet#method#category#codepoint#toptext#bottomtext% {\begingroup - \edef\currentmathstackers{#category}% + \cdef\currentmathstackers{#category}% \mathstackersparameter\c!left\relax \dostarttagged\t!mstacker\currentmathstackers \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi - {\edef\p_offset {\mathstackersparameter\c!offset}% - \edef\p_location {\mathstackersparameter\c!location}% - \edef\p_strut {\mathstackersparameter\c!strut}% - \edef\p_alternative{\mathstackersparameter\c!alternative}% + {\math_stackers_reset_variables \edef\m_math_stackers_text_top {#toptext}% \edef\m_math_stackers_text_bottom{#bottomtext}% \ifparameter#bottomtext\or - \edef\p_order{\mathstackersparameter\c!order}% - \ifx\p_order\v!reverse + \ifcstok{\mathstackersparameter\c!order}\v!reverse \swapmacros\m_math_stackers_text_top\m_math_stackers_text_bottom \fi \fi - \scratchleftoffset \zeropoint - \scratchrightoffset\zeropoint \ifcase#method\relax \math_stackers_check_unicode{#codepoint}% \else + %\scratchunicode\zerocount \edef\m_math_stackers_text_middle{#codepoint}% \fi \ifempty\m_math_stackers_text_top @@ -405,7 +422,7 @@ \advanceby\scratchwidth2\scratchhoffset % \ifcase#method\relax - \dostarttagged\t!mstackermid\empty + \dostarttaggednodetail\t!mstackermid \setbox\scratchboxthree\csname\??mathstackersalternative\p_alternative\endcsname \dostoptagged \fi @@ -439,7 +456,7 @@ \setbox\scratchboxthree\hpack{\lower\scratchdistance\box\scratchboxthree}% \fi \math_stackers_normalize_three - % analysis + % analysis: is this still ok here? \ifdim\htdp\scratchboxtwo>\zeropoint \ifdim\htdp\scratchboxone>\zeropoint \dosettagproperty\s!subtype\t!munderover @@ -495,10 +512,22 @@ \frozen\protected\edefcsname#2\endcsname{\math_stackers_auto_normal{#1}{\number#3}}% \fi} -\tolerant\protected\def\math_stackers_auto_normal#1#2#*[#3]#:#=#*#=% +% \tolerant\protected\def\math_stackers_auto_normal#1#2#*[#3]#:#*#=#*#=% +% {\begingroup +% \scratchcounter#2\relax +% \cdef\currentmathstackers{\ifparameter#3\or#3\else#1\fi}% +% \math_stackers_triplet\zerocount\currentmathstackers\scratchcounter{#4}{#5}% +% \endgroup} + +\tolerant\protected\def\math_stackers_auto_normal#1#2#*[#3]#:#*#=#*#=% {\begingroup \scratchcounter#2\relax - \edef\currentmathstackers{\ifparameter#3\or#3\else#1\fi}% + \cdef\currentmathstackers{#1}% + \ifhastok={#3}% + \setupcurrentmathstackers[#3]% + \orelse\ifparameter#3\or + \cdef\currentmathstackers{#3}% + \fi \math_stackers_triplet\zerocount\currentmathstackers\scratchcounter{#4}{#5}% \endgroup} @@ -526,9 +555,8 @@ \protected\def\math_stackers_start_group#category% {\begingroup - \edef\currentmathstackers{#category}% - \edef\p_limits{\mathstackersparameter\c!mathlimits}% - \ifx\p_limits\v!yes + \cdef\currentmathstackers{#category}% + \ifcstok{\mathstackersparameter\c!mathlimits}\v!yes \def\math_stackers_stop_group{\egroup\endgroup\ordlimits}% % \mathop\bgroup \mathaccent\bgroup @@ -545,7 +573,7 @@ \setupmathstackers[lt=\zeropoint,rt=\zeropoint,lb=\zeropoint,rb=\zeropoint] -\tolerant\protected\def\math_stackers_make_double#top#bottom#category#codepoint#codeextra#spacer[#settings]#:#text% +\tolerant\protected\def\math_stackers_make_double#top#bottom#category#codepoint#codeextra#spacer[#S#settings]#:#*#text% {\math_stackers_start_group{#category}% \c_math_stackers_top #top\relax \c_math_stackers_bottom #bottom\relax @@ -557,18 +585,9 @@ \mathstackersparameter\c!left\relax \dostarttagged\t!mstacker\currentmathstackers \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi - {\edef\m_math_stackers_text_middle {#text}% - % - \edef\p_offset {\mathstackersparameter\c!offset}% - \edef\p_location {\mathstackersparameter\c!location}% - \edef\p_strut {\mathstackersparameter\c!strut}% - \edef\p_alternative{\mathstackersparameter\c!alternative}% - % - \scratchleftoffset \zeropoint - \scratchrightoffset\zeropoint - % + {\math_stackers_reset_variables + \edef\m_math_stackers_text_middle{#text}% \math_stackers_check_unicode\c_math_stackers_codepoint - % \ifempty\math_stackers_middle \setbox\scratchboxthree\emptyhbox \else @@ -593,11 +612,12 @@ \d_math_stackers_offset_l\mathstackersparameter{lt}% \d_math_stackers_offset_r\mathstackersparameter{rt}% \fi + % \setbox\scratchboxtwo\csname\??mathstackersalternative\p_alternative\endcsname \setbox\scratchboxthree\hpack to \scratchwidth{\hss\box\scratchboxthree\hss}% % - \ifcase\c_math_stackers_extracode\else - \scratchunicode\c_math_stackers_extracode + \scratchunicode\c_math_stackers_extracode + \ifcase\scratchunicode\else % uses \scratchunicode \d_math_stackers_offset_l\mathstackersparameter{lb}% \d_math_stackers_offset_r\mathstackersparameter{rb}% \setbox\scratchboxone\csname\??mathstackersalternative\p_alternative\endcsname @@ -606,7 +626,7 @@ \math_stackers_normalize_three \math_stackers_get_max_width \math_stackers_set_max_width - % analysis + % analysis: is this still ok here? \ifcase\c_math_stackers_bottom \ifcase\c_math_stackers_top \dosettagproperty\s!subtype\t!munderover @@ -695,9 +715,9 @@ \permanent\tolerant\protected\def\definemathdouble[#category]#spacer[#command]#spacer[#topcode]#spacer[#bottomcode]% {\frozen\protected\defcsname#command\endcsname{\math_stackers_handle_direct\plusone\plusone{#category}{#topcode}{#bottomcode}}} -\permanent\tolerant\protected\def\mathover[#category]#spacer[#settings]#:#topcode#text% +\permanent\tolerant\protected\def\mathover[#category]#spacer[#S#settings]#:#*#topcode#*#text% {\begingroup - \edef\currentmathstackers{\ifparameter#category\or#category\else\v!top\fi}% + \cdef\currentmathstackers{\ifparameter#category\or#category\else\v!top\fi}% \ifparameter#settings\or \setupcurrentmathstackers[#settings]% \fi @@ -708,9 +728,9 @@ {#text}% \endgroup} -\permanent\tolerant\protected\def\mathunder[#category]#spacer[#settings]#:#bottomcode#text% +\permanent\tolerant\protected\def\mathunder[#category]#spacer[#S#settings]#:#*#bottomcode#*#text% {\begingroup - \edef\currentmathstackers{\ifparameter#category\or#category\else\v!bottom\fi}% + \cdef\currentmathstackers{\ifparameter#category\or#category\else\v!bottom\fi}% \ifparameter#settings\or \setupcurrentmathstackers[#settings]% \fi @@ -721,9 +741,9 @@ {#text}% \endgroup} -\permanent\tolerant\protected\def\mathdouble[#category]#spacer[#settings]#:#topcode#bottomcode#text% +\permanent\tolerant\protected\def\mathdouble[#category]#spacer[#settings]#:#*#topcode#*#bottomcode#*#text% {\begingroup - \edef\currentmathstackers{\ifparameter#category\or#category\else\v!both\fi}% + \cdef\currentmathstackers{\ifparameter#category\or#category\else\v!both\fi}% \ifparameter#settings\or \setupcurrentmathstackers[#settings]% \fi @@ -746,16 +766,7 @@ \mathstackersparameter\c!left\relax \dostarttagged\t!mstacker\currentmathstackers \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi - {\edef\currentmathstackers{#category}% - % - \edef\p_offset {\mathstackersparameter\c!offset}% - \edef\p_location {\mathstackersparameter\c!location}% - \edef\p_strut {\mathstackersparameter\c!strut}% - \edef\p_alternative{\mathstackersparameter\c!alternative}% - % - \scratchleftoffset \zeropoint - \scratchrightoffset\zeropoint - % + {\math_stackers_reset_variables \edef\m_math_stackers_text_middle{#text}% \math_stackers_check_unicode{#codepoint}% \scratchunicode#codepoint\relax @@ -803,7 +814,7 @@ \fi % \math_stackers_normalize_three - % analysis + % analysis: is this still ok here? \dosettagproperty\s!subtype\t!munderover % base \math_stackers_start_tagged_mid @@ -897,9 +908,10 @@ %D Here is a bonus macro that takes three texts. It can be used to get consistent %D mixed usage. -\permanent\tolerant\protected\def\mathtriplet[#category]#:#middletext#toptext#bottomtext% +\permanent\tolerant\protected\def\mathtriplet[#1]#:#*#=#*#=#*#=% {\begingroup - \math_stackers_triplet\plusone{\ifarguments#category\or#category\else\currentmathstackers\fi}{#middletext}{#toptext}{#bottomtext}% + \ifparameter#1\or\cdef\currentmathstackers{#1}\fi + \math_stackers_triplet\plusone\currentmathstackers{#2}{#3}{#4}% \endgroup} \permanent\tolerant\protected\def\definemathtriplet[#1]#*[#2]#*[#3]% category name default @@ -911,18 +923,18 @@ \frozen\protected\edefcsname#2\endcsname{\math_stackers_auto_triplet_yes[#1][#3]}% \fi} -\tolerant\protected\def\math_stackers_auto_triplet_yes[#1][#2]#*[#3]#:#=#*#=% [#2]% #2 gobble spaces +\tolerant\protected\def\math_stackers_auto_triplet_yes[#1][#2]#*[#3]#:#*#=#*#=% [#2]% #2 gobble spaces {\begingroup - \edef\currentmathstackers{#1}% + \cdef\currentmathstackers{#1}% \def \m_math_stackers_text_middle{#2}% - \ifarguments#3\or\edef\currentmathstackers{#3}\fi + \ifparameter#3\or\cdef\currentmathstackers{#3}\fi \math_stackers_triplet\plusone\currentmathstackers\m_math_stackers_text_middle{#4}{#5}% \endgroup} -\tolerant\protected\def\math_stackers_auto_triplet_nop[#1]#*[#2]#:#=#*#=#*#=% [#2]% #2 gobble spaces% +\tolerant\protected\def\math_stackers_auto_triplet_nop[#1]#*[#2]#:#*#=#*#=#*#=% [#2]% #2 gobble spaces% {\begingroup - \edef\currentmathstackers{#1}% - \ifarguments#2\or\edef\currentmathstackers{#2}\fi + \cdef\currentmathstackers{#1}% + \ifparameter#2\or\cdef\currentmathstackers{#2}\fi \math_stackers_triplet\plusone\currentmathstackers{#3}{#4}{#5}% \endgroup} @@ -1048,10 +1060,13 @@ \definemathextensible [\v!reverse] [xequal] ["003D] \definemathextensible [\v!reverse] [xleftarrow] ["2190] % ["27F5] \definemathextensible [\v!reverse] [xrightarrow] ["2192] % ["27F6] -\definemathextensible [\v!reverse] [xleftrightarrow] ["27F7] -\definemathextensible [\v!reverse] [xLeftarrow] ["27F8] -\definemathextensible [\v!reverse] [xRightarrow] ["27F9] -\definemathextensible [\v!reverse] [xLeftrightarrow] ["27FA] +\definemathextensible [\v!reverse] [xleftrightarrow] ["2194] % ["27F7] +\definemathextensible [\v!reverse] [xlongleftarrow] ["27F5] +\definemathextensible [\v!reverse] [xlongrightarrow] ["27F6] +\definemathextensible [\v!reverse] [xlongleftrightarrow] ["27F7] +\definemathextensible [\v!reverse] [xLeftarrow] ["27F8] % why not ["27D2] +\definemathextensible [\v!reverse] [xRightarrow] ["27F9] % why not ["27D0] +\definemathextensible [\v!reverse] [xLeftrightarrow] ["27FA] % why not ["27D4] \definemathextensible [\v!reverse] [xtwoheadleftarrow] ["219E] \definemathextensible [\v!reverse] [xtwoheadrightarrow] ["21A0] \definemathextensible [\v!reverse] [xmapsto] ["21A6] @@ -1071,7 +1086,7 @@ \definemathextensible [\v!mathematics] [mequal] ["003D] \definemathextensible [\v!mathematics] [mleftarrow] ["2190] % ["27F5] \definemathextensible [\v!mathematics] [mrightarrow] ["2192] % ["27F6] -\definemathextensible [\v!mathematics] [mleftrightarrow] ["2194] +\definemathextensible [\v!mathematics] [mleftrightarrow] ["2194] % ["27F7] \definemathextensible [\v!mathematics] [mLeftarrow] ["21D0] \definemathextensible [\v!mathematics] [mRightarrow] ["21D2] \definemathextensible [\v!mathematics] [mLeftrightarrow] ["21D4] @@ -1095,7 +1110,7 @@ \definemathextensible [\v!text] [tmapsto] ["21A6] \definemathextensible [\v!text] [tleftarrow] ["2190] % ["27F5] \definemathextensible [\v!text] [trightarrow] ["2192] % ["27F6] -\definemathextensible [\v!text] [tleftrightarrow] ["2194] +\definemathextensible [\v!text] [tleftrightarrow] ["2194] % ["27F7] \definemathextensible [\v!text] [tLeftarrow] ["21D0] \definemathextensible [\v!text] [tRightarrow] ["21D2] \definemathextensible [\v!text] [tLeftrightarrow] ["21D4] @@ -1201,20 +1216,6 @@ \definemathovertextextensible [\v!bothtext] [overbrackettext] ["23B4] \definemathundertextextensible [\v!bothtext] [underbrackettext] ["23B5] -%D Some bonus ones (for the moment here): - -\definemathstackers - [\v!chemistry] - [\c!offset=\v!max, - \c!left=\enspace, - \c!right=\enspace, - \c!hoffset=.5\mathemwidth] - -\definemathextensible [\v!chemistry] [cleftarrow] ["2190] -\definemathextensible [\v!chemistry] [crightarrow] ["2192] -\definemathextensible [\v!chemistry] [crightoverleftarrow] ["21C4] -\definemathextensible [\v!chemistry] [cleftoverrightarrow] ["21C6] - % \def\math_stackers_hacked_fill#1#2#3% % {\mathematics % {\begingroup @@ -1277,11 +1278,14 @@ \egroup \stopsetups -\def\mathfiller#1% - {\begingroup - \scratchunicode#1\relax - \adaptivebox[mathfiller][\c!alternative=#1]{\hss\strut\hss}% - \endgroup} +% \def\mathfiller#1% +% {\begingroup +% \scratchunicode#1\relax +% \adaptivebox[mathfiller][\c!alternative=#1]{\hss\strut\hss}% +% \endgroup} + +\permanent\protected\def\mathfiller#1% + {\adaptivebox[mathfiller][\c!alternative=#1]{\hss\strut\hss}} \permanent\tolerant\protected\def\defineextensiblefiller[#1]#*[#2]% {\frozen\instance\edefcsname#1\endcsname{\mathfiller{\number#2}}} @@ -1326,36 +1330,48 @@ \permanent\tolerant\protected\def\definemathunstacked[#1]#*[#2]#*[#3]% category name unicode {\ifarguments\or\or \frozen\protected\edefcsname#1\endcsname{\math_stackers_unstacked_normal\noexpand\currentmathstackers{\number#2}}% - \else + \or \frozen\protected\edefcsname#2\endcsname{\math_stackers_unstacked_normal{#1}{\number#3}}% \fi} \protected\def\math_stackers_unstacked_normal#category#codepoint% {\begingroup - \edef\currentmathstackers{#category}% - \edef\p_moffset{\mathstackersparameter\c!moffset}% - \ifconditional\indisplaymath - \ifempty\p_moffset \else - \ifmmode\mskip\else\hskip\fi\p_moffset\relax - \fi - \fi - \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi + \cdef\currentmathstackers{#category}% + \scratchdistance\zeropoint + \scratchcounter\ifchknum\mathstackersparameter\c!sample\or\mathstackersparameter\c!sample\else\zerocount\fi + \scratchunicode#codepoint\relax + \scratchclass\mathcodechecked{\mathstackersparameter\c!mathclass}\relax + \ifconditional\indisplaymath\ifcase\scratchcounter\orelse\ifnum\lastatomclass=\mathbegincode + \scratchdistance\dimexpr + \fontcharwd\mathstylefont\mathstyle\scratchcounter + -\fontcharwd\mathstylefont\mathstyle\scratchunicode + \relax + \fi\fi + \math_atom_by_parameter\mathstackersparameter {\usemathstackerscolorparameter\c!color - \Umathchar\zerocount\zerocount#codepoint}% - \ifconditional\indisplaymath - \ifempty\p_moffset \else - \ifmmode\mskip\else\hskip\fi\p_moffset\relax - \fi - \fi + \Umathchar\scratchclass\fam\scratchunicode\relax + \ifzeropt\scratchdistance\else + \kern\scratchdistance + \fi}% \endgroup} -\definemathstackers [\v!wide] [\c!moffset=\thickmuskip,\c!mathclass=\s!relation] +\definemathstackers + [\s!implication] + [\c!mathclass=\s!implication, + \c!sample="27FA] + +\definemathunstacked [\s!implication] [impliedby] ["27F8] +\definemathunstacked [\s!implication] [implies] ["27F9] +\definemathunstacked [\s!implication] [iff] ["27FA] % \ifandonlyif +\definemathunstacked [\s!implication] [impliesby] ["27FA] + +% This is a weird one: + +\definemathstackers + [\v!wide] + [\c!mathclass=\s!implication] -\definemathunstacked [\v!wide] [And] ["0026] % \mathrel{\;&\;} -\definemathunstacked [\v!wide] [impliedby] ["27F8] % \mathrel{\;\Longleftarrow\;} -\definemathunstacked [\v!wide] [implies] ["27F9] % \mathrel{\;\Longrightarrow\;} -\definemathunstacked [\v!wide] [iff] ["27FA] % \mathrel{\;\Longleftrightarrow\;} -\definemathunstacked [\v!wide] [impliesby] ["27FA] % \mathrel{\;\Longleftrightarrow\;} +\definemathunstacked [\v!wide] [And]["0026] % \mathrel{\;&\;} % New (an example of using \mathexheight): diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt index eaba1ea5421..ae4cd5c2f2f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt @@ -17,162 +17,306 @@ if not modules then modules = { } end modules ['math-tag'] = { -- todo: middle in fraction local find, match = string.find, string.match -local insert, remove, concat = table.insert, table.remove, table.concat - -local attributes = attributes -local nodes = nodes - -local nuts = nodes.nuts -local tonut = nuts.tonut - -local getchar = nuts.getchar -local getprev = nuts.getprev -local getcharspec = nuts.getcharspec -local getdata = nuts.getdata -local getlist = nuts.getlist -local getfield = nuts.getfield -local getdisc = nuts.getdisc -local getattr = nuts.getattr -local getattrlist = nuts.getattrlist -local setattr = nuts.setattr -local getwidth = nuts.getwidth - -local getnumerator = nuts.getnumerator -local getdenominator = nuts.getdenominator -local getdelimiter = nuts.getdelimiter -local getleftdelimiter = nuts.getleftdelimiter -local getrightdelimiter = nuts.getrightdelimiter -local getdegree = nuts.getdegree -local gettop = nuts.gettop -local getbottom = nuts.getbottom -local getchoice = nuts.getchoice - -local getnucleus = nuts.getnucleus - -local setattributes = nuts.setattributes - -local nextnode = nuts.traversers.node - -local nodecodes = nodes.nodecodes - -local noad_code = nodecodes.noad -local accent_code = nodecodes.accent -local radical_code = nodecodes.radical -local fraction_code = nodecodes.fraction -local subbox_code = nodecodes.subbox -local submlist_code = nodecodes.submlist -local mathchar_code = nodecodes.mathchar -local mathtextchar_code = nodecodes.mathtextchar -local delimiter_code = nodecodes.delimiter -local style_code = nodecodes.style -local choice_code = nodecodes.choice -local fence_code = nodecodes.fence - -local accentcodes = nodes.accentcodes -local fencecodes = nodes.fencecodes - -local fixedtopaccent_code = accentcodes.fixedtop -local fixedbottomaccent_code = accentcodes.fixedbottom -local fixedbothaccent_code = accentcodes.fixedboth - -local leftfence_code = fencecodes.left -local middlefence_code = fencecodes.middle -local rightfence_code = fencecodes.right -local operatorfence_code = fencecodes.operator - -local kerncodes = nodes.kerncodes - -local fontkern_code = kerncodes.fontkern -local italickern_code = kerncodes.italickern - -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local glue_code = nodecodes.glue -local kern_code = nodecodes.kern -local math_code = nodecodes.math - -local processnoads = noads.process - -local a_tagged = attributes.private('tagged') -local a_mathcategory = attributes.private('mathcategory') -local a_mathmode = attributes.private('mathmode') - -local tags = structures.tags - -local start_tagged = tags.start -local restart_tagged = tags.restart -local stop_tagged = tags.stop -local taglist = tags.taglist - ------ chardata = characters.data - -local getmathcodes = tex.getmathcodes ------ mathcodes = mathematics.codes -local mathcodes = mathematics.classes -local ordinary_mathcode = mathcodes.ordinary -local digit_mathcode = mathcodes.digit -local punctuation_mathcode = mathcodes.punctuation -local active_mathcode = mathcodes.active - -local fromunicode16 = fonts.mappings.fromunicode16 -local fontcharacters = fonts.hashes.characters - -local report_tags = logs.reporter("structure","tags") - -local process - -local function processnucleus(nucleus,prime) - if prime then - -- This should work wasn't it that browser handling of primes have an issue with - -- "big semi raised text" vs "small supposedly superscripted". So let's play safe - -- and use a superscript. Even then we get somewhat different positioning for the - -- same primed character in q sqrt and (e.g.) a sequential integral. - -- start_tagged("mrow", { prime = true }) - start_tagged("msup", { prime = true }) - process(nucleus) - process(prime) - stop_tagged() - else - process(nucleus) - end -end +local insert, remove, concat, setmetatableindex = table.insert, table.remove, table.concat, table.setmetatableindex -local function processsubsup(start) - -- At some point we might need to add an attribute signaling the - -- super- and subscripts because TeX and MathML use a different - -- order. The mrows are needed to keep mn's separated. - local nucleus, prime, sup, sub, presup, presub = getnucleus(start,true) - if sub then - if sup then - setattr(start,a_tagged,start_tagged("msubsup")) - processnucleus(nucleus,prime) - start_tagged("mrow", { subscript = true }) - process(sub) - stop_tagged() - start_tagged("mrow", { superscript = true }) +local attributes = attributes +local nodes = nodes + +local nuts = nodes.nuts +local tonut = nuts.tonut + +local getchar = nuts.getchar +local getnext = nuts.getnext +local getprev = nuts.getprev +local getcharspec = nuts.getcharspec +local getdata = nuts.getdata +local getlist = nuts.getlist +local getfield = nuts.getfield +local getdisc = nuts.getdisc +local getattr = nuts.getattr +local getattrlist = nuts.getattrlist +local setattr = nuts.setattr +local getwidth = nuts.getwidth +local getoptions = nuts.getoptions +local getchardict = nuts.getchardict +local getclass = nuts.getclass +local getprop = nuts.getprop + +local getnumerator = nuts.getnumerator +local getdenominator = nuts.getdenominator +local getdelimiter = nuts.getdelimiter +local getleftdelimiter = nuts.getleftdelimiter +local getrightdelimiter = nuts.getrightdelimiter +local gettopdelimiter = nuts.gettopdelimiter +local getbottomdelimiter = nuts.getbottomdelimiter +local getdegree = nuts.getdegree +local gettop = nuts.gettop +local getbottom = nuts.getbottom +local getchoice = nuts.getchoice +local getchardict = nuts.getchardict +local getnucleus = nuts.getnucleus +local setattributes = nuts.setattributes +local nextnode = nuts.traversers.node + +local nodecodes = nodes.nodecodes + +local accentcodes = nodes.accentcodes +local fencecodes = nodes.fencecodes +local kerncodes = nodes.kerncodes + +local noad_code = nodecodes.noad +local accent_code = nodecodes.accent +local radical_code = nodecodes.radical +local fraction_code = nodecodes.fraction +local subbox_code = nodecodes.subbox +local submlist_code = nodecodes.submlist +local mathchar_code = nodecodes.mathchar +local mathtextchar_code = nodecodes.mathtextchar +local delimiter_code = nodecodes.delimiter +local style_code = nodecodes.style +local choice_code = nodecodes.choice +local fence_code = nodecodes.fence + +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local glue_code = nodecodes.glue +local kern_code = nodecodes.kern +local math_code = nodecodes.math + +local fixedtopaccent_code = accentcodes.fixedtop +local fixedbottomaccent_code = accentcodes.fixedbottom +local fixedbothaccent_code = accentcodes.fixedboth + +local leftfence_code = fencecodes.left +local middlefence_code = fencecodes.middle +local rightfence_code = fencecodes.right +local operatorfence_code = fencecodes.operator + +local fontkern_code = kerncodes.fontkern +local italickern_code = kerncodes.italickern + +local hextensible_code = nodes.radicalcodes.hextensible +local lextensible_code = nodes.listcodes.hextensible +local gextensible_code = nodes.glyphcodes.extensible + +local processnoads = noads.process + +local a_tagged = attributes.private('tagged') +local a_mathcategory = attributes.private('mathcategory') +local a_mathstack = attributes.private('mathstack') +local a_mathmode = attributes.private('mathmode') +local a_mathdomain = attributes.private('mathdomain') + +local c_mathblobnesting = tex.iscount("currentmathblobnesting") +local c_mathblob = tex.iscount("currentmathblob") + +local getintegervalue = tex.getintegervalue +local getmacro = tokens.getters.macro + +local tags = structures.tags + +local start_tagged = tags.start +local restart_tagged = tags.restart +local stop_tagged = tags.stop +local taglist = tags.taglist + +----- chardata = characters.data + +local getmathcodes = tex.getmathcodes +local classes = mathematics.classes + +local classtotag = { + [classes.ordinary] = "mi", + [classes.variable] = "mi", + [classes.imaginary] = "mi", + [classes.differential] = "mi", + [classes.exponential] = "mi", + [classes.digit] = "mn", + [classes.implication] = "mo", + [classes.ghost] = "mo",--always? +-- [classes.relation] = "mo", +-- [classes.binary] = "mo", +-- [classes.punctuation] = "mc", +} + +local fromunicode16 = fonts.mappings.fromunicode16 +local fontcharacters = fonts.hashes.characters + +local report_tags = logs.reporter("structure","tags") + +local tagging = { + -- mfenced = true, + mfenced = false, +} + +directives.register("structures.tags.math.mfenced", function(v) tagging.mfenced = v end) + +mathematics.tagging = tagging + +local process, processsubsup do + + local noadoptioncodes = tex.noadoptioncodes + + local continuation_code = noadoptioncodes.continuation + local continuationhead_code = noadoptioncodes.continuationhead + local continuationkernel_code = noadoptioncodes.continuationkernel + + local shiftedsuperscript_code = noadoptioncodes.shiftedsuperscript + local shiftedsubscript_code = noadoptioncodes.shiftedsubscript + local shiftedsuperprescript_code = noadoptioncodes.shiftedsuperprescript + local shiftedsubprescript_code = noadoptioncodes.shiftedsubprescript + + -- x[prime + sup] : x sup prime + -- x[prime + sub] : x sub prime + -- x[prime + sup + sub] : x sub sup prime + -- x[prime + sup + sub] : x sub prime + -- + -- x[prime] : x prime + -- x[sup] : x sup + -- x[sub] : x sub + -- x[sup + sub] : x sub sup + + local t_prime = { script = "prime" } -- etc, todo: set on main table + + local function simple(start,nucleus,prime,sup,sub,options,continuation) + if prime then + setattr(start,a_tagged,start_tagged("msup", { prime = true })) + start_tagged("mrow") + end + if sub then + if sup then +-- local subshifted = ((options & shiftedsubscript_code ) > 0) and "true" or nil +-- local supshifted = ((options & shiftedsuperscript_code) > 0) and "true" or nil + local subshifted = ((options & shiftedsubscript_code ) > 0) or nil + local supshifted = ((options & shiftedsuperscript_code) > 0) or nil + if continuation then + continuation.subshifted = subshifted + continuation.supshifted = supshifted + else + continuation = { + subshifted = subshifted, + supshifted = supshifted, + } + end + setattr(start,a_tagged,start_tagged("msubsup",continuation)) + process(nucleus) + start_tagged("mrow", { script = "sub" }) + process(sub) + stop_tagged() + start_tagged("mrow", { script = "sup" }) + process(sup) + stop_tagged() + stop_tagged() + else +-- local subshifted = ((options & shiftedsubscript_code ) > 0) and "true" or nil + local subshifted = ((options & shiftedsubscript_code ) > 0) or nil + if continuation then + continuation.subshifted = subshifted + else + continuation = { + subshifted = subshifted, + } + end + setattr(start,a_tagged,start_tagged("msub",continuation)) + process(nucleus) + start_tagged("mrow", { script = "sub" }) + process(sub) + stop_tagged() + stop_tagged() + end + elseif sup then +-- local supshifted = ((options & shiftedsuperscript_code ) > 0) and "true" or nil + local supshifted = ((options & shiftedsuperscript_code ) > 0) or nil + if continuation then + continuation.supshifted = supshifted + else + continuation = { + supshifted = supshifted, + } + end + setattr(start,a_tagged,start_tagged("msup",continuation)) + process(nucleus) + start_tagged("mrow", { script = "sup" }) process(sup) stop_tagged() stop_tagged() else - setattr(start,a_tagged,start_tagged("msub")) - processnucleus(nucleus,prime) + process(nucleus) + end + if prime then + stop_tagged() + start_tagged("mrow", { script = "prime" }) + process(prime) + stop_tagged() + stop_tagged() + end + end + + local function complex(start,nucleus,prime,sup,sub,presup,presub,options,continuation) + if prime then + setattr(start,a_tagged,start_tagged("msup", { prime = true })) start_tagged("mrow") + end + start_tagged("mmultiscripts", continuation) + process(nucleus) +-- if prime then +-- start_tagged("mrow", { script = "prime" }) +-- process(prime) +-- stop_tagged() +-- end + if sup then + start_tagged("mrow", { script = "sup" }) -- , shifted = ((options & shiftedsuperscript_code) > 0) and "true" or nil }) + process(sup) + stop_tagged() + end + if sub then + start_tagged("mrow", { script = "sub" }) -- , shifted = ((options & shiftedsubscript_code) > 0) and "true" or nil }) process(sub) stop_tagged() + end + if presup then + start_tagged("mrow", { script = "presup" }) -- , shifted = ((options & shiftedsuperprescript_code) > 0) and "true" or nil }) + process(presup) + stop_tagged() + end + if presub then + start_tagged("mrow", { script = "presub" }) -- , shifted = ((options & shiftedsubprescript_code) > 0) and "true" or nil }) + process(presub) stop_tagged() end - elseif sup then - setattr(start,a_tagged,start_tagged("msup")) - processnucleus(nucleus,prime) - start_tagged("mrow") - process(sup) - stop_tagged() stop_tagged() - else - processnucleus(nucleus,prime) + if prime then + stop_tagged() + start_tagged("mrow", { script = "prime" }) + process(prime) + stop_tagged() + stop_tagged() + end + end + + processsubsup = function(start) + -- At some point we might need to add an attribute signaling the + -- super- and subscripts because TeX and MathML use a different + -- order. The mrows are needed to keep mn's separated. + local nucleus, prime, sup, sub, presup, presub = getnucleus(start,true) + local options = getoptions(start) or 0 + local continuation = false + local c = (options & continuation_code) > 0 + local h = (options & continuationhead_code) > 0 + local k = (options & continuationkernel_code) > 0 + local continuation = ((c or h or k) and { + continuation = { next = c, head = h, kernel = k} + }) or nil + -- if presup or presub or (sup and prime) then + if presup or presub then + complex(start,nucleus,prime,sup,sub,presup,presub,options,continuation) + else + simple(start,nucleus,prime,sup,sub,options,continuation) + end end + end -- todo: check function here and keep attribute the same @@ -232,6 +376,50 @@ end -- again and see to what extend we need to adapt to new features. Around the time -- PG's Panopticom was put on youtube. +local chardata = characters.data + +local mathnames = mathematics.dictionaries.names +local mathgroups = mathematics.dictionaries.groups +local mathclasses = mathematics.classes + +local everygroup = mathematics.dictionaries.names.everygroup + +local function getproperties(n,class) + local props, group, index, font, char = getchardict(n) + if group == everygroup then + -- should be done at the lua end by defining a char bound group code + local c = chardata[char] + if c then + local g = c.mathgroup + if not g then + local s = c.mathspec + if s then + g = s[1].group + end + if g then + group = mathnames[g] or group + end + end + end + end + if group or class then + local swapped = getprop(n,"swappedclass") + if swapped then + class = swapped + end + return { + mathclass = mathclasses[class] or class, + mathgroup = mathgroups[group], + mathindex = index, + -- mathfont = font, + mathcharacter = char, + } + end +end + +-- todo: why seen twice +-- todo: get rid of detail + process = function(start) -- we cannot use the processor as we have no finalizers (yet) local mtexttag = nil for start, id, subtype in nextnode, start do -- current @@ -248,49 +436,11 @@ process = function(start) -- we cannot use the processor as we have no finalizer mtexttag = nil end if id == mathchar_code then - local char = getchar(start) - local code = getmathcodes(char) --- local ch = chardata[char] --- local mc = ch and ch.mathclass - local tag - local properties= { class = code } - -- we're a bit early so we can have active here and no rules get applied - -- so maybe we have to correct some later on - -- todo: we have way more now --- if code == ordinary_mathcode then --- if mc == "number" then --- tag = "mn" --- elseif mc == "variable" or not mc then -- variable is default --- tag = "mi" --- else --- tag = "mo" --- end --- else --- tag = "mo" --- end --- print(code,mathematics.classes[code]) --- print(ordinary_mathcode,digit_mathcode,active_mathcode) - if code == ordinary_mathcode then - tag = "mi" - elseif code == digit_mathcode then - tag = "mn" --- elseif code == punctuation_mathcode or code == active_mathcode then --- tag = "mo" - else - tag = "mo" - end --- if mc == "open" or nc == "close" or mc == "middle" then --- properties = { maxsize = 1 } --- end - local a = getattr(start,a_mathcategory) - if a then - -- todo / redo - if properties then - properties.mathcategory = a - else - properties = { mathcategory = a } - end - end + local char = getchar(start) -- not used + local properties = getproperties(start,subtype) + local tag = classtotag[subtype] or "mo" + properties.mathstack = getattr(start,a_mathstack) + properties.mathcategory = getattr(start,a_mathcategory) setattr(start,a_tagged,start_tagged(tag,properties)) stop_tagged() -- showtag(start,id,false) @@ -298,7 +448,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer elseif id == mathtextchar_code then -- or id == glyph_code -- check for code local a = getattr(start,a_mathcategory) - if a then + if a then -- cache table setattr(start,a_tagged,start_tagged("ms",{ mathcategory = a })) -- mtext else setattr(start,a_tagged,start_tagged("ms")) -- mtext @@ -308,17 +458,18 @@ process = function(start) -- we cannot use the processor as we have no finalizer break elseif id == delimiter_code then -- check for code - setattr(start,a_tagged,start_tagged("mo")) + local properties = getproperties(start,subtype) + setattr(start,a_tagged,start_tagged("mo",properties)) stop_tagged() -- showtag(start,id,false) break elseif id == style_code then -- has a next elseif id == noad_code then - -- setattr(start,a_tagged,tags.current()) processsubsup(start) elseif id == subbox_code or id == hlist_code or id == vlist_code then -- keep an eye on subbox_code and see what ends up in there + -- a hlist can be a nested result (mlist_to_hlist) local attr = getattr(start,a_tagged) if not attr then -- just skip @@ -334,11 +485,11 @@ process = function(start) -- we cannot use the processor as we have no finalizer process(list) end else -if tag ~= "mtable" and tag ~= "mstackertop" and tag ~= "mstackermid" and tag ~= "mstackerbot" then --- if tag ~= "mstackertop" and tag ~= "mstackermid" and tag ~= "mstackerbot" then + if tag ~= "mtable" and tag ~= "mstackertop" and tag ~= "mstackermid" and tag ~= "mstackerbot" then tag = "mtext" end - local text = start_tagged(tag) + local detail = specification.detail + local text = start_tagged(tag, detail and { detail = detail } or nil) setattr(start,a_tagged,text) local list = getlist(start) if not list then @@ -359,15 +510,15 @@ if tag ~= "mtable" and tag ~= "mstackertop" and tag ~= "mstackermid" and tag ~= local function runner(list,depth) -- quite inefficient local cache = { } -- we can have nested unboxed mess so best local to runner local keep = nil - -- local keep = { } -- win case we might need to move keep outside + -- local keep = { } -- in case we might need to move keep outside for n, id, subtype in nextnode, list do local mth = id == math_code and subtype -if mth == 0 then -- begin in line - -- insert(keep,text) - keep = text - text = start_tagged("mrow") - common = common + 1 -end + if mth == 0 then -- begin in line / nested math box like stackers + -- insert(keep,text) + keep = text + text = start_tagged("mrow") + common = common + 1 + end local aa = getattr(n,a_tagged) if aa then local ac = cache[aa] @@ -392,12 +543,7 @@ end end if id == hlist_code or id == vlist_code then runner(getlist(n),depth+1) - elseif id == glyph_code then - -- this should not be needed - -- local components = getcomponents(n) -- unlikely set - -- if components then - -- runner(getcomponent,depth+1) - -- end + -- elseif id == glyph_code then elseif id == disc_code then -- this should not be needed local pre, post, replace = getdisc(n) @@ -411,12 +557,12 @@ end runner(replace,depth+1) end end -if mth == 1 then -- end in line - stop_tagged() - -- text = remove(keep) - text = keep - common = common - 1 -end + if mth == 1 then -- end in line + stop_tagged() + -- text = remove(keep) + text = keep + common = common - 1 + end end end runner(list,0) @@ -433,28 +579,44 @@ end if last then local tag = last.tagname local detail = last.detail - if tag == "maction" then - if detail == "" then - setattr(start,a_tagged,start_tagged("mrow")) - process(list) - stop_tagged() - elseif actionstack[#actionstack] == action then - setattr(start,a_tagged,start_tagged("mrow")) - process(list) - stop_tagged() - else - insert(actionstack,action) - setattr(start,a_tagged,start_tagged("mrow",{ detail = action })) - process(list) - stop_tagged() - remove(actionstack) - end - elseif tag == "mstacker" then -- or tag == "mstackertop" or tag == "mstackermid" or tag == "mstackerbot" then - -- looks like it gets processed twice - -- do we still end up here ? + if tag == "munit" then + setattr(start,a_tagged,start_tagged("mrow", { + mathunit = detail + })) + process(list) + stop_tagged() + elseif tag == "mfunction" then + setattr(start,a_tagged,start_tagged("mrow", { + mathfunction = detail, + mathcategory = getattr(start,a_mathcategory), + mathstack = getattr(start,a_mathstack), + })) + process(list) + stop_tagged() + elseif tag == "mstacker" then setattr(start,a_tagged,restart_tagged(attr)) -- so we just reuse the attribute process(list) stop_tagged() + elseif tag == "mfunctionstack" then + setattr(start,a_tagged,start_tagged("mrow", { + mathfunctionstack = detail, + mathstack = getattr(start,a_mathstack), + })) + process(list) + stop_tagged() + elseif tag == "mfractionstack" then + setattr(start,a_tagged,start_tagged("mrow", { + mathfractionstack = detail, + -- mathstack = getattr(start,a_mathstack), + })) + process(list) + stop_tagged() + elseif tag == "mdigits" then + setattr(start,a_tagged,start_tagged("mrow", { + mathdigits = detail or "unknown", + })) + process(list) + stop_tagged() else setattr(start,a_tagged,start_tagged("mrow")) process(list) @@ -470,10 +632,11 @@ end -- -- if middle then we have a stacker! -- - local num = getnumerator(start) - local denom = getdenominator(start) - local left = getleftdelimiter(start) - local right = getrightdelimiter(start) + local num = getnumerator(start) + local denom = getdenominator(start) + local left = getleftdelimiter(start) + local right = getrightdelimiter(start) + local middle = getdelimiter(start) -- todo get them all in one go if left then setattr(left,a_tagged,start_tagged("mo")) process(left) @@ -483,6 +646,10 @@ end process(num) process(denom) stop_tagged() + if middle then + setattr(middle,a_tagged,start_tagged("ignore")) + stop_tagged() + end if right then setattr(right,a_tagged,start_tagged("mo")) process(right) @@ -506,25 +673,33 @@ end process(scriptscript) end elseif id == fence_code then - local delimiter = getdelimiter(start) --- print(subtype,fencecodes[subtype],delimiter) + local delimiter = getdelimiter(start) + local mfenced = tagging.mfenced + local mathcategory = getattr(start,a_mathcategory) if subtype == leftfence_code then - local properties = { } + local properties = { mathcategory = mathcategory } insert(fencesstack,properties) setattr(start,a_tagged,start_tagged("mfenced",properties)) -- needs checking if delimiter then - start_tagged("ignore") + if mfenced then + start_tagged("ignore") + end local chr = getchar(delimiter) if chr ~= 0 then properties.left = chr end process(delimiter) - stop_tagged() + if mfenced then + stop_tagged() + end end start_tagged("mrow") -- begin of subsequence elseif subtype == middlefence_code then + stop_tagged() -- end of subsequence if delimiter then - start_tagged("ignore") + if mfenced then + start_tagged("ignore") + end local top = fencesstack[#fencesstack] local chr = getchar(delimiter) if chr ~= 0 then @@ -536,100 +711,171 @@ end end end process(delimiter) - stop_tagged() + if mfenced then + stop_tagged() + end end - stop_tagged() -- end of subsequence start_tagged("mrow") -- begin of subsequence elseif subtype == rightfence_code then + stop_tagged() -- end of subsequence local properties = remove(fencesstack) if not properties then report_tags("missing right fence") properties = { } end if delimiter then - start_tagged("ignore") + if mfenced then + start_tagged("ignore") + end local chr = getchar(delimiter) if chr ~= 0 then properties.right = chr end process(delimiter) - stop_tagged() + if mfenced then + stop_tagged() + end end - stop_tagged() -- end of subsequence stop_tagged() elseif subtype == operatorfence_code then - -- the same as left but different key - local properties = { } + local properties = { + operator = true, + mathcategory = mathcategory, + } + local top = gettopdelimiter(start) + local bot = getbottomdelimiter(start) insert(fencesstack,properties) - setattr(start,a_tagged,start_tagged("mfenced",properties)) -- needs checking + setattr(start,a_tagged,start_tagged("mrow",properties)) + if top then + if bot then + start_tagged("msubsup") + else + start_tagged("msup") + end + elseif bot then + start_tagged("msub") + else + start_tagged("mrow",properties) + end if delimiter then + start_tagged("mrow") local chr = getchar(delimiter) if chr ~= 0 then - properties.operator = chr + properties.left = chr end process(delimiter) + stop_tagged() + else + -- error + end + if top or bot then + if top then + start_tagged("mrow", { script = "sup" }) + process(top) + stop_tagged() + end + if bot then + start_tagged("mrow", { script = "sub" }) + process(bot) + stop_tagged() + end end - processsubsup(start) - start_tagged("mrow") -- begin of subsequence - end - elseif id == radical_code then - local left = getleftdelimiter(start) - local right = getrightdelimiter(start) - local degree = getdegree(start) - if left then - start_tagged("ignore") - process(left) -- root symbol, ignored stop_tagged() - end - if right then - start_tagged("ignore") - process(lright) -- actuarian symbol, ignored + start_tagged("mrow") -- begin of subsequence + else -- no fence + local a = getattr(start,a_mathcategory) + local properties = a and { mathcategory = a } + start_tagged("mrow",properties) -- begin of subsequence + if delimiter then + if mfenced then + start_tagged("ignore") + end + process(delimiter) + if mfenced then + stop_tagged() + end + end stop_tagged() end - if degree and hascontent(degree) then - setattr(start,a_tagged,start_tagged("mroot")) - processsubsup(start) - process(degree) - stop_tagged() + elseif id == radical_code then + if subtype == hextensible_code then + -- eventually we have no radical but just some box + local left = getleftdelimiter(start) + if left then + start_tagged("mo") + process(left) + stop_tagged() + end else - setattr(start,a_tagged,start_tagged("msqrt")) - processsubsup(start) - stop_tagged() + local left = getleftdelimiter(start) + local right = getrightdelimiter(start) + local degree = getdegree(start) + if left then + start_tagged("ignore") + process(left) -- root symbol, ignored + stop_tagged() + end + if right then + start_tagged("ignore") + process(lright) -- actuarian symbol, ignored + stop_tagged() + end + if degree and hascontent(degree) then + setattr(start,a_tagged,start_tagged("mroot")) + processsubsup(start) + process(degree) + stop_tagged() + else + setattr(start,a_tagged,start_tagged("msqrt")) + processsubsup(start) + stop_tagged() + end end elseif id == accent_code then - local topaccent = gettop(start) + -- maybe tag the 'mo' so that we can reorder but we only use + -- under and over anyway + local topaccent = gettop(start) local bottomaccent = getbottom(start) + local middleaccent = getdelimiter(start) + local mathcategory = getattr(start,a_mathcategory) if bottomaccent then if topaccent then setattr(start,a_tagged,start_tagged("munderover", { - accent = true, - top = getunicode(topaccent), - bottom = getunicode(bottomaccent), - topfixed = subtype == fixedtopaccent_code or subtype == fixedbothaccent_code, - bottomfixed = subtype == fixedbottomaccent_code or subtype == fixedbothaccent_code, + accent = true, + top = getunicode(topaccent), + bottom = getunicode(bottomaccent), + topfixed = subtype == fixedtopaccent_code or subtype == fixedbothaccent_code, + bottomfixed = subtype == fixedbottomaccent_code or subtype == fixedbothaccent_code, + mathcategory = mathcategory, })) processsubsup(start) - process(bottomaccent) - process(topaccent) + setattr(bottomaccent,a_tagged,start_tagged("mo")) + stop_tagged() + setattr(topaccent,a_tagged,start_tagged("mo")) + stop_tagged() stop_tagged() else setattr(start,a_tagged,start_tagged("munder", { - accent = true, - bottom = getunicode(bottomaccent), - bottomfixed = subtype == fixedbottomaccent_code or subtype == fixedbothaccent_code, + accent = true, + bottom = getunicode(bottomaccent), + bottomfixed = subtype == fixedbottomaccent_code or subtype == fixedbothaccent_code, + mathcategory = mathcategory, })) processsubsup(start) - process(bottomaccent) + setattr(bottomaccent,a_tagged,start_tagged("mo")) + stop_tagged() stop_tagged() end elseif topaccent then setattr(start,a_tagged,start_tagged("mover", { - accent = true, - top = getunicode(topaccent), - topfixed = subtype == fixedtopaccent_code or subtype == fixedbothaccent_code, + accent = true, + top = getunicode(topaccent), + topfixed = subtype == fixedtopaccent_code or subtype == fixedbothaccent_code, + mathcategory = mathcategory, })) processsubsup(start) - process(topaccent) + setattr(topaccent,a_tagged,start_tagged("mo")) + stop_tagged() stop_tagged() else processsubsup(start) @@ -640,29 +886,38 @@ end local wd = getwidth(start) if em and wd then setattr(start,a_tagged,start_tagged("mspace",{ emfactor = wd/em })) + stop_tagged() end - stop_tagged() else --rule boundary - setattr(start,a_tagged,start_tagged("merror", { detail = nodecodes[id] })) - stop_tagged() + -- setattr(start,a_tagged,start_tagged("merror", { detail = nodecodes[id] })) + -- stop_tagged() end end --- showtag(start,id,false) end if mtexttag then stop_tagged() end end +local standalone = false + +directives.register("structures.tags.math.standalone", function(v) standalone = v end) + function noads.handlers.tags(head,style,penalties) - start_tagged("math", { mode = (getattr(head,a_mathmode) == 1) and "display" or "inline" }) + start_tagged("math", { + mode = (getattr(head,a_mathmode) == 1) and "display" or "inline", + standalone = standalone, + input = mathematics.lastinput, + blob = getintegervalue(c_mathblob), + language = getmacro("currentlanguage"), + domain = mathematics.getdomainname(tonumber(getattr(head,a_mathdomain))), + }) setattr(head,a_tagged,start_tagged("mrow")) --- showtag(head,getid(head),true) process(head) --- showtag(head,getid(head),false) stop_tagged() stop_tagged() + mathematics.lastinput= nil end do @@ -673,83 +928,238 @@ do -- the blob. I'll deal with that when it's needed (trivial). The current -- interface is rather minimalistic. - local enabled = false - local export = false - local allmath = false - local warned = false + local enabled = false + local export = false + local warned = false + local current = 0 + local shared = { } + local orders = { } + local hashed = { } + local blobdone = setmetatableindex("table") - function mathematics.startcollecting() + local function register(order,data) + if not data then + data = "" + end + local hash = sha2.HEX256(data) -- maybe direct + local index = hashed[hash] + if not index then + index = #shared + 1 + hashed[hash] = index + shared[index] = { + data = data, + strip = xml.mml.stripped(data), -- we could delay this as it often only happens once + } + end + orders[order] = index + return index + end + + function mathematics.enablecollecting() if structures.tags.enabled() then if not enabled then nodes.tasks.enableaction("math", "noads.handlers.export") end enabled = true export = structures.tags.localexport - allmath = { } elseif not warned then report_tags("math collecting only works when tagging is enabled") warned = true end end - function mathematics.stopcollecting() - export = false + local function getmathblob(blob) + local index = orders[blob] + return index and shared[index].strip + end + + local function gettextblob(language,blob) + if not blob then + blob = language + language = "en" + end + local index = orders[blob] + if index then + local entry = shared[index] + local data = entry and entry[language] + if not data then + -- when no labels we actually now duplicate but so be it + data = xml.mml.verbose(entry.data,language) + entry[language] = data + + end + return data + end end - local function collected(asstring) - local a = allmath or { } - return asstring and concat(a) or a + local function getblobindex(blob) + return orders[blob] or 0 end - mathematics.collected = collected + local function markblobindexdone(language,n) + blobdone[language][n] = true + end + + mathematics.getmathblob = getmathblob + mathematics.gettextblob = gettextblob + mathematics.getblobindex = getblobindex + mathematics.markblobindexdone = markblobindexdone + + local integer_value = tokens.values.integer + local boolean_value = tokens.values.boolean + + local implement = interfaces.implement + local context = context + local ctxescaped = context.ctxescaped + + implement { + name = "getmathblob", + protected = true, + public = true, + arguments = "integer", + actions = function(n) + context(getmathblob(n) or "") + end + } + + implement { + name = "gettextblob", + protected = true, + public = true, + arguments = { "string", "integer" }, + actions = function(language,n) + ctxescaped(gettextblob(language,n) or "") + end + } + + implement { + name = "getblobindex", + public = true, + usage = "value", + arguments = "integer", + actions = function(n) + return integer_value, getblobindex(n) + end + } + + implement { + name = "lastblobindex", + public = true, + usage = "value", + arguments = "integer", + actions = function(n) + return integer_value, #shared + end + } - interfaces.implement { - name = "startcollectingmath", + implement { + name = "markblobindexdone", + protected = true, + public = true, + arguments = { "string", "integer" }, + actions = markblobindexdone + } + + implement { + name = "ifblobindexdone", + public = true, + usage = "condition", + arguments = { "string", "integer" }, + actions = function(language,n) + return boolean_value, blobdone[language][n] + end + } + + implement { + name = "enablecollectingmath", -- public = true, protected = true, - actions = mathematics.startcollecting + actions = mathematics.enablecollecting } - interfaces.implement { - name = "stopcollectingmath", + implement { + name = "startcollectingmath", -- obsolete -- public = true, protected = true, - actions = mathematics.stopcollecting + actions = mathematics.enablecollecting } - interfaces.implement { + implement { + name = "stopcollectingmath", -- obsolete + -- public = true, + protected = true, + actions = function() end + } + + -- for now here .. will become a proper lpeg + + local toascii do + + local utfbyte = utf.byte + local gsub, format, find = string.gsub, string.format, string.find + + local clean = setmetatableindex(function(t,k) + local n = utfbyte(k) + if n > 127 then + n = format("&#x%X;",n) + else + n = false + end + t[k] = n + return n + end) + + local pattern = utf8.charpattern + + toascii = function(data) + return (gsub(data,pattern,clean)) + end + + end + + implement { name = "processcollectedmath", -- public = true, protected = true, - arguments = "2 strings", - actions = function(filename,buffername) + arguments = "4 strings", + actions = function(filename,buffername,n,option) + local blob = n and tonumber(n) or getintegervalue(c_mathblob) + local data = getmathblob(blob) or "" + if option == "ascii" then + data = toascii(data) + end if filename and filename ~= "" then - io.savedata(filename,collected(true)) + io.savedata(filename,data) elseif buffername then - buffers.assign(buffername == interfaces.variables.yes and "" or buffername,collected(true)) + buffers.assign(buffername == interfaces.variables.yes and "" or buffername,data) else - return collected + return data end end } - interfaces.implement { + implement { name = "collectedmath", usage = "value", protected = true, public = true, actions = function(what) if what == "value" then - return tokens.values.integer, allmath and #allmath or 0 + return integer_value, current else - context(allmath and allmath[tokens.scanners.integer()] or nil) + context(getmathblob(tokens.scanners.integer()) or "") end end } + local a_mathblob = attributes.private('mathblob') + function noads.handlers.export(head) if export then - allmath[#allmath+1] = export(head) + local nesting = getintegervalue(c_mathblobnesting) + if nesting == 1 then + register(getintegervalue(c_mathblob),export(head,"math")) + end end return head end diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl index 34ea6f38c02..e57392c8c80 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl @@ -34,15 +34,15 @@ \protected\def\math_toy_define_symbol_traced#1#2% {\normalexpanded{\discretionary class #1 % - {$\Ustyle\number\mathstyle \darkred #2$}% - {$\Ustyle\number\mathstyle \darkblue #2$}% - {$\Ustyle\number\mathstyle \darkgreen #2$}}} + {$\givenmathstyle\the\mathstyle \darkred #2$}% + {$\givenmathstyle\the\mathstyle \darkblue #2$}% + {$\givenmathstyle\the\mathstyle \darkgreen #2$}}} \protected\def\math_toy_define_symbol_normal#1#2% {\normalexpanded{\discretionary class #1 % - {$\Ustyle\number\mathstyle #2$}% - {$\Ustyle\number\mathstyle #2$}% - {$\Ustyle\number\mathstyle #2$}}} + {$\givenmathstyle\the\mathstyle #2$}% + {$\givenmathstyle\the\mathstyle #2$}% + {$\givenmathstyle\the\mathstyle #2$}}} \installtextracker {math.toysymbol} diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-chemistry.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-chemistry.lmt new file mode 100644 index 00000000000..451b9e4aafe --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-chemistry.lmt @@ -0,0 +1,63 @@ +if not modules then modules = { } end modules ['math-txt'] = { + version = 1.001, + comment = "companion to math-ini.mkxl", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", + dataonly = true, +} + +-- This one is not ok yet but used as test. + +return { + ["sub"]={ + ["en"]="count", + ["sv"]="Cnedsänkt", + ["nl"]="aantal", + }, + ["super"]={ + ["en"]="charge", + ["sv"]="Cupphöjd", + ["nl"]="lading", + }, + ["presub"]={ + ["en"]="weight", + ["sv"]="Cnedsänkt", + ["nl"]="gewicht", + }, + ["presuper"]={ + ["en"]="isotope", + ["sv"]="Cupphöjd", + ["nl"]="CTODO", + }, + ["postsub"]={ + ["en"]="count", + ["sv"]="Cnedsänkt", + ["nl"]="aantal", + }, + ["postsuper"]={ + ["en"]="charge", + ["sv"]="Cupphöjd", + ["nl"]="lading", + }, + ["prescripts"]={ + ["en"]="", + ["sv"]="", + ["nl"]="", + }, + ["end scripts"]={ + ["en"]="", + ["sv"]="", + ["nl"]="", + }, + ["postscripts"]={ + ["en"]="", + ["sv"]="", + ["nl"]="", + }, + ["endpostcripts"]={ + ["en"]="", + ["sv"]="", + ["nl"]="", + }, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-default.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-default.lmt new file mode 100644 index 00000000000..6ca734fa164 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/math-txt-imp-default.lmt @@ -0,0 +1,1540 @@ +if not modules then modules = { } end modules ['math-txt'] = { + version = 1.001, + comment = "companion to math-ini.mkxl", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", + dataonly = true, +} + +return { + + -- (No) Space + + ["notimes"]={ + ["en"]=",", + ["sv"]=",", + ["nl"]=",", + }, + + + -- Structure related strings: + + ["and"]={ + ["en"]="and", + ["sv"]="och", + ["nl"]="en", + }, + ["and over"]={ + ["en"]="and over", + ["sv"]="och över", + ["nl"]="en boven", + }, + ["and upper limit"]={ + ["en"]="and upper limit", + ["sv"]="och övre gräns", + ["nl"]="boven limiet", + }, + ["applied to"]={ + ["en"]="applied to", + ["sv"]="tillämpad på", + ["nl"]="toegepast op", + }, + ["cubed"]={ + ["en"]="cubed", + ["sv"]="i kubik", + ["nl"]="derde macht", + }, + ["end derivative"]={ + ["en"]="end derivative", + ["sv"]="slut derivatan", + ["nl"]="eind afgeleide", + }, + ["indexed"]={ + ["en"]="indexed", + ["sv"]="med index", + ["nl"]="met index", + }, + ["of"]={ + ["en"]="of", + ["sv"]="av", + ["nl"]="van", + }, + ["over"]={ + ["en"]="over", + ["sv"]="över", + ["nl"]="over", + }, + ["begin group"]={ + ["en"]="group", + ["sv"]="grupp", + ["nl"]="groep", + }, + ["begin"]={ + ["en"]="begin", -- was begin + ["sv"]="start", -- was påbörja + ["nl"]="begin", + }, + ["optional begin"]={ + ["en"]="", -- was begin + ["sv"]="", -- was påbörja + ["nl"]="", + }, +-- ["end fenced"]={ +-- ["en"]="end fenced", +-- ["sv"]="stop GRUPP", +-- }, + ["end group"]={ + ["en"]="end group", + ["sv"]="slut grupp", + ["nl"]="einde groep", + }, + ["pause"]={ + ["en"]=",", --"TAKE A DEEP BREATH", + ["sv"]=",", --"pausa", + ["nl"]=",", --"pauze", + }, + ["comma"]={ + ["en"]="comma", + ["sv"]="komma", + ["nl"]="comma", + }, + ["postscripts"]={ + ["en"]="postscripts", + ["sv"]="postskript", + ["en"]="postscripts", + }, + ["prescripts"]={ + ["en"]="prescripts", + ["sv"]="preskript", + ["nl"]="prescripts", + }, + ["end scripts"]={ + ["en"]="end scripts", + ["sv"]="slut skript", + ["nl"]="einde scripts", + }, + ["squared"]={ + ["en"]="squared", + ["sv"]="i kvadrat", + ["nl"]="kwadraad", + }, + ["sub"]={ + ["en"]="with lower index", + ["sv"]="med undre index", + ["nl"]="TODO", + }, + ["super"]={ + ["en"]="super", + ["sv"]="upphöjd", + ["nl"]="super", + }, + ["presub"]={ + ["en"]="sub", + ["sv"]="nedsänkt", + ["nl"]="sub", + }, + ["presuper"]={ + ["en"]="super", + ["sv"]="upphöjd", + ["nl"]="super", + }, + ["postsub"]={ + ["en"]="sub", + ["sv"]="nedsänkt", + ["nl"]="sub", + }, + ["postsuper"]={ + ["en"]="super", + ["sv"]="upphöjd", + ["nl"]="super", + }, + ["the derivative"]={ + ["en"]="the derivative", + ["sv"]="derivatan", + ["nl"]="de afgeleide", + }, + ["the fraction of"]={ + ["en"]="the fraction of", + ["sv"]="kvoten av", + ["nl"]="de breuk van", + }, + ["the partial derivative"]={ + ["en"]="the partial derivative", + ["sv"]="den partiella derivatan", + ["nl"]="de partiele afgeleide", + }, + ["the root with degree"]={ + ["en"]="the root with degree", + ["sv"]="roten ur med grad", + ["nl"]="de wortel met de graad", + }, + ["the square root"]={ + ["en"]="the square root", + ["sv"]="kvadratroten", + ["nl"]="de vierkantswortel", + }, + ["to the power of"]={ + ["en"]="to the power of", + ["sv"]="upphöjt till", + ["nl"]="tot de macht", + }, + ["under"]={ + ["en"]="under", + ["sv"]="under", + ["nl"]="onder", + }, + ["with lower limit"]={ + ["en"]="with lower limit", + ["sv"]="med undre gräns", + ["nl"]="met onder limiet", + }, + ["with upper limit"]={ + ["en"]="with upper limit", + ["sv"]="med övre gräns", + ["nl"]="met boven limiet", + }, + ["functionof"]={ + ["en"]="of", + ["sv"]="av", + ["nl"]="van", + }, + ["primeof"]={ + ["en"]="of", + ["sv"]="av", + ["nl"]="van", + }, + ["rootof"]={ + ["en"]="of", + ["sv"]="av", + ["nl"]="van", + }, + + ["binom"]={ + ["en"]="begin the binomial coefficient", + ["sv"]="start binomialkoefficienten", + ["nl"]="begin binominaal coefficient", + }, + ["end binom"]={ + ["en"]="end", + ["sv"]="slut", + ["nl"]="einde", + }, + + -- Verbose function names: + + ["Pr"]={ + ["en"]="probability", + ["sv"]="sannolikhet", + ["nl"]="waarschijnlijkheid", + }, + ["adj"]={ + ["en"]="the adjugate", + ["sv"]="adjungerade", + ["nl"]="TODO", + }, + ["coker"]={ + ["en"]="the cokernel", + ["sv"]="kokärnan", + ["nl"]="TODO", + }, + ["deg"]={ + ["en"]="the degree", + ["sv"]="graden", + ["nl"]="graad", + }, + ["det"]={ + ["en"]="the determinant", + ["sv"]="determinanten", + ["nl"]="de determinand", + }, + ["diff"]={ + ["en"]="d", + ["sv"]="d", + ["nl"]="d", + }, + ["dim"]={ + ["en"]="the dimension", + ["sv"]="dimensionen", + ["nl"]="de dimensie", + }, + ["div"]={ + ["en"]="the divergence", + ["sv"]="divergensen", + ["nl"]="TODO", + }, + ["gcd"]={ + ["en"]="the greatest common divisor", + ["sv"]="den största gemensamma delaren", + ["nl"]="de grootste gemene deler", + }, + ["inf"]={ + ["en"]="the infimum", + ["sv"]="infimumet", + ["nl"]="TODO", + }, + ["inv"]={ + ["en"]="the inverse", + ["sv"]="inversen", + ["nl"]="TODO", + }, + ["ker"]={ + ["en"]="the kernel", + ["sv"]="nollrummet", + ["nl"]="TODO", + }, + ["lg"]={ + ["en"]="the logarithm", + ["sv"]="logaritmen", + ["nl"]="de logaritme", + }, + ["lim"]={ + ["en"]="the limit", + ["sv"]="gränsvärdet", + ["nl"]="de limiet", + }, + ["ln"]={ + ["en"]="the natural logarithm", + ["sv"]="den naturliga logaritmen", + ["nl"]="de natuurlijke logaritme", + }, + ["log"]={ + ["en"]="the logarithm", + ["sv"]="logaritmen", + ["nl"]="de logaritme", + }, + ["max"]={ + ["en"]="the maximum", + ["sv"]="maximumet", + ["nl"]="maximum", + }, + ["min"]={ + ["en"]="the minimum", + ["sv"]="minimumet", + ["nl"]="minumum", + }, + ["mod"]={ + ["en"]="modulo", + ["sv"]="TODO", + ["en"]="modulo", + }, + ["sup"]={ + ["en"]="the supremum", + ["sv"]="supremumet", + ["nl"]="TODO", + }, + + -- Accent function: + + ["closure"]={ + ["en"]="the closure of", + ["sv"]="det slutna höljet av", + ["nl"]="TODO", + }, + ["conjugate"]={ + ["en"]="the conjugate of", + ["sv"]="konjugatet av", + ["nl"]="TODO", + }, + +-- Function + + ["function"]={ + ["en"]="the function", + ["sv"]="",--"funktionen", + ["nl"]="de functie", + }, + ["arg"]={ + ["en"]="the argument", + ["sv"]="argumentet", + ["nl"]="het argument", + }, + + ["crossproduct"]={ + ["en"]="crossproduct", + ["sv"]="kryssprodukt", + ["nl"]="kruisprodukt", + }, + ["gradient"]={ + ["en"]="the gradient", + ["sv"]="gradienten", + ["nl"]="de gradient", + }, + ["nabla"]={ + ["en"]="the nabla", + ["sv"]="nablan", + ["nl"]="nabla", + }, + ["neg"]={ + ["en"]="NEGation", + ["sv"]="negationen", + ["nl"]="TODO", + }, + + ["laplace"]={ + ["en"]="laplace", + ["sv"]="laplace", + ["nl"]="laplace", + }, + + ["scalarproduct"]={ + ["en"]="scalarproduct", + ["sv"]="skalärprodukt", + ["nl"]="scalair produkt", + }, + + ["vectorproduct"]={ + ["en"]="vectorproduct", + ["sv"]="vektorprodukt", + ["nl"]="vector produkt", + }, + +-- A specific one + ["applyfunctionof"]={ + ["en"]="of", + ["sv"]="av", + ["nl"]="van", + }, + +-- Show nothing if we only use the "symbol" + ["applyfunction"]={ + ["en"]="", + ["sv"]="", + ["nl"]="", + }, + +-- Operators + + ["integralsub"]={ + ["en"]="over", + ["sv"]="över", + ["nl"]="over", + }, + + ["limitsub"]={ + ["en"]="as", + ["sv"]="då", + ["nl"]="TODO", + }, + + ["operatorof"]={ + ["en"]="of", + ["sv"]="av", + ["nl"]="van", + }, + ["subindex"]={ + ["en"]="with lower index", + ["sv"]="med undre index", + ["nl"]="met onder index", + }, + ["supindex"]={ + ["en"]="with upper index", + ["sv"]="med övre index", + ["nl"]="met boven index", + }, + + ["operatorsup"]={ + ["en"]="with upper limit", + ["sv"]="med övre gräns", + ["nl"]="met boven limiet", + }, + + ["operatorsubsupfrom"]={ + ["en"]="from", + ["sv"]="från", + ["nl"]="van", + }, + + ["operatorsubsupto"]={ + ["en"]="to", + ["sv"]="till", + ["nl"]="tot", + }, + -- Verbose unicode characters: + + ["Q.E.D."]={ + ["en"]="Q.E.D.", + ["sv"]="V.S.B.", + ["nl"]="Q.E.D.", + }, + ["and"]={ + ["en"]="and", + ["sv"]="och", + ["nl"]="en", + }, + ["and so on"]={ + ["en"]=", and so on,", + ["sv"]=", och så vidare,", + ["nl"]=", enzovoort,", + }, + ["anticlockwise contour integral"]={ + ["en"]="anticlockwise contour integral", + ["sv"]="moturs orienterad kurvintegral", + ["nl"]="tegen de klok in oppervlakte integraal", + }, + ["approximately equals"]={ + ["en"]="approximately equals", + ["sv"]="är ungefär lika med", + ["nl"]="is ongeveer gelijk aan", + }, + ["approximately equals, or equals"]={ + ["en"]="approximately equals, or equals", + ["sv"]="är ungefär lika med, eller lika med", + ["nl"]="is ongeveer gelijk aan of gelijk aan", + }, + ["approximately identical to"]={ + ["en"]="approximately identical to", + ["sv"]="är ungefär lika med", + ["nl"]="is ongeveer gelijk aan", + }, + ["are all equal to"]={ + ["en"]="are all equal to", + ["sv"]="är alla lika med", + ["nl"]="zijn allemaal gelijk aan", + }, + ["asymptotically equals"]={ + ["en"]="asymptotically equals", + ["sv"]="är asymptotiskt lika med", + ["nl"]="is asymptotisch gelijk aan", + }, + ["because"]={ + ["en"]="because", + ["sv"]="eftersom", + ["nl"]="omdat", + }, + ["fenced"]={ + ["en"]="fenced", + ["sv"]="grupp", + ["nl"]="begrensd", + }, + ["belongs to"]={ + ["en"]="belongs to", + ["sv"]="tillhör", + ["nl"]="behoort tot", + }, + ["clockwise contour integral"]={ + ["en"]="clockwise contour integral", + ["sv"]="medurs orienterad kurvintegral", + ["nl"]="oppervlakte integraal", + }, + ["clockwise integral"]={ + ["en"]="clockwise integral", + ["sv"]="medurs integral", + ["nl"]="integraal", + }, + ["composed with"]={ + ["en"]="composed with", + ["sv"]="sammansatt med", + ["nl"]="samengesteld met", + }, + ["contains"]={ + ["en"]="contains", + ["sv"]="innehåller", + ["nl"]="bevat", + }, + ["contour integral"]={ + ["en"]="contour integral", + ["sv"]="kurvintegral", + ["nl"]="oppervlakte integraal", + }, + ["convolved with"]={ + ["en"]="convolved with", + ["sv"]="faltad med", + ["nl"]="TODO", + }, + ["coproduct"]={ + ["en"]="coproduct", + ["sv"]="koprodukt", + ["nl"]="coprodukt", + }, + ["differential"]={ + ["en"]="d", + ["sv"]="d", + ["nl"]="d", + }, + ["defines"]={ + ["en"]="defines", + ["sv"]="definierar", + ["nl"]="definieert", + }, + ["diamond operator"]={ + ["en"]="diamond operator", + ["sv"]="diamantoperator", + ["nl"]="TODO", + }, + ["differential operator D"]={ + ["en"]="D", + ["sv"]="D", + ["nl"]="D", + }, + ["direct sum"]={ + ["en"]="direct sum", + ["sv"]="direkt summa", + ["nl"]="direkte som", + }, + ["divided by"]={ + ["en"]="divided by", + ["sv"]="delad med", + ["nl"]="gedeeld door", + }, + ["divides"]={ + ["en"]="divides", + ["sv"]="delar", + ["nl"]="verdeelt", + }, + ["does not belong to"]={ + ["en"]="does not belong to", + ["sv"]="tillhör ej", + ["nl"]="hoort niet bij", + }, + ["does not contain"]={ + ["en"]="does not contain", + ["sv"]="innehåller ej", + ["nl"]="bevat geen", + }, + ["does not contain a normal subgroup"]={ + ["en"]="does not contain the normal subgroup", + ["sv"]="innehåller ej den normala delgruppen", + ["nl"]="bevat niet de normale subgroep", + }, + ["does not contain a normal subgroup, nor is equal to"]={ + ["en"]="does not contain the normal subgroup, nor is equal to", + ["sv"]="innehåller ej den normala delgruppen, och är inte lika med", + ["nl"]="bevat niet de normale subgroep en is ook niet gelijk aan", + }, + ["does not divide"]={ + ["en"]="does not divide", + ["sv"]="delar ej", + ["nl"]="verdeelt niet", + }, + ["does not exist"]={ + ["en"]="does not exist", + ["sv"]="existerar ej", + ["nl"]="bestaat niet", + }, + ["does not precede"]={ + ["en"]="does not precede", + ["sv"]="föregår ej", + ["nl"]="gaat niet vooraf aan", + }, + ["does not precede, nor equals to"]={ + ["en"]="does not precede, nor equals to", + ["sv"]="föregår ej, och är inte lika med", + ["nl"]="gaat niet vooraf aan en is ook niet gelijk aan", + }, + ["does not succeed"]={ + ["en"]="does not succeed", + ["sv"]="does not succeed", -- MS: todo + ["nl"]="volgt niet op", + }, + ["does not succeed, nor equals to"]={ + ["en"]="does not succeed, nor equals to", + ["sv"]="does not succeed, nor equals to", -- MS: todo + ["nl"]="volgt niet op en is ook niet gelijk an", + }, + ["dot plus"]={ + ["en"]="dot plus", + ["sv"]="dot plus", + ["nl"]="TODO", + }, + ["dot product"]={ + ["en"]="dot product", + ["sv"]="skalärprodukt", + ["nl"]="TODO", + }, + ["double integral"]={ + ["en"]="double integral", + ["sv"]="dubbelintegral", + ["nl"]="dubbel integraal", + }, + ["end"]={ + ["en"]="end", + ["sv"]="slut", + ["nl"]="eind", + }, + ["empty set"]={ + ["en"]="empty set", + ["sv"]="tomma mängden", + ["nl"]="TODO", + }, + ["equals"]={ + ["en"]="equals", + ["sv"]="är lika med", + ["nl"]="is gelijk aan", + }, + ["equals, or is greater than"]={ + ["en"]="equals, or is greater than", + ["sv"]="är lika med, eller större än", + ["nl"]="is groter of gelijk an", + }, + ["equals, or is less than"]={ + ["en"]="equals, or is less than", + ["sv"]="är lika med, eller mindre än", + ["nl"]="kleiner of gelijk aan", + }, + ["equals, or precedes"]={ + ["en"]="equals, or precedes", + ["sv"]="är lika med eller föregår", + ["nl"]="is gelijk of gaat vooraf aan", + }, + ["equals, or succeeds"]={ + ["en"]="equals, or succeeds", + ["sv"]="är lika med, eller följer efter", + ["nl"]="is gelijk of volgt op", + }, + ["factorial"]={ + ["en"]="factorial", + ["sv"]="fakultet", + ["nl"]="TODO", + }, + ["false"]={ + ["en"]="false", + ["sv"]="falskt", + ["nl"]="onwaar", + }, + ["for all"]={ + ["en"]="for all", + ["sv"]="för alla", + ["nl"]="voor alle", + }, + ["fractionplus"]={ + ["en"]="FRACTIONPLUS", + ["sv"]="TODO", + ["nl"]="TODO", + }, + ["gets"]={ + ["en"]="gets", + ["sv"]="får", + ["nl"]="krijgt", + }, + ["greater than, but not equivalent to"]={ + ["en"]="greater than, but not equivalent to", + ["sv"]="större än, men ej ekvivalent med", + ["nl"]="groter dan maar niet equivalent aan", + }, + ["if, and only if"]={ + ["en"]="if, and only if", + ["sv"]="om, och endast om", + ["nl"]="als, en alleen als", + }, + ["image of"]={ + ["en"]="image of", + ["sv"]="bilden av", + ["nl"]="afbeelding van", + }, + ["imaginary i"]={ + ["en"]="imaginary i", + ["sv"]="imaginära i", + ["nl"]="imaginaire i", + }, + ["imaginary j"]={ + ["en"]="imaginary j", + ["sv"]="imaginära j", + ["nl"]="imaginaire j", + }, + ["implies"]={ + ["en"]="implies", + ["sv"]="medför", + ["nl"]="impliceert", + }, + ["infinity"]={ + ["en"]="infinity", + ["sv"]="oändligheten", + ["nl"]="oneindig", + }, + ["integral"]={ + ["en"]="integral", + ["sv"]="integral", + ["nl"]="integraal", + }, + ["intersection"]={ + ["en"]="intersection", + ["sv"]="snitt", + ["nl"]="doorsnede", + }, + ["is a subset of"]={ + ["en"]="is a subset of", + ["sv"]="är en delmängd av", + ["nl"]="is onderdeel van", + }, + ["is a subset of, but not equal to"]={ + ["en"]="is a subset of, but not equal to", + ["sv"]="är en delmängd av, men inte lika med", + ["nl"]="is onderdeel van maar niet gelijk aan", + }, + ["is a subset of, or equal to"]={ + ["en"]="is a subset of, or equal to", + ["sv"]="är en delmängd av, eller lika med", + ["nl"]="is onderdeel van of gelijk aan", + }, + ["is a superset of"]={ + ["en"]="is a superset of", + ["sv"]="omfattar", + ["nl"]="TODO", + }, + ["is a superset of, but not equal to"]={ + ["en"]="is a superset of, but not equal to", + ["sv"]="omfattar, och är ej lika med", + ["nl"]="TODO", + }, + ["is a superset of, or equal to"]={ + ["en"]="is a superset of, or equal to", + ["sv"]="omfatter, eller är lika med", + ["nl"]="TODO", + }, + ["is defined by"]={ + ["en"]="is defined by", + ["sv"]="definieras av", + ["nl"]="is gedefinieerd door", + }, + ["is equivalent to"]={ + ["en"]="is equivalent to", + ["sv"]="är ekvivalent med", + ["nl"]="is equivalent aan", + }, + ["is greater than"]={ + ["en"]="is greater than", + ["sv"]="är större än", + ["nl"]="is groter dan", + }, + ["is greater than, but not equal to"]={ + ["en"]="is greater than, but not equal to", + ["sv"]="är större än, men inte lika med", + ["nl"]="is groter dan maar niet gelijk aan", + }, + ["is greater than, equals, or less than"]={ + ["en"]="is greater than, equals, or less than", + ["sv"]="är större än, lika med, eller mindre än", + ["nl"]="is groter dan, gelijk aan of minder dan", + }, + ["is greater than, or equal to"]={ + ["en"]="is greater than, or equal to", + ["sv"]="är större än, eller lika med", + ["nl"]="is groter dan of gelijk aan", + }, + ["is greater than, or less than"]={ + ["en"]="is greater than, or less than", + ["sv"]="är större än, eller mindre än", + ["nl"]="is groter dan of kleiner aan", + }, + ["is greater than, or similar to"]={ + ["en"]="is greater than, or similar to", + ["sv"]="är större än, eller jämförbar med", + ["nl"]="is groter dan or vergelijkbaar met", + }, + ["is implied by"]={ + ["en"]="is implied by", + ["sv"]="följer av", + ["nl"]="volgt uit", + }, + ["is less than"]={ + ["en"]="is less than", + ["sv"]="är mindre än", + ["nl"]="is kleiner dan", + }, + ["is less than, but not equal to"]={ + ["en"]="is less than, but not equal to", + ["sv"]="är mindre än, men inte lika med", + ["nl"]="is kleiner dan maar niet gelijk aan", + }, + ["is less than, equals, or greater than"]={ + ["en"]="is less than, equals, or greater than", + ["sv"]="är mindre än, lika med, eller större än", + ["nl"]="is kleiner dan, gelijk aan of groter dan", + }, + ["is less than, or equal to"]={ + ["en"]="is less than, or equal to", + ["sv"]="är mindre än, eller lika med", + ["nl"]="is kleiner dan of gelijk aan", + }, + ["is less than, or greater than"]={ + ["en"]="is less than, or greater than", + ["sv"]="är mindre än, eller större än", + ["nl"]="is kleiner dan of groter dan", + }, + ["is less than, or similar to"]={ + ["en"]="is less than, or similar to", + ["sv"]="är mindre än, eller liknande", + ["nl"]="is kleiner dan of vergelijkaar met", + }, + ["is much greater than"]={ + ["en"]="is much greater than", + ["sv"]="är mycket större än", + ["nl"]="is veel groter dan", + }, + ["is much less than"]={ + ["en"]="is much less than", + ["sv"]="är mycket mindre än", + ["nl"]="is veel kleiner dan", + }, + ["is neither a subset of, nor equal to"]={ + ["en"]="is neither a subset of, nor equal to", + ["sv"]="är varken en delmängd av, eller lika med", + ["nl"]="is geen subset van en ook niet gelijk aan", + }, + ["is neither a superset of, nor equal to"]={ + ["en"]="is neither a superset of, nor equal to", + ["sv"]="varken omfattar, eller är jämförbar med", + ["nl"]="TODO", + }, + ["is neither approximately, nor equal to"]={ + ["en"]="is neither approximately, nor equal to", + ["sv"]="är varken ungefärligt lika med, eller lika med", + ["nl"]="TODO", + }, + ["is neither greater than, nor equal to"]={ + ["en"]="is neither greater than, nor equal to", + ["sv"]="är varken större än, eller lika med", + ["nl"]="TODO", + }, + ["is neither greater than, nor less than"]={ + ["en"]="is neither greater than, nor less than", + ["sv"]="är varken större än, eller mindre än", + ["nl"]="TODO", + }, + ["is neither greater than, nor similar to"]={ + ["en"]="is neither greater than, nor similar to", + ["sv"]="är varken större än, eller jämförbar med", + ["nl"]="TODO", + }, + ["is neither less than, nor equal to"]={ + ["en"]="is neither less than, nor equal to", + ["sv"]="är varken mindre än, eller lika med", + ["nl"]="TODO", + }, + ["is neither less than, nor greater than"]={ + ["en"]="is neither less than, nor greater than", + ["sv"]="är varken mindre än, eller större än", + ["nl"]="TODO", + }, + ["is neither less than, nor similar to"]={ + ["en"]="is neither less than, nor similar to", + ["sv"]="är varken mindre än, eller jämförbar med", + ["nl"]="TODO", + }, + ["is not a normal subgroup of"]={ + ["en"]="is not a normal subgroup of", + ["sv"]="är inte en delgrupp av", + ["nl"]="TODO", + }, + ["is not a normal subgroup of, nor equal to"]={ + ["en"]="is not a normal subgroup of, nor equal to", + ["sv"]="är inte en normal delgrupp av, eller lika med", + ["nl"]="TODO", + }, + ["is not a subset of"]={ + ["en"]="is not a subset of", + ["sv"]="är inte en delmängd av", + ["nl"]="TODO", + }, + ["is not a superset of"]={ + ["en"]="is not a superset of", + ["sv"]="omfattar ej", + ["nl"]="TODO", + }, + ["is not approximately equal to"]={ + ["en"]="is not approximately equal to", + ["sv"]="är inte ungefärligt lika med", + ["nl"]="TODO", + }, + ["is not asymptotically equal to"]={ + ["en"]="is not asymptotically equal to", + ["sv"]="är inte asymptotiskt lika med", + ["nl"]="TODO", + }, + ["is not equal to"]={ + ["en"]="is not equal to", + ["sv"]="är inte lika med", + ["nl"]="TODO", + }, + ["is not equivalent to"]={ + ["en"]="is not equivalent to", + ["sv"]="är inte ekvivalent med", + ["nl"]="is niet equivalent aan", + }, + ["is not greater than"]={ + ["en"]="is not greater than", + ["sv"]="är inte större än", + ["nl"]="is niet groter dan", + }, + ["is not implied by"]={ + ["en"]="is not implied by", + ["sv"]="följer ej av", + ["nl"]="TODO", + }, + ["is not less than"]={ + ["en"]="is not less than", + ["sv"]="är inte mindre än", + ["nl"]="is niet kleiner dan", + }, + ["is not parallel to"]={ + ["en"]="is not parallel to", + ["sv"]="är inte parallell med", + ["nl"]="is niet parallel aan", + }, + ["is parallel to"]={ + ["en"]="is parallel to", + ["sv"]="är parallell med", + ["nl"]="is parallel aan", + }, + ["is proportional to"]={ + ["en"]="is proportional to", + ["sv"]="is proportionelig mot", + ["nl"]="TODO", + }, + ["is strictly equivalent to"]={ + ["en"]="is strictly equivalent to", + ["sv"]="är strikt ekvivalent med", + ["nl"]="is precies equivalent aan", + }, + ["laplacian"]={ + ["en"]="the laplace operator", + ["sv"]="laplaceoperatorn", + ["nl"]="TODO", + }, + ["leads to"]={ + ["en"]="leads to", + ["sv"]="leder till", + ["nl"]="leidt tot", + }, + ["left semidirect product"]={ + ["en"]="left semidirect product", + ["sv"]="vänster halvdirekt produkt", + ["nl"]="TODO", + }, + ["less or equal to"]={ + ["en"]="less, or equal to", + ["sv"]="mindre än, eller lika med", + ["nl"]="minder dan of gelijk aan", + }, + ["less than, but not equivalent to"]={ + ["en"]="less than, but not equivalent to", + ["sv"]="mindre än, men inte ekvivalent med", + ["nl"]="minder dan maar niet equivalent aan", + }, + ["maps"]={ + ["en"]="maps", + ["sv"]="avbildar", + ["nl"]="TODO", + }, + ["maps as"]={ + ["en"]="is defined so that", + ["sv"]="är definierad så att", + ["nl"]="TODO", + }, + ["maps down"]={ + ["en"]="maps down", + ["sv"]="avbildas nedåt", + ["nl"]="TODO", + }, + ["maps from"]={ + ["en"]="maps from", + ["sv"]="avbildas från", + ["nl"]="TODO", + }, + ["maps to"]={ + ["en"]="maps to", + ["sv"]="avbildas på", + ["nl"]="TODO", + }, + ["maps up"]={ + ["en"]="maps up", + ["sv"]="avbildas uppåt", + ["nl"]="TODO", + }, + ["minus"]={ + ["en"]="minus", + ["sv"]="minus", + ["nl"]="min", + }, + ["minus plus"]={ + ["en"]="minus or plus", + ["sv"]="minus eller plus", + ["nl"]="min plus", + }, + ["more or equal to"]={ + ["en"]="more or equal to", + ["sv"]="mer eller lika med", + ["nl"]="groter of gelijk aan", + }, + ["much more equal to"]={ + ["en"]="much more equal to", + ["sv"]="mycket mer lika med", + ["nl"]="veel meer gelijk aan", + }, + ["multiset union"]={ + ["en"]="multiset union", + ["sv"]="multimängdunion", + ["nl"]="TODO", + }, + ["not"]={ + ["en"]="not", + ["sv"]="icke", + ["nl"]="niet", + }, + ["not and"]={ + ["en"]="not and", + ["sv"]="ej och", + ["nl"]="en niet", -- hm + }, + ["original of"]={ + ["en"]="original of", + ["sv"]="original av", + ["nl"]="origineel van", + }, + ["partial"]={ + ["en"]="partial", + ["sv"]="partiell", + ["nl"]="partieel", + }, + ["partial d"]={ + ["en"]="partial d", + ["sv"]="partiellt d",-- fix + ["nl"]="TODO", + }, + ["percent"]={ + ["en"]="percent", + ["sv"]="procent", + ["nl"]="procent", + }, + ["plus"]={ + ["en"]="plus", + ["nl"]="plus", + }, + ["plus minus"]={ + ["en"]="plus or minus", + ["sv"]="plus eller minus", + ["nl"]="plus minus", + }, + ["precedes"]={ + ["en"]="precedes", + ["sv"]="föregår", + ["nl"]="TODO", + }, + ["precedes, or equals"]={ + ["en"]="precedes, or equals", + ["sv"]="föregår, eller är lika med", + ["nl"]="TODO", + }, + ["precedes, or is equivalent to"]={ + ["en"]="precedes, or is equivalent to", + ["sv"]="föregår, eller är ekvivalent med", + ["nl"]="gaat vooraf aan of is equivalent aan", + }, + ["preceeds, but not equivalent to"]={ + ["en"]="preceeds, but not equivalent to", + ["sv"]="föregår, men är ej ekvivalent med", + ["nl"]="gaat vooraf aan maar is niet equivalent aan", + }, + ["prime"]={ + ["en"]="prime", + ["sv"]="prim", + ["nl"]="priem", + }, + ["double prime"]={ + ["en"]="double prime", + ["sv"]="bis", + ["nl"]="TODO", + }, + ["triple prime"]={ + ["en"]="triple prime", + ["sv"]="trippelprim", + ["nl"]="TODO", + }, + ["quadruple prime"]={ + ["en"]="quadruple prime", + ["sv"]="kvadrupelprim", + ["nl"]="TODO", + }, + ["derivative"]={ + ["en"]="the derivative of", + ["sv"]="derivatan av", + ["nl"]="de afgeleide van", + }, + ["second derivative"]={ + ["en"]="the second derivative of", + ["sv"]="andraderivatan av", + ["nl"]="de tweede afgeleide van", + }, + ["third derivative"]={ + ["en"]="the third derivative of", + ["sv"]="tredjederivatan av", + ["nl"]="de derde afgeleide van", + }, + ["fourth derivative"]={ + ["en"]="the fourth derivative of", + ["sv"]="fjärdederivatan av", + ["nl"]="de vierde afgeleide van", + }, + ["product"]={ + ["en"]="the product", + ["sv"]="produkten", + ["nl"]="TODO", + }, + ["quadruple integral of"]={ + ["en"]="quadruple integral of", + ["sv"]="kvadrupelintegral", + ["nl"]="TODO", + }, + ["restriction"]={ + ["en"]="restriction", + ["sv"]="restriktion", + ["nl"]="TODO", + }, + ["reversed doubleprime"]={ + ["en"]="the reversed second derivative of", + ["sv"]="den omvända biss", + ["nl"]="TODO", + }, + ["reversed prime"]={ + ["en"]="reversed derivative of", + ["sv"]="omvänt prim", + ["nl"]="TODO", + }, + ["reversed triple prime"]={ + ["en"]="reversed third derivative of", + ["sv"]="omvänt trippelprim", + ["nl"]="TODO", + }, + ["right semidirect product"]={ + ["en"]="right semidirect product", + ["sv"]="höger halvdirekt produkt", + ["nl"]="TODO", + }, + ["semidirect product"]={ + ["en"]="semidirect product", + ["sv"]="halvdirekt produkt", + ["nl"]="TODO", + }, + ["set minus"]={ + ["en"]="set minus", + ["sv"]="mängdminus", + ["nl"]="TODO", + }, + ["similar but not equal to"]={ + ["en"]="similar, but not equal to", + ["sv"]="liknande, men inte lika med", + ["nl"]="vergelijkbaar maar niet gelijk aan", + }, + ["star operator"]={ + ["en"]="star operator", + ["sv"]="stjärnaoperator", + ["nl"]="TODO", + }, + ["succeeds"]={ + ["en"]="succeeds", + ["sv"]="efterföljer", + ["nl"]="volgt op", + }, + ["succeeds, but not equivalent to"]={ + ["en"]="succeeds, but not equivalent to", + ["sv"]="efterföljer, men är inte ekvivalent med", + ["nl"]="volgt op meer is niet equivalent aan", + }, + ["succeeds, or equals"]={ + ["en"]="succeeds, or equals", + ["sv"]="efterföljer, eller är lika med", + ["nl"]="volgt op of is gelijk aan", + }, + ["succeeds, or is equivalent to"]={ + ["en"]="succeeds, or is equivalent to", + ["sv"]="efterföljer, eller är ekvivalent med", + ["nl"]="volgt op of is equivalent aan", + }, + ["sum"]={ + ["en"]="the sum", + ["sv"]="summan", + ["nl"]="de som", + }, + ["surface integral"]={ + ["en"]="surface integral", + ["sv"]="ytintegral", + ["nl"]="oppervlakte integraal", + }, + ["tends to"]={ + ["en"]="tends to", + ["sv"]="går mot", + ["nl"]="neigt naar", + }, + ["tends from above to"]={ + ["en"]="tends from above to", + ["sv"]="närmar sig ovanifrån till", + ["nl"]="neigt van boven naar", + }, + ["tends from below to"]={ + ["en"]="tends from below to", + ["sv"]="närmar sig underifrån till", + ["nl"]="neigt van onder naar", + }, + ["tensor product"]={ + ["en"]="tensor product", + ["sv"]="tensorprodukt", + ["nl"]="tensor produkt", + }, + ["the algebraic numbers"]={ + ["en"]="the algebraic numbers", + ["sv"]="de algebraiska talen", + ["nl"]="de algebraische getallen", -- hm + }, + ["the complement of"]={ + ["en"]="the complement of", + ["sv"]="komplementet av", + ["nl"]="het complement van", + }, + ["the complex numbers"]={ + ["en"]="the complex numbers", + ["sv"]="de komplexa talen", + ["nl"]="de complexe getallen", + }, + ["the integers"]={ + ["en"]="the integers", + ["sv"]="heltalen", + ["nl"]="de gehele getallen", + }, + ["the natural numbers"]={ + ["en"]="the natural numbers", + ["sv"]="de naturliga talen", + ["nl"]="de natuurlijke getallen", + }, + ["the number of"]={ + ["en"]="the number of", + ["sv"]="antalet", + ["nl"]="het aantal", + }, + ["the octonions"]={ + ["en"]="the octonions", + ["sv"]="oktonionerna", + ["nl"]="TODO", + }, + ["the prime numbers"]={ + ["en"]="the prime numbers", + ["sv"]="primtalen", + ["nl"]="de priemgetallen", + }, + ["the quaternions"]={ + ["en"]="the quaternions", + ["sv"]="kvaternionerna", + ["nl"]="TODO", + }, + ["the rational numbers"]={ + ["en"]="the rational numbers", + ["sv"]="de rationella talen", + ["nl"]="de rationele getallen", + }, + ["the real numbers"]={ + ["en"]="the real numbers", + ["sv"]="de rella talen", + ["nl"]="de reele getallen", + }, + ["the sedenions"]={ + ["en"]="the sedenions", + ["sv"]="sedenionerna", + ["nl"]="TODO", + }, + ["there exists"]={ + ["en"]="there exists", + ["sv"]="det existerar", + ["nl"]="er bestaat", + }, + ["therefore, "]={ + ["en"]="therefore, ", + ["sv"]="därför, ", + ["nl"]="derhalve", + }, + ["times"]={ + ["en"]="TIMES", + ["sv"]="TIMES",--"multiplicerat med", + ["nl"]="maal", + }, + ["to"]={ + ["en"]="to", + ["sv"]="till", + ["nl"]="tot", + }, + ["triple integral of"]={ + ["en"]="triple integral", + ["sv"]="trippelintegral", + ["nl"]="TODO", + }, + ["true"]={ + ["en"]="true", + ["sv"]="sant", + ["nl"]="waar", + }, + ["union"]={ + ["en"]="union", + ["nl"]="TODO", + }, + ["vector gradient"]={ + ["en"]="vector gradient", + ["sv"]="vektorgradient", + ["nl"]="TODO", + }, + ["vector partial"]={ + ["en"]="vector partial", + ["sv"]="vektorpartial", + ["nl"]="TODO", + }, + ["volume integral"]={ + ["en"]="volume integral", + ["sv"]="volymintegral", + ["nl"]="volume integraal", + }, + ["way equal to"]={ + ["en"]="way equal to", + ["sv"]="väldigt mycket lika med", + ["nl"]="heel veel gelijk aan", + }, + ["way greater than"]={ + ["en"]="way greater than", + ["sv"]="väldigt mycket större än", + ["nl"]="heel veel meer dan", + }, + ["way less than"]={ + ["en"]="way less than", + ["sv"]="väldigt mycket mindre än", + ["nl"]="heel veel minder dan", + }, + ["wedge product"]={ + ["en"]="wedge product", + ["sv"]="hakprodukt", + ["nl"]="TODO", + }, + ["wedge sum"]={ + ["en"]="wedge sum", + ["sv"]="haksumma", + ["nl"]="TODO", + }, + ["xor"]={ + ["en"]="xor", + ["sv"]="xor", + ["nl"]="xor", + }, + + -- Fences: + ["abs"]={ + ["en"]="the absolute value", + ["sv"]="absolutbeloppet", + ["nl"]="de absolute waarde", + }, + ["begin numerator"]={ + ["en"]="numerator", + ["sv"]="täljare", + ["nl"]="teller", + }, + ["begin denominator"]={ + ["en"]="denominator", + ["sv"]="nämnare", + ["nl"]="noemer", + }, + ["end numerator"]={ + ["en"]="end numerator", + ["sv"]="avsluta täljare", + ["nl"]="einde teller", + }, + ["end denominator"]={ + ["en"]="end denominator", + ["sv"]="avsluta nämnare", + ["nl"]="enide noemer", + }, + ["ceiling"]={ + ["en"]="the ceiling", + ["sv"]="takfunktionen", + ["nl"]="TODO", + }, + ["closedinterval"]={ + ["en"]="the closed interval", + ["sv"]="det slutna intervallet", + ["nl"]="het gesloten interval", + }, + ["floor"]={ + ["en"]="the floor", + ["sv"]="golvfunktionen", + ["nl"]="TODO", + }, + ["innerproduct"]={ + ["en"]="the inner product", + ["sv"]="inre produkten", + ["nl"]="het inprodukt", + }, + ["integerpart"]={ + ["en"]="the integer part", + ["sv"]="heltalsdelen", + ["nl"]="het integer deel", + }, + ["innerproduct:fence"]={ + ["en"]="and", + ["sv"]="och", + ["nl"]="en", + }, + ["leftopeninterval"]={ + ["en"]="the left open interval", + ["sv"]="det vänsteröppna intervallet", + ["nl"]="het links open interval", + }, + ["varleftopeninterval"]={ + ["en"]="the left open interval", + ["sv"]="det vänsteröppna intervallet", + ["nl"]="het links open interval", + }, + ["norm"]={ + ["en"]="the norm", + ["sv"]="normen", + ["nl"]="de norm", + }, + ["openinterval"]={ + ["en"]="the open interval", + ["sv"]="det öppna intervallet", + ["nl"]="het open interval", + }, + ["varopeninterval"]={ + ["en"]="the open interval", + ["sv"]="det öppna intervallet", + ["nl"]="het open interval", + }, + ["parenthesis"]={ + ["en"]="parenthesis", + ["sv"]="parentes", + ["nl"]="TODO", + }, + ["set"]={ + ["en"]="the set", + ["sv"]="mängden", + ["nl"]="TODO", + }, + ["sequence"]={ + ["en"]="the sequence", + ["sv"]="talföljden", + ["nl"]="TODO", + }, + ["tuple"]={ + ["en"]="the tuple", + ["sv"]="tupeln", + ["nl"]="TODO", + }, + ["rightopeninterval"]={ + ["en"]="the right open interval", + ["sv"]="det högeröppna intervallet", + ["nl"]="het rechts open interval", + }, + ["varrightopeninterval"]={ + ["en"]="the right open interval", + ["sv"]="det högeröppna intervallet", + ["nl"]="het rechts open interval", + }, + ["set:fence"]={ + ["en"]="such that", + ["sv"]="sådana att", + ["nl"]="zo dat", + }, + ["adjoint"]={ + ["en"]="the adjoint of", + ["sv"]="adjunkten av", + ["nl"]="TODO", + }, + ["transpose"]={ + ["en"]="the transpose of", + ["sv"]="transponatet av", + ["nl"]="TODO", + }, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-txt.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-txt.lmt new file mode 100644 index 00000000000..80ce048eac8 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/math-txt.lmt @@ -0,0 +1,139 @@ +if not modules then modules = { } end modules ['math-txt'] = { + version = 1.001, + comment = "companion to math-ini.mkxl", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +local setmetatableindex = table.setmetatableindex +local upper = string.upper +local utfchar = utf.char +local settings_to_hash = utilities.parsers.settings_to_hash + +local mathematics = mathematics + +local a_mathdomain = attributes.private("mathdomain") +local integer_value = tokens.values.integer + +local report = logs.reporter("mathematics","domains") + +-- We don't need to store anything because we preset default and registering +-- other domains happens at runtime. + +local domainlabels = { } +mathematics.domainlabels = domainlabels +local domainnames = mathematics.domainnames or { [1] = "default", default = 1 } +mathematics.domainnames = domainnames + +local nofdomains = 1 +local defaultlabels = false +local defaultdomain = domainnames.default + +setmetatableindex(domainnames,function(t,name) + nofdomains = nofdomains + 1 + domainnames[name] = nofdomains + domainnames[nofdomains] = name + report("registering %a with id %s",name,nofdomains) + return nofdomains +end) + +local function loadone(name) + local f = resolvers.findfile("math-txt-imp-" .. name .. ".lmt") or "" + local t = f ~= "" and table.load(f) or { } + report("labels for %a %s",name,f ~= "" and "loaded" or "not found") + return t +end + +setmetatableindex(domainlabels,function(t,name) + if not defaultlabels then + defaultlabels = loadone("default") + t.default = defaultlabels + end + if name == "default" then + return defaultlabels + else + local v = loadone(name) + setmetatableindex(v,defaultlabels) + t[name] = v + return v + end +end) + +interfaces.implement { + name = "domainattribute", + arguments = "string", + usage = "value", + actions = function(name) + return integer_value, domainnames[name] + end +} + +function mathematics.getdomainname(id) + return id and domainnames[id] or "default" +end + +local uppercased = setmetatableindex(function(t,k) + local v = upper(k) + t[k] = v + return v +end) + +function mathematics.getverboselabel(name,language,domain) -- todo: change order + local verboselabels = domainlabels[domain] or defaultlabels + local l = verboselabels[name] + if l then + if language == "debug" then + return l.en and uppercased[name] or name + else + return (language and l[language]) or l.en or name + end + else + -- print("missing label",language or "en", name) + return name + end +end + +function mathematics.getoptionallabel(name,language,domain) -- todo: change order + local verboselabels = domainlabels[domain] or defaultlabels + local l = verboselabels[name] + if l then + return (language and l[language]) or l.en + end +end + +-- characters.blocks +-- characters.getrange + +local function set(verboselabels,language,name,meaning) + local v = verboselabels[name] + if not v then + v = { } + verboselabels[name] = v + end + v[language or "en"] = meaning +end + +function mathematics.registerverboselabel(domain,language,name,meaning) + local verboselabels = domainlabels[domain] or defaultlabels + local first, last, _, gaps = characters.getrange(name) + if first then + for i=first,last do + set(verboselabels,language,utfchar(i),meaning) + end + if gaps then + for k, v in next, gaps do + set(verboselabels,language,utfchar(v),meaning) + end + end + else + set(verboselabels,language,name,meaning) + end +end + +interfaces.implement { + name = "registerverbosemathlabel", + protected = true, + arguments = "4 strings", + actions = mathematics.registerverboselabel, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt index c29e167663d..3b8cb37bc51 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt @@ -745,7 +745,8 @@ local function copy_glyph(main,target,original,unicode,slot) kerns = olddata.kerns, mathkerns = olddata.mathkerns, tounicode = olddata.tounicode, --- smaller = olddata.smaller, + unicode = olddata.unicode, + -- smaller = olddata.smaller, commands = { slotcommand[slot][unicode] }, } local glyphdata = newdata @@ -762,6 +763,7 @@ local function copy_glyph(main,target,original,unicode,slot) kerns = olddata.kerns, mathkerns = olddata.mathkerns, tounicode = olddata.tounicode, + unicode = olddata.unicode, smaller = olddata.smaller, commands = { slotcommand[slot][nextglyph] }, } @@ -794,6 +796,7 @@ local function copy_glyph(main,target,original,unicode,slot) height = olddata.height, depth = olddata.depth, tounicode = olddata.tounicode, + unicode = olddata.unicode, commands = { slotcommand[slot][oldglyph] }, } newpart.glyph = addprivate(main,formatters["M-P-%H"](oldglyph),newdata) diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-clock.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-clock.mkxl index 0612113ea42..7f202973537 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-clock.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-clock.mkxl @@ -101,7 +101,7 @@ \starttext -\unexpanded\def\MyClock#1#2% +\protected\def\MyClock#1#2% {\begingroup \ClockFont \iffontchar\font\privatecharactercode{CLOCK:#1:#2}\else diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-demo.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-demo.mkxl index b89a4771bec..ab2dc456edd 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-demo.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-demo.mkxl @@ -184,7 +184,7 @@ metapost.metafonts.demo = { \DemoB\setupinterlinespace \dorecurse{20}{\dorecurse{1000}{g h }\par}\page \DemoC\setupinterlinespace \dorecurse{30}{\dorecurse{1000}{g h }\par}\page - \unexpanded\def\MyChar#1% + \protected\def\MyChar#1% {\begingroup \DemoA \iffontchar\font\privatecharactercode{forever-#1}\else diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-kaktovik.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-kaktovik.mkxl index 40e9f826c33..c32cc89cc26 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-kaktovik.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-kaktovik.mkxl @@ -204,6 +204,8 @@ \continueifinputfile{meta-imp-kaktovik.mkxl} +\startbuffer + \definefontfeature [default] [default] @@ -214,38 +216,51 @@ % \nopdfcompression -\startTEXpage[offset=1ts,width=3es] - - \start +\start \showglyphs - KAKTOVIK - \dostepwiserecurse{0}{19}{1}{\kaktoviknumerals{#1}\space } - \stop - - kaktovik \start - \red\glyphxscale 700 - \dostepwiserecurse{0}{19}{1}{\kaktoviknumerals{#1}\space } - \stop - - \startitemize[packed,K][color=orange,stopper=] - \startitem first \stopitem - \startitem second \stopitem - \startitem third \stopitem - \stopitemize - - KAKTOVIK \start - \red \kaktoviknumerals{2023} -- - \green\kaktoviknumerals{4} -- - \blue \kaktoviknumerals{18} - \stop - KAKTOVIK + \dostepwiserecurse{0}{19}{1}{\kaktoviknumerals{#1}\space } +\stop + +kaktovik \start + \red\glyphxscale 700 + \dostepwiserecurse{0}{19}{1}{\kaktoviknumerals{#1}\space } +\stop + +\startitemize[packed,K][color=orange,stopper=] + \startitem first \stopitem + \startitem second \stopitem + \startitem third \stopitem +\stopitemize + +KAKTOVIK \start + \red \kaktoviknumerals{2023} -- + \green\kaktoviknumerals{4} -- + \blue \kaktoviknumerals{18} +\stop + +KAKTOVIK - 𝋂 + 𝋂 = \kaktovikcalculate{𝋂 + 𝋂} = \kaktoviknumerals{4} +𝋂 + 𝋂 = \kaktovikcalculate{𝋂 + 𝋂} = \kaktoviknumerals{4} - \protected\def\ForWilli#1{#1 = \kaktovikcalculate{#1}} +\protected\def\ForWilli#1{#1 = \kaktovikcalculate{#1}} - \ForWilli{(𝋂 + 𝋂) ^ (𝋂 + 𝋂)} +\ForWilli{(𝋂 + 𝋂) ^ (𝋂 + 𝋂)} - \ForWilli{(sin ( 𝋂𝋓 ) )} +\ForWilli{(sin ( 𝋂𝋓 ) )} + +\stopbuffer + +\starttext + +\startTEXpage[offset=1ts,width=3es] + \getbuffer \stopTEXpage + +\setuplayout[tight] + +\usemodule[scite] + +\typebuffer[option=TEX] + +\stoptext diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-threesix.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-threesix.mkxl index 872d0b3e889..5e8c59f512e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-threesix.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-threesix.mkxl @@ -52,11 +52,13 @@ ["T"] = [[1111111111 1100110011 1100110011 0000110000 0000110000 0000110000 0001111000 0001111000]], ["U"] = [[111101111 111101111 011000010 011000010 011000010 011000010 011000010 001111100]], ["V"] = [[11111000111 11111000111 01110000010 00110000100 00111000100 00011001000 00001101000 00001110000]], - ["W"] = [[111000000111 111000000111 110000000010 011000000100 011001000100 001101101000 001101101000 000110110000]], + ["W"] = [[111000000111 111000000111 110000000010 011000000100 011001000100 001101101000 001101101000 0001101100000]], ["X"] = [[1111001110 1111000110 0001101000 0000110000 0000110000 0001011000 0110001111 0111001111]], ["Y"] = [[111100011 111100011 011000010 001110100 000111000 000011000 001111110 001111110]], ["Z"] = [[11111111 10000111 00001110 00011100 00111000 01110000 11100001 11111111]], + -- these don't have the 36 dots property: + [","] = [[0000 0000 0000 0000 0000 0011 0111 0111]], [";"] = [[0011 0011 0011 0000 0000 0011 0111 0111]], ["."] = [[0000 0000 0000 0000 0000 0111 0111 0111]], @@ -64,9 +66,13 @@ ["!"] = [[0111 0111 0111 0111 0111 0000 0111 0111]], ["?"] = [[11111 10111 00111 01110 01110 00000 01110 01110]], - [utf.char(0xAD)] = [[00000 00000 00000 11111 11111 00000 00000 00000]], -- hyphen + [utf.char(0x00AD)] = [[00000 00000 00000 11111 11111 00000 00000 00000]], -- hyphen + [utf.char(0x2013)] = [[0000000 0000000 0000000 1111111 1111111 0000000 0000000 0000000]], -- endash + [utf.char(0x2014)] = [[000000000 000000000 000000000 111111111 111111111 000000000 000000000 000000000]], -- emdash } + MP.font36 = font36 + local f_code = string.formatters["ThreeSix(%s);"] local replace = { ["0"] = "N;", ["1"] = "Y;", [" "] = "L;" } @@ -181,6 +187,8 @@ enddef ; \stopMPcalculation +% spacing=.25 plus .1 minus .05 extra .25 + \definefontfeature % black and white, with some spread [fontthreesix] [default] diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt index e4b88bd3698..1434f632235 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt @@ -18,7 +18,7 @@ local scanstring = scan.string local expandmacro = token.expandmacro -- todo -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp local metapost = metapost metapost.parshapes = { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.mkxl index c7586264ec3..9efd7a2e648 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.mkxl @@ -29,7 +29,7 @@ % \doifundefined{RotFont}{\definefont[RotFont][RegularBold*default]} % -% \unexpanded\def\getfollowtoken#1% +% \protected\def\getfollowtoken#1% % {\hbox\bgroup % \strut % \ctxlua{mp.follow_text(#1)}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl index c5d86e2af21..44fd6e130d6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl @@ -95,7 +95,7 @@ \permanent\tolerant\protected\def\startMPdefinitions#=#:#2\stopMPdefinitions {\let\m_meta_saved_instance\currentMPinstance - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi @@ -116,7 +116,7 @@ \permanent\tolerant\protected\def\startMPinclusions[#1]#*#=#:#3\stopMPinclusions {\let\m_meta_saved_instance\currentMPinstance % \pushmacro - \edef\currentMPinstance{#2}% + \cdef\currentMPinstance{#2}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi @@ -136,7 +136,7 @@ \global\t_meta_inclusions\emptytoks \fi \ifparameter#3\or - \edef\currentMPinstance{#2}% + \cdef\currentMPinstance{#2}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi @@ -187,16 +187,16 @@ {\let\meta_show_properties\donothing} \protected\def\meta_analyze_graphicname_indeed[#1::#2::#3]% instance :: - {\edef\currentMPgraphicname{#2}% + {\cdef\currentMPgraphicname{#2}% \ifempty\currentMPgraphicname - \edef\currentMPgraphicname{#1}% + \cdef\currentMPgraphicname{#1}% \let\currentMPinstance\defaultMPinstance \orelse\ifcsname\??mpdefinitions#1\endcsname - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \else \let\currentMPinstance\defaultMPinstance \fi - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_show_properties} \mutable\def\currentMPgraphicname{\s!unknown} @@ -251,12 +251,12 @@ \def\meta_start_current_graphic {\begingroup \meta_enable_include - \the\everyMPgraphic + \expand\everyMPgraphic \edef\p_initializations{\MPinstanceparameter\s!initializations}% \ifx\p_initializations\v!yes - \settrue \c_meta_include_initializations + \c_meta_include_initializations\conditionaltrue \else - \setfalse\c_meta_include_initializations + \c_meta_include_initializations\conditionalfalse \fi \edef\p_setups{\MPinstanceparameter\c!setups}% \ifempty\p_setups \else @@ -285,12 +285,12 @@ \popMPboundingbox} \protected\def\meta_process_graphic_instance#1#2% used in startMPpage - {\edef\currentMPinstance{#1}% + {\cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \setmpcategoryparameter\c!stacking{#2}% - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_process_graphic} \protected\def\meta_process_graphic#1% todo: extensions and inclusions outside beginfig @@ -394,9 +394,12 @@ {\relax \bgroup \meta_enable_include - \doifelse{#1}{-} - {\xdef\MPdrawingdata{\MPdrawingdata\detokenize{#2}}}% - {\xdef\MPdrawingdata{\MPdrawingdata#2}}% + % can be a one liner: + \iftok{#1}{-}% + \xdef\MPdrawingdata{\MPdrawingdata\detokenize{#2}}% + \else + \xdef\MPdrawingdata{\MPdrawingdata#2}% + \fi \egroup} \permanent\protected\lettonothing\stopMPdrawing @@ -424,7 +427,7 @@ \d_overlay_height#3\relax \edef\width {\the\d_overlay_width \space}% obsolete \edef\height{\the\d_overlay_height\space}% obsolete - \edef\currentMPclip{#1}% + \cdef\currentMPclip{#1}% \ifcsname\??mpclip\currentMPclip\endcsname \meta_grab_clip_path_yes \else @@ -517,11 +520,11 @@ \endlocalcontrol \ifempty\m_meta_current_variable \meta_mpvar_default - \orelse\ifchkdim\m_meta_current_variable\or - \todimension\m_meta_current_variable\space\space + \orelse\ifchkdimension\m_meta_current_variable\or + \todimension\lastchkdimension\space\space % \orelse\ifchknum\m_meta_current_variable\or % we need to catch 1>2 - \orunless\iftok{\ifchknum\m_meta_current_variable\or\tointeger\m_meta_current_variable\fi}\emptytoks - \tointeger\m_meta_current_variable\space\space + \orunless\ifempty{\ifchknum\m_meta_current_variable\or\tointeger\m_meta_current_variable\fi}% + \tointeger\m_meta_current_variable\space\space % maybe \lastchkinteger \orelse\ifcsname\??colorattribute\currentcolorprefix\m_meta_current_variable\endcsname \MPcolor\m_meta_current_variable\space \orelse\ifcsname\??colorattribute\m_meta_current_variable\endcsname @@ -539,7 +542,7 @@ \orelse\ifchkdim\m_meta_current_variable\or \todimension\m_meta_current_variable\space\space % \orelse\ifchknum\m_meta_current_variable\or % we need to catch 1>2 - \orunless\iftok{\ifchknum\m_meta_current_variable\or\tointeger\m_meta_current_variable\fi}\emptytoks + \orunless\ifempty{\ifchknum\m_meta_current_variable\or\tointeger\m_meta_current_variable\fi}% \tointeger\m_meta_current_variable\space\space \orelse\ifcsname\??colorattribute\currentcolorprefix\m_meta_current_variable\endcsname \MPcolor\m_meta_current_variable\space @@ -650,8 +653,8 @@ \else \meta_enable_include % redundant \global\advanceby\c_meta_object_counter\plusone - \meta_use_box{\number\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox - \xdefcsname\??mpgraphic\overlaystamp:#1\endcsname{\meta_reuse_box{\number\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}% + \meta_use_box{\the\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox + \xdefcsname\??mpgraphic\overlaystamp:#1\endcsname{\meta_reuse_box{\the\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}% \csname\??mpgraphic\overlaystamp:#1\endcsname\empty \fi \endgroup} @@ -684,7 +687,7 @@ {% ugly code but we run on top of older code \resetdummyparameter\c!instance \getdummyparameters[#1]% - \edef\currentMPinstance{\dummyparameter\c!instance}% + \cdef\currentMPinstance{\dummyparameter\c!instance}% % here we feed the instance into the analyzer \meta_begin_graphic_group{\ifempty\currentMPinstance\else\currentMPinstance::\fi#1}% \checkmpcategoryparent @@ -735,8 +738,8 @@ % \currentmpcategory already set \meta_enable_include % redundant \global\advanceby\c_meta_object_counter\plusone - \meta_use_box{\number\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox - \xdefcsname\??mpgraphic#1\endcsname{\meta_reuse_box{\number\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}% + \meta_use_box{\the\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox + \xdefcsname\??mpgraphic#1\endcsname{\meta_reuse_box{\the\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}% \csname\??mpgraphic#1\endcsname\empty \endgroup} @@ -751,24 +754,6 @@ \protected\def\meta_start_reusable_graphic_indeed#1#2#3\stopreusableMPgraphic {\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_reusable_graphic{#1}{#2}{#3}}} -% \permanent\tolerant\protected\def\useMPgraphic#=#*#=% -% {\meta_begin_graphic_group{#1}% -% \ifcsname\??mpgraphic#1\endcsname -% \edef\currentmpcategory{#1}% -% \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname -% \let\currentmpcategory\currentMPgraphicname -% \else -% \lettonothing\currentmpcategory -% \fi -% \ifempty\currentmpcategory -% % message -% \else -% \checkmpcategoryparent -% \doifsomething{#2}{\setupcurrentmpcategory[#2]}% -% \csname\??mpgraphic\currentmpcategory\endcsname -% \fi -% \meta_end_graphic_group} - \permanent\tolerant\protected\def\useMPgraphic {\futureexpandis[\meta_usempgraphic_yes\meta_usempgraphic_nop} @@ -776,11 +761,11 @@ {% ugly code but we run on top of older code \resetdummyparameter\c!instance \getdummyparameters[#1]% - \edef\currentMPinstance{\dummyparameter\c!instance}% + \cdef\currentMPinstance{\dummyparameter\c!instance}% % here we feed the instance into the analyzer \meta_begin_graphic_group{\ifempty\currentMPinstance\else\currentMPinstance::\fi#2}% \ifcsname\??mpgraphic#2\endcsname - \edef\currentmpcategory{#2}% + \cdef\currentmpcategory{#2}% \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname \let\currentmpcategory\currentMPgraphicname \else @@ -798,7 +783,7 @@ \tolerant\def\meta_usempgraphic_nop#=#*#=% {\meta_begin_graphic_group{#1}% \ifcsname\??mpgraphic#1\endcsname - \edef\currentmpcategory{#1}% + \cdef\currentmpcategory{#1}% \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname \let\currentmpcategory\currentMPgraphicname \else @@ -808,7 +793,9 @@ % message \else \checkmpcategoryparent - \doifsomething{#2}{\setupcurrentmpcategory[#2]}% + \ifempty{#2}\else + \setupcurrentmpcategory[#2]% + \fi \csname\??mpgraphic\currentmpcategory\endcsname \fi \meta_end_graphic_group} @@ -834,7 +821,7 @@ \def\meta_handle_overlay_graphic#1#2#3% {\begingroup - \edef\currentmpcategory{#1}% + \cdef\currentmpcategory{#1}% \meta_process_graphic{#3;BoundToOverlayBox;}% \endgroup} @@ -970,12 +957,12 @@ % \permanent\tolerant\protected\def\startMPcode#=#:#2\stopMPcode % {\begingroup -% \edef\currentMPinstance{#1}% +% \cdef\currentMPinstance{#1}% % \ifempty\currentMPinstance % \let\currentMPinstance\defaultMPinstance % \fi % \lettonothing\currentMPgraphicname -% \edef\currentMPformat{\MPinstanceparameter\s!format}% +% \cdef\currentMPformat{\MPinstanceparameter\s!format}% % \meta_enable_include % \meta_process_graphic{#2}% % \endgroup} @@ -985,12 +972,12 @@ \tolerant\def\meta_start_mpcode_nop#:#=#:#2\stopMPcode {\begingroup - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \lettonothing\currentMPgraphicname - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_enable_include \meta_process_graphic{#2}% \endgroup} @@ -1000,13 +987,13 @@ \resetdummyparameter\c!instance \resetdummyparameter\c!stacking \getdummyparameters[#1]% - \edef\currentMPinstance{\dummyparameter\c!instance}% + \cdef\currentMPinstance{\dummyparameter\c!instance}% \setmpcategoryparameter\c!stacking{\dummyparameter\c!stacking}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \lettonothing\currentMPgraphicname - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_enable_include \meta_process_graphic{#2}% \endgroup} @@ -1050,11 +1037,11 @@ \permanent\protected\def\useMPrun#1#2% name n {\begingroup \def\MPaskedfigure{#2}% - \normalexpanded{\useMPgraphic{\iftok{#1}\emptytoks mprun\else#1\fi}}% + \normalexpanded{\useMPgraphic{\ifempty{#1}mprun\else#1\fi}}% \endgroup} \permanent\tolerant\protected\def\startMPrun#=#:#2\stopMPrun - {\normalexpanded{\startuseMPgraphic{\iftok{#1}\emptytoks mprun\else#1\fi}}#2\stopuseMPgraphic} + {\normalexpanded{\startuseMPgraphic{\ifempty{#1}mprun\else#1\fi}}#2\stopuseMPgraphic} \permanent\protected\lettonothing\stopMPrun @@ -1096,7 +1083,7 @@ \installcorenamespace{mptext} -\permanent\protected\def\setMPtext#1#2{\dodoglobal\edefcsname\??mptext#1\endcsname{\detokenize{#2}}} +\permanent\protected\def\setMPtext#1#2{\edefcsname\??mptext#1\endcsname{\detokenize{#2}}} % \global will work here \permanent \def\MPtext #1{\begincsname\??mptext#1\endcsname\empty} \permanent \def\MPstring #1{"\begincsname\??mptext#1\endcsname\empty"} \permanent \def\MPbetex #1{btex \begincsname\??mptext#1\endcsname\space etex} @@ -1353,8 +1340,11 @@ \permanent\def\MPruntab#1#2{\clf_mpruntab{#1}#2\relax} \aliased\let\mpruntab\MPruntab % #2 is number \permanent\def\MPrunset#1#2{\clf_mprunset{#1}{#2}} \aliased\let\mprunset\MPrunset -\prependtoks \clf_mppushvariables \to \everybeforepagebody -\appendtoks \clf_mppopvariables \to \everyafterpagebody +% \prependtoks \clf_mppushvariables \to \everybeforepagebody +% \appendtoks \clf_mppopvariables \to \everyafterpagebody + +\tokspre\everybeforepagebody{\clf_mppushvariables} +\toksapp\everyafterpagebody {\clf_mppopvariables } \aliased\let\MPpushvariables\clf_mppushvariables \aliased\let\MPpopvariables \clf_mppopvariables @@ -1364,12 +1354,12 @@ \permanent\tolerant\protected\def\startMPcalculation#=#:#2\stopMPcalculation {\begingroup \setbox\nextbox\hpack\bgroup - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \lettonothing\currentMPgraphicname - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_enable_include \meta_process_graphic{#2;draw origin}% \egroup @@ -1391,7 +1381,7 @@ %D grouped in order not to make other graphics behave in unexpected ways. \appendtoks - \doifelse{\directMPgraphicsparameter\c!color}\v!global{\MPcolormethod\plusone}{\MPcolormethod\zerocount}% + \MPcolormethod\ifcstok{\directMPgraphicsparameter\c!color}\v!global\plusone\else\zerocount\fi \to \everysetupMPgraphics \setupMPgraphics diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl index 3cfc384aa19..62472829899 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl @@ -115,7 +115,7 @@ \setupcurrentmetanodes[#1]% \edef\p_meta_option{\metanodesparameter\c!option}% \edef\p_meta_alternative{\metanodesparameter\c!alternative}% - \the\t_every_meta_nodes + \expand\t_every_meta_nodes \c_meta_nodes_n\zerocount \t_meta_nodes\emptytoks #2\removeunwantedspaces diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl index 7f16ca34040..6d64fa5c8a9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl @@ -170,7 +170,7 @@ \fi} \def\setMPPDFobject#1#2% resources boxnumber - {\ifdefined\everyPDFxform\the\everyPDFxform\fi + {\ifdefined\everyPDFxform\expand\everyPDFxform\fi \immediate\saveboxresource resources{#1}#2% \edef\getMPPDFobject{\noexpand\useboxresource\the\lastsavedboxresourceindex}} @@ -234,7 +234,7 @@ %D from to n inner_r g b x y radius outer_r g b x y radius %D \stoptyping -\newconditional\manyMPspecials \settrue\manyMPspecials +\newconditional\manyMPspecials \manyMPspecials\conditionaltrue %D In case of \PDF, we need to prepare resourcs. @@ -253,13 +253,8 @@ \glet\currentPDFresources\empty % kind of redundant \to \MPstartresources -% \appendtoks -% \collectPDFresources -% \glet\currentPDFresources\collectedPDFresources -% \to \MPstopresources - -\appendtoksonce - \the\everyPDFxform +\appendtoks + \expand\everyPDFxform \to \MPstopresources %D Special number~1 is dedicated to \CMYK\ support. If you @@ -528,7 +523,7 @@ % % \def\dohandleMPshade#1% % {\revokeMPtransparencyspecial -% \settrue\ignoreMPpath +% \ignoreMPpath\conditionaltrue % \def\extraMPpathcode{/Sh#1 sh Q}% % \pdfliteral{q /Pattern cs}} % @@ -710,7 +705,7 @@ implementing the special more convenient. % \def\dohandleMPshade#1% % {\revokeMPtransparencyspecial -% \settrue\ignoreMPpath +% \ignoreMPpath\conditionaltrue % \def\extraMPpathcode{/#1 sh Q}% % \pdfliteral{q /Pattern cs}} diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl index 8642f94fff4..4ed19b8df43 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl @@ -54,7 +54,7 @@ \permanent\protected\def\definetextext[#1]% {\tolerant\defcsname\??graphictexarguments#1\endcsname} -\permanent\tolerant\def\sometxt[#1]#*[#2]% +\permanent\tolerant\def\sometxt[#1]#*[#S#2]% {\ifarguments \expandafter\meta_some_txt_a \or @@ -227,7 +227,7 @@ \permanent\protected\def\svg_normal_font#1#2#3%#4% {\hbox\bgroup - \iftok{#2}\emptytoks\else + \ifempty{#2}\else \edef\p_font{\ifcsname\??svgfamily#1\endcsname\lastnamedcs\else#1\fi-#2-#3}% \ifcsname svg:\p_font\endcsname \lastnamedcs @@ -248,7 +248,7 @@ % \egroup} \permanent\protected\def\svg_traced_pcode#1#2#3% - {\writestatus{SVG TEXT}{....[poscode #1 #2 \Uchar #3]}% + {\writestatus{SVG TEXT}{....[poscode #1 #2 \tocharacter#3]}% \svg_normal_pcode{#1}{#2}{#3}} \permanent\protected\def\svg_traced_pchar#1#2#3% @@ -260,7 +260,7 @@ \svg_normal_pspace{#1}{#2}} \permanent\protected\def\svg_traced_code#1% - {\writestatus{SVG TEXT}{....[char \Uchar #1]}% + {\writestatus{SVG TEXT}{....[char \tocharacter#1]}% \svg_normal_code{#1}} \permanent\protected\def\svg_traced_char#1% diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt index 1ee21db38ac..b67026b6217 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt @@ -33,7 +33,7 @@ local setters = tokens.setters local setmacro = setters.macro local implement = interfaces.implement -local v_no = interfaces.variables.no +local v_no = interfaces.variables.no local extensiondata = metapost.extensiondata or storage.allocate { } metapost.extensiondata = extensiondata diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl index 91bcaa58b32..1b708c96aaa 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl @@ -41,7 +41,15 @@ \registerctxluafile{mlib-cnt}{autosuffix} \registerctxluafile{mlib-svg}{autosuffix} \registerctxluafile{mlib-fnt}{autosuffix} % outline fun +\registerctxluafile{mlib-ptr}{autosuffix} \unprotect +\defineframed + [potracebitmap] + [\c!foregroundstyle=\tttf, + \c!offset=\v!overlay,% + \c!align=\v!normal,% + \c!frame=\v!off]% + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt index 3209b2ee6bd..0bd8ba2b2df 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt @@ -26,7 +26,7 @@ fonts.metapost = metapost local f_moveto = formatters["(%N,%N)"] local f_lineto = formatters["--(%N,%N)"] local f_curveto = formatters["..controls(%N,%N)and(%N,%N)..(%N,%N)"] -local s_cycle = "--cycle" +local s_cycle = "--cycle" local f_nofill = formatters["nofill %s;"] local f_dofill = formatters["fill %s;"] @@ -73,6 +73,7 @@ function metapost.zeroline(d,factor) end function metapost.paths(d,xfactor,yfactor) + -- todo: add tracer that shows d local sequence = d.sequence local segments = d.segments local list = { } @@ -83,6 +84,9 @@ function metapost.paths(d,xfactor,yfactor) if sequence then local i = 1 local n = #sequence + if sequence[1] ~= "m" then + report() + end while i < n do local operator = sequence[i] if operator == "m" then -- "moveto" @@ -127,7 +131,6 @@ function metapost.paths(d,xfactor,yfactor) end end elseif segments then --- inspect(segments) for i=1,#segments do local segment = segments[i] local operator = segment[#segment] @@ -164,6 +167,11 @@ function metapost.paths(d,xfactor,yfactor) r_y + 2/3 * (m_y-r_y), r_x, r_y ) + elseif operator == "close" then -- second argument is diagnostic + size = size + 1 + path[size] = s_cycle + list[#list+1] = concat(path,"",1,size) + size = 0 else -- weird end @@ -265,12 +273,12 @@ local texgetbox = tex.getbox local nodecodes = nodes.nodecodes -- no nuts yet local rulecodes = nodes.rulecodes -local rule_code = nodecodes.rule +local rule_code = nodecodes.rule -local normalrule_code = rulecodes.normal -local outlinerule_code = rulecodes.outline -local userrule_code = rulecodes.user -local emptyrule_code = rulecodes.empty +local normalrule_code = rulecodes.normal +local outlinerule_code = rulecodes.outline +local userrule_code = rulecodes.user +local emptyrule_code = rulecodes.empty local nuts = nodes.nuts ----- getwhd = nuts.getwhd @@ -514,6 +522,7 @@ function mp.lmt_glyphshape_start(id,character) local width = (descdata.width or 0) * factor local height = descdata.boundingbox[4] * factor local depth = descdata.boundingbox[2] * factor + local llx = descdata.boundingbox[1] * factor local math = descdata.math local italic = (math and math.italic or 0) * factor local accent = (math and math.accent or 0) * factor @@ -526,8 +535,9 @@ function mp.lmt_glyphshape_start(id,character) depth = depth, italic = italic, accent = accent, - usedbox = f_rectangle(0,depth,width,depth,width,height,0,height), - usedline = f_line(0,0,width,0), + llx = llx, + usedbox = f_rectangle(llx,depth,llx+width,depth,llx+width,height,llx,height), + usedline = f_line(llx,0,llx+width,0), } glyph.mpdata = mpdata else @@ -600,3 +610,4 @@ function mp.lmt_glyphshape_depth () injectnumeric(mpdata and mpdata.depth or 0) function mp.lmt_glyphshape_height() injectnumeric(mpdata and mpdata.height or 0) end function mp.lmt_glyphshape_italic() injectnumeric(mpdata and mpdata.italic or 0) end function mp.lmt_glyphshape_accent() injectnumeric(mpdata and mpdata.accent or 0) end +function mp.lmt_glyphshape_llx () injectnumeric(mpdata and mpdata.llx or 0) end diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt index 647b7054c2b..6b4b37c7d15 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt @@ -6,7 +6,8 @@ if not modules then modules = { } end modules ['mlib-int'] = { license = "see context related readme files", } -local factor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp + local isdimen = tex.isdimen local iscount = tex.iscount local getdimen = tex.getdimen @@ -53,21 +54,21 @@ do -- These get swapped so the d_ numbers change. - registerdirect("PaperHeight", function() return getdimen("paperheight") * factor end) - registerdirect("PaperWidth", function() return getdimen("paperwidth") * factor end) - registerdirect("PrintPaperHeight", function() return getdimen("printpaperheight") * factor end) - registerdirect("PrintPaperWidth", function() return getdimen("printpaperwidth") * factor end) - registerdirect("BackSpace", function() return getdimen("backspace") * factor end) - registerdirect("CutSpace", function() return getdimen("cutspace") * factor end) - - registerdirect("LeftEdgeWidth", function() return getdimen("leftedgewidth") * factor end) - registerdirect("LeftEdgeDistance", function() return getdimen("leftedgedistance") * factor end) - registerdirect("LeftMarginWidth", function() return getdimen("leftmarginwidth") * factor end) - registerdirect("LeftMarginDistance", function() return getdimen("leftmargindistance") * factor end) - registerdirect("RightMarginDistance", function() return getdimen("rightmargindistance") * factor end) - registerdirect("RightMarginWidth", function() return getdimen("rightmarginwidth") * factor end) - registerdirect("RightEdgeDistance", function() return getdimen("rightedgedistance") * factor end) - registerdirect("RightEdgeWidth", function() return getdimen("rightedgewidth") * factor end) + registerdirect("PaperHeight", function() return getdimen("paperheight") * bpfactor end) + registerdirect("PaperWidth", function() return getdimen("paperwidth") * bpfactor end) + registerdirect("PrintPaperHeight", function() return getdimen("printpaperheight") * bpfactor end) + registerdirect("PrintPaperWidth", function() return getdimen("printpaperwidth") * bpfactor end) + registerdirect("BackSpace", function() return getdimen("backspace") * bpfactor end) + registerdirect("CutSpace", function() return getdimen("cutspace") * bpfactor end) + + registerdirect("LeftEdgeWidth", function() return getdimen("leftedgewidth") * bpfactor end) + registerdirect("LeftEdgeDistance", function() return getdimen("leftedgedistance") * bpfactor end) + registerdirect("LeftMarginWidth", function() return getdimen("leftmarginwidth") * bpfactor end) + registerdirect("LeftMarginDistance", function() return getdimen("leftmargindistance") * bpfactor end) + registerdirect("RightMarginDistance", function() return getdimen("rightmargindistance") * bpfactor end) + registerdirect("RightMarginWidth", function() return getdimen("rightmarginwidth") * bpfactor end) + registerdirect("RightEdgeDistance", function() return getdimen("rightedgedistance") * bpfactor end) + registerdirect("RightEdgeWidth", function() return getdimen("rightedgewidth") * bpfactor end) -- leftmargintotal rightmargintotal -- not yet -- leftedgetotal rightedgetotal @@ -78,119 +79,121 @@ do -- innercombitotal outercombitotal -- innersidetotal outersidetotal - local d_leftedgewidth = isdimen("leftedgewidth") - local d_leftedgedistance = isdimen("leftedgedistance") - local d_leftmarginwidth = isdimen("leftmarginwidth") - local d_leftmargindistance = isdimen("leftmargindistance") - local d_rightmargindistance = isdimen("rightmargindistance") - local d_rightmarginwidth = isdimen("rightmarginwidth") - local d_rightedgedistance = isdimen("rightedgedistance") - local d_rightedgewidth = isdimen("rightedgewidth") - - registerdirect("InnerMarginDistance", function() return getdimen(d_leftmargindistance ) * factor end) - registerdirect("InnerMarginWidth", function() return getdimen(d_leftmarginwidth ) * factor end) - registerdirect("OuterMarginDistance", function() return getdimen(d_rightmargindistance) * factor end) - registerdirect("OuterMarginWidth", function() return getdimen(d_rightmarginwidth ) * factor end) - registerdirect("InnerEdgeDistance", function() return getdimen(d_leftmargindistance ) * factor end) - registerdirect("InnerEdgeWidth", function() return getdimen(d_leftmarginwidth ) * factor end) - registerdirect("OuterEdgeDistance", function() return getdimen(d_rightedgedistance ) * factor end) - registerdirect("OuterEdgeWidth", function() return getdimen(d_rightedgewidth ) * factor end) + local d_leftedgewidth = isdimen("leftedgewidth") + local d_leftedgedistance = isdimen("leftedgedistance") + local d_leftmarginwidth = isdimen("leftmarginwidth") + local d_leftmargindistance = isdimen("leftmargindistance") + local d_rightmargindistance = isdimen("rightmargindistance") + local d_rightmarginwidth = isdimen("rightmarginwidth") + local d_rightedgedistance = isdimen("rightedgedistance") + local d_rightedgewidth = isdimen("rightedgewidth") + + registerdirect("InnerMarginDistance", function() return getdimen(d_leftmargindistance ) * bpfactor end) + registerdirect("InnerMarginWidth", function() return getdimen(d_leftmarginwidth ) * bpfactor end) + registerdirect("OuterMarginDistance", function() return getdimen(d_rightmargindistance) * bpfactor end) + registerdirect("OuterMarginWidth", function() return getdimen(d_rightmarginwidth ) * bpfactor end) + registerdirect("InnerEdgeDistance", function() return getdimen(d_leftmargindistance ) * bpfactor end) + registerdirect("InnerEdgeWidth", function() return getdimen(d_leftmarginwidth ) * bpfactor end) + registerdirect("OuterEdgeDistance", function() return getdimen(d_rightedgedistance ) * bpfactor end) + registerdirect("OuterEdgeWidth", function() return getdimen(d_rightedgewidth ) * bpfactor end) -- local onrightpage = structures.pages.on_right - -- registerdirect("InnerMarginDistance", function() return getdimen(onrightpage() and "leftmargindistance" or "rightmargindistance") * factor end) - -- registerdirect("InnerMarginWidth", function() return getdimen(onrightpage() and "leftmarginwidth" or "rightmarginwidth" ) * factor end) - -- registerdirect("OuterMarginDistance", function() return getdimen(onrightpage() and "rightmargindistance" or "leftmargindistance" ) * factor end) - -- registerdirect("OuterMarginWidth", function() return getdimen(onrightpage() and "rightmarginwidth" or "leftmarginwidth" ) * factor end) - -- registerdirect("InnerEdgeDistance", function() return getdimen(onrightpage() and "leftmargindistance" or "rightmargindistance") * factor end) - -- registerdirect("InnerEdgeWidth", function() return getdimen(onrightpage() and "leftmarginwidth" or "rightmarginwidth" ) * factor end) - -- registerdirect("OuterEdgeDistance", function() return getdimen(onrightpage() and "rightedgedistance" or "leftedgedistance" ) * factor end) - -- registerdirect("OuterEdgeWidth", function() return getdimen(onrightpage() and "rightedgewidth" or "leftedgewidth" ) * factor end) + -- registerdirect("InnerMarginDistance", function() return getdimen(onrightpage() and "leftmargindistance" or "rightmargindistance") * bpfactor end) + -- registerdirect("InnerMarginWidth", function() return getdimen(onrightpage() and "leftmarginwidth" or "rightmarginwidth" ) * bpfactor end) + -- registerdirect("OuterMarginDistance", function() return getdimen(onrightpage() and "rightmargindistance" or "leftmargindistance" ) * bpfactor end) + -- registerdirect("OuterMarginWidth", function() return getdimen(onrightpage() and "rightmarginwidth" or "leftmarginwidth" ) * bpfactor end) + -- registerdirect("InnerEdgeDistance", function() return getdimen(onrightpage() and "leftmargindistance" or "rightmargindistance") * bpfactor end) + -- registerdirect("InnerEdgeWidth", function() return getdimen(onrightpage() and "leftmarginwidth" or "rightmarginwidth" ) * bpfactor end) + -- registerdirect("OuterEdgeDistance", function() return getdimen(onrightpage() and "rightedgedistance" or "leftedgedistance" ) * bpfactor end) + -- registerdirect("OuterEdgeWidth", function() return getdimen(onrightpage() and "rightedgewidth" or "leftedgewidth" ) * bpfactor end) -- These have stable d_ numbers. - local d_topspace = isdimen("topspace") registerdirect("TopSpace", function() return getdimen(d_topspace) * factor end) - local d_bottomspace = isdimen("bottomspace") registerdirect("BottomSpace", function() return getdimen(d_bottomspace) * factor end) - local d_makeupheight = isdimen("makeupheight") registerdirect("MakeupHeight", function() return getdimen(d_makeupheight) * factor end) - local d_makeupwidth = isdimen("makeupwidth") registerdirect("MakeupWidth", function() return getdimen(d_makeupwidth) * factor end) - local d_topheight = isdimen("topheight") registerdirect("TopHeight", function() return getdimen(d_topheight) * factor end) - local d_topdistance = isdimen("topdistance") registerdirect("TopDistance", function() return getdimen(d_topdistance) * factor end) - local d_headerheight = isdimen("headerheight") registerdirect("HeaderHeight", function() return getdimen(d_headerheight) * factor end) - local d_headerdistance = isdimen("headerdistance") registerdirect("HeaderDistance", function() return getdimen(d_headerdistance) * factor end) - local d_textheight = isdimen("textheight") registerdirect("TextHeight", function() return getdimen(d_textheight) * factor end) - local d_footerdistance = isdimen("footerdistance") registerdirect("FooterDistance", function() return getdimen(d_footerdistance) * factor end) - local d_footerheight = isdimen("footerheight") registerdirect("FooterHeight", function() return getdimen(d_footerheight) * factor end) - local d_bottomdistance = isdimen("bottomdistance") registerdirect("BottomDistance", function() return getdimen(d_bottomdistance) * factor end) - local d_bottomheight = isdimen("bottomheight") registerdirect("BottomHeight", function() return getdimen(d_bottomheight) * factor end) - local d_textwidth = isdimen("textwidth") registerdirect("TextWidth", function() return getdimen(d_textwidth) * factor end) + local d_topspace = isdimen("topspace") registerdirect("TopSpace", function() return getdimen(d_topspace) * bpfactor end) + local d_bottomspace = isdimen("bottomspace") registerdirect("BottomSpace", function() return getdimen(d_bottomspace) * bpfactor end) + local d_makeupheight = isdimen("makeupheight") registerdirect("MakeupHeight", function() return getdimen(d_makeupheight) * bpfactor end) + local d_makeupwidth = isdimen("makeupwidth") registerdirect("MakeupWidth", function() return getdimen(d_makeupwidth) * bpfactor end) + local d_topheight = isdimen("topheight") registerdirect("TopHeight", function() return getdimen(d_topheight) * bpfactor end) + local d_topdistance = isdimen("topdistance") registerdirect("TopDistance", function() return getdimen(d_topdistance) * bpfactor end) + local d_headerheight = isdimen("headerheight") registerdirect("HeaderHeight", function() return getdimen(d_headerheight) * bpfactor end) + local d_headerdistance = isdimen("headerdistance") registerdirect("HeaderDistance", function() return getdimen(d_headerdistance) * bpfactor end) + local d_textheight = isdimen("textheight") registerdirect("TextHeight", function() return getdimen(d_textheight) * bpfactor end) + local d_footerdistance = isdimen("footerdistance") registerdirect("FooterDistance", function() return getdimen(d_footerdistance) * bpfactor end) + local d_footerheight = isdimen("footerheight") registerdirect("FooterHeight", function() return getdimen(d_footerheight) * bpfactor end) + local d_bottomdistance = isdimen("bottomdistance") registerdirect("BottomDistance", function() return getdimen(d_bottomdistance) * bpfactor end) + local d_bottomheight = isdimen("bottomheight") registerdirect("BottomHeight", function() return getdimen(d_bottomheight) * bpfactor end) + local d_textwidth = isdimen("textwidth") registerdirect("TextWidth", function() return getdimen(d_textwidth) * bpfactor end) end do - local d_pagebackgroundoffset = isdimen("pagebackgroundoffset") registerdirect("PageOffset", function() return getdimen(d_pagebackgroundoffset) * factor end) - local d_pagebackgrounddepth = isdimen("pagebackgrounddepth") registerdirect("PageDepth", function() return getdimen(d_pagebackgrounddepth) * factor end) - local c_layoutcolumns = iscount("layoutcolumns") registerdirect("LayoutColumns", function() return getcount(c_layoutcolumns) end) - local d_layoutcolumndistance = isdimen("layoutcolumndistance") registerdirect("LayoutColumnDistance", function() return getdimen(d_layoutcolumndistance) * factor end) - local d_layoutcolumnwidth = isdimen("layoutcolumnwidth") registerdirect("LayoutColumnWidth", function() return getdimen(d_layoutcolumnwidth) * factor end) - local d_spinewidth = isdimen("spinewidth") registerdirect("SpineWidth", function() return getdimen(d_spinewidth) * factor end) - local d_paperbleed = isdimen("paperbleed") registerdirect("PaperBleed", function() return getdimen(d_paperbleed) * factor end) + local d_pagebackgroundoffset = isdimen("pagebackgroundoffset") registerdirect("PageOffset", function() return getdimen(d_pagebackgroundoffset) * bpfactor end) + local d_pagebackgrounddepth = isdimen("pagebackgrounddepth") registerdirect("PageDepth", function() return getdimen(d_pagebackgrounddepth) * bpfactor end) + local c_layoutcolumns = iscount("layoutcolumns") registerdirect("LayoutColumns", function() return getcount(c_layoutcolumns) end) + local d_layoutcolumndistance = isdimen("layoutcolumndistance") registerdirect("LayoutColumnDistance", function() return getdimen(d_layoutcolumndistance) * bpfactor end) + local d_layoutcolumnwidth = isdimen("layoutcolumnwidth") registerdirect("LayoutColumnWidth", function() return getdimen(d_layoutcolumnwidth) * bpfactor end) + local d_spinewidth = isdimen("spinewidth") registerdirect("SpineWidth", function() return getdimen(d_spinewidth) * bpfactor end) + local d_paperbleed = isdimen("paperbleed") registerdirect("PaperBleed", function() return getdimen(d_paperbleed) * bpfactor end) end do - local c_realpageno = iscount("realpageno") registerdirect("RealPageNumber", function() return getcount(c_realpageno) end) - local c_lastpageno = iscount("lastpageno") registerdirect("LastPageNumber", function() return getcount(c_lastpageno) end) + local c_realpageno = iscount("realpageno") registerdirect("RealPageNumber", function() return getcount(c_realpageno) end) + local c_lastpageno = iscount("lastpageno") registerdirect("LastPageNumber", function() return getcount(c_lastpageno) end) - local c_userpageno = iscount("userpageno") registerdirect("PageNumber", function() return getcount(c_userpageno) end) - local c_lastpageno = iscount("lastpageno") registerdirect("NOfPages", function() return getcount(c_lastpageno) end) + local c_userpageno = iscount("userpageno") registerdirect("PageNumber", function() return getcount(c_userpageno) end) + local c_lastpageno = iscount("lastpageno") registerdirect("NOfPages", function() return getcount(c_lastpageno) end) - local c_subpageno = iscount("subpageno") registerdirect("SubPageNumber", function() return getcount(c_subpageno) end) - local c_lastsubpageno = iscount("lastsubpageno") registerdirect("NOfSubPages", function() return getcount(c_lastsubpageno) end) + local c_subpageno = iscount("subpageno") registerdirect("SubPageNumber", function() return getcount(c_subpageno) end) + local c_lastsubpageno = iscount("lastsubpageno") registerdirect("NOfSubPages", function() return getcount(c_lastsubpageno) end) - local c_mofcolumns = iscount("mofcolumns") registerdirect("CurrentColumn", function() return getcount(c_mofcolumns) end) - local c_nofcolumns = iscount("nofcolumns") registerdirect("NOfColumns", function() return getcount(c_nofcolumns) end) + local c_mofcolumns = iscount("mofcolumns") registerdirect("CurrentColumn", function() return getcount(c_mofcolumns) end) + local c_nofcolumns = iscount("nofcolumns") registerdirect("NOfColumns", function() return getcount(c_nofcolumns) end) end do - registerdirect("BaseLineSkip", function() return get("baselineskip",true) * factor end) - registerdirect("TopSkip", function() return get("topskip",true) * factor end) - registerdirect("CurrentWidth", function() return get("hsize") * factor end) - registerdirect("CurrentHeight", function() return get("vsize") * factor end) - registerdirect("HSize", function() return get("hsize") * factor end) - registerdirect("VSize", function() return get("vsize") * factor end) + registerdirect("BaseLineSkip", function() return get("baselineskip",true) * bpfactor end) + registerdirect("TopSkip", function() return get("topskip",true) * bpfactor end) + registerdirect("CurrentWidth", function() return get("hsize") * bpfactor end) + registerdirect("CurrentHeight", function() return get("vsize") * bpfactor end) + registerdirect("HSize", function() return get("hsize") * bpfactor end) + registerdirect("VSize", function() return get("vsize") * bpfactor end) local emwidths = fonts.hashes.emwidths local exheights = fonts.hashes.exheights - registerdirect("EmWidth", function() return emwidths [false] * factor end) - registerdirect("ExHeight", function() return exheights[false] * factor end) + registerdirect("EmWidth", function() return emwidths [false] * bpfactor end) + registerdirect("ExHeight", function() return exheights[false] * bpfactor end) + + local d_uunit = isdimen("uunit") registerdirect("uunit", function() return getdimen(d_uunit) * bpfactor end) end do - local d_lineheight = isdimen("lineheight") registerdirect("LineHeight", function() return getdimen(d_lineheight) * factor end) - local d_bodyfontsize = isdimen("bodyfontsize") registerdirect("BodyFontSize", function() return getdimen(d_bodyfontsize) * factor end) - local d_strutht = isdimen("strutht") registerdirect("StrutHeight", function() return getdimen(d_strutht) * factor end) - local d_strutdp = isdimen("strutdp") registerdirect("StrutDepth", function() return getdimen(d_strutdp) * factor end) + local d_lineheight = isdimen("lineheight") registerdirect("LineHeight", function() return getdimen(d_lineheight) * bpfactor end) + local d_bodyfontsize = isdimen("bodyfontsize") registerdirect("BodyFontSize", function() return getdimen(d_bodyfontsize) * bpfactor end) + local d_strutht = isdimen("strutht") registerdirect("StrutHeight", function() return getdimen(d_strutht) * bpfactor end) + local d_strutdp = isdimen("strutdp") registerdirect("StrutDepth", function() return getdimen(d_strutdp) * bpfactor end) end do - local d_overlay_width = isdimen("d_overlay_width") registerdirect("OverlayWidth", function() return getdimen(d_overlay_width) * factor end) - local d_overlay_height = isdimen("d_overlay_height") registerdirect("OverlayHeight", function() return getdimen(d_overlay_height) * factor end) - local d_overlay_depth = isdimen("d_overlay_depth") registerdirect("OverlayDepth", function() return getdimen(d_overlay_depth) * factor end) - local d_overlay_linewidth = isdimen("d_overlay_linewidth") registerdirect("OverlayLineWidth", function() return getdimen(d_overlay_linewidth) * factor end) - local d_overlay_offset = isdimen("d_overlay_offset") registerdirect("OverlayOffset", function() return getdimen(d_overlay_offset) * factor end) - registerdirect("OverlayRegion", function() return getmacro("m_overlay_region") end) - registerdirect("CurrentLayout", function() return getmacro("currentlayout") end) - registerdirect("OverlayColor", function() return getmacro("overlaycolor") end) - registerdirect("OverlayLineColor", function() return getmacro("overlaylinecolor") end) + local d_overlay_width = isdimen("d_overlay_width") registerdirect("OverlayWidth", function() return getdimen(d_overlay_width) * bpfactor end) + local d_overlay_height = isdimen("d_overlay_height") registerdirect("OverlayHeight", function() return getdimen(d_overlay_height) * bpfactor end) + local d_overlay_depth = isdimen("d_overlay_depth") registerdirect("OverlayDepth", function() return getdimen(d_overlay_depth) * bpfactor end) + local d_overlay_linewidth = isdimen("d_overlay_linewidth") registerdirect("OverlayLineWidth", function() return getdimen(d_overlay_linewidth) * bpfactor end) + local d_overlay_offset = isdimen("d_overlay_offset") registerdirect("OverlayOffset", function() return getdimen(d_overlay_offset) * bpfactor end) + registerdirect("OverlayRegion", function() return getmacro("m_overlay_region") end) + registerdirect("CurrentLayout", function() return getmacro("currentlayout") end) + registerdirect("OverlayColor", function() return getmacro("overlaycolor") end) + registerdirect("OverlayLineColor", function() return getmacro("overlaylinecolor") end) end @@ -226,17 +229,17 @@ do -- TODO: dimensions are yet undefined so we will move this - registerdirect("RuleWidth", function() return getdimen("d_rule_width") * factor end) - registerdirect("RuleHeight", function() return getdimen("d_rule_height") * factor end) - registerdirect("RuleDepth", function() return getdimen("d_rule_depth") * factor end) - registerdirect("RuleH", function() return getdimen("d_rule_h") * factor end) - registerdirect("RuleV", function() return getdimen("d_rule_v") * factor end) - registerdirect("RuleThickness", function() return getdimen("d_rule_line") * factor end) - registerdirect("RuleOffset", function() return getdimen("d_rule_offset") / 65536 end) -- not factor - registerdirect("RuleDirection", function() return getmacro("m_rule_direction") end) - registerdirect("RuleFactor", function() return getdimen("d_rule_factor") * factor end) - registerdirect("RuleOption", function() return getmacro("m_rule_option") end) - registerscript("RuleColor", function() return getmacro("m_rule_color") end) + registerdirect("RuleWidth", function() return getdimen("d_rule_width") * bpfactor end) + registerdirect("RuleHeight", function() return getdimen("d_rule_height") * bpfactor end) + registerdirect("RuleDepth", function() return getdimen("d_rule_depth") * bpfactor end) + registerdirect("RuleH", function() return getdimen("d_rule_h") * bpfactor end) + registerdirect("RuleV", function() return getdimen("d_rule_v") * bpfactor end) + registerdirect("RuleThickness", function() return getdimen("d_rule_line") * bpfactor end) + registerdirect("RuleOffset", function() return getdimen("d_rule_offset") / 65536 end) -- not factor + registerdirect("RuleDirection", function() return getmacro("m_rule_direction") end) + registerdirect("RuleFactor", function() return getdimen("d_rule_factor") * bpfactor end) + registerdirect("RuleOption", function() return getmacro("m_rule_option") end) + registerscript("RuleColor", function() return getmacro("m_rule_color") end) end @@ -244,14 +247,14 @@ end do - local d_adaptive_width = isdimen("d_adaptive_width") registerdirect("AdaptiveWidth", function() return getdimen(d_adaptive_width) * factor end) - local d_adaptive_height = isdimen("d_adaptive_height") registerdirect("AdaptiveHeight", function() return getdimen(d_adaptive_height) * factor end) - local d_adaptive_depth = isdimen("d_adaptive_depth") registerdirect("AdaptiveDepth", function() return getdimen(d_adaptive_depth) * factor end) - local d_adaptive_line = isdimen("d_adaptive_line") registerdirect("AdaptiveThickness", function() return getdimen(d_adaptive_line) * factor end) - registerdirect("AdaptiveColor", function() return getmacro("m_adaptive_color") end) + local d_adaptive_width = isdimen("d_adaptive_width") registerdirect("AdaptiveWidth", function() return getdimen(d_adaptive_width) * bpfactor end) + local d_adaptive_height = isdimen("d_adaptive_height") registerdirect("AdaptiveHeight", function() return getdimen(d_adaptive_height) * bpfactor end) + local d_adaptive_depth = isdimen("d_adaptive_depth") registerdirect("AdaptiveDepth", function() return getdimen(d_adaptive_depth) * bpfactor end) + local d_adaptive_line = isdimen("d_adaptive_line") registerdirect("AdaptiveThickness", function() return getdimen(d_adaptive_line) * bpfactor end) + registerdirect("AdaptiveColor", function() return getmacro("m_adaptive_color") end) registerdirect("AdaptiveTotal", function() - return (getdimen(d_adaptive_height) + getdimen(d_adaptive_depth)) * factor + return (getdimen(d_adaptive_height) + getdimen(d_adaptive_depth)) * bpfactor end) end diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt index db23fcedecb..a262635c539 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt @@ -34,7 +34,7 @@ local scanproperty = scan.property local gethashentry = get.hashentry -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp local injectwhatever = inject.whatever local injectboolean = inject.boolean @@ -180,11 +180,11 @@ do local expandtex = mp.expandtex local tokenvalues = tokens.values - local dimension_value = tokenvalues.dimension - local integer_value = tokenvalues.integer - local boolean_value = tokenvalues.boolean - local string_value = tokenvalues.string - local unknown_value = tokenvalues.none + local dimension_value = tokenvalues.dimension + local integer_value = tokenvalues.integer + local boolean_value = tokenvalues.boolean + local string_value = tokenvalues.string + local unknown_value = tokenvalues.none registerdirect("mpvard", function() if not expandtex(dimension_value,"mpcategoryparameter",true,scanstring()) then @@ -358,7 +358,7 @@ do local skiptoken = skip.token - local comma_code = codes.comma + local comma_code = codes.comma local getmacro = tokens.getters.macro local setmacro = tokens.setters.macro diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt index 19423e7b1d6..4b18aee29ff 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt @@ -27,7 +27,7 @@ local skip = mp.skip local get = mp.get local inject = mp.inject -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp local currentmpx = nil local stack = { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-ptr.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-ptr.lmt new file mode 100644 index 00000000000..eeca4a82abd --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-ptr.lmt @@ -0,0 +1,505 @@ +if not modules then modules = { } end modules ['mlib-ptr'] = { + version = 1.001, + optimize = true, + comment = "companion to mlib-ctx.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +-- This is experimental. + +-- too: use string.packrowsandcolumns + +local formatters, gsub, sub = string.formatters, string.gsub, string.sub +local concat, setmetatableindex = table.concat, table.setmetatableindex +local byte, gsub = string.byte, string.gsub + +local trace_result = false trackers.register("potrace.results", function(v) trace_result = v end) + +local report = logs.reporter("metapost","potrace") + +local potracefromfile do -- this will move to another module + + local newreader = io.newreader + local openstring = utilities.streams.openstring + local readstring = utilities.streams.readstring + local zlibdecompress = xzip.decompress + local pngapplyfilter = pngdecode.applyfilter + local loadbinfile = resolvers.loadbinfile + + local function newcontent(filename) + local found, data = loadbinfile(filename) + return newreader(data or "", "string") + end + + local function decodestrip(s,nx,ny,slice) + local input = readstring(s,ny*(nx*slice+1)) + input = pngapplyfilter(input,nx,ny,slice) + return input, false + end + + local function simplify(content,threshold) + if not threshold then + threshold = 127 + end + local thresholds = setmetatableindex(function(t,k) + local v = byte(k) < threshold and '0' or '1' + t[k] = v + return v + end) + return (gsub(content,".",thresholds)) + end + + potracefrompng = function(filename,parameters) + + if not filename then + return false + end + + local threshold = parameters.criterium + local specification = figures.getinfo(filename) + + specification = specification and specification.status and specification.status.private + + if not specification then + print("no specification") + return + end + + local colorspace = specification.colorspace + local xsize = specification.xsize + local ysize = specification.ysize + local colordepth = specification.colordepth or 8 + + if colorspace ~= 0 or colordepth ~= 8 then + print("unsupported colorspace",colorspace,colordepth) + return + end + if specification.interlace == 1 then + print("unsupported interlace") + return + end + local tables = specification.tables + if not tables then + print("no tables") + return + end + local idat = tables.idat + if not idat then + print("no data") + return + end + local pngfile = newcontent(filename,method,true) + local content = idat[1] + if type(content) == "table" then + if not pngfile then + return + end + content = idat(pngfile,true) + end + content = zlibdecompress(content) + content = decodestrip(openstring(content),xsize,ysize,1) + content = simplify(content,threshold) + pngfile:close() + return content, xsize, ysize + end + +end + +local potracecontourplot, potracegetbitmap, potracesetbitmap, potraceconcat do + + local luastrings = { } + + potracecontourplot = function(nx,ny,f) + local yx = setmetatableindex("table") + local my = ny + 1 + for y=1,ny do + local dy = yx[my-y] + for x=1,nx do + dy[x] = f(x,y) + end + end + return yx + end + + potraceconcat = function(t) + for i=1,#t do + t[i] = concat(t[i]) + end + return concat(t," ") + end + + potracesetbitmap = function(name,str) + luastrings[name] = type(str) == "table" and potraceconcat(str) or str + end + + potracegetbitmap = function(name) + return luastrings[name] or "" + end + +end + +local potracestripped, potracecount do + + local lpegmatch = lpeg.match + + local sp = lpeg.patterns.whitespace^1 + local n = 0 + local p = (lpeg.Cmt((1-sp) * (sp + lpeg.P(-1)), function() n = n + 1 end) + lpeg.P(1))^0 + + potracecount = function(s) + n = 0 + lpegmatch(p,s) + return n + end + + potracestripped = function(s) + s = gsub(s,"%s","") + return s + end + +end + +local potraceflush, potracechecked, potraceconvert do + + local potracenew = potrace.new + local potracefree = potrace.free + local potracetotable = potrace.totable + local potraceprocess = potrace.process + + function potrace.trace(t,polygon) + local p = potracenew(t) + if p and potraceprocess(p) then + local r = potracetotable(p,polygon) + potracefree(p) + return r + end + end + + local getparameterset = metapost.getparameterset + ----- getparameter = metapost.getparameter + ----- setparameter = metapost.setparameter + local mpprint = mp.print + + local f_moveto = formatters["(%N,%N)"] + local f_lineto = formatters["--(%N,%N)"] + local f_curveto = formatters["..controls(%N,%N)and(%N,%N)..(%N,%N)"] + + potraceflush = function(t,alternative,polygon) + local result, r, add + if alternative == "draw" or alternative == "fill" then + alternative = alternative .. "(" + else + alternative = false + end + if t then + result, r = { }, 0 + if polygon then + add = function(before,ti,after) + r = r + 1 ; result[r] = before + r = r + 1 ; result[r] = f_moveto(ti[1],ti[2]) + for i=3,#ti,2 do + r = r + 1 ; result[r] = f_lineto(ti[i],ti[i+1]) + end + r = r + 1 ; result[r] = after + end + else + add = function(before,ti,after) + r = r + 1 ; result[r] = before + r = r + 1 ; result[r] = f_moveto(ti[1][1],ti[1][2]) + for i=2,#ti do + local ti = ti[i] + local ni = #ti + if ni == 2 then + r = r + 1 ; result[r] = f_lineto(ti[1],ti[2]) + elseif ni == 6 then + r = r + 1 ; result[r] = f_curveto(ti[3],ti[4],ti[5],ti[6],ti[1],ti[2]) + end + end + r = r + 1 ; result[r] = after + end + end + if alternative then + r = r + 1 ; result[r] = "image(\n" + for i=1,#t do + add(alternative,t[i],"&cycle);\n") + end + r = r + 1 ; result[r] = ")" + else + for i=1,#t do + if i > 1 then + r = r + 1 ; result[r] = "&&&&\n" + end + add("(",t[i],"&cycle)") + end + if #t > 1 then + r = r + 1 ; result[r] = "\n&&&&cycle" + end + end + result = concat(result) + elseif alternative then + result = "nullpicture" + else + result = "origin--cycle" + end + if trace_result then + inspect(t) + inspect(result) + end + mpprint(result) + end + + potracechecked = function(b,width,height) + if b and type(b) == "string" and b ~= "" then + local bytes = potracestripped(b) + if not width or width == 0 then + if not height or height == 0 then + height = potracecount(b) + end + width = #bytes // height + elseif not height or height == 0 then + height = #bytes // width + end + return bytes, width, height + else + return false, width, height + end + end + + potraceconvert = function(bytes,settings,w,h) + if not w or not h then + bytes, w, h = potracechecked(bytes) + end + local s = { bytes = bytes, width = w, height = h } + local p = potracenew(setmetatableindex(s,settings or { })) + if p then + potraceprocess(p, { value = "1" }) + local t = potracetotable(p) + potracefree(p) + return t + end + end + + local instance = false + + local bytes = false + local width = 0 + local height = 0 + local nx = 1 + local ny = 1 + + local function potracepattern() + local b = { } + local n = 0 + local f = 1 + local t = width + for i=1,height do + n = n + 1 ; b[n] = sub(bytes,f,t) + n = n + 1 ; b[n] = "\\par" + f = t + 1 + t = t + width + end + mpprint(formatters + ['textext.urt("\\potracebitmap{%t}")xysized(last_potraced_width,last_potraced_height)'] + (b) + ) + end + + local loaddata = io.loaddata + local filesuffix = file.suffix + local getbuffer = buffers.getcontent + + local function potracefromtxt(filename,parameters) + local bytes = loaddata(filename) + if bytes and bytes ~= 0 then + return potracechecked(bytes,0,0) + end + end + + -- cache ? + + local function potracefrompk(filename,parameters) + local index = parameters.index + if type(index) == "number" and filename and filename ~= "" then + filename = file.removesuffix(filename) + local r = math.tointeger(parameters.resolution or 7200) -- get rid of 7200.0 + local f = fonts.handlers.tfm.readers.loadpk(resolvers.findpk(filename,r) or "") + if f then + local g = f.glyphs[index] + if g then + local xsize = g.xsize + local ysize = g.ysize + parameters.xsize = xsize + parameters.ysize = ysize + parameters.xoffset = g.xoffset + parameters.yoffset = g.yoffset +-- local b = fonts.handlers.tfm.readers.showpk(g,xsize,ysize) or "" +-- return potracechecked(b,0,0) + return fonts.handlers.tfm.readers.showpk(g,xsize,ysize,true) + end + end + end + end + + local filehandles = { + png = potracefrompng, + txt = potracefromtxt, + pk = potracefrompk, + } + + local function potracefromfile(parameters) + local filename = parameters.filename + if filename and filename ~= "" then + local handle = filehandles[filesuffix(filename)] + if handle then + return handle(filename,parameters) + end + end + end + + local function potracefrombuffer(parameters,width,height) + local buffer = parameters.buffer + if buffer and buffer ~= "" then + local bytes = getbuffer(buffer) + if bytes and bytes ~= "" then + return potracechecked(bytes,width,height) + end + end + end + + local function potracefromstring(parameters,width,height) + local name = parameters.stringname + if name and name ~= "" then + local bytes = potracegetbitmap(name) + if bytes and #bytes ~= "" then + return potracechecked(bytes,width,height) + end + end + end + + function mp.lmt_start_potrace() + bytes = false + + local parameters = getparameterset("potraced") + width = parameters.width or 0 + height = parameters.height or 0 + nx = (parameters.nx or 1 // 1) + ny = (parameters.ny or 1 // 1) + if parameters.explode then + nx = 3 + ny = 3 + end + if not bytes then + local b, w, h = potracefromfile(parameters) + if b then + bytes, width, height = b, w, h + end + end + if not bytes then + local b, w, h = potracefromstring(parameters,width,height) + if b then + bytes, width, height = b, w, h + end + end + if not bytes then + local b, w, h = potracefrombuffer(parameters,width,height) + if b then + bytes, width, height = b, w, h + end + end + if not bytes then + local b, w, h = potracechecked(parameters.bytes,width,height) + if b then + bytes, width, height = b, w, h + end + end + if not bytes then + bytes, width, height = potracechecked("010 111 010",width,height) + end +-- report("width : %i",width) +-- report("height: %i",height) +-- report("bytes : %i",#bytes) +-- report("length: %i",width*height) + instance = potracenew { + bytes = bytes, + width = width, + height = height, + nx = nx, + ny = ny, + value = parameters.value, + negate = parameters.negate, + size = parameters.size, -- turdsize + optimize = parameters.optimize, -- opticurve + swap = parameters.swap, + threshold = parameters.threshold, -- alphamax + policy = parameters.policy, -- turnpolicy + tolerance = parameters.tolerance, -- opttolerance + } + -- we keep bytes for tracing, maybe keep option + parameters.width = width *nx + parameters.height = height*ny + parameters.count = 0 + end + + function mp.lmt_stop_potrace() + if instance then + potracefree(instance) + end + instance = false + bytes = false + end + + function mp.lmt_step_potrace() + if instance then + local parameters = getparameterset("potraced") + local result = false + local alternative = parameters.alternative + local polygon = parameters.polygon or false + local index = parameters.index + local first = parameters.first or 0 + local last = parameters.last or 0 + if index then + first = index + last = index + end + if alternative == "text" then + potracepattern() + else + -- we can return a count + local okay = potraceprocess(instance, { + value = parameters.value, + negate = parameters.negate, + size = parameters.size, + optimize = parameters.optimize, -- opticurve + swap = parameters.swap, + threshold = parameters.threshold, -- alphamax + policy = parameters.policy, -- turnpolicy + tolerance = parameters.tolerance, -- opttolerance + } ) + if okay then + result = potracetotable(instance,polygon,first,last) + potraceflush(result,alternative,polygon) + parameters.count = #result + else + parameters.count = 0 + end + end + parameters.first = nil + parameters.last = nil + parameters.index = nil + end + end + +end + +potrace.stripped = potracestripped +potrace.count = potracecount +potrace.concat = potraceconcat +potrace.setbitmap = potracesetbitmap +potrace.getbitmap = potracegetbitmap +potrace.flush = potraceflush +potrace.fromfile = potracefromfile +potrace.contourplot = potracecontourplot +potrace.checked = potracechecked +potrace.convert = potraceconvert diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt index ed56e113d00..bbb29fa7ef8 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt @@ -26,7 +26,7 @@ if not modules then modules = { } end modules ['mlib-scn'] = { -- endfor ; -- popparameters; -local type, next, rawget, getmetatable, tonumber = type, next, rawget, getmetatable, tonumber +local type, next, rawget, rawset, getmetatable, tonumber = type, next, rawget, rawset, getmetatable, tonumber local byte, gmatch = string.byte, string.gmatch local insert, remove, combine = table.insert, table.remove, table.combine @@ -70,22 +70,22 @@ local injectpath = injectors.path local report = logs.reporter("metapost") -local semicolon_code = codes.semicolon -local equals_code = codes.equals -local comma_code = codes.comma -local colon_code = codes.colon -local leftbrace_code = codes.leftbrace -local rightbrace_code = codes.rightbrace -local leftbracket_code = codes.leftbracket -local rightbracket_code = codes.rightbracket -local leftdelimiter_code = codes.leftdelimiter -local rightdelimiter_code = codes.rightdelimiter -local numeric_code = codes.numeric -local string_code = codes.string -local capsule_code = codes.capsule -local nullary_code = codes.nullary -local tag_code = codes.tag -local definedmacro_code = codes.definedmacro +local semicolon_code = codes.semicolon +local equals_code = codes.equals +local comma_code = codes.comma +local colon_code = codes.colon +local leftbrace_code = codes.leftbrace +local rightbrace_code = codes.rightbrace +local leftbracket_code = codes.leftbracket +local rightbracket_code = codes.rightbracket +local leftdelimiter_code = codes.leftdelimiter +local rightdelimiter_code = codes.rightdelimiter +local numeric_code = codes.numeric +local string_code = codes.string +local capsule_code = codes.capsule +local nullary_code = codes.nullary +local tag_code = codes.tag +local definedmacro_code = codes.definedmacro local typescanners = nil local tokenscanners = nil @@ -269,7 +269,7 @@ local function get_parameters(nested) else data[s] = tokenscanners[kind]() end - ::again:: + ::again:: end return data end @@ -809,6 +809,10 @@ function metapost.getparameterset(namespace) return namespace and namespaces[namespace] or namespaces end +function metapost.setparameter(k,v) + rawset(namespaces,k,v) +end + function metapost.setparameterset(namespace,t) namespaces[namespace] = t end @@ -1100,9 +1104,9 @@ local scandimension = scanners.dimension local definitions = { } -local bpfactor = number.dimenfactors.bp -local comma = byte(",") -local close = byte("]") +local bpfactor = number.dimenfactors.bp +local comma = byte(",") +local close = byte("]") local scanrest = function() return scanvalue(comma,close) or "" end local scandimension = function() return scandimension() * bpfactor end diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt index 2dec349db34..51f3216d35e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt @@ -3552,7 +3552,7 @@ end do - local bpfactor = number.dimenfactors.bp + local bpfactor = number.dimenfactors.bp function metapost.includesvgfile(filename,offset) -- offset in sp local fullname = resolvers.findbinfile(filename) diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl index 08d75a5b3cf..064c62abbe0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl @@ -27,9 +27,9 @@ \unprotect -\immutable\cdef\??empty{\Uchar25} \immutable\letvalue{\Uchar25}\empty % hex 19 +\immutable\cdef\??empty{\tocharacter25} \immutable\letvalue{\tocharacter25}\empty % hex 19 -% \edef\s!parent{\Uchar29} % inlining  is ugly, a tiny bit faster, but neglectable on a run +% \edef\s!parent{\tocharacter29} % inlining  is ugly, a tiny bit faster, but neglectable on a run %D \starttyping %D \unprotect @@ -65,10 +65,6 @@ % % There can be less {} in the following definitions if we assume \??aa and \c!somecs % -% todo: \def\detokenized...parameter#1{\detokenize\expandafter\expandafter\expandafter{\csname#1#2\endcsname}} % always root -% -% it might be more efficient to do this at the lua and -% % watch the push/pop and predefinition of current .. this is needed for nested % definitions and overloaded defines using the predefined one @@ -180,44 +176,177 @@ \lettonothing\m_mult_interfaces_namespace -\def\mult_interfaces_get_parameters#1[% - {\def\m_mult_interfaces_namespace{#1}% - \futureexpandis]\gobbleoneargument\mult_interfaces_get_parameters_indeed} +% \def\mult_interfaces_get_parameters#1[% +% {\def\m_mult_interfaces_namespace{#1}% +% \futureexpandis]\gobbleoneargument\mult_interfaces_get_parameters_indeed} +% +% \def\mult_interfaces_get_parameters_indeed#1]% +% {\mult_interfaces_get_parameters_item#1\ignorearguments\ignorearguments} +% +% \def\mult_interfaces_get_parameters_item#*#1,% +% {\ifarguments +% \else +% \mult_interfaces_get_parameters_item_okay#1,\ignorearguments +% \expandafter\mult_interfaces_get_parameters_item +% \fi} +% +% \def\mult_interfaces_get_parameters_item_okay#1=#2,% +% {\ifarguments +% % done +% \or +% \mult_interfaces_get_parameters_item_error +% \else +% \mult_interfaces_adef\m_mult_interfaces_namespace{#1}{#2}% +% \fi} +% +% \def\mult_interfaces_get_parameters_item_error#-#-#-#1#2% +% {\if,#2\else\mult_interfaces_get_parameters_error_indeed{#1}{#2}\fi} +% +% \startinterface english +% +% \def\mult_interfaces_get_parameters_item_okay#1=#2,% +% {\ifarguments +% % done +% \or +% \mult_interfaces_get_parameters_item_error +% \else +% \defcsname\m_mult_interfaces_namespace#1\endcsname{#2}% +% \fi} +% +% \def\mult_interfaces_get_parameters_item_error#-\defcsname#1#2\endcsname#-% +% {\if,#2\else\mult_interfaces_get_parameters_error_indeed{#1}{#2}\fi} +% +% \stopinterface + +% cheap with no checking +% +% \def\mult_interfaces_get_parameters#1[#S#2]% +% {\cdef\m_mult_interfaces_namespace{#1}% +% \mult_interfaces_get_parameters_item_okay#2\ignorearguments\ignorearguments} +% +% \tolerant\def\mult_interfaces_get_parameters_item_okay#*#1=#S#2,#M,% +% {\ifparameter#2\or +% \ifcsname\k!prefix!#1\endcsname +% \defcsname\m_mult_interfaces_namespace\lastnamedcs\endcsname{#2}% +% \else +% \defcsname\m_mult_interfaces_namespace#1\endcsname{#2}% +% \fi +% \orelse\ifparameter#1\or +% \ifcsname\k!prefix!#1\endcsname +% \letcsname\m_mult_interfaces_namespace\lastnamedcs\endcsname\empty +% \else +% \letcsname\m_mult_interfaces_namespace#1\endcsname\empty +% \fi +% \else +% \expandafter\gobbleoneargument +% \fi +% \mult_interfaces_get_parameters_item_okay} +% +% \startinterface english +% +% \tolerant\def\mult_interfaces_get_parameters_item_okay#*#1=#S#2,#M,% +% {\ifparameter#2\or +% % k=v +% \defcsname\m_mult_interfaces_namespace#1\endcsname{#2}% +% \orelse\ifparameter#1\or +% % k= +% \letcsname\m_mult_interfaces_namespace#1\endcsname\empty +% \else +% \expandafter\gobbleoneargument +% \fi +% \mult_interfaces_get_parameters_item_okay} +% +% \stopinterface + +%D Still not nice + +% \def\mult_interfaces_get_parameters#1[% +% {\cdef\m_mult_interfaces_namespace{#1}% +% \futureexpandis]\gobbleoneargument\mult_interfaces_get_parameters_indeed} +% +% \def\mult_interfaces_get_parameters_indeed#S#1]% +% {\mult_interfaces_get_parameters_item#1\ignorearguments\ignorearguments} + +\def\mult_interfaces_get_parameters#1[#S#2]% + {\cdef\m_mult_interfaces_namespace{#1}% + \mult_interfaces_get_parameters_item#2\ignorearguments\ignorearguments} -\def\mult_interfaces_get_parameters_indeed#1]% - {\mult_interfaces_get_parameters_item#1\ignorearguments\ignorearguments} +% \def\mult_interfaces_get_parameters_item#*#S#1,% +% {\ifarguments +% \else +% \mult_interfaces_get_parameters_item_okay#1,\ignorearguments +% \expandafter\mult_interfaces_get_parameters_item +% \fi} -\def\mult_interfaces_get_parameters_item#*#1,% - {\ifarguments \else +\def\mult_interfaces_get_parameters_item#*#S#1,% + {\ifarguments + \expandafter\gobbleoneargument + \else \mult_interfaces_get_parameters_item_okay#1,\ignorearguments - \expandafter\mult_interfaces_get_parameters_item - \fi} + \fi + \mult_interfaces_get_parameters_item} + +% \tolerant\def\mult_interfaces_get_parameters_item_okay#1=#S#2,% +% {\ifarguments +% % done +% \or +% \mult_interfaces_get_parameters_item_error +% \else +% \mult_interfaces_adef\m_mult_interfaces_namespace{#1}{#2}% +% \fi} + +% \tolerant\def\mult_interfaces_get_parameters_item_okay#1=#S#2,% +% {\ifarguments +% % done +% \or +% \mult_interfaces_get_parameters_item_error{#1}% +% \orelse\ifcsname\k!prefix!#1\endcsname +% \defcsname\m_mult_interfaces_namespace\lastnamedcs\endcsname{#2}% +% \else +% \defcsname\m_mult_interfaces_namespace#1\endcsname{#2}% +% \fi} -\def\mult_interfaces_get_parameters_item_okay#1=#2,% +\tolerant\def\mult_interfaces_get_parameters_item_okay#1=#S#2,% {\ifarguments % done \or - \mult_interfaces_get_parameters_item_error - \else - \mult_interfaces_adef\m_mult_interfaces_namespace{#1}{#2}% + \mult_interfaces_get_parameters_item_error{#1}% + \or + \defcsname + \m_mult_interfaces_namespace + \ifcsname\k!prefix!#1\endcsname\lastnamedcs\else#1\fi + \endcsname{#2}% \fi} -\def\mult_interfaces_get_parameters_item_error#-#-#-#1#2% - {\if,#2\else\mult_interfaces_get_parameters_error_indeed{#1}{#2}\fi} +\def\mult_interfaces_get_parameters_item_error#1% + {\if,#1\else\mult_interfaces_get_parameters_error_indeed\m_mult_interfaces_namespace{#1}\fi} \startinterface english - \def\mult_interfaces_get_parameters_item_okay#1=#2,% + \def\mult_interfaces_get_parameters_item_okay#1=#S#2,% {\ifarguments % done \or - \mult_interfaces_get_parameters_item_error + \mult_interfaces_get_parameters_item_error{#1}% + % \mult_interfaces_get_parameters_item_error + % \if,#1\else\mult_interfaces_get_parameters_item_error\fi \else \defcsname\m_mult_interfaces_namespace#1\endcsname{#2}% \fi} - \def\mult_interfaces_get_parameters_item_error#-\defcsname#1#2\endcsname#-% - {\if,#2\else\mult_interfaces_get_parameters_error_indeed{#1}{#2}\fi} + % \def\mult_interfaces_get_parameters_item_error#-\defcsname#1#2\endcsname#-% + % {\if,#2\else\mult_interfaces_get_parameters_error_indeed{#1}{#2}\fi} + + % \def\mult_interfaces_get_parameters_item_error#-\defcsname#-#1\endcsname#-% + % {\if,#1\else\mult_interfaces_get_parameters_error_indeed\m_mult_interfaces_namespace{#1}\fi} + + \def\mult_interfaces_get_parameters_item_error#1% + {\if,#1\else\mult_interfaces_get_parameters_error_indeed\m_mult_interfaces_namespace{#1}\fi} + + % \def\mult_interfaces_get_parameters_item_error + % {\mult_interfaces_get_parameters_error_indeed + % {\m_mult_interfaces_namespace} + % {\expandparameter\plusthree}} \stopinterface @@ -274,20 +403,21 @@ %D pre-expansion can be a bit faster but handly any effect on a normal run so let's %D go for saving some memory. -\def\mult_interfaces_detokenize{\expandafter\expandafter\expandafter\detokenize\expandafter\expandafter\expandafter} +%def\mult_interfaces_detokenize{\expandafter\expandafter\expandafter\detokenize\expandafter\expandafter\expandafter} \protected\def\mult_interfaces_install_parameter_handler#1#2#3#4#5#6#7#8#9% {\frozen\def#3##1{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}% \frozen\def#4##1##2{\ifcsname##1:##2\endcsname##1:##2\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}% \frozen\edef#5##1##2{\noexpand\ifrelax##1\??empty\noexpand\else\noexpand#4##1{##2}\noexpand\fi}% is {} needed around ##1 ? \frozen\def#6##1##2{\csname\ifcsname#1##1:##2\endcsname#1##1:##2\else\expandafter#5\csname#1##1:\s!parent\endcsname{##2}\fi\endcsname}% - \frozen\def#7##1{\detokenize\expandafter\expandafter\expandafter{\csname#1#2:##1\endcsname}}% always root, no backtrack + %\frozen\def#7##1{\detokenize\expandafter\expandafter\expandafter{\csname#1#2:##1\endcsname}}% always root, no backtrack + \frozen\def#7##1{\expandafter\detokened\csname#1#2:##1\endcsname}% always root, no backtrack \frozen\def#8##1{\begincsname#1#2:##1\endcsname}% % TODO \frozen\def#9##1##2{\expandafter\let\expandafter##1\csname\ifcsname#1#2:##2\endcsname#1#2:##2\else\expandafter#5\csname#1#2:\s!parent\endcsname{##2}\fi\endcsname}} \permanent\protected\def\installparameterhandler#1#2% - {\mutable\letcsname current#2\endcsname\empty + {\mutable\constant\letcsname current#2\endcsname\empty \normalexpanded {\mult_interfaces_install_parameter_handler {\noexpand#1}% \??aa @@ -301,7 +431,8 @@ \expandafter\noexpand\csname letfrom#2parameter\endcsname}} % strict#2parameter is gone \protected\def\mult_interfaces_install_root_parameter_handler#1#2#3% - {\frozen\def#2##1{\detokenize\expandafter\expandafter\expandafter{\csname#1:##1\endcsname}}% always root + %{\frozen\def#2##1{\detokenize\expandafter\expandafter\expandafter{\csname#1:##1\endcsname}}% always root + {\frozen\def#2##1{\expandafter\detokened\csname#1:##1\endcsname}% always root \frozen\def#3##1{\begincsname#1:##1\endcsname}} \permanent\protected\def\installrootparameterhandler#1#2% @@ -368,15 +499,15 @@ \protected\def\mult_interfaces_install_style_and_color_handler#1#2#3#4% {\frozen\protected\def#2##1##2% style color - {\edef\currentstyleparameter{#1{##1}}% this name is public (can also set color e.g. in underline) + {\cdef\currentstyleparameter{#1{##1}}% this name is public (can also set color e.g. in underline) \ifempty\currentstyleparameter\else\dousecurrentstyleparameter\fi - \edef\currentcolorparameter{#1{##2}}% this name is public (so we do this after the style switch) + \cdef\currentcolorparameter{#1{##2}}% this name is public (so we do this after the style switch) \ifempty\currentcolorparameter\else\dousecurrentcolorparameter\fi}% \frozen\protected\def#3##1% style - {\edef\currentstyleparameter{#1{##1}}% this name is public + {\cdef\currentstyleparameter{#1{##1}}% this name is public \ifempty\currentstyleparameter\else\dousecurrentstyleparameter\fi}% \frozen\protected\def#4##1% color - {\edef\currentcolorparameter{#1{##1}}% this name is public + {\cdef\currentcolorparameter{#1{##1}}% this name is public \ifempty\currentcolorparameter\else\dousecurrentcolorparameter\fi}} \permanent\protected\def\installstyleandcolorhandler#1#2% @@ -390,7 +521,7 @@ \def\mult_check_for_parent#1#2#3#4% {\ifcsname#1#4:\s!parent\endcsname\orelse\ifx#4\empty\else \writestatus\m!system{error: invalid parent #4 for #3, #4 defined too (best check it)}% - \edefcsname#1#4:\s!parent\endcsname{#2}% + \cdefcsname#1#4:\s!parent\endcsname{#2}% \fi} \def\mult_interfaces_chain#1#2{\ifcsname#1#2:\s!chain\endcsname\lastnamedcs\space\fi} @@ -401,27 +532,27 @@ % but it might have a little impact on performance ... something to leave % to when we're done with the transition (it's kind of massive) -\protected\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8% why is \expanded still needed in clones +\protected\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8% {\newtoks#5% \newtoks#6% - \frozen\tolerant\protected\def#2[##1]##*[##2]##*[##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child] + \frozen\tolerant\protected\def#2[##1]##*[##S##2]##*[##S##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child] {\let#8#4% % watch out: no \edef#4{##1} before the ifarguments because #1 can have macros \ifarguments \lettonothing#4% - \the#5% predefine + \expand#5% predefine \lettonothing#7% \letcsname#1#4:\s!chain\endcsname\empty \cdefcsname#1#4:\s!parent\endcsname{#3}% \or - \edef#4{##1}% - \the#5% predefine + \cdef#4{##1}% + \expand#5% predefine \lettonothing#7% \cdefcsname#1#4:\s!chain\endcsname{##1}% \cdefcsname#1#4:\s!parent\endcsname{#3}% \or - \edef#4{##1}% - \the#5% predefine + \cdef#4{##1}% + \expand#5% predefine \relax \ifhastok={##2}% \lettonothing#7% @@ -429,7 +560,7 @@ \cdefcsname#1#4:\s!parent\endcsname{#3}% \mult_interfaces_get_parameters{#1#4:}[##2]% \else - \edef#7{##2}% + \cdef#7{##2}% \ifempty#7% \cdefcsname#1#4:\s!chain\endcsname{##1}% \cdefcsname#1#4:\s!parent\endcsname{#3}% @@ -440,15 +571,15 @@ \fi \fi \or - \edef#4{##1}% - \the#5% predefine - \edef#7{##2}% + \cdef#4{##1}% + \expand#5% predefine + \cdef#7{##2}% \mult_check_for_parent{#1}{#3}#4#7% \cdefcsname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}% \cdefcsname#1#4:\s!parent\endcsname{#1##2}% \mult_interfaces_get_parameters{#1#4:}[##3]% \fi - \the#6% + \expand#6% \let#4#8}} \permanent\protected\def\installdefinehandler#1#2#3% @@ -469,21 +600,21 @@ {\newtoks#4% \newtoks#7% \frozen\protected\def#5{\mult_interfaces_get_parameters{#1#3:}}% no every ! don't change it - \frozen\tolerant\protected\def#2[##1]##*[##2]% maybe helper + \frozen\tolerant\protected\def#2[##S##1]##*[##S##2]% maybe helper {\let#6#3% \ifnum\lastarguments=\plustwo \def#8####1% we will have a simple one as well - {\edef#3{####1}% + {\cdef#3{####1}% \mult_interfaces_get_parameters{#1#3:}[##2]% - \the#4}% + \expand#4}% \processcommalist[##1]#8% \else \lettonothing#3% \mult_interfaces_get_parameters{#1:}[##1]% - \the#4% + \expand#4% \fi \let#3#6% - \the#7}} + \expand#7}} \permanent\protected\def\installsetuphandler#1#2% {\mutable\letcsname current#2\endcsname\empty @@ -503,22 +634,95 @@ \aliased\let\doingrootsetnamed \plusthree % \setuplayout[name] \aliased\let\doingrootsetroot \plusfour % \setuplayout -\protected\def\mult_interfaces_install_switch_setup_handler_a#1#2#3% - {\frozen\protected\def#3{\mult_interfaces_get_parameters{#1#2:}}} - -\protected\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9% +% \protected\def\mult_interfaces_install_switch_setup_handler_a#1#2#3% +% {\frozen\protected\def#3{\mult_interfaces_get_parameters{#1#2:}}} + +% \protected\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9% +% {\newtoks#5% +% \newconstant#2% +% \newtoks#8% +% \newtoks#9% +% \frozen\tolerant\protected\def#4[##1]##*[##2]% maybe helper +% {\ifarguments +% % \setuplayout +% \let#6#3% % previous becomes current +% \lettonothing#3% % current becomes empty +% #2\doingrootsetroot +% \expand#5% +% \expand#8% switchsetups +% \or +% \ifhastok={##1}% +% % \setuplayout[key=value] +% \let#7#3% +% \let#6#3% +% \lettonothing#3% +% #2\doingrootsetuproot +% \mult_interfaces_get_parameters{#1:}[##1]% +% \expand#5% +% \expand#8% switchsetups +% \let#3#7% +% \else +% % \setuplayout[whatever] +% \let#6#3% % previous becomes current +% \cdef#3{##1}% this will catch reset so one needs to test for it +% \ifempty#3% +% \let#7#6% +% #2\doingrootsetuproot +% \expand#5% +% \expand#8% switchsetups +% \let#3#7% +% \else +% #2\doingrootsetnamed +% \expand#5% % we can check for previous vs current +% \expand#8% switchsetups +% \fi +% \fi +% \or +% % \setuplayout[whatever][key=value] +% \let#7#3% +% \let#6#3% +% \cdef#3{##1}% +% #2\doingrootsetupnamed +% \mult_interfaces_get_parameters{#1#3:}[##2]% +% \expand#5% +% \ifx#3#6\expand#8\fi % only switchsetups if previous == current +% \let#3#7% +% \fi +% #2\zerocount % mode is always zero at the end +% \expand#9}} + +% \permanent\protected\def\installswitchsetuphandler#1#2% +% {\mutable\letcsname current#2\endcsname\empty +% \mutable\letcsname previous#2\endcsname\empty +% \normalexpanded +% {\mult_interfaces_install_switch_setup_handler_a +% {\noexpand#1}% \??aa +% \expandafter\noexpand\csname current#2\endcsname +% \expandafter\noexpand\csname setupcurrent#2\endcsname +% \mult_interfaces_install_switch_setup_handler_b +% {\noexpand#1}% \??aa +% \expandafter\noexpand\csname #2setupmode\endcsname +% \expandafter\noexpand\csname current#2\endcsname +% \expandafter\noexpand\csname setup#2\endcsname +% \expandafter\noexpand\csname everysetup#2\endcsname +% \expandafter\noexpand\csname previous#2\endcsname +% \expandafter\noexpand\csname saved_setup_current#2\endcsname +% \expandafter\noexpand\csname everyswitch#2\endcsname +% \expandafter\noexpand\csname everysetup#2root\endcsname}} + +\protected\def\mult_interfaces_install_switch_setup_handler#1#2#3#4#5#6#7#8#9#A% {\newtoks#5% \newconstant#2% \newtoks#8% \newtoks#9% - \frozen\tolerant\protected\def#4[##1]##*[##2]% maybe helper + \frozen\tolerant\protected\def#4[##S##1]##*[##S##2]% maybe helper {\ifarguments % \setuplayout \let#6#3% % previous becomes current \lettonothing#3% % current becomes empty #2\doingrootsetroot - \the#5% - \the#8% switchsetups + \expand#5% + \expand#8% switchsetups \or \ifhastok={##1}% % \setuplayout[key=value] @@ -527,48 +731,45 @@ \lettonothing#3% #2\doingrootsetuproot \mult_interfaces_get_parameters{#1:}[##1]% - \the#5% - \the#8% switchsetups + \expand#5% + \expand#8% switchsetups \let#3#7% \else % \setuplayout[whatever] \let#6#3% % previous becomes current - \edef#3{##1}% this will catch reset so one needs to test for it + \cdef#3{##1}% this will catch reset so one needs to test for it \ifempty#3% \let#7#6% #2\doingrootsetuproot - \the#5% - \the#8% switchsetups + \expand#5% + \expand#8% switchsetups \let#3#7% \else #2\doingrootsetnamed - \the#5% % we can check for previous vs current - \the#8% switchsetups + \expand#5% % we can check for previous vs current + \expand#8% switchsetups \fi \fi \or % \setuplayout[whatever][key=value] \let#7#3% \let#6#3% - \edef#3{##1}% + \cdef#3{##1}% #2\doingrootsetupnamed \mult_interfaces_get_parameters{#1#3:}[##2]% - \the#5% - \ifx#3#6\the#8\fi % only switchsetups if previous == current + \expand#5% + \ifx#3#6\expand#8\fi % only switchsetups if previous == current \let#3#7% \fi #2\zerocount % mode is always zero at the end - \the#9}} + \expand#9}% + \frozen\protected\def#A{\mult_interfaces_get_parameters{#1#3:}}} \permanent\protected\def\installswitchsetuphandler#1#2% {\mutable\letcsname current#2\endcsname\empty \mutable\letcsname previous#2\endcsname\empty \normalexpanded - {\mult_interfaces_install_switch_setup_handler_a - {\noexpand#1}% \??aa - \expandafter\noexpand\csname current#2\endcsname - \expandafter\noexpand\csname setupcurrent#2\endcsname - \mult_interfaces_install_switch_setup_handler_b + {\mult_interfaces_install_switch_setup_handler {\noexpand#1}% \??aa \expandafter\noexpand\csname #2setupmode\endcsname \expandafter\noexpand\csname current#2\endcsname @@ -577,33 +778,35 @@ \expandafter\noexpand\csname previous#2\endcsname \expandafter\noexpand\csname saved_setup_current#2\endcsname \expandafter\noexpand\csname everyswitch#2\endcsname - \expandafter\noexpand\csname everysetup#2root\endcsname}} + \expandafter\noexpand\csname everysetup#2root\endcsname + \expandafter\noexpand\csname setupcurrent#2\endcsname}} + \protected\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8% {\newtoks#4% \frozen\protected\def#5{\mult_interfaces_get_parameters{#1#3:}}% - \frozen\tolerant\protected\def#2[##1]##*[##2]##*[##3]% + \frozen\tolerant\protected\def#2[##S##1]##*[##S##2]##*[##S##3]% {\let#7#3% \ifarguments \lettonothing#3% - \the#4% + \expand#4% \or \lettonothing#3% \mult_interfaces_get_parameters{#1:}[##1]% - \the#4% + \expand#4% \or \def#8####1% - {\edef#3{####1}% + {\cdef#3{####1}% #6% checks parent and sets if needed \mult_interfaces_get_parameters{#1#3:}[##2]% - \the#4}% + \expand#4}% \processcommalist[##1]#8% \or \def#8####1% - {\edef#3{####1}% - \defcsname#1#3:\s!parent\endcsname{#1##2}% + {\cdef#3{####1}% + \cdefcsname#1#3:\s!parent\endcsname{#1##2}% \mult_interfaces_get_parameters{#1#3:}[##3]% always sets parent - \the#4}% + \expand#4}% \processcommalist[##1]#8% \fi \let#3#7}} @@ -672,7 +875,8 @@ \protected\def\mult_interfaces_install_direct_parameter_handler#1#2#3#4#5% {\frozen\def#3##1{\begincsname#1##1\endcsname}% - \frozen\def#4##1{\detokenize\expandafter\expandafter\expandafter{\csname#1##1\endcsname}}% + %\frozen\def#4##1{\detokenize\expandafter\expandafter\expandafter{\csname#1##1\endcsname}}% + \frozen\def#4##1{\expandafter\detokened\csname#1##1\endcsname}% \frozen\def#5##1{\begincsname#1##1\endcsname}} \permanent\protected\def\installdirectparameterhandler#1#2% @@ -687,8 +891,8 @@ \protected\def\mult_interfaces_install_direct_setup_handler#1#2#3#4% {\newtoks#4% - \frozen\protected\def#2[##1]{\ifarguments\or\mult_interfaces_get_parameters#1[##1]\fi\the#4}% - \frozen\def#3{\mult_interfaces_get_parameters#1}} + \frozen\tolerant\protected\def#2[##S##1]{\mult_interfaces_get_parameters#1[##1]\expand#4}% + \frozen\protected\def#3{\mult_interfaces_get_parameters#1}} \permanent\protected\def\installdirectsetuphandler#1#2% {\normalexpanded @@ -755,19 +959,19 @@ {\immutable\edefcsname\csname#1namespace\endcsname#2:\s!parent\endcsname{\csname#3namespace\endcsname#4}} \permanent\protected\def\relateparameterhandlersbyns#1#2#3#4% {from} {instance} {to} {instance} - {\edefcsname#1#2:\s!parent\endcsname{#3#4}} + {\cdefcsname#1#2:\s!parent\endcsname{#3#4}} %D Here is another experiment: \protected\def\mult_interfaces_install_action_handler#1#2#3% - {\frozen\tolerant\protected\defcsname#1\endcsname[##1]##*[##2]% + {\frozen\tolerant\protected\defcsname#1\endcsname[##S##1]##*[##S##2]% {\begingroup \ifarguments \lettonothing#2% \or %\ifcondition\expandafter\mult_check_for_assignment_indeed_begin_\detokenize{##1}=^^^^0003^^^^0003^^^^0004% % \ifcondition\mult_aux_no_assignment_indeed##1\ignorearguments - % \edef#2{##1}% + % \cdef#2{##1}% % \else % \lettonothing#2% % #3[##1]% @@ -776,10 +980,10 @@ \lettonothing#2% #3[##1]% \else - \edef#2{##1}% + \cdef#2{##1}% \fi \or - \edef#2{##1}% + \cdef#2{##1}% #3[##2]% \fi \directsetup{handler:action:#1}% @@ -821,7 +1025,7 @@ \newinteger\c_mult_interfaces_n_of_namespaces % \def\v_interfaces_prefix_template -% {\number\c_mult_interfaces_n_of_namespaces>} +% {\the\c_mult_interfaces_n_of_namespaces>} \def\v_interfaces_prefix_template {\tohexadecimal\c_mult_interfaces_n_of_namespaces>} @@ -868,13 +1072,21 @@ \edef\mult_interfaces_dummy{\??dummy} % nor immutable -\permanent\protected\def\getdummyparameters[#1% - {\if\noexpand#1]% - \expandafter\gobbleoneargument - \else - \let\m_mult_interfaces_namespace\mult_interfaces_dummy - \expandafter\mult_interfaces_get_parameters_indeed - \fi#1} +% \permanent\protected\def\getdummyparameters[#S#1% +% {\if\noexpand#1]% +% \expandafter\gobbleoneargument +% \else +% \let\m_mult_interfaces_namespace\mult_interfaces_dummy +% \expandafter\mult_interfaces_get_parameters_indeed +% \fi#1} + +% \permanent\protected\def\getdummyparameters[#S#1]% +% {\let\m_mult_interfaces_namespace\mult_interfaces_dummy +% \mult_interfaces_get_parameters_item_okay#1\ignorearguments\ignorearguments} + +\permanent\protected\def\getdummyparameters[#S#1]% + {\let\m_mult_interfaces_namespace\mult_interfaces_dummy + \mult_interfaces_get_parameters_item#1\ignorearguments\ignorearguments} \mult_interfaces_install_style_and_color_handler \directdummyparameter @@ -1023,14 +1235,14 @@ \frozen\protected\def#4##1% {\pushmacro#6% \advanceby#3\plusone - \edef#6{##1}% + \cdef#6{##1}% \unprotect}% \frozen\protected\def#5% {\protect \advanceby#3\minusone \popmacro#6}% \frozen\protected\def#7##1% - {\edef#6{##1}% + {\cdef#6{##1}% #2% \the\c_mult_set\relax}} @@ -1049,7 +1261,7 @@ {\let#5#2% \frozen\protected\def#2% {\ifcase#4\relax\expandafter#5\else\expandafter#6\fi}% - \tolerant\protected\def#6[##1]##*[##2]% + \tolerant\protected\def#6[##S##1]##*[##S##2]% {\ifarguments\or #3\toksapp\c_mult_set{#7[##1]}% \or @@ -1073,7 +1285,7 @@ \protected\def\mult_interfaces_install_parent_injector#1#2#3#4% {\frozen\protected\def#4##1% {\ifempty#3% - \defcsname#1#2:\s!parent\endcsname{#1##1}% + \cdefcsname#1#2:\s!parent\endcsname{#1##1}% was def \fi}} \permanent\protected\def\installparentinjector#1#2% @@ -1085,11 +1297,13 @@ %D Cheaper (assumes grouping at some point): -\permanent\protected\def\mult_interfaces_install_local_current_injector#1#2#3#4% - {\protected\def#4##1% +\permanent\protected\def\mult_interfaces_install_local_current_injector#1#2#3#4#5% + {\lettonothing#4% \currentglobalXXX + \protected\def#5##1% {\advanceby#2\plusone - \edef#3{##1:\the#2}% \currentXXX - \edefcsname#1#3:\s!parent\endcsname{#1##1}}} + \cdef#3{##1:\the#2}% \currentXXX + \cdef#4{##1}% \currentglobalXXX + \cdefcsname#1#3:\s!parent\endcsname{#1##1}}} \permanent\protected\def\installlocalcurrenthandler#1#2% \??XXX {XXX} {\expandafter\newinteger\csname#1:\s!counter\endcsname @@ -1097,6 +1311,7 @@ {\noexpand#1}% \expandafter\noexpand\csname #1:\s!counter\endcsname \expandafter\noexpand\csname current#2\endcsname + \expandafter\noexpand\csname currentglobal#2\endcsname \expandafter\noexpand\csname setlocal#2current\endcsname}} % \unprotect @@ -1158,28 +1373,38 @@ % never knows when we might need it. \installcorenamespace{commalistprocessor} -\installcorenamespace{commalistprocessorwrap} -\installcorenamespace{commalistprocessorfirst} -\installcorenamespace{commalistprocessornext} \installcorenamespace{commalistprocessoraction} -\permanent\protected\def\installcommalistprocessor#1#2% 5 macro names overhead - {\protected\edefcsname\??commalistprocessor#1\endcsname[% - {\csname\??commalistprocessorwrap#1\endcsname\relax}% \relax preserves {} - \protected\edefcsname\??commalistprocessorwrap#1\endcsname##1]% - {\csname\??commalistprocessorfirst#1\endcsname##1,]} - \protected\edefcsname\??commalistprocessorfirst#1\endcsname\relax - {\csname\??commalistprocessornext#1\endcsname}% - \protected\edefcsname\??commalistprocessornext#1\endcsname - {\noexpand\futureexpandis]% - \noexpand\gobbleoneargument - \csname\??commalistprocessoraction#1\endcsname} - \protected\edefcsname\??commalistprocessoraction#1\endcsname##1,% - {\noexpand#2{##1}% - \csname\??commalistprocessornext#1\endcsname}} +% \installcorenamespace{commalistprocessorwrap} +% \installcorenamespace{commalistprocessorfirst} +% \installcorenamespace{commalistprocessornext} +% +% \permanent\protected\def\installcommalistprocessor#1#2% 5 macro names overhead +% {\protected\edefcsname\??commalistprocessor#1\endcsname[% +% {\csname\??commalistprocessorwrap#1\endcsname\relax}% \relax preserves {} +% \protected\edefcsname\??commalistprocessorwrap#1\endcsname##1]% +% {\csname\??commalistprocessorfirst#1\endcsname##S##1,]}% +% \protected\edefcsname\??commalistprocessorfirst#1\endcsname\relax +% {\csname\??commalistprocessornext#1\endcsname}% +% \protected\edefcsname\??commalistprocessornext#1\endcsname +% {\noexpand\futureexpandis]% +% \noexpand\gobbleoneargument +% \csname\??commalistprocessoraction#1\endcsname} +% \protected\edefcsname\??commalistprocessoraction#1\endcsname##1,% +% {\noexpand#2{##1}% +% \csname\??commalistprocessornext#1\endcsname}} + +\permanent\protected\def\installcommalistprocessor#1#2% 2 macro names overhead + {\tolerant\protected\edefcsname\??commalistprocessor#1\endcsname[##S##1]% + {\csname\??commalistprocessoraction#1\endcsname##1\ignorearguments\ignorearguments}% + \tolerant\protected\edefcsname\??commalistprocessoraction#1\endcsname##S##1,% + {\noexpand\ifarguments\noexpand\or + \noexpand#2{##1}% + \noexpand\expandafter\csname\??commalistprocessoraction#1\endcsname + \noexpand\fi}} \permanent\protected\def\installcommalistprocessorcommand#1#2% \processor \action - {\edef\p_name{\csstring#2}% + {\cdef\p_name{\csstring#2}% \installcommalistprocessor\p_name{#2}% \expandafter\let\expandafter#1\csname\??commalistprocessor\p_name\endcsname} @@ -1201,34 +1426,34 @@ \protected\def\mult_interfaces_install_native_auto_setup_handler#1#2#3#4#5#6#7#8% {\newtoks#4% \frozen\protected\def#5{\mult_interfaces_get_parameters{#1#3:}}% - \frozen\tolerant\protected\def#2[##1]##*[##2]##*[##3]% + \frozen\tolerant\protected\def#2[##S##1]##*[##S##2]##*[##S##3]% {\let#7#3% \ifarguments \lettonothing#3% - \the#4% + \expand#4% \or \lettonothing#3% \let\mult_interfaces_adef\mult_interfaces_adef_nop \mult_interfaces_get_parameters{#1:}[##1]% \let\mult_interfaces_adef\mult_interfaces_adef_yes - \the#4% + \expand#4% \or \def#8####1% - {\edef#3{####1}% + {\cdef#3{####1}% #6% checks parent and sets if needed \let\mult_interfaces_adef\mult_interfaces_adef_nop \mult_interfaces_get_parameters{#1#3:}[##2]% \let\mult_interfaces_adef\mult_interfaces_adef_yes - \the#4}% + \expand#4}% \processcommalist[##1]#8% \or \def#8####1% - {\edef#3{####1}% - \defcsname#1#3:\s!parent\endcsname{#1##2}% + {\cdef#3{####1}% + \cdefcsname#1#3:\s!parent\endcsname{#1##2}% \let\mult_interfaces_adef\mult_interfaces_adef_nop \mult_interfaces_get_parameters{#1#3:}[##3]% always sets parent \let\mult_interfaces_adef\mult_interfaces_adef_yes - \the#4}% + \expand#4}% \processcommalist[##1]#8% \fi \let#3#7}} diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt index a58e600592f..73d80c3ca91 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt @@ -17,12 +17,13 @@ local implement = interfaces.implement local allocate = utilities.storage.allocate local mark = utilities.storage.mark ------ prtcatcodes = catcodes.numbers.prtcatcodes -local vrbcatcodes = catcodes.numbers.vrbcatcodes local contextsprint = context.sprint local setmetatableindex = table.setmetatableindex local formatters = string.formatters +----- prtcatcodes = catcodes.numbers.prtcatcodes +local vrbcatcodes = catcodes.numbers.vrbcatcodes + local report_interface = logs.reporter("interface","initialization") interfaces = interfaces or { } @@ -345,9 +346,10 @@ implement { local function showassignerror(namespace,key,line) -- if key and key ~= "" and key ~= "," then - local ns, instance = match(namespace,"^(%d+)[^%a]+(%a*)") + -- local ns, instance = match(namespace,"^(%d+)[^%a]+(%a*)") + local ns, instance = match(namespace,"^(.-)>(%a*)") if ns then - namespace = corenamespaces[tonumber(ns)] or ns + namespace = corenamespaces[tonumber(ns,16)] or ns end -- injected in the stream for timing: if instance and instance ~= "" then diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl index 19370814f76..ec1e15cee69 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl @@ -242,8 +242,11 @@ \endlinechar\minusone \global\read16 to ##1 \egroup - \doifnothing\currentinterface{\let##1=##2}% - \doifundefined{\s!prefix!##1}{\let##1=##2}}% + \ifempty\currentinterface + \let##1=##2% + \orelse\ifcsname\s!prefix!##1\endcsname\else + \let##1=##2 + \fi}% \selectinterface\currentinterface\defaultinterface \writestatus{interface}{defining \currentinterface\space interface}% %\writeline @@ -272,7 +275,13 @@ %D \stoptyping \permanent\protected\def\startinterface #1 - {\doifnot{#1}{all}{\doifnotinset\currentinterface{#1}{\gobbleuntil\stopinterface}}} + {\iftok{#1}{all}% + % okay + \orelse\ifinset\currentinterface{#1}% + % okay + \else + \expandafter\ignoreupto\expandafter\stopinterface + \fi} \aliased\let\stopinterface\relax @@ -722,15 +731,18 @@ \fi} \permanent\protected\def\setinterfacecommand#1#2% \frozen ? \permanent ? - {\doifnot{#1}{#2}% todo: let when already defined - {\defcsname#2\expandafter\endcsname\expandafter{\csname#1\endcsname}}} + {\iftok{#1}{#2}% + % todo: maybe let when already defined + \else + \defcsname#2\expandafter\endcsname\expandafter{\csname#1\endcsname}% + \fi} %D We just ignore these: -\permanent\protected\def\startvariables{\gobbleuntil\stopvariables} \aliased\let\stopvariables\relax -\permanent\protected\def\startconstants{\gobbleuntil\stopconstants} \aliased\let\stopconstants\relax -\permanent\protected\def\startelements {\gobbleuntil\stopelements } \aliased\let\stopelements \relax -\permanent\protected\def\startcommands {\gobbleuntil\stopcommands } \aliased\let\stopcommands \relax +\permanent\protected\def\startvariables{\ignoreupto\stopvariables} \aliased\let\stopvariables\relax +\permanent\protected\def\startconstants{\ignoreupto\stopconstants} \aliased\let\stopconstants\relax +\permanent\protected\def\startelements {\ignoreupto\stopelements } \aliased\let\stopelements \relax +\permanent\protected\def\startcommands {\ignoreupto\stopcommands } \aliased\let\stopcommands \relax %D For at the \LUA\ end (experiment): @@ -752,10 +764,10 @@ %D So much for the basic multi||lingual interface commands. The macro's can be %D enhanced with more testing facilities, but for the moment they suffice. -% use \Uchar +% use \tocharacter -\ifdefined\zwnj \else \immutable\edef\zwnj{\directlua{utf.char(\number"200C)}} \fi % needed for cont-pe % maybe to char-utf.mkiv -\ifdefined\zwj \else \immutable\edef\zwj {\directlua{utf.char(\number"200D)}} \fi % needed for cont-pe % maybe to char-utf.mkiv +\ifdefined\zwnj \else \immutable\edef\zwnj{\tocharacter"200C} \fi % needed for cont-pe % maybe to char-utf.mkiv +\ifdefined\zwj \else \immutable\edef\zwj {\tocharacter"200D} \fi % needed for cont-pe % maybe to char-utf.mkiv %D \macros %D {contextversion, contextversionnumber, contextversionno, diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl index 1c04823493f..60b29125225 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl @@ -40,6 +40,8 @@ }, luatex = { -- todo: differenced between luatex and luametatex + "lastchkinteger", + "ifchkinteger", }, pdftex = { -- maybe not complete "ifpdfabsdim", "ifpdfabsnum", "ifpdfprimitive", "pdfadjustspacing", diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl index b0df8703b98..cfce08ed242 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl @@ -129,6 +129,7 @@ \definesystemconstant {noaxis} \definesystemconstant {exact} \definesystemconstant {a} +\definesystemconstant {base} \definesystemconstant {bf} \definesystemconstant {big} \definesystemconstant {binary} @@ -209,6 +210,7 @@ \definesystemconstant {external} \definesystemconstant {ex} \definesystemconstant {e} +\definesystemconstant {factor} \definesystemconstant {fallbacks} \definesystemconstant {fallback} \definesystemconstant {false} @@ -246,6 +248,7 @@ \definesystemconstant {hfactor} \definesystemconstant {hw} \definesystemconstant {hyphenmin} +\definesystemconstant {implication} \definesystemconstant {indeed} \definesystemconstant {initializations} \definesystemconstant {insert} % maybe insertclass @@ -326,6 +329,7 @@ \definesystemconstant {ordinary} \definesystemconstant {orientation} \definesystemconstant {otr} +\definesystemconstant {overlay} \definesystemconstant {pagefloat} \definesystemconstant {page} \definesystemconstant {paragraph} @@ -432,6 +436,7 @@ \definesystemconstant {userdata} \definesystemconstant {userpage} \definesystemconstant {user} +\definesystemconstant {variant} \definesystemconstant {vfrac} \definesystemconstant {vfactor} \definesystemconstant {white} @@ -625,6 +630,7 @@ \definefileconstant {page_run} {s-layout-show} \definefileconstant {symb_run} {s-symbols-show} \definefileconstant {publ_tra} {s-publications-show} +\definefileconstant {math_run} {s-math-show} %D For figure inclusion we need(ed): diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt index 05de3c85110..31a51079ba9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt @@ -36,26 +36,23 @@ local copy_node = nuts.copy local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes -local glue_code = nodecodes.glue -local glyph_code = nodecodes.glyph -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local glue_code = nodecodes.glue +local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist -local spaceskip_code = gluecodes.spaceskip -local xspaceskip_code = gluecodes.xspaceskip +local spaceskip_code = gluecodes.spaceskip +local xspaceskip_code = gluecodes.xspaceskip -local a_characters = attributes.private("characters") +local a_characters = attributes.private("characters") local nofreplaced = 0 --- todo: nbsp etc --- todo: collapse kerns (not needed, backend does this) --- todo: maybe cache as we now create many nodes --- todo: check for subtype related to spacing (13/14 but most seems to be user anyway) - -local trace = false trackers.register("backend.spaces", function(v) trace = v end) +local trace = false trackers.register("backend.contenttostring", function(v) trace = v end) local slot = nil +-- todo : use getnextglyph + local function injectspaces(head) -- This can become two fast loops or we just move this to the backend where we can -- also check for spaces (it actually is rather old code that relates to tagging @@ -77,7 +74,7 @@ local function injectspaces(head) if a then setattr(g,a_characters,a) end - setattr(n,a_characters,0) + setattr(n,a_characters,0) -- really? better change s into normal nofreplaced = nofreplaced + 1 end end diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt index 5eff779dc24..714c7f595be 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt @@ -6,9 +6,11 @@ if not modules then modules = { } end modules ['node-ali'] = { license = "see context related readme files" } -local setmetatableindex = table.setmetatableindex +local aligncharacter_code = 1 +local mathalign_code = 2 +local mathmatrix_code = 3 -local a_alignchar = attributes.private("aligncharacter") +local setmetatableindex = table.setmetatableindex local nuts = nodes.nuts local tonut = nuts.tonut @@ -24,10 +26,10 @@ local getboth = nuts.getboth local getglue = nuts.getglue local setglue = nuts.setglue local getwhd = nuts.getwhd -local setwhd = nuts.setwhd local setpenalty = nuts.setpenalty local getlist = nuts.getlist local setlist = nuts.setlist +local getleader = nuts.getleader local setattrlist = nuts.setattrlist local setprop = nuts.setprop local getprop = nuts.getprop @@ -61,22 +63,23 @@ local nextlist = traversers.list local nextrule = traversers.rule local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue -local kern_code = nodecodes.kern -local disc_code = nodecodes.disc -local unset_code = nodecodes.unset -local alignrecord_code = nodecodes.alignrecord -local rule_code = nodecodes.rule - -local spaceskip_code = nodes.gluecodes.spaceskip -local xspaceskip_code = nodes.gluecodes.xspaceskip -local intermathskip_code = nodes.gluecodes.intermathskip -local fontkern_code = nodes.kerncodes.fontkern -local row_code = nodes.listcodes.alignment -- should be row -local cell_code = nodes.listcodes.cell -local line_code = nodes.listcodes.line -local linepenalty_code = nodes.penaltycodes.linepanalty +local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue +local kern_code = nodecodes.kern +local disc_code = nodecodes.disc +local unset_code = nodecodes.unset +local alignrecord_code = nodecodes.alignrecord +local rule_code = nodecodes.rule +local temp_code = nodecodes.temp + +local spaceskip_code = nodes.gluecodes.spaceskip +local xspaceskip_code = nodes.gluecodes.xspaceskip +local intermathskip_code = nodes.gluecodes.intermathskip +local fontkern_code = nodes.kerncodes.fontkern +local row_code = nodes.listcodes.alignment -- should be row +local cell_code = nodes.listcodes.cell +local line_code = nodes.listcodes.line +local linepenalty_code = nodes.penaltycodes.linepanalty -- local preamble_pass = tex.alignmentcontextcodes.preamble -- local preroll_pass = tex.alignmentcontextcodes.preroll @@ -84,237 +87,246 @@ local linepenalty_code = nodes.penaltycodes.linepanalty -- todo statistics and tracing -local method = 2 -local unislots = fonts.hashes.unislots -- todo -local chardata = fonts.hashes.characters - -function nodes.handlers.aligncharacter(head,where,attr,preamble) - if where == "preroll" then - local attr = getattr(attr,a_alignchar) -- 1 : value doesn't matter (for now) - if attr then - local widths = { } - local data = { } - local rows = 0 - local cols = 0 - for col in nextrecord, preamble do - cols = cols + 1 - local w, s = getwidth(col,true) - widths[cols] = { col, w, s } - end - -- - for row in nextunset, head do - rows = rows + 1 - local c = 0 - local d = { } - data[rows] = d - for col in nextunset, getlist(row) do - c = c + 1 - if widths[c][2] then - local list = getlist(col) - -- if method == 1 then - -- local left = nil - -- local right = nil - -- local middle = nil - -- for g, char in nextglyph, list do - -- if not left then - -- left = g - -- end - -- if char == getattr(g,a_alignchar) then - -- middle = g - -- end - -- right = g - -- end - -- d[c] = middle and { col, left, middle, right, 0, 0, getwidth(middle) } or false - -- elseif method == 2 then - local middle = nil - -- we can either cache unislots or we can cache for this font - for g, char, font in nextglyph, list do - local unicode = getattr(g,a_alignchar) - if unicode then - if char == unicode then - middle = g - elseif unislots[font][char] == unicode then - middle = g +do + + + local a_alignchar = attributes.private("aligncharacter") + + local method = 2 + local unislots = fonts.hashes.unislots -- todo + local chardata = fonts.hashes.characters + + function nodes.handlers.aligncharacter(head,where,callback,attr,preamble) -- 0x1 + if callback ~= aligncharacter_code then + -- nothing to do here + elseif where == "preroll" then + local attr = getattr(attr,a_alignchar) -- 1 : value doesn't matter (for now) + if attr then + local widths = { } + local data = { } + local rows = 0 + local cols = 0 + for col in nextrecord, preamble do + cols = cols + 1 + local w, s = getwidth(col,true) + widths[cols] = { col, w, s } + end + -- + for row in nextunset, head do + rows = rows + 1 + local c = 0 + local d = { } + data[rows] = d + for col in nextunset, getlist(row) do + c = c + 1 + if widths[c][2] then + local list = getlist(col) + -- if method == 1 then + -- local left = nil + -- local right = nil + -- local middle = nil + -- for g, char in nextglyph, list do + -- if not left then + -- left = g + -- end + -- if char == getattr(g,a_alignchar) then + -- middle = g + -- end + -- right = g + -- end + -- d[c] = middle and { col, left, middle, right, 0, 0, getwidth(middle) } or false + -- elseif method == 2 then + local middle = nil + -- we can either cache unislots or we can cache for this font + for g, char, font in nextglyph, list do + local unicode = getattr(g,a_alignchar) + if unicode then + if char == unicode then + middle = g + elseif unislots[font][char] == unicode then + middle = g + end end end - end - if middle then - local left, right = getwordrange(middle) -- not real gain but handy anyway (less code too) - -- local left = middle - -- local right = middle - -- for g, id, subtype in nextnode, middle do - -- if id == glyph_code or id == disc_code then - -- right = g - -- elseif id == kern_code and subtype == fontkern_code then - -- right = g - -- else - -- break - -- end - -- end - -- for g, id, subtype in prevnode, middle do - -- if id == glyph_code or id == disc_code then - -- left = g - -- elseif id == kern_code and subtype == fontkern_code then - -- left = g - -- else - -- break - -- end - -- end - d[c] = { col, left, middle, right, 0, 0, getwidth(middle) } - else - d[c] = false - end - -- else - -- local middle = nil - -- for g, char in nextglyph, list do - -- if char == getattr(g,a_alignchar) then - -- middle = g - -- end - -- end - -- if middle then - -- local left = list - -- local right = findtail(list) - -- if getid(left) == glue_code then - -- left = getnext(left) - -- end - -- if getid(right) == glue_code then - -- right = getprev(right) - -- end - -- d[c] = { col, left, middle, right, 0, 0, getwidth(middle) } - -- else - -- d[c] = false - -- end - -- end - else - d[c] = false + if middle then + local left, right = getwordrange(middle) -- not real gain but handy anyway (less code too) + -- local left = middle + -- local right = middle + -- for g, id, subtype in nextnode, middle do + -- if id == glyph_code or id == disc_code then + -- right = g + -- elseif id == kern_code and subtype == fontkern_code then + -- right = g + -- else + -- break + -- end + -- end + -- for g, id, subtype in prevnode, middle do + -- if id == glyph_code or id == disc_code then + -- left = g + -- elseif id == kern_code and subtype == fontkern_code then + -- left = g + -- else + -- break + -- end + -- end + d[c] = { col, left, middle, right, 0, 0, getwidth(middle) } + else + d[c] = false + end + -- else + -- local middle = nil + -- for g, char in nextglyph, list do + -- if char == getattr(g,a_alignchar) then + -- middle = g + -- end + -- end + -- if middle then + -- local left = list + -- local right = findtail(list) + -- if getid(left) == glue_code then + -- left = getnext(left) + -- end + -- if getid(right) == glue_code then + -- right = getprev(right) + -- end + -- d[c] = { col, left, middle, right, 0, 0, getwidth(middle) } + -- else + -- d[c] = false + -- end + -- end + else + d[c] = false + end end end - end - -- - for col=1,cols do - local maxl = 0 - local maxr = 0 - local minm = 0 - local maxm = 0 - local colw = widths[col] - for row=1,rows do - local d = data[row][col] - if d then - local p = d[1] - local l = d[2] - local m = d[3] - local r = d[4] - if m then - local lw = l == m and 0 or dimensions(p,l,m) - local rw = m == r and 0 or dimensions(p,getnext(m),getnext(r)) - d[5] = lw - d[6] = rw - if lw > maxl then - maxl = lw - end - if rw > maxr then - maxr = rw - end - local mw = d[7] - if maxm == 0 then - minm = mw - maxm = mw - else - if mw > maxm then - maxm = mw + -- + for col=1,cols do + local maxl = 0 + local maxr = 0 + local minm = 0 + local maxm = 0 + local colw = widths[col] + for row=1,rows do + local d = data[row][col] + if d then + local p = d[1] + local l = d[2] + local m = d[3] + local r = d[4] + if m then + local lw = l == m and 0 or dimensions(p,l,m) + local rw = m == r and 0 or dimensions(p,getnext(m),getnext(r)) + d[5] = lw + d[6] = rw + if lw > maxl then + maxl = lw end - if mw < minm then + if rw > maxr then + maxr = rw + end + local mw = d[7] + if maxm == 0 then minm = mw + maxm = mw + else + if mw > maxm then + maxm = mw + end + if mw < minm then + minm = mw + end end end end end - end - -- - local fixedwidth = colw[3] ~= 0 - -- - local old = colw[2] - local new = old - for row=1,rows do - local d = data[row][col] - if d then - local p = d[1] - local l = d[2] - local m = d[3] - local r = d[4] - if l and m and r then - local lw = d[5] - local rw = d[6] - local mw = d[7] - dl = maxl - lw - dr = maxr - rw - if dl ~= 0 or dr ~= 0 or mw ~= maxm then - local lst = getlist(p) - local wid = getwidth(p) - if dl ~= 0 then - local k = newkern(dl) - lst = insertbefore(lst,l,k) - setattrlist(k,m) + -- + local fixedwidth = colw[3] ~= 0 + -- + local old = colw[2] + local new = old + for row=1,rows do + local d = data[row][col] + if d then + local p = d[1] + local l = d[2] + local m = d[3] + local r = d[4] + if l and m and r then + local lw = d[5] + local rw = d[6] + local mw = d[7] + dl = maxl - lw + dr = maxr - rw + if dl ~= 0 or dr ~= 0 or mw ~= maxm then + local lst = getlist(p) + local wid = getwidth(p) + if dl ~= 0 then + local k = newkern(dl) + lst = insertbefore(lst,l,k) + setattrlist(k,m) + setlist(p,lst) + wid = wid + dl + end + if dr ~= 0 then + local k = newkern(dr) + insertafter(lst,r,k) + setattrlist(k,m) + wid = wid + dr + end + if mw ~= maxm then + local dw = (maxm - mw) + local dx = dw / 2 + addmargins(m,-dx,-dx) + wid = wid + dw + end + setwidth(p,wid) + if wid > new then + new = wid + end setlist(p,lst) - wid = wid + dl - end - if dr ~= 0 then - local k = newkern(dr) - insertafter(lst,r,k) - setattrlist(k,m) - wid = wid + dr - end - if mw ~= maxm then - local dw = (maxm - mw) - local dx = dw / 2 - addmargins(m,-dx,-dx) - wid = wid + dw - end - setwidth(p,wid) - if wid > new then - new = wid - end - setlist(p,lst) - -- somewhat fuzzy: - if fixedwidth then - local l = hpack(h,getwidth(p),"exactly") - setglue(p,getglue(l)) - setlist(l) - flushnode(l) - else - setglue(p) + -- somewhat fuzzy: + if fixedwidth then + local l = hpack(h,getwidth(p),"exactly") + setglue(p,getglue(l)) + setlist(l) + flushnode(l) + else + setglue(p) + end + -- end - -- end end end - end - if new > old then - if fixedwidth then - -- issue overflow warning - else - setwidth(colw[1],new) + if new > old then + if fixedwidth then + -- issue overflow warning + else + setwidth(colw[1],new) + end end end end end end -end -local enabled = false - -interfaces.implement { - name = "enablealignmentcharacter", - -- onlyonce = true, - public = true, - protected = true, - actions = function() - if not enabled then - nodes.tasks.enableaction("alignments", "nodes.handlers.aligncharacter") - enabled = true - end - end, -} + local enabled = false + + interfaces.implement { + name = "enablealignmentcharacter", + -- onlyonce = true, + public = true, + protected = true, + actions = function() + if not enabled then + nodes.tasks.enableaction("alignments", "nodes.handlers.aligncharacter") -- 0x1 + enabled = true + end + end, + } + +end -- This will go to math-ali.lmt @@ -322,7 +334,7 @@ do local getdata = nuts.getdata local removenode = nuts.remove - local getwhd = nuts.getwhd + -- local getwhd = nuts.getwhd local getheight = nuts.getheight local getdepth = nuts.getdepth local setheight = nuts.setheight @@ -331,13 +343,13 @@ do local setoffsets = nuts.setoffsets local setsubtype = nuts.setsubtype - local baselineskip_code = nodes.gluecodes.baselineskip - local lineskip_code = nodes.gluecodes.lineskip + local baselineskip_code = nodes.gluecodes.baselineskip + local lineskip_code = nodes.gluecodes.lineskip - local alignrecord_code = nodecodes.alignrecord - local hlist_code = nodecodes.hlist - local unset_code = nodecodes.unset - -- local rule_code = nodecodes.rule + local alignrecord_code = nodecodes.alignrecord + local hlist_code = nodecodes.hlist + local unset_code = nodecodes.unset + -- local rule_code = nodecodes.rule local nextnode = nuts.traversers.node @@ -346,15 +358,15 @@ do local texgetglue = tex.getglue local texget = tex.get - local leftmarker = tex.boundaries.system("c_math_align_l_marker") - local rightmarker = tex.boundaries.system("c_math_align_r_marker") + local leftmarker = tex.boundaries.system("c_math_align_l_marker") + local rightmarker = tex.boundaries.system("c_math_align_r_marker") - local a_location = attributes.system("mathnumberlocation") - local a_threshold = attributes.system("mathnumberthreshold") + local a_location = attributes.system("mathnumberlocation") + local a_threshold = attributes.system("mathnumberthreshold") - local v_first = interfaces.variables.first - local v_last = interfaces.variables.last - local v_both = interfaces.variables.both + local v_first = interfaces.variables.first + local v_last = interfaces.variables.last + local v_both = interfaces.variables.both -- Here: @@ -377,8 +389,10 @@ do if subtype == baselineskip_code or subtype == lineskip_code then local nextline = currentline + 1 local amount, stretch, shrink = getglue(n) +-- todo: safeguard for no nextline local prevdp = lines[currentline][5] local nextht = lines[nextline][4] +-- todo: add catch for no line here ^^^ local delta = 0 if prevdp < depth then setdepth(lines[currentline][1],depth) @@ -443,7 +457,8 @@ do -- [dummy] [left -2] [second -1] [number 0] -- In the end it makes more sense to just calculate the alignment in lua - -- but it is kind of fun to see how we can control alignments. + -- but it is kind of fun to see how we can control alignments. This code + -- is (in the end) too complex. local totals = { } local widths = { } @@ -455,16 +470,19 @@ do local a_centered = 2 local a_flushright = 3 - local function first_pass(head,attr,preamble) + local a_numberright = 1 + local a_numberleft = 2 + + local function first_pass(head,callback,attr,preamble,signal) -- local width = 0 local hsize = texget("hsize") local count = 0 local overflow = false -totals = { } -- maybe use one table -widths = { } -records = { } -deltas = { } + totals = { } -- maybe use one table + widths = { } + records = { } + deltas = { } for n in nextrecord, preamble do local wd = getwidth(n) count = count + 1 @@ -480,6 +498,7 @@ deltas = { } local lwidth = 0 local rwidth = 0 local centered = false + -- for row in nextunset, head do local count = 0 local anchor = nil @@ -502,26 +521,32 @@ deltas = { } local lc = getattr(n,a_location) if lc then -- todo: just store align in the outer attribute so once ... - local align = lc // 0x10 - local location = lc % 0x10 + -- local align = lc // 0x10 + -- local location = lc % 0x10 + local packed = (lc >> 8) & 0xF + local align = (lc >> 4) & 0xF + local location = (lc ) & 0xF local threshold = getattr(n,a_threshold) - if location == 1 then - -- number right + if location == a_numberright then + -- (more advanced than left) local m = 1 local s = align == a_centered and 2 or 1 --- if align == 1 then if align == a_flushleft then - -- flushleft rwidth = wd --- elseif align == 3 then elseif align == a_flushright then - -- flushright rwidth = wd elseif wd > lwidth then lwidth = wd rwidth = wd centered = true end + +if packed > 0 then + setprop(n,"mathalignshift","right") + lwidth = 0 + rwidth = 0 +end + if totals[count-2] + cellwidths[count-1] + s*wd - s*threshold > hsize then local total = ht + dp setdepth(row,getdepth(row) + total) @@ -533,24 +558,32 @@ deltas = { } end overflow = true end - elseif location == 2 then - -- number left --- if align == 1 then + elseif location == a_numberleft then if align == a_flushleft then - -- flushleft lwidth = wd --- elseif align == 3 then elseif align == a_flushright then - -- flushright lwidth = wd end + if signal == 0x80 then + lwidth = wd + end + +if packed > 0 then + setprop(n,"mathalignshift","left") + lwidth = 0 + rwidth = 0 +end + end - if location == 2 and anchor then + if location == a_numberleft and anchor then local l, l, n = removenode(list,n) if l ~= list then setlist(cell,l) -- setwidth(cell,0) end + if signal == 0x80 then + setwidth(cell,lwidth) + end insertafter(rochan,anchor,n) end end @@ -566,6 +599,7 @@ deltas = { } setwidth(records[rindex-1],deltas[rindex-1]) end end + -- for count=1,#records do if count == lindex then if centered and overflow then @@ -578,7 +612,7 @@ deltas = { } end end - local function second_pass(head,attr,preamble) + local function second_pass(head,callback,attr,preamble,signal) local done = setmetatableindex("table") local glues = { } local okay = false @@ -627,7 +661,7 @@ deltas = { } end end - local function third_pass(head,attr,preamble) + local function third_pass(head,callback,attr,preamble,signal) local inbetween, stretch, shrink = texgetglue("s_strc_math_alignment_inbetween") openup({ inbetween = inbetween }, head) end @@ -636,116 +670,157 @@ deltas = { } -- maybe zero pass: preamble pass - function nodes.handlers.fixmathalign(head,where,attr,preamble) - if where == "preroll" then + function nodes.handlers.mathalignrelocate(head,where,callback,attr,preamble) -- 0x2 + if callback ~= mathalign_code then + -- nothing to do here + elseif where == "preroll" then local signal = getattr(attr,a_location) - if signal == 0x20 or signal == 0x40 then - first_pass(head,attr,preamble) + if signal == 0x20 or signal == 0x40 or signal == 0x80 then + first_pass(head,callback,attr,preamble,signal) end elseif where == "wrapup" then local signal = getattr(attr,a_location) - if signal == 0x40 then - second_pass(head,attr,preamble) + if signal == 0x40 or signal == 0x80 then + second_pass(head,callback,attr,preamble,signal) end - if signal then - third_pass(head,attr,preamble) + if signal then -- also 0x00 + third_pass(head,callback,attr,preamble,signal) end end end - -- - do - local a_mathalignmentvrule = attributes.private("mathalignmentvrule") - local a_mathalignmenthrule = attributes.private("mathalignmenthrule") + local a_mathalignmentvrule = attributes.private("mathalignmentvrule") + local a_mathalignmenthrule = attributes.private("mathalignmenthrule") + local a_mathalignmenttop = attributes.private("mathalignmenttop") + local a_mathalignmentmid = attributes.private("mathalignmentmid") + local a_mathalignmentbot = attributes.private("mathalignmentbot") - -- these loops will be combined - - local dp = { } - local ht = { } - - local function vrule_pass(head,attr,preamble) + local function hrule_pass(head,attr,preamble) local i = 0 for row, id, subtype, list in nextlist, head do if id == hlist_code and subtype == row_code then - i = i + 1 - local prv, nxt = getboth(row) + local height = 0 + local depth = 0 + local done = false for cell, id, subtype, list in nextlist, list do if list then - for n, id, subtype in nextrule, list do - local signal = getattr(n,a_mathalignmentvrule) - if signal then - if prv then - if getid(prv) ~= rule_code or not getattr(prv,a_mathalignmentvrule) then - prv = nil - end - end - if nxt then - if getid(nxt) ~= rule_code or not getattr(nxt,a_mathalignmentvrule) then - nxt = nil + -- look for leaders + for n, id, subtype in nextglue, list do + -- here we can have the attribute on the glue (leader) + -- but more consistent is to have it on the rule + local rule = getleader(n) + if rule then + local signal = getattr(rule,a_mathalignmenthrule) + if signal then + local w, h, d = getwhd(n) + if h and d then + if h > height then + height = h + end + if d > depth then + depth = d + end + done = true end end - local top = not prv and 0 or nil - local bot = not nxt and 0 or nil - setoffsets(n,nil,nil,d and -d or top,h and -h or bot) end end end end + if done then + setheight(row,height) + setdepth(row,depth) + end end end end - local function hrule_pass(head,attr,preamble) - local i = 0 + -- todo : cache + -- maybe : change prev pointer of head (is now temp) + + local function vrule_pass(head,attr,preamble) for row, id, subtype, list in nextlist, head do if id == hlist_code and subtype == row_code then - i = i + 1 - local height = 0 - local depth = 0 - local done = false + local prv, nxt = getboth(row) for cell, id, subtype, list in nextlist, list do if list then - for n, id, subtype in nextglue, list do - local signal = getattr(n,a_mathalignmenthrule) + -- look for vertical rules + local d = false + local h = false + for n, id, subtype in nextrule, list do + local signal = getattr(n,a_mathalignmentvrule) + -- always 1 if signal then - local w, h, d = getwhd(n) - if h and d then - if h > height then - height = h + if not d then + if prv then + if getattr(prv,a_mathalignmentvrule) == 4 then + local p = prv + while p do + local a = getattr(p,a_mathalignmentvrule) + if not a then + break + elseif a == 2 then + if not getprev(p) or getid(getprev(p)) == temp_code then + local h = getattr(p,a_mathalignmenttop) or 0 + nuts.setheight(p,h) + end + break + else + p = getprev(p) + end + end + else + prv = nil + end + -- if getid(prv) ~= rule_code or not getattr(prv,a_mathalignmentvrule) then + -- prv = nil + -- end end - if d > depth then - depth = d + if nxt then + if getattr(nxt,a_mathalignmentvrule) == 2 then + local p = nxt + while p do + local a = getattr(p,a_mathalignmentvrule) + if not a then + break + elseif a == 4 then + if not getnext(p) then + local d = getattr(p,a_mathalignmentbot) or 0 + nuts.setdepth(p,d) + end + break + else + p = getnext(p) + end + end + else + nxt = nil + end + -- if getid(nxt) ~= rule_code or not getattr(nxt,a_mathalignmentvrule) then + -- nxt = nil + -- end end - done = true + d = prv and -getdepth (prv) or 0 + h = nxt and -getheight(nxt) or 0 + d = d - (getattr(prv,a_mathalignmentmid) or 0) end + setoffsets(n,nil,nil,d,h) end end end end - if done then - setheight(row,height) - setdepth(row,depth) - dp[i] = height - ht[i] = depth - end end end end - function nodes.handlers.mathmatrixrules(head,where,attr,preamble) - if where == "wrapup" then - dp = { } - ht = { } - local signal = getattr(attr,a_mathalignmenthrule) - if signal == 0x01 then -- matrix - hrule_pass(head,attr,preamble) - end - local signal = getattr(attr,a_mathalignmentvrule) - if signal == 0x01 then -- matrix - vrule_pass(head,attr,preamble) - end + function nodes.handlers.mathmatrixrules(head,where,callback,attr,preamble) -- 0x3 + if callback ~= mathmatrix_code then + -- nothing to do here + elseif where == "wrapup" then + hrule_pass(head,attr,preamble) + vrule_pass(head,attr,preamble) end end @@ -758,7 +833,7 @@ do protected = true, actions = function() if not enabled then - nodes.tasks.enableaction("alignments", "nodes.handlers.mathmatrixrules") + nodes.tasks.enableaction("alignments","nodes.handlers.mathmatrixrules") -- 0x3 enabled = true end end, @@ -768,14 +843,14 @@ end -- - local a_ornament = attributes.system("mathmatrixornament") + local a_ornament = attributes.system("mathmatrixornament") - local leftornament = tex.boundaries.system("c_math_matrix_ornament_l") - local rightornament = tex.boundaries.system("c_math_matrix_ornament_r") - local topornament = tex.boundaries.system("c_math_matrix_ornament_t") - local bottomornament = tex.boundaries.system("c_math_matrix_ornament_b") + local leftornament = tex.boundaries.system("c_math_matrix_ornament_l") + local rightornament = tex.boundaries.system("c_math_matrix_ornament_r") + local topornament = tex.boundaries.system("c_math_matrix_ornament_t") + local bottomornament = tex.boundaries.system("c_math_matrix_ornament_b") - local verticalline = tex.boundaries.system("c_math_matrix_vl_boundary") + local verticalline = tex.boundaries.system("c_math_matrix_vl_boundary") local left = 0 local right = 0 @@ -787,7 +862,7 @@ end local tops = false local bottoms = false - local function first_pass(head,attr,preamble) + local function first_pass(head,callback,attr,preamble,signal) nofcells = 0 left = 0 right = 0 @@ -860,7 +935,7 @@ end end end - local function second_pass(box) + local function second_pass(box,callback,attr,preamble,signal) if found then local head = getlist(nuts.getbox(box)) local leftmargin = texgetdimen("d_math_matrix_margin_l") @@ -888,17 +963,13 @@ end end end - function nodes.handlers.mathmatrixornaments(head,where,attr,preamble) - if where == "preroll" then - local signal = getattr(attr,a_ornament) - if signal == 0x10 then - first_pass(head,attr,preamble) - end + function nodes.handlers.mathmatrixornaments(head,where,callback,attr,preamble) -- 0x3 + if callback ~= mathmatrix_code then + -- nothing to do here + elseif where == "preroll" then + first_pass(head,callback,attr,preamble,signal) -- elseif where == "wrapup" then - -- local signal = getattr(attr,a_ornament) - -- if signal == 0x10 then - -- second_pass(head,attr,preamble) - -- end + -- second_pass(head,callback,attr,preamble,signal) end end @@ -911,13 +982,13 @@ end local enabled = false interfaces.implement { - name = "enablematrixalign", + name = "enablemathalignrelocate", -- onlyonce = true, public = true, protected = true, actions = function() if not enabled then - nodes.tasks.enableaction("alignments", "nodes.handlers.fixmathalign") + nodes.tasks.enableaction("alignments","nodes.handlers.mathalignrelocate") -- 0x2 enabled = true end end, @@ -932,7 +1003,7 @@ end protected = true, actions = function() if not enabled then - nodes.tasks.enableaction("alignments", "nodes.handlers.mathmatrixornaments") + nodes.tasks.enableaction("alignments","nodes.handlers.mathmatrixornaments") -- 0x3 enabled = true end end, @@ -940,10 +1011,12 @@ end end +-- This only kicks in when we have a callback set. + local report = logs.reporter("alignment","preamble") local trace trackers.register("alignments.showstates",function(v) trace = v end) -function nodes.handlers.showpreamble(head,where,attr,preamble) +function nodes.handlers.showpreamble(head,where,callback,attr,preamble) if trace then local c = 0 for n, id in nextnode, preamble do diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt index 9794d4ab807..94edd67b2b4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt @@ -17,11 +17,11 @@ local utfvalues = utf.values local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local attribute_code = nodecodes.attribute -- temporary -local par_code = nodecodes.par +local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local attribute_code = nodecodes.attribute -- temporary +local par_code = nodecodes.par local nuts = nodes.nuts local tonut = nuts.tonut @@ -58,7 +58,9 @@ local flushlist = nuts.flushlist local hpack_nodes = nuts.hpack local vpack_nodes = nuts.vpack local unsetattribute = nuts.unsetattribute -local firstglyph = nuts.firstglyph +----- firstglyphnode = nuts.firstglyphnode +----- firstglyph = nuts.firstglyph +----- firstchar = nuts.firstchar local copy_node = nuts.copy local find_tail = nuts.tail local getbox = nuts.getbox @@ -69,7 +71,7 @@ local nodepool = nuts.pool local new_glue = nodepool.glue local new_glyph = nodepool.glyph -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue local current_font = font.current @@ -152,70 +154,53 @@ function nodes.repackhlist(list,...) return tonode(list), b end -local function setattributes(head,attr,value) - for n, id in nextnode, head do - setattr(n,attr,value) - if id == hlist_node or id == vlist_node then - setattributes(getlist(n),attr,value) - end - end -end - -local function setunsetattributes(head,attr,value) - for n, id in nextnode, head do - if not getattr(n,attr) then - setattr(n,attr,value) - end - if id == hlist_code or id == vlist_code then - setunsetattributes(getlist(n),attr,value) - end - end -end - -local function unsetattributes(head,attr) - for n, id in nextnode, head do - setattr(n,attr,unsetvalue) - if id == hlist_code or id == vlist_code then - unsetattributes(getlist(n),attr) - end - end -end +-- local function setattributes(head,attr,value) +-- for n, id in nextnode, head do +-- setattr(n,attr,value) +-- if id == hlist_node or id == vlist_node then +-- setattributes(getlist(n),attr,value) +-- end +-- end +-- end -function nuts.firstcharacter(n,untagged) -- tagged == subtype > 255 - if untagged then - return firstglyph(n) - else - for g in nextglyph ,n do - return g - end - end -end +-- local function setunsetattributes(head,attr,value) +-- for n, id in nextnode, head do +-- if not getattr(n,attr) then +-- setattr(n,attr,value) +-- end +-- if id == hlist_code or id == vlist_code then +-- setunsetattributes(getlist(n),attr,value) +-- end +-- end +-- end -local function firstcharinbox(n) - local l = getlist(getbox(n)) - if l then - for g, c in nextglyph, l do - return c - end - end - return 0 -end +-- local function unsetattributes(head,attr) +-- for n, id in nextnode, head do +-- setattr(n,attr,unsetvalue) +-- if id == hlist_code or id == vlist_code then +-- unsetattributes(getlist(n),attr) +-- end +-- end +-- end -nuts .firstcharinbox = firstcharinbox -nodes.firstcharinbox = firstcharinbox -- hm, ok ? -nodes.firstcharacter = vianuts(firstcharacter) - -interfaces.implement { - name = "buildtextaccent", - arguments = "integer", - actions = function(n) -- Is this crap really used? Or was it an experiment? - local char = firstcharinbox(n) - if char > 0 then - -- context.accent(false,char) - context([[\accent%s\relax]],char) - end - end -} +-- function nuts.firstcharacter(n,untagged) -- tagged == subtype > 255 +-- if untagged then +-- return firstchar(n) +-- else +-- return firstglyph(n) +-- end +-- end +-- +-- nodes.firstcharacter = vianuts(firstcharacter) +-- +-- local function firstcharinbox(n,untagged) +-- local l = getlist(getbox(n)) +-- if l then +-- return firstglyphnode(l) +-- end +-- end +-- +-- nuts .firstcharinbox = firstcharinbox -- this depends on fonts, so we have a funny dependency ... will be -- sorted out .. we could make tonodes a plugin into this @@ -370,8 +355,8 @@ end do local parcodes = nodes.parcodes - local hmodepar_code = parcodes.hmodepar - local vmodepar_code = parcodes.vmodepar + local hmodepar_code = parcodes.hmodepar + local vmodepar_code = parcodes.vmodepar local getnest = tex.getnest local getsubtype = nuts.getsubtype diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt index 0982871a349..21e83b79197 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt @@ -20,11 +20,11 @@ local enableaction = nodes.tasks.enableaction local nodecodes = nodes.nodecodes local listcodes = nodes.listcodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist -local alignmentlist_code = listcodes.alignment -local celllist_code = listcodes.cell +local alignmentlist_code = listcodes.alignment +local celllist_code = listcodes.cell local nuts = nodes.nuts local nodepool = nuts.pool @@ -59,17 +59,17 @@ local new_kern = nodepool.kern local new_hlist = nodepool.hlist local privateattributes = attributes.private -local unsetvalue = attributes.unsetvalue local getvalue = attributes.getvalue local hasvalues = attributes.hasvalues local linefillers = nodes.linefillers -local a_background = privateattributes("background") -local a_alignbackground = privateattributes("alignbackground") -local a_linefiller = privateattributes("linefiller") ------ a_ruled = privateattributes("ruled") +local a_background = privateattributes("background") +local a_alignbackground = privateattributes("alignbackground") +local a_linefiller = privateattributes("linefiller") +----- a_ruled = privateattributes("ruled") +local unsetvalue = attributes.unsetvalue local trace_alignment = false local report_alignment = logs.reporter("backgrounds","alignment") diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt index 8870203513e..0f02d3ac2e7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt @@ -128,7 +128,8 @@ end local endofmath = direct.endofmath local findattribute = direct.findattribute -local firstglyph = direct.firstglyph +----- firstglyph = direct.firstglyph +----- firstchar = direct.firstchar function node.endofmath(n) if n then @@ -150,10 +151,15 @@ function node.findattribute(n,a) return nil end -function node.firstglyph(first,last) - local n = firstglyph(todirect(first), last and todirect(last) or nil) - return n and tonode(n) or nil -end +-- function node.firstglyph(first,last) +-- local n = firstglyph(todirect(first), last and todirect(last) or nil) +-- return n and tonode(n) or nil +-- end +-- +-- function node.firstchar(first,last) +-- local n = firstchar(todirect(first), last and todirect(last) or nil) +-- return n and tonode(n) or nil +-- end local dimensions = direct.dimensions local rangedimensions = direct.rangedimensions diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-dir.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-dir.lmt index 5692fddb720..c14f7e95c93 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-dir.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-dir.lmt @@ -10,12 +10,13 @@ local nodes = nodes local nuts = nodes.nuts local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local normaldir_code = nodes.dircodes.normal -local line_code = nodes.listcodes.line -local lefttoright_code = tex.directioncodes.lefttoright +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local normaldir_code = nodes.dircodes.normal +local line_code = nodes.listcodes.line + +local lefttoright_code = tex.directioncodes.lefttoright local getnext = nuts.getnext local getlist = nuts.getlist diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt index de2e8fa5478..9f88c629015 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt @@ -46,11 +46,12 @@ local tonode = nodes.tonode backends = backends or { } local backends = backends -local whatsit_code = nodes.nodecodes.whatsit local whatsitcodes = allocate { } nodes.whatsitcodes = whatsitcodes local lastwhatsit = 0 +local whatsit_code = nodes.nodecodes.whatsit + nodes.subtypes.whatsit = whatsitcodes nodes.subtypes[whatsit_code] = whatsitcodes @@ -500,7 +501,8 @@ do local writenode = registerwhatsitnode("write") local closenode = registerwhatsitnode("close") local channels = { } - local immediate_code = tex.flagcodes.immediate + + local immediate_code = tex.flagcodes.immediate function backends.openout(n) local p = nodeproperties[n] diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt index 88050af8ac8..02e6d55367a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt @@ -41,19 +41,19 @@ local nextcontent = nuts.traversers.content local nodecodes = nodes.nodecodes local rulecodes = nodes.rulecodes -local boxrule_code = rulecodes.box -local imagerule_code = rulecodes.image -local emptyrule_code = rulecodes.empty -local virtualrule_code = rulecodes.virtual +local boxrule_code = rulecodes.box +local imagerule_code = rulecodes.image +local emptyrule_code = rulecodes.empty +local virtualrule_code = rulecodes.virtual -local container_code = nodes.listcodes.container +local container_code = nodes.listcodes.container -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local glue_code = nodecodes.glue -local rule_code = nodecodes.rule -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local glue_code = nodecodes.glue +local rule_code = nodecodes.rule +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist local texlists = tex.lists local texgetnest = tex.getnest @@ -546,7 +546,8 @@ local function stacker(attribute,head,default) -- no inheritance, but list-wise local attrib = default or unsetvalue local check = false local leader = false - for current, id, subtype, content in nextcontent, head do + for n, id, subtype, content in nextcontent, head do + local current = n if id == glyph_code then check = true elseif id == glue_code then @@ -615,7 +616,6 @@ local function stacker(attribute,head,default) -- no inheritance, but list-wise end check = false end - previous = current end if stacked then diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt index c5f9537413e..12ece66361b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt @@ -67,10 +67,10 @@ local nextchar = nuts.traversers.char local flushnode = nuts.flush local removefromlist = nuts.removefromlist -local disc_code = nodecodes.disc -local boundary_code = nodecodes.boundary +local disc_code = nodecodes.disc +local boundary_code = nodecodes.boundary -local wordboundary_code = boundarycodes.word +local wordboundary_code = boundarycodes.word local protectglyphs = nuts.protectglyphs local unprotectglyphs = nuts.unprotectglyphs @@ -646,8 +646,17 @@ do end end + -- local hasglyph = nuts.hasglyph + function handlers.characters(head,groupcode,direction) - -- either next or not, but definitely no already processed list + + -- no gain: + + -- local h = hasglyph(head) + -- if not h then + -- return head + -- end + starttiming(nodes) usedfonts = { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt index 03a4acda8d8..c4eb5fba1d4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt @@ -7,9 +7,9 @@ if not modules then modules = { } end modules ['node-gmc'] = { } local type, tostring = type, tostring +local fastcopy = table.fastcopy local nodes = nodes -local ligature_code = nodes.glyphcodes.ligature local nuts = nodes.nuts local getnext = nuts.getnext @@ -21,10 +21,10 @@ local isglyph = nuts.isglyph local getprop = nuts.getprop local setprop = nuts.setprop -local fastcopy = table.fastcopy - local report_error = logs.reporter("node-aux:error") +local ligature_code = nodes.glyphcodes.ligature + local function setcomponents(base,list) local t = { } local n = 0 diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt index 435f3bf7e17..00a305e7c74 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt @@ -53,18 +53,6 @@ local function simplified(t) return r end --- local noadoptions = allocate { --- set = 0x08, --- unused_1 = 0x00 + 0x08, --- unused_2 = 0x01 + 0x08, --- axis = 0x02 + 0x08, --- no_axis = 0x04 + 0x08, --- exact = 0x10 + 0x08, --- left = 0x11 + 0x08, --- middle = 0x12 + 0x08, --- right = 0x14 + 0x08, --- } - local nodecodes = simplified(node.types()) gluecodes = allocate(swapped(gluecodes,gluecodes)) @@ -217,9 +205,18 @@ nodes.specialskipcodes = { } table.setmetatableindex(listcodes,function(t,k) - -- fully qualified as yet unknown --- local v = mathematics.classnames[k - 0x100] or listcodes.unknown - local v = mathematics.classes[k - 0x100] or mathematics.classnames[k - 0x100] or listcodes.unknown + local v + -- if mathematics then + if type(k) == "string" then + v = mathematics.classes[k] + 0x100 + else + local i = k - 0x100 + v = mathematics.classes[i] or mathematics.classnames[i] + end + -- end + if not v then + v = listcodes.unknown + end t[k] = v return v end) diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl index df2df0f182f..2b8a75c4d27 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl @@ -33,7 +33,7 @@ \registerctxluafile{node-dir}{autosuffix} \registerctxluafile{node-pro}{autosuffix} \registerctxluafile{node-ser}{autosuffix} -\registerctxluafile{node-acc}{autosuffix} % experimental +%registerctxluafile{node-acc}{autosuffix} % now a backend task %registerctxluafile{node-prp}{} % makes no sense (yet) \registerctxluafile{node-scn}{autosuffix} \registerctxluafile{node-scn}{autosuffix} @@ -47,10 +47,10 @@ \permanent\protected\def\shownextnodes{\afterassignment\node_tracers_show_next\c_node_tracers_show_box} \permanent\protected\def\showflatnodes{\afterassignment\node_tracers_show_flat\c_node_tracers_show_box} -\def\node_tracers_show_next{\ctxlua{texio.write_nl('log',nodes.serializebox(\number\c_node_tracers_show_box,false,true))}} -\def\node_tracers_show_flat{\ctxlua{texio.write_nl('log',nodes.serializebox(\number\c_node_tracers_show_box,true, true))}} +\def\node_tracers_show_next{\ctxlua{texio.write_nl('log',nodes.serializebox(\the\c_node_tracers_show_box,false,true))}} +\def\node_tracers_show_flat{\ctxlua{texio.write_nl('log',nodes.serializebox(\the\c_node_tracers_show_box,true, true))}} -\permanent\protected\def\visualizenextnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,false,true)}}} -\permanent\protected\def\visualizeflatnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,true,true)}}} +\permanent\protected\def\visualizenextnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\the\nextbox,false,true)}}} +\permanent\protected\def\visualizeflatnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\the\nextbox,true,true)}}} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt index 3e545478496..38f2624ab71 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt @@ -33,12 +33,12 @@ local count = nuts.count local migrate = nuts.migrate local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local insert_code = nodecodes.ins -local mark_code = nodecodes.mark +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local insert_code = nodecodes.ins +local mark_code = nodecodes.mark -local a_migrated = attributes.private("migrated") +local a_migrated = attributes.private("migrated") local migrate_inserts = false local migrate_marks = false diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt index f17c5ce7a28..d2a5fa55bf5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt @@ -19,9 +19,9 @@ local direct = node.direct local fastcopy = table.fastcopy local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local glyph_code = nodecodes.glyph local tonode = direct.tonode local tonut = direct.todirect @@ -66,7 +66,9 @@ local nuts = { exchange = direct.exchange, findattribute = direct.findattribute, findnode = direct.findnode, + firstglyphnode = direct.firstglyphnode, firstglyph = direct.firstglyph, + firstchar = direct.firstchar, flattendiscretionaries = direct.flattendiscretionaries, flattenleaders = direct.flattenleaders, flush = d_flushnode, @@ -83,6 +85,7 @@ local nuts = { getattrs = direct.getattributes, getboth = d_getboth, getbottom = direct.getbottom, + getbottomdelimiter = direct.getbottomdelimiter, getbox = direct.getbox, getboxglue = direct.getglue, getchar = direct.getchar, @@ -90,6 +93,7 @@ local nuts = { getcharspec = direct.getcharspec, getchoice = direct.getchoice, getclass = direct.getclass, + getcornerkerns = direct.getcornerkerns, getdata = direct.getdata, getdegree = direct.getdegree, getdelimiter = direct.getdelimiter, @@ -139,10 +143,12 @@ local nuts = { getrightdelimiter = direct.getrightdelimiter, getruledata = direct.getdata, -- obsolete when we have the split getruledimensions = direct.getruledimensions, + setruledimensions = direct.setruledimensions, getscale = direct.getscale, getscales = direct.getscales, getscript = direct.getscript, getshift = direct.getshift, + getslant = direct.getslant, getspeciallist = direct.getspeciallist, getstate = direct.getstate, getsub = direct.getsub, @@ -152,11 +158,13 @@ local nuts = { getsuppre = direct.getsuppre, getsurround = direct.getkern, gettop = direct.gettop, + gettopdelimiter = direct.gettopdelimiter, gettotal = direct.gettotal, getusedattributes = direct.getusedattributes, getvalue = direct.getdata, -- obsolete getwhd = direct.getwhd, getwidth = direct.getwidth, + getweight = direct.getweight, getwordrange = direct.getwordrange, getxscale = direct.getxscale, getxyscales = direct.getxyscales, @@ -168,6 +176,7 @@ local nuts = { hasgeometry = direct.hasgeometry, hasglyph = direct.hasglyph, hasglyphoption = direct.hasglyphoption, + hasdiscoption = direct.hasdiscoption, hpack = direct.hpack, hyphenating = direct.hyphenating, ignoremathskip = direct.ignoremathskip, @@ -186,6 +195,9 @@ local nuts = { isnext = direct.isnext, isprev = direct.isprev, isboth = direct.isboth, + issimilarglyph = direct.issimilarglyph, + isitalicglyph = direct.isitalicglyph, + firstitalicglyph = direct.firstitalicglyph, kerning = direct.kerning, lastnode = direct.lastnode, length = direct.length, @@ -197,6 +209,7 @@ local nuts = { naturalwidth = direct.naturalwidth, new = direct.new, newmathglyph = direct.newmathglyph, + newcontinuationatom = direct.newcontinuationatom, patchattributes = direct.patchattributes, prependbeforehead = direct.prependbeforehead, protectglyph = direct.protectglyph, @@ -269,6 +282,7 @@ local nuts = { setscales = direct.setscales, setscript = direct.setscript, setshift = direct.setshift, + setslant = direct.setslant, setspeciallist = direct.setspeciallist, setsplit = direct.setsplit, setstate = direct.setstate, @@ -282,6 +296,7 @@ local nuts = { settop = direct.settop, setwhd = direct.setwhd, setwidth = direct.setwidth, + setweight = direct.setweight, show = direct.show, slide = d_slide, softenhyphens = direct.softenhyphens, @@ -296,6 +311,7 @@ local nuts = { traversecontent = direct.traversecontent, traverseglyph = direct.traverseglyph, traverseid = direct.traverseid, + traverseitalic = direct.traverseitalic, traverseleader = direct.traverseleader, traverselist = direct.traverselist, unprotectglyph = direct.unprotectglyph, diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt index 9ad78bb204b..eea2457a6b6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt @@ -106,7 +106,7 @@ do local setlist = nodes.setlist local getsubtype = nodes.getsubtype - local linelist_code = nodes.listcodes.line + local linelist_code = nodes.listcodes.line local lineactions = tasks.actions("contributers") local adjustactions = tasks.actions("adjusters") @@ -143,9 +143,11 @@ do local actions = tasks.actions("alignments") - function processors.alignment_filter(head,where,attr,preamble) + function processors.alignment_filter(head,where,callback,attr,preamble) -- todo: add timing - actions(head,where,attr,preamble) + if callback then + actions(head,where,callback,attr,preamble) + end end callbacks.register("alignment_filter", processors.alignment_filter, "things done with alignments") diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt index 18bda16e987..80e1830649a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt @@ -42,9 +42,7 @@ local report_reference = logs.reporter("backend","references") local report_destination = logs.reporter("backend","destinations") local report_area = logs.reporter("backend","areas") -local texiscount = tex.iscount local texsetcount = tex.setcount ------ texsetattribute = tex.setattribute local injectreference = backends.nodeinjections.reference local injectdestination = backends.nodeinjections.destination @@ -56,7 +54,7 @@ updaters.register("backends.injections.latebindings",function() prerollreference = backends.codeinjections.prerollreference end) -local c_lastreferenceattribute = texiscount("lastreferenceattribute") +local c_lastreferenceattribute = tex.iscount("lastreferenceattribute") local nuts = nodes.nuts local nodepool = nuts.pool @@ -96,26 +94,25 @@ local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes local listcodes = nodes.listcodes -local directioncodes = tex.directioncodes -local lefttoright_code = directioncodes.lefttoright -local righttoleft_code = directioncodes.righttoleft +local lefttoright_code = tex.directioncodes.lefttoright +local righttoleft_code = tex.directioncodes.righttoleft -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local glue_code = nodecodes.glue -local glyph_code = nodecodes.glyph -local rule_code = nodecodes.rule -local dir_code = nodecodes.dir -local par_code = nodecodes.par +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local glue_code = nodecodes.glue +local glyph_code = nodecodes.glyph +local rule_code = nodecodes.rule +local dir_code = nodecodes.dir +local par_code = nodecodes.par -local leftskip_code = gluecodes.leftskip -local lefthang_code = gluecodes.lefthangskip -local rightskip_code = gluecodes.rightskip -local righthang_code = gluecodes.righthangskip -local parfillleftskip_code = gluecodes.parfillleftskip -local parfillskip_code = gluecodes.parfillskip +local leftskip_code = gluecodes.leftskip +local lefthang_code = gluecodes.lefthangskip +local rightskip_code = gluecodes.rightskip +local righthang_code = gluecodes.righthangskip +local parfillleftskip_code = gluecodes.parfillleftskip +local parfillskip_code = gluecodes.parfillskip ------ linelist_code = listcodes.line +----- linelist_code = listcodes.line local new_rule = nodepool.rule local new_kern = nodepool.kern @@ -141,6 +138,9 @@ local implement = interfaces.implement local inject_areas do + -- This one is sensitive for the fourth argument (ns) so I need to add it as option + -- instead. + local function hlist_dimensions(start,stop,parent) local last = stop and getnext(stop) if parent then @@ -450,7 +450,7 @@ local colorize, justadd do local typesetters = nuts.typesetters if typesetters then local hashes = fonts.hashes - local infofont = fonts.infofont() + local infofont = fonts.infofont(true) -- small local emwidth = hashes.emwidths [infofont] local exheight = hashes.exheights[infofont] if what == "reference" then @@ -537,7 +537,7 @@ do local stack = { } local done = { } - local attribute = attributes.private('reference') + local attribute = attributes.private('reference') local topofstack = 0 nodes.references = { @@ -678,7 +678,7 @@ do local stack = { } local done = { } - local attribute = attributes.private('destination') + local attribute = attributes.private('destination') local topofstack = 0 nodes.destinations = { diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt index b514a3568bf..6632479ba41 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt @@ -26,11 +26,11 @@ local usercodes = nodes.usercodes local nodeproperties = nodes.properties.data -local glyph_code = nodecodes.glyph -local rule_code = nodecodes.rule -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local gluespec_code = nodecodes.gluespec +local glyph_code = nodecodes.glyph +local rule_code = nodecodes.rule +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local gluespec_code = nodecodes.gluespec local currentfont = font.current local texgetcount = tex.getcount @@ -70,11 +70,12 @@ local setwidth = nuts.setwidth local setsubtype = nuts.setsubtype local setleader = nuts.setleader local setclass = nuts.setclass - local setdata = nuts.setdata local setoffsets = nuts.setoffsets local setvalue = nuts.setvalue +local setruledimensions = nuts.setruledimensions + local copy_nut = nuts.copyonly local new_nut = nuts.new local flush_nut = nuts.flush @@ -134,6 +135,7 @@ local disc = register_nut(new_nut(nodecodes.disc)) local kern = register_nut(new_nut(kern_code,kerncodes.userkern)) local fontkern = register_nut(new_nut(kern_code,kerncodes.fontkern)) local italickern = register_nut(new_nut(kern_code,kerncodes.italiccorrection)) +local spacefontkern = register_nut(new_nut(kern_code,kerncodes.spacefontkern)) local penalty = register_nut(new_nut(nodecodes.penalty)) local glue = register_nut(new_nut(glue_code)) local gluespec = register_nut(new_nut(gluespec_code)) @@ -174,7 +176,7 @@ local cleader = register_nut(copy_nut(glue)) setsubtype(cleader,glueco -- the dir field needs to be set otherwise crash: -local lefttoright_code = tex.directioncodes.lefttoright +local lefttoright_code = tex.directioncodes.lefttoright local rule = register_nut(new_nut(rule_code)) -- setdirection(rule, lefttoright_code) local emptyrule = register_nut(new_nut(rule_code,rulecodes.empty)) -- setdirection(rule, lefttoright_code) @@ -245,6 +247,14 @@ function nutpool.italickern(k) return n end +function nutpool.spacefontkern(k) + local n = copy_nut(spacefontkern) + if k and k ~= 0 then + setkern(n,k) + end + return n +end + function nutpool.gluespec(width,stretch,shrink,stretch_order,shrink_order) local n = copy_nut(gluespec) if width or stretch or shrink or stretch_order or shrink_order then @@ -356,6 +366,8 @@ function nutpool.emptyrule(width,height,depth) -- w/h/d == nil will let them ada return n end +-- data left right + function nutpool.strutrule(width,height,depth) -- w/h/d == nil will let them adapt local n = copy_nut(strutrule) if width or height or depth then @@ -399,11 +411,10 @@ function nutpool.boxrule(width,height,depth) -- w/h/d == nil will let them adapt return n end -function nutpool.virtualrule(width,height,depth) -- w/h/d == nil will let them adapt +function nutpool.virtualrule(width,height,depth,data) local n = copy_nut(virtualrule) - if width or height or depth then - setdata(n,width) - setoffsets(n,nil,nil,height,depth) + if width or height or depth or data then + setruledimensions(n,width,height,depth,data) end return n end diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt index 7d638e7cd63..fb5f01d5115 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt @@ -54,6 +54,7 @@ local setfield = nuts.setfield local getruledata = nuts.getruledata local isglyph = nuts.isglyph +local firstglyphnode = nuts.firstglyphnode local flushlist = nuts.flushlist local effectiveglue = nuts.effectiveglue @@ -73,20 +74,20 @@ local rulecodes = nodes.rulecodes local gluecodes = nodes.gluecodes local listcodes = nodes.listcodes -local glyph_code = nodecodes.glyph -local par_code = nodecodes.par -local dir_code = nodecodes.dir -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist +local glyph_code = nodecodes.glyph +local par_code = nodecodes.par +local dir_code = nodecodes.dir +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist -local indentlist_code = listcodes.indent -local linelist_code = listcodes.line +local indentlist_code = listcodes.indent +local linelist_code = listcodes.line -local leftskip_code = gluecodes.leftskip -local rightskip_code = gluecodes.rightskip -local parfillleftskip_code = gluecodes.parfillleftskip -local parfillrightskip_code = gluecodes.parfillrightskip -local indentskip_code = gluecodes.indentskip +local leftskip_code = gluecodes.leftskip +local rightskip_code = gluecodes.rightskip +local parfillleftskip_code = gluecodes.parfillleftskip +local parfillrightskip_code = gluecodes.parfillrightskip +local indentskip_code = gluecodes.indentskip local nodepool = nuts.pool @@ -101,26 +102,26 @@ local n_tosequence = nodes.tosequence local variables = interfaces.variables local implement = interfaces.implement -local privateattributes = attributes.private +local privateattribute = attributes.private -local a_ruled = privateattributes('ruled') -local a_runningtext = privateattributes('runningtext') -local a_color = privateattributes('color') -local a_transparency = privateattributes('transparency') -local a_colormodel = privateattributes('colormodel') -local a_linefiller = privateattributes("linefiller") -local a_viewerlayer = privateattributes("viewerlayer") +local a_ruled = privateattribute('ruled') +local a_runningtext = privateattribute('runningtext') +local a_color = privateattribute('color') +local a_transparency = privateattribute('transparency') +local a_colormodel = privateattribute('colormodel') +local a_linefiller = privateattribute("linefiller") +local a_viewerlayer = privateattribute("viewerlayer") local registervalue = attributes.registervalue local getvalue = attributes.getvalue local texsetattribute = tex.setattribute -local v_both = variables.both -local v_left = variables.left -local v_right = variables.right -local v_local = variables["local"] -local v_yes = variables.yes -local v_foreground = variables.foreground +local v_both = variables.both +local v_left = variables.left +local v_right = variables.right +local v_local = variables["local"] +local v_yes = variables.yes +local v_foreground = variables.foreground local fonthashes = fonts.hashes local fontdata = fonthashes.identifiers @@ -130,7 +131,7 @@ local dimenfactor = fonts.helpers.dimenfactor local splitdimen = number.splitdimen local setmetatableindex = table.setmetatableindex -local runningrule = tex.magicconstants.runningrule +local runningrule = tex.magicconstants.runningrule local striprange = nuts.striprange local processwords = nuts.processwords @@ -190,8 +191,6 @@ do mathaction(n,h,v,"hruleaction") end - local x - local function useraction(n,h,v) local p = properties[n] if p then @@ -225,7 +224,8 @@ do local enabled = false local texgetattribute = tex.getattribute - local unsetvalue = attributes.unsetvalue + + local unsetvalue = attributes.unsetvalue -- The setter is now the performance bottleneck but it is no longer -- limited to a certain number of cases before we cycle resources. @@ -259,20 +259,38 @@ do -- we could check the passed level on the real one ... (no need to pass level) local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but acceptable for this purpose + local max = d.max or 1 local level = d.stack or d.level or 1 - if level > d.max then + if level > max then -- todo: trace message return head end + -- id == glyph_code + -- id == rule_code + -- id == hlist_code and getattr(n,a_runningtext) + -- id == disc_code + -- id == boundary_code local font = nil local char, id = isglyph(f) if char then font = id elseif id == hlist_code then font = getattr(f,a_runningtext) + else + -- rare case: + if id == disc_code then + font = usesfont(f) + end + -- hope for the best + if not font then + local g = firstglyphnode(f,l) + if g then + font = getfont(g) + end + end end if not font then - -- saveguard ... we need to deal with rules and so (math) + -- maybe single rule -- saveguard ... we need to deal with rules and so (math) return head end local r, m @@ -290,15 +308,14 @@ do return head end local wd, ht, dp = getrangedimensions(parent,f,getnext(l)) - local method = d.method + local method = d.method or 0 local empty = d.empty == v_yes - local offset = d.offset - local dy = d.dy + local offset = d.offset or 0 + local dy = d.dy or 0 local order = d.order - local max = d.max local mp = d.mp local rulethickness = d.rulethickness - local unit = d.unit + local unit = d.unit or "ex" local ma = d.ma local ca = d.ca local ta = d.ta @@ -383,10 +400,20 @@ do l = hpack_nodes(l,wd,"exactly") inject(l,wd,ht,dp) else - local hd = (offset+(level-1)*dy)*e - m - local ht = hd + rulethickness - local dp = -hd + rulethickness - inject(setcoloring(new_rule(wd,ht,dp),colorspace,color,transparency),wd,ht,dp) + local rule + if method == 2 then + local height = d.height + local depth = d.depth + if height > ht then ht = height end + if depth > dp then dp = depth end + rule = nodepool.outlinerule(wd,ht,dp,rulethickness) + else + local hd = (offset+(level-1)*dy)*e - m + ht = hd + rulethickness + dp = -hd + rulethickness + rule = new_rule(wd,ht,dp) + end + inject(setcoloring(rule,colorspace,color,transparency),wd,ht,dp) end end return head @@ -397,7 +424,6 @@ do --or-- local data = getvalues(a_ruled) if data then head = processwords(a_ruled,data,flush_ruled,head) - end return head end @@ -424,6 +450,8 @@ do { "empty" }, { "text", "box" }, { "repeat" }, + { "height", "dimension" }, + { "depth", "dimension" }, } } } @@ -434,7 +462,7 @@ do local trace_shifted = false trackers.register("nodes.shifting", function(v) trace_shifted = v end) local report_shifted = logs.reporter("nodes","shifting") - local a_shifted = attributes.private('shifted') + local a_shifted = privateattribute('shifted') local enabled = false local shifts = nodes.shifts or { } @@ -574,7 +602,7 @@ do end end - local function getskips(list) -- this could be a helper + local function getskips(list) -- this could be a helper .. is already one local ls = nil local rs = nil local is = nil @@ -708,24 +736,18 @@ interfaces.implement { { "yoffset", "dimension" }, { "left", "dimension" }, { "right", "dimension" }, + { "on", "dimension" }, + { "off", "dimension" }, }, }, actions = function(t) local n = new_rule( - t.width or runningrule, + t.width or runningrule, t.height or runningrule, - t.depth or runningrule + t.depth or runningrule ) setattrlist(n,true) - setoffsets(n,t.xoffset,t.yoffset) -- ,t.left, t.right - local l = t.left - local r = t.right - if l then - setfield(n,"left",l) - end - if r then - setfield(n,"right",r) - end + setoffsets(n,t.xoffset,t.yoffset,t.left, t.right,t.on,t.off) context(tonode(n)) end } diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl b/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl index 04c0e0dc30a..50275b1fc1c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl @@ -134,34 +134,70 @@ \newinteger\c_node_rules_up \newinteger\c_node_rules_down +% \permanent\protected\def\node_rules_set#1% +% {\cdef\currentbar{#1}% +% \advanceby\c_node_rules_level\plusone +% \usebarstyleandcolor\c!foregroundstyle\c!foregroundcolor +% \edef\p_node_color {\barparameter\c!color}% todo +% \edef\p_node_text {\barparameter\c!text}% +% \edef\p_node_offset{\barparameter\c!offset}% +% % better is a dedicated key: up/down .. todo +% \advanceby\ifdim\p_node_offset\onepoint<\zeropoint\c_node_rules_down\else\c_node_rules_up\fi\plusone +% \clf_setrule +% continue {\barparameter\c!continue}% +% unit {\barparameter\c!unit}% +% order {\barparameter\c!order}% +% level \c_node_rules_level +% stack \ifdim\p_node_offset\onepoint<\zeropoint\c_node_rules_down\else\c_node_rules_up\fi +% rulethickness {\barparameter\c!rulethickness}% +% method \barparameter\c!method +% max \barparameter\c!max\space % number +% mp {\includeMPgraphic{\barparameter\c!mp}} +% ma \c_attr_colormodel +% ca \rawcolorattribute\p_node_color +% ta \rawtransparencyattribute\p_node_color +% offset \p_node_offset\space % number +% dy \barparameter\c!dy\space % number, also fraction +% empty {\barparameter\c!empty}% +% \ifempty\p_node_text\else +% text \hbox{\p_node_text}% +% repeat {\barparameter\c!repeat}% +% \fi +% \relax} + \permanent\protected\def\node_rules_set#1% - {\edef\currentbar{#1}% + {\cdef\currentbar{#1}% \advanceby\c_node_rules_level\plusone \usebarstyleandcolor\c!foregroundstyle\c!foregroundcolor \edef\p_node_color {\barparameter\c!color}% todo - \edef\p_node_text {\barparameter\c!text}% \edef\p_node_offset{\barparameter\c!offset}% % better is a dedicated key: up/down .. todo \advanceby\ifdim\p_node_offset\onepoint<\zeropoint\c_node_rules_down\else\c_node_rules_up\fi\plusone + \scratchcounter\barparameter\c!method\relax \clf_setrule - continue {\barparameter\c!continue}% - unit {\barparameter\c!unit}% - order {\barparameter\c!order}% - level \c_node_rules_level - stack \ifdim\p_node_offset\onepoint<\zeropoint\c_node_rules_down\else\c_node_rules_up\fi - rulethickness {\barparameter\c!rulethickness}% - method \barparameter\c!method - max \barparameter\c!max\space % number - mp {\includeMPgraphic{\barparameter\c!mp}} - ma \c_attr_colormodel - ca \rawcolorattribute\p_node_color - ta \rawtransparencyattribute\p_node_color - offset \p_node_offset\space % number - dy \barparameter\c!dy\space % number, also fraction - empty {\barparameter\c!empty}% - \ifempty\p_node_text\else - text \hbox{\p_node_text}% - repeat {\barparameter\c!repeat}% + method \scratchcounter + continue {\barparameter\c!continue}% + rulethickness {\barparameter\c!rulethickness}% + mp {\includeMPgraphic{\barparameter\c!mp}} + ma \c_attr_colormodel + ca \rawcolorattribute\p_node_color + ta \rawtransparencyattribute\p_node_color + order {\barparameter\c!order}% + \ifnum\scratchcounter=\plustwo + height \dimexpr\barparameter\c!height\relax + depth \dimexpr\barparameter\c!depth\relax + \else + unit {\barparameter\c!unit}% + level \c_node_rules_level + stack \ifdim\p_node_offset\onepoint<\zeropoint\c_node_rules_down\else\c_node_rules_up\fi + max \barparameter\c!max\space % number + offset \p_node_offset\space % number + dy \barparameter\c!dy\space % number, also fraction + empty {\barparameter\c!empty}% + \ifempty{\barparameter\c!text}\else + text \hbox{\lastnamedcs}% + repeat {\barparameter\c!repeat}% + \fi \fi \relax} @@ -193,15 +229,17 @@ \permanent\protected\def\pushbar[#1]% {\global\advanceby\c_node_rules_nesting\plusone - \edefcsname\??barstack\number\c_node_rules_nesting\endcsname + \edefcsname\??barstack\the\c_node_rules_nesting\endcsname {\c_node_rules_level\the\c_node_rules_level \c_attr_ruled \the\c_attr_ruled}% \node_rules_set{#1}} \permanent\protected\def\popbar - {\csname\??barstack\number\c_node_rules_nesting\endcsname\relax + {\csname\??barstack\the\c_node_rules_nesting\endcsname\relax \global\advanceby\c_node_rules_nesting\minusone} +% we can save some by havign defaults at the lua end + \setupbars [\c!method=0, % new: 0=center nested, 1=stack nested \c!continue=\v!no, @@ -213,6 +251,8 @@ \c!style=, \c!rulethickness=.1, \c!order=\v!foreground, + \c!height=\zeropoint, + \c!depth=\zeropoint, \c!unit=ex, % so now we are relative \c!color=] % replaces: rulecolor @@ -252,6 +292,21 @@ \c!left=\zwj, \c!right=\zwj] +\definebar + [\v!outline] + [\c!method=2, + \c!offset=0, + \c!rulethickness=0.25, + \c!continue=\v!yes, + \c!order=\v!background, + \c!color=lightgray] + +\definebar + [\v!outlined] + [\v!outline] + [\c!height=\strutht, + \c!depth=\strutdp] + % \setupbar[\v!overstrike][continue=all] % we want these always so ... @@ -366,7 +421,7 @@ \to \everydefineshift \protected\def\node_shifts_set#1% todo: check parent ! todo: move attr etc to lua - {\def\currentshift{#1}% + {\cdef\currentshift{#1}% \useshiftstyleandcolor\c!style\c!color \dosetupisolatedalign{\shiftparameter\c!align}% a weird feature that i probably needed once \clf_setshift @@ -437,7 +492,7 @@ \aliased\let\setuplinefillers\setuplinefiller \protected\def\node_linefiller_set#1% todo: check parent ! todo: move attr etc to lua - {\def\currentlinefiller{#1}% + {\cdef\currentlinefiller{#1}% \edef\p_node_color{\linefillerparameter\c!color}% \clf_setlinefiller %method \linefillerparameter\c!method @@ -454,10 +509,10 @@ rulethickness \dimexpr\linefillerparameter\c!rulethickness\relax \relax} -\permanent\tolerant\protected\def\startlinefiller[#1]#*[#2]% +\permanent\tolerant\protected\def\startlinefiller[#1]#*[#S#2]% {\begingroup \par - \def\currentlinefiller{#1}% + \cdef\currentlinefiller{#1}% \ifparameter#2\or % we need to update settings \setuplinefiller[#1][#2]% no \setupcurrentlinefiller as we need to update settings diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt index 1530174c22a..cd184000ea9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt @@ -25,35 +25,32 @@ local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes local kerncodes = nodes.kerncodes -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local rule_code = nodecodes.rule -local boundary_code = nodecodes.boundary -local dir_code = nodecodes.dir -local math_code = nodecodes.math -local glue_code = nodecodes.glue -local penalty_code = nodecodes.penalty -local kern_code = nodecodes.kern -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local rule_code = nodecodes.rule +local boundary_code = nodecodes.boundary +local dir_code = nodecodes.dir +local math_code = nodecodes.math +local glue_code = nodecodes.glue +local penalty_code = nodecodes.penalty +local kern_code = nodecodes.kern +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist -local userskip_code = gluecodes.userskip -local spaceskip_code = gluecodes.spaceskip -local xspaceskip_code = gluecodes.xspaceskip -local leaders_code = gluecodes.leaders -local rightfillskip_code = gluecodes.rightparfillskip -local righthangskip_code = gluecodes.righthangskip +local userskip_code = gluecodes.userskip +local spaceskip_code = gluecodes.spaceskip +local xspaceskip_code = gluecodes.xspaceskip +local intermathkip_code = gluecodes.intermathskip +local leaders_code = gluecodes.leaders +local rightfillskip_code = gluecodes.rightparfillskip +local righthangskip_code = gluecodes.righthangskip -local fontkern_code = kerncodes.fontkern +local fontkern_code = kerncodes.fontkern -local variables = interfaces.variables +local a_runningtext = attributes.private('runningtext') -local privateattributes = attributes.private - -local a_runningtext = privateattributes('runningtext') - -local v_yes = variables.yes -local v_all = variables.all +local v_yes = interfaces.variables.yes +local v_all = interfaces.variables.all local function striprange(first,last) -- todo: dir if first and last then -- just to be sure @@ -125,10 +122,10 @@ local function processwords(nesting,attribute,data,flush,head,parent,skip) -- we while n do local id = getid(n) if id == glyph_code - or id == rule_code - or (id == hlist_code and getattr(n,a_runningtext)) - or id == disc_code - or id == boundary_code + or id == disc_code -- can indeed be a start + or id == rule_code -- can be a strut + or id == boundary_code -- can be between quote and text + or (id == hlist_code and getattr(n,a_runningtext)) -- well ... then local aa = getattr(n,attribute) -- new approach @@ -252,7 +249,7 @@ local function processwords(nesting,attribute,data,flush,head,parent,skip) -- we elseif id == glue_code then -- catch \underbar{a} \underbar{a} (subtype test is needed) local subtype = getsubtype(n) - if getattr(n,attribute) and (subtype == userskip_code or subtype == spaceskip_code or subtype == xspaceskip_code or (leaders and subtype >= leaders_code)) then + if getattr(n,attribute) and (subtype == userskip_code or subtype == spaceskip_code or subtype == xspaceskip_code or subtype == intermathkip_code or (leaders and subtype >= leaders_code)) then l = n else head = flush(head,f,l,d,level,parent,strip) diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt index e45d7f2497a..4b5ebd6635b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt @@ -24,8 +24,8 @@ local subtypes = nodes.subtypes local tonode = nodes.tonode local tonut = nodes.tonut -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist local f_char = formatters["%U"] local f_attr = formatters[""] diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt index fc149330be6..ca25ef9058b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt @@ -16,8 +16,8 @@ local tasks = nodes.tasks local handlers = nodes.handlers local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist local nuts = nodes.nuts local tonut = nuts.tonut @@ -28,7 +28,7 @@ local getbox = nuts.getbox local implement = interfaces.implement -local v_yes = interfaces.variables.yes +local v_yes = interfaces.variables.yes local actions = tasks.actions("shipouts") @@ -49,11 +49,14 @@ do local report = logs.reporter("shipout") - local trace = false trackers.register("backend.cleanup", function(v) trace = v end) - + local trace = false local flatten = true -- also done as line option local soften = true -- true by default + trackers .register("backend.cleanup", function(v) trace = v end) + directives.register("backend.cleanup.flatten", function(v) flatten = v end) + directives.register("backend.cleanup.soften", function(v) soften = v end) + nodes.handlers.cleanuppage = function(head) -- local count = 0 local found = 0 @@ -161,7 +164,8 @@ end) do -- for the moment: local whatsitcodes = nodes.whatsitcodes - local whatsit_code = nodecodes.whatsit + + local whatsit_code = nodecodes.whatsit local removables = { [whatsitcodes.open] = true, diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt index fe607bac8b9..bd7377b1088 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt @@ -150,14 +150,14 @@ local kerncodes = nodes.kerncodes local nextnode = nuts.traversers.node -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local glue_code = nodecodes.glue -local penalty_code = nodecodes.penalty -local kern_code = nodecodes.kern -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local fontkern_code = kerncodes.fontkern +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local glue_code = nodecodes.glue +local penalty_code = nodecodes.penalty +local kern_code = nodecodes.kern +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local fontkern_code = kerncodes.fontkern local insertbefore = nuts.insertbefore local insertafter = nuts.insertafter @@ -165,6 +165,7 @@ local insertafter = nuts.insertafter local nodepool = nuts.pool local new_latelua = nodepool.latelua local new_rule = nodepool.rule +local new_outline_rule = nodepool.outlinerule local new_kern = nodepool.kern local getdimensions = nuts.dimensions @@ -450,13 +451,14 @@ end -- color is already handled so no colors -local collect = nil -local fulltrace = false -local trace = false -local height = 10 * 65536 -local depth = 5 * 65536 -local traceheight = 32768 -local tracedepth = 32768 +local collect = nil +local fulltrace = false +local trace = false +local height = 10 * 65536 +local depth = 5 * 65536 +local traceheight = 32768 +local tracedepth = 32768 +local outlinewidth = 65536 / 4 trackers.register("system.synctex.visualize", function(v) trace = v @@ -472,7 +474,11 @@ local function inject(head,first,last,tag,line) d = depth end if trace then - head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth)) + if fulltrace then + head = insertbefore(head,first,new_outline_rule(w,h,d,outlinewidth)) + else + head = insertbefore(head,first,new_rule(w,traceheight,tracedepth)) + end head = insertbefore(head,first,new_kern(-w)) end head = x_hlist(head,first,tag,line,w,h,d) @@ -539,7 +545,11 @@ local function inject(parent,head,first,last,tag,line) d = depth end if trace then - head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth)) + if fulltrace then + head = insertbefore(head,first,new_outline_rule(w,h,d,outlinewidth)) + else + head = insertbefore(head,first,new_rule(w,traceheight,tracedepth)) + end head = insertbefore(head,first,new_kern(-w)) end head = x_hlist(head,first,tag,line,w,h,d) diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt index 4aa476ce540..d4efb269260 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt @@ -69,16 +69,16 @@ local fillcodes = tex.fillcodes local subtypes = nodes.subtypes -local glyph_code = nodecodes.glyph -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local disc_code = nodecodes.disc -local glue_code = nodecodes.glue -local kern_code = nodecodes.kern -local rule_code = nodecodes.rule -local dir_code = nodecodes.dir -local par_code = nodecodes.par -local whatsit_code = nodecodes.whatsit +local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local disc_code = nodecodes.disc +local glue_code = nodecodes.glue +local kern_code = nodecodes.kern +local rule_code = nodecodes.rule +local dir_code = nodecodes.dir +local par_code = nodecodes.par +local whatsit_code = nodecodes.whatsit local dimenfactors = number.dimenfactors local formatters = string.formatters @@ -383,9 +383,10 @@ end nodes.showboxes = showboxes -local ptfactor = dimenfactors.pt -local bpfactor = dimenfactors.bp -local stripper = lpeg.patterns.stripzeros +local stripper = lpeg.patterns.stripzeros + +local ptfactor = dimenfactors.pt +local bpfactor = dimenfactors.bp local f_f_f = formatters["%0.5Fpt plus %0.5F%s minus %0.5F%s"] local f_f_m = formatters["%0.5Fpt plus %0.5F%s minus %0.5Fpt"] @@ -560,10 +561,11 @@ nodes.nopts = function(n) return format("%.5f",n*ptfactor) end local colors = { } tracers.colors = colors -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue + +local a_color = attributes.private('color') +local a_colormodel = attributes.private('colormodel') -local a_color = attributes.private('color') -local a_colormodel = attributes.private('colormodel') local m_color = attributes.list[a_color] or { } function colors.set(n,c,s,t) -- also unsets ! @@ -618,7 +620,7 @@ end local transparencies = { } tracers.transparencies = transparencies -local a_transparency = attributes.private('transparency') +local a_transparency = attributes.private('transparency') local m_transparency = attributes.list[a_transparency] or { } function transparencies.set(n,t) diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt index edc435836ce..312903bc38a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt @@ -370,7 +370,7 @@ local tonode = nodes.nuts.tonode %localize% -return function(head,where,attr,preamble) +return function(head,where,callback,attr,preamble) local nuthead = tonut(head) local nutattr = tonut(attr) local nutpreamble = tonut(preamble) @@ -380,19 +380,19 @@ end ]], step = [[ - %action%(head,where,attr,preamble) + %action%(head,where,callback,attr,preamble) ]], nut = [[ - %action%(nuthead,where,nutattr,nutpreamble) + %action%(nuthead,where,callback,nutattr,nutpreamble) ]], nohead = [[ - %action%(head,where,attr,preamble) + %action%(head,where,callback,attr,preamble) ]], nonut = [[ - %action%(nuthead,where,nutattr,nutpreamble) + %action%(nuthead,where,callback,nutattr,nutpreamble) ]], } diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt index c28086f8146..56bcde8af37 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt @@ -12,13 +12,13 @@ local chardata = characters.data local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes -local glue_code = nodecodes.glue -local penalty_code = nodecodes.penalty -local kern_code = nodecodes.kern -local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue +local penalty_code = nodecodes.penalty +local kern_code = nodecodes.kern +local glyph_code = nodecodes.glyph -local abovedisplayshortskip_code = gluecodes.abovedisplayshortskip -local belowdisplayshortskip_code = gluecodes.belowdisplayshortskip +local abovedisplayshortskip_code = gluecodes.abovedisplayshortskip +local belowdisplayshortskip_code = gluecodes.belowdisplayshortskip local nuts = nodes.nuts diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-bar.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-bar.mkxl index c6a11153165..b36b56cf220 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-bar.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-bar.mkxl @@ -51,7 +51,7 @@ \c!height=\strutheight, \c!depth=\strutdepth] -\permanent\protected\def\horizontalpositionbar[#1]% +\permanent\protected\def\horizontalpositionbar[#S#1]% {\hbox to \hsize {\setuppositionbar[#1]% \usepositionbarstyleandcolor\c!style\c!color @@ -61,7 +61,7 @@ \hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill \hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} -\permanent\protected\def\verticalpositionbar[#1]% +\permanent\protected\def\verticalpositionbar[#S#1]% {\vbox to \vsize {\hsize\positionbarparameter\c!width \setuppositionbar[#1]% @@ -72,7 +72,7 @@ \vskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill \vskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} -\permanent\protected\def\horizontalgrowingbar[#1]% +\permanent\protected\def\horizontalgrowingbar[#S#1]% {\hpack to \hsize {\setuppositionbar[#1]% \usepositionbarstyleandcolor\c!style\c!color @@ -81,7 +81,7 @@ \hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill \hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} -\permanent\protected\def\verticalgrowingbar[#1]% +\permanent\protected\def\verticalgrowingbar[#S#1]% {\vpack to \vsize {\hsize\positionbarparameter\c!width \setuppositionbar[#1]% diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx b/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx index e754c24514a..051d08f1eff 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx @@ -65,20 +65,22 @@ \setnewconstant\backgroundsplitmode\plusthree \appendtoks - \frozen\setuevalue{\e!start\currentbackground}{\pack_backgrounds_start [\currentbackground]}% - \frozen\setuevalue{\e!stop \currentbackground}{\pack_backgrounds_stop }% - \frozen\setuevalue {\currentbackground}{\pack_backgrounds_direct[\currentbackground]}% + \frozen\protected\instance\defcsname\e!start\currentbackground\endcsname{\pack_backgrounds_start [\currentbackground]}% + \frozen\protected\instance\defcsname\e!stop \currentbackground\endcsname{\pack_backgrounds_stop }% + \frozen\protected\instance\defcsname \currentbackground\endcsname{\pack_backgrounds_direct[\currentbackground]}% \to \everydefinebackground \protected\def\pack_backgrounds_start[#tag]% {\endgraf \begingroup - \def\currentbackground{#tag}% - \doifelse{\backgroundparameter\c!state}\v!start - \pack_backgrounds_start_indeed - \pack_backgrounds_start_ignore} + \cdef\currentbackground{#tag}% + \ifcstok{\backgroundparameter\c!state}\v!start + \expandafter\pack_backgrounds_start_indeed + \else + \expandafter\pack_backgrounds_start_ignore + \fi} -\tolerant\def\pack_backgrounds_start_indeed[#settings]% +\tolerant\def\pack_backgrounds_start_indeed[#S#settings]% {\setupcurrentbackground[#settings,\c!state=\v!start,\c!offset=\v!overlay]% \let\pack_backgrounds_stop\pack_backgrounds_stop_indeed \setbox\scratchboxone\vbox\bgroup @@ -89,7 +91,7 @@ \leftskip \backgroundparameter\c!leftoffset \rightskip\backgroundparameter\c!rightoffset} -\tolerant\def\pack_backgrounds_start_ignore[#settings]% +\tolerant\def\pack_backgrounds_start_ignore[#S#settings]% {\let\pack_backgrounds_stop\pack_backgrounds_stop_ignore} \let\pack_backgrounds_stop\relax @@ -182,10 +184,12 @@ \protected\def\pack_backgrounds_direct[#tag]% {\begingroup - \def\currentbackground{#tag}% - \doifelse{\backgroundparameter\c!state}\c!start - \pack_backgrounds_direct_indeed - \pack_backgrounds_direct_ignore} + \cdef\currentbackground{#tag}% + \ifcstok{\backgroundparameter\c!state}\c!start + \expandafter\pack_backgrounds_direct_indeed + \else + \expandafter\pack_backgrounds_direct_ignore + \fi} \def\pack_backgrounds_direct_indeed {\dowithnextboxcs\pack_backgrounds_direct_finish\vbox} diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl index ea270f88b79..0d1816adfe5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl @@ -53,13 +53,13 @@ \mutable\lettonothing\currentanchor -\permanent\tolerant\protected\def\defineanchor[#1]#*[#2]#*[#3]#*[#4]% name targetlayer layersetting framedsetting +\permanent\tolerant\protected\def\defineanchor[#1]#*[#2]#*[#S#3]#*[#S#4]% name targetlayer layersetting framedsetting {\defcsname\??anchor#1\endcsname{\pack_anchors_process_defined{#2}{#3}{#4}}} \let\pack_anchors_process_defined_indeed\gobbletwooptionals \def\pack_anchors_process_defined#1#2#3% brrr - {\tolerant\def\pack_anchors_process_defined_indeed[##1]##*[##2]% + {\tolerant\def\pack_anchors_process_defined_indeed[##S##1]##*[##S##2]% {\ifarguments \def\next{\pack_anchors_process_indeed{#1}{#2}{#3}}% \or @@ -104,12 +104,12 @@ \protected\def\pack_anchors_register#1#2% {\global\advanceby\c_pack_anchors_n\plusone - \pagereference[\v!layer:\v!anchor:\number\c_pack_anchors_n]% - \putboxincache\v!anchor{\number\c_pack_anchors_n}\b_pack_anchors -% \xtoksapp\t_pack_anchors_flush{\pack_anchors_flush{\number\c_pack_anchors_n}{#1}{#2}}% - \doglobal\appendetoks - \pack_anchors_flush{\number\c_pack_anchors_n}{#1}{#2}% - \to \t_pack_anchors_flush + \pagereference[\v!layer:\v!anchor:\the\c_pack_anchors_n]% + \putboxincache\v!anchor{\the\c_pack_anchors_n}\b_pack_anchors + \xtoksapp\t_pack_anchors_flush{\pack_anchors_flush{\the\c_pack_anchors_n}{#1}{#2}}% + % \doglobal\appendetoks + % \pack_anchors_flush{\the\c_pack_anchors_n}{#1}{#2}% + % \to \t_pack_anchors_flush \glet\pack_anchors_flush_all\pack_anchors_flush_all_indeed} \protected\def\pack_anchors_flush#1#2#3% @@ -125,7 +125,7 @@ \protected\def\pack_anchors_flush_all_indeed {\donefalse - \the\t_pack_anchors_flush + \expand\t_pack_anchors_flush \ifdone\else \global\t_pack_anchors_flush\emptytoks \glet\pack_anchors_flush_all\relax @@ -152,7 +152,7 @@ % \setlayeranchored[text-1][preset=lefttop]{HELLO WORLD} produces a simple (empty) hbox % synchronizes per page -\permanent\tolerant\protected\def\setlayeranchored[#1]#*[#2]% +\permanent\tolerant\protected\def\setlayeranchored[#1]#*[#S#2]% {\begingroup \ifarguments \dowithnextbox @@ -202,10 +202,10 @@ \def\pack_boxes_collector_check_box#1% {\edef\currentcollector{#1}% \ifcsname\??collectorbox\currentcollector\endcsname - \settrue\c_pack_boxes_collector_valid_box + \c_pack_boxes_collector_valid_box\conditionaltrue \expandafter\let\expandafter\b_pack_boxes_collector\lastnamedcs \else - \setfalse\c_pack_boxes_collector_valid_box + \c_pack_boxes_collector_valid_box\conditionalfalse \writestatus{collector}{unknown collector \currentcollector}% \fi} @@ -324,7 +324,7 @@ \permanent\protected\def\composedcollector#1% no [], handy as argument {\flushcollector[#1]} -\permanent\tolerant\protected\def\adaptcollector[#1]#*[#2]% % a typical case where \global\wd looks better in the code +\permanent\tolerant\protected\def\adaptcollector[#1]#*[#S#2]% % a typical case where \global\wd looks better in the code {\begingroup \pack_boxes_collector_check_box{#1}% \ifconditional\c_pack_boxes_collector_valid_box @@ -348,10 +348,10 @@ \definecollector [caption] -\permanent\tolerant\protected\def\collectedtext[#1]#*[#2]% for captions +\permanent\tolerant\protected\def\collectedtext[#1]#*[#S#2]% for captions {\pack_boxes_collector_text[#1][#2]} -\def\pack_boxes_collector_text[#1][#2]#3% #3 is mandate so no tolerant here, so still two step +\def\pack_boxes_collector_text[#1][#S#2]#3% #3 is mandate so no tolerant here, so still two step {\bgroup \dowithnextbox {\setcollector @@ -419,7 +419,7 @@ \c!foregroundcolor=\layeredtextparameter\c!color, \c!foregroundstyle=\layeredtextparameter\c!style] -\permanent\tolerant\protected\def\placelayeredtext[#1]#*[#2]#*[#3]#4% tag layersettings content(framed)settings content +\permanent\tolerant\protected\def\placelayeredtext[#1]#*[#S#2]#*[#S#3]#4% tag layersettings content(framed)settings content {\bgroup \edef\currentlayeredtext{#1}% \checklayeredtextparent % bonus @@ -431,7 +431,7 @@ \setlayer [\??layeredtextlayer]% [#2]% - {\setfalse\fontattributeisset + {\fontattributeisset\conditionalfalse \uselayeredtextstyleparameter\c!style \ifconditional\fontattributeisset \setupinterlinespace @@ -463,15 +463,16 @@ % {gans} % {\externalfigure[koe][width=3cm]} -\permanent\tolerant\protected\def\ornamenttext[#1]#*[#2]% takes another argument +\permanent\tolerant\protected\def\ornamenttext[#1]#*[#S#2]% takes another argument {\bgroup \doifelseassignment{#1}% {\letdummyparameter\c!alternative\v!a \getdummyparameters[#1]% - \doifelse{\directdummyparameter\c!alternative}\v!a - {\egroup\collectedtext}% - {\egroup\layeredtext }% - [#1][#2]}% + \ifcstok{\directdummyparameter\c!alternative}\v!a + \egroup\expandafter\collectedtext + \else + \egroup\expandafter\layeredtext + \fi[#1][#2]}% {\egroup\csname#1\endcsname}} \permanent\tolerant\protected\def\defineornament[#1]#*[#2]#*[#3]% @@ -535,18 +536,18 @@ \installcorenamespace{bleedinglocation} -\defcsname\??bleedinglocation t\endcsname{\settrue\c_pack_boxes_t\scratchhoffset\zeropoint} -\defcsname\??bleedinglocation b\endcsname{\settrue\c_pack_boxes_b\scratchhoffset\zeropoint} -\defcsname\??bleedinglocation l\endcsname{\settrue\c_pack_boxes_l\scratchvoffset\zeropoint} -\defcsname\??bleedinglocation r\endcsname{\settrue\c_pack_boxes_r\scratchvoffset\zeropoint} -\defcsname\??bleedinglocation bl\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_b} -\defcsname\??bleedinglocation lb\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_b} -\defcsname\??bleedinglocation br\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_b} -\defcsname\??bleedinglocation rb\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_b} -\defcsname\??bleedinglocation tl\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_t} -\defcsname\??bleedinglocation lt\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_t} -\defcsname\??bleedinglocation tr\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_t} -\defcsname\??bleedinglocation rt\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_t} +\defcsname\??bleedinglocation t\endcsname{\c_pack_boxes_t\conditionaltrue\scratchhoffset\zeropoint} +\defcsname\??bleedinglocation b\endcsname{\c_pack_boxes_b\conditionaltrue\scratchhoffset\zeropoint} +\defcsname\??bleedinglocation l\endcsname{\c_pack_boxes_l\conditionaltrue\scratchvoffset\zeropoint} +\defcsname\??bleedinglocation r\endcsname{\c_pack_boxes_r\conditionaltrue\scratchvoffset\zeropoint} +\defcsname\??bleedinglocation bl\endcsname{\c_pack_boxes_l\conditionaltrue\c_pack_boxes_b\conditionaltrue} +\defcsname\??bleedinglocation lb\endcsname{\c_pack_boxes_l\conditionaltrue\c_pack_boxes_b\conditionaltrue} +\defcsname\??bleedinglocation br\endcsname{\c_pack_boxes_r\conditionaltrue\c_pack_boxes_b\conditionaltrue} +\defcsname\??bleedinglocation rb\endcsname{\c_pack_boxes_r\conditionaltrue\c_pack_boxes_b\conditionaltrue} +\defcsname\??bleedinglocation tl\endcsname{\c_pack_boxes_l\conditionaltrue\c_pack_boxes_t\conditionaltrue} +\defcsname\??bleedinglocation lt\endcsname{\c_pack_boxes_l\conditionaltrue\c_pack_boxes_t\conditionaltrue} +\defcsname\??bleedinglocation tr\endcsname{\c_pack_boxes_r\conditionaltrue\c_pack_boxes_t\conditionaltrue} +\defcsname\??bleedinglocation rt\endcsname{\c_pack_boxes_r\conditionaltrue\c_pack_boxes_t\conditionaltrue} \mutable\lettonothing\currentbleedposition \mutable\lettonothing\currentpageposition @@ -558,7 +559,7 @@ \enforced\permanent\xdef\bleedwidth {\the\hsize}% \enforced\permanent\xdef\bleedheight{\the\vsize}% % - \edef\currentbleedposition{bleed:\number\c_pack_boxes_bleeds}% + \edef\currentbleedposition{bleed:\the\c_pack_boxes_bleeds}% \edef\currentpageposition {page:0}% todo: per page % \setupcurrentbleeding[#1]% @@ -569,14 +570,18 @@ \scratchhoffset\bleedingparameter\c!hoffset \scratchvoffset\bleedingparameter\c!voffset % - \setfalse\c_pack_boxes_l % left - \setfalse\c_pack_boxes_r % right - \setfalse\c_pack_boxes_t % top - \setfalse\c_pack_boxes_b % bottom + \c_pack_boxes_l\conditionalfalse % left + \c_pack_boxes_r\conditionalfalse % right + \c_pack_boxes_t\conditionalfalse % top + \c_pack_boxes_b\conditionalfalse % bottom % \csname\??bleedinglocation\bleedingparameter\c!location\endcsname % - \doifelse{\bleedingparameter\c!stretch}\v!yes\donetrue\donefalse + \ifcstok{\bleedingparameter\c!stretch}\v!yes + \donetrue + \else + \donefalse + \fi % \enforced\permanent\xdef\bleedwidth{\the\dimexpr \ifdone @@ -611,8 +616,9 @@ \vsize\bleedheight} \def\pack_boxes_bleed_finish - {\doif{\bleedingparameter\c!page}\v!yes - {\setbox\nextbox\topskippedbox{\box\nextbox}}% + {\ifcstok{\bleedingparameter\c!page}\v!yes + \setbox\nextbox\topskippedbox{\box\nextbox}% + \fi \setbox\nextbox\hpack to \scratchwidth {\ifconditional\c_pack_boxes_l\hss\fi \box\nextbox @@ -669,7 +675,7 @@ % tricky: offsets apply to both the layer and the framed; it makes sense to % only apply the offset to ... -\permanent\tolerant\protected\def\setlayerframed[#1]#*[#2]#*[#3] +\permanent\tolerant\protected\def\setlayerframed[#1]#*[#S#2]#*[#S#3] {\ifarguments % error \or @@ -692,7 +698,7 @@ {\setlayer[#1][#2]% \normalframedwithsettings[#3]} -\permanent\tolerant\protected\def\setlayertext[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setlayertext[#1]#*[#2]#*[#S#3]% {\bgroup \resetdummyparameter\c!align \letdummyparameter \c!width\hsize @@ -849,12 +855,12 @@ \aliased\let\setupoffset\setupoffsetbox -\permanent\tolerant\protected\def\offsetbox[#1]% +\permanent\tolerant\protected\def\offsetbox[#S#1]% {\bgroup \pack_boxes_offset_check[#1]% \dowithnextboxcs\pack_boxes_offsetfinish} -\permanent\tolerant\protected\def\offset[#1]% +\permanent\tolerant\protected\def\offset[#S#1]% {\bgroup \pack_boxes_offset_check[#1]% \dowithnextboxcs\pack_boxes_offsetfinish\hbox} @@ -881,8 +887,7 @@ \ifzeropt\scratchtopoffset \else\donetrue\fi \ifzeropt\scratchbottomoffset\else\donetrue\fi \ifdone - \edef\p_method{\offsetboxparameter\c!method}% - \ifx\p_method\v!fixed % new + \ifcstok{\offsetboxparameter\c!method}\v!fixed % new \ifzeropt\scratchleftoffset \ifzeropt\scratchrightoffset \else \scratchxposition-\scratchrightoffset @@ -984,7 +989,7 @@ % to be documented -\permanent\protected\def\phantombox[#1]% == \framed[\c!empty=\v!yes,\c!offset=\v!overlay,#1]{} +\permanent\protected\def\phantombox[#S#1]% == \framed[\c!empty=\v!yes,\c!offset=\v!overlay,#1]{} {\hpack\bgroup \letdummyparameter\c!width \zeropoint \letdummyparameter\c!height\zeropoint @@ -1035,12 +1040,12 @@ % to be considered: methods \ifcase\scratchcounter \or % x and y - \setbox\nextbox\hpack{\dorecurse\scratchnx{\copy\nextbox}}% - \setbox\nextbox\vpack{\dorecurse\scratchny{\copy\nextbox\endgraf}}% + \setbox\nextbox\hpack{\localcontrolledrepeat\scratchnx{\copy\nextbox}}% + \setbox\nextbox\vpack{\localcontrolledrepeat\scratchny{\copy\nextbox\endgraf}}% \or % x - \setbox\nextbox\hpack{\dorecurse\scratchnx{\copy\nextbox}}% + \setbox\nextbox\hpack{\localcontrolledrepeat\scratchnx{\copy\nextbox}}% \or % y - \setbox\nextbox\vpack{\dorecurse\scratchny{\copy\nextbox\endgraf}}% + \setbox\nextbox\vpack{\localcontrolledrepeat\scratchny{\copy\nextbox\endgraf}}% \fi \fi \ifdim\wd\nextbox>\scratchwidth @@ -1167,10 +1172,10 @@ \mutable\lettonothing\currentanchorbox -\permanent\tolerant\protected\def\setanchorbox[#1]#*[#2]% +\permanent\tolerant\protected\def\setanchorbox[#1]#*[#S#2]% {\begingroup \dowithnextbox - {\def\currentanchorbox{#1}% + {\cdef\currentanchorbox{#1}% \setupboxanchor[#2]% \scratchcounterone\csname\??boxanchorbox#1\endcsname\relax \scratchxoffset\boxanchorparameter\c!xoffset\relax @@ -1290,13 +1295,13 @@ \c!location=\v!height, \c!corner=\v!depth] -\permanent\tolerant\protected\def\setboxanchor[#1]#*[#2]#*[#3]#*% assumes \defineboxanchor[#1] +\permanent\tolerant\protected\def\setboxanchor[#1]#*[#S#2]#*[#S#3]#*% assumes \defineboxanchor[#1] {\begingroup \dowithnextbox {\ifhastok={#2}% \setupcurrentboxanchorcontent[#2]% \else - \def\currentboxanchorcontent{#2}% + \cdef\currentboxanchorcontent{#2}% \setupcurrentboxanchorcontent[#3]% \fi \scratchxoffset\boxanchorcontentparameter\c!xoffset diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl index e07e0ff8ddd..cdaa0e3abcb 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl @@ -101,7 +101,7 @@ \initializeboxstack{\??combination captions} \initializeboxstack{\??combination temp} -\setfalse\c_strc_constructions_define_commands +\c_strc_constructions_define_commands\conditionalfalse \def\pack_combinations_push {\advanceby\c_pack_combinations_nesting\plusone @@ -138,7 +138,7 @@ [\c!numberconversion=\v!character, \c!text=] -\settrue\c_strc_constructions_define_commands +\c_strc_constructions_define_commands\conditionaltrue \setupcombination [\c!width=\v!fit, @@ -160,13 +160,13 @@ \installcorenamespace{combinationalternative} \appendtoks - \setfalse\c_strc_constructions_define_commands + \c_strc_constructions_define_commands\conditionalfalse \normalexpanded {\definelabel [\v!combination:\currentcombination]% [\v!combination\ifempty\currentcombinationparent\else:\currentcombinationparent\fi]}% [\s!counter=\currentcombination,\c!levels=1]% - \settrue\c_strc_constructions_define_commands + \c_strc_constructions_define_commands\conditionaltrue \to \everydefinecombination \defcsname\??combinationlocation\v!left \endcsname{\let\m_pack_combinations_leftfiller \relax} @@ -227,87 +227,6 @@ \lettonothing\p_nx_ny -% \permanent\tolerant\protected\def\startcombination[#1]#*[#2]% can be simplified -% {\bgroup % so we can grab a group -% \pack_combinations_push -% \edef\currentcombination{#1}% -% \edef\p_nx_ny{#2}% -% % -% \ifempty\p_nx_ny -% \ifcondition\validassignment{#1}% -% \lettonothing\currentcombination -% \setupcurrentcombination[#1]% -% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% -% \else -% \doifelseinstring{*}\currentcombination -% {\edef\p_nx_ny{\currentcombination*\plusone*}% -% \lettonothing\currentcombination} -% {\doifelsenumber\currentcombination -% {\edef\p_nx_ny{\currentcombination*\plusone*}% -% \lettonothing\currentcombination} -% {\edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}}}% -% \fi -% \else -% \ifcondition\validassignment{#2}% -% \setupcurrentcombination[#2]% -% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% -% \else -% \edef\p_nx_ny{\p_nx_ny*\plusone*}% -% \fi -% \fi -% % -% % test first: -% % -% % \ifempty\p_nx_ny -% % \ifhastok={#1}% -% % \lettonothing\currentcombination -% % \setupcurrentcombination[#1]% -% % \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% -% % \orelse\ifhastok*{\currentcombination}% -% % \edef\p_nx_ny{\currentcombination*\plusone*}% -% % \lettonothing\currentcombination -% % \orelse\ifchknum\currentcombination\or -% % \edef\p_nx_ny{\currentcombination*\plusone*}% -% % \lettonothing\currentcombination -% % \else -% % \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% -% % \fi -% % \orelse\ifhastok={#2}% -% % \setupcurrentcombination[#2]% -% % \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% -% % \else -% % \edef\p_nx_ny{\p_nx_ny*\plusone*}% -% % \fi -% % -% \forgetall -% % -% \the\everycombination -% % -% \enforced\let\startcontent\pack_common_content_start -% \enforced\let\stopcontent \pack_common_content_stop -% \enforced\let\startcaption\pack_common_caption_start -% \enforced\let\stopcaption \pack_common_caption_stop -% % -% \edef\p_height {\combinationparameter\c!height}% -% \edef\p_width {\combinationparameter\c!width}% -% \edef\p_location{\combinationparameter\c!location}% -% \edef\p_distance{\combinationparameter\c!distance}% -% % -% \pack_combinations_location_reset -% \rawprocesscommacommand[\p_location]\pack_combinations_location_step -% % -% \dostarttaggedchained\t!combination\currentcombination\??combination -% \vbox \ifx\p_height\v!fit\else to \p_height \fi \bgroup -% \enforced\lettonothing\combination % permits \combination{}{} handy for cld -% \normalexpanded{\pack_combinations_start_indeed[\p_nx_ny]}} -% -% \permanent\protected\def\stopcombination -% {\bgroup\normalexpanded{\egroup{}\ntimes{{}{}}\c_pack_combinations_y}% brr -% \dostoptagged -% \egroup -% \pack_combinations_pop -% \egroup} - \installcorenamespace{combinationmethod} % \defcsname\??combinationmethod:\v!start\endcsname @@ -319,33 +238,31 @@ % \defcsname\??combinationmethod:\v!stop\endcsname % {} -\permanent\tolerant\protected\def\startcombination[#1]#*[#2]% can be simplified +\permanent\tolerant\protected\def\startcombination[#S#1]#*[#S#2]% can be simplified {\bgroup % so we can grab a group \pack_combinations_push - \edef\currentcombination{#1}% + \cdef\currentcombination{#1}% \edef\p_nx_ny{#2}% % \ifempty\p_nx_ny - \ifcondition\validassignment{#1}% + \ifhastok={#1}% \lettonothing\currentcombination \setupcurrentcombination[#1]% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% + \orelse\ifhastok*\currentcombination + \edef\p_nx_ny{\currentcombination*\plusone*}% + \lettonothing\currentcombination + \orelse\ifchknum\currentcombination\or + \edef\p_nx_ny{\currentcombination*\plusone*}% + \lettonothing\currentcombination \else - \doifelseinstring{*}\currentcombination - {\edef\p_nx_ny{\currentcombination*\plusone*}% - \lettonothing\currentcombination} - {\doifelsenumber\currentcombination - {\edef\p_nx_ny{\currentcombination*\plusone*}% - \lettonothing\currentcombination} - {\edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}}}% - \fi - \else - \ifcondition\validassignment{#2}% - \setupcurrentcombination[#2]% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% - \else - \edef\p_nx_ny{\p_nx_ny*\plusone*}% \fi + \orelse\ifhastok={#2}% + \setupcurrentcombination[#2]% + \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}% + \else + \edef\p_nx_ny{\p_nx_ny*\plusone*}% \fi \begincsname\??combinationmethod\combinationparameter\c!method:\v!start\endcsname % @@ -374,7 +291,7 @@ % \forgetall % - \the\everycombination + \expand\everycombination % \enforced\let\startcontent\pack_common_content_start \enforced\let\stopcontent \pack_common_content_stop @@ -419,7 +336,7 @@ \global\setbox\b_pack_combinations_captions\emptybox \global\c_pack_combinations_max\c_pack_combinations_x \multiplyby\c_pack_combinations_y\c_pack_combinations_x - \tabskip\zeropoint + \tabskip\zeroskip \enforced\permanent\protected\edef\combinationwidth % \immutable {\the\dimexpr (\hsize-\numexpr\c_pack_combinations_x-\plusone\relax\dimexpr\combinationparameter\c!distance\relax)/\c_pack_combinations_x @@ -482,8 +399,7 @@ \appendtoks \edef\p_pack_combinations_alternative{\combinationparameter\c!alternative}% \ifx\p_pack_combinations_alternative\v!label - \edef\p_continue{\combinationparameter\c!continue}% - \ifx\p_continue\v!yes \else + \ifcstok{\combinationparameter\c!continue}\v!yes\else \normalexpanded{\strc_labels_reset{\v!combination\ifempty\currentcombination\else:\currentcombination\fi}{1}}% \fi \fi @@ -572,7 +488,7 @@ {\ifdim\htdp\b_pack_combinations_caption>\d_pack_combinations_ht \global\d_pack_combinations_ht\htdp\b_pack_combinations_caption \fi - \savebox{\??combinationcaption:\number\c_pack_combinations_nesting}{\number\c_pack_combinations_x}{\box\b_pack_combinations_caption}} + \savebox{\??combinationcaption:\the\c_pack_combinations_nesting}{\the\c_pack_combinations_x}{\box\b_pack_combinations_caption}} \let\pack_combinations_flush_captions_indeed\relax @@ -591,7 +507,7 @@ \def\pack_combinations_flush_captions_yes {\vpack to \d_pack_combinations_ht\bgroup - \foundbox{\??combinationcaption:\number\c_pack_combinations_nesting}{\number\c_pack_combinations_x}% + \foundbox{\??combinationcaption:\the\c_pack_combinations_nesting}{\the\c_pack_combinations_x}% \vss \egroup \global\advanceby\c_pack_combinations_x\minusone @@ -830,9 +746,9 @@ \frozen\protected\instance\edefcsname\e!stop\e!place \currentpairedbox \endcsname{\stopplacepairedbox }% \to \everydefinepairedbox -\permanent\tolerant\protected\def\startplacepairedbox[#1]#*[#2]% +\permanent\tolerant\protected\def\startplacepairedbox[#1]#*[#S#2]% {\bgroup - \edef\currentpairedbox{#1}% + \cdef\currentpairedbox{#1}% \setupcurrentpairedbox[#2]% \pairedboxparameter\c!before \bgroup @@ -873,7 +789,7 @@ \pairedboxparameter\c!after \egroup} -\newconditional\c_pack_pairedboxes_horizontal \settrue\c_pack_pairedboxes_horizontal +\newconditional\c_pack_pairedboxes_horizontal \c_pack_pairedboxes_horizontal\conditionaltrue \installcorenamespace{pairedboxnature} \installcorenamespace{pairedboxalign} @@ -883,21 +799,21 @@ \let\pack_pairedboxes_fill_bottom\relax \defcsname\??pairedboxnature\v!left\endcsname - {\settrue\c_pack_pairedboxes_horizontal + {\c_pack_pairedboxes_horizontal\conditionaltrue \let\pack_pairedboxes_flush\pack_pairedboxes_flush_left} \defcsname\??pairedboxnature\v!right\endcsname - {\settrue\c_pack_pairedboxes_horizontal + {\c_pack_pairedboxes_horizontal\conditionaltrue \let\pack_pairedboxes_flush\pack_pairedboxes_flush_right} \defcsname\??pairedboxnature\v!top\endcsname - {\setfalse\c_pack_pairedboxes_horizontal + {\c_pack_pairedboxes_horizontal\conditionalfalse \let\pack_pairedboxes_fill_top\relax \let\pack_pairedboxes_fill_bottom\vss \let\pack_pairedboxes_flush\pack_pairedboxes_flush_top} \defcsname\??pairedboxnature\v!bottom\endcsname - {\setfalse\c_pack_pairedboxes_horizontal + {\c_pack_pairedboxes_horizontal\conditionalfalse \let\pack_pairedboxes_fill_top\vss \let\pack_pairedboxes_fill_bottom\relax \let\pack_pairedboxes_flush\pack_pairedboxes_flush_bottom} diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl index 772b2ba6466..c637cebbc03 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl @@ -13,8 +13,9 @@ \unprotect -% to be redone in a more modern way - +%D When I am in the mood I will implement the main macro in a more modern way using +%D offsets and such. Or maybe using \METAPOST\ instead +%D %D \macros %D {makecutbox, cuthbox, cutvbox, cutvtop} %D @@ -68,13 +69,13 @@ \permanent\protected\def\horizontalcuts {\hpack to \d_pack_cutmarks_width - {\dorecurse\horizontalcutmarks{\vrule\s!width\cutmarkrulethickness\s!height\cutmarklength\hfill}% + {\localcontrolledrepeat\horizontalcutmarks{\vrule\s!width\cutmarkrulethickness\s!height\cutmarklength\hfill}% \unskip}} \permanent\protected\def\verticalcuts {\vpack to \dimexpr\d_pack_cutmarks_height+\d_pack_cutmarks_depth\relax {\hsize\cutmarklength - \dorecurse\verticalcutmarks{\vrule\s!height\cutmarkrulethickness\s!width\hsize\vfill}% + \localcontrolledrepeat\verticalcutmarks{\vrule\s!height\cutmarkrulethickness\s!width\hsize\vfill}% \unskip}} \permanent\protected\def\baselinecuts @@ -93,14 +94,15 @@ \hss \vpack to \cutmarklength {\scratchdimen\dimexpr\cutmarklength/2\relax - \scratchskip \ifempty\cutmarkhoffset\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi + \scratchdistance\ifempty\cutmarkhoffset\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi \vss \hbox to \d_pack_cutmarks_width - {\llap{\copy\scratchbox\hskip\scratchskip}% - \hskip\scratchdimen\hss + {\llap{\copy\scratchbox\kern\scratchdistance}% + \kern\scratchdimen\hss \infofont#1% - \hss\hskip\scratchdimen - \rlap{\hskip\scratchskip\copy\scratchbox}}% + \hss + \kern\scratchdimen + \rlap{\kern\scratchdistance\copy\scratchbox}}% \vss}% \hss}} @@ -117,24 +119,24 @@ \hsize\d_pack_cutmarks_width \setbox\scratchbox\vpack {\setbox\scratchbox\hpack{\horizontalcuts}% - \scratchskip\ifempty\cutmarkvoffset\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi - \tlap{\copy\scratchbox\vskip\scratchskip}% + \scratchdistance\ifempty\cutmarkvoffset\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi + \tlap{\copy\scratchbox\vskip\scratchdistance}% \hpack to \d_pack_cutmarks_width - {\scratchskip\ifempty\cutmarkhoffset\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi + {\scratchdistance\ifempty\cutmarkhoffset\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi \setbox\scratchbox\hpack{\verticalcuts}% - \llap{\copy\scratchbox\hskip\scratchskip}% + \llap{\copy\scratchbox\kern\scratchdistance}% \ifzeropt\d_pack_cutmarks_depth \hfill \else - \bgroup + \begingroup \setbox\scratchbox\hpack{\baselinecuts}% - \llap{\copy\scratchbox\hskip\scratchskip}% + \llap{\copy\scratchbox\kern\scratchdistance}% \hfill - \rlap{\hskip\scratchskip\copy\scratchbox}% - \egroup + \rlap{\kern\scratchdistance\copy\scratchbox}% + \endgroup \fi - \rlap{\hskip\scratchskip\copy\scratchbox}}% - \blap{\vskip\scratchskip\copy\scratchbox}}% + \rlap{\kern\scratchdistance\copy\scratchbox}}% + \blap{\vskip\scratchdistance\copy\scratchbox}}% \ht\scratchbox\d_pack_cutmarks_height \dp\scratchbox\d_pack_cutmarks_depth \wd\scratchbox\zeropoint @@ -142,10 +144,10 @@ \box\scratchbox \ifrelax\cutmarksymbol \else \setbox\scratchbox\vpack - {\scratchskip\ifempty\cutmarkvoffset\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi - \vskip-\dimexpr\scratchskip+\cutmarklength\relax + {\scratchdistance\ifempty\cutmarkvoffset\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi + \vskip-\dimexpr\scratchdistance+\cutmarklength\relax \hpack{\cutmarksymbols\cutmarktoptext}% - \vskip\dimexpr\scratchskip+\d_pack_cutmarks_height+\d_pack_cutmarks_depth+\scratchskip\relax + \vskip\dimexpr\scratchdistance+\d_pack_cutmarks_height+\d_pack_cutmarks_depth+\scratchdistance\relax \hpack{\cutmarksymbols\cutmarkbottomtext}}% \ht\scratchbox\d_pack_cutmarks_height \dp\scratchbox\d_pack_cutmarks_depth diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl index cc4a7381f23..77aebbc15a1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl @@ -34,7 +34,7 @@ \pushoverloadmode -\permanent\overloaded\tolerant\protected\def\defineoverlay[#1]#*[#2]#*[#3]% overlay [layer] content +\permanent\overloaded\tolerant\protected\def\defineoverlay[#1]#*[#S#2]#*[#S#3]% overlay [layer] content {\ifnum\lastarguments=\plusthree %\writestatus{BEWARE}{This (overlay definition) has changed!}% temp \def\pack_framed_define_overlay_indeed##1{\defcsname\??overlay##1\endcsname{\setlayer[#2]{\executedefinedoverlay{##1}{#3}}}}% @@ -103,8 +103,6 @@ \lettonothing\m_pack_layers_target \lettonothing\p_pack_layers_column \lettonothing\p_pack_layers_corner -\lettonothing\p_pack_layers_direction -\lettonothing\p_pack_layers_doublesided \lettonothing\p_pack_layers_dx \lettonothing\p_pack_layers_dy \lettonothing\p_pack_layers_height @@ -150,8 +148,7 @@ \mutable\let\lastlayerdp \!!zeropoint \appendtoks - \edef\p_pack_layers_doublesided{\layerparameter\c!doublesided}% - \ifx\p_pack_layers_doublesided\v!yes + \ifcstok{\layerparameter\c!doublesided}\v!yes \relateparameterhandlers{layer}{\v!left \currentlayer}{layer}\currentlayer % permits left* \relateparameterhandlers{layer}{\v!right\currentlayer}{layer}\currentlayer % permits right* \pack_layers_preset_box{\v!left \currentlayer}% @@ -206,11 +203,11 @@ \permanent\def\thelayerwidth #1{\the\ifcsname\??layerbox#1\endcsname\wd\lastnamedcs\else\zeropoint\fi} \permanent\def\thelayerheight#1{\the\ifcsname\??layerbox#1\endcsname\ht\lastnamedcs\else\zeropoint\fi} -\permanent\tolerant\protected\def\setlayer[#1]#*[#2]#*[#3]% #4 == box do \fi is ok +\permanent\tolerant\protected\def\setlayer[#1]#*[#S#2]#*[#S#3]% #4 == box do \fi is ok {\bgroup \nofarguments\lastarguments \checkpositionoverlays % otherwise funny regions - \edef\currentlayer{#1}% + \cdef\currentlayer{#1}% \edef\p_pack_layers_state{\layerparameter\c!state}% \ifx\p_pack_layers_state\v!stop \dowithnextboxcs\egroup\hbox % no pack ? @@ -232,7 +229,7 @@ \dontcomplain \edef\p_pack_layers_option{\layerparameter\c!option}% \ifx\p_pack_layers_option\v!test - \settrue\c_pack_layers_trace + \c_pack_layers_trace\conditionaltrue \traceboxplacementtrue \fi \dowithnextbox{\pack_layers_set_finish{#1}}\hbox} @@ -289,12 +286,12 @@ \d_pack_layers_y_position\p_pack_layers_sy\dimexpr\p_pack_layers_y\relax \glet\lastlayerxpos\!!zeropoint \glet\lastlayerypos\!!zeropoint - \doifinset\v!bottom\p_pack_layers_corner\pack_layers_set_bottom_positions - \doifinset\v!right \p_pack_layers_corner\pack_layers_set_right_positions - \doifinset\v!middle\p_pack_layers_corner\pack_layers_set_middle_positions + \ifinset\v!bottom\p_pack_layers_corner\pack_layers_set_bottom_positions\fi + \ifinset\v!right \p_pack_layers_corner\pack_layers_set_right_positions \fi + \ifinset\v!middle\p_pack_layers_corner\pack_layers_set_middle_positions\fi \edef\m_pack_layers_page{\layerparameter\c!page}} -\permanent\tolerant\protected\def\definelayerpreset[#1]#*[#2]% +\permanent\tolerant\protected\def\definelayerpreset[#1]#*[#S#2]% {\ifarguments\or \letcsname\??layerpreset#1\endcsname\empty \orelse\ifhastok={#2}% @@ -337,7 +334,6 @@ \edef\p_pack_layers_column {\layerparameter\c!column }% \edef\p_pack_layers_width {\layerparameter\c!width }% local ones \edef\p_pack_layers_height {\layerparameter\c!height }% local ones - \edef\p_pack_layers_direction{\layerparameter\c!direction}% % \ifx\p_pack_layers_position\v!overlay \let\p_pack_layers_width \zeropoint @@ -383,7 +379,7 @@ \ht\b_layers_page\zeropoint \dp\b_layers_page\zeropoint \wd\b_layers_page\zeropoint - \ifx\p_pack_layers_direction\v!reverse\else + \ifcstok{\layerparameter\c!direction}\v!reverse\else \box\b_layers_page \fi \fi @@ -509,7 +505,7 @@ \permanent\protected\def\flushlayer[#1]% quite core, so optimized (todo: check for void) {\begingroup \forgetall - \edef\currentlayer{#1}% + \cdef\currentlayer{#1}% \edef\p_pack_layers_state{\layerparameter\c!state}% \ifx\p_pack_layers_state\v!stop % nothing @@ -517,21 +513,18 @@ \global\letlayerparameter\c!state\v!start % dangerous, stack-built-up \orelse\ifx\p_pack_layers_state\v!continue \global\letlayerparameter\c!state\v!repeat % dangerous, stack-built-up - \else - \edef\p_pack_layers_doublesided{\layerparameter\c!doublesided}% - \ifx\p_pack_layers_doublesided\v!yes - \ifcsname\??layerbox#1\endcsname - % we can make a dedicated one for this - \doifbothsidesoverruled - {\pack_layers_flush_double\v!left }% - {\pack_layers_flush_double\v!right}% - {\pack_layers_flush_double\v!left }% - \else - \pack_layers_flush_single - \fi + \orelse\ifcstok{\layerparameter\c!doublesided}\v!yes + \ifcsname\??layerbox#1\endcsname + % we can make a dedicated one for this + \doifbothsidesoverruled + {\pack_layers_flush_double\v!left }% + {\pack_layers_flush_double\v!right}% + {\pack_layers_flush_double\v!left }% \else \pack_layers_flush_single \fi + \else + \pack_layers_flush_single \fi \endgroup} @@ -611,23 +604,23 @@ \edef\p_pack_layers_method{\layerparameter\c!method}% \edef\p_pack_layers_option{\layerparameter\c!option}% \ifx\p_pack_layers_option\v!test - \settrue\c_pack_layers_trace + \c_pack_layers_trace\conditionaltrue \traceboxplacementtrue \fi \ifcase#1\relax - \setfalse\c_pack_layers_repeated + \c_pack_layers_repeated\conditionalfalse \else \edef\p_pack_layers_position{\layerparameter\c!position}% \ifx\p_pack_layers_position\v!yes - \setfalse\c_pack_layers_repeated + \c_pack_layers_repeated\conditionalfalse \else \edef\p_pack_layers_repeat{\layerparameter\c!repeat}% \ifx\p_pack_layers_repeat\v!yes - \settrue\c_pack_layers_repeated + \c_pack_layers_repeated\conditionaltrue \orelse\ifx\p_pack_layers_state\v!repeat - \settrue\c_pack_layers_repeated + \c_pack_layers_repeated\conditionaltrue \else - \setfalse\c_pack_layers_repeated + \c_pack_layers_repeated\conditionalfalse \fi \fi \fi @@ -660,7 +653,7 @@ \box\nextbox % \pack_layers_bottom_fill}% - % \edef\currentlayer{#2}% :\the\realpageno}% local .. check \anchor + % \cdef\currentlayer{#2}% :\the\realpageno}% local .. check \anchor \edef\p_pack_layers_position{\layerparameter\c!position}% local \ifx\p_pack_layers_position\v!yes \edef\p_pack_layers_region{\layerparameter\c!region}% @@ -703,7 +696,7 @@ \permanent\protected\def\tightlayer[#1]% {\hpack - {\def\currentlayer{#1}% todo: left/right + {\cdef\currentlayer{#1}% todo: left/right \setbox\nextbox\emptybox \d_overlay_width \layerparameter\c!width \d_overlay_height\layerparameter\c!height @@ -744,12 +737,12 @@ \mutable\def\MPlayerwidth {\hsize} \mutable\def\MPlayerheight{\vsize} -\permanent\tolerant\protected\def\setMPlayer[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setMPlayer[#1]#*[#2]#*[S#3]% {\edef\MPlayerwidth {\MPw{#2}}% \edef\MPlayerheight{\MPh{#2}}% \setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!position=\v!no,#3]} -\permanent\tolerant\protected\def\getMPlayer[#1]#*[#2]% +\permanent\tolerant\protected\def\getMPlayer[#1]#*[#S#2]% {\framed[\c!background={\v!foreground,#1},\c!frame=\v!off,\c!offset=\v!overlay,#2]} % takes argument %D Watch out, a redefinition: diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl index a810c8a47ae..6c6cd31c710 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl @@ -25,8 +25,8 @@ \installtextracker {framed.math} - {\settrue \c_framed_math_framed} - {\setfalse\c_framed_math_framed} + {\c_framed_math_framed\conditionaltrue} + {\c_framed_math_framed\conditionalfalse} \integerdef\c_framed_math_last_left \zerocount \integerdef\c_framed_math_last_right\zerocount @@ -40,7 +40,7 @@ \setupframed[\??mathframed][\c!location=\v!middle] -\tolerant\permanent\protected\def\definemathframed[#1]#*[#2]#*[#3]% +\tolerant\permanent\protected\def\definemathframed[#1]#*[#2]#*[#S#3]% {\ifarguments\or \defineframed[#1][\??mathframed]% \or @@ -52,60 +52,18 @@ \definemathframed[mathframed] -% \def\math_framed#1#*[#2]#:#3% -% {\begingroup -% \ifconditional\c_framed_math_framed -% \defineboxanchor[temp]% -% \fi -% \setmathatomrule\mathbegincode\mathbincode\allmathstyles\mathbegincode\mathbincode % hm -% \normalexpanded -% {\setbox\scratchbox\hpack -% \ifconditional\c_framed_math_framed -% \s!source \namedboxanchor{temp} -% \fi -% \s!ymove \Umathaxis\Ustyle\mathstyle -% \bgroup -% \localframedwithsettings -% [#1][#2]% -% {\startimath -% \Ustyle\mathstyle -% #3% -% \stopimath -% \integerdef\c_framed_math_last_left \lastleftclass -% \integerdef\c_framed_math_last_right\lastrightclass -% \push_macro_c_framed_math_last_left -% \push_macro_c_framed_math_last_right -% }% -% \egroup}% -% \pop_macro_c_framed_math_last_left -% \pop_macro_c_framed_math_last_right -% \mathatom -% \s!class \mathexplicitcode -% \ifnum\c_framed_math_last_left <\zerocount\else\s!leftclass \c_framed_math_last_left \fi -% \ifnum\c_framed_math_last_right<\zerocount\else\s!rightclass\c_framed_math_last_right\fi -% \bgroup -% \ifconditional\c_framed_math_framed -% \setboxanchor[temp][\c!corner={\v!left ,\v!bottom},\c!location={\v!right,\v!height}]% -% \hpack{\smallinfofont\the\c_framed_math_last_left}% -% \setboxanchor[temp][\c!corner={\v!right,\v!bottom},\c!location={\v!left ,\v!height}]% -% \hpack{\smallinfofont\the\c_framed_math_last_right}% -% \fi -% \box\scratchbox -% \egroup -% \endgroup} - \dimensiondef\d_math_framed_offset\zeropoint -\def\math_framed#1#*[#2]#:#3% +\def\math_framed#1#*[#S#2]#:#3% {\begingroup \ifconditional\c_framed_math_framed \defineboxanchor[temp]% \fi - \setmathatomrule\mathbegincode\mathbincode\allmathstyles\mathbegincode\mathbincode % hm + \setmathatomrule\mathbegincode\mathbinarycode\allmathstyles\mathbegincode\mathbinarycode % hm % - \scratchdimen\Umathaxis\Ustyle\mathstyle + \scratchdimen\Umathaxis\givenmathstyle\mathstyle % - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \setbox\scratchbox\hbox{\localframedwithsettings[#1][#2]% {\strut\global\dimensiondef\d_math_framed_offset\dimexpr \framedoffset/2 @@ -114,7 +72,7 @@ % \setbox\scratchbox\hpack\bgroup \startimath - \Ustyle\mathstyle + \givenmathstyle\mathstyle #3% \stopimath \normalexpanded{\aftergrouped{% @@ -175,7 +133,7 @@ strike:location=bottom] \permanent\protected\def\mathstrikeoutlabel - {\iftok{\framedparameter{strike:math}}\emptytoks + {\ifempty{\framedparameter{strike:math}}% \useframedstyleandcolor\c!textstyle\c!color \framedparameter{strike:text}% \else @@ -263,7 +221,7 @@ %D \stopformula %D \stoptyping -\permanent\tolerant\protected\def\mparagraph[#1]#*#:#2% +\permanent\tolerant\protected\def\mparagraph[#S#1]#*#:#2% {\vcenter class \mathconstructcode \bgroup % \mathwrappedcode would be like fraction \framed[\c!offset=\v!overlay,\c!frame=\v!overlay,\c!align=\v!middle,#1]{#2}% \egroup} @@ -295,9 +253,9 @@ \frozen\protected\instance\edefcsname\currentmathframed\endcsname{\pack_framed_mathframed[\currentmathframed]}% \to \everydefinemathframed -\tolerant\protected\def\pack_framed_mathframed[#1]#*[#2]#:#3% needs testing ! +\tolerant\protected\def\pack_framed_mathframed[#1]#*[#S#2]#:#3% needs testing ! {\begingroup - \edef\currentmathframed{#1}% + \cdef\currentmathframed{#1}% \setupcurrentmathframed[#2]% \c_framed_mstyle\normalmathstyle \edef\m_framed_location{\mathframedparameter\c!location}% @@ -306,7 +264,7 @@ \setbox\scratchbox\hbox\bgroup \Ustartmath \triggermathstyle\c_framed_mstyle - \the\t_pack_framed_mathframed + \expand\t_pack_framed_mathframed \mathatom \mathunspacedcode\bgroup #3% \egroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-mis.mklx b/Master/texmf-dist/tex/context/base/mkxl/pack-mis.mklx index 5c63f533c6b..6c6e872750d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-mis.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-mis.mklx @@ -27,7 +27,7 @@ \installcommandhandler \??placement {placement} \??placement \appendtoks - \frozen\instance\setuevalue{\e!place\currentplacement}{\pack_placement{\currentplacement}}% + \frozen\instance\protected\edefcsname\e!place\currentplacement\endcsname{\pack_placement{\currentplacement}}% \to \everydefineplacement \setupplacement @@ -45,10 +45,10 @@ \protected\def\pack_placement#tag% {\bgroup - \edef\currentplacement{#tag}% + \cdef\currentplacement{#tag}% \doifelsenextoptionalcs\pack_placement_yes\pack_placement_nop} -\def\pack_placement_yes[#settings]% +\def\pack_placement_yes[#S#settings]% {\setupcurrentplacement[#settings]% \pack_placement_nop} diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl index fbc51bef558..7d46ec6b6ef 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl @@ -43,36 +43,18 @@ \begingroup \doifelsenextoptionalcs\pack_black_rule_pickup\pack_black_rule_indeed} -\def\pack_black_rule_pickup[#1]% +\def\pack_black_rule_pickup[#S#1]% {\setupcurrentblackrules[#1]% \pack_black_rule_indeed} -% \def\pack_black_rule_indeed -% {\edef\p_width {\directblackrulesparameter\c!width }% -% \edef\p_height{\directblackrulesparameter\c!height}% -% \edef\p_depth {\directblackrulesparameter\c!depth }% -% \ifx\p_height\v!max -% \setstrut -% \orelse\ifx\p_depth\v!max -% \setstrut -% \fi -% \useblackrulesstyleandcolor\c!style\c!color -% \ifcsname\??blackruletype\directblackrulesparameter\c!type\endcsname -% \lastnamedcs -% \else -% \vrule -% \fi -% \ifx\p_width \v!max\s!width \emwidth\orelse\ifempty\p_width \else\s!width \p_width \fi -% \ifx\p_height\v!max\s!height\strutht\orelse\ifempty\p_height\else\s!height\p_height\fi -% \ifx\p_depth \v!max\s!depth \strutdp\orelse\ifempty\p_depth \else\s!depth \p_depth \fi -% \egroup} - \def\pack_black_rule_indeed {\edef\p_width {\directblackrulesparameter\c!width}% \edef\p_height {\directblackrulesparameter\c!height}% \edef\p_depth {\directblackrulesparameter\c!depth}% \edef\p_stretch{\directblackrulesparameter\c!stretch}% \edef\p_shrink {\directblackrulesparameter\c!shrink}% + \edef\p_on {\directblackrulesparameter\c!on}% + \edef\p_off {\directblackrulesparameter\c!off}% \ifx\p_height\v!max \setstrut \let\p_height\strutdp @@ -104,6 +86,8 @@ \lastnamedcs \else \vrule + \ifempty\p_on \else on \p_on \fi + \ifempty\p_off\else off \p_off\fi \fi \ifempty\p_height\else\s!height\p_height\fi \ifempty\p_depth\else\s!depth\p_depth\fi @@ -120,6 +104,8 @@ [\c!width=\emwidth, \c!height=\exheight, \c!depth=\zeropoint, + %\c!on=\zeropoint, + %\c!off=\zeropoint, \c!color=] %D \macros @@ -148,7 +134,7 @@ %D We could of course have implemented this macro using \type {\leaders}, but this %D would probably have taken more tokens. -\permanent\tolerant\protected\def\blackrules[#1]% probably never used +\permanent\tolerant\protected\def\blackrules[#S#1]% probably never used {\hpack\bgroup % we keep this because breaking into lines breaks compatibility \ifarguments\or\setupcurrentblackrules[#1]\fi \scratchwidth \directblackrulesparameter\c!width @@ -312,15 +298,23 @@ \letcsname\??thinrulealternatives\v!c \endcsname\plustwo \letcsname\??thinrulealternatives\v!none\endcsname\zerocount +\def\pack_textrule_check_dash#1% + {\edef\p_on {#1\c!on}% + \edef\p_off {#1\c!off}% + \edef\p_dash{\ifempty\p_on \else on \p_on \space\fi + \ifempty\p_off\else off \p_off\space\fi}} + \newconstant\c_pack_thinrules_type -\permanent\protected\def\thinrule +\permanent\tolerant\protected\def\thinrule[#1]% {\strut \bgroup + \ifparameter#1\or\setupthinrules[#1]\fi \edef\p_height {\directthinrulesparameter\c!height}% \edef\p_depth {\directthinrulesparameter\c!depth}% \edef\p_background{\directthinrulesparameter\c!background}% \edef\p_frame {\directthinrulesparameter\c!frame}% + \pack_textrule_check_dash\directthinrulesparameter \linewidth\dimexpr\directthinrulesparameter\c!rulethickness/\plustwo\relax \ifzeropt\linewidth \c_pack_thinrules_type\zerocount @@ -351,12 +345,16 @@ \hrule \s!height\dimexpr\scratchheight-\linewidth\relax \s!depth \dimexpr\scratchdepth -\linewidth\relax + \p_dash + \relax \hfill \else \leaders \hrule \s!height\scratchheight \s!depth \scratchdepth + \p_dash + \relax \hfill \fi \stopcolor @@ -369,6 +367,8 @@ \hrule \s!height\linewidth \s!depth \linewidth + \p_dash + \relax \hfill \stopcolor \or @@ -378,27 +378,31 @@ \hrule \s!height\dimexpr-\scratchdepth+\linewidth\relax \s!depth \scratchdepth + \p_dash + \relax \hfill \hfillneg \leaders \hrule \s!height\scratchheight \s!depth \dimexpr-\scratchheight+\linewidth\relax + \p_dash + \relax \hfill \stopcolor \fi + \orelse\ifcase\c_pack_thinrules_type + % no rule \else - \ifcase\c_pack_thinrules_type - % no rule - \else - \startcolor[\directthinrulesparameter\c!color]% - \leaders - \hrule - \s!height\scratchheight - \s!depth \scratchdepth - \hfill - \stopcolor - \fi + \startcolor[\directthinrulesparameter\c!color]% + \leaders + \hrule + \s!height\scratchheight + \s!depth \scratchdepth + \p_dash + \relax + \hfill + \stopcolor \fi \strut \carryoverpar\egroup} @@ -408,7 +412,7 @@ \thinrule \endgraf} -\permanent\tolerant\protected\def\thinrules[#1]% +\permanent\tolerant\protected\def\thinrules[#S#1]% {\bgroup \setupcurrentthinrules[#1]% \scratchcounter\directthinrulesparameter\c!n\relax @@ -643,27 +647,34 @@ {\scratchwidth \directtextrulesparameter\c!rulethickness\relax \scratchheight\dimexpr .5\exheight+.5\scratchwidth\relax \scratchdepth \dimexpr-.5\exheight+.5\scratchwidth\relax - \doifsomething{#1} - {\doifelse{\directtextrulesparameter\c!location}\v!inmargin - {\llap - {\usetextrulesstyleandcolor\c!style\c!color - #1% - \kern\leftmargindistance}} % hskip - {\color[\directtextrulesparameter\c!rulecolor] - {\vrule - \s!height\scratchheight - \s!depth \scratchdepth - \s!width \directtextrulesparameter\c!width}% - \hbox spread 2\dimexpr\directtextrulesparameter\c!distance\relax - {\hss - \usetextrulesstyleandcolor\c!style\c!color - \strut#1% - \hss}}}% + \pack_textrule_check_dash\directtextrulesparameter + \ifempty{#1}% + % nothing + \orelse\ifcstok{\directtextrulesparameter\c!location}\v!inmargin + \llap + {\usetextrulesstyleandcolor\c!style\c!color + #1% + \kern\leftmargindistance}% hskip + \else + \color[\directtextrulesparameter\c!rulecolor] + {\vrule + \s!height\scratchheight + \s!depth \scratchdepth + \s!width \directtextrulesparameter\c!width + \p_dash}% + \hbox spread 2\dimexpr\directtextrulesparameter\c!distance\relax + {\hss + \usetextrulesstyleandcolor\c!style\c!color + \strut#1% + \hss}% + \fi \color[\directtextrulesparameter\c!rulecolor] {\leaders\hrule \s!height\scratchheight \s!depth \scratchdepth - \hfill}}% + \p_dash + \relax + \hfill}}% \ht\scratchbox\strutht \dp\scratchbox\strutdp \box\scratchbox @@ -674,16 +685,20 @@ {\ifhmode \endgraf \fi - \doifelse{\directtextrulesparameter\c!depthcorrection}\v!on + \ifcstok{\directtextrulesparameter\c!depthcorrection}\v!on \pack_textrule_correct_depth_yes + \else \pack_textrule_correct_depth_nop + \fi \nointerlineskip \noindent\naturalvpack % was \dontleavehmode {\color[\directtextrulesparameter\c!rulecolor] - {\hrule + {\pack_textrule_check_dash\directtextrulesparameter + \hrule \s!depth \directtextrulesparameter\c!rulethickness \s!height\zeropoint - \s!width \availablehsize}}} + \s!width \availablehsize + \p_dash}}} \def\pack_textrule_correct_depth_yes {\vskip\dimexpr @@ -703,10 +718,11 @@ \relax} \def\pack_textrule_following#1% - {\doifelsenothing{#1} - \pack_textrule_with_text_nop - \pack_textrule_with_text_yes - {#1}% + {\ifempty{#1} + \expandafter\pack_textrule_with_text_nop + \else + \expandafter\pack_textrule_with_text_yes + \fi{#1}% \ifvmode \prevdepth\zeropoint \fi} @@ -767,7 +783,7 @@ \def\pack_fillinrules_rule_indeed{\thinrules} -\permanent\tolerant\protected\def\fillinrules[#1]#:#=#*#=% +\permanent\tolerant\protected\def\fillinrules[#S#1]#:#=#*#=% {\endgraf \begingroup \setupcurrentfillinrules[#1]% @@ -779,7 +795,7 @@ \c!after=]% \scratchdistance\directfillinrulesparameter\c!distance\relax \noindent - \iftok{#2}\emptytoks\else + \ifempty{#2}\else \edef\p_width{\directfillinrulesparameter\c!width}% \ifx\p_width\v!fit \scratchdistance\zeropoint @@ -800,7 +816,7 @@ \setupwhitespace[\v!big]% \ignorespaces \pack_fillinrules_rule_indeed - \iftok{#3}\emptytoks\else + \ifempty{#3}\else \kern\scratchdistance \usefillinrulesstyleandcolor\c!style\c!color #3% @@ -818,7 +834,7 @@ %D %D \showsetup{fillintext} -\permanent\tolerant\protected\def\fillintext[#1]#:#=#*#=% +\permanent\tolerant\protected\def\fillintext[#S#1]#:#=#*#=% {\endgraf \begingroup \def\pack_fillinrules_rule_indeed{\unhbox\nextbox\unskip}% hm, needs checking @@ -884,10 +900,10 @@ \c!height=\scratchheight, \c!depth=\scratchheight]}% \frozen\advanceby\rightskip \directfillinlinesparameter\c!margin\relax - \frozen\parfillskip\zeropoint\relax + \frozen\parfillskip\zeroskip\relax \endgroup} -\permanent\tolerant\protected\def\fillinline[#1]% +\permanent\tolerant\protected\def\fillinline[#S#1]% {\dontleavehmode \registerparwrapper {fillinline}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl index 74ec38629db..284493bbcae 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl @@ -53,7 +53,7 @@ \newbox \b_pack_positioning -\permanent\tolerant\protected\def\startpositioning[#1]#*[#2]% +\permanent\tolerant\protected\def\startpositioning[#S#1]#*[#S#2]% {\bgroup \ifparameters \lettonothing\currentpositioning @@ -62,10 +62,10 @@ \lettonothing\currentpositioning \setupcurrentpositioning[#1]% \else - \edef\currentpositioning{#1}% + \cdef\currentpositioning{#1}% \fi \or - \edef\currentpositioning{#1}% + \cdef\currentpositioning{#1}% \setupcurrentpositioning[#2]% \fi \d_pack_positioning_x_position \zeropoint @@ -81,9 +81,10 @@ \permanent\protected\def\stoppositioning {\removeunwantedspaces - \doifnot{\positioningparameter\c!offset}\v!yes - {\global\d_pack_positioning_x_offset\zeropoint - \global\d_pack_positioning_y_offset\zeropoint}% + \ifcstok{\positioningparameter\c!offset}\v!yes\else + \global\d_pack_positioning_x_offset\zeropoint + \global\d_pack_positioning_y_offset\zeropoint + \fi \global\advanceby\d_pack_positioning_x_dimension\d_pack_positioning_x_offset \global\advanceby\d_pack_positioning_y_dimension\d_pack_positioning_y_offset \egroup @@ -102,16 +103,18 @@ \scratchdimen\positioningparameter#9\scratchdimen \advanceby\scratchdimen\positioningparameter#4\relax % == \scratchdimen\dimexpr#8\dimexpr#9\scratchdimen\relax+#4\relax - \doif{\positioningparameter#2}\v!relative - {\advanceby\scratchdimen#3% - \letpositioningparameter#4\zeropoint}% + \ifcstok{\positioningparameter#2}\v!relative + \advanceby\scratchdimen#3% + \letpositioningparameter#4\zeropoint + \fi #3\scratchdimen - \doifnot{\positioningparameter\c!state}\v!overlay - {\scratchdimen\dimexpr#5\nextbox+#3\relax - \ifdim #3<-#7\relax \global#7-#3\relax \fi - \ifdim\scratchdimen> #6\relax \global#6\scratchdimen\fi}} + \ifcstok{\positioningparameter\c!state}\v!overlay\else + \scratchdimen\dimexpr#5\nextbox+#3\relax + \ifdim #3<-#7\relax \global#7-#3\relax \fi + \ifdim\scratchdimen> #6\relax \global#6\scratchdimen\fi + \fi} -\permanent\tolerant\protected\def\position[#1]#:(#2,#3)% +\permanent\tolerant\protected\def\position[#S#1]#:(#2,#3)% {\bgroup \ifparameter#1\or \setupcurrentpositioning[#1]% diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt index 62a90490137..875714f8267 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt @@ -22,12 +22,12 @@ local context = context local nodecodes = nodes.nodecodes local listcodes = nodes.listcodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist -local boxlist_code = listcodes.box -local linelist_code = listcodes.line -local equationlist_code = listcodes.equation +local boxlist_code = listcodes.box +local linelist_code = listcodes.line +local equationlist_code = listcodes.equation local texsetdimen = tex.setdimen local texsetcount = tex.setcount @@ -69,12 +69,12 @@ directives.register("framed.checkmath",function(v) checkformath = v end) -- expe -- beware: dir nodes and pseudostruts can end up on lines of their own -local c_framednoflines = texiscount("framednoflines") -local d_framedfirstheight = texisdimen("framedfirstheight") -local d_framedlastdepth = texisdimen("framedlastdepth") -local d_framedminwidth = texisdimen("framedminwidth") -local d_framedmaxwidth = texisdimen("framedmaxwidth") -local d_framedaveragewidth = texisdimen("framedaveragewidth") +local c_framednoflines = texiscount("framednoflines") +local d_framedfirstheight = texisdimen("framedfirstheight") +local d_framedlastdepth = texisdimen("framedlastdepth") +local d_framedminwidth = texisdimen("framedminwidth") +local d_framedmaxwidth = texisdimen("framedmaxwidth") +local d_framedaveragewidth = texisdimen("framedaveragewidth") local function doreshapeframedbox(n,resync) if resync then diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl index 1daa8bcf7e1..78b32281550 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl @@ -163,6 +163,7 @@ %\c!rightframe=, \c!radius=.5\bodyfontsize, \c!rulethickness=\linewidth, + \c!dashstep=.1\emwidth, \c!corner=\v!rectangular, \c!depth=\zeropoint, %\c!foregroundcolor=, @@ -520,7 +521,7 @@ \protected\def\pack_overlay_define#1#2% {\defcsname\??overlay#1\endcsname{\executedefinedoverlay{#1}{#2}}} -\permanent\tolerant\protected\def\defineoverlay[#1]#*[#2]% wil be overloaded +\permanent\tolerant\protected\def\defineoverlay[#1]#*[#S#2]% wil be overloaded % {\def\pack_framed_define_overlay_indeed##1{\defcsname\??overlay##1\endcsname{\executedefinedoverlay{##1}{#2}}}% {\def\pack_framed_define_overlay_indeed##1{\pack_overlay_define{##1}{#2}}% \processcommalist[#1]\pack_framed_define_overlay_indeed} @@ -528,7 +529,7 @@ \permanent\protected\def\executedefinedoverlay#1#2% we can share the definitions {\bgroup % redundant grouping \setlayoutcomponentattribute{\v!overlay:#1}% - \setbox\scratchbox\hbox \layoutcomponentboxattribute{\the\everyoverlay#2}% + \setbox\scratchbox\hbox \layoutcomponentboxattribute{\expand\everyoverlay#2}% \boxxoffset\scratchbox-.5\dimexpr\wd\scratchbox-\d_framed_target_wd\relax % was \d_overlay_width \boxyoffset\scratchbox-.5\dimexpr\ht\scratchbox-\d_framed_target_ht+\d_framed_target_dp\relax % not \d_overlay_height ! \wd\scratchbox\d_framed_target_wd @@ -645,7 +646,7 @@ \fi \enforced\let\foregroundbox\pack_framed_background_box_content \hpack \layoutcomponentboxattribute to \framedbackgroundwidth\bgroup % width in case 'foreground' is used as overlay - \the\everybackgroundbox % moved + \expand\everybackgroundbox % moved \expandafter\pack_framed_process_backgrounds\p_framed_background,\s!unknown,\relax % hm, messy .. look into it \box\b_framed_normal \hss @@ -742,7 +743,7 @@ {\setbox\scratchbox\vpack \bgroup % \normaloffinterlineskip % sets baselineskip, lineskip and lineskiplimit \baselineskip-\thousandpoint - \lineskip \zeropoint + \lineskip \zeroskip \lineskiplimit\maxdimen \csname\??framedtop\p_framed_frame\framedparameter\c!topframe\endcsname % \nointerlineskip % new (needed for fences) @@ -781,10 +782,10 @@ \pack_framed_stroked_box_normal_opened \fi} -\def\pack_framed_t_rule{\hrule\s!height\d_framed_linewidth\kern-\d_framed_linewidth} -\def\pack_framed_b_rule{\kern-\d_framed_linewidth\hrule\s!height\d_framed_linewidth} -\def\pack_framed_r_rule{\kern-\d_framed_linewidth\vrule\s!width\d_framed_linewidth} -\def\pack_framed_l_rule{\vrule\s!width\d_framed_linewidth\kern-\d_framed_linewidth} +\def\pack_framed_t_rule{\hrule\s!height\d_framed_linewidth\relax\kern-\d_framed_linewidth} +\def\pack_framed_b_rule{\kern-\d_framed_linewidth\hrule\s!height\d_framed_linewidth\relax} +\def\pack_framed_r_rule{\kern-\d_framed_linewidth\vrule\s!width \d_framed_linewidth\relax} +\def\pack_framed_l_rule{\vrule\s!width \d_framed_linewidth\relax\kern-\d_framed_linewidth} \letcsname\??framedtop \v!on \v!on\endcsname\pack_framed_t_rule \letcsname\??framedtop \v!off\v!on\endcsname\pack_framed_t_rule @@ -802,6 +803,41 @@ \letcsname\??framedright \v!off\v!on\endcsname\pack_framed_r_rule \letcsname\??framedright \v!on \endcsname\pack_framed_r_rule +% Let's see who documents this on the wiki: +% +% \framed +% [align=middle,topframe=dash,frame=off] +% {\samplefile{tufte}} +% \framed +% [align=middle,frame=dash,dashstep=.01hs,rulethickness=1pt] +% {\samplefile{tufte}} +% \framed +% [align=middle,frame=dash,dashstep=10pt,rulethickness=2pt,background=color,backgroundcolor=gray] +% {\samplefile{tufte}} + +\def\pack_framed_dash{on \d_framed_framedashstep off \d_framed_framedashstep} + +\def\pack_framed_t_rule_d{\hrule\s!height\d_framed_linewidth\pack_framed_dash\relax\kern-\d_framed_linewidth} +\def\pack_framed_b_rule_d{\kern-\d_framed_linewidth\hrule\s!height\d_framed_linewidth\pack_framed_dash\relax} +\def\pack_framed_r_rule_d{\kern-\d_framed_linewidth\vrule\s!width \d_framed_linewidth\pack_framed_dash\relax} +\def\pack_framed_l_rule_d{\vrule\s!width \d_framed_linewidth\pack_framed_dash\relax\kern-\d_framed_linewidth} + +\letcsname\??framedtop \v!off \v!dash\endcsname\pack_framed_t_rule_d +\letcsname\??framedtop \v!dash \endcsname\pack_framed_t_rule_d +\letcsname\??framedtop \v!dash\v!dash\endcsname\pack_framed_t_rule_d + +\letcsname\??framedbottom\v!off \v!dash\endcsname\pack_framed_b_rule_d +\letcsname\??framedbottom\v!dash \endcsname\pack_framed_b_rule_d +\letcsname\??framedbottom\v!dash\v!dash\endcsname\pack_framed_b_rule_d + +\letcsname\??framedleft \v!off \v!dash\endcsname\pack_framed_l_rule_d +\letcsname\??framedleft \v!dash \endcsname\pack_framed_l_rule_d +\letcsname\??framedleft \v!dash\v!dash\endcsname\pack_framed_l_rule_d + +\letcsname\??framedright \v!off \v!dash\endcsname\pack_framed_r_rule_d +\letcsname\??framedright \v!dash \endcsname\pack_framed_r_rule_d +\letcsname\??framedright \v!dash\v!dash\endcsname\pack_framed_r_rule_d + % no overlapping rules % \def\pack_framed_t_rules{\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}\nointerlineskip\kern-\d_framed_linewidth} @@ -904,17 +940,17 @@ \newinteger\c_pack_framed_nesting -\permanent\tolerant\protected\def\framed[#1]% +\permanent\tolerant\protected\def\framed[#S#1]% {\bgroup \advanceby\c_pack_framed_nesting\plusone \letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed - \edef\currentframed{>\the\c_pack_framed_nesting}% + \cdef\currentframed{>\the\c_pack_framed_nesting}% \pack_framed_initialize \bgroup \setupcurrentframed[#1]% here !, seldom no argument so no need to optimize \pack_framed_process_indeed} -\permanent\tolerant\protected\def\startframed[#1]#*[#2]% +\permanent\tolerant\protected\def\startframed[#S#1]#*[#S#2]% {\bgroup \ifarguments \pack_framed_initialize @@ -923,17 +959,17 @@ \ifhastok={#1}% \advanceby\c_pack_framed_nesting\plusone \letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed - \edef\currentframed{>\the\c_pack_framed_nesting}% + \cdef\currentframed{>\the\c_pack_framed_nesting}% \pack_framed_initialize \bgroup \setupcurrentframed[#1]% here ! \else - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \bgroup \fi \else - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \bgroup \setupcurrentframed[#2]% here ! @@ -948,12 +984,12 @@ {\removeunwantedspaces \egroup} -\permanent\protected\def\normalframedwithsettings[#1]% +\permanent\protected\def\normalframedwithsettings[#S#1]% {\bgroup \advanceby\c_pack_framed_nesting\plusone \letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed \bgroup - \edef\currentframed{>\the\c_pack_framed_nesting}% + \cdef\currentframed{>\the\c_pack_framed_nesting}% \pack_framed_initialize \setupcurrentframed[#1]% \pack_framed_process_indeed} @@ -990,9 +1026,9 @@ %% \protected\def\fastlocalframed[#1]#2[#3]#4% 3-4 -\permanent\protected\def\fastlocalframed[#1]#*[#2]#3% +\permanent\protected\def\fastlocalframed[#1]#*[#S#2]#3% {\bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \setbox\b_framed_normal\hbox{#3}% \iftrialtypesetting \else @@ -1004,6 +1040,7 @@ \setupcurrentframed[#2]% \edef\p_framed_rulethickness{\framedparameter\c!rulethickness}% also used in backgrounds \d_framed_frameoffset\framedparameter\c!frameoffset\relax % also used in backgrounds + \d_framed_framedashstep\framedparameter\c!dashstep\relax \edef\p_framed_frame{\framedparameter\c!frame}% \edef\p_framed_background{\framedparameter\c!background}% % not here, in calling macro: setups @@ -1075,7 +1112,7 @@ \permanent\protected\def\localbackgroundframed#1% namespace component box {\bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \pack_framed_process_box_indeed} % group ends here @@ -1133,15 +1170,16 @@ \newdimension\d_framed_width \newdimension\d_framed_height \newdimension\d_framed_frameoffset +\newdimension\d_framed_framedashstep \newdimension\d_framed_backgroundoffset \newdimension\d_framed_local_offset % todo: protect local \framednames -\permanent\tolerant\protected\def\localframed[#1]#*[#2]% +\permanent\tolerant\protected\def\localframed[#1]#*[#S#2]% {\bgroup \bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \setupcurrentframed[#2]% here ! \pack_framed_process_indeed} @@ -1149,7 +1187,7 @@ \permanent\protected\def\directlocalframed[#1]% no optional {\bgroup \bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \pack_framed_process_indeed} @@ -1172,9 +1210,16 @@ \mutable\lettonothing\localheight \mutable\lettonothing\localformat -\mutable\lettonothing\framedwidth -\mutable\lettonothing\framedheight -\mutable\lettonothing\framedoffset +\mutable\let\framedwidth \zeropoint +\mutable\let\framedheight\zeropoint +\mutable\let\framedoffset\zeropoint + +\pushoverloadmode + \newuserunit\framedwidth fw % checked \d_framed_width + \newuserunit\framedheight fh % checked \d_framed_height + \newuserunit\framedoffset fo % checked \d_framed_local_offset + \newuserunit\linewidth lw +\popoverloadmode % better a constant: @@ -1185,26 +1230,27 @@ \def\spac_framed_push_local_anchors {\ifx\p_framed_synchronize\v!yes - \settrue\c_pack_resync - \settrue\c_pack_reanchor + \c_pack_resync\conditionaltrue + \c_pack_reanchor\conditionaltrue \pushlocalanchors % \aftergrouped{\aftergrouped{\poplocalanchors}}% \aftergroup\poplocalanchors \orelse\ifx\p_framed_synchronize\v!text - \settrue\c_pack_resync + \c_pack_resync\conditionaltrue \pushlocalanchors \aftergroup\poplocalanchors \orelse\ifx\p_framed_synchronize\v!background - \settrue\c_pack_reanchor + \c_pack_reanchor\conditionaltrue \pushlocalanchors \aftergroup\poplocalanchors \else - \setfalse\c_pack_resync - \setfalse\c_pack_reanchor + \c_pack_resync\conditionalfalse + \c_pack_reanchor\conditionalfalse \fi} \protected\def\pack_framed_process_indeed {\d_framed_frameoffset\framedparameter\c!frameoffset + \d_framed_framedashstep\framedparameter\c!dashstep \edef\p_framed_backgroundoffset{\framedparameter\c!backgroundoffset}% \d_framed_backgroundoffset \ifx\p_framed_backgroundoffset\v!frame @@ -1239,20 +1285,20 @@ \edef\p_framed_franalyze {\framedparameter\c!fr!analyze}% experimental option % \ifempty\p_framed_synchronize - \setfalse\c_pack_resync - \setfalse\c_pack_reanchor + \c_pack_resync\conditionalfalse + \c_pack_reanchor\conditionalfalse % \let\spac_framed_pop_local_anchors\relax \else \spac_framed_push_local_anchors \fi % \ifx\p_framed_frame\v!overlay % no frame, no offset, no framewidth - \setfalse\c_framed_has_frame + \c_framed_has_frame\conditionalfalse \let\localoffset\v!overlay \orelse\ifx\p_framed_frame\v!none % no frame, no framewidth - \setfalse\c_framed_has_frame + \c_framed_has_frame\conditionalfalse \else - \settrue\c_framed_has_frame + \c_framed_has_frame\conditionaltrue \fi \ifconditional\c_framed_has_frame \edef\p_framed_rulethickness{\framedparameter\c!rulethickness}% @@ -1270,9 +1316,9 @@ \forgetall % should happen after \localwidth but before align % \ifempty\localformat - \setfalse\c_framed_has_format + \c_framed_has_format\conditionalfalse \else - \settrue\c_framed_has_format + \c_framed_has_format\conditionaltrue \dosetraggedcommand\localformat % not that fast \fi % @@ -1306,7 +1352,7 @@ \else \d_framed_height\p_framed_lines\lineheight \edef\localheight{\the\d_framed_height}% - \settrue\c_framed_has_height + \c_framed_has_height\conditionaltrue \fi \fi % this is now an option: width=local @@ -1419,76 +1465,76 @@ \defcsname\??framedwidthalternative\empty\endcsname {\ifconditional\c_framed_has_format - \settrue\c_framed_has_width + \c_framed_has_width\conditionaltrue \d_framed_width\hsize \else - \setfalse\c_framed_has_width + \c_framed_has_width\conditionalfalse \d_framed_width\zeropoint \fi} \defcsname\??framedwidthalternative\v!fit\endcsname {\ifconditional\c_framed_has_format - \settrue\c_framed_has_width + \c_framed_has_width\conditionaltrue \d_framed_width\hsize \else - \setfalse\c_framed_has_width + \c_framed_has_width\conditionalfalse \d_framed_width\zeropoint \fi} \defcsname\??framedwidthalternative\v!fixed\endcsname % equals \v!fit but no shapebox {\ifconditional\c_framed_has_format - \settrue\c_framed_has_width + \c_framed_has_width\conditionaltrue \d_framed_width\hsize \else - \setfalse\c_framed_has_width + \c_framed_has_width\conditionalfalse \d_framed_width\zeropoint \fi} \defcsname\??framedwidthalternative\v!broad\endcsname - {\settrue\c_framed_has_width + {\c_framed_has_width\conditionaltrue \d_framed_width\hsize} \defcsname\??framedwidthalternative\v!max\endcsname % idem broad - {\settrue\c_framed_has_width + {\c_framed_has_width\conditionaltrue \d_framed_width\hsize} \defcsname\??framedwidthalternative\v!local\endcsname - {\settrue\c_framed_has_width + {\c_framed_has_width\conditionaltrue %\setlocalhsize \d_framed_width\localhsize} \defcsname\??framedwidthalternative\s!unknown\endcsname - {\settrue\c_framed_has_width + {\c_framed_has_width\conditionaltrue \d_framed_width\localwidth} \def\framed_width_alternative_unknown - {\settrue\c_framed_has_width + {\c_framed_has_width\conditionaltrue \d_framed_width\localwidth} % heights \defcsname\??framedheightalternative\empty\endcsname - {\setfalse\c_framed_has_height + {\c_framed_has_height\conditionalfalse \d_framed_height\zeropoint} \defcsname\??framedheightalternative\v!fit\endcsname - {\setfalse\c_framed_has_height + {\c_framed_has_height\conditionalfalse \d_framed_height\zeropoint} \defcsname\??framedheightalternative\v!broad\endcsname - {\setfalse\c_framed_has_height + {\c_framed_has_height\conditionalfalse \d_framed_height\zeropoint} \defcsname\??framedheightalternative\v!max\endcsname - {\settrue\c_framed_has_height + {\c_framed_has_height\conditionaltrue \d_framed_height\vsize} \defcsname\??framedheightalternative\s!unknown\endcsname - {\settrue\c_framed_has_height + {\c_framed_has_height\conditionaltrue \d_framed_height\localheight} \def\framed_height_alternative_unknown - {\settrue\c_framed_has_height + {\c_framed_has_height\conditionaltrue \d_framed_height\localheight} % struts (use let instead?) @@ -1517,36 +1563,36 @@ % offsets \defcsname\??framedoffsetalternative\v!none\endcsname - {\setfalse\c_framed_has_offset + {\c_framed_has_offset\conditionalfalse \c_framed_has_strut\plusone - \setfalse\c_framed_is_overlaid + \c_framed_is_overlaid\conditionalfalse \d_framed_local_offset\d_framed_linewidth} \defcsname\??framedoffsetalternative\v!overlay\endcsname - {% \ifx\p_framed_frame\v!no \setfalse\c_framed_has_frame \fi % test first - \setfalse\c_framed_has_offset + {% \ifx\p_framed_frame\v!no \c_framed_has_frame\conditionalfalse \fi % test first + \c_framed_has_offset\conditionalfalse \c_framed_has_strut\plusone - \settrue\c_framed_is_overlaid + \c_framed_is_overlaid\conditionaltrue \d_framed_local_offset\zeropoint} % \defcsname\??framedoffsetalternative\v!strut\endcsname -% {\setfalse\c_framed_has_offset +% {\c_framed_has_offset\conditionalfalse % \c_framed_has_strut\plustwo -% \settrue\c_framed_is_overlaid +% \c_framed_is_overlaid\conditionaltrue % \d_framed_local_offset\zeropoint} \defcsname\??framedoffsetalternative\v!default\endcsname % new per 2-6-2000 - {\settrue \c_framed_has_offset + {\c_framed_has_offset\conditionaltrue \c_framed_has_strut\plustwo - \setfalse\c_framed_is_overlaid + \c_framed_is_overlaid\conditionalfalse \let\localoffset\defaultframeoffset \letframedparameter\c!offset\defaultframeoffset % brrr \d_framed_local_offset\dimexpr\localoffset+\d_framed_linewidth\relax} \def\framed_offset_alternative_unknown - {\settrue \c_framed_has_offset + {\c_framed_has_offset\conditionaltrue \c_framed_has_strut\plustwo - \setfalse\c_framed_is_overlaid + \c_framed_is_overlaid\conditionalfalse \let\defaultframeoffset\localoffset \d_framed_local_offset\dimexpr\localoffset+\d_framed_linewidth\relax} @@ -1594,7 +1640,7 @@ % \relax} % % \def\doassigncheckedframeoffset#1#2% could be a fast \csname .. \endcsname -% {#1\ifchkdim#2\or#2\else\zeropoint\fi}% +% {#1\ifchkdimension#2\or\lastchkdimension\else\zeropoint\fi}% %D \macros %D {ifreshapeframebox} @@ -1632,8 +1678,9 @@ \def\pack_framed_reverse_box {\ifvbox\b_framed_normal - \edef\p_linedirection{\framedparameter\c!linedirection}% - \ifx\p_linedirection\v!reverse +% \edef\p_linedirection{\framedparameter\c!linedirection}% +% \ifx\p_linedirection\v!reverse + \ifcstok{\framedparameter\c!linedirection}\v!reverse \reversevboxcontent\b_framed_normal \setbox\b_framed_normal\vpack{\unvbox\b_framed_normal}% \fi @@ -1647,7 +1694,7 @@ \else \pack_framed_reshape_reset \fi - \setfalse\c_framed_has_width} + \c_framed_has_width\conditionalfalse} \def\pack_framed_finish_b {\ifx\p_framed_franalyze\v!yes @@ -1655,7 +1702,7 @@ \else \pack_framed_reshape_reset \fi - \setfalse\c_framed_has_width} + \c_framed_has_width\conditionalfalse} \def\pack_framed_finish_c {\ifx\p_framed_franalyze\v!yes @@ -1669,13 +1716,12 @@ % on some paper terminal font); scalefactors are in the range -1000..1000. \protected\def\pack_framed_finish - {\edef\p_freeze{\framedparameter\c!freezespacing}% - \ifempty\p_freeze - % \orelse\ifx\p_freeze\v!yes - % \boxfreeze\b_framed_normal\zerocount - \else + {\ifempty{\framedparameter\c!freezespacing}\else \boxadapt\b_framed_normal\p_freeze\relax \fi + % \ifcstok{\framedparameter\c!limit}\v!yes + % \boxlimit\b_framed_normal % maybe + % \fi \pack_framed_locator_before\p_framed_location \ifconditional\c_framed_has_format \ifempty\p_framed_anchoring\else @@ -1982,6 +2028,14 @@ \dp\b_framed_normal\d_framed_locator_dp \hpack{\box\b_framed_normal}} % why do we pack .. danger of loosing? +\installframedlocator \v!inline + {} + {\scratchoffset\dimexpr\strutdp+\d_framed_applied_offset\relax + \boxyoffset\b_framed_normal\dimexpr\boxyoffset\b_framed_normal-\scratchoffset\relax + \ht\b_framed_normal\dimexpr\ht\b_framed_normal-\scratchoffset\relax + \dp\b_framed_normal\dimexpr\strutdp+\d_framed_applied_offset\relax + \box\b_framed_normal} + % also used in fastlocalframed \newdimension\d_framed_original_wd @@ -2031,7 +2085,7 @@ %D [height=3cm] {framed} boxes. Such boxes have to be \inframed {aligned} with the %D running text. -\permanent\tolerant\protected\def\inframed[#1]{\framed[\c!location=\v!low,#1]} +\permanent\tolerant\protected\def\inframed[#S#1]{\framed[\c!location=\v!low,#1]} %D When we set \type{empty} to \type{yes}, we get ourselves a frame and/or background, %D but no content, so actually we have a sort of phantom framed box. @@ -2046,15 +2100,15 @@ \newdimension\d_framed_boffset \def\pack_framed_check_extra_offsets % we could check h and v indepently - {\setfalse\c_framed_has_extra_offset + {\c_framed_has_extra_offset\conditionalfalse \d_framed_loffset\framedparameter\c!loffset\relax \d_framed_roffset\framedparameter\c!roffset\relax \d_framed_toffset\framedparameter\c!toffset\relax \d_framed_boffset\framedparameter\c!boffset\relax - \ifzeropt\d_framed_loffset\else \advanceby\d_framed_width -\d_framed_loffset \settrue\c_framed_has_extra_offset \fi - \ifzeropt\d_framed_roffset\else \advanceby\d_framed_width -\d_framed_roffset \settrue\c_framed_has_extra_offset \fi - \ifzeropt\d_framed_toffset\else \advanceby\d_framed_height-\d_framed_toffset \settrue\c_framed_has_extra_offset \fi - \ifzeropt\d_framed_boffset\else \advanceby\d_framed_height-\d_framed_boffset \settrue\c_framed_has_extra_offset \fi} + \ifzeropt\d_framed_loffset\else \advanceby\d_framed_width -\d_framed_loffset \c_framed_has_extra_offset\conditionaltrue \fi + \ifzeropt\d_framed_roffset\else \advanceby\d_framed_width -\d_framed_roffset \c_framed_has_extra_offset\conditionaltrue \fi + \ifzeropt\d_framed_toffset\else \advanceby\d_framed_height-\d_framed_toffset \c_framed_has_extra_offset\conditionaltrue \fi + \ifzeropt\d_framed_boffset\else \advanceby\d_framed_height-\d_framed_boffset \c_framed_has_extra_offset\conditionaltrue \fi} \def\pack_framed_apply_extra_offsets {\setbox\b_framed_normal\vpack\bgroup @@ -2744,12 +2798,12 @@ \defcsname\??framedtextlocation\v!none\endcsname {\letframedtextparameter\c!left \relax \letframedtextparameter\c!right\relax - \settrue\c_framed_text_location_none} + \c_framed_text_location_none\conditionaltrue} -\tolerant\protected\def\pack_framed_text_start[#1]#*[#2]#*[#3]% or #1#*[#2]#*[#3]% and pass {#1} +\tolerant\protected\def\pack_framed_text_start[#1]#*[#S#2]#*[#S#3]% or #1#*[#2]#*[#3]% and pass {#1} {\bgroup - \edef\currentframedtext{#1}% - \doifelseassignment{#2} + \cdef\currentframedtext{#1}% + \doifelseassignment{#2}% {\pack_framed_text_start_indeed\empty{#2}} {\pack_framed_text_start_indeed{#2}{#3}}} @@ -2757,9 +2811,11 @@ \def\pack_framed_text_start_indeed#1#2% {\setupframedtexts[\currentframedtext][#2]% - \doifsomething{#1}{\setframedtextparameter\c!location{#1}}% does not listen to #3 - \setfalse\c_framed_text_location_none - \csname\??framedtextlocation\framedtextparameter\c!location\endcsname + \ifempty{#1}\else + \setframedtextparameter\c!location{#1}% does not listen to #3 + \fi + \c_framed_text_location_none\conditionalfalse + \begincsname\??framedtextlocation\framedtextparameter\c!location\endcsname \resetframedtextparameter\c!location \pack_framed_text_check \setbox\b_framed_normal\vbox % \vpack @@ -2879,9 +2935,9 @@ \let\pack_framed_strut\relax -\tolerant\protected\def\pack_framed_text_direct[#1]#*[#2]% +\tolerant\protected\def\pack_framed_text_direct[#1]#*[#S#2]% {\bgroup - \edef\currentframedtext{#1}% + \cdef\currentframedtext{#1}% \usebodyfontparameter\framedtextparameter \setupcurrentframedtext[#2]% \edef\p_framed_text_strut{\framedtextparameter\c!strut}% @@ -2932,7 +2988,7 @@ \to \everypresetframed \appendtoks - \frozen\instance\setuevalue{\currentframed}{\pack_framed_defined_process[\currentframed]}% + \frozen\instance\protected\edefcsname\currentframed\endcsname{\pack_framed_defined_process[\currentframed]}% \to \everydefineframed \newinteger\c_temp_framed_crap @@ -2948,12 +3004,12 @@ % \advanceby\c_pack_framed_temp\plusone % \defcsname\??framed#1>\the\c_pack_framed_temp:\s!parent\endcsname{\??framed#1}% \inheritlocalframed % \bgroup -% \edef\currentframed{#1>\the\c_pack_framed_temp}% +% \cdef\currentframed{#1>\the\c_pack_framed_temp}% % \pack_framed_initialize % \setupcurrentframed[#2]% here ! % \pack_framed_process_indeed} -\permanent\tolerant\protected\def\pack_framed_defined_process[#1]#*[#2]% official (not much checking, todo: parent) +\permanent\tolerant\protected\def\pack_framed_defined_process[#1]#*[#S#2]% official (not much checking, todo: parent) {\bgroup \ifcsname\??regularframedlevel#1\endcsname %\expandafter\let\expandafter\c_pack_framed_temp\csname\??regularframedlevel#1\endcsname @@ -2964,7 +3020,7 @@ \advanceby\scratchcounter\plusone \defcsname\??framed#1>\the\scratchcounter:\s!parent\endcsname{\??framed#1}% \inheritlocalframed \bgroup - \edef\currentframed{#1>\the\scratchcounter}% + \cdef\currentframed{#1>\the\scratchcounter}% \pack_framed_initialize \setupcurrentframed[#2]% here ! \pack_framed_process_indeed} @@ -3036,7 +3092,7 @@ \permanent\tolerant\protected\def\startframedcontent[#1]% {\bgroup - \edef\currentframedcontent{#1}% + \cdef\currentframedcontent{#1}% \ifx\currentframedcontent\v!off \enforced\let\stopframedcontent\egroup \else @@ -3069,12 +3125,15 @@ \egroup \kern\scratchrightoffset \egroup - \doif{\framedcontentparameter\c!width}\v!fit - {\letframedcontentparameter\c!width\v!fixed}% no shapebox + \ifcstok{\framedcontentparameter\c!width}\v!fit + \letframedcontentparameter\c!width\v!fixed% no shapebox + \fi \ifinsidefloat \donefalse + \orelse\ifcstok{\framedcontentparameter\c!linecorrection}\v!yes + \donetrue \else - \doifelse{\framedcontentparameter\c!linecorrection}\v!yes\donetrue\donefalse + \donefalse \fi % plaats ? \ifdone\startlinecorrection\fi @@ -3110,12 +3169,12 @@ %D Fast enough for most cases (we could do a massive \type {\ifhastok} instead): \permanent\protected\def\doifelseframed#1% - {\iftok{#1\c!frame }{\v!on}\expandafter\firstoftwoarguments - \orelse\iftok{#1\c!topframe }{\v!on}\expandafter\firstoftwoarguments - \orelse\iftok{#1\c!bottomframe}{\v!on}\expandafter\firstoftwoarguments - \orelse\iftok{#1\c!leftframe }{\v!on}\expandafter\firstoftwoarguments - \orelse\iftok{#1\c!rightframe }{\v!on}\expandafter\firstoftwoarguments - \orelse\iftok{#1\c!background } {}\expandafter\secondoftwoarguments - \else \expandafter\firstoftwoarguments\fi} + {\ifcstok{#1\c!frame }\v!on\expandafter\firstoftwoarguments + \orelse\ifcstok{#1\c!topframe }\v!on\expandafter\firstoftwoarguments + \orelse\ifcstok{#1\c!bottomframe}\v!on\expandafter\firstoftwoarguments + \orelse\ifcstok{#1\c!leftframe }\v!on\expandafter\firstoftwoarguments + \orelse\ifcstok{#1\c!rightframe }\v!on\expandafter\firstoftwoarguments + \orelse\ifempty{#1\c!background }\expandafter\secondoftwoarguments + \else \expandafter\firstoftwoarguments\fi} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl index 9a800841d92..bef23365194 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl @@ -49,18 +49,20 @@ \frozen\instance\protected\edefcsname\e!stop \currentfittingpage\endcsname{\stopfittingpage}% \to \everydefinefittingpage -\permanent\tolerant\protected\def\startfittingpage[#1]#*[#2]% +\permanent\tolerant\protected\def\startfittingpage[#1]#*[#S#2]% {\page % this is kind of tricky! there can be preceding page refs \autostarttext \bgroup % resulting in a zero height page; test fig-make ! \setupinterlinespace[\v!top=0]% no topskip - \def\currentfittingpage{#1}% + \cdef\currentfittingpage{#1}% \dontcomplain % runs under current page regime, i.e. page variables passed to mp \setupcurrentfittingpage[\c!paper=,#2]% auto or size or nothing - \doifelsenothing{\fittingpageparameter\c!command} - \page_fitting_start_normal - \page_fitting_start_command} + \ifempty{\fittingpageparameter\c!command}% + \expandafter\page_fitting_start_normal + \else + \expandafter\page_fitting_start_command + \fi} \def\page_fitting_start_command {\grabuntil{\e!stop\currentfittingpage}\page_fitting_stop_command} @@ -83,19 +85,21 @@ \egroup \egroup % finalize - \doif{\fittingpageparameter\c!margin}\v!page - {\setbox\b_page_fitting\hpack\bgroup - \offsetbox - [\c!leftoffset=\backspace, - \c!rightoffset=\cutspace, - \c!topoffset=\topspace, - \c!bottomoffset=\bottomspace] - {\box\b_page_fitting}% - \egroup}% - \doifsomething{\fittingpageparameter\c!scale} - {\setbox\b_page_fitting\hpack\bgroup - \scale[\c!scale=\fittingpageparameter\c!scale]{\box\b_page_fitting}% - \egroup}% + \ifcstok{\fittingpageparameter\c!margin}\v!page + \setbox\b_page_fitting\hpack\bgroup + \offsetbox + [\c!leftoffset=\backspace, + \c!rightoffset=\cutspace, + \c!topoffset=\topspace, + \c!bottomoffset=\bottomspace] + {\box\b_page_fitting}% + \egroup + \fi + \ifempty{\fittingpageparameter\c!scale}\else + \setbox\b_page_fitting\hpack\bgroup + \scale[\c!scale=\fittingpageparameter\c!scale]{\box\b_page_fitting}% + \egroup + \fi \ifzeropt\ht\b_page_fitting \ht\b_page_fitting\onepoint \fi @@ -190,7 +194,7 @@ \defineexternalfigure[\v!page:\v!figure][\c!offset=\v!overlay] % we force a parent -\permanent\tolerant\protected\def\startpagefigure[#1]#*[#2]% +\permanent\tolerant\protected\def\startpagefigure[#1]#*[#S#2]% {\bgroup \setupexternalfigure[\v!page:\v!figure][\c!offset=\v!overlay,#2]% \startTEXpage[\c!offset=\namedexternalfigureparameter{\v!page:\v!figure}\c!offset,\c!align=\v!normal]% @@ -200,7 +204,7 @@ {\stopTEXpage \egroup} -\permanent\tolerant\protected\def\pagefigure[#1]#*[#2]% +\permanent\tolerant\protected\def\pagefigure[#1]#*[#S#2]% {\startpagefigure[#1][#2]\stoppagefigure} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl index bdea7b2fe50..c7b31b28c64 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl @@ -44,10 +44,10 @@ \to \everybeforepagebody \permanent\protected\def\initializepagebackgrounds - {\setfalse\c_page_backgrounds_new - \setfalse\c_page_backgrounds_new_right - \setfalse\c_page_backgrounds_new_left - \setfalse\c_page_backgrounds_some} + {\c_page_backgrounds_new\conditionalfalse + \c_page_backgrounds_new_right\conditionalfalse + \c_page_backgrounds_new_left\conditionalfalse + \c_page_backgrounds_some\conditionalfalse} %D We keep calculations and checks to a minimum and also try to minimize %D the amount of tracing due to expansion. @@ -57,80 +57,140 @@ %D This is the only spot where we have a low level dependency on the way %D parent chains are defined but we want the speed. +% \protected\def\page_backgrounds_check_background +% {\ifcsname\??framed\currentotrbackground:\c!background\endcsname +% %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!background\endcsname}% +% \edef\page_background_temp{\lastnamedcs}% +% \ifempty\page_background_temp +% \expandafter\expandafter\expandafter\page_backgrounds_check_frame +% \else +% \page_backgrounds_set_yes +% \fi +% \else +% \expandafter\page_backgrounds_check_frame +% \fi} +% +% \def\page_backgrounds_check_frame +% {\ifcsname\??framed\currentotrbackground:\c!frame\endcsname +% %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!frame\endcsname}% +% \edef\page_background_temp{\lastnamedcs}% +% \ifx\page_background_temp\v!on +% \page_backgrounds_set_yes +% \else +% \expandafter\expandafter\expandafter\page_backgrounds_check_leftframe +% \fi +% \else +% \expandafter\page_backgrounds_check_leftframe +% \fi} +% +% \def\page_backgrounds_check_leftframe +% {\ifcsname\??framed\currentotrbackground:\c!leftframe\endcsname +% %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!leftframe\endcsname}% +% \edef\page_background_temp{\lastnamedcs}% +% \ifx\page_background_temp\v!on +% \page_backgrounds_set_yes +% \else +% \expandafter\expandafter\expandafter\page_backgrounds_check_rightframe +% \fi +% \else +% \expandafter\page_backgrounds_check_rightframe +% \fi} +% +% \def\page_backgrounds_check_rightframe +% {\ifcsname\??framed\currentotrbackground:\c!rightframe\endcsname +% %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!rightframe\endcsname}% +% \edef\page_background_temp{\lastnamedcs}% +% \ifx\page_background_temp\v!on +% \page_backgrounds_set_yes +% \else +% \expandafter\expandafter\expandafter\page_backgrounds_check_topframe +% \fi +% \else +% \expandafter\page_backgrounds_check_topframe +% \fi} +% +% \def\page_backgrounds_check_topframe +% {\ifcsname\??framed\currentotrbackground:\c!topframe\endcsname +% %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!topframe\endcsname}% +% \edef\page_background_temp{\lastnamedcs}% +% \ifx\page_background_temp\v!on +% \page_backgrounds_set_yes +% \else +% \expandafter\expandafter\expandafter\page_backgrounds_check_bottomframe +% \fi +% \else +% \expandafter\page_backgrounds_check_bottomframe +% \fi} +% +% \def\page_backgrounds_check_bottomframe +% {\ifcsname\??framed\currentotrbackground:\c!bottomframe\endcsname +% %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!bottomframe\endcsname}% +% \edef\page_background_temp{\lastnamedcs}% +% \ifx\page_background_temp\v!on +% \page_backgrounds_set_yes +% \else +% \page_backgrounds_set_nop +% \fi +% \else +% \page_backgrounds_set_nop +% \fi} + \protected\def\page_backgrounds_check_background - {\ifcsname\??framed\currentotrbackground:\c!background\endcsname - %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!background\endcsname}% - \edef\page_background_temp{\lastnamedcs}% - \ifempty\page_background_temp - \expandafter\expandafter\expandafter\page_backgrounds_check_frame - \else - \page_backgrounds_set_yes - \fi + {\unless\ifcsname\??framed\currentotrbackground:\c!background\endcsname + \page_backgrounds_check_frame + \orelse\ifempty{\lastnamedcs}% +% \orelse\iflastnamedcs\v!on + \page_backgrounds_check_frame \else - \expandafter\page_backgrounds_check_frame + \page_backgrounds_set_yes \fi} \def\page_backgrounds_check_frame - {\ifcsname\??framed\currentotrbackground:\c!frame\endcsname - %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!frame\endcsname}% - \edef\page_background_temp{\lastnamedcs}% - \ifx\page_background_temp\v!on - \page_backgrounds_set_yes - \else - \expandafter\expandafter\expandafter\page_backgrounds_check_leftframe - \fi + {\unless\ifcsname\??framed\currentotrbackground:\c!frame\endcsname + \page_backgrounds_check_leftframe + \orelse\ifcstok{\lastnamedcs}\v!on +% \orelse\iflastnamedcs\v!on + \page_backgrounds_set_yes \else - \expandafter\page_backgrounds_check_leftframe + \page_backgrounds_check_leftframe \fi} \def\page_backgrounds_check_leftframe - {\ifcsname\??framed\currentotrbackground:\c!leftframe\endcsname - %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!leftframe\endcsname}% - \edef\page_background_temp{\lastnamedcs}% - \ifx\page_background_temp\v!on - \page_backgrounds_set_yes - \else - \expandafter\expandafter\expandafter\page_backgrounds_check_rightframe - \fi + {\unless\ifcsname\??framed\currentotrbackground:\c!leftframe\endcsname + \page_backgrounds_check_rightframe + \orelse\ifcstok{\lastnamedcs}\v!on +% \orelse\iflastnamedcs\v!on + \page_backgrounds_set_yes \else - \expandafter\page_backgrounds_check_rightframe + \page_backgrounds_check_rightframe \fi} \def\page_backgrounds_check_rightframe - {\ifcsname\??framed\currentotrbackground:\c!rightframe\endcsname - %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!rightframe\endcsname}% - \edef\page_background_temp{\lastnamedcs}% - \ifx\page_background_temp\v!on - \page_backgrounds_set_yes - \else - \expandafter\expandafter\expandafter\page_backgrounds_check_topframe - \fi + {\unless\ifcsname\??framed\currentotrbackground:\c!rightframe\endcsname + \page_backgrounds_check_topframe + \orelse\ifcstok{\lastnamedcs}\v!on +% \orelse\iflastnamedcs\v!on + \page_backgrounds_set_yes \else - \expandafter\page_backgrounds_check_topframe + \page_backgrounds_check_topframe \fi} \def\page_backgrounds_check_topframe - {\ifcsname\??framed\currentotrbackground:\c!topframe\endcsname - %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!topframe\endcsname}% - \edef\page_background_temp{\lastnamedcs}% - \ifx\page_background_temp\v!on - \page_backgrounds_set_yes - \else - \expandafter\expandafter\expandafter\page_backgrounds_check_bottomframe - \fi + {\unless\ifcsname\??framed\currentotrbackground:\c!topframe\endcsname + \page_backgrounds_check_bottomframe + \orelse\ifcstok{\lastnamedcs}\v!on +% \orelse\iflastnamedcs\v!on + \page_backgrounds_set_yes \else - \expandafter\page_backgrounds_check_bottomframe + \page_backgrounds_check_bottomframe \fi} \def\page_backgrounds_check_bottomframe - {\ifcsname\??framed\currentotrbackground:\c!bottomframe\endcsname - %\edef\page_background_temp{\csname\??framed\currentotrbackground:\c!bottomframe\endcsname}% - \edef\page_background_temp{\lastnamedcs}% - \ifx\page_background_temp\v!on - \page_backgrounds_set_yes - \else - \page_backgrounds_set_nop - \fi + {\unless\ifcsname\??framed\currentotrbackground:\c!bottomframe\endcsname + \page_backgrounds_set_nop + \orelse\ifcstok{\lastnamedcs}\v!on +% \orelse\iflastnamedcs\v!on + \page_backgrounds_set_yes \else \page_backgrounds_set_nop \fi} @@ -145,7 +205,7 @@ \def\page_backgrounds_set_nop{\letcsname\currentotrbackground\endcsname\undefined} \protected\def\page_backgrounds_check#1% - {\edef\currentotrbackground{\??layoutbackgrounds#1}% + {\cdef\currentotrbackground{\??layoutbackgrounds#1}% \page_backgrounds_check_background} \permanent\def\doifelsesomebackground#1% @@ -240,7 +300,7 @@ %D Calculation is delayed till the page anyway so the state is known. \def\page_backgrounds_recalculate - {\global\settrue\c_page_backgrounds_new} + {\global\c_page_backgrounds_new\conditionaltrue} \def\page_backgrounds_set_boxes {\ifconditional\c_page_backgrounds_new @@ -251,12 +311,12 @@ \page_backgrounds_set_boxes_b \page_backgrounds_set_boxes_c \ifx\p_page_backgrounds_state\v!repeat\else - \global\setfalse\c_page_backgrounds_new + \global\c_page_backgrounds_new\conditionalfalse \fi} \def\page_backgrounds_set_boxes_r - {\global\settrue\c_page_backgrounds_new_right - \global\settrue\c_page_backgrounds_new_left + {\global\c_page_backgrounds_new_right\conditionaltrue + \global\c_page_backgrounds_new_left\conditionaltrue \global\setbox\leftbackground\emptybox \global\setbox\rightbackground\emptybox} @@ -264,22 +324,22 @@ {\ifconditional\c_page_backgrounds_new_left % \showmessage\m!layouts8\empty \page_backgrounds_set_box\leftbackground % \conditionalfalse - \global\setfalse\c_page_backgrounds_new_left - \global\setfalse\c_page_backgrounds_new_right + \global\c_page_backgrounds_new_left\conditionalfalse + \global\c_page_backgrounds_new_right\conditionalfalse \fi} \def\page_backgrounds_set_boxes_b {\ifconditional\c_page_backgrounds_new_left % \showmessage\m!layouts8\empty \page_backgrounds_set_box\leftbackground - \global\setfalse\c_page_backgrounds_new_left + \global\c_page_backgrounds_new_left\conditionalfalse \fi} \def\page_backgrounds_set_boxes_c {\ifconditional\c_page_backgrounds_new_right % \showmessage\m!layouts8\empty \page_backgrounds_set_box\rightbackground - \global\setfalse\c_page_backgrounds_new_right + \global\c_page_backgrounds_new_right\conditionalfalse \fi} \def\page_backgrounds_add_to_main#1% todo: dimension spec @@ -346,7 +406,7 @@ \page_backgrounds_set_offsets \to \everybeforepagebody -\newconditional\swapbackgroundmargins \settrue\swapbackgroundmargins +\newconditional\swapbackgroundmargins \swapbackgroundmargins\conditionaltrue %D The swapping here is pretty nasty! Maybe we should find another way some day but %D for now we tweak. @@ -474,7 +534,7 @@ \newtoks\everybackgroundssetup -\permanent\tolerant\protected\def\setupbackgrounds[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setupbackgrounds[#S#1]#*[#S#2]#*[#S#3]% {\ifarguments \expandafter\gobblethreeoptionals \or @@ -497,9 +557,9 @@ \global\pagebackgroundoffset\d_page_backgrounds_offset\relax \global\pagebackgrounddepth \d_page_backgrounds_depth \relax \ifx\p_page_backgrounds_state\v!stop - \global\setfalse\c_page_backgrounds_new + \global\c_page_backgrounds_new\conditionalfalse \else - \global\settrue \c_page_backgrounds_new + \global\c_page_backgrounds_new\conditionaltrue \fi \to \everybackgroundssetup @@ -509,30 +569,34 @@ \let\page_backgrounds_setup_step_nested\relax -\protected\def\page_backgrounds_setup_double[#1][#2][#3]% if needed we can speed this up - {\global\settrue\c_page_backgrounds_some +\protected\def\page_backgrounds_setup_double[#1][#2][#S#3]% if needed we can speed this up + {\global\c_page_backgrounds_some\conditionaltrue \def\page_backgrounds_setup_step##1% - {\doifelseinset{##1}\v_page_backgrounds_double_set - {\page_backgrounds_setup_and_check{##1}{#3}} - {\def\page_backgrounds_setup_step_nested####1{\page_backgrounds_setup_and_check{##1####1}{#3}}% - \processcommacommand[#2]\page_backgrounds_setup_step_nested}}% + {\ifinset{##1}\v_page_backgrounds_double_set + \page_backgrounds_setup_and_check{##1}{#3}% + \else + \def\page_backgrounds_setup_step_nested####1{\page_backgrounds_setup_and_check{##1####1}{#3}}% + \processcommacommand[#2]\page_backgrounds_setup_step_nested + \fi}% \processcommacommand[#1]\page_backgrounds_setup_step - \the\everybackgroundssetup} - -\protected\def\page_backgrounds_setup_single[#1][#2][#-]% - {\global\settrue\c_page_backgrounds_some - \doifelsecommon{#1}\v_page_backgrounds_single_set - {\def\page_backgrounds_setup_step##1{\page_backgrounds_setup_and_check{##1}{#2}}% - \processcommacommand[#1]\page_backgrounds_setup_step - \the\everybackgroundssetup}% - {\page_backgrounds_setup_double[#1][\v_page_backgrounds_common_set][#2]}} + \expand\everybackgroundssetup} + +\protected\def\page_backgrounds_setup_single[#1][#S#2][#-]% + {\global\c_page_backgrounds_some\conditionaltrue + \ifcommon{#1}\v_page_backgrounds_single_set + \def\page_backgrounds_setup_step##1{\page_backgrounds_setup_and_check{##1}{#2}}% + \processcommacommand[#1]\page_backgrounds_setup_step + \expand\everybackgroundssetup + \else + \page_backgrounds_setup_double[#1][\v_page_backgrounds_common_set][#2]% + \fi} -\protected\def\page_backgrounds_setup_basics[#1][#-][#-]% +\protected\def\page_backgrounds_setup_basics[#S#1][#-][#-]% {\setupframed[\??layoutbackgrounds][#1]% - \the\everybackgroundssetup} + \expand\everybackgroundssetup} \protected\def\page_backgrounds_setup_and_check#1#2% tag settings - {\edef\currentotrbackground{\??layoutbackgrounds#1}% + {\cdef\currentotrbackground{\??layoutbackgrounds#1}% \setupframed[\currentotrbackground][#2]% \page_backgrounds_check_background} @@ -594,12 +658,12 @@ % spread-2 .. spread+2 achter spread -> spread (repeat 2 times) \permanent\protected\def\enablehiddenbackground - {\global\settrue\c_page_backgrounds_hidden_enabled - \global\settrue\c_page_backgrounds_some + {\global\c_page_backgrounds_hidden_enabled\conditionaltrue + \global\c_page_backgrounds_some\conditionaltrue \page_backgrounds_recalculate} \permanent\protected\def\disablehiddenbackground - {\global\setfalse\c_page_backgrounds_hidden_enabled} + {\global\c_page_backgrounds_hidden_enabled\conditionalfalse} \immutable\def\hiddenbackgroundlist {\v!text-2,\v!text-1,\v!foreground,\v!text+1,\v!text+2} @@ -619,7 +683,7 @@ %D Because we haven't really set up backgrounds yet, we set the main efficiency %D switch to false. -\setfalse\c_page_backgrounds_some +\c_page_backgrounds_some\conditionalfalse %D Sometimes you have a document wide (page) background but need to overload it %D locally. In such case (at least in my experience) the only values that get set @@ -648,7 +712,7 @@ \permanent\protected\def\pushbackground[#1]% {\pushmacro\popbackground - \edef\currentotrbackground{\??layoutbackgrounds#1}% + \cdef\currentotrbackground{\??layoutbackgrounds#1}% \enforced\permanent\protected\edef\popbackground {\setupframed [\currentotrbackground] @@ -706,4 +770,3 @@ % \placefigure{none}{\starttabulate\NC test\nc test\NC\NR\stoptabulate} % \input tufte % \stopcolumnset - diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt b/Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt index 4a4441fd10c..85e91c1329f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt @@ -10,7 +10,7 @@ local context = context local implement = interfaces.implement local texgetcount = tex.getcount -local c_realpageno = tex.iscount("realpageno") +local c_realpageno = tex.iscount("realpageno") local blocks = { } local block = false diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx index 3d78e73d80f..739751572e7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx @@ -115,12 +115,12 @@ \unskip}} \def\page_boxes_apply_orientate_paper#box% - {\ifnum\number\c_page_target_paper_orientation\number\c_page_target_paper_reverse>\zerocount + {\ifnum\the\c_page_target_paper_orientation\the\c_page_target_paper_reverse>\zerocount \page_boxes_apply_orientate_indeed\c_page_target_paper_orientation\c_page_target_paper_reverse{#box}% \fi} \def\page_boxes_apply_orientate_print#box% - {\ifnum\number\c_page_target_print_orientation\number\c_page_target_print_reverse>\zerocount + {\ifnum\the\c_page_target_print_orientation\the\c_page_target_print_reverse>\zerocount \page_boxes_apply_orientate_indeed\c_page_target_print_orientation\c_page_target_print_reverse{#box}% \fi} @@ -183,7 +183,7 @@ % best use private variables -\newconditional\c_page_boxes_clip_print \settrue\c_page_boxes_clip_print +\newconditional\c_page_boxes_clip_print \c_page_boxes_clip_print\conditionaltrue \def\page_boxes_apply_clip_print_left % box {\ifconditional\c_page_boxes_clip_print @@ -293,7 +293,7 @@ \newbox \b_page_areas_registered \permanent\protected\def\enabletextarearegistration - {\global\settrue\c_page_areas_enabled} + {\global\c_page_areas_enabled\conditionaltrue} \def\page_areas_registered_box {\ifconditional\c_page_areas_enabled diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl index 8c92148fca4..2b9c1ba120a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl @@ -39,7 +39,7 @@ % \definepagebreak[instance][forsure] % \definepagebreak[forsure][yes,+4] -\newconditional\c_page_breaks_enabled \settrue\c_page_breaks_enabled +\newconditional\c_page_breaks_enabled \c_page_breaks_enabled\conditionaltrue \newinteger \c_page_breaks_prevpage \newtoks\everybeforepagebreak @@ -84,13 +84,13 @@ {\par % else no vertical penalties, always before group so that we clear hangs etc (as in side floats) \ifvmode % extra check \begingroup - \the\everybeforepagebreak + \expand\everybeforepagebreak \c_page_breaks_prevpage\realpageno \ifcase\pageornamentstate \or % disable reset after shipout \global\pageornamentstate\plustwo \fi - % maybe \iftok{#1}\emptytoks + % maybe \ifempty{#1}% \ifparameter#1\or \page_breaks_handle{#1}% \else % so, no pagebreak when \pagebreak[] ! ! ! @@ -100,7 +100,7 @@ \ifnum\c_page_breaks_prevpage<\realpageno \global\pageornamentstate\zerocount \fi - \the\everyafterpagebreak + \expand\everyafterpagebreak \endgroup \fi} @@ -119,7 +119,7 @@ \fi} \permanent\protected\def\resetpagebreak % used elsewhere too - {\global\settrue\c_page_breaks_enabled} + {\global\c_page_breaks_enabled\conditionaltrue} \permanent\protected\def\simplifypagebreak % to be used grouped ! {\enforced\permanent\protected\def\pagebreak[##1]{\goodbreak}} @@ -140,20 +140,20 @@ \endgroup} \protected\def\page_breaks_unknown % how often called ? - {\doifelseinstring{+}\page_breaks_current_option - {\page_otr_command_flush_all_floats + {\ifhastok+\page_breaks_current_option + \page_otr_command_flush_all_floats + \page_otr_command_next_page + \dorecurse\page_breaks_current_option\page_otr_insert_dummy_page + \orelse\ifchknum\page_breaks_current_option\or + \page_otr_command_flush_all_floats \page_otr_command_next_page - \dorecurse\page_breaks_current_option\page_otr_insert_dummy_page} - {\doifelsenumber\page_breaks_current_option - {\page_otr_command_flush_all_floats - \page_otr_command_next_page - \doloop - {\ifnum\userpageno<\page_breaks_current_option\relax - \page_otr_insert_dummy_page - \else - \exitloop - \fi}} - {}}} + \localcontrolledrepeating + {\ifnum\userpageno<\page_breaks_current_option\relax + \page_otr_insert_dummy_page + \else + \quitloop + \fi}% + \fi} \installpagebreakmethod \s!unknown {\page_breaks_unknown} @@ -166,7 +166,7 @@ \resetpagebreak} \installpagebreakmethod \v!disable - {\global\setfalse\c_page_breaks_enabled} + {\global\c_page_breaks_enabled\conditionalfalse} \installpagebreakmethod \v!yes {\ifconditional\c_page_breaks_enabled @@ -239,11 +239,13 @@ \installpagebreakmethod \v!quadruple % not yet ok inside columnsets {\ifdoublesided - \ifcase\modulonumber\plusfour\realpageno\else + % \ifcase\modulonumber\plusfour\realpageno\else + \ifcase\numexpr\realpageno;\plusfour\relax\else \page_breaks_handle_direct\v!yes - \doloop - {\ifcase\modulonumber\plusfour\realpageno\relax - \exitloop + \localcontrolledrepeating + %{\ifcase\modulonumber\plusfour\realpageno\relax + {\ifcase\numexpr\realpageno;\plusfour\relax + \quitloop \else \page_breaks_handle_direct\v!empty \fi}% @@ -269,8 +271,8 @@ \page_breaks_handle_direct\v!empty \fi} -\installpagebreakmethod \v!start {\global\settrue \c_otr_shipout_enabled} -\installpagebreakmethod \v!stop {\global\setfalse\c_otr_shipout_enabled} +\installpagebreakmethod \v!start {\global\c_otr_shipout_enabled\conditionaltrue} +\installpagebreakmethod \v!stop {\global\c_otr_shipout_enabled\conditionalfalse} \installpagebreakmethod{xy}% for Mojca {\page_breaks_handle_direct\v!yes @@ -322,17 +324,17 @@ \permanent\tolerant\protected\def\columnbreak[#1]% {\par % else no vertical penalties \begingroup - \the\everybeforecolumnbreak + \expand\everybeforecolumnbreak \ifparameter#1\or \page_breaks_columns_handle{#1}% \else \page_breaks_columns_handle_direct\v!yes \fi \relax - \the\everyaftercolumnbreak + \expand\everyaftercolumnbreak \endgroup % outside group e.g. setting hsize - \the\everysynchronizecolumn} + \expand\everysynchronizecolumn} \aliased\let\column\columnbreak @@ -376,7 +378,7 @@ \relax \ifconditional\c_page_breaks_enabled \begingroup - \edef\currentpagechecker{#1}% + \cdef\currentpagechecker{#1}% \setupcurrentpagechecker[#2]% \csname\??pagecheckermethod\pagecheckerparameter\c!method\endcsname \endgroup @@ -484,4 +486,26 @@ \fi \fi} +%D Experiment: + +\permanent\protected\def\setpagelooseness[#1]% + {\begingroup + \ifchkdimension#1\lineheight\or + \additionalpageskip + \lastchkdimension + \relax + \else + \letdummyparameter\c!lines \zerocount + \letdummyparameter\c!height \zeropoint + \letdummyparameter\c!stretch\zeropoint + \letdummyparameter\c!shrink \zeropoint + \getdummyparameters[#1]% + \additionalpageskip + \dimexpr\dummyparameter\c!height+\lineheight*\dummyparameter\c!lines\relax + \s!plus \dummyparameter\c!stretch + \s!minus\dummyparameter\c!shrink + \relax + \fi + \endgroup} + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl index c2598afc172..4002f0a36b1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl @@ -30,6 +30,11 @@ \newdimension \columndistance \newconstant \columndirection % 0:lr 1:rl +\pushoverloadmode + \newuserunit \columnwidth cw % column width + \newuserunit \columndistance cd % column distance +\popoverloadmode + \setnewconstant\maxnofcolumns 50 \setnewconstant\allocatednofcolumns 0 diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl index ae408f384ad..6f6ef38e67e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl @@ -84,28 +84,28 @@ \defcsname\??pagecommentlocations\v!bottom\endcsname {\setuplayout[\c!location=]% - \setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=\vss,\c!left=\hskip\d_page_comments_offset,\c!right=]% + \setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=\vss,\c!left=\hkern\d_page_comments_offset,\c!right=]% \d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_height\relax \d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset\relax \defineoverlay[\v!pagecomment][\page_comments_top_bottom]} \defcsname\??pagecommentlocations\v!top\endcsname {\setuplayout[\c!location=]% - \setuppapersize[\c!top=\vss,\c!bottom=\vskip\d_page_comments_offset,\c!left=\hskip\d_page_comments_offset,\c!right=]% + \setuppapersize[\c!top=\vss,\c!bottom=\vskip\d_page_comments_offset,\c!left=\hkern\d_page_comments_offset,\c!right=]% \d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_height\relax \d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset\relax \defineoverlay[\v!pagecomment][\page_comments_top_bottom]} \defcsname\??pagecommentlocations\v!left\endcsname {\setuplayout[\c!location=]% - \setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=,\c!left=\hss,\c!right=\hskip\d_page_comments_offset]% + \setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=,\c!left=\hss,\c!right=\hkern\d_page_comments_offset]% \d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset\relax \d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_width\relax \defineoverlay[\v!pagecomment][\page_comments_left_right]} \defcsname\??pagecommentlocations\v!right\endcsname {\setuplayout[\c!location=]% - \setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=,\c!left=\hskip\d_page_comments_offset,\c!right =\hss]% + \setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=,\c!left=\hkern\d_page_comments_offset,\c!right =\hss]% \d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset\relax \d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_width\relax \defineoverlay[\v!pagecomment][\page_comments_left_right]} @@ -123,13 +123,13 @@ \vskip\d_page_comments_offset \vss \fi - \hskip\d_page_comments_offset + \hkern\d_page_comments_offset \vbox to \d_page_comments_height {%\forgetall \hsize\paperwidth \ifconditional\c_page_comment_enabled \getbuffer[\v!pagecomment]% - \global\setfalse\c_page_comment_enabled + \global\c_page_comment_enabled\conditionalfalse \fi}% \hfill \ifx\p_page_commands_location\v!bottom @@ -142,9 +142,9 @@ \protected\def\page_comments_left_right {\hpack to \printpaperwidth {\ifx\p_page_commands_location\v!right - \hskip\dimexpr\paperwidth+\d_page_comments_distance+\d_page_comments_offset\relax + \hkern\dimexpr\paperwidth+\d_page_comments_distance+\d_page_comments_offset\relax \else - \hskip\d_page_comments_offset + \hkern\d_page_comments_offset \hss \fi \vbox to \printpaperheight @@ -153,18 +153,18 @@ \hsize\d_page_comments_width \ifconditional\c_page_comment_enabled \getbuffer[\v!pagecomment]% - \global\setfalse\c_page_comment_enabled + \global\c_page_comment_enabled\conditionalfalse \fi \vss}% \ifx\p_page_commands_location\v!right \hss - \hskip\d_page_comments_offset + \hkern\d_page_comments_offset \else - \hskip\dimexpr\paperwidth+\d_page_comments_distance+\d_page_comments_offset\relax + \hkern\dimexpr\paperwidth+\d_page_comments_distance+\d_page_comments_offset\relax \fi}} \permanent\protected\defcsname\e!start\v!pagecomment\endcsname - {\global\settrue\c_page_comment_enabled + {\global\c_page_comment_enabled\conditionaltrue \grabbufferdatadirect\v!pagecomment{\e!start\v!pagecomment}{\e!stop\v!pagecomment}} \aliased\letcsname\e!stop\v!pagecomment\endcsname\relax diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl index 6e5ed21686a..7e93a4b0da4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl @@ -124,7 +124,7 @@ {\chaintocurrentpagegrid{\currentpagegrid:#1}}% \to \everydefinepagegrid -\permanent\tolerant\protected\def\startpagegrid[#1]#*[#2]% +\permanent\tolerant\protected\def\startpagegrid[#S#1]#*[#S#2]% {\bgroup \enforced\let\startpagegrid\page_grd_start_dummy \ifarguments @@ -134,10 +134,10 @@ \lettonothing\currentpagegrid \setupcurrentpagegrid[#1]% \else - \def\currentpagegrid{#1}% + \cdef\currentpagegrid{#1}% \fi \or - \edef\currentpagegrid{#1}% + \cdef\currentpagegrid{#1}% \setupcurrentpagegrid[#2]% \fi \usepageparameter\pagegridparameter @@ -186,7 +186,7 @@ % }%\begingroup} -\tolerant\def\page_grd_start_dummy[#1]#*[#2]% +\tolerant\def\page_grd_start_dummy[#S#1]#*[#S#2]% {\let\page_grd_stop\egroup} \permanent\protected\def\stoppagegrid @@ -204,7 +204,7 @@ \page_otr_command_set_vsize \page_otr_command_set_hsize} -\permanent\protected\def\reservepagegrid[#1]% +\permanent\protected\def\reservepagegrid[#S#1]% {\begingroup \letdummyparameter\c!c\plusone \letdummyparameter\c!r\plusone @@ -220,7 +220,7 @@ }% \endgroup} -\permanent\tolerant\protected\def\setpagegrid[#1]% +\permanent\tolerant\protected\def\setpagegrid[#S#1]% {\begingroup \letdummyparameter\c!c\zerocount \letdummyparameter\c!r\zerocount @@ -309,7 +309,7 @@ \page_lines_add_numbers_to_box\b_page_grd_column\privatescratchcounter\c_page_grd_n_of_left\plustwo \fi \begingroup - \edef\currentpagegrid{\currentpagegrid:#1}% + \cdef\currentpagegrid{\currentpagegrid:#1}% \inheritedpagegridframedbox\box\b_page_grd_column \endgroup} @@ -318,17 +318,19 @@ \setbox\b_page_grd_collected\hpack\bgroup \clf_preparecolumnsetflush{\currentpagegrid}% \letpagegridparameter\c!region\currentpagegrid - \doifelse{\pagegridparameter\c!direction}\v!reverse - {\dostepwiserecurse\c_page_grd_last_column\c_page_grd_first_column\minusone - {\page_grd_command_flush_page_column{##1}% - \ifnum##1>\plusone - \kern\namedpagegridparameter{\currentpagegrid:##1}\c!distance\relax - \fi}}% - {\dostepwiserecurse\c_page_grd_first_column\c_page_grd_last_column\plusone - {\page_grd_command_flush_page_column{##1}% - \ifnum##1<\c_page_grd_last_column - \kern\namedpagegridparameter{\currentpagegrid:##1}\c!distance\relax - \fi}}% + \ifcstok{\pagegridparameter\c!direction}\v!reverse + \dostepwiserecurse\c_page_grd_last_column\c_page_grd_first_column\minusone + {\page_grd_command_flush_page_column{##1}% + \ifnum##1>\plusone + \kern\namedpagegridparameter{\currentpagegrid:##1}\c!distance\relax + \fi}% + \else + \dostepwiserecurse\c_page_grd_first_column\c_page_grd_last_column\plusone + {\page_grd_command_flush_page_column{##1}% + \ifnum##1<\c_page_grd_last_column + \kern\namedpagegridparameter{\currentpagegrid:##1}\c!distance\relax + \fi}% + \fi \clf_finishcolumnsetflush{\currentpagegrid}% \egroup \page_otr_construct_and_shipout\box\b_page_grd_collected\zerocount % three arguments @@ -393,14 +395,14 @@ % needs checking \protected\def\page_grd_command_flush_floats - {\wait\global\settrue\c_page_floats_flushing + {\wait\global\c_page_floats_flushing\conditionaltrue \ifconditional\c_page_floats_some_waiting \par \page_grd_command_flush_floats_indeed \fi \global\savednoffloats\zerocount - \global\setfalse\c_page_floats_some_waiting - \global\setfalse\c_page_floats_flushing} + \global\c_page_floats_some_waiting\conditionalfalse + \global\c_page_floats_flushing\conditionalfalse} \def\page_grd_command_flush_floats_indeed % much in common with OTRSET {\ifconditional\c_page_floats_some_waiting @@ -411,7 +413,7 @@ % \or % \page_floats_get \else - \setfalse\c_page_floats_center_box % not needed as we do call directly + \c_page_floats_center_box\conditionalfalse % not needed as we do call directly \global\setbox\floatbox\hbox to \hsize {\hfil \dorecurse\nofcollectedfloats @@ -448,9 +450,9 @@ box \floatbox }% \ifcase\c_page_grd_reserved_state - \global\settrue\c_page_floats_room + \global\c_page_floats_room\conditionaltrue \else - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \fi} \protected\def\page_grd_place_float_here_indeed @@ -641,7 +643,7 @@ \synchronizepagegrid \bgroup \forgetall - \edef\currentpagegridspan{#1}% + \cdef\currentpagegridspan{#1}% \clf_sethsizecolumnspan{\currentpagegrid}\pagegridspanparameter\c!n\relax \setbox\scratchbox\hbox\bgroup\inheritedpagegridspanframed\bgroup \def\page_grd_span_stop{\page_grd_span_stop_indeed{#2}}% @@ -718,7 +720,7 @@ \to \everydefinepagegridarea \permanent\tolerant\protected\def\setuppagegridareatext[#1]#*[#2]% - {\edef\currentpagegridarea{#1}% + {\cdef\currentpagegridarea{#1}% \setpagegridareaparameter\c!text{#2}} % maybe move the left/right correction to the tex end or the offset to lua @@ -727,7 +729,7 @@ \permanent\protected\def\setpagegridarea#1#2#3#4#5#6#7#8% can be optimized {\begingroup - \edef\currentpagegridarea{#2}% + \cdef\currentpagegridarea{#2}% \setpagegridareaparameter\c!width {#5\scaledpoint}% \setpagegridareaparameter\c!height{#6\scaledpoint}% \setbox\nextbox\hpack\bgroup\inheritedpagegridareaframed\bgroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-fac.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-fac.mkxl index 03fa9821724..1c1e0354488 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-fac.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-fac.mkxl @@ -75,7 +75,11 @@ \fi} \appendtoks - \doifelse{\directoppositeplacingparameter\c!state}\v!start\settrue\setfalse\c_page_facings_busy + \ifcstok{\directoppositeplacingparameter\c!state}\v!start + \c_page_facings_busy\conditionaltrue + \else + \c_page_facings_busy\conditionalfalse + \fi \to \everysetupoppositeplacing \setupoppositeplacing diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl index 02c56e2e9e5..22a11e1fe5d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl @@ -107,13 +107,13 @@ \endgroup}} \def\page_otr_flush_top_content - {\scratchcounter\getboxcountfromcache{\v!page:\number\realpageno}\relax + {\scratchcounter\getboxcountfromcache{\v!page:\the\realpageno}\relax \ifcase\scratchcounter\else \dorecurse\scratchcounter - {\directboxfromcache{\v!page:\number\realpageno}\recurselevel + {\directboxfromcache{\v!page:\the\realpageno}\recurselevel \nointerlineskip \par}% - \disposeboxesincache{\v!page:\number\realpageno}% + \disposeboxesincache{\v!page:\the\realpageno}% \global\advanceby\c_page_adapts_pushed\minusone \nointerlineskip \fi} @@ -161,7 +161,7 @@ \appendtoks \advanceby\c_defining_facing_float\plusone \ifcase\c_defining_facing_float\or - \expanded{ + \normalexpanded{ \definefacingfloat[\currentfacingfloat:\v!left ][\currentfacingfloat]% \definefacingfloat[\currentfacingfloat:\v!right][\currentfacingfloat]% }% @@ -192,7 +192,7 @@ \def\strc_floats_facing_flush_indeed#1% {\begingroup - \edef\currentfacingfloat{#1}% + \cdef\currentfacingfloat{#1}% \glet\page_check_weird_page\page_check_weird_page_indeed % for now only when facing floats \scratchcounterone \realpageno \scratchcounterthree\getboxcountfromcache{\currentfacingfloat:\v!left }\relax @@ -251,7 +251,7 @@ {\processcommalist[#1]\strc_floats_facing_flush_indeed} \protected\def\strc_floats_facing_setup - {\edef\currentfacingfloat{\currentfacingfloat:\m_strc_floats_state}% + {\cdef\currentfacingfloat{\currentfacingfloat:\m_strc_floats_state}% \usefacingfloatstyleandcolor\c!style\v!color} \protected\def\strc_floats_facing_collect @@ -298,7 +298,7 @@ \permanent\protected\def\startfacingfloat[#1]% {\begingroup - \edef\currentfacingfloat{#1}% + \cdef\currentfacingfloat{#1}% \edef\p_width{\facingfloatparameter\c!width}% \letfacingfloatparameter\c!width\v!fit \ifx\p_width\v!frame @@ -345,16 +345,16 @@ \else \begingroup \setbox\scratchboxone\hpack\bgroup - \edef\currentfacingfloat{\currentfacingfloat:#2}% + \cdef\currentfacingfloat{\currentfacingfloat:#2}% \inheritedfacingfloatframed{\strut}% \egroup \scratchdimenone\dimexpr\textheight-\htdp\scratchboxone+\lineheight\relax \dontcomplain - \splittopskip\zeropoint + \splittopskip\zeroskip \setbox\scratchbox\vsplit#1 upto \scratchdimenone \setsplitlisthtdp\scratchbox\strutht\strutdp \setbox\scratchbox\hpack\bgroup - \edef\currentfacingfloat{\currentfacingfloat:#2}% + \cdef\currentfacingfloat{\currentfacingfloat:#2}% \inheritedfacingfloatframed{\box\scratchbox}% \egroup \setbox\scratchbox\vbox diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl index fb699626432..09afa7b51bf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl @@ -52,10 +52,10 @@ \newconditional\c_page_floats_some_waiting \newconditional\c_page_floats_not_permitted \newconditional\c_page_floats_flushing -\newconditional\c_page_floats_center_box \settrue\c_page_floats_center_box +\newconditional\c_page_floats_center_box \c_page_floats_center_box\conditionaltrue \newconditional\c_page_floats_center_box_local \newconditional\c_page_floats_center_box_global -\newconditional\c_page_floats_compress_flushed \settrue\c_page_floats_compress_flushed +\newconditional\c_page_floats_compress_flushed \c_page_floats_compress_flushed\conditionaltrue \newdimension \d_page_floats_compress_distance @@ -87,35 +87,35 @@ \appendtoks \ifcase\savednoffloats - \global\setfalse\c_page_floats_some_waiting + \global\c_page_floats_some_waiting\conditionalfalse \else - \global\settrue\c_page_floats_some_waiting + \global\c_page_floats_some_waiting\conditionaltrue \fi \to \everyfloatscheck \protected\def\page_floats_flush#1#2% {\clf_flushfloat{#1}#2\relax - \the\everyfloatscheck} + \expand\everyfloatscheck} \protected\def\page_floats_flush_by_label#1#2% {\clf_flushlabeledfloat{#1}{#2}\relax - \the\everyfloatscheck} + \expand\everyfloatscheck} \protected\def\page_floats_save#1% {\clf_savefloat{#1}\relax - \the\everyfloatscheck} + \expand\everyfloatscheck} \protected\def\page_floats_resave#1% {\clf_resavefloat{#1}\relax - \the\everyfloatscheck} + \expand\everyfloatscheck} \protected\def\page_floats_push_saved {\clf_pushfloat - \the\everyfloatscheck} + \expand\everyfloatscheck} \protected\def\page_floats_pop_saved {\clf_popfloat - \the\everyfloatscheck} + \expand\everyfloatscheck} \protected\def\page_floats_get_info#1% {\clf_consultfloat{#1}} @@ -161,7 +161,7 @@ \ifvoid\floatbox \exitloop \else - \def\currentfloat{#1}% + \cdef\currentfloat{#1}% \blank[\rootfloatparameter\c!spacebefore]% \box\floatbox \blank[\rootfloatparameter\c!spaceafter]% @@ -189,9 +189,9 @@ \newbox\b_strc_float_saved -\permanent\tolerant\protected\def\placesavedfloat[#1]#*[#2]#*[#3]% experiment for Alan B +\permanent\tolerant\protected\def\placesavedfloat[#1]#*[#2]#*[#S#3]% experiment for Alan B {\clf_flushlabeledfloat\s!somewhere{#2}\relax - %\def\currentfloat{#1}% + %\cdef\currentfloat{#1}% \setbox\b_strc_float_saved\vpack{\box\floatbox}% \startplacefloat[#1][\c!location=\v!none,#3]% \box\b_strc_float_saved @@ -218,7 +218,7 @@ \aliased\let\placesetupfloat\gobbleoneoptional -\permanent\tolerant\protected\def\placefloatwithsetups[#1]#*[#2]#*[#3]#:#4% +\permanent\tolerant\protected\def\placefloatwithsetups[#1]#*[#S#2]#*[#S#3]#:#4% {\def\floatsetupcaption{#4}% \def\floatsetupcontent{\copy\nextbox}% \def\floatsetupwidth {\wd\nextbox}% @@ -301,39 +301,19 @@ \newconditional\c_page_floats_flushed -% \def\page_floats_flush_page_floats_indeed#1% future releases can do more clever things -% {\page_floats_flush{#1}\plusone -% \edef\floatspecification{\clf_getfloatvariable{specification}}% Is this okay? -% \the\everybeforeflushedpagefloat -% \vpack to \textheight -% {\doifnotinset\v!high\floatspecification\vfill -% \box\floatbox -% \doifnotinset\v!low\floatspecification\vfill}% -% \page_otr_fill_and_eject_page} - -% \protected\def\page_floats_flush_page_floats % used in postpone -% {\edef\m_page_otr_checked_page_float{\clf_checkedpagefloat}% -% \ifempty\m_page_otr_checked_page_float -% % nothing -% \orelse\ifx\m_page_otr_checked_page_float\v!empty -% \emptyhbox \page_otr_fill_and_eject_page % why not dummy_page -% \else -% \page_floats_flush_page_floats_indeed\m_page_otr_checked_page_float -% \fi} - \def\page_floats_flush_page_floats_inject#1% future releases can do more clever things {\page_floats_flush{#1}\plusone \edef\floatspecification{\clf_getfloatvariable{specification}}% Is this okay? - \the\everybeforeflushedpagefloat + \expand\everybeforeflushedpagefloat \vpack to \textheight - {\doifnotinset\v!high\floatspecification\vfill + {\ifinset\v!high\floatspecification\else\vfill\fi \box\floatbox - \doifnotinset\v!low\floatspecification\vfill}% - % \page_otr_fill_and_eject_page - \global\settrue\c_page_floats_flushed} + \ifinset\v!low \floatspecification\else\vfill\fi}% + \page_otr_fill_and_eject_page % needed + \global\c_page_floats_flushed\conditionaltrue} \protected\def\page_floats_flush_page_floats % used in postpone - {\global\setfalse\c_page_floats_flushed + {\global\c_page_floats_flushed\conditionalfalse \page_floats_flush_page_floats_indeed \ifconditional\c_page_floats_flushed \page_otr_fill_and_eject_page diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl index c1d480e9856..f453f490b62 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl @@ -100,7 +100,7 @@ \permanent\protected\def\starttextflow[#1]% {\begingroup - \edef\currenttextflow{#1}% + \cdef\currenttextflow{#1}% \ifcsname\??textflowbox\currenttextflow\endcsname \b_page_textflow_box\csname\??textflowbox\currenttextflow\endcsname \global\setbox\b_page_textflow_box\vbox @@ -120,7 +120,7 @@ \permanent\protected\def\flushtextflow#1% {\begingroup - \edef\currenttextflow{#1}% + \cdef\currenttextflow{#1}% \ifcsname\??textflowbox\currenttextflow\endcsname \b_page_textflow_box\csname\??textflowbox\currenttextflow\endcsname \ifvoid\b_page_textflow_box diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl index 4c192c5549a..cafab289f59 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl @@ -32,7 +32,7 @@ \aliased\let\stoptextdata\relax \def\page_shipouts_flush_text_data_indeed - {\vsmashed{\the\t_page_text_data}% + {\vsmashed{\expand\t_page_text_data}% \global\t_page_text_data\emptytoks \glet\page_shipouts_flush_text_data\relax} @@ -68,11 +68,7 @@ \scratchtoks\emptytoks \dostepwiserecurse{#1}{\numexpr#2-\plusone\relax}\plusone{\etoksapp\scratchtoks{##1,}}% \xdef\pagestoshipout{\the\scratchtoks,\number#2}% - \doglobal\appendtoks - \ifnum\realpageno>\numexpr#2+\plusone\relax - \global\everypar{\normalend}% - \fi - \to\everyaftershipout + \gtoksapp\everyaftershipout{\ifnum\realpageno>\numexpr#2+\plusone\relax\global\everypar{\normalend}\fi}% \endgroup} \permanent\protected\def\installshipoutmethod#1#2% % a handler takes one argument: something to be boxed @@ -136,7 +132,7 @@ \ifcase\c_page_boxes_flush_n\else \page_boxes_flush_before \fi - \the\everybeforeshipout + \expand\everybeforeshipout \ifcase\shipoutfinalizemethod % not nice ... needs thinking \page_shipouts_handle{#1}% \else @@ -147,7 +143,7 @@ \box\shipoutscratchbox}% \fi \setnextrealpageno % so this comes before \everyaftershipout so in fact: - \the\everyaftershipout % at this point we're already on the next realpage + \expand\everyaftershipout % at this point we're already on the next realpage \ifcase\c_page_boxes_flush_n\else \page_boxes_flush_after \fi} @@ -168,14 +164,14 @@ \setbox\scratchbox\hpack {% before the main one ! \ifcase\realfolio \or - \the\everyfirstshipout + \expand\everyfirstshipout \global\everyfirstshipout\emptytoks \fi % the main one - \the\everyshipout\relax + \expand\everyshipout\relax % always last (and after the main one) \ifnum\realpageno=\lastpage\relax - \the\everylastshipout + \expand\everylastshipout \global\everylastshipout\emptytoks \fi}% \smashbox\scratchbox @@ -187,7 +183,8 @@ \pushoverloadmode \permanent\protected\def\shipout - {\begingroup\dowithnextboxcs\endgroup} + %{\begingroup\dowithnextboxcs\endgroup} + {\bgroup\aftergroup\egroup\setbox\shipoutscratchbox} \popoverloadmode @@ -218,8 +215,10 @@ \else \donetrue \fi - \else % testen, aangepast / expanded nodig ? - \normalexpanded{\doifelseinset{\the\shippedoutpages}{\pagestoshipout}}\donetrue\donefalse + \orelse\ifinset{\the\shippedoutpages}{\pagestoshipout}% + \donetrue + \else + \donefalse \fi \ifdone \setbox\shipoutscratchbox\hpack @@ -237,7 +236,7 @@ \page_shipouts_ignore{#1}% \fi} -\newconditional\c_page_shipouts_use_objects \settrue\c_page_shipouts_use_objects +\newconditional\c_page_shipouts_use_objects \c_page_shipouts_use_objects\conditionaltrue \installcorenamespace {arrangedpage} @@ -302,16 +301,16 @@ {} % no default and check if empty, we can have ,,, \doinstallarrangedoption\v!disable - {\global\settrue\arrangingdisabledstate} + {\global\arrangingdisabledstate\conditionaltrue} \doinstallarrangedoption\v!mirrored - {\global\settrue\arrangedmirrorstate} + {\global\arrangedmirrorstate\conditionaltrue} \doinstallarrangedoption\v!doublesided - {\global\settrue\arrangeddoublestate} + {\global\arrangeddoublestate\conditionaltrue} \doinstallarrangedoption\v!negative - {\global\settrue\arrangednegatestate} + {\global\arrangednegatestate\conditionaltrue} \doinstallarrangedoption\v!rotated {\gdef\arrangedrotationO {90}% @@ -336,7 +335,7 @@ {\global\arrangingpagesfalse} \doinstallarrangedoption\v!background - {\global\settrue\arrangedbackgroundstate} + {\global\arrangedbackgroundstate\conditionaltrue} \aliased\let\poparrangedpages \relax \aliased\let\pusharrangedpage \gobbleoneargument @@ -344,12 +343,12 @@ \permanent\protected\def\setuparranging[#1]% {\ifconditional\arrangingdisabledstate \else - %global\setfalse\arrangingdisabledstate + %global\arrangingdisabledstate\conditionalfalse \global\arrangingpagestrue % will be conditional - \global\setfalse\arrangednegatestate - \global\setfalse\arrangedmirrorstate - \global\setfalse\arrangeddoublestate - \global\setfalse\arrangedswapstate + \global\arrangednegatestate\conditionalfalse + \global\arrangedmirrorstate\conditionalfalse + \global\arrangeddoublestate\conditionalfalse + \global\arrangedswapstate\conditionalfalse \gdef\arrangedrotationO{0}% \gdef\arrangedrotationE{180}% % if we use --arrange we have an initial "disable" here @@ -459,7 +458,7 @@ {\setbox\scratchbox\vpack to \arrangedpageY\paperheight {\offinterlineskip \vskip#4\paperheight - \hskip#3\paperwidth + \hkern#3\paperwidth \dorotatebox{\ifcase#2 0\else180\fi}\hpack{\box#1}% \vfill}% \wd\scratchbox\zeropoint @@ -645,7 +644,7 @@ % 2UP/2DOWN / 1pt prevents overflow \permanent\protected\def\splitoffarrangedpagesTWO - {\splittopskip\zeropoint + {\splittopskip\zeroskip \global\setbox\arrangedpageA\vsplit\arrangedpageB to \onepoint \scratchdimen\dimexpr\ht\arrangedpageB-\onepoint\relax \ifdim\scratchdimen>\onepoint @@ -662,14 +661,14 @@ \box\arrangedpageA \page_boxes_apply_clip_print_right\arrangedpageB \box\arrangedpageB}% - \setfalse\arrangedswapstate + \arrangedswapstate\conditionalfalse \else \global\setbox\arrangedpageA\hpack {\page_boxes_apply_clip_print_left \arrangedpageB \box\arrangedpageB \page_boxes_apply_clip_print_right\arrangedpageA \box\arrangedpageA}% - \settrue\arrangedswapstate + \arrangedswapstate\conditionaltrue \fi \global\setbox\arrangedpageB\box\scratchbox} @@ -683,20 +682,20 @@ \vskip\paperheight \box\arrangedpageA \box\arrangedpageB}% - \setfalse\arrangedswapstate + \arrangedswapstate\conditionalfalse \else \global\setbox\arrangedpageA\vpack {\offinterlineskip \vskip\paperheight \box\arrangedpageB \box\arrangedpageA}% - \settrue\arrangedswapstate + \arrangedswapstate\conditionaltrue \fi \global\setbox\arrangedpageB\box\scratchbox} \permanent\protected\def\poparrangedpagesTWO {\ifnum\arrangedpageN>\zerocount - \setfalse\arrangedswapstate + \arrangedswapstate\conditionalfalse \doloop {\handlearrangedpage \bgroup @@ -1272,10 +1271,10 @@ {\ifvoid\arrangedpageB\else \unhbox\arrangedpageB \ifdim\v_page_target_dx>\zeropoint - \hskip\v_page_target_dx + \hkern\v_page_target_dx \else \hss - \hskip\v_page_target_dx + \hkern\v_page_target_dx \hss \fi \fi @@ -1412,7 +1411,7 @@ \setbox#1\vpack {\offinterlineskip \vskip\d_page_boxes_v_shifts - \hskip\d_page_boxes_h_shifts + \hkern\d_page_boxes_h_shifts \box#1}% \next} @@ -1420,16 +1419,18 @@ {\ifarguments\or \setuppageshift[\v!page][#1][#1]% \or - \doifelseinset{#1}{\v!page,\v!paper} - {\setuppageshift[#1][#2][#2]} - {\setuppageshift[\v!page][#1][#2]}% + \ifcommon{#1}{\v!page,\v!paper}% + \setuppageshift[#1][#2][#2]% + \else + \setuppageshift[\v!page][#1][#2]% + \fi \or %edef\page_boxes_h_shifts{\ifcsname\??pageshift\v!horizontal:#2\endcsname\csname\??pageshift\v!horizontal:#2\endcsname\fi}% %edef\page_boxes_v_shifts{\ifcsname\??pageshift\v!vertical :#3\endcsname\csname\??pageshift\v!vertical :#3\endcsname\fi}% \edef\page_boxes_h_shifts{\begincsname\??pageshift\v!horizontal:#2\endcsname}% \edef\page_boxes_v_shifts{\begincsname\??pageshift\v!vertical :#3\endcsname}% - \doifelse{#1}\v!page {\let\page_boxes_apply_shift_print\page_boxes_apply_shift}{\let\page_boxes_apply_shift_print\gobbleoneargument}% - \doifelse{#1}\v!paper{\let\page_boxes_apply_shift_paper\page_boxes_apply_shift}{\let\page_boxes_apply_shift_paper\gobbleoneargument}% + \ifcstok{#1}\v!page \let\page_boxes_apply_shift_print\page_boxes_apply_shift\else\let\page_boxes_apply_shift_print\gobbleoneargument\fi + \ifcstok{#1}\v!paper\let\page_boxes_apply_shift_paper\page_boxes_apply_shift\else\let\page_boxes_apply_shift_paper\gobbleoneargument\fi \fi} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl index 4865d5990cb..81522728ea5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl @@ -28,7 +28,7 @@ \let\page_info_add_to_box\gobbleoneargument \permanent\tolerant\protected\def\setupversion[#1]% - {\the\everyresetversion + {\expand\everyresetversion \ifhastok={#1}% \getdummyparameters[\c!alternative=,\c!text=,#1]% \edef\currentversioninfo{\dummyparameter\c!alternative}% @@ -43,7 +43,7 @@ \lettonothing\currentversioninfo \let\page_info_add_to_box\gobbleoneargument \fi - \the\everysetupversion} + \expand\everysetupversion} \aliased\let\version\setupversion @@ -76,7 +76,11 @@ {\infofont \getmessage\m!system{27}:\space\currentdate\quad \donefalse - \doif\currentproject\currentproduct{\doif\currentproduct\currentcomponent\donetrue}% + \ifcstok{\currentproject}{\currentproduct}% + \ifcstok{\currentproduct}{\currentcomponent}% + \donetrue + \fi + \fi \ifdone \donefalse \else diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt index c2acd7f215f..da7d490454a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt @@ -34,7 +34,7 @@ local active = false local trace = false trackers.register("pages.mark",function(v) trace = v end) -local c_realpageno = tex.iscount("realpageno") +local c_realpageno = tex.iscount("realpageno") function pages.mark(name,list,settings) active = true diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl index 38fe1e60d6d..abcf0776858 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl @@ -34,7 +34,7 @@ \global\advanceby\nofshipouts\plusone \to \everyaftershipout -\newconditional\c_otr_shipout_enabled \settrue\c_otr_shipout_enabled +\newconditional\c_otr_shipout_enabled \c_otr_shipout_enabled\conditionaltrue \protected\def\page_otr_shipout % not used at all {\ifconditional\c_otr_shipout_enabled @@ -70,15 +70,15 @@ \def\page_apply_postprocessors_box#1% {\b_page_postprocessor#1\relax - \the\t_page_postprocessors_box} + \expand\t_page_postprocessors_box} \def\page_apply_postprocessors_page#1% {\b_page_postprocessor#1\relax - \the\t_page_postprocessors_page} + \expand\t_page_postprocessors_page} \def\page_apply_postprocessors_column#1% {\b_page_postprocessor#1\relax - \the\t_page_postprocessors_column} + \expand\t_page_postprocessors_column} %D Floats. @@ -231,7 +231,7 @@ % Mark synchronization -\newconditional\c_page_marks_building_successive_pages \settrue\c_page_marks_building_successive_pages +\newconditional\c_page_marks_building_successive_pages \c_page_marks_building_successive_pages\conditionaltrue \ifdefined\??markingclass @@ -313,20 +313,20 @@ \def\page_boxes_constructed_page#1#2% {\vpack\bgroup % intercept spurious spaces - \the\everybeforepagebody + \expand\everybeforepagebody \starttextproperties \checkmarginblocks - \the\beforeeverypage - \normalexpanded{\global\beforepage\emptytoks\the\beforepage}% + \expand\beforeeverypage + \normalexpanded{\global\beforepage\emptytoks\expand\beforepage}% \inpagebodytrue \pagebodymode\plusone % todo: \plustwo when spread \page_boxes_constructed_page_body#1#2% - \normalexpanded{\global\afterpage \emptytoks\the\afterpage }% - \the\aftereverypage + \normalexpanded{\global\afterpage \emptytoks\expand\afterpage }% + \expand\aftereverypage \resetpagebreak \resetlayouttextlines % will go to \aftereverypage \stoptextproperties - \the\everyafterpagebody + \expand\everyafterpagebody \egroup} \permanent\def\doifelsetopofpage diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx index 2e245fd8bd5..947b1f4538e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx @@ -32,10 +32,8 @@ \let\page_boxes_flush_before\clf_flushpageinjectionsbefore \let\page_boxes_flush_after \clf_flushpageinjectionsafter -\lettonothing\p_page_injections_delay \lettonothing\p_page_injections_n \lettonothing\p_page_injections_page -\lettonothing\p_page_injections_pagestate \lettonothing\p_page_injections_state \def\page_injections_flush_indeed @@ -51,7 +49,7 @@ \def\page_injections_flush_saved#name#parameters% {\begingroup - \edef\currentpageinjection{#name}% + \cdef\currentpageinjection{#name}% \getdummyparameters[#parameters]% \edef\currentpageinjectionalternative {\pageinjectionparameter \c!alternative }% \edef\p_page_injectionalternative_rederingsetup{\pageinjectionalternativeparameter\c!renderingsetup}% @@ -87,20 +85,19 @@ \page_injections_direct_indeed} \def\page_injections_direct_name_parameters#name% #parameters% - {\edef\currentpageinjection{#name}% + {\cdef\currentpageinjection{#name}% \checkpageinjectionparent \page_injections_direct_indeed} \def\page_injections_direct_name#name% - {\edef\currentpageinjection{#name}% + {\cdef\currentpageinjection{#name}% \checkpageinjectionparent \page_injections_direct_indeed{}} \def\page_injections_direct_indeed% #parameters% {\edef\p_page_injections_state{\pageinjectionparameter\c!state}% - \edef\p_page_injections_delay{\pageinjectionparameter\c!delay}% \edef\p_page_injections_page {\pageinjectionparameter\c!page }% - \ifx\p_page_injections_delay\v!yes + \ifcstok{\pageinjectionparameter\c!delay}\v!yes \expandafter\page_injections_direct_indeed_yes \else \expandafter\page_injections_direct_indeed_nop @@ -136,8 +133,7 @@ \fi} \def\page_injections_nextpage - {\edef\p_page_injections_pagestate{\pageinjectionparameter\c!pagestate}% - \ifx\p_page_injections_pagestate\v!stop \else + {\ifcstok{\pageinjectionparameter\c!pagestate}\v!stop\else \edef\p_page_injections_n{\pageinjectionparameter\c!n}% \ifempty\p_page_injections_n \let\p_page_injections_n\plusone diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl index 8d2dfe84631..d248c315d26 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl @@ -65,7 +65,7 @@ %D Maybe some day we will move settings here. \permanent\protected\def\setcurrentinsertion#1% - {\edef\currentinsertion{#1}% + {\cdef\currentinsertion{#1}% \currentinsertionnumber\csname\??insertionnumber\currentinsertion\endcsname} \permanent\def\namedinsertionnumber#1{\csname\??insertionnumber#1\endcsname} @@ -80,12 +80,12 @@ \to \everysetupinsertion \protected\def\page_inserts_process#1% beware, this adapts currentinsertion ! - {\edef\currentinsertion{#1}% + {\cdef\currentinsertion{#1}% \currentinsertionnumber\csname\??insertionnumber\currentinsertion\endcsname \doprocessinsert\currentinsertionnumber} % old method \permanent\protected\def\processinsertions - {\the\t_page_inserts_list} + {\expand\t_page_inserts_list} % \permanent\protected\def\synchronizeinsertions % {\let\doprocessinsert\page_inserts_synchronize diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl index 5e2281a2f3f..bc859a15cbf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl @@ -123,6 +123,9 @@ \pushoverloadmode + % don't set [1] because it interferes with initializing the text and one can just + % start explicitly with \setuplayout[xxx] or so + \let\page_layouts_define\definelayout % ugly hack for MS \permanent\protected\def\definelayout[#1]% intercept relative pages @@ -131,7 +134,9 @@ \popoverloadmode \appendtoks - \doifnothing{\directlayoutparameter\c!state}{\letlayoutparameter\c!state\v!start}% + \ifempty{\directlayoutparameter\c!state}% + \letlayoutparameter\c!state\v!start + \fi \to \everydefinelayout \newinteger\c_page_layouts_changed @@ -235,7 +240,7 @@ \newtoks\extralayoutcalculations \def\page_layouts_calculate_extras - {\the\extralayoutcalculations} + {\expand\extralayoutcalculations} \newtoks\everyswapmargins % watch the order ! @@ -243,9 +248,9 @@ \appendtoks \ifconditional\marginsareswapped - \setfalse\marginsareswapped + \marginsareswapped\conditionalfalse \else - \settrue\marginsareswapped + \marginsareswapped\conditionaltrue \fi % \enforced\swapcsvalues\leftmargindistance\rightmargindistance @@ -386,8 +391,8 @@ % \definepapersize[name][A4][A3] % \definepapersize[name][settings] -\permanent\tolerant\protected\def\definepapersize[#1]#*[#2]#*[#3]% - {\edef\currentlayouttarget{#1}% +\permanent\tolerant\protected\def\definepapersize[#1]#*[#S#2]#*[#S#3]% + {\cdef\currentlayouttarget{#1}% \ifempty\currentlayouttarget % invalid target \orelse\ifhastok={#2}% @@ -418,7 +423,7 @@ \let\page_paper_reinstate\relax \let\page_paper_restore \relax -\permanent\tolerant\protected\def\setuppapersize[#1]#*[#2]% +\permanent\tolerant\protected\def\setuppapersize[#S#1]#*[#S#2]% {\ifarguments \page_paper_restore \orelse\ifhastok={#1}% @@ -429,7 +434,7 @@ \page_paper_setup_size_change_size[#1][#2]% \fi} -\protected\def\page_paper_setup_size_settings[#1]% sometimes used to set paper/print size +\protected\def\page_paper_setup_size_settings[#S#1]% sometimes used to set paper/print size {\lettonothing\currentlayouttarget \edef\m_layouttarget_paper_saved{\page_paper_the_paper_size{\layouttargetparameter\c!page }}% \edef\m_layouttarget_print_saved{\page_paper_the_print_size{\layouttargetparameter\c!paper}}% @@ -458,14 +463,16 @@ \letlayouttargetparameter\c!page \papersize \letlayouttargetparameter\c!paper\printpapersize} -\protected\def\page_paper_setup_size_settings_by_name[#1][#2]% - {\def\currentlayouttarget{\page_paper_the_paper_size{#1}}% +\protected\def\page_paper_setup_size_settings_by_name[#1][#S#2]% + {\cdef\currentlayouttarget{\page_paper_the_paper_size{#1}}% \setuplayouttarget[#2]} \protected\def\page_paper_setup_size_change_size[#1][#2]% - {\doifelsenothing{#2} - {\page_paper_set_current[#1][#1]} - {\page_paper_set_current[#1][#2]}} + {\ifempty{#2}% + \page_paper_set_current[#1][#1]% + \else + \page_paper_set_current[#1][#2]% + \fi} \permanent\let\setuppaper\page_paper_setup_size_settings @@ -487,16 +494,16 @@ [\page_paper_the_print_size{#2}]}} \protected\def\page_paper_reset_paper - {\global\setfalse\c_page_target_paper_landscape - \global\setfalse\c_page_target_paper_mirror - \global\setfalse\c_page_target_paper_negate + {\global\c_page_target_paper_landscape\conditionalfalse + \global\c_page_target_paper_mirror\conditionalfalse + \global\c_page_target_paper_negate\conditionalfalse \global\c_page_target_paper_orientation\uprotationangle \global\c_page_target_paper_reverse \uprotationangle} \protected\def\page_paper_reset_print - {\global\setfalse\c_page_target_print_landscape - \global\setfalse\c_page_target_print_mirror - \global\setfalse\c_page_target_print_negate + {\global\c_page_target_print_landscape\conditionalfalse + \global\c_page_target_print_mirror\conditionalfalse + \global\c_page_target_print_negate\conditionalfalse \global\c_page_target_print_orientation\uprotationangle \global\c_page_target_print_reverse \uprotationangle} @@ -504,52 +511,52 @@ \letcsname\??layoutprint\v!reset\endcsname\page_paper_reset_print \defcsname\??layoutpaper\v!landscape\endcsname - {\global\settrue\c_page_target_paper_landscape} + {\global\c_page_target_paper_landscape\conditionaltrue} \defcsname\??layoutpaper\v!mirrored\endcsname - {\global\settrue\c_page_target_paper_mirror} + {\global\c_page_target_paper_mirror\conditionaltrue} \defcsname\??layoutpaper\v!negative\endcsname - {\global\settrue\c_page_target_paper_negate} + {\global\c_page_target_paper_negate\conditionaltrue} \defcsname\??layoutpaper\v!rotated\endcsname {\global\c_page_target_paper_orientation\rightrotationangle \global\c_page_target_paper_reverse \leftrotationangle} -\defcsname\??layoutpaper\number\rightrotationangle\endcsname +\defcsname\??layoutpaper\the\rightrotationangle\endcsname {\global\c_page_target_paper_orientation\rightrotationangle \global\c_page_target_paper_reverse \leftrotationangle} -\defcsname\??layoutpaper\number\downrotationangle\endcsname +\defcsname\??layoutpaper\the\downrotationangle\endcsname {\global\c_page_target_paper_orientation\downrotationangle \global\c_page_target_paper_reverse \zerocount} -\defcsname\??layoutpaper\number\leftrotationangle\endcsname +\defcsname\??layoutpaper\the\leftrotationangle\endcsname {\global\c_page_target_paper_orientation\leftrotationangle \global\c_page_target_paper_reverse \rightrotationangle} \defcsname\??layoutprint\v!landscape\endcsname - {\global\settrue\c_page_target_print_landscape} + {\global\c_page_target_print_landscape\conditionaltrue} \defcsname\??layoutprint\v!mirrored\endcsname - {\global\settrue\c_page_target_print_mirror} + {\global\c_page_target_print_mirror\conditionaltrue} \defcsname\??layoutprint\v!negative\endcsname - {\global\settrue\c_page_target_print_negate} + {\global\c_page_target_print_negate\conditionaltrue} \defcsname\??layoutprint\v!rotated\endcsname {\global\c_page_target_print_orientation\rightrotationangle \global\c_page_target_print_reverse \leftrotationangle} -\defcsname\??layoutprint\number\rightrotationangle\endcsname +\defcsname\??layoutprint\the\rightrotationangle\endcsname {\global\c_page_target_print_orientation\rightrotationangle \global\c_page_target_print_reverse \leftrotationangle} -\defcsname\??layoutprint\number\downrotationangle \endcsname +\defcsname\??layoutprint\the\downrotationangle \endcsname {\global\c_page_target_print_orientation\downrotationangle \global\c_page_target_print_reverse \zerocount} -\defcsname\??layoutprint\number\leftrotationangle \endcsname +\defcsname\??layoutprint\the\leftrotationangle \endcsname {\global\c_page_target_print_orientation\leftrotationangle \global\c_page_target_print_reverse \rightrotationangle} @@ -558,7 +565,7 @@ \protected\def\page_paper_identify_target#1% {\ifcsname\??layoutcurrent#1\endcsname - \edef\currentlayouttarget{#1}% + \cdef\currentlayouttarget{#1}% \fi} \newdimension\d_page_minimum_paper_size \d_page_minimum_paper_size\luaexpr{math.pi}\onebasepoint @@ -752,6 +759,7 @@ % 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) +% \layoutlines \global\makeupheight\dimexpr \layoutparameter\c!lines\lineheight-\strutheight+\topskip+ \headerdistance+\headerheight+\footerdistance+\footerheight\relax @@ -782,8 +790,7 @@ \page_backgrounds_recalculate} \def\page_layouts_check_direction - {\edef\p_direction{\layoutparameter\c!direction}% - \ifx\p_direction\v!reverse + {\ifcstok{\layoutparameter\c!direction}\v!reverse \enforced\global\swapcsvalues\naturalleftedgedistance \naturalrightedgedistance \enforced\global\swapcsvalues\naturalleftmargindistance\naturalrightmargindistance \enforced\global\swapcsvalues\leftmargindistance \rightmargindistance @@ -987,62 +994,62 @@ \newconditional\c_page_layouts_location_is_middle \def\page_layouts_location_reset % we start in the left top and mirror right pages - {\setfalse\c_page_layouts_location_is_set - \setfalse\c_page_layouts_location_is_middle + {\c_page_layouts_location_is_set\conditionalfalse + \c_page_layouts_location_is_middle\conditionalfalse \let\v_page_target_left_fill \relax \let\v_page_target_right_fill \hss % ? \relax \let\v_page_target_top_fill \relax \let\v_page_target_bottom_fill\vss} % \relax} \defcsname\??layoutlocation\v!right\endcsname - {\settrue\c_page_layouts_location_is_set - \setfalse\c_page_layouts_location_is_middle + {\c_page_layouts_location_is_set\conditionaltrue + \c_page_layouts_location_is_middle\conditionalfalse \let\v_page_target_left_fill \hss \let\v_page_target_right_fill\relax} \defcsname\??layoutlocation\v!left\endcsname - {\settrue\c_page_layouts_location_is_set - \setfalse\c_page_layouts_location_is_middle + {\c_page_layouts_location_is_set\conditionaltrue + \c_page_layouts_location_is_middle\conditionalfalse \let\v_page_target_left_fill \relax \let\v_page_target_right_fill\hss} \defcsname\??layoutlocation\v!bottom\endcsname - {\settrue\c_page_layouts_location_is_set - \setfalse\c_page_layouts_location_is_middle + {\c_page_layouts_location_is_set\conditionaltrue + \c_page_layouts_location_is_middle\conditionalfalse \let\v_page_target_top_fill \vss \let\v_page_target_bottom_fill\relax} \defcsname\??layoutlocation\v!top\endcsname - {\settrue\c_page_layouts_location_is_set - \setfalse\c_page_layouts_location_is_middle + {\c_page_layouts_location_is_set\conditionaltrue + \c_page_layouts_location_is_middle\conditionalfalse \let\v_page_target_top_fill \relax \let\v_page_target_bottom_fill\vss} \defcsname\??layoutlocation\v!middle\endcsname - {\settrue\c_page_layouts_location_is_set - \settrue\c_page_layouts_location_is_middle + {\c_page_layouts_location_is_set\conditionaltrue + \c_page_layouts_location_is_middle\conditionaltrue \let\v_page_target_left_fill \hss \let\v_page_target_right_fill \hss \let\v_page_target_top_fill \vss \let\v_page_target_bottom_fill\vss} \defcsname\??layoutlocation\empty\endcsname - {\setfalse\c_page_layouts_location_is_set % default also signal to scrn_ - \setfalse\c_page_layouts_location_is_middle + {\c_page_layouts_location_is_set\conditionalfalse % default also signal to scrn_ + \c_page_layouts_location_is_middle\conditionalfalse \let\v_page_target_right_fill \hss \let\v_page_target_bottom_fill\hss} \defcsname\??layoutlocation\v!doublesided\endcsname - {\settrue\c_page_target_print_doublesided} + {\c_page_target_print_doublesided\conditionaltrue} \defcsname\??layoutlocation\v!singlesided\endcsname - {\setfalse\c_page_target_print_doublesided} + {\c_page_target_print_doublesided\conditionalfalse} \def\page_target_check_centering_indeed#1% {\begincsname\??layoutlocation#1\endcsname} \protected\def\page_target_check_centering - {\setfalse\c_page_target_print_doublesided + {\c_page_target_print_doublesided\conditionalfalse \page_layouts_location_reset \processcommacommand[\layoutparameter\c!location]\page_target_check_centering_indeed} @@ -1088,7 +1095,7 @@ \appendtoks \global\d_page_adapts_delta\zeropoint \to \everyshipout -\permanent\protected\tolerant\def\adaptlayout[#1]#*[#2]% +\permanent\protected\tolerant\def\adaptlayout[#1]#*[#S#2]% {\ifparameter#2\or \processcommalist[#1]{\page_adapts_layout_register{#2}}% \page_adapts_check @@ -1172,7 +1179,7 @@ %D \macros %D {startlayout,stoplayout} -\permanent\protected\def\startlayout[#1]% +\permanent\protected\def\startlayout[#S#1]% {\page \globalpushmacro\currentlayout \doifelselayoutdefined{#1}{\setuplayout[#1]}\donothing} % {\setuplayout[\currentlayout]}} @@ -1231,7 +1238,7 @@ \newdimension\innermakeupwidth % special purpose \newdimension\innermakeupmargin % special purpose -\newconditional\innermakeupcompensation \settrue\innermakeupcompensation +\newconditional\innermakeupcompensation \innermakeupcompensation\conditionaltrue \permanent\def\compensatedinnermakeupmargin {\dimexpr\ifconditional\innermakeupcompensation+\innermakeupmargin\else\zeropoint\fi\relax} @@ -1328,7 +1335,7 @@ \protected\def\page_layouts_swap_margins_indeed#1% {\let\page_layouts_swap_margins\gobbleoneargument % to prevent local swapping %\writestatus\m!layouts{swapping margins for #1}% - \the\everyswapmargins} + \expand\everyswapmargins} \permanent\protected\def\swapmargindimensions {\page_layouts_swap_margins\v!page} @@ -1497,9 +1504,23 @@ \c!paper=, \c!page=, \c!adaptive=\zeropoint, % new: experiment + \c!limitstretch=\v!auto, % catches \setupalign[depth] without setting (2 lineheight) \c!columns=\plusone, \c!columndistance=\zeropoint] +\pushoverloadmode + \newuserunit \textwidth tw + \newuserunit \textheight th + \newuserunit \paperwidth pw + \newuserunit \paperheight ph + \newuserunit \hsize hs % just for fun + \newuserunit \vsize vs % just for fun +\popoverloadmode + +% \appendtoks +% \layoutunit\dimexpr\textwidth/100\relax +% \to \everysetuplayout + %D First we define a whole range of (DIN) papersizes, of which the A-series makes %D most sense. We enable checking. diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-lin.lmt b/Master/texmf-dist/tex/context/base/mkxl/page-lin.lmt index 3c20feaee8c..f51bf689934 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-lin.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/page-lin.lmt @@ -29,27 +29,27 @@ storage.register("lines/data", data, "nodes.lines.data") local variables = interfaces.variables -local v_next = variables.next -local v_page = variables.page -local v_no = variables.no +local v_next = variables.next +local v_page = variables.page +local v_no = variables.no local properties = nodes.properties.data local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local whatsit_code = nodecodes.whatsit -local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local whatsit_code = nodecodes.whatsit +local glyph_code = nodecodes.glyph -local linelist_code = nodes.listcodes.line +local linelist_code = nodes.listcodes.line -local latelua_code = nodes.whatsitcodes.latelua +local latelua_code = nodes.whatsitcodes.latelua local localtexrun = tex.runlocal ------ a_displaymath = attributes.private('displaymath') -local a_linenumber = attributes.private('linenumber') -local a_linereference = attributes.private('linereference') +----- a_displaymath = attributes.private('displaymath') +local a_linenumber = attributes.private('linenumber') +local a_linereference = attributes.private('linereference') local cross_references = { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx index 71a0e0c6eda..503cebc861b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx @@ -45,7 +45,7 @@ \definesystemattribute[linenumber] [public] \definesystemattribute[linereference][public] -\appendtoksonce +\appendtoks \c_attr_linenumber\attributeunsetvalue \to \everyforgetall @@ -63,8 +63,8 @@ \installtextracker {lines.numbers.show} - {\settrue \tracelinenumbering} - {\setfalse\tracelinenumbering} + {\tracelinenumbering\conditionaltrue} + {\tracelinenumbering\conditionalfalse} % id nr shift width leftskip dir @@ -198,7 +198,7 @@ % \startlinenumbering[|continue|settings|name] % \startlinenumbering[name][|continue|settings] -\permanent\tolerant\protected\def\startlinenumbering[#1]#*[#2]% +\permanent\tolerant\protected\def\startlinenumbering[#1]#*[#S#2]% {\begingroup \page_postprocessors_linenumbers_check \advanceby\c_pages_lines_nesting\plusone @@ -221,47 +221,48 @@ \fi \page_lines_start_followup} -\def\page_lines_start_one[#1][#2]% [continue||settings] % historic +\def\page_lines_start_one[#S#1][#2]% [continue||settings] % historic {\edef\m_argument{#1}% \ifx\m_argument\v!continue \c_page_lines_mode\zerocount \lettonothing\currentlinenumbering \else - \c_page_lines_mode\plusone \ifx\m_argument\v!empty \lettonothing\currentlinenumbering \orelse\ifhastok={#1}% \lettonothing\currentlinenumbering \setupcurrentlinenumbering[#1]% + \orelse\ifchknum\m_argument\or + \lettonothing\currentlinenumbering + \letlinenumberingparameter\c!start\m_argument \else - \doifelsenumber\m_argument - {\lettonothing\currentlinenumbering - \letlinenumberingparameter\c!start\m_argument} - {\let\currentlinenumbering\m_argument}% + \let\currentlinenumbering\m_argument \fi - \edef\p_continue{\linenumberingparameter\c!continue}% - \ifx\p_continue\v!yes + \ifcstok{\linenumberingparameter\c!continue}\v!yes \c_page_lines_mode\zerocount + \else + \c_page_lines_mode\plusone \fi \fi \page_lines_start_followup} -\def\page_lines_start_two[#1][#2]% [tag][continue||settings] - {\edef\currentlinenumbering{#1}% +\def\page_lines_start_two[#1][#S#2]% [tag][continue||settings] + {\cdef\currentlinenumbering{#1}% \edef\m_argument{#2}% \ifx\m_argument\v!continue \c_page_lines_mode\zerocount \else - \c_page_lines_mode\plusone \ifx\m_argument\v!empty \else - \doifelseassignment{#2} - {\setupcurrentlinenumbering[#2]} - {\doifnumber\m_argument - {\letlinenumberingparameter\c!start\m_argument}}% + \ifhastok={#2}% + \setupcurrentlinenumbering[#2]% + \orelse\ifchknum\m_argument\or + \letlinenumberingparameter\c!start\m_argument + \fi \fi - \edef\p_continue{\linenumberingparameter\c!continue}% - \ifx\p_continue\v!yes + \ifcstok{\linenumberingparameter\c!continue}\v!yes \c_page_lines_mode\zerocount + \else + \c_page_lines_mode\plusone \fi \fi \page_lines_start_followup} @@ -284,28 +285,28 @@ \def\page_lines_start_followup {\numberinglinestrue \edef\p_location{\linenumberingparameter\c!location}% - \setfalse\c_page_lines_auto_narrow + \c_page_lines_auto_narrow\conditionalfalse \ifhmode \else \ifx\p_location\v!text \ifdim\leftskip>\zeropoint \else \advanceby\leftskip\linenumberingparameter\c!margin - \settrue\c_page_lines_auto_narrow + \c_page_lines_auto_narrow\conditionaltrue \fi \orelse\ifx\p_location\v!begin \ifdim\leftskip>\zeropoint \else \advanceby\leftskip\linenumberingparameter\c!margin - \settrue\c_page_lines_auto_narrow + \c_page_lines_auto_narrow\conditionaltrue \fi \orelse\ifx\p_location\v!end \ifdim\leftskip>\zeropoint \else \advanceby\rightskip\linenumberingparameter\c!margin - \settrue\c_page_lines_auto_narrow + \c_page_lines_auto_narrow\conditionaltrue \fi \fi \fi - \the\beforeeverylinenumbering - %\global\settrue\c_page_lines_enabled % - \global\settrue\page_postprocessors_needed_box % see core-rul.mkiv + \expand\beforeeverylinenumbering + %\global\c_page_lines_enabled\conditionaltrue % + \global\page_postprocessors_needed_box\conditionaltrue % see core-rul.mkiv \ifcase\c_page_lines_mode\relax \page_lines_start_update % continue \or @@ -316,7 +317,7 @@ \permanent\protected\def\stoplinenumbering {\ifconditional\c_pages_lines_nesting=\plusone \c_attr_linenumber\attributeunsetvalue - \the\aftereverylinenumbering + \expand\aftereverylinenumbering \ifconditional\c_page_lines_auto_narrow\par\fi \fi \endgroup} @@ -328,7 +329,7 @@ \newconstant \c_page_lines_column \newconstant \c_page_lines_last_column \newdimen \d_page_lines_line_width -\settrue \c_page_lines_dir_left_to_right +\newconditional\c_page_lines_dir_left_to_right \c_page_lines_dir_left_to_right\conditionaltrue \installcorenamespace{linenumberinghandler} @@ -364,30 +365,30 @@ \def\page_lines_make_number#tag#linenumber#width#dir% with hang and parindent and skips we have to compensate for \hsize {\setbox\scratchbox\naturalhbox to \zeropoint \bgroup - \edef\currentlinenumbering{#tag}% + \cdef\currentlinenumbering{#tag}% \def\linenumber{#linenumber}% unsafe \d_page_lines_line_width#width\scaledpoint\relax \d_page_lines_distance\linenumberingparameter\c!distance\relax \edef\p_align{\linenumberingparameter\c!align}% \edef\p_location{\linenumberingparameter\c!location}% \ifcase#dir\relax - \settrue \c_page_lines_dir_left_to_right + \c_page_lines_dir_left_to_right\conditionaltrue \else - \setfalse\c_page_lines_dir_left_to_right + \c_page_lines_dir_left_to_right\conditionalfalse \fi % % maybe we also need an option to ignore columns, so that we renumber % once but on the other hand this assumes aligned lines % \ifcase\c_page_lines_last_column\relax - \settrue \c_page_lines_fake_number % why + \c_page_lines_fake_number\conditionaltrue % why \or % one column \or % two columns \ifx\p_location\v!default % or just margin \ifcase\c_page_lines_column\relax - \settrue \c_page_lines_fake_number % why + \c_page_lines_fake_number\conditionaltrue % why \or \let\p_location\v!left % one \else @@ -450,7 +451,7 @@ #distance+\d_page_lines_distance \ifconditional\c_page_lines_dir_left_to_right\else+\d_page_lines_line_width\fi \relax - \the\everylinenumber + \expand\everylinenumber \hss \dostoptagged}% \dostoptagged} @@ -466,7 +467,7 @@ \dostoptagged \page_lines_number_inject#align#width% \dostarttagged\t!ignore\empty - \the\everylinenumber + \expand\everylinenumber \hss \dostoptagged}% \dostoptagged} @@ -519,7 +520,7 @@ {\rlap {\kern\d_page_lines_distance \page_lines_number_inject#align\zeropoint - \the\everylinenumber}} + \expand\everylinenumber}} \def\page_line_handle_end#align% {\rlap @@ -527,7 +528,7 @@ \llap {\page_lines_number_inject#align\zeropoint \kern\d_page_lines_distance - \the\everylinenumber}}} + \expand\everylinenumber}}} \protected\defcsname\??linenumberinghandler\v!begin\endcsname{\page_line_handle_begin\p_align} \protected\defcsname\??linenumberinghandler\v!end \endcsname{\page_line_handle_end \p_align} @@ -593,13 +594,15 @@ \aliased\let\doifsamelinereferenceelse\doifelsesamelinereference \permanent\protected\def\inline#1[#2]% - {\doifelsenothing{#1}% - {\doifelsesamelinereference{#2}% - {\in{\leftlabeltext\v!line}{\rightlabeltext\v!line}[lr:b:#2]}% - {\in{\leftlabeltext\v!lines}{}[lr:b:#2]--\in{}{\rightlabeltext\v!lines}[lr:e:#2]}}% - {\doifelsesamelinereference{#2}% - {\in{#1}[lr:b:#2]}% - {\in{#1}[lr:b:#2]--\in[lr:e:#2]}}} + {\ifempty{#1}% + \doifelsesamelinereference{#2}% + {\in{\leftlabeltext\v!line}{\rightlabeltext\v!line}[lr:b:#2]}% + {\in{\leftlabeltext\v!lines}{}[lr:b:#2]--\in{}{\rightlabeltext\v!lines}[lr:e:#2]}% + \else + \doifelsesamelinereference{#2}% + {\in{#1}[lr:b:#2]}% + {\in{#1}[lr:b:#2]--\in[lr:e:#2]}% + \fi} \permanent\protected\def\inlinerange[#1]% {\doifelsesamelinereference{#1}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx index f0d01cc362c..574af63c2e1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx @@ -42,15 +42,15 @@ \installcommandhandler \??makeup {makeup} \??makeup \appendtoks - \frozen\instance\setuevalue{\e!start\currentmakeup\e!makeup}{\startmakeup[\currentmakeup]}% - \frozen\instance\setuevalue{\e!stop \currentmakeup\e!makeup}{\stopmakeup}% + \frozen\protected\instance\edefcsname\e!start\currentmakeup\e!makeup\endcsname{\startmakeup[\currentmakeup]}% + \frozen\protected\instance\edefcsname\e!stop \currentmakeup\e!makeup\endcsname{\stopmakeup}% \doifelselayoutdefined\currentmakeup\donothing{\definelayout[\currentmakeup]}% new \to \everydefinemakeup %D The \type {\start}||\type {\stop} macros are used for both the direct and %D indirect way. The parameterless call will build a simple box. -\permanent\tolerant\protected\def\startmakeup[#1]#*[#2]% +\permanent\tolerant\protected\def\startmakeup[#1]#*[#S#2]% {\ifparameters \expandafter\page_makeup_start_nop \else @@ -61,7 +61,7 @@ %D The simple case: just a box with text dimensions. -\protected\def\page_makeup_start_nop[#name][#settings]% dummies +\protected\def\page_makeup_start_nop[#name][#S#settings]% dummies {\page \setupheader[\c!state=\v!empty]% \setupfooter[\c!state=\v!empty]% @@ -104,11 +104,11 @@ % \definelayout[whatever][height=2cm] % \setuplayout[whatever] -\def\page_makeup_start_indeed[#name][#settings]% +\def\page_makeup_start_indeed[#name][#S#settings]% {% the next grouping hack is somewhat messy: \begingroup % we need to figure out the current layout - \xdef\m_page_makeup_name{#name}% + \global\cdef\m_page_makeup_name{#name}% \let\currentmakeup\m_page_makeup_name \let\currentlayout\m_page_makeup_name \xdef\m_page_makeup_layout_parent{\layoutparameter\s!parent}% @@ -117,6 +117,7 @@ \ifempty\p_page \endgroup \page % new, so best not have dangling mess here like references (we could capture then and flush embedded) + \relax \orelse\ifx\p_page\v!no % nothing \endgroup @@ -141,7 +142,7 @@ \let\currentmakeup\m_page_makeup_name \setupcurrentmakeup[#settings]% \setsystemmode\v!makeup - \the\t_page_makeup_every_setup + \expand\t_page_makeup_every_setup \makeupparameter\c!commands % hm, what is this one doing here ? \forgetall % else indented flush \dontcomplain @@ -164,12 +165,14 @@ \ht\b_page_makeup\vsize % is already set to \textheight (maybe set dp to 0) \fi \setuppagenumber[\c!state=\makeupparameter\c!pagestate]% - \doif{\makeupparameter\c!location}\v!top{\topskip\zeropoint}% + \ifcstok{\makeupparameter\c!location}\v!top + \topskip\zeroskip + \fi \edef\p_reference{\makeupparameter\c!reference}% \dontleavehmode \usereferenceparameter\makeupparameter \box\b_page_makeup % could be whole box being destination - \the\t_page_makeup_every_setup + \expand\t_page_makeup_every_setup \page \endgroup \makeupparameter\c!after\relax @@ -181,7 +184,8 @@ \stoplayout % includes \page \ifx\m_page_makeup_name\currentlayout \orelse\ifx\m_page_makeup_layout_parent\??layout - \normalexpanded{\setuplayout[\m_page_makeup_name][\s!parent=\??layout]}% is remembered but checked later anyway +% \normalexpanded{\setuplayout[\m_page_makeup_name][\s!parent=\??layout]}% is remembered but checked later anyway + \normalexpanded{\setuplayout[\m_page_makeup_name][\s!parent=\??layout\currentlayout]}% is remembered but checked later anyway \fi} \defcsname\??makeupdoublesided\v!yes\endcsname @@ -189,7 +193,7 @@ \page} \defcsname\??makeupdoublesided\v!empty\endcsname - {\the\t_page_makeup_every_setup + {\expand\t_page_makeup_every_setup % == \page[\v!dummy] \page[\v!blank]% \emptyhbox diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx index 3dc1c4e7c95..357e98ccad5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx @@ -50,8 +50,11 @@ \newbox \b_page_margin_blocks_prepared \appendtoks - \doifelse{\rootmarginblockparameter\c!state}\v!start - \settrue\setfalse\c_page_margin_blocks_enabled + \ifcstok{\rootmarginblockparameter\c!state}\v!start + \c_page_margin_blocks_enabled\conditionaltrue + \else + \c_page_margin_blocks_enabled\conditionalfalse + \fi \to \everysetupmarginblock \setupmarginblocks @@ -73,13 +76,13 @@ \resetboxesincache \s!marginblock \s!marginblock -\setfalse\c_page_margin_blocks_enabled +\c_page_margin_blocks_enabled\conditionalfalse \let\page_margin_blocks_stop_block\relax \permanent\tolerant\protected\def\startmarginblock[#tag]% {\begingroup - \edef\currentmarginblock{#tag}% + \cdef\currentmarginblock{#tag}% \ifcstok{\marginblockparameter\c!state}\v!start \expandafter\page_margin_blocks_start_block_yes \else @@ -92,7 +95,7 @@ \def\page_margin_blocks_start_block_yes {%\showmessage\m!layouts4\empty - \global\settrue\c_page_margin_blocks_enabled + \global\c_page_margin_blocks_enabled\conditionaltrue \dowithnextboxcs \page_margin_blocks_start_block_save \vbox\bgroup @@ -149,8 +152,8 @@ \marginblockparameter\c!inbetween \fi \setbox\scratchbox\emptyvbox - \ht\scratchbox\getboxhtfromcache\s!marginblock{\number\currentloopiterator}% - \dp\scratchbox\getboxdpfromcache\s!marginblock{\number\currentloopiterator}% + \ht\scratchbox\getboxhtfromcache\s!marginblock{\the\currentloopiterator}% + \dp\scratchbox\getboxdpfromcache\s!marginblock{\the\currentloopiterator}% \box\scratchbox \marginblockparameter\c!after}% \marginblockparameter\c!bottom @@ -171,14 +174,14 @@ \else \marginblockparameter\c!inbetween \fi - \getboxfromcache\s!marginblock{\number\currentloopiterator}\scratchbox + \getboxfromcache\s!marginblock{\the\currentloopiterator}\scratchbox \box\scratchbox \marginblockparameter\c!after}% \marginblockparameter\c!bottom \egroup \pruneboxesincache\s!marginblock \ifcase\getboxcountfromcache\s!marginblock\relax - \global\settrue\c_page_margin_blocks_enabled + \global\c_page_margin_blocks_enabled\conditionaltrue \fi \fi \endgroup} @@ -228,12 +231,14 @@ % margin floats (keyword 'margin' in option list) \protected\def\page_margin_blocks_process_float - {\doifelse{\marginblockparameter\c!state}\v!start + {\ifcstok{\marginblockparameter\c!state}\v!start \page_margin_blocks_process_float_yes - \page_margin_blocks_process_float_nop} + \else + \page_margin_blocks_process_float_nop + \fi} \def\page_margin_blocks_process_float_yes - {\global\settrue\c_page_margin_blocks_enabled + {\global\c_page_margin_blocks_enabled\conditionaltrue \putboxincache\s!marginblock{+}\floatbox} \def\page_margin_blocks_process_float_nop @@ -262,7 +267,7 @@ \else \marginblockparameter\c!inbetween \fi - \getboxfromcache\s!marginblock{\number\currentloopiterator}\scratchbox + \getboxfromcache\s!marginblock{\the\currentloopiterator}\scratchbox \box\scratchbox \marginblockparameter\c!after}% \pruneboxesincache\s!marginblock diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl index 3faf13db7a1..1c04f41dc61 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl @@ -220,9 +220,9 @@ \def\page_mcl_flush_packaged_columns_indeed {\ifvoid\b_page_mcl_preceding - \setfalse\c_page_mcl_preceding_present % will be set elsewhere + \c_page_mcl_preceding_present\conditionalfalse % will be set elsewhere \else - \settrue\c_page_mcl_preceding_present + \c_page_mcl_preceding_present\conditionaltrue \page_apply_postprocessors_box\b_page_mcl_preceding \fi \forgetall @@ -240,7 +240,7 @@ \unskip \hskip\ifconditional\c_page_mcl_reverse\d_page_mcl_leftskip\else\d_page_mcl_rightskip\fi}}% \ifconditional\c_page_mcl_preceding_present - \settrue\c_page_mcl_preceding_present + \c_page_mcl_preceding_present\conditionaltrue \ifgridsnapping \page_mcl_flush_preceding_ongrid % obey grid settings, force on grid \else @@ -291,22 +291,22 @@ \setbox\b_page_mcl_balance_content\vpack{\unvbox\normalpagebox}% \ifdim\ht\b_page_mcl_balance_content>\openlineheight % at least one line \ifnum\c_page_mcl_balance_minimum<\plustwo % balance anyway - \settrue\c_page_mcl_balance_possible + \c_page_mcl_balance_possible\conditionaltrue \else % check criterium to available lines \getnoflines{\ht\b_page_mcl_balance_content}% \divideby\noflines \nofcolumns \relax \ifnum\noflines<\c_page_mcl_balance_minimum \relax \ifdim\dimexpr\ht\b_page_mcl_balance_content+\openlineheight\relax>\makeupheight - \settrue\c_page_mcl_balance_possible % column exceeding text height + \c_page_mcl_balance_possible\conditionaltrue % column exceeding text height \else - \setfalse\c_page_mcl_balance_possible % it seems to fit + \c_page_mcl_balance_possible\conditionalfalse % it seems to fit \fi \else - \settrue\c_page_mcl_balance_possible % balance indeed + \c_page_mcl_balance_possible\conditionaltrue % balance indeed \fi \fi \else - \setfalse\c_page_mcl_balance_possible % balancing does not make sense + \c_page_mcl_balance_possible\conditionalfalse % balancing does not make sense \fi \ifconditional\c_page_mcl_balance_possible % start balancing, was: \ifdim\ht\b_page_mcl_balance_content>\openlineheight \page_mcl_balance_try_one @@ -380,7 +380,7 @@ {%\global\setbox\currentcolumnbox\box\currentcolumnbox \ht\currentcolumnbox\ht\firstcolumnbox} -\permanent\tolerant\protected\def\startmulticolumns[#1]% +\permanent\tolerant\protected\def\startmulticolumns[#S#1]% {\bgroup \ifinsidecolumns \page_mcl_start_nop @@ -412,18 +412,16 @@ % \d_page_mcl_distance\multicolumnsparameter\c!distance\relax % - \edef\p_direction{\multicolumnsparameter\c!direction}% - \ifx\p_direction\v!right - \setfalse\c_page_mcl_reverse + \ifcstok{\multicolumnsparameter\c!direction}\v!right + \c_page_mcl_reverse\conditionalfalse \else - \settrue\c_page_mcl_reverse + \c_page_mcl_reverse\conditionaltrue \fi % - \edef\p_balance{\multicolumnsparameter\c!balance}% - \ifx\p_balance\v!yes - \settrue\c_page_mcl_balance + \ifcstok{\multicolumnsparameter\c!balance}\v!yes + \c_page_mcl_balance\conditionaltrue \else - \setfalse\c_page_mcl_balance + \c_page_mcl_balance\conditionalfalse \fi % \usealignparameter\multicolumnsparameter @@ -442,8 +440,8 @@ % \d_page_mcl_leftskip \leftskip \d_page_mcl_rightskip\rightskip - \leftskip \zeropoint - \rightskip \zeropoint + \leftskip \zeroskip + \rightskip \zeroskip \hangafter \zerocount \hangindent \zeropoint % @@ -458,7 +456,7 @@ \appendtoks \topskip1\topskip % best a switch \to \everybodyfont - \the\everybodyfont % ugly here + \expand\everybodyfont % ugly here \saveinterlinespace % ugly here % \initializecolumns\nofcolumns diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl index 3d11794834c..89623ff3d1c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl @@ -98,7 +98,7 @@ \c!step=.25\lineheight, % needs some experimenting %\c!splitmethod=\v!fixed, % will be default \c!direction=\v!normal, % new (also todo in the new columnsets) - \c!notes=\v!yes, + % \c!notes=\v!yes, % needs an update because now we flush weirdly inside the columns \c!define=\v!yes, \c!method=\ifinner\s!box\else\s!otr\fi] % automatic as suggested by WS @@ -240,7 +240,7 @@ \protected\def\page_mix_command_routine {\ifcase\c_page_mix_routine - \page_one_command_routine + \page_one_command_routine % not ok as we need to also adapt the vsize setter \or \page_mix_routine_intercept \or @@ -329,11 +329,11 @@ \def\page_mix_enable_grid_snapping {\edef\p_grid{\mixedcolumnsparameter\c!grid}% - \setfalse\c_page_mix_grid_snapping + \c_page_mix_grid_snapping\conditionalfalse \ifempty\p_grid % just follow the default grid settings \else - \ifgridsnapping\settrue\c_page_mix_grid_snapping\fi + \ifgridsnapping\c_page_mix_grid_snapping\conditionaltrue\fi \gridsnappingtrue \setsystemmode\v!grid \spac_grids_snap_value_set\p_grid @@ -406,7 +406,7 @@ \installmacrostack\currentmixedcolumns \installmacrostack\currentmixedcolumnsmethod -\permanent\tolerant\protected\def\startmixedcolumns[#1]#*[#2]% +\permanent\tolerant\protected\def\startmixedcolumns[#S#1]#*[#S#2]% {\push_macro_currentmixedcolumns \push_macro_currentmixedcolumnsmethod \ifparameters @@ -428,12 +428,12 @@ \fi} \def\page_mix_start_columns_a[#1]% [#2]% - {\edef\currentmixedcolumns{#1}% + {\cdef\currentmixedcolumns{#1}% \page_mix_start_columns_checked \page_mix_start_columns_a_yes \page_mix_start_columns_a_nop} -\def\page_mix_start_columns_a_yes[#1]% +\def\page_mix_start_columns_a_yes[#S#1]% {\mixedcolumnsparameter\c!before\relax \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax \begingroup @@ -442,21 +442,21 @@ \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname \enforced\let\stopmixedcolumns\page_mix_columns_stop_yes} -\def\page_mix_start_columns_a_nop[#1]% +\def\page_mix_start_columns_a_nop[#S#1]% {\begingroup \enforced\let\stopmixedcolumns\page_mix_columns_stop_nop} -\def\page_mix_start_columns_b[#1][#2]% +\def\page_mix_start_columns_b[#S#1][#S#2]% {\ifhastok={#1}% \lettonothing\currentmixedcolumns \page_mix_error_b \page_mix_start_columns_checked\page_mix_start_columns_b_yes\page_mix_start_columns_b_nop[#1]% \else - \edef\currentmixedcolumns{#1}% + \cdef\currentmixedcolumns{#1}% \page_mix_start_columns_checked\page_mix_start_columns_b_yes\page_mix_start_columns_b_nop[#2]% \fi} -\def\page_mix_start_columns_b_yes[#1]% +\def\page_mix_start_columns_b_yes[#S#1]% {\mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings ! \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax \begingroup @@ -493,7 +493,7 @@ \protected\def\page_mix_fast_columns_start#1% {\push_macro_currentmixedcolumns \push_macro_currentmixedcolumnsmethod - \edef\currentmixedcolumns{#1}% + \cdef\currentmixedcolumns{#1}% \edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}% \mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings ! \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax @@ -523,14 +523,14 @@ \mixedcolumnsparameter\c!after\relax \pop_macro_currentmixedcolumnsmethod \pop_macro_currentmixedcolumns - \the\t_page_mix_at_the_end\global\t_page_mix_at_the_end\emptytoks} + \expand\t_page_mix_at_the_end\global\t_page_mix_at_the_end\emptytoks} \protected\def\page_mix_columns_stop_nop {\page_mix_finalize_columns \endgroup \pop_macro_currentmixedcolumnsmethod \pop_macro_currentmixedcolumns - \the\t_page_mix_at_the_end\global\t_page_mix_at_the_end\emptytoks} + \expand\t_page_mix_at_the_end\global\t_page_mix_at_the_end\emptytoks} % \protected\def\page_mix_columns_stop_yes % {\begincsname\??mixedcolumnsstop \currentmixedcolumnsmethod\endcsname % no \relax @@ -568,6 +568,8 @@ %D The common initialization: +%D !!! todo: notes \automigrationmode\zerocount as well as notes=yes + \def\page_mix_initialize_columns {\page_mix_enable_grid_snapping % @@ -581,10 +583,14 @@ \d_page_mix_leftskip \leftskip \d_page_mix_rightskip\rightskip % \frozen ? - \leftskip \zeropoint - \rightskip\zeropoint + \leftskip \zeroskip + \rightskip\zeroskip % - \doifelse{\mixedcolumnsparameter\c!notes}\v!yes\settrue\setfalse\c_page_mix_process_notes + \ifcstok{\mixedcolumnsparameter\c!notes}\v!yes + \c_page_mix_process_notes\conditionaltrue + \else + \c_page_mix_process_notes\conditionalfalse + \fi \ifconditional\c_page_mix_process_notes \else \startpostponingnotes \fi @@ -606,7 +612,7 @@ \useblankparameter \mixedcolumnsparameter \useprofileparameter\mixedcolumnsparameter % new % - \automigrationmode\zerocount % for now + \automigrationmode\zerocount % for now (see notes=yes) % \nofcolumns\c_page_mix_n_of_columns} % public @@ -678,9 +684,11 @@ \defcsname\??mixedcolumnsstop\s!otr\endcsname {\par \ifcase\c_page_mix_otr_nesting\or - \doifelse{\mixedcolumnsparameter\c!balance}\v!yes - {\c_page_mix_routine\c_page_mix_routine_balance}% - {\penalty-\plustenthousand}% weird hack, we need to trigger the otr sometimes (new per 20140306, see balancing-001.tex) + \ifcstok{\mixedcolumnsparameter\c!balance}\v!yes + \c_page_mix_routine\c_page_mix_routine_balance + \else + \penalty-\plustenthousand % weird hack, we need to trigger the otr sometimes (new per 20140306, see balancing-001.tex) + \fi \page_otr_trigger_output_routine \ifvoid\b_page_mix_preceding \else % empty columns so we need to make sure pending content is flushed @@ -770,8 +778,7 @@ \page_mix_hbox to \d_page_mix_max_width \bgroup \edef\p_separator{\mixedcolumnsparameter\c!separator}% \mixedcolumnseparatorwidth\d_page_mix_distance % \mixedcolumnsparameter\c!rulethickness\relax - \edef\p_direction{\mixedcolumnsparameter\c!direction}% - \ifx\p_direction\v!reverse + \ifcstok{\mixedcolumnsparameter\c!direction}\v!reverse \dostepwiserecurse\c_page_mix_n_of_columns\plusone\minusone {\page_mix_routine_package_step \ifnum\recurselevel>\plusone @@ -849,16 +856,17 @@ %writestatus\m!columns{construct balance}% \page_mix_routine_construct\v!yes \page_mix_routine_package - \c_page_mix_routine\c_page_mix_routine_regular - % \setupoutputroutine[\s!singlecolumn]% + % \c_page_mix_routine\c_page_mix_routine_regular % no, because we also need to set vsize + \setupoutputroutine[\s!singlecolumn]% \page_otr_command_set_vsize \page_otr_command_set_hsize \par %writestatus\m!columns{flush balance}% \page_grids_add_to_mix\b_page_mix_collected % no linenumbers here \box\b_page_mix_collected - \vskip\zeropoint % triggers recalculation of page stuff (weird that this is needed but it *is* needed, see mixed-001.tex) - \par + % can't we do this differently now? +% \vskip\zeroskip % triggers recalculation of page stuff (weird that this is needed but it *is* needed, see mixed-001.tex) +% \par \nointerlineskip \prevdepth\strutdp \clf_mixflushrest% rubish @@ -989,9 +997,9 @@ \protected\def\page_mix_command_check_if_float_fits {\ifpostponecolumnfloats - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \orelse\ifconditional\c_page_floats_not_permitted - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \else % \bgroup % \getcolumnstatus{\count255}{\dimen0}{\dimen2}% @@ -1001,13 +1009,13 @@ % \snaptogrid\vbox{\vskip\floatheight}}% copy? % \advanceby\dimen0\dimexpr\ht\scratchbox+2\openlineheight+.5\lineheight\relax\relax % needed because goal a bit higher % \ifdim\dimen0>\dimen2 -% \global\setfalse\c_page_floats_room +% \global\c_page_floats_room\conditionalfalse % \else - \global\settrue\c_page_floats_room + \global\c_page_floats_room\conditionaltrue \fi \ifdim\floatwidth>\hsize \showmessage\m!columns{11}\empty - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \fi} \protected\def\page_mix_command_flush_floats diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl index 597cff17d3b..066426b15af 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl @@ -73,7 +73,7 @@ l=\pagecutmarklength,o=\pagecutmarkoffset}% \egroup \wd\scratchbox\scratchwidth\ht\scratchbox\scratchheight\dp\scratchbox\scratchdepth - \hskip-\scratchwidth\box\scratchbox} + \hkern-\scratchwidth\box\scratchbox} \def\page_marks_add_marking {\setlayoutcomponentattribute{\v!print:\v!marking}% @@ -84,7 +84,7 @@ l=\pagecutmarklength,o=\pagecutmarkoffset}% \egroup \wd\scratchbox\scratchwidth\ht\scratchbox\scratchheight\dp\scratchbox\scratchdepth - \hskip-\scratchwidth\box\scratchbox} + \hkern-\scratchwidth\box\scratchbox} \def\page_marks_add_lines {\setlayoutcomponentattribute{\v!print:\v!lines}% @@ -96,7 +96,7 @@ x=\the\c_page_marks_nx,y=\the\c_page_marks_ny}% \egroup \wd\scratchbox\scratchwidth\ht\scratchbox\scratchheight\dp\scratchbox\scratchdepth - \hskip-\scratchwidth\box\scratchbox} + \hkern-\scratchwidth\box\scratchbox} \def\page_marks_add_number {\setlayoutcomponentattribute{\v!print:\v!number}% @@ -108,7 +108,7 @@ n=\number\ifcase\arrangeno\realpageno\else\arrangeno\fi}% \egroup \wd\scratchbox\scratchwidth\ht\scratchbox\scratchheight\dp\scratchbox\scratchdepth - \hskip-\scratchwidth\box\scratchbox} + \hkern-\scratchwidth\box\scratchbox} \def\page_marks_add_page_indeed#1% {\setbox#1\hpack\bgroup @@ -160,24 +160,24 @@ \installpagecutmark\v!on {%settrue\c_page_marks_add_page_lines - \settrue\c_page_marks_add_more_lines - \settrue\c_page_marks_add_more_number} + \c_page_marks_add_more_lines\conditionaltrue + \c_page_marks_add_more_number\conditionaltrue} \installpagecutmark\v!page - {\settrue\c_page_marks_add_page_lines - \settrue\c_page_marks_add_more_lines - \settrue\c_page_marks_add_more_number} + {\c_page_marks_add_page_lines\conditionaltrue + \c_page_marks_add_more_lines\conditionaltrue + \c_page_marks_add_more_number\conditionaltrue} \installpagecutmark\v!empty {%settrue\c_page_marks_add_page_lines - \settrue\c_page_marks_add_more_lines} + \c_page_marks_add_more_lines\conditionaltrue} \installpagecutmark\v!color {%settrue\c_page_marks_add_page_lines - \settrue\c_page_marks_add_more_lines - \settrue\c_page_marks_add_more_color - \settrue\c_page_marks_add_more_marking - \settrue\c_page_marks_add_more_number} + \c_page_marks_add_more_lines\conditionaltrue + \c_page_marks_add_more_color\conditionaltrue + \c_page_marks_add_more_marking\conditionaltrue + \c_page_marks_add_more_number\conditionaltrue} \installpagecutmark\v!one {\global\c_page_marks_max\plusone} % first page \installpagecutmark\v!two {\global\c_page_marks_max\plustwo} % first two pages @@ -187,11 +187,11 @@ {\begincsname\??layoutmarking#1\endcsname} \def\page_marks_setup_layout - {\setfalse\c_page_marks_add_page_lines - \setfalse\c_page_marks_add_more_color - \setfalse\c_page_marks_add_more_marking - \setfalse\c_page_marks_add_more_lines - \setfalse\c_page_marks_add_more_number + {\c_page_marks_add_page_lines\conditionalfalse + \c_page_marks_add_more_color\conditionalfalse + \c_page_marks_add_more_marking\conditionalfalse + \c_page_marks_add_more_lines\conditionalfalse + \c_page_marks_add_more_number\conditionalfalse \global\c_page_marks_max\maxcount \rawprocesscommacommand[\layoutparameter\c!marking]\page_marks_set \ifnum\c_page_marks_max<\maxcount @@ -200,8 +200,8 @@ \ifconditional\c_page_marks_add_more_marking\orelse \ifconditional\c_page_marks_add_more_lines \orelse \ifconditional\c_page_marks_add_more_number \else - \settrue\c_page_marks_add_page_lines - \settrue\c_page_marks_add_more_number + \c_page_marks_add_page_lines\conditionaltrue + \c_page_marks_add_more_number\conditionaltrue \fi \fi \ifconditional\c_page_marks_add_page_lines diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl index aece474a793..aab402d31c8 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl @@ -13,8 +13,10 @@ \writestatus{loading}{ConTeXt Page Macros / Default Routine} -%D This is just the good old \CONTEXT\ output routine, which -%D has been there right from the start. +%D This is just the good old \CONTEXT\ output routine, which has been there right +%D from the start. + +% todo: flush page figures without header and footer \unprotect @@ -40,8 +42,8 @@ \newconditional\c_page_one_set_vsize_tmp \installtextracker{otr.insertheights} - {\settrue\c_page_one_set_vsize_tmp} - {\setfalse\c_page_one_set_vsize_tmp} + {\c_page_one_set_vsize_tmp\conditionaltrue} + {\c_page_one_set_vsize_tmp\conditionalfalse} \def\page_one_command_set_vsize_tmp {\settotalinsertionheight @@ -152,74 +154,6 @@ % % we can also have bottom notes on top of bottom insertions -% \protected\def\page_one_command_package_contents#1#2% \box \unvbox % this one will be redone (checked) -% {\bgroup -% \strc_notes_check_if_bottom_present -% \d_page_one_natural_depth\dp#2\relax -% % we need to set the height as otherwise the shrink will not kick in so the following -% % no longer applies: -% % -% % \setbox\b_page_one_contents\vbox \ifconditional\c_notes_bottom_present to \textheight \fi -% % -% \setbox\b_page_one_contents\vbox to \textheight % probably no pack -% {\page_otr_command_flush_top_insertions -% % this is messy ... we will provide a more tight area (no big deal as we can -% % do that at the lua end) -% % \parfillskip\zeropoint -% \page_one_registered_text_area_a#1#2% \unvbox -% % -% \ifgridsnapping -% \unskip % new per 2019-06-18, otherwise weird bottom floats -% \vkern\dimexpr\openstrutdepth-\d_page_one_natural_depth\relax -% \prevdepth\openstrutdepth -% \page_otr_command_flush_bottom_insertions -% \vfil -% \orelse\ifcase\bottomraggednessmode -% % ragged (default) -% \unskip % new per 2019-06-18, otherwise weird bottom floats -% \vkern\dimexpr\openstrutdepth-\d_page_one_natural_depth\relax -% \prevdepth\openstrutdepth -% % these have whitespace before but we can have some more options -% % like a \vfill or so -% \page_otr_command_flush_bottom_insertions -% \vfil -% \or -% % align (normal) -% \page_otr_command_flush_bottom_insertions -% \or -% % baseline -% \unskip % new per 2019-06-18, otherwise weird bottom floats -% \vkern\dimexpr\maxdepth-\d_page_one_natural_depth\relax -% \page_otr_command_flush_bottom_insertions -% \fi -% \fakepagenotes}% -% \page_one_command_package_show_state -% \ifconditional\c_notes_bottom_present -% \ifgridsnapping -% \ifcase\layoutlines -% \getrawnoflines\textheight -% \else -% \noflines\layoutlines -% \fi -% \scratchoffset\dimexpr\numexpr\noflines-\plusone\relax\lineheight+\topskip\relax -% \else -% \scratchoffset\ht\b_page_one_contents -% \fi -% \setbox\b_page_one_bottom_notes\hpack -% {\lower\scratchoffset\vbox{\placebottomnotes\par\kern\zeropoint}}% kerns makes notes sit on bottom % pack ? -% \smashbox\b_page_one_bottom_notes -% \ht\b_page_one_contents\zeropoint -% \page_one_registered_text_area_b -% {\vpack to \textheight -% {\box\b_page_one_contents -% \box\b_page_one_bottom_notes}}% -% \else -% \ht\b_page_one_contents\textheight -% \page_one_registered_text_area_b -% {\box\b_page_one_contents}% -% \fi -% \egroup} - %D \starttyping %D \setuplayout[height=middle] \showframe %D @@ -235,6 +169,8 @@ %D \stoptext %D \stoptyping +%D This will be replaced by vz + \newinteger\c_page_one_stretch % we use marked pages which actually slow down a little \def\page_one_check_stretch_contents @@ -249,6 +185,8 @@ {\edef\m_lines{\markedpageparameter\v!stretch\v!lines}% \ifempty\m_lines\else\c_page_one_stretch\m_lines\fi} +\let\page_one_hook_for_checks\gobbleoneargument + \protected\def\page_one_command_package_contents#1#2% \box \unvbox % this one will be redone (checked) {\bgroup \strc_notes_check_if_bottom_present @@ -258,14 +196,16 @@ % % \setbox\b_page_one_contents\vbox \ifconditional\c_notes_bottom_present to \textheight \fi % - \ifconditional\c_notes_bottom_present\else - \doifmarkedpage\v!stretch\page_one_check_stretch_lines - \fi + \page_layouts_check_stretch#2% + % +% \ifconditional\c_notes_bottom_present\else +% \doifmarkedpage\v!stretch\page_one_check_stretch_lines +% \fi \setbox\b_page_one_contents\vbox \ifcase\c_page_one_stretch to \textheight\fi % probably no pack {\page_otr_command_flush_top_insertions % this is messy ... we will provide a more tight area (no big deal as we can % do that at the lua end) - % \parfillskip\zeropoint + % \parfillskip\zeroskip \page_one_registered_text_area_a#1#2% \unvbox % \ifgridsnapping @@ -292,8 +232,14 @@ \vkern\dimexpr\maxdepth-\d_page_one_natural_depth\relax % \srule depth \dimexpr\maxdepth-\d_page_one_natural_depth\relax \page_otr_command_flush_bottom_insertions + \or + % depth + \vkern-\d_page_one_natural_depth + \unskip % new per 2019-06-18, otherwise weird bottom floats + \page_otr_command_flush_bottom_insertions \fi \fakepagenotes}% + \page_one_hook_for_checks\b_page_one_contents % todo \page_one_command_package_show_state \ifconditional\c_notes_bottom_present \ifgridsnapping @@ -315,9 +261,18 @@ {\box\b_page_one_contents \box\b_page_one_bottom_notes}}% \else - \ifcase\c_page_one_stretch\else - \page_one_check_stretch_contents + \ifcase\c_page_scale_lines + % nothing to do: vz not enabled + \orelse\ifdim\d_page_box_stretch_delta>\zeropoint + \page_scale_text_box_register_box\b_page_one_contents + \page_scale_text_box\b_page_one_contents + \else + \page_scale_text_box_register_page + \page_scale_text_box\b_page_one_contents \fi +% \ifcase\c_page_one_stretch\else +% \page_one_check_stretch_contents +% \fi \ht\b_page_one_contents\textheight \page_one_registered_text_area_b {\box\b_page_one_contents}% @@ -333,14 +288,14 @@ %D Insertions \newconditional\c_page_one_top_of_insert -\newconditional\c_page_one_correct_top_insert \settrue\c_page_one_correct_top_insert % false moves up (tight) +\newconditional\c_page_one_correct_top_insert \c_page_one_correct_top_insert\conditionaltrue % false moves up (tight) \newgluespec \s_page_one_between_top_insert \def\page_one_prepare_top_float {\ifzeropt\d_page_floats_inserted_top - \settrue\c_page_one_top_of_insert + \c_page_one_top_of_insert\conditionaltrue \else - \setfalse\c_page_one_top_of_insert + \c_page_one_top_of_insert\conditionalfalse \fi \s_page_one_between_top_insert\ifdim\d_strc_floats_top>\d_strc_floats_bottom\d_strc_floats_top\else\d_strc_floats_bottom\fi\relax \global\advanceby\d_page_floats_inserted_top\dimexpr\ht\floatbox+\dp\floatbox+\s_page_one_between_top_insert\relax} @@ -441,7 +396,7 @@ \page_floats_resave\s!text \noffloatinserts\c_page_floats_n_of_bottom\relax \fi - \global\settrue\c_page_floats_not_permitted % vgl topfloats s! + \global\c_page_floats_not_permitted\conditionaltrue % vgl topfloats s! \else \ifconditional\c_page_floats_some_waiting \showmessage\m!floatblocks7{\the\c_page_floats_n_of_bottom}% @@ -460,8 +415,10 @@ {\ifzeropt\page_inserts_get_height\namedinsertionnumber\s!topfloat\else \page_one_command_flush_top_insertions_indeed % less tracing \ifcase\bottomraggednessmode\or\else - % will be an option - \vskip\zeropoint plus \openstrutdepth minus \openstrutdepth + % will be an option because of stretch size effect when we limit + \ifzerodim\d_page_box_stretch_delta + \vskip\zeropoint\s!plus\openstrutdepth\s!minus\openstrutdepth\relax + \fi \fi \fi \global\d_page_floats_inserted_top\zeropoint} @@ -487,7 +444,7 @@ \page_one_command_flush_bottom_insertions_indeed \fi \global\d_page_floats_inserted_bottom\zeropoint - \global\setfalse\c_page_floats_not_permitted} + \global\c_page_floats_not_permitted\conditionalfalse} \def\page_one_command_flush_bottom_insertions_indeed {\ifgridsnapping @@ -501,7 +458,7 @@ \fi} \protected\def\page_one_command_flush_floats - {\global\settrue\c_page_floats_flushing + {\global\c_page_floats_flushing\conditionaltrue \ifconditional\c_page_floats_some_waiting \par % if kept, then option and definitely off in gridmode ! ! ! ! @@ -509,8 +466,8 @@ \page_one_command_flush_floats_indeed \fi \global\savednoffloats\zerocount - \global\setfalse\c_page_floats_some_waiting - \global\setfalse\c_page_floats_flushing} + \global\c_page_floats_some_waiting\conditionalfalse + \global\c_page_floats_flushing\conditionalfalse} \protected\def\page_one_command_flush_float_box {\ifconditional\c_page_floats_center_box \ifdim\wd\floatbox<\hsize @@ -519,7 +476,7 @@ \snaptogrid\hpack{\box\floatbox}} % was copy \def\page_one_command_floats_get_compressed - {\setfalse\c_page_floats_center_box % not needed as we do call directly + {\c_page_floats_center_box\conditionalfalse % not needed as we do call directly %% no longer (interferes with footnotes): %% %% \page_one_command_set_vsize % test 2011.06.24.001 @@ -567,7 +524,7 @@ \fi \page_otr_command_next_page % \page \ifvoid\b_page_margin_blocks - \global\setfalse\c_page_margin_blocks_present + \global\c_page_margin_blocks_present\conditionalfalse \else \doubleexpandafter\page_one_command_flush_margin_blocks \fi @@ -575,7 +532,7 @@ \protected\def\page_one_command_check_if_float_fits {\ifconditional\c_page_floats_not_permitted - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \else % new per 31/5/2004, should be an option, only one column mode \begingroup @@ -606,9 +563,9 @@ \fi \relax % really needed ! ! ! ! \ifdim\scratchdimenone>\scratchdimentwo - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \else - \global\settrue\c_page_floats_room + \global\c_page_floats_room\conditionaltrue \fi \fi} @@ -619,7 +576,9 @@ \page_one_command_set_top_insertions \page_one_command_set_bottom_insertions \ifconditional\c_page_floats_some_waiting - \doif{\rootfloatparameter\c!cache}\v!no\page_one_command_flush_floats % could be _otr_ + \ifcstok{\rootfloatparameter\c!cache}\v!no + \page_one_command_flush_floats % could be _otr_ + \fi \orelse\ifconditional\c_page_margin_blocks_present \page_one_command_flush_floats \fi @@ -666,7 +625,9 @@ {\setbox\floatbox\vpack{\box\floatbox}% ? can go \wd\floatbox\floatwidth #1{\box\floatbox}% - \doifinset\v!tall\floatlocationmethod\page_sides_flush_floats_after_par} + \ifinset\v!tall\floatlocationmethod + \page_sides_flush_floats_after_par + \fi} \def\page_one_place_float_left {\page_one_place_float_side_indeed @@ -732,50 +693,35 @@ \nonoindentation} % new, due to popular request \def\page_one_place_float_otherwise - {\doifelseinset\v!here\floatlocationmethod + {\ifinset\v!here\floatlocationmethod \page_one_place_float_otherwise_here - \page_one_place_float_otherwise_else} + \else + \page_one_place_float_otherwise_else + \fi} \def\page_one_place_float_otherwise_here - {\doifelseinset\v!always\floatlocationmethod - {\page[\v!preference]% - \page_otr_command_check_if_float_fits - \ifconditional\c_page_floats_room - \page_one_place_float_here_indeed - \else - \showmessage\m!floatblocks9\empty - \page_floats_resave\s!text - \fi} - {\ifconditional\c_page_floats_some_waiting - \page_floats_save\s!text - \nonoindentation - \else - \page[\v!preference]% - \page_otr_command_check_if_float_fits - \ifconditional\c_page_floats_room - \page_one_place_float_here_indeed - \else - \page_floats_save\s!text - \nonoindentation - \fi - \fi}} - -% \def\page_one_place_float_otherwise_else -% {\doifelseinset\v!always\floatlocationmethod -% {\page_otr_command_check_if_float_fits -% \ifconditional\c_page_floats_room -% \page_one_place_float_auto_top_bottom -% \else -% \showmessage\m!floatblocks9\empty -% \page_floats_resave\s!text -% \fi} -% {\page_otr_command_check_if_float_fits -% \ifconditional\c_page_floats_room -% \page_one_place_float_auto_top_bottom -% \else -% \page_floats_save\s!text -% \nonoindentation -% \fi}} + {\ifinset\v!always\floatlocationmethod + \page[\v!preference]% + \page_otr_command_check_if_float_fits + \ifconditional\c_page_floats_room + \page_one_place_float_here_indeed + \else + \showmessage\m!floatblocks9\empty + \page_floats_resave\s!text + \fi + \orelse\ifconditional\c_page_floats_some_waiting + \page_floats_save\s!text + \nonoindentation + \else + \page[\v!preference]% + \page_otr_command_check_if_float_fits + \ifconditional\c_page_floats_room + \page_one_place_float_here_indeed + \else + \page_floats_save\s!text + \nonoindentation + \fi + \fi} % Some new always top/bottom trickery. % @@ -784,25 +730,29 @@ % Harrison level creativity. \def\page_one_place_float_otherwise_else - {\doifelseinset\v!always\floatlocationmethod - {\page_otr_command_check_if_float_fits - \ifconditional\c_page_floats_room - \page_one_place_float_auto_top_bottom - \else - \showmessage\m!floatblocks9\empty - \doifelseinset\v!top\floatlocationmethod - {\page_floats_save\s!top} - {\doifelseinset\v!bottom\floatlocationmethod - {\page_floats_save\s!bottom} - {\page_floats_resave\s!text}}% - \fi} - {\page_otr_command_check_if_float_fits - \ifconditional\c_page_floats_room - \page_one_place_float_auto_top_bottom - \else - \page_floats_save\s!text - \nonoindentation - \fi}} + {\ifinset\v!always\floatlocationmethod + \page_otr_command_check_if_float_fits + \ifconditional\c_page_floats_room + \page_one_place_float_auto_top_bottom + \else + \showmessage\m!floatblocks9\empty + \ifinset\v!top\floatlocationmethod + \page_floats_save\s!top + \orelse\ifinset\v!bottom\floatlocationmethod + \page_floats_save\s!bottom + \else + \page_floats_resave\s!text + \fi + \fi + \else + \page_otr_command_check_if_float_fits + \ifconditional\c_page_floats_room + \page_one_place_float_auto_top_bottom + \else + \page_floats_save\s!text + \nonoindentation + \fi + \fi} \protected\def\page_one_command_set_always_insertions_bottom_indeed {\page_floats_flush\s!bottom\plusone diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx index d88a16c0604..d0bc22aaa1f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx @@ -45,10 +45,12 @@ \appendtoks \let\page_otr_commands_process\page_otr_specifics_preset - \the\t_page_otr_commands + \expand\t_page_otr_commands \let\page_otr_commands_process\gobbleoneargument \to \everyswitchoutputroutine +% use \csstring + \protected\def\page_otr_specifics_preset#name% {\edef\page_otr_specifics_command{\directoutputroutineparameter{#name}}% no inheritance of commands \ifempty\page_otr_specifics_command @@ -80,7 +82,7 @@ \let\page_otr_specifics_preset\page_otr_specifics_preset_normal \permanent\protected\def\traceoutputroutines - {\the\t_page_otr_tracers} + {\expand\t_page_otr_tracers} \appendtoks \let\page_otr_specifics_preset\page_otr_specifics_preset_traced @@ -114,14 +116,15 @@ \protected\def\page_otr_message_s#sign#what% {\writestatus \currentoutputroutine - {#sign\space \space - #what\space \space - p:\the\outputpenalty,\space - r:\the\realpageno ,\space - c:\number\mofcolumns,\space - v:\the\vsize ,\space - g:\the\pagegoal ,\space - t:\the\pagetotal ,\space + {#sign\space \space + #what\space \space + p:\the\outputpenalty ,\space + r:\the\realpageno ,\space + c:\number\mofcolumns ,\space + v:\the\vsize ,\space + g:\the\pagegoal ,\space + t:\the\pagetotal ,\space + h:\the\pagelastheight,\space i:\the\insertheights \ifdim\pagetotal>\pagegoal ,\space @@ -136,8 +139,8 @@ \permanent\protected\def\installoutputroutine#invoke#action% \invoke \action {\global\advanceby\c_page_otr_trigger_penalty\minusone - \frozen\protected\edef#invoke{\page_otr_trigger{\number\c_page_otr_trigger_penalty}}% - \setvalue{\??otrtriggers\number\c_page_otr_trigger_penalty}{#action}} + \frozen\protected\edef#invoke{\page_otr_trigger{\the\c_page_otr_trigger_penalty}}% + \defcsname\??otrtriggers\the\c_page_otr_trigger_penalty\endcsname{#action}} \protected\def\page_otr_triggered_output_routine_traced {\ifcsname\??otrtriggers\the\outputpenalty\endcsname @@ -171,9 +174,9 @@ \def\page_otr_set_engine_output_routine#content% {\global\output {\inotrtrue - \the\everybeforeoutput + \expand\everybeforeoutput #content\relax - \the\everyafteroutput}} + \expand\everyafteroutput}} \page_otr_set_engine_output_routine\page_otr_triggered_output_routine @@ -203,11 +206,49 @@ \fi \resetpagebreak} +% In case \pagetotal is ahead of \pagegoal (\pagelastheight is the real one) we +% need to make sure that we flush but we don't do that in a ragged situation where +% we have safeguards. + +% \setuplayout[limitstretch=yes] % border case 1 +% \setupalign[depth] +% +% \starttext +% \startitemize +% \dorecurse{24}{\startitem test \stopitem} +% \dorecurse{3}{\startitem test \stopitem} +% \startitem test \stopitem % border case 2 +% \stopitemize +% \stoptext + +% \def\page_otr_fill_page_unchecked +% {\ifdim\pagetotal>\pagegoal \else +% \normalvfil +% \fi} + +\def\page_otr_fill_page_unchecked + {% \writestatus{!!!!!}{h=\the\pagelastheight,t=\the\pagetotal,g=\the\pagegoal}% + \ifdim\pagetotal>\pagegoal + % we're probably okay and are not too flexible + \orelse\ifnum\bottomraggednessmode>\plusone + % we actualy want to be flexible + \else + % we have to make sure that we don't stretch + \normalvfil + \fi} + +\def\page_otr_fill_page_checked + {\ifdim\dimexpr\pagelastheight+\c_page_scale_lines\lineheight+\pageexcess\relax>\pagegoal\else + \normalvfil + \fi} + \def\page_otr_eject_page {\par \ifvmode - \ifdim\pagetotal>\pagegoal \else - \normalvfil + \ifcase\c_page_scale_lines + \page_otr_fill_page_unchecked + \else + \page_otr_fill_page_checked \fi \penalty\c_page_otr_eject_penalty \fi @@ -216,21 +257,24 @@ \def\page_otr_eject_page_and_flush_inserts % can be an installed one {\par \ifvmode - \ifdim\pagetotal>\pagegoal \else - \normalvfil + \ifcase\c_page_scale_lines + \page_otr_fill_page_unchecked + \else + \page_otr_fill_page_checked \fi \penalty\c_page_otr_super_penalty \fi \resetpagebreak} \def\page_otr_check_for_pending_inserts - {\ifnum\outputpenalty>\c_page_otr_super_penalty \else - \ifnum\insertpenalties>\zerocount - % something is being held over so we force a new page - \page_otr_force_another_page - \fi + {\ifnum\outputpenalty>\c_page_otr_super_penalty + \orelse\ifnum\insertpenalties>\zerocount + % something is being held over so we force a new page + \page_otr_force_another_page \fi} +%D So far. + \def\page_otr_force_another_page {% we should actually remove the dummy line in the otr \hpack to \hsize{}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl index d6298982c77..b05f38f30e8 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl @@ -122,6 +122,7 @@ % see one for comments as it is similar \strc_notes_check_if_bottom_present \d_page_one_natural_depth\dp#2\relax +% \page_layouts_check_stretch#2% \setbox\b_page_one_contents\vbox to \textheight {\page_col_command_flush_top_insertions \page_one_registered_text_area_a#1#2% @@ -142,10 +143,15 @@ \page_col_command_flush_bottom_insertions \or % baseline - \kern\dimexpr\maxdepth-\d_page_one_natural_depth\relax + \vkern\dimexpr\maxdepth-\d_page_one_natural_depth\relax + \page_col_command_flush_bottom_insertions + \or + % depth + \vskip-\d_page_one_natural_depth \page_col_command_flush_bottom_insertions \fi \fakepagenotes}% + \page_layouts_check_stretch\b_page_one_contents \page_one_command_package_show_state \ifconditional\c_notes_bottom_present \ifgridsnapping @@ -161,16 +167,25 @@ \setbox\b_page_one_bottom_notes\hpack {\hsize\d_page_col_column_width \setupnotes[\c!width=\textwidth]% - \lower\scratchoffset\vbox{\placebottomnotes\par\kern\zeropoint}}% - \ht\b_page_one_contents \zeropoint - \wd\b_page_one_contents \zeropoint - \ht\b_page_one_bottom_notes\zeropoint - \wd\b_page_one_bottom_notes\zeropoint - \wd\b_page_one_bottom_notes\d_page_col_column_width + \lower\dimexpr\scratchoffset-\initialpageskip\relax % watch the initialpageskip + \vbox{\placebottomnotes\par\kern\zeropoint}}% + \ht\b_page_one_contents \zeropoint + \wd\b_page_one_contents \zeropoint + \ht\b_page_one_bottom_notes\zeropoint + \wd\b_page_one_bottom_notes\d_page_col_column_width \page_col_registered_text_area_b {\vpack to \textheight {\hpack{\box\b_page_one_contents\box\b_page_one_bottom_notes}}}% \else + \ifcase\c_page_scale_lines + % nothing to do: vz not enabled + \orelse\ifdim\d_page_box_stretch_delta>\zeropoint + \page_scale_text_box_register_box\b_page_one_contents + \page_scale_text_box\b_page_one_contents + \else + \page_scale_text_box_register_page + \page_scale_text_box\b_page_one_contents + \fi \ht\b_page_one_contents\textheight \wd\b_page_one_contents\d_page_col_column_width \page_col_registered_text_area_b @@ -193,7 +208,7 @@ \setbox\scratchbox\vbox\bgroup \page_col_command_package_contents_one\unvbox\normalpagebox \egroup - \putboxincache\s!pagecolumn{\number\c_page_col_current}\scratchbox + \putboxincache\s!pagecolumn{\the\c_page_col_current}\scratchbox \ifnum\c_page_col_current=\c_page_col_n_of_columns \page_col_routine_package \page_otr_construct_and_shipout\box\normalpagebox\plusone @@ -208,7 +223,7 @@ \begingroup \floatingpenalty\zerocount \page_inserts_inject\namedinsertionnumber\s!topfloat\bgroup - \vbox to \d_page_col_top_height{\vss} + \vbox to \d_page_col_top_height{\vss}% % can be an option \page_col_command_flush_top_insertions \page_col_command_flush_floats @@ -227,98 +242,62 @@ % use \currentmixedcolumns instead of \recurselevel -\def\page_col_routine_package_step - {% needs packaging anyway - \mofcolumns\recurselevel % added - \getboxfromcache{\s!pagecolumn}{\number\recurselevel}\scratchbox - \page_lines_add_numbers_to_box\scratchbox\recurselevel\c_page_col_n_of_columns\plusone % new - \page_marks_synchronize_column\plusone\c_page_col_n_of_columns\recurselevel\scratchbox - % backgrounds - \anch_mark_column_box\scratchbox\recurselevel - \pagecolumnseparatorheight\ht\scratchbox - \pagecolumnseparatordepth \dp\scratchbox - \inheritedpagecolumnsframedbox\recurselevel\scratchbox} - \def\page_col_routine_package {\global\setbox\normalpagebox\hbox to \makeupwidth\bgroup \edef\p_separator{\pagecolumnsparameter\c!separator}% \pagecolumnseparatorwidth\d_page_col_distance - \edef\p_direction{\pagecolumnsparameter\c!direction}% - \ifx\p_direction\v!reverse - \dostepwiserecurse\c_page_col_n_of_columns\plusone\minusone - {\page_col_routine_package_step - \ifnum\recurselevel>\plusone + \ifcstok{\pagecolumnsparameter\c!direction}\v!reverse + \localcontrolledloop\c_page_col_n_of_columns\plusone\minusone + {\mofcolumns\currentloopiterator + \page_col_routine_package_step + \ifnum\mofcolumns>\plusone \page_col_routine_package_separate \fi}% \else - \dorecurse\c_page_col_n_of_columns - {\page_col_routine_package_step - \ifnum\recurselevel<\c_page_col_n_of_columns + \localcontrolledloop\plusone\c_page_col_n_of_columns\plusone + {\mofcolumns\currentloopiterator + \page_col_routine_package_step + \ifnum\mofcolumns<\c_page_col_n_of_columns \page_col_routine_package_separate \fi}% \fi \egroup - \resetboxesincache{\s!pagecolumn}} + \resetboxesincache{\s!pagecolumn\s!pagecolumn}% + \resetboxesincache{\s!pagecolumn}% + \global\initialpageskip\zeroskip + \global\initialtopskip \zeroskip} -%D \unknown +\def\page_col_routine_package_step + {% needs packaging anyway + \getboxfromcache{\s!pagecolumn\s!pagecolumn}{\number\mofcolumns}\scratchboxone + \getboxfromcache{\s!pagecolumn}{\number\mofcolumns}\scratchboxtwo + %\ht\scratchbox\dimexpr\ht\scratchboxtwo-\initialpageskip\relax + \ht\scratchboxtwo\dimexpr\ht\scratchboxtwo-\ht\scratchboxone\relax + \page_lines_add_numbers_to_box\scratchbox\mofcolumns\c_page_col_n_of_columns\plusone % new + \page_marks_synchronize_column\plusone\c_page_col_n_of_columns\mofcolumns\scratchboxtwo + % backgrounds + \anch_mark_column_box\scratchboxtwo\mofcolumns + \pagecolumnseparatorheight\ht\scratchboxtwo + \pagecolumnseparatordepth \dp\scratchboxtwo + \vpack\bgroup + \box\scratchboxone + \nointerlineskip\par + \inheritedpagecolumnsframedbox\mofcolumns\scratchboxtwo + \egroup} -% \protected\def\page_col_command_check_if_float_fits -% {\ifconditional\c_page_floats_not_permitted -% \global\setfalse\c_page_floats_room -% %\orelse\ifabsdim\dimexpr\d_page_col_available-\naturalfloatwd\relax<\onepoint -% \orelse\ifdim\dimexpr\d_page_col_available-\naturalfloatwd\relax>-\onepoint -% \global\settrue\c_page_floats_room -% \else -% \global\setfalse\c_page_floats_room -% \fi -% \ifconditional\c_page_floats_room -% \begingroup -% \scratchdimen\dimexpr\pagetotal+\lineheight\relax -% \ifdim\scratchdimen>\pagegoal -% \goodbreak -% \ifdim\dimexpr\d_page_col_available-\naturalfloatwd\relax>\onepoint -% \global\setfalse\c_page_floats_room -% \else -% \global\settrue\c_page_floats_room -% \fi -% \fi -% \endgroup -% \fi -% \ifconditional\c_page_floats_room -% \ifdim\pagetotal>\zeropoint -% \scratchdimenone\dimexpr\pagetotal+\floatheight+\d_strc_floats_top-\pageshrink\relax -% \scratchdimentwo\pagegoal -% \relax % needed -% \ifcase\c_page_one_float_method -% % method 0 : raw -% \or -% % method 1 : safe -% \advanceby\scratchdimentwo -\strutdp -% \or -% % method 2 : tight -% \advanceby\scratchdimenone -\onepoint -% \fi -% \relax % really needed ! ! ! ! -% \ifdim\scratchdimenone>\scratchdimentwo -% \global\setfalse\c_page_floats_room -% \fi -% \fi -% \ifconditional\c_page_floats_room -% \global\setbox\floatbox\hpack to \d_page_col_available{\hss\box\floatbox\hss}% -% \fi -% \fi} +%D \unknown \protected\def\page_col_command_check_if_float_fits {\ifconditional\c_page_floats_not_permitted % forget about it anyway - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \else % first we check the current column % \ifdim\dimexpr\d_page_col_width-\naturalfloatwd\relax>-\onepoint \ifdim\dimexpr\hsize-\naturalfloatwd\relax>-\onepoint - \global\settrue\c_page_floats_room + \global\c_page_floats_room\conditionaltrue \else - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \fi \ifconditional\c_page_floats_room % we fit in the column but do we have room @@ -342,7 +321,7 @@ \relax % really needed ! ! ! ! \ifdim\scratchdimenone>\scratchdimentwo % there is no room, give up - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse % now we can decide on a top float % \fi \else @@ -366,18 +345,18 @@ \hsize\d_page_col_available} \protected\def\page_col_command_flush_floats - {\global\settrue\c_page_floats_flushing + {\global\c_page_floats_flushing\conditionaltrue \ifconditional\c_page_floats_some_waiting \par \page_col_set_float_pack_hsize \page_col_command_flush_floats_indeed \fi \global\savednoffloats\zerocount - \global\setfalse\c_page_floats_some_waiting - \global\setfalse\c_page_floats_flushing} + \global\c_page_floats_some_waiting\conditionalfalse + \global\c_page_floats_flushing\conditionalfalse} \def\page_floats_show_pack_state_indeed#1% - {\llap{\smash{\backgroundline[black]{\strut\smallinfofont\white#1\space\the\nofcollectedfloats\space of\space\the\savednoffloats:\the\hsize}}\hskip.25\emwidth}} + {\llap{\smash{\backgroundline[black]{\strut\smallinfofont\white#1\space\the\nofcollectedfloats\space of\space\the\savednoffloats:\the\hsize}}\hkern.25\emwidth}} \installtextracker {floats.collecting} @@ -389,7 +368,7 @@ \def\page_col_command_flush_floats_indeed % much in common with OTRSET {\ifconditional\c_page_floats_some_waiting \ifconditional\c_page_floats_compress_flushed - \setfalse\c_page_floats_center_box % not needed as we do call directly + \c_page_floats_center_box\conditionalfalse % not needed as we do call directly \page_floats_collect\s!text\hsize\d_page_floats_compress_distance % \ifnum\nofcollectedfloats=\plusone @@ -443,7 +422,9 @@ \page_col_command_set_top_insertions \page_col_command_set_bottom_insertions \ifconditional\c_page_floats_some_waiting - \doif{\rootfloatparameter\c!cache}\v!no\page_col_command_flush_floats % could be _otr_ + \ifcstok{\rootfloatparameter\c!cache}\v!no + \page_col_command_flush_floats % could be _otr_ + \fi \orelse\ifconditional\c_page_margin_blocks_present \page_col_command_flush_floats \fi @@ -610,7 +591,7 @@ % %\page_col_column % \column % \page % % why was this \global\holdinginserts\zerocount -% \global\setfalse\c_page_sides_short} +% \global\c_page_sides_short\conditionalfalse} \let\page_col_command_flush_all_floats\relax @@ -731,16 +712,48 @@ \fi \endgroup} +% Keep this one as original: +% +% \def\page_col_flush_preceding +% {\ifvoid\b_page_mix_preceding \else +% % this is just one method but ok for now +% \begingroup +% % we might need more but for now this is ok +% \setupfloat[\c!spacebefore=,\c!spaceafter=]% +% \startplacefigure[\c!location={\v!top,\v!none}]% +% \box\b_page_mix_preceding +% \stopplacefigure +% \endgroup +% \fi} + \def\page_col_flush_preceding {\ifvoid\b_page_mix_preceding \else - % this is just one method but ok for now - \begingroup - % we might need more but for now this is ok - \setupfloat[\c!spacebefore=,\c!spaceafter=]% - \startplacefigure[\c!location={\v!top,\v!none}]% - \box\b_page_mix_preceding - \stopplacefigure - \endgroup + \scratchwidth \emwidth + \scratchheight\ht\b_page_mix_preceding + \scratchdepth \dp\b_page_mix_preceding + \global\initialpageskip\htdp\b_page_mix_preceding + \global\initialtopskip \strutht + % for the moment + \setbox\scratchbox\vbox\bgroup + \pagediscards + \egroup + \global\advanceby\initialtopskip \ht\scratchbox + % till here + \setbox\scratchbox\hbox to \zeropoint + \bgroup + \box\b_page_mix_preceding + \egroup + \putboxincache{\s!pagecolumn\s!pagecolumn}{\number\plusone}\scratchbox + \dostepwiserecurse\plustwo\c_page_col_n_of_columns\plusone + {\setbox\scratchbox\hbox to \zeropoint + \bgroup + \novrule + \s!width \scratchwidth + \s!height\scratchheight + \s!depth \scratchdepth + \hss + \egroup + \putboxincache{\s!pagecolumn\s!pagecolumn}{\recurselevel}\scratchbox}% \fi} % \let\page_col_notes_initialize \relax @@ -775,8 +788,8 @@ \fi \fi} -\def\page_col_notes_delay {\setfalse\c_page_col_notes_lastcolumn\ifcstok{\noteparameter\c!location}\v!lastcolumn\settrue\c_page_col_notes_lastcolumn\insertstorage\currentnoteinsertionnumber\plusone \fi} -\def\page_col_notes_inject{\setfalse\c_page_col_notes_lastcolumn\ifcstok{\noteparameter\c!location}\v!lastcolumn\settrue\c_page_col_notes_lastcolumn\insertstorage\currentnoteinsertionnumber\zerocount\fi} +\def\page_col_notes_delay {\c_page_col_notes_lastcolumn\conditionalfalse\ifcstok{\noteparameter\c!location}\v!lastcolumn\c_page_col_notes_lastcolumn\conditionaltrue\insertstorage\currentnoteinsertionnumber\plusone \fi} +\def\page_col_notes_inject{\c_page_col_notes_lastcolumn\conditionalfalse\ifcstok{\noteparameter\c!location}\v!lastcolumn\c_page_col_notes_lastcolumn\conditionaltrue\insertstorage\currentnoteinsertionnumber\zerocount\fi} \def\page_col_notes_initialize {\insertstoring\zerocount\strc_notes_process\page_col_notes_delay} \def\page_col_notes_reset {\insertstoring\zerocount\strc_notes_process\page_col_notes_inject} @@ -784,20 +797,22 @@ \protected\def\page_col_command_set_vsize % different ! {\page_one_command_set_vsize} -\permanent\tolerant\protected\def\startpagecolumns[#1]% +\permanent\tolerant\protected\def\startpagecolumns[#S#1]% {\begingroup \begingroup - \doifelseassignment{#1}% - {\lettonothing\currentpagecolumns - \setuppagecolumns[#1]}% - {\edef\currentpagecolumns{#1}}% + \ifhastok={#1}% + \lettonothing\currentpagecolumns + \setuppagecolumns[#1]% + \else + \cdef\currentpagecolumns{#1}% + \fi \edef\p_page{\pagecolumnsparameter\c!page}% \ifempty\p_page - \setfalse\c_page_col_page + \c_page_col_page\conditionalfalse \orelse\ifx\p_page\v!no - \setfalse\c_page_col_page + \c_page_col_page\conditionalfalse \else - \settrue\c_page_col_page + \c_page_col_page\conditionaltrue \page[\p_page]% \fi \c_page_col_n_of_columns\pagecolumnsparameter\c!n\relax @@ -825,6 +840,9 @@ % \nopenalties % + \global\initialpageskip\zeroskip + \global\initialtopskip \zeroskip + % % \insidecolumnstrue % NO! % \enforced\let\column\page_col_column @@ -872,6 +890,8 @@ \page % beware for empty pages \endgroup % \setupoutputroutine[\s!singlecolumn]% + \global\initialpageskip\zeroskip + \global\initialtopskip \zeroskip \page_otr_command_set_vsize \page_otr_command_set_hsize \page diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl index 45d049760fd..e5645f61cdc 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl @@ -22,7 +22,7 @@ \newevery\everytopofpage\relax \appendtoks - \the\everytopofpage + \expand\everytopofpage \to \everystarttext \appendtoks @@ -74,12 +74,12 @@ \protected\def\page_postponed_blocks_flush_indeed {\begingroup \setsystemmode\v!postponing - \settrue\c_page_postponed_busy + \c_page_postponed_busy\conditionaltrue \ifnum\c_page_postponed_mode=\plusone \savepagecontent \fi \pagetotal\zeropoint % here? still needed? (was after flush pagefloats) - \the\everytopofpage\relax + \expand\everytopofpage\relax %\flushrestfloats \page_floats_flush_page_floats \setnormalcatcodes % postponing in verbatim diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx index 6344a0cc9d4..123efb1571c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx @@ -15,6 +15,8 @@ %D to be in the core. So, this could become runtime loaded code. Some of %D the alternatives need checking. +%D Todo: update to use luametatex features. + \writestatus{loading}{ConTeXt Page Macros / Page Selection} \unprotect @@ -57,12 +59,12 @@ \newinteger\c_page_selectors_n -\permanent\tolerant\protected\def\insertpages[#filename]#spacer[#emptylist]#spacer[#settings]% - {\doifelseassignment{#emptylist} - {\page_selectors_insert_indeed[#filename][][#emptylist]} +\permanent\tolerant\protected\def\insertpages[#filename]#spacer[#emptylist]#spacer[#S#settings]% + {\doifelseassignment{#emptylist}% + {\page_selectors_insert_indeed[#filename][][#emptylist]}% {\page_selectors_insert_indeed[#filename][#emptylist][#settings]}} -\def\page_selectors_insert_indeed[#filename][#emptylist][#settings]% +\def\page_selectors_insert_indeed[#filename][#emptylist][#S#settings]% {\bgroup \dontcomplain \getfiguredimensions[#filename]% @@ -70,21 +72,39 @@ [\c!width=\zeropoint, \c!n=\noffigurepages, \c!category=, + \c!alternative=\v!a, #settings]% \global\c_page_selectors_n\directwithpagesparameter\c!n\relax \scratchwidth\directwithpagesparameter\c!width\relax - \doifinset0{#emptylist} - {\emptyhbox\page}% + \ifinset{0}{#emptylist}% + \emptyhbox + \page + \fi \dorecurse\c_page_selectors_n - {\page_selectors_filter_a_page{#filename}\recurselevel - \doifinset\recurselevel{#emptylist} - {\emptyhbox\page}}% + {\page_selectors_filter_alternative{#filename}\recurselevel + \ifinset{\recurselevel}{#emptylist}% + \emptyhbox + \page + \fi}% \egroup} \let\page_selectors_filter_step_indeed\gobbleoneargument \let\page_selectors_filter_step \gobbleoneargument -\permanent\tolerant\protected\def\filterpages[#filename]#spacer[#selection]#spacer[#settings]% % \noffigurepages not yet supported +\installcorenamespace{filterpagesalternative} + +\protected\def\page_selectors_filter_alternative + {\expandnamespaceparameter + \??filterpagesalternative + \directwithpagesparameter\c!alternative + \v!a} + +\permanent\tolerant\protected\def\filterpages[#filename]#spacer[#selection]#spacer[#S#settings]% + {\doifelseassignment{#selection}% + {\page_selectors_filter_indeed[#filename][][#selection]}% + {\page_selectors_filter_indeed[#filename][#selection][#settings]}} + +\def\page_selectors_filter_indeed[#filename][#selection][#S#settings]% % \noffigurepages not yet supported {\bgroup \dontcomplain \getfiguredimensions[#filename]% @@ -92,41 +112,47 @@ [\c!width=\zeropoint, \c!n=\noffigurepages, \c!category=, + \c!alternative=\v!a, #settings]% \global\c_page_selectors_n\directwithpagesparameter\c!n\relax \scratchwidth\directwithpagesparameter\c!width\relax \edef\p_selection{#selection}% - \ifx\p_selection\v!even + \ifempty\p_selection + \let\p_selection\v!all + \fi + \ifx\p_selection\v!all + \dorecurse\c_page_selectors_n + {\page_selectors_filter_alternative{#filename}\recurselevel}% + \orelse\ifx\p_selection\v!even \dorecurse\c_page_selectors_n {\ifodd\recurselevel\else - \page_selectors_filter_a_page{#filename}\recurselevel + \page_selectors_filter_alternative{#filename}\recurselevel \fi}% \orelse\ifx\p_selection\v!odd \dorecurse\c_page_selectors_n {\ifodd\recurselevel\relax - \page_selectors_filter_a_page{#filename}\recurselevel + \page_selectors_filter_alternative{#filename}\recurselevel \fi}% \else \def\page_selectors_filter_step_indeed#page% {\ifnum#page>\c_page_selectors_n\else - \page_selectors_filter_a_page{#filename}{#page}% + \page_selectors_filter_alternative{#filename}{#page}% \fi}% \def\page_selectors_filter_step#step% - {\dowithrange{#step}\page_selectors_filter_step_indeed}% + {\dowithminmaxrange{1}{\noffigurepages}{#step}\page_selectors_filter_step_indeed}% \processcommacommand[\p_selection]\page_selectors_filter_step \fi \egroup} -\def\page_selectors_filter_a_page#filename#page% - {%\startpagemakeup - \hpack to \textwidth +\defcsname\??filterpagesalternative\v!a\endcsname#filename#page% + {\hpack to \textwidth {\ifdim\scratchwidth>\zeropoint \rightorleftpageaction{\scratchwidth\zeropoint}{\hfill}% \fi \setbox\scratchbox\hpack {\hskip-\scratchwidth \edef\p_category{\directwithpagesparameter\c!category}% \useexternalfigure[foo][width=\textwidth] - \ifempty\p_category + \ifx\p_category\empty \externalfigure[#filename][\c!page=#page,\c!height=\textheight]% \else \externalfigure[#filename][\p_category][\c!page=#page]% @@ -134,9 +160,17 @@ \hss}% \wd\scratchbox\zeropoint \box\scratchbox}% - \page}%\stoppagemakeup} + \page} + +\defcsname\??filterpagesalternative\v!b\endcsname#filename#page% + {\startTEXpage + \externalfigure[#filename][\c!page=#page]% + \stopTEXpage} + +\letcsname\??filterpagesalternative\v!default\expandafter\endcsname\csname\??filterpagesalternative\v!a\endcsname +\letcsname\??filterpagesalternative\v!page \expandafter\endcsname\csname\??filterpagesalternative\v!b\endcsname -\permanent\tolerant\protected\def\copypages[#filename]#spacer[#settings]#spacer[#figuresettings]% +\permanent\tolerant\protected\def\copypages[#filename]#spacer[#S#settings]#spacer[#S#figuresettings]% {\bgroup \getfiguredimensions[#filename]% \setupcurrentwithpages @@ -151,14 +185,18 @@ {\vbox to \textheight {\hsize\textwidth \centeredbox - {\doifelse{\directwithpagesparameter\c!marking}\v!on\cuthbox\hpack % only place where cuthbox is used + {\ifcstok{\directwithpagesparameter\c!marking}\v!on + \expandafter\cuthbox + \else + \expandafter\hpack % only place where cuthbox is used + \fi {\ifdim\scratchoffset>\zeropoint\relax \advanceby\vsize -2\scratchoffset \advanceby\hsize -2\scratchoffset \externalfigure[#filename][\c!page=\recurselevel,#figuresettings,\c!scale=,\c!factor=\v!max,\c!offset=\v!overlay]% \else \externalfigure[#filename][\c!page=\recurselevel,#figuresettings,\c!offset=\v!overlay]% - \fi}}} + \fi}}}% \page}% \egroup} @@ -190,7 +228,7 @@ \installcorenamespace{combinepagesalternative} -\permanent\tolerant\protected\def\combinepages[#filename]#spacer[#settings]% a=perpag b=free +\permanent\tolerant\protected\def\combinepages[#filename]#spacer[#S#settings]% a=perpag b=free {\bgroup \dontcomplain \getfiguredimensions[#filename]% @@ -319,7 +357,7 @@ % This macro cuts a page into n parts that can be pasted together. -\permanent\tolerant\protected\def\slicepages[#filename]#spacer[#oddsettings]#spacer[#evensettings]% +\permanent\tolerant\protected\def\slicepages[#filename]#spacer[#S#oddsettings]#spacer[#S#evensettings]% {\ifparameter#evensettings\or \page_selectors_slice_indeed[#filename][#oddsettings][#evensettings]% \else @@ -330,7 +368,7 @@ \mutable\let\slicedpagestepx \!!zerocount \mutable\let\slicedpagestepy \!!zerocount -\def\page_selectors_slice_indeed[#filename][#oddsettings][#evensettings]% +\def\page_selectors_slice_indeed[#filename][#S#oddsettings][#S#evensettings]% {\bgroup \dontcomplain \glet\slicedpagenumber\!!zerocount @@ -369,7 +407,7 @@ \clip [\c!nx=\c_page_selectors_n,\c!ny=\c_page_selectors_n,\c!x=\slicedpagestepx,\c!y=\slicedpagestepy]% {\scale - [\c!scale=\number\c_page_selectors_n000]% + [\c!scale=\the\c_page_selectors_n000]% {\externalfigure[#filename][\c!page=\slicedpagenumber]}}% \page}}% \else @@ -389,7 +427,7 @@ % \starttext \slicepages[slice1.pdf][n=3] \stoptext -\permanent\protected\def\trimpages[#1]% was for a over decade in p-pdf-51.tex +\permanent\protected\def\trimpages[#S#1]% was for a over decade in p-pdf-51.tex {\begingroup \getdummyparameters [\c!file=dummy,% diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl index 13131fa8d9b..ea162fb2e91 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl @@ -479,8 +479,8 @@ \def\page_sides_flush_floats_reset {\global\d_page_sides_vsize\d_page_sides_vsize_reset % also here if used at all \global\holdinginserts\zerocount - \global\setfalse\c_page_sides_short - \global\setfalse\c_page_sides_flag + \global\c_page_sides_short\conditionalfalse + \global\c_page_sides_flag\conditionalfalse \global\c_page_sides_checks_done\zerocount} \def\page_sides_flush_floats_after_none % we force a flush @@ -543,7 +543,7 @@ \def\page_sides_flush_floats_progress {\begingroup \page_sides_force_depth - \parskip\zeropoint + \parskip\zeroskip \let\page_sides_flush_floats\relax \edef\m_pages_strut {\ifcsname\??sidefloatsteps\rootfloatparameter\c!step\endcsname @@ -553,11 +553,11 @@ \fi}% \forgetall \offinterlineskip - \doloop + \localcontrolledrepeating {\scratchdimen\d_page_sides_flush_criterium \ifdim\scratchdimen>\onepoint % good enough, can become configurable - \ifnum\recurselevel>\plushundred % safeguard, sort of deadcycles - \exitloop + \ifnum\currentloopiterator>\plushundred % safeguard, sort of deadcycles + \quitloop \orelse\iftracesidefloats \page_sides_flush_floats_tracer\par \else @@ -565,7 +565,7 @@ \fi \else \page_sides_force_depth - \exitloop + \quitloop \fi}% \endgroup} @@ -646,8 +646,8 @@ {\global\d_page_sides_vsize\d_page_sides_vsize_reset \global\c_page_sides_n_of_lines\zerocount % also here if used at all \global\holdinginserts\zerocount - \global\setfalse\c_page_sides_short - \global\setfalse\c_page_sides_flag} + \global\c_page_sides_short\conditionalfalse + \global\c_page_sides_flag\conditionalfalse} %D Here comes the output routine. We either go the fast route or we use the %D normal one (stored in \type {\page_otr_command_side_float_output}. We no @@ -657,7 +657,7 @@ \def\page_sides_output_routine {\page_otr_command_side_float_output \ifconditional\c_page_sides_short - \global\setfalse\c_page_sides_short + \global\c_page_sides_short\conditionalfalse \else \global\d_page_sides_vsize\d_page_sides_vsize_reset \global\c_page_sides_n_of_lines\zerocount @@ -703,7 +703,7 @@ % \def\page_sides_push_float_inline#1% % {\begingroup % \reseteverypar % needed ! -% \parskip\zeropoint % needed ! +% \parskip\zeroskip % needed ! % \nointerlineskip % \page_sides_set_skips % \page_floats_report_total @@ -761,8 +761,8 @@ \egroup \else \begingroup - \reseteverypar % needed ! - \parskip\zeropoint % needed ! + \reseteverypar % needed ! + \parskip\zeroskip % needed ! \nointerlineskip \page_sides_set_skips \page_floats_report_total @@ -777,7 +777,7 @@ % {\d_page_sides_progress\d_page_sides_vsize % \ifconditional\c_page_sides_flag % \advanceby\d_page_sides_progress-\d_page_sides_page_total -% \global\setfalse\c_page_sides_flag +% \global\c_page_sides_flag\conditionalfalse % \else % \advanceby\d_page_sides_progress-\pagetotal % \fi} @@ -801,7 +801,7 @@ \d_page_sides_progress\d_page_sides_vsize \ifconditional\c_page_sides_flag \advanceby\d_page_sides_progress-\d_page_sides_page_total - \global\setfalse\c_page_sides_flag + \global\c_page_sides_flag\conditionalfalse \else \ifdim\dimexpr\d_page_sides_progress+\d_page_sides_bottomtotal\relax>\pagegoal % we adapt pagegoal because we can already have placed something with @@ -812,7 +812,7 @@ \fi} \def\page_sides_analyse_space_stage_one - {\global\settrue\c_page_sides_flag + {\global\c_page_sides_flag\conditionaltrue % \ifdim\pagegoal=\maxdimen % \pagegoal\textheight % maybe % \fi @@ -855,17 +855,17 @@ \def\page_sides_analyse_space_stage_two {% how about \pagedepth \ifdim\scratchdimenone>\scratchdimentwo - \global\setfalse\c_page_floats_room + \global\c_page_floats_room\conditionalfalse \else \ifdim\dimexpr\pagegoal-\d_page_sides_vsize\relax<\d_page_sides_bottomtotal % just weird: \global\advanceby\d_page_sides_vsize \scratchdimenone - \global\settrue\c_page_sides_short + \global\c_page_sides_short\conditionaltrue % why was this \global\holdinginserts\plusone \else \global\advanceby\d_page_sides_vsize \d_page_sides_bottomtotal % wins over inbetween - \global\setfalse\c_page_sides_short + \global\c_page_sides_short\conditionalfalse \fi - \global\settrue\c_page_floats_room + \global\c_page_floats_room\conditionaltrue \fi} \def\page_sides_analyse_space @@ -884,7 +884,7 @@ % \fi \page_sides_analyse_space_stage_two \ifconditional\c_page_sides_shape_down - \global\settrue\c_page_floats_room + \global\c_page_floats_room\conditionaltrue \fi} %D As we have no clear end of one or more paragraphs we only have pre float @@ -911,10 +911,10 @@ % \page_sides_apply_vertical_shift % \page_sides_analyse_space % \ifconditional\c_page_floats_room -% \global\setfalse\c_page_sides_delayed +% \global\c_page_sides_delayed\conditionalfalse % % we're ok % \else -% \global\settrue\c_page_sides_delayed +% \global\c_page_sides_delayed\conditionaltrue % \global\c_page_sides_m_of_lines\c_page_sides_n_of_lines % \ifcase\c_page_sides_page_method % \page_otr_fill_and_eject_page @@ -929,7 +929,7 @@ % \page_sides_inject_dummy_lines % \fi % \page_sides_place_float -% \global\setfalse\c_page_sides_delayed +% \global\c_page_sides_delayed\conditionalfalse % \page_sides_check_floats_reset % \page_sides_wrapup} @@ -945,20 +945,20 @@ \page_sides_apply_vertical_shift \page_sides_analyse_space \ifconditional\c_page_floats_room - \global\setfalse\c_page_sides_delayed + \global\c_page_sides_delayed\conditionalfalse % we're ok \else \ifconditional\c_page_sides_keep_together \clf_interceptsamepagecontent\b_page_sides_spill_over \fi - \global\settrue\c_page_sides_delayed + \global\c_page_sides_delayed\conditionaltrue \global\c_page_sides_m_of_lines\c_page_sides_n_of_lines \ifcase\c_page_sides_page_method - \page_otr_fill_and_eject_page + \page_otr_fill_and_eject_page \or - \page_otr_force_new_page_one + \page_otr_force_new_page_one \else - \page_otr_fill_and_eject_page + \page_otr_fill_and_eject_page \fi \ifvoid\b_page_sides_spill_over\else \box\b_page_sides_spill_over @@ -968,7 +968,7 @@ \page_sides_inject_dummy_lines \fi \page_sides_place_float - \global\setfalse\c_page_sides_delayed + \global\c_page_sides_delayed\conditionalfalse \page_sides_check_floats_reset \page_sides_wrapup} @@ -1155,7 +1155,7 @@ {\page_sides_analyse_progress \ifdim\d_page_sides_progress>\zeropoint \relax \ifconditional\c_page_sides_short - \global\setfalse\c_page_sides_short + \global\c_page_sides_short\conditionalfalse \page_otr_fill_and_eject_page \else \kern\d_page_sides_progress diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl index 2f620bdbca3..4fddbafe9b6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl @@ -28,7 +28,7 @@ %D This will be replaced by mixed box. -\permanent\tolerant\protected\def\startsimplecolumns[#1]% +\permanent\tolerant\protected\def\startsimplecolumns[#S#1]% {\bgroup \setsimplecolumnshsize[#1]% \nopenalties @@ -42,7 +42,7 @@ \rigidcolumnbalance\scratchbox \egroup} -\permanent\protected\def\setsimplecolumnshsize[#1]% +\permanent\protected\def\setsimplecolumnshsize[#S#1]% {\getdummyparameters [\c!width=\hsize, \c!distance=1.5\bodyfontsize, diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl index 3d83126ce4a..795f3fa274c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl @@ -90,8 +90,8 @@ {\bgroup \page[\v!left]% %\setsystemmode{spread}% - \settrue\c_page_spread_busy - \expanded{\setuplayout[\c!textwidth=\the\dimexpr2\textwidth+2\backspace\relax]}% + \c_page_spread_busy\conditionaltrue + \normalexpanded{\setuplayout[\c!textwidth=\the\dimexpr2\textwidth+2\backspace\relax]}% \enforced\let\stopspread\page_spread_stop_yes} \permanent\protected\def\page_spread_stop_yes diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl index e883d8859e5..7c9f1a9c8c7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl @@ -46,7 +46,7 @@ \permanent\protected\def\enableoutputstream[#1]% could be \startoutputsubstream {\initializeoutputstreams - \the\everyenableoutputstream + \expand\everyenableoutputstream \inoutputstreamtrue \xdef\currentoutputstream{#1}% \clf_enablestream{#1} @@ -60,7 +60,7 @@ \permanent\protected\def\startoutputstream[#1]% {\begingroup \initializeoutputstreams - \the\everyenableoutputstream + \expand\everyenableoutputstream \inoutputstreamtrue \xdef\currentoutputstream{#1}% \clf_startstream{#1}} diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx index 67ca325b2a9..f58b7a0ec58 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx @@ -1,4 +1,5 @@ % macros=mkvi +% macros=mkvi %D \module %D [ file=page-txt, % copied from main-001, @@ -77,7 +78,7 @@ \definelayoutelement[\v!footer:\v!edge] [\v!footer][\c!lefttext=,\c!middletext=,\c!righttext=] \definelayoutelement[\v!bottom:\v!edge] [\v!bottom][\c!lefttext=,\c!middletext=,\c!righttext=] -\permanent\tolerant\protected\def\setuplayouttext[#vertical]#spacer[#horizontal]#spacer[#settings]% +\permanent\tolerant\protected\def\setuplayouttext[#vertical]#spacer[#horizontal]#spacer[#S#settings]% {\ifnum\lastarguments>\plustwo \setuplayoutelement[#vertical:#horizontal][#settings]% \else @@ -103,7 +104,7 @@ \def\page_layouts_synchronize_element#vertical% {\xdef\previoustextstate{\csname\??layouttextssynchronize#vertical\endcsname}% can be a let - \edef\currenttextstate {\namedlayoutelementparameter{#vertical}\c!state}% + \cdef\currenttextstate {\namedlayoutelementparameter{#vertical}\c!state}% %\writestatus{>>}{[#vertical:\currenttextstate/\previoustextstate]}% \ifx\currenttextstate\previoustextstate \else \page_layouts_synchronize_element_indeed{#vertical}% @@ -177,41 +178,41 @@ \mutable\lettonothing\currentlayoutelementstate -\permanent\tolerant\protected\def\setuptexts[#vertical]#spacer[#horizontal]#spacer[#a]#spacer[#b]#spacer[#c]#spacer[#d]% +\permanent\tolerant\protected\def\setuptexts[#vertical]#spacer[#horizontal]#spacer[#S#a]#spacer[#S#b]#spacer[#S#c]#spacer[#S#d]% {\ifarguments % there is always one \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \resetlayoutelementparameter\c!middletext - \edef\currentlayoutelement{#vertical:\v!margin}% + \cdef\currentlayoutelement{#vertical:\v!margin}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \resetlayoutelementparameter\c!middletext - \edef\currentlayoutelement{#vertical:\v!edge}% + \cdef\currentlayoutelement{#vertical:\v!edge}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \resetlayoutelementparameter\c!middletext \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \setlayoutelementparameter \c!middletext{\page_layouts_process_element_single{#horizontal}}% \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_single{#horizontal}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_single{#a}}% \or - \edef\currentlayoutelement{#vertical:#horizontal}% + \cdef\currentlayoutelement{#vertical:#horizontal}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_single{#a}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_single{#b}}% \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_double{#horizontal}{#c}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_double{#a}{#b}}% \or - \edef\currentlayoutelement{#vertical:#horizontal}% + \cdef\currentlayoutelement{#vertical:#horizontal}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_double{#a}{#d}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_double{#b}{#c}}% \fi} @@ -240,6 +241,7 @@ \protected\def\page_layouts_process_element_indeed#style#color#width% {\begingroup + \lefttoright % new \uselayoutelementstyleandcolor#style#color% \begincsname\??layouttextstrut\layoutelementparameter\c!strut\endcsname \ignorecrlf @@ -284,8 +286,8 @@ \fi} \appendtoks - \doifinset\v!header\floatspecification{\xdefcsname\namedlayoutelementhash\v!header\c!n\endcsname{1}}% - \doifinset\v!footer\floatspecification{\xdefcsname\namedlayoutelementhash\v!footer\c!n\endcsname{1}}% + \ifinset\v!header\floatspecification\xdefcsname\namedlayoutelementhash\v!header\c!n\endcsname{1}\fi + \ifinset\v!footer\floatspecification\xdefcsname\namedlayoutelementhash\v!footer\c!n\endcsname{1}\fi \to \everybeforeflushedpagefloat \protected\def\page_layouts_place_text_line#vertical% @@ -297,7 +299,7 @@ \fi#vertical} \permanent\protected\def\doifelselayouttextline#vertical% shown or not - {\edef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% + {\cdef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% \ifx\currentlayoutelementstate\v!normal \expandafter\firstoftwoarguments \orelse\ifx\currentlayoutelementstate\v!start @@ -307,7 +309,7 @@ \fi} \permanent\protected\def\doifelselayoutsomeline#vertical% present or not - {\edef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% + {\cdef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% \ifx\currentlayoutelementstate\v!none \expandafter\secondoftwoarguments \orelse\ifx\currentlayoutelementstate\v!high @@ -328,7 +330,7 @@ \letcsname\??layouttextsline\v!stop\endcsname\gobbletwoarguments \defcsname\??layouttextsline\v!high\endcsname#vertical#height% - {\global\settrue\resyncaftertextline + {\global\resyncaftertextline\conditionaltrue \page_layouts_reset_element_status#vertical} \defcsname\??layouttextsline\v!empty\endcsname#vertical#height% @@ -341,7 +343,7 @@ \defcsname\??layouttextsline\v!nomarking\endcsname#vertical#height% {\bgroup \page_layouts_reset_element_status#vertical% - \settrue\inhibitgetmarking + \inhibitgetmarking\conditionaltrue \page_layouts_place_text_line_indeed#vertical#height% \egroup} @@ -357,7 +359,7 @@ % \definetext [title] [header] [text] [aa] [bb] [cc] [dd] \def\page_layouts_place_text_line_unknown#vertical#height% - {\global\settrue\resyncaftertextline + {\global\resyncaftertextline\conditionaltrue \begingroup % new \page_layouts_reset_element_status#vertical% \begincsname\namedlayoutelementhash{#vertical}\textlinestatus\endcsname @@ -380,7 +382,7 @@ \ifconditional\resyncaftertextline \calculateglobalvsizes \page_backgrounds_recalculate - \global\setfalse\resyncaftertextline + \global\resyncaftertextline\conditionalfalse \fi} \permanent\def\getspecificlayouttext#vertical#horizontal#what% @@ -388,7 +390,7 @@ % \settext[header][text][middle][xxx][yyy] -\permanent\tolerant\protected\def\settextcontent[#vertical]#spacer[#horizontal]#spacer[#one]#spacer[#two]#spacer[#three]% header text middle text/text +\permanent\tolerant\protected\def\settextcontent[#vertical]#spacer[#horizontal]#spacer[#S#one]#spacer[#S#two]#spacer[#S#three]% header text middle text/text {\ifarguments\or\or\or % 3 \defcsname\namedlayoutelementhash{#vertical:#horizontal}\c!middletext\endcsname {\page_layouts_process_element_double{#one}{#one}}% @@ -404,14 +406,14 @@ %D This will be redefined, so no \type {\frozen} here! -\permanent\tolerant\protected\def\resettextcontent[#vertical]#spacer[#horizontal]#spacer[#tag]% header text middle +\permanent\tolerant\protected\def\resettextcontent[#vertical]#spacer[#horizontal]#spacer[#S#tag]% header text middle {\ifarguments\or\or % 2 - \edef\currentlayoutelement{#vertical:#horizontal}% + \cdef\currentlayoutelement{#vertical:#horizontal}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!middletext \resetlayoutelementparameter\c!righttext \or % 3 -% \edef\currentlayoutelement{#vertical:#horizontal}% +% \cdef\currentlayoutelement{#vertical:#horizontal}% % \letcsname\layoutelementhash\begincsname\??layouttextcontent\v!text:#tag\endcsname\c!middletext\endcsname\empty \letcsname\namedlayoutelementhash{#vertical:#horizontal}\begincsname\??layouttextcontent\v!text:#tag\endcsname\c!middletext\endcsname\empty \fi} @@ -502,7 +504,7 @@ \fi} \def\page_layouts_left_edge_element#text#style#color#width% - {\edef\currentlayoutelement{\currentlayouttextline:\v!edge}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!edge}% \page_layouts_place_element_indeed\leftedgewidth {\page_layouts_left_edge_element_indeed#text#style#color#width}% \kern\leftedgedistance} @@ -519,7 +521,7 @@ \fi} \def\page_layouts_right_edge_element#text#style#color#width% - {\edef\currentlayoutelement{\currentlayouttextline:\v!edge}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!edge}% \kern\rightedgedistance \page_layouts_place_element_indeed\rightedgewidth {\page_layouts_right_edge_element_indeed#text#style#color#width}} @@ -551,7 +553,7 @@ \fi} \def\page_layouts_left_margin_element#text#style#color#width#margintoo% - {\edef\currentlayoutelement{\currentlayouttextline:\v!margin}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!margin}% \page_layouts_place_element_indeed\leftmarginwidth {\page_layouts_left_margin_element_indeed#text#style#color#width#margintoo}% \kern\leftmargindistance} @@ -578,7 +580,7 @@ \fi} \def\page_layouts_right_margin_element#text#style#color#width#margintoo% - {\edef\currentlayoutelement{\currentlayouttextline:\v!margin}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!margin}% \kern\rightmargindistance \page_layouts_place_element_indeed\rightmarginwidth {\page_layouts_right_margin_element_indeed#text#style#color#width#margintoo}} @@ -657,11 +659,11 @@ \fi} \def\page_layouts_text_body_element_l_m_r_e - {\edef\currentlayoutelement{\currentlayouttextline:\v!text}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!text}% \page_layouts_place_element_indeed\makeupwidth\page_layouts_text_body_element_indeed_l_m_r_e} \def\page_layouts_text_body_element_e_r_m_l - {\edef\currentlayoutelement{\currentlayouttextline:\v!text}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!text}% \page_layouts_place_element_indeed\makeupwidth\page_layouts_text_body_element_indeed_e_r_m_l} \def\page_layouts_place_element_indeed#width#content% @@ -713,7 +715,7 @@ %D \chapter{tweede} \dorecurse{20}{\input tufte \relax} %D \stoptyping -\permanent\tolerant\protected\def\definetext[#tag]#spacer[#vertical]#spacer[#horizontal]#spacer[#a]#spacer[#b]#spacer[#c]#spacer[#d]% +\permanent\tolerant\protected\def\definetext[#tag]#spacer[#vertical]#spacer[#horizontal]#spacer[#S#a]#spacer[#S#b]#spacer[#S#c]#spacer[#S#d]% {\ifnum\lastarguments<\plusfour \defcsname\namedlayoutelementhash {#vertical}#tag\endcsname{\setuptexts[#vertical][#horizontal]\relax}% 1, 2, 3 \orelse\ifarguments\or\or\or\or @@ -728,19 +730,6 @@ %D A few more page breakers: -% \installpagebreakmethod \v!empty -% {\page_otr_flush_all_floats -% \page_otr_command_next_page -% \doifnot{\namedlayoutelementparameter\v!header\c!state}\v!stop{\setuplayoutelement[\v!header][\c!state=\v!empty]}% -% \doifnot{\namedlayoutelementparameter\v!footer\c!state}\v!stop{\setuplayoutelement[\v!footer][\c!state=\v!empty]}% -% \page_otr_insert_dummy_page} -% -% \installpagebreakmethod \v!header -% {\doifnot{\namedlayoutelementparameter\v!header\c!state}\v!stop{\setuplayoutelement[\v!header][\c!state=\v!empty]}} -% -% \installpagebreakmethod \v!footer -% {\doifnot{\namedlayoutelementparameter\v!footer\c!state}\v!stop{\setuplayoutelement[\v!footer][\c!state=\v!empty]}} - \installpagebreakmethod \v!empty {\page_otr_flush_all_floats \page_otr_command_next_page @@ -780,14 +769,15 @@ \def\page_layouts_reset_page_number_location {\ifrelax\m_page_layouts_page_number_location_v\else % this can be done better now, no meaning hackery needed - \edef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% + \cdef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% \edef\tempstring{\detokenizedlayoutelementparameter\m_page_layouts_page_number_location_x}% - \doif{\normalmeaningless\tempstring}{\normalmeaningless\page_layouts_place_page_number} - {\resetlayoutelementparameter\m_page_layouts_page_number_location_x}% + \iftok{\normalmeaningless\tempstring}{\normalmeaningless\page_layouts_place_page_number}% + \resetlayoutelementparameter\m_page_layouts_page_number_location_x + \fi \fi} \def\page_layouts_set_page_number_location - {\edef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% + {\cdef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% \letlayoutelementparameter\m_page_layouts_page_number_location_x\page_layouts_place_page_number \ifx\m_page_layouts_page_number_location_x\c!marginedgetext \let\page_layouts_place_extra_text_left \page_layouts_place_page_number_left @@ -890,7 +880,7 @@ \vkern\dimexpr-\textdistance-\textheight\relax \the\texttextcontent \vkern\textheight - \the\everyendoftextbody + \expand\everyendoftextbody \vkern\footerdistance \the\footertextcontent \vkern\dimexpr\footerheight+\bottomdistance\relax @@ -902,7 +892,63 @@ % only for very special controlled cases or experiments: -\let\page_scale_text_box\gobbleoneargument +\newinteger \c_page_scale_lines +\newdimension \d_page_box_stretch_delta +\newdimension \d_page_box_stretch_criterium +\newconditional\c_page_box_check_stretch + +% The stretch setting can depend on the current lineheight and the +% alignment can be set later. So we need to delay. + +\def\page_box_check_limit_stretch_indeed#1% + {\edef\p_limitstretch{\layoutparameter\c!limitstretch}% + \ifx\p_limitstretch\v!yes + \d_page_box_stretch_criterium\zeropoint + \settrue\c_page_box_check_stretch + \orelse\ifx\p_limitstretch\v!auto + % safeguard for depth without limit set + \ifnum\bottomraggednessmode=\plusthree + \d_page_box_stretch_criterium2\lineheight + \settrue\c_page_box_check_stretch + \else + \d_page_box_stretch_criterium\maxdimen + \setfalse\c_page_box_check_stretch + \fi + \orelse\ifchkdimension\p_limitstretch\or + \d_page_box_stretch_criterium\p_limitstretch\relax + \settrue\c_page_box_check_stretch + \else + \d_page_box_stretch_criterium\maxdimen + \setfalse\c_page_box_check_stretch + \fi + \ifconditional\c_page_box_check_stretch + \boxfixstretch\d_page_box_stretch_criterium#1\relax + \d_page_box_stretch_delta\boxstretchdelta + \fi} + +\let\page_box_check_limit_stretch\relax % we test for this + +\appendtoks + \edef\p_limitstretch{\layoutparameter\c!limitstretch}% + \ifx\p_limitstretch\v!yes + \let\page_box_check_limit_stretch\page_box_check_limit_stretch_indeed + \orelse\ifx\p_limitstretch\v!auto + \let\page_box_check_limit_stretch\page_box_check_limit_stretch_indeed + \orelse\ifchkdimension\p_limitstretch\or + \let\page_box_check_limit_stretch\page_box_check_limit_stretch_indeed + \else + \let\page_box_check_limit_stretch\relax % we test for this + \fi +\to \everysetuplayout + +\def\page_layouts_check_stretch#1% + {\ifcase\bottomraggednessmode + \d_page_box_stretch_delta\zeropoint + \orelse\ifrelax\page_box_check_limit_stretch + \d_page_box_stretch_delta\zeropoint + \else + \page_box_check_limit_stretch{#1}% + \fi} \def\page_insert_body#1#2% {\setbox\b_page_layouts_element\vpack @@ -929,7 +975,6 @@ \settextpagecontent\b_page_layouts_element{#1}{#2}% \page_backgrounds_add_to_text\b_page_layouts_element \page_grids_add_to_box\b_page_layouts_element - \page_scale_text_box\b_page_layouts_element \box\b_page_layouts_element \begingroup \ifdim\rightmarginwidth>\zeropoint @@ -947,6 +992,118 @@ \smashbox\b_page_layouts_element \box\b_page_layouts_element} +%D Long ago (relative to 2023), when Thanh and I were discussing the \PDFTEX\ hz +%D features with Hermann Zapf, we side tracked to vertical alignment. Hermann then +%D suggested to play with vertical scaling because \quotation {No user will notice +%D it}. Some quick experiment at the moment showed that it could work indeed but we +%D left it at that (the code stayed around). It is for that reason that this now +%D present feature has the key \type {vz}, as variant on \type {hz} (a.k.a.\ +%D expansion or fontadjust). + +\newconditional\c_page_scale_trace_vz + +\installtextracker + {layout.vz} + {\c_page_scale_trace_vz\conditionaltrue} + {\c_page_scale_trace_vz\conditionalfalse} + +\installcorenamespace{vzdistance} + +\def\page_scale_text_box_trace + {\writestatus{vz page \the\realpageno}{% + %\s!goal=\the\pagegoal, + %\s!total=\the\pagetotal, + \s!page=\the\pagegoal, + \s!text=\the\textheight, + \s!height=\the\pagelastheight, + \s!depth=\the\pagelastdepth, + \s!stretch=\the\pagelaststretch, + \s!shrink=\the\pagelastshrink, + \s!fill=(\thewithoutunit\pagelastfilstretch,\thewithoutunit\pagelastfillstretch,\thewithoutunit\pagelastfilllstretch)% + }} + +\def\page_scale_text_box_register_box#1% + {\scratchheight\boxrepack#1% + \scratchdimen\dimexpr\textheight-\scratchheight\relax + \global\expandafter\dimensiondef\csname\??vzdistance\the\mofcolumns\endcsname + \ifabsdim\scratchdimen>\c_page_scale_lines\lineheight + \zeropoint + \else + \scratchheight + \fi + \relax + \ifconditional\c_page_scale_trace_vz + \page_scale_text_box_trace + \fi} + +\def\page_scale_text_box_register_page + {\scratchdimen\dimexpr\textheight-\pagelastheight\relax % not \pagegoal as that includes footnotes + \global\expandafter\dimensiondef\csname\??vzdistance\the\mofcolumns\endcsname + \ifabsdim\scratchdimen>\c_page_scale_lines\lineheight + \zeropoint + \orelse\ifdim\pagelastshrink>\zeropoint % maybe also stretch + \zeropoint + \else + \pagelastheight + \fi + \relax + \ifconditional\c_page_scale_trace_vz + \page_scale_text_box_trace + \fi} + +\def\page_scale_text_box + {\scratchdistance\ifcsname\??vzdistance\the\mofcolumns\endcsname\lastnamedcs\else\zeropoint\fi + \ifzeropt\scratchdistance + \expandafter\gobbleoneargument + \else + \expandafter\page_scale_text_box_indeed + \fi} + +\def\page_scale_text_box_indeed#1% + {\scratchdimen \dimexpr\textheight-\scratchdistance\relax + \scratchheight\ht#1% + \scratchdepth \dp#1% + \scratchwidth \wd#1% + \scratchfloat \floatexpr\textheight/\scratchdistance\relax + \setbox#1\vpack\bgroup + \hpack\bgroup + \normalexpanded{\scale + %[\c!xscale=\plusthousand,\c!yscale=\scratchcounter] + [\c!sx=1,\c!sy=\the\scratchfloat]% + {\box#1}}% + \egroup + \ifconditional\c_page_scale_trace_vz + \nointerlineskip + \srule + \s!height \scratchdimen + \s!yoffset 2\scratchdimen + \s!xoffset-2\emwidth + \s!width 2\emwidth + \hpack + \s!yoffset \scratchdimen + \s!xoffset-2\emwidth + \bgroup + \edef\tempstring{\semiexpand\formatone{@0.3f}{\the\scratchfloat}}% + \writestatus{vz page \the\realpageno}{scaling \tempstring\space applied}% + \llap{\infofont\tempstring}% + \egroup + \fi + \egroup + \ht#1\scratchheight + \dp#1\scratchdepth + \wd#1\scratchwidth} + +\appendtoks + \edef\p_lines{\layoutparameter\c!vz}% + \ifx\p_lines\v!yes + \c_page_scale_lines\plusone + \orelse\ifchknumber\p_lines\or + \c_page_scale_lines\lastchknumber + \else + \c_page_scale_lines\zerocount + \fi +\to \everysetuplayout + %D The main text area has to be combined with some additional (tracing) information. %D %D This will be stored as normal and overloaded in page-lyr and later in page-spr we diff --git a/Master/texmf-dist/tex/context/base/mkxl/phys-dim.lmt b/Master/texmf-dist/tex/context/base/mkxl/phys-dim.lmt index d3b6f80ba24..ffa53983f18 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/phys-dim.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/phys-dim.lmt @@ -852,6 +852,8 @@ local function update_parsers(keepcase) -- todo: don't remap utf sequences shortoperator = Cs(V("somespace") * p_short_operator), packaged = Cs(V("somespace") * p_packaged), -- +specialsuffix = Cs(V("somespace") * P("^")/"" * lbrace * (1-rbrace)^1 * rbrace), + -- nothing = Cc(""), somespace = somespace, nospace = (1-somespace)^1, -- was 0 @@ -876,6 +878,7 @@ local function update_parsers(keepcase) -- todo: don't remap utf sequences + V("longprefix") * V("shortunit") -- centi m + V("shortprefix") * V("longunit"), -- c meter + -- combination = ( V("longprefix") -- centi meter -- + V("nothing") -- ) * V("longunit") @@ -891,7 +894,7 @@ local function update_parsers(keepcase) -- todo: don't remap utf sequences * ( V("packaged") / dimpre + (V("longsuffix") * V("combination")) / dimspu - + (V("combination") * (V("shortsuffix") + V("nothing"))) / dimpus + + (V("combination") * (V("shortsuffix") + V("specialsuffix") + V("nothing"))) / dimpus ) * (V("qualifier") / ctx_unitsQ)^-1 * V("somespace"), @@ -969,8 +972,10 @@ local c_p_parser_keepcase = nil local dirty_lowercase = true local dirty_keepcase = true -local v_reverse = interfaces.variables.reverse -local v_keep = interfaces.variables.keep +local v_reverse = interfaces.variables.reverse +local v_keep = interfaces.variables.keep + +local lastunitstring = "" local function makeunit(order,option,str) local reverse = order == v_reverse @@ -995,6 +1000,7 @@ local function makeunit(order,option,str) end parser = reverse and p_c_parser_lowercase or c_p_parser_lowercase end + lastunitstring = str if not matchlpeg(parser,str) then report_units("unable to parse: %s",str) context(str) @@ -1093,6 +1099,12 @@ implement { arguments = "3 strings" } +implement { + name = "lastunitstring", + public = true, + actions = function() context(lastunitstring) end, +} + implement { name = "registerunit", actions = registerunit, diff --git a/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl b/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl index e085ba844f8..08d67d0ae3c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl @@ -140,9 +140,9 @@ \expandafter\phys_digits_normalized_text \fi} -\def\phys_digits_normalized_math#1#2% - {\setbox\scratchbox\hbox{\normalstartimath\Ustack{#1}\normalstopimath}% - \hbox to \wd\scratchbox{\hss{\normalstartimath\Ustack{#2}\normalstopimath}\hss}} +\def\phys_digits_normalized_math#1#2% todo + {\setbox\scratchbox\hbox{\normalstartimath\mathstack{#1}\normalstopimath}% + \hbox to \wd\scratchbox{\hss{\normalstartimath\mathstack{#2}\normalstopimath}\hss}} \def\phys_digits_normalized_text#1#2% {\setbox\scratchbox\hbox{#1}% @@ -224,9 +224,9 @@ \letcsname\??digitsperiod6\endcsname\normaldigitsperiodsymbol \letcsname\??digitsspace 6\endcsname\thickspace -\frozen\protected\def\digitscommasymbol {\csname\??digitscomma \number\c_phys_digits_method\endcsname} -\frozen\protected\def\digitsperiodsymbol {\csname\??digitsperiod\number\c_phys_digits_method\endcsname} -\frozen\protected\def\digitsseparatorspace {\csname\??digitsspace \number\c_phys_digits_method\endcsname} +\frozen\protected\def\digitscommasymbol {\csname\??digitscomma \the\c_phys_digits_method\endcsname} +\frozen\protected\def\digitsperiodsymbol {\csname\??digitsperiod\the\c_phys_digits_method\endcsname} +\frozen\protected\def\digitsseparatorspace {\csname\??digitsspace \the\c_phys_digits_method\endcsname} \frozen\protected\def\digitsfinalcomma {\digitsperiodsymbol} % more for tracing \frozen\protected\def\digitsfinalperiod {\digitsperiodsymbol} % more for tracing @@ -240,7 +240,7 @@ \begingroup \ifcase\c_phys_digits_order\expandafter\clf_digits_normal\else\expandafter\clf_digits_reverse\fi{\detokenize{#1}}% \endgroup - \settrue\c_phys_units_dospace} + \c_phys_units_dospace\conditionaltrue} \permanent\protected\def\digits {\doifelsenextbgroup\phys_digits_argument\phys_digits_spaced} @@ -437,15 +437,15 @@ \protected\def\phys_units_direct#1% {\begingroup - \the\everyunits + \expand\everyunits\relax \ifdim\lastskip>\zeropoint - \settrue\c_phys_units_dospace + \c_phys_units_dospace\conditionaltrue \removelastskip \fi - \edef\currentunit{#1}% + \cdef\currentunit{#1}% \c_phys_digits_method\unitparameter\c!method\relax \ifmmode\else\dontleavehmode\fi -% \edef\currentunit{#1}% +% \cdef\currentunit{#1}% \enforced\edef\unitlanguage{\unitparameter\s!language}% \enforced\let\prefixlanguage\unitlanguage \enforced\let\operatorlanguage\unitlanguage @@ -537,9 +537,9 @@ \digitstextbinop{#2}% after \fi \c_phys_units_state\zerocount - \setfalse\c_phys_units_dospace - \setfalse\c_phys_units_number - \setfalse\c_phys_units_quantity} + \c_phys_units_dospace\conditionalfalse + \c_phys_units_number\conditionalfalse + \c_phys_units_quantity\conditionalfalse} \permanent\protected\def\unitsRPM {\unitsR\plusone {±}} % todo: symbols \permanent\protected\def\unitsRTO {\unitsR\plusone {–}} % todo: symbols \permanent\protected\def\unitsRabout {\unitsR\zerocount{±}} % todo: symbols @@ -592,15 +592,15 @@ \permanent\protected\def\unitsNstartindeed {\ifmmode \else - \settrue\c_phys_units_quantity + \c_phys_units_quantity\conditionaltrue \dostarttagged\t!quantity\empty - \settrue\c_phys_units_number + \c_phys_units_number\conditionaltrue \dostarttagged\t!number\empty \fi} \permanent\protected\def\unitsNstop {\ifconditional\c_phys_units_number - \setfalse\c_phys_units_number + \c_phys_units_number\conditionalfalse \dostoptagged \fi \c_phys_units_state\plusfive} @@ -623,7 +623,7 @@ \def\phys_units_start {\ifmmode - \dostarttagged\t!maction\t!unit + \dostarttagged\t!munit{\lastunitstring}% \mathatom \s!leftclass \mathdimensioncode \s!rightclass \mathdimensioncode @@ -636,11 +636,11 @@ \def\phys_units_stop {\ifconditional\c_phys_units_number - \setfalse\c_phys_units_number + \c_phys_units_number\conditionalfalse \dostoptagged \fi \ifconditional\c_phys_units_quantity - \setfalse\c_phys_units_quantity + \c_phys_units_quantity\conditionalfalse \dostoptagged \fi \dostoptagged @@ -689,7 +689,7 @@ \phys_units_space \or % 6: symbol (connected) \fi - \setfalse\c_phys_units_dospace + \c_phys_units_dospace\conditionalfalse \phys_units_start} \permanent\protected\def\unitsTIMES % GP: Does this do anything? HH: yes "times" diff --git a/Master/texmf-dist/tex/context/base/mkxl/publ-aut.lmt b/Master/texmf-dist/tex/context/base/mkxl/publ-aut.lmt new file mode 100644 index 00000000000..c9641e61b9a --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/publ-aut.lmt @@ -0,0 +1,1050 @@ +if not modules then modules = { } end modules ['publ-aut'] = { + version = 1.001, + comment = "this module part of publication support", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +if not characters then + dofile(resolvers.findfile("char-def.lua")) + dofile(resolvers.findfile("char-ini.lua")) +end + +local lpeg = lpeg + +local type, next, tostring, tonumber = type, next, tostring, tonumber +local concat, sortedhash = table.concat, table.sortedhash +local utfsub = utf.sub +local find = string.find +local formatters = string.formatters + +local P, S, C, V, Cs, Ct, Cc = lpeg.P, lpeg.S, lpeg.C, lpeg.V, lpeg.Cs, lpeg.Ct, lpeg.Cc +----- Cg, Cf = lpeg.Cg, lpeg.Cf +local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns +local settings_to_hash = utilities.parsers.settings_to_hash + +local context = context +----- commands = commands + +local implement = interfaces.implement + +local publications = publications + +local datasets = publications.datasets +local getcasted = publications.getcasted + +local allocate = utilities.storage.allocate + +local chardata = characters.data + +local trace_hashing = false trackers.register("publications.authorhash", function(v) trace_hashing = v end) + +local expand_authors = false directives.register("publications.prerollauthor", function(v) expand_authors = v end) + +local report = logs.reporter("publications","authors") +local report_cite = logs.reporter("publications","cite") + +local v_last = interfaces.variables.last + +-- local function makesplitter(separator) +-- return Ct { "start", +-- start = (Cs((V("outer") + (1-separator))^1) + separator^1)^1, +-- start = Cs(V("outer")) + (Cs((V("inner") + (1-separator))^1) + separator^1)^1, +-- outer = (P("{")/"") * ((V("inner") + P(1-P("}")))^0) * (P("}")/""), +-- inner = P("{") * ((V("inner") + P(1-P("}")))^0) * P("}"), +-- } +-- end + +-- authorlist = { authorspec and authorspec and authorspec } +-- authorspec = composedname +-- authorspec = surnames, firstnames +-- authorspec = von, surnames, firstnames +-- authorspec = von, surnames, jr, firstnames +-- authorspec = von, surnames, jr, firstnames, initials + +local space = lpegpatterns.whitespace +local comma = P(",") +local period = P(".") + P("{.}") +local dash = P("-") + P("{-}") +local firstcharacter = lpegpatterns.utf8byte +local utf8character = lpegpatterns.utf8character +local p_and = space^1 * (P("and") + P("&&") + P("++")) * space^1 +local p_comma = space^0 * comma * space^0 +local p_space = space^1 +local p_shortone = C((utf8character -dash-period)^1) +local p_longone = C( utf8character) * (1-dash-period)^0 + +local p_empty = P("{}")/"" * #(p_space^0 * (P(-1) + P(","))) + +local andsplitter = Ct { "start", + start = (Cs((V("inner") + (1-p_and))^1) + p_and)^1, + inner = P("{") * ((V("inner") + P(1-P("}")))^1) * P("}"), +} + +local commasplitter = Ct { "start", + start = Cs(V("outer")) + (p_empty + Cs((V("inner") + (1-p_comma))^1) + p_comma)^1, + outer = (P("{")/"") * ((V("inner") + P(1-P("}")))^1) * ((P("}") * P(-1))/""), + inner = P("{") * ((V("inner") + P(1-P("}")))^1) * P("}"), +} + +local spacesplitter = Ct { "start", + start = Cs(V("outer")) + (Cs((V("inner") + (1-p_space))^1) + p_space)^1, + outer = (P("{")/"") * ((V("inner") + P(1-P("}")))^1) * ((P("}") * P(-1))/""), + inner = P("{") * ((V("inner") + P(1-P("}")))^1) * P("}"), +} + +local p_initial = p_shortone * period * dash^0 + + p_longone * (period + dash + P(-1)) +local initialsplitter = p_initial * P(-1) + Ct((p_initial)^1) + +----- optionsplitter = Cf(Ct("") * Cg(C((1-space)^1) * space^0 * Cc(true))^1,rawset) +local optionsplitter = Ct("") * (C((1-space)^1) * space^0 * Cc(true) % rawset)^1 + +local function is_upper(str) + local first = lpegmatch(firstcharacter,str) + local okay = chardata[first] + return okay and okay.category == "lu" +end + +-- local cleaner = Cs( ( P("{}")/"" + P(1) )^1 ) + +local cache = allocate() -- 33% reuse on tugboat.bib +local nofhits = 0 +local nofused = 0 + +publications.authorcache = cache + +local function makeinitials(firstnames) + if firstnames and #firstnames > 0 then + local initials = { } + for i=1,#firstnames do + initials[i] = lpegmatch(initialsplitter,firstnames[i]) + end + return initials + end +end + +local authormap = allocate() +publications.authormap = authormap + +local prerollcmdstring = publications.prerollcmdstring + +local function splitauthor(author,justsplit) + local detail, remapped + if not justsplit then + detail = cache[author] + if detail then + return detail + end + remapped = authormap[author] + if remapped then + report("remapping %a to %a",author,remapped) + local detail = cache[remapped] + if detail then + cache[author] = detail + return detail + end + end + end + local author = remapped or author + local firstnames, vons, surnames, initials, juniors, options + if expand_authors and find(author,"\\btxcmd") then + author = prerollcmdstring(author) + end + local split = lpegmatch(commasplitter,author) + local n = #split + detail = { + original = author, + snippets = n, + } + if n == 1 then + -- {First Middle von Last} + local words = lpegmatch(spacesplitter,author) + local i = 1 + local n = #words + firstnames = { } + vons = { } + surnames = { } + while i <= n do + local w = words[i] + if is_upper(w) then + firstnames[#firstnames+1], i = w, i + 1 + else + break + end + end + while i <= n do + local w = words[i] + if is_upper(w) then + break + else + vons[#vons+1], i = w, i + 1 + end + end + if i <= n then + while i <= n do + surnames[#surnames+1], i = words[i], i + 1 + end + elseif #vons == 0 then + surnames[1] = firstnames[#firstnames] + firstnames[#firstnames] = nil + else + -- mess + end + if #surnames == 0 then + -- safeguard + firstnames = { } + vons = { } + surnames = { author } + else + initials = makeinitials(firstnames) + end + elseif n == 2 then + -- {Last, First} + -- {von Last, First} + local words = lpegmatch(spacesplitter,split[1]) + local i = 1 + local n = #words + firstnames = { } + vons = { } + surnames = { } + while i <= n do + local w = words[i] + if is_upper(w) then + break + else + vons[#vons+1], i = w, i + 1 + end + end + while i <= n do + surnames[#surnames+1] = words[i] + i = i + 1 + end + -- + local words = lpegmatch(spacesplitter,split[2]) + local i = 1 + local n = #words + while i <= n do + local w = words[i] + if is_upper(w) then + firstnames[#firstnames+1] = w + i = i + 1 + else + break + end + end + while i <= n do + vons[#vons+1] = words[i] + i = i + 1 + end + if surnames and firstnames and #surnames == 0 then + -- safeguard + surnames[1] = firstnames[#firstnames] + firstnames[#firstnames] = nil + end + initials = makeinitials(firstnames) + elseif n == 3 then + -- {von Last, First, Jr} + surnames = lpegmatch(spacesplitter,split[1]) + juniors = lpegmatch(spacesplitter,split[2]) + firstnames = lpegmatch(spacesplitter,split[3]) + initials = makeinitials(firstnames) + elseif n == 4 then + -- {Von, Last, First, Jr} + vons = lpegmatch(spacesplitter,split[1]) + surnames = lpegmatch(spacesplitter,split[2]) + juniors = lpegmatch(spacesplitter,split[3]) + firstnames = lpegmatch(spacesplitter,split[4]) + initials = makeinitials(firstnames) + elseif n >= 5 then + -- {Von, Last, First, Jr, F.} + -- {Von, Last, First, Jr, Fr., options} + vons = lpegmatch(spacesplitter,split[1]) + surnames = lpegmatch(spacesplitter,split[2]) + juniors = lpegmatch(spacesplitter,split[3]) + firstnames = lpegmatch(spacesplitter,split[4]) + initials = lpegmatch(spacesplitter,split[5]) + options = split[6] + if options then + options = lpegmatch(optionsplitter,options) + end + end + if firstnames and #firstnames > 0 then detail.firstnames = firstnames end + if vons and #vons > 0 then detail.vons = vons end + if surnames and #surnames > 0 then detail.surnames = surnames end + if initials and #initials > 0 then detail.initials = initials end + if juniors and #juniors > 0 then detail.juniors = juniors end + if options and next(options) then detail.options = options end + if not justsplit then + cache[author] = detail + nofhits = nofhits + 1 + end + return detail +end + +local function splitauthorstring(str) + if not str or str == "" then + return + end + nofused = nofused + 1 + + local remapped = authormap[str] + if remapped then + local detail = cache[remapped] + if detail then + cache[str] = detail + return { detail } + end + end + + local authors = cache[str] + if authors then + return { authors } -- we assume one author + end + + -- we could cache these too but it can become messy .. leave that for later + + local authors = lpegmatch(andsplitter,str) or { } -- maybe fake an author + local nofauthors = #authors + for i=1,nofauthors do + authors[i] = splitauthor(authors[i]) + end + if nofauthors > 1 and authors[nofauthors].original == "others" then + -- only the last one is looked at + authors[nofauthors] = nil + authors.others = true + end + return authors +end + +publications.splitoneauthor = splitauthor +publications.splitauthor = splitauthorstring + +local function the_initials(initials,symbol,connector) + if not symbol then + symbol = "." + end + if not connector then + connector = "-" + end + local result = { } + local r = 0 + for i=1,#initials do + local initial = initials[i] + if type(initial) == "table" then + -- J.-J. + local set = { } + local s = 0 + for i=1,#initial do + if i > 1 then + s = s + 1 ; set[s] = connector + end + s = s + 1 ; set[s] = initial[i] + s = s + 1 ; set[s] = symbol + end + r = r + 1 ; result[r] = concat(set) + else + -- J. + r = r + 1 ; result[r] = initial .. symbol + end + end + return result +end + +local ctx_btxsetconcat = context.btxsetconcat +local ctx_btxsetoverflow = context.btxsetoverflow +local ctx_btxsetinitials = context.btxsetinitials +local ctx_btxsetfirstnames = context.btxsetfirstnames +local ctx_btxsetvons = context.btxsetvons +local ctx_btxsetsurnames = context.btxsetsurnames +local ctx_btxsetjuniors = context.btxsetjuniors +local ctx_btxsetauthorvariant = context.btxsetauthorvariant + +local ctx_btxstartauthor = context.btxstartauthor +local ctx_btxstopauthor = context.btxstopauthor + +local ctx_btxciteauthorsetup = context.btxciteauthorsetup +local ctx_btxlistauthorsetup = context.btxlistauthorsetup + +local concatstate = publications.concatstate +local f_invalid = formatters[""] + +local currentauthordata = nil +local currentauthorsymbol = nil +local currentauthorconnector = nil + +local manipulators = typesetters.manipulators +local splitmanipulation = manipulators.splitspecification +local applymanipulation = manipulators.applyspecification + +local function value(i,field) + if currentauthordata then + local entry = currentauthordata[i] + if entry then + local value = entry[field] + if value and #value > 0 then + return value + end + end + end +end + +implement { name = "btxcurrentfirstnames", arguments = "integer", actions = function(i) local v = value(i,"firstnames") if v then context(concat(v," ")) end end } +implement { name = "btxcurrentinitials", arguments = "integer", actions = function(i) local v = value(i,"initials") if v then context(concat(the_initials(v,currentauthorsymbol,currentauthorconnector))) end end } +implement { name = "btxcurrentjuniors", arguments = "integer", actions = function(i) local v = value(i,"juniors") if v then context(concat(v," ")) end end } +implement { name = "btxcurrentsurnames", arguments = "integer", actions = function(i) local v = value(i,"surnames") if v then context(concat(v," ")) end end } +implement { name = "btxcurrentvons", arguments = "integer", actions = function(i) local v = value(i,"vons") if v then context(concat(v," ")) end end } + +local function btxauthorfield(i,field) + if currentauthordata then + local entry = currentauthordata[i] + if entry then + local manipulator, field = splitmanipulation(field) + local value = entry[field] + if not value or #value == 0 then + -- value, no need for message + elseif manipulator then + for i=1,#value do + if i > 1 then + context(" ") + end + context(applymanipulation(manipulator,value) or value) + end + elseif field == "initials" then + context(concat(the_initials(value,currentauthorsymbol,currentauthorconnector))) + else + context(concat(value," ")) + end + end + end +end + +-- This is somewhat tricky: an author is not always an author but +-- can also be a title or key, depending on the (optional) set it's +-- in. Also, authors can be combined with years and so and they +-- might be called upon mixed with other calls. + +local function btxauthor(dataset,tag,field,settings) + local split, usedfield, kind = getcasted(dataset,tag,field) + if kind == "author" then + local max = split and #split or 0 + if max == 0 then + return + -- error + end + local absmax = max + local etallimit = tonumber(settings.etallimit) or 1000 + local etaldisplay = tonumber(settings.etaldisplay) or etallimit + local etaloption = settings_to_hash(settings.etaloption or "") + local etallast = etaloption[v_last] + local combiner = settings.combiner + local symbol = settings.symbol + local connector = settings.connector + local index = settings.index + if not combiner or combiner == "" then + combiner = "normal" + end + if not symbol then + symbol = "." + end + local ctx_btxsetup = settings.kind == "cite" and ctx_btxciteauthorsetup or ctx_btxlistauthorsetup + if max > etallimit and (etaldisplay+(etallast and 1 or 0)) < max then + max = etaldisplay + else + etallast = false + end + currentauthordata = split + currentauthorsymbol = symbol + currentauthorconnector = connector + + local function oneauthor(i,last,justone) + local author = split[i] + if index then + ctx_btxstartauthor(i,1,0) + elseif last then + ctx_btxstartauthor(i,1,0) + ctx_btxsetconcat(0) + ctx_btxsetauthorvariant(combiner) + else + local state = author.state or 0 + ctx_btxstartauthor(i,max,state) + ctx_btxsetconcat(concatstate(i,max)) + ctx_btxsetauthorvariant(combiner) + end + local initials = author.initials + if initials and #initials > 0 then + ctx_btxsetinitials() -- (concat(the_initials(initials,symbol)," ")) + end + local firstnames = author.firstnames + if firstnames and #firstnames > 0 then + ctx_btxsetfirstnames() -- (concat(firstnames," ")) + end + local vons = author.vons + if vons and #vons > 0 then + ctx_btxsetvons() -- (concat(vons," ")) + end + local surnames = author.surnames + if surnames and #surnames > 0 then + ctx_btxsetsurnames() -- (concat(surnames," ")) + end + local juniors = author.juniors + if juniors and #juniors > 0 then + ctx_btxsetjuniors() -- (concat(juniors," ")) + end + if not index and i == max then + if split.others then + ctx_btxsetoverflow(1) + else + local overflow = #split - max + if overflow > 0 then + ctx_btxsetoverflow(overflow) + end + end + end + ctx_btxsetup(combiner) + ctx_btxstopauthor() + end + + if index then + oneauthor(index) + elseif max == 1 then + oneauthor(1,false,true) + else + for i=1,max do + oneauthor(i) + end + if etallast then + oneauthor(absmax,true) + end + end + + else + report("ignored field %a of tag %a, used field %a is no author",field,tag,usedfield) + end + +end + +implement { + name = "btxauthorfield", + actions = btxauthorfield, + arguments = { "integer", "string" } +} + +implement { + name = "btxauthor", + actions = btxauthor, + arguments = { + "argument", + "argument", + "argument", + { + { "combiner" }, + { "kind" }, + { "etallimit" }, + { "etaldisplay" }, + { "etaloption" }, + { "symbol" }, + { "connector" }, + } + } +} + +local function components(snippet,short) + local vons = snippet.vons + local surnames = snippet.surnames + local initials = snippet.initials + local firstnames = not short and snippet.firstnames + local juniors = snippet.juniors + return + vons and #vons > 0 and concat(vons," ") or "", + surnames and #surnames > 0 and concat(surnames," ") or "", + initials and #initials > 0 and concat(the_initials(initials)," ") or "", + firstnames and #firstnames > 0 and concat(firstnames," ") or "", + juniors and #juniors > 0 and concat(juniors, " ") or "" +end + +local collapsers = allocate { } + +publications.authorcollapsers = collapsers + +-- making a constructor doesn't make the code nicer as the_initials is an +-- exception + +local function default(author) -- one author + local hash = author.hash + if hash then + return hash + end + local original = author.original + local vons = author.vons + local surnames = author.surnames + local initials = author.initials + local firstnames = author.firstnames + local juniors = author.juniors + local result = { } + local nofresult = 0 + if vons and #vons > 0 then + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end + end + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + if initials and #initials > 0 then + initials = the_initials(initials) + for j=1,#initials do + nofresult = nofresult + 1 + result[nofresult] = initials[j] + end + end + if firstnames and #firstnames > 0 then + for j=1,#firstnames do + nofresult = nofresult + 1 + result[nofresult] = firstnames[j] + end + end + if juniors and #juniors > 0 then + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end + local hash = concat(result," ") + if trace_hashing then + report("hash: %s -> %s",original,hash) + end + author.hash = hash + return hash +end + +local authorhashers = { } +publications.authorhashers = authorhashers + +-- todo: some hashing + +local function name(authors) + if type(authors) == "table" then + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local surnames = author.surnames + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + end + return concat(result," ") + else + return authors + end +end + +table.setmetatableindex(authorhashers,function(t,k) + t[k] = name + return name +end) + +authorhashers.normal = function(authors) + if type(authors) == "table" then + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local vons = author.vons + local surnames = author.surnames + local firstnames = author.firstnames + local juniors = author.juniors + if vons and #vons > 0 then + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end + end + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + if firstnames and #firstnames > 0 then + for j=1,#firstnames do + nofresult = nofresult + 1 + result[nofresult] = firstnames[j] + end + end + if juniors and #juniors > 0 then + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end + end + return concat(result," ") + else + return authors + end +end + +authorhashers.normalshort = function(authors) + if type(authors) == "table" then + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local vons = author.vons + local surnames = author.surnames + local initials = author.initials + local juniors = author.juniors + if vons and #vons > 0 then + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end + end + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + if initials and #initials > 0 then + initials = the_initials(initials) + for j=1,#initials do + nofresult = nofresult + 1 + result[nofresult] = initials[j] + end + end + if juniors and #juniors > 0 then + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end + end + return concat(result," ") + else + return authors + end +end + +local sequentialhash = function(authors) + if type(authors) == "table" then + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local vons = author.vons + local surnames = author.surnames + local firstnames = author.firstnames + local juniors = author.juniors + if firstnames and #firstnames > 0 then + for j=1,#firstnames do + nofresult = nofresult + 1 + result[nofresult] = firstnames[j] + end + end + if vons and #vons > 0 then + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end + end + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + if juniors and #juniors > 0 then + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end + end + return concat(result," ") + else + return authors + end +end + +local sequentialshorthash = function(authors) + if type(authors) == "table" then + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local vons = author.vons + local surnames = author.surnames + local initials = author.initials + local juniors = author.juniors + if initials and #initials > 0 then + initials = the_initials(initials) + for j=1,#initials do + nofresult = nofresult + 1 + result[nofresult] = initials[j] + end + end + if vons and #vons > 0 then + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end + end + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + if juniors and #juniors > 0 then + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end + end + return concat(result," ") + else + return authors + end +end + +authorhashers.sequential = sequentialhash +authorhashers.sequentialshort = sequentialshorthash +authorhashers.normalinverted = authorhashers.normal +authorhashers.invertedshort = authorhashers.normalshort + +local p_clean = Cs ( ( + P("\\btxcmd") / "" -- better keep the argument + + S("`~!@#$%^&*()_-+={}[]:;\"\'<>,.?/|\\") / "" + + lpeg.patterns.utf8character + )^1) + +-- Probabbly more robust is a two pass approach. + +authorhashers.short = function(authors) + -- a short is a real dumb hardcoded kind of tag and we only support + -- this one because some users might expect it, not because it makes + -- sense + if type(authors) == "table" then + local n = #authors + if n == 0 then + return "unk" + elseif n == 1 then + local surnames = authors[1].surnames + if not surnames or #surnames == 0 then + return "err" + else + local s = surnames[1] + local c = lpegmatch(p_clean,s) + if trace_hashing and s ~= c then + report_cite("name %a cleaned to %a for short construction",s,c) + end + return utfsub(c,1,3) + end + else + local t = { } + for i=1,n do + if i > 3 then + t[#t+1] = "+" -- indeed + break + end + local surnames = authors[i].surnames + if not surnames or #surnames == 0 then + t[#t+1] = "?" + else + local s = surnames[1] + local c = lpegmatch(p_clean,s) + if s ~= c then + report_cite("name %a cleaned to %a for short construction",s,c) + end + t[#t+1] = utfsub(c,1,1) + end + end + return concat(t) + end + else + return utfsub(authors,1,3) + end +end + +collapsers.default = default + +local function authorwriter(key,index) + if not key then + return "" + end + if type(key) == "string" then + return key + end + local n = #key + if n == 0 then + return "" + end + if index then + if not key[index] then + return "" + end + elseif n == 1 then + index = 1 + end + if index then + local author = key[index] + local options = author.options + if options then + for option in next, options do + local collapse = collapsers[option] + if collapse then + return collapse(author) + end + end + end + local hash = default(author) + -- if trace_hashing then + -- report("hash: %s",hash) + -- end + return hash + end + local t = { } + local s = 0 + for i=1,n do + local author = key[i] + local options = author.options + s = s + 1 + if options then + local done = false + for option in next, options do + local collapse = collapsers[option] + if collapse then + t[s] = collapse(author) + done = true + end + end + if not done then + t[s] = default(author) + end + else + t[s] = default(author) + end + end + local hash = concat(t," & ") + -- if trace_hashing then + -- report("hash: %s",hash) + -- end + return hash +end + +local function writer(key) + return authorwriter(key) -- discard extra arguments in the caller +end + +publications.writers .author = writer +publications.casters .author = splitauthorstring +publications.components.author = components + +-- sharedmethods.author = { +-- { field = "key", default = "", unknown = "" }, +-- { field = "author", default = "", unknown = "" }, +-- { field = "title", default = "", unknown = "" }, +-- } + +-- Analysis of the APA by Alan: +-- +-- first : key author editor publisher title journal volume number pages +-- second: year suffix title month day journal volume number + +publications.sortmethods.authoryear = { + sequence = { + -- { field = "key", default = "ZZZZ", unknown = "ZZZZ" }, + { field = "author", default = "", unknown = "" }, + { field = "year", default = "9998", unknown = "9999" }, + -- { field = "suffix", default = " ", unknown = " " }, + { field = "month", default = "13", unknown = "14" }, + { field = "day", default = "32", unknown = "33" }, + { field = "journal", default = "", unknown = "" }, + { field = "volume", default = "", unknown = "" }, + -- { field = "number", default = "", unknown = "" }, + { field = "pages", default = "", unknown = "" }, + { field = "title", default = "", unknown = "" }, + { field = "index", default = "", unknown = "" }, + }, +} + +publications.sortmethods.authortitle = { + sequence = { + { field = "author", default = "", unknown = "" }, + { field = "title", default = "", unknown = "" }, + { field = "booktitle", default = "", unknown = "" }, -- if this is an untitled section (e.g., introduction, foreword, preface) of a book or a review of a book + { field = "maintitle", default = "", unknown = "" }, -- if this is an untitled section or volume in a multivolume collection + { field = "volume", default = "", unknown = "" }, + { field = "part", default = "", unknown = "" }, + { field = "date", default = "9998-13-32", unknown = "9999-14-33" }, -- some specifications allow date instead of year, month, day + { field = "year", default = "9998", unknown = "9999" }, + { field = "month", default = "13", unknown = "14" }, + { field = "day", default = "32", unknown = "33" }, + { field = "index", default = "", unknown = "" }, + }, +} + +implement { + name = "btxremapauthor", + arguments = "2 strings", + actions = function(k,v) + local a = { splitauthor(k,true) } + local s1 = sequentialhash(a) + local s2 = sequentialshorthash(a) + if not authormap[k] then + authormap[k] = v + report("%a mapped onto %a",k,v) + end + if not authormap[s1] then + authormap[s1] = v + report("%a mapped onto %a, derived from %a",s1,v,k) + end + if not authormap[s2] then + authormap[s2] = v + report("%a mapped onto %a, derived from %a",s2,v,k) + end + end +} + +implement { + name = "btxshowauthorremapping", + actions = function(k,v) + report("start author remapping") + for k, v in sortedhash(authormap) do + report(" %s => %s",k,v) + end + report("stop author remapping") + end +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl index f120c55fb99..5875da6e3fa 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl @@ -16,8 +16,6 @@ % TODO: s! vs v! for default and neutral key/values % todo: too many refs in list -% TODO A.-B. Foo (dash as connector, see JMH) - % todo: no need for all these %'s % todo: tagging @@ -25,7 +23,7 @@ % todo: \v!cite => \s!cite % todo: interface with (ml)bibtex (export -> call -> import) % todo: check if 'all' etc are ok ... either use list or use other criterium -% todo: \the\everysetupbtxciteplacement probably too often +% todo: \expand\everysetupbtxciteplacement probably too often % \definecolor[btx:field] [darkred] % \definecolor[btx:crossref][darkblue] @@ -50,9 +48,9 @@ \registerctxluafile{publ-dat}{} \registerctxluafile{publ-ini}{} \registerctxluafile{publ-sor}{} -\registerctxluafile{publ-aut}{} +\registerctxluafile{publ-aut}{autosuffix} \registerctxluafile{publ-usr}{} -\registerctxluafile{publ-oth}{} % this could become an option +\registerctxluafile{publ-oth}{autosuffix} % this could become an option \registerctxluafile{publ-fnd}{} % new method (for the moment only local) \registerctxluafile{publ-jrn}{} \registerctxluafile{publ-reg}{} @@ -168,11 +166,13 @@ % because we have lots of setups we provide a checker for sloppy users \protected\def\btx_check_chain#1#2#3% - {\doifelsesomething{#3} - {\writestatus{btx #1}{defining\space"#2"\space as\space descendant\space of\space"#3"}% we're in definition regime (no space) - \definebtx[#2][#3]} - {\writestatus{btx #1}{defining\space"#2"}% - \definebtx[#2]}} + {\ifempty{#3}% + \writestatus{btx #1}{defining\space"#2"}% + \definebtx[#2]% + \else + \writestatus{btx #1}{defining\space"#2"\space as\space descendant\space of\space"#3"}% we're in definition regime (no space) + \definebtx[#2][#3]% + \fi} % \protected\def\btxcheckdefine#1#2{\doifelsecommandhandler\??btx{#1}\donothing{\btx_check_chain{define}{#1}{#2}}} % \protected\def\btxchecksetup #1#2{\doifelsecommandhandler\??btx{#1}\donothing{\btx_check_chain {setup}{#1}{#2}}} @@ -425,9 +425,12 @@ \permanent\protected\def\btxnbsp {\removeunwantedspaces\nbsp} % the same anyway \permanent\protected\def\btxperiod {\removeunwantedspaces.\space} \permanent\protected\def\btxcomma {\removeunwantedspaces,\space} +\permanent\protected\def\btxserialcomma {\removeunwantedspaces,\space} % (aka Oxford comma) redefine to disable +\permanent\protected\def\btxellipsis {\removeunwantedspaces\nobreakspace\textellipsis\space} \permanent\protected\def\btxcommabreak {\removeunwantedspaces,\hskip\zeropoint plus .5\emwidth\relax} \permanent\protected\def\btxcolon {\removeunwantedspaces:\space} \permanent\protected\def\btxsemicolon {\removeunwantedspaces;\space} +\permanent\protected\def\btxhyphen {\removeunwantedspaces-} \permanent\protected\def\btxlparent {\removeunwantedspaces\space(} % obsolete \permanent\protected\def\btxrparent {\removeunwantedspaces)\space} % obsolete \permanent\protected\def\btxleftparenthesis {\removeunwantedspaces\space(} @@ -578,8 +581,8 @@ \installtextracker {btxrendering} - {\settrue \c_btx_trace} - {\setfalse\c_btx_trace} + {\c_btx_trace\conditionaltrue} + {\c_btx_trace\conditionalfalse} %D Rendering lists and citations. @@ -636,15 +639,21 @@ \newconditional\c_btx_list_texts \appendtoks - \doifelse{\btxrenderingparameter\c!textstate}\v!start - \settrue\setfalse\c_btx_list_texts + \ifcstok{\btxrenderingparameter\c!textstate}\v!start + \c_btx_list_texts\conditionaltrue + \else + \c_btx_list_texts\conditionalfalse + \fi \to \everysetupbtxlistplacement \newconditional\c_btx_list_pages \appendtoks - \doifelse{\btxrenderingparameter\c!pagestate}\v!start - \settrue\setfalse\c_btx_list_pages + \ifcstok{\btxrenderingparameter\c!pagestate}\v!start + \c_btx_list_pages\conditionaltrue + \else + \c_btx_list_pages\conditionalfalse + \fi \to \everysetupbtxlistplacement \protected\def\btx_entry_inject_pages % for the moment only normal @@ -845,7 +854,7 @@ \fi \fi \setbtxparameterset\currentbtxspecification\s!list - \the\everybtxlistrendering + \expand\everybtxlistrendering \ifconditional#1\relax \edef\currentbtxrenderingtitle{\btxrenderingparameter\c!title}% \ifempty\currentbtxrenderingtitle @@ -860,8 +869,8 @@ \edef\currentbtxdataset{\btxrenderingparameter\c!dataset}% \uselanguageparameter\btxdatasetparameter % new \setbtxlist - \the\everystructurelist - \the\everysetupbtxlistplacement + \expand\everystructurelist + \expand\everysetupbtxlistplacement % why not pass this with collect .. todo % here we just collect items \clf_btxcollectlistentries @@ -910,7 +919,11 @@ \letlistparameter\c!width\d_publ_number_width % no need for _reference here, frozen \fi \fi - \doifelse{\listparameter\c!prefix}\v!yes\settrue\setfalse\c_publ_prefixed + \ifcstok{\listparameter\c!prefix}\v!yes + \c_publ_prefixed\conditionaltrue + \else + \c_publ_prefixed\conditionalfalse + \fi % this actually typesets them, we loop here as otherwise the whole % bunch gets flushed at once \dorecurse\nofbtxlistentries @@ -1060,7 +1073,7 @@ \newtoks\everybtxlistentry \permanent\protected\def\btxlistsetup#1% used for the reference in the list - {\the\everybtxlistentry + {\expand\everybtxlistentry \everybtxlistentry\emptytoks % so only once per entry to be sure \publ_fast_setup\plusfour\s!list{#1}} @@ -1126,13 +1139,13 @@ {\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% \s!btxref=\currentbtxtag,% \s!btxspc=\currentbtxspecification,% - \s!btxlst=\number\c_btx_list_reference,% check if needed + \s!btxlst=\the\c_btx_list_reference,% check if needed %\ifempty\currentbtxcombis \else\s!btxcom={\currentbtxcombis},\fi% \ifempty\currentbtxbefore \else\s!btxbtx={\currentbtxbefore},\fi% \ifempty\currentbtxafter \else\s!btxatx={\currentbtxafter },\fi% \ifempty\currentbtxbacklink\else\s!btxint=\number\currentbtxbacklink\fi }% - {\s!btx::\v!list::\number\c_btx_list_reference}% + {\s!btx::\v!list::\the\c_btx_list_reference}% {\currentbtxnumber}} \newconditional\c_btx_cite_reference_injected @@ -1145,7 +1158,7 @@ % can be made empty when combining author / year \orelse\ifnum\currentbtxbacklink>\zerocount \btx_cite_reference_inject_indeed - \settrue\c_btx_cite_reference_injected + \c_btx_cite_reference_injected\conditionaltrue \fi \fi \fi} @@ -1309,12 +1322,12 @@ \installcorenamespace{btxinteraction} -\defcsname\??btxinteraction\v!number\endcsname{\settrue\btxinteractivenumber} -\defcsname\??btxinteraction\v!text \endcsname{\settrue\btxinteractivetext} -\defcsname\??btxinteraction\v!page \endcsname{\settrue\btxinteractivepage} -\defcsname\??btxinteraction\v!all \endcsname{\settrue\btxinteractivenumber - \settrue\btxinteractivetext - \settrue\btxinteractivepage} +\defcsname\??btxinteraction\v!number\endcsname{\btxinteractivenumber\conditionaltrue} +\defcsname\??btxinteraction\v!text \endcsname{\btxinteractivetext\conditionaltrue} +\defcsname\??btxinteraction\v!page \endcsname{\btxinteractivepage\conditionaltrue} +\defcsname\??btxinteraction\v!all \endcsname{\btxinteractivenumber\conditionaltrue + \btxinteractivetext\conditionaltrue + \btxinteractivepage\conditionaltrue} % \setupbtx[interaction=page] % or text or number or all % \setupbtxrendering[pagestate=start] @@ -1323,14 +1336,14 @@ \iflocation \edef\currentbtxinteraction{\btxparameter\c!interaction}% \ifx\currentbtxinteraction\v!stop - \setfalse\btxinteractive + \btxinteractive\conditionalfalse \else \enforced\lettonothing\structurelistlocation - \settrue\btxinteractive + \btxinteractive\conditionaltrue \begincsname\??btxinteraction\currentbtxinteraction\endcsname \fi \else - \setfalse\btxinteractive + \btxinteractive\conditionalfalse \fi \to \everysetupbtxlistplacement @@ -1338,12 +1351,12 @@ \iflocation \edef\currentbtxinteraction{\btxparameter\c!interaction}% \ifx\currentbtxinteraction\v!stop - \setfalse\btxinteractive + \btxinteractive\conditionalfalse \else - \settrue\btxinteractive + \btxinteractive\conditionaltrue \fi \else - \setfalse\btxinteractive + \btxinteractive\conditionalfalse \fi \to \everysetupbtxciteplacement @@ -1400,7 +1413,7 @@ \edef\currentbtxcitealternative{\btxparameter\c!alternative}% \setbtxparameterset\s!cite\currentbtxcitealternative \edef\currentbtxcitetag{#1}% - \the\everysetupbtxciteplacement + \expand\everysetupbtxciteplacement \publ_cite_variant \endgroup} @@ -1444,7 +1457,7 @@ \edef\p_publ_cite_lefttext {\dummyparameter\c!lefttext}% \edef\p_publ_cite_righttext{\dummyparameter\c!righttext}% % - \the\everysetupbtxciteplacement + \expand\everysetupbtxciteplacement \publ_cite_variant \endgroup} @@ -1453,7 +1466,7 @@ \edef\currentbtxcitealternative{#1}% \edef\currentbtxcitetag{#2}% \setbtxparameterset\s!cite\currentbtxcitealternative - \the\everysetupbtxciteplacement + \expand\everysetupbtxciteplacement \publ_cite_variant \endgroup} @@ -1469,7 +1482,7 @@ {\begingroup \edef\currentbtxcitealternative{#1}% \setbtxparameterset\s!cite\currentbtxcitealternative - \the\everysetupbtxciteplacement + \expand\everysetupbtxciteplacement \publ_cite_handle_variant_indeed} \permanent\protected\def\publ_cite_handle_variant_blob @@ -1616,7 +1629,7 @@ \protected\def\publ_fast_btx_setup_chain_yes#1#2% {\dontleavehmode\begingroup - \let\:\publ_fast_btx_setup_colon_inbetween + \enforced\let\:\publ_fast_btx_setup_colon_inbetween \infofont \ifcase\btxsetuptype\darkred\or\darkblue\or\darkgreen\or\darkcyan\or\darkmagenta\else\darkred\fi [\prewordbreak @@ -1638,7 +1651,7 @@ \protected\def\publ_fast_btx_setup_chain_nop#1#2% {\dontleavehmode\begingroup - \let\:\publ_fast_btx_setup_colon_inbetween + \enforced\let\:\publ_fast_btx_setup_colon_inbetween \infofont \darkred [\prewordbreak @@ -1687,16 +1700,16 @@ \newtoks\everybtxciteentry \prependtoks - \setfalse\c_btx_cite_reference_injected + \c_btx_cite_reference_injected\conditionalfalse \to \everybtxciteentry \permanent\protected\def\btxcitesetup#1% - {\the\everybtxciteentry + {\expand\everybtxciteentry \everybtxciteentry\emptytoks % tricky maybe not when subcites \publ_fast_setup\plusone\s!cite{#1}} % no \btxcitereset as we loose dataset and such \permanent\protected\def\btxsubcitesetup#1% - {\the\everybtxciteentry + {\expand\everybtxciteentry \everybtxciteentry\emptytoks % tricky maybe not when subcites \publ_fast_setup\plustwo\s!cite{#1}} % no \btxcitereset as we loose dataset and such @@ -1873,7 +1886,7 @@ \edef\currentbtxcitealternative{invertedshort}% maybe we need some default here too? \fi %let\currentbtxlistvariant\currentbtxcitealternative % we inherit - \the\everysetupbtxciteplacement + \expand\everysetupbtxciteplacement \def\currentbtxvons {#2}% \def\currentbtxsurnames {#3}% \def\currentbtxinitials {#4}% @@ -1993,8 +2006,9 @@ \c!otherstext={\btxspace et al.}, \c!separator:firstnames={\btxspace}, \c!separator:juniors={\btxspace}, - \c!separator:vons={\btxspace}, + \c!separator:vons={\btxnobreakspace}, \c!separator:initials={\btxspace}, + \c!connector:initials={\btxhyphen}, \c!stopper:initials={.}, %\c!surnamesep={\btxcomma}, % is this used anywhere? \c!separator:invertedinitials={\btxcomma}, diff --git a/Master/texmf-dist/tex/context/base/mkxl/publ-oth.lmt b/Master/texmf-dist/tex/context/base/mkxl/publ-oth.lmt new file mode 100644 index 00000000000..8a54b9b7c05 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/publ-oth.lmt @@ -0,0 +1,159 @@ +if not modules then modules = { } end modules ['publ-oth'] = { + version = 1.001, + comment = "this module part of publication support", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local P, S, C, Ct, Cmt, Carg = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cmt, lpeg.Carg +----- Cf, Cg = lpeg.Cf, lpeg.Cg +local lpegmatch = lpeg.match + +local p_endofline = lpeg.patterns.newline + +local publications = publications or { loaders = { } } + +local loaders = publications.loaders +local getindex = publications.getindex + +local function addfield(t,k,v,fields) + k = fields[k] + if k then + local tk = t[k] + if tk then + t[k] = tk .. " and " .. v + else + t[k] = v + end + end + return t +end + +local function checkfield(_,_,t,categories,all) + local tag = t.tag + if tag then + local category = t.category + t.tag = nil + t.category = categories[category] or category + all[tag] = t + end + return true +end + +-- endnotes -- + +local fields = { + ["@"] = "tag", + ["0"] = "category", + ["A"] = "author", + ["E"] = "editor", + ["T"] = "title", + ["D"] = "year", + ["I"] = "publisher", +} + +local categories = { + ["Journal Article"] = "article", +} + +----- entry = P("%") * Cg(C(1) * (S(" \t")^1) * C((1-p_endofline)^0) * Carg(1)) * p_endofline +----- record = Cf(Ct("") * (entry^1), addfield) +local entry = P("%") * (C(1) * (S(" \t")^1) * C((1-p_endofline)^0) * Carg(1)) * p_endofline +local record = Ct("") * (entry % addfield)^1 +local records = (Cmt(record * Carg(2) * Carg(3), checkfield) * P(1))^1 + +function publications.endnotes_to_btx(data) + local all = { } + lpegmatch(records,data,1,fields,categories,all) + return all +end + +function loaders.endnote(dataset,filename) + -- we could combine the next into checkfield but let's not create too messy code + local dataset, fullname = publications.resolvedname(dataset,filename) + if fullname then + loaders.lua(dataset,publications.endnotes_to_btx(io.loaddata(fullname) or "")) + end +end + +-- refman -- + +----- entry = Cg(C((1-lpeg.S(" \t")-p_endofline)^1) * (S(" \t-")^1) * C((1-p_endofline)^0) * Carg(1)) * p_endofline +----- record = Cf(Ct("") * (entry^1), addfield) +local entry = (C((1-lpeg.S(" \t")-p_endofline)^1) * (S(" \t-")^1) * C((1-p_endofline)^0) * Carg(1)) * p_endofline +local record = Ct("") * (entry % addfield)^1 +local records = (Cmt(record * Carg(2) * Carg(3), checkfield) * P(1))^1 + +local fields = { + ["SN"] = "tag", + ["TY"] = "category", + ["A1"] = "author", + ["E1"] = "editor", + ["T1"] = "title", + ["Y1"] = "year", + ["PB"] = "publisher", +} + +local categories = { + ["JOUR"] = "article", +} + +function publications.refman_to_btx(data) + local all = { } + lpegmatch(records,data,1,fields,categories,all) + return all +end + +function loaders.refman(dataset,filename) + -- we could combine the next into checkfield but let's not create too messy code + local dataset, fullname = publications.resolvedname(dataset,filename) + if fullname then + loaders.lua(dataset,publications.refman_to_btx(io.loaddata(fullname) or "")) + end +end + +-- test -- + +-- local endnote = [[ +-- %0 Journal Article +-- %T Scientific Visualization, Overviews, Methodologies, and Techniques +-- %A Nielson, Gregory M +-- %A Hagen, Hans +-- %A Müller, Heinrich +-- %@ 0818677776 +-- %D 1994 +-- %I IEEE Computer Society + +-- %0 Journal Article +-- %T Scientific Visualization, Overviews, Methodologies, and Techniques +-- %A Nielson, Gregory M +-- %A Hagen, Hans +-- %A Müller, Heinrich +-- %@ 0818677775 +-- %D 1994 +-- %I IEEE Computer Society +-- ]] + +-- local refman = [[ +-- TY - JOUR +-- T1 - Scientific Visualization, Overviews, Methodologies, and Techniques +-- A1 - Nielson, Gregory M +-- A1 - Hagen, Hans +-- A1 - Müller, Heinrich +-- SN - 0818677776 +-- Y1 - 1994 +-- PB - IEEE Computer Society + +-- TY - JOUR +-- T1 - Scientific Visualization, Overviews, Methodologies, and Techniques +-- A1 - Nielson, Gregory M +-- A1 - Hagen, Hans +-- A1 - Müller, Heinrich +-- SN - 0818677775 +-- Y1 - 1994 +-- PB - IEEE Computer Society +-- ]] + +-- inspect(publications.endnotes_to_btx(endnote)) +-- inspect(publications.refman_to_btx(refman)) diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx index 5fbd47d6cf9..c5590b3b9bf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx @@ -60,19 +60,20 @@ \installframedcommandhandler \??interactionbar {interactionbar} \??interactionbar -\permanent\tolerant\protected\def\interactionbar[#tag]#spacer[#settings]% somewhat messy +\permanent\tolerant\protected\def\interactionbar[#tag]#spacer[#S#settings]% somewhat messy {\iflocation \begingroup \ifhastok={#tag}% \lettonothing\currentinteractionbar \setupcurrentinteractionbar[#tag]% - \edef\currentinteractionbar{\interactionbarparameter\c!alternative}% + \cdef\currentinteractionbar{\interactionbarparameter\c!alternative}% \else - \edef\currentinteractionbar{#tag}% + \cdef\currentinteractionbar{#tag}% \setupcurrentinteractionbar[#settings]% \fi - \doif{\interactionbarparameter\c!state}\v!start - {\interactionbarparameter\c!command}% + \ifcstok{\interactionbarparameter\c!state}\v!start + \interactionbarparameter\c!command + \fi \endgroup \fi} @@ -99,7 +100,7 @@ %D shortcuts to their four associated buttons. The symbols are derived from the %D symbols linked to the entries. -\permanent\tolerant\protected\def\interactionbuttons[#settings]#spacer[#list]% +\permanent\tolerant\protected\def\interactionbuttons[#S#settings]#spacer[#list]% {\iflocation \ifcstok{\interactionbarparameter\c!state}\v!start \ifparameter#list\or @@ -119,8 +120,12 @@ \ifzeropt\d_scrn_bar_width \d_scrn_bar_width1.5\emwidth \fi - \doifnothing{\interactionbarparameter\c!height}{\letinteractionbarparameter\c!height\v!broad}% - \doifnothing{\interactionbarparameter\c!depth }{\letinteractionbarparameter\c!depth\zeropoint}%%% + \ifempty{\interactionbarparameter\c!height}% + \letinteractionbarparameter\c!height\v!broad + \fi + \ifempty{\interactionbarparameter\c!depth}% + \letinteractionbarparameter\c!depth\zeropoint + \fi \resetinteractionbarparameter\c!background \setbox2\hbox{\inheritedinteractionbarframed{\symbol[\interactionparameter\c!symbolset][\v!previouspage]}}% \scratchheight\ht2 % needed because we default to nothing @@ -200,7 +205,7 @@ \hskip\zeropoint\s!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 + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\blackrule}[page(\the\realpageno)]}% todo: \v!currentpage \ifnum\realpageno<\lastpage\relax \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\blackrule}[\v!nextpage]}% \hskip\zeropoint\s!plus\numexpr\lastpage-\realpageno-\plusone\relax \s!sp\relax % cm gives overflow @@ -253,10 +258,12 @@ \let\scrn_bar_goto_indeed\relax \protected\def\scrn_bar_goto_x#command% - {\doifelse{\interactionbarparameter\c!symbol}\v!yes - {\setupsymbolset[\interactionparameter\c!symbolset]% - \let\scrn_bar_goto_indeed\scrn_bar_goto_a} - {\let\scrn_bar_goto_indeed\scrn_bar_goto_b}% + {\ifcstok{\interactionbarparameter\c!symbol}\v!yes + \setupsymbolset[\interactionparameter\c!symbolset]% + \let\scrn_bar_goto_indeed\scrn_bar_goto_a + \else + \let\scrn_bar_goto_indeed\scrn_bar_goto_b + \fi \dorecurse\nofsubpages %{\scratchcounter\numexpr\recurselevel+\firstsubpage+\minusone\relax {\scratchcounter\therealsubpageno\recurselevel @@ -269,102 +276,110 @@ \unskip} \def\scrn_bar_alternative_d - {\ifnum\nofsubpages>\plusone \doif{\namedcounterparameter\s!subpage\c!state}\v!start{% - \d_scrn_bar_width \interactionbarparameter\c!width - \d_scrn_bar_distance\interactionbarparameter\c!distance - \d_scrn_bar_height \interactionbarparameter\c!height - \d_scrn_bar_depth \interactionbarparameter\c!depth - \scratchdimenone\d_scrn_bar_width - \noindent\hbox{\scrn_bar_goto_x{\hskip\d_scrn_bar_distance}}% \hpack ? - }\fi} + {\ifnum\nofsubpages>\plusone + \ifcstok{\namedcounterparameter\s!subpage\c!state}\v!start + \d_scrn_bar_width \interactionbarparameter\c!width + \d_scrn_bar_distance\interactionbarparameter\c!distance + \d_scrn_bar_height \interactionbarparameter\c!height + \d_scrn_bar_depth \interactionbarparameter\c!depth + \scratchdimenone\d_scrn_bar_width + \noindent\hbox{\scrn_bar_goto_x{\hskip\d_scrn_bar_distance}}% \hpack ? + \fi + \fi} \def\scrn_bar_alternative_e - {\ifnum\nofsubpages>\plusone \doif{\namedcounterparameter\s!subpage\c!state}\v!start{% - \d_scrn_bar_width \interactionbarparameter\c!width - \d_scrn_bar_distance\interactionbarparameter\c!distance - \d_scrn_bar_height \interactionbarparameter\c!height - \d_scrn_bar_depth \interactionbarparameter\c!depth - \scratchdimentwo\dimexpr\nofsubpages\d_scrn_bar_distance-\d_scrn_bar_distance\relax % (n-1) - \scratchdimenone\dimexpr(\d_scrn_bar_width-\scratchdimentwo)/\nofsubpages\relax - \ifdim\scratchdimenone<\d_scrn_bar_distance - \scrn_bar_alternative_f - \else - \noindent\hbox to \d_scrn_bar_width{\scrn_bar_goto_x{\hss}\unskip}% \hpack ? + {\ifnum\nofsubpages>\plusone + \ifcstok{\namedcounterparameter\s!subpage\c!state}\v!start + \d_scrn_bar_width \interactionbarparameter\c!width + \d_scrn_bar_distance\interactionbarparameter\c!distance + \d_scrn_bar_height \interactionbarparameter\c!height + \d_scrn_bar_depth \interactionbarparameter\c!depth + \scratchdimentwo\dimexpr\nofsubpages\d_scrn_bar_distance-\d_scrn_bar_distance\relax % (n-1) + \scratchdimenone\dimexpr(\d_scrn_bar_width-\scratchdimentwo)/\nofsubpages\relax + \ifdim\scratchdimenone<\d_scrn_bar_distance + \scrn_bar_alternative_f + \else + \noindent\hbox to \d_scrn_bar_width{\scrn_bar_goto_x{\hss}\unskip}% \hpack ? + \fi \fi - }\fi} + \fi} \def\scrn_bar_alternative_f - {\ifnum\nofsubpages>\plusone \doif{\namedcounterparameter\s!subpage\c!state}\v!start{% - \d_scrn_bar_width \interactionbarparameter\c!width - \d_scrn_bar_distance\interactionbarparameter\c!distance - \d_scrn_bar_height \interactionbarparameter\c!height - \d_scrn_bar_depth \interactionbarparameter\c!depth - \noindent \hbox to \d_scrn_bar_width \bgroup - \doloop - {\scratchcounterthree\numexpr(\nofsubpages/\recurselevel)+\plusone\relax % rounding - \scratchdimentwo\d_scrn_bar_distance - \multiplyby\scratchdimentwo \scratchcounterthree - \advanceby\scratchdimentwo -\d_scrn_bar_distance - \scratchdimenone\d_scrn_bar_width - \advanceby\scratchdimenone -\scratchdimentwo - \divideby\scratchdimenone \scratchcounterthree - \ifdim\scratchdimenone<\d_scrn_bar_distance\else - \scratchcountertwo\recurselevel - \exitloop - \fi}% - \ifnum\scratchcounterthree>\plusone - % this is not that well tested - \advanceby\scratchcounterthree \minustwo - \scratchdimenone-\d_scrn_bar_distance - \scratchdimenone\scratchcounterthree\scratchdimenone - \advanceby\scratchdimenone \d_scrn_bar_width - \advanceby\scratchcounterthree \plusone - \divideby\scratchdimenone \scratchcounterthree - \fi - \doifelse{\interactionbarparameter\c!symbol}\v!yes - {\setupsymbolset[\interactionparameter\c!symbolset]% - \let\scrn_bar_goto_indeed\scrn_bar_goto_c}% - {\let\scrn_bar_goto_indeed\scrn_bar_goto_d}% - \scratchcounterthree\numexpr\realpageno-\plustwo\relax - \scratchcounterfour\numexpr\realpageno+\plustwo\relax - \ifnum\scratchcounterthree<\plusone \scratchcounterthree\plusone \fi - \scratchcounterfive\zerocount - \dostepwiserecurse\firstsubpage\lastsubpage\plusone - {\donefalse - \advanceby\scratchcounterfive \plusone - \ifnum\recurselevel=\firstsubpage\relax \donetrue \fi - \ifnum\recurselevel=\lastsubpage \relax \donetrue \fi - \scratchcountersix\therealsubpageno\recurselevel\relax - \c_scrn_bar_mode - \ifdone - \ifnum\scratchcountersix<\realpageno - \zerocount - \orelse\ifnum\scratchcountersix>\realpageno - \plustwo - \else - \plusfour - \fi - \else - \ifnum\scratchcounterfive=\scratchcountertwo + {\ifnum\nofsubpages>\plusone + \ifcstok{\namedcounterparameter\s!subpage\c!state}\v!start + \d_scrn_bar_width \interactionbarparameter\c!width + \d_scrn_bar_distance\interactionbarparameter\c!distance + \d_scrn_bar_height \interactionbarparameter\c!height + \d_scrn_bar_depth \interactionbarparameter\c!depth + \noindent \hbox to \d_scrn_bar_width \bgroup + \doloop + {\scratchcounterthree\numexpr(\nofsubpages/\recurselevel)+\plusone\relax % rounding + \scratchdimentwo\d_scrn_bar_distance + \multiplyby\scratchdimentwo \scratchcounterthree + \advanceby\scratchdimentwo -\d_scrn_bar_distance + \scratchdimenone\d_scrn_bar_width + \advanceby\scratchdimenone -\scratchdimentwo + \divideby\scratchdimenone \scratchcounterthree + \ifdim\scratchdimenone<\d_scrn_bar_distance\else + \scratchcountertwo\recurselevel + \exitloop + \fi}% + \ifnum\scratchcounterthree>\plusone + % this is not that well tested + \advanceby\scratchcounterthree \minustwo + \scratchdimenone-\d_scrn_bar_distance + \scratchdimenone\scratchcounterthree\scratchdimenone + \advanceby\scratchdimenone \d_scrn_bar_width + \advanceby\scratchcounterthree \plusone + \divideby\scratchdimenone \scratchcounterthree + \fi + \ifcstok{\interactionbarparameter\c!symbol}\v!yes + \setupsymbolset[\interactionparameter\c!symbolset]% + \let\scrn_bar_goto_indeed\scrn_bar_goto_c + \else + \let\scrn_bar_goto_indeed\scrn_bar_goto_d + \fi + \scratchcounterthree\numexpr\realpageno-\plustwo\relax + \scratchcounterfour\numexpr\realpageno+\plustwo\relax + \ifnum\scratchcounterthree<\plusone \scratchcounterthree\plusone \fi + \scratchcounterfive\zerocount + \dostepwiserecurse\firstsubpage\lastsubpage\plusone + {\donefalse + \advanceby\scratchcounterfive \plusone + \ifnum\recurselevel=\firstsubpage\relax \donetrue \fi + \ifnum\recurselevel=\lastsubpage \relax \donetrue \fi + \scratchcountersix\therealsubpageno\recurselevel\relax + \c_scrn_bar_mode + \ifdone \ifnum\scratchcountersix<\realpageno - \plusone + \zerocount \orelse\ifnum\scratchcountersix>\realpageno - \plusthree - \else \plustwo + \else + \plusfour \fi \else - \minusone + \ifnum\scratchcounterfive=\scratchcountertwo + \ifnum\scratchcountersix<\realpageno + \plusone + \orelse\ifnum\scratchcountersix>\realpageno + \plusthree + \else + \plustwo + \fi + \else + \minusone + \fi \fi - \fi - \ifnum\c_scrn_bar_mode<\zerocount\else - \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\c_scrn_bar_mode}[realpage(\the\scratchcountersix)]}% - \hss - \scratchcounterfive\zerocount - \fi}% - \unskip - \egroup - }\fi} + \ifnum\c_scrn_bar_mode<\zerocount\else + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\c_scrn_bar_mode}[realpage(\the\scratchcountersix)]}% + \hss + \scratchcounterfive\zerocount + \fi}% + \unskip + \egroup + \fi + \fi} \def\scrn_bar_alternative_g {\ifnum\lastsubpage>\firstsubpage\relax % no test for state? diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx index e227516183d..7a3e51cfc84 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx @@ -50,12 +50,12 @@ \aliased\let\setupbuttons\setupbutton \appendtoks - \frozen\instance\setuevalue\currentbutton{\scrn_button_direct{\currentbutton}}% + \frozen\protected\instance\edefcsname\currentbutton\endcsname{\scrn_button_direct{\currentbutton}}% \to \everydefinebutton \protected\def\scrn_button_direct#tag% {\begingroup - \edef\currentbutton{#tag}% + \cdef\currentbutton{#tag}% \iflocation \expandafter\scrn_button_direct_status \else @@ -73,7 +73,7 @@ % % \button[settings]{}[action] % normally used at the tex end -\tolerant\def\scrn_button_direct_indeed[#settings]#:#text[#action]% +\tolerant\def\scrn_button_direct_indeed[#S#settings]#:#text[#action]% {\setupcurrentbutton[#settings]% % no \dontleavehmode as it will force a vbox to \hsize which then % spoils a tight box @@ -88,7 +88,7 @@ \egroup \endgroup} -\tolerant\def\scrn_button_direct_ignore[#settings]#:#text[#destination]% +\tolerant\def\scrn_button_direct_ignore[#S#settings]#:#text[#destination]% {\endgroup} \definebutton[button] % english @@ -151,7 +151,7 @@ \def\scrn_button_make#currentparameter#inheritedframed#letparameter#setparameter#text#action% {\begingroup \c_attr_reference\attributeunsetvalue - \global\setfalse\c_scrn_button_skipped + \global\c_scrn_button_skipped\conditionalfalse \locationboxpagestate\csname\??buttonlocation#currentparameter\c!samepage\endcsname % ?? bt: todo \doifelsereferencefound{#action}\scrn_button_make_yes\scrn_button_make_nop #currentparameter% @@ -208,7 +208,7 @@ {#inheritedframed{\ignorespaces#text\removeunwantedspaces}} \def\scrn_button_make_skipped#currentparameter#inheritedframed#letparameter#setparameter#text% - {\global\settrue\c_scrn_button_skipped} + {\global\c_scrn_button_skipped\conditionaltrue} \def\scrn_button_make_normal#currentparameter#inheritedframed#letparameter#setparameter#text% {\clf_injectcurrentreference @@ -337,7 +337,7 @@ \pushoverloadmode -\permanent\tolerant\protected\def\defineinteractionmenu[#tag]#spacer[#category]#spacer[#settings]% category reflects location, settings can be parent +\permanent\tolerant\protected\def\defineinteractionmenu[#tag]#spacer[#category]#spacer[#S#settings]% category reflects location, settings can be parent {\ifarguments\or \scrn_menu_define_original[#tag]% % root definition \or @@ -360,8 +360,8 @@ \def\scrn_menu_register#tag#category% {\ifcsname\??menutoks#category\endcsname \else - \expandafter\newtoks \csname\??menutoks#category\endcsname - \expandafter\setfalse\csname\??menustate#category\endcsname + \expandafter\newtoks \csname\??menutoks #category\endcsname + \expandafter\newconditional\csname\??menustate#category\endcsname \fi % \normalexpanded{\csname\??menutoks#category\endcsname{\the\csname\??menutoks#category\endcsname\scrn_menu_action{#tag}}}} \toksapp\csname\??menutoks#category\endcsname{\scrn_menu_action{#tag}}} % needs testing @@ -373,15 +373,16 @@ \aliased\letcsname\e!stop\v!interactionmenu\endcsname\relax -%normalexpanded{\permanent\defcsname\e!start\v!interactionmenu\endcsname[#tag]#content\expandafter\noexpand\csname\e!stop\v!interactionmenu\endcsname}% -% \normalexpanded{\permanent\expandafter\def\expandafter\noexpand\csname\e!start\v!interactionmenu\endcsname[#tag]#content\expandafter\noexpand\csname\e!stop\v!interactionmenu\endcsname}% \normalexpanded{\permanent\expandafter\def\expandafter\noexpand\csname\e!start\v!interactionmenu\endcsname[#tag]#content\csname\e!stop\v!interactionmenu\endcsname}% - {\def\currentinteractionmenu{#tag}% - \expandafter\settrue\csname\??menustate\interactionmenuparameter\c!category\endcsname + {\cdef\currentinteractionmenu{#tag}% + %\ifcsname\??menustate\interactionmenuparameter\c!category\endcsname\else + % \expandafter\newconditional\csname\??menustate\interactionmenuparameter\c!category\endcsname + %\fi + \csname\??menustate\interactionmenuparameter\c!category\endcsname\conditionaltrue \setinteractionmenuparameter\c!menu{#content}} \permanent\protected\def\resetinteractionmenu[#tag]% - {\def\currentinteractionmenu{#tag}% + {\cdef\currentinteractionmenu{#tag}% \resetinteractionmenuparameter\c!menu} %D Placement of menus: @@ -437,10 +438,10 @@ \mutable\lettonothing\currentinteractionmenulocation \def\scrn_menu_set_used - {\d_scrn_menu_offset_left \ifchkdim\interactionmenuparameter\c!leftoffset \or\lastchkdim\else\zeropoint\fi - \d_scrn_menu_offset_right \ifchkdim\interactionmenuparameter\c!rightoffset \or\lastchkdim\else\zeropoint\fi - \d_scrn_menu_offset_top \ifchkdim\interactionmenuparameter\c!topoffset \or\lastchkdim\else\zeropoint\fi - \d_scrn_menu_offset_bottom\ifchkdim\interactionmenuparameter\c!bottomoffset\or\lastchkdim\else\zeropoint\fi + {\d_scrn_menu_offset_left \ifchkdimension\interactionmenuparameter\c!leftoffset \or\lastchkdimension\else\zeropoint\fi + \d_scrn_menu_offset_right \ifchkdimension\interactionmenuparameter\c!rightoffset \or\lastchkdimension\else\zeropoint\fi + \d_scrn_menu_offset_top \ifchkdimension\interactionmenuparameter\c!topoffset \or\lastchkdimension\else\zeropoint\fi + \d_scrn_menu_offset_bottom\ifchkdimension\interactionmenuparameter\c!bottomoffset\or\lastchkdimension\else\zeropoint\fi \d_scrn_menu_asked_width \interactionmenuparameter\c!maxwidth \d_scrn_menu_asked_height \interactionmenuparameter\c!maxheight \d_scrn_menu_used_width\dimexpr @@ -514,7 +515,7 @@ \forgetall \global\d_scrn_menu_next_distance\zeropoint \let\scrn_menu_action\scrn_menu_package_indeed - \the\everysetmenucommands + \expand\everysetmenucommands \csname\??menupacker\namedinteractionmenuparameter\currentinteractionmenulocation\c!alternative\endcsname \fi \endgroup} @@ -542,7 +543,7 @@ \protected\def\scrn_menu_package_indeed#tag% one menu {\begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \edef\currentinteractionmenustate{\interactionmenuparameter\c!state}% \ifx\currentinteractionmenustate\v!start \scrn_menu_packager @@ -615,12 +616,12 @@ \def\scrn_menu_button_meta_template {\currentinteractionmenulocation _menu_button(% - \number\c_scrn_menu_position,% - \number\c_scrn_menu_page_mode,% - \MPpos{\currentinteractionmenulocation:\number\c_scrn_menu_position}% + \the\c_scrn_menu_position,% + \the\c_scrn_menu_page_mode,% + \MPpos{\currentinteractionmenulocation:\the\c_scrn_menu_position}% );} -\permanent\def\MPmenubuttons#1{\the\t_scrn_menu_meta_data} +\permanent\def\MPmenubuttons#1{\expand\t_scrn_menu_meta_data} \appendtoks \global\t_scrn_menu_meta_data\emptytoks @@ -639,7 +640,11 @@ {\begingroup \global\c_scrn_menu_position\zerocount \def\scrn_menu_between_action_indeed{\interactionmenuparameter\c!inbetween}% - \doifelse{\interactionmenuparameter\c!position}\v!yes\settrue\setfalse\c_scrn_menu_positioning + \ifcstok{\interactionmenuparameter\c!position}\v!yes + \c_scrn_menu_positioning\conditionaltrue + \else + \c_scrn_menu_positioning\conditionalfalse + \fi \scrn_menu_set_align \setbox\b_scrn_menu\vbox to \d_scrn_menu_used_height \bgroup \hsize\d_scrn_menu_used_width @@ -659,7 +664,11 @@ {\begingroup \global\c_scrn_menu_position\zerocount \def\scrn_menu_between_action_indeed{\interactionmenuparameter\c!middle}% - \doifelse{\interactionmenuparameter\c!position}\v!yes\settrue\setfalse\c_scrn_menu_positioning + \ifcstok{\interactionmenuparameter\c!position}\v!yes + \c_scrn_menu_positioning\conditionaltrue + \else + \c_scrn_menu_positioning\conditionalfalse + \fi \setbox\b_scrn_menu\hbox to \d_scrn_menu_used_width \bgroup \interactionmenuparameter\c!left\relax \ignorespaces#content\unskip @@ -717,7 +726,7 @@ {\c_scrn_menu_page_mode\plustwo}% \xtoksapp\t_scrn_menu_meta_data{\scrn_menu_button_meta_template}% \hpos - {\currentinteractionmenulocation:\number\c_scrn_menu_position}% + {\currentinteractionmenulocation:\the\c_scrn_menu_position}% {\scrn_button_make #currentparameter% #inheritedframed% @@ -799,17 +808,18 @@ \permanent\protected\def\includemenu[#tag]% {\begingroup - \edef\currentinteractionmenu{#tag}% - \doif{\interactionmenuparameter\c!state}\v!local - {\letinteractionmenuparameter\c!state\v!start - \directinteractionmenuparameter\c!menu}% + \cdef\currentinteractionmenu{#tag}% + \ifcstok{\interactionmenuparameter\c!state}\v!local + \letinteractionmenuparameter\c!state\v!start + \directinteractionmenuparameter\c!menu + \fi \endgroup} %D Direct call (todo): -\permanent\tolerant\protected\def\interactionmenu[#tag]#spacer[#settings]% +\permanent\tolerant\protected\def\interactionmenu[#tag]#spacer[#S#settings]% {\begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \setupcurrentinteractionmenu[#settings]% \scrn_menu_insert{#tag}% \endgroup} @@ -826,9 +836,11 @@ \let\scrn_menu_insert_content_ignore\gobbleoneargument \appendtoks - \doifelse{\interactionparameter\c!menu}\v!on - {\let\scrn_menu_insert_content\scrn_menu_insert_content_indeed}% - {\let\scrn_menu_insert_content\scrn_menu_insert_content_ignore}% + \ifcstok{\interactionparameter\c!menu}\v!on + \let\scrn_menu_insert_content\scrn_menu_insert_content_indeed + \else + \let\scrn_menu_insert_content\scrn_menu_insert_content_ignore + \fi \to \everysetupinteraction %D Plugs into the page builder: @@ -836,7 +848,7 @@ \protected\def\scrn_menu_leftedge {\hbox to \leftedgewidth \bgroup \hsize\leftedgewidth - \settrue\c_scrn_menu_zerodimensions + \c_scrn_menu_zerodimensions\conditionaltrue \scrn_menu_insert\v!left \egroup \hskip-\leftedgewidth} @@ -844,7 +856,7 @@ \protected\def\scrn_menu_rightedge {\hbox to \rightedgewidth \bgroup \hsize\rightedgewidth - \settrue\c_scrn_menu_zerodimensions + \c_scrn_menu_zerodimensions\conditionaltrue \scrn_menu_insert\v!right \egroup \hskip-\rightedgewidth} @@ -852,7 +864,7 @@ \protected\def\scrn_menu_top {\vbox to \topheight \bgroup \vsize\topheight - \settrue\c_scrn_menu_zerodimensions + \c_scrn_menu_zerodimensions\conditionaltrue \scrn_menu_insert\v!top \kern\zeropoint \egroup @@ -861,7 +873,7 @@ \protected\def\scrn_menu_bottom {\vbox to \bottomheight \bgroup \vsize\bottomheight - \settrue\c_scrn_menu_zerodimensions + \c_scrn_menu_zerodimensions\conditionaltrue \scrn_menu_insert\v!bottom \kern\zeropoint \egroup @@ -965,9 +977,11 @@ %D Sometimes handy: \def\scrn_button_direct_status - {\doifelse{\buttonparameter\c!state}\v!start - {\dosingleempty\scrn_button_direct_indeed}% - {\dosingleempty\scrn_button_direct_ignore}} + {\ifcstok{\buttonparameter\c!state}\v!start + \expandafter\scrn_button_direct_indeed + \else + \expandafter\scrn_button_direct_ignore + \fi} \permanent\protected\def\menubutton % tag settings text action {\iflocation @@ -976,7 +990,7 @@ \expandafter\scrn_menu_menu_button_ignore \fi} -\tolerant\def\scrn_menu_menu_button_indeed[#menutag]#spacer[#settings]#:#text[#action]% +\tolerant\def\scrn_menu_menu_button_indeed[#menutag]#spacer[#S#settings]#:#text[#action]% {\ifcstok{\interactionmenuparameter\c!state}\v!start \ifparameter#settings\or \expandafter\scrn_menu_menu_button_a @@ -987,12 +1001,12 @@ \fi{#menutag}{#settings}{#text}{#action}% \fi} -\tolerant\def\scrn_menu_menu_button_ignore[#menutag]#spacer[#settings]#:#text[#action]% +\tolerant\def\scrn_menu_menu_button_ignore[#menutag]#spacer[#S#settings]#:#text[#action]% {} \def\scrn_menu_menu_button_a#tag#settings#text#action% {\dontleavehmode \begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \setupcurrentinteractionmenu[#settings]% \scrn_button_make \interactionmenuparameter @@ -1018,7 +1032,7 @@ \def\scrn_menu_menu_button_c#tag#dummy#text#action% {\dontleavehmode \begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \scrn_button_make \interactionmenuparameter \inheritedinteractionmenuframed diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx index e3bde47c678..26aa52851e5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx @@ -201,7 +201,7 @@ \fi \to \everydefinefieldbody -\permanent\tolerant\protected\def\fieldbody[#tag]#spacer[#settings]% +\permanent\tolerant\protected\def\fieldbody[#tag]#spacer[#S#settings]% {\iflocation \hbox\bgroup \edef\currentfieldbody{#tag}% @@ -328,9 +328,11 @@ \appendtoks \lettonothing\currentfieldcategory - \doifelse{\interactionparameter\c!fieldlayer}\v!auto - {\setupcurrentfieldcategory[\c!fieldlayer=\currentviewerlayer]}% - {\setupcurrentfieldcategory[\c!fieldlayer=]}% + \ifcstok{\interactionparameter\c!fieldlayer}\v!auto + \setupcurrentfieldcategory[\c!fieldlayer=\currentviewerlayer]% + \else + \setupcurrentfieldcategory[\c!fieldlayer=]% + \fi \to \everysetupinteraction \setupinteraction @@ -355,7 +357,7 @@ \c!offset=\v!overlay, \c!align=] -\permanent\tolerant\protected\def\fitfield[#tag]#spacer[#settings]% +\permanent\tolerant\protected\def\fitfield[#tag]#spacer[#S#settings]% {\iflocation \begingroup \setbox\b_scrn_field_fit_symbol\hbox\bgroup @@ -419,7 +421,7 @@ % \setupcurrent -\permanent\tolerant\protected\def\setupfield[#tag]#spacer[#variant]#spacer[#totalsettings]#spacer[#labelsettings]#spacer[#fieldsettings]% +\permanent\tolerant\protected\def\setupfield[#tag]#spacer[#variant]#spacer[#S#totalsettings]#spacer[#S#labelsettings]#spacer[#S#fieldsettings]% {\ifarguments\or\or \definefieldcategory[#tag][\s!parent=\??fieldcontent#tag,#variant]% \setupfieldtotalframed [#tag][\s!parent=\??fieldtotal]% @@ -442,7 +444,7 @@ \setupfieldcontentframed[#tag][\s!parent=\??fieldcontent,#fieldsettings]% \fi} -\permanent\tolerant\protected\def\setupfields[#variant]#spacer[#totalsettings]#spacer[#labelsettings]#spacer[#fieldsettings]% +\permanent\tolerant\protected\def\setupfields[#variant]#spacer[#S#totalsettings]#spacer[#S#labelsettings]#spacer[#S#fieldsettings]% {\ifarguments\or \setupfieldtotalframed [#variant]% \or @@ -550,22 +552,24 @@ \def\scrn_field_set_content_box {\setbox\b_scrn_field_content\hbox {\reshapeframeboxtrue % else wrong dimensions (to be checked) - \doifnothing{\fieldcontentframedparameter\c!height} - {\ifconditional\fieldisvertical - \setfieldcontentframedparameter\c!height{6ex}% - \orelse\ifconditional\fieldishorizontal - \setfieldcontentframedparameter\c!height{\vsize}% - \else - \setfieldcontentframedparameter\c!height{2cm}% - \fi}% - \doifnothing{\fieldcontentframedparameter\c!width} - {\ifconditional\fieldisvertical - \setfieldcontentframedparameter\c!width{\hsize}% - \orelse\ifconditional\fieldishorizontal - \setfieldcontentframedparameter\c!width{20em}% - \else - \setfieldcontentframedparameter\c!width{2cm}% - \fi}% + \ifempty{\fieldcontentframedparameter\c!height}% + \ifconditional\fieldisvertical + \setfieldcontentframedparameter\c!height{6ex}% + \orelse\ifconditional\fieldishorizontal + \setfieldcontentframedparameter\c!height{\vsize}% + \else + \setfieldcontentframedparameter\c!height{2cm}% + \fi + \fi + \ifempty{\fieldcontentframedparameter\c!width}% + \ifconditional\fieldisvertical + \setfieldcontentframedparameter\c!width{\hsize}% + \orelse\ifconditional\fieldishorizontal + \setfieldcontentframedparameter\c!width{20em}% + \else + \setfieldcontentframedparameter\c!width{2cm}% + \fi + \fi \inheritedfieldcontentframedframed % lower framedoffset {\fieldbody [\currentfieldbody] @@ -596,19 +600,19 @@ %D todo: replace \processallactionsinset \def\scrn_field_analyze_setups - {\setfalse\fieldlabelshown - \setfalse\fieldframeshown - \setfalse\fieldishorizontal - \setfalse\fieldisvertical + {\fieldlabelshown\conditionalfalse + \fieldframeshown\conditionalfalse + \fieldishorizontal\conditionalfalse + \fieldisvertical\conditionalfalse \normalexpanded{\processallactionsinset[\fieldtotalframedparameter\c!alternative]} - [ \v!reset=>\setfalse\fieldlabelshown - \setfalse\fieldframeshown - \setfalse\fieldishorizontal - \setfalse\fieldisvertical, - \v!label=>\settrue\fieldlabelshown, - \v!frame=>\settrue\fieldframeshown, - \v!horizontal=>\settrue\fieldishorizontal, - \v!vertical=>\settrue\fieldisvertical]% + [ \v!reset=>\fieldlabelshown\conditionalfalse + \fieldframeshown\conditionalfalse + \fieldishorizontal\conditionalfalse + \fieldisvertical\conditionalfalse, + \v!label=>\fieldlabelshown\conditionaltrue, + \v!frame=>\fieldframeshown\conditionaltrue, + \v!horizontal=>\fieldishorizontal\conditionaltrue, + \v!vertical=>\fieldisvertical\conditionaltrue]% \ifconditional\fieldisvertical \setupfieldtotalframed[\c!distance=\zeropoint,\c!inbetween=\vskip\d_framed_local_offset,\c!align=\v!right,\c!width=20em]% \orelse\ifconditional\fieldishorizontal @@ -622,7 +626,7 @@ \newinteger\c_scrn_field_system_n -\permanent\def\currentsystemfield{sys::\number\c_scrn_field_system_n} +\permanent\def\currentsystemfield{sys::\the\c_scrn_field_system_n} \permanent\protected\def\nextsystemfield {\global\advanceby\c_scrn_field_system_n\plusone} @@ -656,27 +660,27 @@ \c!backgroundcolor=gray] \appendtoks - \frozen\instance\setuevalue\currenttooltip{\scrn_tooltip_direct{\currenttooltip}}% + \frozen\instance\protected\edefcsname\currenttooltip\endcsname{\scrn_tooltip_direct{\currenttooltip}}% \to \everydefinetooltip \protected\def\scrn_tooltip_direct#tag% - {\def\currenttooltip{#tag}% + {\cdef\currenttooltip{#tag}% \iflocation \expandafter\scrn_tooltip_indeed \else \expandafter\scrn_tooltip_ignore \fi} -\tolerant\def\scrn_tooltip_ignore[#settings]#:#anchortext#tiptext% +\tolerant\def\scrn_tooltip_ignore[#S#settings]#:#anchortext#tiptext% {#anchortext} \mutable\lettonothing\currenttooltipname -\tolerant\def\scrn_tooltip_indeed[#settings]#:#anchortext#tiptext% a more modern aproach (push buttons) +\tolerant\def\scrn_tooltip_indeed[#S#settings]#:#anchortext#tiptext% a more modern aproach (push buttons) {\dontleavehmode \hbox \bgroup \dontcomplain \global\advanceby\c_scrn_tooltip_n\plusone - \edef\currenttooltipname{tooltip:\number\c_scrn_tooltip_n}% + \edef\currenttooltipname{tooltip:\the\c_scrn_tooltip_n}% \setbox\b_scrn_tooltip_anchor\hbox {\strut#anchortext}% \doifelseassignment{#settings} @@ -744,15 +748,15 @@ \installcorenamespace {fieldstack} -\permanent\tolerant\protected\def\definefieldstack[#tag]#spacer[#symbols]#spacer[#settings]% +\permanent\tolerant\protected\def\definefieldstack[#tag]#spacer[#symbols]#spacer[#S#settings]% {\ifcsname\??fieldstack#tag\endcsname % already done \else - %setgvalue{\??fieldstack#tag}{\scrn_fieldstack_construct[#tag][#symbols][#settings]}% - \setxvalue{\??fieldstack#tag}{\scrn_fieldstack_construct[#tag][#symbols][\normalunexpanded{#settings}]}% + %xdefcsname\??fieldstack#tag\endcsname{\scrn_fieldstack_construct[#tag][#symbols][#settings]}% + \xdefcsname\??fieldstack#tag\endcsname{\scrn_fieldstack_construct[#tag][#symbols][\normalunexpanded{#settings}]}% \fi} -\permanent\tolerant\protected\def\fieldstack[#tag]#spacer[#symbols]#spacer[#settings]% +\permanent\tolerant\protected\def\fieldstack[#tag]#spacer[#symbols]#spacer[#S#settings]% {\ifparameter#symbols\or \definefieldstack[#tag][#symbols][#settings]% \fi @@ -764,7 +768,7 @@ \def\scrn_fieldstack_add#tag#settings#symbol% {\advanceby\scratchcounter\plusone - \edef\currentfieldstackname{#tag:\number\scratchcounter}% + \edef\currentfieldstackname{#tag:\the\scratchcounter}% \ifnum\scratchcounter=\fieldcategoryparameter\c!start\relax \definefieldbody[\currentfieldstackname][\c!type=check,\c!values={#symbol,\s!empty},\c!default={#symbol}]% \else @@ -781,7 +785,7 @@ \c!depth=\dp\b_scrn_fieldstack_box, #settings]}} -\protected\def\scrn_fieldstack_construct[#tag][#symbols][#settings]% start=n, 0 == leeg +\protected\def\scrn_fieldstack_construct[#tag][#symbols][#S#settings]% start=n, 0 == leeg {\iflocation \dontleavehmode \begingroup @@ -819,23 +823,23 @@ \global\advanceby\c_scrn_rollbutton_n_button\plusone \global\advanceby\c_scrn_rollbutton_n_symbol\plusone \definesymbol - [rollsymbol:\number\c_scrn_rollbutton_n_symbol] + [rollsymbol:\the\c_scrn_rollbutton_n_symbol] [{\framed[\c!frame=\v!off,\c!width=\overlaywidth,\c!height=\overlayheight]{}}]% % \definefieldbody - % [rollbutton:\number\c_scrn_rollbutton_n_button] + % [rollbutton:\the\c_scrn_rollbutton_n_button] % [\c!type=push, - % \c!values=rollsymbol:\number\c_scrn_rollbutton_n_symbol, - % \c!default=rollsymbol:\number\c_scrn_rollbutton_n_symbol]% + % \c!values=rollsymbol:\the\c_scrn_rollbutton_n_symbol, + % \c!default=rollsymbol:\the\c_scrn_rollbutton_n_symbol]% % \fitfield - % [rollbutton:\number\c_scrn_rollbutton_n_button]% + % [rollbutton:\the\c_scrn_rollbutton_n_button]% % [\c!regionin={#regionin}, % \c!regionout={#regionout}]% % \definefield - [rollbutton:\number\c_scrn_rollbutton_n_button][push][rollbutton] - [rollsymbol:\number\c_scrn_rollbutton_n_symbol]% + [rollbutton:\the\c_scrn_rollbutton_n_button][push][rollbutton] + [rollsymbol:\the\c_scrn_rollbutton_n_symbol]% \fitfield - [rollbutton:\number\c_scrn_rollbutton_n_button]% + [rollbutton:\the\c_scrn_rollbutton_n_button]% [\c!regionin={#1#3},\c!regionout={#2#4}]% % \egroup @@ -868,7 +872,7 @@ \newinteger\c_scrn_pushbutton_n -\permanent\tolerant\protected\def\definepushbutton[#tag]#spacer[#settings]% +\permanent\tolerant\protected\def\definepushbutton[#tag]#spacer[#S#settings]% {\scrn_pushbutton_define_variant{#tag}{n}{push}% \scrn_pushbutton_define_variant{#tag}{r}{\symbol[pushsymbol:#tag:n]}% \scrn_pushbutton_define_variant{#tag}{d}{\symbol[pushsymbol:#tag:r]}% @@ -889,12 +893,12 @@ \c!clickout={#reference},% #settings]% \definefield - [pushbutton:\number\c_scrn_pushbutton_n]% + [pushbutton:\the\c_scrn_pushbutton_n]% [push]% [pushbutton]% [pushsymbol:#tag:n,pushsymbol:#tag:r,pushsymbol:#tag:d]% \fitfield - [pushbutton:\number\c_scrn_pushbutton_n]% + [pushbutton:\the\c_scrn_pushbutton_n]% \egroup} \permanent\tolerant\protected\def\definepushsymbol[#tag]#spacer[#variant]% [#reference] @@ -975,7 +979,7 @@ \setbuttonparameter \usebuttonstyleandcolor} -\permanent\tolerant\protected\def\rollbutton[#tag]#spacer[#settings]#:#text[#reference]% +\permanent\tolerant\protected\def\rollbutton[#tag]#spacer[#S#settings]#:#text[#reference]% {\dontleavehmode \bgroup \global\advanceby\c_scrn_rollbutton_n_button\plusone @@ -997,27 +1001,32 @@ \let\scrn_rollbutton_symbol\scrn_rollbutton_symbol_b \fi % todo: share symbols, tricky since different dimensions (maybe \unique...) - \definesymbol[rollsymbol:\number\c_scrn_rollbutton_n_symbol:n][\scrn_rollbutton_symbol{n}{#text}]% - \definesymbol[rollsymbol:\number\c_scrn_rollbutton_n_symbol:r][\scrn_rollbutton_symbol{r}{#text}]% - \definesymbol[rollsymbol:\number\c_scrn_rollbutton_n_symbol:d][\scrn_rollbutton_symbol{d}{#text}]% + \definesymbol[rollsymbol:\the\c_scrn_rollbutton_n_symbol:n][\scrn_rollbutton_symbol{n}{#text}]% + \definesymbol[rollsymbol:\the\c_scrn_rollbutton_n_symbol:r][\scrn_rollbutton_symbol{r}{#text}]% + \definesymbol[rollsymbol:\the\c_scrn_rollbutton_n_symbol:d][\scrn_rollbutton_symbol{d}{#text}]% \definefield - [rollbutton:\number\c_scrn_rollbutton_n_button][push][rollbutton] - [rollsymbol:\number\c_scrn_rollbutton_n_symbol:n,% - rollsymbol:\number\c_scrn_rollbutton_n_symbol:r,% - rollsymbol:\number\c_scrn_rollbutton_n_symbol:d]% + [rollbutton:\the\c_scrn_rollbutton_n_button][push][rollbutton] + [rollsymbol:\the\c_scrn_rollbutton_n_symbol:n,% + rollsymbol:\the\c_scrn_rollbutton_n_symbol:r,% + rollsymbol:\the\c_scrn_rollbutton_n_symbol:d]% \fitfield - [rollbutton:\number\c_scrn_rollbutton_n_button]% + [rollbutton:\the\c_scrn_rollbutton_n_button]% [\c!clickout={#reference}]% \egroup} \protected\def\scrn_rollbutton_symbol_indeed#getparameter#inheritedframed#setparameter#usestyleandcolor#what#text% {\definecolor[rollover][rollover:#what]% - \doifelse{#what}{n}% ? - {\doifelse{#getparameter\c!alternative}\v!hidden\phantom\hbox}\hbox - {#setparameter\c!framecolor {rollover}% - #setparameter\c!backgroundcolor{rollover}% - #setparameter\c!color {rollover}% - #inheritedframed{#usestyleandcolor\c!style\c!color{#text}}}} + \ifcstok{#getparameter\c!alternative}\v!hidden + \expandafter\phantom + \else + \expandafter\hbox + \fi + \bgroup + #setparameter\c!framecolor {rollover}% + #setparameter\c!backgroundcolor{rollover}% + #setparameter\c!color {rollover}% + #inheritedframed{#usestyleandcolor\c!style\c!color{#text}}% + \egroup} %D We plug into the menu system @@ -1037,4 +1046,31 @@ \enforced\let\rob \scrn_menu_rob_direct \to \everysetmenucommands +%D Signing: +%D +%D \starttyping +%D \setupinteraction[state=start] +%D +%D \definefield[signature][signed] +%D +%D \starttext +%D +%D \defineoverlay[signature][my signature] +%D +%D \startTEXpage[offset=1ts] +%D sign: \inframed +%D [background=signature] +%D {\fieldbody[signature][width=3cm,option=hidden]} +%D \stopTEXpage +%D +%D \stoptext +%D \stoptyping +%D +%D after processing: +%D +%D \starttyping +%D mtxrun --script pdf --sign --certificate=somesign.pem --password=test --uselibrary somefile +%D mtxrun --script pdf --verify --certificate=somesign.pem --password=test --uselibrary somefile +%D \stoptyping + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx index 9f0c5dbdd07..f2fe7f42a3a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx @@ -78,9 +78,9 @@ \mutable\lettonothing\currenthelpname \protected\def\scrn_help_argument#category% - {\def\currenthelp{#category}% + {\cdef\currenthelp{#category}% \global\advanceby\c_scrn_help_n\plusone - \edef\currenthelpname{help:\number\c_scrn_help_n}% + \edef\currenthelpname{help:\the\c_scrn_help_n}% \doifelselocation\scrn_help_argument_indeed\scrn_help_argument_ignore} \tolerant\def\scrn_help_argument_indeed[#reference]#:#text#target% @@ -91,17 +91,17 @@ \scrn_help_register{#target}% \egroup % can be usernode instead \goto - {\helpsignal{\number\c_scrn_help_n}#target}% - [\helpaction{\number\c_scrn_help_n}]} + {\helpsignal{\the\c_scrn_help_n}#target}% + [\helpaction{\the\c_scrn_help_n}]} \tolerant\def\scrn_help_argument_ignore[#reference]#:#text#target% {#target} \tolerant\protected\def\scrn_help_start#category#spacer[#reference]% {\global\advanceby\c_scrn_help_n\plusone - \edef\currenthelp{#category}% + \cdef\currenthelp{#category}% \edef\currenthelpreference{#reference}% - \edef\currenthelpname{help:\number\c_scrn_help_n}% + \edef\currenthelpname{help:\the\c_scrn_help_n}% \grabbufferdatadirect\currenthelp{\e!start\currenthelp}{\e!stop\currenthelp}} \protected\def\scrn_help_stop diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt index 2d01a1a28ef..6890a66d5a8 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt @@ -21,10 +21,6 @@ local expand_macro = token.expand_macro local prerolled = { } local identitydata = { } -local function setidentityvariable(key,value) - prerolled[key] = value -end - table.setmetatableindex(identitydata, function(t,k) if k == "keywords" then k = "keyword" @@ -49,8 +45,12 @@ end interfaces.implement { name = "setidentityvariable", - actions = setidentityvariable, arguments = "2 strings", + public = true, + protected = true, + actions = function(key,value) + prerolled[key] = value + end, } interfaces.implement { diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx index 1308ff6ec9b..6a458870c7e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx @@ -40,9 +40,13 @@ \to \everysetupinteraction \permanent\protected\def\checkinteractionstate - {\doifelse{\interactionparameter\c!state}\v!start - {\locationtrue \setsystemmode \v!interaction}% - {\locationfalse \resetsystemmode\v!interaction}} + {\ifcstok{\interactionparameter\c!state}\v!start + \locationtrue + \setsystemmode\v!interaction + \else + \locationfalse + \resetsystemmode\v!interaction + \fi} \permanent\def\doifelselocation % expandable {\iflocation @@ -71,35 +75,35 @@ % interactions so a general start-stop will do % % \appendtoks -% \setuevalue \currentinteraction {\scrn_interaction_direct{\currentinteraction}}% -% \setuevalue{\e!start\currentinteraction}{\scrn_interaction_start {\currentinteraction}}% -% \setuevalue{\e!stop \currentinteraction}{\scrn_interaction_stop }% +% \frozen\instance\protected\edefcsname \currentinteraction\endcsname{\scrn_interaction_direct{\currentinteraction}}% +% \frozen\instance\protected\edefcsname\e!start\currentinteraction\endcsname{\scrn_interaction_start {\currentinteraction}}% +% \frozen\instance\protected\edefcsname\e!stop \currentinteraction\endcsname{\scrn_interaction_stop }% % \to \everydefineinteraction % % \protected\def\scrn_interaction_direct#1% -% {\edef\currentinteraction{#1}} +% {\cdef\currentinteraction{#1}} % % \protected\def\scrn_interaction_start#1% % {\pushmacro\currentinteraction -% \edef\currentinteraction{#1}} +% \cdef\currentinteraction{#1}} % % \protected\def\scrn_interaction_stop % {\popmacro\currentinteraction} % % \protected\def\setinteraction[#1]% -% {\def\currentinteraction{#1}} +% {\cdef\currentinteraction{#1}} % % \defineinteraction[\v!interaction] \permanent\protected\def\startinteraction[#1]% {\pushmacro\currentinteraction - \edef\currentinteraction{#1}} + \cdef\currentinteraction{#1}} \permanent\protected\def\stopinteraction {\popmacro\currentinteraction} \permanent\protected\def\setinteraction[#1]% - {\def\currentinteraction{#1}} + {\cdef\currentinteraction{#1}} \defineinteraction % keep it simple [\v!hidden] @@ -188,7 +192,7 @@ %D the \LUA\ end. So this one gets called by the time we need the value. \def\scrn_identity_get#1% - {\clf_setidentityvariable{#1}{\prerolltostring{\interactionparameter{#1}}}} + {\setidentityvariable{#1}{\prerolltostring{\interactionparameter{#1}}}} % this comes before starttext diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx index 312051d0c05..378d94e0cba 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx @@ -117,7 +117,7 @@ \global\canvasheight\currentinteractionscreenheight \fi \ifconditional\c_page_layouts_location_is_set - \global\setfalse\c_scrn_canvas_tight_page + \global\c_scrn_canvas_tight_page\conditionalfalse \fi \ifconditional\c_scrn_canvas_tight_page \global\canvasmaxwidth \paperwidth @@ -256,11 +256,11 @@ \begingroup \edef\p_option{\interactionscreenparameter\c!option}% \ifx\p_option\v!max - \global\settrue \c_scrn_canvas_tight_page + \global\c_scrn_canvas_tight_page\conditionaltrue \orelse\ifx\p_option\v!fit - \global\settrue \c_scrn_canvas_tight_page + \global\c_scrn_canvas_tight_page\conditionaltrue \else - \global\setfalse\c_scrn_canvas_tight_page + \global\c_scrn_canvas_tight_page\conditionalfalse \fi \endgroup \to \everysetupinteractionscreen diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx index b86677ab238..41946a13aaa 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx @@ -18,14 +18,22 @@ \unprotect \appendtoks - \doifsomething{\interactionparameter\c!calculate}% - {\clf_setfieldcalculationset{\interactionparameter\c!calculate}}% - \doifelse{\interactionparameter\c!click}\v!yes - \settrue\setfalse\highlighthyperlinks - \doifelse{\interactionparameter\c!display}\v!new - \settrue\setfalse\gotonewwindow - \doifnot{\interactionparameter\c!page}\v!no + \ifempty{\interactionparameter\c!calculate}\else + \clf_setfieldcalculationset{\interactionparameter\c!calculate}% + \fi + \ifcstok{\interactionparameter\c!click}\v!yes + \highlighthyperlinks\conditionaltrue + \else + \highlighthyperlinks\conditionalfalse + \fi + \ifcstok{\interactionparameter\c!display}\v!new + \gotonewwindow\conditionaltrue + \else + \gotonewwindow\conditionalfalse + \fi + \ifcstok{\interactionparameter\c!page}\v!no\else \scrn_reference_enable_page_destinations + \fi \to \everysetupinteraction \def\scrn_reference_enable_page_destinations % no reset diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt index f2112aa1171..7ec142804fa 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt @@ -47,8 +47,7 @@ local texgetcount = tex.getcount local codeinjections = backends.codeinjections local nodeinjections = backends.nodeinjections -local variables = interfaces.variables -local v_auto = variables.auto +local v_auto = interfaces.variables.auto local trace_attachments = false trackers.register("widgets.attachments", function(v) trace_attachments = v end) @@ -280,6 +279,8 @@ implement { local collected = allocate() local tobesaved = allocate() +local c_realpageno = tex.iscount("realpageno") + local linkedlists = { collected = collected, tobesaved = tobesaved, @@ -311,7 +312,7 @@ implement { linkedlist = { } tobesaved[tag] = linkedlist end - linkedlist[n] = texgetcount("realpageno") + linkedlist[n] = texgetcount(c_realpageno) end } diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx index 382635882e6..5b79e041d61 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx @@ -100,10 +100,10 @@ \mutable\lettonothing\currentattachmentsymbol \mutable\lettonothing\currentattachmentwidth -\permanent\tolerant\protected\def\registerattachment[#tag]#spacer[#settings]% we save (globally) at the lua end +\permanent\tolerant\protected\def\registerattachment[#tag]#spacer[#S#settings]% we save (globally) at the lua end {\ifarguments\else \begingroup - \def\currentattachment{_}% + \cdef\currentattachment{_}% \setupcurrentattachment[#settings,\s!parent=\??attachment]% \clf_registerattachment tag {#tag}% @@ -120,17 +120,17 @@ \fi} \appendtoks - \frozen\instance\setuevalue \currentattachment {\scrn_attachment_direct[\currentattachment]}% - \frozen\instance\setuevalue{\e!start\currentattachment}{\scrn_attachment_start [\currentattachment]}% - \frozen\instance\setuevalue{\e!stop \currentattachment}{\scrn_attachment_stop }% + \frozen\instance\protected\edefcsname \currentattachment\endcsname{\scrn_attachment_direct[\currentattachment]}% + \frozen\instance\protected\edefcsname\e!start\currentattachment\endcsname{\scrn_attachment_start [\currentattachment]}% + \frozen\instance\protected\edefcsname\e!stop \currentattachment\endcsname{\scrn_attachment_stop }% \to \everydefineattachment -\permanent\tolerant\protected\def\scrn_attachment_direct[#tag]#spacer[#registered]#spacer[#settings]% +\permanent\tolerant\protected\def\scrn_attachment_direct[#tag]#spacer[#registered]#spacer[#S#settings]% {\iflocation \bgroup - \edef\currentattachment{#tag}% + \cdef\currentattachment{#tag}% \ifcstok{\attachmentparameter\c!state}\v!start - \iftok{#registered}\emptytoks + \ifempty{#registered}% \scrn_attachment_inject[\v!auto][]% \orelse\ifhastok={#registered}% \scrn_attachment_inject[\v!auto][#registered]% @@ -141,8 +141,8 @@ \egroup \fi} -\tolerant\protected\def\scrn_attachment_start[#tag]#spacer[#registered]#spacer[#settings]% - {\edef\currentattachment{#tag}% +\tolerant\protected\def\scrn_attachment_start[#tag]#spacer[#registered]#spacer[#S#settings]% + {\cdef\currentattachment{#tag}% \unless\iflocation \expandafter\scrn_attachment_start_ignore \orelse\ifcstok{\attachmentparameter\c!state}\v!start @@ -154,19 +154,21 @@ \protected\def\scrn_attachment_stop {} -\def\scrn_attachment_start_indeed[#registered][#settings]% +\def\scrn_attachment_start_indeed[#registered][#S#settings]% {\bgroup - \doifelsenothing{#registered} - {\def\scrn_attachment_stop{\scrn_attachment_inject[\v!auto][\c!buffer=\v!attachment]\egroup}}% - {\doifelseassignment{#registered} - {\def\scrn_attachment_stop{\scrn_attachment_inject[\v!auto][\c!buffer=\v!attachment,#registered]\egroup}}% - {\def\scrn_attachment_stop{\scrn_attachment_inject[#registered][\c!buffer=\v!attachment,#settings]\egroup}}}% + \ifempty{#registered}% + \def\scrn_attachment_stop{\scrn_attachment_inject[\v!auto][\c!buffer=\v!attachment]\egroup}% + \else + \doifelseassignment{#registered} + {\def\scrn_attachment_stop{\scrn_attachment_inject[\v!auto][\c!buffer=\v!attachment,#registered]\egroup}}% + {\def\scrn_attachment_stop{\scrn_attachment_inject[#registered][\c!buffer=\v!attachment,#settings]\egroup}}% + \fi \grabbufferdatadirect\v!attachment{\e!start\currentattachment}{\e!stop\currentattachment}} \def\scrn_attachment_start_ignore - {\expandafter\gobbleuntil\csname\e!stop\currentattachment\endcsname} + {\expandafter\ignoreupto\csname\e!stop\currentattachment\endcsname} -\def\scrn_attachment_inject[#registered][#settings]% +\def\scrn_attachment_inject[#registered][#S#settings]% {\edef\currentattachmentregistered{#registered}% \setupattachment[\currentattachment][#settings]% \expandnamespaceparameter\??attachmentmethod\attachmentparameter\c!method\v!normal} @@ -414,9 +416,9 @@ \frozen\protected\instance\edefcsname\e!stop \currentcomment\endcsname{\scrn_comment_stop }% \to \everydefinecomment -\tolerant\protected\def\scrn_comment_argument[#category]#spacer[#title]#spacer[#settings]#:#text%% +\tolerant\protected\def\scrn_comment_argument[#category]#spacer[#title]#spacer[#S#settings]#:#text%% {\iflocation - \def\currentcomment{#category}% + \cdef\currentcomment{#category}% \ifcstok{\commentparameter\c!state}\v!start \ifhastok={#title} \setupcurrentcomment[#title]% @@ -429,8 +431,8 @@ \fi \ignorespaces} -\tolerant\protected\def\scrn_comment_start[#category]#spacer[#title]#spacer[#settings]% - {\def\currentcomment{#category}% +\tolerant\protected\def\scrn_comment_start[#category]#spacer[#title]#spacer[#S#settings]% + {\cdef\currentcomment{#category}% \unless\iflocation \expandafter\scrn_comment_start_ignore \orelse\ifcstok{\commentparameter\c!state}\v!start @@ -439,7 +441,7 @@ \expandafter\scrn_comment_start_ignore \fi[#title][#settings]} -\def\scrn_comment_start_indeed[#title][#settings]% +\def\scrn_comment_start_indeed[#title][#S#settings]% {\bgroup \doifelseassignment{#title} {\setupcurrentcomment[#title]} @@ -448,7 +450,7 @@ \grabbufferdatadirect\v!comment{\e!start\currentcomment}{\e!stop\currentcomment}} \def\scrn_comment_start_ignore - {\expandafter\gobbleuntil\csname\e!stop\currentcomment\endcsname} + {\expandafter\ignoreupto\csname\e!stop\currentcomment\endcsname} \protected\def\scrn_comment_stop {} diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt index a8856f14877..d558faa8c51 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt @@ -26,17 +26,15 @@ local attributes = attributes local nodes = nodes local context = context -local nodecodes = nodes.nodecodes - local implement = interfaces.implement -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue +local glyph_code = nodes.nodecodes.glyph +local glue_code = nodes.nodecodes.glue local emwidths = fonts.hashes.emwidths local exheights = fonts.hashes.exheights -local a_script = attributes.private('script') +local a_script = attributes.private('script') local fontdata = fonts.hashes.identifiers local allocate = utilities.storage.allocate @@ -57,7 +55,7 @@ local setglyphdata = nuts.setglyphdata local isglyph = nuts.isglyph -local firstglyph = nuts.firstglyph +local firstglyphnode = nuts.firstglyphnode local nextglyph = nuts.traversers.glyph local nextchar = nuts.traversers.char @@ -349,7 +347,7 @@ local function traced_process(head,first,last,process,a) end function scripts.injectors.handler(head) - local start = firstglyph(head) -- we already have glyphs here (subtype 1) + local start = firstglyphnode(head) -- we already have glyphs here (subtype 1) if not start then return head else diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl index 99f064accff..9914dd29d37 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl @@ -58,11 +58,11 @@ % presets are global and are currently defined in lua % \appendtoks -% \setuevalue\currentscript{\setscript[\currentscript]}% +% \frozen\instance\protected\edefcsname\currentscript\endcsname{\setscript[\currentscript]}% % \to \everydefinescript \permanent\protected\def\setlocalscript[#1]% - {\edef\currentscript{#1}% + {\cdef\currentscript{#1}% \clf_setscript{\currentscript}{\scriptparameter\c!method}{\scriptparameter\c!preset}} \permanent\protected\def\setglobalscript[#1]% @@ -98,7 +98,11 @@ \appendtoks \ifempty\currentscript - \doifelse{\scriptparameter\s!features}\v!auto\enableautofontscript\disableautofontscript + \ifcstok{\scriptparameter\s!features}\v!auto + \enableautofontscript + \else + \disableautofontscript + \fi \fi \to \everysetupscript diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt index 0eeda643aaf..1f34b7e11af 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt @@ -22,17 +22,17 @@ local takeattr = nuts.takeattr local getwidth = nuts.getwidth local findtail = nuts.tail -local righttoleft_code = tex.directioncodes.righttoleft +local righttoleft_code = tex.directioncodes.righttoleft -local linelist_code = nodes.listcodes.line +local linelist_code = nodes.listcodes.line local hpack_nodes = nuts.hpack local nextlist = nuts.traversers.list local new_stretch = nuts.pool.stretch -local a_realign = attributes.private("realign") -local c_realpageno = tex.iscount("realpageno") +local a_realign = attributes.private("realign") +local c_realpageno = tex.iscount("realpageno") local texsetattribute = tex.setattribute local texgetcount = tex.getcount diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl index 9d9feab9b17..94fe44b2622 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl @@ -71,9 +71,9 @@ % This will become a more advanced layout controller soon: -\newconditional\layoutlefttoright \settrue\layoutlefttoright -\newconditional\displaylefttoright \settrue\displaylefttoright -\newconditional\inlinelefttoright \settrue\inlinelefttoright +\newconditional\layoutlefttoright \layoutlefttoright\conditionaltrue +\newconditional\displaylefttoright \displaylefttoright\conditionaltrue +\newconditional\inlinelefttoright \inlinelefttoright\conditionaltrue \permanent\protected\def\lefttoright {\ifvmode @@ -90,24 +90,24 @@ \fi} \protected\def\spac_directions_lefttoright_vmode - {\settrue\displaylefttoright - \settrue\inlinelefttoright + {\displaylefttoright\conditionaltrue + \inlinelefttoright\conditionaltrue \textdirection\directionlefttoright \pardirection \directionlefttoright} \protected\def\spac_directions_righttoleft_vmode - {\setfalse\displaylefttoright - \setfalse\inlinelefttoright + {\displaylefttoright\conditionalfalse + \inlinelefttoright\conditionalfalse \textdirection\directionrighttoleft \pardirection \directionrighttoleft} \protected\def\spac_directions_lefttoright_hmode {\linedirection\directionlefttoright % linedir keeps subtype of skip - \settrue\inlinelefttoright} + \inlinelefttoright\conditionaltrue} \protected\def\spac_directions_righttoleft_hmode {\linedirection\directionrighttoleft % linedir keeps subtype of skip - \setfalse\inlinelefttoright} + \inlinelefttoright\conditionalfalse} \permanent\protected\def\synchronizelayoutdirection {\ifconditional\layoutlefttoright @@ -124,12 +124,12 @@ \fi} \def\spac_directions_synchronize_lr - {\settrue\inlinelefttoright + {\inlinelefttoright\conditionaltrue \textdirection\directionlefttoright \pardirection \directionlefttoright} \def\spac_directions_synchronize_rl - {\setfalse\inlinelefttoright + {\inlinelefttoright\conditionalfalse \textdirection\directionrighttoleft \pardirection \directionrighttoleft} @@ -202,7 +202,10 @@ \ifdefined\nohyphens \else \let\nohyphens \relax \fi \ifdefined\dohyphens \else \let\dohyphens \relax \fi -\newconstant\c_spac_tolerance_default \c_spac_tolerance_default 1500 % shouldn't that be 200 +% \pretolerance 100 +% \tolerance 200 + +\newconstant\c_spac_tolerance_default \c_spac_tolerance_default 200 \newconstant\c_spac_tolerance_minimum \c_spac_tolerance_minimum 1500 \newconstant\c_spac_tolerance_normal \c_spac_tolerance_normal 3000 \newconstant\c_spac_tolerance_extreme \c_spac_tolerance_extreme 4500 @@ -243,6 +246,7 @@ % Vertical \newconstant\c_spac_align_state_vertical +\newconstant\c_spac_align_state_spread \protected\def\spac_align_set_vertical_none {\enforced\let\raggedtopcommand \relax @@ -269,7 +273,13 @@ \spac_align_set_vertical_low \or \spac_align_set_vertical_high - \fi} + \fi + \baselineskip + 1\baselineskip + \ifcase\c_spac_align_state_spread\else + \s!plus \onepoint + \fi + \relax} % Horizontal @@ -278,7 +288,7 @@ \fi % \appendtoks -% \setfalse\raggedonelinerstate +% \raggedonelinerstate\conditionalfalse % \to \everyforgetall \newconstant\raggedstatus % public @@ -297,8 +307,9 @@ \let\v_spac_align_space_amount \interwordspace \def\v_spac_align_space_amount_x {.5\emwidth} -\newgluespec\s_zero_plus_one_fil \s_zero_plus_one_fil = 0pt plus 1fil -\newgluespec\s_zero_plus_zero \s_zero_plus_zero = 0pt plus 0pt +\newgluespec\s_zero_plus_one_fil \s_zero_plus_one_fil = 0pt plus 1fil +\newgluespec\s_zero_plus_one_fill \s_zero_plus_one_fill = 0pt plus 1fill +\newgluespec\s_zero_plus_zero \s_zero_plus_zero = 0pt plus 0pt % \s!plus ... slower than inline @@ -307,13 +318,13 @@ \c_attr_alignstate\attributeunsetvalue \leftskip \plusone\leftskip \rightskip \plusone\rightskip - \spaceskip \zeropoint - \xspaceskip \zeropoint - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_one_fil % new - \setfalse \raggedonelinerstate % now here + \spaceskip \zeroskip + \xspaceskip \zeroskip + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \s_zero_plus_one_fil % new + \raggedonelinerstate\conditionalfalse % now here \enforced\aliased\let\updateraggedskips\relax} % no need for adaption \permanent\protected\def\spac_align_set_horizontal_left @@ -324,10 +335,13 @@ \rightskip \plusone\rightskip\s!plus\zeropoint \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_zero + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + % \parfillleftskip \zeroskip + % \parfillrightskip \s_zero_plus_zero + % needs testing: + \parfillleftskip \s_zero_plus_one_fil + \parfillrightskip \zeroskip \parindent \zeropoint \relax} @@ -339,10 +353,10 @@ \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_middle \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_zero + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \s_zero_plus_zero \parindent \zeropoint \relax} @@ -354,10 +368,10 @@ \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_one_fil + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \s_zero_plus_one_fil %\parindent \parindent \relax} @@ -368,10 +382,13 @@ \rightskip \plusone\rightskip\s!plus\zeropoint \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_zero + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + % \parfillleftskip \zeroskip + % \parfillrightskip \s_zero_plus_zero + % needs testing: + \parfillleftskip \s_zero_plus_zero + \parfillrightskip \zeroskip \parindent \zeropoint \relax} @@ -382,10 +399,10 @@ \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_zero + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \s_zero_plus_zero \parindent \zeropoint \relax} @@ -396,10 +413,10 @@ \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_zero + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \s_zero_plus_zero %\parindent \parindent \relax} @@ -411,10 +428,10 @@ \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_half \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_zero + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \s_zero_plus_zero \parindent \zeropoint \relax} @@ -423,12 +440,12 @@ \c_attr_alignstate\attributeunsetvalue \leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax - \spaceskip \zeropoint - \xspaceskip \zeropoint - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \zeropoint\s!plus\v_spac_align_fill_amount_double\relax + \spaceskip \zeroskip + \xspaceskip \zeroskip + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \zeropoint\s!plus\v_spac_align_fill_amount_double\relax \parindent \zeropoint \relax} @@ -437,12 +454,12 @@ \c_attr_alignstate\attributeunsetvalue \leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax - \spaceskip \zeropoint - \xspaceskip \zeropoint - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillskip \zeropoint + \spaceskip \zeroskip + \xspaceskip \zeroskip + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip \parfillleftskip \zeropoint\s!plus\v_spac_align_fill_amount_extreme\relax + \parfillrightskip \zeroskip \parindent \zeropoint \relax} @@ -452,12 +469,12 @@ \c_attr_alignstate\plusthree \leftskip \plusone\leftskip \s!plus\zeropoint\relax \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right\relax - \spaceskip \zeropoint - \xspaceskip \zeropoint - \parinitleftskip \zeropoint - \parinitrightskip \zeropoint - \parfillleftskip \zeropoint - \parfillskip \s_zero_plus_zero + \spaceskip \zeroskip + \xspaceskip \zeroskip + \parinitleftskip \zeroskip + \parinitrightskip \zeroskip + \parfillleftskip \zeroskip + \parfillrightskip \s_zero_plus_zero %\parindent \parindent \relax} @@ -467,12 +484,12 @@ \c_attr_alignstate\plustwo \leftskip \plusone\leftskip \s!plus\spac_align_set_raggedness_middle \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_middle - \spaceskip \zeropoint - \xspaceskip \zeropoint - \parinitleftskip \zeropoint + \spaceskip \zeroskip + \xspaceskip \zeroskip + \parinitleftskip \zeroskip \parinitrightskip \zeropoint\s!plus\v_spac_align_fill_amount_extreme\relax \parfillleftskip \zeropoint\s!plus\v_spac_align_fill_amount_extreme\relax - \parfillskip \zeropoint + \parfillrightskip \zeroskip \parindent \zeropoint \relax} @@ -495,14 +512,24 @@ \or % 2 flush left \ifcase\c_spac_align_state_broad - \spac_align_set_horizontal_right + \ifcase\c_spac_align_state_tight + \spac_align_set_horizontal_right + \else + \spac_align_set_horizontal_center + \leftskip1\leftskip + \fi \else \spac_align_set_horizontal_very_right \fi \or % 3 flush right \ifcase\c_spac_align_state_broad - \spac_align_set_horizontal_left + \ifcase\c_spac_align_state_tight + \spac_align_set_horizontal_left + \else + \spac_align_set_horizontal_center + \rightskip1\rightskip + \fi \else \spac_align_set_horizontal_very_left \fi @@ -525,7 +552,8 @@ \else \spac_align_set_horizontal_very_right \fi - \parfillskip\zeropoint + %\parfillleftskip \zeroskip + \parfillrightskip\zeroskip \or % 7 centered last line \spac_align_set_horizontal_centered_last_line @@ -534,10 +562,17 @@ \spac_align_set_horizontal_flushedright_last_line \or % 9 paragraph - \parfillskip\zeropoint + %\parfillleftskip \zeroskip + \parfillrightskip\zeroskip \or % 10 slanted \spac_align_set_horizontal_slanted + \or + % 11 hangleft + \spac_align_set_horizontal_hang_left + \or + % 12 hangright + \spac_align_set_horizontal_hang_right \fi \relax} @@ -545,9 +580,9 @@ \newconstant\c_spac_align_state_page -\mutable\def\bottomalignlimit{\plusthree\lineheight} +% \mutable\def\bottomalignlimit{\plusthree\lineheight} -\newconstant\bottomraggednessmode % 0=ragged 1=normal/align 2=baseline +\newconstant\bottomraggednessmode % 0=ragged 1=normal/align 2=baseline 3=depth 4=weird-line \permanent\protected\def\raggedbottom {\bottomraggednessmode\zerocount @@ -561,6 +596,10 @@ {\bottomraggednessmode\plustwo \settopskip} +\permanent\protected\def\depthlinebottom + {\bottomraggednessmode\plusthree + \settopskip} + \aliased\let\normalbottom\alignbottom % downward compatible \permanent\protected\def\setbottomalignmode#1% @@ -576,6 +615,8 @@ \alignbottom \or \baselinebottom + \or + \depthlinebottom \fi} % Directions @@ -591,11 +632,26 @@ \righttoleft \fi} +% Trick + +%D \starttyping +%D \framed[width=5.5cm,align={flushleft}] {This is a test sentence to see if it aligns okay.} +%D \framed[width=5.5cm,align={flushright}] {This is a test sentence to see if it aligns okay.} +%D \framed[width=5.5cm,align={flushleft,tight}] {This is a test sentence to see if it aligns okay.} +%D \framed[width=5.5cm,align={flushright,tight}]{This is a test sentence to see if it aligns okay.} +%D \framed[width=5.5cm,align={flushleft,broad}] {This is a test sentence to see if it aligns okay.} +%D \framed[width=5.5cm,align={flushright,broad}]{This is a test sentence to see if it aligns okay.} +%D \stoptyping + +\newconstant\c_spac_align_state_tight + % Interesting is that the non cached version is also pretty efficient % and as we cache we seldom call that one now so one can debate the % speedup. \newtoks\t_spac_align_collected +\newtoks\t_spac_align_applied +\newtoks\t_spac_align_presets \aliased\let\raggedcommand \relax \aliased\let\updateraggedskips\relax @@ -603,53 +659,42 @@ \def\spac_align_add_to_cache {\enforced\let\raggedbox\relax % why % we inherit hyphenation and tolerance - \t_spac_align_collected \emptytoks - \c_spac_align_state_broad \zerocount - \c_spac_align_state_horizontal\zerocount - \c_spac_align_state_vertical \zerocount - \c_spac_align_state_direction \zerocount % what is default ? - \c_spac_align_state_page \zerocount - \c_spac_align_state_par_fill \zerocount + \expand\t_spac_align_presets +% \lastlinefit\zerocount \ifcsname\??aligncommand\m_spac_align_named\endcsname \lastnamedcs \else \rawprocesscommacommand[\m_spac_align_asked]\spac_align_collect \fi - % % kept, nice for tracing - % - % \normalexpanded{\t_spac_align_collected - % {\setfalse\raggedonelinerstate % bad - % \the\t_spac_align_collected - % \spac_align_flush_horizontal - % \spac_align_flush_vertical - % \spac_align_flush_direction - % \spac_align_flush_page - % \spac_align_flush_parfill - % }}% - % - % \etoksapp\t_spac_align_collected - % {\spac_align_flush_horizontal - % \spac_align_flush_vertical - % \spac_align_flush_direction - % \spac_align_flush_page - % \spac_align_flush_parfill}% - % \etokspre\t_spac_align_collected - % {\setfalse\raggedonelinerstate}% bad - % - \etoks\t_spac_align_collected - {\setfalse\raggedonelinerstate % bad - \the\t_spac_align_collected - \spac_align_flush_horizontal - \spac_align_flush_vertical - \spac_align_flush_direction - \spac_align_flush_page - \spac_align_flush_parfill}% - % - \enforced\permanent\protected\edef\raggedcommand {\the\t_spac_align_collected }% + \etoks\t_spac_align_collected + {\raggedonelinerstate\conditionalfalse % bad + \expand\t_spac_align_collected + \expand\t_spac_align_applied}% + \enforced\permanent\protected\edef\raggedcommand {\expand\t_spac_align_collected}% \enforced\permanent\protected\edef\updateraggedskips{\spac_align_flush_horizontal}% \enforced\aliased\gletcsname\??alignmentnormalcache\m_spac_align_named\endcsname\raggedcommand \enforced\aliased\gletcsname\??alignmentraggedcache\m_spac_align_named\endcsname\updateraggedskips} +\appendtoks + \spac_align_flush_horizontal + \spac_align_flush_vertical + \spac_align_flush_direction + \spac_align_flush_page + \spac_align_flush_parfill +\to \t_spac_align_applied + +\appendtoks + \t_spac_align_collected \emptytoks + \c_spac_align_state_broad \zerocount + \c_spac_align_state_horizontal\zerocount + \c_spac_align_state_vertical \zerocount + \c_spac_align_state_spread \zerocount + \c_spac_align_state_direction \zerocount % what is default ? + \c_spac_align_state_tight \zerocount + \c_spac_align_state_page \zerocount + \c_spac_align_state_par_fill \zerocount +\to \t_spac_align_presets + \mutable\def\m_spac_align_named{\m_spac_align_asked} \def\spac_align_collect#1% @@ -737,14 +782,17 @@ \defcsname\??aligncommand\v!bottom \endcsname{\c_spac_align_state_page \plusone } \defcsname\??aligncommand\v!height \endcsname{\c_spac_align_state_page \plustwo } +\defcsname\??aligncommand\v!depth \endcsname{\c_spac_align_state_page \plusfour } \defcsname\??aligncommand\v!line \endcsname{\c_spac_align_state_page \plusthree % this will become another keyword (undocumented anyway) - \toksapp\t_spac_align_collected{\settrue\raggedonelinerstate}} + \toksapp\t_spac_align_collected{\raggedonelinerstate\conditionaltrue}} \defcsname\??aligncommand\v!high \endcsname{\c_spac_align_state_vertical \plusthree} \defcsname\??aligncommand\v!low \endcsname{\c_spac_align_state_vertical \plustwo } \defcsname\??aligncommand\v!lohi \endcsname{\c_spac_align_state_vertical \plusone } +\defcsname\??aligncommand\v!spread \endcsname{\c_spac_align_state_spread \plusone } + \defcsname\??aligncommand\v!flushright \endcsname{\c_spac_align_state_horizontal\plusthree} \defcsname\??aligncommand\v!flushleft \endcsname{\c_spac_align_state_horizontal\plustwo } \defcsname\??aligncommand\v!middle \endcsname{\c_spac_align_state_horizontal\plusone } @@ -772,6 +820,7 @@ \defcsname\??aligncommand l2r\endcsname{\c_spac_align_state_direction \plusone } \defcsname\??aligncommand r2l\endcsname{\c_spac_align_state_direction \plustwo } +\defcsname\??aligncommand\v!tight \endcsname{\c_spac_align_state_tight \plusone} \defcsname\??aligncommand\v!slanted \endcsname{\c_spac_align_state_horizontal\plusten \c_spac_align_state_broad \plustwo } @@ -815,12 +864,24 @@ \defcsname\??aligncommand 1*\v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plusone}} \defcsname\??aligncommand 2*\v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plustwo}} -%defcsname\??aligncommand ...\endcsname{\toksapp\t_spac_align_collected{\nopenalties}} -%defcsname\??aligncommand ...\endcsname{\toksapp\t_spac_align_collected{\setdefaultpenalties}} +% for verbatim overflow + +\defcsname\??aligncommand\v!hangleft \endcsname{\c_spac_align_state_horizontal\pluseleven} +\defcsname\??aligncommand\v!hangright \endcsname{\c_spac_align_state_horizontal\plustwelve} + +\permanent\protected\def\spac_align_set_horizontal_hang_right + {\spac_align_set_horizontal_very_left + \parinitrightskip\s_zero_plus_one_fill + \relax} + +\permanent\protected\def\spac_align_set_horizontal_hang_left + {\spac_align_set_horizontal_very_right + \parinitleftskip \s_zero_plus_one_fill + \relax} % experiment -\defcsname\??aligncommand \v!flushforward\endcsname{\c_spac_align_state_horizontal\ifconditional\inlinelefttoright\plustwo\else\plusthree\fi} +\defcsname\??aligncommand\v!flushforward \endcsname{\c_spac_align_state_horizontal\ifconditional\inlinelefttoright\plustwo\else\plusthree\fi} \defcsname\??aligncommand\v!flushbackward\endcsname{\c_spac_align_state_horizontal\ifconditional\inlinelefttoright\plusthree\else\plustwo\fi} % experiment @@ -831,15 +892,78 @@ \defcsname\??aligncommand\v!profile\endcsname{\toksapp\t_spac_align_collected{\setmainlineprofile}} +% lastlinefit + +\newconstant\c_spac_align_state_fit + +\defcsname\??aligncommand\v!fit\endcsname + {\c_spac_align_state_fit\plusone} + +\appendtoks + \c_spac_align_state_fit\zerocount +\to \t_spac_align_presets + +\appendtoks + \lastlinefit\ifcase\c_spac_align_state_fit\zerocount\else\plusthousand\fi +\to \t_spac_align_applied + +% linebreakcriterion + +\immutable\integerdef\defaultdoublehyphendemerits 10000 +\immutable\integerdef\defaultfinalhyphendemerits 5000 +\immutable\integerdef\defaultadjdemerits 10000 +\immutable\integerdef\defaultorphanpenalty 0 +\immutable\integerdef\defaultlinebreakcriterion 0 % 12 12 12 99 : 0C0C0C63 + +\immutable\integerdef\granularadjdemerits 5000 % maybe 2500 +\immutable\integerdef\granularlinebreakcriterion "020C2A63 % 2 12 42 99 + +\frozen\doublehyphendemerits\defaultdoublehyphendemerits +\frozen\finalhyphendemerits \defaultfinalhyphendemerits +\frozen\adjdemerits \defaultadjdemerits +\frozen\linebreakcriterion \defaultlinebreakcriterion +\frozen\orphanpenalty \defaultorphanpenalty + +% better but incompatible: +% +% \frozen\adjdemerits \optimaladjdemerits +% \frozen\linebreakcriterion \optimallinebreakcriterion + +\newconstant\c_spac_align_state_granular + +\defcsname\??aligncommand\v!granular\endcsname % no way to reset it .. todo: \everyresetalign + {\c_spac_align_state_granular\plusone} + +\appendtoks + \c_spac_align_state_granular\zerocount +\to \t_spac_align_presets + +% \doubleadjdemerits: when zero it defaults to \adjdemerits + +\appendtoks + \ifcase\c_spac_align_state_granular + \adjdemerits \defaultadjdemerits + \doubleadjdemerits \defaultadjdemerits + \linebreakcriterion\defaultlinebreakcriterion + \else + \adjdemerits \granularadjdemerits +% \doubleadjdemerits 100000 + \doubleadjdemerits \defaultadjdemerits + \linebreakcriterion\granularlinebreakcriterion + \fi +\to \t_spac_align_applied + +% end of definitions + \definehspace [\v!final] [\emspaceamount] \def\spac_align_flush_parfill {\ifcase\c_spac_align_state_par_fill\else - \spac_align_flush_parfill_indeed{\number\c_spac_align_state_par_fill}% + \spac_align_flush_parfill_indeed{\the\c_spac_align_state_par_fill}% \fi} \protected\def\spac_align_flush_parfill_indeed#1% - {\parfillskip + {\parfillrightskip #1\directhspaceamount\v!final % plus \dimexpr\availablehsize-#1\directhspaceamount\v!final\relax plus 1fill @@ -855,7 +979,7 @@ \to \t_spac_every_swap_align \permanent\protected\def\enablereversealignment - {\the\t_spac_every_swap_align + {\expand\t_spac_every_swap_align \t_spac_every_swap_align\emptytoks} % Visible commands: @@ -956,8 +1080,8 @@ \defcsname\??alignhorizontal\v!flushright\endcsname{\enforced\let\raggedbox\spac_align_horizontal_flushright} \defcsname\??alignhorizontal\v!center \endcsname{\enforced\let\raggedbox\spac_align_horizontal_center} -% The next one can be in use so we keep it around but one should -% be aware of possible interference. +% The next one can be in use so we keep it around but one should be aware of +% possible interference. But it will be removed at some point! \permanent\protected\def\setraggedskips#1#2#3#4#5#6#7% never change this name (todo: inline this one .. less tracingall) {\enforced\permanent\protected\def\updateraggedskips{\dosetraggedskips{#1}{#2}{#3}{#4}{#5}{#6}{#7}}% @@ -982,7 +1106,9 @@ \def\spac_show_par_data#1% {\ifrelax#1\else - \hbox{\string#1: \the#1}\endgraf + \ifzero#1\else + \hbox{\string#1: \the#1}\endgraf + \fi \expandafter\spac_show_par_data \fi} @@ -994,17 +1120,19 @@ \hsize \vsize \leftskip \rightskip \spaceskip \xspaceskip - \parindent \parfillskip + \parindent \parfillleftskip \parinitrightskip \parinitleftskip \parfillrightskip \hyphenpenalty \exhyphenpenalty \automatichyphenpenalty \explicithyphenpenalty \displaywidowpenalty \widowpenalty \clubpenalty \brokenpenalty - \doublehyphendemerits \finalhyphendemerits \adjdemerits + \doublehyphendemerits \finalhyphendemerits \adjdemerits \orphanpenalty + \linebreakcriterion \relax}}}}} \permanent\protected\def\startshowpardata {\begingroup \showstruts \tracingparagraphs\maxdimen - \appendtoksonce\showpardata\to\everypar} + \enforced\let\startshowpardata\begingroup + \toksapp\everypar{\showpardata}} \permanent\protected\def\stopshowpardata {\endgraf @@ -1044,9 +1172,9 @@ \dowithnextbox {\hbox to \localhsize {\ifcase\alignstrutmode\or\strut\fi - \the\everyleftofalignedline + \expand\everyleftofalignedline #1\unhbox\nextbox#2\relax - \the\everyrightofalignedline}% + \expand\everyrightofalignedline}% \endgroup} \hbox} @@ -1119,10 +1247,10 @@ {\hbox to \localhsize {#1\hskip\ifdone#2\else#3\fi#4% \hbox to \localhsize - {\the\everyleftofalignedline + {\expand\everyleftofalignedline \ifcase\alignstrutmode\or\strut\fi \ifdone#5\unhbox\nextbox#6\else#6\unhbox\nextbox#5\fi - \the\everyrightofalignedline}% + \expand\everyrightofalignedline}% \hss}% \endgroup} \hbox} @@ -1156,46 +1284,30 @@ % beware: \wordright{whatever\kern-\rightskip} should work! % so, no funny boxing here -%D We need to pick up a box (downward compatible in case \type {\bgroup} -%D is used (test suite index example). +%D We need to pick up a box (downward compatible in case \type {\bgroup} is used +%D (test suite index example). \permanent\tolerant\protected\def\wordright[#1]% {\dowithnextbox {\normalexpanded{\spac_word_right_indeed{#1}{\hpack{\thebox\nextbox}}}} \hbox} -% \protected\def\spac_word_right_indeed#1#2% -% {\registerparwrapper -% {\v!word:\v!right} -% {\begingroup -% \frozen\parfillskip \zeropoint -% \frozen\finalhyphendemerits\zerocount -% \endgroup} -% {\doifelseparwrapper{\v!word:\v!right}% -% {\doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}% -% \strut \removeunwantedspaces -% \hfill -% \allowbreak % changed back from \hskip\zeropoint -% \quad}% -% {\allowbreak % changed back from \hskip\zeropoint -% \break}% -% \unregisterparwrapper{\v!word:\v!right}% -% \strut -% \hfill -% \nobreak -% #2% -% \allowbreak}} - \protected\def\spac_word_right_indeed#1#2% {\registerparwrapper {\v!word:\v!right} {\begingroup - \frozen\parfillskip \zeropoint - \frozen\finalhyphendemerits\zerocount + \frozen\parfillrightskip \zeroskip % frozen ? + \frozen\finalhyphendemerits\zerocount % frozen ? \endgroup} {\doifelseparwrapper{\v!word:\v!right}{\unregisterparwrapper{\v!word:\v!right}}\donothing \removeunwantedspaces - \doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}% + \ifcstok{#1}\v!right + \kern-\rightskip + \orelse\ifempty{#1}% + % no kern + \else + \kern-#1% + \fi \hfilll \discretionary{\strut}{\strut}{\strut}% \allowbreak % changed back from \hskip\zeropoint \hfilll @@ -1287,7 +1399,7 @@ \fi \fi} -\newconditional\alignsimplelefttoright \settrue\alignsimplelefttoright +\newconditional\alignsimplelefttoright \alignsimplelefttoright\conditionaltrue \permanent\protected\def\simplereversealignedbox#1#2% {\hbox \ifdim#1>\zeropoint to #1 diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-brk.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-brk.lmt new file mode 100644 index 00000000000..2cb4f980a7b --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-brk.lmt @@ -0,0 +1,236 @@ +if not modules then modules = { } end modules ['spac-brk'] = { + version = 1.001, + comment = "companion to spac-brk.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local next, type, tonumber, tostring = next, type, tonumber, tostring + +local settings_to_array = utilities.parsers.settings_to_array +local settings_to_hash = utilities.parsers.settings_to_hash + +local nuts = nodes.nuts +local tonut = nodes.tonut + +local newrule = nuts.pool.virtualrule +local insertbefore = nuts.insertbefore +local insertafter = nuts.insertafter +local hpack_string = nuts.typesetters.tohpack +local getwidth = nuts.getwidth +local getid = nuts.getid +local getprev = nuts.getprev +local getnext = nuts.getnext +local setwhd = nuts.setwhd +local getlist = nuts.getlist +local setoffsets = nuts.setoffsets + +local setcolor = nodes.tracers.colors.set +local settransparency = nodes.tracers.transparencies.set + +local texgetnest = tex.getnest +local texgetcount = tex.getcount + +local nodecodes = nodes.nodecodes + +local penalty_code = nodecodes.penalty +local glue_code = nodecodes.glue +local disc_code = nodecodes.disc +local kern_code = nodecodes.kern +local math_code = nodecodes.math + +local breakcodes = tex.breakcodes + +local registercallback = callback.register + +local c_tracinglousiness = tex.iscount("tracinglousiness") + +local alignments = { } +typesetters.alignments = alignments + +typesetters = typesetters or { } +local breakpoints = typesetters.breakpoints or { } +typesetters.breakpoints = breakpoints + +local width = 65536 / 2 +local height = 9 * 65536 +local depth = 3 * 65536 +local xoffset = 1 * 65536 +local yoffset = -3 * 65536 + +local serial = false +local usedfont = false +local nestlevel = false +local overload = false +local order = 0 + +local report = logs.reporter("linebreaks") + +local actions = { + [breakcodes.initialize] = function() + if texgetnest("ptr") == nestlevel then + usedfont = nodes.visualizers.getusedfont() + serial = false + order = order + 1 + end + end, + [breakcodes.start] = function(pass) + if texgetnest("ptr") == nestlevel then + if pass == 2 then + serial = { } + end + end + end, + [breakcodes.report] = function(pass,currentserial,previousserial,line,kind,class,demerits,breakpoint,short,glue) + if serial and breakpoint and texgetnest("ptr") == nestlevel then + local s = { + serial = currentserial, + demerits = demerits, + breakpoint = breakpoint, + } + serial[currentserial] = s + local found = overload and overload[currentserial] + if found then + report("pass %i, overloading serial %i.%i demerits from %i to %i",2,order,currentserial,demerits,found) + return found + end + end + return demerits + end, + [breakcodes.collect] = function() + if serial and texgetnest("ptr") == nestlevel and texgetcount(c_tracinglousiness) >= 1 then + for currentserial=1,#serial do + local data = serial[currentserial] + local breakpoint = data.breakpoint + local current = tonut(breakpoint) + while current do + local id = getid(current) + if id == penalty_code or id == glue_code or id == kern_code or id == math_code then + current = getprev(current) + else + break + end + end + if current then + local rule = newrule(width,height,depth,currentserial) + data.rule = rule + insertafter(current,current,rule) + end + end + end + end, + [breakcodes.wrapup] = function() + if serial and texgetnest("ptr") == nestlevel then + local n = #serial + local trace = texgetcount(c_tracinglousiness) + if trace >= 2 then + report("%i demerits in set %i",n,order) + end + for currentserial=1,n do + local data = serial[currentserial] + local demerits = data.demerits + if trace >= 1 then + local rule = data.rule + if rule then + local tag = tostring(order).."."..tostring(currentserial) + local text = hpack_string(tag,usedfont) + local size = getwidth(text) + setwhd(text,0,0,0) + setoffsets(text,-size-xoffset,yoffset) + insertafter(rule,rule,text) + end + end + serial[currentserial] = demerits + if trace >= 2 then + report("% 4i : %8i",currentserial,demerits) + end + end + overload = false + registercallback("show_break") + end + end, +} + +local function action(what,...) + local action = actions[what] + if action then + return action(...) + end +end + +local function show(str) + nestlevel = texgetnest("ptr") + if str and str ~= "" then + if type(str) == "table" then + overload = str + else + overload = settings_to_hash(str) + for k, v in next, overload do + overload[tonumber(k)] = tonumber(v) or -1 + end + end + else + overload = false + end + registercallback("show_break", action) +end + +local function last() + return serial or { } +end + +typesetters.breakpoints.show = show +typesetters.breakpoints.last = last + +-- interface + +local context = context +local scaninteger = tokens.scanners.integer + +local function feedback() + local l = last() + local n = #l + if n > 0 then + local t = { n } + local m = 1 + for i=1,#l do + m = m + 1 ; t[m] = i + m = m + 1 ; t[m] = l[i] + end + context("% t",t) + end +end + +interfaces.implement { + name = "lousiness", + public = true, + protected = true, + usage = "value", + actions = function(what) + if what == "value" then + feedback() + else + local n = scaninteger() + local t = { } + for i=1,n do + t[scaninteger()] = scaninteger() + end + show(t) + end + end, +} + +interfaces.implement { + name = "silliness", + public = true, + protected = true, + usage = "value", + actions = function(what) + if what == "value" then + feedback() + else + show { [scaninteger()] = 0 } + end + end, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-brk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-brk.mkxl new file mode 100644 index 00000000000..75ed48ef4df --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-brk.mkxl @@ -0,0 +1,43 @@ +%D \module +%D [ file=spac-brk, +%D version=2023.05.23, +%D title=\CONTEXT\ Spacing Macros, +%D subtitle=Breaking lines, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifdefined\tracinglousiness \endinput \fi + +\writestatus{loading}{ConTeXt Spacing Macros / Breakpoints} + +\newcount\tracinglousiness + +\registerctxluafile{spac-brk}{} + +\unprotect + +%D This is a very experimental feature and a by product of improving inline math +%D crossing lines. As it might evolve: use with care. + +\fetchmodulecommand \startshowbreakpoints {trac-brk} % {s-lines-show.mkxl} +%fetchmodulecommand \stopshowbreakpoints {trac-brk} % {s-lines-show.mkxl} % start needed anyway +%fetchmodulecommand \showbreakpoints {trac-brk} % {s-lines-show.mkxl} % idem, loops otherwise + +% \starttext +% \setupalign[verytolerant] +% \tracinglousiness1 +% % \tracinglousiness2 +% \hsize8cm \lousiness 0 \samplefile{ward} \blank +% {\tt \the\lousiness} \blank +% \hsize8cm \lousiness 1 11 0 \samplefile{ward} \blank +% \hsize8cm \silliness 11 \samplefile{ward} \blank +% \stoptext + +%D These macros are defined a the \LUA\ end. + +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt index 58071c431b8..82068be74f1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt @@ -40,6 +40,7 @@ local getlanguage = nuts.getlanguage local setchar = nuts.setchar local setattrlist = nuts.setattrlist local getfont = nuts.getfont +local getxscale = nuts.getxscale local isglyph = nuts.isglyph local setcolor = nodes.tracers.colors.set @@ -61,9 +62,9 @@ local new_rule = nodepool.rule local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue -local spaceskip_code = gluecodes.spaceskip +local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue +local spaceskip_code = gluecodes.spaceskip local chardata = characters.data local ispunctuation = characters.is_punctuation @@ -83,8 +84,8 @@ local fontquads = fonthashes.quads local setmetatableindex = table.setmetatableindex -local a_character = attributes.private("characters") -local a_alignstate = attributes.private("alignstate") +local a_character = attributes.private("characters") +local a_alignstate = attributes.private("alignstate") local c_zero = byte('0') local c_period = byte('.') @@ -93,7 +94,8 @@ local function inject_quad_space(unicode,head,current,fraction) if fraction ~= 0 then fraction = fraction * fontquads[getfont(current)] end - local glue = new_glue(fraction) + local scale = getxscale(current) + local glue = new_glue(scale * fraction) setattrlist(glue,current) setattrlist(current) -- why reset all setattr(glue,a_character,unicode) @@ -101,9 +103,10 @@ local function inject_quad_space(unicode,head,current,fraction) end local function inject_char_space(unicode,head,current,parent) - local font = getfont(current) - local char = fontcharacters[font][parent] - local glue = new_glue(char and char.width or fontparameters[font].space) + local font = getfont(current) + local char = fontcharacters[font][parent] + local scale = getxscale(current) + local glue = new_glue(scale * (char and char.width or fontparameters[font].space)) setattrlist(glue,current) setattrlist(current) -- why reset all setattr(glue,a_character,unicode) @@ -111,7 +114,8 @@ local function inject_char_space(unicode,head,current,parent) end local function inject_nobreak_space(unicode,head,current,space,spacestretch,spaceshrink) - local glue = new_glue(space,spacestretch,spaceshrink) + local scale = getxscale(current) + local glue = new_glue(scale*space,scale*spacestretch,scale*spaceshrink) local penalty = new_penalty(10000) setattrlist(glue,current) setattrlist(penalty,current) @@ -181,6 +185,16 @@ local nbsphash = { } setmetatableindex(nbsphash,function(t,k) return nbsphash[k] end) +local function inject_regular_space(head,current,font) + local p = fontparameters[font] + local s = getxscale(current) + return insertnodebefore(head,current,new_glue( + s * p.space, + s * p.spacestretch, + s * p.spaceshrink + )) +end + local methods = { -- The next one uses an attribute assigned to the character but still we @@ -205,8 +219,7 @@ local methods = { -- insert when valid character following local char, font = isglyph(next) if char and canhavespace[char] then - local p = fontparameters[font] - head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink)) + head, current = inject_regular_space(head,current,font) end end @@ -218,8 +231,7 @@ local methods = { if next then local char, font = isglyph(next) if char and not ispunctuation[char] then - local p = fontparameters[font] - head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink)) + head, current = inject_regular_space(head,current,font) end end return head, current @@ -305,11 +317,11 @@ local methods = { end, [0x202F] = function(head,current) -- narrownobreakspace - return inject_nobreak_space(0x202F,head,current,fontquads[getfont(current)]/8) + return inject_nobreak_space(0x202F,head,current,fontquads[getfont(current)]/8,0,0) end, [0x205F] = function(head,current) -- math thinspace - return inject_nobreak_space(0x205F,head,current,4*fontquads[getfont(current)]/18) + return inject_nobreak_space(0x205F,head,current,4*fontquads[getfont(current)]/18,0,0) end, -- The next one is also a bom so maybe only when we have glyphs around it diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl index ef63b2b8204..72d33f448cd 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl @@ -31,28 +31,28 @@ \pushoverloadmode -%immutable\edef\nobreakspace {\begingroup\setalignstateattribute\normalUchar"00A0\endgroup} % 1 = left -\immutable\edef\nobreakspace {\normalUchar"00A0} % space -\immutable\edef\softhyphen {\normalUchar"00AD} % softhyohen -\immutable\edef\enquad {\normalUchar"2000} % quad/2 -\immutable\edef\emquad {\normalUchar"2001} % quad -\immutable\edef\twoperemspace {\normalUchar"2002} % quad/2 +%immutable\edef\nobreakspace {\begingroup\setalignstateattribute\tocharacter"00A0\endgroup} % 1 = left +\immutable\edef\nobreakspace {\tocharacter"00A0} % space +\immutable\edef\softhyphen {\tocharacter"00AD} % softhyohen +\immutable\edef\enquad {\tocharacter"2000} % quad/2 +\immutable\edef\emquad {\tocharacter"2001} % quad +\immutable\edef\twoperemspace {\tocharacter"2002} % quad/2 % % "2003 % quad == \quad == \hskip\emwidth -\immutable\edef\threeperemspace {\normalUchar"2004} % quad/3 -\immutable\edef\fourperemspace {\normalUchar"2005} % quad/4 -%immutable\edef\fiveperemspace {\normalUchar"001E} % quad/5 (bonus) -\immutable\edef\sixperemspace {\normalUchar"2006} % quad/6 -\immutable\edef\figurespace {\normalUchar"2007} % width of zero -\immutable\edef\punctuationspace {\normalUchar"2008} % width of period -\immutable\edef\breakablethinspace {\normalUchar"2009} % quad/8 -\immutable\edef\hairspace {\normalUchar"200A} % quad/8 -\immutable\edef\zerowidthspace {\normalUchar"200B} % 0 -\immutable\edef\zerowidthnonjoiner {\normalUchar"200C} % 0 -\immutable\edef\zerowidthjoiner {\normalUchar"200D} % 0 -\immutable\edef\narrownobreakspace {\normalUchar"202F} % quad/8 -%immutable\edef\mediummathspace {\normalUchar"205F} % space/8 (math) -%immutable\edef\zerowidthnobreakspace{\normalUchar"FEFF} -%immutable\edef\fiveperemspace {\normalUchar"001E} +\immutable\edef\threeperemspace {\tocharacter"2004} % quad/3 +\immutable\edef\fourperemspace {\tocharacter"2005} % quad/4 +%immutable\edef\fiveperemspace {\tocharacter"001E} % quad/5 (bonus) +\immutable\edef\sixperemspace {\tocharacter"2006} % quad/6 +\immutable\edef\figurespace {\tocharacter"2007} % width of zero +\immutable\edef\punctuationspace {\tocharacter"2008} % width of period +\immutable\edef\breakablethinspace {\tocharacter"2009} % quad/8 +\immutable\edef\hairspace {\tocharacter"200A} % quad/8 +\immutable\edef\zerowidthspace {\tocharacter"200B} % 0 +\immutable\edef\zerowidthnonjoiner {\tocharacter"200C} % 0 +\immutable\edef\zerowidthjoiner {\tocharacter"200D} % 0 +\immutable\edef\narrownobreakspace {\tocharacter"202F} % quad/8 +%immutable\edef\mediummathspace {\tocharacter"205F} % space/8 (math) +%immutable\edef\zerowidthnobreakspace{\tocharacter"FEFF} +%immutable\edef\fiveperemspace {\tocharacter"001E} \immutable\protected\def\zerowidthnobreakspace{\penalty\plustenthousand\kern\zeropoint} \immutable\protected\def\fiveperemspace {\hskip\dimexpr\emwidth/5\relax} diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl index 729968c5de1..4e2f2e85125 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl @@ -60,7 +60,9 @@ \c!height=.72, \c!depth=.28, \c!top=1.0, - \c!ntop=\minusone, % >= 0 : times lineheight + %\c!ntop=\minusone, % >= 0 : times lineheight, otherwise 5 + %\c!ntop=\plusfive, % long time default + \c!ntop=\plustwo, % more reasonable, if at all \c!bottom=0.4, \c!distance=\onepoint, % \dimexpr\openlineheight/10\relax \c!line=2.8\exheight, diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl index e6147facd90..b716753de9b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl @@ -40,7 +40,7 @@ \permanent\tolerant\protected\def\filler[#1]% {\removeunwantedspaces \begingroup - \edef\currentfiller{#1}% + \cdef\currentfiller{#1}% \usefillerstyleandcolor\c!style\c!color \scratchdimen\fillerparameter\c!leftmargin\relax \ifzeropt\scratchdimen\else @@ -71,13 +71,15 @@ \permanent\tolerant\protected\def\fillupto[#1]#:#2% {\removeunwantedspaces \begingroup - \edef\currentfiller{#1}% + \cdef\currentfiller{#1}% \scratchdimen\dimexpr\fillerparameter\c!rightmargindistance\relax \ifzeropt\scratchdimen\else \parfillskip \scratchdimen\s!plus \plusone\s!fil\relax \fi \filler[#1]% - \doifsomething{#2}{\hbox{#2}}% + \ifempty{#2}\else + \hbox{#2}% + \fi \par \endgroup \ignorespaces} diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl index 33bf0c706d7..600f5c3c6f6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl @@ -33,15 +33,15 @@ \fi \endcsname} -\defcsname\??lastnodepusher\number\kernnodecode\endcsname +\defcsname\??lastnodepusher\the\kernnodecode\endcsname {\enforced\permanent\protected\edef\poplastnode{\kern\the\lastkern\relax}% \kern-\lastkern} -\defcsname\??lastnodepusher\number\gluenodecode\endcsname +\defcsname\??lastnodepusher\the\gluenodecode\endcsname {\enforced\permanent\protected\edef\poplastnode{\vskip\the\lastskip\relax}% \vskip-\lastskip} -\defcsname\??lastnodepusher\number\penaltynodecode\endcsname +\defcsname\??lastnodepusher\the\penaltynodecode\endcsname {\enforced\permanent\protected\edef\poplastnode{\penalty\the\lastpenalty\relax}% \nobreak} diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt index a4a8f0ade52..e7d540c76a5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt @@ -10,7 +10,14 @@ local chardata = characters.data local peekchar = tokens.scanners.peekchar local ctx_space = context.space -local can_have_space = characters.can_have_space +local nuts = nodes.nuts +local tonut = nodes.tonut +local texgetnest = tex.getnest +local traverseglue = nuts.traversers.glue +local setwidth = nodes.nuts.setwidth +local indentskip_code = nodes.gluecodes.indentskip + +local can_have_space = characters.can_have_space interfaces.implement { name = "autoinsertnextspace", @@ -27,13 +34,6 @@ interfaces.implement { end, } -local nuts = nodes.nuts -local tonut = nodes.tonut -local traverseglue = nuts.traversers.glue -local setwidth = nodes.nuts.setwidth -local indentskip_code = nodes.gluecodes.indentskip -local texgetnest = tex.getnest - local function lateindent(amount) local head = tonut(texgetnest("top","head")) if head then diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl index ab15e7a6eca..361724f6aec 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl @@ -19,7 +19,7 @@ \registerctxluafile{spac-hor}{autosuffix} -\aliased\let\parfillrightskip\parfillskip +\ifdefined\parfillrightskip\else \aliased\let\parfillrightskip\parfillskip \fi \bitwiseflip \normalizelinemode \normalizelinenormalizecode \bitwiseflip \normalizelinemode \parindentskipnormalizecode @@ -36,7 +36,7 @@ \newdimension\d_spac_indentation_par \parindent \d_spac_indentation_par % for the show -\newconditional\c_spac_indentation_indent_first \settrue\c_spac_indentation_indent_first +\newconditional\c_spac_indentation_indent_first \c_spac_indentation_indent_first\conditionaltrue \newconstant \c_spac_indentation_toggle_state %D After a blank or comparable situation (left side floats) we @@ -65,7 +65,7 @@ \fi} \def\spac_indentation_setup_indeed - {% not here: \settrue\c_spac_indentation_indent_first + {% not here: \c_spac_indentation_indent_first\conditionaltrue % not here: \parindent\d_spac_indentation_par % not here: \c_spac_indentation_toggle_state\zerocount \processcommacommand[\m_spac_indentation_options]\spac_indentation_apply_step_one % catch small, medium, etc @@ -140,8 +140,8 @@ \installindentingmethod \v!no {\parindent\zeropoint} \installindentingmethod \v!not {\parindent\zeropoint} -\installindentingmethod \v!first {\settrue\c_spac_indentation_indent_first} -\installindentingmethod \v!next {\setfalse\c_spac_indentation_indent_first} +\installindentingmethod \v!first {\c_spac_indentation_indent_first\conditionaltrue} +\installindentingmethod \v!next {\c_spac_indentation_indent_first\conditionalfalse} \installindentingmethod \v!yes {\parindent\d_spac_indentation_par\relax} % not \indent ! \installindentingmethod \v!always{\parindent\d_spac_indentation_par\relax} % not \indent ! @@ -157,7 +157,7 @@ \spac_indentation_setup_size \fi} -\installindentingmethod \v!reset {\settrue\c_spac_indentation_indent_first +\installindentingmethod \v!reset {\c_spac_indentation_indent_first\conditionaltrue \parindent\zeropoint \c_spac_indentation_toggle_state\zerocount} @@ -176,7 +176,7 @@ \aliased\let\checkindentation\relax -\installmacrostack\checkindentation +\installmacrostack\checkindentation % used? %D Actually we can forget about indent and let everypar insert a kern or so, %D but on the other hand it's kind of consistent to keep it and make the @@ -341,7 +341,7 @@ % maybe an everyforgetparindent \permanent\protected\def\forgetparindent - {\settrue\c_spac_indentation_indent_first % recently added + {\c_spac_indentation_indent_first\conditionaltrue % recently added \d_spac_indentation_par\zeropoint \parindent\zeropoint \let\v_spac_indentation_current\v!none} @@ -406,14 +406,6 @@ % test test\fsp. test % beats frenchspacing -% \permanent\protected\def\fsp#1% fixed space puncuation -% {\begingroup -% \ifchknum`#1\or -% \sfcode`#1\plusthousand -% \fi -% #1% -% \endgroup} - \permanent\protected\def\fsp#1% fixed space puncuation {#1% \ifchknum`#1\or @@ -522,8 +514,8 @@ \permanent\protected\def\nospacing{\normalnospaces\plusone} \permanent\protected\def\dospacing{\normalnospaces\zerocount} \else - \permanent\protected\def\nospacing{\spaceskip\scaledpoint \xspaceskip\zeropoint} - \permanent\protected\def\dospacing{\spaceskip\currentspaceskip\xspaceskip\zeropoint} % what + \permanent\protected\def\nospacing{\spaceskip\scaledpoint \xspaceskip\zeroskip} + \permanent\protected\def\dospacing{\spaceskip\currentspaceskip\xspaceskip\zeroskip} % what \fi \ifdefined\softhyphen \else @@ -657,7 +649,7 @@ {\dontleavehmode \begingroup %\scratchcounter\ifparameter#1\or#1\else\plusthree\fi - \scratchcounter\ifchknum#1\or#1\else\plusthree\fi + \scratchcounter\ifchknumber#1\or\lastchknumber\else\plusthree\fi \zwj\dorecurse\scratchcounter{\hskip\emwidth\zwj}% \endgroup} @@ -667,21 +659,23 @@ % Bovendien definieren we enkele extra \fill's: +\newgluespec\s_spac_fi \s_spac_fi \zeropoint \s!plus 1\s!fi \relax \newgluespec\s_spac_fil \s_spac_fil \zeropoint \s!plus 1\s!fil \relax \newgluespec\s_spac_fill \s_spac_fill \zeropoint \s!plus 1\s!fill \relax \newgluespec\s_spac_filll \s_spac_filll \zeropoint \s!plus 1\s!filll\relax +\newgluespec\s_spac_neg_fi \s_spac_neg_fi \zeropoint \s!plus-1\s!fi \relax \newgluespec\s_spac_neg_fil \s_spac_neg_fil \zeropoint \s!plus-1\s!fil \relax \newgluespec\s_spac_neg_fill \s_spac_neg_fill \zeropoint \s!plus-1\s!fill \relax \newgluespec\s_spac_neg_filll \s_spac_neg_filll \zeropoint \s!plus-1\s!filll\relax -\permanent\protected\def\hfilll {\hskip\s_spac_filll\relax} -\permanent\protected\def\vfilll {\vskip\s_spac_filll\relax} +\permanent\protected\untraced\def\hfilll {\hskip\s_spac_filll\relax} +\permanent\protected\untraced\def\vfilll {\vskip\s_spac_filll\relax} -\permanent\protected\def\hfillneg {\hskip\s_spac_neg_fill \relax} -\permanent\protected\def\hfilllneg{\hskip\s_spac_neg_filll\relax} -\permanent\protected\def\vfillneg {\vskip\s_spac_neg_fill \relax} -\permanent\protected\def\vfilllneg{\vskip\s_spac_neg_filll\relax} +\permanent\protected\untraced\def\hfillneg {\hskip\s_spac_neg_fill \relax} +\permanent\protected\untraced\def\hfilllneg{\hskip\s_spac_neg_filll\relax} +\permanent\protected\untraced\def\vfillneg {\vskip\s_spac_neg_fill \relax} +\permanent\protected\untraced\def\vfilllneg{\vskip\s_spac_neg_filll\relax} \permanent\protected\def\tfskip {\begingroup\tf\hskip\emwidth\endgroup} \permanent\protected\def\dotfskip#1{\begingroup\tf\hskip #1\endgroup} % used elsewhere @@ -729,15 +723,15 @@ \installnarrowermethod{-\v!left }{\global\advanceby\s_spac_narrower_left -\narrowerparameter\c!left \relax} \installnarrowermethod{-\v!middle}{\global\advanceby\s_spac_narrower_middle-\narrowerparameter\c!middle\relax} \installnarrowermethod{-\v!right }{\global\advanceby\s_spac_narrower_right -\narrowerparameter\c!right \relax} -\installnarrowermethod \v!reset {\global \s_spac_narrower_left \zeropoint - \global \s_spac_narrower_middle \zeropoint - \global \s_spac_narrower_right \zeropoint\relax} +\installnarrowermethod \v!reset {\global \s_spac_narrower_left \zeroskip + \global \s_spac_narrower_middle \zeroskip + \global \s_spac_narrower_right \zeroskip\relax} \installnarrowermethod \v!none {} \installnarrowermethod \v!reverse {} % never seen \permanent\overloaded\tolerant\protected\def\spac_narrower_start[#1]#*[#2]% {\begingroup - \edef\currentnarrower{#1}% + \cdef\currentnarrower{#1}% \ifparameter#2\or \spac_narrower_start_apply{#2}% \else @@ -750,19 +744,19 @@ \def\spac_narrower_start_apply#1% {\narrowerparameter\c!before - \global\s_spac_narrower_left \zeropoint - \global\s_spac_narrower_right \zeropoint - \global\s_spac_narrower_middle\zeropoint + \global\s_spac_narrower_left \zeroskip + \global\s_spac_narrower_right \zeroskip + \global\s_spac_narrower_middle\zeroskip \edef\scratchstringone{#1}% \ifx\scratchstringone\v!reverse \ifconditional\s_spac_narrower_last_swap \frozen\leftskip \s_spac_narrower_right_last \frozen\rightskip\s_spac_narrower_left_last - \setfalse\s_spac_narrower_last_swap + \s_spac_narrower_last_swap\conditionalfalse \else \frozen\leftskip \s_spac_narrower_left_last \frozen\rightskip\s_spac_narrower_right_last - \settrue\s_spac_narrower_last_swap + \s_spac_narrower_last_swap\conditionaltrue \fi \else \normalexpanded{\processcommalistwithparameters[\scratchstringone]}\spac_narrower_initialize @@ -778,9 +772,9 @@ \s_spac_narrower_left_last \the\leftskip \relax \s_spac_narrower_right_last\the\rightskip\relax \ifconditional\s_spac_narrower_last_swap - \setfalse\s_spac_narrower_last_swap + \s_spac_narrower_last_swap\conditionalfalse \else - \settrue\s_spac_narrower_last_swap + \s_spac_narrower_last_swap\conditionaltrue \fi }} @@ -795,7 +789,7 @@ \aliased\let\stopnarrower\spac_narrower_stop -\permanent\tolerant\protected\def\startnarrow[#1]#*[#2]% current how +\permanent\tolerant\protected\def\startnarrow[#S#1]#*[#S#2]% current how {\begingroup \ifnum\lastarguments=\plustwo \expandafter\spac_narrower_start_named_two @@ -803,34 +797,36 @@ \expandafter\spac_narrower_start_named_one \fi[#1][#2]} -\def\spac_narrower_start_named_one[#1]% +% we can combine these: + +\def\spac_narrower_start_named_one[#S#1]% {\doifelseassignment{#1}\spac_narrower_start_named_one_yes\spac_narrower_start_named_one_nop[#1]} -\def\spac_narrower_start_named_one_yes[#1][#2]% [settings] [] +\def\spac_narrower_start_named_one_yes[#S#1][#2]% [settings] [] {\setupcurrentnarrower[#1]% \spac_narrower_start_apply{\narrowerparameter\v!default}} \def\spac_narrower_start_named_one_nop[#1][#2]% [tag] [] - {\edef\currentnarrower{#1}% + {\cdef\currentnarrower{#1}% \spac_narrower_start_apply{\narrowerparameter\v!default}} -\def\spac_narrower_start_named_two[#1]% +\def\spac_narrower_start_named_two[#S#1]% {\doifelseassignment{#1}\spac_narrower_start_named_settings_how\spac_narrower_start_named_tag_unknown[#1]} -\def\spac_narrower_start_named_settings_how[#1][#2]% [settings] [how] +\def\spac_narrower_start_named_settings_how[#S#1][#2]% [settings] [how] {\setupcurrentnarrower[#1]% \spac_narrower_start_apply{#2}} -\def\spac_narrower_start_named_tag_unknown[#1][#2]% [tag] [...] +\def\spac_narrower_start_named_tag_unknown[#1][#S#2]% [tag] [...] {\doifelseassignment{#2}\spac_narrower_start_named_tag_settings\spac_narrower_start_named_tag_how[#1][#2]} -\def\spac_narrower_start_named_tag_settings[#1][#2]% [tag] [settings] - {\edef\currentnarrower{#1}% +\def\spac_narrower_start_named_tag_settings[#1][#S#2]% [tag] [settings] + {\cdef\currentnarrower{#1}% \setupcurrentnarrower[#2]% \spac_narrower_start_apply{\narrowerparameter\v!default}} \def\spac_narrower_start_named_tag_how[#1][#2]% [tag] [how] - {\edef\currentnarrower{#1}% + {\cdef\currentnarrower{#1}% \spac_narrower_start_apply{#2}} \aliased\let\stopnarrow\spac_narrower_stop @@ -855,11 +851,11 @@ \newgluespec\rightskipadaption \defcsname\??skipadaptionleft \v!yes\endcsname{\ifzeropt\d_spac_indentation_par\narrowerparameter\c!left\else\d_spac_indentation_par\fi} -\letcsname\??skipadaptionleft \v!no \endcsname\zeropoint -\letcsname\??skipadaptionleft \empty\endcsname\zeropoint +\letcsname\??skipadaptionleft \v!no \endcsname\zeropoint % \zeroskip +\letcsname\??skipadaptionleft \empty\endcsname\zeropoint % \zeroskip \defcsname\??skipadaptionright\v!yes\endcsname{\narrowerparameter\c!right} -\letcsname\??skipadaptionright\v!no \endcsname\zeropoint -\letcsname\??skipadaptionright\empty\endcsname\zeropoint +\letcsname\??skipadaptionright\v!no \endcsname\zeropoint % \zeroskip +\letcsname\??skipadaptionright\empty\endcsname\zeropoint % \zeroskip \letcsname\??skipadaptionleft \v!standard\expandafter\endcsname\csname\??skipadaptionleft \v!yes\endcsname \letcsname\??skipadaptionright\v!standard\expandafter\endcsname\csname\??skipadaptionright\v!yes\endcsname @@ -871,8 +867,8 @@ \permanent\protected\def\doadaptrightskip#1{\normalexpanded{\dosetrightskipadaption{#1}}\frozen\advanceby\rightskip\rightskipadaption} \permanent\protected\def\forgetbothskips - {\leftskip\zeropoint - \rightskip\zeropoint + {\leftskip \zeroskip + \rightskip\zeroskip \relax} \appendtoks @@ -882,8 +878,8 @@ % in spac-ver.mkiv % % \protected\def\forgetparskip -% {\s_spac_whitespace_parskip\zeropoint -% \parskip\zeropoint +% {\s_spac_whitespace_parskip\zeroskip +% \parskip\zeroskip % \let\v_spac_whitespace_current\v!none} % % \appendtoks @@ -921,9 +917,11 @@ \permanent\tolerant\protected\def\setuptolerance[#1]% {\ifarguments\or - \doifelseinset\v!vertical{#1}% - {\processcommacommand[#1]\spac_tolerances_step_vertical } - {\processcommacommand[#1]\spac_tolerances_step_horizontal}% + \ifinset\v!vertical{#1}% + \processcommacommand[#1]\spac_tolerances_step_vertical + \else + \processcommacommand[#1]\spac_tolerances_step_horizontal + \fi \fi} % %D \macros @@ -943,7 +941,7 @@ % \setbox\b_spac_indentations_b\lastbox % get \indent generated box % \unskip % \else -% \dontleavehmode % was \hskip\zeropoint % switch to horizontal mode +% \dontleavehmode % was \hskip\zeroskip % switch to horizontal mode % \unskip % \setbox\b_spac_indentations_a\lastbox % get \indent generated box % \setbox\b_spac_indentations_b\emptybox @@ -973,7 +971,7 @@ %D To serve our purpose a bit better, the macro \type {\strut} can be redefined as: %D \starttyping %D \def\strut -%D {\relax\ifmmode\else\hskip0pt\fi\copy\strutbox} +%D {\relax\ifmmode\else\hskip\zeroskip\fi\copy\strutbox} %D \stoptyping %D %D Or more compatible: @@ -1058,7 +1056,7 @@ \definehspace [\v!big] [1\emspaceamount] \definehspace [\v!normal] [1\spaceamount] \definehspace [\v!default] [\spaceamount] -\definehspace [\v!none] [\zeropoint] +\definehspace [\v!none] [\zeropoint] % \zeroskip %D Taken from Taco's math module (cq. \AMS\ macros), but %D adapted to \type %D {\hspace}: @@ -1075,7 +1073,7 @@ \overloaded\permanent\protected \def\negthinspace {\textormathspace-\thinmuskip 1} \overloaded\permanent\protected \def\negmedspace {\textormathspace-\medmuskip 2} \overloaded\permanent\protected \def\negthickspace{\textormathspace-\thickmuskip3} -\overloaded\permanent\protected\edef\medspace {\textormathspacecommand+\medmuskip{\Uchar"205F}} +\overloaded\permanent\protected\edef\medspace {\textormathspacecommand+\medmuskip{\tocharacter"205F}} % maybe @@ -1092,7 +1090,7 @@ % \protected\def\nobreakskip {\penalty\plustenthousand\kern\interwordspace} % \protected\def\narrownobreakskip {\penalty\plustenthousand\thinspace} % \protected\def\zerowidthnobreakskip {\penalty\plustenthousand\kern\zeropoint} -% \protected\def\zerowidthskip {\hskip\zeropoint} +% \protected\def\zerowidthskip {\hskip\zeroskip} \definehspace[.5][.1250\emwidth] % hair \definehspace[1] [.1667\emwidth] % thin diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-imp-tests.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-imp-tests.mkxl new file mode 100644 index 00000000000..526b9838ac9 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-imp-tests.mkxl @@ -0,0 +1,247 @@ +%D \module +%D [ file=spac-imp-tests, +%D version=2023.06.10, +%D title=\CONTEXT\ Spacing Macros, +%D subtitle=Test Passes, +%D author=Hans Hagen & Mikael Sundqvist, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Eventually we will have a set of useable (realistic) presets and definitions +%D here. So, all be low can change dependin gon what users feed back to us. + +% \writestatus{loading}{ConTeXt Spacing Macros / Test Passes} + +\unprotect + +\startsetups align:pass:decent + \pretolerance 50 + \tolerance 150 + \parpasses 2 + identifier \parpassidentifier{decent} + threshold 0.05pt + tolerance 200 + next + threshold 0.05pt + tolerance 500 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + \relax +% \linebreakpasses\plusone +\stopsetups + +\startsetups align:pass:quality + \pretolerance 50 + \tolerance 150 + \parpasses 4 + identifier \parpassidentifier{quality} + threshold 0.025pt + tolerance 175 + next + threshold 0.025pt + tolerance 200 + next + threshold 0.025pt + tolerance 250 + next + threshold 0.025pt + tolerance 250 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + \relax +% \linebreakpasses\plusone +\stopsetups + +% the test set: + +% \startsetups align:pass:test1 +% \pretolerance 100 +% \tolerance 200 +% \parpasses 2 +% classes \indecentparpassclasses +% tolerance 400 +% next +% classes \indecentparpassclasses +% tolerance 400 +% adjustspacing 3 +% adjustspacingstep 1 +% adjustspacingshrink 15 +% adjustspacingstretch 30 +% emergencystretch .25\bodyfontsize +% \relax +% \linebreakpasses\plusone +% \stopsetups + +\startsetups align:pass:test1 + \pretolerance 100 + \tolerance 200 + \parpasses 1 + classes \almostdecentparpassclasses + tolerance 300 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 15 + adjustspacingstretch 30 + emergencystretch .25\bodyfontsize + \relax +% \linebreakpasses\plusone +\stopsetups + +% This one works quite well About 300 hits, almost all but a handful caught by the +% the first one. + +\startsetups align:pass:test2 + \pretolerance 100 + \tolerance 200 + \parpasses 3 + classes \indecentparpassclasses + threshold 0.025pt + tolerance 250 + extrahyphenpenalty 50 + next + threshold 0.025pt + tolerance 300 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 10 + adjustspacingstretch 15 + next + threshold 0.025pt + tolerance 350 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + emergencystretch .25\bodyfontsize + \relax +% \linebreakpasses\plusone +\stopsetups + +% This one works quite well. About 500 hits, all but about 10 caught by the the +% first one + +\startsetups align:pass:test3 + \pretolerance 50 + \tolerance 100 + \parpasses 2 + classes \indecentparpassclasses + threshold 0.025pt + tolerance 200 + extrahyphenpenalty 50 + next + threshold 0.025pt + tolerance 200 + extrahyphenpenalty 25 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + emergencystretch .25\bodyfontsize + \relax +% \linebreakpasses\plusone +\stopsetups + +% We increase expansion stepwise Here most (about 300) end up in the fourth run, +% only a handful in the first ones No overfull hboxes present, many large changes. + +\startsetups align:pass:test4 + \pretolerance 100 + \tolerance 200 + \parpasses 4 + classes \indecentparpassclasses + threshold 0.025pt + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 5 + adjustspacingstretch 10 + next + classes \indecentparpassclasses + threshold 0.025pt + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 10 + adjustspacingstretch 20 + next + classes \indecentparpassclasses + threshold 0.025pt + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + next + classes \indecentparpassclasses + threshold 0.025pt + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 40 + adjustspacingstretch 80 + \relax +% \linebreakpasses\plusone +\stopsetups + +% Start with low tolerance and hopefully no hyphens. increase tolerance and +% decrease extrahyphenpenalty Last one has a larger threshold, so only kicks in for +% lines that stick out "much" 31-1-4-0 (but two slightly overfull hboxes) + +\startsetups align:pass:test5 + \pretolerance 50 + \tolerance 100 + \parpasses 4 + threshold 0.025pt + tolerance 200 + extrahyphenpenalty 100 + next + threshold 0.025pt + tolerance 400 + extrahyphenpenalty 50 + next + threshold 0.025pt + tolerance 500 + extrahyphenpenalty 25 + emergencystretch .25\bodyfontsize + next + threshold 1pt + tolerance 1000 + extrahyphenpenalty 0 + emergencystretch .5\bodyfontsize + \relax +% \linebreakpasses\plusone +\stopsetups + +% another temporary test + +\permanent\protected\def\optional#1#2% + {\optionalboundary#1\wordboundary#2\wordboundary\optionalboundary\zerocount} + +\startsetups align:pass:optional1 + \pretolerance 75 + \tolerance 150 + \parpasses 3 + classes \indecentparpassclasses + linebreakoptional 0 + tolerance 150 + next +% callback \parpasscallback{experiment} + classes \indecentparpassclasses + tolerance 200 + linebreakoptional 0 + emergencystretch .25\bodyfontsize + next +% threshold 0.025pt + classes \indecentparpassclasses + tolerance 200 + linebreakoptional 0 + emergencystretch .5\bodyfontsize + \relax +% \linebreakpasses\plusone +\stopsetups + +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl index d462caeaa1d..4066c38080a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl @@ -59,8 +59,8 @@ \c!space=\v!default] \appendtoks - \frozen\instance\setuevalue{\e!start\currentlines}{\spac_lines_start[\currentlines]}% - \frozen\instance\letvalue {\e!stop \currentlines }\spac_lines_stop + \frozen\instance\protected\edefcsname\e!start\currentlines\endcsname{\spac_lines_start[\currentlines]}% + \frozen\instance\letcsname \e!stop \currentlines\endcsname \spac_lines_stop \to \everydefinelines \lettonothing\p_lines_option @@ -107,11 +107,11 @@ \permanent\tolerant\protected\def\spac_lines_start[#1]% {\bgroup - \edef\currentlines{#1}% + \cdef\currentlines{#1}% \obeylines \spac_lines_start_indeed} -\tolerant\def\spac_lines_start_indeed[#1]% new: optional second argument (WS) +\tolerant\def\spac_lines_start_indeed[#S#1]% new: optional second argument (WS) {\ifarguments\or \setupcurrentlines[#1]% \fi diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl index 2e3e1bc0058..f9e8af71d05 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl @@ -45,20 +45,20 @@ \ifinpagebody \ifdoublesided \ifodd\realpageno\relax - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \else - \setfalse\c_spac_pagestates_found + \c_spac_pagestates_found\conditionalfalse \fi \else - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \fi \orelse\ifdoublesided \edef\m_spac_pagestates_realpage{\pagestaterealpage{#1}{\number#2}}% \ifempty\m_spac_pagestates_realpage \ifodd\realpageno\relax - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \else - \setfalse\c_spac_pagestates_found + \c_spac_pagestates_found\conditionalfalse \fi \else \realpagestateno\m_spac_pagestates_realpage\relax @@ -66,19 +66,19 @@ \pagestatemismatchtrue \fi \ifodd\realpagestateno\relax - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \else - \setfalse\c_spac_pagestates_found + \c_spac_pagestates_found\conditionalfalse \fi \fi \else - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \fi \else \ifodd\realpagestateno\relax - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \else - \setfalse\c_spac_pagestates_found + \c_spac_pagestates_found\conditionalfalse \fi \fi \ifconditional\c_spac_pagestates_found @@ -94,9 +94,9 @@ \edef\m_spac_pagestates_realpage{\pagestaterealpage{#1}{\number#2}}% \ifempty\m_spac_pagestates_realpage \ifodd\realpageno\relax - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \else - \setfalse\c_spac_pagestates_found + \c_spac_pagestates_found\conditionalfalse \fi \else \realpagestateno\m_spac_pagestates_realpage\relax @@ -104,16 +104,16 @@ \pagestatemismatchtrue \fi \ifodd\realpagestateno\relax - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \else - \setfalse\c_spac_pagestates_found + \c_spac_pagestates_found\conditionalfalse \fi \fi \else \ifodd\realpagestateno\relax - \settrue\c_spac_pagestates_found + \c_spac_pagestates_found\conditionaltrue \else - \setfalse\c_spac_pagestates_found + \c_spac_pagestates_found\conditionalfalse \fi \fi \ifconditional\c_spac_pagestates_found diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl index f924165872a..7ac123f1449 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl @@ -32,6 +32,7 @@ + \brokenpenaltyfrozenparcode + \demeritsfrozenparcode + \orphanpenaltyfrozenparcode + + \singlelinepenaltyfrozenparcode \relax \setnewconstant\paragraphpenaltycodes\numexpr @@ -41,6 +42,7 @@ + \brokenpenaltyfrozenparcode + \shapingpenaltyfrozenparcode + \orphanpenaltyfrozenparcode + + \singlelinepenaltyfrozenparcode \relax \setnewconstant\paragraphdemeritcodes\numexpr @@ -62,6 +64,12 @@ \hyphenationfrozenparcode \relax +\setnewconstant\paragraphpassescodes\numexpr + \parpassesfrozenparcode +\relax + +% \linefrozenparcode % lineskip + \setnewconstant\frozenparagraphdefault\numexpr \hsizefrozenparcode % \hsize + \skipfrozenparcode % \leftskip \rightskip @@ -85,6 +93,10 @@ + \hyphenationfrozenparcode % \hyphenationmode + \shapingpenaltyfrozenparcode % \shapingpenaltymode + \orphanpenaltyfrozenparcode + % \mathpenaltyfrozenparcode + + \emergencyfrozenparcode + + \parpassesfrozenparcode + + \singlelinepenaltyfrozenparcode \relax \permanent\protected\def\freezeparagraphproperties {\snapshotpar\frozenparagraphdefault} @@ -95,6 +107,7 @@ \permanent\protected\def\updateparagraphdemerits {\ifhmode\snapshotpar\paragraphdemeritcodes\fi} \permanent\protected\def\updateparagraphshapes {\ifhmode\snapshotpar\paragraphshapecodes \fi} \permanent\protected\def\updateparagraphlines {\ifhmode\snapshotpar\paragraphlinecodes \fi} +\permanent\protected\def\updateparagraphpasses {\ifhmode\snapshotpar\paragraphpassescodes \fi} % so far @@ -274,26 +287,26 @@ \letcsname\??paragraphintro\empty\endcsname\gobbleoneargument \defcsname\??paragraphintro\v!reset\endcsname#1% - {\global\setfalse\c_spac_paragraphs_intro_first - \global\setfalse\c_spac_paragraphs_intro_next - \global\setfalse\c_spac_paragraphs_intro_each + {\global\c_spac_paragraphs_intro_first\conditionalfalse + \global\c_spac_paragraphs_intro_next\conditionalfalse + \global\c_spac_paragraphs_intro_each\conditionalfalse \global\t_spac_paragraphs_intro_first\emptytoks \global\t_spac_paragraphs_intro_next \emptytoks \global\t_spac_paragraphs_intro_each \emptytoks \glettonothing\spac_paragraphs_flush_intro} \defcsname\??paragraphintro\v!first\endcsname#1% - {\global\settrue\c_spac_paragraphs_intro_first + {\global\c_spac_paragraphs_intro_first\conditionaltrue \gtoksapp\t_spac_paragraphs_intro_first{#1}% \glet\spac_paragraphs_flush_intro\spac_paragraphs_flush_intro_indeed} \defcsname\??paragraphintro\v!next\endcsname#1% - {\global\settrue\c_spac_paragraphs_intro_next + {\global\c_spac_paragraphs_intro_next\conditionaltrue \gtoksapp\t_spac_paragraphs_intro_next{#1}% \glet\spac_paragraphs_flush_intro\spac_paragraphs_flush_intro_indeed} \defcsname\??paragraphintro\v!each\endcsname#1% - {\global\settrue\c_spac_paragraphs_intro_each + {\global\c_spac_paragraphs_intro_each\conditionaltrue \gtoksapp\t_spac_paragraphs_intro_each{#1}% \glet\spac_paragraphs_flush_intro\spac_paragraphs_flush_intro_indeed} @@ -350,37 +363,37 @@ \glet\spac_paragraphs_flush_intro\spac_paragraphs_flush_intro_each \fi \ifconditional\c_spac_paragraphs_intro_first - \global\setfalse\c_spac_paragraphs_intro_first + \global\c_spac_paragraphs_intro_first\conditionalfalse \global\t_spac_paragraphs_intro_first\emptytoks - \the\t_spac_paragraphs_intro_first + \expand\t_spac_paragraphs_intro_first \fi - \the\t_spac_paragraphs_intro_each + \expand\t_spac_paragraphs_intro_each \else \ifconditional\c_spac_paragraphs_intro_next \glet\spac_paragraphs_flush_intro\spac_paragraphs_flush_intro_next \fi \ifconditional\c_spac_paragraphs_intro_first - \global\setfalse\c_spac_paragraphs_intro_first + \global\c_spac_paragraphs_intro_first\conditionalfalse \global\t_spac_paragraphs_intro_first\emptytoks - \the\t_spac_paragraphs_intro_first + \expand\t_spac_paragraphs_intro_first \fi \fi}} \protected\def\spac_paragraphs_flush_intro_next {\normalexpanded{% - \global\setfalse\c_spac_paragraphs_intro_next + \global\c_spac_paragraphs_intro_next\conditionalfalse \global\t_spac_paragraphs_intro_next\emptytoks \ifconditional\c_spac_paragraphs_intro_each \glet\spac_paragraphs_flush_intro\spac_paragraphs_flush_intro_each - \the\t_spac_paragraphs_intro_next - \the\t_spac_paragraphs_intro_each + \expand\t_spac_paragraphs_intro_next + \expand\t_spac_paragraphs_intro_each \else \glettonothing\spac_paragraphs_flush_intro - \the\t_spac_paragraphs_intro_next + \expand\t_spac_paragraphs_intro_next \fi}} \protected\def\spac_paragraphs_flush_intro_each - {\the\t_spac_paragraphs_intro_each} + {\expand\t_spac_paragraphs_intro_each} %D \macros %D {flushatnextpar} @@ -421,7 +434,7 @@ \permanent\protected\def\flushatnextpar {\begingroup - \the\everyflushatnextpar + \expand\everyflushatnextpar \enforced\glet\flushpostponednodedata\spac_postponed_data_flush \dowithnextboxcs\spac_postponed_data_finish\hpack} @@ -466,4 +479,55 @@ \expandafter\firstofoneargument \fi} +%D Experiment: +%D +%D \starttyping +%D \startcombination[4*1] +%D {\vtop{ \hsize #1 \setupalign[tolerant] \samplefile{ward}}} {tolerant} +%D {\vtop{\darkblue \hsize #1 \setupalign[tolerant,stretch] \samplefile{ward}}} {tolerant,stretch} +%D {\vtop{\darkgreen \hsize #1 \setupalign[tolerant] \optimize[flushleft] \samplefile{ward}}} {tolerant,fuzzy} +%D {\vtop{\darkred \hsize #1 \setupalign[tolerant] \optimize[normal] \samplefile{ward}}} {tolerant,lessfuzzy} +%D \stopcombination +%D \stoptyping + +\installcorenamespace {optimize} + +\installcommandhandler \??optimize {optimize} \??optimize + +\setupoptimize + [\c!lines=\zerocount, + \c!left=\zeropoint, + \c!right=\zeropoint, + \c!distance=\zeropoint] + +\permanent\protected\def\optimize[#S#1]% + {\begingroup + \ifhastok={#1}% + \setupcurrentoptimize[#1]% + \else + \cdef\currentoptimize{#1}% + \fi + \scratchdimenone \optimizeparameter\c!left \relax + \scratchdimentwo \optimizeparameter\c!right\relax + \scratchcounterone\optimizeparameter\c!lines\relax + \scratchdistance \optimizeparameter\c!distance\relax + \normalexpanded + {\endgroup + \looseness\the\scratchcounterone\relax + \emergencyextrastretch\the\scratchdistance\relax + \ifzerodim\scratchdimenone\else + \emergencyleftskip \zeropoint \s!plus \the\scratchdimenone\relax + \fi + \ifzerodim\scratchdimentwo\else + \emergencyrightskip\zeropoint \s!plus \the\scratchdimentwo\relax + \fi}% + \ignorespaces} + +\defineoptimize[+\v!line][\c!lines=\plusone] +\defineoptimize[-\v!line][\c!lines=\minusone] + +\defineoptimize[\v!flushleft ][\c!right=2\bodyfontsize] +\defineoptimize[\v!flushright][\c!left=2\bodyfontsize] +\defineoptimize[\v!normal ][\c!right=2\bodyfontsize,\c!distance=\bodyfontsize] + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-pas.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-pas.lmt new file mode 100644 index 00000000000..5f58404f227 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-pas.lmt @@ -0,0 +1,263 @@ +if not modules then modules = { } end modules ['spac-pas'] = { + version = 1.001, + comment = "companion to spac-pas.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local rawget, tonumber = rawget, tonumber + +local report = logs.reporter("break quality") + +local currentfile = luatex.currentfile + +local integer_value = tokens.values.integer + +local toobad = 20 +local tracing = false +local details = false + +-- builders.passnames = utilities.storage.mark(builders.passnames or { }) +-- local passnames = builders.passnames +-- local nofidentifiers = #passnames +-- +-- storage.register("builders/passnames", passnames, "builders.passnames") + +local passnames = { } +local nofidentifiers = 0 + +table.setmetatableindex(passnames,function(t,k) + if type(k) == "number" and k >= 0 then + return k + else + nofidentifiers = nofidentifiers - 1 + t[k] = nofidentifiers + t[nofidentifiers] = k + return nofidentifiers + end +end) + +interfaces.implement { + name = "parpassidentifier", + public = true, + usage = "value", + arguments = "string", + actions = function(s) + return integer_value, passnames[s] + end, +} + +local function linebreak_quality_console(id,line,pass,subpass,subpasses,overfull,underfull,badness,classes) + local filename = currentfile() + local passname = passnames[id] + if pass == 1 then + if details then + report("file %a, line %i, pass 1",filename,line) + end + elseif overfull ~= 0 then + if subpass > 0 then + report("file %a, line %i, pass %i, subpass %i of %i, overfull %p, classes 0x%02X, id %a",filename,line,pass,subpass,subpasses,overfull,classes,passname) + else + report("file %a, line %i, pass %i, classes 0x%02X, overfull %p",filename,line,pass,classes,overfull) + end + elseif underfull ~= 0 then + if subpass > 0 then + report("file %a, line %i, pass %i, subpass %i of %i, underfull %p, classes 0x%02X, id %a",filename,line,pass,subpass,subpasses,underfull,classes,passname) + else + report("file %a, line %i, pass %i, classes 0x%02X, underfull %p",filename,line,pass,classes,underfull) + end + elseif badness > toobad then + if subpass > 0 then + report("file %a, line %i, pass %i, subpass %i of %i, badness %s, classes 0x%02X, id %a",filename,line,pass,subpass,subpasses,badness,classes,passname) + else + report("file %a, line %i, classes 0x%02X, badness %i, okay",filename,line,pass,classes,badness) + end + else + if subpass > 0 then + report("file %a, line %i, pass %i, subpass %i of %i, okay, classes 0x%02X, id %a",filename,line,pass,subpass,subpasses,classes,passname) + elseif details then + report("file %a, line %i, okay",filename,line,pass) + end + end +end + +local collected = table.setmetatableindex("table") +local noffirst = 0 +local nofsecond = 0 +local nofthird = 0 +local nofsubpasses = 0 +local nofsubdone = 0 +local nofoverfull = 0 +local nofunderfull = 0 +local nofbadness = 0 + +local function linebreak_quality_summary(id,line,pass,subpass,subpasses,overfull,underfull,badness,classes) + if pass == 1 then + -- t = { pass = 1, line = line } + noffirst = noffirst + 1 + else + if pass == 2 then + nofsecond = nofsecond + 1 + else + nofthird = nofthird + 1 + end + local o = overfull ~= 0 + local u = underfull ~= 0 + local b = badness > toobad + local s = subpass > 0 + if o then + nofoverfull = nofoverfull + 1 + end + if u then + nofunderfull = nofunderfull + 1 + end + if b then + nofbadness = nofbadness + 1 + end + if s then + nofsubpasses = nofsubpasses + 1 + nofsubdone = nofsubdone + subpass + end + if o then + local c = collected[currentfile()] + c[#c+1] = { + pass = pass, + line = line, + subpass = subpass, + subpasses = subpasses, + overfull = overfull, + classes = classes, + id = passnames[id], + } + elseif b then + local c = collected[currentfile()] + c[#c+1] = { + pass = pass, + line = line, + subpass = subpass, + subpasses = subpasses, + badness = badness, + classes = classes, + id = passnames[id], + } + end + end +end + +logs.registerfinalactions(function() + if tracing and next(collected) then + logs.startfilelogging(report,"overfull lines") + for filename, list in table.sortedhash(collected) do + for i=1,#list do + local t = list[i] + local b = t.badness + local o = t.overfull + if b then + report(" file %a, line %i, pass %i, subpass %i of %i, classes 0x%02X, badness %i", filename,t.line,t.pass,t.subpass,t.subpasses,t.classes,b) + elseif o then + report(" file %a, line %i, pass %i, subpass %i of %i, classes 0x%02X, overfull %p",filename,t.line,t.pass,t.subpass,t.subpasses,t.classes,o) + end + end + end + logs.stopfilelogging() + end +end) + +statistics.register("linebreak quality",function() + if tracing then + return string.formatters["%i first, %i second, %i third, %i subpasses, %i subruns, %i overfull, %i underfull, %i badness"]( + noffirst, nofsecond, nofthird, + nofsubpasses, nofsubdone, + nofoverfull, nofunderfull, + nofbadness + ) + end +end) + +local registercallback = callback.register + +trackers.register("paragraphs.passes", function(v) + details = false + if not v then + tracing = nil + elseif v == "summary" then + tracing = linebreak_quality_summary + elseif v == "details" then + details = true + tracing = linebreak_quality_console + else + tracing = linebreak_quality_console + end + registercallback("linebreak_quality",tracing) +end) + +-- -- -- -- + +local nuts = nodes.nuts +local tonut = nodes.tonut +local setprop = nuts.setprop +local getprop = nuts.getprop + +local trace_callbacks = false + +trackers.register("paragraphs.passes.callbacks", function(v) + trace_callbacks = v +end) + +local actions = { } +local identifiers = table.setmetatableindex(function(t,k) + local v = #t + 1 + local s = tostring(k) -- no number + t[s] = v + t[v] = s + return v +end) + +callback.register("paragraph_pass", function( + head,identifier,callback, + overfull,underfull,verdict,classified, + threshold,badness,classes + ) + local action = actions[callback] + if action then + local head = tonut(head) + local step = getprop(head,"par_pass_done") or 1 + setprop(head,"par_pass_done",step+1) + local result, again = action( + head,rawget(identifiers,identifier) or identifier,callback,step, + overfull,underfull,verdict,classified, + threshold,badness,classes + ) + if trace_callbacks then + if type(result) == "table" then + report("subpass identifier %a, callback %a, %s",identifier,callback,"process with data") + elseif result then + report("subpass identifier %a, callback %a, %s",identifier,callback,"process") + else + report("subpass identifier %a, callback %a, %s",identifier,callback,"quit") + end + end + return result, again + else + report("subpass identifier %a, unknown callback %a",identifier,callback) + return false + end +end) + +function builders.registerpaspasscallback(identifier,action) + local index = identifiers[identifier] + actions[index] = action + return index +end + +interfaces.implement { + name = "parpasscallback", + public = true, + usage = "value", + arguments = "string", + actions = function(s) + return integer_value, identifiers[s] + end, +} + diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-pas.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-pas.mkxl new file mode 100644 index 00000000000..7e0d64fe7e0 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-pas.mkxl @@ -0,0 +1,111 @@ +%D \module +%D [ file=spac-pas, +%D version=2023.06.10, +%D title=\CONTEXT\ Spacing Macros, +%D subtitle=Passes, +%D author=Hans Hagen & Mikael Sundqvist, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Spacing Macros / Passes} + +\registerctxluafile{spac-pas}{autosuffix} + +%D Here we set up some nano typography features. We have moved the penalties +%D that deal with par building here. We also separated them from the page +%D builder related ones. + +\unprotect + +% \resetpenalties\orphanpenalties + +\integerdef\indecentparpassclasses\numexpr + \verylooseparpassclass + + \looseparpassclass + + \semilooseparpassclass + % \decentparpassclass + + \semitightparpassclass + + \tightparpassclass +\relax + +\integerdef\almostdecentparpassclasses\numexpr + \verylooseparpassclass + + \looseparpassclass + % \semilooseparpassclass + % \decentparpassclass + % \semitightparpassclass % yes or no + + \tightparpassclass +\relax + +\integerdef\looseparpassclasses\numexpr + \verylooseparpassclass + + \looseparpassclass + + \semilooseparpassclass +\relax + +\integerdef\tightparpassclasses\numexpr + \semitightparpassclass + + \tightparpassclass +\relax + +\appendtoks + \ifcase\linebreakpasses\else + \linebreakpasses\zerocount + \pretolerance \plushundred + \tolerance \plustwohundred + \fi +\to \everyforgetall + +\startsetups align:pass:none + \pretolerance \plushundred + \tolerance \plustwohundred + \parpasses \zerocount + \linebreakpasses\zerocount + % \lettonothing\currentalignpass +\stopsetups + +% see spac-pas-imp-tests.mkxl + +\lettonothing\currentalignpass + +\permanent\protected\def\setupalignpass[#1]% + {\cdef\tempstring{align:pass:#1}% + \ifx\tempstring\currentalignpass\else + \linebreakpasses\plusone % none will reset this + \let\currentalignpass\tempstring + \fastsetup\currentalignpass + \relax % to be sure + \fi} + +\appendtoks + \ifcase\linebreakpasses\else + \fastsetup\currentalignpass + \fi +\to \everybodyfont + +%D This sort of belongs here: + +\permanent\protected\def\optionalword#1% + {\removeunwantedspaces\wordboundary\discretionary{}{}{#1}} + +%D \starttyping +%D \dostepwiserecurse{80}{100}{1}{\hsize #1mm +%D Many readers will skim over formulas on their first reading +%D of your exposition. Therefore, your sentences should flow +%D smoothly when all but the simplest formulas are replaced by +%D \quotation {blah} or some other \optionalword {grunting }noise. +%D \page +%D } +%D \stoptyping + +% Musical timestamp: Archive's Call to Arms & Angels (and Super8) in loop mode +% (June 2023, weirdly I had missed those releases in 2022). + +% \dorecurse{41}{line #1\par} +% here \singlelinepenalty20000 \updateparagraphpenalties here here + +\protect diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt index d8f5169f191..5e8bb5a2211 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt @@ -17,31 +17,31 @@ local formatters = string.formatters local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local kern_code = nodecodes.kern -local penalty_code = nodecodes.penalty -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local unset_code = nodecodes.unset -local math_code = nodecodes.math -local rule_code = nodecodes.rule -local marginkern_code = nodecodes.marginkern - -local leaders_code = gluecodes.leaders -local lineskip_code = gluecodes.lineskip -local baselineskip_code = gluecodes.baselineskip - -local strutrule_code = nodes.rulecodes.strut -local linelist_code = nodes.listcodes.line +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local kern_code = nodecodes.kern +local penalty_code = nodecodes.penalty +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local unset_code = nodecodes.unset +local math_code = nodecodes.math +local rule_code = nodecodes.rule +local marginkern_code = nodecodes.marginkern + +local leaders_code = gluecodes.leaders +local lineskip_code = gluecodes.lineskip +local baselineskip_code = gluecodes.baselineskip + +local strutrule_code = nodes.rulecodes.strut +local linelist_code = nodes.listcodes.line local texlists = tex.lists local settexattribute = tex.setattribute local texgetdimen = tex.getdimen -local d_strutht = tex.isdimen("strutht") -local d_strutdp = tex.isdimen("strutdp") +local d_strutht = tex.isdimen("strutht") +local d_strutdp = tex.isdimen("strutdp") local newindex = lua.newindex @@ -101,15 +101,15 @@ local hpack_nodes = nuts.hpack local find_node_tail = nuts.tail local setglue = nuts.setglue -local a_visual = attributes.private("visual") -local a_snapmethod = attributes.private("snapmethod") -local a_profilemethod = attributes.private("profilemethod") ------ a_specialcontent = attributes.private("specialcontent") +local a_visual = attributes.private("visual") +local a_snapmethod = attributes.private("snapmethod") +local a_profilemethod = attributes.private("profilemethod") +----- a_specialcontent = attributes.private("specialcontent") local variables = interfaces.variables -local v_none = variables.none -local v_fixed = variables.fixed -local v_strict = variables.strict +local v_none = variables.none +local v_fixed = variables.fixed +local v_strict = variables.strict local setcolor = nodes.tracers.colors.set local settransparency = nodes.tracers.transparencies.set diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx index 06038d8678c..c3381ab5bfd 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx @@ -70,16 +70,16 @@ method {\profileparameter\c!method}% \relax} -\tolerant\protected\def\spac_profile_start#profile#spacer[#settings]% +\tolerant\protected\def\spac_profile_start#profile#spacer[#S#settings]% {\begingroup \ifparameter#settings\or - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \setupcurrentprofile[#settings]% \orelse\ifhastok={#profile}% \let\currentprofile\v!none \setupcurrentprofile[#profile]% \else - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \fi \spac_profile_set \profileparameter\c!before} @@ -89,14 +89,14 @@ \profileparameter\c!after \endgroup} -\permanent\protected\def\startprofile[#profile]% +\permanent\protected\def\startprofile[#S#profile]% {\spac_profile_start{#profile}} \permanent\protected\def\stopprofile {\spac_profile_stop} \permanent\protected\def\setprofile[#profile]% - {\edef\currentprofile{#profile}% + {\cdef\currentprofile{#profile}% \spac_profile_set} \permanent\protected\def\resetprofile @@ -110,16 +110,16 @@ \setprofile[\m_spac_profile_asked]% \fi} -\permanent\tolerant\protected\def\profiledbox[#profile]#spacer[#settings]% +\permanent\tolerant\protected\def\profiledbox[#S#profile]#spacer[#S#settings]% {\vbox\bgroup \ifparameter#settings\or - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \setupcurrentprofile[#settings]% \orelse\ifhastok={#profile}% \let\currentprofile\v!none \setupcurrentprofile[#profile]% \else - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \fi \dowithnextbox {\profilegivenbox\currentprofile\nextbox @@ -129,7 +129,7 @@ \permanent\protected\def\profilegivenbox#profile#box% {\begingroup - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \clf_profilebox box \numexpr#box\relax height \dimexpr\profileparameter\c!height\relax @@ -169,7 +169,7 @@ \relax} \permanent\tolerant\protected\def\setlineprofile[#profile]% - {\edef\currentlineprofile{#profile}% + {\cdef\currentlineprofile{#profile}% \spac_line_profile_set} \permanent\protected\def\resetlineprofile diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt index a2b02c34c3e..5fc5f7150fd 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt @@ -59,7 +59,6 @@ local texgetbox = tex.getbox local buildpage = tex.triggerbuildpage local variables = interfaces.variables -local implement = interfaces.implement local v_local = variables["local"] local v_global = variables["global"] @@ -97,26 +96,26 @@ local trace_specials = false trackers.register("vspacing.specials", fun local remove_math_skips = true directives.register("vspacing.removemathskips", function(v) remnove_math_skips = v end) -local report_vspacing = logs.reporter("vspacing","spacing") -local report_collapser = logs.reporter("vspacing","collapsing") -local report_snapper = logs.reporter("vspacing","snapping") -local report_specials = logs.reporter("vspacing","specials") +local report_vspacing = logs.reporter("vspacing","spacing") +local report_collapser = logs.reporter("vspacing","collapsing") +local report_snapper = logs.reporter("vspacing","snapping") +local report_specials = logs.reporter("vspacing","specials") -local a_skipcategory = attributes.private('skipcategory') -local a_skippenalty = attributes.private('skippenalty') -local a_skiporder = attributes.private('skiporder') -local a_snapmethod = attributes.private('snapmethod') -local a_snapvbox = attributes.private('snapvbox') +local a_skipcategory = attributes.private('skipcategory') +local a_skippenalty = attributes.private('skippenalty') +local a_skiporder = attributes.private('skiporder') +local a_snapmethod = attributes.private('snapmethod') +local a_snapvbox = attributes.private('snapvbox') -local d_bodyfontstrutheight = tex.isdimen("bodyfontstrutheight") -local d_bodyfontstrutdepth = tex.isdimen("bodyfontstrutdepth") -local d_globalbodyfontstrutheight = tex.isdimen("globalbodyfontstrutheight") -local d_globalbodyfontstrutdepth = tex.isdimen("globalbodyfontstrutdepth") ------ d_strutht = tex.isdimen("strutht") -local d_strutdp = tex.isdimen("strutdp") -local d_spac_overlay = tex.isdimen("d_spac_overlay") +local d_bodyfontstrutheight = tex.isdimen("bodyfontstrutheight") +local d_bodyfontstrutdepth = tex.isdimen("bodyfontstrutdepth") +local d_globalbodyfontstrutheight = tex.isdimen("globalbodyfontstrutheight") +local d_globalbodyfontstrutdepth = tex.isdimen("globalbodyfontstrutdepth") +----- d_strutht = tex.isdimen("strutht") +local d_strutdp = tex.isdimen("strutdp") +local d_spac_overlay = tex.isdimen("d_spac_overlay") -local c_spac_vspacing_ignore_parskip = tex.iscount("c_spac_vspacing_ignore_parskip") +local c_spac_vspacing_ignore_parskip = tex.iscount("c_spac_vspacing_ignore_parskip") local nuts = nodes.nuts local tonut = nuts.tonut @@ -129,8 +128,6 @@ local getlist = nuts.getlist local setlist = nuts.setlist local getattr = nuts.getattr local setattr = nuts.setattr -local setattrs = nuts.setattrs -local getattrs = nuts.getattrs local getsubtype = nuts.getsubtype local getbox = nuts.getbox local getwhd = nuts.getwhd @@ -182,23 +179,23 @@ local gluecodes = nodes.gluecodes ----- penaltycodes = nodes.penaltycodes ----- listcodes = nodes.listcodes -local penalty_code = nodecodes.penalty -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local rule_code = nodecodes.rule -local par_code = nodecodes.par -local boundary_code = nodecodes.boundary +local penalty_code = nodecodes.penalty +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local rule_code = nodecodes.rule +local par_code = nodecodes.par +local boundary_code = nodecodes.boundary -local userskip_code = gluecodes.userskip -local lineskip_code = gluecodes.lineskip -local baselineskip_code = gluecodes.baselineskip -local parskip_code = gluecodes.parskip -local topskip_code = gluecodes.topskip -local splittopskip_code = gluecodes.splittopskip +local userskip_code = gluecodes.userskip +local lineskip_code = gluecodes.lineskip +local baselineskip_code = gluecodes.baselineskip +local parskip_code = gluecodes.parskip +local topskip_code = gluecodes.topskip +local splittopskip_code = gluecodes.splittopskip -local linelist_code = nodes.listcodes.line +local linelist_code = nodes.listcodes.line local setvisual = function(...) setvisual = nuts.setvisual return setvisual(...) end @@ -795,6 +792,9 @@ elseif method == 2 then -- quite okay but more memory due to attributes (not many) + local setattrs = nuts.setattrs + local getattrs = nuts.getattrs + setspecification = function(n,category,penalty,order) setattrs(n,false,a_skipcategory,category or nil,a_skippenalty,penalty or nil,a_skiporder,order or 1) end @@ -889,11 +889,14 @@ do local k_fixed = variables.fixed local k_flexible = variables.flexible + local k_limit = variables.limit local k_category = "category" local k_penalty = "penalty" local k_order = "order" + local setoptions = nuts.setoptions + function vspacing.setmap(from,to) map[from] = to end @@ -922,6 +925,7 @@ do local b_order = false local b_fixed = false local b_grid = false + local b_limit = false local pattern = nil @@ -939,6 +943,7 @@ do b_penalty = false b_order = false b_fixed = b_grid + b_limit = false end local function after() @@ -956,8 +961,11 @@ do local function inject() local n = new_glue(b_amount,b_stretch,b_shrink) setspecification(n,b_category,b_penalty,b_order or 1) - setvisual(k) + setvisual(n) write_node(n) + if b_limit then + setoptions(n,tex.glueoptioncodes.limit) + end -- todo: inject via value end @@ -1010,6 +1018,8 @@ do b_penalty = penalty flush() end + elseif keyword == k_limit then + b_limit = true else local amount, stretch, shrink multiplier = tonumber(multiplier) or 1 @@ -1170,10 +1180,10 @@ do local insertnodeafter = nuts.insertafter local insertnodebefore = nuts.insertbefore - local abovedisplayskip_code = gluecodes.abovedisplayskip - local belowdisplayskip_code = gluecodes.belowdisplayskip - local abovedisplayshortskip_code = gluecodes.abovedisplayshortskip - local belowdisplayshortskip_code = gluecodes.belowdisplayshortskip + local abovedisplayskip_code = gluecodes.abovedisplayskip + local belowdisplayskip_code = gluecodes.belowdisplayskip + local abovedisplayshortskip_code = gluecodes.abovedisplayshortskip + local belowdisplayshortskip_code = gluecodes.belowdisplayshortskip local w, h, d = 0, 0, 0 ----- w, h, d = 100*65536, 65536, 65536 @@ -1437,7 +1447,9 @@ do while c and c ~= n do local id = getid(c) if id == glue_code then - skips = skips + getwidth(c) + local w = getwidth(c) + skips = skips + w + setglue(c,w) -- nil stretch elseif id == kern_code then skips = skips + getkern(c) end @@ -1448,7 +1460,9 @@ do while c and c ~= n and c ~= l do local id = getid(c) if id == glue_code then - skips = skips + getwidth(c) + local w = getwidth(c) + skips = skips + w + setglue(c,w) -- nil stretch elseif id == kern_code then skips = skips + getkern(c) end @@ -1787,6 +1801,9 @@ do -- trace_done("removed penalty",current) -- end -- head, current = remove_node(head,current,true) + if trace then + trace_done("kept penalty",current) + end current = getnext(current) elseif id == kern_code then if snap and trace_vsnapping and getkern(current) ~= 0 then @@ -2221,10 +2238,15 @@ do end end - -- ugly code: we get partial lists (check if this stack is still okay) ... and we run - -- into temp nodes (sigh) - - -- this really need a rework + -- This really need a rework. although, it has now been stable for 15 years so why + -- mess with it. We get sequences like these where penalties come from the par + -- builder: + -- + -- glue + -- glue hlist + -- glue hlist penalty glue hlist penalty glue hlist + -- + -- and in context we never use penalties other than spacing related local forceflush = false @@ -2234,6 +2256,8 @@ do local flush = false stackhack = true -- todo: only when grid snapping once enabled +-- local t = { } for n, id in nextnode, newhead do t[#t+1] = nodecodes[id] end report_vspacing("page handler: % t",t) + for n, id, subtype in nextnode, newhead do if id ~= glue_code then flush = true @@ -2360,7 +2384,7 @@ do end) local function ignoredepth() - return texgetdimen("ignoredepthcriterium") -- -65536000 + return texgetdimen("ignoredepthcriterion") -- -65536000 end -- A previous version analyzed the number of lines moved to the next page in @@ -2445,7 +2469,7 @@ do local abs = math.abs -- local last = nil local vmode_code = tex.modelevels.vertical - local temp_code = nodecodes.temp + local temp_code = nodecodes.temp local texgetnest = tex.getnest local texgetlist = tex.getlist local getnodetail = nodes.tail @@ -2550,10 +2574,10 @@ do -- end -- end - local hlist_code = nodes.nodecodes.hlist - local insert_code = nodes.nodecodes.insert - local mark_code = nodes.nodecodes.mark - local line_code = nodes.listcodes.line + local hlist_code = nodes.nodecodes.hlist + local insert_code = nodes.nodecodes.insert + local mark_code = nodes.nodecodes.mark + local line_code = nodes.listcodes.line -- local nuts = nodes.nuts -- local getid = nuts.getid @@ -2616,6 +2640,7 @@ do local strutdp = texgetdimen(d_strutdp) local delta = strutdp - getdepth(n) if delta > 0 then + --- also pagelastdepth setdepth(n,strutdp) texset("pagetotal",texget("pagetotal") + delta) texset("pagedepth",strutdp) @@ -2628,7 +2653,11 @@ do elseif id == insert_code or id == mark_code then -- prev else +-- if id == glue_code then +-- print(gluecodes[subtype],nuts.getwidth(n)) +-- else break +-- end end end end @@ -2734,25 +2763,27 @@ end do - interfaces.implement { + local implement = interfaces.implement + + implement { name = "injectvspacing", actions = vspacing.inject, arguments = { "integer", "string" }, } - interfaces.implement { + implement { name = "injectvpenalty", actions = vspacing.injectpenalty, arguments = "integer", } - interfaces.implement { + implement { name = "injectvskip", actions = vspacing.injectskip, arguments = "dimension", } - interfaces.implement { + implement { name = "injectdisable", actions = vspacing.injectdisable, } @@ -2895,10 +2926,6 @@ do actions = vspacing.forcepageflush } -end - -do - implement { name = "injectzerobaselineskip", protected = true, diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl index 640d493b961..71910818b64 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl @@ -92,16 +92,28 @@ \lettonothing\bodyfontinterlinespace \fi +% \permanent\protected\def\presetnormallineheight % each bodyfont +% {\edef\normallineheight{\interlinespaceparameter\c!line}% +% \iflocalinterlinespace \else +% \edef\m_spac_normallineheight{\bodyfontinterlinespace}% +% \ifempty\m_spac_normallineheight \else +% \let\normallineheight\m_spac_normallineheight +% \fi +% \fi} + \permanent\protected\def\presetnormallineheight % each bodyfont {\edef\normallineheight{\interlinespaceparameter\c!line}% \iflocalinterlinespace \else \edef\m_spac_normallineheight{\bodyfontinterlinespace}% - \ifempty\m_spac_normallineheight \else + \ifempty\m_spac_normallineheight + \orelse\ifchkdimension\m_spac_normallineheight\or \let\normallineheight\m_spac_normallineheight + \else + \edef\normallineheight{\todimension\m_spac_normallineheight\dimexpr\fontbody\relax}% \fi \fi} -\permanent\protected\def\setupspecifiedinterlinespace[#1]% +\permanent\protected\def\setupspecifiedinterlinespace[#S#1]% {\setupcurrentinterlinespace[#1]% \spac_linespacing_setup_specified_interline_space} @@ -183,14 +195,14 @@ \installmacrostack\currentinterlinespace -\permanent\overloaded\tolerant\protected\def\setupinterlinespace[#1]% +\permanent\overloaded\tolerant\protected\def\setupinterlinespace[#S#1]% {\ifarguments - \settrue\interlinespaceisset + \interlinespaceisset\conditionaltrue \spac_linespacing_synchronize_local \else - \settrue\interlinespaceisset + \interlinespaceisset\conditionaltrue \ifcsname\namedinterlinespacehash{#1}\s!parent\endcsname - \edef\currentinterlinespace{#1}% + \cdef\currentinterlinespace{#1}% \spac_linespacing_setup_specified_interline_space %\dosetupspecifiedinterlinespaceindeed \else @@ -198,15 +210,15 @@ \fi \fi} -\def\spac_linespacing_setup_specified_or_relative[#1]% +\def\spac_linespacing_setup_specified_or_relative[#S#1]% {\doifelseassignment{#1}\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]% - \the\iflocalinterlinespace\everysetuplocalinterlinespace\else\everysetupglobalinterlinespace\fi} + \expandtoks\iflocalinterlinespace\everysetuplocalinterlinespace\else\everysetupglobalinterlinespace\fi} \def\spac_linespacing_synchronize_local % adapts to the font {\localinterlinespacetrue \setfontparameters \updateraggedskips % funny one here - \the\everysetuplocalinterlinespace + \expandtoks\everysetuplocalinterlinespace \localinterlinespacefalse} \permanent\protected\def\dosetupcheckedinterlinespace#1% often a chain @@ -218,10 +230,10 @@ \let\currentinterlinespace\p_spac_checked_interlinespace \spac_linespacing_setup_specified_interline_space % \dosetupspecifiedinterlinespaceindeed \iflocalinterlinespace - \the\everysetuplocalinterlinespace + \expandtoks\everysetuplocalinterlinespace \else \localinterlinespacetrue - \the\everysetuplocalinterlinespace + \expandtoks\everysetuplocalinterlinespace \localinterlinespacefalse \fi \pop_macro_currentinterlinespace @@ -229,15 +241,15 @@ \normalexpanded{\noexpand\doifelseassignment{\p_spac_checked_interlinespace}% \setupspecifiedinterlinespace\setuprelativeinterlinespace[\p_spac_checked_interlinespace]}% \iflocalinterlinespace - \the\everysetuplocalinterlinespace + \expandtoks\everysetuplocalinterlinespace \else \localinterlinespacetrue - \the\everysetuplocalinterlinespace + \expandtoks\everysetuplocalinterlinespace \localinterlinespacefalse \fi \fi} -\permanent\protected\def\setuplocalinterlinespace[#1]% +\permanent\protected\def\setuplocalinterlinespace[#S#1]% {\localinterlinespacetrue \push_macro_currentinterlinespace \setupinterlinespace[#1]% @@ -357,8 +369,8 @@ \installcorenamespace{whitespacemethod} -\newgluespec \s_spac_whitespace_parskip \s_spac_whitespace_parskip\zeropoint -\newconditional\c_spac_whitespace_flexible \settrue\c_spac_whitespace_flexible +\newgluespec \s_spac_whitespace_parskip +\newconditional\c_spac_whitespace_flexible \c_spac_whitespace_flexible\conditionaltrue \newconstant \c_spac_whitespace_grid_mode % option in layout / 1=permit_half_lines %def\v_spac_whitespace_current{\zeropoint} @@ -367,7 +379,7 @@ \permanent\tolerant\protected\def\setupwhitespace[#1]% {\ifarguments \spac_whitespace_setup_nop - \orelse\iftok{#1}\emptytoks + \orelse\ifempty{#1}% \spac_whitespace_setup_nop \else \edef\v_spac_whitespace_current{#1}% @@ -400,7 +412,7 @@ \fi} \def\spac_whitespace_setup_grid - {\setfalse\c_spac_whitespace_flexible + {\c_spac_whitespace_flexible\conditionalfalse \ifdim\s_spac_whitespace_parskip>\zeropoint \s_spac_whitespace_parskip \ifcase\c_spac_whitespace_grid_mode @@ -420,13 +432,13 @@ {\defcsname\??whitespacemethod#1\endcsname{#2}} \installwhitespacemethod \v!fix {} -\installwhitespacemethod \v!fixed {\setfalse\c_spac_whitespace_flexible} -\installwhitespacemethod \v!flexible {\settrue \c_spac_whitespace_flexible} +\installwhitespacemethod \v!fixed {\c_spac_whitespace_flexible\conditionalfalse} +\installwhitespacemethod \v!flexible {\c_spac_whitespace_flexible\conditionaltrue} \installwhitespacemethod \v!line {\s_spac_whitespace_parskip \baselineskip} \installwhitespacemethod \v!halfline {\s_spac_whitespace_parskip .5\baselineskip} \installwhitespacemethod \v!quarterline {\s_spac_whitespace_parskip.25\baselineskip} -\installwhitespacemethod \v!none {\s_spac_whitespace_parskip \zeropoint} +\installwhitespacemethod \v!none {\s_spac_whitespace_parskip \zeroskip} \installwhitespacemethod \v!big {\s_spac_whitespace_parskip \bigskipamount} \installwhitespacemethod \v!medium {\s_spac_whitespace_parskip \medskipamount} \installwhitespacemethod \v!small {\s_spac_whitespace_parskip \smallskipamount} @@ -441,8 +453,8 @@ \fi\relax} \permanent\protected\def\forgetparskip - {\s_spac_whitespace_parskip\zeropoint - \parskip\zeropoint + {\s_spac_whitespace_parskip\zeroskip + \parskip\zeroskip \let\v_spac_whitespace_current\v!none} \appendtoks @@ -464,7 +476,7 @@ % todo: when packed blocks blank, we need to enable forced -\newconditional\c_spac_packed_blank \settrue\c_spac_packed_blank +\newconditional\c_spac_packed_blank \c_spac_packed_blank\conditionaltrue \newinteger \c_spac_packed_level \permanent\tolerant\protected\def\startpacked[#1]% @@ -474,7 +486,11 @@ \begingroup \whitespace % not combined \directcheckedvspacing\v!disable % \blank[\v!disable]% or \inhibitblank - \doifelse{#1}\v!blank\settrue\setfalse\c_spac_packed_blank + \ifcstok{#1}\v!blank + \c_spac_packed_blank\conditionaltrue + \else + \c_spac_packed_blank\conditionalfalse + \fi \setupwhitespace[\v!none]% or \forgetparskip \fi \fi} @@ -511,32 +527,20 @@ \let\v_spac_lines_around_action_set\relax -\lettonothing\m_spac_lines_around +\lettonothing\spac_lines_action_around_before +\lettonothing\spac_lines_action_around_after \newconstant\c_spac_lines_correction_mode -\defcsname\??linesaround\v!blank \endcsname{\blank} -\letcsname\??linesaround\empty \endcsname\relax -\defcsname\??linesaround\s!unknown\endcsname{\directcheckedvspacing\m_spac_lines_around} % \blank[\m_spac_lines_around]} +\installcorenamespace{linecorrection} -\def\spac_lines_action_around % we used to let this one but it's cleaner this way - {\csname\??linesaround % i.e. do it twice - \ifcsname\??linesaround\m_spac_lines_around\endcsname\m_spac_lines_around\else\s!unknown\fi - \endcsname} +\installsetuponlycommandhandler \??linecorrection {linecorrection} -\permanent\tolerant\protected\def\startlinecorrection [#1]{\spac_lines_start_correction\plusone{#1}} -\permanent\tolerant\protected\def\startlocallinecorrection[#1]{\spac_lines_start_correction\plustwo{#1}} +\permanent\tolerant\protected\def\startlinecorrection [#S#1]{\spac_lines_start_correction\plusone{#1}} +\permanent\tolerant\protected\def\startlocallinecorrection[#S#1]{\spac_lines_start_correction\plustwo{#1}} -\permanent\protected\def\spac_lines_start_correction#1#2% - {\endgraf - \begingroup - \setconstant\c_spac_lines_correction_mode#1% - \edef\m_spac_lines_around{#2}% - \spac_lines_action_around - \d_spac_prevdepth\prevdepth - \spac_lines_initialize_corrections - \offbaselinecorrection % ??? - \setbox\scratchbox\spac_lines_vbox\bgroup +\permanent\protected\def\spac_lines_start_correction_box + {\setbox\scratchbox\spac_lines_vbox\bgroup \ifcase\c_spac_lines_correction_mode % nothing \or @@ -549,35 +553,75 @@ \fi \ignorespaces} -\permanent\protected\def\spac_lines_stop_correction +\permanent\protected\def\spac_lines_stop_correction_box {\removeunwantedspaces - \egroup + \egroup} + +\permanent\protected\def\spac_lines_start_correction#1#2% + {\endgraf + \begingroup + \c_spac_lines_correction_mode#1% + % a bit of history + \ifhastok={#2}% + \setupcurrentlinecorrection[#2]% + \def\spac_lines_action_around_before{\linecorrectionparameter\c!before}% + \def\spac_lines_action_around_after {\linecorrectionparameter\c!after}% + \orelse\ifempty{#2}% + \def\spac_lines_action_around_before{\linecorrectionparameter\c!before}% + \def\spac_lines_action_around_after {\linecorrectionparameter\c!after}% + \orelse\ifcstok{#2}\v!blank + \def\spac_lines_action_around_before{\blank}% + \let\spac_lines_action_around_after \spac_lines_action_around_before + \else + \def\spac_lines_action_around_before{\blank[#2]}% + \let\spac_lines_action_around_after \spac_lines_action_around_before + \fi \ifgridsnapping + \spac_lines_start_correction_ongrid + \else + \spac_lines_start_correction_normal + \fi} + +\permanent\protected\def\spac_lines_stop_correction + {\ifgridsnapping \spac_lines_stop_correction_ongrid \else \spac_lines_stop_correction_normal \fi \endgroup} -\protected\def\spac_lines_stop_correction_ongrid - {\directcheckedvspacing\v!white % \blank[\v!white]% - \spac_lines_action_around - \snaptogrid\hpack{\box\scratchbox}% - \directcheckedvspacing\v!white - \spac_lines_action_around} +\permanent\protected\def\spac_lines_start_correction_normal + {\spac_lines_action_around_before + \d_spac_prevdepth\prevdepth + \spac_lines_initialize_corrections + \offbaselinecorrection % ??? + \spac_lines_start_correction_box} -\protected\def\spac_lines_stop_correction_normal - {\directcheckedvspacing\v!nowhite % \blank[\v!nowhite]% - \ifdim\parskip>\zeropoint - % too fuzzy otherwise +\newconstant\linecorrectionmode + +% \linecorrectionmode\plusone % better for end of column and depth alignment + +\permanent\protected\def\spac_lines_stop_correction_normal + {\spac_lines_stop_correction_box + \ifnum\linecorrectionmode=\plusone + \forcestrutdepth + \iftrue + \penalty\zerocount % works too + \else + %\tracingpages\plusone \tracingonline\plustwo + \pageboundary\plustenthousand % becomes a penalty (after triggering the callback) (experimental!) + %\tracingpages\zerocount + \fi \else - % doesn't like whitespace - \ifdim\d_spac_prevdepth<\maxdimen + \directcheckedvspacing\v!nowhite % \blank[\v!nowhite]% + \ifdim\parskip>\zeropoint + % too fuzzy otherwise + \orelse\ifdim\d_spac_prevdepth<\maxdimen \unless\ifdim\d_spac_prevdepth<\zeropoint \ifdim\d_spac_prevdepth<\strutdp \relax \pushlastnode \ifdim\d_spac_prevdepth>\zeropoint - \kern-\d_spac_prevdepth + \kern-\d_spac_prevdepth \fi \kern\strutdp \prevdepth\strutdp @@ -590,7 +634,7 @@ % \blank[\v!white,\the\d_spac_lines_correction_before]% \blank[\v!white]\dotopbaselinecorrection \directcheckedvspacing{\v!white,\the\d_spac_lines_correction_before}% \blank[\v!white]\dotopbaselinecorrection \fi - \nointerlineskip % new + \nointerlineskip % relatively new \noindent % not \dontleavehmode ! \ifcase\c_spac_lines_correction_mode % nothing @@ -610,7 +654,24 @@ \directcheckedvspacing{\v!white,\the\d_spac_lines_correction_after}% \dobotbaselinecorrection % \allowbreak % new, otherwise problems when many in a row \prevdepth\strutdp - \spac_lines_action_around} + \spac_lines_action_around_after} + +% this needs checking: a double before .. use lmtx tricks + +\permanent\protected\def\spac_lines_start_correction_ongrid + {\spac_lines_action_around_before + \d_spac_prevdepth\prevdepth + \spac_lines_initialize_corrections + \offbaselinecorrection % ??? + \spac_lines_start_correction_box} + +\permanent\protected\def\spac_lines_stop_correction_ongrid + {\spac_lines_stop_correction_box + \directcheckedvspacing\v!white % \blank[\v!white]% + \spac_lines_action_around_before + \snaptogrid\hpack{\box\scratchbox}% + \directcheckedvspacing\v!white + \spac_lines_action_around_after} \aliased\let\stoplinecorrection \spac_lines_stop_correction \aliased\let\stoplocallinecorrection\spac_lines_stop_correction @@ -712,22 +773,48 @@ \vskip-\openstrutheight \fi} +% \permanent\protected\def\settopskip % the extra test is needed for the lbr family +% {\topskip +% \ifgridsnapping +% \zeropoint +% \else +% \systemtopskipfactor\globalbodyfontsize +% \ifcase\bottomraggednessmode % ragged bottom +% \s!plus +% \ifnum\ntopskipfactor<\zerocount +% 5\globalbodyfontsize % old hard coded value +% \else +% \ntopskipfactor\openlineheight +% \fi +% \fi +% \fi +% %\relax +% \topskipgap\topskip +% \advanceby\topskipgap -\openstrutheight\relax +% \ifdim\minimumstrutheight>\zeropoint +% \ifdim\topskip<\minimumstrutheight +% \topskip\minimumstrutheight\relax +% \fi +% \else +% \ifdim\topskip<\strutheightfactor\openlineheight +% \topskip\strutheightfactor\openlineheight\relax +% \fi +% \fi} + \permanent\protected\def\settopskip % the extra test is needed for the lbr family {\topskip \ifgridsnapping - \zeropoint + \zeroskip + \initialpageskip\zeroskip \else \systemtopskipfactor\globalbodyfontsize - \ifcase\bottomraggednessmode % ragged bottom - \s!plus - \ifnum\ntopskipfactor<\zerocount - 5\globalbodyfontsize % old hard coded value - \else - \ntopskipfactor\openlineheight + \relax + \initialpageskip\zeropoint + \ifcase\bottomraggednessmode % ragged bottom + \s!plus \ntopskipfactor\openlineheight \fi - \fi + \relax \fi - %\relax \topskipgap\topskip \advanceby\topskipgap -\openstrutheight\relax \ifdim\minimumstrutheight>\zeropoint @@ -752,10 +839,15 @@ \lineskip \usedlineskip \lineskiplimit\usedlineskiplimit} +% \permanent\protected\def\flexiblebaselines +% {\baselineskip \usedbaselineskip +% \lineskip 1\usedlineskip \s!plus 1\s!fill +% \lineskiplimit \usedlineskiplimit} + \permanent\protected\def\flexiblebaselines - {\baselineskip \usedbaselineskip - \lineskip 1\usedlineskip \s!plus 1\s!fill - \lineskiplimit\usedlineskiplimit} + {\baselineskip 1\usedbaselineskip \s!plus 1\s!fill + \lineskip \usedlineskip + \lineskiplimit \usedlineskiplimit} \permanent\protected\def\setnormalbaselines % used in overload {\ifdim\normallineheight>\zeropoint @@ -889,14 +981,14 @@ \ifdim\minimumstrutheight>\zeropoint \minimumstrutheight \else - \strutheightfactor\dimexpr\normallineheight + \strutheightfactor\dimexpr\normallineheight\relax \fi \relax \strutdp\spacingfactor\dimexpr \ifdim\minimumstrutdepth>\zeropoint \minimumstrutdepth \else - \strutdepthfactor\dimexpr\normallineheight + \strutdepthfactor\dimexpr\normallineheight\relax \fi \relax \dosetstrut} @@ -1080,7 +1172,7 @@ \newtoks\everysetnostrut \permanent\protected\def\setnostrut - {\the\everysetnostrut} + {\expandtoks\everysetnostrut} \appendtoks % \setbox\strutbox\copy\nostrutbox @@ -1120,7 +1212,7 @@ %\boundary\plusone \penalty\plustenthousand %\boundary\plusone - \hskip\zeropoint} + \hskip\zeroskip} \permanent\protected\def\endstrut {% \ifmmode M\fi @@ -1140,7 +1232,7 @@ \def\spac_struts_end {\penalty\plustenthousand %\boundary\plustwo - \hskip\zeropoint + \hskip\zeroskip %\boundary\plustwo \strut \boundary\plustwo} @@ -1172,7 +1264,7 @@ \setstrut} \ifdefined\setfontparameters \else - \def\setfontparameters{\the\everybodyfont} + \def\setfontparameters{\expandtoks\everybodyfont} \fi %D Keyword based strutting: @@ -1197,14 +1289,14 @@ \pushoverloadmode \overloaded\permanent\protected\def\offinterlineskip % later we will overload this with a push pop - {\baselineskip \ignoredepthcriterium % -\thousandpoint - \lineskip \zeropoint + {\baselineskip \ignoredepthcriterion % -\thousandpoint + \lineskip \zeroskip \lineskiplimit\maxdimen % We also need this here now; thanks to taco for figuring that out! \let\minimumlinedistance\zeropoint} \overloaded\permanent\protected\def\nointerlineskip - {\prevdepth\ignoredepthcriterium}% -\thousandpoint + {\prevdepth\ignoredepthcriterion}% -\thousandpoint \aliased\let\normaloffinterlineskip\offinterlineskip % knuth's original @@ -1276,16 +1368,9 @@ \permanent\protected\def\setpenalties#1#2#3% {\ifdefined#1% space before #3 prevents lookahead problems, needed when #3=text - \frozen#1\numexpr#2+\plusone\relax\space\doexpandedrecurse{\the\numexpr#2\relax}{ #3}\zerocount\relax + \frozen#1\numexpr#2+\plusone\relax\space\expandedrepeat\numexpr#2\relax{ #3}\zerocount\relax \fi} -% to be tested: -% -% \permanent\protected\def\setpenalties#1#2#3% -% {\ifdefined#1% space before #3 prevents lookahead problems, needed when #3=text -% \frozen#1\numexpr#2+\plusone\relax\space\expandedloop\plusone\numexpr#2\relax\plusone{ #3}\zerocount\relax -% \fi} - %D \macros %D {keeplinestogether} %D @@ -1310,29 +1395,26 @@ \global\enforced\let\restoreinterlinepenalty\spac_penalties_restore \fi} -\immutable\integerdef\defaultdisplaywidowpenalty 50 -\immutable\integerdef\defaultwidowpenalty 2000 % was: 1000 -\immutable\integerdef\defaultclubpenalty 2000 % was: 800 -\immutable\integerdef\defaultbrokenpenalty 100 -\immutable\integerdef\defaultdoublehyphendemerits 10000 -\immutable\integerdef\defaultfinalhyphendemerits 5000 -\immutable\integerdef\defaultadjdemerits 10000 - -\immutable\integerdef\defaultgriddisplaywidowpenalty 0 -\immutable\integerdef\defaultgridwidowpenalty 0 -\immutable\integerdef\defaultgridclubpenalty 0 -\immutable\integerdef\defaultgridbrokenpenalty 0 -\immutable\integerdef\defaultgriddoublehyphendemerits 10000 % always was so -\immutable\integerdef\defaultgridfinalhyphendemerits 5000 % always was so -\immutable\integerdef\defaultgridadjdemerits 10000 % always was so +%D Here now only deal with penalties that relate to vertical breaking; the +%D horizontal ones have been moved to spac-pas. + +\immutable\integerdef\defaultdisplaywidowpenalty 50 +\immutable\integerdef\defaultwidowpenalty 2000 % was: 1000 +\immutable\integerdef\defaultclubpenalty 2000 % was: 800 +\immutable\integerdef\defaultbrokenpenalty 100 + +\immutable\integerdef\defaultgriddisplaywidowpenalty \zerocount +\immutable\integerdef\defaultgridwidowpenalty \zerocount +\immutable\integerdef\defaultgridclubpenalty \zerocount +\immutable\integerdef\defaultgridbrokenpenalty \zerocount + +% \linebreakcriterion\optimallinebreakcriterion +% \divide \adjdemerits \plustwo \permanent\protected\def\nopenalties - {\frozen\widowpenalty \zerocount - \frozen\clubpenalty \zerocount - \frozen\brokenpenalty \zerocount - \frozen\doublehyphendemerits\zerocount - \frozen\finalhyphendemerits \zerocount - \frozen\adjdemerits \zerocount} + {\frozen\widowpenalty \zerocount + \frozen\clubpenalty \zerocount + \frozen\brokenpenalty\zerocount} \permanent\protected\def\setdefaultpenalties {\directsetup{\systemsetupsprefix\s!default}} @@ -1341,7 +1423,6 @@ \resetpenalties\widowpenalties \resetpenalties\clubpenalties \resetpenalties\interlinepenalties - \resetpenalties\orphanpenalties \stopsetups %D We use \directsetup because it's faster and we know there is no csl: @@ -1354,9 +1435,6 @@ \frozen\clubpenalty \defaultclubpenalty \frozen\displaywidowpenalty \defaultdisplaywidowpenalty \frozen\brokenpenalty \defaultbrokenpenalty - \frozen\doublehyphendemerits\defaultdoublehyphendemerits - \frozen\finalhyphendemerits \defaultfinalhyphendemerits - \frozen\adjdemerits \defaultadjdemerits \stopsetups @@ -1368,9 +1446,6 @@ \frozen\clubpenalty \defaultgridclubpenalty \frozen\displaywidowpenalty \defaultgriddisplaywidowpenalty \frozen\brokenpenalty \defaultgridbrokenpenalty - \frozen\doublehyphendemerits\defaultgriddoublehyphendemerits - \frozen\finalhyphendemerits \defaultgridfinalhyphendemerits - \frozen\adjdemerits \defaultgridadjdemerits \stopsetups @@ -1384,14 +1459,9 @@ \setpenalties \clubpenalties \plustwo \maxdimen \setpenalties \orphanpenalties \zerocount \frozen \brokenpenalty \maxdimen - \frozen \doublehyphendemerits \defaultdoublehyphendemerits - \frozen \finalhyphendemerits \defaultfinalhyphendemerits - \frozen \adjdemerits \defaultadjdemerits \stopsetups -\setdefaultpenalties % will happen later in \setuplayout - %D To be checked: % \newbox\b_spac_struts_saved @@ -1428,9 +1498,10 @@ \def\spac_grids_set_local_snapping#1% {\ifgridsnapping - \doifsomething{#1}% - {\spac_grids_snap_value_set{#1}% - \c_attr_snapvbox\c_attr_snapmethod}% + \ifempty{#1}\else + \spac_grids_snap_value_set{#1}% + \c_attr_snapvbox\c_attr_snapmethod + \fi \fi} \def\spac_grids_expand_snapper#1% @@ -1577,8 +1648,14 @@ %D More might be added here: -\def\restoreglobalinterlinespace - {\mutable\let\normallineheight\globalbodyfontlineheight +% \def\restoreglobalinterlinespace +% {\mutable\let\normallineheight\globalbodyfontlineheight % mutable crashed at some point +% \bodyfontlineheight \globalbodyfontlineheight % s we have a bug deep down +% \bodyfontstrutheight\globalbodyfontstrutheight +% \bodyfontstrutdepth \globalbodyfontstrutdepth} + +\permanent\protected\def\restoreglobalinterlinespace + {\let\normallineheight\globalbodyfontlineheight \bodyfontlineheight \globalbodyfontlineheight \bodyfontstrutheight\globalbodyfontstrutheight \bodyfontstrutdepth \globalbodyfontstrutdepth} @@ -1629,31 +1706,47 @@ {\ifvbox\nextbox % this will go away \clf_vspacingcollapse\nextbox\relax % isn't that already done? \fi - \doifelsenothing{#1}{\spac_grids_snap_value_set\v!normal}{\spac_grids_snap_value_set{#1}}% + \ifempty{#1}% + \spac_grids_snap_value_set\v!normal + \else + \spac_grids_snap_value_set{#1}% + \fi \clf_vspacingsnap\nextbox\c_attr_snapmethod\relax \ifvbox\nextbox\vbox\else\hbox\fi attr \snapmethodattribute \zerocount {\box\nextbox}% no pack (?), we snap \egroup} -\def\spac_grids_check_nop - {\gridsnappingfalse - \resetsystemmode\v!grid - \spac_grids_snap_value_reset} - -\def\spac_grids_check_yes - {\gridsnappingtrue - \setsystemmode\v!grid - \spac_grids_snap_value_set\p_grid} +% \def\spac_grids_check_nop +% {\gridsnappingfalse +% \resetsystemmode\v!grid +% \spac_grids_snap_value_reset} + +% \def\spac_grids_check_yes +% {\gridsnappingtrue +% \setsystemmode\v!grid +% \spac_grids_snap_value_set\p_grid} + +% \permanent\protected\def\synchronizegridsnapping +% {\edef\p_grid{\layoutparameter\c!grid}% +% \ifx\p_grid\v!no % official +% \spac_grids_check_nop +% \orelse\ifx\p_grid\v!off % for taco and luigi +% \spac_grids_check_nop +% \orelse\ifempty\p_grid % to be sure +% \spac_grids_check_nop +% \else +% \spac_grids_check_yes +% \fi} \permanent\protected\def\synchronizegridsnapping {\edef\p_grid{\layoutparameter\c!grid}% - \ifx\p_grid\v!no % official - \spac_grids_check_nop - \orelse\ifx\p_grid\v!off % for taco and luigi - \spac_grids_check_nop - \orelse\ifempty\p_grid % to be sure - \spac_grids_check_nop + \ifcsname\??gridsnappers\p_grid\endcsname + \gridsnappingtrue + \setsystemmode\v!grid + \spac_grids_snap_value_set\p_grid \else - \spac_grids_check_yes + \gridsnappingfalse + \resetsystemmode\v!grid + \spac_grids_snap_value_reset \fi} \permanent\protected\def\setupgridsnapping[#1]% less overhead than setuplayout (needs testing) @@ -1777,23 +1870,23 @@ \gridboxvbox % calculated size {\getrawnoflines{#3}% \getnoflines{#3}% \scratchdimen\dimexpr#2+\lineheight\relax - \dorecurse\noflines + \localcontrolledrepeat\noflines {\strut \hskip-.5\lineheight\relax \ifcase\gridboxlinenomode\or \rlap - {\hskip\dimexpr.2\bodyfontsize+\scratchdimen\relax - \infofont\hbox to \emwidth{\hss\recurselevel}}% + {\kern\dimexpr.2\bodyfontsize+\scratchdimen\relax + \infofont\hbox to \emwidth{\hss\the\currentloopiterator}}% \or \llap - {\infofont\hbox to \emwidth{\hss\recurselevel}% - \hskip.2\bodyfontsize}% + {\infofont\hbox to \emwidth{\hss\the\currentloopiterator}% + \kern.2\bodyfontsize}% \fi \vrule \s!height \gridboxwidth \s!depth \gridboxwidth \s!width \scratchdimen - \par}} + \par}}% \vfill}} %D This has become obsolete: @@ -1804,17 +1897,19 @@ %D Helper: \protected\def\spac_helpers_assign_skip#1#2% ook nog \v!halfline+fuzzysnap - {\doifelse{#2}\v!line - {#1\ifgridsnapping - \bodyfontlineheight - \else - \openlineheight - \fi} - {\ifgridsnapping - \assigndimension{#2}{#1}{.25\bodyfontlineheight}{.5\bodyfontlineheight}\bodyfontlineheight - \else - \assigndimension{#2}{#1}\smallskipamount\medskipamount\bigskipamount - \fi}% + {\ifcstok{#2}\v!line + #1\ifgridsnapping + \bodyfontlineheight + \else + \openlineheight + \fi + \else + \ifgridsnapping + \assigndimension{#2}{#1}{.25\bodyfontlineheight}{.5\bodyfontlineheight}\bodyfontlineheight + \else + \assigndimension{#2}{#1}\smallskipamount\medskipamount\bigskipamount + \fi + \fi \relax} % \start \dosetstretch{.25em} \setuptolerance[tolerant,stretch] \input tufte \endgraf \stop @@ -1896,9 +1991,9 @@ % \c_attr_skippenalty \attributeunsetvalue % \c_attr_skiporder \attributeunsetvalue % \ifgridsnapping -% \settrue\c_space_vspacing_fixed +% \c_space_vspacing_fixed\conditionaltrue % \else -% \setfalse\c_space_vspacing_fixed +% \c_space_vspacing_fixed\conditionalfalse % \fi % \to \everybeforeblankhandling % @@ -1945,7 +2040,7 @@ \def\spac_vspacing_nop_ignore {\ifmmode\else\par\fi} \permanent\protected\def\directvspacing#1% - {\ifmmode\else\par\ifvmode\clf_injectvspacing\ifgridsnapping\plusone\else\zerocount\fi{\iftok{#1}\emptytoks\currentvspacing\else#1\fi}\fi\fi} + {\ifmmode\else\par\ifvmode\clf_injectvspacing\ifgridsnapping\plusone\else\zerocount\fi{\ifempty{#1}\currentvspacing\else#1\fi}\fi\fi} \permanent\protected\def\directdefaultvspacing {\ifinpagebody % somewhat weird @@ -1995,7 +2090,7 @@ %D The \type {category:4} is default. -\definevspacingamount[\v!none] [\zeropoint] [\zeropoint] +\definevspacingamount[\v!none] [\zeroskip] [\zeroskip] \definevspacingamount[\v!big] [\bigskipamount] [\bodyfontlineheight] \definevspacingamount[\v!medium] [\medskipamount] [.5\bodyfontlineheight] \definevspacingamount[\v!small] [\smallskipamount] [.25\bodyfontlineheight] @@ -2079,11 +2174,18 @@ \normalexpanded{\definevspacing[\v!samepage-\number#1-\number#2][penalty:\the\scratchcountertwo]}% \endgroup} +% \protected\def\spac_vspacing_define_same_page#1% +% {\dostepwiserecurse\c_spac_vspacing_special_done{#1}\plusone +% {\spac_vspacing_define_same_step\recurselevel\zerocount % before +% \spac_vspacing_define_same_step\recurselevel\plusone % after +% \spac_vspacing_define_same_step\recurselevel\plustwo}% % whatever +% \global\c_spac_vspacing_special_done#1\relax} + \protected\def\spac_vspacing_define_same_page#1% - {\dostepwiserecurse\c_spac_vspacing_special_done{#1}\plusone - {\spac_vspacing_define_same_step\recurselevel\zerocount % before - \spac_vspacing_define_same_step\recurselevel\plusone % after - \spac_vspacing_define_same_step\recurselevel\plustwo}% % whatever + {\localcontrolledloop\c_spac_vspacing_special_done=#1=\plusone + {\spac_vspacing_define_same_step\currentloopiterator\zerocount % before + \spac_vspacing_define_same_step\currentloopiterator\plusone % after + \spac_vspacing_define_same_step\currentloopiterator\plustwo}% % whatever \global\c_spac_vspacing_special_done#1\relax} \spac_vspacing_define_same_page{12} % 12 levels should be more than enough as a start @@ -2225,10 +2327,10 @@ \scratchwidth\dimexpr\wd\nextbox+\scratchdistance\relax \ifx\m_spac_hanging_location\v!right \frozen\hangindent\ifconditional\displaylefttoright-\fi\scratchwidth - \rlap{\hskip\dimexpr\hsize-\leftskip-\wd\nextbox\relax\box\nextbox}% \leftskip is new + \rlap{\kern\dimexpr\hsize-\leftskip-\wd\nextbox\relax\box\nextbox}% \leftskip is new \else \frozen\hangindent\ifconditional\displaylefttoright\else-\fi\scratchwidth - \llap{\box\nextbox\hskip\scratchdistance}% + \llap{\box\nextbox\kern\scratchdistance}% \fi \ignorespaces} @@ -2397,8 +2499,8 @@ %D test test test \hfill\break %D \stoptyping -\permanent\tolerant\protected\def\blankbefore[#1]{\vadjust pre {\ifcstok{#1}\emptytoks\blank\else\blank[#1]\fi}} -\permanent\tolerant\protected\def\blankafter [#1]{\vadjust post{\ifcstok{#1}\emptytoks\blank\else\blank[#1]\fi}} +\permanent\tolerant\protected\def\blankbefore[#1]{\vadjust pre {\ifempty{#1}\blank\else\blank[#1]\fi}} +\permanent\tolerant\protected\def\blankafter [#1]{\vadjust post{\ifempty{#1}\blank\else\blank[#1]\fi}} %D Experimental: @@ -2415,7 +2517,7 @@ [\c!factor=.5, \c!after=\textdisplayparameter\c!before] -\tolerant\protected\def\spac_textdisplay_start#1#:[#2]% +\tolerant\protected\def\spac_textdisplay_start#1#:[#S#2]% {\par \begingroup \whitespace diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl index 8e5e7e4b113..a393d8dcab5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl @@ -93,7 +93,7 @@ \lettonothing\m_bookmarks_names \lettonothing\m_bookmarks_opened -\tolerant\def\strc_bookmarks_place_yes[#1]#*[#2]#*[#3]% +\tolerant\def\strc_bookmarks_place_yes[#1]#*[#S#2]#*[#S#3]% {\begingroup \edef\m_bookmarks_names{#1}% \edef\m_bookmarks_opened{#2}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl index c8173953051..13abc47a4c1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl @@ -51,7 +51,7 @@ \lettonothing\m_subblock \doifelsenextoptionalcs\strc_blocks_begin_yes\strc_blocks_begin_nop} -\protected\def\strc_blocks_begin_yes[#1]% +\protected\def\strc_blocks_begin_yes[#S#1]% {\doifelseassignmentcs{#1}% \strc_blocks_begin_indeed \strc_blocks_begin_tagged @@ -61,7 +61,7 @@ {\edef\m_subblock{#1}% \doifelsenextoptionalcs\strc_blocks_begin_yes_yes\strc_blocks_begin_nop} -\protected\def\strc_blocks_begin_yes_yes[#1]% +\protected\def\strc_blocks_begin_yes_yes[#S#1]% {\strc_blocks_begin_indeed{#1}} \protected\def\strc_blocks_begin_nop @@ -123,15 +123,15 @@ \endgroup} \def\strc_start_block#1#2% - {\edef\currentblock{#2}% + {\cdef\currentblock{#2}% \c_strc_blocks_index#1\relax \strc_blocks_setup \let\strc_blocks_setup\relax \edef\p_alternative{\blockparameter\c!alternative}% \ifx\p_alternative\v!text - \setfalse\c_strc_blocks_display + \c_strc_blocks_display\conditionalfalse \else - \settrue\c_strc_blocks_display + \c_strc_blocks_display\conditionaltrue \fi \ifconditional\c_strc_blocks_display \blockparameter\c!before @@ -164,7 +164,7 @@ \tolerant\def\strc_blocks_set_state[#1]#*[#2]#*[#3]% state name tag % todo: we could use the lua one directly {\clf_setstructureblockstate{#1}{#2}{#3}} -\tolerant\def\strc_blocks_select[#1]#*[#2]#*[#3]#*[#4]% state name tag setups +\tolerant\def\strc_blocks_select[#1]#*[#2]#*[#S#3]#*[#S#4]% state name tag setups {\begingroup \ifhastok={#3}% \getparameters[\??blocktemp][\c!criterium=\v!text,#3]% diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx index 0f7750bfedb..374d0a04b23 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx @@ -127,7 +127,7 @@ \mutable\lettonothing\currentconstructiontitle \mutable\lettonothing\currentconstructionxmlsetup -\settrue\c_strc_constructions_define_commands % use with care, might become a proper key +\newconditional\c_strc_constructions_define_commands \c_strc_constructions_define_commands\conditionaltrue % use with care, might become a proper key \appendtoks \ifempty\currentconstructionparent @@ -139,6 +139,7 @@ \fi \edefcsname\??constructionlevel\currentconstruction\endcsname{\number\constructionparameter\c!level}% \edefcsname\??constructionclass\currentconstruction\endcsname{\constructionparameter\s!handler}% + \expandafter\newconditional\csname\??constructionclosesymbol\currentconstruction\endcsname \to \everydefineconstruction % todo: inhibit this when we have a different handle .. current we cannot do \frozen @@ -153,7 +154,7 @@ %D Just a basic environment (mostly for testing). We will provide a 'setup' based %D plugin once the rest is sorted out. -\tolerant\permanent\protected\def\startnamedconstruction[#1]#*[#2]#*[#3]% +\tolerant\permanent\protected\def\startnamedconstruction[#1]#*[#S#2]#*[#3]% {\begingroup \strc_constructions_initialize{#1}% \strc_constructions_register[#3][\c!label={\constructionparameter\c!text},\c!reference=,\c!title=,\c!bookmark=,\c!list=,\c!referencetext=,#2]% @@ -179,7 +180,7 @@ \installcorenamespace{constructionnotehandler} \protected\def\strc_constructions_initialize#1% class instance - {\edef\currentconstruction{#1}% + {\cdef\currentconstruction{#1}% \enforced\let\currentconstructionhash\??construction \let\currentconstructionlistentry\!!zerocount \enforced\expandafter\let\expandafter\currentconstructionmain \csname\??constructionmain \currentconstruction\endcsname @@ -195,8 +196,8 @@ \newconditional\c_strc_constructions_title_state \protected\defcsname\??constructioninitializer\v!construction\endcsname - {\setfalse\c_strc_constructions_number_state - \setfalse\c_strc_constructions_title_state} + {\c_strc_constructions_number_state\conditionalfalse + \c_strc_constructions_title_state\conditionalfalse} \protected\defcsname\??constructionfinalizer\v!construction\endcsname {} @@ -271,7 +272,7 @@ \protected\defcsname\??constructiontexthandler\v!construction\endcsname {\begingroup \useconstructionstyleandcolor\c!headstyle\c!headcolor % move to \currentconstructiontext - \the\everyconstruction + \expand\everyconstruction \constructionparameter\c!headcommand {\strut \constructionparameter\c!text @@ -327,7 +328,7 @@ {\constructionsheaddistance\zeropoint \constructionsheadwidth \zeropoint % we also need to make sure that no stretch creeps in (new per 2015-02-02, for Alan) - \settrue\c_strc_constructions_distance_none} + \c_strc_constructions_distance_none\conditionaltrue} \protected\defcsname\??constructionstarthandler\v!construction\endcsname % this will be redone (reorganized) .. too much boxing {\dostarttaggedchained\t!construction\currentconstruction\currentconstructionhash @@ -353,10 +354,10 @@ \edef\p_strc_constructions_distance{\constructionalternativeparameter\c!distance}% \edef\p_strc_constructions_width{\constructionalternativeparameter\c!width}% \ifx\p_strc_constructions_distance\v!none - \settrue\c_strc_constructions_distance_none + \c_strc_constructions_distance_none\conditionaltrue \constructionsheaddistance\zeropoint \else - \setfalse\c_strc_constructions_distance_none + \c_strc_constructions_distance_none\conditionalfalse \constructionsheaddistance\p_strc_constructions_distance\relax \ifdim\constructionsheaddistance=\zeropoint \ifx\p_strc_constructions_width\v!broad @@ -402,7 +403,9 @@ \forgetall \dontcomplain % new and under testing - \doif{\constructionparameter\c!headindenting}\v!yes{\hskip\scratchskip}% + \ifcstok{\constructionparameter\c!headindenting}\v!yes + \hskip\scratchskip + \fi % \ifx\currentconstructionalternative\v!serried % brrr, hack, will change \csname\??constructionmainhandler\currentconstructionhandler\endcsname\currentconstructiontext @@ -445,7 +448,9 @@ \protected\defcsname\??constructionstophandler\v!construction\endcsname {\strc_constructions_close_symbol_place - \doifnot{\constructionparameter\c!display}\v!no\par + \ifcstok{\constructionparameter\c!display}\v!no\else + \par + \fi \dostoptagged % content \dostoptagged % construction \endgroup @@ -456,13 +461,15 @@ \dorechecknextindentation} \permanent\protected\def\boxedconstructionhead#1% - {\doifelse{\constructionalternativeparameter\c!alignbottom}{\v!yes}\vbox\vtop - {\hsize\constructionsheadwidth - \edef\p_strc_constructions_headalign{\constructionparameter\c!headalign}% - \ifempty\p_strc_constructions_headalign \else - \setupalign[\p_strc_constructions_headalign]% \use... - \fi - #1}} + {\ifcstok{\constructionalternativeparameter\c!alignbottom}\v!yes \vbox \else \vtop \fi + \bgroup + \hsize\constructionsheadwidth + \edef\p_strc_constructions_headalign{\constructionparameter\c!headalign}% + \ifempty\p_strc_constructions_headalign \else + \setupalign[\p_strc_constructions_headalign]% \use... + \fi + #1% + \egroup} \installcorenamespace{constructionalternative} \installcorenamespace{constructionrenderings} @@ -957,7 +964,7 @@ \noindent \leftskip\leftconstructionskip \rightskip\dimexpr\rightconstructionskip+\constructionsheadwidth+\constructionsheaddistance\relax - \parfillskip\zeropoint + \parfillskip\zeroskip \strc_constructions_set_pure_box\v!flushright \directparwrapper \relax {% \hfilll @@ -981,13 +988,13 @@ \mutable\let\qed \donothing \def\strc_constructions_close_symbol_reset % no need for global - {\global\expandafter\settrue\csname\??constructionclosesymbol\currentconstruction\endcsname + {\global\csname\??constructionclosesymbol\currentconstruction\endcsname\conditionaltrue \let\placeclosesymbol\strc_constructions_close_symbol_place \let\qed \strc_constructions_close_symbol_place} \protected\def\strc_constructions_close_symbol_place {\ifconditional\csname\??constructionclosesymbol\currentconstruction\endcsname - \global\expandafter\setfalse\csname\??constructionclosesymbol\currentconstruction\endcsname + \global\csname\??constructionclosesymbol\currentconstruction\endcsname\conditionalfalse \edef\p_strc_constructions_closesymbol{\constructionparameter\c!closesymbol}% \ifempty\p_strc_constructions_closesymbol \else \constructionparameter\c!closecommand{\p_strc_constructions_closesymbol}% hm why {} maybe because box expected @@ -1007,7 +1014,7 @@ % \def\strc_constructions_register{\strc_constructions_register_yes} -\def\strc_constructions_register_nop[#1][#2]% #1=optional user data #2=interfaced-settings +\def\strc_constructions_register_nop[#S#1][#S#2]% #1=optional user data #2=interfaced-settings %{\writestatus{constructions}{reusing \currentconstruction: \number\currentconstructionlistentry}} {} @@ -1021,7 +1028,7 @@ \let\currentconstructionsynchronize\relax \let\currentconstructionattribute \attributeunsetvalue -\def\strc_constructions_register_yes[#1][#2]% #1=optional user data #2=interfaced-settings +\def\strc_constructions_register_yes[#S#1][#S#2]% #1=optional user data #2=interfaced-settings {\begingroup % similar to structure so we might generalize this \setupcurrentconstruction[#2]% % xdef's will become edef's \xdef\currentconstructionexpansion {\constructionparameter\c!expansion}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx index 6c04c9ac163..957a6db4bb2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx @@ -75,8 +75,6 @@ \fi \to \everydefinedescription -\lettonothing\p_strc_constructions_title - \protected\defcsname\??constructioninitializer\v!description\endcsname {\let \currentdescription \currentconstruction \enforced\let\constructionparameter \descriptionparameter @@ -85,11 +83,10 @@ \enforced\let\letconstructionparameter \letdescriptionparameter \enforced\let\useconstructionstyleandcolor \usedescriptionstyleandcolor \enforced\let\setupcurrentconstruction \setupcurrentdescription - \edef\p_strc_constructions_title{\constructionparameter\c!title}% - \ifx\p_strc_constructions_title\v!yes - \settrue\c_strc_constructions_title_state + \ifcstok{\constructionparameter\c!title}\v!yes + \c_strc_constructions_title_state\conditionaltrue \else - \setfalse\c_strc_constructions_title_state + \c_strc_constructions_title_state\conditionalfalse \fi} % We keep the command variant around but rather would move to the @@ -102,7 +99,7 @@ % A bit over the top, the optional title but mkii has it too. -\tolerant\permanent\protected\def\startnameddescription[#1]#*[#2]% +\tolerant\permanent\protected\def\startnameddescription[#1]#*[#S#2]% {\begingroup \strc_constructions_initialize{#1}% \ifhastok={#2}% @@ -121,7 +118,7 @@ % \resetdescriptionparameter\c!list % \resetdescriptionparameter\c!referencetext} -\protected\def\strc_descriptions_start_setups[#1]% +\protected\def\strc_descriptions_start_setups[#S#1]% {\strc_constructions_register[][\c!label={\descriptionparameter\c!text},\c!reference=,\c!title=,\c!bookmark=,\c!list=,\c!referencetext=,#1]% \csname\??constructionstarthandler\currentconstructionhandler\endcsname} @@ -139,7 +136,7 @@ % \description [reference] text \par % \description [reference] {title} text \par -\tolerant\permanent\protected\def\nameddescription[#1]#*[#2]% +\tolerant\permanent\protected\def\nameddescription[#1]#*[#S#2]% {\begingroup \strc_constructions_initialize{#1}% \ifhastok={#2}% @@ -150,7 +147,7 @@ \expandafter\strc_descriptions_command_reference \fi[#2]} -\protected\def\strc_descriptions_command_setups[#1]% +\protected\def\strc_descriptions_command_setups[#S#1]% {\strc_constructions_register[][\c!label={\descriptionparameter\c!text},\c!reference=,\c!title=,\c!bookmark=,\c!list=,\c!referencetext=,#1]% \csname\??constructioncommandhandler\currentconstructionhandler\endcsname} diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx index d3cf165dec8..6ca8fbc1f7f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx @@ -130,7 +130,7 @@ % with push/pop (also at definition time) \protected\def\strc_define_commands_enumeration#tag#level#parent% - {\iftok{#parent}\emptytoks + {\ifempty{#parent}% \normalexpanded{\defineconstruction[#tag][\s!handler=\v!enumeration,\c!level=#level]}% \edefcsname\??enumeration#tag:\s!parent\endcsname{\??enumeration}% \else @@ -182,9 +182,6 @@ %\strc_enumerations_setup_counter\currentenumeration \to \everydefineenumeration -\lettonothing\p_strc_constructions_title -\lettonothing\p_strc_constructions_number - \protected\defcsname\??constructioninitializer\v!enumeration\endcsname {\let \currentenumeration \currentconstruction \enforced\let\constructionparameter \enumerationparameter @@ -193,21 +190,19 @@ \enforced\let\letconstructionparameter \letenumerationparameter \enforced\let\useconstructionstyleandcolor \useenumerationstyleandcolor \enforced\let\setupcurrentconstruction \setupcurrentenumeration - \edef\p_strc_constructions_number{\constructionparameter\c!number}% - \ifx\p_strc_constructions_number\v!yes - \settrue\c_strc_constructions_number_state + \ifcstok{\constructionparameter\c!number}\v!yes + \c_strc_constructions_number_state\conditionaltrue \iftrialtypesetting \strc_counters_save\currentconstructionnumber \fi \strc_counters_increment_sub\currentconstructionnumber\currentconstructionlevel \else - \setfalse\c_strc_constructions_number_state + \c_strc_constructions_number_state\conditionalfalse \fi - \edef\p_strc_constructions_title{\constructionparameter\c!title}% - \ifx\p_strc_constructions_title\v!yes - \settrue\c_strc_constructions_title_state + \ifcstok{\constructionparameter\c!title}\v!yes + \c_strc_constructions_title_state\conditionaltrue \else - \setfalse\c_strc_constructions_title_state + \c_strc_constructions_title_state\conditionalfalse \fi} \protected\defcsname\??constructionfinalizer\v!enumeration\endcsname @@ -262,7 +257,7 @@ \endgroup} \protected\def\strc_enumerations_text - {\the\everyenumeration % will become obsolete + {\expand\everyenumeration % will become obsolete \ifconditional\c_strc_constructions_number_state \ifx\currentconstructionreference\!!plustoken \strc_enumerations_full_number_symbol diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-flt.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-flt.lmt index e47046f8c80..07d017a58c7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-flt.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-flt.lmt @@ -21,7 +21,7 @@ local report = logs.reporter("structure","floats") local forcepageflush = builders.vspacing.forcepageflush -local d_page_sides_vsize = tex.isdimen("d_page_sides_vsize") +local d_page_sides_vsize = tex.isdimen("d_page_sides_vsize") function builders.checksidefloat(mode,indented) if not texgetoutputactive() then diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx index b3f33734e35..31b2d880218 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx @@ -11,7 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D This module will be redone with conditionals and everythings +%D This module will be redone with conditionals and everythings. Anyway, text floats +%D are a rather historic feature so changing something is also braking something. \writestatus{loading}{ConTeXt Structure Macros / Float Numbering} @@ -26,7 +27,7 @@ % \setuplayout[width=middle,backspace=3cm] % % \appendtoks -% \settrue\inhibitmargindata +% \inhibitmargindata\conditionaltrue % \to \everyinsidefloat % % \starttext @@ -184,8 +185,14 @@ \c!offset=\v!overlay, \c!strut=\v!no] +\newconditional\c_page_floats_pack_flushed + \appendtoks - \doifelse{\floatparameter\c!compress}\v!yes\settrue\setfalse\c_page_floats_pack_flushed + \ifcstok{\floatparameter\c!compress}\v!yes + \c_page_floats_pack_flushed\conditionaltrue + \else + \c_page_floats_pack_flushed\conditionalfalse + \fi \d_page_floats_compress_distance\floatparameter\c!compressdistance\relax \to \everysetupfloat @@ -221,7 +228,7 @@ \let\strc_floats_define_saved\definefloat -\permanent\tolerant\protected\overloaded\def\definefloat[#1]#*[#2]#*[#3]% name+plural+parent | name+parent+settings +\permanent\tolerant\protected\overloaded\def\definefloat[#1]#*[#S#2]#*[#S#3]% name+plural+parent | name+parent+settings {\ifarguments\or \strc_floats_define_c[#1][#1]% \or @@ -264,13 +271,15 @@ \strc_floats_define_commands{#1}{#2}} \def\strc_floats_define_commands#1#2% - {\frozen\protected\instance\edefcsname\e!place \e!listof#2\endcsname{\strc_lists_place[#1]}% call will change - \frozen\protected\instance\edefcsname\e!complete\e!listof#2\endcsname{\strc_lists_complete[#1][#2]}% call will change - \frozen\protected\instance\edefcsname\e!place #1\endcsname{\placefloat[#1]}% - \frozen\protected\instance\edefcsname\e!start \e!place#1\endcsname{\startplacefloat[#1]}% - \frozen\protected\instance\edefcsname\e!stop \e!place#1\endcsname{\stopplacefloat}% - \frozen\protected\instance\edefcsname\e!start #1\e!text\endcsname{\strc_floats_start_text[#1]}% - \frozen\protected\instance\edefcsname\e!stop #1\e!text\endcsname{\strc_floats_stop_text}% + {\frozen\protected\instance\edefcsname\e!place \e!listof#2\endcsname{\strc_lists_place[#1]}% call will change + \frozen\protected\instance\edefcsname\e!complete \e!listof#2\endcsname{\strc_lists_complete[#1][#2]}% call will change + \frozen\protected\instance\edefcsname\e!place #1\endcsname{\placefloat[#1]}% + \frozen\protected\instance\edefcsname\e!start \e!place#1\endcsname{\startplacefloat[#1]}% + \frozen\protected\instance\edefcsname\e!stop \e!place#1\endcsname{\stopplacefloat}% + \frozen\protected\instance\edefcsname\e!start #1\e!text\endcsname{\startfloattext[#1]}% + \frozen\protected\instance\edefcsname\e!stop #1\e!text\endcsname{\stopfloattext}% + \frozen\protected\instance\edefcsname\e!start\e!place#1\e!text\endcsname{\startplacefloattext[#1]}% + \frozen\protected\instance\edefcsname\e!stop \e!place#1\e!text\endcsname{\stopplacefloattext}% % these will become obsolete: \frozen\instance\protected\edefcsname\e!reserve #1\endcsname{\strc_floats_reserve[#1]}% \frozen\instance\protected\edefcsname\e!start\e!reserve#1\e!text\endcsname{\strc_floats_start_reserve_text[#1]}% @@ -296,10 +305,11 @@ \installstructurelistprocessor\s!float{\usestructurelistprocessor{number+title}} \permanent\protected\def\thecurrentfloatnumbersuffix - {\doifsomething{\floatcaptionparameter\c!suffix} - {\floatcaptionparameter\c!suffixseparator - \floatcaptionparameter\c!suffix - \floatcaptionparameter\c!suffixstopper}} + {\ifempty{\floatcaptionparameter\c!suffix}\else + \floatcaptionparameter\c!suffixseparator + \floatcaptionparameter\c!suffix + \floatcaptionparameter\c!suffixstopper + \fi} \permanent\protected\def\thecurrentfloatnumber {\ifnofloatcaption \orelse \ifnofloatnumber \orelse \ifrelax\currentfloatnumber \else @@ -365,12 +375,12 @@ %D %D So there you have it: -\permanent\tolerant\protected\def\placefloatcaption[#category]#spacer[#settings]#spacer[#userdata]% +\permanent\tolerant\protected\def\placefloatcaption[#category]#spacer[#S#settings]#spacer[#S#userdata]% {\ifarguments\or\else % >= 2 % we need at least a category and title \dontleavehmode \bgroup - \edef\currentfloat{#category}% + \cdef\currentfloat{#category}% \let\currentfloatcaption\currentfloat \resetfloatcaptionparameter\c!reference \resetfloatcaptionparameter\c!title @@ -381,9 +391,11 @@ \setupcurrentfloatcaption[#settings]% \edef\currentfloatcounter{\namedcounterparameter\currentfloat\s!name}% \iftrialtypesetting\strc_counters_save\currentfloatcounter\fi - \doifelse{\floatcaptionparameter\c!number}\v!yes - {\global\nofloatnumberfalse}% - {\global\nofloatnumbertrue}% + \ifcstok{\floatcaptionparameter\c!number}\v!yes + \global\nofloatnumberfalse + \else + \global\nofloatnumbertrue + \fi \ifnofloatnumber\else \strc_counters_increment\currentfloatcounter \fi @@ -424,7 +436,9 @@ \lettonothing\m_strc_floats_last_caption_tag \def\strc_floats_make_complete_caption - {\doifsomething{\floatcaptionparameter\c!spacebefore}{\blank[\floatcaptionparameter\c!spacebefore]}% + {\ifempty{\floatcaptionparameter\c!spacebefore}\else + \blank[\floatcaptionparameter\c!spacebefore]% + \fi \strc_floats_make_complete_caption_before \synchronizedisplaydirection % temp hack, till we have a proper model \noindent @@ -442,20 +456,24 @@ \ifemptyfloatcaption \hbox{\usefloatcaptionstyleandcolor\c!headstyle\c!headcolor\thecurrentfloatnumber}% \else - \doifelsenothing{\floatcaptionparameter\c!spaceinbetween} - {\scratchskip\floatcaptionparameter\c!distance\relax - \setbox\scratchbox\hbox - {\usefloatcaptionstyleandcolor\c!headstyle\c!headcolor - \thecurrentfloatnumber - \floatcaptionparameter\c!headseparator - \dotfskip\scratchskip}% - \doifelse{\floatcaptionparameter\c!hang}\v!yes - {\leftskip\wd\scratchbox - \llap{\box\scratchbox}} - {\unhbox\scratchbox}% - \emergencystretch.5\scratchskip} - {\hbox{\usefloatcaptionstyleandcolor\c!headstyle\c!headcolor\thecurrentfloatnumber}% - \blank[\floatcaptionparameter\c!spaceinbetween]}% + \ifempty{\floatcaptionparameter\c!spaceinbetween}% + \scratchskip\floatcaptionparameter\c!distance\relax + \setbox\scratchbox\hbox + {\usefloatcaptionstyleandcolor\c!headstyle\c!headcolor + \thecurrentfloatnumber + \floatcaptionparameter\c!headseparator + \dotfskip\scratchskip}% + \ifcstok{\floatcaptionparameter\c!hang}\v!yes + \leftskip\wd\scratchbox + \llap{\box\scratchbox}% + \else + \unhbox\scratchbox + \fi + \emergencystretch.5\scratchskip + \else + \hbox{\usefloatcaptionstyleandcolor\c!headstyle\c!headcolor\thecurrentfloatnumber}% + \blank[\floatcaptionparameter\c!spaceinbetween]% + \fi \fi \fi \usefloatcaptionstyleandcolor\c!textstyle\c!textcolor @@ -465,7 +483,9 @@ \fi \endgroup \strc_floats_make_complete_caption_after - \doifsomething{\floatcaptionparameter\c!spaceafter}{\blank[\floatcaptionparameter\c!spaceafter]}} + \ifempty{\floatcaptionparameter\c!spaceafter}\else + \blank[\floatcaptionparameter\c!spaceafter]% + \fi} %let\strc_floats_make_complete_caption_before\relax \let\strc_floats_make_complete_caption_after \relax @@ -531,9 +551,9 @@ \def\strc_floats_apply_caption_command {\setbox\b_strc_floats_caption\hbox\bgroup - %\unless\iftok{\floatcaptionparameter\c!command}\emptytoks + %\unless\ifempty{\floatcaptionparameter\c!command} \floatcaptionparameter\c!command{\box\b_strc_floats_caption}% - %\orunless\iftok{\floatcaptionparameter\c!deeptextcommand}\emptytoks + %\orunless\ifempty{\floatcaptionparameter\c!deeptextcommand}% % \floatcaptionparameter\c!deeptextcommand{\unvbox\b_strc_floats_caption}% %\else % \box\b_strc_floats_caption @@ -586,11 +606,11 @@ %D \let\strc_float_realpage\realpageno %D %D \def\strc_float_save_data -%D {\setdataset[\s!float][\number\c_strc_floats_n][]} +%D {\setdataset[\s!float][\the\c_strc_floats_n][]} %D %D \def\strc_float_load_data % precedes save ! %D {\global\advanceby\c_strc_floats_n\plusone -%D \xdef\strc_float_realpage{\datasetvariable\s!float{\number\c_strc_floats_n}\s!page}% +%D \xdef\strc_float_realpage{\datasetvariable\s!float{\the\c_strc_floats_n}\s!page}% %D \ifempty\strc_float_realpage %D \glet\strc_float_realpage\realpageno % \realfolio %D \fi} @@ -605,11 +625,11 @@ \let\strc_float_realpage\realpageno \def\strc_float_save_data - {\setpagestate[\s!float][\number\c_strc_floats_n]} + {\setpagestate[\s!float][\the\c_strc_floats_n]} \def\strc_float_load_data % precedes save ! {\global\advanceby\c_strc_floats_n\plusone - \xdef\strc_float_realpage{\pagestaterealpage\s!float{\number\c_strc_floats_n}}% + \xdef\strc_float_realpage{\pagestaterealpage\s!float{\the\c_strc_floats_n}}% \ifempty\strc_float_realpage \glet\strc_float_realpage\realpageno % \realfolio \fi} @@ -640,7 +660,7 @@ \aliased\lettonothing\lastplacedfloat \def\strc_floats_set_current_tag#tag% - {\edef\currentfloat{#tag}% + {\cdef\currentfloat{#tag}% \ifempty\currentfloat \let\currentfloat\v!figure % a bit of a hack \fi @@ -681,12 +701,12 @@ % \setfloatmethodvariables\floatlocation} -\newtoks\c_floats_every_table_float +\newtoks\t_floats_every_table_float \appendtoks \edef\floatlocation{\v!force,\v!always,\floatlocation}% \setupfloat[\c!spacebefore=\v!none,\c!spaceafter=\v!none]% -\to \c_floats_every_table_float +\to \t_floats_every_table_float \ifdefined\dotagregisterfloat \else \aliased\let\dotagregisterfloat\gobbletwoarguments \fi @@ -700,12 +720,16 @@ \let\floatlocation\floatlocationdefault % beware of a clash between alignment locations \fi \ifintable - \the\c_floats_every_table_float + \expand\t_floats_every_table_float \fi \strc_floats_analyze_location % todo: use \lets \setupcurrentfloatcaption[\c!reference={#reference},\c!title={#caption},\c!marking=,\c!list=,\c!bookmark=,\c!referencetext=]% - \doifelseinset\v!split\floatlocation\strc_floats_place_next_box_split\strc_floats_place_next_box_normal} + \ifinset\v!split\floatlocation + \expandafter\strc_floats_place_next_box_split + \else + \expandafter\strc_floats_place_next_box_normal + \fi} \permanent\protected\def\placefloat {\flushnotes @@ -731,7 +755,7 @@ %D Do we need a \setuplayout here (kind of costly) in case we mix multi page text %D with a side float and less height. -\permanent\tolerant\protected\def\startplacefloat[#tag]#spacer[#settings]#spacer[#userdata]% +\permanent\tolerant\protected\def\startplacefloat[#tag]#spacer[#S#settings]#spacer[#S#userdata]% {\flushnotes %\setuplayout \page_otr_command_flush_side_floats % here ! @@ -764,7 +788,20 @@ \else \lettonothing\m_strc_floats_saved_userdata \fi - % check (see elsewhere + \edef\p_mode{\floatcaptionparameter\s!mode}% + \ifempty\p_mode + \let\strc_floats_stop_place\strc_floats_stop_place_yes + \strc_floats_start_place_yes + \orelse\ifmode{\p_mode}% + \let\strc_floats_stop_place\strc_floats_stop_place_yes + \strc_floats_start_place_yes + \else + \let\strc_floats_stop_place\strc_floats_stop_place_nop + \strc_floats_start_place_nop + \fi} + +\def\strc_floats_start_place_yes + {% check (see elsewhere \edef\floatlocationdefault{\floatparameter\c!default}% \edef\floatlocation{\floatcaptionparameter\c!location}% \ifempty\floatlocation @@ -781,14 +818,32 @@ \letfloatcaptionparameter\c!freeregion \p_freeregion % \strc_floats_analyze_location - \doifelseinset\v!split\floatlocation\strc_floats_place_next_box_split\strc_floats_place_next_box_normal + \ifinset\v!split\floatlocation + \expandafter\strc_floats_place_next_box_split + \else + \expandafter\strc_floats_place_next_box_normal + \fi \bgroup \ignorespaces} -\permanent\protected\def\stopplacefloat +\def\strc_floats_stop_place_yes {\removeunwantedspaces \egroup} +\def\strc_floats_start_place_nop + {\directsetup{\p_mode:\currentfloat:\v!before}% + \bgroup + \ignorespaces} + +\def\strc_floats_stop_place_nop + {\removeunwantedspaces + \egroup + \directsetup{\p_mode:\currentfloat:\v!after}% + \strc_floats_end_group} + +\permanent\protected\def\stopplacefloat + {\strc_floats_stop_place} + % reserve \protected\def\strc_floats_reserve @@ -805,21 +860,78 @@ % text -\protected\def\strc_floats_start_text +\permanent\tolerant\protected\def\startfloattext[#tag]#spacer[#location]#spacer[#reference]% {\flushnotes % Here indeed? \page_otr_command_flush_side_floats % Here indeed? \strc_floats_begin_text_group - \strc_floats_start_text_indeed} + \strc_floats_place[#tag][\v!text,#location,\v!left][#reference]} -\tolerant\protected\def\strc_floats_start_text_indeed[#tag]#spacer[#location]#spacer[#reference]% - {\strc_floats_place[#tag][\v!text,#location,\v!left][#reference]} - -\protected\def\strc_floats_stop_text +\protected\def\stopfloattext {\strc_floats_stop_text_indeed} +\ifdefined\startcontent \else \aliased\let\startcontent\relax \fi +\ifdefined\stopcontent \else \aliased\let\stopcontent \relax \fi +\ifdefined\startentry \else \aliased\let\startentry \relax \fi +\ifdefined\stopentry \else \aliased\let\stopentry \relax \fi + +\permanent\tolerant\protected\def\startplacefloattext[#tag]#spacer[#S#settings]#spacer[#S#userdata]% + {\begingroup + % + \flushnotes % Here indeed? + \page_otr_command_flush_side_floats % Here indeed? + % + \strc_floats_set_current_tag{#tag}% + \strc_floats_reset_variables + \resetfloatcaptionparameter\c!location + \resetfloatcaptionparameter\c!reference + \resetfloatcaptionparameter\c!title + \resetfloatcaptionparameter\c!marking + \resetfloatcaptionparameter\c!list + \resetfloatcaptionparameter\c!bookmark + \resetfloatcaptionparameter\c!referencetext + % pickup + \ifparameter#settings\or + \setupcurrentfloatcaption[#settings]% + \fi + \xdef\askedfloatoptions{\v!text,\floatcaptionparameter\c!location,\v!left}% + \edef\floatlocationdefault{\floatparameter\c!default}% + \let\floatlocation\askedfloatoptions + \strc_floats_analyze_location + \resetfloatcaptionparameter\c!location + \ifparameter#userdata\or + \setupcurrentfloatuserdata[#userdata]% + \def\m_strc_floats_saved_userdata{#userdata}% + \else + \lettonothing\m_strc_floats_saved_userdata + \fi + \enforced\let\startcontent\strc_floats_text_content_start + \enforced\let\stopcontent\strc_floats_text_content_stop + \enforced\let\startentry\strc_floats_text_entry_start + \enforced\let\stopentry \strc_floats_text_entry_stop} + +\protected\def\stopplacefloattext + {\strc_floats_stop_text_indeed + \endgroup} + +\protected\def\strc_floats_text_content_start + {\setbox\floatbox\vbox\bgroup + \ignorespaces} + +\protected\def\strc_floats_text_content_stop + {\removeunwantedspaces + \egroup + \strc_floats_begin_text_group + \strc_floats_place_next_box_normal{\box\floatbox}} + +\protected\def\strc_floats_text_entry_start + {\ignorespaces} + +\protected\def\strc_floats_text_entry_stop + {\removeunwantedspaces} + % reserved text -\tolerant\protected\def\strc_floats_start_reserve_text[#tag]#spacer[#settings]#spacer[#location]#spacer[#reference]#:#caption%% +\tolerant\protected\def\strc_floats_start_reserve_text[#tag]#spacer[#S#settings]#spacer[#location]#spacer[#reference]#:#caption%% {\flushnotes \page_otr_command_flush_side_floats \strc_floats_begin_text_group @@ -853,24 +965,36 @@ \v!innermargin,\v!outermargin,\v!inneredge,\v!outeredge,% \v!text,\v!opposite}% \v!page +% \protected\def\strc_floats_place_next_box_split +% {\let\splitfloatfinalizer\strc_floats_end_split_group +% \let\strc_floats_end_group\relax +% \splitfloat{\strc_floats_place_next_box_normal}} + \protected\def\strc_floats_place_next_box_split {\let\splitfloatfinalizer\strc_floats_end_split_group \let\strc_floats_end_group\relax + %\ifnumexpression \c_strc_floats_rotation=90 or \c_strc_floats_rotation=270 \relax + \ifnumexpression (\c_strc_floats_rotation=90) or (\c_strc_floats_rotation=270) \relax + \splitfloatfixedheight\conditionaltrue + \def\splitfloatheight{\textwidth}% + \fi \splitfloat{\strc_floats_place_next_box_normal}} \protected\def\strc_floats_place_next_box_normal {\ifconditional\c_page_floats_some_waiting % this was \checkwaitingfloats spread all over - \doifelseinset\v!always\floatlocation - {\showmessage\m!floatblocks5\empty} - {\doifelsecommon\floatlocation\flushfloatslist\page_otr_command_flush_floats\donothing}% + \ifinset\v!always\floatlocation + \showmessage\m!floatblocks5\empty + \orelse\ifcommon\floatlocation\flushfloatslist + \page_otr_command_flush_floats + \fi % but which should be done before using box \floatbox \fi \page_margin_strc_floats_before % todo: each float handler gets a before \global\insidefloattrue \dostarttaggedchained\t!float\currentfloat\??float \page_margin_strc_floats_set_hsize % todo: each float handler gets a set_hsize - \the\everyinsidefloat + \expand\everyinsidefloat \strc_floats_analyze_variables_one \dostarttagged\t!floatcontent\empty \dowithnextboxcontent @@ -910,21 +1034,22 @@ %D \stoptyping \def\strc_floats_finish_placement - {\doifsomething{\floatparameter\c!criterium} - {\ifdim\wd\nextbox>\floatparameter\c!criterium\relax - \edef\forcedfloatmethod{\floatparameter\c!fallback}% - \ifempty\forcedfloatmethod \else - \doifelsecommandhandler\??float\forcedfloatmethod - {\let\currentfloat\forcedfloatmethod - \edef\floatlocationdefault{\floatparameter\c!default}% - \let\floatlocation\floatlocationdefault - \let\forcedfloatmethod\floatlocationdefault} - \donothing - \fi - \ifempty\forcedfloatmethod - \let\forcedfloatmethod\v!here - \fi - \fi}% + {\ifempty{\floatparameter\c!criterium}\else + \ifdim\wd\nextbox>\floatparameter\c!criterium\relax + \edef\forcedfloatmethod{\floatparameter\c!fallback}% + \ifempty\forcedfloatmethod \else + \doifelsecommandhandler\??float\forcedfloatmethod + {\let\currentfloat\forcedfloatmethod + \edef\floatlocationdefault{\floatparameter\c!default}% + \let\floatlocation\floatlocationdefault + \let\forcedfloatmethod\floatlocationdefault} + \donothing + \fi + \ifempty\forcedfloatmethod + \let\forcedfloatmethod\v!here + \fi + \fi + \fi \strc_floats_check_extra_actions \strc_floats_analyze_variables_two \strc_floats_place_packaged_boxes @@ -934,7 +1059,9 @@ \global\d_page_sides_downshift \zeropoint \global\d_page_sides_extrashift\zeropoint \ifconditional\c_strc_floats_par_float - \doifinset\v!reset\floatlocation\page_sides_forget_floats + \ifinset\v!reset\floatlocation + \page_sides_forget_floats + \fi \doinhibitblank \fi \strc_floats_end_group} @@ -970,11 +1097,11 @@ \def\strc_floats_analyze_variables_two {\ifinsidecolumns - \global\setfalse\c_strc_floats_par_float + \global\c_strc_floats_par_float\conditionalfalse + \orelse\ifcommon\floatlocation\flushfloatslist + \global\c_strc_floats_par_float\conditionaltrue \else - \doifelsecommon\floatlocation\flushfloatslist - {\global\settrue \c_strc_floats_par_float}% - {\global\setfalse\c_strc_floats_par_float}% + \global\c_strc_floats_par_float\conditionalfalse \fi % variable initializations \global\d_page_sides_shift \zeropoint @@ -993,7 +1120,7 @@ \global\c_page_floats_n_of_top \rootfloatparameter\c!ntop \global\c_page_floats_n_of_bottom\rootfloatparameter\c!nbottom \global\d_strc_floats_overflow \zeropoint - \global\setfalse\c_page_sides_shape_down + \global\c_page_sides_shape_down\conditionalfalse \ifconditional\c_strc_floats_par_float \global\d_strc_floats_top \zeropoint \global\d_strc_floats_bottom \zeropoint @@ -1018,17 +1145,17 @@ \v!grid=>\global\c_page_sides_align\plusfour ,% \v!halfline=>\global\c_page_sides_align\plusfive ]% \ifcase\c_page_sides_align\relax % todo: optie v!lokaal => \else - \doifinset\v!height \floatlocation{\global\c_page_sides_align\plusone }% - \doifinset\v!line \floatlocation{\global\c_page_sides_align\plustwo }% - \doifinset\v!depth \floatlocation{\global\c_page_sides_align\plusthree}% - \doifinset\v!grid \floatlocation{\global\c_page_sides_align\plusfour }% - \doifinset\v!halfline\floatlocation{\global\c_page_sides_align\plusfive }% meant for 'none' + \ifinset\v!height \floatlocation\global\c_page_sides_align\plusone \fi + \ifinset\v!line \floatlocation\global\c_page_sides_align\plustwo \fi + \ifinset\v!depth \floatlocation\global\c_page_sides_align\plusthree\fi + \ifinset\v!grid \floatlocation\global\c_page_sides_align\plusfour \fi + \ifinset\v!halfline\floatlocation\global\c_page_sides_align\plusfive \fi % meant for 'none' \fi - \doifinset\v!high \floatlocation{\global\c_page_sides_skipmode \plusone }% - \doifinset\v!low \floatlocation{\global\c_page_sides_skipmode \plustwo }% - \doifinset\v!fit \floatlocation{\global\c_page_sides_skipmode \plusthree}% - \doifinset\v!tolerant \floatlocation{\global\c_page_sides_tolerance\plusone }% - \doifinset\v!verytolerant\floatlocation{\global\c_page_sides_tolerance\plustwo }% + \ifinset\v!high \floatlocation\global\c_page_sides_skipmode \plusone \fi + \ifinset\v!low \floatlocation\global\c_page_sides_skipmode \plustwo \fi + \ifinset\v!fit \floatlocation\global\c_page_sides_skipmode \plusthree\fi + \ifinset\v!tolerant \floatlocation\global\c_page_sides_tolerance\plusone \fi + \ifinset\v!verytolerant\floatlocation\global\c_page_sides_tolerance\plustwo \fi \else \processallactionsinset [\floatlocation]% @@ -1036,27 +1163,37 @@ 180=>\global\c_strc_floats_rotation\commalistelement\relax,% 270=>\global\c_strc_floats_rotation\commalistelement\relax]% \fi - \doifelseinset\v!force\floatlocation - {\global\settrue\c_page_sides_shape_down} - {\global\setfalse\c_page_sides_shape_down}% - \doifelseinset\v!keeptogether\floatlocation - {\global\settrue\c_page_sides_keep_together} - {\global\setfalse\c_page_sides_keep_together}% - \doifelseinset\v!nonumber\floatlocation - {\global\nofloatnumbertrue}% - {\doifelse{\floatcaptionparameter\c!number}\v!yes - {\global\nofloatnumberfalse}% - {\global\nofloatnumbertrue}}% - \doifelseinset\v!none\floatlocation - {\global\nofloatcaptiontrue}% - {\global\nofloatcaptionfalse}% - \doif{\floatcaptionparameter\c!number}\v!none % new - {\global\nofloatcaptiontrue}% - \doifinset\v!effective\floatlocation - {\letfloatparameter \c!leftmargin \effectiveleftskip - \letfloatparameter \c!rightmargin\effectiverightskip - \letfloatcaptionparameter\c!leftmargin \effectiveleftskip - \letfloatcaptionparameter\c!rightmargin\effectiverightskip}% + \ifinset\v!force\floatlocation + \global\c_page_sides_shape_down\conditionaltrue + \else + \global\c_page_sides_shape_down\conditionalfalse + \fi + \ifinset\v!keeptogether\floatlocation + \global\c_page_sides_keep_together\conditionaltrue + \else + \global\c_page_sides_keep_together\conditionalfalse + \fi + \ifinset\v!nonumber\floatlocation + \global\nofloatnumbertrue + \orelse\ifcstok{\floatcaptionparameter\c!number}\v!yes + \global\nofloatnumberfalse + \else + \global\nofloatnumbertrue + \fi + \ifinset\v!none\floatlocation + \global\nofloatcaptiontrue + \else + \global\nofloatcaptionfalse + \fi + \ifcstok{\floatcaptionparameter\c!number}\v!none % new + \global\nofloatcaptiontrue + \fi + \ifinset\v!effective\floatlocation + \letfloatparameter \c!leftmargin \effectiveleftskip + \letfloatparameter \c!rightmargin\effectiverightskip + \letfloatcaptionparameter\c!leftmargin \effectiveleftskip + \letfloatcaptionparameter\c!rightmargin\effectiverightskip + \fi \ifemptyfloatcaption \ifnofloatnumber \global\nofloatcaptiontrue \fi \fi} @@ -1064,17 +1201,29 @@ % documenteren in details \def\strc_floats_analyze_variables_one - {\doifelse{\floatparameter\c!local}\v!yes\settrue\setfalse\c_page_floats_center_box_global % fout keyword + {\ifcstok{\floatparameter\c!local}\v!yes % fout keyword + \c_page_floats_center_box_global\conditionaltrue + \else + \c_page_floats_center_box_global\conditionalfalse + \fi \ifconditional\c_page_floats_center_box_global - \settrue\c_page_floats_center_box_local + \c_page_floats_center_box_local\conditionaltrue + \orelse\ifinset\v!local\floatlocation + \c_page_floats_center_box_local\conditionaltrue + \else + \c_page_floats_center_box_local\conditionalfalse + \fi + \ifcstok{\floatparameter\c!freeregion}\v!yes + \c_strc_floats_mark_as_free\conditionaltrue \else - \doifelseinset\v!local\floatlocation\settrue\setfalse\c_page_floats_center_box_local + \c_strc_floats_mark_as_free\conditionalfalse \fi - \doifelse{\floatparameter\c!freeregion}\v!yes - \settrue\setfalse\c_strc_floats_mark_as_free - \doifnotcommon{\v!always,\v!here,\v!force}\floatlocation % ! ! ! ! ! ! - {\setfalse\c_page_floats_center_box_global - \setfalse\c_page_floats_center_box_local}} + \ifcommon{\v!always,\v!here,\v!force}\floatlocation + % ! ! ! ! ! ! + \else + \c_page_floats_center_box_global\conditionalfalse + \c_page_floats_center_box_local\conditionalfalse + \fi} \permanent\def\naturalfloatheight{\the\naturalfloatwd} \permanent\def\naturalfloatwidth {\the\naturalfloatht} @@ -1242,7 +1391,7 @@ \glet\currentfloatsynchronize \m_strc_counters_last_registered_synchronize \fi % - \iftrialtypesetting\else\global\setfalse\usesamefloatnumber\fi % one shot + \iftrialtypesetting\else\global\usesamefloatnumber\conditionalfalse\fi % one shot % check float box \strc_floats_set_natural_dimensions\nextbox \global\setbox\floatbox\vbox{\floatparameter\c!command{\box\nextbox}}% can be anything so no pack @@ -1276,9 +1425,8 @@ % also available check here? \seteffectivehsize \hsize\localhsize - \else - \doifinset\v!margin\floatlocation % brr, really needed! see wm will be redone - {\hsize\namedmarginblockparameter\empty\c!width}% + \orelse\ifinset\v!margin\floatlocation % brr, really needed! see wm will be redone + \hsize\namedmarginblockparameter\empty\c!width \fi \edef\p_availablewidth {\floatparameter\c!availablewidth }% \edef\p_availableheight{\floatparameter\c!availableheight}% @@ -1322,7 +1470,7 @@ % new : \place...[leftmargin,-2*line]; we need to catch fxtb:2*3 % watch out: line alone aligns on the line ! ! ! -\permanent\protected\def\movesidefloat[#settings]% (-)n*line|x=,y= +\permanent\protected\def\movesidefloat[#S#settings]% (-)n*line|x=,y= {\global\d_page_sides_downshift \zeropoint \global\d_page_sides_extrashift\zeropoint \ifhastok={#settings}% @@ -1372,7 +1520,7 @@ \fi \global\advanceby\c_page_sides_n_of_lines#lines\relax} -\permanent\protected\def\movedownsidefloat[#settings]% already in core +\permanent\protected\def\movedownsidefloat[#S#settings]% already in core {\unless\ifhastok:{#settings}% \begingroup \scratchconditiononefalse @@ -1409,15 +1557,16 @@ \defcsname\??extrafloataction \s!unknown\endcsname#1{\movedownsidefloat[#1]} \def\strc_floats_check_extra_actions % less tracingthis way .... - {\doifnotinset\v!text\floatlocation % fuzzy, text overloads left, since then it's a directive - {\lettonothing\extrafloatlocation - % \d_page_sides_downshift will be reset afterwards, and can - % already be set at this point - \processcommacommand[\floatlocation]\strc_floats_check_extra_actions_step - \ifempty\extrafloatlocation \else - \edef\floatlocation{\extrafloatlocation,\floatlocation}% - \setfloatmethodvariables\floatlocation - \fi}} + {\ifinset\v!text\floatlocation\else % fuzzy, text overloads left, since then it's a directive + \lettonothing\extrafloatlocation + % \d_page_sides_downshift will be reset afterwards, and can + % already be set at this point + \processcommacommand[\floatlocation]\strc_floats_check_extra_actions_step + \ifempty\extrafloatlocation\else + \edef\floatlocation{\extrafloatlocation,\floatlocation}% + \setfloatmethodvariables\floatlocation + \fi + \fi} \def\strc_floats_check_extra_actions_step#step% {\csname\??extrafloataction @@ -1445,37 +1594,43 @@ \fi \fi % we can also support edges .. in that case no common but a fast loop - \doifelseinset\v!hanging\floatlocation - {\doifelsecommon{\v!inleft,\v!leftmargin}\floatlocation - {\let\p_maxwidth\leftmarginwidth}% - {\doifelsecommon{\v!inright,\v!rightmargin}\floatlocation - {\let\p_maxwidth\rightmarginwidth}% - {\edef\p_maxwidth{\floatparameter\c!maxwidth}}}}% - {\edef\p_maxwidth{\floatparameter\c!maxwidth}}% + \ifinset\v!hanging\floatlocation + \ifcommon{\v!inleft,\v!leftmargin}\floatlocation + \let\p_maxwidth\leftmarginwidth + \orelse\ifcommon{\v!inright,\v!rightmargin}\floatlocation + \let\p_maxwidth\rightmarginwidth + \else + \edef\p_maxwidth{\floatparameter\c!maxwidth}% + \fi + \else + \edef\p_maxwidth{\floatparameter\c!maxwidth}% + \fi \ifempty\p_maxwidth % nothing \else \scratchwidth\p_maxwidth\relax \ifdim\wd\floatbox>\scratchwidth - \doifelsecommon{\v!inright,\v!rightmargin,\v!rightedge,\v!inleft,\v!leftmargin,\v!leftedge}\floatlocation - {\global\d_page_sides_maximum\scratchwidth} - {\doifelsecommon{\v!right,\v!left}\floatlocation - \strc_floats_realign_floatbox_horizontal_one - \strc_floats_realign_floatbox_horizontal_two}% + \ifcommon{\v!inright,\v!rightmargin,\v!rightedge,\v!inleft,\v!leftmargin,\v!leftedge}\floatlocation + \global\d_page_sides_maximum\scratchwidth + \orelse\ifcommon{\v!right,\v!left}\floatlocation + \strc_floats_realign_floatbox_horizontal_one + \else + \strc_floats_realign_floatbox_horizontal_two + \fi \fi \fi} \def\strc_floats_realign_floatbox_horizontal_one {\global\setbox\floatbox\hpack to \scratchwidth - {\doifnotinset\v!right\floatlocation\hss + {\ifinset\v!right\floatlocation\else\hss\fi \box\floatbox - \doifnotinset\v!left\floatlocation\hss}} + \ifinset\v!left\floatlocation\else\hss\fi}} \def\strc_floats_realign_floatbox_horizontal_two % why is this {\global\setbox\floatbox\hpack to \scratchwidth - {\doifnot{\floatparameter\c!location}\v!left\hss + {\ifcstok{\floatparameter\c!location}\v!left\else\hss\fi \box\floatbox - \doifnot{\floatparameter\c!location}\v!right\hss}} + \ifcstok{\floatparameter\c!location}\v!right\else\hss\fi}} \permanent\protected\def\placefloats {\page_otr_command_flush_floats} @@ -1537,17 +1692,19 @@ \global\floatheight \ht\floatbox % forget about the depth \global\floattextwidth\dimexpr\hsize-\floatwidth-\rootfloatparameter\c!margin\relax \edef\floatlocation{\floatlocationmethod}% to be sure .. why - \doifelseinset\v!tall\floatlocationmethod - {\floattextheight\dimexpr\pagegoal-\pagetotal-\bigskipamount\relax % ugly, this bigskip - \ifdim\floattextheight>\textheight - \floattextheight\textheight - \fi - \boxmaxdepth\zeropoint\relax % toegevoegd - \ifdim\floattextheight<\floatheight - \floattextheight\floatheight - \fi - \setbox\floattext\vbox to \floattextheight} - {\setbox\floattext\vbox}% + \ifinset\v!tall\floatlocationmethod + \floattextheight\dimexpr\pagegoal-\pagetotal-\bigskipamount\relax % ugly, this bigskip + \ifdim\floattextheight>\textheight + \floattextheight\textheight + \fi + \boxmaxdepth\zeropoint\relax % toegevoegd + \ifdim\floattextheight<\floatheight + \floattextheight\floatheight + \fi + \setbox\floattext\vbox to \floattextheight + \else + \setbox\floattext\vbox + \fi \bgroup \forgetall \setupblank @@ -1558,44 +1715,54 @@ \def\strc_floats_stop_text_indeed % todo {\egroup - \doifnotinset\v!tall\floatlocation - {\floattextheight\ifdim\ht\floattext<\floatheight\floatheight\else\ht\floattext\fi}% + \ifinset\v!tall\floatlocation\else + \floattextheight\ifdim\ht\floattext<\floatheight\floatheight\else\ht\floattext\fi + \fi \setbox\floatbox\vpack to \floattextheight {\hsize\floatwidth - \doifelseinset\v!both\floatlocation - {\doifelseinset\v!low\floatlocation - {\vfill\box\floatbox} - {\doifelseinset\v!middle\floatlocation - {\vfill\box\floatbox\vfill} - {\box\floatbox\vfill}}} - {\box\floatbox\vfill}}% + \ifinset\v!both\floatlocation + \ifinset\v!low\floatlocation + \vfill\box\floatbox + \orelse\ifinset\v!middle\floatlocation + \vfill\box\floatbox\vfill + \else + \box\floatbox\vfill + \fi + \else + \box\floatbox\vfill + \fi}% \setbox\floattext\vpack to \floattextheight - {\hsize\floattextwidth - \doifelseinset\v!low\floatlocation - {\vfill + {\hsize\floattextwidth + \ifinset\v!low\floatlocation + \vfill \box\floattext - \doifinset\c!offset\floatlocation{\whitespace\blank}} - {\doifelseinset\v!middle\floatlocation - {\vfill - \box\floattext - \vfill} - {\doifinset\v!offset\floatlocation{\whitespace\blank}% - \box\floattext - \vfill}}}% - \doifelseinset\v!right\floatlocation - {\setbox\floatbox\hpack to \hsize - {\box\floattext - \hfill - \box\floatbox}} - {\setbox\floatbox\hpack to \hsize - {\box\floatbox - \hfill - \box\floattext}}% + \ifinset\c!offset\floatlocation\whitespace\blank\fi + \orelse\ifinset\v!middle\floatlocation + \vfill + \box\floattext + \vfill + \else + \ifinset\v!offset\floatlocation\whitespace\blank\fi + \box\floattext + \vfill + \fi}% + \ifinset\v!right\floatlocation + \setbox\floatbox\hpack to \hsize + {\box\floattext + \hfill + \box\floatbox}% + \else + \setbox\floatbox\hpack to \hsize + {\box\floatbox + \hfill + \box\floattext}% + \fi \baselinecorrection \whitespace \blank[\rootfloatparameter\c!spacebefore]% - \doifnotinset\v!tall\floatlocation - {\dp\floatbox\openstrutdepth}% \strutdp % toegevoegd + \ifinset\v!tall\floatlocation\else + \dp\floatbox\openstrutdepth% \strutdp % toegevoegd + \fi \box\floatbox \dostoptagged \blank[\rootfloatparameter\c!spaceafter]% @@ -1649,8 +1816,9 @@ \def\strc_floats_align_content_indeed {\alignstrutmode\zerocount \ifx\forcedfloatmethod\v!local \else - \doifnotcommon\floatcaptionlocation{\v!outermargin,\v!innermargin,\v!leftmargin,\v!rightmargin} - {\strc_floats_shift_indeed\floatparameter}% + \ifcommon\floatcaptionlocation{\v!outermargin,\v!innermargin,\v!leftmargin,\v!rightmargin}\else + \strc_floats_shift_indeed\floatparameter + \fi \expandafter\strc_floats_align_indeed \fi} @@ -1724,10 +1892,10 @@ \strc_floats_prepare_no_caption \strc_floats_set_caption_dimensions\voidbox %\page_backgrounds_add_local_to_box\floatbox % was \doglobal but not needed -\ifx\forcedfloatmethod\v!local - % we need \ifinfloatcombination - \strc_floats_build_box -\fi + \ifx\forcedfloatmethod\v!local + % we need \ifinfloatcombination + \strc_floats_build_box + \fi \else % todo: installable maken, variant/method=auto vs macro \strc_floats_prepare_page_caption @@ -1744,15 +1912,16 @@ % manual \fi \ifconditional\c_floats_store_minimal_package - % nothing + % nothing \orelse\ifcase\c_strc_floats_rotation - \doifnotinset\v!margin\floatlocation % brr, really needed! see wm - {\postcenterfloatbox\d_strc_floats_content - \strc_floats_mark_pag_as_free}% - % mark as free not done here + \ifinset\v!margin\floatlocation\else % brr, really needed! see wm + \postcenterfloatbox\d_strc_floats_content + \strc_floats_mark_pag_as_free + \fi + % mark as free not done here \else \global\setbox\floatbox\vpack - {\rotate[\c!rotation=\number\c_strc_floats_rotation]{\box\floatbox}}% + {\rotate[\c!rotation=\the\c_strc_floats_rotation]{\box\floatbox}}% \strc_floats_mark_pag_as_free \fi \egroup} @@ -1769,15 +1938,15 @@ \edef\p_strc_floats_caption_minwidth{\floatcaptionparameter\c!minwidth}% \edef\p_strc_floats_caption_align {\floatcaptionparameter\c!align}% \dostarttagged\t!floatcaption\empty - \doifcommonelse\floatcaptionlocation{\v!top,\v!bottom} - {\strc_floats_prepare_page_caption_top_bottom} - {\ifx\p_strc_floats_caption_width\v!fit - \strc_floats_prepare_side_auto_caption - \orelse\ifx\p_strc_floats_caption_width\v!max - \strc_floats_prepare_side_auto_caption - \else - \strc_floats_prepare_side_width_caption - \fi}% + \ifcommon{\v!top,\v!bottom}\floatcaptionlocation + \strc_floats_prepare_page_caption_top_bottom + \orelse\ifx\p_strc_floats_caption_width\v!fit + \strc_floats_prepare_side_auto_caption + \orelse\ifx\p_strc_floats_caption_width\v!max + \strc_floats_prepare_side_auto_caption + \else + \strc_floats_prepare_side_width_caption + \fi \dostoptagged} \def\strc_floats_prepare_page_caption_top_bottom @@ -1806,9 +1975,9 @@ \def\strc_floats_caption_set_align {\edef\m_align{\v!reset\ifempty\p_strc_floats_caption_align\else,\fi\p_strc_floats_caption_align}% - \doifinset\v!tolerant \floatcaptionlocation{\edef\m_align{\m_align,\v!tolerant}}% - \doifinset\v!verytolerant\floatcaptionlocation{\edef\m_align{\m_align,\v!verytolerant}}% - \doifinset\v!stretch \floatcaptionlocation{\edef\m_align{\m_align,\v!stretch}}% + \ifinset\v!tolerant \floatcaptionlocation\edef\m_align{\m_align,\v!tolerant }\fi + \ifinset\v!verytolerant\floatcaptionlocation\edef\m_align{\m_align,\v!verytolerant}\fi + \ifinset\v!stretch \floatcaptionlocation\edef\m_align{\m_align,\v!stretch }\fi \setupalign[\m_align]} \def\strc_floats_prepare_side_auto_caption @@ -1857,8 +2026,13 @@ \strc_floats_make_complete_caption}} \def\strc_floats_prepare_stack_caption_auto - {\ifempty\p_strc_floats_caption_align \else - \doifnotinset\v!middle\p_strc_floats_caption_align{\d_strc_floats_caption_overshoot\zeropoint}% +% {\ifempty\p_strc_floats_caption_align +% \orelse\ifinset\v!middle\p_strc_floats_caption_align +% \else +% \d_strc_floats_caption_overshoot\zeropoint +% \fi + {\ifinset\v!middle\p_strc_floats_caption_align\else + \d_strc_floats_caption_overshoot\zeropoint \fi \d_strc_floats_caption_hsize\wd\b_strc_floats_content \scratchwidth\floatcaptionparameter\c!maxwidth\relax @@ -1940,16 +2114,18 @@ {\ifconditional\c_strc_floats_par_float \hpack \else \expandafter \strc_floats_align_content \fi % skip, no pack {\d_strc_float_temp_height\ht\b_strc_floats_content \box\b_strc_floats_content - \doifnotinset\v!hang\floatcaptionlocation - {\dotfskip{\floatcaptionparameter\c!distance}}% + \ifinset\v!hang\floatcaptionlocation\else + \dotfskip{\floatcaptionparameter\c!distance}% + \fi \vbox to\d_strc_float_temp_height{#1}}} \def\strc_floats_build_box_next_left#1% {\ifconditional\c_strc_floats_par_float \hpack \else \expandafter \strc_floats_align_content \fi % skip, no pack {\d_strc_float_temp_height\ht\b_strc_floats_content \vbox to\d_strc_float_temp_height{#1}% - \doifnotinset\v!hang\floatcaptionlocation - {\dotfskip{\floatcaptionparameter\c!distance}}% + \ifinset\v!hang\floatcaptionlocation\else + \dotfskip{\floatcaptionparameter\c!distance}% + \fi \box\b_strc_floats_content}} \def\strc_floats_build_box_next_outer @@ -2060,17 +2236,23 @@ {\hsmash{\llap{\box\b_strc_floats_caption\dotfskip{\floatcaptionparameter\c!distance}}}} \def\strc_floats_flush_caption_hang - {\doifelseinset\v!righthanging\floatcaptionlocation - {\strc_floats_flush_right_caption_hang} - {\doifelseinset\v!lefthanging\floatcaptionlocation - {\strc_floats_flush_left_caption_hang} - {\doifelseinset\v!hang\floatcaptionlocation - {\doifelseinset\v!outer\floatcaptionlocation - {\doifelserightpagefloat{\strc_floats_flush_right_caption_hang}{\strc_floats_flush_left_caption_hang}} - {\doifelseinset\v!right\floatcaptiondirectives - {\strc_floats_flush_right_caption_hang} - {\strc_floats_flush_left_caption_hang}}} - {\box\b_strc_floats_caption}}}} % is this ok + {\ifinset\v!righthanging\floatcaptionlocation + \strc_floats_flush_right_caption_hang + \orelse\ifinset\v!lefthanging\floatcaptionlocation + \strc_floats_flush_left_caption_hang + \orelse\ifinset\v!hang\floatcaptionlocation + \ifinset\v!outer\floatcaptionlocation + \doifelserightpagefloat + {\strc_floats_flush_right_caption_hang} + {\strc_floats_flush_left_caption_hang}% + \orelse\ifinset\v!right\floatcaptiondirectives + \strc_floats_flush_right_caption_hang + \else + \strc_floats_flush_left_caption_hang + \fi + \else + \box\b_strc_floats_caption + \fi} % is this ok \def\strc_floats_build_box_high {\strc_floats_build_box_next{\strc_floats_between_stack\strc_floats_flush_caption_hang\vfill}} @@ -2140,27 +2322,22 @@ \hpack{\box\b_strc_floats_caption}} \def\strc_floats_build_box_top_stack_normal - {\doifelseinset\v!overlay{\floatcaptionparameter\c!location} + {\ifinset\v!overlay{\floatcaptionparameter\c!location}% \strc_floats_build_box_top_stack_normal_overlay - {\doifelseinset\v!tight{\floatlocation} + \orelse\ifinset\v!tight{\floatlocation}% \strc_floats_build_box_top_stack_normal_tight - \strc_floats_build_box_top_stack_normal_content}} + \else + \strc_floats_build_box_top_stack_normal_content + \fi} \def\strc_floats_build_box_bottom_stack_normal - {\doifelseinset\v!overlay{\floatcaptionparameter\c!location} + {\ifinset\v!overlay{\floatcaptionparameter\c!location}% \strc_floats_build_box_bottom_stack_normal_overlay - {\doifelseinset\v!tight{\floatlocation} + \orelse\ifinset\v!tight{\floatlocation}% \strc_floats_build_box_bottom_stack_normal_tight - \strc_floats_build_box_bottom_stack_normal_content}} - -% \def\strc_floats_build_box_bottom_stack_normal -% {\ifhasxtoks{,\v!overlay,}{,\floatcaptionparameter\c!location,}% -% \strc_floats_build_box_bottom_stack_normal_overlay -% \orelse\ifhasxtoks{,\v!tight,}{,\floatlocation,}% -% \strc_floats_build_box_bottom_stack_normal_tight -% \else -% \strc_floats_build_box_bottom_stack_normal_content -% \fi} + \else + \strc_floats_build_box_bottom_stack_normal_content + \fi} \def\strc_floats_build_box_top_stack_grid {\dp\b_strc_floats_caption\strutdepth @@ -2324,8 +2501,8 @@ \newbox\b_strc_floats_separate_caption \def\strc_floats_build_box_separate_set - {\settrue\c_floats_adapt_to_caption_width - \settrue\c_floats_store_minimal_package} + {\c_floats_adapt_to_caption_width\conditionaltrue + \c_floats_store_minimal_package\conditionaltrue} % \def\strc_floats_build_box_separate_make % {\offinterlineskip @@ -2337,8 +2514,8 @@ %D list and we no longer have just a box (but inserts and lines again). \def\strc_floats_build_box_separate_make - {\savebox\??localfloatstack{\number\numexpr\c_strc_localfloats_n+1\relax:a}{\box\b_strc_floats_content}% - \savebox\??localfloatstack{\number\numexpr\c_strc_localfloats_n+1\relax:b}{\box\b_strc_floats_caption}} + {\savebox\??localfloatstack{\the\numexpr\c_strc_localfloats_n+1\relax:a}{\box\b_strc_floats_content}% + \savebox\??localfloatstack{\the\numexpr\c_strc_localfloats_n+1\relax:b}{\box\b_strc_floats_caption}} \protected\def\strc_floats_build_box_separate_split#1% {\global\setbox\b_strc_floats_separate_content\vpack{\foundbox\??localfloatstack{\number#1:a}}% @@ -2557,10 +2734,11 @@ \global\floatheight\htdp\floatbox \global\floatwidth\wd\floatbox \ifconditional\c_floats_store_minimal_package \else - \doifnotinset\v!margin\floatlocation % gaat namelijk nog fout - {\setbox\floatbox\vpack - {\parindent\zeropoint - \box\floatbox}}% + \ifinset\v!margin\floatlocation\else % gaat namelijk nog fout + \setbox\floatbox\vpack + {\parindent\zeropoint + \box\floatbox}% + \fi \fi \wd\floatbox\floatwidth \ifdim\dimexpr\floatheight+\lineheight\relax<\textheight \else @@ -2724,7 +2902,7 @@ \permanent\protected\def\somelocalfloat {\global\advanceby\c_strc_localfloats_n\plusone - \savebox\??localfloatstack{\number\c_strc_localfloats_n}{\box\floatbox}} + \savebox\??localfloatstack{\the\c_strc_localfloats_n}{\box\floatbox}} \permanent\protected\def\getlocalfloats {\dorecurse\c_strc_localfloats_n diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl index 10bd7f468f7..564247d9b26 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl @@ -60,23 +60,24 @@ \newdimension\d_strc_indentedtexts_distance \appendtoks - \frozen\instance\setuevalue {\e!start\currentindentedtext}{\strc_indentedtexts_start{\currentindentedtext}\c_strc_indentedtexts_nesting}% - \frozen\instance\setuevalue {\e!stop \currentindentedtext}{\strc_indentedtexts_stop}% + \frozen\instance\protected\edefcsname\e!start\currentindentedtext\endcsname{\strc_indentedtexts_start{\currentindentedtext}\c_strc_indentedtexts_nesting}% + \frozen\instance\protected\edefcsname\e!stop \currentindentedtext\endcsname{\strc_indentedtexts_stop}% % to be avoided ... might go away - \frozen\instance\setuevalue {\currentindentedtext}{\strc_indentedtexts_direct{\currentindentedtext}{0}}% - \frozen\instance\setuevalue {\v!sub\currentindentedtext}{\strc_indentedtexts_direct{\currentindentedtext}{1}}% - \frozen\instance\setuevalue{\v!sub\v!sub\currentindentedtext}{\strc_indentedtexts_direct{\currentindentedtext}{2}}% + \frozen\instance\protected\edefcsname \currentindentedtext\endcsname{\strc_indentedtexts_direct{\currentindentedtext}{0}}% + \frozen\instance\protected\edefcsname \v!sub\currentindentedtext\endcsname{\strc_indentedtexts_direct{\currentindentedtext}{1}}% + \frozen\instance\protected\edefcsname\v!sub\v!sub\currentindentedtext\endcsname{\strc_indentedtexts_direct{\currentindentedtext}{2}}% \to \everydefineindentedtext \protected\def\strc_indentedtexts_start#1#2% we need to get rid of \spr {\par \begingroup - \edef\currentindentedtext{#1}% + \cdef\currentindentedtext{#1}% \c_strc_indentedtexts_nesting#2\relax \indentedtextparameter\c!before \d_strc_indentedtexts_distance\indentedtextparameter\c!distance\relax - \doifnothing{\indentedtextparameter\c!sample} - {\setindentedtextparameter\c!sample{\indentedtextparameter\c!text}}% + \ifempty{\indentedtextparameter\c!sample}% + \setindentedtextparameter\c!sample{\indentedtextparameter\c!text}% + \fi \assignwidth {\indentedtextparameter\c!width} {\d_strc_indentedtexts_width} diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-itm.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-itm.lmt index 4ee084ca3b7..2ed0789d921 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-itm.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-itm.lmt @@ -29,8 +29,8 @@ if job then job.register("structures.itemgroups.collected", tobesaved, initializer) end -local c_strc_itemgroups_max_items = tex.iscount("c_strc_itemgroups_max_items") -local d_strc_itemgroups_max_width = tex.isdimen("d_strc_itemgroups_max_width") +local c_strc_itemgroups_max_items = tex.iscount("c_strc_itemgroups_max_items") +local d_strc_itemgroups_max_width = tex.isdimen("d_strc_itemgroups_max_width") -- We keep the counter at the Lua end so we can group the items within -- an itemgroup which in turn makes for less passes when one itemgroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx index a7dda8fdd45..085477610f4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx @@ -185,6 +185,7 @@ \newconditional\c_strc_itemgroups_pack \newconditional\c_strc_itemgroups_paragraph \newconditional\c_strc_itemgroups_text +\newconditional\c_strc_itemgroups_no_par \newconditional\c_strc_itemgroups_text_saved \newconditional\c_strc_itemgroups_first \newconditional\c_strc_itemgroups_before @@ -203,17 +204,20 @@ \newconditional\c_strc_itemgroups_repeat \newconditional\c_strc_itemgroups_inline_head \newconditional\c_strc_itemgroups_symbol +\newconditional\c_strc_itemgroups_overlay % 0 = before/after % 1 = between unless before % 2 = between (auto) \newconstant \c_strc_itemgroups_spacing_mode \c_strc_itemgroups_spacing_mode\plustwo -\newconditional\c_strc_itemgroups_optimize \settrue\c_strc_itemgroups_optimize -\newconditional\c_strc_itemgroups_auto_concat \settrue\c_strc_itemgroups_auto_concat +\newconditional\c_strc_itemgroups_auto_concat \c_strc_itemgroups_auto_concat \conditionaltrue -\newboundary \c_strc_itemgroups_boundary +% 0=loose 1=tight 2=verytight + +\newinteger \c_strc_itemgroups_optimize \c_strc_itemgroups_optimize\plusone % tight +\newboundary \c_strc_itemgroups_boundary \newbox \b_strc_itemgroups \newdimension \d_strc_itemgroups_list_width @@ -236,6 +240,7 @@ \mutable\let \currentitemlevel \!!zerocount % public \mutable\def \currentnofitems {\the\c_strc_itemgroups_max_items} +\mutable\def \currentitemindex {\the\c_strc_itemgroups_n_of_items} \mutable\def \currentitemnumber {\strc_counters_raw_sub\v_strc_itemgroups_counter\currentitemlevel} % public \newtoks \itemgroupcommands % maybe public @@ -337,9 +342,9 @@ \aliased\let\setupitemgroups\setupitemgroup \appendtoks - \frozen\instance\setuevalue{\e!start\currentitemgroup}{\startitemgroup[\currentitemgroup]}% - \frozen\instance\setuevalue{\e!stop \currentitemgroup}{\stopitemgroup}% - \frozen\instance\setuevalue{\e!setup\currentitemgroup\e!endsetup}{\setupitemgroup[\currentitemgroup]}% obsolete + \frozen\instance\protected\edefcsname\e!start\currentitemgroup \endcsname{\startitemgroup[\currentitemgroup]}% + \frozen\instance\protected\edefcsname\e!stop \currentitemgroup \endcsname{\stopitemgroup}% + \frozen\instance\protected\edefcsname\e!setup\currentitemgroup\e!endsetup\endcsname{\setupitemgroup[\currentitemgroup]}% obsolete \let\currentparentitemgroup\currentitemgroup \definecounter[\v_strc_itemgroups_counter]% \to \everydefineitemgroup @@ -361,17 +366,21 @@ % These will become keywords. We will also add a feature to keep the while set % together. -\definevspacing[\v!item @0] [penalty:0] % allow -\definevspacing[\v!item @10000] [penalty:10000] % no -\definevspacing[\v!item @-5] [penalty:-5] -\definevspacing[\v!item @5] [penalty:5] -\definevspacing[\v!item @500] [penalty:500] % discourage .. too low, 5000 is better +\definevspacing[\v!item @\v!no] [penalty:0] % allow +\definevspacing[\v!item @\v!yes] [penalty:10000] % never +\definevspacing[\v!item @\v!tight] [penalty:500] % discourage +\definevspacing[\v!item @\v!verytight] [penalty:5000] % discourage more + +\definevspacing[\v!item @-5] [penalty:-5] +\definevspacing[\v!item @5] [penalty:5] \def\strc_itemgroups_insert_break_when_needed#break% - {\ifconditional\c_strc_itemgroups_optimize - \ifconditional\c_strc_itemgroups_text \else - #break\relax - \fi + {\ifcase\c_strc_itemgroups_optimize + % loose + \orelse\ifconditional\c_strc_itemgroups_text + % horizontal + \else + #break\relax \fi} \def\strc_itemgroups_insert_breakallow{\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakallow_indeed} @@ -380,10 +389,10 @@ \def\strc_itemgroups_insert_nobreak {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_nobreak_indeed } \def\strc_itemgroups_insert_breakallow_indeed - {\vspacing[\v!item @0]} + {\vspacing[\v!item @\v!no]} \def\strc_itemgroups_insert_breakno_indeed - {\vspacing[\v!item @10000]} + {\vspacing[\v!item @\v!yes]} \def\strc_itemgroups_insert_break_indeed {\flushnotes @@ -393,8 +402,13 @@ {\flushnotes \ifinsidecolumns % todo \vspacing[\v!item @5]% + \orelse\ifcase\c_strc_itemgroups_optimize + \or + % tight + \vspacing[\v!item @\v!tight]% \else - \vspacing[\v!item @500]% + % verytight + \vspacing[\v!item @\v!verytight]% \fi} \protected\def\strc_itemgroups_process_options#options% @@ -425,12 +439,12 @@ \def\strc_itemgroups_process_set_option_pack {\ifcase\c_strc_itemgroups_nesting \else - \settrue\c_strc_itemgroups_pack + \c_strc_itemgroups_pack\conditionaltrue \fi} \def\strc_itemgroups_process_set_option_unpack {\ifcase\c_strc_itemgroups_nesting\else - \setfalse\c_strc_itemgroups_pack + \c_strc_itemgroups_pack\conditionalfalse \fi} \defcsname\??itemgroupkeyword\!!zerocount\endcsname @@ -443,10 +457,10 @@ {\strc_itemgroups_process_set_option_unpack} \defcsname\??itemgroupkeyword\v!intro\endcsname - {\settrue\c_strc_itemgroups_intro} % here? not set to false + {\c_strc_itemgroups_intro\conditionaltrue} % here? not set to false \defcsname\??itemgroupkeyword\v!autointro\endcsname - {\settrue\c_strc_itemgroups_auto_intro} + {\c_strc_itemgroups_auto_intro\conditionaltrue} \defcsname\??itemgroupkeyword\v!broad\endcsname {\ifempty\itemgroupfirst @@ -455,19 +469,19 @@ \letitemgroupparameter\c!factor\itemgroupfirst} \defcsname\??itemgroupkeyword\v!text\endcsname - {\settrue\c_strc_itemgroups_text - \settrue\c_strc_itemgroups_inline - \settrue\c_strc_itemgroups_joined + {\c_strc_itemgroups_text\conditionaltrue + \c_strc_itemgroups_inline\conditionaltrue + \c_strc_itemgroups_joined\conditionaltrue \strc_itemgroups_process_set_option_pack} \defcsname\??itemgroupkeyword\v!before\endcsname - {\settrue\c_strc_itemgroups_before} + {\c_strc_itemgroups_before\conditionaltrue} \defcsname\??itemgroupkeyword\v!after\endcsname - {\settrue\c_strc_itemgroups_after} + {\c_strc_itemgroups_after\conditionaltrue} \defcsname\??itemgroupkeyword\v!nowhite\endcsname - {\settrue\c_strc_itemgroups_nowhite} + {\c_strc_itemgroups_nowhite\conditionaltrue} \defcsname\??itemgroupkeyword\v!margin\endcsname % signal {\setitemgroupparameter\c!width{-2em}} @@ -481,30 +495,42 @@ \fi} \defcsname\??itemgroupkeyword\v!intext\endcsname - {\settrue\c_strc_itemgroups_inline} + {\c_strc_itemgroups_inline\conditionaltrue} \defcsname\??itemgroupkeyword\v!headintext\endcsname - {\settrue\c_strc_itemgroups_inline_head} + {\c_strc_itemgroups_inline_head\conditionaltrue} \defcsname\??itemgroupkeyword\v!loose\endcsname - {\setfalse\c_strc_itemgroups_optimize} + {\c_strc_itemgroups_optimize\zerocount} + +\defcsname\??itemgroupkeyword\v!tight\endcsname % new per 2023-07-16 + {\c_strc_itemgroups_optimize\plusone} + +\defcsname\??itemgroupkeyword\v!verytight\endcsname % new per 2023-07-16 + {\c_strc_itemgroups_optimize\plustwo} + +\defcsname\??itemgroupkeyword\v!tight:\v!first\endcsname % new per 2023-07-16 + {\c_strc_itemgroups_optimize\plusthree} + +\defcsname\??itemgroupkeyword\v!tight:\v!last\endcsname % new per 2023-07-16 + {\c_strc_itemgroups_optimize\plusfour} \defcsname\??itemgroupkeyword\v!fit\endcsname - {\settrue\c_strc_itemgroups_fitting} + {\c_strc_itemgroups_fitting\conditionaltrue} \defcsname\??itemgroupkeyword\v!nofit\endcsname - {\setfalse\c_strc_itemgroups_fitting} + {\c_strc_itemgroups_fitting\conditionalfalse} \defcsname\??itemgroupkeyword\v!paragraph\endcsname - {\settrue\c_strc_itemgroups_paragraph + {\c_strc_itemgroups_paragraph\conditionaltrue \strc_itemgroups_process_set_option_pack} \defcsname\??itemgroupkeyword\v!joinedup\endcsname - {\settrue\c_strc_itemgroups_joined + {\c_strc_itemgroups_joined\conditionaltrue \strc_itemgroups_process_set_option_pack} \defcsname\??itemgroupkeyword\v!notjoinedup\endcsname - {\setfalse\c_strc_itemgroups_joined} + {\c_strc_itemgroups_joined\conditionalfalse} \defcsname\??itemgroupkeyword\v!serried\endcsname {\edef\itemgroupfirst{-\ifempty\itemgroupfirst1\else\itemgroupfirst\fi}% @@ -517,16 +543,19 @@ {\letitemgroupparameter\c!placestopper\v!no} % keep {} \defcsname\??itemgroupkeyword\v!repeat\endcsname - {\settrue\c_strc_itemgroups_repeat} + {\c_strc_itemgroups_repeat\conditionaltrue} \defcsname\??itemgroupkeyword\v!norepeat\endcsname - {\setfalse\c_strc_itemgroups_repeat} + {\c_strc_itemgroups_repeat\conditionalfalse} \defcsname\??itemgroupkeyword\v!reverse\endcsname - {\settrue\c_strc_itemgroups_reverse} + {\c_strc_itemgroups_reverse\conditionaltrue} \defcsname\??itemgroupkeyword\v!columns\endcsname - {\settrue\c_strc_itemgroups_columns} + {\c_strc_itemgroups_columns\conditionaltrue} + +\defcsname\??itemgroupkeyword\v!overlay\endcsname + {\c_strc_itemgroups_overlay\conditionaltrue} \defcsname\??itemgroupkeyword\v!one \endcsname{\letitemgroupparameter\c!n\plusone} \defcsname\??itemgroupkeyword\v!two \endcsname{\letitemgroupparameter\c!n\plustwo} @@ -552,26 +581,28 @@ \letitemgroupparameter \c!after \blank} \def\strc_itemgroups_initialize_local - {\setfalse\c_strc_itemgroups_inline - \setfalse\c_strc_itemgroups_concat - \setfalse\c_strc_itemgroups_txt + {\c_strc_itemgroups_inline\conditionalfalse + \c_strc_itemgroups_concat\conditionalfalse + \c_strc_itemgroups_txt\conditionalfalse + \c_strc_itemgroups_no_par\conditionalfalse % - \setfalse\c_strc_itemgroups_reverse - \setfalse\c_strc_itemgroups_intro - \setfalse\c_strc_itemgroups_auto_intro - \setfalse\c_strc_itemgroups_before - \setfalse\c_strc_itemgroups_after - \setfalse\c_strc_itemgroups_nowhite - \setfalse\c_strc_itemgroups_randomize - \setfalse\c_strc_itemgroups_horizontal - \setfalse\c_strc_itemgroups_collecting - \setfalse\c_strc_itemgroups_intro - \setfalse\c_strc_itemgroups_continue + \c_strc_itemgroups_reverse\conditionalfalse + \c_strc_itemgroups_intro\conditionalfalse + \c_strc_itemgroups_auto_intro\conditionalfalse + \c_strc_itemgroups_before\conditionalfalse + \c_strc_itemgroups_after\conditionalfalse + \c_strc_itemgroups_nowhite\conditionalfalse + \c_strc_itemgroups_randomize\conditionalfalse + \c_strc_itemgroups_horizontal\conditionalfalse + \c_strc_itemgroups_collecting\conditionalfalse + \c_strc_itemgroups_intro\conditionalfalse + \c_strc_itemgroups_continue\conditionalfalse % this will be a constant - \setfalse\c_strc_itemgroups_head - \setfalse\c_strc_itemgroups_sub - \setfalse\c_strc_itemgroups_symbol - \setfalse\c_strc_itemgroups_columns + \c_strc_itemgroups_head\conditionalfalse + \c_strc_itemgroups_sub\conditionalfalse + \c_strc_itemgroups_symbol\conditionalfalse + \c_strc_itemgroups_columns\conditionalfalse + \c_strc_itemgroups_overlay\conditionalfalse % to be checked \lettonothing\m_strc_itemgroups_destination \lettonothing\strc_itemgroups_used_symbol % ** start value @@ -582,20 +613,20 @@ } \defcsname\??itemgroupfirst\v!intro\endcsname - {\settrue\c_strc_itemgroups_intro} + {\c_strc_itemgroups_intro\conditionaltrue} \defcsname\??itemgroupfirst\v!continue\endcsname - {\settrue\c_strc_itemgroups_continue} + {\c_strc_itemgroups_continue\conditionaltrue} \defcsname\??itemgroupfirst\v!random\endcsname - {\settrue\c_strc_itemgroups_randomize - \settrue\c_strc_itemgroups_collecting} + {\c_strc_itemgroups_randomize\conditionaltrue + \c_strc_itemgroups_collecting\conditionaltrue} \defcsname\??itemgroupkeyword\v!horizontal\endcsname - {\settrue\c_strc_itemgroups_horizontal - \settrue\c_strc_itemgroups_collecting - \settrue\c_strc_itemgroups_inline - \settrue\c_strc_itemgroups_joined + {\c_strc_itemgroups_horizontal\conditionaltrue + \c_strc_itemgroups_collecting\conditionaltrue + \c_strc_itemgroups_inline\conditionaltrue + \c_strc_itemgroups_joined\conditionaltrue \strc_itemgroups_process_set_option_pack} \def\strc_itemgroups_preset_stage_one#options% @@ -678,7 +709,7 @@ \let\strc_itemgroups_normal_setup\setupitemgroup -\permanent\overloaded\tolerant\protected\def\setupitemgroup[#category]#spacer[#levels]#spacer[#options]#spacer[#settings]% category level|each options|settings settings|options +\permanent\overloaded\tolerant\protected\def\setupitemgroup[#S#category]#spacer[#S#levels]#spacer[#S#options]#spacer[#S#settings]% category level|each options|settings settings|options {\ifarguments % nothing to set up \or @@ -705,15 +736,8 @@ \fi \fi} -% can be made a bit faster - -% \def\strc_itemgroups_setup_each#category#whatever% -% {\doifelseassignment{#whatever} -% {\strc_itemgroups_normal_setup[#category][#whatever]} -% {\strc_itemgroups_normal_setup[#category][\c!option={#whatever}]}} - \def\strc_itemgroups_setup_each#category#whatever% - {\ifcondition\validassignment{#whatever}% + {\ifhastok={#whatever}% \strc_itemgroups_normal_setup[#category][#whatever]% \else \strc_itemgroups_normal_setup[#category][\c!option={#whatever}]% @@ -725,13 +749,8 @@ \def\strc_itemgroups_setup_list_level_b#category#whatever#level% {\strc_itemgroups_normal_setup[#category:#level][\c!option={#whatever}]} -% \def\strc_itemgroups_setup_list#subcategories#category#whatever% -% {\doifelseassignment{#whatever} -% {\processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_a{#category}{#whatever}}} -% {\processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_b{#category}{#whatever}}}} - \def\strc_itemgroups_setup_list#subcategories#category#whatever% - {\ifcondition\validassignment{#whatever}% + {\ifhastok={#whatever}% \processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_a{#category}{#whatever}}% \else \processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_b{#category}{#whatever}}% @@ -874,7 +893,7 @@ \def\strc_itemgroups_calculate_list_width#level% {\let\m_strc_itemgroups_saved\currentitemgroup - \edef\currentitemgroup{\currentparentitemgroup:\number#level}% + \cdef\currentitemgroup{\currentparentitemgroup:\number#level}% \ifdim\d_strc_itemgroups_max_width>\zeropoint \d_strc_itemgroups_list_width\d_strc_itemgroups_max_width \orelse\ifnum\itemgroupparameter\c!factor>\zerocount @@ -891,15 +910,15 @@ \lettonothing\p_itemgroups_options \lettonothing\p_itemgroups_extra_options -\permanent\tolerant\protected\def\startitemgroup[#category]#spacer[#options]#spacer[#settings]% +\permanent\tolerant\protected\def\startitemgroup[#S#category]#spacer[#S#options]#spacer[#S#settings]% {\begingroup % (1) \nofarguments\lastarguments - \def\currentitemgroup{#category}% no nested mixing of itemgroups + \cdef\currentitemgroup{#category}% no nested mixing of itemgroups \let\currentparentitemgroup\currentitemgroup \global\advanceby\c_strc_itemgroups_nesting\plusone - \def\currentitemlevel{\number\c_strc_itemgroups_nesting}% + \def\currentitemlevel{\the\c_strc_itemgroups_nesting}% \normalexpanded{\chaintocurrentitemgroup{\currentparentitemgroup:\currentitemlevel}}% - \edef\currentitemgroup{\currentparentitemgroup:\currentitemlevel}% + \cdef\currentitemgroup{\currentparentitemgroup:\currentitemlevel}% % \edef\p_itemgroups_options{\itemgroupparameter\c!option}% \lettonothing\p_itemgroups_extra_options @@ -932,24 +951,11 @@ \setconditional\c_strc_itemgroups_text_saved\c_strc_itemgroups_text \strc_itemgroups_initialize_local \strc_itemgroups_preset_stage_one\p_itemgroups_options -% -% \ifhmode -% \ifconditional\c_strc_itemgroups_auto_concat -% \ifnum\lastboundary=\c_strc_itemgroups_boundary -% \settrue\c_strc_itemgroups_concat -% \fi -% \fi -% \ifconditional\c_strc_itemgroups_text_saved \else -% \ifconditional\c_strc_itemgroups_text \else -% \par -% \fi -% \fi -% \fi -% \iftrialtypesetting \strc_counters_save\v_strc_itemgroups_counter \fi - \c_strc_itemgroups_n_of_items\zerocount +\globalpushmacro\c_strc_itemgroups_n_of_items +\global\c_strc_itemgroups_n_of_items\zerocount \strc_itemgroups_check_n_of_items \ifempty\p_itemgroups_options \strc_itemgroups_setup_symbol_default @@ -970,23 +976,26 @@ \ifhmode \ifconditional\c_strc_itemgroups_auto_concat \ifnum\lastboundary=\c_strc_itemgroups_boundary - \settrue\c_strc_itemgroups_concat + \c_strc_itemgroups_concat\conditionaltrue \fi \fi - \ifconditional\c_strc_itemgroups_text_saved \else - \ifconditional\c_strc_itemgroups_text \else - \par - \fi + \ifconditional\c_strc_itemgroups_text_saved + \orelse\ifconditional\c_strc_itemgroups_text + \orelse\ifconditional\c_strc_itemgroups_no_par + \else + \par \fi \fi % \ifconditional\c_strc_itemgroups_pack \ifnum\currentnofitems>\itemgroupparameter\c!packcriterium\relax\else - \setfalse\c_strc_itemgroups_pack + \c_strc_itemgroups_pack\conditionalfalse \fi \fi % - \ifnum\c_strc_itemgroups_nesting=\plusone % NIEUW + \ifconditional\c_strc_itemgroups_text % also does inline + % ignore + \orelse\ifnum\c_strc_itemgroups_nesting=\plusone % NIEUW \doadaptleftskip {\itemgroupparameter\c!margin}% \doadaptleftskip {\itemgroupparameter\c!leftmargin}% \doadaptrightskip{\itemgroupparameter\c!rightmargin}% @@ -1007,7 +1016,7 @@ \usealignparameter\itemgroupparameter \edef\m_strc_itemgroups_indenting{\itemgroupparameter\c!indenting}% \ifnum\c_strc_itemgroups_nesting>\zerocount - \settrue\c_strc_itemgroups_first + \c_strc_itemgroups_first\conditionaltrue \ifconditional\c_strc_itemgroups_continue \else \strc_counters_restart_sub\v_strc_itemgroups_counter\currentitemlevel{\numexpr\itemgroupparameter\c!start-\plusone\relax}% \fi @@ -1019,7 +1028,7 @@ \fi \fi \ifconditional\c_strc_itemgroups_auto_intro\ifnum\prevgraf<\plusthree - \settrue\c_strc_itemgroups_intro + \c_strc_itemgroups_intro\conditionaltrue \fi\fi \ifconditional\c_strc_itemgroups_paragraph \ifnum\c_strc_itemgroups_nesting>\plusone @@ -1108,8 +1117,8 @@ % will be redefined in page-mix \ifdefined\startcolumns \else - \protected\def\startcolumns[#settings]{} - \protected\def\stopcolumns {} + \protected\def\startcolumns[#S#settings]{} + \protected\def\stopcolumns {} \fi \def\strc_itemgroups_start_columns @@ -1135,7 +1144,8 @@ \par \fi \strc_itemgroups_register_status - \ifconditional\c_strc_itemgroups_first \else + % \ifconditional\c_strc_itemgroups_first \else + \ifnum\c_strc_itemgroups_n_of_items>\zerocount % different criterium \dostoptagged \dostoptagged % \endgroup % (3) @@ -1165,8 +1175,9 @@ \iftrialtypesetting \strc_counters_restore\v_strc_itemgroups_counter % could happen in LUA \fi +\globalpopmacro\c_strc_itemgroups_n_of_items \global\advanceby\c_strc_itemgroups_nesting\minusone - \xdef\currentitemlevel{\number\c_strc_itemgroups_nesting}% + \xdef\currentitemlevel{\the\c_strc_itemgroups_nesting}% %\ifconditional\c_strc_itemgroups_text \endgroup % (2) \endgroup % (1) @@ -1180,7 +1191,7 @@ % The items. \def\strc_itemgroups_start_item_first - {\setfalse\c_strc_itemgroups_first + {\c_strc_itemgroups_first\conditionalfalse % \begingroup % (3) \ifcase\c_strc_itemgroups_nesting % 0 @@ -1201,7 +1212,7 @@ \newinteger\c_strc_itemgroups_prev_level \def\strc_itemgroups_inbetween_command - {\nameditemgroupparameter{\currentparentitemgroup:\number\c_strc_itemgroups_prev_level}\c!inbetween} + {\nameditemgroupparameter{\currentparentitemgroup:\the\c_strc_itemgroups_prev_level}\c!inbetween} \def\strc_itemgroups_start_item_first_two {\ifconditional\c_strc_itemgroups_paragraph\else @@ -1209,9 +1220,11 @@ \ifcase\c_strc_itemgroups_spacing_mode \strc_itemgroups_before_command \or - \doifelsenothing\strc_itemgroups_before_command % should possibly expand to empty + \ifempty\strc_itemgroups_before_command % should possibly expand to empty \strc_itemgroups_inbetween_command + \else \strc_itemgroups_before_command + \fi \else \strc_itemgroups_inbetween_command \fi @@ -1219,8 +1232,8 @@ \fi} \def\strc_itemgroups_start_item_next - {\dostoptagged % ok? what do we stop here? - \dostoptagged % ok? what do we stop here? + {%\dostoptagged % moved + %\dostoptagged % moved \ifconditional\c_strc_itemgroups_text \ifhmode % WS: make the distance between items customizable, think about better default values -> see itemize-1.tex @@ -1256,25 +1269,36 @@ \mutable\lettonothing\currentitemreference -\tolerant\permanent\protected\def\startitemgroupitem[#reference]% we can reuse more - {\def\currentitemreference{#reference}% +\noaligned\tolerant\permanent\protected\def\startitemgroupitem[#reference]% we can reuse more + {\strc_itemgroups_begin + \def\currentitemreference{#reference}% \ifconditional\c_strc_itemgroups_text % begin of item + \orelse\ifconditional\c_strc_itemgroups_no_par + % special \else \par \fi \ifconditional\c_strc_itemgroups_concat \strc_itemgroups_insert_breakno \fi + % \ifconditional\c_strc_itemgroups_first + % \strc_itemgroups_start_item_first + % \else + % \strc_itemgroups_start_item_next + % \fi + % now: \strc_itemgroups_increment_item_counter - \ifconditional\c_strc_itemgroups_first - \strc_itemgroups_start_item_first - \else + \ifnum\c_strc_itemgroups_n_of_items>\zerocount % different criterium + \dostoptagged % moved here + \dostoptagged % moved here \strc_itemgroups_start_item_next + \else + \strc_itemgroups_start_item_first \fi \ifconditional\c_strc_itemgroups_concat \spac_overlay_lines % see spac-ver.mkvi ... a typical potential problem - \setfalse\c_strc_itemgroups_concat + \c_strc_itemgroups_concat\conditionalfalse \fi \dostarttagged\t!item\empty % \dotagsetitem\empty @@ -1294,7 +1318,7 @@ \boundary\c_strc_itemgroups_boundary % was signal \itemgroupparameter\c!command} -\protected\permanent\def\stopitemgroupitem +\noaligned\protected\permanent\def\stopitemgroupitem {\ifhmode \endstrut % new per 2017-12-15 \fi @@ -1302,7 +1326,11 @@ % nothing \else \endgraf - \fi} + \fi + \strc_itemgroups_end} + +\lettonothing\strc_itemgroups_begin +\lettonothing\strc_itemgroups_end \tolerant\permanent\protected\def\startitemgrouphead[#reference]% {\ifconditional\c_strc_itemgroups_first \else @@ -1330,7 +1358,7 @@ \stopitemgroupitem} \protected\def\strc_itemgroups_start_head_indeed - {\settrue\c_strc_itemgroups_head + {\c_strc_itemgroups_head\conditionaltrue \dotagsetitem\s!head% % weird place \dostarttagged\t!itemhead\empty \useitemgroupstyleandcolor\c!headstyle\c!headcolor @@ -1378,7 +1406,7 @@ \protected\def\strc_itemgroups_start_symbol#text% {\def\strc_itemgroups_extra_symbol{#text}% - \settrue\c_strc_itemgroups_symbol + \c_strc_itemgroups_symbol\conditionaltrue \startitemgroupitem \dotagsetitem\s!symbol} @@ -1388,7 +1416,7 @@ \begstrut} \protected\def\strc_itemgroups_start_subitem - {\settrue\c_strc_itemgroups_sub + {\c_strc_itemgroups_sub\conditionaltrue \startitemgroupitem \dotagsetitem\s!sub} @@ -1415,15 +1443,15 @@ \protected\def\strc_itemgroups_start_text#text% {\def\strc_itemgroups_extra_symbol{#text}% - \settrue\c_strc_itemgroups_symbol - \settrue\c_strc_itemgroups_txt + \c_strc_itemgroups_symbol\conditionaltrue + \c_strc_itemgroups_txt\conditionaltrue \startitemgroupitem} \protected\tolerant\def\strc_itemgroups_start_items[#1]% {\strc_itemgroups_start_edge {\localcontrolledloop \plusone - \ifchknum#1\or#1\else0\itemgroupparameter\c!items\fi + \ifchknumber#1\or\lastchknumber\else0\itemgroupparameter\c!items\fi \plusone {\strc_itemgroups_used_symbol\hss}% \unskip}} @@ -1447,29 +1475,86 @@ \letcsname\??itemgroupstart\v!txt \endcsname\strc_itemgroups_start_text \letcsname\??itemgroupstart\v!no \endcsname\strc_itemgroups_start_no_item +\def\strc_itemgroups_optimize_breaks_both + {\ifcase\c_strc_itemgroups_max_items + \orelse\ifnum\c_strc_itemgroups_max_items=\plusthree + \ifnum\c_strc_itemgroups_n_of_items>\plusone + \strc_itemgroups_insert_nobreak + \fi + \orelse\ifnum\c_strc_itemgroups_max_items>\plusthree + \ifnum\c_strc_itemgroups_n_of_items=\plustwo + \ifconditional\c_strc_itemgroups_intro + \strc_itemgroups_insert_breakno + \else + \strc_itemgroups_insert_nobreak + \fi + \orelse\ifnum\c_strc_itemgroups_max_items=\c_strc_itemgroups_n_of_items\relax + \strc_itemgroups_insert_nobreak + \orelse\ifnum\c_strc_itemgroups_n_of_items>\plustwo + \strc_itemgroups_insert_break + \orelse\ifconditional\c_strc_itemgroups_intro + \else + \strc_itemgroups_insert_break + \fi + \fi} + +\def\strc_itemgroups_optimize_breaks_first + {\ifcase\c_strc_itemgroups_max_items + \orelse\ifnum\c_strc_itemgroups_max_items=\plusthree + \ifnum\c_strc_itemgroups_n_of_items<\plusthree % ! + \strc_itemgroups_insert_nobreak % ! + \else % ! + \strc_itemgroups_insert_break % ! + \fi % ! + \orelse\ifnum\c_strc_itemgroups_max_items>\plusthree + \ifnum\c_strc_itemgroups_n_of_items=\plustwo + \ifconditional\c_strc_itemgroups_intro + \strc_itemgroups_insert_breakno + \else + \strc_itemgroups_insert_nobreak + \fi + \orelse\ifnum\c_strc_itemgroups_max_items=\c_strc_itemgroups_n_of_items\relax + \strc_itemgroups_insert_break % ! + \orelse\ifnum\c_strc_itemgroups_n_of_items>\plustwo + \strc_itemgroups_insert_break + \orelse\ifconditional\c_strc_itemgroups_intro + \else + \strc_itemgroups_insert_break + \fi + \fi} + +\def\strc_itemgroups_optimize_breaks_last + {\ifcase\c_strc_itemgroups_max_items + \orelse\ifnum\c_strc_itemgroups_max_items=\plusthree + \ifnum\c_strc_itemgroups_n_of_items>\plustwo % ! + \strc_itemgroups_insert_nobreak % ! + \else % ! + \strc_itemgroups_insert_break % ! + \fi % ! + \orelse\ifnum\c_strc_itemgroups_max_items>\plusthree + \ifnum\c_strc_itemgroups_n_of_items=\plustwo + \ifconditional\c_strc_itemgroups_intro + \strc_itemgroups_insert_breakno + \else + \strc_itemgroups_insert_break % ! + \fi + \orelse\ifnum\c_strc_itemgroups_max_items=\c_strc_itemgroups_n_of_items\relax + \strc_itemgroups_insert_nobreak + \orelse\ifnum\c_strc_itemgroups_n_of_items>\plustwo + \strc_itemgroups_insert_break + \orelse\ifconditional\c_strc_itemgroups_intro + \else + \strc_itemgroups_insert_break + \fi + \fi} + \def\strc_itemgroups_optimize_breaks {\ifcase\c_strc_itemgroups_column_depth - \ifconditional\c_strc_itemgroups_optimize - \ifcase\c_strc_itemgroups_max_items - \orelse\ifnum\c_strc_itemgroups_max_items=\plusthree - \ifnum\c_strc_itemgroups_n_of_items>\plusone - \strc_itemgroups_insert_nobreak - \fi - \orelse\ifnum\c_strc_itemgroups_max_items>\plusthree - \ifnum\c_strc_itemgroups_n_of_items=\plustwo - \ifconditional\c_strc_itemgroups_intro - \strc_itemgroups_insert_breakno - \else - \strc_itemgroups_insert_nobreak - \fi - \orelse\ifnum\c_strc_itemgroups_max_items=\c_strc_itemgroups_n_of_items\relax - \strc_itemgroups_insert_nobreak - \orelse\ifnum\c_strc_itemgroups_n_of_items>\plustwo - \strc_itemgroups_insert_break - \else - \ifconditional\c_strc_itemgroups_intro\else\strc_itemgroups_insert_break\fi - \fi - \fi + \ifconditional\c_strc_itemgroups_optimize % loose + \or \strc_itemgroups_optimize_breaks_both % tight + \or \strc_itemgroups_optimize_breaks_both % verytight + \or \strc_itemgroups_optimize_breaks_first % tight:first + \or \strc_itemgroups_optimize_breaks_last % tight:last \fi \fi} @@ -1515,8 +1600,9 @@ +\enspace \dostoptagged \fi + \scratchwidth\wd\b_strc_itemgroups \box\b_strc_itemgroups - \ifzerodim\wd\b_strc_itemgroups\else + \ifzerodim\scratchwidth\else \hskip\interwordspace % not configureable (yet), could be \c!textdistance \fi}% \nobreak} @@ -1533,8 +1619,8 @@ \protected\def\strc_itemgroups_start_head_sym#text% {\def\strc_itemgroups_extra_symbol{#text}% - \settrue\c_strc_itemgroups_symbol - \settrue\c_strc_itemgroups_head + \c_strc_itemgroups_symbol\conditionaltrue + \c_strc_itemgroups_head\conditionaltrue %\strc_itemgroups_start_head} \startitemgrouphead} @@ -1560,7 +1646,7 @@ \fi \fi}% \lettonothing\strc_itemgroups_extra_symbol - \setfalse\c_strc_itemgroups_symbol} + \c_strc_itemgroups_symbol\conditionalfalse} \def\strc_itemgroups_make_fitting_box {\ifdim\wd\b_strc_itemgroups>\itemgroupparameter\c!maxwidth\relax @@ -1568,17 +1654,18 @@ \fi \ifdim\d_strc_itemgroups_max_width>\zeropoint \setbox\b_strc_itemgroups\simplealignedbox - {\dimexpr\d_strc_itemgroups_max_width+\itemgroupparameter\c!distance\relax} - {\itemgroupparameter\c!itemalign} + {\dimexpr\d_strc_itemgroups_max_width+\itemgroupparameter\c!distance\relax}% + {\itemgroupparameter\c!itemalign}% {\box\b_strc_itemgroups\hskip\itemgroupparameter\c!distance}% \fi} \def\strc_itemgroups_make_aligned_box - {\doifsomething{\itemgroupparameter\c!itemalign} - {\setbox\b_strc_itemgroups\simplealignedbox - {\dimexpr\d_strc_itemgroups_asked_width+\itemgroupparameter\c!distance\relax} - {\itemgroupparameter\c!itemalign} - {\box\b_strc_itemgroups\hskip\itemgroupparameter\c!distance}}} + {\ifempty{\itemgroupparameter\c!itemalign}\else + \setbox\b_strc_itemgroups\simplealignedbox + {\dimexpr\d_strc_itemgroups_asked_width+\itemgroupparameter\c!distance\relax}% + {\itemgroupparameter\c!itemalign}% + {\box\b_strc_itemgroups\hskip\itemgroupparameter\c!distance}% + \fi} \def\strc_itemgroups_make_destination_box {\iftrialtypesetting \orelse \ifempty\m_strc_itemgroups_destination \else @@ -1586,12 +1673,13 @@ \fi} \def\strc_itemgroups_check_indenting - {\setfalse\c_strc_itemgroups_indented_first + {\c_strc_itemgroups_indented_first\conditionalfalse \ifempty\m_strc_itemgroups_indenting \else \normalexpanded{\setupindenting[\v!reset,\v!yes,\m_strc_itemgroups_indenting]}% \ifconditional\c_spac_indentation_indent_first % better is to have a mode - \doifnot{\itemgroupparameter\c!alignsymbol}\v!yes - {\settrue\c_strc_itemgroups_indented_first}% + \ifcstok{\itemgroupparameter\c!alignsymbol}\v!yes\else + \c_strc_itemgroups_indented_first\conditionaltrue + \fi \fi \fi} @@ -1604,59 +1692,75 @@ \lettonothing\m_strc_itemgroups_repeat_start \fi} +\newconditional\c_strc_itemgroups_ignore + +\noaligned\permanent\protected\def\startignoreditem % kind of private + {\global\c_strc_itemgroups_ignore\conditionaltrue + \startitem} + +\noaligned\permanent\protected\def\stopignoreditem % kind of private + {\stopitem + \global\c_strc_itemgroups_ignore\conditionalfalse} + \def\strc_itemgroups_insert_item {\ifconditional\c_strc_itemgroups_text % again? % begin of item + \orelse\ifconditional\c_strc_itemgroups_no_par % again? + % begin of item \else \par % done twice? \fi - \advanceby\c_strc_itemgroups_n_of_items\plusone - \strc_itemgroups_optimize_breaks - \strc_itemgroups_check_indenting - \dontleavehmode - \ifconditional\c_strc_itemgroups_indented_first - \hskip-\parindent - \fi - \strc_itemgroups_make_symbol_box - \strc_itemgroups_make_destination_box - \ifconditional\c_strc_itemgroups_fitting - \strc_itemgroups_make_fitting_box - \orelse\ifdim\d_strc_itemgroups_asked_width>\zeropoint - \strc_itemgroups_make_aligned_box + \iftrialtypesetting\else + \global\advanceby\c_strc_itemgroups_n_of_items\plusone \fi - \lettonothing\m_strc_itemgroups_destination - \ht\b_strc_itemgroups\strutheight % just in case a symbols is not yet available in - \dp\b_strc_itemgroups\strutdepth % the current run (more a mkii mp side artifact) - \strc_itemgroups_check_for_repeated - \ifdim\d_strc_itemgroups_asked_width<\zeropoint\relax - \strc_itemgroups_handle_lapped_item_negative - \else - \ifzeropt\d_strc_itemgroups_asked_width - \strc_itemgroups_calculate_list_width\plusone - \else - \strc_itemgroups_calculate_list_width\c_strc_itemgroups_nesting + \ifconditional\c_strc_itemgroups_ignore\else + \strc_itemgroups_optimize_breaks + \strc_itemgroups_check_indenting + \dontleavehmode + \ifconditional\c_strc_itemgroups_indented_first + \hskip-\parindent \fi - \ifconditional\c_strc_itemgroups_text - \strc_itemgroups_handle_groups_text_item - \orelse\ifconditional\c_strc_itemgroups_inline - \strc_itemgroups_handle_groups_inline_item - \orelse\ifconditional\c_strc_itemgroups_txt - \strc_itemgroups_handle_text_item + \strc_itemgroups_make_symbol_box + \strc_itemgroups_make_destination_box + \ifconditional\c_strc_itemgroups_fitting + \strc_itemgroups_make_fitting_box + \orelse\ifdim\d_strc_itemgroups_asked_width>\zeropoint + \strc_itemgroups_make_aligned_box + \fi + \lettonothing\m_strc_itemgroups_destination + \ht\b_strc_itemgroups\strutheight % just in case a symbols is not yet available in + \dp\b_strc_itemgroups\strutdepth % the current run (more a mkii mp side artifact) + \strc_itemgroups_check_for_repeated + \ifdim\d_strc_itemgroups_asked_width<\zeropoint\relax + \strc_itemgroups_handle_lapped_item_negative \else - \strc_itemgroups_handle_lapped_item_positive + \ifzeropt\d_strc_itemgroups_asked_width + \strc_itemgroups_calculate_list_width\plusone + \else + \strc_itemgroups_calculate_list_width\c_strc_itemgroups_nesting + \fi + \ifconditional\c_strc_itemgroups_text + \strc_itemgroups_handle_groups_text_item + \orelse\ifconditional\c_strc_itemgroups_inline + \strc_itemgroups_handle_groups_inline_item + \orelse\ifconditional\c_strc_itemgroups_txt + \strc_itemgroups_handle_text_item + \else + \strc_itemgroups_handle_lapped_item_positive + \fi + \fi + \c_strc_itemgroups_head\conditionalfalse + \c_strc_itemgroups_sub\conditionalfalse + \ifconditional\c_strc_itemgroups_indented_first + \hskip\parindent \fi - \fi - \setfalse\c_strc_itemgroups_head - \setfalse\c_strc_itemgroups_sub - \ifconditional\c_strc_itemgroups_indented_first - \hskip\parindent \fi \ignorepars} % \ignorespaces \def\strc_itemgroups_start_item_nop {\lettonothing\currentitemreference \strc_itemgroups_increment_item_counter - \advanceby\c_strc_itemgroups_n_of_items\plusone + \global\advanceby\c_strc_itemgroups_n_of_items\plusone \setbox\b_strc_itemgroups\hbox {\useitemgroupstyleandcolor\c!style\c!color \strc_itemgroups_used_symbol}% @@ -1724,7 +1828,6 @@ \ifdefined\startspecialitem \else \aliased\let\startspecialitem\relax \fi \ifdefined\stopspecialitem \else \aliased\let\stopspecialitem \relax \fi - \appendtoks \enforced\let\item \strc_itemgroups_start_do_item \enforced\let\sub \strc_itemgroups_start_subitem @@ -1766,6 +1869,8 @@ \next{\e!stop \v!head}\stopitemgrouphead } + % \let\next\relax + \fi \relaxvalueifundefined \v!item @@ -1814,7 +1919,7 @@ \normalexpanded{\def\strc_itemgroups_collected_store#1\csname\e!stop\v!item\endcsname}% {\advanceby\c_strc_itemgroups_collected_stored\plusone - \defcsname\??itemgroupstack\number\c_strc_itemgroups_collected_stored\endcsname + \defcsname\??itemgroupstack\the\c_strc_itemgroups_collected_stored\endcsname {\startitemgroupitem#1\stopitemgroupitem}} \def\strc_itemgroups_collected_flush_randomize @@ -1836,7 +1941,7 @@ \def\strc_itemgroups_collected_flush_indeed {\m_strc_itemgroups_collected - \letcsname\??itemgroupstack\number\c_strc_itemgroups_collected_current\endcsname\undefined} + \letcsname\??itemgroupstack\the\c_strc_itemgroups_collected_current\endcsname\undefined} \def\strc_itemgroups_collected_flush {\ifconditional\c_strc_itemgroups_randomize @@ -1844,7 +1949,7 @@ \else \advanceby\c_strc_itemgroups_collected_current\plusone \fi - \ifcsname\??itemgroupstack\number\c_strc_itemgroups_collected_current\endcsname + \ifcsname\??itemgroupstack\the\c_strc_itemgroups_collected_current\endcsname \edef\m_strc_itemgroups_collected{\lastnamedcs}% \ifconditional\c_strc_itemgroups_horizontal \strc_itemgroups_collected_flush_horizontal @@ -1864,7 +1969,7 @@ \ifnum\c_strc_itemgroups_collected_stored>\zerocount \ifconditional\c_strc_itemgroups_horizontal \strc_itemgroups_before_command - \setfalse\c_strc_itemgroups_first + \c_strc_itemgroups_first\conditionalfalse \strc_itemgroups_collected_flush %\strc_itemgroups_after_command % triggered elsewhere \else @@ -1885,7 +1990,11 @@ {\strc_itemgroups_item_alone} \tolerant\def\strc_itemgroups_item_alone[#category]#:#text\par - {\doifelsesomething{#category}{\startitemgroup[#category]}{\startitemgroup[\v!itemize]}% + {\ifempty{#category}% + \startitemgroup[\v!itemize]% + \else + \startitemgroup[#category]% + \fi \startitem#text\stopitem \stopitemgroup} @@ -1893,7 +2002,11 @@ {\strc_itemgroups_head_alone} \def\strc_itemgroups_head_alone[#category]#head\par#body\par - {\doifelsesomething{#category}{\startitemgroup[#category]}{\startitemgroup[\v!itemize]}% + {\ifempty{#category}% + \startitemgroup[\v!itemize]% + \else + \startitemgroup[#category]% + \fi \starthead{#head}#body\stophead \stopitemgroup} @@ -1948,6 +2061,111 @@ \box\b_strc_itemgroups \ignorepars} % \ignorespaces +%D New per 2023-08-01 + +\newdimension\d_strc_itemgroups_inbetween_table +\newdimension\d_strc_itemgroups_column_distance +\newdimension\d_strc_itemgroups_column_width + +\def\strc_itemgroups_table_begin + {\NC} + +\def\strc_itemgroups_table_end_row + {\NR + \ifzerodim\d_strc_itemgroups_inbetween_table\orelse\ifnum + \numexpression + \c_strc_itemgroups_n_of_items/\c_strc_itemgroups_columns + \relax<\numexpression + \c_strc_itemgroups_max_items /\c_strc_itemgroups_columns + \relax + \noalign{\m_strc_itemgroups_inbetween}% + % \TB[\the\d_strc_itemgroups_inbetween_table]% + \fi} + +\noaligned\def\strc_itemgroups_table_end + {\ifcase\numexpression\c_strc_itemgroups_n_of_items mod \c_strc_itemgroups_columns\relax + \expandafter\strc_itemgroups_table_end_row + \fi} + +\protected\def\strc_itemgroups_table_wrapup + {\iftrialtypesetting\orelse\ifcase\c_tabl_tabulate_column\else + \beginlocalcontrol % horrible hack to prevens crcr issues + \expandafter\endlocalcontrol\expandedloop + \numexpr\c_tabl_tabulate_column+\plusone\relax + \c_tabl_tabulate_nofcolumns + \plusone + {\startignoreditem\strut\stopignoreditem}% + \fi} + +\let\strc_itemgroups_table_pickup\relax + +\setupitemgroup[\c!columndistance=\emwidth] + +\lettonothing\m_strc_itemgroups_after +\lettonothing\m_strc_itemgroups_inbetween + +\tolerant\permanent\protected\def\strc_itemgroups_start_table[#1]#*[#S#2]#*[#S#3]% + {\ifcase\currentitemlevel\relax + \startitemgroup[#1][#2][#3]% + \itemgroupparameter\c!before + \orelse\ifhmode + \strut + \startitemgroup[#1][#2][#3]% + \ifconditional\c_strc_itemgroups_overlay + \blank[\v!overlay]% + \else + \itemgroupparameter\c!before + \fi + \else + \startitemgroup[#1][#2][#3]% + \itemgroupparameter\c!before + \fi + \edef\m_strc_itemgroups_after {\itemgroupparameter\c!after}% + \edef\m_strc_itemgroups_inbetween{\itemgroupparameter\c!inbetween}% + \setbox\scratchbox\vbox{\m_strc_itemgroups_inbetween}% + \d_strc_itemgroups_inbetween_table\htdp\scratchbox + \letitemgroupparameter\c!before\relax + \letitemgroupparameter\c!after\relax + \letitemgroupparameter\c!inbetween\relax + \c_strc_itemgroups_columns\itemgroupparameter\c!n + \let\strc_itemgroups_begin\strc_itemgroups_table_begin + \let\strc_itemgroups_end \strc_itemgroups_table_end + % + % horrible ... we have \dividebydsize\textwidth{1em}{3} + % + \scratchdistance\itemgroupparameter\c!columndistance + \d_strc_itemgroups_column_distance\dimexpr\leftskip+\rightskip\relax + \d_strc_itemgroups_column_width\hsize + \c_strc_itemgroups_no_par\conditionaltrue % blocks a par that interferes with tagging + \advanceby\d_strc_itemgroups_column_width -\c_strc_itemgroups_columns\d_strc_itemgroups_column_distance + \divideby \d_strc_itemgroups_column_width \c_strc_itemgroups_columns + \advanceby\d_strc_itemgroups_column_distance \scratchdistance + \advanceby\d_strc_itemgroups_column_width -\scratchdistance + \advanceby\d_strc_itemgroups_column_width \dimexpr\scratchdistance/\c_strc_itemgroups_columns\relax + % + \c_strc_itemgroups_optimize\zerocount % otherwise we inject vertical breaks between struts + % inlining confusses the verbose name parser + \normalexpanded{\strc_itemgroups_table_bootstrap + \csname\e!start#1\v!table\endcsname + \csname\e!stop #1\v!table\endcsname % watch the 'l' specification below, maybe a format key + {\expandedrepeat \c_strc_itemgroups_columns {|p(\the\d_strc_itemgroups_column_width)l}|}}} + +\protected\def\strc_itemgroups_table_bootstrap#1#2#3% + {\protected\def\strc_itemgroups_table_pickup##L#1##R#2##1% + {\tabl_tabulate_disable_tagging + \starttabulate[#3][\c!before=,\c!after=,\c!split=\v!no,\c!unit=\the\d_strc_itemgroups_column_distance]% + ##1\relax\strc_itemgroups_table_wrapup + \stoptabulate + \normalexpanded{\stopitemgroup\m_strc_itemgroups_after}}% + \strc_itemgroups_table_pickup} + +\appendtoks + \frozen\instance\protected\edefcsname\e!stop \currentitemgroup\v!table\endcsname + {}% {\strc_itemgroups_stop_table} + \frozen\instance\protected\edefcsname\e!start\currentitemgroup\v!table\endcsname + {\strc_itemgroups_start_table[\currentitemgroup]}% +\to \everydefineitemgroup + %D Done again. \setupitemgroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl index 327810a5198..e4cd0fad77a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl @@ -52,15 +52,17 @@ \c!levels=3] \protected\def\strc_define_commands_label#1#2#3% current level parent - {\doifelsenothing{#3} - {\normalexpanded{\defineconstruction[#1][\s!handler=\v!label,\c!level=#2]}% - \edefcsname\??label#1:\s!parent\endcsname{\??label}}% - {\normalexpanded{\defineconstruction[#1][#3][\s!handler=\v!label,\c!level=#2]}% - \edefcsname\??label#1:\s!parent\endcsname{\??label#3}}% + {\ifempty{#3}% + \normalexpanded{\defineconstruction[#1][\s!handler=\v!label,\c!level=#2]}% + \edefcsname\??label#1:\s!parent\endcsname{\??label}% + \else + \normalexpanded{\defineconstruction[#1][#3][\s!handler=\v!label,\c!level=#2]}% + \edefcsname\??label#1:\s!parent\endcsname{\??label#3}% + \fi \ifconditional\c_strc_constructions_define_commands \frozen\instance\protected\edefcsname\e!next #1\endcsname{\strc_labels_next {#1}{\number#2}}% obsolete \frozen\instance\protected\edefcsname\v!reset#1\endcsname{\strc_labels_reset{#1}{\number#2}}% obsolete % should be \e!reset anyway - %frozen\instance\setuevalue{\c!set #1}{\strc_labels_set {#1}{\number#2}}% obsolete + %frozen\instance\protected\edefcsname\c!set #1\endcsname{\strc_labels_set {#1}{\number#2}}% obsolete \ifcsname\v!current#1\endcsname % we play safe \else @@ -106,9 +108,6 @@ \letlabelparameter\s!counter\p_counter \to \everydefinelabel -\lettonothing\p_strc_constructions_title -\lettonothing\p_strc_constructions_number - \newconditional\c_strc_constructions_number_keep \defcsname\??constructioninitializer\v!label\endcsname @@ -120,9 +119,8 @@ \enforced\let\useconstructionstyleandcolor \uselabelstyleandcolor \enforced\let\setupcurrentconstruction \setupcurrentlabel % shared with enumerations - \edef\p_strc_constructions_number{\constructionparameter\c!number}% - \ifx\p_strc_constructions_number\v!yes - \settrue\c_strc_constructions_number_state + \ifcstok{\constructionparameter\c!number}\v!yes + \c_strc_constructions_number_state\conditionaltrue \iftrialtypesetting \strc_counters_save\currentconstructionnumber \fi @@ -130,13 +128,12 @@ \strc_counters_increment_sub\currentconstructionnumber\currentconstructionlevel \fi \else - \setfalse\c_strc_constructions_number_state + \c_strc_constructions_number_state\conditionalfalse \fi - \edef\p_strc_constructions_title{\constructionparameter\c!title}% - \ifx\p_strc_constructions_title\v!yes - \settrue\c_strc_constructions_title_state + \ifcstok{\constructionparameter\c!title}\v!yes + \c_strc_constructions_title_state\conditionaltrue \else - \setfalse\c_strc_constructions_title_state + \c_strc_constructions_title_state\conditionalfalse \fi} \defcsname\??constructionfinalizer\v!label\endcsname @@ -148,8 +145,8 @@ %D Interfaces: -\protected\def\strc_labels_command{\setfalse\c_strc_constructions_number_keep\nameddescription} -\protected\def\strc_labels_current{\settrue \c_strc_constructions_number_keep\nameddescription} +\protected\def\strc_labels_command{\c_strc_constructions_number_keep\conditionalfalse\nameddescription} +\protected\def\strc_labels_current{\c_strc_constructions_number_keep\conditionaltrue\nameddescription} \protected\def\strc_labels_next {\strc_constructions_next_indeed \namedlabelparameter} % #1#2 \protected\def\strc_labels_reset {\strc_constructions_reset_indeed\namedlabelparameter} % #1#2 diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lev.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-lev.mklx index 08688ee04df..b4295909ffb 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-lev.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lev.mklx @@ -42,7 +42,7 @@ \permanent\protected\def\stopsubjectlevel {\clf_stopsectionlevel} % we could use public at the lua end -\permanent\tolerant\protected\def\nostarthead[#category]#spacer[#settings]#spacer[#userdata]% +\permanent\tolerant\protected\def\nostarthead[#category]#spacer[#S#settings]#spacer[#S#userdata]% {\blank \noindentation{\tttf[start missing section level #category]} \blank} diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx index 331be873728..e2bad2f1e76 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx @@ -26,7 +26,7 @@ \newinteger\c_strc_linenotes \newtoks \everydefinelinenote -\permanent\tolerant\protected\def\definelinenote[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\definelinenote[#1]#*[#S#2]#*[#S#3]% {\ifarguments % error \orelse\ifcsname\??linenote#1\endcsname @@ -45,12 +45,12 @@ \definenote[#1][#2][#3]% \fi \pushmacro\currentnote - \edef\currentnote{#1} + \cdef\currentnote{#1} \letcsname\??linenote\currentnote\expandafter\endcsname\csname\currentnote\endcsname % use copy command - \frozen\instance\setuevalue {\currentnote}{\strc_linenotes_direct{\currentnote}}% - \frozen\instance\setuevalue{\e!start\currentnote}{\strc_linenotes_start {\currentnote}}% - \frozen\instance\setuevalue{\e!stop \currentnote}{\strc_linenotes_stop }% - \the\everydefinelinenote + \frozen\instance\protected\edefcsname \currentnote\endcsname{\strc_linenotes_direct{\currentnote}}% + \frozen\instance\protected\edefcsname\e!start\currentnote\endcsname{\strc_linenotes_start {\currentnote}}% + \frozen\instance\protected\edefcsname\e!stop \currentnote\endcsname{\strc_linenotes_stop }% + \expand\everydefinelinenote \popmacro\currentnote \fi} @@ -93,10 +93,14 @@ \def\page_lines_in_to {\in[lr:e:\currentlinenotereference]} \protected\def\strc_linenotes_range_normal#1% order - {\doifelsereferencefound{lr:b:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_from + {\doifelsereferencefound{lr:b:\currentlinenotereference}% + {\c_page_lines_current_from\conditionaltrue}% + {\c_page_lines_current_from\conditionalfalse}% \ifconditional\c_page_lines_current_from \xdef\m_page_lines_current_from{\currentreferencelinenumber}% - \doifelsereferencefound{lr:e:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_to + \doifelsereferencefound{lr:e:\currentlinenotereference}% + {\c_page_lines_current_to\conditionaltrue}% + {\c_page_lines_current_to\conditionalfalse}% \ifconditional\c_page_lines_current_to \xdef\m_page_lines_current_to{\currentreferencelinenumber}% \page_lines_in_from @@ -112,10 +116,14 @@ \fi} \protected\def\strc_linenotes_range_sparse#1% order - {\doifelsereferencefound{lr:b:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_from + {\doifelsereferencefound{lr:b:\currentlinenotereference}% + {\c_page_lines_current_from\conditionaltrue}% + {\c_page_lines_current_from\conditionalfalse}% \ifconditional\c_page_lines_current_from \xdef\m_page_lines_current_from{\currentreferencelinenumber}% - \doifelsereferencefound{lr:e:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_to + \doifelsereferencefound{lr:e:\currentlinenotereference}% + {\c_page_lines_current_to\conditionaltrue}% + {\c_page_lines_current_to\conditionalfalse}% \ifconditional\c_page_lines_current_to \xdef\m_page_lines_current_to{\currentreferencelinenumber}% \ifx\m_page_lines_previous_from\m_page_lines_current_from @@ -143,7 +151,7 @@ \protected\def\strc_linenotes_indeed#1#2#3% {\begingroup % we keep things local so we can use it as regular note too - \edef\currentnotation{#1}% + \cdef\currentnotation{#1}% \edef\currentlinenotereference{#2}% \xdef\m_page_lines_previous_from{\begincsname\??linenotespreviousfrom\currentnotation\endcsname}% \xdef\m_page_lines_previous_to {\begincsname\??linenotespreviousto \currentnotation\endcsname}% @@ -188,9 +196,8 @@ {\hskip\noteparameter\c!compressdistance\relax} \def\strc_linenotes_check_compression - {\edef\p_linenotes_compress {\noteparameter\c!compress}% - \edef\p_linenotes_compressmethod{\noteparameter\c!compressmethod}% - \ifx\p_linenotes_compress\v!yes + {\edef\p_linenotes_compressmethod{\noteparameter\c!compressmethod}% + \ifcstok{\noteparameter\c!compress}\v!yes \let\linenotelinenumber\strc_linenotes_range_sparse \else \let\linenotelinenumber\strc_linenotes_range_normal diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt index 312a815cd88..35af18746e3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt @@ -85,20 +85,20 @@ local autosectiondepth = sections.autodepth local variables = interfaces.variables -local v_all = variables.all -local v_reference = variables.reference -local v_title = variables.title -local v_command = variables.command -local v_text = variables.text -local v_current = variables.current -local v_previous = variables.previous -local v_intro = variables.intro -local v_here = variables.here -local v_component = variables.component -local v_product = variables.product -local v_file = variables.file -local v_local = variables["local"] -local v_default = variables.default +local v_all = variables.all +local v_reference = variables.reference +local v_title = variables.title +local v_command = variables.command +local v_text = variables.text +local v_current = variables.current +local v_previous = variables.previous +local v_intro = variables.intro +local v_here = variables.here +local v_component = variables.component +local v_product = variables.product +local v_file = variables.file +local v_local = variables["local"] +local v_default = variables.default local cheats = { [variables.fit] = true, @@ -151,7 +151,9 @@ local function initializer() -- we're okay elseif lastblock then if blockdone[block] then - report_lists("out of order sectionsblocks, maybe use \\setsectionblock") + if trace_lists then + report_lists("out of order sectionsblocks, maybe use \\setsectionblock") + end else blockdone[block] = true sectionblocks[#sectionblocks+1] = block @@ -912,7 +914,8 @@ setmetatableindex(result,{ external = reference }) -- brr for i=1,#collected do local v = collected[i] local m = v.metadata - if m and names[m.name] or all then +-- if m and names[m.name] or all then + if m and not m.nolist and (names[m.name] or all) then nofresult = nofresult + 1 result[nofresult] = v end diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx index 3fd0e979eb4..6d61d808de9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx @@ -136,16 +136,20 @@ \permanent\protected\def\structurelistinject[#tag]% {\begingroup - \edef\currentlist{#tag}% - \doifelse{\listparameter\c!state}\v!start\strc_lists_inject_yes\strc_lists_inject_nop} + \cdef\currentlist{#tag}% + \ifcstok{\listparameter\c!state}\v!start + \expandafter\strc_lists_inject_yes + \else + \expandafter\strc_lists_inject_nop + \fi} -\tolerant\protected\def\strc_lists_inject_nop[#settings]#spacer[#userdata]% +\tolerant\protected\def\strc_lists_inject_nop[#S#settings]#spacer[#S#userdata]% {\endgroup} \def\strc_lists_inject_enhance#listindex% {\expandafter\clf_deferredenhancelist\number#listindex\relax} -\tolerant\protected\def\strc_lists_inject_yes[#settings]#spacer[#userdata]% can be used directly +\tolerant\protected\def\strc_lists_inject_yes[#S#settings]#spacer[#S#userdata]% can be used directly {\setupcurrentlist[\c!type=userdata,\c!location=\v!none,#settings]% grouped (use \let... \edef\p_location{\listparameter\c!location}% \setnextinternalreference @@ -185,50 +189,56 @@ \protected\def\strc_lists_inject_direct[#tag]% [#settings][#userdata] {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \strc_lists_inject_yes} % [#settings][#userdata] \permanent\protected\def\writebetweenlist[#tag]% {\begingroup - \edef\currentlist{#tag}% - \doifelse{\namedlistparameter{#tag}\c!state}\v!start - \strc_lists_write_between_yes - \strc_lists_write_between_nop} + \cdef\currentlist{#tag}% + \ifcstok{\namedlistparameter{#tag}\c!state}\v!start + \expandafter\strc_lists_write_between_yes + \else + \expandafter\strc_lists_write_between_nop + \fi} -\tolerant\def\strc_lists_write_between_yes[#settings]#:#command% +\tolerant\def\strc_lists_write_between_yes[#S#settings]#:#command% {\strc_lists_inject_yes[#settings,\c!type=\s!command][command={#command}]} -\tolerant\def\strc_lists_write_between_nop[#settings]#:#command% +\tolerant\def\strc_lists_write_between_nop[#S#settings]#:#command% {\endgroup} \permanent\protected\def\writedatatolist[#tag]% {\begingroup - \edef\currentlist{#tag}% - \doifelse{\namedlistparameter{#tag}\c!state}\v!start - \strc_lists_write_data_to_yes - \strc_lists_write_data_to_nop} + \cdef\currentlist{#tag}% + \ifcstok{\namedlistparameter{#tag}\c!state}\v!start + \expandafter\strc_lists_write_data_to_yes + \else + \expandafter\strc_lists_write_data_to_nop + \fi} -\tolerant\def\strc_lists_write_data_to_yes[#settings]#spacer[#userdata]% +\tolerant\def\strc_lists_write_data_to_yes[#S#settings]#spacer[#userdata]% {\ifparameter#userdata\or % no need to have an extra step ... used seldom \strc_lists_inject_yes[#settings,\c!type=\s!userdata][#userdata]% \else \strc_lists_inject_yes[\c!type=\s!userdata][#settings]% \fi} -\tolerant\def\strc_lists_write_data_to_nop[#settings]#spacer[#userdata]% +\tolerant\def\strc_lists_write_data_to_nop[#S#settings]#spacer[#userdata]% {\endgroup} \permanent\protected\def\writetolist[#tag]% {\begingroup - \edef\currentlist{#tag}% - \doifelse{\namedlistparameter{#tag}\c!state}\v!start - \strc_lists_write_to_yes - \strc_lists_write_to_nop} + \cdef\currentlist{#tag}% + \ifcstok{\namedlistparameter{#tag}\c!state}\v!start + \expandafter\strc_lists_write_to_yes + \else + \expandafter\strc_lists_write_to_nop + \fi} -\tolerant\def\strc_lists_write_to_yes[#settings]#:#first#second% no \s!first because we don't expand user settings +\tolerant\def\strc_lists_write_to_yes[#S#settings]#:#first#second% no \s!first because we don't expand user settings {\strc_lists_inject_yes[\c!location=\v!here,#settings,\c!type=\s!simple][first={#first},second={#second}]} -\tolerant\def\strc_lists_write_to_nop[#settings]#:#first#second% +\tolerant\def\strc_lists_write_to_nop[#S#settings]#:#first#second% {\endgroup} % \strc_lists_inject_nop[][] % \starttyping @@ -255,7 +265,7 @@ \newtoks\everystructurelist -\permanent\tolerant\protected\def\placelist[#taglist]#spacer[#settings]% +\permanent\tolerant\protected\def\placelist[#taglist]#spacer[#S#settings]% {\begingroup \startpacked[\v!blank]% \edef\m_list {#taglist}% @@ -270,18 +280,20 @@ \stoppacked \endgroup} -\permanent\tolerant\protected\def\placerawlist[#tag]#spacer[#settings]% just one list +\permanent\tolerant\protected\def\placerawlist[#tag]#spacer[#S#settings]% just one list {\strc_lists_place_indeed\empty{#tag}{#settings}} \aliased\let\strc_lists_place\placelist % used in strc-flt \def\strc_lists_place_indeed#tag#list#settings% {\begingroup - \the\t_lists_every_renderingcleanup % \lettonothing\currentlistentrylocation - \edef\currentlist{#tag}% + \expand\t_lists_every_renderingcleanup % \lettonothing\currentlistentrylocation + \cdef\currentlist{#tag}% \setupcurrentlist[#settings]% - \the\everystructurelist - % \doif{\listparameter\c!coupling}\v!on{\startlistreferences{#tag}}% + \expand\everystructurelist + % \ifcstok{\listparameter\c!coupling}\v!on + % \startlistreferences{#tag}% + % \fi \strc_lists_place_current % maybe inline {#list}% {\listparameter\c!criterium}% @@ -309,17 +321,17 @@ \ifdefined\stopnamedsection \else \let\stopnamedsection \relax \fi \ifdefined\headtext \else \let\headtext \relax \fi -\permanent\tolerant\protected\def\completelist[#tag]#spacer[#settings]% +\permanent\tolerant\protected\def\completelist[#tag]#spacer[#S#settings]% {\normalexpanded{\startnamedsection[\v!title][\c!title=\headtext{#tag},\c!reference=#tag]}% {} around ref ? \strc_lists_place[#tag][#settings]% \stopnamedsection} -\permanent\tolerant\protected\def\strc_lists_complete[#singular]#spacer[#plural]#spacer[#settings]% used in strc-flt +\permanent\tolerant\protected\def\strc_lists_complete[#singular]#spacer[#plural]#spacer[#S#settings]% used in strc-flt {\normalexpanded{\startnamedsection[\v!title][\c!title=\headtext{#plural},\c!reference=#singular]}% {} around ref ? \strc_lists_place[#singular][#settings]% \stopnamedsection} -\permanent\tolerant\def\strc_lists_combined_complete[#tag]#spacer[#settings]% +\permanent\tolerant\def\strc_lists_combined_complete[#tag]#spacer[#S#settings]% {\normalexpanded{\startnamedsection[\v!title][\c!title={\headtext{#tag}},\c!reference=#tag]}% \placecombinedlist[#tag][#settings]% \stopnamedsection} @@ -330,7 +342,7 @@ %D \definecombinedlist[whatever][a,b,c][settings] %D \stoptyping -\permanent\tolerant\protected\def\definecombinedlist[#tag]#spacer[#list]#spacer[#settings]% +\permanent\tolerant\protected\def\definecombinedlist[#tag]#spacer[#list]#spacer[#S#settings]% {\definelist[#tag][\c!criterium=\v!local,\c!reference=,\c!alternative=,\c!list={#list},#settings]% inherits from root \frozen\instance\defcsname\e!setup#tag\e!endsetup\endcsname{\setupcombinedlist[#tag]}% \frozen\instance\defcsname\e!place#tag\endcsname{\placecombinedlist[#tag]}% @@ -341,9 +353,9 @@ \setuplist[#tag][#settings]% we don't want to mess up the parent \fi} -\permanent\tolerant\protected\def\placecombinedlist[#tag]#spacer[#settings]% i.e. no list set in settings +\permanent\tolerant\protected\def\placecombinedlist[#tag]#spacer[#S#settings]% i.e. no list set in settings {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \setupcurrentlist[#settings]% \edef\m_strc_list_alternative{\listparameter\c!alternative}% we only inherit alternative \strc_lists_place_indeed{#tag}{\listparameter\c!list}{#settings}% @@ -364,9 +376,9 @@ \installcorenamespace {listpagenumber} -\defcsname\??listpagenumber\v!always \endcsname{\settrue\c_lists_show_page\settrue\c_lists_has_page} -\defcsname\??listpagenumber\v!yes \endcsname{\settrue\c_lists_show_page} -\defcsname\??listpagenumber\s!realpage\endcsname{\settrue\c_lists_show_page\settrue\c_lists_show_realpage} +\defcsname\??listpagenumber\v!always \endcsname{\c_lists_show_page\conditionaltrue\c_lists_has_page\conditionaltrue} +\defcsname\??listpagenumber\v!yes \endcsname{\c_lists_show_page\conditionaltrue} +\defcsname\??listpagenumber\s!realpage\endcsname{\c_lists_show_page\conditionaltrue\c_lists_show_realpage\conditionaltrue} \def\strc_lists_process_pagenumber#1% {\begincsname\??listpagenumber#1\endcsname} @@ -533,7 +545,7 @@ \permanent\protected\def\strclistsentryprocess#tag#method#index#extra% This one is called at the lua end! {\clf_pushlist#index\relax %\lettonothing\currentlistentrylocation - \edef\currentlist {#tag}% + \cdef\currentlist {#tag}% \edef\currentlistmethod{#method}% \edef\currentlistindex {#index}% \edef\currentlistextra {#extra}% @@ -578,7 +590,7 @@ \permanent\protected\def\listsymbol[#tag]#number% {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \def\currentlistentrynumber{#number}% no edef else tag problems \currentlistsymbol \endgroup} @@ -590,7 +602,7 @@ \def\strc_lists_assign_dimen#dimension#key#default% {\edef\m_strc_list_dimen{\listparameter#key}% - \doifelseinset\m_strc_list_dimen{\v!fit,\v!broad}{#dimension#default}{#dimension\m_strc_list_dimen}\relax} + #dimension\ifinset{\m_strc_list_dimen}{\v!fit,\v!broad}#default\else\m_strc_list_dimen\fi\relax} \definesymbol[\v!list][\v!none ][\strc_lists_symbol_none] \definesymbol[\v!list][\v!one ][\strc_lists_symbol_one] @@ -890,32 +902,36 @@ % in mind that testing for empty fails do to tagging being applied % \edef\p_pagenumber{\listparameter\c!pagenumber}% % \ifx\p_pagenumber\v!always -% \settrue\c_lists_has_page -% \settrue\c_lists_show_page +% \c_lists_has_page\conditionaltrue +% \c_lists_show_page\conditionaltrue % \else -% \doifelsestructurelisthaspage\settrue\setfalse\c_lists_has_page +% \doifelsestructurelisthaspage{\c_lists_has_page\conditionaltrue}{\c_lists_has_page\conditionalfalse}% % \ifx\p_pagenumber\v!yes -% \settrue\c_lists_show_page +% \c_lists_show_page\conditionaltrue % \else -% \setfalse\c_lists_show_page +% \c_lists_show_page\conditionalfalse % \fi % \fi - \setfalse\c_lists_show_page % necessary? + \c_lists_show_page\conditionalfalse % necessary? \processcommacommand[\listparameter\c!pagenumber]\strc_lists_process_pagenumber \ifconditional\c_lists_has_page \else - \doifelsestructurelisthaspage\settrue\setfalse\c_lists_has_page + \doifelsestructurelisthaspage + {\c_lists_has_page\conditionaltrue}% + {\c_lists_has_page\conditionalfalse}% \fi % always forces number placement (in bib we use a forced number) \edef\p_headnumber{\listparameter\c!headnumber}% \ifx\p_headnumber\v!always - \settrue\c_lists_has_number - \settrue\c_lists_show_number + \c_lists_has_number\conditionaltrue + \c_lists_show_number\conditionaltrue \else - \doifelsestructurelisthasnumber\settrue\setfalse\c_lists_has_number + \doifelsestructurelisthasnumber + {\c_lists_has_number\conditionaltrue}% + {\c_lists_has_number\conditionalfalse}% \ifx\p_headnumber\v!yes - \settrue\c_lists_show_number + \c_lists_show_number\conditionaltrue \else - \setfalse\c_lists_show_number + \c_lists_show_number\conditionalfalse \fi \fi \strc_lists_interaction_check @@ -932,17 +948,17 @@ \lettonothing\currentlistentrynumber \lettonothing\currentlistentrytitle \lettonothing\currentlistentrypagenumber - \setfalse\c_lists_has_page - \setfalse\c_lists_has_number - \setfalse\c_lists_show_page - \setfalse\c_lists_show_realpage - \setfalse\c_lists_show_number + \c_lists_has_page\conditionalfalse + \c_lists_has_number\conditionalfalse + \c_lists_show_page\conditionalfalse + \c_lists_show_realpage\conditionalfalse + \c_lists_show_number\conditionalfalse \to \t_lists_every_renderingcleanup \lettonothing\m_strc_list_alternative % combined \protected\def\strc_lists_apply_renderingsetup - {\the\t_lists_every_renderingsetup + {\expand\t_lists_every_renderingsetup % now we group \begingroup \ifempty\m_strc_list_alternative @@ -953,7 +969,7 @@ \directsetup{\listalternativeparameter\c!renderingsetup}\relax \endgroup % till here, where we reset locals - \the\t_lists_every_renderingcleanup} + \expand\t_lists_every_renderingcleanup} % todo: provide packager via attributes @@ -966,7 +982,7 @@ \stopsetups \permanent\protected\def\currentlistentrytitlesynchronize - {\the\t_lists_every_renderingsynchronize} + {\expand\t_lists_every_renderingsynchronize} \permanent\protected\def\currentlistentrytitlerendered {\currentlistentrytitlesynchronize\currentlistentrytitle} @@ -1012,8 +1028,8 @@ \fi \hbox \strc_lists_get_reference_attribute\v!text { \strc_lists_set_style_color\c!textstyle\c!textcolor\v!text - \the\t_lists_every_renderingtext - \the\t_lists_every_renderingsynchronize + \expand\t_lists_every_renderingtext + \expand\t_lists_every_renderingsynchronize \listparameter\c!textcommand\currentlistentrytitle } \ifconditional\c_lists_show_page @@ -1140,8 +1156,8 @@ \begingroup \strc_lists_set_reference_attribute\v!text \strc_lists_set_style_color\c!textstyle\c!textcolor\v!text - \the\t_lists_every_renderingtext - \the\t_lists_every_renderingsynchronize + \expand\t_lists_every_renderingtext + \expand\t_lists_every_renderingsynchronize \setstrut % needs checking, new here \begstrut \strc_lists_limitated_text\currentlistentrytitle @@ -1222,8 +1238,8 @@ \begingroup \strc_lists_set_reference_attribute\v!text \strc_lists_set_style_color\c!textstyle\c!textcolor\v!text - \the\t_lists_every_renderingtext - \the\t_lists_every_renderingsynchronize + \expand\t_lists_every_renderingtext + \expand\t_lists_every_renderingsynchronize \setstrut % needs checking, new here \begstrut \strc_lists_limitated_text\currentlistentrytitle @@ -1262,8 +1278,8 @@ \inheritedlistframed { \letinteractionparameter\c!strut\v!no % still needed? \strc_lists_set_style_color\c!style\c!color\v!all - \the\t_lists_every_renderingtext - \the\t_lists_every_renderingsynchronize + \expand\t_lists_every_renderingtext + \expand\t_lists_every_renderingsynchronize \setstrut \begstrut \strc_lists_limitated_text\currentlistentrytitle @@ -1282,8 +1298,8 @@ \dosetraggedhbox{\listparameter\c!align}% \raggedbox { \strc_lists_set_style_color\c!style\c!color\v!all - \the\t_lists_every_renderingtext - \the\t_lists_every_renderingsynchronize + \expand\t_lists_every_renderingtext + \expand\t_lists_every_renderingsynchronize \setstrut \begstrut \strc_lists_limitated_text\currentlistentrytitle @@ -1301,8 +1317,8 @@ \hbox \strc_lists_get_reference_attribute\v!all \strc_lists_get_destination_attribute { \midaligned { \strc_lists_set_style_color\c!style\c!color\v!all - \the\t_lists_every_renderingtext - \the\t_lists_every_renderingsynchronize + \expand\t_lists_every_renderingtext + \expand\t_lists_every_renderingsynchronize \setstrut \begstrut \strc_lists_limitated_text\currentlistentrytitle @@ -1448,8 +1464,8 @@ \letcsname\??listinteractions\v!yes \endcsname\v!all \permanent\def\listboxproperties {\strc_lists_get_reference_attribute} -\permanent\def\listrenderingsetup {\the\t_lists_every_renderingtext} -\permanent\def\listrenderingsynchronize{\the\t_lists_every_renderingsynchronize} +\permanent\def\listrenderingsetup {\expand\t_lists_every_renderingtext} +\permanent\def\listrenderingsynchronize{\expand\t_lists_every_renderingsynchronize} \protected\def\strc_lists_interaction_check {\iflocation @@ -1498,8 +1514,7 @@ \ifcsname\??listinteractions\p_interaction_forward\endcsname %\expandafter\let\expandafter\p_interaction_forward\csname\??listinteractions\p_interaction_forward\endcsname \expandafter\let\expandafter\p_interaction_forward\lastnamedcs - %\ifcstok{\structurelistexternal}\emptytoks % luacall - \iftok{\structurelistexternal}\emptytoks % luacall + \ifempty{\structurelistexternal}% luacall \strc_references_get_simple_reference{internal(\currentlistentrylocation)}% \else % \writestatus{FAR OUT LIST}{\structurelistexternal::page(\number\structurelistrealpagenumber)}% @@ -1619,9 +1634,9 @@ \mutable\let\listlength\!!zerocount % also in strc-reg -\permanent\tolerant\protected\def\determinelistcharacteristics[#list]#spacer[#settings]% +\permanent\tolerant\protected\def\determinelistcharacteristics[#list]#spacer[#S#settings]% {\begingroup - \edef\currentlist{\firststructureelementinlist{#list}}% + \cdef\currentlist{\firststructureelementinlist{#list}}% \ifempty\currentlist \endgroup \let\listlength\!!zerocount diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt deleted file mode 100644 index eb94f9fc391..00000000000 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt +++ /dev/null @@ -1,759 +0,0 @@ -if not modules then modules = { } end modules ['strc-mar'] = { - version = 1.001, - comment = "companion to strc-mar.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- todo: cleanup stack (structures.marks.reset(v_all) also does the job) --- todo: only commands.* print to tex, native marks return values - -local insert, concat = table.insert, table.concat -local tostring, next, rawget, type = tostring, next, rawget, type -local lpegmatch = lpeg.match - -local context = context -local commands = commands - -local implement = interfaces.implement - -local allocate = utilities.storage.allocate -local setmetatableindex = table.setmetatableindex - -local nuts = nodes.nuts -local tonut = nuts.tonut - -local getid = nuts.getid -local getlist = nuts.getlist -local getattr = nuts.getattr -local getbox = nuts.getbox - -local nextnode = nuts.traversers.node - -local nodecodes = nodes.nodecodes -local whatsitcodes = nodes.whatsitcodes - -local glyph_code = nodecodes.glyph -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local whatsit_code = nodecodes.whatsit - -local lateluawhatsit_code = whatsitcodes.latelua - -local texsetattribute = tex.setattribute - -local a_marks = attributes.private("marks") - -local trace_set = false trackers.register("marks.set", function(v) trace_set = v end) -local trace_get = false trackers.register("marks.get", function(v) trace_get = v end) -local trace_details = false trackers.register("marks.details", function(v) trace_details = v end) - -local report_marks = logs.reporter("structure","marks") - -local variables = interfaces.variables - -local v_first = variables.first -local v_last = variables.last -local v_previous = variables.previous -local v_next = variables.next -local v_top = variables.top -local v_bottom = variables.bottom -local v_current = variables.current -local v_default = variables.default -local v_page = variables.page -local v_all = variables.all -local v_keep = variables.keep - -local v_nocheck_suffix = ":" .. variables.nocheck - -local v_first_nocheck = variables.first .. v_nocheck_suffix -local v_last_nocheck = variables.last .. v_nocheck_suffix -local v_previous_nocheck = variables.previous .. v_nocheck_suffix -local v_next_nocheck = variables.next .. v_nocheck_suffix -local v_top_nocheck = variables.top .. v_nocheck_suffix -local v_bottom_nocheck = variables.bottom .. v_nocheck_suffix - -local structures = structures -local marks = structures.marks - -local settings_to_array = utilities.parsers.settings_to_array - -local boxes_too = false -- at some point we can also tag boxes or use a zero char - -directives.register("marks.boxestoo", function(v) boxes_too = v end) - -local data = marks.data or allocate() -marks.data = data - -storage.register("structures/marks/data", marks.data, "structures.marks.data") - -local stack, topofstack = { }, 0 - -local ranges = { - [v_page] = { - first = 0, - last = 0, - }, -} - -local function resolve(t,k) - if k then - if trace_set or trace_get then - report_marks("undefined mark, name %a",k) - end - local crap = { autodefined = true } -- maybe set = 0 and reset = 0 - t[k] = crap - return crap - else - -- weird: k is nil - end -end - -setmetatableindex(data, resolve) - -function marks.exists(name) - return rawget(data,name) ~= nil -end - --- identify range - -local function sweep(head,first,last) - for n, id, subtype in nextnode, head do - -- we need to handle empty heads so we test for latelua - if id == glyph_code or (id == whatsit_code and subtype == lateluawhatsit_code) then -- brrr - local a = getattr(n,a_marks) - if not a then - -- next - elseif first == 0 then - first, last = a, a - elseif a > last then - last = a - end - elseif id == hlist_code or id == vlist_code then - if boxes_too then - local a = getattr(n,a_marks) - if not a then - -- next - elseif first == 0 then - first, last = a, a - elseif a > last then - last = a - end - end - local list = getlist(n) - if list then - first, last = sweep(list,first,last) - end - end - end - return first, last -end - -local classes = { } - -setmetatableindex(classes, function(t,k) local s = settings_to_array(k) t[k] = s return s end) - -local lasts = { } - -function marks.synchronize(class,n,option) - local box = getbox(n) - if box then - local first, last = sweep(getlist(box),0,0) - if option == v_keep and first == 0 and last == 0 then - if trace_get or trace_set then - report_marks("action %a, class %a, box %a","retain at synchronize",class,n) - end - -- todo: check if still valid first/last in range - first = lasts[class] or 0 - last = first - else - lasts[class] = last - local classlist = classes[class] - for i=1,#classlist do - local class = classlist[i] - local range = ranges[class] - if range then - range.first = first - range.last = last - else - range = { - first = first, - last = last, - } - ranges[class] = range - end - if trace_get or trace_set then - report_marks("action %a, class %a, first %a, last %a","synchronize",class,range.first,range.last) - end - end - end - elseif trace_get or trace_set then - report_marks("action %s, class %a, box %a","synchronize without content",class,n) - end -end - --- define etc - -local function resolve(t,k) - if k == "fullchain" then - local fullchain = { } - local chain = t.chain - while chain and chain ~= "" do - insert(fullchain,1,chain) - chain = data[chain].chain - end - t[k] = fullchain - return fullchain - elseif k == "chain" then - t[k] = "" - return "" - elseif k == "reset" or k == "set" then - t[k] = 0 - return 0 - elseif k == "parent" then - t[k] = false - return false - end -end - -function marks.define(name,settings) - if not settings then - settings = { } - elseif type(settings) == "string" then - settings = { parent = settings } - end - data[name] = settings - local parent = settings.parent - if parent == nil or parent == "" or parent == name then - settings.parent = false - else - local dp = data[parent] - if not dp then - settings.parent = false - elseif dp.parent then - settings.parent = dp.parent - end - end - setmetatableindex(settings, resolve) -end - -for k, v in next, data do - setmetatableindex(v,resolve) -- runtime loaded table -end - -local function parentname(name) - local dn = data[name] - return dn and dn.parent or name -end - -function marks.relate(name,chain) - local dn = data[name] - if dn and not dn.parent then - if chain and chain ~= "" then - dn.chain = chain - local dc = data[chain] - if dc then - local children = dc.children - if not children then - children = { } - dc.children = children - end - children[#children+1] = name - end - elseif trace_set then - report_marks("error: invalid relation, name %a, chain %a",name,chain) - end - end -end - -local function resetchildren(new,name) - local dn = data[name] - if dn and not dn.parent then - local children = dn.children - if children then - for i=1,#children do - local ci = children[i] - new[ci] = false - if trace_set then - report_marks("action %a, parent %a, child %a","reset",name,ci) - end - resetchildren(new,ci) - end - end - end -end - -function marks.set(name,value) - local dn = data[name] - if dn then - local child = name - local parent = dn.parent - if parent then - name = parent - dn = data[name] - end - dn.set = topofstack - if not dn.reset then - dn.reset = 0 -- in case of selfdefined - end - local top = stack[topofstack] - local new = { } - if top then - for k, v in next, top do - local d = data[k] - local r = d.reset or 0 - local s = d.set or 0 - if r <= topofstack and s < r then - new[k] = false - else - new[k] = v - end - end - end - resetchildren(new,name) - new[name] = value - topofstack = topofstack + 1 - stack[topofstack] = new - if trace_set then - if name == child then - report_marks("action %a, name %a, index %a, value %a","set",name,topofstack,value) - else - report_marks("action %a, parent %a, child %a, index %a, value %a","set",parent,child,topofstack,value) - end - end - texsetattribute("global",a_marks,topofstack) - end -end - -local function reset(name) - if v_all then - if trace_set then - report_marks("action %a","reset all") - end - stack = { } - for name, dn in next, data do - local parent = dn.parent - if parent then - dn.reset = 0 - dn.set = 0 - end - end - else - local dn = data[name] - if dn then - local parent = dn.parent - if parent then - name = parent - dn = data[name] - end - if trace_set then - report_marks("action %a, name %a, index %a","reset",name,topofstack) - end - dn.reset = topofstack - local children = dn.children - if children then - for i=1,#children do - local ci = children[i] - reset(ci) - end - end - end - end -end - -marks.reset = reset - -function marks.get(n,name,value) - local dn = data[name] - if dn then - name = dn.parent or name - local top = stack[n] - if top then - context(top[name]) - end - end -end - -function marks.show(first,last) - if first and last then - for k=first,last do - local v = stack[k] - if v then - report_marks("% 4i: %s",k,table.sequenced(v)) - end - end - else - for k, v in table.sortedpairs(stack) do - report_marks("% 4i: %s",k,table.sequenced(v)) - end - end -end - -local function resolve(name,first,last,strict,quitonfalse,notrace) - local dn = data[name] - if dn then - local child = name - local parent = dn.parent - name = parent or child - dn = data[name] - local step, method - if first > last then - step, method = -1, "bottom-up" - else - step, method = 1, "top-down" - end - if trace_get and not notrace then - report_marks("action %a, strategy %a, name %a, parent %a, strict %a","request",method,child,parent,strict or false) - end - if trace_details and not notrace then - marks.show(first,last) - end - local r = dn.reset - local s = dn.set - if first <= last and first <= r then - if trace_get and not notrace then - report_marks("action %a, name %a, first %a, last %a, reset %a, index %a","reset first",name,first,last,r,first) - end - elseif first >= last and last <= r then - if trace_get and not notrace then - report_marks("action %a, name %a, first %a, last %a, reset %a, index %a","reset last",name,first,last,r,last) - end - elseif not stack[first] or not stack[last] then - if trace_get and not notrace then - -- a previous or next method can give an out of range, which is valid - report_marks("error: out of range, name %a, reset %a, index %a",name,r,first) - end - elseif strict then - local top = stack[first] - local fullchain = dn.fullchain - if not fullchain or #fullchain == 0 then - if trace_get and not notrace then - report_marks("warning: no full chain, trying again, name %a, first %a, last %a",name,first,last) - end - return resolve(name,first,last) - else - if trace_get and not notrace then - report_marks("found chain [ % => T ]",fullchain) - end - local chaindata = { } - local chainlength = #fullchain - for i=1,chainlength do - local cname = fullchain[i] - if data[cname].set > 0 then - local value = resolve(cname,first,last,false,false,true) - if value == "" then - if trace_get and not notrace then - report_marks("quitting chain, name %a, reset %a, start %a",name,r,first) - end - return "" - else - chaindata[i] = value - end - end - end - if trace_get and not notrace then - report_marks("using chain [ % => T ]",chaindata) - end - local value, index, found = resolve(name,first,last,false,false,true) - if value ~= "" then - if trace_get and not notrace then - report_marks("following chain [ % => T ]",chaindata) - end - for i=1,chainlength do - local cname = fullchain[i] - if data[cname].set > 0 and chaindata[i] ~= found[cname] then - if trace_get and not notrace then - report_marks("quiting chain, name %a, reset %a, index %a",name,r,first) - end - return "" - end - end - if trace_get and not notrace then - report_marks("found in chain, name %a, reset %a, start %a, index %a, value %a",name,r,first,index,value) - end - return value, index, found - elseif trace_get and not notrace then - report_marks("not found, name %a, reset %a",name,r) - end - end - else - for i=first,last,step do - local current = stack[i] - local value = current and current[name] - if value == nil then - -- search on - elseif value == false then - if quitonfalse then - return "" - end - elseif value == true then - if trace_get and not notrace then - report_marks("quitting steps, name %a, reset %a, start %a, index %a",name,r,first,i) - end - return "" - elseif value ~= "" then - if trace_get and not notrace then - report_marks("found in steps, name %a, reset %a, start %a, index %a, value %a",name,r,first,i,value) - end - return value, i, current - end - end - if trace_get and not notrace then - report_marks("not found in steps, name %a, reset %a",name,r) - end - end - end - return "" -end - --- todo: column:first column:last - -local methods = { } - -local function doresolve(name,rangename,swap,df,dl,strict) - local range = ranges[rangename] or ranges[v_page] - local first = range.first - local last = range.last - if trace_get then - report_marks("action %a, name %a, range %a, swap %a, first %a, last %a, df %a, dl %a, strict %a", - "resolving",name,rangename,swap or false,first,last,df,dl,strict or false) - end - if swap then - first, last = last + df, first + dl - else - first, last = first + df, last + dl - end - local value, index, found = resolve(name,first,last,strict) - -- maybe something more - return value, index, found -end - --- previous : last before sync --- next : first after sync - --- top : first in sync --- bottom : last in sync - --- first : first not top in sync --- last : last not bottom in sync - -methods[v_previous] = function(name,range) return doresolve(name,range,false,-1,0,true ) end -- strict -methods[v_top] = function(name,range) return doresolve(name,range,false, 0,0,true ) end -- strict -methods[v_bottom] = function(name,range) return doresolve(name,range,true , 0,0,true ) end -- strict -methods[v_next] = function(name,range) return doresolve(name,range,true , 0,1,true ) end -- strict - -methods[v_previous_nocheck] = function(name,range) return doresolve(name,range,false,-1,0,false) end -methods[v_top_nocheck] = function(name,range) return doresolve(name,range,false, 0,0,false) end -methods[v_bottom_nocheck] = function(name,range) return doresolve(name,range,true , 0,0,false) end -methods[v_next_nocheck] = function(name,range) return doresolve(name,range,true , 0,1,false) end - -local function do_first(name,range,check) - if trace_get then - report_marks("action %a, name %a, range %a","resolving first",name,range) - end - local f_value, f_index, f_found = doresolve(name,range,false,0,0,check) - if f_found then - if trace_get then - report_marks("action %a, name %a, range %a","resolving last",name,range) - end - local l_value, l_index, l_found = doresolve(name,range,true ,0,0,check) - if l_found and l_index > f_index then - local name = parentname(name) - for i=f_index,l_index,1 do - local si = stack[i] - local sn = si[name] - if sn and sn ~= false and sn ~= true and sn ~= "" and sn ~= f_value then - if trace_get then - report_marks("action %a, name %a, range %a, index %a, value %a","resolving",name,range,i,sn) - end - return sn, i, si - end - end - end - end - if trace_get then - report_marks("resolved, name %a, range %a, using first",name,range) - end - return f_value, f_index, f_found -end - -local function do_last(name,range,check) - if trace_get then - report_marks("action %a, name %a, range %a","resolving last",name,range) - end - local l_value, l_index, l_found = doresolve(name,range,true ,0,0,check) - if l_found then - if trace_get then - report_marks("action %a, name %a, range %a","resolving first",name,range) - end - local f_value, f_index, f_found = doresolve(name,range,false,0,0,check) - if f_found and l_index > f_index then - local name = parentname(name) - for i=l_index,f_index,-1 do - local si = stack[i] - local sn = si[name] - if sn and sn ~= false and sn ~= true and sn ~= "" and sn ~= l_value then - if trace_get then - report_marks("action %a, name %a, range %a, index %a, value %a","resolving",name,range,i,sn) - end - return sn, i, si - end - end - end - end - if trace_get then - report_marks("resolved, name %a, range %a, using first",name,range) - end - return l_value, l_index, l_found -end - -methods[v_first ] = function(name,range) return do_first(name,range,true ) end -methods[v_last ] = function(name,range) return do_last (name,range,true ) end -methods[v_first_nocheck] = function(name,range) return do_first(name,range,false) end -methods[v_last_nocheck ] = function(name,range) return do_last (name,range,false) end - -methods[v_current] = function(name,range) -- range is ignored here - local top = stack[topofstack] - return top and top[parentname(name)] or "" -end - -local function fetched(name,range,method) - local value = (methods[method] or methods[v_first])(name,range) or "" - if not trace_get then - -- no report - elseif value == "" then - report_marks("nothing fetched, name %a, range %a, method %a",name,range,method) - else - report_marks("marking fetched, name %a, range %a, method %a, value %a",name,range,method,value) - end - return value or "" -end - --- can be used at the lua end: - -marks.fetched = fetched - --- this will move to a separate runtime modules - -marks.tracers = marks.tracers or { } - -function marks.tracers.showtable() - context.starttabulate { "|l|l|l|lp|lp|" } - context.tabulaterowbold("name","parent","chain","children","fullchain") - context.ML() - for k, v in table.sortedpairs(data) do - local parent = v.parent or "" - local chain = v.chain or "" - local children = v.children or { } - local fullchain = v.fullchain or { } - table.sort(children) -- in-place but harmless - context.tabulaterowtyp(k,parent,chain,concat(children," "),concat(fullchain," ")) - end - context.stoptabulate() -end - --- pushing to context: - --- local separator = context.nested.markingseparator --- local command = context.nested.markingcommand --- local ctxconcat = context.concat - --- local function fetchonemark(name,range,method) --- context(command(name,fetched(name,range,method))) --- end - --- local function fetchtwomarks(name,range) --- ctxconcat( { --- command(name,fetched(name,range,v_first)), --- command(name,fetched(name,range,v_last)), --- }, separator(name)) --- end - --- local function fetchallmarks(name,range) --- ctxconcat( { --- command(name,fetched(name,range,v_previous)), --- command(name,fetched(name,range,v_first)), --- command(name,fetched(name,range,v_last)), --- }, separator(name)) --- end - - local ctx_separator = context.markingseparator - local ctx_command = context.markingcommand - - local function fetchonemark(name,range,method) - ctx_command(name,fetched(name,range,method)) - end - - local function fetchtwomarks(name,range) - ctx_command(name,fetched(name,range,v_first)) - ctx_separator(name) - ctx_command(name,fetched(name,range,v_last)) - end - - local function fetchallmarks(name,range) - ctx_command(name,fetched(name,range,v_previous)) - ctx_separator(name) - ctx_command(name,fetched(name,range,v_first)) - ctx_separator(name) - ctx_command(name,fetched(name,range,v_last)) - end - -function marks.fetch(name,range,method) -- chapter page first | chapter column:1 first - if trace_get then - report_marks("marking requested, name %a, range %a, method %a",name,range,method) - end - if method == "" or method == v_default then - fetchonemark(name,range,v_first) - elseif method == v_both then - fetchtwomarks(name,range) - elseif method == v_all then - fetchallmarks(name,range) - else - fetchonemark(name,range,method) - end -end - -function marks.fetchonemark (name,range,method) fetchonemark (name,range,method) end -function marks.fetchtwomarks(name,range) fetchtwomarks(name,range ) end -function marks.fetchallmarks(name,range) fetchallmarks(name,range ) end - --- here we have a few helpers .. will become commands.* - -local pattern = lpeg.afterprefix("li::") - -function marks.title(tag,n) - local listindex = lpegmatch(pattern,n) - if listindex then - commands.savedlisttitle(tag,listindex,"marking") - else - context(n) - end -end - -function marks.number(tag,n) -- no spec - local listindex = lpegmatch(pattern,n) - if listindex then - commands.savedlistnumber(tag,listindex) - else - -- no prefix (as it is the prefix) - context(n) - end -end - --- interface - -implement { name = "markingtitle", actions = marks.title, arguments = "2 strings" } -implement { name = "markingnumber", actions = marks.number, arguments = "2 strings" } - -implement { name = "definemarking", actions = marks.define, arguments = "2 strings" } -implement { name = "relatemarking", actions = marks.relate, arguments = "2 strings" } -implement { name = "setmarking", actions = marks.set, arguments = "2 strings" } -implement { name = "resetmarking", actions = marks.reset, arguments = "string" } -implement { name = "synchronizemarking", actions = marks.synchronize, arguments = { "string", "integer", "string" } } -implement { name = "getmarking", actions = marks.fetch, arguments = "3 strings" } -implement { name = "fetchonemark", actions = marks.fetchonemark, arguments = "3 strings" } -implement { name = "fetchtwomarks", actions = marks.fetchtwomarks, arguments = "2 strings" } -implement { name = "fetchallmarks", actions = marks.fetchallmarks, arguments = "2 strings" } - -implement { name = "doifelsemarking", actions = { marks.exists, commands.doifelse }, arguments = "string" } diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt index 61972009c95..5446f72c548 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt @@ -14,11 +14,11 @@ local context = context local implement = interfaces.implement local variables = interfaces.variables -local v_first = variables.first -local v_last = variables.last -local v_previous = variables.previous -local v_next = variables.next -local v_column = variables.column +local v_first = variables.first +local v_last = variables.last +local v_previous = variables.previous +local v_next = variables.next +local v_column = variables.column local nuts = nodes.nuts local nextmark = nuts.traversers.mark @@ -28,9 +28,9 @@ local getlist = nuts.getlist local getindex = nuts.getindex local getdata = nuts.getdata ----- setmark_code = nodes.markcodes.set -local flushmark_code = nodes.markcodes.flush -local hlist_code = nodes.nodecodes.hlist -local vlist_code = nodes.nodecodes.vlist +local flushmark_code = nodes.markcodes.flush +local hlist_code = nodes.nodecodes.hlist +local vlist_code = nodes.nodecodes.vlist local marks = { } structures.marks = marks diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl index 6dbb0e20771..c20db9ede2c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl @@ -164,7 +164,7 @@ {\ifarguments\orelse\ifcstok{\namedmarkingparameter{#1}\c!state}\v!start \begingroup \setsystemmode\v!marking - \the\everymarking + \expand\everymarking \ifparameter#3\or \ifcstok{#2}\v!page \markingcommand{#1}{\csname\??markingfilter#3\endcsname{#1}}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl index 6c639bb1f0f..2e66c8ba128 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl @@ -29,7 +29,6 @@ %\c!numberstyle=, %\c!numbercolor=, %\c!numbercommand=, - %\c!margin=, %\c!align=, %\c!separator=, % \c!splitmethod=\v!both, % first|last|both| @@ -44,12 +43,16 @@ \c!spaceafter=\formulaparameter\c!spacebefore, \c!spaceinbetween=\v!quarterline, \c!width=\hsize, - \c!leftmargin=\zeropoint, - \c!rightmargin=\zeropoint, + \c!margin=\zeropoint, + \c!leftmargin=\formulaparameter\c!margin, + \c!rightmargin=\formulaparameter\c!margin, \c!indentnext=\v!no, \c!alternative=\s!default, \c!strut=\v!yes, % per 2022-04, was \v!no \c!numberstrut=\v!yes, % \v!no \v!yes \v!always + \c!margindistance=\zeropoint, + \c!leftmargindistance=\formulaparameter\c!margindistance, + \c!rightmargindistance=\formulaparameter\c!margindistance, \c!numberthreshold=\emwidth, \c!numberdistance=2\emwidth] @@ -194,13 +197,16 @@ % implementation \protected\def\strc_formulas_store_number#1#2#3#4#5#6% ref, todo:str, \sync % todo: title etc (like float) - {\settrue\c_strc_formulas_handle_number + {\c_strc_formulas_handle_number\conditionaltrue \strc_counters_register_component {formula}% \setupcurrentformula \formulaparameter \detokenizedformulaparameter \relax \relax \relax [\c!name=\v!formula,\s!counter=\v!formula,% - \s!hascaption=\v!yes,\s!hastitle=\v!yes,\s!hasnumber=\v!yes,\s!haslevel=#6,% + \s!hascaption=\v!yes,% + \s!hastitle=\v!yes,% maybe also a check + \s!hasnumber=\ifempty\namedformulaentry\v!yes\else\v!no\fi,% + \s!haslevel=#6,% \c!reference=#1,% \c!title=\namedformulaentry, \c!list=\currentplaceformulalist, @@ -217,6 +223,7 @@ \newconstant\c_strc_formulas_number_mode \newconstant\c_strc_formulas_sub_number_mode \newconstant\c_strc_formulas_nested_number_mode +\newconstant\c_strc_formulas_counter_level \let\strc_formulas_show_modes \relax \let\strc_formulas_show_references\relax @@ -294,15 +301,17 @@ \newconditional\c_strc_formulas_referenced \appendtoks - \global\setfalse\c_strc_formulas_inside_place - \global\setfalse\c_strc_formulas_inside_place_sub + \global\c_strc_formulas_inside_place\conditionalfalse + \global\c_strc_formulas_inside_place_sub\conditionalfalse \to \everyresetformulas \def\strc_formulas_place_number_noneed - {\doif{\formulaparameter\c!numberstrut}\v!always\strut} + {\ifcstok{\formulaparameter\c!numberstrut}\v!always + \strut + \fi} \def\strc_formulas_place_numbering % place formula - {\settrue\c_strc_formulas_handle_number + {\c_strc_formulas_handle_number\conditionaltrue \strc_formulas_check_reference\c_strc_formulas_place_number_mode\currentplaceformulareference \ifnum\c_strc_formulas_place_number_mode=\plustwo \glet\strc_formulas_place_number\strc_formulas_place_number_noneed @@ -341,6 +350,15 @@ {\begingroup \rm % determines the distance and main font \edef\p_location{\formulaparameter\c!location}% + \ifx\p_location\v!atrightmargin + \ifzeropt\s_strc_formulas_margin_right + \let\p_location\v!right + \fi + \orelse\ifx\p_location\v!atleftmargin + \ifzeropt\s_strc_formulas_margin_left + \let\p_location\v!left + \fi + \fi \strc_formulas_show_references \ifx\p_location\v!right \strc_formulas_add_distance\plusone\v!left\formulaparameter @@ -438,6 +456,8 @@ \mutable\lettonothing\currentsubformulasreference \mutable\lettonothing\currentsubformulassynchronize +\c_strc_formulas_counter_level\plusone + \def\strc_formulas_handle_current_references {\strc_formulas_reference_show \ifnum\c_strc_formulas_place_number_mode=\plusthree @@ -449,11 +469,11 @@ \currentplaceformulanumber \currentplaceformulasynchronize \currentplaceformulaattribute - \plusone + \c_strc_formulas_counter_level \currentplaceformulasynchronize \glet\currentplaceformulasynchronize\relax \theformuladestinationattribute\currentplaceformulaattribute - \global\settrue\c_strc_formulas_referenced + \global\c_strc_formulas_referenced\conditionaltrue \fi \fi \ifnum\c_strc_formulas_number_mode=\plusthree @@ -485,44 +505,26 @@ \theformuladestinationattribute\currentnestedformulaattribute \fi} -% \def\strc_formulas_handle_numbering_indeed -% {\ifempty\namedformulaentry -% \doifelsetext\currentnestedformulasuffix -% {\strc_counters_increment\v!formula -% \ifcstok{+}\currentnestedformulasuffix -% \strc_counters_increment_sub\v!formula\plustwo -% \else -% \strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix -% \fi}% -% {\ifempty\currentplaceformulasuffix\else -% \let\currentnestedformulasuffix \currentplaceformulasuffix -% \let\currentnestedformulareference\currentplaceformulareference -% \strc_formulas_place_number_nested_check -% \fi -% \strc_counters_increment\v!formula}% -% \fi -% \glettonothing\currentplaceformulasuffix -% \glettonothing\currentnestedformulasuffix -% \placecurrentformulanumber} - \def\strc_formulas_handle_numbering_indeed {\ifempty\namedformulaentry - \doifelsetext\currentnestedformulasuffix - {\ifconditional\c_strc_formulas_incremented\else - \strc_counters_increment\v!formula - \fi - \global\settrue\c_strc_formulas_incremented - \ifcstok{+}\currentnestedformulasuffix - \strc_counters_increment_sub\v!formula\plustwo - \else - \strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix - \fi}% - {\ifempty\currentplaceformulasuffix\else - \let\currentnestedformulasuffix \currentplaceformulasuffix - \let\currentnestedformulareference\currentplaceformulareference - \strc_formulas_place_number_nested_check - \fi - \strc_counters_increment\v!formula}% + \iftext\currentnestedformulasuffix + \ifconditional\c_strc_formulas_incremented\else + \strc_counters_increment\v!formula + \fi + \global\c_strc_formulas_incremented\conditionaltrue + \ifcstok{+}\currentnestedformulasuffix + \strc_counters_increment_sub\v!formula\plustwo + \else + \strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix + \fi + \else + \ifempty\currentplaceformulasuffix\else + \let\currentnestedformulasuffix \currentplaceformulasuffix + \let\currentnestedformulareference\currentplaceformulareference + \strc_formulas_place_number_nested_check + \fi + \strc_counters_increment\v!formula + \fi \fi \glettonothing\currentplaceformulasuffix \glettonothing\currentnestedformulasuffix @@ -539,9 +541,11 @@ \def\strc_formulas_handle_sub_numbering_indeed {\let\strc_formulas_handle_sub_numbering\relax % else error: see math/numbering-001.tex - \doifelsetext\currentnestedformulasuffix - {\strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix}% - {\strc_counters_increment_sub\v!formula\plustwo}% + \iftext\currentnestedformulasuffix + \strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix + \else + \strc_counters_increment_sub\v!formula\plustwo + \fi \glettonothing\currentplaceformulasuffix \glettonothing\currentnestedformulasuffix \placecurrentformulanumber} @@ -647,10 +651,10 @@ %D Tricky stuff: -\abovedisplayskip \zeropoint -\abovedisplayshortskip \zeropoint % evt. 0pt minus 3pt -\belowdisplayskip \zeropoint -\belowdisplayshortskip \zeropoint % evt. 0pt minus 3pt +\abovedisplayskip \zeroskip +\abovedisplayshortskip \zeroskip % evt. 0pt minus 3pt +\belowdisplayskip \zeroskip +\belowdisplayshortskip \zeroskip % evt. 0pt minus 3pt \predisplaypenalty \zerocount \postdisplaypenalty \zerocount % -5000 goes wrong, see penalty at \section @@ -663,19 +667,19 @@ % \protected\def\strc_formulas_forget_display_skips % {\mathdisplayskipmode \plusthree -% \abovedisplayskip \zeropoint -% \belowdisplayskip \zeropoint -% \abovedisplayshortskip\zeropoint -% \belowdisplayshortskip\zeropoint} +% \abovedisplayskip \zeroskip +% \belowdisplayskip \zeroskip +% \abovedisplayshortskip\zeroskip +% \belowdisplayshortskip\zeroskip} %D Became this, where setting the mode is now also irrelevant but the engine still %D has it, so: \mathdisplayskipmode \plusthree -\abovedisplayskip \zeropoint -\belowdisplayskip \zeropoint -\abovedisplayshortskip\zeropoint -\belowdisplayshortskip\zeropoint +\abovedisplayskip \zeroskip +\belowdisplayskip \zeroskip +\abovedisplayshortskip\zeroskip +\belowdisplayshortskip\zeroskip \newdimension\d_strc_formulas_display_width @@ -701,6 +705,7 @@ \newconditional\c_strc_formulas_packed \newconditional\c_strc_formulas_depth \newbox \b_strc_formulas_number +\newdimen \d_strc_formulas_number \def\strc_formulas_display_space_before_normal {% not ok, try \stopformula\par\startformula vs \stopformula\startformula @@ -720,6 +725,7 @@ \fi \nointerlineskip \fi + \whitespace % added, test with spacebefore=small \ifempty\m_spacebefore \ifx\p_spacebefore\v!none % nothing @@ -739,7 +745,8 @@ \fi} \def\strc_formulas_display_space_after_common - {\ifx\p_spaceafter\v!none + {\whitespace % needs testing + \ifx\p_spaceafter\v!none % nothing \orelse\ifempty\p_spaceafter \directvspacing\currentvspacing @@ -756,7 +763,7 @@ \ifvmode \ifinner \strc_formulas_display_space_before_normal - \setfalse\c_strc_formulas_depth + \c_strc_formulas_depth\conditionalfalse \else \forcestrutdepth \nointerlineskip @@ -807,7 +814,7 @@ \else \edef\p_spacebefore{\formulaparameter\c!spacebefore}% \fi - % \begincsname\??mathdisplayspacemodel\v!before:\number\c_strc_formulas_space_model\endcsname + % \begincsname\??mathdisplayspacemodel\v!before:\the\c_strc_formulas_space_model\endcsname \strc_formulas_display_space_before \fi \ifhmode @@ -825,7 +832,7 @@ \else \edef\p_spaceafter{\formulaparameter\c!spaceafter}% \fi - % \begincsname\??mathdisplayspacemodel\v!after:\number\c_strc_formulas_space_model\endcsname + % \begincsname\??mathdisplayspacemodel\v!after:\the\c_strc_formulas_space_model\endcsname \strc_formulas_display_space_after \fi \ifhmode @@ -857,7 +864,7 @@ \scratchdimentwo \ifconditional\c_strc_formulas_tight\formulaparameter\c!numberthreshold\else\zeropoint\fi\relax \scratchdimenthree.5\exheight \ifcase\scratchdimentwo\else\ifx#2\v!left - \middlered + \darkred \kern-\scratchdimentwo \vrule \s!height\scratchdimenthree @@ -865,14 +872,14 @@ \s!width \scratchdimentwo \fi\fi \ifcase\scratchdimenone\else - \ifcase#1\or\middlegreen\else\middleblue\fi + \ifcase#1\or\darkgreen\else\darkblue\fi \vrule \s!height\scratchdimenthree \s!depth \scratchdimenthree \s!width \scratchdimenone \fi \ifcase\scratchdimentwo\else\ifx#2\v!right - \middlered + \darkred \vrule \s!height\scratchdimenthree \s!depth \scratchdimenthree @@ -889,16 +896,16 @@ \let\strc_formulas_add_distance \strc_formulas_add_distance_normal \defcsname\??formulaoption\v!packed\endcsname - {\settrue\c_strc_formulas_packed} + {\c_strc_formulas_packed\conditionaltrue} \defcsname\??formulaoption\v!tight\endcsname - {\settrue\c_strc_formulas_tight} + {\c_strc_formulas_tight\conditionaltrue} \defcsname\??formulaoption\v!middle\endcsname {} \defcsname\??formulaoption\v!depth\endcsname - {\settrue\c_strc_formulas_depth} + {\c_strc_formulas_depth\conditionaltrue} \defcsname\??formulaoption\v!line\endcsname {\ifgridsnapping @@ -960,23 +967,18 @@ \global\c_strc_math_split_mode\c_strc_math_flow_mode \fi \mathpenaltiesmode\plusone - \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode - \global\setfalse\c_strc_math_indent - \else - \global\settrue\c_strc_math_indent % otherwise no breaks - \fi \global\d_strc_math_indent\zeropoint} \def\strc_math_set_number_location {\ifcstok{\formulaparameter\c!numberlocation}\v!overlay - \settrue\c_strc_formulas_overlay_number + \c_strc_formulas_overlay_number\conditionaltrue \else - \setfalse\c_strc_formulas_overlay_number + \c_strc_formulas_overlay_number\conditionalfalse \fi \ifcstok{\formulaparameter\c!numbermethod}\v!down - \settrue\c_math_align_overflow_mode + \c_math_align_overflow_mode\conditionaltrue \else - \setfalse\c_math_align_overflow_mode + \c_math_align_overflow_mode\conditionalfalse \fi} \setupformula @@ -1016,8 +1018,8 @@ \installtextracker {math.autohang} - {\settrue\c_strc_math_trace_hang} - {\setfalse\c_strc_math_trace_hang} + {\c_strc_math_trace_hang\conditionaltrue} + {\c_strc_math_trace_hang\conditionalfalse} \newconditional\c_strc_math_aligned_here @@ -1026,7 +1028,7 @@ \protected\def\strc_math_align_here {\ifmmode - \global\settrue\c_strc_math_aligned_here + \global\c_strc_math_aligned_here\conditionaltrue % we can have a more dedicated value, and also maybe store the class so that we can % pick it up at the engine end (second pass) \ifconditional\c_strc_math_trace_hang @@ -1035,26 +1037,6 @@ \boundary\c_bndr_mathalign \fi} -% \tolerant\protected\def\strc_math_skip_here[#1]% -% {% no strut as it will influence fences -% \ifconditional\c_strc_math_trace_hang -% \strc_math_trace_okay{darkblue}{S #1}% -% \fi -% \scratchdimen\dimexpr\formulaparameter\c!textmargin\relax -% \ifchkdim#1\or -% \d_strc_math_hang_state#1% -% \orelse\ifchknum#1\or -% \d_strc_math_hang_state#1\scratchdimen -% \orelse\iftok{#1}{+}% -% \advanceby\d_strc_math_hang_state\scratchdimen -% \orelse\iftok{#1}{-}% -% \advanceby\d_strc_math_hang_state-\scratchdimen -% \else -% \d_strc_math_hang_state\scratchdimen -% \fi -% \kern\d_strc_math_hang_state -% \strc_math_pickup_again} - \newboundary\c_bndr_skiphere \tolerant\protected\def\strc_math_skip_here[#1]% @@ -1063,8 +1045,8 @@ \strc_math_trace_okay{darkblue}{S #1}% \fi \scratchdimen\dimexpr\formulaparameter\c!textmargin\relax - \ifchkdim#1\or - \d_strc_math_hang_state#1% + \ifchkdimension#1\or + \d_strc_math_hang_state\lastchkdimension \orelse\ifchknum#1\or \d_strc_math_hang_state#1\scratchdimen \orelse\iftok{#1}{+}% @@ -1091,49 +1073,6 @@ % % \blank[line] \ruledhbox{zzzz} \blank[line] -% \tolerant\protected\def\strc_math_text_here[#1]#:#*#=% -% {\ifparameter#2\or -% \ifnum\lastboundary=\c_math_begin_boundary\else -% \ifcstok{#1}\v!right\else -% \strc_math_break_here -% \fi -% \fi -% \vadjust -% \ifcstok{#1}\v!before -% pre -% \orelse\ifcstok{#1}\v!left -% pre -% baseline -% depth before -\thousandpoint -% \orelse\ifcstok{#1}\v!right -% post -% baseline -% \fi -% \bgroup -% \hbox to \displaywidth \bgroup -% \strut -% \ifcstok{#1}\v!right -% \hfill#2% -% \else -% #2\hss -% \fi -% \strut -% \egroup -% \egroup -% \ifcstok{#1}\v!right -% \strc_math_break_here -% \else -% % \mathatom class \mathexplicitcode{}% -% \strc_math_pickup_again -% \fi -% \orelse\ifcstok{#1}\v!page -% \strc_math_page_here -% \orelse\ifcstok{#1}\v!samepage -% \strc_math_same_here -% \else -% \strc_math_break_here -% \fi} - \definelocalboxes [\v!lefttext] [\c!command=\localmarginlefttext\zeropoint, @@ -1151,19 +1090,19 @@ \installcorenamespace{mathtexthere} \installcorenamespace{mathbreakhere} -\def\strc_math_text_here_right#1% - {\localbox[\v!righttext]{\llap{#1}}} +\def\strc_math_text_here_right#1% a nasty interplay with the lua end (!!! TODO) + {\localbox[\v!righttext]{\llap{#1}}} %\kern\rightskip}}} \def\strc_math_text_here_left#1% - {\localbox[\v!lefttext]{\rlap{#1}}} + {\localbox[\v!lefttext]{\rlap{\kern\leftskip#1}}} \def\strc_math_text_here_before#1% {\vadjust pre \bgroup \hbox to \displaywidth \bgroup \strut - \hskip\leftskip + \kern\leftskip #1\hss - \hskip\rightskip + \kern\rightskip \strut \egroup \egroup} @@ -1172,9 +1111,9 @@ {\vadjust \bgroup \hbox to \displaywidth \bgroup \strut - \hskip\leftskip + \kern\leftskip #1\hss - \hskip\rightskip + \kern\rightskip \strut \egroup \egroup} @@ -1276,16 +1215,17 @@ \enforced\let\breakhere\strc_math_break_here \enforced\let\skiphere \strc_math_skip_here \enforced\let\texthere \strc_math_text_here - % \global\setfalse\c_strc_math_aligned_here + % \global\c_strc_math_aligned_here\conditionalfalse \to \everymathematics \installcorenamespace{mathtextalign} -\newconstant\c_strc_math_ragged_status -\newconstant\c_strc_math_split_status +\newconstant \c_strc_math_ragged_status +\newconstant \c_strc_math_split_status +\newconditional\c_strc_math_number_swapped \prependtoks - \c_strc_math_ragged_status\plustwo + \c_strc_math_ragged_status\plustwo % middle \c_strc_math_split_status \zerocount \to \everymathematics @@ -1298,36 +1238,50 @@ {\raggedright \mathgluemode\plustwo \c_strc_math_ragged_status\plusone + \c_strc_math_number_swapped\conditionalfalse \updateparagraphproperties} % not needed \defcsname\??mathtextalign\v!middle\endcsname {\raggedcenter \mathgluemode\plustwo \c_strc_math_ragged_status\plustwo + \c_strc_math_number_swapped\conditionalfalse \updateparagraphproperties} % not needed \defcsname\??mathtextalign\v!flushright\endcsname {\raggedleft \mathgluemode\plustwo \c_strc_math_ragged_status\plusthree + \c_strc_math_number_swapped\conditionalfalse \updateparagraphproperties} % not needed -\defcsname\??mathtextalign\v!slanted\endcsname +\defcsname\??mathtextalign\v!slanted\endcsname % maybe move bottom to number location {\raggedslanted %\mathgluemode\plustwo \c_strc_math_ragged_status\plustwo - \ifcase\c_strc_math_number_location\or - \parinitleftskip\wd\b_strc_formulas_number % should normally fit - \else - \parfillrightskip\wd\b_strc_formulas_number % should normally fit - \fi + \edef\p_distance{\formulaparameter\c!leftmargindistance}% + \parinitleftskip \ifx\p_distance\v!number \wd\b_strc_formulas_number \else \p_distance \fi + \edef\p_distance{\formulaparameter\c!rightmargindistance}% + \parfillrightskip\ifx\p_distance\v!number \wd\b_strc_formulas_number \else \p_distance \fi \updateparagraphproperties} % not needed \def\strc_math_setup_align {\ifcsname\??mathtextalign\formulaparameter\c!align\endcsname \lastnamedcs\else\begincsname\??mathtextalign\v!middle\endcsname + \math_check_limit + \fi} + +\def\math_check_limit + {\ifcstok{\mathematicsparameter\c!limit}\v!yes + \bitwiseflip\mathgluemode\plusfour \fi} +\appendtoks + \math_check_limit +\to \everymathematics + +% split : wrap (box) and flow (yes) + \defcsname\??mathtextalign\v!flushleft:\v!auto\endcsname {\raggedright \mathgluemode\plustwo @@ -1335,14 +1289,14 @@ \strc_math_analyze_box} \defcsname\??mathtextalign\v!middle:\v!auto\endcsname - {\raggedright - \mathgluemode\plustwo - \c_strc_math_ragged_status\plustwo - \strc_math_analyze_box} + {\raggedright % needed for the lua magick (stage 1) + \mathgluemode\plustwo % only shrink (otherwise inconsistent) + \c_strc_math_ragged_status\plustwo % needed for the lua magick (stage 2) + \strc_math_analyze_box} % lua magick \defcsname\??mathtextalign\v!flushright:\v!auto\endcsname {\raggedright - \mathgluemode\plustwo + \mathgluemode\plustwo % only shrink \c_strc_math_ragged_status\plusthree \strc_math_analyze_box} @@ -1391,25 +1345,30 @@ \appendtoks \global\d_strc_math_indent \zeropoint \global\c_strc_math_n_of_lines \zerocount - \global\d_strc_math_max_width \zeropoint - \global\d_strc_math_first_width \zeropoint \global\d_strc_math_first_height\zeropoint - \global\d_strc_math_last_width \zeropoint + \global\d_strc_math_first_left \zeropoint + \global\d_strc_math_first_right \zeropoint + \global\d_strc_math_last_left \zeropoint + \global\d_strc_math_last_right \zeropoint \global\d_strc_math_last_depth \zeropoint + \global\d_strc_math_max_right \zeropoint + \global\d_strc_math_max_left \zeropoint + \global\d_math_strc_hangindent \zeropoint + \global\c_math_strc_hangafter \zeropoint \to \everyresetformulas \newbox\b_strc_math_display % most code is in math-ali (for historical reasons) -\newgluespec\s_strc_formulas_margin_left -\newgluespec\s_strc_formulas_margin_right +\newgluespec\s_strc_formulas_margin_left % maybe just dimen +\newgluespec\s_strc_formulas_margin_right % idem \def\strc_formulas_set_paragraph {%\setlocalhsize %\hsize\localhsize % \d_strc_formulas_display_width\formulaparameter\c!width\relax - \s_strc_formulas_margin_left \leftskip - \s_strc_formulas_margin_right\rightskip +% \s_strc_formulas_margin_left \leftskip +% \s_strc_formulas_margin_right\rightskip \edef\p_margin{\formulaparameter\c!leftmargin}% \ifempty\p_margin \else \doadaptleftskip\p_margin @@ -1418,85 +1377,39 @@ \ifempty\p_margin \else \doadaptrightskip\p_margin \fi - \edef\p_margin{\formulaparameter\c!margin}% - \ifempty\p_margin \else - \doadaptleftskip\p_margin - \doadaptrightskip\p_margin - \fi - % this was lost +% \edef\p_margin{\formulaparameter\c!margin}% +% \ifempty\p_margin \else +% \doadaptleftskip\p_margin +% \doadaptrightskip\p_margin +% \fi + \s_strc_formulas_margin_left \leftskip + \s_strc_formulas_margin_right\rightskip \edef\p_interlinespace{\formulaparameter\c!interlinespace}% \ifempty\p_interlinespace\else\baselineskip\p_interlinespace\fi - % and is now back - \global\setfalse\c_strc_math_aligned_here + \global\c_strc_math_aligned_here\conditionalfalse \hsize\d_strc_formulas_display_width \displaywidth\hsize \displayindent\zeropoint} -% \def\strc_math_analyze_box -% {\clf_handlemathhang -% stage \plusone -% alignstate \c_strc_math_ragged_status -% box \b_strc_math_display -% distance \formulaparameter\c!textdistance -% \relax -% %\holdingmigrations\zerocount -% \setbox\b_strc_math_display\vbox\bgroup % \vtop -% \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode -% % we can't end up here -% \orelse\ifconditional\c_strc_math_aligned_here -% \ifzeropt\d_strc_math_indent\else -% \hangafter\plusone -% \hangindent\d_strc_math_indent -% \fi -% % \strc_math_setup_align % _inner -% \else -% \strc_math_setup_align -% \fi -% % \strc_math_setup_spacing\formulaparameter -% \strc_math_setup_penalties -% \unhbox\b_strc_math_display -% \egroup -% \clf_handlemathhang -% stage \ifconditional\c_strc_math_aligned_here \plustwo \else \plusthree \fi -% % alignstate \c_strc_math_ragged_status -% % box \b_strc_math_display -% % distance \formulaparameter\c!textdistance -% \relax -% % -% \begingroup -% \edef\v_spac_whitespace_current{\formulaparameter\c!spaceinbetween}% -% \spac_whitespace_setup -% \clf_handlemathhang -% stage \plusfour -% inbetween 1\parskip -% height \strutht -% depth \strutdp -% \relax -% \endgroup} - \def\strc_math_analyze_box {\clf_handlemathhang stage \plusone alignstate \c_strc_math_ragged_status box \b_strc_math_display distance \formulaparameter\c!textdistance + leftmargin \the\dimexpr\s_strc_formulas_margin_left\relax + rightmargin \the\dimexpr\s_strc_formulas_margin_right\relax \relax %\holdingmigrations\zerocount \setbox\b_strc_math_display\vbox\bgroup % \vtop - \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode - % we can't end up here - \orelse\ifconditional\c_strc_math_aligned_here + % beware: everypar is doing sidefloats here so we then have hang values set + % but we have no local leftskip and rightskip as they are reflected in hsize + \strc_formulas_trigger_side_box + \ifconditional\c_strc_math_aligned_here \ifzeropt\d_strc_math_indent\else -% \ifnum\c_page_sides_hangafter=\zerocount -% \hangafter\plusone -% \hangindent\d_strc_math_indent -% \else - % this might become the default anyway: - \advanceby\leftskip\d_strc_math_indent - \hskip-\d_strc_math_indent -% \fi + \advanceby\leftskip\d_strc_math_indent % which is why we see a leftskip reported ! + \hskip-\d_strc_math_indent \fi - % \strc_math_setup_align % _inner \else \strc_math_setup_align \fi @@ -1523,54 +1436,39 @@ \relax \endgroup} -\def\strc_math_show_margins_there - {\vadjust pre \bgroup - \c_attr_visual\attributeunsetvalue - \hbox to \hsize \bgroup - \setbox\scratchbox\hbox to \hsize\bgroup - \bgroup\darkred \vrule \s!width\leftskip \egroup\hss - \bgroup\darkgray\leaders\vrule\hfill \egroup\hss - \bgroup\white \vrule \s!width\emwidth \egroup\hss - \bgroup\darkgray\leaders\vrule\hfill \egroup\hss - \bgroup\darkblue\vrule \s!width\rightskip\egroup - \egroup - \ht\scratchbox1.2\exheight - \dp\scratchbox0.4\exheight - \strut - \box\scratchbox - \hskip-\hsize - \hbox to \hsize \bgroup - \white - \infofont - \hskip1\leftskip - \quad - \formulaparameter\c!split - \quad - \formulaparameter\c!align - \egroup - \egroup - \egroup} - \let\strc_math_inject_show_margins_here\relax -\def\strc_math_show_margins_indeed - {\gdef\strc_math_inject_show_margins_here - {\strc_math_show_margins_there - \glet\strc_math_inject_show_margins_here\relax}% - \appendtoks\strc_math_inject_show_margins_here\to\everypar} +\integerdef\c_strc_math_positioning\zerocount + +%D For practical reasons this one is kept extern: + +\newconditional\c_strc_math_ignore_number % for testing space compatibility + +\fetchmodulecommand \showmathmargins \f!math_run \installtextracker {math.showmargins} - {\let\strc_math_show_margins\strc_math_show_margins_indeed} - {\let\strc_math_show_margins\relax} + {\def\strc_math_show_margins{\showmathmargins[\v!all]}% + \let\strc_math_flush_number_box\strc_math_flush_number_box_visual} + {\let\strc_math_show_margins\relax + \let\strc_math_flush_number_box\strc_math_flush_number_box_normal} + +\installtextracker + {math.showmargins.less} + {\def\strc_math_show_margins{\showmathmargins}% + \let\strc_math_flush_number_box\strc_math_flush_number_box_visual} + {\let\strc_math_show_margins\relax + \let\strc_math_flush_number_box\strc_math_flush_number_box_normal} \let\strc_math_show_margins\relax +%D Till here. + \def\strc_math_set_options#1% - {\setfalse\c_strc_formulas_tight - \setfalse\c_strc_formulas_packed - \setfalse\c_strc_formulas_depth - \iftok{#1}\emptytoks + {\c_strc_formulas_tight\conditionalfalse + \c_strc_formulas_packed\conditionalfalse + \c_strc_formulas_depth\conditionalfalse + \ifempty{#1}% \edef\p_option{\formulaparameter\c!option}% \orelse\ifhastok={#1}% this is new, so that we can also set the grid \setupcurrentformula[#1]% @@ -1583,15 +1481,53 @@ \rawprocesscommacommand[\p_option]\strc_formulas_option \fi} -\tolerant\protected\def\strc_formulas_start_formula#1#:#*[#2]% setting leftskip adaption is slow ! - {\ifhmode +% This is an experiment! + +% \lettonothing\strc_formulas_start_side_box +% \lettonothing\strc_formulas_stop_side_box +% \lettonothing\strc_formulas_check_side_box +% \lettonothing\strc_formulas_trigger_side_box + +\newdimen\d_strc_math_side_width + +\def\strc_formulas_check_side_box + {\doifelsesidefloat + {\d_strc_math_side_width\d_page_sides_width}% + {\d_strc_math_side_width\zeropoint}} + +\def\strc_formulas_start_side_box + {\ifzeropt\d_strc_math_side_width\else + \advance\displaywidth-\d_strc_math_side_width + \ifnum\c_page_sides_checks_done<\plustwo + % see \strc_formulas_display_space_before_normal + \vkern-\strutht % quite a hack + \fi + \dontleavehmode\dbox + \fi + \bgroup} + +\def\strc_formulas_stop_side_box + {\egroup} + +\def\strc_formulas_trigger_side_box + {\ifzeropt\d_strc_math_side_width\else + \advance\hsize-\d_strc_math_side_width + \forgeteverypar + \dontleavehmode + \fi} + +% End of experiment. + +\tolerant\protected\def\strc_formulas_start_formula#1#:#*[#S#2]% setting leftskip adaption is slow ! + {\strc_formulas_check_side_box + \ifhmode \par \fi \bgroup % HERE \iftrialtypesetting\else \global\advanceby\c_strc_formulas_n\plusone \fi - \edef\currentformula{#1}% + \cdef\currentformula{#1}% \usesetupsparameter\formulaparameter % new \dostarttaggedchained\t!formula\currentformula\??formula \strc_math_set_options{#2}% @@ -1599,7 +1535,7 @@ \strc_math_set_number_location \strc_formulas_set_paragraph \let\strc_formulas_start_formula\strc_formulas_start_formula_nested - \the\everybeforedisplayformula + \expand\everybeforedisplayformula \strc_math_setup_align \ifcstok{\formulaparameter\c!strut}\v!yes \let\strc_formulas_begstrut\begstrut @@ -1640,8 +1576,8 @@ \egroup \hangafter\minusone % added for side floats \hangindent\zeropoint % added for side floats - \setfalse\c_strc_formulas_handle_number - \the\everyresetformulas + \c_strc_formulas_handle_number\conditionalfalse + \expand\everyresetformulas \dorechecknextindentation} % here ? % experiment: @@ -1732,14 +1668,14 @@ \tolerant\permanent\protected\def\startsubformulas[#1]% {\edef\currentsubformulasreference{#1}% - \global\settrue\c_strc_formulas_inside_formulas_sub + \global\c_strc_formulas_inside_formulas_sub\conditionaltrue \strc_formulas_handle_sub_number} \permanent\protected\def\stopsubformulas {\nonoindentation \useindentnextparameter\subformulaparameter - \the\everyresetformulas % to be checked - \global\setfalse\c_strc_formulas_inside_formulas_sub + \expand\everyresetformulas % to be checked + \global\c_strc_formulas_inside_formulas_sub\conditionalfalse \dorechecknextindentation} % here ? %D Named subformulas (to be redone) @@ -1766,10 +1702,10 @@ \permanent\letcsname\e!stop\v!formulas\endcsname\relax -\tolerant\protected\def\strc_formulas_nested_formula_start[#1]% +\tolerant\protected\def\strc_formulas_nested_formula_start[#S#1]% {\begingroup \ifparameter#1\or - \setupformula[\c!width=\d_strc_formulas_display_width,#1]% + \setupformula[\c!width=\d_strc_formulas_ _width,#1]% \d_strc_formulas_display_width\formulaparameter\c!width\relax \fi \vcenter \bgroup @@ -1789,14 +1725,14 @@ \normalexpanded{\tolerant\def\noexpand\strc_formulas_start_formulas[#1]#:#2\csname\e!stop\v!formulas\endcsname}% {\startformula \dostarttagged\t!formulaset\empty - \global\settrue\c_strc_formulas_inside_formulas + \global\c_strc_formulas_inside_formulas\conditionaltrue \edef\currentformulasreference{#1}% \strc_formulas_handle_number \lettonothing\currentformula % \strc_formulas_forget_display_skips \enforced\protected\def\startformula {\advanceby\scratchcounter\plusone - \expandafter\gobbleuntil\csname\e!stop\v!formula\endcsname}% + \expandafter\ignoreupto\csname\e!stop\v!formula\endcsname}% \scratchcounter\zerocount #2% preroll \hbox to \d_strc_formulas_display_width \bgroup @@ -1808,10 +1744,10 @@ \enforced\let\stopformula \strc_formulas_nested_formula_stop #2% \egroup - \global\setfalse\c_strc_formulas_inside_formulas + \global\c_strc_formulas_inside_formulas\conditionalfalse \dostoptagged \stopformula - \the\everyresetformulas + \expand\everyresetformulas \hangafter\minusone % added for side floats \hangindent\zeropoint} % added for side floats @@ -1837,31 +1773,36 @@ {\def\currentformulareference{#1}% \strc_formulas_place_number_in_box} -\permanent\protected\def\placeformula {\global\settrue\c_strc_formulas_inside_place \strc_formulas_place} -\permanent\protected\def\placesubformula{\global\settrue\c_strc_formulas_inside_place_sub\strc_formulas_place} +\permanent\protected\def\placeformula {\global\c_strc_formulas_inside_place\conditionaltrue \strc_formulas_place} +\permanent\protected\def\placesubformula{\global\c_strc_formulas_inside_place_sub\conditionaltrue\strc_formulas_place} \tolerant\protected\def\strc_formulas_place[#1]% {\xdef\currentplaceformulareference{#1}% \glettonothing\currentplaceformulasuffix \glettonothing\currentnestedformulasuffix - \global\setfalse\c_strc_formulas_incremented - \global\setfalse\c_strc_formulas_referenced - \global\settrue\c_strc_formulas_inside_place + \global\c_strc_formulas_incremented\conditionalfalse + \global\c_strc_formulas_referenced\conditionalfalse + \global\c_strc_formulas_inside_place\conditionaltrue \doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop} % [ref]{} \protected\def\strc_formulas_place_yes#1% {\xdef\currentplaceformulasuffix{#1}% \strc_formulas_place_nop} -\protected\def\strc_formulas_place_nop - {\doifelsenextchar$\strc_formulas_place_pickup\strc_formulas_place_indeed} % [ref]$$ [ref]\start +%D We no longer pickup $$ as this is now equivalent to inline: -\protected\def\strc_formulas_place_indeed - {\strc_formulas_place_numbering} +% \protected\def\strc_formulas_place_nop +% {\doifelsenextchar$\strc_formulas_place_pickup\strc_formulas_place_indeed} % [ref]$$ [ref]\start +% +% \protected\def\strc_formulas_place_indeed +% {\strc_formulas_place_numbering} +% +% \protected\def\strc_formulas_place_pickup$$#1$$% +% {\strc_formulas_place_numbering +% \strc_formulas_start_formula{}#1\strc_formulas_stop_formula} -\protected\def\strc_formulas_place_pickup$$#1$$% - {\strc_formulas_place_numbering - \strc_formulas_start_formula{}#1\strc_formulas_stop_formula} +\protected\def\strc_formulas_place_nop + {\strc_formulas_place_numbering} % \let\startplaceformula\placeformula % \let\stopplaceformula \relax @@ -1876,36 +1817,34 @@ \mutable\lettonothing\currentplaceformulatitle \mutable\lettonothing\currentplaceformulareference \mutable\lettonothing\currentplaceformulasuffix +\mutable\lettonothing\currentplaceformulabookmark +\mutable\lettonothing\currentplaceformulalist -\permanent\tolerant\protected\def\startplaceformula[#1]% +\permanent\tolerant\protected\def\startplaceformula[#S#1]% {\begingroup - \global\setfalse\c_strc_formulas_incremented - \global\setfalse\c_strc_formulas_referenced - \global\settrue\c_strc_formulas_inside_place + \global\c_strc_formulas_incremented\conditionalfalse + \global\c_strc_formulas_referenced\conditionalfalse + \global\c_strc_formulas_inside_place\conditionaltrue \ifparameter#1\or \expandafter\strc_formulas_start_place_yes \else \expandafter\strc_formulas_start_place_nop \fi[#1]} -\def\strc_formulas_start_place_yes[#1]% todo - {\doifassignmentelse{#1}\strc_formulas_start_place_parameters\strc_formulas_start_place_reference[#1]} - -\def\strc_formulas_start_place_nop[#1]% +\def\strc_formulas_start_place_nop[#S#1]% {\glettonothing\currentplaceformulareference \glettonothing\currentplaceformulasuffix \strc_formulas_place_nop} -\def\strc_formulas_start_place_reference[#1]% - {\xdef\currentplaceformulareference{#1}% - \glettonothing\currentplaceformulasuffix - %\doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop} % [ref]{} - \strc_formulas_place_nop} - -\mutable\lettonothing\currentplaceformulabookmark -\mutable\lettonothing\currentplaceformulalist +\def\strc_formulas_start_place_yes[#S#1]% todo + {\doifassignmentelse{#1} + {\strc_formulas_set_place_parameters{#1}% + \doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop}% [ref]{} + {\xdef\currentplaceformulareference{#1}% + \glettonothing\currentplaceformulasuffix + \strc_formulas_place_nop}} -\def\strc_formulas_start_place_parameters[#1]% maybe a dedicated setup handler +\def\strc_formulas_set_place_parameters#1% maybe a dedicated setup handler {\resetdummyparameter\c!title \resetdummyparameter\c!reference \resetdummyparameter\c!bookmark @@ -1919,13 +1858,88 @@ \edef\currentplaceformulasuffix {\dummyparameter\c!suffix}% \ifempty\currentplaceformulatitle\else \normalexpanded{\setformulalistentry{\currentplaceformulatitle}}% - \fi - \doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop} % [ref]{} + \fi} \permanent\protected\def\stopplaceformula {\relax \endgroup} +%D This is new in \LMTX\ (and described in the manual): +%D +%D \starttyping +%D \startformula +%D \startsubnumberinghere +%D x \alignhere = a + 1 \numberhere[ref:c1] +%D \breakhere = b + 2 \numberhere +%D \breakhere = c + 3n \numberhere[ref:c2] +%D \stopsubnumberinghere +%D \stopformula +%D +%D \startformula +%D x \alignhere = a + 1n \numberhere[ref:a] +%D \breakhere = b + 2 \numberhere +%D \breakhere = c + 3 \numberhere +%D \stopformula +%D +%D \startformula +%D \startsubnumberinghere +%D x \alignhere = a + 1 \numberhere +%D \breakhere = b + 2 \numberhere +%D \breakhere = c + 3 \numberhere +%D \stopsubnumberinghere +%D \breakhere = d + 4n \numberhere[ref:d] +%D \stopformula +%D \stoptyping + +\newconditional \c_strc_formulas_in_sub + +\permanent\protected\def\startsubnumberinghere + {\begingroup + \c_strc_formulas_in_sub\conditionaltrue + \strc_counters_increment\v!formula} + +\permanent\protected\def\stopsubnumberinghere + {\c_strc_formulas_in_sub\conditionalfalse + \endgroup} + +\permanent\tolerant\protected\def\numberhere[#1]% + {\begingroup + \attribute\mathblobattribute\attributeunsetvalue + \dostarttagged\t!formulacaption\empty + \global\c_strc_formulas_incremented\conditionalfalse + \global\c_strc_formulas_referenced\conditionaltrue + \global\c_strc_formulas_inside_place\conditionalfalse + \global\c_strc_formulas_place_number_mode\zerocount + % + \glettonothing\currentplaceformulareference + \glettonothing\currentplaceformulasuffix + % + \ifparameter#1\orelse\ifhastok={#1}% + \strc_formulas_set_place_parameters{#1}% + \else + \xdef\currentplaceformulareference{#1}% + \fi + \iftrialtypesetting + \orelse\ifempty\currentplaceformulareference + \else + \global\c_strc_formulas_referenced\conditionalfalse % maybe always anyway (title etc) + \ifconditional\c_strc_formulas_in_sub + \c_strc_formulas_counter_level\plustwo % we use normal numbering here + \fi + \strc_formulas_check_reference + \c_strc_formulas_place_number_mode + \currentplaceformulareference + \fi + \texthere + [\ifcstok{\formulaparameter\c!location}\v!left\v!left\else\v!right\fi]% + {\ifconditional\c_strc_formulas_in_sub + \strc_formulas_handle_sub_numbering + \else + \strc_formulas_handle_numbering + \fi}% + \dostoptagged + \endgroup} + % to be checked \let\strc_formulas_place_number \relax @@ -1984,16 +1998,19 @@ % \stopplaceformula % \stoptext +% Relaxing in the macro is really needed because otherwise we get spurious +% numbers probably due to some % interference with other local variables + \def\strc_formulas_place_number_in_box - {\dostarttagged\t!formulacaption\empty - % this is really needed, otherwise we get spurious numbers probably due to some - % interference with other local variables .. also keep an eye on eqtest in the - % MS tests - \glet\strc_formulas_place_number \relax - %\glet\strc_formulas_place_number_nested\gobbletwoarguments - % + {\begingroup + \attribute\mathblobattribute\attributeunsetvalue + \dostarttagged\t!formulacaption\empty + \glet\strc_formulas_place_number\relax + %\glet\strc_formulas_place_number_nested\gobbletwoarguments \global\setbox\b_strc_formulas_number\naturalhbox{\strc_formulas_number_indeed}% - \dostoptagged} + \global\d_strc_formulas_number\wd\b_strc_formulas_number + \dostoptagged + \endgroup} \let\strc_formulas_flush_number\relax diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt index 2c68cc5993f..5ddbf348289 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt @@ -38,12 +38,13 @@ storage.register("structures/notes/numbers", notes.numbers, "structures.notes.nu local notestates = notes.states local notedata = table.setmetatableindex("table") -local variables = interfaces.variables local context = context local commands = commands local implement = interfaces.implement +local v_page = interfaces.variables.page + -- state: store, insert, postpone local function store(tag,n) @@ -396,7 +397,7 @@ local function flushnotes(tag,whatkind,how) -- store and postpone -- todo: as registers: start, stop, inbetween for i=ns,#nd do -- tricky : trialtypesetting - if how == variables.page then + if how == v_page then local rp = get(tag,i) rp = rp and rp.references rp = rp and rp.symbolpage or 0 @@ -529,4 +530,4 @@ local function action(index,slot) end end -callbacks.register("build_page_insert",action,"check spacing around inserts") +callbacks.register("insert_distance",action,"check spacing around inserts") diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx index 29440f58208..52525bba78e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx @@ -134,12 +134,14 @@ % \installcorenamespace{noteclass} \protected\def\strc_define_commands_notation#tag#level#parent% - {\doifelsenothing{#parent} - {\normalexpanded{\defineconstruction[#tag][\s!handler=\v!notation,\c!level=#level]}% - \edefcsname\??notation#tag:\s!parent\endcsname{\??notation}}% - {\normalexpanded{\defineconstruction[#tag][#parent][\s!handler=\v!notation,\c!level=#level]}% - \edefcsname\??note #tag:\s!parent\endcsname{\??note#parent}% see later for \s!note - \edefcsname\??notation#tag:\s!parent\endcsname{\??notation#parent}}% + {\ifempty{#parent}% + \normalexpanded{\defineconstruction[#tag][\s!handler=\v!notation,\c!level=#level]}% + \edefcsname\??notation#tag:\s!parent\endcsname{\??notation}% + \else + \normalexpanded{\defineconstruction[#tag][#parent][\s!handler=\v!notation,\c!level=#level]}% + \edefcsname\??note #tag:\s!parent\endcsname{\??note#parent}% see later for \s!note + \edefcsname\??notation#tag:\s!parent\endcsname{\??notation#parent}% + \fi \instance\protected\edefcsname\e!next #tag\endcsname{\strc_notations_next{#tag}{\number#level}}% obsolete \instance\protected\edefcsname\c!reset#tag\endcsname{\strc_notations_reset{#tag}{\number#level}}% obsolete \instance\protected\edefcsname #tag\endcsname{\strc_notations_command[#tag]}% @@ -197,19 +199,19 @@ \enforced\let\setupcurrentconstruction \setupcurrentnotation \edef\p_strc_constructions_number{\constructionparameter\c!number}% \ifx\p_strc_constructions_number\v!yes - \settrue\c_strc_constructions_number_state + \c_strc_constructions_number_state\conditionaltrue \iftrialtypesetting \strc_counters_save\currentconstructionnumber \fi %\strc_counters_increment_sub\currentconstructionnumber\currentconstructionlevel \else - \setfalse\c_strc_constructions_number_state + \c_strc_constructions_number_state\conditionalfalse \fi \edef\p_strc_constructions_title{\constructionparameter\c!title}% \ifx\p_strc_constructions_title\v!yes - \settrue\c_strc_constructions_title_state + \c_strc_constructions_title_state\conditionaltrue \else - \setfalse\c_strc_constructions_title_state + \c_strc_constructions_title_state\conditionalfalse \fi} \protected\defcsname\??constructionfinalizer\v!notation\endcsname @@ -247,16 +249,16 @@ \def\strc_notations_finalize_next {\endgroup\ignorespaces} -\tolerant\protected\def\strc_notations_command[#1]#*[#2]% +\tolerant\protected\def\strc_notations_command[#1]#*[#S#2]% {\begingroup - \edef\currentnote{#1}% + \cdef\currentnote{#1}% \strc_constructions_initialize{#1}% \strc_notes_synchronize \edef\p_next{\noteparameter\c!anchor}% \ifx\p_next\v!next % for now only two states - \settrue \c_strc_notations_anchored_next + \c_strc_notations_anchored_next\conditionaltrue \else - \setfalse\c_strc_notations_anchored_next + \c_strc_notations_anchored_next\conditionalfalse \fi \ifnotesenabled \strc_counters_increment_sub\currentconstructionnumber\currentconstructionlevel @@ -267,7 +269,7 @@ \expandafter\strc_notations_command_reference \fi[#2]} -\def\strc_notations_command_setups[#1]% +\def\strc_notations_command_setups[#S#1]% {\strc_constructions_register[][\c!label={\descriptionparameter\c!text},\c!reference=,\c!title=,\c!bookmark=,\c!list=,\c!referencetext=,#1]% \strc_notations_wrapup} @@ -293,9 +295,9 @@ {\strc_notations_start_indeed\stopnamednotation} \fi -\tolerant\protected\def\strc_notations_start_indeed#1#*[#2]#*[#3]% +\tolerant\protected\def\strc_notations_start_indeed#1#*[#2]#*[#S#3]% {\begingroup - \edef\currentnote{#2}% + \cdef\currentnote{#2}% \strc_constructions_initialize{#2}% \strc_notes_synchronize \ifnotesenabled @@ -309,15 +311,15 @@ \let\strc_notations_pickup_yes\relax -\protected\def\strc_notations_start_setups#1[#2]% +\protected\def\strc_notations_start_setups#1[#S#2]% {\normalexpanded{\def\noexpand\strc_notations_pickup_yes##/#1{\strc_notations_start_setups_indeed[#2]{##1}}}% \strc_notations_pickup_yes} -\protected\def\strc_notations_start_setups_indeed[#1]#*#2% +\protected\def\strc_notations_start_setups_indeed[#S#1]#*#2% {\strc_constructions_register[][\c!label={\descriptionparameter\c!text},\c!reference=,\c!title={#2},\c!bookmark=,\c!list=,\c!referencetext=,#1]% \strc_notations_wrapup} -\protected\def\strc_notations_start_reference#1[#2]% +\protected\def\strc_notations_start_reference#1[#S#2]% {\normalexpanded{\def\noexpand\strc_notations_pickup_yes##/#1{\strc_notations_start_reference_indeed[#2]{##1}}}% \strc_notations_pickup_yes} @@ -419,7 +421,6 @@ \doifelseinsertion\currentnote \donothing {\defineinsertion[\currentnote]% could be an option -% \normalexpanded{\t_strc_notes{\the\t_strc_notes\noexpand\strc_notes_process_list{\currentnote}}}}% \xtoksapp\t_strc_notes{\noexpand\strc_notes_process_list{\currentnote}}}% \letnoteparameter\s!insert\currentnote \definenotation[\currentnote][\c!type=\v!note]% @@ -480,7 +481,7 @@ \else \begingroup \edef\currentnotenumber{\clf_storenote{\currentnote}\currentconstructionlistentry}% - \settrue\processingnote + \processingnote\conditionaltrue \ifconditional\c_strc_notes_skip \glet\lastnotesymbol\strc_notes_inject_symbol_nop \else @@ -495,9 +496,9 @@ \fi \fi \ifconditional\postponingnotes % todo: per note class - \global\settrue\postponednote + \global\postponednote\conditionaltrue \orelse\ifconditional\inlocalnotes % todo: per note class - \global\settrue\postponednote + \global\postponednote\conditionaltrue \orelse\ifconditional\c_strc_notes_flushed \handlenoteitself\currentnote\currentnotenumber \orelse\ifconditional\c_strc_notes_delayed @@ -509,7 +510,7 @@ \fi \fi \ifconditional\c_strc_notes_skip - \global\setfalse\c_strc_notes_skip + \global\c_strc_notes_skip\conditionalfalse \else \boundary\noteboundary \fi} @@ -723,7 +724,9 @@ \dotagsetnotesymbol \noteparameter\c!textcommand{\clf_noteprefixednumber{\currentnote}\currentnotenumber\relax}% % the next one can cycle so we need to make sure it has no advance width - \doif{\noteparameter\c!indicator}\v!yes\strc_notes_inject_pointer + \ifcstok{\noteparameter\c!indicator}\v!yes + \strc_notes_inject_pointer + \fi \dostoptagged \egroup \endgroup @@ -842,8 +845,8 @@ \let\strc_notes_process_list\gobbleoneargument \protected\def\strc_notes_process#action% argument is a \macro that uses \currentnote - {\def\strc_notes_process_list##1{\edef\currentnote{##1}\let\currentdescription\currentnote#action}% - \the\t_strc_notes} + {\def\strc_notes_process_list##1{\cdef\currentnote{##1}\let\currentdescription\currentnote#action}% + \expand\t_strc_notes} \newtoks\everychecknote % just before a note is typeset \newtoks\everysynchronizenote % after a general setup has happened @@ -855,14 +858,14 @@ \to \everysynchronizenote \def\strc_notes_synchronize - {\the\everysynchronizenote} % we can speed this one up if needed by avoiding the commalist + {\expand\everysynchronizenote} % we can speed this one up if needed by avoiding the commalist \appendtoks \strc_notes_process\strc_notes_synchronize \to \everysetupnoteroot \appendtoks - \the\everysynchronizenote + \expand\everysynchronizenote \to \everydefinenote % \starttext @@ -961,9 +964,9 @@ \newconditional\c_strc_notes_delayed \newconditional\c_strc_notes_flushed -\protected\def\strc_notes_set_delayed_yes{\settrue \c_strc_notes_delayed\setfalse\c_strc_notes_flushed} -\protected\def\strc_notes_set_delayed_nop{\setfalse\c_strc_notes_delayed\setfalse\c_strc_notes_flushed} -\protected\def\strc_notes_set_delayed_lst{\settrue \c_strc_notes_delayed\settrue \c_strc_notes_flushed} +\protected\def\strc_notes_set_delayed_yes{\c_strc_notes_delayed\conditionaltrue\c_strc_notes_flushed\conditionalfalse} +\protected\def\strc_notes_set_delayed_nop{\c_strc_notes_delayed\conditionalfalse\c_strc_notes_flushed\conditionalfalse} +\protected\def\strc_notes_set_delayed_lst{\c_strc_notes_delayed\conditionaltrue\c_strc_notes_flushed\conditionaltrue} \defcsname\??notelocation\v!page\endcsname {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop @@ -1090,7 +1093,7 @@ \fi} \def\strc_notes_set_location_page - {\setfalse\c_strc_notes_delayed + {\c_strc_notes_delayed\conditionalfalse \strc_notes_set_distance \strc_notes_set_columns \page_inserts_set_location \currentnoteinsertion\v!page % \setupinsertion[\currentnote][\c!location=\v!page]% @@ -1099,7 +1102,7 @@ \page_inserts_set_distance \currentnoteinsertionnumber\s_strc_notes_distance} \def\strc_notes_set_location_columns - {\setfalse\c_strc_notes_delayed + {\c_strc_notes_delayed\conditionalfalse \strc_notes_set_distance \strc_notes_set_columns % \ifnum\currentnofcolumns=\zerocount @@ -1112,7 +1115,7 @@ \page_inserts_set_distance \currentnoteinsertionnumber\s_strc_notes_distance} \def\strc_notes_set_location_somecolumn#whatcolumn% - {\setfalse\c_strc_notes_delayed + {\c_strc_notes_delayed\conditionalfalse \strc_notes_set_distance \strc_notes_set_columns \page_inserts_set_location \currentnoteinsertion#whatcolumn% \setupinsertion[\currentnote][\c!location=#whatcolumn]% @@ -1124,7 +1127,7 @@ \def\strc_notes_set_location_lastcolumn {\strc_notes_set_location_somecolumn\v!lastcolumn } \def\strc_notes_set_location_text % we don't use inserts anyway (e.g. endnotes) - {\settrue\c_strc_notes_delayed + {\c_strc_notes_delayed\conditionaltrue \clf_setnotestate{\currentnote}{store}% \page_inserts_set_location \currentnoteinsertion\v!text % \setupinsertion[\currentnote][\c!location=\v!text]% \page_inserts_set_multiplier\currentnoteinsertionnumber\zerocount @@ -1142,7 +1145,7 @@ \let\strc_notes_set_position_high\relax \def\strc_notes_set_position_bottom - {\settrue\c_notes_bottom_present} + {\c_notes_bottom_present\conditionaltrue} \appendtoks \strc_notes_set_properties @@ -1166,7 +1169,7 @@ {\ifconditional\c_notes_bottom_present\else\strc_notes_check_if_bottom_present_indeed\fi} \def\strc_notes_check_if_bottom_present - {\setfalse\c_notes_bottom_present + {\c_notes_bottom_present\conditionalfalse \strc_notes_process\strc_notes_check_if_bottom_present_step} % Example of using factor: @@ -1252,42 +1255,46 @@ %D to split of the symbol placement. I decided to merge this functionality with the %D existing \type {\note} functionality. -\newconditional\c_strc_notes_symbol \settrue\c_strc_notes_symbol % not used +\newconditional\c_strc_notes_symbol \c_strc_notes_symbol\conditionaltrue % not used \newconditional\c_strc_notes_skip \permanent\protected\def\setnote [#tag]{\csname#tag\endcsname} -\permanent\protected\def\setnotetext[#tag]{\global\settrue\c_strc_notes_skip\csname#tag\endcsname} +\permanent\protected\def\setnotetext[#tag]{\global\c_strc_notes_skip\conditionaltrue\csname#tag\endcsname} \permanent\protected\def\handlenoteinsert#tag#id% {\begingroup - \edef\currentnote{#tag}% + \cdef\currentnote{#tag}% \strc_constructions_initialize{#tag}% \strc_notes_synchronize - \the\everybeforenoteinsert + \expand\everybeforenoteinsert \insert\currentnoteinsertionnumber\bgroup - \the\everyinsidenoteinsert\relax + \expand\everyinsidenoteinsert\relax \usesetupsparameter\noteparameter % experimental \useinterlinespaceparameter\noteparameter - \doifelse{\noteparameter\c!paragraph}\v!yes - {\nointerlineskip - \startvboxtohboxseparator - \noteparameter\c!inbetween - \stopvboxtohboxseparator - \startvboxtohbox - \handlenoteitself{#tag}{#id}% - \stopvboxtohbox} - {\handlenoteitself{#tag}{#id}}% + \ifcstok{\noteparameter\c!paragraph}\v!yes + \nointerlineskip + \startvboxtohboxseparator + \noteparameter\c!inbetween + \stopvboxtohboxseparator + \startvboxtohbox + \handlenoteitself{#tag}{#id}% + \stopvboxtohbox + \else + \handlenoteitself{#tag}{#id}% + \fi \egroup - \the\everyafternoteinsert + \expand\everyafternoteinsert \endgroup} \permanent\protected\def\betweennoteitself#tag% used ? - {\edef\currentnote{#tag}% - \doif{\noteparameter\c!paragraph}\v!yes{\noteparameter\c!inbetween}} + {\cdef\currentnote{#tag}% + \ifcstok{\noteparameter\c!paragraph}\v!yes + \noteparameter\c!inbetween + \fi} \permanent\protected\def\handlenoteitself#tag#id% {\edef\currentnotenumber{#id}% - \edef\currentnote{#tag}% + \cdef\currentnote{#tag}% \strc_constructions_initialize{#tag}% \strc_notes_synchronize \edef\currentconstructionlistentry{\clf_notelistindex{\currentnote}#id}% index in list cache @@ -1380,7 +1387,7 @@ % maybe but better use [scope=local] here % % \appendtoks -% \setfalse\inhibitmargindata +% \inhibitmargindata\conditionalfalse % \to \everyinsidenoteinsert \setupnotes @@ -1431,7 +1438,7 @@ \newconditional\c_strc_notes_first_placed \permanent\protected\def\placenoteinserts - {\setfalse\c_strc_notes_first_placed + {\c_strc_notes_first_placed\conditionalfalse \strc_notes_process\strc_notes_place_inserts} \def\strc_notes_place_inserts @@ -1440,7 +1447,7 @@ % \ifdim\ht\currentnoteinsertionnumber>\zeropoint % or a faster delayed test \ifcase\page_inserts_get_height\currentnoteinsertionnumber\else \strc_notes_place_inserts_indeed - \settrue\c_strc_notes_first_placed + \c_strc_notes_first_placed\conditionaltrue \fi \fi} @@ -1522,22 +1529,24 @@ \def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter - \doifelse{\noteparameter\c!paragraph}\v!yes - {\leftorrightvbox % cf mail from ws to list - {\starthboxestohbox - \iftrialtypesetting - \page_inserts_get_uncopied - \else - \page_inserts_get_unboxed - \fi - \currentnoteinsertionnumber - \stophboxestohbox}} - {\iftrialtypesetting - \ifvmode\page_inserts_get_uncopied\else\page_inserts_get_copied\fi - \else - \ifvmode\page_inserts_get_unboxed \else\page_inserts_get_boxed \fi - \fi - \currentnoteinsertionnumber}% + \ifcstok{\noteparameter\c!paragraph}\v!yes + \leftorrightvbox % cf mail from ws to list + {\starthboxestohbox + \iftrialtypesetting + \page_inserts_get_uncopied + \else + \page_inserts_get_unboxed + \fi + \currentnoteinsertionnumber + \stophboxestohbox}% + \else + \iftrialtypesetting + \ifvmode\page_inserts_get_uncopied\else\page_inserts_get_copied\fi + \else + \ifvmode\page_inserts_get_unboxed \else\page_inserts_get_boxed \fi + \fi + \currentnoteinsertionnumber + \fi \endgroup} %D Supporting end notes is surprisingly easy. Even better, we can combine this @@ -1571,7 +1580,7 @@ \permanent\protected\def\postponenotes % will be locally overloaded {\ifcase\insertionmigrationmode \ifconditional\postponingnotes\else - \global\settrue\postponingnotes + \global\postponingnotes\conditionaltrue \enforced\glet\flushnotes\doflushnotes \clf_postponenotes \fi @@ -1583,7 +1592,7 @@ \permanent\protected\def\startpostponingnotes % experimental, page-mix {\ifconditional\postponingnotes\else - \global\settrue\postponingnotes + \global\postponingnotes\conditionaltrue %\glet\flushnotes\doflushnotes \clf_postponenotes \fi} @@ -1603,8 +1612,8 @@ \fi \fi \clf_flushpostponednotes% this also resets the states ! - \global\setfalse\postponednote - \global\setfalse\postponingnotes + \global\postponednote\conditionalfalse + \global\postponingnotes\conditionalfalse \enforced\glettonothing\flushnotes \endgroup \fi} @@ -1632,13 +1641,13 @@ \mutable\lettonothing\localnoteslist \permanent\tolerant\protected\def\startlocalnotes[#list]% grouping ? (we used to have a second argument ... settings) - {\settrue\inlocalnotes + {\inlocalnotes\conditionaltrue \def\localnoteslist{#list}% \processcommacommand[\localnoteslist]\strc_notes_local_start_step} \permanent\protected\def\stoplocalnotes {\processcommacommand[\localnoteslist]\strc_notes_local_stop_step - \setfalse\inlocalnotes} + \inlocalnotes\conditionalfalse} \lettonothing\p_strc_notes_continue @@ -1657,19 +1666,21 @@ \fi \clf_restorenote{#tag}} -\permanent\tolerant\protected\def\placelocalnotes[#tag]#spacer[#settings]% - {\doif{\clf_getnotestate{#tag}}{store}{\strc_notes_local_place_indeed{#settings}{#tag}}} +\permanent\tolerant\protected\def\placelocalnotes[#tag]#spacer[#S#settings]% + {\iftok{\clf_getnotestate{#tag}}{store}% + \strc_notes_local_place_indeed{#settings}{#tag}% + \fi} \def\strc_notes_local_place_indeed#settings#tag% {\begingroup - \edef\currentnote{#tag}% is already set? - \the\everyplacelocalnotes + \cdef\currentnote{#tag}% is already set? + \expand\everyplacelocalnotes % beware, we cannot trust setting \currentnote here \setupcurrentnote[#settings]% later we set height etc for framed \strc_notes_place_local_alternative \strc_notes_set_properties % restore globals (if needed) \endgroup - }% TODO: just restore properties \the\everychecknote} % we need to restore the old state + }% TODO: just restore properties \expand\everychecknote} % we need to restore the old state %D These commands can be used like: %D @@ -1708,22 +1719,24 @@ \permanent\protected\def\placebottomnotes {\strc_notes_process\strc_notes_place_inserts} -\permanent\tolerant\protected\def\placenotes[#list]#spacer[#settings]% +\permanent\tolerant\protected\def\placenotes[#list]#spacer[#S#settings]% {\processcommalist[#list]{\strc_notes_place_indeed{#settings}}} \def\strc_notes_place_indeed#settings#tag% settings note - {\edef\currentnote{#tag}% grouping ? - \doifelse{\clf_getnotestate{#tag}}{store} - \strc_notes_local_place_indeed - \strc_notes_global_place_indeed - {#settings}{#tag}} + {\cdef\currentnote{#tag}% grouping ? + \iftok{\clf_getnotestate{#tag}}{store}% + \expandafter\strc_notes_local_place_indeed + \else + \expandafter\strc_notes_global_place_indeed + \fi + {#settings}{#tag}} \def\strc_notes_global_place_indeed#settings#tag% {\begingroup \setupnote[#tag][#settings]% \strc_notes_place_inserts \endgroup - \the\everysetupnote} % to be checked .. synchronize + \expand\everysetupnote} % to be checked .. synchronize %D Placement @@ -1923,6 +1936,7 @@ \definenote [\v!footnote] \definenote [\v!endnote ] [\c!location=\v!none] % else no break +\definenote [\v!mathnote] [\c!location=\v!none] %D Compatibility macros: @@ -1934,14 +1948,14 @@ \permanent\protected\def\startlocalfootnotes {\startlocalnotes [\v!footnote]} % alleen footnote \permanent\protected\def\stoplocalfootnotes {\stoplocalnotes } -\tolerant\def\strc_notes_place_footnotes[#list]#spacer[#settings]% +\tolerant\def\strc_notes_place_footnotes[#list]#spacer[#S#settings]% {\ifarguments\or \placenotes[#list][\c!height=\textheight]% \or \placenotes[#list][#settings,\c!height=\textheight]% \fi} -\tolerant\def\strc_notes_place_local_footnotes[#list]#spacer[#settings]% +\tolerant\def\strc_notes_place_local_footnotes[#list]#spacer[#S#settings]% {\ifarguments\or \placelocalnotes[#list][\c!height=\textheight]% \or @@ -1979,9 +1993,9 @@ {\ifnotesenabled \dontleavehmode \begingroup - \edef\currentnote{#tag}% + \cdef\currentnote{#tag}% \usenotestyleandcolor\c!textstyle\c!textcolor - \iftok{#reference}\emptytoks + \ifempty{#reference}% \noteparameter\c!textcommand\lastnotesymbol % check if command double \else \unskip @@ -1991,7 +2005,7 @@ \fi} \permanent\tolerant\protected\def\note[#tag]#keepspacer[#reference]% - {\iftok{#reference}\emptytoks + {\ifempty{#reference}% \notesymbol[\v!footnote][#tag]% \else \notesymbol[#tag][#reference]% diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl index 3f3bd21430d..3c44266fccb 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl @@ -267,9 +267,9 @@ % so far for the hack -\permanent\tolerant\protected\def\convertedcounter[#1]#*[#2]% +\permanent\tolerant\protected\def\convertedcounter[#1]#*[#S#2]% {\begingroup - \edef\currentcounter{#1}% + \cdef\currentcounter{#1}% \ifparameter#2\or\setupcurrentcounter[#2]\fi \clf_prefixedconverted {\counterparameter\s!name} @@ -399,7 +399,7 @@ \ifempty\currentname \edef\currentname{#1}% \fi - \edef\currentcounter{#3\s!counter}% + \cdef\currentcounter{#3\s!counter}% \ifempty\currentcounter \let\currentcounter\currentname \fi @@ -599,7 +599,7 @@ \c!numbersegments =#2\c!numbersegments]} \protected\def\strc_counter_setup_using_parameter#1#2% name \someparameter - {\edef\currentcounter{#1}% + {\cdef\currentcounter{#1}% % \setcounterparameter \c!start{#2\c!start}% \setcounterparameter \c!state{#2\c!state}% % beware, "" == start @@ -623,7 +623,7 @@ \setcounterparameter \c!numberstopper{#2\c!numberstopper}% \setcounterparameter \c!numbersegments{#2\c!numbersegments}% % - \the\everysetupcounter} + \expand\everysetupcounter} \protected\def\mult_interfaces_counter_association#1#2#3#4#5#6#7% tag current setup parameter list sync register {\strc_counter_preset_using_parameter#3\rootcounterparameter @@ -667,11 +667,11 @@ % \the#5% % \else % \lettonothing\currentcounter -% \the\everysetupcounter +% \expand\everysetupcounter % \fi % \strc_counter_setup_pop}% % \protected\def#7##1% register -% {\normalexpanded{#5{\the#5\edef\noexpand\currentcounter{##1}\noexpand\the\everysetupcounter}}}} +% {\normalexpanded{#5{\the#5\edef\noexpand\currentcounter{##1}\noexpand\expand\everysetupcounter}}}} %D For good old times (easier to explain in manuals): %D diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl index 2da56506768..f63b4ff4e41 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl @@ -40,7 +40,7 @@ \newtoks\everyinitializepagecounters \permanent\protected\def\initializepagecounters - {\the\everyinitializepagecounters} + {\expand\everyinitializepagecounters} \appendtoks \initializepagecounters @@ -91,9 +91,9 @@ \def\strc_pagenumbers_save_state#1{\edef\m_strc_pagenumbers_state_old{\namedcounterparameter#1\c!state}} -\permanent\tolerant\protected\def\setuprealpagenumber[#1]{\strc_pagenumbers_save_state\s!realpage\setupcounter[\s!realpage][#1]\the\everysetuprealpagenumber} -\permanent\tolerant\protected\def\setupuserpagenumber[#1]{\strc_pagenumbers_save_state\s!userpage\setupcounter[\s!userpage][#1]\the\everysetupuserpagenumber} -\permanent\tolerant\protected\def\setupsubpagenumber [#1]{\strc_pagenumbers_save_state\s!subpage \setupcounter[\s!subpage ][#1]\the\everysetupsubpagenumber } +\permanent\tolerant\protected\def\setuprealpagenumber[#S#1]{\strc_pagenumbers_save_state\s!realpage\setupcounter[\s!realpage][#1]\expand\everysetuprealpagenumber} +\permanent\tolerant\protected\def\setupuserpagenumber[#S#1]{\strc_pagenumbers_save_state\s!userpage\setupcounter[\s!userpage][#1]\expand\everysetupuserpagenumber} +\permanent\tolerant\protected\def\setupsubpagenumber [#S#1]{\strc_pagenumbers_save_state\s!subpage \setupcounter[\s!subpage ][#1]\expand\everysetupsubpagenumber } \permanent\protected\def\resetrealpagenumber {} % not permitted \permanent\protected\def\resetuserpagenumber {\strc_counters_reset\s!userpage} @@ -312,15 +312,15 @@ \newtoks\everysidedswitch \appendtoks - \singlesidedfalse \setfalse\layoutisdoublesided - \doublesidedfalse \setfalse\layoutissinglesided + \singlesidedfalse \layoutisdoublesided\conditionalfalse + \doublesidedfalse \layoutissinglesided\conditionalfalse \resetsystemmode\v!singlesided \resetsystemmode\v!doublesided \processallactionsinset [\directpagenumberingparameter\c!alternative]% - [ \v!singlesided=>\setsystemmode\v!singlesided\singlesidedtrue\settrue\layoutissinglesided, - \v!doublesided=>\setsystemmode\v!doublesided\doublesidedtrue\settrue\layoutisdoublesided]% - \the\everysidedswitch + [ \v!singlesided=>\setsystemmode\v!singlesided\singlesidedtrue\layoutissinglesided\conditionaltrue, + \v!doublesided=>\setsystemmode\v!doublesided\doublesidedtrue\layoutisdoublesided\conditionaltrue]% + \expand\everysidedswitch \pageduplexmode \ifsinglesided \ifdoublesided\plustwo\else\zerocount\fi @@ -366,7 +366,9 @@ \protected\def\strc_pagenumbers_place_location {\ifnum\c_strc_pagenumbers_state_userpage=\plustwo \ifnum\c_strc_pagenumbers_state=\plusone - \doif{\directpagenumberingparameter\c!strut}\v!yes\strut + \ifcstok{\directpagenumberingparameter\c!strut}\v!yes + \strut + \fi \begingroup \usepagenumberingstyleandcolor\c!style\c!color \directpagenumberingparameter\c!command @@ -394,7 +396,7 @@ \fi} \permanent\protected\def\referencepagenumber[#1]% - {\doifelsenothing{#1}{?}{}} + {\ifempty{#1}?\fi} % The numbered location handler is there because we need to be downward % compatible. So, in fact there can be multiple handlers active at the @@ -424,9 +426,11 @@ \to \everysetupsubpagenumber \appendtoks % todo: set state: none, start, stop, reset - \doifelse{\directpagenumberingparameter\c!state}\v!start - {\c_strc_pagenumbers_state\plusone }% - {\c_strc_pagenumbers_state\zerocount}% + \ifcstok{\directpagenumberingparameter\c!state}\v!start + \c_strc_pagenumbers_state\plusone + \else + \c_strc_pagenumbers_state\zerocount + \fi \to \everysetuppagenumbering % Done diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt index 272e7e99298..3665c56c3f6 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt @@ -55,6 +55,7 @@ local commands = commands local implement = interfaces.implement local ctx_latelua = context.latelua +local ctx_doifelse = commands.doifelse local texiscount = tex.iscount local texgetcount = tex.getcount @@ -69,7 +70,8 @@ local justacomponent = resolvers.jobs.justacomponent local settings_to_array = utilities.parsers.settings_to_array local settings_to_table = utilities.parsers.settings_to_array_obey_fences local process_settings = utilities.parsers.process_stripped_settings -local unsetvalue = attributes.unsetvalue + +local unsetvalue = attributes.unsetvalue local structures = structures local helpers = structures.helpers @@ -125,12 +127,12 @@ local componentsplitter = references.componentsplitter local currentreference = nil -local txtcatcodes = catcodes.numbers.txtcatcodes -- or just use "txtcatcodes" +local txtcatcodes = catcodes.numbers.txtcatcodes -- or just use "txtcatcodes" -local c_realpageno = texiscount("realpageno") -local c_locationcount = texiscount("locationcount") -local c_locationorder = texiscount("locationorder") -local c_lastdestinationattribute = texiscount("lastdestinationattribute") +local c_realpageno = texiscount("realpageno") +local c_locationcount = texiscount("locationcount") +local c_locationorder = texiscount("locationorder") +local c_lastdestinationattribute = texiscount("lastdestinationattribute") local p_splitter = lpeg.splitat(":") local p_lower = lpeg.patterns.utf8lower @@ -785,7 +787,7 @@ end implement { name = "doifelseurldefined", - actions = { urls.found, commands.doifelse }, + actions = { urls.found, ctx_doifelse }, arguments = "string" } @@ -836,7 +838,7 @@ end implement { name = "doifelsefiledefined", - actions = { files.found, commands.doifelse }, + actions = { files.found, ctx_doifelse }, arguments = "string" } @@ -1122,13 +1124,12 @@ local function loadexternalreferences(name,utilitydata) local sections = struc.sections.collected -- a bit weird one, as we don't have the externals in the collected for prefix, set in next, external do - if prefix == "" then - prefix = name -- this can clash! - end + -- prefix is currently not used, only in reporting + local usedprefix = prefix == "" and name or prefix -- this can clash! for reference, data in next, set do if trace_importing then report_importing("registering %a reference, kind %a, name %a, prefix %a, reference %a", - "external","regular",name,prefix,reference) + "external","regular",name,usedprefix,reference) end -- weird code -- local section = reference.section @@ -1431,12 +1432,12 @@ implement { end } -local useproduct = commands.useproduct +local ctx_useproductuseproduct = commands.useproduct -if useproduct then +if ctx_useproduct then local function newuseproduct(product) - useproduct(product) + ctx_useproduct(product) if texconditionals.autocrossfilereferences then local component = justacomponent() if component then @@ -1654,6 +1655,9 @@ local function identify_inner(set,var,prefix,collected,derived) end -- local n, list = resolvers.jobs.currentstructure() +-- print(prefix) +-- inspect(set) +-- inspect(list) if list then for i=#list,1,-1 do local l = list[i] @@ -1661,8 +1665,9 @@ local function identify_inner(set,var,prefix,collected,derived) if i then i = i[inner] if i then - -- return finish_inner(set,var,"",i) - return finish_inner(set,var,l,i) +local p = i.references.prefix or l -- which is what we use in the destination +-- return finish_inner(set,var,l,i) + return finish_inner(set,var,p,i) end end end @@ -2135,7 +2140,7 @@ end implement { name = "doifelsereference", - actions = { references.valid, commands.doifelse }, + actions = { references.valid, ctx_doifelse }, arguments = { "string", "string", @@ -2149,7 +2154,7 @@ implement { implement { name = "doifelsereferencechecked", - actions = { references.checked, commands.doifelse }, + actions = { references.checked, ctx_doifelse }, arguments = { "string", "string", @@ -2208,7 +2213,7 @@ function references.setlinkmethod(inner,outer) end if toboolean(outer) or outer == v_page or outer == v_yes then outermethod = v_page - elseif inner == v_name then + elseif outer == v_name then outermethod = v_name else outermethod = v_auto diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx index 8619d084e74..2bdc19caa86 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx @@ -96,8 +96,7 @@ \newif\ifreferencing \referencingtrue \appendtoks - \edef\p_state{\referencingparameter\c!state}% - \ifx\p_state\v!start + \ifcstok{\referencingparameter\c!state}\v!start \referencingtrue \else \referencingfalse @@ -129,10 +128,10 @@ %D These are implemented in a low level form as: -\permanent\tolerant\protected\def\textreference [#labels]{\strc_references_set_named_reference\s!text{#labels}{}} -\permanent\tolerant\protected\def\pagereference [#labels]{\strc_references_set_named_reference\s!page{#labels}{}{}} -\permanent\tolerant\protected\def\reference [#labels]{\strc_references_set_named_reference\s!full{#labels}{}} -\permanent\tolerant\protected\def\setreference [#labels]#spacer[#settings]{\strc_references_set_named_reference\s!user{#labels}{#settings}{}} +\permanent\tolerant\protected\def\textreference [#labels]{\strc_references_set_named_reference\s!text{#labels}{}} +\permanent\tolerant\protected\def\pagereference [#labels]{\strc_references_set_named_reference\s!page{#labels}{}{}} +\permanent\tolerant\protected\def\reference [#labels]{\strc_references_set_named_reference\s!full{#labels}{}} +\permanent\tolerant\protected\def\setreference [#labels]#spacer[#S#settings]{\strc_references_set_named_reference\s!user{#labels}{#settings}{}} \permanent\protected\def\dosetdirectpagereference#1{\strc_references_set_named_reference\s!page{#1}{}{}} % low level, maybe use _ @@ -482,7 +481,7 @@ %D %D \stoptyping -\permanent\tolerant\protected\def\contentreference[#1]#*[#2]% +\permanent\tolerant\protected\def\contentreference[#1]#*[#S#2]% {\ifarguments \expandafter\gobbletwoarguments \or @@ -661,7 +660,7 @@ %D %D We can trace references by setting the next switch to true. -\permanent\tolerant\protected\def\definereference[#name]#spacer[#specification]% +\permanent\tolerant\protected\def\definereference[#name]#spacer[#S#specification]% {\clf_definereference{\referenceprefix}{#name}{\detokenize{#specification}}} \permanent\protected\def\resetreference[#name]% @@ -685,7 +684,7 @@ %D The next switch can be used to make user hyperlinks are not highlighted when %D clicked on. -\newconditional\highlighthyperlinks \settrue\highlighthyperlinks +\newconditional\highlighthyperlinks \highlighthyperlinks\conditionaltrue %D \macros %D {gotonewwindow} @@ -694,7 +693,7 @@ %D one file, it makes sense to force the viewer to open a new window for each file %D opened. -\newconditional\gotonewwindow \setfalse\gotonewwindow +\newconditional\gotonewwindow \gotonewwindow\conditionalfalse \permanent\def\doifelsereferencefound#label% {\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}} @@ -887,17 +886,15 @@ \newconditional\autocrossfilereferences \appendtoks - \edef\p_autofile{\referencingparameter\c!autofile}% - \ifx\p_autofile\v!yes - \settrue \autocrossfilereferences + \ifcstok{\referencingparameter\c!autofile}\v!yes + \autocrossfilereferences\conditionaltrue \else - \setfalse\autocrossfilereferences + \autocrossfilereferences\conditionalfalse \fi \to \everysetupreferencing \appendtoks - \edef\p_export{\referencingparameter\c!export}% - \ifx\p_export\v!yes + \ifcstok{\referencingparameter\c!export}\v!yes \clf_exportreferences \fi \to \everygoodbye @@ -1100,7 +1097,11 @@ \newconditional\pagestatespread \appendtoks - \doifelse{\referencingparameter\c!doublesided}\v!yes\settrue\setfalse\pagestatespread + \ifcstok{\referencingparameter\c!doublesided}\v!yes + \pagestatespread\conditionaltrue + \else + \pagestatespread\conditionalfalse + \fi \to \everysetupreferencing \setupreferencing @@ -1190,11 +1191,11 @@ \permanent\protected\def\someplace#preceding#backward#current#foreward#following#dummy[#label]% #dummy gobbles space around #foreward {\doifcheckedpagestate{#label}% - {\doifelsenothing{#preceding}{\goto{#preceding}[#label]}\ignorespaces}% - {\doifelsenothing {#backward}{\goto {#backward}[#label]}\ignorespaces}% - {\doifelsenothing {#current}{\goto {#current}[#label]}\ignorespaces}% - {\doifelsenothing {#foreward}{\goto {#foreward}[#label]}\ignorespaces}% - {\doifelsenothing{#following}{\goto{#following}[#label]}\ignorespaces}% + {\ifempty{#preceding}\goto{#preceding}[#label]\fi\ignorespaces}% + {\ifempty {#backward}\goto {#backward}[#label]\fi\ignorespaces}% + {\ifempty {#current}\goto {#current}[#label]\fi\ignorespaces}% + {\ifempty {#foreward}\goto {#foreward}[#label]\fi\ignorespaces}% + {\ifempty{#following}\goto{#following}[#label]\fi\ignorespaces}% {#label}} \permanent\protected\def\atpage[#label]% todo @@ -1211,11 +1212,11 @@ % % \protected\def\strc_references_conditional#action#text[#condition]#dummy[#label]% % {\doifcheckedpagestate{#label}% -% {\doifelse{#condition}\v!precedingpage{#action{#text}[#label]}\ignorespaces}% -% {\doifelse{#condition}\v!hencefore {#action{#text}[#label]}\ignorespaces}% -% {\doifelse{#condition}\v!current {#action{#text}[#label]}\ignorespaces}% -% {\doifelse{#condition}\v!hereafter {#action{#text}[#label]}\ignorespaces}% -% {\doifelse{#condition}\v!followingpage{#action{#text}[#label]}\ignorespaces}% +% {\ifempty{#condition}\v!precedingpage#action{#text}[#label]\fi\ignorespaces}% +% {\ifempty{#condition}\v!hencefore #action{#text}[#label]\fi\ignorespaces}% +% {\ifempty{#condition}\v!current #action{#text}[#label]\fi\ignorespaces}% +% {\ifempty{#condition}\v!hereafter #action{#text}[#label]\fi\ignorespaces}% +% {\ifempty{#condition}\v!followingpage#action{#text}[#label]\fi\ignorespaces}% % {#label}} % % \protected\def\conditionalat {\strc_references_conditional\at} @@ -1249,21 +1250,27 @@ \installcorenamespace{referencinginteraction} \def\strc_references_interaction_all - {\the\leftreferencetoks - \doifelsesometoks\leftreferencetoks \leftofreferencecontent \donothing - \leftofreference - \doifelsesometoks\leftreferencetoks\onlynonbreakablespace\relax % new, replace space by nonbreakable if present + {\ifempty\leftreferencetoks + \leftofreference + \else + \expand\leftreferencetoks + \leftofreferencecontent + \leftofreference + \onlynonbreakablespace\relax % new, replace space by nonbreakable if present + \fi \currentreferencecontent \rightofreference - \doifelsesometoks\rightreferencetoks\rightofreferencecontent\donothing - \the\rightreferencetoks} + \ifempty\rightreferencetoks\else + \rightofreferencecontent + \expand\rightreferencetoks + \fi} \letcsname\??referencinginteraction\v!all\endcsname\strc_references_interaction_all \defcsname\??referencinginteraction\v!label\endcsname {\leftofreference - \the\leftreferencetoks - \the\rightreferencetoks + \expand\leftreferencetoks + \expand\rightreferencetoks \rightofreference} \defcsname\??referencinginteraction\v!text\endcsname @@ -1293,7 +1300,7 @@ \begingroup} \def\strc_references_stop_goto - {\the\everyresetinatreference + {\expand\everyresetinatreference \endgroup} % NEEDS TESTING: @@ -1377,7 +1384,7 @@ \installcommandhandler \??referenceformat {referenceformat} \??referenceformat \appendtoks - \setuevalue\currentreferenceformat{\strc_references_apply_format{\currentreferenceformat}}% + \frozen\instance\protected\edefcsname\currentreferenceformat\endcsname{\strc_references_apply_format{\currentreferenceformat}}% \to \everydefinereferenceformat \setupreferenceformat @@ -1475,7 +1482,7 @@ % [\goto{state} [file(mk-last-state)]] % \stoptext -\newconditional\uselocationstrut \settrue\uselocationstrut +\newconditional\uselocationstrut \uselocationstrut\conditionaltrue \permanent\def\extrareferencearguments {highlight \luaconditional\highlighthyperlinks\space @@ -1496,6 +1503,12 @@ \expandafter\strc_references_goto_htdp \fi} +\permanent\tolerant\protected\def\namedgoto[#1]#:#*#=#*[#3]% + {\dontleavehmode\begingroup + \setinteraction[#1]% + \goto{#2}[#3]% + \endgroup} + % The unbox trick is needed in order to permit \par inside a reference. Otherwise % the reference attribute migrates to the outer boxes. @@ -2144,7 +2157,7 @@ segments {\referencestructureprefixparameter{#kind}{#name}{#category}\c!numbersegments}% }} -\permanent\tolerant\protected\def\setupreferencestructureprefix[#kind]#spacer[#category]#spacer[#settings]% +\permanent\tolerant\protected\def\setupreferencestructureprefix[#kind]#spacer[#category]#spacer[#S#settings]% {\ifarguments\or\or \getparameters[\??referencingprefix:#kind][#category]% \else diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt index 6affc02f89c..cb68bf57518 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt @@ -34,20 +34,19 @@ local processors = typesetters.processors local splitprocessor = processors.split local texgetcount = tex.getcount -local texiscount = tex.iscount local variables = interfaces.variables -local v_forward = variables.forward -local v_all = variables.all -local v_no = variables.no -local v_yes = variables.yes -local v_packed = variables.packed -local v_current = variables.current -local v_previous = variables.previous -local v_first = variables.first -local v_last = variables.last -local v_text = variables.text -local v_section = variables.section +local v_forward = variables.forward +local v_all = variables.all +local v_no = variables.no +local v_yes = variables.yes +local v_packed = variables.packed +local v_current = variables.current +local v_previous = variables.previous +local v_first = variables.first +local v_last = variables.last +local v_text = variables.text +local v_section = variables.section local context = context local ctx_latelua = context.latelua @@ -66,10 +65,10 @@ local setinternalreference = references.setinternalreference local setmetatableindex = table.setmetatableindex -local absmaxlevel = 5 -- \c_strc_registers_maxlevel +local absmaxlevel = 5 -- \c_strc_registers_maxlevel -local c_realpageno = texiscount("realpageno") -local c_locationcount = texiscount("locationcount") +local c_realpageno = tex.iscount("realpageno") +local c_locationcount = tex.iscount("locationcount") local h_prefixpage = helpers.prefixpage local h_prefixlastpage = helpers.prefixlastpage @@ -622,48 +621,38 @@ local function enhanceregister(specification) end end --- This can become extendregister(specification)! - -local function extendregister(name,tag,rawdata) -- maybe do lastsection internally - if type(tag) == "string" then - tag = tagged[tag] - end - if tag then - local data = tobesaved[name].metadata.notsaved and collected[name] or tobesaved[name] - local entry = data.entries[tag] - if entry then - local references = entry.references - references.lastrealpage = texgetcount(c_realpageno) - references.lastsection = currentid() - if rawdata then - local userdata = rawdata.userdata - if userdata then - rawdata.userdata = touserdata(userdata) - end - if rawdata.entries then - preprocessentries(rawdata) - end - local metadata = rawdata.metadata - if metadata and not metadata.catcodes then - metadata.catcodes = tex.catcodetable -- get - end - for k, v in next, rawdata do - local rk = references[k] - if not rk then - references[k] = v - else - for kk, vv in next, v do - if type(vv) == "table" then - if next(vv) then - rk[kk] = vv - end - elseif vv ~= "" then - rk[kk] = vv - end +local function extendregister(rawdata) -- this is probably not okay in mkiv + local references = rawdata.references + local metadata = rawdata.metadata + if references and metadata then + local name = rawdata.metadata.name + local tag = references.label + if type(tag) == "string" then + tag = tagged[tag] + end + if tag then + local data = tobesaved[name].metadata.notsaved and collected[name] or tobesaved[name] + local entry = data.entries[tag] + if entry then + references = entry.references + references.lastrealpage = texgetcount(c_realpageno) + references.lastsection = currentid() + if rawdata then + local userdata = rawdata.userdata + if userdata and userdata ~= "" then + entry.userdata = table.merged(entry.userdata or { },touserdata(userdata)) + end + if rawdata.entries then + preprocessentries(rawdata) + if next(rawdata.list) then + entry.list = rawdata.list end end - end - end + if metadata then + entry.metadata = table.merged(entry.metadata or { },metadata) + end + end + end end end end @@ -697,9 +686,48 @@ implement { implement { name = "extendregister", actions = extendregister, + arguments = { + { + { "metadata", { + { "name" }, + { "coding" }, + { "catcodes", "integer" }, + { "own" }, + } + }, + { "entries", { + { "entries", "list" }, + { "keys", "list" }, + { "processors", "list" }, + { "entry" }, + { "key" }, + { "processor" }, + } + }, + { "references", { + { "label" }, + } + }, + { "userdata" }, + } + } +} + +implement { + name = "extendregisterlate", arguments = "2 strings", + actions = function(name,label) + context.latelua(function() + extendregister { + metadata = { name = name }, + references = { abel = label }, + } + end) + end, } +-- commands.extendregister = extendregister + implement { name = "storeregister", -- actions = function(rawdata) @@ -1276,7 +1304,12 @@ local function collapsedpage(pages) local second_first_last = second_first.references.lastrealpage if first_last_last then first_last_pn = first_last_last - if second_first == second_last and second_first_pn <= first_last_pn then + if first_last_pn == second_first_pn then + -- 2-3, 3-9 -> 2-9 + pages[i-1] = { first_first, second_last } + remove(pages,i) + return true + elseif second_first == second_last and second_first_pn <= first_last_pn then -- 2=8, 5 -> 12=8 remove(pages,i) return true @@ -1691,7 +1724,6 @@ function registers.flush(data,options,prefixspec,pagespec) for i=1,#entries do entries[i].split = nil end - -- collectgarbage("collect") end function registers.process(class,...) diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl index 7dd07b2e261..2b10354b71e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl @@ -66,7 +66,7 @@ \let\strc_registers_setup_step\relax -\permanent\tolerant\protected\overloaded\def\setupregister[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\overloaded\def\setupregister[#S#1]#*[#S#2]#*[#S#3]% {\ifarguments\or \strc_registers_setup_saved[#1]% \or @@ -76,7 +76,7 @@ \processcommalist[#2]\strc_registers_setup_step \fi} -\permanent\tolerant\protected\def\setupregisters[#1]% +\permanent\tolerant\protected\def\setupregisters[#S#1]% {\strc_registers_setup_saved[#1]\relax} \setupregister @@ -169,23 +169,23 @@ \newconditional\c_strc_registers_defining \setnewconstant\c_strc_registers_maxlevel \plusfive -\newconditional\c_strc_registers_vertical \settrue\c_strc_registers_vertical +\newconditional\c_strc_registers_vertical \c_strc_registers_vertical\conditionaltrue \ifdefined\Word \else \protected\def\Word#1{#1} \fi \appendtoks \ifconditional\c_strc_registers_defining \else % todo: dosingle ... - \settrue\c_strc_registers_defining + \c_strc_registers_defining\conditionaltrue \definemixedcolumns[\currentregister][\v!register]% first as otherwise it overloads start/stop \clf_defineregister{\currentregister}{\registerparameter\c!referencemethod}% \normalexpanded{\presetheadtext[\currentregister=\Word{\currentregister}]}% - \frozen\instance\setuevalue{\currentregister}{\strc_registers_insert_entry[\currentregister]}% - \frozen\instance\setuevalue{\e!see\currentregister}{\strc_registers_insert_see[\currentregister]}% - %frozen\instance\setuevalue{\e!coupled\currentregister}{\dolinkedregister{\currentregister}}% + \frozen\instance\protected\edefcsname\currentregister\endcsname{\strc_registers_insert_entry[\currentregister]}% + \frozen\instance\protected\edefcsname\e!see\currentregister\endcsname{\strc_registers_insert_see[\currentregister]}% + %frozen\instance\protected\edefcsname\e!coupled\currentregister\endcsname{\dolinkedregister{\currentregister}}% % historic ballast - \frozen\instance\setuevalue{\e!place\currentregister}{\placeregister[\currentregister]}% - \frozen\instance\setuevalue{\e!complete\currentregister}{\completeregister[\currentregister]}% - \frozen\instance\setuevalue{\e!setup\currentregister\e!endsetup}{\setupregister[\currentregister]}% + \frozen\instance\protected\edefcsname\e!place\currentregister\endcsname{\placeregister[\currentregister]}% + \frozen\instance\protected\edefcsname\e!complete\currentregister\endcsname{\completeregister[\currentregister]}% + \frozen\instance\protected\edefcsname\e!setup\currentregister\e!endsetup\endcsname{\setupregister[\currentregister]}% \dorecurse\c_strc_registers_maxlevel{% weird, expanded should not be needed \normalexpanded{\defineregister[\currentregister:\recurselevel][\currentregister]}% %\defineregister[\currentregister:\recurselevel][\currentregister]% @@ -193,7 +193,7 @@ \resetregisterparameter{\c!keys :\recurselevel}% avoid it, but it's faster too) }% % - \setfalse\c_strc_registers_defining + \c_strc_registers_defining\conditionalfalse \fi \to \everydefineregister @@ -266,9 +266,8 @@ \xdef\currentregisterprocessorsb{\registerparameter{\c!processors:2}}% \xdef\currentregisterprocessorsc{\registerparameter{\c!processors:3}}} -\def\strc_registers_register_page_entry_indeed#1#2#3% register data userdata - {\begingroup - \edef\currentregister{#1}% +\def\strc_registers_register_prepare_entry#1#2% + {\cdef\currentregister{#1}% %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% \setupcurrentregister[#2]% \edef\currentregisterlabel {\registerparameter\c!label}% @@ -302,7 +301,11 @@ \strc_registers_register_page_expand_yes_keys \fi \fi - \strc_registers_register_page_expand_processors + \strc_registers_register_page_expand_processors} + +\def\strc_registers_register_page_entry_indeed#1#2#3% register data userdata + {\begingroup + \strc_registers_register_prepare_entry{#1}{#2}% \setnextinternalreference % we could consider storing register entries in a list which we % could then sort @@ -325,7 +328,7 @@ \ifempty\currentregisterlabel \else label {\currentregisterlabel}% \fi -% view {\interactionparameter\c!focus}% + % view {\interactionparameter\c!focus}% }% entries {% % we need a special one for xml, this is just a single one @@ -380,7 +383,7 @@ \permanent\protected\def\dosetfastregisterentry#1#2#3#4#5% register entry key processor processor {\begingroup - \edef\currentregister{#1}% + \cdef\currentregister{#1}% \setnextinternalreference \glet\currentregistername\currentregister \xdef\currentregisternumber{\clf_storeregister @@ -413,10 +416,9 @@ \aliased\let\dotagregisterlocation\relax % experiment -\tolerant\protected\def\strc_registers_insert_entry[#1]#*[#2]% - {\def\currentregister{#1}% - \edef\p_ownnumber{\registerparameter\c!ownnumber}% - \ifx\p_ownnumber\v!yes +\tolerant\protected\def\strc_registers_insert_entry[#1]#*[#S#2]% + {\cdef\currentregister{#1}% + \ifcstok{\registerparameter\c!ownnumber}\v!yes \expandafter\strc_registers_insert_entry_yes \else \expandafter\strc_registers_insert_entry_nop @@ -468,7 +470,8 @@ \fi} \permanent\tolerant\protected\def\stopregister[#1]#*[#2]% - {\normalexpanded{\ctxlatecommand{extendregister("#1","#2")}}} +% {\normalexpanded{\ctxlatecommand{extendregister("#1","#2")}}} + {\clf_extendregisterlate{#1}{#2}} % a synonym, so that we can nest with overlap without syntax check problems @@ -483,61 +486,64 @@ \permanent\tolerant\protected\def\finishregisterentry[#1]#*[#2]#*[#3]% {\strc_registers_finish_entry_indeed{#1}{#2}{#3}} -\def\strc_registers_finish_entry_indeed#1#2#3% register data userdata +\protected\def\strc_registers_finish_entry_indeed#1#2#3% register data userdata {\begingroup - \edef\currentregister{#1}% - %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% todo: fast setter - \resetregisterparameter\c!entries - \resetregisterparameter\c!label - \resetregisterparameter\c!keys - \resetregisterparameter\c!alternative - \setupcurrentregister[#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 - \glet\currentregistercoding\s!xml - \else - \ifx\currentregisterexpansion\v!yes - \xdef\currentregisterentries{\registerparameter\c!entries}% - \else - \xdef\currentregisterentries{\detokenizedregisterparameter\c!entries}% - \fi - \glet\currentregistercoding\s!tex - \fi % I hate this kind of mess ... but it's a user request. - \ifempty\currentregisterentries - \normalexpanded{\ctxcommand{extendregister("\currentregister","\currentregisterlabel", { - metadata = { - \ifx\currentregisterownnumber\v!yes - own = "\registerparameter\c!alternative", % can be used instead of pagenumber + \strc_registers_register_prepare_entry{#1}{#2}% + \glet\currentregistername\currentregister + \clf_extendregister { % 'own' should not be in metadata + metadata {% + name {\currentregister}% + coding {\currentregistercoding}% + \ifx\currentregisterownnumber\v!yes + own {\registerparameter\c!alternative}% can be used instead of pagenumber + \fi + \ifx\currentreferencecoding\s!xml + xmlroot {\xmldocument} % only useful when text + \fi + \ifempty\currentregisterxmlsetup \else + xmlsetup {\currentregisterxmlsetup}% + \fi + }% + references {% + \ifempty\currentregisterlabel \else + label {\currentregisterlabel}% + \fi + % view {\interactionparameter\c!focus}% + }% + entries {% + % we need a special one for xml, this is just a single one + \ifempty\currentregisterentries + entries { + {\currentregisterentriesa}% + {\currentregisterentriesb}% + {\currentregisterentriesc}% + } + \else + entry {\currentregisterentries}% \fi - }, - userdata = \!!bs\detokenize{#3}\!!es - })% - }}% - \else - \normalexpanded{\ctxcommand{extendregister("\currentregister","\currentregisterlabel", { - metadata = { - % catcodes = \the\catcodetable, - coding = "\currentregistercoding", - \ifx\currentregisterownnumber\v!yes - own = "\registerparameter\c!alternative", % can be used instead of pagenumber + \ifempty\currentregisterkeys + keys { + {\currentregisterkeysa}% + {\currentregisterkeysb}% + {\currentregisterkeysc}% + } + \else + key {\currentregisterkeys}% \fi - }, - entries = { - % we need a special one for xml, this is just a single one - \!!bs\currentregisterentries\!!es, - \!!bs\currentregisterkeys\!!es - }, - userdata = \!!bs\detokenize{#3}\!!es - }) - }}% - \fi + \ifempty\currentregisterprocessors + processors { + {\currentregisterprocessorsa}% + {\currentregisterprocessorsb}% + {\currentregisterprocessorsc}% + } + \else + processor {\currentregisterprocessors}% + \fi + }% + userdata {\detokenize\expandafter{\normalexpanded{#3}}} + }% + \relax \endgroup} % The following variants are meant for (for instance xml). There is some @@ -558,10 +564,10 @@ % some overlap with previous -\permanent\tolerant\protected\def\setstructurepageregister[#1]#*[#2]#*[#3]% [register][settings][userdata] +\permanent\tolerant\protected\def\setstructurepageregister[#1]#*[#2]#*[#S#3]% [register][settings][userdata] {\doflushatpar{\strc_registers_register_page_entry{#1}{#2}{#3}}} -\permanent\tolerant\protected\def\startstructurepageregister[#1]#*[#2]#*[#3]#*[#4]% [register][tag][settings][userdata] +\permanent\tolerant\protected\def\startstructurepageregister[#1]#*[#2]#*[#S#3]#*[#S#4]% [register][tag][settings][userdata] {\doflushatpar{\strc_registers_register_page_entry{#1}{\c!label=#2,#3}{#4}}} \permanent\tolerant\protected\def\stopstructurepageregister[#1]#*[#2]% @@ -577,7 +583,7 @@ \def\strc_registers_insert_see_indeed#1#2#3#4% register key entry seeword {\begingroup - \edef\currentregister{#1}% + \cdef\currentregister{#1}% \edef\currentregisterexpansion{\registerparameter\c!expansion}% \ifx\currentregisterexpansion\s!xml \xmlstartraw @@ -632,10 +638,10 @@ % \mutable\let\listlength\!!zerocount % also in strc-lst -\permanent\tolerant\protected\def\determineregistercharacteristics[#1]#*[#2]% +\permanent\tolerant\protected\def\determineregistercharacteristics[#1]#*[#S#2]% {\begingroup \setupregister[#1][#2]% - \edef\currentregister{\firstinset{#1}}% + \cdef\currentregister{\firstinset{#1}}% \normalexpanded{\endgroup\noexpand\xdef\noexpand\listlength{\clf_analyzeregister {\currentregister}% {% @@ -662,13 +668,13 @@ \newconditional\c_strc_registers_text_interaction \newconditional\c_strc_registers_page_done -\permanent\tolerant\protected\def\placeregister[#1]#*[#2]% +\permanent\tolerant\protected\def\placeregister[#1]#*[#S#2]% {\ifarguments\else \begingroup %\forgetall \setupregister[#1][#2]% can be a list - \edef\currentregister{\firstinset{#1}}% - \the\everyplaceregister + \cdef\currentregister{\firstinset{#1}}% + \expand\everyplaceregister \ifnum\namedmixedcolumnsparameter\currentregister\c!n>\plusone \startmixedcolumns[\currentregister]% \strc_registers_place_indeed{#1}% @@ -680,8 +686,11 @@ \fi} \def\strc_registers_place_indeed#1% - {\doifelse{\registerparameter\c!interaction}\v!text - \settrue\setfalse\c_strc_registers_text_interaction + {\ifcstok{\registerparameter\c!interaction}\v!text + \c_strc_registers_text_interaction\conditionaltrue + \else + \c_strc_registers_text_interaction\conditionalfalse + \fi \clf_processregister {#1}% {% @@ -728,10 +737,10 @@ \fi \to \everyplaceregister -\permanent\tolerant\protected\def\completeregister[#1]#*[#2]% +\permanent\tolerant\protected\def\completeregister[#1]#*[#S#2]% {\ifarguments\or \begingroup - \edef\currentregister{\firstinset{#1}}% + \cdef\currentregister{\firstinset{#1}}% \normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\currentregister}},reference=\currentregister]}% \placeregister[#1][#2]% \page[\v!yes]% @@ -822,13 +831,10 @@ % skip \orelse\ifx\currentregistercharacter\s!unknown % skip + \orelse\ifcstok{\registerparameter\c!indicator}\v!yes + \strc_registers_place_character_yes \else - \edef\p_indicator{\registerparameter\c!indicator}% - \ifx\p_indicator\v!yes - \strc_registers_place_character_yes - \else - \strc_registers_place_character_nop - \fi + \strc_registers_place_character_nop \fi} \def\strc_registers_place_character_yes @@ -950,7 +956,7 @@ % \dostarttagged\t!registerentries\empty % % \let\savedcurrentregister\currentregister % \pushmacro\currentregister -% \edef\currentregister{\currentregister:\number\c_strc_register_level}% +% \cdef\currentregister{\currentregister:\the\c_strc_register_level}% % \usenestedregisterstyleandcolor\c!textstyle\c!textcolor % \ifnum\c_strc_register_level>\plusone % \advanceby\leftskip\d_strc_registers_distance\relax @@ -991,8 +997,11 @@ %D \stoptyping \appendtoks - \doifelse{\registerparameter\c!textalternative}\v!horizontal - \setfalse\settrue\c_strc_registers_vertical + \ifcstok{\registerparameter\c!textalternative}\v!horizontal + \c_strc_registers_vertical\conditionalfalse + \else + \c_strc_registers_vertical\conditionaltrue + \fi \to \everysetupregister \mutable\lettonothing\currentnestedregister @@ -1015,7 +1024,7 @@ \c_strc_register_level\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax \dostarttagged\t!registerentries\empty \pushmacro\currentregister % bah - \edef\currentregister{\currentregister:\number\c_strc_register_level}% + \cdef\currentregister{\currentregister:\the\c_strc_register_level}% \let\currentnestedregister\currentregister \usenestedregisterstyleandcolor\c!textstyle\c!textcolor \ifnum\c_strc_register_level>\plusone @@ -1033,21 +1042,6 @@ \dostoptagged \endgroup} -% \permanent\protected\def\startregisterentry#1% todo: level -% {\typo_injectors_check_register -% \begingroup -% \dostarttagged\t!registerentry\empty -% \global\setconstant\c_strc_registers_page_state\zerocount -% \hangindent\d_strc_registers_hangindent -% \hangafter \c_strc_registers_hangafter -% \typo_injectors_mark_register} -% -% \permanent\protected\def\stopregisterentry -% {\endgraf -% \global\setconstant\c_strc_registers_page_state\zerocount -% \dostoptagged -% \endgroup} - \permanent\protected\def\startregisterentry#1% todo: level {\typo_injectors_check_register \begingroup @@ -1117,14 +1111,6 @@ \permanent\protected\def\registeronepagerangeseparator {|\endash|} % todo use \prewordbreak -% \protected\def\withregisterpagecommand#1#2#3#4% -% {\def\currentregisterpageindex{#2}% -% \iflocation -% \goto{\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}}[internal(#2)]% -% \else -% \applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}% -% \fi} - \let\currentregisterrealpage\!!zerocount % todo: more general accessor % keep as reference @@ -1174,7 +1160,7 @@ \permanent\protected\def\pushcurrentregister#1% {\let\m_current_register\currentregister - \edef\currentregister{#1}} + \cdef\currentregister{#1}} \permanent\protected\def\popcurrentregister {\let\currentregister\m_current_register} @@ -1182,8 +1168,7 @@ \permanent\protected\def\registeronepage#1#2#3#4#5% #1:class #2:processor content {\pushcurrentregister{#1}% \strc_registers_update_page_properties - \edef\p_pagenumber{\registerparameter\c!pagenumber}% - \ifx\p_pagenumber\v!no\else + \ifcstok{\registerparameter\c!pagenumber}\v!no\else \registerpageseparator \global\setconstant\c_strc_registers_page_state\plusone \dostarttagged\t!registerpage\empty @@ -1197,18 +1182,17 @@ \appendtoks \edef\p_compress{\registerparameter\c!compress}% \ifx\p_compress\v!text - \settrue\c_strc_registers_following + \c_strc_registers_following\conditionaltrue \letregisterparameter\c!compress\v!yes \else - \setfalse\c_strc_registers_following + \c_strc_registers_following\conditionalfalse \fi \to \everyplaceregister \permanent\protected\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class #2:processor content, content todo: -- configurable {\pushcurrentregister{#1}% \strc_registers_update_page_properties - \edef\p_pagenumber{\registerparameter\c!pagenumber}% - \ifx\p_pagenumber\v!no\else + \ifcstok{\registerparameter\c!pagenumber}\v!no\else \registerpageseparator \global\setconstant\c_strc_registers_page_state\plusone \dostarttagged\t!registerpagerange\empty @@ -1268,30 +1252,6 @@ \applyprocessor{#1}{#2}% \fi} -% \permanent\protected\def\defaultregisterseeword#1#2#3#4#5#6#7% class i n #3:processor #4:internal #5:seeindex #6:word -% {\pushcurrentregister{#1}% -% \ifnum#2=\plusone -% \registerpageseparator -% \fi -% \global\setconstant\c_strc_registers_page_state\plustwo -% \def\currentregisterpageindex{#5}% -% \dostarttagged\t!registersee\empty -% \settrue\c_strc_registers_page_done -% \iflocation -% \def\currentregisterseeindex{#6}% -% \else -% \lettonothing\currentregisterseeindex -% \fi -% \ifnum#2=\plusone -% \labeltexts\v!see{\doapplyregisterseecommand{#4}{#7}}% -% \orelse\ifnum#2=#3\relax -% \labeltexts\v!and{\doapplyregisterseecommand{#4}{#7}}% -% \else -% ,\space\doapplyregisterseecommand{#4}{#7}% -% \fi -% \dostoptagged -% \popcurrentregister} - \permanent\protected\def\defaultregisterseeword#1#2#3#4#5#6#7% class i n #3:processor #4:internal #5:seeindex #6:word {\pushcurrentregister{#1}% \ifnum#2=\plusone @@ -1301,7 +1261,7 @@ \def\currentregisterpageindex{#5}% \def\currentregisterseeindex{#6}% \dostarttagged\t!registersee\empty - \settrue\c_strc_registers_page_done + \c_strc_registers_page_done\conditionaltrue \ifchknum\currentregisterseeindex\or \lettonothing\currentregisterpageprefix \else @@ -1344,7 +1304,7 @@ \global\setconstant\c_strc_registers_page_state\plustwo \def\currentregisterpageindex{#5}% \dostarttagged\t!registersection\empty - \settrue\c_strc_registers_page_done + \c_strc_registers_page_done\conditionaltrue \iflocation \def\currentregistersectionindex{#6}% \else @@ -1437,9 +1397,11 @@ \enforced\frozen\def\registerpagerange{\registerpagebuttonsymbol\gobbleeightarguments}} \protected\def\strc_registers_set_page_rendering - {\doifelse{\registerparameter\c!pagenumber}\v!no - {\enforced\frozen\let \currentregisterpagesymbol\v!none} - {\enforced\frozen\edef\currentregisterpagesymbol{\registerparameter\c!symbol}}% + {\ifcstok{\registerparameter\c!pagenumber}\v!no + \enforced\frozen\let\currentregisterpagesymbol\v!none + \else + \enforced\frozen\edef\currentregisterpagesymbol{\registerparameter\c!symbol}% + \fi \ifempty\currentregisterpagesymbol \csname\??registersymbol n\endcsname \orelse\ifcsname\??registersymbol\currentregisterpagesymbol\endcsname @@ -1548,7 +1510,7 @@ % % \fi}% % % \def\injectregistervalues#1#2% -% {\iftok{\registerparameter{#1:\the\numexpr#2}}\emptytoks\else +% {\ifempty{\registerparameter{#1:\the\numexpr#2}}\else % \expandafter{\lastnamedcs}% % \injectregistervalues#1{#2+1}% % \fi}% @@ -1598,7 +1560,7 @@ % % \def\strc_registers_register_page_entry_indeed#1#2#3% register data userdata % {\begingroup -% \edef\currentregister{#1}% +% \cdef\currentregister{#1}% % %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% % \setupcurrentregister[#2]% % \edef\currentregisterlabel {\registerparameter\c!label}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl index b78155d21b9..bb6b92df38e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl @@ -39,25 +39,25 @@ \edef\p_strc_rendering_interlinespace{\headparameter\c!interlinespace}% \ifempty\p_strc_rendering_interlinespace % here the interline space is only set when style sets no space - \setfalse\fontattributeisset % use the currentfontparameter state instead - \setfalse\interlinespaceisset + \fontattributeisset\conditionalfalse % use the currentfontparameter state instead + \interlinespaceisset\conditionalfalse \useheadstyleandcolor\c!style\c!color\relax \ifconditional\fontattributeisset \ifconditional\interlinespaceisset \else \setupinterlinespace \fi \fi - \setfalse\fontattributeisset + \fontattributeisset\conditionalfalse \useheadstyleandcolor#1#2\relax \ifconditional\fontattributeisset \ifconditional\interlinespaceisset \else \setupinterlinespace \fi \fi \else % here the set interline space overloads any other set space in the style - \setfalse\fontattributeisset + \fontattributeisset\conditionalfalse \useheadstyleandcolor\c!style\c!color\relax \ifconditional\fontattributeisset \dosetupcheckedinterlinespace\p_strc_rendering_interlinespace \fi - \setfalse\fontattributeisset + \fontattributeisset\conditionalfalse \useheadstyleandcolor#1#2\relax \ifconditional\fontattributeisset \dosetupcheckedinterlinespace\p_strc_rendering_interlinespace @@ -66,12 +66,12 @@ \protected\def\strc_rendering_initialize_style_and_color_inline#1#2% {\dontconvertfont - \setfalse\fontattributeisset + \fontattributeisset\conditionalfalse \useheadstyleandcolor\c!style\c!color\relax \ifconditional\fontattributeisset \updateraggedskips % \setupspacing \fi - \setfalse\fontattributeisset + \fontattributeisset\conditionalfalse \useheadstyleandcolor#1#2\relax \ifconditional\fontattributeisset \updateraggedskips % \setupspacing @@ -134,9 +134,11 @@ \protected\def\strc_rendering_place_head_number_and_text {\strc_rendering_start_placement \setheadmarking - \doifelsetext\getheadnumber + \iftext\getheadnumber \strc_sectioning_set_head_number_content + \else \strc_sectioning_reset_head_number_content + \fi \ifconditional\c_strc_sectioning_empty \setbox\b_strc_rendering_head\hpack \headreferenceattributes to \zeropoint{\strut}% \else % = needed @@ -214,7 +216,7 @@ \else \strc_rendering_initialize_hsize_global \fi - \setfalse\inhibitmargindata % brrrr is set in forgetall + \inhibitmargindata\conditionalfalse % brrrr is set in forgetall \dontcomplain \postponenotes \strc_rendering_initialize_interaction @@ -487,14 +489,14 @@ \let\currentheadrenderingalternative\v!vertical \fi \ifx\currentheadrenderingalternative\v!horizontal - \global\setfalse\headisdisplay % global - \global\setfalse\headissomewhere % global + \global\headisdisplay\conditionalfalse % global + \global\headissomewhere\conditionalfalse % global \orelse\ifx\currentheadrenderingalternative\v!somewhere - \global\setfalse\headisdisplay % global - \global\settrue \headissomewhere % global + \global\headisdisplay\conditionalfalse % global + \global\headissomewhere\conditionaltrue % global \else - \global\settrue \headisdisplay % global - \global\setfalse\headissomewhere % global + \global\headisdisplay\conditionaltrue % global + \global\headissomewhere\conditionalfalse % global \fi} \protected\def\strc_rendering_initialize_dimensions @@ -660,12 +662,7 @@ \dontleavehmode % in case there is no strut, else side effects with llap \begstrut % use one \strut here! \ifconditional\headshownumber - \doifelsesomething {\headparameter\c!location} { - % kind of new - \margindata [\headparameter\c!location] { - \headnumbercontent - } - } { + \ifempty {\headparameter\c!location} % normal backward compatible variant \llap { \signalrightpage @@ -680,7 +677,12 @@ \hskip\dimexpr\d_strc_rendering_local_leftoffset+\scratchdistance\relax } } - } + \else + % kind of new + \margindata [\headparameter\c!location] { + \headnumbercontent + } + \fi \else \fakeheadnumbercontent % will also be done in the other ones (force consistency with numbered) \fi @@ -708,7 +710,7 @@ \headsetupspacing \noindent \begstrut - \setfalse\headisdisplay % so a kind of mix + \headisdisplay\conditionalfalse % so a kind of mix \headtextcontent \ifconditional\headshownumber \kern\headnumberdistance diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl index ade59da0b60..f307fcc53bb 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl @@ -40,10 +40,11 @@ \let\strc_sectionblock_define_normal\definesectionblock -\permanent\overloaded\tolerant\protected\def\definesectionblock[#1]#*[#2]#*[#3]% singular plural settings +\permanent\overloaded\tolerant\protected\def\definesectionblock[#1]#*[#2]#*[#S#3]% singular plural settings {\strc_sectionblock_define_normal[#1][#3]% %\expandafter\newif\csname if#2\endcsname % obsolete \strc_sectionblock_set_environment{#1}\empty + \definemode[*#1]% \frozen\protected\defcsname\e!start#2\endcsname{\startsectionblock[#1]}% \frozen\protected\defcsname\e!stop #2\endcsname{\stopsectionblock}} @@ -72,8 +73,8 @@ \resetallstructuremarks \to \everyaftersectionblock -\permanent\tolerant\protected\def\setsectionblock[#1]#*[#2]% used to set the default - {\edef\currentsectionblock{#1}% from now on we assume a value +\permanent\tolerant\protected\def\setsectionblock[#1]#*[#S#2]% used to set the default + {\cdef\currentsectionblock{#1}% from now on we assume a value \setupcurrentsectionblock[#2]% \clf_setsectionblock{#1} bookmark {\sectionblockparameter\c!bookmark}% @@ -81,22 +82,22 @@ \mutable\lettonothing\currentsectionblock % was \s!unknown -\permanent\tolerant\protected\def\startsectionblock[#1]#*[#2]% +\permanent\tolerant\protected\def\startsectionblock[#1]#*[#S#2]% {%\ctxlua{structures.counters.check(0)}% we assume sane usage of \page, as this is the only workable place (in push) \begingroup - \edef\currentsectionblock{#1}% from now on we assume a value + \cdef\currentsectionblock{#1}% from now on we assume a value \setupcurrentsectionblock[#2]% \clf_pushsectionblock{#1} bookmark {\sectionblockparameter\c!bookmark}% \relax %\csname #1true\endcsname % obsolete \setsystemmode\currentsectionblock - \the\everybeforesectionblock\relax + \expand\everybeforesectionblock\relax \showmessage\m!structures1\currentsectionblock} \permanent\protected\def\stopsectionblock {\showmessage\m!structures2\currentsectionblock - \the\everyaftersectionblock\relax + \expand\everyaftersectionblock\relax \clf_popsectionblock \endgroup} diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl index db100f0dde3..c3c70e64717 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl @@ -225,6 +225,12 @@ titledata { label {\detokenize\expandafter{\currentstructurelabel}} title {\detokenize\expandafter{\currentstructuretitle}} +% alternative 1: +% label {\detokened\currentstructurelabel} +% title {\detokened\currentstructuretitle} +% alternative 2, detokened scanner: +% label \currentstructurelabel +% title \currentstructuretitle \ifx\currentstructurebookmark\currentstructuretitle \else bookmark {\detokenize\expandafter{\currentstructurebookmark}} \fi @@ -448,13 +454,13 @@ {\normalexpanded{\definelist[\currenthead][\currentheadparent][\c!prefix=\v!no]}}% \fi \presetlabeltext[\currenthead=]% - \the\everysetuphead + \expand\everysetuphead \to \everydefinehead \newtoks\everyredefinehead \appendtoks - \the\everyredefinehead + \expand\everyredefinehead \to \everydefinehead \appendtoks @@ -490,19 +496,21 @@ % compatible but better \appendtoks - \ifempty\currenthead \else - \doifelse{\headparameter\c!ownnumber}\v!yes - {\instance\protected\edefcsname\currenthead\endcsname{\strc_sectioning_handle_own[\currenthead]}} - {\instance\protected\edefcsname\currenthead\endcsname{\strc_sectioning_handle_nop[\currenthead]}}% + \ifempty\currenthead + % top level + \orelse\ifcstok{\headparameter\c!ownnumber}\v!yes + \instance\protected\edefcsname\currenthead\endcsname{\strc_sectioning_handle_own[\currenthead]} + \else + \instance\protected\edefcsname\currenthead\endcsname{\strc_sectioning_handle_nop[\currenthead]}% \fi \to \everysetuphead \permanent\protected\def\doredefinehead#1#2% called at lua end {\push_macro_currenthead \push_macro_currentheadparent - \edef\currenthead{#1}% + \cdef\currenthead{#1}% \edef\currentheadparent{#2}% - \the\everyredefinehead\relax + \expand\everyredefinehead\relax \pop_macro_currentheadparent \pop_macro_currenthead} @@ -562,13 +570,13 @@ \permanent\protected\def\definesection[#1]% {\ifcsname\??headlevel#1\endcsname \else - \edef\currenthead{#1}% + \cdef\currenthead{#1}% \let\currentsection\currenthead % just an alias \global\advanceby\maxstructuredepth\plusone \edefcsname\??headlevel#1\endcsname{\the\maxstructuredepth}% \setstructurelevel{#1}{\sectionlevel{#1}}% \normalexpanded{\setheadparameter{\s!parent}{\??head\lastsectionname}}% TO BE CHECKED, WE HAVE A HELPER - \the\everydefinesection + \expand\everydefinesection % so far for these default inheritances \definemarking[#1]% \ifnum\maxstructuredepth>\plusone @@ -580,12 +588,12 @@ \fi \fi} -\permanent\tolerant\protected\def\setupsection[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setupsection[#1]#*[#S#2]#*[#S#3]% {\ifparameter#1\else \push_macro_currenthead - \edef\currenthead{\ifcsname\??headlevel#1\endcsname#1\else\sectionheadsection{#1}\fi}% + \cdef\currenthead{\ifcsname\??headlevel#1\endcsname#1\else\sectionheadsection{#1}\fi}% \ifparameter#3\or - \edef\currenthead{\currenthead#2}% not used at any more in mkiv (sets now) + \cdef\currenthead{\currenthead#2}% not used at any more in mkiv (sets now) \setupcurrenthead[#3]% \else \setupcurrenthead[#2]% @@ -624,12 +632,12 @@ \newtoks\everyafterhead % hook, todo: before/after keys \permanent\tolerant\protected\def\strc_sectioning_handle_own[#1]#*[#2]#:#*#=#*#=% [ref] {nr} {title} - {\settrue\currentstructureown + {\currentstructureown\conditionaltrue \triggerautostructurelevel \strc_sectioning_handle{#1}{\c!reference={#2},\c!ownnumber={#3},\c!title={#4}}{}} % name ref nr title -- \permanent\tolerant\protected\def\strc_sectioning_handle_nop[#1]#*[#2]% [ref] {title} / for taco: [key=value] variant - {\setfalse\currentstructureown + {\currentstructureown\conditionalfalse \triggerautostructurelevel \ifhastok={#2}% \expandafter\strc_sectioning_handle_nop_indeed_yes @@ -644,16 +652,16 @@ \def\strc_sectioning_handle_nop_indeed_nop#1#2#3% {\strc_sectioning_handle{#1}{\c!reference={#2},\c!title={#3}}{}} % name ref nr title -- -\permanent\tolerant\protected\def\strc_sectioning_start[#1]#*[#2]#*[#3]% for the moment no grouping, too annoying with page breaks +\permanent\tolerant\protected\def\strc_sectioning_start[#1]#*[#S#2]#*[#S#3]% for the moment no grouping, too annoying with page breaks {\push_macro_currentnamedsection \push_macro_currentstructurereferenceprefix \edef\currentnamedsection{#1}% - \setfalse\currentstructureown + \currentstructureown\conditionalfalse %\globalpushmacro\currenthead % this does not work out well \xdef\currenthead{#1}% \setsystemmode\currenthead % new, also here now \headparameter\c!beforesection % beware, no users vars set yet - \the\everybeforehead + \expand\everybeforehead \strc_sectioning_handle{#1}{#2}{#3}% name -- -- -- userdata (we might move the tagged to here) % potential: \bgroup (can be optional: grouped = yes) \headparameter\c!insidesection} @@ -665,7 +673,7 @@ %\globalpopmacro\currenthead % so we do a hard recover \xdef\currenthead{#1}% recover \headparameter\c!aftersection - \the\everyafterhead + \expand\everyafterhead \resetsystemmode\currenthead \pop_macro_currentstructurereferenceprefix \pop_macro_currentnamedsection} % new, also here now @@ -694,58 +702,58 @@ \newconditional\headisdisplay % public \newconditional\headissomewhere % public -\defcsname\??headincrement\v!yes \endcsname{\settrue \c_strc_sectioning_increment\settrue \c_strc_sectioning_to_list} -\defcsname\??headincrement\v!no \endcsname{\setfalse\c_strc_sectioning_increment\setfalse\c_strc_sectioning_to_list} -\defcsname\??headincrement\v!list \endcsname{\setfalse\c_strc_sectioning_increment\settrue \c_strc_sectioning_to_list} -\defcsname\??headincrement\s!empty\endcsname{\settrue \c_strc_sectioning_increment\settrue \c_strc_sectioning_to_list} +\defcsname\??headincrement\v!yes \endcsname{\c_strc_sectioning_increment\conditionaltrue\c_strc_sectioning_to_list\conditionaltrue} +\defcsname\??headincrement\v!no \endcsname{\c_strc_sectioning_increment\conditionalfalse\c_strc_sectioning_to_list\conditionalfalse} +\defcsname\??headincrement\v!list \endcsname{\c_strc_sectioning_increment\conditionalfalse\c_strc_sectioning_to_list\conditionaltrue} +\defcsname\??headincrement\s!empty\endcsname{\c_strc_sectioning_increment\conditionaltrue\c_strc_sectioning_to_list\conditionaltrue} \protected\def\strc_sectioning_initialize_increment {\edef\currentheadincrement{\headparameter\c!incrementnumber}% \ifcsname\??headincrement\currentheadincrement\endcsname \lastnamedcs \else - \settrue\c_strc_sectioning_increment - \settrue\c_strc_sectioning_to_list + \c_strc_sectioning_increment\conditionaltrue + \c_strc_sectioning_to_list\conditionaltrue % \filterheadnumber \fi} \permanent\protected\def\filterheadnumber - {\settrue\c_strc_sectioning_increment - \settrue\c_strc_sectioning_to_list + {\c_strc_sectioning_increment\conditionaltrue + \c_strc_sectioning_to_list\conditionaltrue \ifempty\currentproduct % todo : filter from other toc (number, file, title) % use : \currentheadincrement as spec \fi} \defcsname\??headplace\v!yes\endcsname - {\setfalse\c_strc_sectioning_empty - \settrue \c_strc_sectioning_place - \setfalse\c_strc_sectioning_hidden - \setfalse\c_strc_sectioning_section} + {\c_strc_sectioning_empty\conditionalfalse + \c_strc_sectioning_place\conditionaltrue + \c_strc_sectioning_hidden\conditionalfalse + \c_strc_sectioning_section\conditionalfalse} \defcsname\??headplace\v!empty\endcsname - {\settrue \c_strc_sectioning_empty - \settrue \c_strc_sectioning_place - \setfalse\c_strc_sectioning_hidden - \setfalse\c_strc_sectioning_section} + {\c_strc_sectioning_empty\conditionaltrue + \c_strc_sectioning_place\conditionaltrue + \c_strc_sectioning_hidden\conditionalfalse + \c_strc_sectioning_section\conditionalfalse} \defcsname\??headplace\v!no\endcsname - {\settrue \c_strc_sectioning_empty - \setfalse\c_strc_sectioning_place - \setfalse\c_strc_sectioning_hidden - \setfalse\c_strc_sectioning_section} + {\c_strc_sectioning_empty\conditionaltrue + \c_strc_sectioning_place\conditionalfalse + \c_strc_sectioning_hidden\conditionalfalse + \c_strc_sectioning_section\conditionalfalse} \defcsname\??headplace\v!hidden\endcsname - {\settrue \c_strc_sectioning_empty - \setfalse\c_strc_sectioning_place - \settrue \c_strc_sectioning_hidden - \setfalse\c_strc_sectioning_section} + {\c_strc_sectioning_empty\conditionaltrue + \c_strc_sectioning_place\conditionalfalse + \c_strc_sectioning_hidden\conditionaltrue + \c_strc_sectioning_section\conditionalfalse} \defcsname\??headplace\v!section\endcsname - {\settrue \c_strc_sectioning_empty - \setfalse\c_strc_sectioning_place - \settrue \c_strc_sectioning_hidden - \settrue \c_strc_sectioning_section} + {\c_strc_sectioning_empty\conditionaltrue + \c_strc_sectioning_place\conditionalfalse + \c_strc_sectioning_hidden\conditionaltrue + \c_strc_sectioning_section\conditionaltrue} \protected\def\strc_sectioning_initialize_placement {\expandnamespaceparameter\??headplace\headparameter\c!placehead\v!yes} @@ -754,23 +762,21 @@ \def\strc_sectioning_set_head_number_content % was: \dosetstructureheadnumbercontent {\setsystemmode\v!sectionnumber - \settrue\headshownumber} % why ? + \headshownumber\conditionaltrue} % why ? \def\strc_sectioning_reset_head_number_content % was: \doresetstructureheadnumbercontent {\resetsystemmode\v!sectionnumber - \setfalse\headshownumber} % why ? + \headshownumber\conditionalfalse} % why ? \protected\def\strc_sectioning_initialize_number - {\edef\p_number{\sectionblockparameter\c!number}% - \ifx\p_number\v!yes - \edef\p_number{\headparameter\c!number}% - \ifx\p_number\v!yes - \settrue\headshownumber + {\ifcstok{\sectionblockparameter\c!number}\v!yes + \ifcstok{\headparameter\c!number}\v!yes + \headshownumber\conditionaltrue \else - \setfalse\headshownumber + \headshownumber\conditionalfalse \fi \else - \setfalse\headshownumber + \headshownumber\conditionalfalse \fi} % Beware, we do need some node for anchoring marks and normally a zwnj will @@ -788,7 +794,7 @@ \permanent\protected\def\theheadsynchronization % public {% no, interferes: \signalcharacter - \the\everyheadsynchronization + \expand\everyheadsynchronization % new, this might move to a better place, e.g. first in the box \currentstructureextradata \lettonothing\currentstructureextradata @@ -860,8 +866,8 @@ {\dontleavehmode \begingroup \enforced\permanent\protected\def\\{\space}% messy here, but the default (and needs to be grouped) - \global\settrue\headisdisplay % triggers interlinespace checking - \edef\currenthead{#1}% maybe only when #1 is given + \global\headisdisplay\conditionaltrue % triggers interlinespace checking + \cdef\currenthead{#1}% maybe only when #1 is given \strc_rendering_initialize_style_and_color\c!textstyle\c!textcolor \relax \getspecificstructuretitle{\thenamedheadlevel{#1}}% @@ -871,8 +877,8 @@ \permanent\tolerant\protected\def\placeheadnumber[#1]% {\dontleavehmode \begingroup - \global\settrue\headisdisplay % triggers interlinespace checking - \edef\currenthead{#1}% maybe only when #1 is given + \global\headisdisplay\conditionaltrue % triggers interlinespace checking + \cdef\currenthead{#1}% maybe only when #1 is given \strc_rendering_initialize_style_and_color\c!numberstyle\c!numbercolor \relax \getfullstructurenumber{\thenamedheadlevel{#1}}% @@ -901,7 +907,7 @@ \strc_sectioning_initialize_placement \strc_sectioning_initialize_number % - \the\everybeforesectionheadhandle + \expand\everybeforesectionheadhandle % % todo: also mark (for header) % @@ -988,9 +994,9 @@ \fi \fi % - \the\everyaftersectionheadhandle + \expand\everyaftersectionheadhandle % - \setfalse\c_strc_sectioning_ignore_page + \c_strc_sectioning_ignore_page\conditionalfalse % ignorespaces prevents spaces creeping in when after=\dontleavehmode \dostarttagged\t!sectioncontent\empty \unless\ifempty\currentstructureplaceholder @@ -1091,7 +1097,7 @@ \permanent\protected\def\repeathead[#1]% {\begingroup \setupinteraction[\c!state=\v!stop]% - \def\currenthead{#1} + \cdef\currenthead{#1} \strc_sectioning_initialize_placement \strc_sectioning_initialize_number \dostarttagged\t!sectioncaption\empty @@ -1157,7 +1163,7 @@ \fi} \newinteger \c_strc_sectioning_preceding_level \c_strc_sectioning_preceding_level\plusone -\newconditional\c_strc_sectioning_auto_break \settrue\c_strc_sectioning_auto_break +\newconditional\c_strc_sectioning_auto_break \c_strc_sectioning_auto_break\conditionaltrue \newconditional\c_strc_sectioning_ignore_page \newboundary \c_strc_sectioning_boundary @@ -1199,19 +1205,19 @@ \ifnum\lastboundary=\c_strc_sectioning_boundary % no page break \ifconditional\c_strc_sectioning_ignore_page - \setfalse\c_strc_sectioning_ignore_page + \c_strc_sectioning_ignore_page\conditionalfalse \else \global\c_strc_sectioning_preceding_level\currentheadlevel \nobreak \fi - % \global\settrue\c_strc_rendering_continuous + % \global\c_strc_rendering_continuous\conditionaltrue \else \penalty\scratchcounter - % \global\setfalse\c_strc_rendering_continuous + % \global\c_strc_rendering_continuous\conditionalfalse #1% \fi \else - % \global\setfalse\c_strc_rendering_continuous + % \global\c_strc_rendering_continuous\conditionalfalse #1% \fi} @@ -1225,16 +1231,13 @@ \mutable\lettonothing\previoushead \def\strc_sectioning_handle_page_nop - {\edef\p_continue{\headparameter\c!continue}% - \ifx\p_continue\v!yes - \ifx\currenthead\previoushead % not really needed - \strc_sectioning_check_layout - \orelse\ifnum\previoussectioncountervalue=\zerocount - \strc_sectioning_check_layout - \orelse\ifnum\currentsectioncountervalue>\zerocount - \strc_sectioning_check_layout - \fi - \else + {\unless\ifcstok{\headparameter\c!continue}\v!yes + \strc_sectioning_check_layout + \orelse\ifx\currenthead\previoushead % not really needed + \strc_sectioning_check_layout + \orelse\ifnum\previoussectioncountervalue=\zerocount + \strc_sectioning_check_layout + \orelse\ifnum\currentsectioncountervalue>\zerocount \strc_sectioning_check_layout \fi \glet\previoushead\currenthead} @@ -1242,23 +1245,22 @@ \def\strc_sectioning_handle_page_yes {\ifconditional\c_strc_sectioning_ignore_page - \setfalse\c_strc_sectioning_ignore_page + \c_strc_sectioning_ignore_page\conditionalfalse \else % beware, these numbers are not yet know here \strc_sectioning_handle_page_nop - \edef\p_aligntitle{\headparameter\c!aligntitle}% - \ifx\p_aligntitle\v!float - \ifconditional\c_strc_sectioning_auto_break - \spac_vspacing_same_page\currentheadlevel\zerocount - \fi - \headparameter\c!before\relax - \indent % hm, not a clever one? + \ifcstok{\headparameter\c!aligntitle}\v!float + \ifconditional\c_strc_sectioning_auto_break + \spac_vspacing_same_page\currentheadlevel\zerocount + \fi + \headparameter\c!before\relax + \indent % hm, not a clever one? \else - \page_otr_command_flush_side_floats - \ifconditional\c_strc_sectioning_auto_break - \spac_vspacing_same_page\currentheadlevel\zerocount - \fi - \headparameter\c!before\relax + \page_otr_command_flush_side_floats + \ifconditional\c_strc_sectioning_auto_break + \spac_vspacing_same_page\currentheadlevel\zerocount + \fi + \headparameter\c!before\relax \fi \global\c_strc_sectioning_preceding_level\currentheadlevel \fi @@ -1266,8 +1268,7 @@ \def\strc_sectioning_depth_correction {\ifvmode - \edef\p_depthcorrection{\headparameter\c!depthcorrection}% - \ifx\p_depthcorrection\v!strut + \ifcstok{\headparameter\c!depthcorrection}\v!strut \prevdepth\strutdepth \fi \fi} @@ -1312,7 +1313,7 @@ \permanent\tolerant\protected\def\someheadnumber[#1]#*[#2]% {\dontleavehmode \begingroup - \edef\currenthead{#1}% + \cdef\currenthead{#1}% \getsomefullstructurenumber{\thenamedheadlevel{#1}}{#2}% \endgroup} @@ -1328,17 +1329,17 @@ \newconditional\c_strc_sectioning_auto_levels \appendtoks - \settrue\c_strc_sectioning_auto_levels + \c_strc_sectioning_auto_levels\conditionaltrue \to \everyenableelements \protected\def\strc_sectioning_initialize_autolevel {\ifconditional\c_strc_sectioning_auto_levels \clf_autonextstructurelevel\currentheadlevel\relax - \global\setfalse\c_strc_sectioning_auto_levels + \global\c_strc_sectioning_auto_levels\conditionalfalse \fi} \permanent\protected\def\triggerautostructurelevel - {\global\settrue\c_strc_sectioning_auto_levels} + {\global\c_strc_sectioning_auto_levels\conditionaltrue} \permanent\protected\def\finalizeautostructurelevels {\clf_autofinishstructurelevels} diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-syn.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-syn.lmt index 940b982a72e..070d9ca257f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-syn.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-syn.lmt @@ -32,9 +32,12 @@ synonyms.tobesaved = tobesaved local progressions = { } -- false=not_yet_shown true=shown -local variables = interfaces.variables -local v_all = variables.all -local v_current = variables.current +local c_realpageno = tex.iscount("realpageno") + +local texgetcount = tex.getcount + +local v_all = interfaces.variables.all +local v_current = interfaces.variables.current local function initializer() collected = synonyms.collected @@ -219,8 +222,7 @@ end local ctx_latelua = context.latelua local function enhance(data) - local page = tex.getcount("realpageno") - data.pages[page] = true + data.pages[texgetcount(c_realpageno)] = true end function synonyms.enhance(class,tag) diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl index 9b4d410e123..62470413842 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl @@ -61,7 +61,7 @@ %D %D \typebuffer \getbuffer %D -%D By default a synonym is just typeset and flagges as being used, so that in +%D By default a synonym is just typeset and flagged as being used, so that in %D a list it wil be shows with its meaning. You can however also expand the %D meaning automatically at first use: %D @@ -199,14 +199,16 @@ \s!language=\currentmainlanguage, ] +\newconditional\c_strc_constructions_define_commands + \appendtoks - \setfalse\c_strc_constructions_define_commands + \c_strc_constructions_define_commands\conditionalfalse \ifempty\currentsimplelistparent \defineconstruction[\currentsimplelist][\s!handler=\v!simplelist,\c!level=1]% \else \defineconstruction[\currentsimplelist][\currentsimplelistparent][\s!handler=\v!simplelist,\c!level=1]% \fi - \settrue\c_strc_constructions_define_commands + \c_strc_constructions_define_commands\conditionaltrue \to \everydefinesimplelist \protected\defcsname\??constructioninitializer\v!simplelist\endcsname @@ -224,7 +226,7 @@ \protected\defcsname\??constructiontexthandler\v!simplelist\endcsname {\begingroup \useconstructionstyleandcolor\c!headstyle\c!headcolor - \the\everyconstruction + \expand\everyconstruction \constructionparameter\c!headcommand {\strut \currentsimplelistentry}% @@ -278,17 +280,17 @@ \ifparameter#3\or \frozen\instance\protected\def#3##1{\strc_synonyms_insert_meaning{#1}{##1}}% \meaning \fi - \edef\currentsynonym{#1}% + \cdef\currentsynonym{#1}% % %\checksynonymparent %\setupcurrentsynonym[\s!single={#1},\s!multi={#2}]% - \setfalse\c_strc_constructions_define_commands + \c_strc_constructions_define_commands\conditionalfalse \definesimplelist [\currentsynonym]% [\v!sorting] [\s!single={#1},% \s!multi={#2}]% - \settrue\c_strc_constructions_define_commands + \c_strc_constructions_define_commands\conditionaltrue \ifparameter#2\or % \presetheadtext[#2=\Word{#2}]% changes the \if...argument @@ -305,7 +307,7 @@ \permanent\tolerant\protected\def\definesynonym[#1]#*[#2]#*[#3]#*[#4]% [yes][abbreviation][FOO]{foo}{foo me} {\begingroup \edef\currentsynonymoption{#1}% - \edef\currentsynonym{#2}% + \cdef\currentsynonym{#2}% \edef\currentsynonymtag{#3}% \edef\currentsynonymsortkey{#4}% \strc_synonyms_define_entry} @@ -317,7 +319,7 @@ % \permanent\tolerant\protected\def\setsynonym[#1]#*[#2]% % {\begingroup % \setupsynonymentry[#2]% -% \edef\currentsynonym {#1}% +% \cdef\currentsynonym {#1}% % \edef\currentsynonymoption {\synonymentryparameter\c!option}% % \edef\currentsynonymtag {\synonymentryparameter\c!tag}% % \edef\currentsynonymsortkey{\synonymentryparameter\c!sortkey}% @@ -376,7 +378,7 @@ \permanent\protected\def\registercurrentsynonympage % \registercurrentsortingpage {\ifcstok{\simplelistparameter\v!page}\v!yes - \clf_enhancesynonym\currentsimplelist\currentsortingtag + \clf_enhancesynonym\currentsimplelist\currentsynonymtag \fi} \aliased\let\rawsynonymname \clf_synonymname @@ -399,7 +401,7 @@ \protected\def\strc_synonyms_insert_meaning#1#2% name tag {\dontleavehmode % otherwise we don't get it right at the beginning of a par \begingroup - \def\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \def\currentsynonymtag{#2}% \fastsetup{\??simplelistrenderings::\v!text}% \endgroup} @@ -407,7 +409,7 @@ \protected\def\strc_synonyms_insert#1#2% name tag {\dontleavehmode % otherwise we don't get it right at the beginning of a par \begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \let\currentsynonym\currentsimplelist % for a while \def\currentsynonymtag{#2}% \edef\currentsimplelistalternative{\simplelistparameter\c!alternative}% @@ -480,9 +482,9 @@ \aliased\let\synonymentry\relax -\permanent\tolerant\protected\def\placelistofsynonyms[#1]#*[#2]% +\permanent\tolerant\protected\def\placelistofsynonyms[#1]#*[#S#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \doifelsecommandhandler\??simplelist\currentsimplelist {\strc_constructions_initialize{#1}% \setupcurrentsimplelist[#2]% @@ -502,9 +504,9 @@ {}% todo: message that invalid \endgroup} -\permanent\tolerant\protected\def\completelistofsynonyms[#1]#*[#2]% +\permanent\tolerant\protected\def\completelistofsynonyms[#1]#*[#S#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \doifelsecommandhandler\??simplelist\currentsimplelist {\normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\simplelistparameter\s!multi}},\c!reference=#1]}% \placelistofsynonyms[#1][#2]% @@ -561,14 +563,14 @@ \else \frozen\instance\protected\defcsname#1\endcsname{\definesort[\v!yes][#1]}% \fi - \edef\currentsorting{#1}% - \setfalse\c_strc_constructions_define_commands + \cdef\currentsorting{#1}% + \c_strc_constructions_define_commands\conditionalfalse \definesimplelist [\currentsorting]% [\v!sorting] [\s!single={#1},% \s!multi={#2}]% - \settrue\c_strc_constructions_define_commands + \c_strc_constructions_define_commands\conditionaltrue \ifparameter#2\or % \presetheadtext[#2=\Word{#2}]% changes the \if...argument @@ -586,12 +588,12 @@ \permanent\tolerant\protected\def\definesort[#1]#*[#2]#*[#3]% {\begingroup \edef\currentsortingoption{#1}% - \edef\currentsorting{#2}% + \cdef\currentsorting{#2}% \edef\currentsortingtag{#3}% \strc_sorting_define_entry} \def\strc_sorting_define_entry#1% - {\let\currentsimplelist\currentsimplelist + {%\let\currentsimplelist\currentsimplelist \ifempty\currentsortingtag \edef\currentsortingtag{#1}% \fi @@ -644,7 +646,7 @@ {\dontleavehmode % otherwise we don't get it right at the beginning of a par \begingroup % no kap currently, of .. we need to map cap onto WORD - \edef\currentsorting{#1}% + \cdef\currentsorting{#1}% \edef\currentsortingtag{#2}% \let\currentsimplelist\currentsorting \edef\currentsimplelistalternative{\simplelistparameter\c!alternative}% @@ -684,9 +686,9 @@ % % maybe just 'commandset' and then combine -\permanent\tolerant\protected\def\placelistofsorts[#1]#*[#2]% +\permanent\tolerant\protected\def\placelistofsorts[#1]#*[#S#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \strc_constructions_initialize{#1}% \setupcurrentsimplelist[#2]% \edef\p_simplelist_command{\simplelistparameter\c!command}% @@ -708,9 +710,9 @@ \simplelistparameter\c!after}% \endgroup} -\permanent\tolerant\protected\def\completelistofsorts[#1]#*[#2]% +\permanent\tolerant\protected\def\completelistofsorts[#1]#*[#S#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\simplelistparameter\s!multi}},\c!reference=#1]}% \placelistofsorts[#1][#2]% \page diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt index ec6455cc645..e3b0b1429f9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt @@ -27,9 +27,9 @@ local attributes = attributes local structures = structures local implement = interfaces.implement -local a_tagged = attributes.private('tagged') +local a_tagged = attributes.private('tagged') +local unsetvalue = attributes.unsetvalue -local unsetvalue = attributes.unsetvalue local codeinjections = backends.codeinjections local texgetattribute = tex.getattribute @@ -71,167 +71,185 @@ tagpatterns.splitter = p_splitter local properties = allocate { -- todo: more "record = true" to improve formatting - document = { pdf = "Div", nature = "display" }, - - division = { pdf = "Div", nature = "display" }, - paragraph = { pdf = "P", nature = "mixed" }, - p = { pdf = "P", nature = "mixed" }, - construct = { pdf = "Span", nature = "inline" }, - highlight = { pdf = "Span", nature = "inline" }, - - section = { pdf = "Sect", nature = "display" }, - sectioncaption = { pdf = "Div", nature = "display", record = true }, - sectiontitle = { pdf = "H", nature = "mixed" }, - sectionnumber = { pdf = "H", nature = "mixed" }, - sectioncontent = { pdf = "Div", nature = "display" }, - - itemgroup = { pdf = "L", nature = "display" }, - item = { pdf = "LI", nature = "display" }, - itemtag = { pdf = "Lbl", nature = "mixed" }, - itemcontent = { pdf = "LBody", nature = "mixed" }, - itemhead = { pdf = "Div", nature = "display" }, - itembody = { pdf = "Div", nature = "display" }, - - description = { pdf = "Div", nature = "display" }, - descriptiontag = { pdf = "Div", nature = "mixed" }, - descriptioncontent = { pdf = "Div", nature = "mixed" }, - descriptionsymbol = { pdf = "Span", nature = "inline" }, -- note reference - - verbatimblock = { pdf = "Code", nature = "display" }, - verbatimlines = { pdf = "Code", nature = "display" }, - verbatimline = { pdf = "Code", nature = "mixed" }, - verbatim = { pdf = "Code", nature = "inline" }, - - lines = { pdf = "Code", nature = "display" }, - line = { pdf = "Code", nature = "mixed" }, - linenumber = { pdf = "Span", nature = "inline" }, - - synonym = { pdf = "Span", nature = "inline" }, - sorting = { pdf = "Span", nature = "inline" }, - - register = { pdf = "Div", nature = "display" }, - registerlocation = { pdf = "Span", nature = "inline" }, - registersection = { pdf = "Div", nature = "display" }, - registertag = { pdf = "Span", nature = "mixed" }, - registerentries = { pdf = "Div", nature = "display" }, - registerentry = { pdf = "Div", nature = "display" }, - registercontent = { pdf = "Span", nature = "mixed" }, - registersee = { pdf = "Span", nature = "mixed" }, - registerpages = { pdf = "Span", nature = "mixed" }, - registerpage = { pdf = "Span", nature = "mixed" }, - registerseparator = { pdf = "Span", nature = "inline" }, - registerpagerange = { pdf = "Span", nature = "mixed" }, - - table = { pdf = "Table", nature = "display" }, - tablerow = { pdf = "TR", nature = "display" }, - tablecell = { pdf = "TD", nature = "mixed" }, - tableheadcell = { pdf = "TH", nature = "mixed" }, - tablehead = { pdf = "THEAD", nature = "display" }, - tablebody = { pdf = "TBODY", nature = "display" }, - tablefoot = { pdf = "TFOOT", nature = "display" }, - - tabulate = { pdf = "Table", nature = "display" }, - tabulaterow = { pdf = "TR", nature = "display" }, - tabulatecell = { pdf = "TD", nature = "mixed" }, - tabulateheadcell = { pdf = "TH", nature = "mixed" }, - tabulatehead = { pdf = "THEAD", nature = "display" }, - tabulatebody = { pdf = "TBODY", nature = "display" }, - tabulatefoot = { pdf = "TFOOT", nature = "display" }, - - list = { pdf = "TOC", nature = "display" }, - listitem = { pdf = "TOCI", nature = "display" }, - listtag = { pdf = "Lbl", nature = "mixed" }, - listcontent = { pdf = "P", nature = "mixed" }, - listdata = { pdf = "P", nature = "mixed" }, - listpage = { pdf = "Reference", nature = "mixed" }, - listtext = { pdf = "Span", nature = "inline" }, - - delimitedblock = { pdf = "BlockQuote", nature = "display" }, - delimited = { pdf = "Quote", nature = "inline" }, - delimitedcontent = { pdf = "Span", nature = "inline" }, - delimitedsymbol = { pdf = "Span", nature = "inline" }, - subsentence = { pdf = "Span", nature = "inline" }, - subsentencecontent = { pdf = "Span", nature = "inline" }, - subsentencesymbol = { pdf = "Span", nature = "inline" }, - - label = { pdf = "Span", nature = "mixed" }, - number = { pdf = "Span", nature = "mixed" }, - - float = { pdf = "Div", nature = "display" }, -- Figure - floatcaption = { pdf = "Caption", nature = "mixed" }, - floatlabel = { pdf = "Span", nature = "inline" }, - floatnumber = { pdf = "Span", nature = "inline" }, - floattext = { pdf = "Span", nature = "mixed" }, - floatcontent = { pdf = "P", nature = "mixed" }, - - image = { pdf = "P", nature = "mixed" }, - mpgraphic = { pdf = "P", nature = "mixed" }, - - formulaset = { pdf = "Div", nature = "display" }, - formula = { pdf = "Div", nature = "display" }, -- Formula - formulacaption = { pdf = "Span", nature = "mixed" }, - formulalabel = { pdf = "Span", nature = "mixed" }, - formulanumber = { pdf = "Span", nature = "mixed" }, - formulacontent = { pdf = "P", nature = "display" }, - subformula = { pdf = "Div", nature = "display" }, - - link = { pdf = "Link", nature = "inline" }, - reference = { pdf = "Span", nature = "inline" }, - - margintextblock = { pdf = "Span", nature = "inline" }, - margintext = { pdf = "Span", nature = "inline" }, - marginanchor = { pdf = "Span", nature = "inline" }, - - math = { pdf = "Div", nature = "inline", namespace = "mathml" }, -- no display - mn = { pdf = "Span", nature = "mixed", namespace = "mathml" }, - mi = { pdf = "Span", nature = "mixed", namespace = "mathml" }, - mo = { pdf = "Span", nature = "mixed", namespace = "mathml" }, - ms = { pdf = "Span", nature = "mixed", namespace = "mathml" }, - mrow = { pdf = "Span", nature = "display", namespace = "mathml" }, - msubsup = { pdf = "Span", nature = "display", namespace = "mathml" }, - msub = { pdf = "Span", nature = "display", namespace = "mathml" }, - msup = { pdf = "Span", nature = "display", namespace = "mathml" }, - merror = { pdf = "Span", nature = "mixed", namespace = "mathml" }, - munderover = { pdf = "Span", nature = "display", namespace = "mathml" }, - munder = { pdf = "Span", nature = "display", namespace = "mathml" }, - mover = { pdf = "Span", nature = "display", namespace = "mathml" }, - mtext = { pdf = "Span", nature = "mixed", namespace = "mathml" }, - mfrac = { pdf = "Span", nature = "display", namespace = "mathml" }, - mroot = { pdf = "Span", nature = "display", namespace = "mathml" }, - msqrt = { pdf = "Span", nature = "display", namespace = "mathml" }, - mfenced = { pdf = "Span", nature = "display", namespace = "mathml" }, - maction = { pdf = "Span", nature = "display", namespace = "mathml" }, - - mstacker = { pdf = "Span", nature = "display" }, -- these are only internally used - mstackertop = { pdf = "Span", nature = "display" }, -- these are only internally used - mstackerbot = { pdf = "Span", nature = "display" }, -- these are only internally used - mstackermid = { pdf = "Span", nature = "display" }, -- these are only internally used - - mtable = { pdf = "Table", nature = "display", namespace = "mathml" }, -- might change - mtr = { pdf = "TR", nature = "display", namespace = "mathml" }, -- might change - mtd = { pdf = "TD", nature = "display", namespace = "mathml" }, -- might change - - ignore = { pdf = "Span", nature = "mixed" }, -- used internally - private = { pdf = "Span", nature = "mixed" }, -- for users (like LS) when they need it - metadata = { pdf = "Div", nature = "display" }, - metavariable = { pdf = "Span", nature = "mixed" }, - - mid = { pdf = "Span", nature = "inline" }, - sub = { pdf = "Span", nature = "inline" }, - sup = { pdf = "Span", nature = "inline" }, - subsup = { pdf = "Span", nature = "inline" }, - - combination = { pdf = "Span", nature = "display" }, - combinationpair = { pdf = "Span", nature = "display" }, - combinationcontent = { pdf = "Span", nature = "mixed" }, - combinationcaption = { pdf = "Span", nature = "mixed" }, - - publications = { pdf = "Div", nature = "display" }, - publication = { pdf = "Div", nature = "mixed" }, - pubfld = { pdf = "Span", nature = "inline" }, - - block = { pdf = "Div", nature = "display" }, - userdata = { pdf = "Div", nature = "display" }, + document = { pdf = "Div", nature = "display" }, + + division = { pdf = "Div", nature = "display" }, + paragraph = { pdf = "P", nature = "mixed" }, + p = { pdf = "P", nature = "mixed" }, + construct = { pdf = "Span", nature = "inline" }, + highlight = { pdf = "Span", nature = "inline" }, + + section = { pdf = "Sect", nature = "display" }, + sectioncaption = { pdf = "Div", nature = "display", record = true }, + sectiontitle = { pdf = "H", nature = "mixed" }, + sectionnumber = { pdf = "H", nature = "mixed" }, + sectioncontent = { pdf = "Div", nature = "display" }, + + itemgroup = { pdf = "L", nature = "display" }, + item = { pdf = "LI", nature = "display" }, + itemtag = { pdf = "Lbl", nature = "mixed" }, + itemcontent = { pdf = "LBody", nature = "mixed" }, + itemhead = { pdf = "Div", nature = "display" }, + itembody = { pdf = "Div", nature = "display" }, + + description = { pdf = "Div", nature = "display" }, + descriptiontag = { pdf = "Div", nature = "mixed" }, + descriptioncontent = { pdf = "Div", nature = "mixed" }, + descriptionsymbol = { pdf = "Span", nature = "inline" }, -- note reference + + verbatimblock = { pdf = "Code", nature = "display" }, + verbatimlines = { pdf = "Code", nature = "display" }, + verbatimline = { pdf = "Code", nature = "mixed" }, + verbatim = { pdf = "Code", nature = "inline" }, + + lines = { pdf = "Code", nature = "display" }, + line = { pdf = "Code", nature = "mixed" }, + linenumber = { pdf = "Span", nature = "inline" }, + + synonym = { pdf = "Span", nature = "inline" }, + sorting = { pdf = "Span", nature = "inline" }, + + register = { pdf = "Div", nature = "display" }, + registerlocation = { pdf = "Span", nature = "inline" }, + registersection = { pdf = "Div", nature = "display" }, + registertag = { pdf = "Span", nature = "mixed" }, + registerentries = { pdf = "Div", nature = "display" }, + registerentry = { pdf = "Div", nature = "display" }, + registercontent = { pdf = "Span", nature = "mixed" }, + registersee = { pdf = "Span", nature = "mixed" }, + registerpages = { pdf = "Span", nature = "mixed" }, + registerpage = { pdf = "Span", nature = "mixed" }, + registerseparator = { pdf = "Span", nature = "inline" }, + registerpagerange = { pdf = "Span", nature = "mixed" }, + + table = { pdf = "Table", nature = "display" }, + tablerow = { pdf = "TR", nature = "display" }, + tablecell = { pdf = "TD", nature = "mixed" }, + tableheadcell = { pdf = "TH", nature = "mixed" }, + tablehead = { pdf = "THEAD", nature = "display" }, + tablebody = { pdf = "TBODY", nature = "display" }, + tablefoot = { pdf = "TFOOT", nature = "display" }, + + tabulate = { pdf = "Table", nature = "display" }, + tabulaterow = { pdf = "TR", nature = "display" }, + tabulatecell = { pdf = "TD", nature = "mixed" }, + tabulateheadcell = { pdf = "TH", nature = "mixed" }, + tabulatehead = { pdf = "THEAD", nature = "display" }, + tabulatebody = { pdf = "TBODY", nature = "display" }, + tabulatefoot = { pdf = "TFOOT", nature = "display" }, + + list = { pdf = "TOC", nature = "display" }, + listitem = { pdf = "TOCI", nature = "display" }, + listtag = { pdf = "Lbl", nature = "mixed" }, + listcontent = { pdf = "P", nature = "mixed" }, + listdata = { pdf = "P", nature = "mixed" }, + listpage = { pdf = "Reference", nature = "mixed" }, + listtext = { pdf = "Span", nature = "inline" }, + + delimitedblock = { pdf = "BlockQuote", nature = "display" }, + delimited = { pdf = "Quote", nature = "inline" }, + delimitedcontent = { pdf = "Span", nature = "inline" }, + delimitedsymbol = { pdf = "Span", nature = "inline" }, + subsentence = { pdf = "Span", nature = "inline" }, + subsentencecontent = { pdf = "Span", nature = "inline" }, + subsentencesymbol = { pdf = "Span", nature = "inline" }, + + label = { pdf = "Span", nature = "mixed" }, + number = { pdf = "Span", nature = "mixed" }, + + float = { pdf = "Div", nature = "display" }, -- Figure + floatcaption = { pdf = "Caption", nature = "mixed" }, + floatlabel = { pdf = "Span", nature = "inline" }, + floatnumber = { pdf = "Span", nature = "inline" }, + floattext = { pdf = "Span", nature = "mixed" }, + floatcontent = { pdf = "P", nature = "mixed" }, + + image = { pdf = "P", nature = "mixed" }, + mpgraphic = { pdf = "P", nature = "mixed" }, + + formulaset = { pdf = "Div", nature = "display" }, + formula = { pdf = "Div", nature = "display" }, -- Formula + formulacaption = { pdf = "Span", nature = "mixed" }, + formulalabel = { pdf = "Span", nature = "mixed" }, + formulanumber = { pdf = "Span", nature = "mixed" }, + formulacontent = { pdf = "P", nature = "display" }, + subformula = { pdf = "Div", nature = "display" }, + + link = { pdf = "Link", nature = "inline" }, + reference = { pdf = "Span", nature = "inline" }, + + margintextblock = { pdf = "Span", nature = "inline" }, + margintext = { pdf = "Span", nature = "inline" }, + marginanchor = { pdf = "Span", nature = "inline" }, + + -- math = { pdf = "Div", nature = "inline", namespace = "mathml" }, -- no display + -- math = { pdf = "Formula", nature = "inline", namespace = "mathml" }, -- no display + math = { pdf = "Div", nature = "inline", namespace = "mathml" }, -- no display + -- math = { pdf = "Span", nature = "inline", namespace = "mathml" }, -- no display + inlinemath = { pdf = "Span", nature = "inline", namespace = "mathml" }, -- maybe + displaymath = { pdf = "Div", nature = "display", namespace = "mathml" }, -- maybe + mn = { pdf = "Span", nature = "mixed", namespace = "mathml" }, + mi = { pdf = "Span", nature = "mixed", namespace = "mathml" }, + mo = { pdf = "Span", nature = "mixed", namespace = "mathml" }, + ms = { pdf = "Span", nature = "mixed", namespace = "mathml" }, + mrow = { pdf = "Span", nature = "display", namespace = "mathml" }, + msubsup = { pdf = "Span", nature = "display", namespace = "mathml" }, + msub = { pdf = "Span", nature = "display", namespace = "mathml" }, + msup = { pdf = "Span", nature = "display", namespace = "mathml" }, + merror = { pdf = "Span", nature = "mixed", namespace = "mathml" }, + munderover = { pdf = "Span", nature = "display", namespace = "mathml" }, + munder = { pdf = "Span", nature = "display", namespace = "mathml" }, + mover = { pdf = "Span", nature = "display", namespace = "mathml" }, + mtext = { pdf = "Span", nature = "mixed", namespace = "mathml" }, + mfrac = { pdf = "Span", nature = "display", namespace = "mathml" }, + mroot = { pdf = "Span", nature = "display", namespace = "mathml" }, + msqrt = { pdf = "Span", nature = "display", namespace = "mathml" }, + mfenced = { pdf = "Span", nature = "display", namespace = "mathml" }, + maction = { pdf = "Span", nature = "display", namespace = "mathml" }, + mmultiscripts = { pdf = "Span", nature = "display", namespace = "mathml" }, + mprescripts = { pdf = "Span", nature = "mixed", namespace = "mathml" }, + + mstacker = { pdf = "Span", nature = "display" }, -- this one is only used internally + mstackertop = { pdf = "Span", nature = "display" }, -- idem + mstackerbot = { pdf = "Span", nature = "display" }, -- idem + mstackermid = { pdf = "Span", nature = "display" }, -- idem + mextensible = { pdf = "Span", nature = "display" }, -- idem + mfunction = { pdf = "Span", nature = "mixed" }, -- idem + mfunctionstack = { pdf = "Span", nature = "display" }, -- idem + mfraction = { pdf = "Span", nature = "display" }, -- idem + mfractionstack = { pdf = "Span", nature = "display" }, -- idem + munit = { pdf = "Span", nature = "mixed" }, + mdigits = { pdf = "Span", nature = "mixed" }, + mc = { pdf = "Span", nature = "mixed" }, + + mtable = { pdf = "Table", nature = "display", namespace = "mathml" }, -- might change + mtr = { pdf = "TR", nature = "display", namespace = "mathml" }, -- might change + mtd = { pdf = "TD", nature = "display", namespace = "mathml" }, -- might change + + ignore = { pdf = "Span", nature = "mixed" }, -- used internally + private = { pdf = "Span", nature = "mixed" }, -- for users (like LS) when they need it + metadata = { pdf = "Div", nature = "display" }, + metavariable = { pdf = "Span", nature = "mixed" }, + + mid = { pdf = "Span", nature = "inline" }, + sub = { pdf = "Span", nature = "inline" }, + sup = { pdf = "Span", nature = "inline" }, + subsup = { pdf = "Span", nature = "inline" }, + + combination = { pdf = "Span", nature = "display" }, + combinationpair = { pdf = "Span", nature = "display" }, + combinationcontent = { pdf = "Span", nature = "mixed" }, + combinationcaption = { pdf = "Span", nature = "mixed" }, + + publications = { pdf = "Div", nature = "display" }, + publication = { pdf = "Div", nature = "mixed" }, + pubfld = { pdf = "Span", nature = "inline" }, + + block = { pdf = "Div", nature = "display" }, + userdata = { pdf = "Div", nature = "display" }, + + quantity = { pdf = "Span", nature = "inline" }, + unit = { pdf = "Span", nature = "inline" }, } @@ -607,7 +625,7 @@ implement { name = "doifelseinelement", public = true, protected = true, - actions = { structures.atlocation, commands.testcase }, + actions = { structures.atlocation, commands.doifelse }, arguments = "argument", } @@ -618,3 +636,14 @@ implement { actions = tags.registermetadata, arguments = "optional", } + +implement { + name = "settagginglevel", + protected = true, + arguments = "argument", + actions = function(level) + if level == interfaces.variables.none then + codeinjections.reducetags() + end + end, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl index 3c00acb6506..7b33a66bf52 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl @@ -102,11 +102,23 @@ \definetagconstant{mtr} % TR \definetagconstant{mtd} % TD \definetagconstant{maction} % + \definetagconstant{mstacker} \definetagconstant{mstackertop} \definetagconstant{mstackermid} \definetagconstant{mstackerbot} +\definetagconstant{mextensible} + +\definetagconstant{mfunction} +\definetagconstant{mfunctionstack} + +\definetagconstant{mfraction} +\definetagconstant{mfractionstack} + +\definetagconstant{munit} +\definetagconstant{mdigits} + \aliastagconstant{mtablerow} {mtr} \aliastagconstant{mtablecell}{mtd} @@ -295,7 +307,7 @@ \protected\def\strc_tags_enable {% once enable one is toast - \global\settrue\c_strc_tags_enabled + \global\c_strc_tags_enabled\conditionaltrue % and gets: \strc_tags_enable_indeed} @@ -345,7 +357,11 @@ \appendtoks \strc_tags_enable_elements \strc_tags_enable_properties - \doifelse{\taggingparameter\c!method}\v!auto\strc_tags_enable\strc_tags_disable + \ifcstok{\taggingparameter\c!method}\v!auto + \strc_tags_enable + \else + \strc_tags_disable + \fi \to \everyenableelements \appendtoks @@ -355,7 +371,11 @@ \to \everydisableelements \appendtoks - \doifelse{\taggingparameter\c!state}\v!start{\the\everyenableelements}{\the\everydisableelements}% + \ifcstok{\taggingparameter\c!state}\v!start + \expand\everyenableelements + \else + \expand\everydisableelements + \fi \to \everysetuptagging \permanent\protected\def\forgettagging @@ -384,7 +404,7 @@ \ifdefined\dotagparagraph \else \aliased\let\dotagparagraph\gobbleoneargument \fi -\permanent\tolerant\protected\def\startparagraph[#1]#*[#2]% +\permanent\tolerant\protected\def\startparagraph[#S#1]#*[#S#2]% {\endgraf % we end before the group \begingroup \ifarguments @@ -394,10 +414,10 @@ \lettonothing\currentparagraph \setupcurrentparagraph[#1] \else - \edef\currentparagraph{#1}% + \cdef\currentparagraph{#1}% \fi \or - \edef\currentparagraph{#1}% + \cdef\currentparagraph{#1}% \setupcurrentparagraph[#2]% \fi \useparagraphstyleandcolor\c!style\c!color @@ -512,6 +532,12 @@ \popoverloadmode +%D For now: + +\appendtoks + \clf_settagginglevel{\taggingparameter\c!level}% +\to \everysetuptagging + % \permanent\def\untagged{attr \taggedattribute\attributeunsetvalue} \protect diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-tnt.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-tnt.mkxl index 4129117f06a..d7f5128ed9a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-tnt.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-tnt.mkxl @@ -56,10 +56,10 @@ \c!n=10] % * will use the real space \appendtoks - \frozen\instance\setuevalue{\currenttextnote}{\educ_textnote[\currenttextnote]}% + \frozen\instance\protected\edefcsname\currenttextnote\endcsname{\educ_textnote[\currenttextnote]}% \to \everydefinetextnote -\tolerant\protected\def\educ_textnote[#1]#*[#2]#:#3% +\tolerant\protected\def\educ_textnote[#1]#*[#S#2]#:#3% {\dontleavehmode \begingroup \def\currenttextnote{#1}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl index cd1f97dec0b..5e9670e0a41 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl @@ -101,24 +101,24 @@ \lettonothing\currentuserdata \doifelsenextoptionalcs\userdata_start_delayed\userdata_start_indeed} -\def\userdata_start_delayed[#1]% +\def\userdata_start_delayed[#S#1]% {\doifelseassignmentcs{#1}% \userdata_start_delayed_parameters \userdata_start_delayed_name [#1]} -\def\userdata_start_delayed_parameters[#1]% +\def\userdata_start_delayed_parameters[#S#1]% {\setupcurrentuserdata[#1]% \userdata_start_indeed} \def\userdata_start_delayed_name[#1]% - {\edef\currentuserdata{#1}% + {\cdef\currentuserdata{#1}% \checkuserdataparent \doifelsenextoptionalcs\userdata_start_delayed_parameters\userdata_start_indeed} -\protected\tolerant\def\userdata_start_instance#1#*[#2]% +\protected\tolerant\def\userdata_start_instance#1#*[#S#2]% {\begingroup - \edef\currentuserdata{#1}% + \cdef\currentuserdata{#1}% \setupcurrentuserdata[#2]% \grabbufferdatadirect % {\s!userdata:\currentuserdata}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt b/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt index a26f77ae20e..3586de72a7e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt @@ -19,21 +19,24 @@ local nodes = nodes local implement = interfaces.implement +local ctx_doifelse = commands.doifelse + local nodecodes = nodes.nodecodes -local disc_code = nodecodes.disc -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local glue_code = nodecodes.glue -local penalty_code = nodecodes.penalty -local glyph_code = nodecodes.glyph -local par_code = nodecodes.par +local disc_code = nodecodes.disc +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local glue_code = nodecodes.glue +local penalty_code = nodecodes.penalty +local glyph_code = nodecodes.glyph +local par_code = nodecodes.par -local indent_code = nodes.listcodes.indent -local topskip_code = nodes.gluecodes.topskip -local line_code = nodes.listcodes.line +local indentlist_code = nodes.listcodes.indent +local topskip_code = nodes.gluecodes.topskip +local indentskip_code = nodes.gluecodes.indentskip +local line_code = nodes.listcodes.line -local hmode_code = tex.modelevels.horizontal +local hmode_code = tex.modelevels.horizontal local nuts = nodes.nuts local tonut = nuts.tonut @@ -80,7 +83,7 @@ local getdimensions = nuts.dimensions local hpack = nuts.hpack local vpack = nuts.vpack local traverseid = nuts.traverseid -local traverse = nuts.traverse +----- traverse = nuts.traverse local free = nuts.free local findtail = nuts.tail local reverse = nuts.reverse @@ -90,6 +93,9 @@ local nextdisc = nuts.traversers.disc local nextdir = nuts.traversers.dir local nexthlist = nuts.traversers.hlist +local countnodes = nuts.count +----- traverselist = nuts.traverselist + local listtoutf = nodes.listtoutf local nodepool = nuts.pool @@ -105,13 +111,19 @@ local texisdimen = tex.isdimen local texsetdimen = tex.setdimen local texgetnest = tex.getnest -local d_lastnaturalboxwd = texisdimen("lastnaturalboxwd") -local d_lastnaturalboxht = texisdimen("lastnaturalboxht") -local d_lastnaturalboxdp = texisdimen("lastnaturalboxdp") +local values = tokens.values +local dimension_value = values.dimension +local cardinal_value = values.cardinal +local direct_value = values.direct +local conditional_value = values.conditional + +local d_lastnaturalboxwd = texisdimen("lastnaturalboxwd") +local d_lastnaturalboxht = texisdimen("lastnaturalboxht") +local d_lastnaturalboxdp = texisdimen("lastnaturalboxdp") -local d_givenwidth = texisdimen("givenwidth") -local d_givenheight = texisdimen("givenheight") -local d_givendepth = texisdimen("givendepth") +local d_givenwidth = texisdimen("givenwidth") +local d_givenheight = texisdimen("givenheight") +local d_givendepth = texisdimen("givendepth") local function hyphenatedlist(head,usecolor) local current = head and tonut(head) @@ -329,7 +341,7 @@ end do - local a_vboxtohboxseparator = attributes.private("vboxtohboxseparator") + local a_vboxtohboxseparator = attributes.private("vboxtohboxseparator") implement { name = "vboxlisttohbox", @@ -399,7 +411,15 @@ implement { arguments = "integer", public = true, actions = function(n) - context.verbatim(nodes.toutf(texgetbox(n).list)) -- helper is defined later + local b = texgetbox(n) + local l = b and b.list + if l then + -- helper is defined later + local s = nodes.toutf(l) + if s then + context.verbatim(s) + end + end end } @@ -407,9 +427,6 @@ do -- we can now move this to the tex end - local values = tokens.values - local dimension_value = values.dimension - local function getnaturaldimensions(n) local w = 0 local h = 0 @@ -477,13 +494,10 @@ do end -local doifelse = commands.doifelse - do - local directioncodes = tex.directioncodes - local lefttoright_code = directioncodes.lefttoright - local righttoleft_code = directioncodes.righttoleft + local lefttoright_code = tex.directioncodes.lefttoright + local righttoleft_code = tex.directioncodes.righttoleft local function firstdirinbox(n) local b = getbox(n) @@ -507,7 +521,7 @@ do name = "doifelserighttoleftinbox", arguments = "integer", actions = function(n) - doifelse(firstdirinbox(n) == righttoleft_code) + ctx_doifelse(firstdirinbox(n) == righttoleft_code) end } @@ -525,10 +539,6 @@ do local setbox = nuts.setbox local new_hlist = nuts.pool.hlist - local values = tokens.values - local dimension_value = values.dimension - local cardinal_value = values.cardinal - local boxes = { } nodes.boxes = boxes local cache = table.setmetatableindex("table") @@ -714,7 +724,7 @@ do public = true, protected = true, arguments = "2 strings", - actions = { boxes.found, doifelse }, + actions = { boxes.found, ctx_doifelse }, } implement { @@ -1027,22 +1037,21 @@ implement { -- only in lmtx: -implement { - name = "widthuptohere", - public = true, - usage = "value", - actions = function() - local n = texgetnest() - local w = 0 - if n.mode == hmode_code then - local h = hpack(getnext(tonut(n.head))) - w = getwidth(h) - setlist(h) - free(h) - end - return tokens.values.dimension, w - end, -} +do + + local naturalhsize = nuts.naturalhsize + + implement { + name = "widthuptohere", + public = true, + usage = "value", + actions = function() + local n = texgetnest() + return dimension_value, n.mode == hmode_code and naturalhsize(getnext(tonut(n.head))) or 0 + end, + } + +end implement { name = "doifelseindented", @@ -1058,18 +1067,25 @@ implement { n = getnext(n) if n then local id = getid(n) - if id == hlist_code then - if getsubtype(n) == indent_code then + if id == glue_code then + if getsubtype(n) == indentskip_code then b = getwidth(n) > 0 break end - elseif id ~= par_code then + elseif id == hlist_code then + if getsubtype(n) == indentlist_code then + b = getwidth(n) > 0 + end + break + elseif id == par_code then + -- okay + else break end end end end - commands.doifelse(b) + ctx_doifelse(b) end, } @@ -1084,14 +1100,21 @@ implement { if b then b = getlist(b) if b then - for n, id in traverse(b) do - if id == hlist_code or id == vlist_code then - c = c + 1 - end - end + -- for n, id in traverse(b) do -- traverse_list + -- if id == hlist_code or id == vlist_code then + -- c = c + 1 + -- end + -- end + -- + -- for n in traverselist(b) do + -- c = c + 1 + -- end + -- + c = countnodes(hlist_code,b) + countnodes(vlist_code,b) end end context(c) + -- return cardinal_value, c end, } @@ -1143,15 +1166,9 @@ do local setprop = nuts.setprop local getprop = nuts.getprop - local listcodes = nodes.listcodes - local line_code = listcodes.line - local equation_code = listcodes.equation - local unknown_code = listcodes.unknown - - local values = tokens.values - local dimension_value = values.dimension - local cardinal_value = values.cardinal - local direct_value = values.direct + local line_code = nodes.listcodes.line + local equation_code = nodes.listcodes.equation + local unknown_code = nodes.listcodes.unknown -- todo: make helper that formats @@ -1543,3 +1560,18 @@ do } end +do + + local ctx_validtext = context.core.validtext + + implement { + name = "iftext", + public = true, + usage = "condition", + actions = function() + ctx_validtext() + return conditional_value + end + } + +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl b/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl index 710a4892ed1..d8a28ab1dc2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl @@ -34,6 +34,12 @@ \newdimension\lastnaturalboxht \newdimension\lastnaturalboxdp +\pushoverloadmode + \newuserunit\strutht sh + \newuserunit\strutdp sd + \newuserunit\struthtdp st +\popoverloadmode + \registerctxluafile{supp-box}{autosuffix} % \fixupboxesmode\plusone % gone: is now the default @@ -204,7 +210,7 @@ \protected\def\syst_boxes_math_set_nextbox#1% {\setbox\nextbox\hbox\expandafter\bgroup - \expandafter\normalstartimath\expandafter\Ustyle\the\mathstackstyle + \expandafter\normalstartimath\expandafter\givenmathstyle\the\mathstackstyle \mathsurround\zeropoint{#1}% \normalstopimath \egroup} @@ -354,9 +360,9 @@ \box\scratchbox \endgroup} -%D We also define plain's \type {\mathstrut}. +%D We also define plain's \type {\mathstrut}. It will be replaced in \typ {math-ini}. -\permanent\protected\def\mathstrut{\Ustack{\vphantom(}} % can be made faster by inlining +\permanent\protected\def\mathstrut{\mathstack{\vphantom(}} % can be made faster by inlining %D \macros %D {getboxheight} @@ -531,6 +537,16 @@ %D \doiftext {data} {then branch} %D \stoptyping +% performance: +% +% \ifcondition\validtext {...}T\else F\fi 4.47 +% \doifelsetext {...}{T}{F} 4.91 +% \iftext {...}T\else F\fi 5.01 +% +% \ifcondition\validtext {}T\else F\fi 0.22 +% \doifelsetext {}{T}{F} 1.02 +% \iftext {}T\else F\fi 0.39 + \permanent\protected\def\doifelsetext#1% {\begingroup \setbox\scratchbox\hbox % no \hpack because we can have fallbacks @@ -553,9 +569,23 @@ \endgroup\expandafter\firstofoneargument \fi} -% more efficient but maybe fragile: -% -% \nospacing#1}% +\permanent\protected\def\validtext#1% + {\ifparameter#1\or + \begingroup + \setbox\scratchbox\hbox % no \hpack because we can have fallbacks + {\settrialtypesetting + \ignorespaces#1\removeunwantedspaces}% + \normalexpanded{\endgroup\noexpand\expandafter\ifzeropt\wd\scratchbox\if_false\else\if_true\fi}% + \else + \expandafter\if_false + \fi} + +% \iftext{xx} YES\else NOP\fi +% \iftext{} YES\else NOP\fi +% \iftext{\strut} YES\else NOP\fi +% \iftext{ } YES\else NOP\fi + +% more efficient but maybe fragile: \nospacing#1 \aliased\let\doiftextelse\doifelsetext @@ -714,8 +744,8 @@ % \def\syst_boxes_math_rlap{\mathpalette\syst_boxes_do_math_rlap} \def\syst_boxes_math_xlap#1#2% - {\normalexpanded{#1\bgroup\normalstartimath\Ustyle\the\mathstyle}% - %{\expandafter#1\expandafter\bgroup\expandafter\normalstartimath\expandafter\Ustyle\the\mathstyle + {\normalexpanded{#1\bgroup\normalstartimath\givenmathstyle\the\mathstyle}% + %{\expandafter#1\expandafter\bgroup\expandafter\normalstartimath\expandafter\givenmathstyle\the\mathstyle \mathsurround\zeropoint#2% \normalstopimath\egroup} @@ -860,8 +890,8 @@ \newbox \newshapebox \newbox \oldshapebox \newbox \tmpshapebox -\newinteger \shapecounter -\newevery \everyshapebox \relax +\newinteger \shapecounter +\newevery \everyshapebox \relax \permanent\dimensiondef\shapesignal.12345678pt % or 12345sp @@ -932,7 +962,7 @@ {\setbox\oldshapebox\vbox \bgroup \reshapingboxtrue - \the\everyshapebox + \expand\everyshapebox \insertshapesignal} \permanent\protected\def\endofshapebox @@ -1017,7 +1047,7 @@ %D depth of the line. \permanent\protected\def\shapedhbox % lines with non strutted dimensions have - {\expanded{\dowithnextbox % interlineskip so if we want the original + {\normalexpanded{\dowithnextbox % interlineskip so if we want the original {\ht\nextbox\the\ht\shapebox % spacing, we need to preserve the original \dp\nextbox\the\dp\shapebox % height and depth which is definitely \box\nextbox}} % needed if we apply struts to the 'new' @@ -1682,7 +1712,7 @@ \newdimension\vboxtohboxslack \newdimension\hboxestohboxslack -%D Create line and fake height of paragraph by messign with heights: a nice hack by +%D Create line and fake height of paragraph by messing with heights: a nice hack by %D DEK himself. %\protected\def\setvboxtohbox @@ -1780,7 +1810,10 @@ %D {unhhbox} %D %D The next macro is used in typesetting inline headings. Let's first look at the -%D macro and then show an example. +%D macro and then show an example. As many other helpers here, it is no longer +%D used in the core and dates from \MKII\ times, but we keep it here just in case +%D some use style uses it. Eventually we might moev this to a load|-|on|-|demand +%D module. \newbox \unhhedbox \newbox \hhbox @@ -1981,7 +2014,7 @@ \hpack to \scratchwidth{\hss\box\nextbox \hss}}} \permanent\protected\def\startoverlay - {\bgroup + {\vbox\bgroup % we remove unwanted spaces so we want to prevent the pre-overlay gobble \enforced\aliased\let\stopoverlay\egroup \processboxes\syst_boxes_overlay_process} @@ -2122,7 +2155,7 @@ \futurelet\nexttoken\dodocommand}% \def\dodocommand {\ifx\nexttoken\bgroup - \expanded{\egroup#1 to \the\sizeofbox}% + \normalexpanded{\egroup#1 to \the\sizeofbox}% \else \expandafter\afterassignment\expandafter\docommand\expandafter\scratchdimen \fi}% @@ -2446,18 +2479,18 @@ \protected\def\syst_boxes_stack_allocate {\newbox\b_syst_boxes_stack - \letcsname\??boxstack\number\c_syst_boxes_stack\endcsname\b_syst_boxes_stack} + \letcsname\??boxstack\the\c_syst_boxes_stack\endcsname\b_syst_boxes_stack} \protected\def\syst_boxes_push#1#2% {\global\advanceby\c_syst_boxes_stack\plusone - \expandafter\let\expandafter\b_syst_boxes_stack\csname\??boxstack\number\c_syst_boxes_stack\endcsname + \expandafter\let\expandafter\b_syst_boxes_stack\csname\??boxstack\the\c_syst_boxes_stack\endcsname \ifrelax\b_syst_boxes_stack % cheaper then csname check as in most cases it's defined \syst_boxes_stack_allocate \fi #1\setbox\b_syst_boxes_stack\box#2\relax} \protected\def\syst_boxes_pop#1#2% - {#1\setbox#2\box\csname\??boxstack\number\c_syst_boxes_stack\endcsname + {#1\setbox#2\box\csname\??boxstack\the\c_syst_boxes_stack\endcsname \global\advanceby\c_syst_boxes_stack\minusone} \permanent\protected\def\localpushbox {\syst_boxes_push\relax} @@ -2737,11 +2770,27 @@ \let\prerolltostring\firstofoneargument % we need to bypass initializations +% This fails on an empty document (probably some mode issue): + +% \appendtoks +% \permanent\def\prerolltostring +% {\beginlocalcontrol\begingroup +% \expand\everypreroll +% \dowithnextboxcs\syst_boxes_contenttostring\hbox} +% \to \everydump +% +% So we do this instead: + +\newbox\b_syst_boxes + \appendtoks - \permanent\def\prerolltostring - {\beginlocalcontrol\begingroup - \the\everypreroll - \dowithnextboxcs\syst_boxes_contenttostring\hbox} + \permanent\def\prerolltostring#1% + {\beginlocalcontrol + \setbox\b_syst_boxes\hbox{\expand\everypreroll#1}% + \normalexpanded + {\setbox\b_syst_boxes\emptybox + \endlocalcontrol + \boxtostring\b_syst_boxes}} \to \everydump % depricated: @@ -2945,8 +2994,158 @@ % \ifcstok{#2}\v!before\minusone\else\plusone\fi % \box\nextbox}} +%D \macros{doifelseindented} +%D +%D This test macro is defined at the \LUA\ end: +%D +%D \startbuffer +%D test \doifelseindented{yes}{nop} test\par +%D \setupindenting[3em] \indenting[yes] +%D test \doifelseindented{yes}{nop} test\par +%D \stopbuffer +%D +%D \typebuffer \blank \startpacked \getbuffer \stoppacked \blank + +% \definedasluacommand\noflinesinbox + +%D \macros{boxfixstretch} +%D +%D This is relative new one and a wrapper around \typ {\boxlimitate} but with a +%D criterium. +%D +%D \startbuffer +%D \setbox2\copy0 \boxfixstretch 20pt 2 \box2 +%D \setbox2\copy0 \boxfixstretch 30pt 2 \box2 +%D \setbox2\copy0 \boxfixstretch 40pt 2 \box2 +%D \setbox2\copy0 \boxfixstretch 0pt 2 \box2 % \boxlimitate 2 0pt +%D \setbox2\copy0 \boxfixstretch \maxdimen 2 \box2 +%D \stopbuffer +%D +%D \setbox0\ruledvbox to 2cm \bgroup +%D test\vskip10pt plus 10pt minus 5pt\relax test% +%D \egroup +%D +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection +%D +%D \setbox0\ruledhbox to 3cm \bgroup +%D test\hskip10pt plus 10pt minus 5pt\relax test% +%D \egroup \getbuffer +%D +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection + +\newconditional\boxstretchfixed +\newdimension \boxstretchdelta + +\permanent\protected\def\boxfixstretch + {\begingroup + \afterassignment\syst_boxes_fixstretch_a\scratchdimen} + +\permanent\protected\def\syst_boxes_fixstretch_a + {\afterassignment\syst_boxes_fixstretch_b\scratchcounter} + +\permanent\protected\def\syst_boxes_fixstretch_b + {\scratchdimenone \ifvbox\scratchcounter\ht\else\wd\fi\scratchcounter % current size + \scratchdimentwo \boxrepack\scratchcounter % natural + \scratchdimenthree\boxstretch\scratchcounter % stretch + \scratchdistance \dimexpr\scratchdimenone-\scratchdimentwo\relax + % if size - natural > stretch + \unless\ifdim\scratchdistance>\scratchdimenthree + % we don't stretch beyond what is acceptable + \global\boxstretchfixed\conditionalfalse + \global\boxstretchdelta\zeropoint + \orelse\ifdim\scratchdistance>\scratchdimen + % we are below the criterium + \boxlimitate\scratchcounter\zerocount + \global\boxstretchfixed\conditionaltrue + \global\boxstretchdelta\dimexpr\ifvbox\scratchcounter\ht\else\wd\fi\scratchcounter-\boxrepack\scratchcounter\relax + \else + % we are above the criterium + \global\boxstretchfixed\conditionalfalse + \global\boxstretchdelta\zeropoint + \fi +% \writestatus{PAGE}{stretch:#L +% size \the\scratchdimenone,#L +% natural \the\scratchdimentwo,#L +% stretch \the\scratchdimenthree,#L +% distance \the\scratchdistance,#L +% criterium \the\scratchdimen,#L +% fixed case +% \unless\ifdim\scratchdistance>\scratchdimenthree +% 1:false,#L +% \orelse\ifdim\scratchdistance<\scratchdimen +% 2:true,#L +% \else +% 4:false,#L +% \fi +% delta \the\boxstretchdelta +% }% + \endgroup} + \protect \endinput +% alternative + +% \newdimension\d_syst_boxes_target_size +% \newdimension\d_syst_boxes_natural_size +% \newdimension\d_syst_boxes_stretch +% \newdimension\d_syst_boxes_available +% \newdimension\d_syst_boxes_limit +% +% \permanent\protected\def\boxfixstretch +% {\begingroup +% \afterassignment\syst_boxes_fixstretch_a\d_syst_boxes_limit} +% +% \permanent\protected\def\syst_boxes_fixstretch_a +% {\afterassignment\Xsyst_boxes_fixstretch_b\scratchcounter} +% +% \permanent\protected\def\syst_boxes_fixstretch_b +% {\d_syst_boxes_target_size \ifvbox\scratchcounter\ht\else\wd\fi\scratchcounter % current size +% \d_syst_boxes_natural_size\boxrepack\scratchcounter % natural +% \d_syst_boxes_stretch \boxstretch\scratchcounter % stretch +% \d_syst_boxes_available \dimexpr\d_syst_boxes_target_size-\d_syst_boxes_natural_size\relax +% \ifdim\d_syst_boxes_available>\d_syst_boxes_stretch +% % we don't stretch beyond what is acceptable +% % \boxlimitate\scratchcounter\zerocount +% \boxfinalize\scratchcounter-1000 +% % \boxfreeze\scratchcounter1 +% \global\boxstretchfixed\conditionalfalse +% \global\boxstretchdelta\zeropoint +% \orelse\ifdim\d_syst_boxes_available>\d_syst_boxes_limit +% % we are below the criterium +% % \boxfinalize\scratchcounter1000 +% \boxfreeze\scratchcounter\zerocount +% % \boxfreeze\scratchcounter1 +% % \boxlimitate\scratchcounter\zerocount +% \global\boxstretchfixed\conditionaltrue +% \global\boxstretchdelta\dimexpr\ifvbox\scratchcounter\ht\else\wd\fi\scratchcounter-\boxrepack\scratchcounter\relax +% \else +% % we are above the criterium +% \global\boxstretchfixed\conditionalfalse +% \global\boxstretchdelta\zeropoint +% \fi +% % \writestatus{PAGE}{% +% % page \the\realpageno,#L +% % size \the\d_syst_boxes_target_size,#L +% % natural \the\d_syst_boxes_natural_size,#L +% % stretch \the\d_syst_boxes_stretch,#L +% % distance \the\d_syst_boxes_available,#L +% % criterium \the\d_syst_boxes_limit,#L +% % fixed case +% % \unless\ifdim\d_syst_boxes_available>\d_syst_boxes_stretch +% % 1:false,#L +% % \orelse\ifdim\d_syst_boxes_available>\d_syst_boxes_limit +% % 2:true,#L +% % \else +% % 4:false,#L +% % \fi +% % delta \the\boxstretchdelta +% % }% +% \endgroup} + % a bit of test code: % \hbox \bgroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-dir.mkxl b/Master/texmf-dist/tex/context/base/mkxl/supp-dir.mkxl index d2500d236b1..531486e85ec 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/supp-dir.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/supp-dir.mkxl @@ -32,9 +32,6 @@ \permanent\protected\edef\reversevpack {\vpack \??bdir\directionrighttoleft} \permanent\protected\edef\reversetpack {\tpack \??bdir\directionrighttoleft} -% \expanded{\defineactivecharacter \number"2000E} {\textdirection\directionrighttoleft\relax} -% \expanded{\defineactivecharacter \number"2000F} {\textdirection\directionlefttoright\relax} - \def\syst_direction_string#1{\ifcase#1=\plusone r2l\else l2r\fi} \permanent\protected\def\showdirsinmargin diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl index c3c69593aff..f507361dd6b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl @@ -60,9 +60,6 @@ % % \aliased\let\Ucheckedstopdisplaymath\relax -% \let\normalsuper\Usuperscript % obsolete -% \let\normalsuber\Usubscript % obsolete - \aliased\let\startimath\Ustartmath \aliased\let\stopimath \Ustopmath \aliased\let\startdmath\Ustartdisplaymath % \Ucheckedstartdisplaymath @@ -174,14 +171,4 @@ % \def\startdisplay{\displaybreak\ignorespaces\startpacked} % \def\stopdisplay {\stoppacked\displaybreak\ignorespaces} -\aliased\let\superscript \Usuperscript -\aliased\let\subscript \Usubscript -\aliased\let\primescript \Uprimescript -\aliased\let\nosuperscript \Unosuperscript -\aliased\let\nosubscript \Unosubscript -\aliased\let\superprescript \Usuperprescript -\aliased\let\subprescript \Usubprescript -\aliased\let\nosuperprescript\Unosuperprescript -\aliased\let\nosubsprecript \Unosubprescript - \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/symb-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/symb-ini.lmt index 9837afcf325..6e551c66b16 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/symb-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/symb-ini.lmt @@ -7,7 +7,6 @@ if not modules then modules = { } end modules ['symb-ini'] = { } local context = context -local variables = interfaces.variables fonts = fonts or { } -- brrrr @@ -20,6 +19,8 @@ local uselibrary = resolvers.uselibrary local report_symbols = logs.reporter ("fonts","symbols") local status_symbols = logs.messenger("fonts","symbols") +local v_reset = interfaces.variables.reset + local patterns = { "symb-imp-%s.mkxl", "symb-imp-%s.mkiv", @@ -39,7 +40,7 @@ local function failure(name) end function symbols.uselibrary(name) - if name ~= variables.reset then + if name ~= v_reset then for name in listitem(name) do uselibrary { name = name, diff --git a/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl index cf61ddb1f79..a5f9f4cdff2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl @@ -51,8 +51,11 @@ \installsetuphandler \??symbols {symbols} \appendtoks - \doifelse{\symbolsparameter\c!stylealternative}\v!math - \settrue\setfalse\prefermathovertextchar + \ifcstok{\symbolsparameter\c!stylealternative}\v!math + \prefermathovertextchar\conditionaltrue + \else + \prefermathovertextchar\conditionalfalse + \fi \to \everysetupsymbols \setupsymbols @@ -75,7 +78,7 @@ \permanent\tolerant\protected\def\definesymbol[#1]#*[#2]#*[#3]% {\ifparameter#3\or \defcsname\??symbol#1:#2\endcsname{#3}% - \doifsomething{#1}{\addvalue{\??symbolset#1}{#2}}% + \ifempty{#1}\else\addvalue{\??symbolset#1}{#2}\fi \else \defcsname\??symbol\m_symb_current_set:#1\endcsname{#2}% \addvalue{\??symbolset\m_symb_current_set}{#1}% @@ -130,16 +133,16 @@ \fi} \def\symb_place_normal - {\setfalse\c_symb_found - \the\t_symb_setups + {\c_symb_found\conditionalfalse + \expand\t_symb_setups \ifconditional\c_symb_found \else \symb_place_retry\currentsymbol % hm, isn't this redundant? \fi} \def\symb_place_indeed#1% \relax's prevent lookahead problems - {\settrue\c_symb_found + {\c_symb_found\conditionaltrue \begingroup - \the\everysymbol + \expand\everysymbol \csname\??symbol#1\endcsname\relax \endgroup} @@ -165,7 +168,7 @@ \def\symb_place_named#1% \relax's prevent lookahead problems {\begingroup \setbox\scratchbox\hbox\bgroup - \the\everysymbol + \expand\everysymbol \getglyphstyled {\csname\??symboldefault#1\endcsname}% {\tochar{n:\currentsymbol}}% @@ -175,15 +178,15 @@ \unhbox\scratchbox \endgroup \xdefcsname\??symbol#1:\currentsymbol\endcsname{\symb_place_named_indeed{#1}{\currentsymbol}}% - \settrue\c_symb_found + \c_symb_found\conditionaltrue \else \endgroup \fi} \protected\def\symb_place_named_indeed#1#2% \relax's prevent lookahead problems - {\settrue\c_symb_found + {\c_symb_found\conditionaltrue \begingroup - \the\everysymbol + \expand\everysymbol \getglyphstyled {\csname\??symboldefault#1\endcsname}% {\tochar{n:#2}}% @@ -212,10 +215,10 @@ \mutable\def\defaultsymbolfactor{10} \mutable\def\defaultsymbolheight{1.25ex} -\permanent\tolerant\protected\def\figuresymbol[#1]#,[#2]% +\permanent\tolerant\protected\def\figuresymbol[#1]#,[#S#2]% {\externalfigure[#1][\c!reset=\v!yes,\c!symbol=\v!yes,\c!height=\defaultsymbolheight,#2]} -\permanent\tolerant\protected\def\definefiguresymbol[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\definefiguresymbol[#1]#*[#2]#*[#S#3]% {\ifarguments\or\else \definesymbol[#1][{\figuresymbol[#2][#3]}]% \fi} @@ -233,17 +236,17 @@ \fi} \def\symb_fetch_first_indeed#1% - {\doifinsymbolset{#1}\currentsymbol{\settrue\c_symb_found}} + {\doifinsymbolset{#1}\currentsymbol{\c_symb_found\conditionaltrue}} \def\symb_fetch_second#1% - {\doifinsymbolset\empty\currentsymbol{\settrue\c_symb_found}} + {\doifinsymbolset\empty\currentsymbol{\c_symb_found\conditionaltrue}} \permanent\protected\def\doifelsesymboldefined#1% {\begingroup \edef\currentsymbol{#1}% \let\symb_fetch\symb_fetch_first - \setfalse\c_symb_found - \the\t_symb_setups + \c_symb_found\conditionalfalse + \expand\t_symb_setups \ifconditional\c_symb_found \endgroup\expandafter\firstoftwoarguments \else @@ -289,7 +292,7 @@ \installcorenamespace{symbolsets} -\permanent\tolerant\protected\def\startsymbolset[#1]#*[#2]% +\permanent\tolerant\protected\def\startsymbolset[#1]#*[#S#2]% {\pushmacro\m_symb_current_set \def\m_symb_current_set{#1}% \ifarguments\or\or @@ -303,14 +306,14 @@ \permanent\protected\def\stopsymbolset {\popmacro\m_symb_current_set} -\permanent\protected\def\setupsymbolset[#1]% - {\edef\currentsymbolset{#1}% +\permanent\protected\def\setupsymbolset[#1]% should have been \setsymbolset + {\cdef\currentsymbolset{#1}% \ifcsname\??symbolsets\currentsymbolset\endcsname \else \symb_setup_symbol_set \fi} \def\symb_setup_symbol_set - {\normalexpanded{\t_symb_setups{\symb_fetch{\currentsymbolset}\the\t_symb_setups}}% + {\normalexpanded{\t_symb_setups{\symb_fetch{\currentsymbolset}\expand\t_symb_setups}}% \letcsname\??symbolsets\currentsymbolset\endcsname\empty} % speedup \permanent\protected\def\resetsymbolset diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt index 39ceae3767d..1bc4bb9172f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt @@ -1,4 +1,4 @@ - if not modules then modules = { } end modules ['syst-aux'] = { +if not modules then modules = { } end modules ['syst-aux'] = { version = 1.001, comment = "companion to syst-aux.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", @@ -120,24 +120,20 @@ implement { -- \gdef\setpercentdimen#1#2% -- {#1=\ctxcommand{percentageof("#2",\number#1)}\relax} -local space = P(" ") / "" -local spaces = P(" ")^0 / "" +local space = P(" ") +local spaces = space^0 +local nospaces = spaces / "" local nohash = 1 - P("#") local digit = R("09") local double = P("##") / "#" local single = P("#") -local sentinel = spaces * (nohash^1 / "\\%0") -local whatever = S("+-/*_^=:") + digit +local sentinel = nospaces * (nohash^1 / "\\%0") +local whatever = S("+-/*_^=:") + digit + R("AZ") local sargument = (single * digit)^1 local dargument = (double * digit)^1 local swhatever = (single * whatever)^1 local dwhatever = (double * whatever)^1 --- different ones: - -local space = P(" ") -local spaces = space^0 - -- see syst-aux.lua for historic variants local global = nil @@ -203,8 +199,8 @@ local pattern = ( )^0 * spaces * ( C((1-S(" #["))^1) ) * spaces * Cs( - (Cs(P("[") * dargument * P("]")) / oldoption + dwhatever)^1 * sentinel^-1 * double^-1 - + (Cs(P("[") * sargument * P("]")) / oldoption + swhatever)^1 * sentinel^-1 * single^-1 + (Cs(P("[") * dargument * P("]")) / oldoption + nospaces * dwhatever)^1 * sentinel^-1 * double^-1 + + (Cs(P("[") * sargument * P("]")) / oldoption + nospaces * swhatever)^1 * sentinel^-1 * single^-1 + sentinel^-1 * (double+single)^-1 ) ) @@ -223,6 +219,9 @@ local function texdefinition_one(str) instance = false frozen = false csname, rest = lpegmatch(pattern,str) +-- print("str : " .. str) +-- print("cs : " .. csname) +-- print("rest : " .. rest) ctx_dostarttexdefinition() end @@ -243,7 +242,7 @@ local function texdefinition_two() ) end -implement { name = "texdefinition_one", actions = texdefinition_one, scope = "private", arguments = "string" } +implement { name = "texdefinition_one", actions = texdefinition_one, scope = "private", arguments = "tokenstring" } implement { name = "texdefinition_two", actions = texdefinition_two, scope = "private" } do @@ -385,345 +384,120 @@ context.secondoftwoarguments = ctx_secondoftwoarguments context.firstofoneargument = ctx_firstofoneargument context.gobbleoneargument = ctx_gobbleoneargument -local ctx_iftrue = context.iftrue -local ctx_iffalse = context.iffalse +local boolean_value = tokens.values.boolean local hash = utilities.parsers.hashes.settings_to_set -local function doifelsecommon(a,b) - if a == b then - setmacro("commalistelement",a) - if a == "" then - ctx_secondoftwoarguments() - else - ctx_firstoftwoarguments() - end - return - end - local ba = find(a,",",1,true) - local bb = find(b,",",1,true) - if ba and bb then - local ha = hash[a] - local hb = hash[b] - -- local ha = settings_to_set(a) - -- local hb = settings_to_set(b) - for k in next, ha do - if hb[k] then - setmacro("commalistelement",k) - ctx_firstoftwoarguments() - return - end - end - elseif ba then - if hash[a][b] then - -- if settings_to_set(a)[b] then - setmacro("commalistelement",b) - ctx_firstoftwoarguments() - return - end - elseif bb then - if hash[b][a] then - -- if settings_to_set(b)[a] then +implement { + name = "if_common", + usage = "condition", + arguments = "2 arguments", + actions = function(a,b) + if a == b then setmacro("commalistelement",a) - ctx_firstoftwoarguments() - return - end - end - setmacro("commalistelement","") - ctx_secondoftwoarguments() -end - -local function doifcommon(a,b) - if a == b then - setmacro("commalistelement",a) - if a == "" then - ctx_gobbleoneargument() - else - ctx_firstofoneargument() + return boolean_value, a ~= "" end - return - end - local ba = find(a,",",1,true) - local bb = find(b,",",1,true) - if ba and bb then - local ha = hash[a] - local hb = hash[b] - -- local ha = settings_to_set(a) - -- local hb = settings_to_set(b) - for k in next, ha do - if hb[k] then - setmacro("commalistelement",k) - ctx_firstofoneargument() - return + local ba = find(a,",",1,true) + local bb = find(b,",",1,true) + if ba and bb then + local ha = hash[a] + local hb = hash[b] + for k in next, ha do + if hb[k] then + setmacro("commalistelement",k) + return boolean_value, true + end + end + elseif ba then + if hash[a][b] then + setmacro("commalistelement",b) + return boolean_value, true + end + elseif bb then + if hash[b][a] then + setmacro("commalistelement",a) + return boolean_value, true end end - elseif ba then - if hash[a][b] then - -- if settings_to_set(a)[b] then - setmacro("commalistelement",b) - ctx_firstofoneargument() - return - end - elseif bb then - if hash[b][a] then - -- if settings_to_set(b)[a] then - setmacro("commalistelement",a) - ctx_firstofoneargument() - return - end + setmacro("commalistelement","") + return boolean_value, false end - setmacro("commalistelement","") - ctx_gobbleoneargument() -end +} -local function doifnotcommon(a,b) - if a == b then - setmacro("commalistelement",a) - if a == "" then - ctx_firstofoneargument() - else - ctx_gobbleoneargument() +implement { + name = "ifcommon", + public = true, + usage = "condition", + arguments = "2 arguments", + actions = function(a,b) + if a == b then + return boolean_value, a ~= "" end - return - end - local ba = find(a,",",1,true) - local bb = find(b,",",1,true) - if ba and bb then - local ha = hash[a] - local hb = hash[b] - -- local ha = settings_to_set(a) - -- local hb = settings_to_set(b) - for k in next, ha do - if hb[k] then - setmacro("commalistelement",k) - ctx_gobbleoneargument() - return + local ba = find(a,",",1,true) + local bb = find(b,",",1,true) + if ba and bb then + local ha = hash[a] + local hb = hash[b] + for k in next, ha do + if hb[k] then + return boolean_value, true + end + end + elseif ba then + if hash[a][b] then + return boolean_value, true + end + elseif bb then + if hash[b][a] then + return boolean_value, true end end - elseif ba then - if hash[a][b] then - -- if settings_to_set(a)[b] then - setmacro("commalistelement",b) - ctx_gobbleoneargument() - return - end - elseif bb then - if hash[b][a] then - -- if settings_to_set(b)[a] then - setmacro("commalistelement",a) - ctx_gobbleoneargument() - return - end + return boolean_value, false end - setmacro("commalistelement","") - ctx_firstofoneargument() -end +} --- local function hascommonargumentcondition(a,b) --- if a == b then --- setmacro("commalistelement",a) --- if a == "" then --- ctx_iffalse() --- else --- ctx_iftrue() +-- -- This one slower than the tex based one: +-- +-- implement { +-- name = "if_inset", +-- usage = "condition", +-- arguments = "2 arguments", +-- actions = function(a,b) +-- if a == b then +-- setmacro("commalistelement",a) +-- return boolean_value, a ~= "" -- end --- return --- end --- local ba = find(a,",",1,true) --- local bb = find(b,",",1,true) --- if ba and bb then --- local ha = hash[a] --- local hb = hash[b] --- for k in next, ha do --- if hb[k] then --- setmacro("commalistelement",k) --- ctx_iftrue() --- return +-- local bb = find(b,",",1,true) +-- if bb then +-- if hash[b][a] then +-- setmacro("commalistelement",a) +-- return boolean_value, true -- end -- end --- elseif ba then --- if hash[a][b] then --- setmacro("commalistelement",b) --- ctx_iftrue() --- return --- end --- elseif bb then --- if hash[b][a] then --- setmacro("commalistelement",a) --- ctx_iftrue() --- return --- end +-- setmacro("commalistelement","") +-- return boolean_value, false -- end --- setmacro("commalistelement","") --- ctx_iffalse() --- end - -local function doifelseinset(a,b) - if a == b then - setmacro("commalistelement",a) - if a == "" then - ctx_secondoftwoarguments() - else - ctx_firstoftwoarguments() - end - return - end - local bb = find(b,",",1,true) - if bb then - if hash[b][a] then - -- if settings_to_set(b)[a] then - setmacro("commalistelement",a) - ctx_firstoftwoarguments() - return - end - end - setmacro("commalistelement","") - ctx_secondoftwoarguments() -end - -local function doifinset(a,b) - if a == b then - setmacro("commalistelement",a) - if a == "" then - ctx_gobbleoneargument() - else - ctx_firstofoneargument() - end - return - end - local bb = find(b,",",1,true) - if bb then - if hash[b][a] then - -- if settings_to_set(b)[a] then - setmacro("commalistelement",a) - ctx_firstofoneargument() - return - end - end - setmacro("commalistelement","") - ctx_gobbleoneargument() -end +-- } -local function doifnotinset(a,b) - if a == b then - setmacro("commalistelement",a) - if a == "" then - ctx_firstofoneargument() - else - ctx_gobbleoneargument() +implement { + name = "ifinset", + public = true, + usage = "condition", + arguments = "2 arguments", + actions = function(a,b) + if a == b then + return boolean_value, a ~= "" end - return - end - local bb = find(b,",",1,true) - if bb then - if hash[b][a] then - -- if settings_to_set(b)[a] then - setmacro("commalistelement",a) - ctx_gobbleoneargument() - return + local bb = find(b,",",1,true) + if bb then + if hash[b][a] then + return boolean_value, true + end end + return boolean_value, false end - setmacro("commalistelement","") - ctx_firstofoneargument() -end - -implement { - name = "doifelsecommon", - actions = doifelsecommon, - arguments = "2 strings", -} - -implement { - name = "doifcommon", - actions = doifcommon, - arguments = "2 strings", -} - -implement { - name = "doifnotcommon", - actions = doifnotcommon, - arguments = "2 strings", -} - --- implement { --- name = "hascommonargumentcondition", --- actions = hascommonargumentcondition, --- arguments = "2 strings", --- arguments = "2 arguments", --- } - -implement { - name = "doifelseinset", - actions = doifelseinset, - arguments = "2 strings", --- arguments = "2 arguments", -} - -implement { - name = "doifinset", - actions = doifinset, - arguments = "2 strings", } -implement { - name = "doifnotinset", - actions = doifnotinset, - arguments = "2 strings", -} - --- done elsewhere: --- --- local function firstinset(a) --- local aa = hash[a] --- context(aa and aa[1] or a) --- end --- --- implement { --- name = "firstinset", --- actions = firstinset, --- arguments = "string", --- private = false, --- } - --- implement { --- name = "stringcompare", --- arguments = "2 strings", --- actions = function(a,b) --- context((a == b and 0) or (a > b and 1) or -1) --- end --- } --- --- implement { --- name = "doifelsestringafter", --- arguments = "2 strings", --- actions = function(a,b) --- ctx_doifelse((a == b and 0) or (a > b and 1) or -1) --- end --- } --- --- implement { --- name = "doifelsestringbefore", --- arguments = "2 strings", --- actions = function(a,b) --- ctx_doifelse((a == b and 0) or (a < b and -1) or 1) --- end --- } - --- implement { -- not faster than addtocommalist --- name = "additemtolist", -- unique --- arguments = "2 strings", --- actions = function(l,s) --- if l == "" or s == l then --- -- s = s --- elseif find("," .. l .. ",","," .. s .. ",") then --- s = l --- else --- s = l .. "," .. s --- end --- context(s) --- end --- } - local bp = number.dimenfactors.bp implement { @@ -782,6 +556,8 @@ implement { actions = function() getshape("widowpenalties") end, } +-- These have beem replaced by loop primitives: + implement { name = "loopcs", public = true, @@ -795,6 +571,7 @@ implement { end end } + implement { name = "loopcsn", public = true, diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl index 58678f9f3c5..b5f783cb83d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl @@ -32,6 +32,10 @@ %D %D Of course I couldn't do this without Wolfgang looking over my shoulder. Changing %D core code is kind of tricky. +%D +%D There are quite some helpers here that are effectively obsolete (read: there is no +%D need for them). Examples are \type {setflag} and \type {\uppercasestring} and their +%D relatives. We keep them around as illustration and possible usage in old styles. \unprotect @@ -82,7 +86,7 @@ \newinteger\c_syst_helpers_n_of_namespaces \c_syst_helpers_n_of_namespaces\pluseight % 1-8 reserved for catcodes - \def\v_interfaces_prefix_template_system{\number \c_syst_helpers_n_of_namespaces>>} + \def\v_interfaces_prefix_template_system{\the \c_syst_helpers_n_of_namespaces>>} %def\v_interfaces_prefix_template_system{\characters\c_syst_helpers_n_of_namespaces>>} % no \characters yet \fi @@ -208,11 +212,11 @@ \permanent\def\gobbleeightarguments #-#-#-#-#-#-{} \permanent\def\gobbleninearguments #-#-#-#-#-#-#-{} -\permanent\tolerant\def\gobbleoneoptional [#-]{} -\permanent\tolerant\def\gobbletwooptionals [#-]#*[#-]{} -\permanent\tolerant\def\gobblethreeoptionals[#-]#*[#-]#*[#-]{} -\permanent\tolerant\def\gobblefouroptionals [#-]#*[#-]#*[#-]#*[#-]{} -\permanent\tolerant\def\gobblefiveoptionals [#-]#*[#-]#*[#-]#*[#-]#*[#-]{} +\permanent\tolerant\def\gobbleoneoptional [#S#-]{} +\permanent\tolerant\def\gobbletwooptionals [#S#-]#*[#S#-]{} +\permanent\tolerant\def\gobblethreeoptionals[#S#-]#*[#S#-]#*[#S#-]{} +\permanent\tolerant\def\gobblefouroptionals [#S#-]#*[#S#-]#*[#S#-]#*[#S#-]{} +\permanent\tolerant\def\gobblefiveoptionals [#S#-]#*[#S#-]#*[#S#-]#*[#S#-]#*[#S#-]{} %D Reserved macros for tests: @@ -378,7 +382,7 @@ \permanent\def\setgvalue #1{\gdefcsname#1\endcsname} \permanent\def\setevalue #1{\edefcsname#1\endcsname} \permanent\def\setxvalue #1{\xdefcsname#1\endcsname} -\permanent\def\getvalue #1{\csname#1\endcsname} % maybe: \begincsname#1\endcsname +\permanent\def\getvalue #1{\begincsname#1\endcsname} \permanent\def\letvalue #1{\letcsname #1\endcsname} \permanent\def\letgvalue #1{\gletcsname#1\endcsname} \permanent\def\resetvalue #1{\letcsname#1\endcsname\empty} @@ -390,7 +394,7 @@ \permanent\def\setugvalue #1{\protected\gdefcsname#1\endcsname} \permanent\def\setuxvalue #1{\protected\xdefcsname#1\endcsname} -\permanent\protected\def\getuvalue#1{\csname#1\endcsname} +\permanent\protected\def\getuvalue#1{\begincsname#1\endcsname} %D \macros %D {globallet,glet} @@ -587,7 +591,7 @@ % or (test this): % % \permanent\protected\def\processallactionsinset[#1]% -% {\iftok{#1}\emptytoks +% {\ifempty{#1}% % \expandafter\processaction % \else % \expandafter\syst_helpers_process_all_actions_in_set_indeed @@ -743,9 +747,13 @@ % !9yes=\doifcommonelse{,a,}{,,,a,}{yes}{nop} % !9yes=\doifcommonelse{,,a,}{,,,a,}{yes}{nop} -\permanent\protected\def\doifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}} % todo: define in lua -\permanent\protected\def\doifcommon #1#2{\clf_doifcommon {#1}{#2}} % todo: define in lua -\permanent\protected\def\doifnotcommon #1#2{\clf_doifnotcommon {#1}{#2}} % todo: define in lua +% \permanent\protected\def\doifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}} % todo: define in lua +% \permanent\protected\def\doifcommon #1#2{\clf_doifcommon {#1}{#2}} % todo: define in lua +% \permanent\protected\def\doifnotcommon #1#2{\clf_doifnotcommon {#1}{#2}} % todo: define in lua + +\permanent\protected\def\doifelsecommon#1#2{\clf_if_common{#1}{#2}\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi} +\permanent\protected\def\doifcommon #1#2{\clf_if_common{#1}{#2}\expandafter\firstofoneargument \else\expandafter\gobbleoneargument \fi} +\permanent\protected\def\doifnotcommon #1#2{\clf_if_common{#1}{#2}\expandafter\gobbleoneargument \else\expandafter\firstofoneargument \fi} \aliased\let\doifcommonelse\doifelsecommon @@ -817,15 +825,15 @@ \mutable\lettonothing\commalistcommand -\protected\def\syst_helpers_process_comma_item#+,% - {\ifarguments - \expandafter\syst_helpers_process_comma_item_gobble - \orelse\ifparameter#1\or - \commalistcommand{#1}% - \expandafter\syst_helpers_process_comma_item_next - \else - \expandafter\syst_helpers_process_comma_item_gobble - \fi} +% \protected\def\syst_helpers_process_comma_item#+,% +% {\ifarguments +% \expandafter\syst_helpers_process_comma_item_gobble +% \orelse\ifparameter#1\or +% \commalistcommand{#1}% +% \expandafter\syst_helpers_process_comma_item_next +% \else +% \expandafter\syst_helpers_process_comma_item_gobble +% \fi} % \def\syst_helpers_process_comma_item_next % {\expandafterspaces\syst_helpers_process_comma_item} @@ -1352,7 +1360,7 @@ \permanent\protected\def\makerawcommalist[#1]#2% use \processnext ... here {\scratchtoks\emptytoks - \def\syst_helpers_do_make_raw_comma_list##1{\iftok\scratchtoks\emptytoks\scratchtoks{##1}\else\toksapp\scratchtoks{,##1}\fi}% + \def\syst_helpers_do_make_raw_comma_list##1{\ifempty\scratchtoks\scratchtoks{##1}\else\toksapp\scratchtoks{,##1}\fi}% \processcommalist[#1]\syst_helpers_do_make_raw_comma_list \edef#2{\the\scratchtoks}} @@ -1597,41 +1605,85 @@ % \mutable\lettonothing\currentvalue % only mkii -\permanent\protected\def\getparameters {\dogetparameters\dosetvalue} -\permanent\protected\def\geteparameters {\dogetparameters\dosetevalue} -\permanent\protected\def\getgparameters {\dogetparameters\dosetgvalue} -\permanent\protected\def\getxparameters {\dogetparameters\dosetxvalue} -\permanent\protected\def\forgetparameters{\dogetparameters\doignorevalue} +% \permanent\protected\def\getparameters {\dogetparameters\dosetvalue} +% \permanent\protected\def\geteparameters {\dogetparameters\dosetevalue} +% \permanent\protected\def\getgparameters {\dogetparameters\dosetgvalue} +% \permanent\protected\def\getxparameters {\dogetparameters\dosetxvalue} +% \permanent\protected\def\forgetparameters{\dogetparameters\doignorevalue} +% +% \aliased\let\getexpandedparameters\geteparameters +% +% \def\syst_helpers_grab_parameter_error#1% +% {\showassignerror{#1}{\the\inputlineno\space(\m_syst_parameter_n)}} +% +% \def\syst_helpers_grab_parameter#1,% +% {\ifarguments +% % done +% \else +% \syst_helpers_grab_parameter_okay#1,\ignorearguments +% \expandafter\syst_helpers_grab_parameter_next +% \fi} +% +% \def\syst_helpers_grab_parameter_okay#1=#2,% +% {\ifarguments +% \or +% \syst_helpers_grab_parameter_error{#1}% +% \or +% \m_syst_parameter_s\m_syst_parameter_n{#1}{#2}% +% \fi} +% +% \def\syst_helpers_grab_parameter_next +% {\expandafterspaces\syst_helpers_grab_parameter} +% +% \permanent\protected\def\dogetparameters#1[#2]#*[#3]% +% {\def\m_syst_parameter_n{#2}% +% \let\m_syst_parameter_s#1% +% \expandafterspaces\syst_helpers_grab_parameter#3\ignorearguments\ignorearguments} + +% Doesn't work with single entry empty values [foo=] +% +% \tolerant\def\syst_get_parameters_n#*#1=#S#2,#M,% +% {\ifarguments \expandafter\gobbleoneargument +% \or \mult_interfaces_get_parameters_error_indeed\m_syst_parameter{#1}% +% \orelse\ifparameter#2\or \defcsname\m_syst_parameter#1\endcsname{#2}% +% \else \letcsname\m_syst_parameter#1\endcsname\empty +% \fi \syst_get_parameters_n} +% +% so we do this instead (and also silently recover). + +\tolerant\def\syst_get_parameters_n#*#1=#S#2,#M,% + {\unless\ifparameter#1\or\expandafter\gobbleoneargument + \orelse\ifparameter#2\or\defcsname\m_syst_parameter#1\endcsname{#2}% + \else \letcsname\m_syst_parameter#1\endcsname\empty + \fi \syst_get_parameters_n} +\tolerant\def\syst_get_parameters_e#*#1=#S#2,#M,% + {\unless\ifparameter#1\or\expandafter\gobbleoneargument + \orelse\ifparameter#2\or\edefcsname\m_syst_parameter#1\endcsname{#2}% + \else \letcsname\m_syst_parameter#1\endcsname\empty + \fi \syst_get_parameters_e} +\tolerant\def\syst_get_parameters_g#*#1=#S#2,#M,% + {\unless\ifparameter#1\or\expandafter\gobbleoneargument + \orelse\ifparameter#2\or\gdefcsname\m_syst_parameter#1\endcsname{#2}% + \else \letcsname\m_syst_parameter#1\endcsname\empty + \fi \syst_get_parameters_g} +\tolerant\def\syst_get_parameters_x#*#1=#S#2,#M,% + {\unless\ifparameter#1\or\expandafter\gobbleoneargument + \orelse\ifparameter#2\or\xdefcsname\m_syst_parameter#1\endcsname{#2}% + \else \letcsname\m_syst_parameter#1\endcsname\empty + \fi \syst_get_parameters_x} +\tolerant\def\syst_get_parameters_f#*#1=#S#2,#M,% + {\unless\ifparameter#1\or\expandafter\gobbleoneargument + \else \letcsname\m_syst_parameter#1\endcsname\empty + \fi \syst_get_parameters_f} + +\permanent\protected\def\getparameters [#1]#*[#S#2]{\cdef\m_syst_parameter{#1}\syst_get_parameters_n#2\ignorearguments\ignorearguments} +\permanent\protected\def\geteparameters [#1]#*[#S#2]{\cdef\m_syst_parameter{#1}\syst_get_parameters_e#2\ignorearguments\ignorearguments} +\permanent\protected\def\getgparameters [#1]#*[#S#2]{\cdef\m_syst_parameter{#1}\syst_get_parameters_g#2\ignorearguments\ignorearguments} +\permanent\protected\def\getxparameters [#1]#*[#S#2]{\cdef\m_syst_parameter{#1}\syst_get_parameters_x#2\ignorearguments\ignorearguments} +\permanent\protected\def\forgetparameters[#1]#*[#S#2]{\cdef\m_syst_parameter{#1}\syst_get_parameters_f#2\ignorearguments\ignorearguments} \aliased\let\getexpandedparameters\geteparameters -\def\syst_helpers_grab_parameter_error#1% - {\showassignerror{#1}{\the\inputlineno\space(\m_syst_parameter_n)}} - -\def\syst_helpers_grab_parameter#1,% - {\ifarguments - % done - \else - \syst_helpers_grab_parameter_okay#1,\ignorearguments - \expandafter\syst_helpers_grab_parameter_next - \fi} - -\def\syst_helpers_grab_parameter_okay#1=#2,% - {\ifarguments - \or - \syst_helpers_grab_parameter_error{#1}% - \or - \m_syst_parameter_s\m_syst_parameter_n{#1}{#2}% - \fi} - -\def\syst_helpers_grab_parameter_next - {\expandafterspaces\syst_helpers_grab_parameter} - -\permanent\protected\def\dogetparameters#1[#2]#*[#3]% - {\def\m_syst_parameter_n{#2}% - \let\m_syst_parameter_s#1% - \expandafterspaces\syst_helpers_grab_parameter#3\ignorearguments\ignorearguments} - %D \macros %D {getemptyparameters} %D @@ -1642,10 +1694,16 @@ %D \getemptyparameters [label] [...=...,...=...] %D \stoptyping -\let\syst_helpers_get_empty_parameters\gobbleoneargument +% \let\syst_helpers_get_empty_parameters\gobbleoneargument +% +% \permanent\protected\def\getemptyparameters[#1]#*[#2]% +% {\def\syst_helpers_get_empty_parameters##1{\doassignempty[#1][##1]}% +% \processcommalist[#2]\syst_helpers_get_empty_parameters} + +\let\syst_helpers_copy_parameter\relax \permanent\protected\def\getemptyparameters[#1]#*[#2]% - {\def\syst_helpers_get_empty_parameters##1{\doassignempty[#1][##1]}% + {\def\syst_helpers_copy_parameter##1{\letcsname#1##1\endcsname\empty}% \processcommalist[#2]\syst_helpers_get_empty_parameters} %D We now just alias these as there is no need for a speedup. These have not been used @@ -1676,9 +1734,23 @@ \let\syst_helpers_process_assign_entry\gobbleoneargument -\permanent\protected\def\processassignmentlist[#1]#2% #2 == \command{key}{value] - {\def\syst_helpers_process_assign_entry##1{#2}% {##2}{##3} % namespace is ignored - \dogetparameters\syst_helpers_process_assign_entry[][#1]} +% \permanent\protected\def\processassignmentlist[#1]#2% #2 == \command{key}{value] +% {\def\syst_helpers_process_assign_entry##1{#2}% {##2}{##3} % namespace is ignored +% \dogetparameters\syst_helpers_process_assign_entry[][#1]} + +\tolerant\def\syst_helpers_process_assign_value#*#1=#S#2,#M,% + {\ifarguments + \expandafter\gobbleoneargument + \or + \mult_interfaces_get_parameters_error_indeed\empty{#1}% + \else + \syst_helpers_process_assign_entry{#1}{#2}% + \fi + \syst_helpers_process_assign_value} + +\permanent\protected\def\processassignmentlist[#S#1]#2% #2 == \command{key}{value] + {\def\syst_helpers_process_assign_entry{#2}% + \syst_helpers_process_assign_value#1\ignorearguments\ignorearguments} \permanent\protected\def\processassignmentcommand[#1]% {\normalexpanded{\processassignmentlist[#1]}} @@ -1738,12 +1810,21 @@ %D By using \type {\docopyvalue} we've prepared this command for use in a %D multi||lingual environment. +% \let\syst_helpers_copy_parameter\relax +% +% \permanent\protected\def\copyparameters[#1]#*[#2]#*[#3]% +% {\iftok{#1}{#2}\else +% \def\syst_helpers_copy_parameter{\docopyvalue{#1}{#2}}% ##1 +% \processcommalist[#3]\syst_helpers_copy_parameter +% \fi} + \let\syst_helpers_copy_parameter\relax \permanent\protected\def\copyparameters[#1]#*[#2]#*[#3]% - {\doifnot{#1}{#2} - {\def\syst_helpers_copy_parameter{\docopyvalue{#1}{#2}}% ##1 - \processcommalist[#3]\syst_helpers_copy_parameter}} + {\iftok{#1}{#2}\else + \def\syst_helpers_copy_parameter##1{\defcsname#1##1\endcsname{\begincsname#2##1\endcsname}}% + \processcommalist[#3]\syst_helpers_copy_parameter + \fi} % %D \macros % %D {ifparameters,checkparameters} @@ -1757,9 +1838,9 @@ % %D \starttyping % %D \checkparameters[argument] % %D \stoptyping -% + % \newif\ifparameters -% + % \protected\def\checkparameters[#1]% % {\ifhastok={#1}\parameterstrue\else\parametersfalse\fi} @@ -2328,16 +2409,14 @@ % {\seventhargumentfalse % \the\t_syst_aux[]} -%tolerant\def\syst_single_empty#1\relax[#+]% -\tolerant\def\syst_single_empty#1\relax[#2]% +\tolerant\def\syst_single_empty#1\relax[#S#2]% {\ifarguments \or\firstargumentfalse \or\firstargumenttrue \fi #1[#2]} -%tolerant\def\syst_double_empty#1\relax[#2]#*[#3]% -\tolerant\def\syst_double_empty#1\relax[#+]#*[#+]% +\tolerant\def\syst_double_empty#1\relax[#S#+]#*[#S#+]% {\ifarguments \or\firstargumentfalse\secondargumentfalse \or\firstargumenttrue \secondargumentfalse @@ -2345,8 +2424,7 @@ \fi #1[#2][#3]} -%tolerant\def\syst_triple_empty#1\relax[#2]#*[#3]#*[#4]% -\tolerant\def\syst_triple_empty#1\relax[#+]#*[#+]#*[#+]% +\tolerant\def\syst_triple_empty#1\relax[#S#+]#*[#S#+]#*[#S#+]% {\ifarguments \or\firstargumentfalse\secondargumentfalse\thirdargumentfalse \or\firstargumenttrue \secondargumentfalse\thirdargumentfalse @@ -2355,8 +2433,7 @@ \fi #1[#2][#3][#4]} -%tolerant\def\syst_quadruple_empty#1\relax[#2]#*[#3]#*[#4]#*[#5]% -\tolerant\def\syst_quadruple_empty#1\relax[#+]#*[#+]#*[#+]#*[#+]% +\tolerant\def\syst_quadruple_empty#1\relax[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]% {\ifarguments \or\firstargumentfalse\secondargumentfalse\thirdargumentfalse\fourthargumentfalse \or\firstargumenttrue \secondargumentfalse\thirdargumentfalse\fourthargumentfalse @@ -2366,8 +2443,7 @@ \fi #1[#2][#3][#4][#5]} -%\tolerant\def\syst_quintuple_empty#1\relax[#2]#*[#3]#*[#4]#*[#5]#*[#6]% -\tolerant\def\syst_quintuple_empty#1\relax[#+]#*[#+]#*[#+]#*[#+]#*[#+]% +\tolerant\def\syst_quintuple_empty#1\relax[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]% {\ifarguments \or\firstargumentfalse\secondargumentfalse\thirdargumentfalse\fourthargumentfalse\fifthargumentfalse \or\firstargumenttrue \secondargumentfalse\thirdargumentfalse\fourthargumentfalse\fifthargumentfalse @@ -2378,8 +2454,7 @@ \fi #1[#2][#3][#4][#5][#6]} -%tolerant\def\syst_sixtuple_empty#1\relax[#2]#*[#3]#*[#4]#*[#5]#*[#6]#*[#7]% -\tolerant\def\syst_sixtuple_empty#1\relax[#+]#*[#+]#*[#+]#*[#+]#*[#+]#*[#+]% +\tolerant\def\syst_sixtuple_empty#1\relax[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]% {\ifarguments \or\firstargumentfalse\secondargumentfalse\thirdargumentfalse\fourthargumentfalse\fifthargumentfalse\sixthargumentfalse \or\firstargumenttrue \secondargumentfalse\thirdargumentfalse\fourthargumentfalse\fifthargumentfalse\sixthargumentfalse @@ -2391,8 +2466,7 @@ \fi #1[#2][#3][#4][#5][#6][#7]} -%tolerant\def\syst_seventuple_empty#1\relax[#2]#*[#3]#*[#4]#*[#5]#*[#6]#*[#7]#*[#8]% -\tolerant\def\syst_seventuple_empty#1\relax[#+]#*[#+]#*[#+]#*[#+]#*[#+]#*[#+]#*[#+]% +\tolerant\def\syst_seventuple_empty#1\relax[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]#*[#S#+]% {\ifarguments \or\firstargumentfalse\secondargumentfalse\thirdargumentfalse\fourthargumentfalse\fifthargumentfalse\sixthargumentfalse\seventhargumentfalse \or\firstargumenttrue \secondargumentfalse\thirdargumentfalse\fourthargumentfalse\fifthargumentfalse\sixthargumentfalse\seventhargumentfalse @@ -2541,8 +2615,8 @@ \newconditional\c_syst_helpers_permit_spaces_between_groups -\permanent\protected\def \permitspacesbetweengroups{\settrue \c_syst_helpers_permit_spaces_between_groups} -\permanent\protected\def\dontpermitspacesbetweengroups{\setfalse\c_syst_helpers_permit_spaces_between_groups} +\permanent\protected\def \permitspacesbetweengroups{\c_syst_helpers_permit_spaces_between_groups\conditionaltrue} +\permanent\protected\def\dontpermitspacesbetweengroups{\c_syst_helpers_permit_spaces_between_groups\conditionalfalse} \dontpermitspacesbetweengroups @@ -3004,13 +3078,19 @@ \integerdef\c_syst_parameter_catcode\parametercatcode -\bgroup \obeylines +% \catcode\endoflineasciicode\activecatcode\letcharcode\endoflineasciicode\par + +\bgroup + +\catcode\endoflineasciicode\activecatcode% +\letcharcode\endoflineasciicode\par% \permanent\protected\gdef\starttexdefinition% {\integerdef\c_syst_parameter_catcode\catcode\hashasciicode% \catcode\hashasciicode\parametercatcode% \bgroup% - \obeylines% + \catcode\endoflineasciicode\activecatcode% + \letcharcode\endoflineasciicode\par% \syst_helpers_start_tex_definition} \gdef\syst_helpers_start_tex_definition#1 @@ -3201,8 +3281,11 @@ \newinteger\outerrecurse \newinteger\innerrecurse -\mutable\def\recursedepth{\the\outerrecurse} -\mutable\def\recurselevel{0} +% \mutable\def\recursedepth{\the\outerrecurse} +% \mutable\def\recurselevel{0} + +\mutable\untraced\def\recursedepth{\the\outerrecurse} +\mutable\untraced\def\recurselevel{0} \mutable\let\recurseaction\relax @@ -3338,39 +3421,57 @@ %D %D When needed, one can call for \type {\looplevel} and \type {\loopdepth}. -\aliased\let\endofloop\donothing % maybe \syst_helpers_loop_end +% \aliased\let\endofloop\donothing % maybe \syst_helpers_loop_end +% +% \permanent\protected\def\doloop#1% +% {\global\advanceby\outerrecurse \plusone +% \push_macro_recurseaction +% \push_macro_recurselevel +% \protected\gdef\recurseaction##1##2{#1}% +% \enforced\let\endofloop\syst_helpers_loop +% \syst_helpers_loop1}% no \plusone else \recurselevel wrong +% +% \protected\def\syst_helpers_loop#1% +% {\def\recurselevel{#1}% +% \expandafter\syst_helpers_loop_yes\expandafter{\the\numexpr\recurselevel+\plusone\relax}} +% +% %% \protected\def\syst_helpers_loop_yes +% %% {\syst_helpers_recurse_content +% %% \endofloop} +% +% \protected\def\syst_helpers_loop_yes +% {\normalexpanded{\recurseaction{\recurselevel}{\the\outerrecurse}}% +% \endofloop} +% +% \protected\def\syst_helpers_loop_nop#-% +% {\enforced\let\endofloop\syst_helpers_loop +% \pop_macro_recurselevel +% \pop_macro_recurseaction +% \global\advanceby\outerrecurse\minusone} +% +% \permanent\protected\def\exitloop % \exitloop quits at end +% {\enforced\let\endofloop\syst_helpers_loop_nop} +% +% \permanent\protected\def\exitloopnow#-\endofloop % \exitloopnow quits directly +% {\syst_helpers_loop_nop} \permanent\protected\def\doloop#1% - {\global\advanceby\outerrecurse \plusone - \globalpushmacro\recurseaction - \globalpushmacro\recurselevel + {\push_macro_recurseaction + \push_macro_recurselevel + \push_macro_recursedepth \protected\gdef\recurseaction##1##2{#1}% - \enforced\let\endofloop\syst_helpers_loop - \syst_helpers_loop1}% no \plusone else \recurselevel wrong - -\protected\def\syst_helpers_loop#1% - {\def\recurselevel{#1}% - \expandafter\syst_helpers_loop_yes\expandafter{\the\numexpr\recurselevel+\plusone\relax}} - -%% \protected\def\syst_helpers_loop_yes -%% {\syst_helpers_recurse_content -%% \endofloop} - -\protected\def\syst_helpers_loop_yes - {\normalexpanded{\recurseaction{\recurselevel}{\the\outerrecurse}}% - \endofloop} - -\protected\def\syst_helpers_loop_nop#-% - {\enforced\let\endofloop\syst_helpers_loop - \globalpopmacro\recurselevel - \globalpopmacro\recurseaction - \global\advanceby\outerrecurse\minusone} - -\permanent\protected\def\exitloop % \exitloop quits at end - {\enforced\let\endofloop\syst_helpers_loop_nop} + \untraced\edef\recurselevel{\noexpand\the\nestedloopiterator\the\currentloopnesting\space}% + \untraced\edef\recursedepth{\the\numexpr\currentloopnesting+\plusone}% + \localcontrolledendless + {%\edef\recurselevel{\the\currentloopiterator}% + %\edef\recursedepth{\the\currentloopnesting}% + \normalexpanded{\recurseaction{\the\currentloopiterator}{\the\currentloopnesting}}}% + \pop_macro_recursedepth + \pop_macro_recurselevel + \pop_macro_recurseaction} -\permanent\protected\def\exitloopnow#-\endofloop % \exitloopnow quits directly - {\syst_helpers_loop_nop} +\aliased\let\exitloop \quitloop +\aliased\let\exitloopnow\quitloopnow %D The loop is executed at least once, so beware of situations like: %D @@ -3437,14 +3538,14 @@ %% \globalpushmacro\recurselevel %% \protected\gdef\recurseaction##1##2{#4}% %% \normalexpanded{\ifcmpnum#3\zerocount -%% \ifnum#1<#2\relax\relax % so we catch \number\numexpr xx without \relax's +%% \ifnum#1<#2\relax\relax % so we catch \the\numexpr xx without \relax's %% \doubleexpandafter\gobbletwoarguments %% \else %% \tripleexpandafter\syst_helpers_stepwise_reverse %% \fi %% \or %% \doubleexpandafter\gobbletwoarguments -%% \orelse\ifnum#2<#1\relax\relax % so we catch \number\numexpr xx without \relax's +%% \orelse\ifnum#2<#1\relax\relax % so we catch \the\numexpr xx without \relax's %% \doubleexpandafter\gobbletwoarguments %% \else %% \doubleexpandafter\syst_helpers_stepwise_recurse @@ -3492,21 +3593,24 @@ \protected\gdefcsname push_macro_\csstring#1\endcsname{\globalpushmacro#1}% \protected\gdefcsname pop_macro_\csstring#1\endcsname{\globalpopmacro #1}} -% \showmacrostack can be used to see if there are different entries - \installglobalmacrostack \recurseaction \installglobalmacrostack \recurselevel \installglobalmacrostack \recursedepth +\installglobalmacrostack \recursestring + +% \showmacrostack can be used to see if there are different entries \permanent\protected\def\dostepwiserecurse#1#2#3#4% {\push_macro_recurseaction \push_macro_recurselevel \push_macro_recursedepth \protected\gdef\recurseaction##1##2{#4}% + \untraced\edef\recurselevel{\noexpand\the\nestedloopiterator\the\currentloopnesting\space}% + \untraced\edef\recursedepth{\the\numexpr\currentloopnesting+\plusone}% \localcontrolledloop=#1=#2=#3% - {\edef\recurselevel{\the\currentloopiterator}% - \edef\recursedepth{\the\currentloopnesting}% - \normalexpanded{\recurseaction{\recurselevel}{\recursedepth}}}% + {%\edef\recurselevel{\the\currentloopiterator}% + %\edef\recursedepth{\the\currentloopnesting}% + \normalexpanded{\recurseaction{\the\currentloopiterator}{\the\currentloopnesting}}}% \pop_macro_recursedepth \pop_macro_recurselevel \pop_macro_recurseaction} @@ -3516,10 +3620,12 @@ \push_macro_recurselevel \push_macro_recursedepth \protected\gdef\recurseaction##1##2{#2}% - \localcontrolledloop=\plusone=#1=\plusone - {\edef\recurselevel{\the\currentloopiterator}% - \edef\recursedepth{\the\currentloopnesting}% - \normalexpanded{\recurseaction{\recurselevel}{\recursedepth}}}% + \untraced\edef\recurselevel{\noexpand\the\nestedloopiterator\the\currentloopnesting\space}% + \untraced\edef\recursedepth{\the\numexpr\currentloopnesting+\plusone}% + \localcontrolledrepeat=#1% + {%\edef\recurselevel{\the\currentloopiterator}% + %\edef\recursedepth{\the\currentloopnesting}% + \normalexpanded{\recurseaction{\the\currentloopiterator}{\the\currentloopnesting}}}% \pop_macro_recursedepth \pop_macro_recurselevel \pop_macro_recurseaction} @@ -3536,16 +3642,16 @@ \push_macro_m_expanded_recursed \def\m_expanded_recursed##1{#2}% \endlocalcontrol - \expandedloop\plusone#1\plusone{\expandafter\m_expanded_recursed\expandafter{\the\currentloopiterator}}% + \expandedrepeat#1{\expandafter\m_expanded_recursed\expandafter{\the\currentloopiterator}}% \beginlocalcontrol \pop_macro_m_expanded_recursed \endlocalcontrol} % Helper: -\permanent\protected\def\resetrecurselevel{\let\recurselevel\!!zerocount} +% \permanent\protected\def\resetrecurselevel{\let\recurselevel\!!zerocount} -\let\recurselevel\!!zerocount +\permanent\protected\def\resetrecurselevel{\untraced\let\recurselevel\!!zerocount} % \appendtoks \resetrecurselevel \to \everydump @@ -3574,12 +3680,16 @@ \permanent\protected\def\doloopoverlist#1#2% {\global\advanceby\outerrecurse\plusone - \globalpushmacro\recurseaction - \globalpushmacro\recursestring +% \globalpushmacro\recurseaction +% \globalpushmacro\recursestring + \push_macro_recurseaction + \push_macro_recursestring \protected\gdef\recurseaction##1{\edef\recursestring{##1}#2}% \processcommacommand[#1]\recurseaction - \globalpopmacro\recursestring - \globalpopmacro\recurseaction +% \globalpopmacro\recursestring +% \globalpopmacro\recurseaction + \pop_macro_recursestring + \pop_macro_recurseaction \global\advanceby\outerrecurse\minusone} %D This is some \LMTX\ experiment: @@ -3606,20 +3716,34 @@ \permanent\protected\def\doloopovermatch#1#2#3% {\pushmacro\matchloopcommand - \enforced\def\matchloopcommand##1##2##3##4##5##6##7##8##9{#3}% + \enforced\def\matchloopcommand##1##2##3##4##5##6##7##8##9##A##B##C##D##E{#3}% \ctxluamatch\matchloopcommand{#1}{#2}% \popmacro\matchloopcommand} \permanent\def\doloopovermatched#1#2#3% {\beginlocalcontrol \pushmacro\matchloopcommand - \enforced\def\matchloopcommand##1##2##3##4##5##6##7##8##9{#3}% + \enforced\def\matchloopcommand##1##2##3##4##5##6##7##8##9##A##B##C##D##E{#3}% \endlocalcontrol \the\ctxluamatch\matchloopcommand{#1}{#2}% \beginlocalcontrol \popmacro\matchloopcommand \endlocalcontrol} +% \defineatluaend\ctxluamatch +% \defineatluaend\ctxluamatchfile + +%D \starttyping +%D \ctxluamatch +%D \Whatever +%D {(\letterpercent S+) *(\letterpercent S+) *(\letterpercent S+) *(\letterpercent S+)\letterpercent s*} +%D {\cldloadfile{crap.txt}} +%D \ctxluamatchfile +%D \Whatever +%D {(\letterpercent S+) *(\letterpercent S+) *(\letterpercent S+) *(\letterpercent S+)\letterpercent s*} +%D {crap.txt} +%D \stoptyping + %D \macros %D {newevery,everyline,EveryLine,EveryPar} %D @@ -3666,7 +3790,7 @@ \newtoks \neverypar \permanent\protected\def\forgeteverypar - {\everypar{\the\neverypar}} + {\everypar{\expand\neverypar}} %D Which we're going to use indeed! When the second argument equals \type {\relax}, %D the first token list is created unless it is already defined. @@ -3909,7 +4033,7 @@ %D We don't explicitly test if the macro is defined. \permanent\protected\def\assignifempty#1#2% - {\iftok{#1}\emptytoks \def#1{#2}\fi} + {\ifempty{#1}\def#1{#2}\fi} %D \macros %D {gobbleuntil,grabuntil,gobbleuntilrelax, @@ -4330,7 +4454,7 @@ \newtoks\AfterPar \permanent\protected\def\GetPar - {\expanded + {\normalexpanded {\dowithpar {\the\BeforePar \BeforePar\emptytoks} @@ -4339,7 +4463,7 @@ \AfterPar\emptytoks}}} \permanent\protected\def\GotoPar - {\expanded + {\normalexpanded {\dogotopar {\the\BeforePar \BeforePar\emptytoks}}} @@ -4525,14 +4649,22 @@ \permanent\protected\def\appendtoksonce#1\to#2% {\ifhasxtoks{#1}#2\else - \appendtoks#1\to#2% + \toksapp#2{#1}% \fi} \permanent\protected\def\prependtoksonce#1\to#2% - {\ifhasxtoks{#1}{#2}\m_syst_helpers_scratch\else - \prependtoks#1\to#2% + {\ifhasxtoks{#1}#2\else + \tokspre#2{#1}% \fi} +% Soon (check usage): +% +% \permanent\protected\def\appendtoks #1\to#2{\toksapp#2{#1}} +% \permanent\protected\def\prependtoks#1\to#2{\tokspre#2{#1}} +% +% \permanent\protected\def\appendtoksonce #1\to#2{\ifhasxtoks{#1}#2\else\toksapp#1{#1}\fi} +% \permanent\protected\def\prependtoksonce#1\to#2{\ifhasxtoks{#1}#2\else\tokspre#2{#1}\fi} + %D The test macro: \permanent\protected\def\doifelseintoks#1#2% #1 en #2 zijn toks @@ -5152,49 +5284,49 @@ \fi} \permanent\protected\def\doifnothing#1% - {\iftok{#1}\emptytoks + {\ifempty{#1}% \expandafter\firstofoneargument \else \expandafter\gobbleoneargument \fi} \permanent\protected\def\doifsomething#1% - {\iftok{#1}\emptytoks + {\ifempty{#1}% \expandafter\gobbleoneargument \else \expandafter\firstofoneargument \fi} \permanent\protected\def\doifelsenothing#1% - {\iftok{#1}\emptytoks + {\ifempty{#1}% \expandafter\firstoftwoarguments \else \expandafter\secondoftwoarguments \fi} \permanent\protected\def\doifelsesomething#1% - {\iftok{#1}\emptytoks + {\ifempty{#1}% \expandafter\secondoftwoarguments \else \expandafter\firstoftwoarguments \fi} \permanent\protected\def\doifvaluenothing#1% - {\iftok{\csname#1\endcsname}\emptytoks + {\ifempty{\csname#1\endcsname}% \expandafter\firstofoneargument \else \expandafter\gobbleoneargument \fi} \permanent\protected\def\doifvaluesomething#1% - {\iftok{\csname#1\endcsname}\emptytoks + {\ifempty{\csname#1\endcsname}% \expandafter\gobbleoneargument \else \expandafter\firstofoneargument \fi} \permanent\protected\def\doifelsevaluenothing#1% - {\iftok{\csname#1\endcsname}\emptytoks + {\ifempty{\csname#1\endcsname}% \expandafter\firstoftwoarguments \else \expandafter\secondoftwoarguments @@ -5243,7 +5375,7 @@ \def\syst_helpers_do_if_all_common_else#1#2#3#4% slow {\def\syst_helpers_do_common_check_all##1% - {\doifnotinset{##1}{#4}\donefalse + {\ifinset{##1}{#4}\else\donefalse\fi \ifdone\else\expandafter\quitcommalist\fi}% \donetrue \processcommalist[#3]\syst_helpers_do_common_check_all @@ -5339,14 +5471,16 @@ \let\syst_helpers_with_set_step\relax % maybe push pop \permanent\tolerant\protected\def\dodoubleemptywithset#1#*[#2]#*[#3]% - {\doifsomething{#2}% - {\def\syst_helpers_with_set_step##1{#1[##1][#3]}% - \processcommalist[#2]\syst_helpers_with_set_step}} + {\ifempty{#2}\else + \def\syst_helpers_with_set_step##1{#1[##1][#3]}% + \processcommalist[#2]\syst_helpers_with_set_step + \fi} \permanent\tolerant\protected\def\dotripleemptywithset#1#*[#2]#*[#3]#*[#4]% - {\doifsomething{#2}% - {\def\syst_helpers_with_set_step##1{#1[##1][#3][#4]}% - \processcommalist[#2]\syst_helpers_with_set_step}} + {\ifempty{#2}\else + \def\syst_helpers_with_set_step##1{#1[##1][#3][#4]}% + \processcommalist[#2]\syst_helpers_with_set_step + \fi} \aliased\let\dodoubleargumentwithset\dodoubleemptywithset \aliased\let\dotripleargumentwithset\dotripleemptywithset @@ -5582,19 +5716,12 @@ %D This command can be integrated in \type {\getparameters}, but we decided best not %D to do so. -% \protected\def\processassignlist#1[#2]#3% -% {\def\syst_helpers_process_assign_list_assign[##1=##2=##3]% -% {\doif{##3}\relax{#3{##1}}}% -% \def\syst_helpers_process_assign_list_step##1% -% {\syst_helpers_process_assign_list_assign[##1==\relax]}% -% \processcommalist[#2]\syst_helpers_process_assign_list_step} - \let\syst_helpers_process_assign_list_assign\gobbleoneoptional \let\syst_helpers_process_assign_list_step \gobbleoneargument \permanent\protected\def\processassignlist#1[#2]#3% {\def\syst_helpers_process_assign_list_assign[##1=##-=##2]% - {\doif{##2}\relax{#3{##1}}}% + {\iftok{##2}{\relax}#3{##1}\fi}% \def\syst_helpers_process_assign_list_step##1% {\syst_helpers_process_assign_list_assign[##1==\relax]}% \processcommalist[#2]\syst_helpers_process_assign_list_step} @@ -5891,8 +6018,8 @@ \newtoks\everysettrialtypesetting \newtoks\everyresettrialtypesetting -\permanent\protected\def\settrialtypesetting {\the\everysettrialtypesetting } % obeys grouping so -\permanent\protected\def\resettrialtypesetting{\the\everyresettrialtypesetting} % this one is seldom needed +\permanent\protected\def\settrialtypesetting {\expand\everysettrialtypesetting } % obeys grouping so +\permanent\protected\def\resettrialtypesetting{\expand\everyresettrialtypesetting} % this one is seldom needed \aliased\let\iftrialtypesetting\iffalse % so we have no \trialtypesettingtrue|false in mkiv ! @@ -5947,10 +6074,11 @@ %D \macros %D {dogobblesingleempty, dogobbledoubleempty} %D -%D These two macros savely grab and dispose two arguments. +%D These two macros savely grab and dispose two arguments. We also have a few +%D private ones defined earlier. -\permanent\tolerant\protected\def\dogobblesingleempty [#-]{} -\permanent\tolerant\protected\def\dogobbledoubleempty[#-]#*[#-]{} +\permanent\tolerant\protected\def\dogobbledoubleempty[#S#-]#*[#S#-]{} +\permanent\tolerant\protected\def\dogobblesingleempty [#S#-]{} \aliased\let\gobblesingleempty\dogobblesingleempty % also used \aliased\let\gobbledoubleempty\dogobbledoubleempty % also used @@ -6367,17 +6495,22 @@ %D Some old|-|time favourites: -\permanent\protected\def\dosetrawvalue #1#2#3{\defcsname #1#2\endcsname{#3}} -\permanent\protected\def\dosetrawevalue#1#2#3{\edefcsname #1#2\endcsname{#3}} -\permanent\protected\def\dosetrawgvalue#1#2#3{\global\defcsname #1#2\endcsname{#3}} -\permanent\protected\def\dosetrawxvalue#1#2#3{\global\edefcsname#1#2\endcsname{#3}} - -\permanent\protected\def\getrawparameters {\dogetparameters\dosetrawvalue } -\permanent\protected\def\getraweparameters {\dogetparameters\dosetrawevalue} -\permanent\protected\def\getrawgparameters {\dogetparameters\dosetrawgvalue} -\permanent\protected\def\getrawxparameters {\dogetparameters\dosetrawxvalue} +% \permanent\protected\def\dosetrawvalue #1#2#3{\defcsname #1#2\endcsname{#3}} +% \permanent\protected\def\dosetrawevalue#1#2#3{\edefcsname#1#2\endcsname{#3}} +% \permanent\protected\def\dosetrawgvalue#1#2#3{\gdefcsname#1#2\endcsname{#3}} +% \permanent\protected\def\dosetrawxvalue#1#2#3{\xdefcsname#1#2\endcsname{#3}} +% +% \permanent\protected\def\getrawparameters {\dogetparameters\dosetrawvalue } +% \permanent\protected\def\getraweparameters {\dogetparameters\dosetrawevalue} +% \permanent\protected\def\getrawgparameters {\dogetparameters\dosetrawgvalue} +% \permanent\protected\def\getrawxparameters {\dogetparameters\dosetrawxvalue} +% +% \permanent\protected\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete -\permanent\protected\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete +\aliased\let\getrawparameters \getparameters % obsolete +\aliased\let\getraweparameters\geteparameters % obsolete +\aliased\let\getrawgparameters\getgparameters % obsolete +\aliased\let\getrawxparameters\getxparameters % obsolete %D Sort of obsolete: @@ -6417,11 +6550,11 @@ \let\syst_helpers_test_feature_yes\relax \let\syst_helpers_test_feature_nop\relax -\permanent\def\currentfeaturetest{\number\c_syst_helpers_test_feature_n} +\permanent\def\currentfeaturetest{\the\c_syst_helpers_test_feature_n} \permanent\protected\def\testfeature#1#2% {\c_syst_helpers_test_feature_m\ifparameter#1\or#1\else\maxiterator\fi\relax - \enforced\xdef\elapsedsteps{\number\c_syst_helpers_test_feature_m}% + \enforced\xdef\elapsedsteps{\the\c_syst_helpers_test_feature_m}% \def\syst_helpers_test_feature_yes {\advanceby\c_syst_helpers_test_feature_n\plusone \ifnum\c_syst_helpers_test_feature_n>\c_syst_helpers_test_feature_m\else @@ -6443,12 +6576,12 @@ \clf_benchmarktimer \writestatus\m!system {starting feature test: % - \number\c_syst_helpers_test_feature_m\space steps}% + \the\c_syst_helpers_test_feature_m\space steps}% \c_syst_helpers_test_feature_n\zerocount \syst_helpers_test_feature_yes \writestatus\m!system {feature test done: % - \number\c_syst_helpers_test_feature_m\space steps, % + \the\c_syst_helpers_test_feature_m\space steps, % \clf_elapsedtime\space seconds, % \clf_elapsedsteptime\elapsedsteps\space\space per step}% \egroup} @@ -6493,13 +6626,15 @@ %D Maybe ... toksapp should deal with this ... -\permanent\protected\def\appendvalue #1#2% - {\defcsname#1\expandafter\expandafter\expandafter\endcsname\expandafter\expandafter\expandafter - {\begincsname#1\endcsname#2}} +\permanent\protected\def\appendvalue#1#2% + {\edefcsname#1\endcsname{% + \normalunexpanded\expandafter\expandafter\expandafter{\begincsname#1\endcsname}% + \normalunexpanded{#2}}} -\permanent\protected\def\prependvalue #1#2% - {\edefcsname#1\endcsname - {\normalunexpanded{#2}\expandafter\expandafter\expandafter\empty\begincsname#1\endcsname}} +\permanent\protected\def\prependvalue#1#2% + {\edefcsname#1\endcsname{% + \normalunexpanded{#2}% + \normalunexpanded\expandafter\expandafter\expandafter{\begincsname#1\endcsname}}} \permanent\protected\def\appendgvalue #1#2{\global\appendvalue} \permanent\protected\def\prependgvalue#1#2{\global\prependvalue} @@ -6519,19 +6654,44 @@ %D %D \typebuffer \blank \getbuffer \blank +%D We have a better splitter at the \LUA\ end. + +\integerdef\c_helpers_range_min\zerocount +\integerdef\c_helpers_range_max\zerocount + +\lettonothing\m_helpers_range_action + \def\syst_helpers_with_range#1% {\splitstring#1\at:\to\m_syst_helpers_range_from\and\m_syst_helpers_range_to - \ifempty\m_syst_helpers_range_to\let\m_syst_helpers_range_to\m_syst_helpers_range_from\fi + \ifx\m_syst_helpers_range_from\wildcardsymbol + \edef\m_syst_helpers_range_from{\number\c_helpers_range_min}% + \fi + \ifx\m_syst_helpers_range_to\wildcardsymbol + \edef\m_syst_helpers_range_to{\number\c_helpers_range_max}% + \fi + \ifempty\m_syst_helpers_range_to + \let\m_syst_helpers_range_to\m_syst_helpers_range_from + \fi \dostepwiserecurse\m_syst_helpers_range_from\m_syst_helpers_range_to\plusone{\m_helpers_range_action{##1}}}% \permanent\protected\def\processranges[#1]#2% #1= n:m,p,q:r {\def\m_helpers_range_action{#2}% + \integerdef\c_helpers_range_min\zerocount + \integerdef\c_helpers_range_max\zerocount \processcommacommand[#1]\syst_helpers_with_range} -\permanent\protected\def\dowithrange#1#2% +\permanent\protected\def\dowithrange#1#2% set action {\def\m_helpers_range_action{#2}% + \integerdef\c_helpers_range_min\zerocount + \integerdef\c_helpers_range_max\zerocount \processcommacommand[#1]\syst_helpers_with_range} +\permanent\protected\def\dowithminmaxrange#1#2#3#4% min max set action + {\def\m_helpers_range_action{#4}% + \integerdef\c_helpers_range_min#1\relax + \integerdef\c_helpers_range_max#2\relax + \processcommacommand[#3]\syst_helpers_with_range} + % \def\DoSomething#1{ [item #1] } % \dowithrange[1,4:5]\DoSomething @@ -6597,21 +6757,21 @@ \protected\def\signalcharacter{\char\zerocount} % \zwj -%D A few secial variants of commands defined here. Some more will be moved here (e.g. -%D from table modules. - -\permanent\def\dodirectdoubleempty#1#2% used in math (lookahead issues) - {\ifx#2[% - \expandafter\syst_helpers_direct_double_empty_one_yes - \else - \expandafter\syst_helpers_direct_double_empty_one_nop - \fi#1#2} - -\def\syst_helpers_direct_double_empty_one_yes#1[#2]#3% - {\ifx#3[\else\expandafter\syst_helpers_direct_double_empty_two_nop\fi#1[#2]#3} - -\def\syst_helpers_direct_double_empty_one_nop#1{#1[][]} -\def\syst_helpers_direct_double_empty_two_nop#1[#2]{#1[#2][]} +% %D A few secial variants of commands defined here. Some more will be moved here +% %D e.g.from the table modules. This code is no longer needed. +% +% \permanent\def\dodirectdoubleempty#1#2% used in math (lookahead issues) +% {\ifx#2[% +% \expandafter\syst_helpers_direct_double_empty_one_yes +% \else +% \expandafter\syst_helpers_direct_double_empty_one_nop +% \fi#1#2} +% +% \def\syst_helpers_direct_double_empty_one_yes#1[#2]#3% +% {\ifx#3[\else\expandafter\syst_helpers_direct_double_empty_two_nop\fi#1[#2]#3} +% +% \def\syst_helpers_direct_double_empty_one_nop#1{#1[][]} +% \def\syst_helpers_direct_double_empty_two_nop#1[#2]{#1[#2][]} % %D Used in math definitions (in an \type {\edef}). This will be replaced. % %D @@ -6904,4 +7064,9 @@ \expandafter\secondoftwoarguments \fi} +%D Here (can become primitive): + +\untraced\permanent\protected\def\glyphscaled#1% name will change + {\dimexpr#1*\plusthousand/\glyphscale\relax} + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-con.lmt b/Master/texmf-dist/tex/context/base/mkxl/syst-con.lmt new file mode 100644 index 00000000000..d67a898fc3d --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-con.lmt @@ -0,0 +1,156 @@ +if not modules then modules = { } end modules ['syst-con'] = { + version = 1.001, + comment = "companion to syst-con.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local tonumber, tostring = tonumber, tostring +local math = math +local utfchar = utf.char +local gsub = string.gsub +local concat, reverse, sort = table.concat, table.reverse, table.sort + +converters = converters or { } +local converters = converters + +local context = context +local commands = commands +local implement = interfaces.implement + +local formatters = string.formatters + +function converters.hexstringtonumber(n) tonumber(n,16) end +function converters.octstringtonumber(n) tonumber(n, 8) end + +local f_lchexnumber = formatters["%x"] +local f_uchexnumber = formatters["%X"] +local f_lchexnumbers = formatters["%02x"] +local f_uchexnumbers = formatters["%02X"] +local f_octnumber = formatters["%03o"] +local nicenumber = formatters["%0.6F"] -- or N + +local lchexnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_lchexnumber (n) end +local uchexnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_uchexnumber (n) end +local lchexnumbers = function(n) if n < 0 then n = 0x100000000 + n end return f_lchexnumbers(n) end +local uchexnumbers = function(n) if n < 0 then n = 0x100000000 + n end return f_uchexnumbers(n) end +local octnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_octnumber (n) end + +converters.lchexnumber = lchexnumber +converters.uchexnumber = uchexnumber +converters.lchexnumbers = lchexnumbers +converters.uchexnumbers = uchexnumbers +converters.octnumber = octnumber +converters.nicenumber = nicenumber + +implement { name = "hexstringtonumber", actions = { tonumber, context }, arguments = { "integer", 16 } } +implement { name = "octstringtonumber", actions = { tonumber, context }, arguments = { "integer", 8 } } + +implement { name = "rawcharacter", actions = function(n) context(utfchar(0x110000+n)) end, arguments = "integer" } + +implement { name = "lchexnumber", actions = { lchexnumber, context }, arguments = "integer" } +implement { name = "uchexnumber", actions = { uchexnumber, context }, arguments = "integer" } +implement { name = "lchexnumbers", actions = { lchexnumbers, context }, arguments = "integer" } +implement { name = "uchexnumbers", actions = { uchexnumbers, context }, arguments = "integer" } +implement { name = "octnumber", actions = { octnumber, context }, arguments = "integer" } + +-- replaced by posits + +implement { name = "sin", actions = { math.sin, nicenumber, context }, arguments = "number" } +implement { name = "cos", actions = { math.cos, nicenumber, context }, arguments = "number" } +implement { name = "tan", actions = { math.tan, nicenumber, context }, arguments = "number" } + +implement { name = "sind", actions = { math.sind, nicenumber, context }, arguments = "number" } +implement { name = "cosd", actions = { math.cosd, nicenumber, context }, arguments = "number" } +implement { name = "tand", actions = { math.tand, nicenumber, context }, arguments = "number" } + +-- only as commands + +function commands.format(fmt,...) context((gsub(fmt,"@","%%")),...) end + +implement { + name = "formatone", -- used as such so no name change here + public = true, + semiprotected = true, + arguments = "2 strings", + actions = function(f,s) context((gsub(f,"@","%%")),s) end, +} + +local function tobits(b,w,d) + local t = { } + if not w then + w = 32 + end + local m = d + local k = 0 + for i=1,w do + k = k + 1 ; t[k] = (b & 0x1) == 1 and "1" or "0" + if m then + m = m - 1 + if m == 0 then + k = k + 1 ; t[k] = " " + m = d + end + end + b = b >> 1 + end + if t[k] == " " then + t[k] = nil + end + return concat(reverse(t)) +end + +implement { + name = "tobits", + public = true, + arguments = "3 integers", + actions = function(w,d,n) context(tobits(n,w,d)) end, -- fast enough +} + +do + + local round, log = math.round, math.log + + implement { + name = "tobit", + public = true, + arguments = "integer", + actions = function(n) + context(n > 0 and (round(log(n,2)) + 1) or 0) + end, + } + +end + +implement { + name = "tohexa", + public = true, + arguments = "2 integers", + actions = function(w,n) context("0x%0"..w.."X",n) end, -- somewhat slow +} + +interfaces.implement { + name = "showbits", + public = true, + arguments = { "string", "integer" }, + actions = function(s,n) + local b = tex[s] + if type(b) == "table" then + local t = { } + for i=1,32 do + if (n & 0x1) == 1 then + local f = b[1<<(i-1)] + if f then + t[#t+1] = tostring(f) + end + end + n = n >> 1 + end + if #t > 0 then + sort(t) + context("% t",t) + end + end + end, +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-con.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-con.mkxl index ed4a4f3c5a7..0b88f8ddf6e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/syst-con.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-con.mkxl @@ -41,13 +41,6 @@ \permanent\def\hexstringtonumber#1{\clf_hexstringtonumber\numexpr#1\relax} \permanent\def\octstringtonumber#1{\clf_octstringtonumber\numexpr#1\relax} -%D \macros{rawcharacter} -%D -%D This macro can be used to produce proper 8 bit characters that we sometimes need -%D in backends and round||trips. - -\permanent\def\rawcharacter#1{\clf_rawcharacter\numexpr#1\relax} - %D \macros{twodigits, threedigits} %D %D These macros provides two or three digits always: @@ -85,4 +78,12 @@ %D The \type {\modulatednumber} and \type {\realnumber} macros have been removed. +%D \macros{tobits} +%D +%D Thso macro expects a number of bits, chunk size and the number. +%D +%D \starttyping +%D \tobits 32 4 "00000003 +%D \stoptyping + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl index d55a821758d..991f75cd8e0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl @@ -141,6 +141,8 @@ \immutable\integerdef\hyphenasciicode 45 \immutable\integerdef\periodasciicode 46 \immutable\integerdef\forwardslashasciicode 47 % / +\immutable\integerdef\zeroasciicode 48 +\immutable\integerdef\nineasciicode 57 \immutable\integerdef\colonasciicode 58 \immutable\integerdef\semicolonasciicode 59 \immutable\integerdef\lessthanasciicode 60 % < used as alternative verbatim { @@ -152,6 +154,8 @@ \immutable\integerdef\rightbracketasciicode 93 \immutable\integerdef\circumflexasciicode 94 \immutable\integerdef\underscoreasciicode 95 +\immutable\integerdef\alowercaseasciicode 97 +\immutable\integerdef\zlowercaseasciicode 122 \immutable\integerdef\leftbraceasciicode 123 % `\{ \immutable\integerdef\barasciicode 124 % `\| \immutable\integerdef\rightbraceasciicode 125 % `\} @@ -231,9 +235,9 @@ \immutable\letcharcode \tildeasciicode \ % tilde \immutable\letcharcode \spaceasciicode \space % space -\immutable\defcsname\Uchar\tabasciicode \endcsname {\ } % \def\^^I{\ } tab -\immutable\defcsname\Uchar\formfeedasciicode \endcsname {\par} % \def\^^L{\par} formfeed -\immutable\defcsname\Uchar\endoflineasciicode\endcsname {\ } % \def\^^M{\ } return +\immutable\defcsname\tocharacter\tabasciicode \endcsname {\ } % \def\^^I{\ } tab +\immutable\defcsname\tocharacter\formfeedasciicode \endcsname {\par} % \def\^^L{\par} formfeed +\immutable\defcsname\tocharacter\endoflineasciicode\endcsname {\ } % \def\^^M{\ } return %D For now: @@ -314,10 +318,10 @@ \permanent\countdef\c_syst_min_allocated_attribute = 207 \c_syst_min_allocated_attribute = 1024 % 0-1023 : private \permanent\countdef\c_syst_max_allocated_attribute = 208 \c_syst_min_allocated_attribute = \directlua{tex.write(tex.magicconstants.max_attribute_register_index)} % 65535 % no allocator, managed differently -\permanent\countdef\c_syst_max_allocated_count = 211 \c_syst_max_allocated_count = \directlua{tex.write(tex.magicconstants.max_int_register_index)} % 65535 % is adapted later on -\permanent\countdef\c_syst_max_allocated_dimen = 212 \c_syst_max_allocated_dimen = \directlua{tex.write(tex.magicconstants.max_dimen_register_index)} % idem +\permanent\countdef\c_syst_max_allocated_count = 211 \c_syst_max_allocated_count = \directlua{tex.write(tex.magicconstants.max_integer_register_index)} % 65535 % is adapted later on +\permanent\countdef\c_syst_max_allocated_dimen = 212 \c_syst_max_allocated_dimen = \directlua{tex.write(tex.magicconstants.max_dimension_register_index)} % idem \permanent\countdef\c_syst_max_allocated_skip = 213 \c_syst_max_allocated_skip = \directlua{tex.write(tex.magicconstants.max_glue_register_index)} % idem -\permanent\countdef\c_syst_max_allocated_muskip = 214 \c_syst_max_allocated_muskip = \directlua{tex.write(tex.magicconstants.max_mu_glue_register_index)} % idem +\permanent\countdef\c_syst_max_allocated_muskip = 214 \c_syst_max_allocated_muskip = \directlua{tex.write(tex.magicconstants.max_muglue_register_index)} % idem \permanent\countdef\c_syst_max_allocated_box = 215 \c_syst_max_allocated_box = \directlua{tex.write(tex.magicconstants.max_box_register_index)} % idem \permanent\countdef\c_syst_max_allocated_toks = 216 \c_syst_max_allocated_toks = \directlua{tex.write(tex.magicconstants.max_toks_register_index)} % idem \permanent\countdef\c_syst_max_allocated_read = 217 \c_syst_max_allocated_read = \c_syst_max_allocated_iohandle @@ -344,9 +348,11 @@ \immutable\integerdef\normalpagebox 255 % hardcoded in pdftex/xetex -\immutable\integerdef\statuswrite \minusone +\immutable\integerdef\statuswrite \minusone -\immutable\dimensiondef\zeropoint 0pt +\immutable\dimensiondef\zeropoint 0pt + +\immutable\positdef\zerofloat 0 %D These alternatives avoid the indirect references. Don't use these for generic %D code because one never knows what happens elsewhere. @@ -417,7 +423,7 @@ % %D The next definitions are really needed (in \CONTEXT): -\newlinechar\newlineasciicode \permanent\edef\outputnewlinechar{\Uchar\newlineasciicode} % {^^J} +\newlinechar\newlineasciicode \permanent\edef\outputnewlinechar{\tocharacter\newlineasciicode} % {^^J} %D One reason to start high with allocation is that it permits us to allocate %D consecutive ranges more easily, for instance if for \MPLIB\ we want to allocate a @@ -494,6 +500,7 @@ %D intrude on normal scratch ones. \newinteger \scratchcounter \newinteger \globalscratchcounter \newinteger \privatescratchcounter +\newposit \scratchfloat \newposit \globalscratchfloat \newposit \privatescratchfloat \newdimension\scratchdimen \newdimension\globalscratchdimen \newdimension\privatescratchdimen \newgluespec \scratchskip \newgluespec \globalscratchskip \newgluespec \privatescratchskip \newmuskip \scratchmuskip \newmuskip \globalscratchmuskip \newmuskip \privatescratchmuskip @@ -501,6 +508,7 @@ \newbox \scratchbox \newbox \globalscratchbox \newbox \privatescratchbox \newinteger \scratchcounterone \newinteger \scratchcountertwo \newinteger \scratchcounterthree +\newposit \scratchfloatone \newposit \scratchfloattwo \newposit \scratchfloatthree \newdimension\scratchdimenone \newdimension\scratchdimentwo \newdimension\scratchdimenthree \newgluespec \scratchskipone \newgluespec \scratchskiptwo \newgluespec \scratchskipthree \newmuskip \scratchmuskipone \newmuskip \scratchmuskiptwo \newmuskip \scratchmuskipthree @@ -508,6 +516,7 @@ \newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree \newinteger \scratchcounterfour\newinteger \scratchcounterfive \newinteger \scratchcountersix +\newposit \scratchfloatfour \newposit \scratchfloatfive \newposit \scratchfloatsix \newdimension\scratchdimenfour \newdimension\scratchdimenfive \newdimension\scratchdimensix \newgluespec \scratchskipfour \newgluespec \scratchskipfive \newgluespec \scratchskipsix \newmuskip \scratchmuskipfour \newmuskip \scratchmuskipfive \newmuskip \scratchmuskipsix @@ -571,6 +580,11 @@ \newinteger\scratchmax \newinteger\scratchunicode +\newinteger\scratchunicodeone +\newinteger\scratchunicodetwo +\newinteger\scratchunicodethree + +\newinteger\scratchclass \newdimension\scratchleftskip \newdimension\scratchrightskip @@ -599,17 +613,20 @@ \immutable\dimensiondef \scaledpoint 1sp \immutable\dimensiondef \thousandpoint 1000pt -\immutable\gluespecdef \zeroskip \zeropoint plus \zeropoint minus \zeropoint -\immutable\gluespecdef \centeringskip \zeropoint plus \thousandpoint minus \thousandpoint -\immutable\gluespecdef \stretchingskip \zeropoint plus \thousandpoint -\immutable\gluespecdef \shrinkingskip \zeropoint minus \thousandpoint -\immutable\gluespecdef \centeringfillskip \zeropoint plus 1fill minus 1fill -\immutable\gluespecdef \stretchingfillskip \zeropoint plus 1fill -\immutable\gluespecdef \shrinkingfillskip \zeropoint minus 1fill - -\immutable\mugluespecdef \zeromuskip 0mu -\immutable\mugluespecdef \onemuskip 1mu -\immutable\mugluespecdef \muquad 18mu +\immutable\gluespecdef \zeroskip \zeropoint plus \zeropoint minus \zeropoint +\immutable\gluespecdef \centeringskip \zeropoint plus \thousandpoint minus \thousandpoint +\immutable\gluespecdef \stretchingskip \zeropoint plus \thousandpoint +\immutable\gluespecdef \shrinkingskip \zeropoint minus \thousandpoint +\immutable\gluespecdef \centeringfillskip \zeropoint plus 1fill minus 1fill +\immutable\gluespecdef \stretchingfillskip \zeropoint plus 1fill +\immutable\gluespecdef \shrinkingfillskip \zeropoint minus 1fill +\immutable\gluespecdef \centeringfilllskip \zeropoint plus 1filll minus 1filll +\immutable\gluespecdef \stretchingfilllskip \zeropoint plus 1filll +\immutable\gluespecdef \shrinkingfilllskip \zeropoint minus 1filll + +\immutable\mugluespecdef \zeromuskip 0mu +\immutable\mugluespecdef \onemuskip 1mu +\immutable\mugluespecdef \muquad 18mu \aliased\let\points \onepoint \aliased\let\halfpoint\halfapoint @@ -767,17 +784,20 @@ % % We wrap all into one macro (the frozen stuff adds 10% runtime): -\permanent\protected\def\newif#1% - {\permanent\protected\gdefcsname\expandafter\new_if_check\csstring#1true\endcsname {\overloaded\frozen\let#1\iftrue }% - \permanent\protected\gdefcsname\expandafter\new_if_check\csstring#1false\endcsname{\overloaded\frozen\let#1\iffalse}% - \csname\expandafter\new_if_check\csstring#1false\endcsname} +\permanent\protected\def\new_if_define#1#2% + {\permanent\protected\gdefcsname\expandafter\new_if_check\csstring#2true\endcsname {\enforced#1#2\iftrue }% + \permanent\protected\gdefcsname\expandafter\new_if_check\csstring#2false\endcsname{\enforced#1#2\iffalse}% + \csname\expandafter\new_if_check\csstring#2false\endcsname} \normalexpanded{\gdef\noexpand\new_if_check\string i\string f{}} +\permanent\protected\def\newif {\new_if_define\let } +\permanent\protected\def\globalnewif{\new_if_define\glet} + %D Let's test this one: -\newif\ifdone -\newif\iffound +\newif\ifdone \globalnewif\ifglobaldone +\newif\iffound \globalnewif\ifglobalfound \newif\ifscratchcondition \newif\ifscratchconditionone @@ -802,10 +822,10 @@ %D Constants to be used with \type {\interactionmode}. -\immutable\integerdef\batchmodecode \zerocount -\immutable\integerdef\nonstopmodecode \plusone -\immutable\integerdef\scrollmodecode \plustwo -\immutable\integerdef\errorstopmodecode \plusthree +% \immutable\integerdef\batchmodecode \zerocount +% \immutable\integerdef\nonstopmodecode \plusone +% \immutable\integerdef\scrollmodecode \plustwo +% \immutable\integerdef\errorstopmodecode \plusthree %D Of course we want even bigger log files, so we copied this from the \ETEX\ %D source files. @@ -884,8 +904,8 @@ %D This is only used when we load \CONTEXT. Nesting is not supported here. \permanent\def\pushoverloadmode - {\enforced\permanent\protected\edef\popoverloadmode{\overloadmode\the\overloadmode\enforced\let\popoverloadmode\relax}% - \overloadmode\zerocount} + {\enforced\permanent\protected\edef\popoverloadmode{\normaloverloadmode\the\normaloverloadmode\enforced\let\popoverloadmode\relax}% + \normaloverloadmode\zerocount} \aliased\let\popoverloadmode\relax @@ -930,7 +950,7 @@ %D \type{\setfalse}: %D %D \starttyping -%D \settrue\doublesided +%D \doublesided\conditionaltrue %D \setfalse %D \stoptyping %D while testing is accomplished by: @@ -1166,11 +1186,11 @@ %D Sometimes kerns make more sense than glue but we need to be in the right mode: -\permanent\protected\def\vkern {\ifhmode\par \fi\kern} -\permanent\protected\def\hkern {\ifvmode\dontleavehmode\fi\kern} +\ifdefined\vkern \else \permanent\protected\def\vkern {\ifhmode\par \fi\kern} \fi +\ifdefined\hkern \else \permanent\protected\def\hkern {\ifvmode\dontleavehmode\fi\kern} \fi -\permanent\protected\def\vpenalty{\ifhmode\par \fi\penalty} -\permanent\protected\def\hpenalty{\ifvmode\dontleavehmode\fi\penalty} +\ifdefined\vpenalty \else \permanent\protected\def\vpenalty{\ifhmode\par \fi\penalty} \fi +\ifdefined\hpenalty \else \permanent\protected\def\hpenalty{\ifvmode\dontleavehmode\fi\penalty} \fi %D Again a few kind-of-extensions the core. These come from plain \TEX\ but are %D probably not used in \CONTEXT. @@ -1245,7 +1265,7 @@ \newcount\c_syst_helpers_n_of_namespaces \c_syst_helpers_n_of_namespaces\pluseight % 1-8 reserved for catcodes -\def\v_interfaces_prefix_template_system{\number \c_syst_helpers_n_of_namespaces>>} +\def\v_interfaces_prefix_template_system{\the \c_syst_helpers_n_of_namespaces>>} %def\v_interfaces_prefix_template_system{\characters\c_syst_helpers_n_of_namespaces>>} % no \characters yet \protected\def\installsystemnamespace#1% will be redefined @@ -1258,15 +1278,95 @@ %D It makes more sense to have these here: -\aliased\let\normalsuperscript \Usuperscript -\aliased\let\normalsubscript \Usubscript -\aliased\let\normalprimescript \Uprimescript -\aliased\let\normalnosuperscript\Unosuperscript -\aliased\let\normalnosubscript \Unosubscript -\aliased\let\normalstartimath \Ustartmath -\aliased\let\normalstopimath \Ustopmath -\aliased\let\normalstartdmath \Ustartdisplaymath -\aliased\let\normalstopdmath \Ustopdisplaymath +\aliased\let\normalstartimath \Ustartmath +\aliased\let\normalstopimath \Ustopmath +\aliased\let\normalstartdmath \Ustartdisplaymath +\aliased\let\normalstopdmath \Ustopdisplaymath + +\aliased\let\normalUchar \tocharacter + +% These are the old U* commands: + +\aliased\let\Usuperscript \superscript +\aliased\let\Usubscript \subscript +\aliased\let\Uprimescript \primescript +\aliased\let\Unosuperscript \nosuperscript +\aliased\let\Unosubscript \nosubscript +\aliased\let\Usuperprescript \superprescript +\aliased\let\Usubprescript \subprescript +\aliased\let\Unosuperprescript \nosuperprescript +\aliased\let\Unosubprescript \nosubprescript + +\aliased\let\Ustack \mathstack +\aliased\let\Umathdict \mathdictionary +\aliased\let\Umathclass \mathclass + +\aliased\let\Ustyle \givenmathstyle + +\aliased\let\Uchar \tocharacter + +% Todo: + +% \aliased\let\Umathchar \mathcharacter +% \aliased\let\Umathchardef \mathcharacterdef +% \aliased\let\Umathdictdef \mathdictionarydef +% \aliased\let\Umathchardef \mathcharacterdef + +% \aliased\let\Udelimited \mathdelimited % left right math +% \aliased\let\Udelimiterover \mathdelimiterover % top math +% \aliased\let\Udelimiterunder \mathdelimiterunder % bottom math + +% \aliased\let\Uhextensible \mathhextensible % middle +% \aliased\let\Uoverdelimiter \mathoverdelimiter % top math +% \aliased\let\Uunderdelimiter \mathunderdelimiter % bottom math + +% \aliased\let\Uradical \mathdelimitedradical % left math +% \aliased\let\Uroot \mathdelimitedroot % left degree math +% \aliased\let\Urooted \mathdelimitedrooted % left right degree math + +% \aliased\let\Uabove \mathabove +% \aliased\let\Uabovewithdelims \mathabovewithdelims +% \aliased\let\Uatop \mathatop +% \aliased\let\Uatopwithdelims \mathatopwithdelims +% \aliased\let\Uover \mathover +% \aliased\let\Uoverwithdelims \mathoverwithdelims +% \aliased\let\Uskewed \mathskewed +% \aliased\let\Uskewedwithdelims \mathskewedwithdelims +% \aliased\let\Ustretched \mathstretched +% \aliased\let\Ustretchedwithdelims \mathstretchedwithdelims + +% \aliased\let\Uleft \mathleftfence +% \aliased\let\Umiddle \mathmiddlefence +% \aliased\let\Uoperator \mathoperator +% \aliased\let\Uright \mathrightfence +% \aliased\let\Uvextensible \mathvextensible + +% \aliased\let\overline \mathoverline +% \aliased\let\underline \mathunderline + +% \aliased\let\Udelimiter \Umathdelimiter +% \aliased\let\Umathaccent \Umathaccented +% \aliased\let\Udelcode \mathdelimitercode +% \aliased\let\Umathcode \mathcharactercode + +% \aliased\let\Umathadapttoleft \mathadapttoleft +% \aliased\let\Umathadapttoright \mathadapttoright +% \aliased\let\Umathlimits \mathlimits +% \aliased\let\Umathnoaxis \mathnoaxis +% \aliased\let\Umathnolimits \mathnolimits +% \aliased\let\Umathopenupdepth \mathopenupdepth +% \aliased\let\Umathopenupheight \mathopenupheight +% \aliased\let\Umathphantom \mathphantom +% \aliased\let\Umathsource \mathsource +% \aliased\let\Umathuseaxis \mathuseaxis +% \aliased\let\Umathvoid \mathvoid + +% \aliased\let\Ustartdisplaymath \mathstartdisplaymath % otherwise conflict +% \aliased\let\Ustartmath \mathstartmath % idem +% \aliased\let\Ustartmathmode \mathstartmathmode % idem +% \aliased\let\Ustopdisplaymath \mathstopdisplaymath % idem +% \aliased\let\Ustopmath \mathstopmath % idem +% \aliased\let\Ustopmathmode \mathstopmathmode % idem %D Also better here: @@ -1482,10 +1582,30 @@ \let\ifexpression\ifnumexpression -%D This will be default: +%D So we register implicit (newline) pars. When we set bit 2 and define a macro +%D with \type {\par} as delimiter, an explicit \par is expected and newline pars +%D are then part of the argument. + +% newline : +% bit 1: text +% set : +% unset: par_loc +% bit 2: macro +% set : par_command_match +% unset: use token +% bit 3: go on +% set : don't increment loc +% unset: increment loc +% +% default: +% inject : par_loc +% macro : use token +% input : increment loc +% +% only bit 1 set: macros work with \par as normal +% when also bit 2 set: embedded empty lines grabbed too -\autoparagraphmode\plusone % we need at least 1 in order to be able to switch to 2 -%autoparagraphmode\plustwo % because we define two \par delimited macros +\autoparagraphmode\plusone %D The same values apply as \type {\shownodedetails}. When set the box is shown in %D the the log file but that is pretty slow when we have much detail. @@ -1500,4 +1620,71 @@ \ifdefined\mathpunctuation \else \let\mathpunctuation\mathpunct \fi % fixed in 2.10.06 +%D We keep this for a while (suggested correction by KB): + +\ifdefined\linebreakcriterion \aliased\let\linebreakcriterium \linebreakcriterion \fi +\ifdefined\ignoredepthcriterion \aliased\let\ignoredepthcriterium\ignoredepthcriterion \fi + +%D Special purpose: + +\permanent\protected\def\if_false{\iffalse} +\permanent\protected\def\if_true {\iftrue} + +%D Pseudo primitives: + +\permanent\untraced\def\localcontrolledrepeating{\localcontrolledrepeat\maxcount} +\permanent\untraced\def\expandedrepeating {\expandedrepeat \maxcount} +\permanent\untraced\def\unexpandedrepeating {\unexpandedrepeat \maxcount} + +\aliased\let\lastchkinteger\lastchknumber +\aliased\let\ifchkinteger \ifchknumber + +%D Let's be neat: + +\permanent\untraced\def\userunitcode#1#2% + {\numexpr(`#1-\alowercaseasciicode)*26+(`#2-\alowercaseasciicode)\relax} + +\permanent\protected\def\newuserunit#1#2#3% + {\associateunit#1=\numexpr(`#2-\alowercaseasciicode)*26+(`#3-\alowercaseasciicode)\relax} + +\newdimension\piunit \piunit 3.1415926535898pt % 205887sp % for Mikael +\newdimension\ftunit \ftunit 12in % foot % for Alan +\newdimension\uunit \uunit 1cm + +\newuserunit \piunit pi +\newuserunit \ftunit ft +\newuserunit \uunit uu + +%D We enable special escapes: + +\parametermode \plusone + +%D While the buildbot is down: + +\ifdefined\protecteddetokenize\else + \aliased\let\protecteddetokenize\detokenize +\fi + +%D Consistency: + +\let\boxwidth \wd +\let\boxheight\ht +\let\boxdepth \dp + +%D Because we use the variable class: + +\variablefam-\plustwo % obey class 7 + \protect \endinput + +% performance experiment: +% +% \def\footest +% {\iftrue +% \relax\relax\relax\relax\relax\relax\relax\relax\relax\relax +% \relax\relax\relax\relax\relax\relax\relax\relax\relax\relax +% % \quitfinow\ignorerest % n=11000000 : 0.304 -> 0.224 +% \else +% \relax\relax\relax\relax\relax\relax\relax\relax\relax\relax +% \relax\relax\relax\relax\relax\relax\relax\relax\relax\relax +% \fi} diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt index 0f80f57d3e7..a3b897f26b5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt @@ -58,8 +58,7 @@ local ctx_secondoftwoarguments = context.secondoftwoarguments local ctx_firstofoneargument = context.firstofoneargument local ctx_gobbleoneargument = context.gobbleoneargument -local values = tokens.values -local boolean_code = values.boolean +local boolean_value = tokens.values.boolean implement { -- will be overloaded later name = "writestatus", @@ -504,11 +503,32 @@ do end, } + implement { + name = "readlinedirect", + public = true, + untraced = true, + actions = function(prefix) + local n = scaninteger() + local c = channels[n] + if scankeyword("line") and c then + c:gotoline(scaninteger()) + end + local s = c and c:reader() + if s then + local e = texgetcount("endlinechar") -- we can have tex.endline if needed + if e > 0 then -- forget about 0 + s = s .. char(e) + end + context(s) + else + channels[n] = false + end + end, + } + -- This one uses the special lua condition option which is kind of experimental -- but seems to work fine. - local boolean_value = tokens.values.boolean - implement { name = "ifeof", public = true, diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl index 4b60ee59f53..88bcc16e626 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl @@ -57,7 +57,7 @@ % \def\luaexpr #1{\ctxlua {context (tostring(#1))}} % more efficient: % \permanent\def\luaexpr #1{\ctxlua {tex.print(tostring(#1))}} % no use is shortcutting has to be compiled -\tolerant\permanent\edef\luaexpr[#1]#:#2{\noexpand\cldcontext{\noexpand\iftok{#1}\noexpand\emptytoks\noexpand\else"\letterpercent #1",\noexpand\fi#2}} +\tolerant\permanent\edef\luaexpr[#1]#:#2{\noexpand\cldcontext{\noexpand\ifempty{#1}\noexpand\else"\letterpercent #1",\noexpand\fi#2}} %D But as we only use write 16 we could as well do all in \LUA\ and ignore the rest. %D Okay, we still can do writes here but only when not blocked. diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt b/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt index bd1d8476ff6..ecf93c740ae 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt @@ -20,6 +20,7 @@ local insert, remove = table.insert, table.remove local pushmacrotoken = token.pushmacro local popmacrotoken = token.popmacro local scancsname = token.scancsname +local scancstoken = token.scancstoken local createtoken = token.create local gobbletoken = token.gobble @@ -52,12 +53,15 @@ end tokens.pushmacro = pushmacro tokens.popmacro = popmacro +local scancs = scancsname +-- scancs = scancstoken -- saves a lookup and also seems to work okay, not much faster + implement { name = "localpushmacro", public = true, protected = true, actions = function() - pushmacro(scancsname()) + pushmacro(scancs()) end } @@ -66,7 +70,7 @@ implement { public = true, protected = true, actions = function() - pushmacro(scancsname(),true) + pushmacro(scancs(),true) end } @@ -75,7 +79,7 @@ implement { public = true, protected = true, actions = function() - popmacro(scancsname()) + popmacro(scancs()) end } @@ -84,7 +88,7 @@ implement { public = true, protected = true, actions = function() - popmacro(scancsname()) + popmacro(scancs()) end } @@ -93,7 +97,7 @@ implement { public = true, protected = true, actions = function() - local n = scancsname() + local n = scancs() local s = stack[n] local m = #s report("%s : %i stack slots used",n,m) diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-ali.lmt b/Master/texmf-dist/tex/context/base/mkxl/tabl-ali.lmt new file mode 100644 index 00000000000..05f100aeef4 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-ali.lmt @@ -0,0 +1,82 @@ +if not modules then modules = { } end modules ['tabl-ali'] = { + version = 1.001, + comment = "companion to tabl-ali.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local next, tonumber = next, tonumber +local find, match = string.find, string.match + +local data = false +local user = false + +local dimension_code = tokens.values.dimension + +local function align_point_delta(n,m) + + -- better use the official position interface + + if not data then + user = (job.positions.collected or { }).user or { } + data = { } + -- for k, v in table.sortedhash(user) do + for k, v in next, user do + if find(k,"^ap::") then + local p = v.p + local n = tonumber(match(k,"ap::(%d+):")) + if n then + local dn = data[n] + if not dn then + dn = { } + data[n] = dn + end + local dp = dn[p] + if not dp then + dp = { } + dn[p] = dp + end + dp[#dp+1] = v.x + end + end + end + + for k, v in next, data do + local max = false + for kk, vv in next, v do + for i=1,#vv do + local x = vv[i] + if not max or x > max then + max = x + end + end + v[kk] = max + end + end + + end + + local d = data[n] + + if d then + local u = user["ap::"..n..":"..m] + if u then + -- we could clean up previous pages but it's not worth the trouble + local x = u.x + local p = u.p + local m = d[p] + if m and m > x then + return dimension_code, m - x + end + end + end + return dimension_code, 0 +end + +interfaces.implement { + name = "align_point_delta", + arguments = "2 integers", + usage = "value", + actions = align_point_delta +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-ali.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-ali.mkxl new file mode 100644 index 00000000000..159e4dfcbb7 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-ali.mkxl @@ -0,0 +1,46 @@ +%D \module +%D [ file=core-ali, +%D version=2023.06.15, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Text Simple Alignment, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / Alignment} + +%D This module is for Bruce Horrocks (and a follow up on a chat session). Watch out, +%D when a shift results in a newline we get oscillation! + +\unprotect + +\newinteger \c_align_point_index +\newdimension\d_align_point_delta + +\registerctxluafile{tabl-ali}{autosuffix} + +\permanent\protected\def\ap[#1]% + {\ifchknum#1\or + \dontleavehmode + \global\advance\c_align_point_index\plusone + \d_align_point_delta\clf_align_point_delta + \numexpr#1\relax + \c_align_point_index + \relax + \xypos{ap::\number#1:\the\c_align_point_index}% + \hkern\d_align_point_delta + \fi} + +\protect \endinput + +% \starttext +% \dostepwiserecurse{10}{10000}{10}{ +% \ap[1]{\bf\darkred 1} test test \ap[2]{\bf\darkblue 2} test #1.#1 \ap[3]{\bf \darkgreen 3} test \par +% test #1.#1 \ap[1]{\bf\darkred 1} test #1.#1 test \ap[2]{\bf\darkblue 2} test \ap[3]{\bf \darkgreen 3} test #1.#1 \par +% } +% \stoptext + diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl index 8621d2f6223..33269a93a7e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl @@ -19,12 +19,17 @@ \registerctxluafile{node-ali}{autosuffix} +%setnewconstant\align_callback_showpreamble \plusone +\setnewconstant\align_callback_aligncharacter\plusone +\setnewconstant\align_callback_mathalign \plustwo +\setnewconstant\align_callback_mathmatrix \plusthree + \definesystemattribute[aligncharacter][public] \permanent\protected\def\setalignmentcharacter#1% {\enablealignmentcharacter - \global\settrue\c_tabl_use_size - \global\settrue\c_tabl_sparse_skips + \global\c_tabl_use_size\conditionaltrue + \global\c_tabl_sparse_skips\conditionaltrue \enforced\permanent\protected\gdef\setalignmentcharacter##1% {\attribute\aligncharacterattribute`##1\relax}% \attribute\aligncharacterattribute`#1\relax} @@ -33,7 +38,10 @@ {\attribute\aligncharacterattribute\attributeunsetvalue} \permanent\def\alignmentcharactertrigger - {\s!callback\space\s!attr\aligncharacterattribute\plusone} + {\s!callback + \align_callback_aligncharacter + \s!attr % not needed, we can trigger on the callback id + \aligncharacterattribute\plusone} \noaligned\permanent\protected\def\aligncontentleft {\ignorespaces\aligncontent\unskip\hss} \noaligned\permanent\protected\def\aligncontentmiddle{\hss\ignorespaces\aligncontent\unskip\hss} diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl index e19ea34fee3..1f3095e7f64 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl @@ -57,7 +57,7 @@ % \setupframedtable[foo][...] -\permanent\tolerant\protected\def\setupframedtable[#1]#*[#2]% +\permanent\tolerant\protected\def\setupframedtable[#S#1]#*[#S#2]% {\ifarguments\or \setupframed[\??framedtable][#1]% \or @@ -70,7 +70,7 @@ % \setupframedtable[1][...] % \setupframedtable[foo][1][...] -\permanent\tolerant\protected\def\setupframedtablerow[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setupframedtablerow[#1]#*[#S#2]#*[#S#3]% {\ifarguments\or\or \ifcsname\??framed:\??framedtablerow:#1\endcsname \else \defineframed[\??framedtablerow:#1][\??framedtable]% @@ -86,7 +86,7 @@ \setupframed[\??framedtablerow#1:#2][#3]% \fi} -\permanent\tolerant\protected\def\setupframedtablecolumn[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setupframedtablecolumn[#1]#*[#S#2]#*[#S#3]% {\ifarguments\or\or \ifcsname\??framed:\??framedtablecolumn:#1\endcsname \else \defineframed[\??framedtablecolumn:#1][\??framedtable]% @@ -104,17 +104,17 @@ \mutable\lettonothing\currentframedtable -\permanent\tolerant\protected\def\startframedtable[#1]#*[#2]% +\permanent\tolerant\protected\def\startframedtable[#S#1]#*[#S#2]% {\begingroup \forgetall \ifhastok={#1}% \lettonothing\currentframedtable \setupframed[\??framedtable][#1]% \else - \edef\currentframedtable{#1}% + \cdef\currentframedtable{#1}% \setupframed[\??framedtable][#2]% \fi - \edef\currentframed{\??framedtable\currentframedtable}% + \cdef\currentframed{\??framedtable\currentframedtable}% \pack_framed_initialize \c_tabl_framed_r\zerocount \d_tabl_framed_d\framedparameter\c!distance @@ -126,7 +126,7 @@ % a two pass variant that deals with the height .. so no catcode changes here -\tolerant\protected\def\pack_framed_start_framed_whatever[#1]% +\tolerant\protected\def\pack_framed_start_framed_whatever[#S#1]% {\pack_framed_initialize % moved up \bgroup \setupcurrentframed[#1]% here ! @@ -134,32 +134,6 @@ \bgroup \ignorespaces} -% \permanent\protected\def\startframedrow -% {\advanceby\c_tabl_framed_r\plusone -% \c_tabl_framed_c\zerocount -% \d_tabl_framed_h\zeropoint -% \bgroup -% \edef\currentframed{\number\c_tabl_framed_r}% -% \edef\currentframed -% {\??framedtablerow\currentframedtable -% \ifcsname\??framedtablerow\currentframedtable:\currentframed\endcsname -% :\currentframed -% \orelse\ifcsname\??framedtablerow\currentframedtable:\v!each\endcsname -% :\v!each -% \fi}% -% \pack_framed_start_framed_whatever} -% -% \permanent\protected\def\stopframedrow -% {\dofastloopcs\c_tabl_framed_c\tabl_framed_flush_row -% \stopframed -% \nointerlineskip -% \vskip\zeropoint\relax -% \framedparameter\c!inbetween} - -\protected\def\tabl_framed_flush_row - {\vpack to \d_tabl_framed_h{\flushbox\??framedtable{\number\fastloopindex}\vfill}% - \ifzeropt\d_tabl_framed_d\else\kern\d_tabl_framed_d\fi} - \newinteger\c_tabl_framed_pass \permanent\let\stopframedrow\relax @@ -183,8 +157,8 @@ {\bgroup \c_tabl_framed_c\zerocount \c_tabl_framed_pass\plustwo - \edef\currentframed{\number\c_tabl_framed_r}% - \edef\currentframed + \cdef\currentframed{\the\c_tabl_framed_r}% + \cdef\currentframed {\??framedtablerow\currentframedtable \ifcsname\??framedtablerow\currentframedtable:\currentframed\endcsname :\currentframed @@ -194,22 +168,22 @@ \pack_framed_start_framed_whatever} \protected\def\stopframedrow_two - {\dofastloopcs\c_tabl_framed_c\tabl_framed_flush_row + {\localcontrolledloop\plusone\c_tabl_framed_c\plusone{\tabl_framed_flush_row_two}% \stopframed \nointerlineskip - \vskip\zeropoint\relax + \vskip\zeroskip\relax \framedparameter\c!inbetween} \protected\def\tabl_framed_flush_row_two - {\vpack to \d_tabl_framed_h{\flushbox\??framedtable{\number\fastloopindex}\vfill}% + {\vpack to \d_tabl_framed_h{\flushbox\??framedtable{\the\currentloopiterator}\vfill}% \ifzeropt\d_tabl_framed_d\else\kern\d_tabl_framed_d\fi} \permanent\protected\def\startframedcell {\advanceby\c_tabl_framed_c\plusone \setbox\b_tabl_framed\hpack\bgroup %\bgroup - \edef\currentframed{\number\c_tabl_framed_c}% - \edef\currentframed + \cdef\currentframed{\the\c_tabl_framed_c}% + \cdef\currentframed {\??framedtablecolumn\currentframedtable \ifcsname\??framedtablecolumn\currentframedtable:\currentframed\endcsname :\currentframed @@ -234,7 +208,7 @@ \d_tabl_framed_h\ht\b_tabl_framed \fi \else - \savebox\??framedtable{\number\c_tabl_framed_c}{\box\b_tabl_framed}% + \savebox\??framedtable{\the\c_tabl_framed_c}{\box\b_tabl_framed}% \fi} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-itm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-itm.mkxl new file mode 100644 index 00000000000..6aa06fc29ea --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-itm.mkxl @@ -0,0 +1,102 @@ +%D \module +%D [ file=core-itm, +%D version=2023.21.007, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Itemize, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / Itemize} + +%D This is a bit weird module but also kind of fun. It permits mixing tables with +%D numbered items. +%D +%D \starttyping +%D \startitemize[n,loose] +%D \startitem \samplefile{ward} \stopitem +%D \starttabulate[|pl|i3pl|] +%D \NC \startitem \samplefile{ward} \stopitem +%D \NC \startitem \samplefile{tufte} \stopitem +%D \NC \NR +%D \NC \startitem \samplefile{ward} \stopitem +%D \NC \startitem \samplefile{tufte} \stopitem +%D \NC \NR +%D \stoptabulate +%D \startitem \samplefile{tufte} \stopitem +%D \stopitemize +%D +%D \page +%D +%D \starttabulate[|l|i3pl|] +%D \NC one \NC +%D \startitemize[n] +%D \startitem \samplefile{ward} \stopitem +%D \startitem \samplefile{tufte} \stopitem +%D \stopitemize +%D \NC \NR +%D \stoptabulate +%D +%D \page +%D +%D \startitemize[n,loose,packed] +%D \startitem \samplefile{ward} \stopitem +%D \startlinecorrection +%D \bTABLE[distance=2em] +%D \bTR +%D \bTD \startitem \samplefile{ward} \stopitem \eTD +%D \bTD \startitem \samplefile{tufte} \stopitem \eTD +%D \eTR +%D \eTABLE +%D \stoplinecorrection +%D \startitem \samplefile{tufte} \stopitem +%D \stopitemize +%D +%D \page +%D +%D \bTABLE +%D \bTR +%D \bTD +%D \startitemize[n] +%D \startitem \samplefile{ward} \stopitem +%D \startitem \samplefile{tufte} \stopitem +%D \stopitemize +%D \eTD +%D \eTR +%D \eTABLE +%D \stoptyping +%D +%D We don't (yet) deal with spacing but at some point it might happen as it depends +%D on usage. + +\unprotect + +\appendtoks + \ifcase\c_strc_itemgroups_nesting\else + \strc_counters_save\v_strc_itemgroups_counter + \fi +\to \t_tabl_tabulate_initializers_first + +\appendtoks + \ifcase\c_strc_itemgroups_nesting\else + \strc_counters_restore\v_strc_itemgroups_counter + \fi +\to \t_tabl_tabulate_initializers_second + +\appendtoks + \ifcase\c_strc_itemgroups_nesting\else + \strc_counters_save\v_strc_itemgroups_counter + \fi +\to \t_tabl_ntb_initializers_first + +\appendtoks + \ifcase\c_strc_itemgroups_nesting\else + \strc_counters_restore\v_strc_itemgroups_counter + \fi +\to \t_tabl_ntb_initializers_second + +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl index 7fcdba6f2ad..eabe27a6fae 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl @@ -97,13 +97,13 @@ \newtoks \t_tabl_lines_head -\newconditional \linetableautoheight \settrue\linetableautoheight +\newconditional \linetableautoheight \linetableautoheight\conditionaltrue \tabl_lines_initialize_box\zerocount % holds repeater \pushoverloadmode -\permanent\tolerant\protected\def\setuplinetable[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setuplinetable[#S#1]#*[#S#2]#*[#S#3]% {\ifarguments\or \getparameters[\??linetable][#1]% \or @@ -116,7 +116,7 @@ {\begincsname\??linetable#1\endcsname} \permanent\protected\def\doifelselinetablecparameter#1% - {\ifcsname\??linetable c:\number\c_tabl_lines_column#1\endcsname + {\ifcsname\??linetable c:\the\c_tabl_lines_column#1\endcsname \expandafter\firstoftwoarguments \orelse\ifcsname\??linetable c:#1\endcsname \expandafter\firstoftwoarguments @@ -129,8 +129,8 @@ \permanent\def\linetablecparameter#1% {\begincsname \??linetable - \ifcsname\??linetable c:\number\c_tabl_lines_column#1\endcsname - c:\number\c_tabl_lines_column + \ifcsname\??linetable c:\the\c_tabl_lines_column#1\endcsname + c:\the\c_tabl_lines_column \orelse\ifcsname\??linetable c:#1\endcsname c:% \fi @@ -148,8 +148,8 @@ r:0% \fi \else - \ifcsname\??linetable r:\number\c_tabl_lines_row#1\endcsname - r:\number\c_tabl_lines_row + \ifcsname\??linetable r:\the\c_tabl_lines_row#1\endcsname + r:\the\c_tabl_lines_row \orelse\ifcsname\??linetable r:\v!oddeven\c_tabl_lines_row#1\endcsname r:\v!oddeven\c_tabl_lines_row \fi @@ -186,10 +186,10 @@ \global\advanceby \c_tabl_lines_column\plusone \advanceby\scratchskip \linetablecparameter\c!distance} -\permanent\tolerant\protected\def\startlinetablecell[#1]% +\permanent\tolerant\protected\def\startlinetablecell[#S#1]% {\global\setbox\b_tabl_lines_cell\hbox\bgroup \ifparameter#1\or - \getparameters[\??linetable c:\number\c_tabl_lines_column][#1]% + \getparameters[\??linetable c:\the\c_tabl_lines_column][#1]% \fi \global\c_tabl_lines_step\linetablecparameter\c!nx\relax \ifcase\c_tabl_lines_step\or @@ -197,7 +197,7 @@ \scratchskip \linetablecparameter\c!distance \else \scratchdimen \zeropoint - \scratchskip \zeropoint + \scratchskip \zeroskip \scratchcounter\c_tabl_lines_column \dorecurse\c_tabl_lines_step\tabl_lines_step_cell \global\c_tabl_lines_column\scratchcounter @@ -301,7 +301,7 @@ \c!height=\ifempty\p_height\ht\scratchbox\else\p_height\fi, \c!depth=\ifempty\p_depth \dp\scratchbox\else\p_depth \fi, \c!width=\wd\scratchbox]% - \hskip-\wd\scratchbox\box\scratchbox}} + \hkern-\wd\scratchbox\box\scratchbox}} \def\tabl_lines_wrap_up_auto_r {\hpack @@ -313,7 +313,7 @@ \c!height=\ht\scratchbox, \c!depth=\dp\scratchbox, \c!width=\wd\scratchbox]% - \hskip-\wd\scratchbox\box\scratchbox}} + \hkern-\wd\scratchbox\box\scratchbox}} \def\tabl_lines_wrap_up_line {\backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}} @@ -327,7 +327,7 @@ {\ifvoid\b_tabl_lines_current\c_tabl_lines_part\else\unvbox\b_tabl_lines_current\c_tabl_lines_part\fi \ifcstok{\linetablerparameter\c!background}\v!color \backgroundline[\linetablerparameter\c!backgroundcolor]{\box\scratchbox}% - \orelse\iftok{\linetablerparameter\c!type}\emptytoks + \orelse\ifempty{\linetablerparameter\c!type}% \box\scratchbox \else \tabl_lines_wrap_up_auto_r @@ -423,7 +423,7 @@ %%%% \ifdone % collecting repeater - \orelse\ifnum\c_tabl_lines_column>\csname\??linetablepart\number\c_tabl_lines_part\endcsname\relax + \orelse\ifnum\c_tabl_lines_column>\csname\??linetablepart\the\c_tabl_lines_part\endcsname\relax \donetrue \fi \ifdone @@ -497,10 +497,11 @@ \permanent\protected\def\startlinetablerun % to do: quit when nested {\bgroup \dontcomplain - \settrue\c_tabl_lines_in_table + \c_tabl_lines_in_table\conditionaltrue % autowidth - \doif{\linetableparameter\c!maxwidth}\v!fit - {\setuplinetable[\c!maxwidth=\zeropoint]}% + \ifcstok{\linetableparameter\c!maxwidth}\v!fit + \setuplinetable[\c!maxwidth=\zeropoint]% + \fi \processaction [\linetableparameter\c!stretch] [ \v!no=>{\setuplinetable[\c!stretch=\maxdimen]},% no stretch @@ -523,7 +524,7 @@ \def\docommand##1% {\global\advanceby\c_tabl_lines_n_of_parts\plusone \advanceby\scratchcounter##1% - \xdefcsname\??linetablepart\number\c_tabl_lines_n_of_parts\endcsname{\the\scratchcounter}}% + \xdefcsname\??linetablepart\the\c_tabl_lines_n_of_parts\endcsname{\the\scratchcounter}}% \processcommacommand[\linetableparameter\c!n]\docommand \tabl_lines_initialize_boxes\c_tabl_lines_n_of_parts \global\c_tabl_lines_part\ifcase\c_tabl_lines_repeat\plusone\else\zerocount\fi % repeater @@ -628,7 +629,7 @@ \def\tabl_lines_check_page {\global\c_tabl_lines_page\zerocount \ifcase\c_tabl_lines_repeat\orelse\ifcase\c_tabl_lines_page - \iftok{\linetableparameter\c!repeat}\v!no + \ifcstok{\linetableparameter\c!repeat}\v!no \global\c_tabl_lines_page\doifelseoddpage\plusone\plustwo \fi \fi} @@ -643,7 +644,7 @@ \or % 3 trigger flush \c_tabl_lines_head_state\plusone - \the\t_tabl_lines_head\relax + \expand\t_tabl_lines_head\relax \c_tabl_lines_head_state\plustwo \fi} @@ -668,7 +669,7 @@ \permanent\protected\def\startlinetableanalysis {\bgroup - \settrue\c_tabl_lines_preroll + \c_tabl_lines_preroll\conditionaltrue \settrialtypesetting \startlinetablerun} @@ -707,13 +708,13 @@ \fi \push_macro_BC \push_macro_EC - \enforced\permanent\protected\def\BC##1\EC{\appendtoks##1\to\t_tabl_lines_head}% + \enforced\permanent\protected\def\BC##1\EC{\toksapp\t_tabl_lines_head{##1}}% \enforced\permanent \let\EC\relax} % signal \permanent\protected\def\tabl_lines_EH {\pop_macro_EC \pop_macro_BC - \expandafter\startlinetablehead\the\t_tabl_lines_head\stoplinetablehead} + \expandafter\startlinetablehead\expand\t_tabl_lines_head\stoplinetablehead} \permanent\let\startlinetablebody\relax \permanent\let\stoplinetablebody \relax diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl index e65c97e0de1..71dc16a55e3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl @@ -33,16 +33,21 @@ \mutable\let\kindoftabposition\!!zerocount -\permanent\tolerant\protected\def\somekindoftab[#1]% +\permanent\tolerant\protected\def\somekindoftab[#S#1]% {\bgroup \getdummyparameters [\c!alternative=\v!vertical, \c!width=\textwidth,\c!height=\textheight, \c!n=\lastpage,\c!m=\realpageno, #1]% - \doifelse{\directdummyparameter\c!alternative}\v!vertical - {\typo_kindoftab_indeed\vbox\vskip\c!height} - {\typo_kindoftab_indeed\hbox\hskip\c!width }} + \ifcstok{\directdummyparameter\c!alternative}\v!vertical + \expandafter\typo_kindoftab_indeed_v + \else + \expandafter\typo_kindoftab_indeed_h + \fi} + +\def\typo_kindoftab_indeed_v{\typo_kindoftab_indeed\vbox\vskip\c!height} +\def\typo_kindoftab_indeed_h{\typo_kindoftab_indeed\hbox\hskip\c!width } \def\typo_kindoftab_indeed#1#2#3#4% {#1 to \directdummyparameter#3 \bgroup @@ -129,27 +134,31 @@ \let\typo_paragraphs_setup_step\gobbleoneargument -\overloaded\permanent\tolerant\protected\def\setupparagraphs[#1]#*[#2]#*[#3]% we are downward compatible with [each] and [1,3] +\overloaded\permanent\tolerant\protected\def\setupparagraphs[#S#1]#*[#S#2]#*[#S#3]% we are downward compatible with [each] and [1,3] {\ifarguments\or \typo_paragraphs_setup_saved[#1]% \or \typo_paragraphs_setup_saved[#1][#2]% \or - \doifelse{#2}\v!each - {\dorecurse{\namedparagraphsparameter{#1}\c!n}% - {\normalexpanded{\typo_paragraphs_setup_saved[#1:\recurselevel]}[#3]}}% - {\def\typo_paragraphs_setup_step##1{\typo_paragraphs_setup_saved[#1:##1][#3]}% - \processcommalist[#2]\typo_paragraphs_setup_step}% + \ifcstok{#2}\v!each + \localcontrolledrepeat \namedparagraphsparameter{#1}\c!n + {\normalexpanded{\typo_paragraphs_setup_saved[#1:\the\currentloopiterator]}[#3]}% + \else + \def\typo_paragraphs_setup_step##1{\typo_paragraphs_setup_saved[#1:##1][#3]}% + \processcommalist[#2]\typo_paragraphs_setup_step + \fi \fi} \appendtoks - \frozen\instance\letcsname\e!next \currentparagraphs\endcsname\nextparagraphs + \frozen\instance\letcsname\e!next\currentparagraphs\endcsname\nextparagraphs \frozen\instance\letcsname\currentparagraphs\endcsname\nextparagraphs \frozen\instance\protected\edefcsname\e!start\currentparagraphs\endcsname{\startparagraphs[\currentparagraphs]}% - \frozen\instance\letcsname\e!stop \currentparagraphs\endcsname\stopparagraphs - %frozen\instance\setuevalue{\e!setup\currentparagraph\e!endsetup}{\typo_paragraphs_setup_saved[\currentparagraphs]}% - \dorecurse{\paragraphsparameter\c!n}% - {\normalexpanded{\typo_paragraphs_setup_saved[\currentparagraphs:\recurselevel][\c!width=,\s!parent=\??paragraphs\currentparagraphs]}}% + \frozen\instance\letcsname\e!stop\currentparagraphs\endcsname\stopparagraphs + \localcontrolledrepeat \paragraphsparameter\c!n + {\normalexpanded + {\typo_paragraphs_setup_saved + [\currentparagraphs:\the\currentloopiterator]% + [\c!width=,\s!parent=\??paragraphs\currentparagraphs]}}% \typo_paragraphs_setup_saved[\currentparagraphs:1][\c!distance=\zeropoint]% \to \everydefineparagraphs @@ -163,7 +172,7 @@ \permanent\protected\def\startparagraphs[#1]% quite slow {\bgroup % (1) - \edef\currentparagraphs{#1}% + \cdef\currentparagraphs{#1}% % \paragraphsparameter\c!before \edef\p_width{\paragraphsparameter\c!width}% \ifempty\p_width @@ -175,15 +184,15 @@ \c_typo_paragraphs_max\paragraphsparameter\c!n\relax \d_typo_paragraphs_auto\d_typo_paragraphs_width\relax \scratchcounter\zerocount - \dorecurse\c_typo_paragraphs_max - {\edef\p_width{\namedparagraphsparameter{\currentparagraphs:\recurselevel}\c!width}% + \localcontrolledrepeat \c_typo_paragraphs_max + {\edef\p_width{\namedparagraphsparameter{\currentparagraphs:\the\currentloopiterator}\c!width}% \ifempty\p_width \advanceby\scratchcounter\plusone \else \advanceby\d_typo_paragraphs_auto-\p_width\relax \fi - \ifnum\recurselevel>\plusone - \advanceby\d_typo_paragraphs_auto-\namedparagraphsparameter{\currentparagraphs:\recurselevel}\c!distance\relax + \ifnum\currentloopiterator>\plusone + \advanceby\d_typo_paragraphs_auto-\namedparagraphsparameter{\currentparagraphs:\number\currentloopiterator}\c!distance\relax \fi}% \ifnum\scratchcounter>\zerocount \divideby\d_typo_paragraphs_auto\scratchcounter @@ -241,7 +250,7 @@ {\begingroup \let\typo_paragraphs_start_cell\relax \let\typo_paragraphs_stop_cell\typo_paragraphs_stop_cell_indeed - \edef\currentparagraphs{\currentparagraphs:\the\c_typo_paragraphs_n}% + \cdef\currentparagraphs{\currentparagraphs:\the\c_typo_paragraphs_n}% \ifnum\c_typo_paragraphs_n>\plusone \typo_paragraphs_separator \fi @@ -289,11 +298,12 @@ \def\typo_paragraphs_separator {\scratchdistance\paragraphsparameter\c!distance - \doif{\paragraphsparameter\c!rule}\v!on - {\scratchwidth\paragraphsparameter\c!rulethickness - \scratchdistance\dimexpr(\scratchdistance-\scratchwidth)/2\relax - \hskip\scratchdistance - \color[\paragraphsparameter\c!rulecolor]{\vrule\s!width\scratchwidth}}% + \ifcstok{\paragraphsparameter\c!rule}\v!on + \scratchwidth\paragraphsparameter\c!rulethickness + \scratchdistance\dimexpr(\scratchdistance-\scratchwidth)/2\relax + \hskip\scratchdistance + \color[\paragraphsparameter\c!rulecolor]{\vrule\s!width\scratchwidth}% + \fi \hskip\scratchdistance} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.lmt b/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.lmt index a307d046a8a..139d3291cb4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.lmt @@ -8,9 +8,6 @@ if not modules then modules = { } end modules ['tabl-ntb'] = { local context = context -local a_tablesection = attributes.system("tablesection") - -local hlist_code = nodes.nodecodes.hlist local nuts = nodes.nuts local tonode = nuts.tonode @@ -23,7 +20,9 @@ local getattr = nuts.getattr local copylist = nuts.copylist local flushlist = nuts.flushlist -local integer_value = tokens.values.integer +local integer_value = tokens.values.integer +local hlist_code = nodes.nodecodes.hlist +local a_tablesection = attributes.system("tablesection") local implement = interfaces.implement diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl index b82dcb585e3..90fa37a44a2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl @@ -114,7 +114,7 @@ \protected\def\tabl_ntb_cell_stop {\font_styles_math_stop \ifhmode - \the\t_tabl_ntb_cell_stop + \expand\t_tabl_ntb_cell_stop \par % added 13/4/2006 \orelse\ifdim\prevdepth<\zeropoint % =-1000pt ? % not sure yet:\naturaltablelocalparameter\c!right @@ -127,7 +127,7 @@ % % \protected\def\tabl_ntb_cell_stop % {\ifhmode -% \the\t_tabl_ntb_cell_stop +% \expand\t_tabl_ntb_cell_stop % \par % added 13/4/2006 % \else % % not sure yet:\naturaltablelocalparameter\c!right @@ -195,6 +195,9 @@ \newtoks \everyTABLEpass % public +\newtoks \t_tabl_ntb_initializers_first % trial +\newtoks \t_tabl_ntb_initializers_second % final + \newinteger \tablecellrows % public (needs checking) \newinteger \tablecellcolumns % public (needs checking) @@ -428,12 +431,13 @@ % \expandafter\firstoftwoarguments % a span % \fi} -\def\tabl_ntb_set_spn #1{\letcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname\plusone} -\def\tabl_ntb_spn_doifelse#1{\ifcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname - \expandafter\firstoftwoarguments % a span - \else - \expandafter\secondoftwoarguments % unset - \fi} +\def\tabl_ntb_set_spn #1{\letcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname\plusone} +%def\tabl_ntb_spn_doifelse #1{\ifcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname +% \expandafter\firstoftwoarguments % a span +% \else +% \expandafter\secondoftwoarguments % unset +% \fi} +\def\tabl_ntb_spn_condition#1{\ifcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname} \protected\def\tabl_ntb_set_txt_process#1#2#3#4#5#6% {\defcsname\??naturaltabletxt\m_tabl_tbl_level:\number#1:\number#2\endcsname @@ -462,23 +466,29 @@ \installtextracker {tables.natural.widths} - {\settrue \c_tabl_ntb_trace_widths} - {\setfalse\c_tabl_ntb_trace_widths} + {\c_tabl_ntb_trace_widths\conditionaltrue} + {\c_tabl_ntb_trace_widths\conditionalfalse} % so far -\protected\def\tabl_ntb_cell_process#1#2[#3]{} +\protected\def\tabl_ntb_cell_process#1#2[#S#3]{} \permanent\protected\def\bTC#1\eTC{\bTD#1\eTD} \permanent\protected\lettonothing\eTC \permanent\protected\def\bTX#1\eTX{\bTD#1\eTD} \permanent\protected\lettonothing\eTX \permanent\protected\def\bTY#1\eTY{\bTR#1\eTR} \permanent\protected\lettonothing\eTY +%D We have an extensive setup mechanism, it's flexible but also comes with +%D overhead, mainly due to the many possible combinations. + +\installcorenamespace{naturaltablesetupthree} +\installcorenamespace{naturaltablesetuptwo} + \let\tabl_ntb_parameters_get\setupcurrentnaturaltablelocal \let\tabl_ntb_setup_step \gobbleoneargument \let\tabl_ntb_setup_step_step\gobbleoneargument -\permanent\tolerant\protected\def\setupTABLE[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setupTABLE[#S#1]#*[#S#2]#*[#S#3]% {\ifarguments \expandafter\gobblethreeoptionals \or @@ -489,31 +499,28 @@ \expandafter\tabl_ntb_setup_three \fi[#1][#2][#3]} -\def\tabl_ntb_setup_one[#1][#2][#3]% +\def\tabl_ntb_setup_one[#S#1][#2][#3]% {\setupcurrentnaturaltablelocal[#1]} -\def\tabl_ntb_setup_xy[#1][#2][#3]% +\def\tabl_ntb_setup_xy[#1][#2][#S#3]% {\def\tabl_ntb_setup_step##1{\tabl_ntb_parameters_set[#1##1][#3]}% \processcommalist[#2]\tabl_ntb_setup_step} -\def\tabl_ntb_setup_un[#1][#2][#3]% +\def\tabl_ntb_setup_un[#1][#2][#S#3]% {\def\tabl_ntb_setup_step##1% {\def\tabl_ntb_setup_step_step####1{\tabl_ntb_parameters_set[\c!x##1\c!y####1][#3]}% \processcommalist[#2]\tabl_ntb_setup_step_step}% \processcommalist[#1]\tabl_ntb_setup_step} -\def\tabl_ntb_setup_each[#1][#2][#3]% ignores #3 +\def\tabl_ntb_setup_each[#1][#S#2][#3]% ignores #3 {\tabl_ntb_parameters_set[#1\v!each][#2]} -\def\tabl_ntb_setup_ux[#1][#2][#3]% ignores #3 +\def\tabl_ntb_setup_ux[#1][#S#2][#3]% ignores #3 {\def\tabl_ntb_setup_step##1{\tabl_ntb_parameters_set[\c!x##1][#2]}% \processcommalist[#1]\tabl_ntb_setup_step} -\installcorenamespace{naturaltablesetupthree} -\installcorenamespace{naturaltablesetuptwo} - -\def\tabl_ntb_setup_three[#1]{\ifcsname\??naturaltablesetupthree#1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_un\fi[#1]} -\def\tabl_ntb_setup_two [#1]{\ifcsname\??naturaltablesetuptwo #1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_ux\fi[#1]} +\def\tabl_ntb_setup_three[#S#1]{\ifcsname\??naturaltablesetupthree#1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_un\fi[#1]} +\def\tabl_ntb_setup_two [#S#1]{\ifcsname\??naturaltablesetuptwo #1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_ux\fi[#1]} \defcsname\??naturaltablesetupthree \v!row\endcsname[#1]{\tabl_ntb_setup_xy [\c!y]} \defcsname\??naturaltablesetupthree \v!column\endcsname[#1]{\tabl_ntb_setup_xy [\c!x]} @@ -548,7 +555,7 @@ \letcsname\??naturaltablesetuptwo y\expandafter\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname \letcsname\??naturaltablesetuptwo x\expandafter\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname -\def\tabl_ntb_parameters_set[#1][#2]% +\def\tabl_ntb_parameters_set[#1][#S#2]% {\ifappendTBLsetups \ifcsname\??naturaltableset\m_tabl_tbl_level:#1\endcsname \enforced\def\tabl_ntb_parameters_get[##1]% @@ -628,10 +635,8 @@ {\tabl_ntb_setup_section % already forgotten \edef\m_tabl_ntb_positive_row{\number#1}% \edef\m_tabl_ntb_positive_col{\number#2}% -% \edef\m_tabl_ntb_negative_row{\the\numexpr-\c_tabl_ntb_maximum_row+#1+\minusone\relax}% -% \edef\m_tabl_ntb_negative_col{\the\numexpr-\c_tabl_ntb_maximum_col+#2+\minusone\relax}% - \edef\m_tabl_ntb_negative_row{\number\numexpr-\c_tabl_ntb_maximum_row+#1+\minusone}% - \edef\m_tabl_ntb_negative_col{\number\numexpr-\c_tabl_ntb_maximum_col+#2+\minusone}% + \edef\m_tabl_ntb_negative_row{\the\numexpr-\c_tabl_ntb_maximum_row+#1+\minusone}% + \edef\m_tabl_ntb_negative_col{\the\numexpr-\c_tabl_ntb_maximum_col+#2+\minusone}% % saves tokens (no speed gain) \edef\m_tabl_ntb_prefix{\??naturaltableset\m_tabl_tbl_level:}% can move to \tabl_ntb_next_level etc % each each @@ -746,7 +751,7 @@ % till here -\tolerant\protected\def\tabl_ntb_tr[#1]% +\tolerant\protected\def\tabl_ntb_tr[#S#1]% {\c_tabl_ntb_running_col\zerocount \c_tabl_ntb_encountered_col\zerocount % @@ -756,24 +761,24 @@ \ifparameter#1\or \expandafter\tabl_ntb_tr_yes \else - \expandafter\gobbleoneoptional - \fi[#1]} + \expandafter\gobbleoneargument + \fi{#1}} -\def\tabl_ntb_tr_yes[#1]% +\protected\def\tabl_ntb_tr_yes#1% {\defcsname\??naturaltableset\m_tabl_tbl_level:\c!y++\the\c_tabl_ntb_maximum_row\endcsname{\setupcurrentnaturaltablelocal[#1]}} \def\m_tabl_ntb_default_nr{\naturaltableparameter\c!nr} \def\m_tabl_ntb_default_nc{\naturaltableparameter\c!nc} -\tolerant\protected\def\tabl_ntb_td[#1]% +\tolerant\protected\def\tabl_ntb_td[#S#1]% {\advanceby\c_tabl_ntb_encountered_col\plusone \ifparameter#1\or \expandafter\tabl_ntb_td_yes \else \expandafter\tabl_ntb_td_nop - \fi[#1]} + \fi{#1}} -\def\tabl_ntb_td_yes[#1]#2\eTD +\protected\def\tabl_ntb_td_yes#1#2\eTD {\letnaturaltableparameter \c!ny\m_tabl_ntb_default_nr \letnaturaltableparameter \c!nx\m_tabl_ntb_default_nc \letnaturaltableparameter \c!nc\plusone @@ -833,7 +838,7 @@ \c_tabl_ntb_encountered_max\c_tabl_ntb_encountered_col \fi} -\def\tabl_ntb_td_nop[#1]#2\eTD +\protected\def\tabl_ntb_td_nop#1#2\eTD {\global\advanceby\c_tabl_ntb_spn\plusone\relax \localcontrolledloop\plusone\maxcard\plusone {\advanceby\c_tabl_ntb_running_col\plusone @@ -856,10 +861,13 @@ \c_tabl_ntb_encountered_max\c_tabl_ntb_encountered_col \fi} -\def\tabl_ntb_td_pass_n#1% +\protected\def\tabl_ntb_td_pass_n#1% {\scratchcounter\numexpr\m_tabl_ntb_n-\c_tabl_ntb_running_col+\minusone-\c_tabl_ntb_spn\relax \ifnum\scratchcounter>\zerocount \normalexpanded{\tabl_ntb_td[\c!nx=\the\scratchcounter,\c!n=,\c!m=,*sq=\v!no]}\eTD + % could be a faster inline + % \advanceby\c_tabl_ntb_encountered_col\plusone + % \normalexpanded{\tabl_ntb_td_yes[\c!nx=\the\scratchcounter},\c!n=,\c!m=,*sq=\v!no]\eTD \fi \letnaturaltableparameter\c!ny\m_tabl_ntb_default_nr \letnaturaltableparameter\c!nx\m_tabl_ntb_default_nc @@ -869,7 +877,7 @@ \resetnaturaltableparameter\c!n \resetnaturaltableparameter\c!m} -\def\tabl_ntb_td_pass_m#1% +\protected\def\tabl_ntb_td_pass_m#1% {\scratchcounter\numexpr\m_tabl_ntb_m-\c_tabl_ntb_running_col+\minusone-\c_tabl_ntb_spn\relax \localcontrolledloop\plusone\scratchcounter\plusone{\normalexpanded{\tabl_ntb_td[\c!n=,\c!m=]}\eTD}% % can be sped up @@ -939,10 +947,12 @@ %D %D \typebuffer \getbuffer -\tolerant\def\tabl_ntb_th[#1]#:#2\eTH +% could be a faster inline: advance and _yes + +\tolerant\def\tabl_ntb_th[#S#1]#:#2\eTH {\tabl_ntb_td[#1,\c!color=\naturaltablelocalparameter\c!headcolor,\c!style=\naturaltablelocalparameter\c!headstyle,\c!aligncharacter=\v!no]#2\eTD} -\tolerant\def\tabl_ntb_tn[#1]#:#2\eTN +\tolerant\def\tabl_ntb_tn[#S#1]#:#2\eTN {\tabl_ntb_td[#1]\digits#2\relax\eTD} %D Vit Zyka needed the option to create a distance between columns, so I added @@ -996,10 +1006,10 @@ \permanent\protected\lettonothing\eTABLEbody \permanent\protected\lettonothing\eTABLEfoot -\permanent\tolerant\protected\def\bTABLEhead[#1]#:#2\eTABLEhead{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_head} -\permanent\tolerant\protected\def\bTABLEnext[#1]#:#2\eTABLEnext{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_next} -\permanent\tolerant\protected\def\bTABLEbody[#1]#:#2\eTABLEbody{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_body} -\permanent\tolerant\protected\def\bTABLEfoot[#1]#:#2\eTABLEfoot{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_foot} +\permanent\tolerant\protected\def\bTABLEhead[#1]#:#2\eTABLEhead{\toksapp\t_tabl_ntb_head{\tabl_ntb_section[#1]{#2}}} +\permanent\tolerant\protected\def\bTABLEnext[#1]#:#2\eTABLEnext{\toksapp\t_tabl_ntb_next{\tabl_ntb_section[#1]{#2}}} +\permanent\tolerant\protected\def\bTABLEbody[#1]#:#2\eTABLEbody{\toksapp\t_tabl_ntb_body{\tabl_ntb_section[#1]{#2}}} +\permanent\tolerant\protected\def\bTABLEfoot[#1]#:#2\eTABLEfoot{\toksapp\t_tabl_ntb_foot{\tabl_ntb_section[#1]{#2}}} \def\tabl_ntb_section[#1]#2% also used in tabl-nte {\protected\def\tabl_ntb_setup_section{\setupcurrentnaturaltablelocal[#1]}% @@ -1011,7 +1021,7 @@ \begincsname\??naturaltableset\m_tabl_tbl_level:\v!start\v!oddeven\m_tabl_tbl_level\endcsname \begincsname\??naturaltableset\m_tabl_tbl_level:\v!start\m_tabl_tbl_level\endcsname} -\permanent\tolerant\protected\def\bTABLE[#1]% +\permanent\tolerant\protected\def\bTABLE[#S#1]% {\tabl_ntb_table_push % box not here \bgroup @@ -1077,8 +1087,8 @@ \def\tabl_ntb_current_row {\m_tabl_ntb_positive_row} \def\tabl_ntb_current_column{\m_tabl_ntb_positive_col} -\def\tabl_ntb_n_of_rows {\number\c_tabl_ntb_maximum_row} -\def\tabl_ntb_n_of_columns {\number\c_tabl_ntb_maximum_col} +\def\tabl_ntb_n_of_rows {\the\c_tabl_ntb_maximum_row} +\def\tabl_ntb_n_of_columns {\the\c_tabl_ntb_maximum_col} \mutable\let\currentTABLErow \!!zerocount \mutable\let\currentTABLEcolumn\!!zerocount @@ -1103,29 +1113,35 @@ \permanent\protected\def\eTABLE % beware, we need to get rid of spurious spaces when in hmode {% tricky and dirty order -) - \setfalse\c_tabl_ntb_okay + \c_tabl_ntb_okay\conditionalfalse % head - \doifelsesometoks\t_tabl_ntb_head % slow, better a flag \iftok - {\c_tabl_ntb_head\numexpr\c_tabl_ntb_maximum_row+\plusone\relax - \the\t_tabl_ntb_head - \c_tabl_ntb_n_of_head_lines\c_tabl_ntb_maximum_row\relax - \doifelsesometoks\t_tabl_ntb_next - {\the\t_tabl_ntb_next - \c_tabl_ntb_n_of_next_lines\numexpr\c_tabl_ntb_maximum_row-\c_tabl_ntb_n_of_head_lines\relax}% - {\c_tabl_ntb_n_of_next_lines\zerocount}% was 1 - \c_tabl_ntb_n_of_hdnx_lines\c_tabl_ntb_maximum_row} - {\c_tabl_ntb_head\zerocount - \c_tabl_ntb_n_of_head_lines\zerocount % was 1 - \c_tabl_ntb_n_of_next_lines\zerocount - \c_tabl_ntb_n_of_hdnx_lines\zerocount}% + \ifempty\t_tabl_ntb_head + \c_tabl_ntb_head\zerocount + \c_tabl_ntb_n_of_head_lines\zerocount % was 1 + \c_tabl_ntb_n_of_next_lines\zerocount + \c_tabl_ntb_n_of_hdnx_lines\zerocount + \else + \c_tabl_ntb_head\numexpr\c_tabl_ntb_maximum_row+\plusone\relax + \expand\t_tabl_ntb_head + \c_tabl_ntb_n_of_head_lines\c_tabl_ntb_maximum_row\relax + \ifempty\t_tabl_ntb_next + \c_tabl_ntb_n_of_next_lines\zerocount % was 1 + \else + \expand\t_tabl_ntb_next + \c_tabl_ntb_n_of_next_lines\numexpr\c_tabl_ntb_maximum_row-\c_tabl_ntb_n_of_head_lines\relax + \fi + \c_tabl_ntb_n_of_hdnx_lines\c_tabl_ntb_maximum_row + \fi % body \c_tabl_ntb_body\numexpr\c_tabl_ntb_maximum_row+\plusone\relax - \the\t_tabl_ntb_body + \expand\t_tabl_ntb_body % foot - \doifelsesometoks\t_tabl_ntb_foot - {\c_tabl_ntb_foot\numexpr\c_tabl_ntb_maximum_row+\plusone\relax - \the\t_tabl_ntb_foot}% - {\c_tabl_ntb_foot\zerocount}% + \ifempty\t_tabl_ntb_foot + \c_tabl_ntb_foot\zerocount + \else + \c_tabl_ntb_foot\numexpr\c_tabl_ntb_maximum_row+\plusone\relax + \expand\t_tabl_ntb_foot + \fi % done \removeunwantedspaces % only if hmode % finish cells @@ -1257,7 +1273,7 @@ \newinteger\c_tabl_prelocated_rows % \prelocateTBLrows{1000} may speed up large tables % \def\tabl_ntb_row_start{\t_tabl_ntb_row\emptytoks} -% \def\tabl_ntb_row_stop {\normalexpanded{\t_tabl_ntb{\the\t_tabl_ntb\noexpand\tabl_ntb_row_align_start\the\t_tabl_ntb_row\tabl_ntb_row_align_stop}}} +% \def\tabl_ntb_row_stop {\normalexpanded{\t_tabl_ntb{\expand\t_tabl_ntb\noexpand\tabl_ntb_row_align_start\expand\t_tabl_ntb_row\tabl_ntb_row_align_stop}}} \def\tabl_ntb_row_start {\t_tabl_ntb_row\emptytoks} @@ -1350,21 +1366,21 @@ \ifconditional\c_tabl_ntb_okay \dostoptagged \else - \settrue\c_tabl_ntb_okay + \c_tabl_ntb_okay\conditionaltrue \fi \dostarttagged\t!tablehead\empty \orelse\ifnum\scratchcounter=\c_tabl_ntb_body \ifconditional\c_tabl_ntb_okay \dostoptagged \else - \settrue\c_tabl_ntb_okay + \c_tabl_ntb_okay\conditionaltrue \fi \dostarttagged\t!tablebody\empty \orelse\ifnum\scratchcounter=\c_tabl_ntb_foot \ifconditional\c_tabl_ntb_okay \dostoptagged \else - \settrue\c_tabl_ntb_okay + \c_tabl_ntb_okay\conditionaltrue \fi \dostarttagged\t!tablefoot\empty \fi @@ -1376,13 +1392,13 @@ \scratchcounter\numexpr\c_tabl_ntb_row+\plustwo\relax \ifnum\scratchcounter=\c_tabl_ntb_body \dostoptagged - \setfalse\c_tabl_ntb_okay + \c_tabl_ntb_okay\conditionalfalse \orelse\ifnum\scratchcounter=\c_tabl_ntb_foot \dostoptagged - \setfalse\c_tabl_ntb_okay + \c_tabl_ntb_okay\conditionalfalse \orelse\ifnum\scratchcounter>\c_tabl_ntb_maximum_row \dostoptagged - \setfalse\c_tabl_ntb_okay + \c_tabl_ntb_okay\conditionalfalse \fi \fi} @@ -1467,20 +1483,20 @@ \egroup} \def\tabl_ntb_flush_content - {\the\everyTABLEpass + {\expand\everyTABLEpass \global\c_tabl_ntb_spn\zerocount \global\c_tabl_ntb_col\zerocount \global\c_tabl_ntb_row\zerocount \global\advanceby\c_tabl_ntb_row\minusone \dostarttaggedchained\t!table\empty\??naturaltable %\registerparoptions % (*) triggers max hsize - \the\t_tabl_ntb + \expand\t_tabl_ntb \dostoptagged} \protected\def\tabl_ntb_span#1% - {\hskip\tabl_ntb_get_dis\c_tabl_ntb_col + {\hkern\tabl_ntb_get_dis\c_tabl_ntb_col \localcontrolledloop\plusone#1\plusone - {\hskip\tabl_ntb_get_wid\c_tabl_ntb_col\relax + {\hkern\tabl_ntb_get_wid\c_tabl_ntb_col\relax \global\advanceby\c_tabl_ntb_col\plusone}} \protected\def\tabl_ntb_skip#1% @@ -1684,8 +1700,10 @@ \c_tabl_tbl_pass\plusone \let\tabl_ntb_pass\tabl_ntb_pass_one \let\tabl_ntb_cell_process\tabl_ntb_cell_process_a + \expand\t_tabl_ntb_initializers_first\relax \setbox\scratchbox\vbox{\settrialtypesetting \tabl_ntb_flush_content}% \ifcase\tabl_ntb_get_gal\or + % so \c_tabl_tbl_pass is not really a pass count % \c_tabl_tbl_pass\plusone % \let\tabl_ntb_pass\tabl_ntb_pass_one \let\tabl_ntb_cell_process\tabl_ntb_cell_process_a_extra @@ -1715,7 +1733,7 @@ % added jan 2002 because nx=* did no longer work \ifnum\c_tabl_ntb_encountered_max<\c_tabl_ntb_maximum_col % added jun 2014 because someone had less columns than nx .. sigh / see *nx* - \writestatus\m!TABLE{missing\space\number\numexpr\c_tabl_ntb_maximum_col-\c_tabl_ntb_encountered_max\relax\space column(s), guessing widths}% + \writestatus\m!TABLE{missing\space\the\numexpr\c_tabl_ntb_maximum_col-\c_tabl_ntb_encountered_max\relax\space column(s), guessing widths}% \fi \d_tabl_ntb_saved_hsize\hsize % \hsize\wd\scratchbox\relax % new per 17/04/2006 @@ -1736,6 +1754,7 @@ \let\tabl_ntb_cell_process\tabl_ntb_cell_process_e \c_tabl_tbl_pass\plusthree \let\tabl_ntb_pass\tabl_ntb_pass_three + \expand\t_tabl_ntb_initializers_second\relax \ifnum\m_tabl_tbl_level>\plusone \tabl_ntb_split_nop \orelse\ifenableTBLbreak @@ -1993,7 +2012,7 @@ \fi} \def\tabl_ntb_char_align_indeed#1#2% row column - {\ifcase\c_tabl_tbl_pass \or + {\ifcase\c_tabl_tbl_pass\or \setcharacteralign{#2}{\naturaltablelocalparameter\c!alignmentcharacter}% we could store the character in tal \fi \typo_charalign_adapt_font @@ -2006,7 +2025,7 @@ \expandafter\tabl_ntb_cell_process_a \fi{#1}{#2}} -\protected\def\tabl_ntb_cell_process_x#1#2[#3]#4% +\protected\def\tabl_ntb_cell_process_x#1#2[#S#3]#4% {} % problem: when span doesn't break we can have a span that is the sum of cells but @@ -2035,7 +2054,7 @@ \tabl_ntb_set_wid\c_tabl_ntb_col\wd\scratchbox \fi} -\protected\def\tabl_ntb_cell_process_a#1#2[#3]#4% grouping added ! ! ! +\protected\def\tabl_ntb_cell_process_a#1#2[#S#3]#4% grouping added ! ! ! {\begingroup \resetnaturaltablelocalparameter\c!option\empty \tabl_ntb_setup_cell{#1}{#2}% @@ -2060,9 +2079,14 @@ \ifsqueezeTBLspan \tabl_ntb_cell_process_a_check_span_one \fi - \tabl_ntb_spn_doifelse\c_tabl_ntb_col + %\tabl_ntb_spn_doifelse\c_tabl_ntb_col + % \tabl_ntb_cell_process_a_check_span_two_yes + % \tabl_ntb_cell_process_a_check_span_two_nop + \ifcondition\tabl_ntb_spn_condition\c_tabl_ntb_col \tabl_ntb_cell_process_a_check_span_two_yes + \else \tabl_ntb_cell_process_a_check_span_two_nop + \fi \fi \scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax \scratchdimen\tabl_ntb_get_hei\scratchcounter\relax @@ -2095,7 +2119,7 @@ \box\scratchboxone \endgroup} -\protected\def\tabl_ntb_cell_process_b_c#1#2#3[#4]#5% +\protected\def\tabl_ntb_cell_process_b_c#1#2#3[#S#4]#5% {\begingroup \setbox\scratchbox\hbox {\tabl_ntb_setup_cell{#2}{#3}% @@ -2121,7 +2145,7 @@ \box\scratchboxone \endgroup} -\protected\def\tabl_ntb_cell_process_b#1#2[#3]#4% +\protected\def\tabl_ntb_cell_process_b#1#2[#S#3]#4% {\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax \ifdim\scratchdimen>\zeropoint\relax \else @@ -2138,7 +2162,7 @@ \protected\def\tabl_ntb_cell_process_c {\tabl_ntb_cell_process_b_c{}} -\protected\def\tabl_ntb_cell_process_d#1#2[#3]#4% +\protected\def\tabl_ntb_cell_process_d#1#2[#S#3]#4% {\tabl_ntb_setup_cell{#1}{#2}% \bgroup \setupcurrentnaturaltablelocal[#3]% @@ -2148,7 +2172,7 @@ \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop}% \egroup} -\protected\def\tabl_ntb_cell_process_e#1#2[#3]#4% +\protected\def\tabl_ntb_cell_process_e#1#2[#S#3]#4% {\begingroup \tabl_ntb_setup_cell{#1}{#2}% \setupcurrentnaturaltablelocal[#3]% to get the color right, the way we @@ -2168,7 +2192,7 @@ \tabl_ntb_anchor_start{#1}{#2}% \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop}% \tabl_ntb_anchor_stop - \hskip\tabl_ntb_get_dis{#2}% + \hkern\tabl_ntb_get_dis{#2}% \endgroup} \newtoks\everyresetTABLEyes @@ -2271,7 +2295,7 @@ % \eTABLE % \egroup -\newconditional\resetTABLEmode \settrue\resetTABLEmode +\newconditional\resetTABLEmode \resetTABLEmode\conditionaltrue \def\tabl_ntb_parameters_reset % we can use setters instead {\ifnum\m_tabl_tbl_level>\plusone % in ieder geval @@ -2294,7 +2318,7 @@ \installcorenamespace{naturaltablesetup} -\permanent\tolerant\protected\def\defineTABLEsetup[#1]#*[#2]% +\permanent\tolerant\protected\def\defineTABLEsetup[#1]#*[#S#2]% {\ifarguments\else\defcsname\??naturaltablesetup#1\endcsname{#2}\fi} \permanent\let\eTDs\relax @@ -2385,8 +2409,8 @@ \c_tabl_ntb_section\zerocount \tabl_ntb_section_disable} -\tolerant\permanent\protected\def\bTABLEsection[#1]% - {\iftok{#1}\emptytoks +\tolerant\permanent\protected\def\bTABLEsection[#S#1]% + {\ifempty{#1}% \global\c_tabl_ntb_section_repeat\zerocount \else \letdummyparameter\c!repeat\zerocount diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-nte.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-nte.mkxl index e79e2a00417..9aa9b7df1ce 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-nte.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-nte.mkxl @@ -59,7 +59,7 @@ \newconditional\c_tabl_nte_in_nc -\permanent\tolerant\protected\def\startTABLE[#1]% +\permanent\tolerant\protected\def\startTABLE[#S#1]% {\bgroup \bTABLE[#1]% \enforced\let\NC\tabl_nte_start_nc @@ -75,7 +75,7 @@ \permanent\protected\def\tabl_nte_start_nr {\eTR - \setfalse\c_tabl_nte_in_nc} + \c_tabl_nte_in_nc\conditionalfalse} \permanent\protected\def\tabl_nte_start_nc {\futurelet\nexttoken\tabl_nte_start_nc_indeed} @@ -87,7 +87,7 @@ \def\tabl_nte_start_nc_finish#1\NC {\ifconditional\c_tabl_nte_in_nc \else - \settrue\c_tabl_nte_in_nc + \c_tabl_nte_in_nc\conditionaltrue \tabl_ntb_bTR[]% \fi \tabl_ntb_bTD#1\eTD\NC} @@ -99,9 +99,9 @@ \permanent\let\stopTABLEbody\relax \permanent\let\stopTABLEfoot\relax -\permanent\tolerant\protected\def\startTABLEhead[#1]#:#2\stopTABLEhead{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_head} -\permanent\tolerant\protected\def\startTABLEnext[#1]#:#2\stopTABLEnext{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_next} -\permanent\tolerant\protected\def\startTABLEbody[#1]#:#2\stopTABLEbody{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_body} -\permanent\tolerant\protected\def\startTABLEfoot[#1]#:#2\stopTABLEfoot{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_foot} +\permanent\tolerant\protected\def\startTABLEhead[#S#1]#:#2\stopTABLEhead{\toksapp\t_tabl_ntb_head{\tabl_ntb_section[#1]{#2}}} +\permanent\tolerant\protected\def\startTABLEnext[#S#1]#:#2\stopTABLEnext{\toksapp\t_tabl_ntb_next{\tabl_ntb_section[#1]{#2}}} +\permanent\tolerant\protected\def\startTABLEbody[#S#1]#:#2\stopTABLEbody{\toksapp\t_tabl_ntb_body{\tabl_ntb_section[#1]{#2}}} +\permanent\tolerant\protected\def\startTABLEfoot[#S#1]#:#2\stopTABLEfoot{\toksapp\t_tabl_ntb_foot{\tabl_ntb_section[#1]{#2}}} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl index ff0d201cfd7..0ace337a4c5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl @@ -60,7 +60,7 @@ % \enforced\let~\fixedspace \enforced\letcharcode\tildeasciicode\fixedspace % why \inhibitblank % \blank[\v!disable]% % added - \the\everytableparbox} + \expand\everytableparbox} \protected\def\tabl_table_end_par_box {\removelastskip % itemize or so @@ -271,7 +271,7 @@ \aligntab \the\!taPreamble\tabskip\tablerighttabskip \aligntab - \aligncontent\tabskip\zeropoint\cr} + \aligncontent\tabskip\zeroskip\cr} \!taBeginFormatfalse \!ttDoHalign} @@ -282,7 +282,7 @@ \!taRightGlue\emptytoks \begingroup \tabl_table_use_bar - \expanded{\endgroup\noexpand\doreadtableformatkeys#1]}}% appear in a \tabl_table_reformat cmd; this is here as a safeguard. + \normalexpanded{\endgroup\noexpand\doreadtableformatkeys#1]}}% appear in a \tabl_table_reformat cmd; this is here as a safeguard. \aliased\let\ReFormat\relax @@ -445,19 +445,19 @@ \doreadtableformatkeys} \newtableformatkey c% - {\prependtoks\raggedcenter\to\!taDataColumnTemplate + {\tokspre\!taDataColumnTemplate\raggedcenter \doreadtableformatkeys \LeftGlue\hfil \RightGlue\hfil} \newtableformatkey l% - {\prependtoks\raggedright\to\!taDataColumnTemplate + {\tokspre\!taDataColumnTemplate\raggedright \doreadtableformatkeys \LeftGlue\empty \RightGlue\hfil} \newtableformatkey r% - {\prependtoks\raggedleft\to\!taDataColumnTemplate + {\tokspre\!taDataColumnTemplate\raggedleft \doreadtableformatkeys \LeftGlue\hfil \RightGlue\empty} \newtableformatkey x% - {\prependtoks\notragged\to\!taDataColumnTemplate + {\tokspre\!taDataColumnTemplate\notragged \doreadtableformatkeys \LeftGlue\hfil \RightGlue\empty} % Key "k": Adds kerns to left and right of "#" This key and the two below use Plain @@ -466,22 +466,22 @@ % is currently under construction, there's no problem. \newtableformatkey k% - {\settrue\c_tabl_table_spacing_left - \settrue\c_tabl_table_spacing_right + {\c_tabl_table_spacing_left\conditionaltrue + \c_tabl_table_spacing_right\conditionaltrue \!tgGetValue{\!tgInsertKern}} % Key "i": Adds a kern to the left of "#" \newtableformatkey i% - {\settrue\c_tabl_table_spacing_left - \setfalse\c_tabl_table_spacing_right + {\c_tabl_table_spacing_left\conditionaltrue + \c_tabl_table_spacing_right\conditionalfalse \!tgGetValue{\!tgInsertKern}} % Key "j": Adds a kern to the right of "#" \newtableformatkey j% - {\setfalse\c_tabl_table_spacing_left - \settrue\c_tabl_table_spacing_right + {\c_tabl_table_spacing_left\conditionalfalse + \c_tabl_table_spacing_right\conditionaltrue \!tgGetValue{\!tgInsertKern}} % Key "n": numeric item , non-math mode. @@ -660,10 +660,10 @@ \ifempty\tempstring \!taDimenC\zeropoint \else - \setbox\scratchbox\hbox{\mathsurround\zeropoint #1.#3#1}% + \setbox\scratchbox\hbox{\mathsurround\zeropoint\mathsurroundskip\zeroskip#1.#3#1}% \!taDimenC\wd\scratchbox \fi - \setbox\scratchbox\hbox{\mathsurround\zeropoint #1#2#1}% + \setbox\scratchbox\hbox{\mathsurround\zeropoint\mathsurroundskip\zeroskip#1#2#1}% \!thToksEdef\!taDataColumnTemplate {\noexpand\!tnSetNumericItem{\the\wd\scratchbox}{\the\!taDimenC}{#1}% \the\!taDataColumnTemplate}% Might have tabskip glue in here @@ -676,8 +676,8 @@ \def\!tnSetNumericItemA #1#2#3#4.#5.#6!% {\def\tempstring{#6}% - \hbox to #1{\hss \mathsurround\zeropoint #3#4#3}% - \hbox to #2{\ifempty\tempstring\else\mathsurround\zeropoint #3.#5#3\fi\hss}} + \hbox to #1{\hss \mathsurround\zeropoint\mathsurroundskip\zeroskip#3#4#3}% + \hbox to #2{\ifempty\tempstring\else\mathsurround\zeropoint\mathsurroundskip\zeroskip#3.#5#3\fi\hss}} % extensions @@ -733,10 +733,10 @@ \ifempty\tempstring \!taDimenC\zeropoint \else - \setbox\scratchbox\hbox{\mathsurround\zeropoint #1,#3#1}% + \setbox\scratchbox\hbox{\mathsurround\zeropoint\mathsurroundskip\zeroskip#1,#3#1}% \!taDimenC\wd\scratchbox \fi - \setbox\scratchbox\hbox{\mathsurround\zeropoint #1#2#1}% + \setbox\scratchbox\hbox{\mathsurround\zeropoint\mathsurroundskip\zeroskip#1#2#1}% \!thToksEdef\!taDataColumnTemplate {\noexpand\!tqSetQuantityItem{\the\wd\scratchbox}{\the\!taDimenC}{#1}% \the\!taDataColumnTemplate}% @@ -747,8 +747,8 @@ \def\!tqSetQuantityItemA #1#2#3#4,#5,#6!% {\def\tempstring{#6}% - \hbox to #1{\hss\mathsurround\zeropoint#3#4#3}% - \hbox to #2{\ifempty\tempstring\else\mathsurround\zeropoint#3,#5#3\fi\hss}} + \hbox to #1{\hss\mathsurround\zeropoint\mathsurroundskip\zeroskip#3#4#3}% + \hbox to #2{\ifempty\tempstring\else\mathsurround\zeropoint\mathsurroundskip\zeroskip#3,#5#3\fi\hss}} % \Enlarge % \enlarge @@ -776,7 +776,7 @@ \!TsFinishEnlarge} \def\!TsEnlargeMath#1#2% - {\setbox\scratchbox\hbox{\normalstartimath\mathsurround\zeropoint#1{#2}\normalstopimath}% + {\setbox\scratchbox\hbox{\normalstartimath\mathsurround\zeropoint\mathsurroundskip\zeroskip#1{#2}\normalstopimath}% \!TsFinishEnlarge} \def\!TsFinishEnlarge @@ -830,7 +830,7 @@ \let\!ttRightGlue\relax \everycr\emptytoks \ifnum\!taRecursionLevel=\plusone - \the\everytable + \expand\everytable \fi} \bgroup \catcode\tildeasciicode\activecatcode @@ -856,10 +856,10 @@ \lineskip \the\lineskip \tabskip \the\tabskip \relax}% - \baselineskip \zeropoint + \baselineskip \zeroskip \lineskiplimit\zeropoint - \lineskip \zeropoint - \tabskip \zeropoint + \lineskip \zeroskip + \tabskip \zeroskip \edef\p_tabl_table_textwidth{\directtablesparameter\c!textwidth}% % we are not in sync so: \synchronizedisplaydirection @@ -948,7 +948,7 @@ \def\tabl_table_use#1% {\ifnum#1>\plusone \omit - \global\setfalse\c_tabl_table_is_division % added + \global\c_tabl_table_is_division\conditionalfalse % added \scratchcounter\currenttablecolumn % added \advanceby\scratchcounter #1% % added \advanceby\scratchcounter \minusone % added @@ -1056,7 +1056,7 @@ \!thFinishVCS} \def\!thDoMathVCS#1#2% - {\setbox\zerocount\hbox{\normalstartimath\mathsurround\zeropoint#1{#2}\normalstopimath}% + {\setbox\zerocount\hbox{\normalstartimath\mathsurround\zeropoint\mathsurroundskip\zeroskip#1{#2}\normalstopimath}% \!thFinishVCS} \def\!thFinishVCS @@ -1095,7 +1095,7 @@ \!thFinishRaise} % From Plain TeX: \ht0=0pt \dp0=0pt \box0 \def\!thDoMathRaise#1#2% - {\setbox\zerocount\hbox{\raise \!taDimenA\hbox{\normalstartimath\mathsurround\zeropoint#1{#2}\normalstopimath}}% + {\setbox\zerocount\hbox{\raise \!taDimenA\hbox{\normalstartimath\mathsurround\zeropoint\mathsurroundskip\zeroskip#1{#2}\normalstopimath}}% \!thFinishRaise} \def\!thFinishRaise @@ -1466,14 +1466,14 @@ %D splitting. \def\tabl_table_insert_head - {\noalign{\global\settrue\preventtablebreak\global\setfalse\hassometablehead}% + {\noalign{\global\preventtablebreak\conditionaltrue\global\hassometablehead\conditionalfalse}% \tabl_table_head - \noalign{\global\setfalse\preventtablebreak}} + \noalign{\global\preventtablebreak\conditionalfalse}} \def\tabl_table_insert_tail - {\noalign{\global\settrue\preventtablebreak\global\setfalse\hassometabletail}% + {\noalign{\global\preventtablebreak\conditionaltrue\global\hassometabletail\conditionalfalse}% \tabl_table_tail - \noalign{\global\setfalse\preventtablebreak}} + \noalign{\global\preventtablebreak\conditionalfalse}} % \def\doverysimpletableHL % todo % {\noalign{\normalexpanded{\noexpand\tabl_table_normal_full_rule\m_tabl_table_HLheight}} @@ -1498,10 +1498,10 @@ % \gdef\tabl_table_second_stage[#1]% brr nested mess % {\bgroup % \tabl_table_use_bar -% \global\setfalse\tableactionstatepermitted -% \global\setfalse\hassometablehead -% \global\setfalse\hassometabletail -% \expanded{\doifelseinstring{|}{#1}} +% \global\tableactionstatepermitted\conditionalfalse +% \global\hassometablehead\conditionalfalse +% \global\hassometabletail\conditionalfalse +% \normalexpanded{\doifelseinstring{|}{#1}} % {\xdef\tabl_table_restart{\noexpand\tabl_table_restart_indeed{\noexpand\tabl_table_third_stage{#1}}}} % {\ifcsname\??tabletemplate#1\endcsname % \gdef\tabl_table_restart{\csname\??tabletemplate#1\endcsname}% @@ -1516,9 +1516,9 @@ \def\tabl_table_second_stage[#1]% brr nested mess {\bgroup \tabl_table_use_bar - \global\setfalse\tableactionstatepermitted - \global\setfalse\hassometablehead - \global\setfalse\hassometabletail + \global\tableactionstatepermitted\conditionalfalse + \global\hassometablehead\conditionalfalse + \global\hassometabletail\conditionalfalse \normalexpanded{\noexpand\ifhastoks{|}{#1}}% \xdef\tabl_table_restart{\noexpand\tabl_table_restart_indeed{\noexpand\tabl_table_third_stage{#1}}}% \orelse\ifcsname\??tabletemplate#1\endcsname @@ -1543,19 +1543,20 @@ \mutable\lettonothing\currenttableformat \def\tabl_table_third_stage#1% - {\global\settrue\tableactionstatepermitted + {\global\tableactionstatepermitted\conditionaltrue \tabl_table_set_action\tableunknownstate \tabl_table_set_force\tableunknownstate \tabl_table_resetVLvalues - \appendtoks\tabl_table_local_setups\to\everytable + \toksapp\everytable{\tabl_table_local_setups}% \tabl_table_standard_begin[\ifsplittables u\else b\fi]% \the\localtabledefinitions \forgetall % added \edef\currenttableformat{#1}% - \doifsomething\currenttableformat - {\tabl_tables_get_nofcolumns\currenttableformat - % more modern is to use catcode tables - \expandafter\tabl_table_begin_format\currenttableformat\doendtableformat}} + \ifempty\currenttableformat\else + \tabl_tables_get_nofcolumns\currenttableformat + % more modern is to use catcode tables + \expandafter\tabl_table_begin_format\currenttableformat\doendtableformat + \fi} \def\tabl_table_finish {\tabl_tables_chuck_auto_row @@ -1592,11 +1593,11 @@ \splittablestrue \edef\p_tabl_table_split{\directtablesparameter\c!split}% \ifx\p_tabl_table_split\v!repeat - \settrue\c_tabl_table_repeat_head - \settrue\c_tabl_table_repeat_tail + \c_tabl_table_repeat_head\conditionaltrue + \c_tabl_table_repeat_tail\conditionaltrue \else - \setfalse\c_tabl_table_repeat_head - \setfalse\c_tabl_table_repeat_tail + \c_tabl_table_repeat_head\conditionalfalse + \c_tabl_table_repeat_tail\conditionalfalse \fi \flushnotes \setbox\tablecontentbox\vbox\bgroup @@ -1623,12 +1624,10 @@ \d_split_minimum_free_space\zeropoint \setbox\b_split_content\box#1% \ifconditional\c_tabl_table_repeat_head \ifconditional\hassometablehead - \setbox\b_split_head\vsplit\b_split_content to \lineheight - \setbox\b_split_head\vbox{\unvbox\b_split_head}% \vpack ? + \setbox\b_split_head\vsplit\b_split_content upto \lineheight \fi \fi \ifconditional\c_tabl_table_repeat_tail \ifconditional\hassometabletail - \setbox\b_split_tail\vsplit\b_split_content to \lineheight - \setbox\b_split_tail\vbox{\unvbox\b_split_tail}% \vpack ? + \setbox\b_split_tail\vsplit\b_split_content upto \lineheight \fi \fi \ifinsidefloat\else \t_split_before_result{\startbaselinecorrection}% @@ -1683,11 +1682,11 @@ \def\tabl_table_set_head[#1][#2]#3\end {\gdef\tabl_table_head{\begincsname\??tablehead#1\endcsname}% new - \defcsname\??tablehead#1\endcsname{\noalign{\global\settrue\hassometablehead}#3}} + \defcsname\??tablehead#1\endcsname{\noalign{\global\hassometablehead\conditionaltrue}#3}} \def\tabl_table_set_tail[#1][#2]#3\end {\gdef\tabl_table_tail{\begincsname\??tabletail#1\endcsname}% new - \defcsname\??tabletail#1\endcsname{\noalign{\global\settrue\hassometabletail}#3}} + \defcsname\??tabletail#1\endcsname{\noalign{\global\hassometabletail\conditionaltrue}#3}} \normalexpanded { \aliased\letcsname\e!stop\v!tablehead\endcsname\relax @@ -1866,7 +1865,7 @@ \writestatus\m!TABLE{\string#1\space changed into \string#2}% \fi \expandafter\tabl_table_normal_line_format#3#4\crcr % \crcr nodig ? - \noalign{\nobreak\global\settrue\tableactionstatepermitted}} + \noalign{\nobreak\global\tableactionstatepermitted\conditionaltrue}} %D In order to prevent (as good as possible) alignment overflow and therefore \TEX\ %D error messages, we check the maximum number of columns. We keep track of the @@ -1936,7 +1935,7 @@ \global\advanceby\currenttablecolumn\plusone \glettonothing\m_tabl_table_vrule_color \global\c_tabl_table_vrule_thickness_factor\m_tabl_table_VLwidth\relax - \iftok{#1}\emptytoks\else + \ifempty{#1}\else \rawprocesscommalist[#1]\tabl_table_vrulecommand \fi \tabl_table_normal_line_complex_bar}% \relax breaks \use @@ -2027,7 +2026,7 @@ {\tabl_tables_chuck_auto_row \tabl_table_finish_row \noalign\bgroup - \blank[\iftok{#1}\emptytoks\directtablesparameter\c!NL\else#1\fi]% + \blank[\ifempty{#1}\directtablesparameter\c!NL\else#1\fi]% \nobreak \egroup} @@ -2056,7 +2055,7 @@ \newconditional\c_tabl_table_is_division \appendtoks - \global\setfalse\c_tabl_table_is_division + \global\c_tabl_table_is_division\conditionalfalse \enforced\let\DL\tabl_table_DL \enforced\let\DC\tabl_table_DC \enforced\let\DV\tabl_table_DV @@ -2067,7 +2066,7 @@ {\ifconditional\c_tabl_table_is_division\else \tabl_tables_chuck_auto_row \global\currenttablecolumn\zerocount - \global\settrue\c_tabl_table_is_division + \global\c_tabl_table_is_division\conditionaltrue \fi} \def\tabl_table_drulecommand#1% global assignments @@ -2093,7 +2092,7 @@ \tabl_table_set_action\tableunknownstate \global\c_tabl_table_hrule_thickness_factor\m_tabl_table_HLheight\relax \global\c_tabl_table_drule_span\zerocount - \iftok{#1}\emptytoks\else + \ifempty{#1}\else \glettonothing\m_tabl_table_hrule_color \rawprocesscommalist[#1]\tabl_table_drulecommand % \ifempty\m_tabl_table_hrule_color\else @@ -2129,7 +2128,7 @@ \tabl_table_normal_line_ending \noalign\bgroup \nobreak - \global\setfalse\c_tabl_table_is_division + \global\c_tabl_table_is_division\conditionalfalse \tabl_table_account_width % temporary solution \tabl_table_set_action\tablerulestate \egroup} @@ -2183,9 +2182,11 @@ \defcsname\??tablealign\s!unknown\endcsname{\def\tabl_table_paralignment{\notragged}} \appendtoks - \doifelse{\directtablesparameter\c!distance}\v!none - {\tablerowfactor\zerocount} - {\tablerowfactor\plustwo }% + \ifcstok{\directtablesparameter\c!distance}\v!none + \tablerowfactor\zerocount + \else + \tablerowfactor\plustwo + \fi \to \localtabledefinitions \appendtoks diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt index 50d8719055b..bc2fc571f93 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt @@ -27,9 +27,9 @@ local pattern = Ct((separator * (nested + Cc("")) * C((1-separator)^0))^0) local ctx_settabulatelastentry = context.settabulatelastentry local ctx_settabulateentry = context.settabulateentry -local c_tabl_tabulate_nofcolumns = texiscount("c_tabl_tabulate_nofcolumns") -local c_tabl_tabulate_has_rule_spec_first = texiscount("c_tabl_tabulate_has_rule_spec_first") -local c_tabl_tabulate_has_rule_spec_last = texiscount("c_tabl_tabulate_has_rule_spec_last") +local c_tabl_tabulate_nofcolumns = texiscount("c_tabl_tabulate_nofcolumns") +local c_tabl_tabulate_has_rule_spec_first = texiscount("c_tabl_tabulate_has_rule_spec_first") +local c_tabl_tabulate_has_rule_spec_last = texiscount("c_tabl_tabulate_has_rule_spec_last") -- the lmtx raw processor handles {} like the normal one so we need to prune diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl index b2e4f50908a..e139f92c0fe 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl @@ -197,10 +197,10 @@ \newconditional \c_tabl_tabulate_no_blank_in_paragraphs % can become always on \newconditional \c_tabl_tabulate_no_interline_space -\settrue \c_tabl_tabulate_split -\settrue \c_tabl_tabulate_handlepbreak -\settrue \c_tabl_tabulate_autorulespacing -\settrue \c_tabl_tabulate_no_blank_in_paragraphs +\c_tabl_tabulate_split \conditionaltrue +\c_tabl_tabulate_handlepbreak \conditionaltrue +\c_tabl_tabulate_autorulespacing \conditionaltrue +\c_tabl_tabulate_no_blank_in_paragraphs\conditionaltrue \newdimension \d_tabl_tabulate_width_p \newdimension \d_tabl_tabulate_width_w @@ -209,13 +209,16 @@ \newdimension \d_tabl_tabulate_height_p_max \newdimension \d_tabl_tabulate_vrulethickness_default \newdimension \d_tabl_tabulate_hrulethickness_default +\newdimension \d_tabl_tabulate_hruledashsteps_default \newdimension \d_tabl_tabulate_vrulethickness \newdimension \d_tabl_tabulate_hrulethickness % not used \newdimension \d_tabl_tabulate_vrulethickness_local \newdimension \d_tabl_tabulate_hrulethickness_local +\newdimension \d_tabl_tabulate_hruledashsteps_local \newdimension \d_tabl_tabulate_indent \newdimension \d_tabl_tabulate_splitoff_betweenskip \newdimension \d_tabl_tabulate_margin +\newcount \c_tabl_tabulate_step \newgluespec \s_tabl_tabulate_pre \newgluespec \s_tabl_tabulate_post @@ -228,7 +231,7 @@ \newconstant \c_tabl_tabulate_pass \newconstant \c_tabl_tabulate_type \newconstant \c_tabl_tabulate_kind % 1=strong 2=equals -\newconstant \c_tabl_tabulate_splitlinemode \c_tabl_tabulate_splitlinemode\plusone +\newconstant \c_tabl_tabulate_splitlinemode \c_tabl_tabulate_splitlinemode\plustwo % \plusone \newconstant \c_tabl_tabulate_colorspan \newconstant \c_tabl_tabulate_localcolorspan \newconstant \c_tabl_tabulate_modus @@ -238,14 +241,14 @@ \lettonothing \m_tabl_tabulate_separator_factor % fraction -\aliased\let\tabulatesplitlinemode\c_tabl_tabulate_splitlinemode % temp hack, we need an interface +\aliasinteger\tabulatesplitlinemode\c_tabl_tabulate_splitlinemode % temp hack, we need an interface \newtoks \everytabulatepar % where used ? \newtoks \everytabulate % public ? -\permanent\protected\def\tolerantTABLEbreaktrue{\settrue\c_tabl_tabulate_tolerant_break} % used in styles ! +\permanent\protected\def\tolerantTABLEbreaktrue{\c_tabl_tabulate_tolerant_break\conditionaltrue} % used in styles ! -\permanent\def\noftabulaterows{\number\c_tabl_tabulate_noflines} % handy for testing if a table is empty +\permanent\def\noftabulaterows{\the\c_tabl_tabulate_noflines} % handy for testing if a table is empty \installcorenamespace{tabulatebox} \installcorenamespace{tabulatesetup} @@ -439,11 +442,38 @@ \newconditional\c_tabl_use_size \newconditional\c_tabl_sparse_skips -\settrue\c_tabl_use_size % default per 2022-08-25 -\settrue\c_tabl_sparse_skips % default per 2022-08-25 +\c_tabl_use_size \conditionaltrue % default per 2022-08-25 +\c_tabl_sparse_skips\conditionaltrue % default per 2022-08-25 -\installtexdirective {tabulateusesize} {\settrue\c_tabl_use_size} {\setfalse\c_tabl_use_size} -\installtexdirective {tabulatesparseskips} {\settrue\c_tabl_sparse_skips} {\setfalse\c_tabl_sparse_skips} +% \installtexdirective {tabulateusesize} {\c_tabl_use_size \conditionaltrue} {\c_tabl_use_size \conditionalfalse} +% \installtexdirective {tabulatesparseskips} {\c_tabl_sparse_skips\conditionaltrue} {\c_tabl_sparse_skips\conditionalfalse} + +\def\tabl_tabulate_tag_start + {\dostarttaggedchained\t!tabulate\empty\??tabulation} + +\def\tabl_tabulate_tag_start_row + {\dostarttagged\t!tabulaterow\empty} + +\def\tabl_tabulate_tag_start_cell + {\dostarttagged\t!tabulatecell\empty + \dotagtabulatecell} + +\def\tabl_tabulate_tag_stop + {\dostoptagged} + +\def\tabl_tabulate_tag_stop_row + {\dostoptagged} + +\def\tabl_tabulate_tag_stop_cell + {\dostoptagged} + +\noaligned\def\tabl_tabulate_disable_tagging + {\lettonothing\tabl_tabulate_tag_start + \lettonothing\tabl_tabulate_tag_start_row + \lettonothing\tabl_tabulate_tag_start_cell + \lettonothing\tabl_tabulate_tag_stop + \lettonothing\tabl_tabulate_tag_stop_row + \lettonothing\tabl_tabulate_tag_stop_cell} \def\tabl_tabulate_set_preamble_step#1#2% only makes sense for many tabulates {\etoksapp\t_tabl_tabulate_preamble{% @@ -474,7 +504,7 @@ \tabl_tabulate_hook_check % unexpandable \ifzeropt\d_tabl_tabulate_width \ifcase\c_tabl_tabulate_modus\else - \settrue\c_tabl_tabulate_automode + \c_tabl_tabulate_automode\conditionaltrue \fi \else \ifcase\c_tabl_tabulate_modus @@ -496,8 +526,7 @@ \ifempty\m_tabl_tabulate_alignment \else \spac_align_use_now{\m_tabl_tabulate_alignment}% \fi - \noexpand\dostarttagged\noexpand\t!tabulatecell\noexpand\empty - \noexpand\dotagtabulatecell + \noexpand\tabl_tabulate_tag_start_cell \noexpand#1% \ifconditional\c_tabl_tabulate_reshape \tabl_tabulate_shaped_par_begin @@ -519,9 +548,9 @@ \bgroup \tabl_tabulate_hook_G \tabl_tabulate_entry_before -\tabl_tabulate_hook_box_begin % might move + \tabl_tabulate_hook_box_begin % might move \aligncontent -\tabl_tabulate_hook_box_end % might move + \tabl_tabulate_hook_box_end % might move \tabl_tabulate_entry_after \egroup \noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else @@ -542,7 +571,7 @@ \tabsize\zeropoint \fi % begin of right part - \noexpand\dostoptagged + \noexpand\tabl_tabulate_tag_stop_cell \tabl_tabulate_inject_post_skip {\the\ifconditional\c_tabl_post_is_set\s_tabl_tabulate_post\else\s_tabl_tabulate_last\fi}% {\the\s_tabl_tabulate_post}% @@ -554,12 +583,12 @@ \ifnum\c_tabl_tabulate_columns<\numexpr\c_tabl_tabulate_nofcolumns-\plusone\relax \s_tabl_tabulate_post\s_tabl_tabulate_pre \else - \s_tabl_tabulate_post\zeropoint + \s_tabl_tabulate_post\zeroskip \fi %\let\gettabulateexit\dogettabulateexit % still needed ? \d_tabl_tabulate_width\zeropoint %setfalse\c_tabl_pre_is_set - \setfalse\c_tabl_post_is_set} + \c_tabl_post_is_set\conditionalfalse} \permanent\protected\def\installtabulatepreambleoption#1#2% {\defcsname\??tabulatepreamble\string#1\endcsname{#2}}% @@ -598,7 +627,7 @@ \installtabulatepreambleoption{i}{\tabl_tabulate_set_preskip} \installtabulatepreambleoption{j}{\tabl_tabulate_set_posskip} \installtabulatepreambleoption{k}{\tabl_tabulate_set_preposskip} -\installtabulatepreambleoption{e}{\toksapp\t_tabl_tabulate_settings{\global\settrue\c_tabl_tabulate_equal}% +\installtabulatepreambleoption{e}{\toksapp\t_tabl_tabulate_settings{\global\c_tabl_tabulate_equal\conditionaltrue}% \tabl_tabulate_set_preamble} \installtabulatepreambleoption{g}{\tabl_tabulate_set_align} \installtabulatepreambleoption{G}{\tabl_tabulate_set_align_new} @@ -646,14 +675,14 @@ {\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}} \def\tabl_tabulate_set_posskip#1% - {\settrue\c_tabl_post_is_set + {\c_tabl_post_is_set\conditionaltrue \doifelsenumber{#1}% {\s_tabl_tabulate_post#1\d_tabl_tabulate_unit\tabl_tabulate_set_preamble }% {\s_tabl_tabulate_post.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}} \def\tabl_tabulate_set_preposskip#1% {%settrue\c_tabl_pre_is_set - \settrue\c_tabl_post_is_set + \c_tabl_post_is_set\conditionaltrue \doifelsenumber{#1}% {\s_tabl_tabulate_pre#1\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble }% {\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble#1}} @@ -686,13 +715,13 @@ \fi} \def\tabl_tabulate_set_align#1% - {\global\settrue\c_tabl_auto_align_mode + {\global\c_tabl_auto_align_mode\conditionaltrue \setcharacteralign\c_tabl_tabulate_columns{#1}% \tabl_tabulate_set_preamble} \def\tabl_tabulate_set_align_new#1% - {\global\settrue\c_tabl_auto_align_mode_new - \iftok{#1}\emptytoks\else\setalignmentcharacter{#1}\fi% todo: check for number or char or ... in lua + {\global\c_tabl_auto_align_mode_new\conditionaltrue + \ifempty{#1}\else\setalignmentcharacter{#1}\fi% todo: check for number or char or ... in lua \tabl_tabulate_set_preamble} % end of character align plugin @@ -713,7 +742,7 @@ {\doifelsenextparenthesis\tabl_tabulate_set_width_indeed\tabl_tabulate_set_preamble} \def\tabl_tabulate_set_width - {\setfalse\c_tabl_tabulate_pwidth_set + {\c_tabl_tabulate_pwidth_set\conditionalfalse \c_tabl_tabulate_modus\zerocount \tabl_tabulate_pickup_width} @@ -725,10 +754,10 @@ \def\tabl_tabulate_set_paragraph {\doifelsenextparenthesis {\c_tabl_tabulate_modus\plusone - \settrue\c_tabl_tabulate_pwidth_set + \c_tabl_tabulate_pwidth_set\conditionaltrue \tabl_tabulate_pickup_width} {\c_tabl_tabulate_modus\plustwo - \setfalse\c_tabl_tabulate_pwidth_set + \c_tabl_tabulate_pwidth_set\conditionalfalse \tabl_tabulate_set_preamble}} % \startbuffer @@ -783,13 +812,13 @@ \defcsname\??tabulatewidth\v!fixed\endcsname {\c_tabl_tabulate_modus\plusthree - \settrue\c_tabl_tabulate_nopbreak} + \c_tabl_tabulate_nopbreak\conditionaltrue} \defcsname\??tabulatewidth\v!packed\endcsname - {\settrue\c_tabl_tabulate_no_interline_space} + {\c_tabl_tabulate_no_interline_space\conditionaltrue} \defcsname\??tabulatewidth\v!auto\endcsname - {\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape} + {\c_tabl_tabulate_modus\plusthree\c_tabl_tabulate_reshape\conditionaltrue} \lettonothing\tabl_tabulate_hook_box \lettonothing\tabl_tabulate_hook_box_begin @@ -879,10 +908,10 @@ \permanent\protected\def\tabl_tabulate_set_entry#1#2% rulespec template {\c_tabl_tabulate_align\v_tabl_tabulate_align \c_tabl_tabulate_modus\zerocount - \setfalse\c_tabl_tabulate_pwidth_set - \setfalse\c_tabl_tabulate_reshape + \c_tabl_tabulate_pwidth_set\conditionalfalse + \c_tabl_tabulate_reshape\conditionalfalse %setfalse\c_tabl_pre_is_set - \setfalse\c_tabl_post_is_set + \c_tabl_post_is_set\conditionalfalse \t_tabl_tabulate_before\emptytoks \t_tabl_tabulate_after\emptytoks \t_tabl_tabulate_bmath\emptytoks @@ -895,13 +924,13 @@ \glettonothing\m_tabl_tabulate_vrule_color \glettonothing\tabl_tabulate_hook_box \global\c_tabl_tabulate_colorspan\zerocount - \global\setfalse\c_tabl_auto_align_mode - \global\setfalse\c_tabl_auto_align_mode_new + \global\c_tabl_auto_align_mode\conditionalfalse + \global\c_tabl_auto_align_mode_new\conditionalfalse \resetalignmentcharacter % \attribute\aligncharacterattribute\attributeunsetvalue \global\advanceby\c_tabl_tabulate_columns\plusone \letcsname\??tabulatesetup\the\c_tabl_tabulate_columns\endcsname\donothing % here ? - \iftok{#1}\emptytoks + \ifempty{#1}% \global\d_tabl_tabulate_vrulethickness\zeropoint \else \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_default @@ -922,7 +951,7 @@ \permanent\protected\def\tabl_tabulate_set_last_entry#1% rulespec {\glettonothing\m_tabl_tabulate_color \glettonothing\m_tabl_tabulate_vrule_color - \iftok{#1}\emptytoks + \ifempty{#1}% \global\d_tabl_tabulate_vrulethickness\zeropoint \else \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_default @@ -965,6 +994,9 @@ \global\d_tabl_tabulate_splitoff_betweenskip\lastskip \fi}} +% see bruce's test file for variant that is template driven, could be an option +% to a tabulate + \installtexdirective {tabulate.linenumbers} {\def\tabl_tabulate_check_linenumbers{\page_postprocessors_linenumbers_deepbox\b_tabl_tabulate}} @@ -974,15 +1006,15 @@ \def\tabl_tabulate_splitoff_box % maybe use the modern splitter {\dontcomplain - \global\setbox\b_tabl_tabulate\vsplit\b_tabl_tabulate_current\c_tabl_tabulate_column to \lineheight % % % global ? % % % - \setbox\b_tabl_tabulate\vbox - {\unvbox\b_tabl_tabulate}% + \setbox\b_tabl_tabulate\vsplit\b_tabl_tabulate_current\c_tabl_tabulate_column upto \lineheight % % % global ? % % % \ifconditional\c_tabl_tabulate_splitoff_whitespace \tabl_tabulate_check_whitespace \fi \tabl_tabulate_color_repeat % needs to end up in a cell \setbox\b_tabl_tabulate\hpack to \wd\b_tabl_tabulate - {\hss\tabl_tabulate_hook_yes{\box\b_tabl_tabulate}\hss}% + {\hss + \tabl_tabulate_hook_yes{\box\b_tabl_tabulate}% + \hss}% \tabl_tabulate_normalize_splitline \tabl_tabulate_check_linenumbers \box\b_tabl_tabulate} @@ -994,20 +1026,45 @@ \def\tabl_tabulate_hook_yes{\begincsname\??tabulatehook\the\c_tabl_tabulate_column\endcsname} +% \def\tabl_tabulate_pheight_reset +% {\global\c_tabl_tabulate_plines_min\plusone +% \ifdim\d_tabl_tabulate_height_p_max>\zeropoint +% \getnoflines\d_tabl_tabulate_height_p_max +% \global\c_tabl_tabulate_plines_max\noflines +% \else +% \global\c_tabl_tabulate_plines_max\zerocount +% \fi +% \global\d_tabl_tabulate_height_p_max\zeropoint} + +% \def\tabl_tabulate_pheight_set +% {\scratchdimen\ht\b_tabl_tabulate_current\c_tabl_tabulate_column\relax +% \ifdim\scratchdimen>\d_tabl_tabulate_height_p_max +% \global\d_tabl_tabulate_height_p_max\scratchdimen +% \fi} + +\newinteger\c_tabl_tabulate_height_p_max_lines + \def\tabl_tabulate_pheight_reset {\global\c_tabl_tabulate_plines_min\plusone - \ifdim\d_tabl_tabulate_height_p_max>\zeropoint + \iftrue + \global\c_tabl_tabulate_plines_max\c_tabl_tabulate_height_p_max_lines + \orelse\ifdim\d_tabl_tabulate_height_p_max>\zeropoint \getnoflines\d_tabl_tabulate_height_p_max \global\c_tabl_tabulate_plines_max\noflines \else \global\c_tabl_tabulate_plines_max\zerocount \fi - \global\d_tabl_tabulate_height_p_max\zeropoint} + \global\d_tabl_tabulate_height_p_max\zeropoint + \global\c_tabl_tabulate_height_p_max_lines\zerocount} \def\tabl_tabulate_pheight_set {\scratchdimen\ht\b_tabl_tabulate_current\c_tabl_tabulate_column\relax \ifdim\scratchdimen>\d_tabl_tabulate_height_p_max \global\d_tabl_tabulate_height_p_max\scratchdimen + \fi + \scratchcounter\noflinesinbox\b_tabl_tabulate_current\c_tabl_tabulate_column\relax + \ifnum\scratchcounter>\c_tabl_tabulate_height_p_max_lines + \global\c_tabl_tabulate_height_p_max_lines\scratchcounter \fi} \def\tabl_tabulate_pbreak_inject @@ -1118,10 +1175,11 @@ \c!margin=\!!zeropoint, \c!split=\v!auto, \c!header=\v!yes, + \c!dashstep=.1\emwidth, %\c!title=, \c!indenting=\v!no] -\permanent\tolerant\protected\def\definetabulate[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\definetabulate[#1]#*[#S#2]#*[#S#3]% {\ifarguments % ignore \or @@ -1138,7 +1196,7 @@ \definetabulation[#1:#2][#1][\c!format={#3},\s!check=]% \fi} -\permanent\tolerant\protected\def\setuptabulate[#1]#*[#2]#*[#3]% +\permanent\tolerant\protected\def\setuptabulate[#S#1]#*[#S#2]#*[#S#3]% {\ifarguments % ignore \or @@ -1169,20 +1227,18 @@ \lettonothing\tabl_tabulate_insert_foot \def\tabl_tabulate_insert_head_content - {\noalign{\global\settrue\c_tabl_tabulate_someamble}% + {\noalign{\global\c_tabl_tabulate_someamble\conditionaltrue}% \begincsname\??tabulatehead\currenttabulation\endcsname - \noalign{\global\setfalse\c_tabl_tabulate_someamble}}% + \noalign{\global\c_tabl_tabulate_someamble\conditionalfalse}}% \def\tabl_tabulate_insert_foot_content - {\noalign{\global\settrue\c_tabl_tabulate_someamble}% + {\noalign{\global\c_tabl_tabulate_someamble\conditionaltrue}% \begincsname\??tabulatefoot\currenttabulation\endcsname - \noalign{\global\setfalse\c_tabl_tabulate_someamble}}% + \noalign{\global\c_tabl_tabulate_someamble\conditionalfalse}}% \def\tabl_tabulate_check_full_content % - needed, else confusion with \c!header {\ifcsname\??tabulatehead\currenttabulation\endcsname - %\expandafter\ifempty\csname\??tabulatehead\currenttabulation\endcsname - %\expandafter\ifempty\lastnamedcs - \ifempty\lastnamedcs + \ifempty{\lastnamedcs}% \lettonothing\tabl_tabulate_insert_head \else \let\tabl_tabulate_insert_head\tabl_tabulate_insert_head_content @@ -1191,9 +1247,7 @@ \lettonothing\tabl_tabulate_insert_head \fi \ifcsname\??tabulatefoot\currenttabulation\endcsname - %\expandafter\ifempty\csname\??tabulatefoot\currenttabulation\endcsname - %\expandafter\ifempty\lastnamedcs - \ifempty\lastnamedcs + \ifempty{\lastnamedcs}% \lettonothing\tabl_tabulate_insert_foot \else \let\tabl_tabulate_insert_foot\tabl_tabulate_insert_foot_content @@ -1213,8 +1267,10 @@ \def\tabl_tabulate_remove_funny_line {\ifhmode - \strut\crcr - \noalign{\kern-\lineheight}% +% \ifinalignment % needs testing + \strut\crcr + \noalign{\kern-\lineheight}% +% \fi \fi} % todo: make footer synonym to tail @@ -1238,7 +1294,7 @@ \protected\def\tabl_start_defined[#1]% {\bgroup - \edef\currenttabulationparent{#1}% + \cdef\currenttabulationparent{#1}% \let\currenttabulation\currenttabulationparent \ifcstok{\tabulationparameter\c!format}\v!none % this is special case: we need to define the generic english @@ -1249,15 +1305,15 @@ \expandafter\tabl_start_defined_indeed \fi} -\tolerant\def\tabl_start_defined_indeed[#1]#*[#2]% +\tolerant\def\tabl_start_defined_indeed[#S#1]#*[#S#2]% {\ifarguments\or \ifhastok={#1}% \setuptabulation[\currenttabulation][#1]% \else - \edef\currenttabulation{\currenttabulation:#1}% + \cdef\currenttabulation{\currenttabulation:#1}% \fi \else - \edef\currenttabulation{\currenttabulation:#1}% + \cdef\currenttabulation{\currenttabulation:#1}% \setuptabulation[\currenttabulation][#2]% \fi \tabl_tabulate_start_building} @@ -1271,19 +1327,19 @@ \lettonothing\currenttabulationparent \tabl_start_regular} -\tolerant\protected\def\tabl_start_regular[#1]#*[#2]% [format] | [settings] | [format] [settings] | [settings] [format] +\tolerant\protected\def\tabl_start_regular[#S#1]#*[#S#2]% [format] | [settings] | [format] [settings] | [settings] [format] {\let\currenttabulation\currenttabulationparent - \iftok{#1}\emptytoks + \ifempty{#1}% \ifhaschar={#2}\relax \setupcurrenttabulation[#2]% \fi \orelse\ifhaschar={#1}\relax - \iftok{#2}\emptytoks\else + \ifempty{#2}\else \settabulationparameter\c!format{#2}% \fi \setupcurrenttabulation[#1]% \else - \iftok{#1}\emptytoks\else + \ifempty{#1}\else \settabulationparameter\c!format{#1}% \fi \ifhaschar={#2}\relax @@ -1298,16 +1354,16 @@ \permanent\protected\def\tabl_tabulate_start_ignore % todo when we go frozen {\em Nested tabulate is not (yet) supported.\relax - \expandafter\gobbleuntil\csname\ifconditional\c_tabl_generic stoptabulate\else\e!stop\v!tabulate\fi\endcsname} + \expandafter\ignoreupto\csname\ifconditional\c_tabl_generic stoptabulate\else\e!stop\v!tabulate\fi\endcsname} \appendtoks \enforced\letcsname\e!start\v!tabulate\endcsname\tabl_tabulate_start_ignore % only the main one \to \everytabulate -\defcsname\??tabulatesplit\v!yes \endcsname{\settrue\c_tabl_tabulate_split} -\defcsname\??tabulatesplit\v!repeat\endcsname{\settrue\c_tabl_tabulate_split} -\defcsname\??tabulatesplit\v!no \endcsname{\setfalse\c_tabl_tabulate_split} -\defcsname\??tabulatesplit\v!auto \endcsname{\ifinsidefloat\ifinsidesplitfloat\else\setfalse\c_tabl_tabulate_split\fi\fi} +\defcsname\??tabulatesplit\v!yes \endcsname{\c_tabl_tabulate_split\conditionaltrue} +\defcsname\??tabulatesplit\v!repeat\endcsname{\c_tabl_tabulate_split\conditionaltrue} +\defcsname\??tabulatesplit\v!no \endcsname{\c_tabl_tabulate_split\conditionalfalse} +\defcsname\??tabulatesplit\v!auto \endcsname{\ifinsidefloat\ifinsidesplitfloat\else\c_tabl_tabulate_split\conditionalfalse\fi\fi} % todo: spacing around tabulate when bodyfont is set @@ -1378,14 +1434,14 @@ {\tabulationparameter\c!after} \def\tabl_tabulate_outside_inbetween_indeed - {\ifcstok{\tabulationparameter\c!after}\emptytoks\else + {\ifempty{\tabulationparameter\c!after}\else \vskip\strutdp \verticalstrut \vskip-\struttotal \fi} \def\tabl_tabulate_inside_inbetween % needs checking - {\ifcstok{\tabulationparameter\c!after}\emptytoks\else + {\ifempty{\tabulationparameter\c!after}\else \vskip\strutdp \verticalstrut \vskip-\struttotal @@ -1411,25 +1467,24 @@ \edef\p_rulethickness {\tabulationparameter\c!rulethickness}% \edef\p_bodyfont {\tabulationparameter\c!bodyfont}% \edef\p_indenting {\tabulationparameter\c!indenting}% - \edef\p_keeptogether {\tabulationparameter\c!keeptogether}% \edef\p_blank {\tabulationparameter\c!blank}% - \edef\p_interlinespace{\tabulationparameter\c!interlinespace}% + \edef\p_dashstep {\tabulationparameter\c!dashstep}% % - \ifx\p_keeptogether\v!no - \settrue \c_tabl_tabulate_tolerant_break - %\setfalse\c_tabl_tabulate_handlepbreak + \ifcstok{\tabulationparameter\c!keeptogether}\v!no + \c_tabl_tabulate_tolerant_break\conditionaltrue + %\c_tabl_tabulate_handlepbreak\conditionalfalse \else - \setfalse\c_tabl_tabulate_tolerant_break - %\settrue \c_tabl_tabulate_handlepbreak + \c_tabl_tabulate_tolerant_break\conditionalfalse + %\c_tabl_tabulate_handlepbreak\conditionaltrue \fi % - \ifx\p_interlinespace\v!no - \settrue\c_tabl_tabulate_no_interline_space + \ifcstok{\tabulationparameter\c!interlinespace}\v!no + \c_tabl_tabulate_no_interline_space\conditionaltrue \else - \setfalse\c_tabl_tabulate_no_interline_space + \c_tabl_tabulate_no_interline_space\conditionalfalse \fi % - \settrue\c_tabl_tabulate_split + \c_tabl_tabulate_split\conditionaltrue \begincsname\??tabulatesplit\tabulationparameter\c!split\endcsname % \let\m_tabl_tabulate_blank_default\p_blank @@ -1440,20 +1495,52 @@ \let\m_tabl_tabulate_hrule_color_default\p_rulecolor \d_tabl_tabulate_vrulethickness_default\p_rulethickness \d_tabl_tabulate_hrulethickness_default\p_rulethickness + \d_tabl_tabulate_hruledashsteps_default\p_dashstep \ifempty\p_bodyfont\else \switchtobodyfont[\p_bodyfont]% \fi \postponenotes % new, to be tested / will be configurable \widowpenalty\zerocount % otherwise lines are not broken \clubpenalty \zerocount % but overlap in funny ways - \the\everytabulate - \tabulationparameter\c!inner + \expand\everytabulate + \usesetupsparameter\tabulationparameter + \tabulationparameter\c!inner % use setups now \d_tabl_tabulate_indent\dimexpr\leftskip+\hangindent\ifx\p_indenting\v!yes+\parindent\fi\relax \global\c_tabl_tabulate_column\zerocount - \processcontent % stoptabulate needs to match the frozen one - {\ifconditional\c_tabl_generic stoptabulate\else\e!stop\ifempty\currenttabulationparent\v!tabulate\else\currenttabulationparent\fi\fi} - \tabl_tabulate_insert_body - \tabl_tabulate_process} + \begingroup + \catcode\hashasciicode\othercatcode + \ifconditional\c_tabl_generic + \expandafter\tabl_tabulate_pickup_generic + \orelse\ifempty\currenttabulationparent + \expandafter\tabl_tabulate_pickup_interfaced + \else + \expandafter\tabl_tabulate_pickup_specific + \fi} + +\protected\def\tabl_tabulate_pickup_generic + #L\starttabulate + #R\stoptabulate + #1% + {\endgroup + \def\tabl_tabulate_insert_body{#1}% + \tabl_tabulate_process} + +\protected\def\tabl_tabulate_pickup_indeed#1#2% + {\protected\def\tabl_tabulate_pickup##L#1##R#2##1% indirect needed because otherwise ##L and ##R expand + {\endgroup + \def\tabl_tabulate_insert_body{##1}% + \tabl_tabulate_process}% + \tabl_tabulate_pickup} + +\protected\def\tabl_tabulate_pickup_interfaced + {\normalexpanded{\tabl_tabulate_pickup_indeed + \expandafter\noexpand\csname\e!start\v!tabulate\endcsname + \expandafter\noexpand\csname\e!stop \v!tabulate\endcsname}} + +\protected\def\tabl_tabulate_pickup_specific + {\normalexpanded{\tabl_tabulate_pickup_indeed + \expandafter\noexpand\csname\e!start\currenttabulationparent\endcsname + \expandafter\noexpand\csname\e!stop \currenttabulationparent\endcsname}} \permanent\protected\def\tabulateEQ {\ifconditional\c_tabl_tabulate_firstflushed\else @@ -1463,7 +1550,7 @@ \dostoptagged \dostoptagged \fi - \global\setfalse\c_tabl_tabulate_equal} + \global\c_tabl_tabulate_equal\conditionalfalse} % The next ones will be token registers @@ -1677,8 +1764,8 @@ \defcsname\??tabulateseparator\v!small \endcsname{\def\m_tabl_tabulate_separator_factor{.25}} \defcsname\??tabulateseparator\v!medium\endcsname{\def\m_tabl_tabulate_separator_factor{.5}} \defcsname\??tabulateseparator\v!big \endcsname{} -\defcsname\??tabulateseparator\v!none \endcsname{\s_tabl_tabulate_separator\zeropoint\let\m_tabl_tabulate_separator_factor\zerocount} -\defcsname\??tabulateseparator\v!grid \endcsname{\s_tabl_tabulate_separator\zeropoint\let\m_tabl_tabulate_separator_factor\zerocount} +\defcsname\??tabulateseparator\v!none \endcsname{\s_tabl_tabulate_separator\zeroskip\let\m_tabl_tabulate_separator_factor\zerocount} +\defcsname\??tabulateseparator\v!grid \endcsname{\s_tabl_tabulate_separator\zeroskip\let\m_tabl_tabulate_separator_factor\zerocount} \def\tabl_tabulate_column_rule_separator_step#1% {\ifcsname\??tabulateseparator#1\endcsname @@ -1702,25 +1789,55 @@ \directvskip\s_tabl_tabulate_separator \egroup} -\lettonothing\m_tabl_tabulate_hrule_color +% \starttabulate +% \FL[1,2] % linewidthfactor, dashstepfactor +% \NC test \NC test and test and test and done \NC \NR +% \ML[1,1] +% \NC test \NC test and test and test and done \NC \NR +% \NC test \NC test and test and test and done \NC \NR +% \NC test \NC test and test and test and done \NC \NR +% \LL[1,10] +% \stoptabulate -\def\tabl_tabulate_hrule_preset_step#1% - {\doifelsenumber{#1}% - {\global\d_tabl_tabulate_hrulethickness_local#1\d_tabl_tabulate_hrulethickness_default} - {\xdef\m_tabl_tabulate_hrule_color{#1}}} +\lettonothing\m_tabl_tabulate_hrule_color \def\tabl_tabulate_hrule_preset[#1]% {\glet\m_tabl_tabulate_hrule_color\m_tabl_tabulate_hrule_color_default \global\d_tabl_tabulate_hrulethickness_local\d_tabl_tabulate_hrulethickness_default - \iftok{#1}\emptytoks\else\rawprocesscommalist[#1]\tabl_tabulate_hrule_preset_step\fi} + \global\d_tabl_tabulate_hruledashsteps_local\zeropoint + \c_tabl_tabulate_step\zerocount + \ifempty{#1}\else\rawprocesscommalist[#1]\tabl_tabulate_hrule_preset_step\fi} + +\def\tabl_tabulate_hrule_preset_step#1% + {\ifchknum#1\or + \advance\c_tabl_tabulate_step\plusone + \ifcase\c_tabl_tabulate_step\or + \global\d_tabl_tabulate_hrulethickness_local#1\d_tabl_tabulate_hrulethickness_default + \else + \global\d_tabl_tabulate_hruledashsteps_local#1\d_tabl_tabulate_hruledashsteps_default + \fi + \else + \xdef\m_tabl_tabulate_hrule_color{#1}% + \fi} \def\tabl_tabulate_hrule_inject_normal {\autorule \s!height.5\d_tabl_tabulate_hrulethickness_local \s!depth .5\d_tabl_tabulate_hrulethickness_local \s!left \d_tabl_tabulate_indent + on \d_tabl_tabulate_hruledashsteps_local + off \d_tabl_tabulate_hruledashsteps_local \relax} +% \def\tabl_tabulate_hrule_inject_normal .. messes with prevdepth and needs mode +% {\hrule % running +% \s!height.5\d_tabl_tabulate_hrulethickness_local +% \s!depth .5\d_tabl_tabulate_hrulethickness_local +% \s!left \d_tabl_tabulate_indent +% on \d_tabl_tabulate_hruledashsteps_local +% off \d_tabl_tabulate_hruledashsteps_local +% \relax} + \def\tabl_tabulate_hrule_inject_colored {\dousecolorparameter\m_tabl_tabulate_hrule_color \tabl_tabulate_hrule_inject_normal} @@ -1871,7 +1988,7 @@ \advanceby\hsize\d_tabl_tabulate_indent % this is indeed rather messy and took a few hours % to dis/uncover - \the\t_tabl_tabulate_every_row + \expand\t_tabl_tabulate_every_row \hss}} \def\tabl_tabulate_flush_indent @@ -2001,12 +2118,12 @@ \c!yoffset=\zeropoint, \c!orientation=] -\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_yes[#1]#*[#2]% +\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_yes[#S#1]#*[#S#2]% {\beginlocalcontrol \ifhastok={#1}% \setupcurrenttabulatemove[#1]% \else - \edef\currenttabulatemove{#1}% + \cdef\currenttabulatemove{#1}% \setupcurrenttabulatemove[#2]% \fi \edef\p_orientation{\theorientation{\tabulatemoveparameter\c!orientation}}% @@ -2030,7 +2147,7 @@ \endlocalcontrol \noalign\tabl_tabulate_tm{}} -\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_nop[#1]#*[#2]% +\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_nop[#S#1]#*[#S#2]% {} \lettonothing\tabl_tabulate_tm % new 27/12/2022 @@ -2106,8 +2223,8 @@ % \permanent\protected\def\tabl_tabulate_NR_common#1#2% % {\global\advanceby\c_tabl_tabulate_noflines\plusone -% \global\setfalse\c_tabl_tabulate_firstflushed -% \global\setfalse\c_tabl_tabulate_equal +% \global\c_tabl_tabulate_firstflushed\conditionalfalse +% \global\c_tabl_tabulate_equal\conditionalfalse % \global\c_tabl_tabulate_column\zerocount % \ifconditional#1\relax % \tabl_tabulate_break_state_reset @@ -2115,7 +2232,7 @@ % \tabl_tabulate_pheight_reset % \unskip\unskip\crcr\tabl_tabulate_flush_collected % % can we omit the next one in the first run? probably -% \noalign{\the\t_tabl_tabulate_every_after_row#2}} +% \noalign{\expand\t_tabl_tabulate_every_after_row#2}} % test case for ignorepar error % @@ -2128,8 +2245,8 @@ \permanent\tolerant\protected\def\tabl_tabulate_NR_common#1#2% #. gobbles pars and spaces {\global\advanceby\c_tabl_tabulate_noflines\plusone - \global\setfalse\c_tabl_tabulate_firstflushed - \global\setfalse\c_tabl_tabulate_equal + \global\c_tabl_tabulate_firstflushed\conditionalfalse + \global\c_tabl_tabulate_equal\conditionalfalse \global\c_tabl_tabulate_column\zerocount \ifconditional#1\relax \tabl_tabulate_break_state_reset @@ -2138,7 +2255,7 @@ \unskip\unskip\crcr\tabl_tabulate_flush_collected % can we omit the next one in the first run? probably % todo: move \ignorepars ourside so no alignment error then - \noalign{\the\t_tabl_tabulate_every_after_row#2\ignorepars}} + \noalign{\expand\t_tabl_tabulate_every_after_row#2\ignorepars}} \def\tabl_tabulate_check_penalties {\ifconditional\c_tabl_tabulate_tolerant_break\else @@ -2161,7 +2278,7 @@ \fi \fi \fi - \global\setfalse\c_tabl_tabulate_firstflushed + \global\c_tabl_tabulate_firstflushed\conditionalfalse \ifconditional\c_tabl_tabulate_no_interline_space \nointerlineskip \injectzerobaselineskip @@ -2201,7 +2318,7 @@ \else % successive lines \lettonothing\tabl_tabulate_eskip - \dontcomplain + %\dontcomplain \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes \expandafter\tabl_tabulate_splitoff_box \fi} @@ -2213,19 +2330,19 @@ % {\glettonothing\tabl_tabulate_flush_collected_indeed % \global\c_tabl_tabulate_column\zerocount % \tabl_tabulate_pbreak_check -% \global\setfalse\c_tabl_tabulate_split_done % new 27/12/2022 +% \global\c_tabl_tabulate_split_done\conditionalfalse % new 27/12/2022 % \dofastloopcs\c_tabl_tabulate_columns\tabl_tabulate_flush_second_step % \ifconditional\c_tabl_tabulate_split_done\else % \glet\tabl_tabulate_tm\s!reset % new 27/12/2022 % \fi -% \global\settrue\c_tabl_tabulate_firstflushed} +% \global\c_tabl_tabulate_firstflushed\conditionaltrue} % \protected\def\tabl_tabulate_flush_second_step % {\ifvoid\b_tabl_tabulate_current\fastloopindex % \else -% \gdef\tabl_tabulate_flush_collected_indeed{\the\t_tabl_tabulate_dummy}% +% \gdef\tabl_tabulate_flush_collected_indeed{\expand\t_tabl_tabulate_dummy}% % \ifvoid\b_tabl_tabulate_current\fastloopindex \else -% \global\settrue\c_tabl_tabulate_split_done % new 27/12/2022 +% \global\c_tabl_tabulate_split_done\conditionaltrue % new 27/12/2022 % \fi % \fi} @@ -2235,19 +2352,19 @@ {\glettonothing\tabl_tabulate_flush_collected_indeed \global\c_tabl_tabulate_column\zerocount \tabl_tabulate_pbreak_check - \global\setfalse\c_tabl_tabulate_split_done % new 27/12/2022 + \global\c_tabl_tabulate_split_done\conditionalfalse % new 27/12/2022 \localcontrolledloop\plusone\c_tabl_tabulate_columns\plusone{\tabl_tabulate_flush_second_step}% \ifconditional\c_tabl_tabulate_split_done\else \glet\tabl_tabulate_tm\s!reset % new 27/12/2022 \fi - \global\settrue\c_tabl_tabulate_firstflushed} + \global\c_tabl_tabulate_firstflushed\conditionaltrue} \protected\def\tabl_tabulate_flush_second_step {\ifvoid\b_tabl_tabulate_current\currentloopiterator \else - \gdef\tabl_tabulate_flush_collected_indeed{\the\t_tabl_tabulate_dummy}% + \gdef\tabl_tabulate_flush_collected_indeed{\expand\t_tabl_tabulate_dummy}% \ifvoid\b_tabl_tabulate_current\currentloopiterator \else - \global\settrue\c_tabl_tabulate_split_done % new 27/12/2022 + \global\c_tabl_tabulate_split_done\conditionaltrue % new 27/12/2022 \fi \fi} @@ -2257,8 +2374,10 @@ \tabl_tabulate_flush_collected_indeed} \protected\def\tabl_tabulate_bskip_second_split_nop +% {\dbox\bgroup {\vtop\bgroup \ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi +\inhibitblank % \begstrut % interferes with pre-\pars % evt: \appendtoks\begstrut\to\everypar \ignorepars} % \ignorespaces @@ -2299,7 +2418,7 @@ \permanent\tolerant\noaligned\protected\def\tabl_tabulate_BL_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_BL_second_indeed}} \protected\def\tabl_tabulate_FL_second_indeed - {\ifinsidefloat\orelse\ifcstok{\tabulationparameter\c!before}\emptytoks + {\ifinsidefloat\orelse\ifempty{\tabulationparameter\c!before}%% \tabl_tabulate_baselinecorrection \fi \tabl_tabulate_hrule_inject @@ -2452,14 +2571,14 @@ % \stoptabulate \protected\def\tabl_tabulate_anchor_indeed - {\edef\xanchor{\number\c_tabl_tabulate_column}% - \edef\yanchor{\number\c_tabl_tabulate_nofrealrows}% + {\edef\xanchor{\the\c_tabl_tabulate_column}% + \edef\yanchor{\the\c_tabl_tabulate_nofrealrows}% \markanchor{matrix}{\c_tabl_tabulate_column}{\c_tabl_tabulate_nofrealrows}} \def\tabl_tabulate_anchor_setup % a bit of a cheat but good enough for a lightweight experiment {\edef\p_synchronize{\tabulationparameter\c!synchronize}% \ifx\p_synchronize\v!background - \edef\currentframedcontent{\tabulationparameter\c!frame}% + \cdef\currentframedcontent{\tabulationparameter\c!frame}% \ifx\currentframedcontent\v!off \resettabulationparameter\c!frame \lettonothing\currentframedcontent @@ -2479,10 +2598,10 @@ \edef\v_tabl_tabulate_align{\ifcsname\??tabulatealigning\p_align\endcsname\lastnamedcs\else0\fi}% \s_tabl_tabulate_first.5\d_tabl_tabulate_unit \s_tabl_tabulate_last\s_tabl_tabulate_first - \s_tabl_tabulate_pre\zeropoint - \s_tabl_tabulate_post\zeropoint + \s_tabl_tabulate_pre\zeroskip + \s_tabl_tabulate_post\zeroskip %setfalse\c_tabl_pre_is_set - \setfalse\c_tabl_post_is_set + \c_tabl_post_is_set\conditionalfalse \global\c_tabl_tabulate_columns\zerocount \global\c_tabl_tabulate_nofauto\zerocount \global\c_tabl_tabulate_noflines\zerocount @@ -2490,9 +2609,9 @@ \c_tabl_tabulate_minusnoflines\zerocount \global\d_tabl_tabulate_width_p\zeropoint \global\d_tabl_tabulate_width_w\zeropoint - \global\setfalse\c_tabl_tabulate_equal + \global\c_tabl_tabulate_equal\conditionalfalse \tabl_tabulate_pheight_reset - \tabskip\zeropoint + \tabskip\zeroskip \ifinsidesplitfloat \donetrue \orelse\ifinsidefloat @@ -2511,7 +2630,7 @@ \zerocount \fi % - \the\t_tabl_tabulate_initializers_first % collect more here + \expand\t_tabl_tabulate_initializers_first % collect more here % \glettonothing\tabl_tabulate_flush_collected \ifdim\d_tabl_tabulate_margin>\zeropoint @@ -2535,7 +2654,7 @@ \aligncontent % \alignmark\alignmark \aligntab \aligncontent % \alignmark\alignmark - \tabskip\zeropoint}% + \tabskip\zeroskip}% \fi \d_tabl_tabulate_width\zeropoint % these counters are set at the lua end @@ -2581,7 +2700,7 @@ \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}}% \anch_backgrounds_text_level_stop \ifcase\c_anch_backgrounds_text_state\else - \global\settrue\tablehaspositions + \global\tablehaspositions\conditionaltrue \fi \ifnum\c_tabl_tabulate_nofauto>\zerocount % so, even if the natural size is larger, in the final run, we force the calculated width @@ -2601,7 +2720,7 @@ \global\c_tabl_tabulate_noflines\zerocount % \c_tabl_tabulate_pass\plustwo % final pass - \the\t_tabl_tabulate_initializers_second % collect more here + \expand\t_tabl_tabulate_initializers_second % collect more here % \ifx\p_line\v!line \enforced\let\HL\HR @@ -2620,17 +2739,16 @@ \global\setbox\b_tabl_tabulate\vbox \bgroup \fi % - \dostarttaggedchained\t!tabulate\empty\??tabulation - \dostarttagged\t!tabulaterow\empty - \setfalse\inhibitmargindata % new per 2012.06.13 ... really needed -% % \everycr\expandafter{\the\everycr\noalign{\the\t_tabl_tabulate_every_real_row}\dostoptagged\dostarttagged\t!tabulaterow\empty}% - \toksapp\everycr{\noalign{\the\t_tabl_tabulate_every_real_row\dostoptagged\dostarttagged\t!tabulaterow\empty}}% + \tabl_tabulate_tag_start + \tabl_tabulate_tag_start_row + \inhibitmargindata\conditionalfalse % new per 2012.06.13 ... really needed + \toksapp\everycr{\noalign{\the\t_tabl_tabulate_every_real_row\tabl_tabulate_tag_stop_row\tabl_tabulate_tag_start_row\empty}}% \halign \ifconditional\c_tabl_sparse_skips \s!noskips\fi \ifconditional\c_tabl_auto_align_mode_new \alignmentcharactertrigger\fi \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}% - \dostoptagged - \dostoptagged + \tabl_tabulate_tag_stop_row + \tabl_tabulate_tag_stop \ifhmode\par\prevdepth\strutdp\fi % nog eens beter, temporary hack \ifx\p_distance\v!grid \vskip-\strutdp % experimental tm-prikkels @@ -2692,8 +2810,7 @@ \d_split_minimum_free_space\zeropoint \setbox\b_split_content\box#1% \ifcase\c_tabl_tabulate_repeathead\or - \setbox\b_split_head\vsplit\b_split_content to \lineheight - \setbox\b_split_head\vbox{\unvbox\b_split_head}% + \setbox\b_split_head\vsplit\b_split_content upto \lineheight \or \setbox\b_split_head\vbox{\hbox{\strut\tabulationparameter\c!title}}% \fi @@ -2724,7 +2841,7 @@ \permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB_yes[#1]% {\noalign\bgroup - \unless\iftok{#1}\emptytoks + \unless\ifempty{#1}% \blank[#1] \orelse\ifempty\m_tabl_tabulate_blank_default \blank @@ -2767,7 +2884,7 @@ %D Some new trickery: %D %D \startbuffer -%D \settrue\c_tabl_tabulate_splitoff_whitespace +%D \c_tabl_tabulate_splitoff_whitespace\conditionaltrue %D %D \starttabulate[|p(2cm)|p(2cm)|p(2cm)|] %D \NC test 1a \NC test 2a \NC test 3a @@ -2915,7 +3032,7 @@ \permanent\protected\defcsname starttabulate\endcsname {\bgroup % whole thing - \settrue\c_tabl_generic + \c_tabl_generic\conditionaltrue \lettonothing\currenttabulationparent \tabl_start_regular} @@ -3199,10 +3316,10 @@ \permanent\protected\def\tabl_tabulate_A_first {\global\advanceby\c_tabl_tabulate_autocolor\plusone - \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\number\c_tabl_tabulate_autocolor}}% + \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\the\c_tabl_tabulate_autocolor}}% \ifempty\m_table_current_row_background_auto \global\c_tabl_tabulate_autocolor\plusone - \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\number\c_tabl_tabulate_autocolor}}% + \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\the\c_tabl_tabulate_autocolor}}% \fi \ifempty\m_table_current_row_background_auto \lettonothing\m_table_current_row_background_auto % \m_table_current_row_background_default diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl index 6facbfcae00..7200d05813e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl @@ -67,7 +67,7 @@ \newconditional\splitfloatfirstdone \newconditional\somenextsplitofffloat \newconditional\splitfloatdone -\newconditional\onlyonesplitofffloat \settrue\onlyonesplitofffloat +\newconditional\onlyonesplitofffloat \onlyonesplitofffloat\conditionaltrue \newif \ifinsidesplitfloat % will become conditional \newcount\noffloatssplits @@ -79,9 +79,9 @@ \mutable\lettonothing\splitfloatcommand \mutable\lettonothing\floatcaptionsuffix -\permanent\tolerant\protected\def\splitfloat[#1]#:#2% nog dubbele refs +\permanent\tolerant\protected\def\splitfloat[#S#1]#:#2% nog dubbele refs {\bgroup - \global\setfalse\splitfloatdone + \global\splitfloatdone\conditionalfalse \aftergroup\page_split_float_check \insidefloattrue \insidesplitfloattrue @@ -89,10 +89,10 @@ \global\noffloatssplits\zerocount \let\floatcaptionsuffix\page_split_float_suffix \edef\extrasplitfloatlines{\floatsplittingparameter\c!lines}% - \the\everysplitfloatsetup + \expand\everysplitfloatsetup \def\splitfloatcommand{#2}% - \global\settrue \onlyonesplitofffloat - \global\setfalse\somenextsplitofffloat + \global\onlyonesplitofffloat\conditionaltrue + \global\somenextsplitofffloat\conditionalfalse \page_floats_push_saved \floatsplittingparameter\c!before \let\next} % \bgroup @@ -105,7 +105,7 @@ \protected\def\page_split_float_check {\ifconditional\splitfloatdone - \splitfloatfinalizer % a weird place (could interfere with flushing) + %\splitfloatfinalizer % a weird place (could interfere with flushing) \else \blank \begingroup @@ -113,7 +113,8 @@ \endgroup \blank \showmessage\m!floatblocks{13}\empty - \fi} + \fi + \splitfloatfinalizer} % a weird place (could interfere with flushing) \def\page_split_float_process % nextbox {\ifinsidesplitfloat @@ -128,7 +129,7 @@ \def\page_split_float_process_finish {\forgetall \dontcomplain - \global\settrue\splitfloatdone + \global\splitfloatdone\conditionaltrue % \nodelocationmode\zerocount % bypass auto-renumbering \global\advanceby\noffloatssplits\plusone \ifcase\noffloatssplits\relax \or @@ -154,7 +155,7 @@ \page_floats_pop_saved \page_floats_flush_saved \fi - \global\settrue\splitfloatfirstdone} + \global\splitfloatfirstdone\conditionaltrue} \def\page_split_float_process_nop {\dowithnextboxcs\page_split_float_process_nop_finish\vbox} @@ -163,16 +164,16 @@ {\forgetall \dontcomplain \box\nextbox % maybe an option to unvbox - \global\settrue\splitfloatfirstdone} + \global\splitfloatfirstdone\conditionaltrue} \def\page_split_float_check_content#1% box {\ifinsidesplitfloat % \ifdim\ht#1=\zeropoint % funny: \ifcase does not check for overflow \ifcase\ht#1\relax - \global\setfalse\somenextsplitofffloat + \global\somenextsplitofffloat\conditionalfalse \else - \global\settrue \somenextsplitofffloat - \global\setfalse\onlyonesplitofffloat + \global\somenextsplitofffloat\conditionaltrue + \global\onlyonesplitofffloat\conditionalfalse \fi \fi} @@ -192,9 +193,9 @@ \resetlocalfloats \advanceby\noflines\minusone % compensate dummy line \normalexpanded{\egroup\noexpand\edef\noexpand\extrasplitfloatlines{\the\noflines}}% - \global\settrue\usesamefloatnumber - \else - \doifelsenumber\extrasplitfloatlines\donothing{\def\extrasplitfloatlines{1}}% + \global\usesamefloatnumber\conditionaltrue + \orelse\ifchknum\extrasplitfloatlines\else + \def\extrasplitfloatlines{1} \fi} \permanent\protected\def\doifnotinsidesplitfloat @@ -254,7 +255,7 @@ \mutable\let\postprocesstsplit\donothing \permanent\protected\def\resettsplit - {\the\everyresettsplit} + {\expand\everyresettsplit} \resettsplit @@ -262,33 +263,36 @@ \permanent\protected\def\handletsplit {\page_split_float_check_caption{\wd\b_split_content}% - \global\setfalse\splitfloatfirstdone + \global\splitfloatfirstdone\conditionalfalse \testpagesync % new, sync, but still tricky - [\number\c_split_minimum_free_lines] + [\the\c_split_minimum_free_lines] [\dimexpr\d_split_minimum_free_space+\extrasplitfloatlines\lineheight\relax]% - \setbox\scratchbox\vbox{\the\t_split_inbetween}% + \setbox\scratchbox\vbox{\expand\t_split_inbetween}% \d_split_inbetween_height\htdp\scratchbox - \setfalse\c_tabl_split_done - \doloop\tabl_split_loop_body - \global\setfalse\usesamefloatnumber % new, prevent next increment - \global\setfalse\splitfloatfirstdone} % we can use this one for tests + \c_tabl_split_done\conditionalfalse + \localcontrolledrepeating + {\tabl_split_loop_body}% + \global\usesamefloatnumber\conditionalfalse % new, prevent next increment + \global\splitfloatfirstdone\conditionalfalse} % we can use this one for tests + +\newbox\b_split_result_saved \def\tabl_split_loop_body {\ifinsidecolumns % brrr, assumes empty columns - \global\setfalse\splitfloatfirstdone + \global\splitfloatfirstdone\conditionalfalse \d_split_available_height\textheight - \settrue\c_tabl_split_full + \c_tabl_split_full\conditionaltrue \else \ifconditional\splitfloatfirstdone \d_split_available_height\textheight - \settrue\c_tabl_split_full + \c_tabl_split_full\conditionaltrue \orelse\ifdim\pagegoal<\maxdimen \d_split_available_height\dimexpr\pagegoal-\pagetotal\relax - \setfalse\c_tabl_split_full + \c_tabl_split_full\conditionalfalse \else \d_split_available_height\textheight - \settrue\c_tabl_split_full + \c_tabl_split_full\conditionaltrue \fi \fi \d_split_available_height \dimexpr @@ -303,22 +307,27 @@ \setbox\b_split_result\vbox {\ifdim\ht\b_split_head>\zeropoint \unvcopy\b_split_head - \the\t_split_section - \the\t_split_inbetween + \expand\t_split_section + \expand\t_split_inbetween \fi}% \ifconditional\c_tabl_split_done \else \ifdim\ht\b_split_next>\zeropoint \setbox\b_split_head\box\b_split_next \fi \fi - \settrue\c_tabl_split_done + \c_tabl_split_done\conditionaltrue \ifdim\ht\b_split_result>\zeropoint - \settrue\c_tabl_split_head % table head + \c_tabl_split_head\conditionaltrue % table head \else - \setfalse\c_tabl_split_head % no tablehead + \c_tabl_split_head\conditionalfalse % no tablehead + \fi + \splittopskip\zeroskip + \ifvoid\b_split_result_saved\else + \setbox\b_split_result\box\b_split_result_saved + \c_tabl_split_head\conditionaltrue % no tablehead + \global\tabl_split_forced_page\conditionalfalse \fi - \splittopskip\zeropoint - \doloop % inner loop + \localcontrolledrepeating {\setbox\scratchbox\vsplit\b_split_content to \onepoint % \lineheight \setbox\scratchbox\vbox % \vpack {\unvbox\scratchbox @@ -326,53 +335,55 @@ {\splitdiscards \ifnum\lastpenalty>-\plustenthousand\else % so that \bTR[before=\page] works - \global\settrue\tabl_split_forced_page + \global\tabl_split_forced_page\conditionaltrue \fi}}% \ifconditional\tabl_split_forced_page - \global\setfalse\tabl_split_forced_page + \global\tabl_split_forced_page\conditionalfalse \setbox\b_split_result\vbox {\unvbox\b_split_result - \the\t_split_inbetween + \expand\t_split_inbetween \unvbox\scratchbox}% - \exitloop + \quitloop \orelse\ifdim\dimexpr\d_split_available_height-\htdp\scratchbox-\htdp\b_split_result\relax>\zeropoint \setbox\b_split_result\vbox {\unvbox\b_split_result - \the\t_split_inbetween + \expand\t_split_inbetween \unvbox\scratchbox}% - \ifvoid\b_split_content \exitloop \fi + \ifvoid\b_split_content + \quitloop + \fi \orelse\ifconditional\c_tabl_split_head % we only have a tablehead so far - \setbox\b_split_result\vbox{\unvbox\b_split_result\unvbox\scratchbox}% \vpack - \exitloop + \global\setbox\b_split_result_saved\vbox{\unvbox\b_split_result\unvbox\scratchbox}% \vpack + \quitloop \orelse\ifconditional\c_tabl_split_full % we have text height available, but the (one) cell is too % large to fit, so, in order to avoid loops/deadcycles we do: \setbox\b_split_result\vbox {\unvbox\b_split_result - \the\t_split_inbetween + \expand\t_split_inbetween \unvbox\scratchbox}% - \exitloop + \quitloop \else \setbox\b_split_content\vbox {\unvbox\scratchbox - \the\t_split_inbetween + \expand\t_split_inbetween \ifvoid\b_split_content\else\unvbox\b_split_content\fi}% - \exitloop + \quitloop \fi - \setfalse\c_tabl_split_head - \setfalse\c_tabl_split_full}% + \c_tabl_split_head\conditionalfalse + \c_tabl_split_full\conditionalfalse}% \postprocesstsplit \page_split_float_check_content\b_split_content \ifvoid\b_split_content \setbox\b_split_result\vbox {\unvbox\b_split_result - \the\t_split_inbetween + \expand\t_split_inbetween \unvcopy\b_split_tail}% - \page_split_float_process{\the\t_split_before_result\box\b_split_result\the\t_split_after_result}% - \doifnotinsidesplitfloat{\the\t_split_after}% + \page_split_float_process{\expand\t_split_before_result\box\b_split_result\expand\t_split_after_result}% + \doifnotinsidesplitfloat{\expand\t_split_after}% \endgraf - \exitloop + \quitloop \else % hack \ifdim\pagegoal<\maxdimen @@ -382,12 +393,12 @@ \ifdim\ht\b_split_result>\zeropoint \setbox\b_split_result\vbox {\unvbox\b_split_result - \the\t_split_inbetween + \expand\t_split_inbetween \unvcopy\b_split_tail}% - \page_split_float_process{\the\t_split_before_result\box\b_split_result\the\t_split_after_result}% - \doifnotinsidesplitfloat{\the\t_split_after}% + \page_split_float_process{\expand\t_split_before_result\box\b_split_result\expand\t_split_after_result}% + \doifnotinsidesplitfloat{\expand\t_split_after}% \endgraf - \global\settrue\usesamefloatnumber % new, prevent next increment + \global\usesamefloatnumber\conditionaltrue % new, prevent next increment \fi \ifinsidecolumns \goodbreak % was \doifnotinsidesplitfloat\goodbreak @@ -405,17 +416,24 @@ \permanent\protected\def\handledirecttsplit {\page_split_float_check_caption{\tsplitdirectwidth}% - \global\setfalse\splitfloatfirstdone + \global\splitfloatfirstdone\conditionalfalse \testpagesync % new, sync, but still tricky - [\number\c_split_minimum_free_lines] + [\the\c_split_minimum_free_lines] [\dimexpr\d_split_minimum_free_space+\extrasplitfloatlines\lineheight\relax]% - \doloop\tabl_split_direct_loop_body - \global\setfalse\usesamefloatnumber % new, prevent next increment - \global\setfalse\splitfloatfirstdone} % we can use this one for tests + \localcontrolledrepeating + {\tabl_split_direct_loop_body}% + \global\usesamefloatnumber\conditionalfalse % new, prevent next increment + \global\splitfloatfirstdone\conditionalfalse} % we can use this one for tests + +\newconditional\splitfloatfixedheight + +\def\splitfloatheight{\textheight} \def\tabl_split_direct_loop_body - {\ifinsidecolumns - \global\setfalse\splitfloatfirstdone + {\ifconditional\splitfloatfixedheight + \d_split_available_height\splitfloatheight + \orelse\ifinsidecolumns + \global\splitfloatfirstdone\conditionalfalse \d_split_available_height\textheight \orelse\ifconditional\splitfloatfirstdone \d_split_available_height\textheight @@ -432,30 +450,36 @@ \tsplitdirectsplitter\d_split_available_height % also sets state \ifdim\ht\b_split_result>\zeropoint \ifconditional\somenextsplitofffloat - \global\setfalse\onlyonesplitofffloat + \global\onlyonesplitofffloat\conditionalfalse \fi - \ifdim\pagegoal<\maxdimen + \ifconditional\splitfloatfixedheight + % not relevant + \orelse\ifdim\pagegoal<\maxdimen \pagegoal\dimexpr\pagegoal+\lineheight\relax % etex \fi - \page_split_float_process{\the\t_split_before_result\box\b_split_result\the\t_split_after_result}% - \global\settrue\usesamefloatnumber % new, prevent next increment + \page_split_float_process{\expand\t_split_before_result\box\b_split_result\expand\t_split_after_result}% + \global\usesamefloatnumber\conditionaltrue % new, prevent next increment \endgraf \ifconditional\somenextsplitofffloat - \ifinsidecolumns + \ifconditional\splitfloatfixedheight + \page + \orelse\ifinsidecolumns \goodbreak \else \page \fi \fi - \global\settrue\splitfloatfirstdone + \global\splitfloatfirstdone\conditionaltrue \orelse\ifconditional\somenextsplitofffloat - \ifinsidecolumns + \ifconditional\splitfloatfixedheight + \page + \orelse\ifinsidecolumns \goodbreak \else \page % no room \fi \else - \exitloop + \quitloop \fi} %D Maybe handy: diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-xnt.mklx b/Master/texmf-dist/tex/context/base/mkxl/tabl-xnt.mklx index f2a41c500fe..589b4c7fd51 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-xnt.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-xnt.mklx @@ -121,13 +121,13 @@ {\stopxcell \stopxcellgroup} -\permanent\protected\tolerant\def\tabl_x_TABLE_setup[#settings]% +\permanent\protected\tolerant\def\tabl_x_TABLE_setup[#S#settings]% {\ifarguments\or %\ifparameter#1\or \setupxtable[#settings]% \fi} -\permanent\protected\tolerant\def\tabl_x_TABLE_start[#settings]% +\permanent\protected\tolerant\def\tabl_x_TABLE_start[#S#settings]% {\bgroup \ifarguments\or %\ifparameter#1\or diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt index 50f321c0dc9..c5966bf6d36 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt @@ -87,21 +87,22 @@ local new_glue = nodepool.glue local new_kern = nodepool.kern local new_hlist = nodepool.hlist -local lefttoright_code = tex.directioncodes.lefttoright - -local v_stretch = variables.stretch -local v_normal = variables.normal -local v_width = variables.width -local v_height = variables.height -local v_repeat = variables["repeat"] -local v_max = variables.max -local v_fixed = variables.fixed ------ v_auto = variables.auto -local v_before = variables.before -local v_after = variables.after -local v_both = variables.both -local v_samepage = variables.samepage -local v_tight = variables.tight +local lefttoright_code = tex.directioncodes.lefttoright + +local v_stretch = variables.stretch +local v_normal = variables.normal +local v_width = variables.width +local v_height = variables.height +local v_repeat = variables["repeat"] +local v_max = variables.max +local v_fixed = variables.fixed +----- v_auto = variables.auto +local v_before = variables.before +local v_after = variables.after +local v_both = variables.both +local v_samepage = variables.samepage +local v_tight = variables.tight +local v_split = variables.split local xtables = { } typesetters.xtables = xtables @@ -111,24 +112,24 @@ local report_xtable = logs.reporter("xtable") trackers.register("xtable.construct", function(v) trace_xtable = v end) -local c_tabl_x_nx = texiscount("c_tabl_x_nx") -local c_tabl_x_ny = texiscount("c_tabl_x_ny") -local c_tabl_x_state = texiscount("c_tabl_x_state") -local c_tabl_x_mode = texiscount("c_tabl_x_mode") -local c_tabl_x_skip_mode = texiscount("c_tabl_x_skip_mode") -local d_tabl_x_final_width = texisdimen("d_tabl_x_final_width") -local d_tabl_x_distance = texisdimen("d_tabl_x_distance") -local d_tabl_x_width = texisdimen("d_tabl_x_width") -local d_tabl_x_height = texisdimen("d_tabl_x_height") -local d_tabl_x_depth = texisdimen("d_tabl_x_depth") -local d_lineheight = texisdimen("lineheight") - -local c_frameddimensionstate = texiscount("frameddimensionstate") - -local head_mode = 1 -local foot_mode = 2 -local more_mode = 3 -local body_mode = 4 +local c_tabl_x_nx = texiscount("c_tabl_x_nx") +local c_tabl_x_ny = texiscount("c_tabl_x_ny") +local c_tabl_x_state = texiscount("c_tabl_x_state") +local c_tabl_x_mode = texiscount("c_tabl_x_mode") +local c_tabl_x_skip_mode = texiscount("c_tabl_x_skip_mode") +local d_tabl_x_final_width = texisdimen("d_tabl_x_final_width") +local d_tabl_x_distance = texisdimen("d_tabl_x_distance") +local d_tabl_x_width = texisdimen("d_tabl_x_width") +local d_tabl_x_height = texisdimen("d_tabl_x_height") +local d_tabl_x_depth = texisdimen("d_tabl_x_depth") +local d_lineheight = texisdimen("lineheight") + +local c_frameddimensionstate = texiscount("frameddimensionstate") + +local head_mode = 1 +local foot_mode = 2 +local more_mode = 3 +local body_mode = 4 local namedmodes = { [0] = "null", @@ -1156,7 +1157,7 @@ function xtables.flush(directives) -- todo split by size / no inbetween then .. data.bodystop = bodystop ctx_endvbox() else - if method == variables.split then + if method == v_split then -- maybe also a non float mode with header/footer repeat although -- we can also use a float without caption for i=1,#head do diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx index f7121dc5840..456d2c37801 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx @@ -160,12 +160,12 @@ \c!rightmargindistance=\zeropoint,% whole table ] -\def \tabl_x_default_buffer{x_table_\number\c_tabl_x_nesting} +\def \tabl_x_default_buffer{x_table_\the\c_tabl_x_nesting} \lettonothing\tabl_x_current_buffer \permanent\protected\def\startxtable{\tabl_x_start_table} -\protected\tolerant\def\tabl_x_start_table[#settings]% maybe two arguments: [tag][settings] | [tag] | [settings] +\protected\tolerant\def\tabl_x_start_table[#S#settings]% maybe two arguments: [tag][settings] | [tag] | [settings] {\bgroup \tabl_x_prepare{#settings}% \edef\tabl_x_current_buffer{\tabl_x_default_buffer}% @@ -189,18 +189,18 @@ \tabl_x_get_buffer % settings \tabl_x_process} -\protected\tolerant\def\tabl_x_start_ignore[#settings]% +\protected\tolerant\def\tabl_x_start_ignore[#S#settings]% {} -\protected\tolerant\def\tabl_x_process_buffer[#settings]% +\protected\tolerant\def\tabl_x_process_buffer[#S#settings]% {\tabl_x_prepare{#settings}% \let\tabl_x_start_table\tabl_x_start_ignore - \gobbleuntil\stopxtable} % nested xtables are not supported, + \ignoreupto\stopxtable} % nested xtables are not supported, %D A bonus: you have to use the following construct inside a macro or %D direct buffer. -\permanent\tolerant\protected\def\startembeddedxtable[#settings]#:#content\stopembeddedxtable +\permanent\tolerant\protected\def\startembeddedxtable[#S#settings]#:#content\stopembeddedxtable {\tabl_x_prepare{#settings}% \clf_assignbuffer{embedded_x_table}{\detokenize{#content}}\catcodetable\relax \bgroup @@ -217,9 +217,9 @@ \permanent\protected\edefcsname\e!stop \currentxtable\endcsname{\tabl_x_stop_named}% \to \everydefinextable -\protected\def\tabl_x_start_named[#tag]#spacer[#settings]% +\protected\def\tabl_x_start_named[#tag]#spacer[#S#settings]% {\bgroup - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \advanceby\c_tabl_x_nesting\plusone \dostarttaggedchained\t!table\empty\??xtable \setupcurrentxtable[#settings]% @@ -248,7 +248,7 @@ \dostarttaggedchained\t!table\empty\??xtable \tabl_x_set_checked{#settings}% \tabl_x_check_textwidth - \the\everypreparextable + \expand\everypreparextable }% else whitespace mess \def\tabl_x_get_buffer @@ -268,8 +268,11 @@ \forgetall % moved here \dontcomplain % for the moment here till we figure out where we get the overflow \usebodyfontparameter\xtableparameter - \setbox\scratchbox\vbox - {\doifsomething{\xtableparameter\c!spaceinbetween}{\blank[\xtableparameter\c!spaceinbetween]}}% + \setbox\scratchbox\vbox\bgroup + \ifempty{\xtableparameter\c!spaceinbetween}\else + \blank[\xtableparameter\c!spaceinbetween]% + \fi + \egroup \clf_x_table_create option {\xtableparameter\c!option}% textwidth \d_tabl_x_textwidth @@ -345,7 +348,7 @@ \dostoptagged \resetbuffer[\tabl_x_current_buffer]% \resetcharacteralign - \the\t_table_x_cleanup + \expand\t_table_x_cleanup \egroup} % text flow split modes @@ -450,9 +453,9 @@ height \dimexpr#height\relax \relax}% \ifcase\c_tabl_x_state - \global\setfalse\somenextsplitofffloat + \global\somenextsplitofffloat\conditionalfalse \else - \global\settrue \somenextsplitofffloat + \global\somenextsplitofffloat\conditionaltrue \fi} % \permanent\protected\def\startxrow @@ -463,7 +466,7 @@ % {\tabl_x_stop_row % \endgroup} -\protected\def\tabl_x_start_row_reflow_width_yes[#settings]% +\protected\def\tabl_x_start_row_reflow_width_yes[#S#settings]% {\setupcurrentxtable[#settings]% \clf_x_table_next_row} @@ -477,7 +480,7 @@ \let\tabl_x_start_row_reflow_height_nop\tabl_x_start_row_reflow_width_nop \let\tabl_x_stop_row_reflow_height \tabl_x_stop_row_reflow_width -\protected\def\tabl_x_start_row_construct_yes[#settings]% +\protected\def\tabl_x_start_row_construct_yes[#S#settings]% {\setupcurrentxtable[#settings]% \dostarttagged\t!tablerow\empty \clf_x_table_next_row_option{\xtableparameter\c!samepage}} @@ -526,8 +529,7 @@ % \to \t_tabl_x_every_cell \appendtoks - \edef\p_characteralign{\directxtableparameter\c!aligncharacter}% - \ifx\p_characteralign\v!yes + \ifcstok{\directxtableparameter\c!aligncharacter}\v!yes \ifcase\clf_x_table_r\or \tabl_x_setup_character_align \fi @@ -536,7 +538,7 @@ \to \t_tabl_x_every_cell \protected\def\tabl_x_begin_of_cell - {\the\t_tabl_x_every_cell + {\expand\t_tabl_x_every_cell \everypar{\delayedbegstrut}} \protected\def\tabl_x_end_of_cell @@ -573,7 +575,7 @@ \let\tabl_x_set_hsize\relax -\protected\def\tabl_x_start_cell_reflow_width_yes[#settings]% +\protected\def\tabl_x_start_cell_reflow_width_yes[#S#settings]% {\setbox\b_tabl_x\hpack\bgroup \ifnum\c_tabl_x_nesting>\plusone \letxtableparameter\c!width \v!fit % overloads given width @@ -622,7 +624,7 @@ \egroup \clf_x_table_set_reflow_width} -\protected\def\tabl_x_start_cell_reflow_height_yes[#settings]% +\protected\def\tabl_x_start_cell_reflow_height_yes[#S#settings]% {\setbox\b_tabl_x\hpack\bgroup \clf_x_table_init_reflow_height \ifcase\c_tabl_x_skip_mode % can be sped up @@ -657,7 +659,7 @@ \egroup \clf_x_table_set_reflow_height} -\protected\def\tabl_x_start_cell_construct_yes[#settings]% +\protected\def\tabl_x_start_cell_construct_yes[#S#settings]% {\dostarttagged\t!tablecell\empty % can't we just tag the box \setbox\b_tabl_x\hpack\bgroup \setupcurrentxtable[#settings]% @@ -686,7 +688,7 @@ \clf_x_table_set_construct \dostoptagged} -% \permanent\tolerant\protected\def\startxcellgroup[#settings]% +% \permanent\tolerant\protected\def\startxcellgroup[#S#settings]% % {\begingroup % \ifarguments\or % \tabl_x_set_checked{#settings}% @@ -695,7 +697,7 @@ % \permanent\protected\def\stopxcellgroup % {\endgroup} % -% \permanent\tolerant\protected\def\startxrowgroup[#settings]% +% \permanent\tolerant\protected\def\startxrowgroup[#S#settings]% % {\begingroup % \ifarguments\or % \tabl_x_set_checked{#settings}% @@ -707,7 +709,7 @@ \protected\def\tabl_x_set_checked#settings% {\ifcsname\namedxtablehash{#settings}\s!parent\endcsname - \edef\currentxtable{#settings}% + \cdef\currentxtable{#settings}% \else \setupcurrentxtable[#settings]% \fi} @@ -717,7 +719,7 @@ \permanent\protected\def\startxtablenext{\begingroup\c_tabl_x_mode\plusthree\tabl_x_start_partition} \permanent\protected\def\startxtablebody{\begingroup\c_tabl_x_mode\plusfour \tabl_x_start_partition} -\permanent\tolerant\protected\def\tabl_x_start_partition[#settings]#spacer% +\permanent\tolerant\protected\def\tabl_x_start_partition[#S#settings]#spacer% {\ifarguments\or \tabl_x_set_checked{#settings}% \fi} @@ -796,7 +798,7 @@ {\ifempty\currentxtable \else \chaintocurrentxtable{#tag}% \fi - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \doifelsenextoptionalcs\setupcurrentxtable\relax} \aliased\let\startxrowgroup \startxgroup @@ -821,7 +823,7 @@ {\ifempty\currentxtable \else \chaintocurrentxtable{#tag}% \fi - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \doifelsenextoptionalcs\tabl_x_start_cell_yes\tabl_x_start_cell_nop} \permanent\protected\def\stopxcell @@ -845,7 +847,7 @@ {\ifempty\currentxtable \else \chaintocurrentxtable{#tag}% \fi - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \doifelsenextoptionalcs\tabl_x_start_row_yes\tabl_x_start_row_nop} \permanent\protected\def\stopxrow @@ -899,15 +901,15 @@ \stopxrow}} \def\tabl_x_collect_allocate - {\expandafter\newtoks\csname\??xtableswap\number\c_tabl_x_swapped\endcsname - \expandafter\let\expandafter\t_tabl_x_swapped\csname\??xtableswap\number\c_tabl_x_swapped\endcsname} + {\expandafter\newtoks\csname\??xtableswap\the\c_tabl_x_swapped\endcsname + \expandafter\let\expandafter\t_tabl_x_swapped\csname\??xtableswap\the\c_tabl_x_swapped\endcsname} \def\tabl_x_collect_advance {\global\advanceby\c_tabl_x_swapped\plusone \ifnum\c_tabl_x_swapped>\c_tabl_x_swapped_max \global\c_tabl_x_swapped_max\c_tabl_x_swapped \fi - \mutable\expandafter\let\expandafter\t_tabl_x_swapped\csname\??xtableswap\number\c_tabl_x_swapped\endcsname + \mutable\expandafter\let\expandafter\t_tabl_x_swapped\csname\??xtableswap\the\c_tabl_x_swapped\endcsname \ifrelax\t_tabl_x_swapped \tabl_x_collect_allocate \fi} @@ -925,7 +927,7 @@ \gtoksapp\t_tabl_x_swapped\expandafter{\expandafter\tabl_x_c_cell_start\expandafter{\m_tabl_x_swapped_settings}#content\tabl_x_c_cell_stop}% \fi} -\def\tabl_x_collect_cell_start_yes[#settings]#content\stopxcell +\def\tabl_x_collect_cell_start_yes[#S#settings]#content\stopxcell {\tabl_x_collect_advance \ifempty\m_tabl_x_swapped_settings \gtoksapp\t_tabl_x_swapped{\tabl_x_c_cell_start{}[#settings]#content\tabl_x_c_cell_stop}% @@ -938,7 +940,7 @@ \dorecurse\scratchcounter\tabl_x_collect_advance \fi} -\permanent\tolerant\protected\def\startxcolumn[#settings]#spacer% +\permanent\tolerant\protected\def\startxcolumn[#S#settings]#spacer% {\begingroup \global\c_tabl_x_swapped\zerocount \enforced\let\startxcell\tabl_x_collect_cell_start diff --git a/Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt index 962a7ef9af7..6951c8cbdcf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt @@ -65,6 +65,7 @@ appendaction("processors", "lists", "typesetters.spacings.handler", appendaction("processors", "lists", "typesetters.kerns.handler", nil, "nut", "disabled" ) appendaction("processors", "lists", "typesetters.tighten.handler", nil, "nut", "disabled" ) appendaction("processors", "lists", "typesetters.digits.handler", nil, "nut", "disabled" ) +appendaction("processors", "lists", "typesetters.corrections.handler", nil, "nut", "disabled" ) appendaction("processors", "lists", "typesetters.italics.handler", nil, "nut", "disabled" ) appendaction("processors", "lists", "languages.visualizediscretionaries", nil, "nut", "disabled" ) @@ -80,7 +81,7 @@ appendaction("shipouts", "normalizers", "nodes.destinations.handler", appendaction("shipouts", "normalizers", "nodes.rules.handler", nil, "nut", "disabled" ) appendaction("shipouts", "normalizers", "nodes.shifts.handler", nil, "nut", "disabled" ) appendaction("shipouts", "normalizers", "structures.tags.handler", nil, "nut", "disabled" ) -appendaction("shipouts", "normalizers", "nodes.handlers.accessibility", nil, "nut", "disabled" ) +------------("shipouts", "normalizers", "nodes.handlers.accessibility", nil, "nut", "disabled" ) appendaction("shipouts", "normalizers", "nodes.handlers.backgrounds", nil, "nut", "disabled" ) appendaction("shipouts", "normalizers", "typesetters.rubies.attach", nil, "nut", "disabled" ) ------------("shipouts", "normalizers", "nodes.properties.delayed", nil, "nut", "production") @@ -113,9 +114,11 @@ appendaction("math", "normalizers", "noads.handlers.collapse", appendaction("math", "normalizers", "noads.handlers.fixscripts", nil, "nonut", "enabled" ) ------------("math", "normalizers", "noads.handlers.domains", nil, "nonut", "disabled" ) appendaction("math", "normalizers", "noads.handlers.autofences", nil, "nonut", "disabled" ) -appendaction("math", "normalizers", "noads.handlers.resize", nil, "nonut", "enabled" ) +------------("math", "normalizers", "noads.handlers.resize", nil, "nonut", "enabled" ) ------------("math", "normalizers", "noads.handlers.respace", nil, "nonut", "enabled" ) appendaction("math", "normalizers", "noads.handlers.alternates", nil, "nonut", "enabled" ) +-- shouldn't tags move down to after classes and dictionaries +appendaction("math", "normalizers", "noads.handlers.intervals", nil, "nonut", "enabled" ) appendaction("math", "normalizers", "noads.handlers.tags", nil, "nonut", "disabled" ) ------------("math", "normalizers", "noads.handlers.italics", nil, "nonut", "disabled" ) -- replaced appendaction("math", "normalizers", "noads.handlers.kernpairs", nil, "nonut", "disabled" ) @@ -146,7 +149,7 @@ appendaction("contributers", "normalizers", "nodes.handlers.wipe", appendaction("adjusters", "normalizers", "nodes.handlers.adjusters", nil, "nut", "enabled" ) -appendaction("vboxbuilders", "normalizers", "nodes.adaptive.handlehorizontal", nil, "nut", "disabled" ) +------------("vboxbuilders", "normalizers", "nodes.adaptive.handlehorizontal", nil, "nut", "disabled" ) appendaction("vboxbuilders", "normalizers", "nodes.handlers.backgroundsvbox", nil, "nut", "disabled" ) ------------("vboxbuilders", "normalizers", "typesetters.margins.localhandler", nil, "nut", "disabled" ) appendaction("vboxbuilders", "normalizers", "builders.vspacing.vboxhandler", nil, "nut", "enabled" ) @@ -164,13 +167,13 @@ appendaction("mvlbuilders", "normalizers", "builders.profiling.pagelinehandler" appendaction("mvlbuilders", "normalizers", "typesetters.checkers.handler", nil, "nut", "disabled" ) appendaction("mvlbuilders", "normalizers", "typesetters.synchronize.handler", nil, "nut", "disabled" ) -appendaction("vboxhandlers", "normalizers", "nodes.adaptive.handlevertical", nil, "nut", "disabled" ) +------------("vboxhandlers", "normalizers", "nodes.adaptive.handlevertical", nil, "nut", "disabled" ) appendaction("everypar", "normalizers", "nodes.handlers.checkparcounter", nil, "nut", "disabled" ) appendaction("alignments", "normalizers", "nodes.handlers.showpreamble", nil, "nut", "enabled" ) appendaction("alignments", "normalizers", "nodes.handlers.aligncharacter", nil, "nut", "disabled" ) -appendaction("alignments", "normalizers", "nodes.handlers.fixmathalign", nil, "nut", "disabled" ) +appendaction("alignments", "normalizers", "nodes.handlers.mathalignrelocate", nil, "nut", "disabled" ) appendaction("alignments", "normalizers", "nodes.handlers.mathmatrixornaments", nil, "nut", "disabled" ) appendaction("alignments", "normalizers", "nodes.handlers.mathmatrixrules", nil, "nut", "disabled" ) diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt index 2027ed78e23..78e1452ab45 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt @@ -8,7 +8,10 @@ if not modules then modules = { } end modules ['toks-aux'] = { local type, tostring, next = type, tostring, next local max = math.max local formatters, gsub, char, gmatch = string.formatters, string.gsub, string.char, string.gmatch -local concat = table.concat +local concat, swapped = table.concat, table.swapped + +local allocate = utilities.storage.allocate +local texintegerdef = tex.integerdef do @@ -28,124 +31,145 @@ do end --- todo : locals from scanners +do + + -- todo : locals from scanners -local function flags(t) - if type(t) == "string" then - t = token.create(t) + local function flags(t) + if type(t) == "string" then + t = token.create(t) + end + local r = { } + if t.frozen then r[#r+1] = "frozen" end + if t.permanent then r[#r+1] = "permanent" end + if t.immutable then r[#r+1] = "immutable" end + if t.primitive then r[#r+1] = "primitive" end + if t.mutable then r[#r+1] = "mutable" end + if t.noaligned then r[#r+1] = "noaligned" end + if t.instance then r[#r+1] = "instance" end + if t.tolerant then r[#r+1] = "tolerant" end + if t.protected then r[#r+1] = "protected" end + if t.constant then r[#r+1] = "constant" end + return r end - local r = { } - if t.frozen then r[#r+1] = "frozen" end - if t.permanent then r[#r+1] = "permanent" end - if t.immutable then r[#r+1] = "immutable" end - if t.primitive then r[#r+1] = "primitive" end - if t.mutable then r[#r+1] = "mutable" end - if t.noaligned then r[#r+1] = "noaligned" end - if t.instance then r[#r+1] = "instance" end - if t.tolerant then r[#r+1] = "tolerant" end - if t.protected then r[#r+1] = "protected" end - if t.constant then r[#r+1] = "constant" end - return r -end -tokens.flags= flags - -interfaces.implement { - name = "showluatokens", - public = true, - protected = true, - actions = function() - local f0 = formatters["%s: %s"] - local nl = logs.newline - local wr = logs.writer - local t = token.peeknext() -- local t = token.scannext() token.putback(t) - local n = "" - local w = "" - local c = t.cmdname - if c == "left_brace" then - w = "given token list" - t = token.scantoks(false) - elseif c == "register_toks" then - token.scannext() - w = "token register" - n = t.csname or t.index - t = tex.gettoks(n,true) - elseif c == "internal_toks" then - token.scannext() - w = "internal token variable" - n = t.csname or t.index - t = tex.gettoks(n,true) - else - n = token.scancsname() - local r = flags(t) - local m = token.getmeaning(n,true) - r[#r+1] = "control sequence" - if type(m) == "table" then - t = m + tokens.flags= flags + + interfaces.implement { + name = "showluatokens", + public = true, + protected = true, + actions = function() + local f0 = formatters["%s: %s"] + local nl = logs.newline + local wr = logs.writer + local t = token.peeknext() -- local t = token.scannext() token.putback(t) + local n = "" + local w = "" + local c = t.cmdname + local tl = nil + if c == "left_brace" then + w = "given token list" + t = token.scantoks(false) + elseif c == "register_toks" then + token.scannext() + w = "token register" + n = t.csname or t.index + t = tex.gettoks(n,true) + elseif c == "internal_toks" then + token.scannext() + w = "internal token variable" + n = t.csname or t.index + t = tex.gettoks(n,true) + elseif t.active then + token.scannext() + local r = flags(t) + local m, l = token.getmeaning("\xEF\xBF\xBF"..t.csname,true,false,true) + r[#r+1] = "active character" + if type(m) == "table" then + t = m + tl = l + else + t = { t } + end + w = concat(r, " ") + n = t.csname else - t = { t } - end - w = concat(r, " ") - end - wr(f0(w,n)) - nl() - if type(t) == "table" then - local w1 = 4 - local w2 = 1 - local w3 = 3 - local w4 = 3 - for i=1,#t do - local ti = t[i] - w1 = max(w1,#tostring(ti.id)) - w2 = max(w2,#tostring(ti.command)) - w3 = max(w3,#tostring(ti.index)) - w4 = max(w4,#ti.cmdname) + n = token.scancsname() + local r = flags(t) + local m, l = token.getmeaning(n,true,false,true) -- last argument: we want original links + r[#r+1] = "control sequence" + if type(m) == "table" then + t = m + tl = l + else + t = { t } + end + w = concat(r, " ") end - local f1 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s %s"] - local f2 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s"] - local f3 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s %C"] - for i=1,#t do - local ti = t[i] - local cs = ti.csname - local id = ti.id - local ix = ti.index - local cd = ti.command - local cn = ti.cmdname - if cn == "prefix" and not cs then - cs = "always enforced" + wr(f0(w,n)) + nl() + if type(t) == "table" then + local w1 = 4 + local w2 = 1 + local w3 = 3 + local w4 = 3 + for i=1,#t do + local ti = t[i] + local li = tl and tl[i] + w1 = max(w1,#tostring(li or ti.id)) + w2 = max(w2,#tostring(ti.command)) + w3 = max(w3,#tostring(ti.index)) + w4 = max(w4,#ti.cmdname) end - cn = gsub(cn,"_"," ") - if cs then - wr(f1(id,cd,ix,cn,cs)) - elseif cn == "letter" or cn == "other char" then - wr(f3(id,cd,ix,cn,ix)) - elseif cn == "match" then - -- needs checking for additions - local s - if ix == 32 then s = "optional spacer" -- space - elseif ix == 42 then s = "skip spaces" -- * - elseif ix == 43 then s = "keep braces" -- + - elseif ix == 45 then s = "thrash" -- - - elseif ix == 47 then s = "prune" -- / - elseif ix == 58 then s = "continue" -- : - elseif ix == 59 then s = "quit" -- ; - elseif ix == 61 then s = "mandate braces" -- = - elseif ix == 94 then s = "keep spaces" -- ^ - elseif ix == 95 then s = "keep mandate braces" -- _ - else s = "argument " .. char(ix) + local f1 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s %s"] + local f2 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s"] + local f3 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s %C"] + for i=1,#t do + local ti = t[i] + local li = tl and tl[i] + local cs = ti.csname + local id = li or ti.id + local ix = ti.index + local cd = ti.command + local cn = ti.cmdname + if cn == "prefix" and not cs then + cs = "always enforced" end - wr(f1(id,cd,ix,cn,s)) - else - wr(f2(id,cd,ix,cn)) - if cn == "end match" then - wr("--------------") + cn = gsub(cn,"_"," ") + if cs then + wr(f1(id,cd,ix,cn,cs)) + elseif cn == "letter" or cn == "other char" then + wr(f3(id,cd,ix,cn,ix)) + elseif cn == "match" then + -- needs checking for additions + local s + if ix == 32 then s = "optional spacer" -- space + elseif ix == 42 then s = "skip spaces" -- * + elseif ix == 43 then s = "keep braces" -- + + elseif ix == 45 then s = "thrash" -- - + elseif ix == 47 then s = "prune" -- / + elseif ix == 58 then s = "continue" -- : + elseif ix == 59 then s = "quit" -- ; + elseif ix == 61 then s = "mandate braces" -- = + elseif ix == 94 then s = "keep spaces" -- ^ + elseif ix == 95 then s = "keep mandate braces" -- _ + else s = "argument " .. char(ix) + end + wr(f1(id,cd,ix,cn,s)) + else + wr(f2(id,cd,ix,cn)) + if cn == "end match" then + wr("--------------") + end end end + nl() end - nl() end - end -} + } + +end -- For the moment here, will move to initex only (also see node-ini.lua); we need -- to actually store these. @@ -155,7 +179,6 @@ local context = context local function getthem(getter,post) local codes = { } if getter then - local texintegerdef = tex.integerdef for k, v in next, getter() do codes[k] = gsub(v,"[_ ]","") end @@ -175,31 +198,69 @@ local function getthem(getter,post) } end end - return utilities.storage.allocate(table.swapped(codes,codes)) + return allocate(swapped(codes,codes)) end -tex.discoptioncodes = getthem(tex.getdiscoptionvalues, "discoptioncode") -tex.flagcodes = getthem(tex.getflagvalues, "flagcode" ) -tex.frozenparcodes = getthem(tex.getfrozenparvalues, "frozenparcode") -tex.glyphoptioncodes = getthem(tex.getglyphoptionvalues, "glyphoptioncode") -tex.groupcodes = getthem(tex.getgroupvalues, "groupcode") -tex.hyphenationcodes = getthem(tex.gethyphenationvalues, "hyphenationcode") -tex.mathcontrolcodes = getthem(tex.getmathcontrolvalues, "mathcontrolcode") ----.mathflattencodes = getthem(tex.getmathflattenvalues, "mathflattencode") -tex.noadoptioncodes = getthem(tex.getnoadoptionvalues ) -- only at lua end -tex.normalizelinecodes = getthem(tex.getnormalizelinevalues, "normalizecode") -- we keep the short name -tex.normalizeparcodes = getthem(tex.getnormalizeparvalues, "normalizeparcode") -tex.automigrationcodes = getthem(tex.getautomigrationvalues, "automigrationcode") -tex.parcontextcodes = getthem(tex.getparcontextvalues, "parcontextcode") -tex.textcontrolcodes = getthem(tex.gettextcontrolvalues ) -- only at lua end -tex.listanchorcodes = getthem(tex.getlistanchorvalues, "listanchorcode") -tex.listsigncodes = getthem(tex.getlistsignvalues, "listsigncode") -tex.classoptioncodes = getthem(tex.getmathclassoptionvalues, "classoptioncode") ----.alignmentcontextcodes = getthem(tex.getalignmentcontextvalues ) -- only at lua end -tex.specialmathclasscodes = getthem(tex.getspecialmathclassvalues ) -- only at lua end -tex.directioncodes = getthem(tex.getdirectionvalues ) -- only at lua end (todo tex) -tex.fillcodes = getthem(tex.getfillvalues ) -- only at lua end (todo tex) -tex.mathparametercodes = getthem(tex.getmathparametervalues ) -- only at lua end (todo tex) +-- For the moment we do it like this: + +local function setthem(codes,post) + for k, v in next, codes do + texintegerdef(k .. post,v,"immutable") + end + return allocate(swapped(codes,codes)) +end + +tex.userglyphoptioncodes = setthem({ + textcheckitalic = 0x01000000, + mathcheckitalic = 0x02000000, +},"glyphoptioncode") + +tex.userdiscoptioncodes = setthem({ + textcheckitalic = 0x01000000, +},"discoptioncode") + +-- Not all of these make sense at the tex end (can't be set). + +tex.glyphoptioncodes = getthem(tex.getglyphoptionvalues,"glyphoptioncode") +tex.discoptioncodes = getthem(tex.getdiscoptionvalues,"discoptioncode") +tex.ruleoptioncodes = getthem(tex.getruleoptionvalues,"ruleoptioncode") +tex.glueoptioncodes = getthem(tex.getglueoptionvalues) +tex.mathoptioncodes = getthem(tex.getmathoptionvalues) +tex.penaltyoptioncodes = getthem(tex.getpenaltyoptionvalues) +tex.flagcodes = getthem(tex.getflagvalues,"flagcode") +tex.frozenparcodes = getthem(tex.getfrozenparvalues,"frozenparcode") +tex.groupcodes = getthem(tex.getgroupvalues,"groupcode") +tex.hyphenationcodes = getthem(tex.gethyphenationvalues,"hyphenationcode") +tex.mathcontrolcodes = getthem(tex.getmathcontrolvalues,"mathcontrolcode") +---.mathflattencodes = getthem(tex.getmathflattenvalues,"mathflattencode") +tex.noadoptioncodes = getthem(tex.getnoadoptionvalues) +tex.normalizelinecodes = getthem(tex.getnormalizelinevalues,"normalizecode") -- we keep the short name +tex.normalizeparcodes = getthem(tex.getnormalizeparvalues,"normalizeparcode") +tex.automigrationcodes = getthem(tex.getautomigrationvalues,"automigrationcode") +tex.autoparagraphcodes = getthem(tex.getautoparagraphvalues) +tex.parcontextcodes = getthem(tex.getparcontextvalues,"parcontextcode") +tex.partriggercodes = getthem(tex.getpartriggervalues,"partriggercode") +tex.textcontrolcodes = getthem(tex.gettextcontrolvalues) +tex.fitnesscodes = getthem(tex.getfitnessvalues) +tex.parpassclasscodes = getthem(tex.getparpassclassvalues,"parpassclass" ) +tex.listanchorcodes = getthem(tex.getlistanchorvalues,"listanchorcode") +tex.listsigncodes = getthem(tex.getlistsignvalues,"listsigncode") +tex.listgeometrycodes = getthem(tex.getlistgeometryvalues) +tex.classoptioncodes = getthem(tex.getmathclassoptionvalues,"classoptioncode") +---.alignmentcontextcodes = getthem(tex.getalignmentcontextvalues) +tex.specialmathclasscodes = getthem(tex.getspecialmathclassvalues) +tex.directioncodes = getthem(tex.getdirectionvalues) +tex.fillcodes = getthem(tex.getfillvalues) +tex.mathparametercodes = getthem(tex.getmathparametervalues) +tex.breakcodes = getthem(tex.getbreakcontextvalues) +tex.buildcodes = getthem(tex.getbuildcontextvalues) +tex.interactioncodes = getthem(tex.getinteractionmodes,"modecode") +tex.charactertagcodes = getthem(tex.getcharactertagvalues) +tex.protrusionboundarycodes = getthem(tex.getprotrusionboundaryvalues) +tex.shapingpenaltiescodes = getthem(tex.getshapingpenaltiesvalues) +tex.mathscriptordercodes = getthem(tex.getmathscriptordervalues) +tex.mathscriptsmodecodes = getthem(tex.getmathscriptsmodevalues,"scriptsmodecode") +tex.doublescriptoptioncodes = getthem(tex.getdoublescriptoptionvalues,"doublescriptmodecode") function tex.stringtocodesbitmap(str,codes) local bitmap = 0 diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt index d45e3ae1c35..0ff39932dc8 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt @@ -18,12 +18,15 @@ local printtable = table.print local concat = table.concat local format = string.format -local commands = token.getcommandvalues() -local values = token.getfunctionvalues() +local commands = token.getcommandvalues() -- tex.functioncode + +local values = token.getfunctionvalues() -- tex.functioncode values.dimen = values.dimension values.count = values.integer + tokens.values = utilities.storage.allocate(table.swapped(values, values)) tokens.commands = utilities.storage.allocate(table.swapped(commands,commands)) +tokens.cache = utilities.storage.allocate() local scantoks = token.scantoks local scanstring = token.scanstring @@ -56,6 +59,8 @@ local scanluainteger = token.scanluainteger local scanluacardinal = token.scanluacardinal local scanintegerargument = token.scanintegerargument local scandimenargument = token.scandimenargument +local scandetokened = token.scandetokened +local scantokenstring = token.scantokenstring local scannumber = token.scannumber local scanboolean = token.scanboolean @@ -186,6 +191,8 @@ tokens.scanners = { -- these expand keywordcs = scankeywordcs, csname = scancsname, nextchar = scannextchar, + detokened = scandetokened, + tokenstring = scantokenstring, next = token.scannext, nextexpanded = token.scannextexpanded, @@ -293,7 +300,7 @@ if setinspector then -- can best be true end -tokens.cache = table.setmetatableindex(function(t,k) +table.setmetatableindex(tokens.cache, function(t,k) if not isdefined(k) then setmacro(k,"","global") -- So we default to nothing! Maybe some message as option? end diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt b/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt index 855bca6ad23..8a2cb6eaa35 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt @@ -44,6 +44,7 @@ local scangluespec = scanners.gluespec local scancsname = scanners.csname local scanintegerargument = scanners.integerargument local scandimenargument = scanners.dimenargument +local scandetokened = scanners.detokened local todimen = number.todimen local toboolean = toboolean @@ -213,6 +214,8 @@ scanners.bracketedasis = scanbracketedasis scanners.argumentasis = scanargumentasis scanners.csnameunchecked = scancsnameunchecked +--------.detokenize = function() return scanners.tokenstring(false) end -- needs testing + local shortcuts = { tokens = tokens, bits = tokenbits, @@ -221,6 +224,8 @@ local shortcuts = { scanners = scanners, scanstring = scanstring, scanargument = scanargument, + scantokenstring = scanners.tokenstring, + -- scandetokenize = scanners.detokenize, scanverbatim = scanverbatim, scantokenlist = scantokenlist, scantoks = scantoks, @@ -258,6 +263,7 @@ local shortcuts = { scanargumentasis = scanargumentasis, scanintegerargument = scanintegerargument, scandimenargument = scandimenargument, + scandetokened = scandetokened, todimen = todimen, tonumber = tonumber, tostring = tostring, @@ -320,7 +326,7 @@ local f_scan_c = formatters["%s(scan%s())"] local f_any = formatters[" else local key = scanword(true) if key then data[key] = scan%s() else break end end"] local f_any_c = formatters[" else local key = scanword(true) if key then data[key] = %s(scan%s()) else break end end"] -local s_done = " else break end" +local s_done = " else break end" local f_any_all = formatters[" local key = scanword(true) if key then data[key] = scan%s() else break end"] local f_any_all_c = formatters[" local key = scanword(true) if key then data[key] = %s(scan%s()) else break end"] diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-bld.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-bld.lmt new file mode 100644 index 00000000000..1a9fc7ca134 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-bld.lmt @@ -0,0 +1,288 @@ +if not modules then modules = { } end modules ['trac-bld'] = { + version = 1.001, + optimize = true, + comment = "companion to trac-bld.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local nuts = nodes.nuts +local tonut = nodes.tonut + +local insertafter = nuts.insertafter +local hpack_string = nuts.typesetters.tohpack +local hpack = nuts.hpack +local getheight = nuts.getheight +local getid = nuts.getid +local setwhd = nuts.setwhd +local setoffsets = nuts.setoffsets +local setlink = nuts.setlink + +local newrule = nuts.pool.virtualrule + +local nodecodes = nodes.nodecodes + +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local rule_code = nodecodes.rule + +local setcolor = nodes.tracers.colors.set + +local buildcodes = tex.buildcodes + +local ejectpenalty = tex.magicconstants.eject_penalty + +local report = logs.reporter("build") + +local xoffset = 4 * 65536 +local yoffset = 1 * 65536 +local usedfont = false + +local f_status_y = string.formatters["%i : badness=%i costs=%i height=%p depth=%p stretch=%p shrink=%p hasfil=%l"] +local f_status_n = string.formatters["%i"] + +local variables = interfaces.variables +local v_after = variables.after +local v_before = variables.before +local v_reset = variables.reset +local v_yes = variables.yes +local v_all = variables.all + +local done = { } +local last = false +local count = 0 +local forced = { } -- we can combine forced and ignored but then we can't disable +local ignored = { } -- the callback easily +local detail = false +local enabled = false +local ejecting = false + +-- use + +local function checkedforce(moveon,fireup,penalty) + local how = forced[count] + ejecting = fireup and penalty == ejectpenalty + if how == v_after then + report("forcing pagebreak %s %i",how,count) + forced[count] = nil + ignored[count] = true +-- check on moveon + return true, true + elseif how == v_before then + report("forcing pagebreak %s %i",how,count) + forced[count] = nil + ignored[count] = true + return false, true + else + return moveon, fireup + end +end + +local function check(current,moveon,fireup,badness,costs,penalty) + if last then + count = count + 1 + end + return checkedforce(moveon,fireup,penalty) +end + +local forceactions = { + [buildcodes.step] = step, + [buildcodes.check] = check, +} + +local function handleforce(what,...) + local action = forceactions[what] + if action then + return action(...) + end +end + +local function disableforce() + count = 0 + forced = { } + ignored = { } + if enabled and not trace then + callback.register("show_build") + end + enabled = false +end + +local function enableforce() + if not enabled and not trace then + callback.register("show_build",handleforce) + end + enabled = true +end + +interfaces.implement { + name = "registerforcedbreak", + public = true, + protected = true, + arguments = "2 optionals", + actions = function(where,how) + if where == v_reset then + disableforce() + else + for n in string.gmatch(where,"%d+") do + forced[tonumber(n)] = how + end + enableforce() + end + end +} + +interfaces.implement { + name = "resetforcedbreak", + public = true, + protected = true, + actions = disableforce, +} + +-- show + +local function initialize() + usedfont = nodes.visualizers.getusedfont() +end + +local function step(current) + current = tonut(current) + local id = getid(current) + if id == hlist_code or id == vlist_code or id == rule_code then + last = current + end +end + +local function check(current,moveon,fireup,badness,costs,penalty) + if last then + count = count + 1 + done[#done+1] = { + count = count, + line = last, + badness = badness, + penalty = penalty, + costs = costs, + height = 0, + depth = 0, + stretch = 0, + shrink = 0, + hasfil = false, + } + end + return checkedforce(moveon,fireup,penalty) +end + +-- local function skip(current) +-- if last then +-- count = count + 1 +-- done[#done+1] = { +-- count = count, +-- line = last, +-- } +-- end +-- end + +local function move(current,height,depth,stretch,shrink,hasfil) + local d = done[#done] + if d then + d.height = height + d.depth = depth + d.stretch = stretch + d.shrink = shrink + d.hasfil = hasfil + end +end + +-- local function fireup(current) +-- end + +-- local function wrapup() +-- end + +local showactions = { + [buildcodes.initialize] = initialize, + [buildcodes.step] = step, + [buildcodes.check] = check, + -- [buildcodes.skip] = skip, + [buildcodes.move] = move, + -- [buildcodes.fireup] = fireup, + -- [buildcodes.wrapup] = wrapup, +} + +interfaces.implement { + name = "build_page_before_shipout", + actions = function() + if trace then + done[#done] = nil + if #done > 0 then + for i=1,#done do + local data = done[i] + local line = data.line + local count = data.count + if not ignored[count] then + local badness = data.badness + if detail and badness then + data = f_status_y(count,badness,data.costs,data.height,data.depth,data.stretch,data.shrink,data.hasfil) + else + data = f_status_n(count) + end + local text = hpack_string(data,usedfont) + local height = getheight(text) + local rule = newrule(height,height,0) + setcolor(rule,"trace:db") + setoffsets(rule,-(height+xoffset),0) + text = hpack(setlink(rule,text)) + setwhd(text,0,0,0) + setoffsets(text,0,-(height+yoffset)) + insertafter(line,line,text) + end + end + if ejecting then + count = 0 + done = { } + end + end + end + end +} + +interfaces.implement { + name = "build_page_after_shipout", + actions = function() + if trace then + done = { } + end + last = false + end +} + +local function build_page_setup(v) + if v == "all" or v == v_all then + trace = true + detail = true + elseif v == true or v == "yes" or v == v_yes then + trace = true + detail = false + else + trace = false + detail = false + end + if trace then + callback.register("show_build", function(what,...) + local action = showactions[what] + if action then + return action(...) + end + end) + elseif not enabled then + callback.register("show_build") + end +end + +interfaces.implement { + name = "build_page_setup", + arguments = "string", + actions = build_page_setup, +} + +trackers.register("builders.page.show", build_page_setup) -- for old times sake, will go diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-bld.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-bld.mkxl new file mode 100644 index 00000000000..4b40dc74f7d --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-bld.mkxl @@ -0,0 +1,52 @@ +%D \module +%D [ file=trac-brk, +%D version=2023.07.14, +%D title=\CONTEXT\ Tracing Macros, +%D subtitle=Pagebreaks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifdefined\registerforcedbreak \endinput \fi + +\writestatus{loading}{ConTeXt Tracing Macros / Buildpoints} + +\registerctxluafile{trac-bld}{} + +\unprotect + +% These are defined at the \LUA\ end: +% +% \showpageprogress[yes|all] +% \registerforcedbreak[locationlist|reset][before|after] +% \resetforcedbreak + +% \showpageprogress % [all] +% \registerforcedbreak[8][before] +% %resetforcedbreak +% +% \starttext +% \dorecurse{10}{\samplefile{tufte}\par} +% \stoptext + +\lettonothing\show_build_page_before_shipout +\lettonothing\show_build_page_after_shipout + +\permanent\tolerant\protected\def\showpageprogress[#1]% + {\clf_build_page_setup{\ifempty{#1}\v!yes\else#1\fi}% + \let\show_build_page_before_shipout\clf_build_page_before_shipout + \let\show_build_page_after_shipout \clf_build_page_after_shipout} + +\appendtoks + \show_build_page_before_shipout +\to \everybeforeshipout + +\appendtoks + \show_build_page_after_shipout +\to \everyaftershipout + +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-brk.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-brk.lmt new file mode 100644 index 00000000000..45d1da86f1a --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-brk.lmt @@ -0,0 +1,425 @@ +local next, tonumber, tostring, type = next, tonumber, tostring, type +local round, abs = math.round, math.abs + +local settings_to_array = utilities.parsers.settings_to_array +local settings_to_hash = utilities.parsers.settings_to_hash + +local nuts = nodes.nuts +local tonut = nodes.tonut + +local newrule = nuts.pool.virtualrule +local insertbefore = nuts.insertbefore +local insertafter = nuts.insertafter +local hpack_string = nuts.typesetters.tohpack +local getwidth = nuts.getwidth +local getid = nuts.getid +local getprev = nuts.getprev +local getnext = nuts.getnext +local setwhd = nuts.setwhd +local getglue = nuts.getglue +local getlist = nuts.getlist +local setoffsets = nuts.setoffsets + +local setcolor = nodes.tracers.colors.set +local settransparency = nodes.tracers.transparencies.set + +local texgetnest = tex.getnest + +local nodecodes = nodes.nodecodes +local fitnesscodes = tex.fitnesscodes + +local penalty_code = nodecodes.penalty +local glue_code = nodecodes.glue +local disc_code = nodecodes.disc +local kern_code = nodecodes.kern +local math_code = nodecodes.math + +local getnormalizedline = nuts.getnormalizedline +local getdimensions = nuts.dimensions +local getnaturalhsize = nuts.naturalhsize +local setruledimensions = nuts.setruledimensions +local getruledimensions = nuts.getruledimensions + +local breakpoints = tracers.breakpoints or { } +tracers.breakpoints = breakpoints + +local width = 65536 / 2 +local height = 9 * 65536 +local depth = 3 * 65536 +local xoffset = 1 * 65536 +local yoffset = -3 * 65536 + +local serials = false +local serial = false +local results = false +local usedfont = false +local nestlevel = false +local overloads = false +local overload = false +local breakpass = 0 +local linenumber = 0 + +local report = logs.reporter("linebreaks") + +local breakcodes = tex.breakcodes + +local f_status = string.formatters["[% 2i] b=%i d=%p p=%0.3f r=%0.3f (dt=%i) (%p)"] + +local maxbadness = tex.magicconstants.maxcalculatedbadness +local marginoffset = 0 +local showdetails = false + +local actions = { + [breakcodes.initialize] = function() + if texgetnest("ptr") == nestlevel then + report("start registering") + usedfont = nodes.visualizers.getusedfont() + end + end, + [breakcodes.start] = function(pass) + if texgetnest("ptr") == nestlevel then + report("tracing pass %i",pass) + if breakpass ~= pass then + breakpass = pass + linenumber = 0 + serials = { } + results = { } + end + serial = { } + serials[#serials+1] = serial + if overloads then + overload = overloads[#serials] + end + end + end, + [breakcodes.report] = function(pass,currentserial,previousserial,line,kind,class,demerits,breakpoint,short,glue,width) + if texgetnest("ptr") == nestlevel then + if breakpoint then + local s = { + serial = currentserial, + previous = previousserial, + line = line, + kind = kind, + class = class, + demerits = demerits, + breakpoint = breakpoint, + short = short, + width = width, + spillover = 0, + } + if short < 0 then + short = -short + if short > glue then + local spillover = short - glue + report("pass %i, line %i, %s by %p",pass,line,"overfull",spillover) + s.spillover = splillover + end + elseif short > 0 then + if short > glue then + local spillover = short - glue + report("pass %i, line %i, %s by %p",pass,line,"underfull",spillover) + s.spillover = splillover + end + end + serial[currentserial] = s + local found = overload and overload[currentserial] + if found then + report("pass %i, overloading serial %i demerits from %i to %i",breakpass,currentserial,demerits,found) + s.overload = found + return found + end + end + end + return demerits + end, + [breakcodes.stop] = function() + if texgetnest("ptr") == nestlevel then + report("stop registering") + end + end, + [breakcodes.collect] = function() + if texgetnest("ptr") == nestlevel then + report("collecting") + for currentserial=1,#serial do + local data = serial[currentserial] + local breakpoint = data.breakpoint + local current = tonut(breakpoint) + local trigger = getid(current) + while current do + local id = getid(current) + if id == penalty_code or id == glue_code or id == kern_code or id == math_code then + current = getprev(current) + else + break + end + end + if current then + local rule = newrule(width,height,depth,currentserial) + data.rule = rule + data.trigger = trigger + insertafter(current,current,rule) + end + end + end + end, + [breakcodes.line] = function(line,badness,overshoot,shrink,stretch) + if showdetails and texgetnest("ptr") == nestlevel then + linenumber = linenumber + 1 + line = tonut(line) + local linedata = getnormalizedline(line,true) -- get more details + local natural = linedata.size + local linewd = linedata.width + local deltawd = linewd - natural + local splillover = linedata.spillover or 0 + local ratiob = 0 + local ratio, order, sign + = getglue(line) + local yoffset = 2*xoffset + local xoffset = 5*xoffset + linedata.right + marginoffset + if order == 0 then + if deltawd ~= 0 and ratio == 0 and sign == 0 then + xoffset = xoffset + deltawd + ratiob = 10000 + elseif deltawd < 0 and ratio == 1 then + ratiob = 1000000 + else -- or test for ratio as maxbadness is 8189 + ratiob = round(100*abs(ratio)^3) + if ratiob > maxbadness then + ratiob = 10000 + end + end + end + -- Here ratio is the value from Digital Typography and a difference + -- indicates a sensitive area. It is just a playground for MS and HH. + local text = hpack_string(f_status(linenumber,badness,deltawd,100*deltawd/linewd,ratio,ratiob),usedfont,spillover) + local location = linedata.last + local head = linedata.head + setwhd(text,0,0,0) + setoffsets(text,xoffset,yoffset) + insertbefore(head,location,text) + deltawd = deltawd - linedata.parinitrightskip - linedata.parfillrightskip + local rule = newrule(deltawd < 0 and - deltawd or deltawd,0,depth) + setoffsets(rule,deltawd > 0 and -deltawd or 0,yoffset+depth) + setcolor(rule,"trace:dy") + settransparency(rule,"trace:dy") + insertbefore(head,location,rule) + end + end, + [breakcodes.list] = function(currentserial) + if texgetnest("ptr") == nestlevel then + local s = serial[currentserial] + if s then + s.final = true + end + end + end, + [breakcodes.delete] = function(currentserial) + -- eventually most are pruned + if texgetnest("ptr") == nestlevel then + local s = serial[currentserial] + if s then + s.deleted = true + end + end + end, + [breakcodes.wrapup] = function() + if texgetnest("ptr") == nestlevel then + report("wrapping up") + if serial then + local result = { } + results[#results+1] = result + for currentserial=1,#serial do + local data = serial[currentserial] + local rule = data.rule + if rule then + local text = hpack_string(tostring(currentserial),usedfont) + local size = getwidth(text) + local trigger = data.trigger + local final = data.final + local class = data.class + local color = "trace:ds" + if trigger == penalty_code then + color = "trace:dr" + elseif trigger == glue_code then + color = "trace:dg" + elseif trigger == disc_code then + color = "trace:db" + end + if final then + local width, height, depth = getruledimensions(rule) + setruledimensions(rule,2*width,height,depth) + end + setcolor(rule,color) + setwhd(text,0,0,0) + setoffsets(text,-size-xoffset,yoffset) + insertafter(rule,rule,text) + result[#result+1] = data + data.trigger = nodecodes[trigger] + data.class = fitnesscodes[class] + data.color = color + end + end + -- + -- we could limit to the last line only + -- + local finals = { } + for currentserial=#serial,1,-1 do + if serial[currentserial].final then + for finalserial=currentserial-1,currentserial+1 do + local data = serial[finalserial] + if data then + local line = data.line + local list = { } + local done = { + serial = finalserial, + line = line, + list = list, + final = data.final, + color = data.color + } + finals[#finals+1] = done + while true do + local previous = data.previous + if previous == 0 then + break + else + list[#list+1] = previous + data = serial[previous] + end + end + end + end + break + end + end + + result.finals = finals + -- + serial = false + end + end + end, +} + +-- -- -- + +function breakpoints.start(specification) + callback.register("show_break", function(what,...) + return actions[what](...) + end) + -- + local list = specification.list + local option = specification.option + -- + breakpass = 0 + linenumber = 0 + showdetails = false + serials = { } + results = { } + nestlevel = texgetnest("ptr") + marginoffset = specification.offset or 0 + -- + if option then + option = type(options) == "table" and option or settings_to_hash(option or "") + if option.margin then + showdetails = true + end + end + if list then + overloads = type(list) == "table" and list or settings_to_array(list or "") + for i=1,#overloads do + local s = overloads[i] + local t = settings_to_hash(s) + local o = { } + for k, v in next, t do + o[tonumber(k)] = tonumber(v) or -1 + end + overloads[i] = o + end + end +end + +function breakpoints.stop() + callback.register("show_break") +end + +function breakpoints.reset() + serials = false + serial = false + results = false + nestlevel = false + breakpass = 0 + linenumber = 0 +end + +function breakpoints.getresults() + return results or { } +end + +function breakpoints.nofresults() + return results and #results or 0 +end + +function breakpoints.typesetresult(n) + local context, ctx_NC, ctx_NR, ctx_color = context, context.NC, context.NR, context.color + + local function typeset(result) + if result then + local lastline = 0 + -- context.starttabulate { "|r|c|r|r|r|l|l|c|" } + context.starttabulate { "|r|r|r|r|l|l|c|" } + for i=1,#result do + local r = result[i] + local serial = r.serial + local previous = r.previous + local line = r.line + local final = r.final + -- local deleted = r.deleted + local overload = r.overload + local demerits = overload or r.demerits + local trigger = r.trigger + local class = r.class + local short = r.short + local color = { r.color } -- cache + ctx_NC() if line ~= lastline then context(line) lastline = line end + -- ctx_NC() if deleted then context.textminus() end + ctx_NC() if final then ctx_color(color,serial) else context(serial) end + ctx_NC() context(previous) + ctx_NC() if final then ctx_color(color,demerits) else context(demerits) end + ctx_NC() if final then ctx_color(color,class) else context(class) end + ctx_NC() ctx_color(color,trigger) + ctx_NC() if overload then if final then ctx_color(color,"!") else context("!") end end + ctx_NC() ctx_NR() + end + context.stoptabulate() + -- + local finals = result.finals + if finals then + context.starttabulate { "|r|l|" } + for i=1,#finals do + local data = finals[i] + local final = data.final + local serial = data.serial + local path = table.concat(data.list," ") + local color = final and data.color + if color then + color = { color } + end + ctx_NC() if color then ctx_color(color,serial) else context(serial) end + ctx_NC() if color then ctx_color(color,path) else context(path) end + ctx_NC() ctx_NR() + end + context.stoptabulate() + end + end + end + + local results = breakpoints.getresults() + if n then + typeset(results[n]) + else + for i=1,#results do + typeset(results[i]) + end + end +end diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-brk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-brk.mkxl new file mode 100644 index 00000000000..d7463535204 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-brk.mkxl @@ -0,0 +1,47 @@ +%D \module +%D [ file=trac-brk, +%D version=2023.05.23, +%D title=\CONTEXT\ Tracing Macros, +%D subtitle=Linebreaks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifdefined\showbreakpoints \endinput \fi + +\writestatus{loading}{ConTeXt Tracing Macros / Breakpoints} + +\registerctxluafile{trac-brk}{} + +\unprotect + +\permanent\tolerant\protected\gdef\startshowbreakpoints[#1]% + {\begingroup + \getdummyparameters[\c!option=,\c!list=,\c!offset=\zeropoint,#1]% + \ctxlua{tracers.breakpoints.start { + option = "\dummyparameter\c!option", + list = "\dummyparameter\c!list", + offset = \number\dimexpr\dummyparameter\c!offset\relax, + }}% + \endgroup} + +\permanent\protected\gdef\stopshowbreakpoints + {\par + \ctxlua{tracers.breakpoints.stop()}} + +\permanent\tolerant\protected\gdef\showbreakpoints[#1]% + {\begingroup + \switchtobodyfont[7pt]% + \dorecurse{\cldcontext{tracers.breakpoints.nofresults()}} { + \startcolumns[n=3,notes=no,#1]% + \ctxlua{tracers.breakpoints.typesetresult(##1)}% + \stopcolumns + }% + \ctxlua{tracers.breakpoints.reset()}% + \endgroup} + +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl index 5d760598b7f..cae0ca58279 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl @@ -49,9 +49,9 @@ % \newconditional\c_math_virtual_px % \newconditional\c_math_virtual_lm % -% \installtexdirective {fonts.math.virtual.tx} {\settrue \c_math_virtual_tx} {\setfalse\c_math_virtual_tx} -% \installtexdirective {fonts.math.virtual.px} {\settrue \c_math_virtual_px} {\setfalse\c_math_virtual_px} -% \installtexdirective {fonts.math.virtual.lm} {\settrue \c_math_virtual_lm} {\setfalse\c_math_virtual_lm} +% \installtexdirective {fonts.math.virtual.tx} {\c_math_virtual_tx\conditionaltrue} {\c_math_virtual_tx\conditionalfalse} +% \installtexdirective {fonts.math.virtual.px} {\c_math_virtual_px\conditionaltrue} {\c_math_virtual_px\conditionalfalse} +% \installtexdirective {fonts.math.virtual.lm} {\c_math_virtual_lm\conditionaltrue} {\c_math_virtual_lm\conditionalfalse} % % but as it makes the typescript look ugly we wil use: % diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt index 649fef30bff..bf71feceb63 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt @@ -42,11 +42,11 @@ local function resettiming(instance) timers[instance or "notimer"] = { timing = 0, loadtime = 0, offset = 0 } end -local ticks = clock -local seconds = function(n) return n or 0 end +-- local ticks = clock +-- local seconds = function(n) return n or 0 end -ticks = lua.getpreciseticks -seconds = lua.getpreciseseconds +local ticks = lua.getpreciseticks +local seconds = lua.getpreciseseconds local function starttiming(instance,reset) local timer = timers[instance or "notimer"] @@ -173,7 +173,7 @@ function statistics.show() end) register("used engine", function() return format("%s version: %s, functionality level: %s, format id: %s, compiler: %s", - LUATEXENGINE, LUATEXVERSION, LUATEXFUNCTIONALITY, LUATEXFORMATID, status.used_compiler) + LUATEXENGINE, LUATEXVERBOSE, LUATEXFUNCTIONALITY, LUATEXFORMATID, status.used_compiler) end) register("tex properties", function() local t = status.gethashstate() diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt index e9c8fac2844..93f4ceb4b53 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt @@ -11,8 +11,8 @@ typesetters.checkers = checkers ----- report_justification = logs.reporter("visualize","justification") -local a_alignstate = attributes.private("alignstate") -local a_justification = attributes.private("justification") +local a_alignstate = attributes.private("alignstate") +local a_justification = attributes.private("justification") local nuts = nodes.nuts @@ -37,10 +37,11 @@ local nodepool = nuts.pool local new_hlist = nodepool.hlist local new_kern = nodepool.kern -local hlist_code = nodes.nodecodes.hlist +local hlist_code = nodes.nodecodes.hlist local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue + +local unsetvalue = attributes.unsetvalue local enableaction = nodes.tasks.enableaction diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-riv.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-riv.lmt new file mode 100644 index 00000000000..aa6658606e1 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-riv.lmt @@ -0,0 +1,320 @@ +if not modules then modules = { } end modules ['trac-riv'] = { + version = 1.001, + optimize = true, + comment = "companion to trac-riv.mkxl", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local concat = table.concat +local floor, ceiling = math.floor, math.ceiling +local newindex = lua.newindex + +local nuts = nodes.nuts + +local getbox = nuts.getbox + +local getid = nuts.getid +local getsubtype = nuts.getsubtype +local getnext = nuts.getnext +local getwhd = nuts.getwhd +local getwidth = nuts.getwidth +local getkern = nuts.getkern +local getlist = nuts.getlist +local getleader = nuts.getleader +local getreplace = nuts.getreplace +local getheight = nuts.getheight +local getdepth = nuts.getdepth + +local setlink = nuts.setlink +local setlist = nuts.setlist +local setoffsets = nuts.setoffsets +local setkern = nuts.setkern + +local effectiveglue = nuts.effectiveglue + +local setcolor = nodes.tracers.colors.set + +local newrule = nuts.pool.rule +local newkern = nuts.pool.kern + +local nextnode = nuts.traversers.node + +local nodecodes = nodes.nodecodes +local gluecodes = nodes.gluecodes + +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local penalty_code = nodecodes.penalty +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local math_code = nodecodes.math +local rule_code = nodecodes.rule + +local spaceskip_code = gluecodes.spaceskip +local xspaceskip_code = gluecodes.xspaceskip +local lineskip_code = gluecodes.lineskip +local baselineskip_code = gluecodes.baselineskip + +local fontkern_code = nodes.kerncodes.fontkern +local linelist_code = nodes.listcodes.line + +local unit = 65536 +local step = 2 * unit +local margin = -1 * unit +local skip = 10 * unit +local height = 2 * unit +local depth = 2 * unit + +local function analyze(line,max) + + local width = 0 + local position = 0 + local profile = newindex(max+2,0) + local wd = 0 + local state = 0 + + local function process(current) -- called nested in disc replace + for current, id, subtype in nextnode, current do + if id == glyph_code then + -- wd = getwidth(current) + local w, h, d = getwhd(current) + wd = w + if d <= depth and h <= height then + local n = getnext(current) + if n and getid(n) == glue_code then + local s = getsubtype(n) + if s == spaceskip_code or s == xspaceskip_code then + state = 1 + end + end + end + elseif id == kern_code then + wd = getkern(current) + if wd > 0 and subtype ~= fontkern_code then + state = 1 + end + elseif id == disc_code then + local replace = getreplace(current) + if replace then + process(replace) + end + goto done + elseif id == glue_code then + wd = effectiveglue(current,line) + if wd > 0 and subtype == spaceskip_code or subtype == xspaceskip_code then + state = 1 + end + elseif id == hlist_code then + wd = getwidth(current) + elseif id == vlist_code then + wd = getwidth(current) + elseif id == rule_code then + wd = getwidth(current) + elseif id == math_code then + wd = getkern(current) + getwidth(current) -- surround + state = 1 + else + goto done + end + -- progress + position = width + width = position + wd + p = floor((position - margin)/step + 0.5) + w = floor((width + margin)/step - 0.5) + if p < 0 then + p = 0 + end + if w < 0 then + w = 0 + end + if p > w then + w, p = p, w + end + if state == 1 then + for i=p+1,w+1 do + profile[i] = state + end + state = 0 + end + ::done:: + end + end + + process(getlist(line)) + + return profile + +end + +function builders.profiling.getrivers(specification) + local box = getbox(specification.box) + local head = getlist(box) + if head then + + step = (specification.step or 2 * unit) + margin = (specification.margin or -1 * unit) + skip = (specification.gluethreshold or 10 * unit) + height = (specification.height or 2 * unit) + depth = (specification.depth or 2 * unit) + + local profiles = { } + local max = ceiling(getwidth(box)/step) + 1 + + local p = 0 + + p = p + 1 ; profiles[p] = newindex(max+2,1) + p = p + 1 ; profiles[p] = newindex(max+2,0) + + for current, id, subtype in nextnode, head do + if id == hlist_code then + local amount = getwidth(current) + if amount > 0 then + p = p + 1 ; profiles[p] = analyze(current,max) + end + elseif id == glue_code then + if subtype == baselineskip_code or subtype == lineskip_code then + -- okay + elseif getwidth(current) > skip then + p = p + 1 ; profiles[p] = newindex(max+2,0) + end + elseif id == vlist_code then + p = p + 1 ; profiles[p] = newindex(max+2,0) + end + end + + p = p + 1 ; profiles[p] = newindex(max+2,0) + p = p + 1 ; profiles[p] = newindex(max+2,1) + + for i=1,p do + local pi = profiles[i] + pi[0] = 1 ; pi[max ] = 1 + pi[1] = 1 ; pi[max+1] = 1 + profiles[i] = concat(pi,"",0,max+1) + end + profiles = concat(profiles,"\n") + potrace.setbitmap("profile", profiles) + end +end + +function builders.profiling.addrivers(specification) + local box = getbox(specification.box) + local head = getlist(box) + if head then + + step = (specification.step or 2 * unit) + margin = (specification.margin or -1 * unit) + skip = (specification.gluethreshold or 10 * unit) + height = (specification.height or 2 * unit) + depth = (specification.depth or 2 * unit) + + local profiles = { } + local max = ceiling(getwidth(box)/step) + 1 + + local previous = false + local spacing = 0 + + local topline = false + local botline = false + + local list = newindex(max+2,false) + + for current, id, subtype in nextnode, head do + if id == hlist_code then + local amount = getwidth(current) + if amount > 0 then + botline = analyze(current,max) + if topline then + local head = false + local tail = false + for i=1,max do + if topline[i] ~= 0 and botline[i] ~= 0 then + local _, hp, dp = getwhd(previous) + local _, hc, dc = getwhd(previous) + local rule = newrule(step,hp + dp + spacing + hc,dc) + local kern = newkern() + setkern(kern,-step) + setoffsets(rule,i*step,0) + setlink(rule,kern) + if tail then + setlink(tail,rule) + else + head = rule + end + tail = kern + local li = list[i] + if li then + li[#li+1] = rule + for i=1,#li do + setcolor(li[i],"darkred") + end + else + list[i] = { rule } + setcolor(rule,"darkblue") + end + else + list[i] = false + end + end + if head then + setlink(tail,getlist(current)) + setlist(current,head) + end + end + topline = botline + botline = false + previous = current + end + elseif id == glue_code then + local width = getwidth(current) + if subtype == baselineskip_code or subtype == lineskip_code then + spacing = width + elseif width > skip then + topline = false + botline = false + end + elseif id == vlist_code then + topline = false + botline = false + end + end + + end +end + +interfaces.implement { + name = "getrivers", + protected = true, + actions = builders.profiling.getrivers, + arguments = { + { + { "box", "integer" }, + { "height", "dimension" }, + { "depth", "dimension" }, + { "step", "dimension" }, + { "margin", "dimension" }, + { "skip", "dimension" }, + } + } +} + +-- can become option + +interfaces.implement { + name = "addrivers", + protected = true, + actions = builders.profiling.addrivers, + arguments = { + { + { "box", "integer" }, + { "height", "dimension" }, + { "depth", "dimension" }, + { "step", "dimension" }, + { "margin", "dimension" }, + { "skip", "dimension" }, + } + } +} diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-riv.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-riv.mkxl new file mode 100644 index 00000000000..d2a0efe8401 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-riv.mkxl @@ -0,0 +1,87 @@ +%D \module +%D [ file=trac-riv, +%D version=2023.08.15, % follow up +%D title=\CONTEXT\ Tracing Macros, +%D subtitle=Rivers, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Tracing Macros / Rivers} + +\registerctxluafile{trac-riv}{autosuffix} + +\unprotect + +\permanent\tolerant\protected\def\startshowrivers[#1]#*% + {\begingroup + \letdummyparameter\c!margin\zeropoint + \letdummyparameter\c!step\!!twopoint + \setdummyparameter\c!height{.2\bodyfontsize}% + \setdummyparameter\c!depth {.2\bodyfontsize}% + \setdummyparameter\c!spaceinbetween{.1\lineheight}% + \letdummyparameter\c!criterium\plusfour + \letdummyparameter\c!option\empty + \getdummyparameters[#1]% + \setbox\scratchboxone\vbox\bgroup} + +\permanent\tolerant\protected\def\stopshowrivers + {\egroup + \clf_getrivers + box \scratchboxone + margin \dimexpr\dummyparameter\c!margin\relax + skip \dimexpr\dummyparameter\c!spaceinbetween\relax + step \dimexpr\dummyparameter\c!step\relax + height \dimexpr\dummyparameter\c!height\relax + depth \dimexpr\dummyparameter\c!depth\relax + \relax + \setbox\scratchboxtwo\hbox\bgroup + \startMPcode + lmt_showrivers ( + \the\numexpr\dummyparameter\c!criterium\relax, + \the\dimexpr\wd \scratchboxone\relax, + \the\dimexpr\htdp\scratchboxone\relax, + \ifcstok{\dummyparameter\c!option}\v!test true\else false\fi + ) ; + \stopMPcode + \egroup + \startoverlay + {\box\scratchboxtwo} + {\box\scratchboxone} + \stopoverlay + \endgroup} + +\permanent\tolerant\protected\def\addriverstobox[#1]#2% + {\begingroup + \letdummyparameter\c!margin\zeropoint + \letdummyparameter\c!step\!!twopoint + \setdummyparameter\c!height{.2\bodyfontsize}% + \setdummyparameter\c!depth {.2\bodyfontsize}% + \setdummyparameter\c!spaceinbetween{.1\lineheight}% + \getdummyparameters[#1]% + \clf_addrivers + box \numexpr#2\relax + margin \dimexpr\dummyparameter\c!margin\relax + skip \dimexpr\dummyparameter\c!spaceinbetween\relax + step \dimexpr\dummyparameter\c!step\relax + height \dimexpr\dummyparameter\c!height\relax + depth \dimexpr\dummyparameter\c!depth\relax + \relax + \endgroup} + +% \def\page_one_show_rivers#1% +% {\addriverstobox{#1}} +% +% \installtextracker +% {typesetting.rivers} +% {\let\page_one_hook_for_checks\page_one_show_rivers} +% {\let\page_one_hook_for_checks\gobbleoneargument} + +\permanent\tolerant\protected\def\showrivers[#1]% + {\def\page_one_hook_for_checks##1{\addriverstobox[#1]{##1}}} + +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt index 5c21f65250b..54e238780e7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt @@ -102,11 +102,11 @@ local function set(t,what,newvalue) else value = is_boolean(value,value,true) -- strict end - w = topattern(w,true,true) + local p = topattern(w,true,true) for name, functions in sortedhash(data) do if done[name] then -- prevent recursion due to wildcards - elseif find(name,w) then + elseif find(name,p) then done[name] = true for i=1,#functions do functions[i](value) diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-tex.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-tex.lmt new file mode 100644 index 00000000000..58dfb0316ad --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-tex.lmt @@ -0,0 +1,120 @@ +if not modules then modules = { } end modules ['trac-tex'] = { + version = 1.001, + comment = "companion to trac-deb.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local texhashtokens = tex.hashtokens + +local trackers = trackers +local token = token +local saved = { } +local create = token.create +local undefined = create("undefined").command + +function trackers.savehash() + saved = texhashtokens() + return saved +end + +function trackers.dumphashtofile(filename,delta) + local list = { } + local hash = texhashtokens() + local create = token.create + for i=1,#hash do + local name = hash[i] + if not delta or not saved[name] then + local token = create(name) + if token.command ~= undefined then + local category = token.cmdname + local dk = list[category] + if not dk then + dk = { + names = { }, + found = 0, + -- code = token[1], + } + list[category] = dk + end + if token.protected then + if token.expandable then + dk.names[name] = "ep" + else + dk.names[name] = "-p" + end + else + if token.expandable then + dk.names[name] = "ep" + else + dk.names[name] = "--" + end + end + dk.found = dk.found + 1 + end + end + end + table.save(filename or tex.jobname .. "-hash.log",list) +end + +local delta = nil + +local function dump_hash(wanteddelta) + if delta == nil then + saved = saved or trackers.savehash() + luatex.registerstopactions(1,function() dump_hash(nil,wanteddelta) end) -- at front + end + delta = wanteddelta +end + +directives.register("system.dumphash", function() dump_hash(false) end) +directives.register("system.dumpdelta", function() dump_hash(true ) end) + +local function saveusedfilesintrees(format) + local data = { + jobname = environment.jobname or "?", + version = environment.version or "?", + kind = environment.kind or "?", + files = resolvers.foundintrees() + } + local filename = file.replacesuffix(environment.jobname or "context-job",'jlg') + if format == "lua" then + io.savedata(filename,table.serialize(data,true)) + else + io.savedata(filename,table.toxml(data,"job")) + end +end + +directives.register("system.dumpfiles", function(v) + luatex.registerstopactions(function() saveusedfilesintrees(v) end) +end) + +local profiled = table.setmetatableindex("number") + +interfaces.implement { + name = "profilemacro", + arguments = "csname", + actions = function(cs) + profiled[cs] = profiled[cs] + 1 + end, +} + +interfaces.implement { + name = "showprofiledmacros", + public = true, + protected = true, + actions = function(cs) + local n = 0 + local m = 0 + for k, v in table.sortedhash(profiled) do + logs.report("profiled", "%s : %i",k,v) + n = n + v + m = m + 1 + end + if m > 0 and n > 0 then + logs.report("profiled", "%i profiled : %i",m,n) + end + end, +} + diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl index cf46bed26e5..2926a90b2e3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl @@ -13,7 +13,7 @@ \writestatus{loading}{ConTeXt Tracking Macros / TeX} -\registerctxluafile{trac-tex}{} +\registerctxluafile{trac-tex}{autosuffix} %D All tracing flags at the \TEX\ end will be redone this way so %D that we have a similar mechanism for \TEX\ and \LUA. Also, the @@ -40,31 +40,26 @@ \permanent\protected\def\nomkivstatistics{\enabledirectives[system.nostatistics]} -%D This is not really a tracker but for decades it lived in my \type {cont-loc} -%D file. I moved it here because I wanted someone else to use it. This macro is not -%D really useful for users. I kept the \LUA\ variant in \type {cont-loc.mkiv}. +%D Finally this one got moved from cont-exp to here (replacing the old one): -\installcorenamespace{profilemacrocount} -\installcorenamespace{profilemacromacro} - -\newtoks\t_syst_profile - -\appendtoks - \the\t_syst_profile -\to \everystoptext +\installcorenamespace{profilemacro} \permanent\protected\def\profilemacro#1% an oldie, but modernized a bit {\edef\p_name{\csstring#1}% - \ifcsname\??profilemacrocount\p_name\endcsname \else - \expandafter\newinteger\csname\??profilemacrocount\p_name\endcsname - \letcsname\??profilemacromacro\p_name\endcsname#1% - \xtoksapp\t_syst_profile - {\writestatus - {profile}% - {\string#1: \noexpand\the\csname\??profilemacrocount\p_name\endcsname}}% - \enforced\protected\xdef#1% - {\global\advanceby\csname\??profilemacrocount\p_name\endcsname\plusone - \expandafter\noexpand\csname\??profilemacromacro\p_name\endcsname}% + \ifcsname\??profilemacro\p_name\endcsname \else + \aliased\letcsname\??profilemacro\p_name\endcsname#1% + % \enforced\protected\xdef#1% + \untraced\enforced\ifflags#1\protected\protected\fi\xdef#1% + {\noexpand\clf_profilemacro\noexpand#1% + \expandafter\noexpand\csname\??profilemacro\p_name\endcsname}% \fi} +% \appendtoks +% {\appendtoks\showprofiledmacros\to\everystoptext}% +% \to \everydump + +\appendtoks + \showprofiledmacros +\to \everystoptext + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt index 9b467de29d0..44624e7e0ec 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt @@ -41,7 +41,6 @@ local setattr = nuts.setattr local setwidth = nuts.setwidth local setshift = nuts.setshift local setoffsets = nuts.setoffsets -local getglyphdimensions = nuts.getglyphdimensions local getid = nuts.getid local getfont = nuts.getfont @@ -71,7 +70,6 @@ local copylist = nuts.copylist local copy_node = nuts.copy local insertnodebefore = nuts.insertbefore local insertnodeafter = nuts.insertafter -local apply_to_nodes = nuts.apply local flushnodelist = nuts.flushlist local hpack_string = nuts.typesetters.tohpack @@ -81,7 +79,7 @@ local texsetattribute = tex.setattribute local setmetatableindex = table.setmetatableindex -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue local current_font = font.current @@ -89,7 +87,8 @@ local fonthashes = fonts.hashes local chardata = fonthashes.characters local exheights = fonthashes.exheights local emwidths = fonthashes.emwidths -local pt_factor = number.dimenfactors.pt + +local ptfactor = number.dimenfactors.pt local nodepool = nuts.pool local new_rule = nodepool.rule @@ -110,8 +109,9 @@ local setlisttransparency = tracers.transparencies.setlist local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming -local a_visual = attributes.private("visual") -local a_layer = attributes.private("viewerlayer") +local a_visual = attributes.private("visual") +local a_filter = attributes.private("filter") +local a_layer = attributes.private("viewerlayer") local enableaction = nodes.tasks.enableaction @@ -149,9 +149,29 @@ local modes = { mark = 0x2000000, insert = 0x4000000, boundary = 0x8000000, + + vkern = 0x0000008, + hkern = 0x0000008, + vglue = 0x0000010, + hglue = 0x0000010, + vpenalty = 0x0000020, + hpenalty = 0x0000020, +} + +local filters = { + vglue = 0x001, + hglue = 0x002, + -- mglue = 0x004, + vkern = 0x010, + hkern = 0x020, + -- mkern = 0x040, + vpenalty = 0x100, + hpenalty = 0x200, + -- mpenalty = 0x400, } -visualizers.modes = modes +visualizers.modes = modes +visualizers.filters = filters local usedfont, exheight, emwidth local l_penalty, l_glue, l_kern, l_fontkern, l_hbox, l_vbox, l_vtop, l_strut, l_whatsit, l_glyph, l_user, l_math, l_marginkern, l_mathkern, l_mathshape, l_italic, l_origin, l_discretionary, l_expansion, l_line, l_space, l_depth, @@ -180,23 +200,37 @@ local userrule -- bah, not yet defined: todo, delayed(nuts.rules,"userrule") local outlinerule -- bah, not yet defined: todo, delayed(nuts.rules,"userrule") local emptyrule -- bah, not yet defined: todo, delayed(nuts.rules,"userrule") -local function initialize() - -- +local function getusedfont() if not usedfont then -- we use a narrow monospaced font -- infofont ? visualizers.setfont(fonts.definers.define { name = "lmmonoltcond10regular", size = tex.sp("4pt") }) end + return usedfont +end + +visualizers.getusedfont = getusedfont + +function visualizers.definelayer(name) + local tag = formatters["v_%s"](name) + attributes.viewerlayers.define { + tag = tag, + title = formatters["visualizer %s"](name), + visible = "start", + editable = "yes", + printable = "yes", + } + layers[name] = attributes.viewerlayers.register(tag,true) + return tag +end + +local function initialize() -- - for mode, value in next, modes do - local tag = formatters["v_%s"](mode) - attributes.viewerlayers.define { - tag = tag, - title = formatters["visualizer %s"](mode), - visible = "start", - editable = "yes", - printable = "yes" - } - layers[mode] = attributes.viewerlayers.register(tag,true) + if not usedfont then + getusedfont() + end + -- + for mode in next, modes do + visualizers.definelayer(mode) end l_hbox = layers.hbox l_vbox = layers.vbox @@ -256,7 +290,7 @@ function visualizers.enable() end end -local function setvisual(n,a,what,list) -- this will become more efficient when we have the bit lib linked in +local function setvisual(n,a,what,list) if not n or n == "reset" then return unsetvalue elseif n == true or n == "makeup" then @@ -305,25 +339,52 @@ local function setvisual(n,a,what,list) -- this will become more efficient when return a end +local function setfilter(n,a,what,list) + if not n or n == "reset" then + return unsetvalue + elseif type(n) == "string" then + for s in gmatch(n,"[a-z]+") do + local m = filters[s] + if not m then + -- go on + elseif not a or a == 0 or a == unsetvalue then + a = m + else + a = a | m + end + end + end + if not a or a == 0 or a == unsetvalue then + return unsetvalue + else + return a + end +end + function nuts.setvisual(n,mode) if mode then setattr(n,a_visual,setvisual(mode,getattr(n,a_visual),true)) + setattr(n,a_filter,setfilter(mode,getattr(n,a_filter),true)) else local a = texgetattribute(a_visual) if a ~= unsetvalue then setattr(n,a_visual,a) + setattr(n,a_filter,texgetattribute(a_visual)) end end end function nuts.setvisuals(n,mode) -- currently the same setattr(n,a_visual,setvisual(mode,getattr(n,a_visual),true,true)) + setattr(n,a_filter,setfilter(mode,getattr(n,a_filter),true,true)) end -- fast setters do + local apply_to_nodes = nuts.apply + local cached = setmetatableindex(function(t,k) if k == true then return texgetattribute(a_visual) @@ -371,27 +432,31 @@ end function visualizers.setvisual(n) texsetattribute(a_visual,setvisual(n,texgetattribute(a_visual))) + texsetattribute(a_filter,setfilter(n,texgetattribute(a_filter))) end function visualizers.setlayer(n) texsetattribute(a_layer,layers[n] or unsetvalue) end -local function set(mode,v) - texsetattribute(a_visual,setvisual(mode,texgetattribute(a_visual),v)) -end +local fraction = 10 do -for mode, value in next, modes do - trackers.register(formatters["visualizers.%s"](mode), function(v) set(mode,v) end) -end + local function set(mode,v) + texsetattribute(a_visual,setvisual(mode,texgetattribute(a_visual),v)) + texsetattribute(a_filter,setfilter(mode,texgetattribute(a_filter),v)) + end -local fraction = 10 + for mode, value in next, modes do + trackers.register(formatters["visualizers.%s"](mode), function(v) set(mode,v) end) + end + + trackers .register("visualizers.reset", function(v) set("reset", v) end) + trackers .register("visualizers.all", function(v) set("all", v) end) + trackers .register("visualizers.makeup", function(v) set("makeup",v) end) + trackers .register("visualizers.boxes", function(v) set("boxes", v) end) + directives.register("visualizers.fraction", function(v) fraction = (v and tonumber(v)) or (v == "more" and 5) or 10 end) -trackers .register("visualizers.reset", function(v) set("reset", v) end) -trackers .register("visualizers.all", function(v) set("all", v) end) -trackers .register("visualizers.makeup", function(v) set("makeup",v) end) -trackers .register("visualizers.boxes", function(v) set("boxes", v) end) -directives.register("visualizers.fraction", function(v) fraction = (v and tonumber(v)) or (v == "more" and 5) or 10 end) +end -- we can just paste verbatim together .. no typesetting needed @@ -407,61 +472,6 @@ directives.register("visualizers.fraction", function(v) fraction = (v and tonumb -- ... if okay it will replace the current hpack_string in node_typ --- local function sometext(str,layer,color,textcolor,lap,variant) --- local text = hpack_string(str,usedfont) --- local size = getwidth(text) --- local rule = new_rule(size,2*exheight,exheight/2) --- local kern = new_kern(-size) --- if color then --- setcolor(rule,color) --- end --- if textcolor then --- setlistcolor(getlist(text),textcolor) --- end --- local info = setlink(rule,kern,text) --- setlisttransparency(info,"trace:g") --- info = hpack_nodes(info) --- local width = getwidth(info) --- if variant then --- setoffsets(info,0,variant*exheight) --- end --- if lap then --- info = new_hlist(setlink(new_kern(-width),info)) -- use xoffset and set info wd to 0 --- else --- info = new_hlist(info) -- a bit overkill: double wrapped --- end --- if layer then --- setattr(info,a_layer,layer) --- end --- return info, width --- end - --- local function sometext(str,layer,color,textcolor,lap,variant) --- local text = hpack_string(str,usedfont) --- local size = getwidth(text) --- local rule = new_virtual_rule(size,2*exheight,exheight/2) --- if color then --- setcolor(rule,color) --- end --- if textcolor then --- setlistcolor(getlist(text),textcolor) --- end --- local info = setlink(rule,text) --- setlisttransparency(info,"trace:g") --- info = hpack_nodes(info) --- if variant then --- setoffsets(info,0,variant*exheight) --- end --- info = new_hlist(info) -- a bit overkill: double wrapped --- if lap then --- setoffsets(info,-size) --- end --- if layer then --- setattr(info,a_layer,layer) --- end --- return info, size --- end - local function sometext(str,layer,color,textcolor,lap,variant) local text = hpack_string(str,usedfont) local size = getwidth(text) @@ -515,6 +525,10 @@ end local caches = setmetatableindex("table") +function visualizers.registercache(name) + return caches[name] +end + local fontkern, italickern, marginkern, mathkern do local f_cache = caches["fontkern"] @@ -529,7 +543,7 @@ local fontkern, italickern, marginkern, mathkern do local kern = width + extra local info = cache[kern] if not info then - local text = hpack_string(formatters[" %0.3f"](kern*pt_factor),usedfont) + local text = hpack_string(formatters[" %0.3f"](kern*ptfactor),usedfont) local rule = new_rule(emwidth/fraction,6*exheight,2*exheight) local list = getlist(text) if kern > 0 then @@ -560,15 +574,15 @@ local fontkern, italickern, marginkern, mathkern do end mathshapekern = function(head,current) - return somekern(head,current,s_cache,"trace:do",l_mathshapekern) + return somekern(head,current,s_cache,"trace:dg",l_mathshapekern) end marginkern = function(head,current) - return somekern(head,current,m_cache,"trace:do",l_marginkern) + return somekern(head,current,m_cache,"trace:dr",l_marginkern) end mathkern = function(head,current) - return somekern(head,current,l_cache,"trace:do",l_mathkern) + return somekern(head,current,l_cache,"trace:db",l_mathkern) end end @@ -643,7 +657,7 @@ end local ruledmark do - local set_code = nodes.markcodes.set + local set_code = nodes.markcodes.set local sm_cache = setmetatableindex(caches["setmark"], function(t,index) local info = sometext(formatters["SM:%i"](index),usedfont,nil,"trace:w") -- whatsit @@ -763,9 +777,9 @@ local ruleddir, ruledpar do local dircodes = nodes.dircodes local directioncodes = tex.directioncodes -- nodes.dirvalues - local cancel_code = dircodes.cancel - local l2r_code = directioncodes.l2r - local r2l_code = directioncodes.r2l + local cancel_code = dircodes.cancel + local l2r_code = directioncodes.l2r + local r2l_code = directioncodes.r2l local d_cache = caches["dir"] @@ -866,6 +880,7 @@ local ruledbox do setcolor(rule,"trace:do") settransparency(rule,"trace:do") setattr(rule,a_layer,l_origin) + setattr(origin,a_layer,l_origin) t[size] = origin return origin end) @@ -903,11 +918,8 @@ end rest = emptyrule(wd,ht,dp) -- we accept some overhead elseif what == "_D_" then -- also the other line - local up = nil local list = getlist(current) - if list then - up = getheight(list) - end + local up = list and getheight(list) or 0 rest = userrule { width = wd, height = ht, @@ -1009,6 +1021,8 @@ local ruledglyph do -- local ligature_code = 0x8000 + nodes.glyphcodes.ligature + local getglyphdimensions = nuts.getglyphdimensions + ruledglyph = function(head,current,previous) -- wrong for vertical glyphs local wd, ht, dp = getglyphdimensions(current) if wd ~= 0 then @@ -1016,18 +1030,9 @@ local ruledglyph do local prev = previous setboth(current) local linewidth = emwidth/(2*fraction) - local x_offset, y_offset, l_margin, r_margin, raise = getoffsets(current) --- local info = setlink((dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule { --- width = wd, --- height = ht, --- depth = dp, --- line = linewidth, --- type = "box", --- },new_kern(-wd)) --- if ht == 0 and dp == 0 then --- ht = linewidth/2 --- dp = ht --- end + -- local x_offset, y_offset, l_margin, r_margin, raise = getoffsets(current) + local c, f = isglyph(current) + local char = chardata[f][c] local info = (dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule { width = wd, height = ht, @@ -1035,8 +1040,6 @@ local ruledglyph do line = linewidth, type = "box", } - local c, f = isglyph(current) - local char = chardata[f][c] if char and type(char.unicode) == "table" then -- hackery test setlistcolor(info,"trace:s") setlisttransparency(info,"trace:ds") @@ -1078,23 +1081,23 @@ local ruledglue, ruledmathglue do local gluecodes = nodes.gluecodes - local userskip_code = gluecodes.userskip - local spaceskip_code = gluecodes.spaceskip - local xspaceskip_code = gluecodes.xspaceskip - local zerospaceskip_code = gluecodes.zerospaceskip or gluecodes.userskip - -- local keepskip_code = gluecodes.keepskip or gluecodes.userskip - local leftskip_code = gluecodes.leftskip - local rightskip_code = gluecodes.rightskip - local lefthangskip_code = gluecodes.lefthangskip - local righthangskip_code = gluecodes.righthangskip - local parfillleftskip_code = gluecodes.parfillleftskip or parfillskip_code - local parfillrightskip_code = gluecodes.parfillrightskip or parfillskip_code - local parinitleftskip_code = gluecodes.parinitleftskip - local parinitrightskip_code = gluecodes.parinitrightskip - local indentskip_code = gluecodes.indentskip - local intermathskip_code = gluecodes.intermathskip - local correctionskip_code = gluecodes.correctionskip - local tabskip_code = gluecodes.tabskip + local userskip_code = gluecodes.userskip + local spaceskip_code = gluecodes.spaceskip + local xspaceskip_code = gluecodes.xspaceskip + local zerospaceskip_code = gluecodes.zerospaceskip or gluecodes.userskip + -- local keepskip_code = gluecodes.keepskip or gluecodes.userskip + local leftskip_code = gluecodes.leftskip + local rightskip_code = gluecodes.rightskip + local lefthangskip_code = gluecodes.lefthangskip + local righthangskip_code = gluecodes.righthangskip + local parfillleftskip_code = gluecodes.parfillleftskip or parfillskip_code + local parfillrightskip_code = gluecodes.parfillrightskip or parfillskip_code + local parinitleftskip_code = gluecodes.parinitleftskip + local parinitrightskip_code = gluecodes.parinitrightskip + local indentskip_code = gluecodes.indentskip + local intermathskip_code = gluecodes.intermathskip + local correctionskip_code = gluecodes.correctionskip + local tabskip_code = gluecodes.tabskip local g_cache_v = caches["vglue"] local g_cache_h = caches["hglue"] @@ -1159,7 +1162,7 @@ local ruledglue, ruledmathglue do -- local subtype = getsubtype(current) -- local width = effectiveglue(current,parent) -- local stag = stags[subtype] --- local amount = f_amount(tags[subtype] or (vertical and "VS") or "HS",width*pt_factor) -- can be sped up +-- local amount = f_amount(tags[subtype] or (vertical and "VS") or "HS",width*ptfactor) -- can be sped up -- local info = (vertical and g_cache_v or g_cache_h)[amount] -- if subtype == intermathskip_code then -- head = ruledmathglue(head, current) @@ -1224,7 +1227,7 @@ local ruledglue, ruledmathglue do if info then -- print("glue hit") else - local amount = f_amount(tags[subtype] or (vertical and "VS") or "HS",width*pt_factor) + local amount = f_amount(tags[subtype] or (vertical and "VS") or "HS",width*ptfactor) if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then info = sometext(amount,l_glue,"trace:y") elseif subtype == userskip_code then @@ -1270,23 +1273,32 @@ local ruledglue, ruledmathglue do local g_cache_s = caches["space"] local g_cache_x = caches["xspace"] + local g_cache_f = caches["fspace"] + + local getoptions = nuts.getoptions ruledspace = function(head,current,parent) local subtype = getsubtype(current) local width = effectiveglue(current,parent) local info - if subtype == spaceskip_code then - info = g_cache_s[width] - if not info then - info = someblob("SP",l_glue,"trace:y",nil,width) - g_cache_s[width] = info - end - else + if subtype ~= spaceskip_code then info = g_cache_x[width] if not info then info = someblob("XS",l_glue,"trace:m",nil,width) g_cache_x[width] = info end + elseif (getoptions(current) & 2) == 2 then + info = g_cache_f[width] + if not info then + info = someblob("SF",l_glue,"trace:c",nil,width) + g_cache_f[width] = info + end + else + info = g_cache_s[width] + if not info then + info = someblob("SP",l_glue,"trace:y",nil,width) + g_cache_s[width] = info + end end info = copylist(info) head, current = insertnodebefore(head,current,info) @@ -1297,8 +1309,8 @@ local ruledglue, ruledmathglue do local mathvalues = tex.mathparametercodes -- nodes.mathvalues - mathvalues[-1] = "left" - mathvalues[-2] = "right" + mathvalues[-1] = "left" -- (script) slack detail value + mathvalues[-2] = "right" -- (script) slack detail value local morehack = setmetatableindex(function(t,k) local v = mathematics.classnames[k] -- yet unknown @@ -1342,8 +1354,8 @@ local ruledglue, ruledmathglue do end end if not info then - local amount = quad and f_amount("QUAD",width*pt_factor) or temphack[name] - -- local amount = quad and f_amount("QD",width*pt_factor) or temphack[name] + local amount = quad and f_amount("QUAD",width*ptfactor) or temphack[name] + -- local amount = quad and f_amount("QD",width*ptfactor) or temphack[name] local text = hpack_string(amount,usedfont) local rule = new_rule(emwidth/fraction,2*exheight,(zero and 4.25 or 2.75)*exheight) local list = getlist(text) @@ -1377,7 +1389,7 @@ local ruledkern do local cache = vertical and v_cache or h_cache local info = cache[kern] if not info then - local amount = formatters["%s:%0.3f"](vertical and "VK" or "HK",kern*pt_factor) + local amount = formatters["%s:%0.3f"](vertical and "VK" or "HK",kern*ptfactor) if kern > 0 then info = sometext(amount,l_kern,"trace:b") elseif kern < 0 then @@ -1399,12 +1411,12 @@ end local ruledstrut do - local strut_size = 65536 * 8 / 10 - local strut_code = nodes.rulecodes.strut - local math_code = nodes.nodecodes.math + local strut_size = 65536 * 8 / 10 + local strut_code = nodes.rulecodes.strut + local math_code = nodes.nodecodes.math local traverseid = nuts.traverseid local rangedimensions = nuts.rangedimensions - local a_mathaxis = attributes.private("mathaxis") + local a_mathaxis = attributes.private("mathaxis") ruledstrut = function(head,current,parent) if getwidth(current) == 0 then @@ -1462,7 +1474,7 @@ local ruleditalic do local kern = getkern(current) local info = i_cache[kern] if not info then - local amount = formatters["%s:%0.3f"]("IC",kern*pt_factor) + local amount = formatters["%s:%0.3f"]("IC",kern*ptfactor) if kern > 0 then info = sometext(amount,l_kern,"trace:b") elseif kern < 0 then @@ -1490,7 +1502,7 @@ local ruledmarginkern do local cache = left and l_cache or r_cache local info = cache[kern] if not info then - local amount = formatters["%s:%0.3f"](left and "ML" or "MR",kern*pt_factor) + local amount = formatters["%s:%0.3f"](left and "ML" or "MR",kern*ptfactor) if kern > 0 then info = sometext(amount,l_marginkern,"trace:b") elseif kern < 0 then @@ -1517,7 +1529,7 @@ local ruledmathkern do local cache = vertical and v_cache or h_cache local info = cache[kern] if not info then - local amount = formatters["%s:%0.3f"](vertical and "MV" or "MH",kern*pt_factor) + local amount = formatters["%s:%0.3f"](vertical and "MV" or "MH",kern*ptfactor) if kern > 0 then info = sometext(amount,l_mathkern,"trace:b") elseif kern < 0 then @@ -1558,27 +1570,58 @@ end local ruledpenalty do - local p_cache_v = caches["vpenalty"] - local p_cache_h = caches["hpenalty"] - local p_cache_m = caches["mpenalty"] + local cachehash = { + ["MP=%s"] = caches["MP=%s"], + ["MP>%s"] = caches["MP>%s"], + ["MP<%s"] = caches["MP<%s"], + ["MP:%s"] = caches["MP:%s"], + ["VP:%s"] = caches["VP:%s"], + ["HP:%s"] = caches["HP:%s"], + } local raisepenalties = false ----- getpenalty = nuts.getpenalty - local pre_penalty_code = nodes.penaltycodes.mathprepenalty - local post_penalty_code = nodes.penaltycodes.mathpostpenalty + local pre_penalty_code = nodes.penaltycodes.mathprepenalty + local post_penalty_code = nodes.penaltycodes.mathpostpenalty directives.register("visualizers.raisepenalties",function(v) raisepenalties = v end) + local getoptions = nuts.getoptions + + local mathforward = tex.penaltyoptioncodes.mathforward + local mathbackward = tex.penaltyoptioncodes.mathbackward + ruledpenalty = function(head,current,vertical,subtype) local penalty = getpenalty(current) local ismath = subtype == pre_penalty_code or subtype == post_penalty_code or subtype == true - local cache = (ismath and p_cache_m) or (vertical and p_cache_v) or p_cache_h - local info = cache[penalty] + local amount + if ismath then + local options = getoptions(current) + local forward = (options & mathforward) ~= 0 + local backward = (options & mathbackward) ~= 0 + if forward then + if backward then + amount = "MP=%s" + else + amount = "MP>%s" + end + elseif backward then + amount = "MP<%s" + else + amount = "MP:%s" + end + elseif vertical then + amount = "VP:%s" + else + amount = "HP:%s" + end + local cache = cachehash[amount] + local info = cache[penalty] if info then -- print("penalty hit") else - local amount = formatters["%s:%s"]((ismath and "MP") or (vertical and "VP") or "HP",penalty) + amount = formatters[amount](penalty) if ismath then info = sometext(amount,l_penalty,"trace:s") elseif penalty > 0 then @@ -1607,32 +1650,43 @@ end local ruledmath do local mathcodes = nodes.mathcodes - local m_cache = { - beginmath = caches["bmath"], - endmath = caches["emath"], - } local tags = { - beginmath = "B", - endmath = "E", + [true] = { + math = { "SM:?", caches["SM:?"] }, + beginmath = { "SM:B", caches["SM:B"] }, + endmath = { "SM:E", caches["SM:E"] }, + }, + [false] = { + math = { "M:?", caches["M:?"] }, + beginmath = { "M:B", caches["M:B"] }, + endmath = { "M:E", caches["M:E"] }, + }, } + local getoptions = nuts.getoptions + local shortmath = tex.mathoptioncodes.short + ruledmath = function(head,current) - local what = getsubtype(current) - local tag = mathcodes[what] - local skip = getkern(current) + getwidth(current) -- surround - local info = m_cache[tag][skip] + local what = getsubtype(current) + local mtag = mathcodes[what] + local skip = getkern(current) + getwidth(current) -- surround + local short = (getoptions(current) & shortmath) ~= 0 + local htag = tags[short][mtag or "math"] or tags[false].math + local ttag = htag[1] + local cache = htag[2] + local info = cache[skip] if info then -- print("hit math") else - local text, width = sometext(formatters["M:%s"](tag and tags[tag] or what),usedfont,nil,"trace:dr") + local text, width = sometext(ttag,usedfont,nil,"trace:dr") local rule = new_rule(skip,-655360/fraction,2*655360/fraction) - local dist = tag == "beginmath" and width or skip + local dist = mtag == "beginmath" and width or skip setcolor(rule,"trace:dr") settransparency(rule,"trace:dr") setattr(rule,a_layer,l_math) info = new_hlist(setlink(new_glue(-skip),rule,new_glue(-dist),text)) setattr(info,a_layer,l_math) - m_cache[tag][skip] = info + cache[skip] = info end local saved = current head, current = insertnodeafter(head,current,copylist(info)) @@ -1647,52 +1701,56 @@ end do local nodecodes = nodes.nodecodes - local disc_code = nodecodes.disc - local kern_code = nodecodes.kern - local glyph_code = nodecodes.glyph - local glue_code = nodecodes.glue - local penalty_code = nodecodes.penalty - local whatsit_code = nodecodes.whatsit - local user_code = nodecodes.user - local math_code = nodecodes.math - local hlist_code = nodecodes.hlist - local vlist_code = nodecodes.vlist - local dir_code = nodecodes.dir - local par_code = nodecodes.par - local mark_code = nodecodes.mark - local insert_code = nodecodes.insert - local rule_code = nodecodes.rule - local boundary_code = nodecodes.boundary + local disc_code = nodecodes.disc + local kern_code = nodecodes.kern + local glyph_code = nodecodes.glyph + local glue_code = nodecodes.glue + local penalty_code = nodecodes.penalty + local whatsit_code = nodecodes.whatsit + local user_code = nodecodes.user + local math_code = nodecodes.math + local hlist_code = nodecodes.hlist + local vlist_code = nodecodes.vlist + local dir_code = nodecodes.dir + local par_code = nodecodes.par + local mark_code = nodecodes.mark + local insert_code = nodecodes.insert + local rule_code = nodecodes.rule + local boundary_code = nodecodes.boundary local kerncodes = nodes.kerncodes - local fontkern_code = kerncodes.fontkern - local italickern_code = kerncodes.italiccorrection - local leftmarginkern_code = kerncodes.leftmarginkern - local rightmarginkern_code = kerncodes.rightmarginkern - local mathshapekern_code = kerncodes.mathshapekern - local horizontalmathkern_code = kerncodes.horizontalmathkern - local verticalmathkern_code = kerncodes.verticalmathkern - ----- userkern_code = kerncodes.userkern - - local skipcodes = nodes.skipcodes - local spaceskip_code = skipcodes.spaceskip - local xspaceskip_code = skipcodes.xspaceskip - local zerospaceskip_code = skipcodes.zerospaceskip - local intermathskip_code = skipcodes.intermathskip - - local listcodes = nodes.listcodes - local linelist_code = listcodes.line - local rowlist_code = listcodes.alignment - - local vtop_package_state = 3 -- todo: symbolic - local dbox_package_state = 4 -- todo: symbolic + local fontkern_code = kerncodes.fontkern + local italickern_code = kerncodes.italiccorrection + local spacefontkern_code = kerncodes.spacefontkern + local leftkern_code = kerncodes.leftcorrectionkern + local rightkern_code = kerncodes.rightcorrectionkern + local leftmarginkern_code = kerncodes.leftmarginkern + local rightmarginkern_code = kerncodes.rightmarginkern + local mathshapekern_code = kerncodes.mathshapekern + local horizontalmathkern_code = kerncodes.horizontalmathkern + local verticalmathkern_code = kerncodes.verticalmathkern + local leftmathslackkern_code = kerncodes.leftmathslackkern + local rightmathslackkern_code = kerncodes.rightmathslackkern + ----- userkern_code = kerncodes.userkern + + -- local skipcodes = nodes.skipcodes + local spaceskip_code = nodes.skipcodes.spaceskip + local xspaceskip_code = nodes.skipcodes.xspaceskip + local zerospaceskip_code = nodes.skipcodes.zerospaceskip + local intermathskip_code = nodes.skipcodes.intermathskip + + -- local listcodes = nodes.listcodes + local linelist_code = nodes.listcodes.line + local rowlist_code = nodes.listcodes.alignment + + -- local vtop_package_state = 3 -- todo: symbolic + -- local dbox_package_state = 4 -- todo: symbolic local getleader = nuts.getleader local getdisc = nuts.getdisc local setleader = nuts.setleader local setdisc = nuts.setdisc - local hpack = nuts.hpack -- local cache @@ -1732,6 +1790,15 @@ do local prev_trace_italic = nil local prev_trace_expansion = nil + -- too many locals so: + + local vglue_code = filters.vglue + local hglue_code = filters.hglue + local vkern_code = filters.vkern + local hkern_code = filters.hkern + local vpenalty_code = filters.vpenalty + local hpenalty_code = filters.hpenalty + while current do local id = getid(current) local a = forced or getattr(current,a_visual) or unsetvalue @@ -1839,10 +1906,7 @@ do elseif id == glue_code then goto glue elseif id == penalty_code then - if trace_penalty then - subtype = getsubtype(current) - head, current = ruledpenalty(head,current,vertical,subtype) - end + goto penalty elseif id == hlist_code or id == vlist_code then goto list elseif id == rule_code then @@ -1861,6 +1925,8 @@ do local saved = current if trace_math then head, current = ruledmath(head,current) + elseif trace_penalty then + head, current = ruledpenalty(head,current,false,true) end elseif id == dir_code then if trace_dir then @@ -1884,12 +1950,40 @@ do end end goto next - ::glue:: + ::penalty:: + if trace_penalty then + local f = getattr(current,a_filter) + if f then + if vertical then + if (f & hpenalty_code) == hpenalty_code then + goto next + end + else + if (f & vpenalty_code) == vpenalty_code then + goto next + end + end + end + subtype = getsubtype(current) + head, current = ruledpenalty(head,current,vertical,subtype) + end + ::glue:: content = getleader(current) if content then - -- setleader(current,hpack(visualize(content,false,nil,parent))) setleader(current,visualize(content,false,nil,parent)) elseif trace_glue then + local f = getattr(current,a_filter) + if f then + if vertical then + if (f & hglue_code) == hglue_code then + goto next + end + else + if (f & vglue_code) == vglue_code then + goto next + end + end + end head, current = ruledglue(head,current,vertical,parent) else subtype = getsubtype(current) @@ -1904,16 +1998,16 @@ do end end goto next - ::kern:: + ::kern:: subtype = getsubtype(current) - if subtype == fontkern_code then + if subtype == fontkern_code or subtype == spacefontkern_code then if trace_fontkern or prev_trace_fontkern then head, current = fontkern(head,current) end if trace_expansion or prev_trace_expansion then head, current = kernexpansion(head,current) end - elseif subtype == italickern_code then + elseif subtype == italickern_code or subtype == leftkern_code or subtype == rightkern_code then if trace_italic or prev_trace_italic then head, current = italickern(head,current) elseif trace_kern then @@ -1929,7 +2023,7 @@ do if trace_mathkern or trace_kern then head, current = ruledmathkern(head,current,true) end - elseif subtype == horizontalmathkern_code then + elseif subtype == horizontalmathkern_code or subtype == leftmathslackkern_code or subtype == rightmathslackkern_code then if trace_mathkern then head, current = mathkern(head,current) elseif trace_kern then @@ -1943,11 +2037,23 @@ do end else if trace_kern then + local f = getattr(current,a_filter) + if f then + if vertical then + if (f & hkern_code) == hkern_code then + goto next + end + else + if (f & vkern_code) == vkern_code then + goto next + end + end + end head, current = ruledkern(head,current,vertical) end end goto next - ::list:: + ::list:: if id == hlist_code then local content = getlist(current) if content then @@ -1964,8 +2070,8 @@ do elseif id == vlist_code then local content = getlist(current) local state = getstate(current) - local isvtop = state == vtop_package_state - local isdbox = state == dbox_package_state + local isvtop = state == 3 -- vtop_package_state + local isdbox = state == 4 -- dbox_package_state local tag = nil local layer = nil if content then @@ -1995,7 +2101,7 @@ do head, current = ruledbox(head,current,true,layer,tag,trace_simple,previous,trace_origin,parent) end end - ::next:: + ::next:: previous = current current = getnext(current) end @@ -2045,8 +2151,8 @@ end do local nodecodes = nodes.nodecodes - local hlist_code = nodecodes.hlist - local vlist_code = nodecodes.vlist + local hlist_code = nodecodes.hlist + local vlist_code = nodecodes.vlist local nextnode = nuts.traversers.node local last = nil @@ -2137,11 +2243,14 @@ end do - local function make(str,forecolor,rulecolor,layer) - if initialize then - initialize() + local function make(str,forecolor,rulecolor,layer,delta,extra) + -- if initialize then + -- initialize() + -- end + if not usedfont then + getusedfont() end - local rule = new_rule(emwidth/fraction,exheight,4*exheight) + local rule = new_rule(emwidth/fraction,exheight,(4+delta)*exheight) setcolor(rule,rulecolor) settransparency(rule,rulecolor) local info @@ -2152,34 +2261,52 @@ do local list = getlist(text) setlistcolor(list,textcolor) setlisttransparency(list,textcolor) - setshift(text,3.5 * exheight) - info = new_hlist(setlink(rule,text)) + setshift(text,(3.5+delta)*exheight) + if extra then + setwidth(text) + extra = hpack_string(extra,usedfont) + local list = getlist(text) + setlistcolor(extra,textcolor) + setlisttransparency(extra,textcolor) + setshift(extra,(3.5)*exheight) + end + info = new_hlist(setlink(rule,text,extra)) end setattr(info,a_layer,layer) return info end - function visualizers.register(name,textcolor,rulecolor) + function visualizers.register(name,textcolor,rulecolor,shift,nocache) if rawget(layers,name) then -- message return end + + visualizers.definelayer(name,true) + local cache = caches[name] local layer = layers[name] + if not textcolor then textcolor = "trace:ds" end if not rulecolor then rulecolor = "trace:do" end - return function(str) + local delta = shift or 0 + return function(str,extra) if not str then str = "" end - local info = cache[str] - if not info then - info = make(str,textcolor,rulecolor,layer) - cache[str] = info + local info + if nocache then + info = make(str,textcolor,rulecolor,layer,delta,extra) + else + info = cache[str] + if not info then + info = make(str,textcolor,rulecolor,layer,delta,extra) + cache[str] = info + end end return copy_node(info) end diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl index ec51ad4b059..737fb4b87d7 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl @@ -30,6 +30,12 @@ %D %D In due time some special visualzation of math will move here as well. +% special case: +% +% \disabledirectives[backend.cleanup.flatten] +% \bitwiseflip \normalizelinemode -\flattendiscretionariesnormalizecode +% \showmakeup[discretionary] + \writestatus{loading}{ConTeXt Tracing Macros / Visualization} \unprotect @@ -95,7 +101,7 @@ \global\t_syst_visualizers_optimize\emptytoks \to \t_syst_visualizers_optimize -\def\syst_visualizers_speedup{\the\t_syst_visualizers_optimize} +\def\syst_visualizers_speedup{\expand\t_syst_visualizers_optimize} % \appendtoks % \enforced\global\protected\edef\ruledhbox {\syst_visualizers_hbox attr \visualattribute \number\clf_getvisual{simplehbox} } @@ -126,7 +132,7 @@ \permanent\tolerant\protected\def\setvisualizerfont[#1]% somename at 4pt {\begingroup - \iftok{#1}\emptytoks + \ifempty{#1}% \definedfont[Mono at 4pt]% \else \definedfont[#1]% @@ -213,12 +219,12 @@ \permanent\protected\def\dontinterfere {\reseteverypar \parindent\zeropoint - \parskip \zeropoint - \leftskip \zeropoint - \rightskip\zeropoint + \parskip \zeroskip + \leftskip \zeroskip + \rightskip\zeroskip \relax} -%D We keep these for a while: +%D We kept these for a while: % \aliased\let\ruledhss \hss % \aliased\let\ruledhfil \hfil diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx index 4842451e7e9..19aa6b3b83b 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx @@ -31,7 +31,7 @@ \newconditional\c_font_typescripts_quit \newtoks \c_font_typescripts_document \newconditional\c_font_typescripts_preload -\newconditional\c_font_typescripts_first_pass \settrue\c_font_typescripts_first_pass +\newconditional\c_font_typescripts_first_pass \c_font_typescripts_first_pass\conditionaltrue \newif \iftypescriptfound % will become a mode \newif \iftracetypescripts @@ -152,7 +152,7 @@ \else \font_typescripts_use_display \fi - \setfalse\c_font_typescripts_first_pass + \c_font_typescripts_first_pass\conditionalfalse \pop_macro_stoptypescript \pop_macro_typescriptstate \pop_macro_typescriptmethod @@ -165,12 +165,12 @@ \def\font_typescripts_use_display {\processcommacommand[\typescriptfiles]\font_typescripts_load_file - \the\c_font_typescripts_document} + \expand\c_font_typescripts_document} \let\font_typescripts_use_inline\font_typescripts_use_display \permanent\protected\def\preloadtypescripts - {\ifproductionrun\settrue\c_font_typescripts_preload\fi} + {\ifproductionrun\c_font_typescripts_preload\conditionaltrue\fi} \prependtoks \preloadtypescripts @@ -192,7 +192,7 @@ \stopreadingfile} \permanent\protected\def\quittypescriptscanning - {\settrue\c_font_typescripts_quit} % public + {\c_font_typescripts_quit\conditionaltrue} % public \permanent\protected\def\font_typescripts_start_store#definitions\stoptypescript {\global\advanceby\c_font_typescripts_n_of_preloaded\plusone @@ -209,7 +209,7 @@ {\csname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname}} \def\font_typescripts_load_file#filename% - {\setfalse\c_font_typescripts_quit + {\c_font_typescripts_quit\conditionalfalse \push_macro_currenttypefile \def\currenttypefile{#filename}% \ifconditional\c_font_typescripts_preload @@ -220,7 +220,7 @@ \pop_macro_currenttypefile \ifconditional\c_font_typescripts_quit \quitcommalist - \setfalse\c_font_typescripts_quit + \c_font_typescripts_quit\conditionalfalse \fi} \def\font_typescript_process_typescript_file_and_store @@ -228,7 +228,7 @@ \ifrelax\t_font_typescripts \font_typescript_process_typescript_store_indeed \fi - \the\t_font_typescripts} + \expand\t_font_typescripts} \def\font_typescript_process_typescript_store_indeed {\newtoks\t_font_typescripts % is \relaxed elsewhere @@ -269,7 +269,7 @@ % script [serif] [computer-modern] [special] \prependtoks - \settrue\c_font_typescripts_first_pass + \c_font_typescripts_first_pass\conditionaltrue \to \everyjob \permanent\protected\def\starttypescript @@ -415,26 +415,28 @@ %D This hooks into the font switcher: -\settrue\autotypescripts +\newconditional\autotypescripts \autotypescripts\conditionaltrue \protected\def\fonts_helpers_try_currentfontclass#typeface% {\ifconditional\autotypescripts \usetypescript[#typeface]% \ifcsname\??fontclassyes#typeface\endcsname - \edef\fontclass{#typeface}% + \cdef\fontclass{#typeface}% \else \iftracetypescripts\writestatus\m!fonts{auto load typescript file 1: [#typeface]}\fi \usetypescriptfile[#typeface]% \usetypescript[#typeface]% \ifcsname\??fontclassyes#typeface\endcsname - \edef\fontclass{#typeface}% + \cdef\fontclass{#typeface}% \else % todo: message +% \gletcsname \letcsname\??fontclassnop#typeface\endcsname\empty \fi \fi \else % todo: message +% \gletcsname \letcsname\??fontclassnop#typeface\endcsname\empty \fi} @@ -485,28 +487,33 @@ {\clf_definetypeface{#name}{#specification}} \def\font_typefaces_define_indeed[#name][#style]% saveguard against redefinition - {\doifsomething{#name} - {\ifcsname\??typescriptdefaultstyles#name\endcsname \else - \registerfontclass{#name}% - \gdefcsname\??typescriptdefaultstyles#name\endcsname{#style}% - \fi - \ifcsname#name\endcsname \else - \protected\frozen\instance\gdefcsname#name\endcsname{\switchtotypeface[#name][#style]}% - \fi}} + {\ifempty{#name}\else + \ifcsname\??typescriptdefaultstyles#name\endcsname \else + \registerfontclass{#name}% + \gdefcsname\??typescriptdefaultstyles#name\endcsname{#style}% + \fi + \ifcsname#name\endcsname \else + \protected\frozen\instance\gdefcsname#name\endcsname{\switchtotypeface[#name][#style]}% + \fi + \fi} + +\lettonothing\m_ts_features +\lettonothing\m_ts_fallbacks +\lettonothing\m_ts_goodies +\lettonothing\m_ts_designsize \def\font_typefaces_defining_start#name#style#settings% - {\let\m_ts_rscale \!!plusone % as we push/pop + {\let\m_ts_rscale\!!plusone % as we push/pop \lettonothing\m_ts_features \lettonothing\m_ts_fallbacks \lettonothing\m_ts_goodies - \lettonothing\m_ts_direction \lettonothing\m_ts_designsize \geteparameters[m_ts_][#settings]% todo raw ... no need for key interpretation \push_macro_fontclass \push_macro_fontclassstyle \setcurrentfontclass{#name}% - \savefontclassparameters{#style}\m_ts_rscale\m_ts_features\m_ts_fallbacks\m_ts_goodies\m_ts_designsize\m_ts_direction - \the\everybeforedefinetypeface} + \savefontclassparameters{#style}\m_ts_rscale\m_ts_features\m_ts_fallbacks\m_ts_goodies\m_ts_designsize + \expand\everybeforedefinetypeface} \permanent\def\tsvar#key#default% undocumented and unofficial {\expandafter\ifempty\csname\??ts#key\endcsname @@ -516,7 +523,7 @@ \fi} \def\font_typefaces_defining_stop - {\the\everyafterdefinetypeface + {\expand\everyafterdefinetypeface \pop_macro_fontclassstyle \pop_macro_fontclass} @@ -574,7 +581,7 @@ %D \stoptyping \permanent\tolerant\protected\def\inherittypeface[#name]#spacer[#styles]#spacer[#parentclass]% - {\iftok{#styles}\emptytoks + {\ifempty{#styles}% \inherittypeface[#name][\s!rm,\s!ss,\s!tt,\s!mm][\fontclass]% \orelse\iftok{#name}{#parentclass}\else \glet\font_typescripts_inherit_check\font_typescripts_inherit_check_indeed diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl index ae1c85ee97d..f35712ea539 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl @@ -109,6 +109,7 @@ \definefilesynonym [type-imp-pagella-with-euler.mkiv] [type-imp-euler.mkxl] \definefilesynonym [type-imp-euleroverpagella.mkiv] [type-imp-euler.mkxl] \definefilesynonym [type-imp-pagellaovereuler.mkiv] [type-imp-euler.mkxl] +\definefilesynonym [type-imp-euler.mkiv] [type-imp-euler.mkxl] %definefilesynonym [type-imp-mdbch.mkiv] [type-imp-mathdesign.mkiv] %definefilesynonym [type-imp-mdugm.mkiv] [type-imp-mathdesign.mkiv] @@ -167,6 +168,7 @@ \definefilesynonym [type-imp-kpfonts-nt.mkiv] [type-imp-kpfonts.mkiv] \definefilesynonym [type-imp-concrete-nt.mkiv] [type-imp-concrete.mkiv] \definefilesynonym [type-imp-xcharter-nt.mkiv] [type-imp-xcharter.mkiv] +\definefilesynonym [type-imp-gfsneohellenic-nt.mkiv] [type-imp-gfsneohellenic.mkiv] \definefilesynonym [type-imp-antykwa-poltawskiego.mkiv] [type-imp-antykwapoltawskiego.mkiv] @@ -178,6 +180,7 @@ \definefilesynonym [type-imp-kurier-medium.mkiv] [type-imp-kurier.mkiv] \definefilesynonym [type-imp-kurier-heavy.mkiv] [type-imp-kurier.mkiv] +\definefilesynonym [type-imp-antykwa-torunska.mkiv] [type-imp-antykwa.mkiv] \definefilesynonym [type-imp-antykwa-light.mkiv] [type-imp-antykwa.mkiv] \definefilesynonym [type-imp-antykwa-cond.mkiv] [type-imp-antykwa.mkiv] \definefilesynonym [type-imp-antykwa-light-cond.mkiv] [type-imp-antykwa.mkiv] diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt index 09947938350..e7ece6ecffa 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt @@ -13,18 +13,20 @@ local setmacro = tokens.setters.macro local expandmacro = token.expandmacro local nuts = nodes.nuts +local tonut = nodes.tonut local getid = nuts.getid local getlist = nuts.getlist local getwhd = nuts.getwhd local getattr = nuts.getattr local getwidth = nuts.getwidth +local getleader = nuts.getleader local setlist = nuts.setlist local setlink = nuts.setlink local setstate = nuts.setstate local setattr = nuts.setattr -local hlist_code = nodes.nodecodes.hlist -local vlist_code = nodes.nodecodes.vlist +local hlist_code = nodes.nodecodes.hlist +local vlist_code = nodes.nodecodes.vlist local getbox = nuts.getbox local takebox = nuts.takebox @@ -35,7 +37,7 @@ local flattenleaders = nuts.flattenleaders local traverselist = nuts.traverselist local traverseleader = nuts.traverseleader -local a_adaptive = attributes.private("adaptive") +local a_adaptive = attributes.private("adaptive") local registervalue = attributes.registervalue local getvalue = attributes.getvalue @@ -46,21 +48,12 @@ local adaptive = nodes.adaptive or { } nodes.adaptive = adaptive local enabled = false -local enableaction = nodes.tasks.enableaction +----- enableaction = nodes.tasks.enableaction -local d_adaptive_width = isdimen("d_adaptive_width") -local d_adaptive_height = isdimen("d_adaptive_height") -local d_adaptive_depth = isdimen("d_adaptive_depth") -local d_adaptive_line = isdimen("d_adaptive_line") - -function adaptive.set(settings) - if not enabled then - enableaction("vboxbuilders","nodes.adaptive.handlehorizontal") - enableaction("vboxhandlers","nodes.adaptive.handlevertical") - enabled = true - end - texsetattribute(a_adaptive,registervalue(a_adaptive,settings)) -end +local d_adaptive_width = isdimen("d_adaptive_width") +local d_adaptive_height = isdimen("d_adaptive_height") +local d_adaptive_depth = isdimen("d_adaptive_depth") +local d_adaptive_line = isdimen("d_adaptive_line") local function setadaptive(w,h,d,l,c,a) setdimen(d_adaptive_width,w) @@ -87,10 +80,55 @@ local methods = { end } +local function handleuleader(n,grp,index) + local m = tonut(n) + local a = getattr(m,a_adaptive) or index -- index will become a selector + if a then + local settings = getvalue(a_adaptive,a) -- index triggers ... + if settings then + setstate(m,0) + local action = methods[settings.method or 1] + if action then + action(settings,m,getlist(m)) + end + end + end + return n +end + +-- callback.register("handle_uleader", handleuleader) -- will be frozen + +function adaptive.set(settings) + if not enabled then + -- enableaction("vboxbuilders","nodes.adaptive.handlehorizontal") + -- enableaction("vboxhandlers","nodes.adaptive.handlevertical") + callback.register("handle_uleader", handleuleader) -- will be frozen + enabled = true + end + texsetattribute(a_adaptive,registervalue(a_adaptive,settings)) +end + +interfaces.implement { + name = "setadaptive", + actions = adaptive.set, + arguments = { + { + { "setups", "string" }, + { "method", "integer" }, + { "mp", "string" }, + { "color", "string" }, + { "rulethickness", "dimension" }, + { "alternative", "string" }, + } + } +} + -- The hlist leaders get done before we enter vpacking, so that is where the -- first call kicks in. Then we do a vpack (so one can indeed also adapt the -- ht/dp). After packing we know the glue and do the vlist leaders. +-- This is now done via a callback but it is still experimental! + local function handlehorizontal(n) if hasvalues(a_adaptive) then for _, t, _, l in traverselist(n) do @@ -117,7 +155,7 @@ end local function handlevertical(n) if hasvalues(a_adaptive) then -- not a list just a node - for nn, t, _, l in traverselist(n) do + for _, t, _, l in traverselist(n) do if t == vlist_code then for m, _, _, ll in traverseleader(l) do local a = getattr(m,a_adaptive) @@ -141,21 +179,6 @@ end adaptive.handlehorizontal = handlehorizontal adaptive.handlevertical = handlevertical -interfaces.implement { - name = "setadaptive", - actions = adaptive.set, - arguments = { - { - { "setups", "string" }, - { "method", "integer" }, - { "mp", "string" }, - { "color", "string" }, - { "rulethickness", "dimension" }, - { "alternative", "string" }, - } - } -} - interfaces.implement { name = "adaptivecheckbox", arguments = "integer", diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl index d6eae424922..312c648bdc4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl @@ -73,14 +73,14 @@ \aliased\let\adaptivebox\adaptivehbox -\tolerant\def\typo_adaptive_box#1#*[#2]#*[#3]% +\tolerant\def\typo_adaptive_box#1#*[#S#2]#*[#S#3]% {\ifcase#1\dontleavehmode\fi \begingroup \ifhastok={#2}% \lettonothing\currentadaptive \setupcurrentadaptive[#2]% \else - \edef\currentadaptive{#2}% + \cdef\currentadaptive{#2}% \setupcurrentadaptive[#3]% \fi \edef\p_setups{\adaptiveparameter\c!setups}% @@ -108,6 +108,7 @@ \edef\p_stretch{\adaptiveparameter\c!stretch}% \edef\p_shrink {\adaptiveparameter\c!shrink}% \uleaders + \s!callback \numexpr \adaptiveattribute \relax \ifcase#1% \hbox \s!spread \scratchdimen @@ -129,6 +130,16 @@ \endgroup}% \ifcase#1\hbox\else\vbox\fi} +%D \startbuffer +%D y\adaptive\hbox to5cm{x\rightarrowfill x}y\par +%D y\adaptive\hbox to5cm{x\leftarrowfill x}y\par +%D \stopbuffer +%D +%D \typebuffer \startlinecorrection\getbuffer\stoplinecorrection + +\permanent\protected\def\adaptive + {\dowithnextbox{\adaptivecheckbox\nextbox\box\nextbox}} + %D Here is a test case, expect more: %D %D \starttyping @@ -194,6 +205,14 @@ %D \egroup %D \stopsetups %D +%D \startsetups adaptive:test +%D \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset .25ex \bgroup +%D \startMPcode +%D drawarrow ((0,0) -- (\the\usedadaptivewidth,0)) randomized (ExHeight/2); +%D \stopMPcode +%D \egroup +%D \stopsetups +%D %D \dorecurse{5}{ %D \dostepwiserecurse{1}{150}{1}{% %D this~#1.##1 is~#1.##1 test~#1.##1 diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt index d902187e3d4..1477aacd0ef 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt @@ -7,9 +7,8 @@ if not modules then modules = { } end modules ['typo-adj'] = { license = "see context related readme files" } -local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local penalty_code = nodecodes.penalty +local hlist_code = nodes.nodecodes.hlist +local penalty_code = nodes.nodecodes.penalty local nuts = nodes.nuts local getprev = nuts.getprev @@ -40,7 +39,7 @@ end local function block_baselineskip(head,tail) -- tex.prevdepth = -1000 * 65536 -- ignoredepth - tex.prevdepth = texgetdimen("ignoredepthcriterium") + tex.prevdepth = texgetdimen("ignoredepthcriterion") -- todo: c_... return head end diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl index bf754cdbf8c..d1b0596316e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl @@ -51,7 +51,6 @@ \tolerant\def\typo_adjusters_blank#1[#2]% no need for speed {\begingroup - % \setbox\scratchbox\vbox{\iftok{#2}\emptytoks\blank\else\blank[#2]\fi}% \setbox\scratchbox\vbox{\blank[#2]}% \vadjust #1 index \plustwo {\vskip\htdp\scratchbox}% \endgroup} diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt index c0b42001e66..0a1ccbb60b3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt @@ -34,10 +34,11 @@ local numbers = constructors.numbers constructors.methods = constructors.methods or { } local methods = constructors.methods -local a_parbuilder = attributes.numbers['parbuilder'] or 999 -- why 999 +local a_parbuilder = attributes.numbers['parbuilder'] or 999 -- why 999 constructors.attribute = a_parbuilder -local unsetvalue = attributes.unsetvalue +local unsetvalue = attributes.unsetvalue + local texsetattribute = tex.setattribute local texnest = tex.nest local texget = tex.get @@ -334,12 +335,22 @@ local show = false trackers.register("builders.hpack.overflow",function(v) s function hpackbuilders.report(how,detail,n,first,last,filename) -- no return value local str = (report or collect) and listtoutf(getlist(n),"",true,nil,true) if report then + local overfull = how == "overfull" if last <= 0 then - report_quality("%s hbox: %s (%p)",how,str,detail) + report_quality( + overfull and "%s hbox: %s (%p)" or "%s hbox: %s (badness %i)", + how,str,detail + ) elseif first > 0 and first < last then - report_quality("%s hbox at line %i - %i in file %a: %s (%p)",how,first,last,filename or "?",str,detail) + report_quality( + overfull and "%s hbox at line %i - %i in file %a: %s (%p)" or "%s hbox at line %i - %i in file %a: %s (badness %i)", + how,first,last,filename or "?",str,detail + ) else - report_quality("%s hbox at line %i in file %a: %s (%p)",how,last,filename or "?",str,detail) + report_quality( + overfull and "%s hbox at line %i in file %a: %s (%p)" or "%s hbox at line %i in file %a: %s (badness %i)", + how,last,filename or "?",str,detail + ) end end if collect then @@ -411,9 +422,6 @@ end registercallback("hpack_quality", hpackbuilders.qualityactions, "report horizontal packing quality") registercallback("vpack_quality", vpackbuilders.qualityactions, "report vertical packing quality") - --- - statistics.register("quality reports", function() local n = #list if n > 0 then @@ -433,8 +441,14 @@ statistics.register("quality reports", function() end logs.startfilelogging(report_quality) for i=1,n do - local l = list[i] - report_quality("%-" .. fw .. "s [%04i - %04i] : %-" .. hw .. "s %s : %s (%p)",file.basename(l[3]),l[4],l[5],l[2],l[1],l[6],l[7]) + local l = list[i] + local how = l[2] + report_quality( + how == "overfull" + and "%-" .. fw .. "s [%04i - %04i] : %-" .. hw .. "s %s : %s (%p)" + or "%-" .. fw .. "s [%04i - %04i] : %-" .. hw .. "s %s : %s (badness %i)", + file.basename(l[3]),l[4],l[5],how,l[1],l[6],l[7] + ) end logs.stopfilelogging() report_quality() diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt index 3a7b69db9bc..9d554eecade 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt @@ -58,13 +58,14 @@ local unsetattributes = nuts.unsetattributes local tonodes = nuts.tonodes local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue + +local unsetvalue = attributes.unsetvalue local nodepool = nuts.pool local enableaction = nodes.tasks.enableaction -local v_reset = interfaces.variables.reset -local v_yes = interfaces.variables.yes +local v_reset = interfaces.variables.reset +local v_yes = interfaces.variables.yes local implement = interfaces.implement @@ -76,11 +77,11 @@ local new_wordboundary = nodepool.wordboundary local nodecodes = nodes.nodecodes local kerncodes = nodes.kerncodes -local kern_code = nodecodes.kern -local math_code = nodecodes.math +local kern_code = nodecodes.kern +local math_code = nodecodes.math -local fontkern_code = kerncodes.fontkern -local italickern_code = kerncodes.italiccorrection +local fontkern_code = kerncodes.fontkern +local italickern_code = kerncodes.italiccorrection local is_letter = characters.is_letter @@ -95,7 +96,7 @@ breakpoints.numbers = breakpoints.numbers or { } breakpoints.methods = breakpoints.methods or { } local methods = breakpoints.methods -local a_breakpoints = attributes.private("breakpoint") +local a_breakpoints = attributes.private("breakpoint") storage.register("typesetters/breakpoints/mapping", breakpoints.mapping, "typesetters.breakpoints.mapping") @@ -406,7 +407,7 @@ local enabled = false function breakpoints.define(name) local data = numbers[name] if data then - -- error + report_breakpoints("there is already a breakpoints class %a",name) else local number = #mapping + 1 local data = { @@ -439,6 +440,8 @@ function breakpoints.setreplacement(name,char,language,settings) middle = middle ~= "" and middle or nil, skip = settings.range == v_yes, } -- was { type or 1, before or 1, after or 1 } + else + report_breakpoints("there is no breakpoints class %a",name) end end diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl index 0988e3a6b75..108d1238442 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl @@ -27,10 +27,18 @@ % see below: \exhyphenchar \minusone % we use a different order than base tex, so we really need this +% \definebreakpoints [test] +% +% \definebreakpoint [test][:][nleft=3,nright=3,type=1] +% \definebreakpoint [test][/][nleft=3,nright=3,type=1] +% +% {\setbreakpoints[test]\hsize1mm\nohyphens x boundary:boundary/boundary\par} +% {\setbreakpoints[test]\hsize1mm x boundary:boundary/boundary\par} % still hyphenated + \permanent\tolerant\protected\def\definebreakpoints[#1]% {\clf_definebreakpoints{#1}} % todo: public implementor -\permanent\tolerant\protected\def\definebreakpoint[#1]#*[#2]#*[#3]% name char settings +\permanent\tolerant\protected\def\definebreakpoint[#1]#*[#2]#*[#S#3]% name char settings {\begingroup \getdummyparameters [\c!type=\plusone,\c!nleft=\plusthree,\c!nright=\plusthree,% @@ -82,7 +90,7 @@ % \stop % \mainlanguage[czech] -% \definebreakpoint [compound] [\number`-] [language=cs,nleft=3,nright=3,type=4] +% \definebreakpoint [compound] [-] [language=cs,nleft=3,nright=3,type=4] % \setbreakpoints[compound] % \start \hsize 1mm test-test \par \stop diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt index c0e19757647..c069ca58f6f 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt @@ -45,12 +45,12 @@ local nextglyph = nuts.traversers.glyph local nodecodes = nodes.nodecodes local kerncodes = nodes.kerncodes -local glyph_code = nodecodes.glyph -local kern_code = nodecodes.kern -local disc_code = nodecodes.disc -local math_code = nodecodes.math +local glyph_code = nodecodes.glyph +local kern_code = nodecodes.kern +local disc_code = nodecodes.disc +local math_code = nodecodes.math -local fontkern_code = kerncodes.fontkern +local fontkern_code = kerncodes.fontkern local enableaction = nodes.tasks.enableaction @@ -63,11 +63,14 @@ local fontchar = fonthashes.characters local currentfont = font.current local variables = interfaces.variables -local v_reset = variables.reset +local v_reset = variables.reset local texsetattribute = tex.setattribute +local texgetattribute = tex.getattribute local texgetscales = tex.getglyphscales +local integer_value = tokens.values.integer + typesetters = typesetters or { } local typesetters = typesetters @@ -76,23 +79,30 @@ local cases = typesetters.cases cases.actions = { } local actions = cases.actions -local a_cases = attributes.private("case") + +local a_cases = attributes.private("case") local run = 0 -- a trick to make neighbouring ranges work local registervalue = attributes.registervalue local getvalue = attributes.getvalue -local texsetattribute = tex.setattribute -local function set(tag,font) +local function set(tag,font,category,xscale,yscale) run = run + 1 + local scales = { texgetscales() } local settings = { - font = font, - tag = tag, - run = run, -- still needed ? - -- blocked = false - scales = { texgetscales() }, + font = font, + tag = tag, + run = run, -- still needed ? + category = category or 0, + scales = scales, } + if xscale and xscale ~= 1000 then + scales[2] = scales[2] * xscale / 1000 + end + if yscale and yscale ~= 1000 then + scales[3] = scales[3] * yscale / 1000 + end texsetattribute(a_cases,registervalue(a_cases,settings)) end @@ -190,7 +200,7 @@ local function camel(start,data,lastfont,n,count,where,first) return start, true end -local function mixed(start,data,lastfont,n,count,where,first) +local function mixed(start,data,lastfont,n,count,where,first,keep) if where == "post" then return end @@ -208,12 +218,16 @@ local function mixed(start,data,lastfont,n,count,where,first) setscales(used,s[1],s[2],s[3]) end end - else + elseif not keep then replacer(used,uccodes) end return start, true end +local function Camel(start,data,lastfont,n,count,where,first) + return mixed(start,data,lastfont,n,count,where,first,true) +end + local function Capital(start,data,lastfont,n,count,where,first,once) -- 3 local used = first or start if count == 1 and where ~= "post" then @@ -281,6 +295,7 @@ register(variables.none, none) -- 7 (dummy) register(variables.random, randomized) -- 8 register(variables.mixed, mixed) -- 9 register(variables.camel, camel) -- 10 +register(variables.Camel, Camel) -- 11 register(variables.cap, variables.capital) -- clone register(variables.Cap, variables.Capital) -- clone @@ -389,7 +404,7 @@ end local enabled = false -function cases.set(n,id) +local function setcases(n,id,category,xscale,yscale) if n ~= v_reset then n = registered[n] or tonumber(n) if n then @@ -400,21 +415,33 @@ function cases.set(n,id) end enabled = true end - set(n,id or currentfont()) + set(n,id or currentfont(),category,xscale,yscale) return end end texsetattribute(a_cases) end +cases.set = setcases + -- interface interfaces.implement { name = "setcharactercasing", - -- public = true, - -- protected = true, - actions = cases.set, - arguments = { "argument" } + actions = function(name,category,xscale,yscale) + setcases(name,false,category,xscale,yscale) + end, + arguments = { "argument", "integer", "integer", "integer" }, +} + +interfaces.implement { + name = "getcharactercasingcategory", + public = true, + usage = "value", + actions = function() + local v = getvalue(a_cases,texgetattribute(a_cases)) + return integer_value, v and v.category or 0 + end, } -- An example of a special plug, see type-imp-punk for usage. diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl index 0a6867a4365..1a738cbecc0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl @@ -35,14 +35,41 @@ %D Beware, these are not really defines (yet). -\definecapitals[\v!WORD] % all upper -\definecapitals[\v!capital] % one upper + font -\definecapitals[\v!Capital] % some upper + font -\definecapitals[\v!mixed] % UpperCase -\definecapitals[\v!Word] % one upper + font -\definecapitals[\v!Words] % some upper -\definecapitals[\v!camel] % lowers first -\definecapitals[\v!word][\c!style=] % nothing +% 1=upper 2=lower 3=mixed + +\setupcapitals + [\c!category=\zerocount, + \c!xscale=\plusthousand, + \c!yscale=\plusthousand] + +\definecapitals[\v!WORD] [\c!category=\plusone] % all upper +\definecapitals[\v!capital] [\c!category=\plusthree] % one upper + font +\definecapitals[\v!Capital] [\c!category=\plusthree] % some upper + font +\definecapitals[\v!mixed] [\c!category=\plusthree] % UpperCase +\definecapitals[\v!Word] [\c!category=\plusthree] % one upper + font +\definecapitals[\v!Words] [\c!category=\plusthree] % some upper +\definecapitals[\v!camel] [\c!category=\plusthree] % lowers first + +\definecapitals[\v!cap] [\v!capital] % adapts to mathmode +\definecapitals[\v!Cap] [\v!Capital] + +\definecapitals % nothing + [\v!word] + [\c!category=\plustwo, + \c!style=] + +\definecapitals % scale upper + [\v!Camel] + [\c!xscale=900, + \c!yscale=900, + \c!category=\plusthree] + +\permanent\protected\def\resetcharactercasing{\c_attr_case\attributeunsetvalue} + +\definecapitals % nothing + [randomvariant] + [\c!category=\zerocount] + %D \macros %D {Word, Words, WORD, WORDS} @@ -73,24 +100,31 @@ % test \word{test TEST \TeX} test % test \Word{test TEST \TeX} test -\permanent\tolerant\protected\def\setcharactercasing[#1]{\clf_setcharactercasing{#1}} % can be public implementor +\permanent\tolerant\protected\def\setcharactercasing[#1]% + {\clf_setcharactercasing + {#1}% + \numexpr\namedcapitalsparameter{#1}\c!category\relax + \numexpr\namedcapitalsparameter{#1}\c!xscale\relax + \numexpr\namedcapitalsparameter{#1}\c!yscale\relax} -\protected\def\casing[#1]{\groupedcommand{\clf_setcharactercasing{#1}}{}} -\protected\def\nocasing {\groupedcommand{\clf_setcharactercasing {}}{}} +\protected\def\casing[#1]{\groupedcommand{\setcharactercasing[#1]}{}} +\protected\def\nocasing {\groupedcommand{\resetcharactercasing}{}} -\protected\def\typo_capitale_WORD {\clf_setcharactercasing\v!WORD } -\protected\def\typo_capitale_word {\clf_setcharactercasing\v!word } -\protected\def\typo_capitale_Word {\clf_setcharactercasing\v!Word } -\protected\def\typo_capitale_Words{\clf_setcharactercasing\v!Words} -\protected\def\typo_capitale_camel{\clf_setcharactercasing\v!camel} +\protected\def\typo_capital_WORD {\setcharactercasing[\v!WORD ]} +\protected\def\typo_capital_word {\setcharactercasing[\v!word ]} +\protected\def\typo_capital_Word {\setcharactercasing[\v!Word ]} +\protected\def\typo_capital_Words{\setcharactercasing[\v!Words]} +\protected\def\typo_capital_camel{\setcharactercasing[\v!camel]} +\protected\def\typo_capital_Camel{\setcharactercasing[\v!Camel]} \pushoverloadmode -\permanent\protected\def\WORD {\triggergroupedcommandcs\typo_capitale_WORD } -\permanent\protected\def\word {\triggergroupedcommandcs\typo_capitale_word } -\permanent\protected\def\Word {\triggergroupedcommandcs\typo_capitale_Word } -\permanent\protected\def\Words{\triggergroupedcommandcs\typo_capitale_Words} -\permanent\protected\def\camel{\triggergroupedcommandcs\typo_capitale_camel} +\permanent\protected\def\WORD {\triggergroupedcommandcs\typo_capital_WORD } +\permanent\protected\def\word {\triggergroupedcommandcs\typo_capital_word } +\permanent\protected\def\Word {\triggergroupedcommandcs\typo_capital_Word } +\permanent\protected\def\Words{\triggergroupedcommandcs\typo_capital_Words} +\permanent\protected\def\camel{\triggergroupedcommandcs\typo_capital_camel} +\permanent\protected\def\Camel{\triggergroupedcommandcs\typo_capital_Camel} \aliased\let\WORDS\WORD \aliased\let\words\word @@ -149,8 +183,8 @@ \newconditional\c_typo_capitals_pseudo -\permanent\protected\def\usepseudocaps{\settrue \c_typo_capitals_pseudo} -\permanent\protected\def\userealcaps {\setfalse\c_typo_capitals_pseudo} +\permanent\protected\def\usepseudocaps{\c_typo_capitals_pseudo\conditionaltrue} +\permanent\protected\def\userealcaps {\c_typo_capitals_pseudo\conditionalfalse} \usepseudocaps @@ -159,14 +193,14 @@ % here we keep the \groupedcommand \def\typo_capitals_set_fake#1% - {\edef\currentcapitals{#1}% - \clf_setcharactercasing\currentcapitals + {\cdef\currentcapitals{#1}% + \setcharactercasing[\currentcapitals]% \usecapitalsstyleparameter\c!style} -\def\typo_capitals_set_real#1% - {\edef\currentcapitals{#1}% +\def\typo_capitals_set_real#1#2% + {\cdef\currentcapitals{#1}% \sc % \smallcaps - \clf_setcharactercasing\currentcapitals} + \setcharactercasing[\currentcapitals]} \permanent\protected\def\pseudosmallcapped{\triggergroupedcommandcs\font_style_pseudosmallcapped} \permanent\protected\def\pseudoSmallcapped{\triggergroupedcommandcs\font_style_pseudoSmallcapped} @@ -179,16 +213,16 @@ \permanent\protected\def\notsmallcapped {\triggergroupedcommandcs\font_style_notsmallcapped} -\protected\def\font_style_pseudosmallcapped{\typo_capitals_set_fake\v!WORD } % all upper +\protected\def\font_style_pseudosmallcapped{\typo_capitals_set_fake\v!WORD} % all upper \protected\def\font_style_pseudoSmallcapped{\typo_capitals_set_fake\v!capital} % one upper + font \protected\def\font_style_pseudoSmallCapped{\typo_capitals_set_fake\v!Capital} % some upper + font \protected\def\font_style_pseudoMixedCapped{\typo_capitals_set_fake\v!mixed } -\protected\def\font_style_realsmallcapped {\typo_capitals_set_real\v!WORD } % all lower -\protected\def\font_style_realSmallcapped {\typo_capitals_set_real\v!Word } % one upper + font -\protected\def\font_style_realSmallCapped {\typo_capitals_set_real\v!Words } % some upper +\protected\def\font_style_realsmallcapped {\typo_capitals_set_real\v!WORD} % all lower +\protected\def\font_style_realSmallcapped {\typo_capitals_set_real\v!Word} % one upper + font +\protected\def\font_style_realSmallCapped {\typo_capitals_set_real\v!Words} % some upper -\protected\def\font_style_notsmallcapped {\typo_capitals_set_fake\v!word } +\protected\def\font_style_notsmallcapped {\typo_capitals_set_fake\v!word} \protected\def\typo_capitals_smallcaps {\ifconditional\c_typo_capitals_pseudo @@ -231,14 +265,18 @@ \appendtoks \ifempty\currentcapitals - \doifelse{\directcapitalsparameter\c!title}\v!yes - {\definealternativestyle[\v!capital ][\font_style_normalsmallcapped][\font_style_normalsmallcapped]% - \definealternativestyle[\v!smallcaps][\setsmallcaps][\setsmallcaps]} - {\definealternativestyle[\v!capital ][\font_style_normalsmallcapped][\font_style_normalWORD]% - \definealternativestyle[\v!smallcaps][\setsmallcaps][\font_style_normalWORD]}% - \doifelse{\directcapitalsparameter\s!sc}\v!yes + \ifcstok{\directcapitalsparameter\c!title}\v!yes + \definealternativestyle[\v!capital ][\font_style_normalsmallcapped][\font_style_normalsmallcapped]% + \definealternativestyle[\v!smallcaps][\setsmallcaps][\setsmallcaps]% + \else + \definealternativestyle[\v!capital ][\font_style_normalsmallcapped][\font_style_normalWORD]% + \definealternativestyle[\v!smallcaps][\setsmallcaps][\font_style_normalWORD]% + \fi + \ifcstok{\directcapitalsparameter\s!sc}\v!yes \userealcaps + \else \usepseudocaps + \fi \fi \to \everysetupcapitals diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt index 56218440fd2..ac24125e0e3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt @@ -18,11 +18,11 @@ local nodecodes = nodes.nodecodes local boundarycodes = nodes.boundarycodes local subtypes = nodes.subtypes -local glyph_code = nodecodes.glyph -local par_code = nodecodes.par -local boundary_code = nodecodes.boundary +local glyph_code = nodecodes.glyph +local par_code = nodecodes.par +local boundary_code = nodecodes.boundary -local wordboundary_code = boundarycodes.word +local wordboundary_code = boundarycodes.word local texgetnest = tex.getnest -- to be used local texsetcount = tex.setcount @@ -34,8 +34,8 @@ local settexattribute = tex.setattribute local ispunctuation = characters.is_punctuation local variables = interfaces.variables -local v_all = variables.all -local v_reset = variables.reset +local v_all = variables.all +local v_reset = variables.reset local stack = { } @@ -228,7 +228,7 @@ interfaces.implement { -- not needed in lmtx ... -local c_syst_last_node_id = tex.iscount("c_syst_last_node_id") +local c_syst_last_node_id = tex.iscount("c_syst_last_node_id") interfaces.implement { name = "lastnodeid", diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-cln.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-cln.lmt index 469859162fb..dde31c3b9a0 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-cln.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-cln.lmt @@ -24,8 +24,6 @@ local report_autocase = logs.reporter("nodes","autocase") typesetters.cleaners = typesetters.cleaners or { } local cleaners = typesetters.cleaners -local variables = interfaces.variables - local nodecodes = nodes.nodecodes local enableaction = nodes.tasks.enableaction @@ -33,20 +31,20 @@ local enableaction = nodes.tasks.enableaction local texsetattribute = tex.setattribute local nuts = nodes.nuts - local getattr = nuts.getattr local setattr = nuts.setattr - local setchar = nuts.setchar - local nextglyph = nuts.traversers.glyph -local unsetvalue = attributes.unsetvalue - -local glyph_code = nodecodes.glyph local uccodes = characters.uccodes -local a_cleaner = attributes.private("cleaner") +local glyph_code = nodecodes.glyph + +local a_cleaner = attributes.private("cleaner") +local unsetvalue = attributes.unsetvalue + +local v_reset = interfaces.variables.reset + local resetter = { -- this will become an entry in char-def [utfbyte(".")] = true @@ -86,7 +84,7 @@ end local enabled = false function cleaners.set(n) - if n == variables.reset or not tonumber(n) or n == 0 then + if n == v_reset or not tonumber(n) or n == 0 then texsetattribute(a_cleaner,unsetvalue) else if not enabled then diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl index bd427b954be..649d8fc9785 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl @@ -152,7 +152,7 @@ % \def\beforesubsentence{\removeunwantedspaces} % \def\aftersubsentence {\ignorespaces} -\newconditional\c_typo_subsentence_cleanup \settrue\c_typo_subsentence_cleanup +\newconditional\c_typo_subsentence_cleanup \c_typo_subsentence_cleanup\conditionaltrue \def\typo_subsentence_cleanup_start {\ifconditional\c_typo_subsentence_cleanup @@ -353,7 +353,7 @@ \def\typo_delimited_push#1#2% {\push_macro_currentdelimitedtext % can we combine these two \push_macro_currentdelimitedlanguage % the language used for hyphenation - \edef\currentdelimitedtext{#1}% + \cdef\currentdelimitedtext{#1}% \edef\m_delimited_argument{#2}% \ifempty\m_delimited_argument \typo_delimited_set_language_nop @@ -362,9 +362,9 @@ \fi \let\currentparentdelimitedtext\currentdelimitedtext \global\advanceby\c_typo_delimited_nesting\plusone - \edef\delimitedtextlevel{\number\c_typo_delimited_nesting}% + \edef\delimitedtextlevel{\the\c_typo_delimited_nesting}% \normalexpanded{\chaintocurrentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}}% - \edef\currentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}} + \cdef\currentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}} \def\typo_delimited_pop {\global\advanceby\c_typo_delimited_nesting\minusone @@ -440,7 +440,7 @@ \else \lettonothing\typo_delimited_repeat \fi - \setfalse\c_typo_delimited_repeating + \c_typo_delimited_repeating\conditionalfalse \edef\p_delimited_location{\delimitedtextparameter\c!location}% \ifx\p_delimited_location\v!paragraph \expandafter\typo_delimited_start_par @@ -655,7 +655,7 @@ \dontleavehmode \edef\p_delimited_margin{\delimitedtextparameter\c!location}% \ifx\p_delimited_margin\v!margin - \hskip-\wd\scratchbox + \kern-\wd\scratchbox \fi \box\scratchbox \dostoptagged} @@ -736,7 +736,7 @@ \fi \endgroup \else - \settrue\c_typo_delimited_repeating + \c_typo_delimited_repeating\conditionaltrue \fi} \def\typo_delimited_handle_left#1% @@ -751,14 +751,13 @@ % \strut % new, needed below % \ifhmode % else funny pagebeaks % \penalty\plustenthousand - % \hskip\zeropoint % == \prewordbreak + % \hskip\zeroskip % == \prewordbreak % \fi \strut % new, needed below \dostarttagged\t!delimitedsymbol\empty \dotagsetdelimitedsymbol\s!left \delimitedtextparameter#1% unhbox\scratchbox \dostoptagged - \penalty\plustenthousand % new per 2013-03-09 WS mailing list \boundary\c_typo_delimited_boundary \fi \endgroup} @@ -775,7 +774,7 @@ \fi \ifhmode % else funny pagebeaks \penalty\plustenthousand - \hskip\zeropoint % == \prewordbreak + \hskip\zeroskip % == \prewordbreak \fi \strut % new, needed below \dostarttagged\t!delimitedsymbol\empty diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dha.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-dha.lmt index 8671970d889..69aae9301cc 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-dha.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dha.lmt @@ -73,19 +73,19 @@ local nodepool = nuts.pool local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes +local directioncodes = tex.directioncodes -local glyph_code = nodecodes.glyph -local math_code = nodecodes.math -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local dir_code = nodecodes.dir -local par_code = nodecodes.par +local glyph_code = nodecodes.glyph +local math_code = nodecodes.math +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local dir_code = nodecodes.dir +local par_code = nodecodes.par -local parfillskip_code = gluecodes.parfillskip +local parfillskip_code = gluecodes.parfillskip -local directioncodes = tex.directioncodes -local lefttoright_code = directioncodes.lefttoright -local righttoleft_code = directioncodes.righttoleft +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft local new_direction = nodepool.direction @@ -102,7 +102,7 @@ local directions = typesetters.directions local setcolor = directions.setcolor local getglobal = directions.getglobal -local a_directions = attributes.private('directions') +local a_directions = attributes.private('directions') local strip = false diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt index 9e72d25c299..a790eed49ca 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt @@ -40,10 +40,10 @@ local findattribute = nuts.findattribute local unsetattributes = nuts.unsetattributes local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue -local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph +local unsetvalue = attributes.unsetvalue + +local glyph_code = nodes.nodecodes.glyph local nodepool = nuts.pool local enableaction = nodes.tasks.enableaction @@ -53,7 +53,7 @@ local new_glue = nodepool.glue local fonthashes = fonts.hashes local chardata = fonthashes.characters -local v_reset = interfaces.variables.reset +local v_reset = interfaces.variables.reset local charbase = characters.data local getdigitwidth = fonts.helpers.getdigitwidth @@ -67,7 +67,7 @@ local digits = typesetters.digits digits.actions = { } local actions = digits.actions -local a_digits = attributes.private("digits") +local a_digits = attributes.private("digits") -- at some point we can manipulate the glyph node so then i need -- to rewrite this then diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dig.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-dig.mkxl index 308ccb66e61..654dfb00edf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-dig.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dig.mkxl @@ -48,8 +48,8 @@ \resetdigitsmanipulation \to \everyresettypesetting -\permanent\protected\def\equaldigits{\groupedcommand{\setdigitsmanipulation[\number\plusone]}{}} -\permanent\protected\def\dummydigit {\hphantom {\setdigitsmanipulation[\number\plusone]0}} +\permanent\protected\def\equaldigits{\groupedcommand{\setdigitsmanipulation[1]}{}} +\permanent\protected\def\dummydigit {\hphantom {\setdigitsmanipulation[1]0}} \appendtoks \resetdigitsmanipulation diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt index c1d2a8601a0..8e5996192c1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt @@ -41,7 +41,8 @@ local report_textdirections = logs.reporter("typesetting","text directions") ----- report_mathdirections = logs.reporter("typesetting","math directions") local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue + +local unsetvalue = attributes.unsetvalue local nuts = nodes.nuts local getnext = nuts.getnext @@ -57,17 +58,17 @@ local implement = interfaces.implement local directions = typesetters.directions or { } typesetters.directions = directions -local a_directions = attributes.private('directions') +local a_directions = attributes.private('directions') local variables = interfaces.variables -local v_global = variables["global"] -local v_local = variables["local"] -local v_on = variables.on -local v_yes = variables.yes - -local m_enabled = 0x00000040 -- 2^6 64 -local m_global = 0x00000080 -- 2^7 -local m_fences = 0x00000100 -- 2^8 +local v_global = variables["global"] +local v_local = variables["local"] +local v_on = variables.on +local v_yes = variables.yes + +local m_enabled = 0x00000040 -- 2^6 64 +local m_global = 0x00000080 -- 2^7 +local m_fences = 0x00000100 -- 2^8 local handlers = { } local methods = { } diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl index d9937ce7302..a59ab0e7e6a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl @@ -31,8 +31,8 @@ \installsimplecommandhandler \??directions {directions} \??directions % no \define... yet -\immutable\edef\lefttorightmark{\normalUchar"200E} \aliased\let\lrm\lefttorightmark % expandable -\immutable\edef\righttoleftmark{\normalUchar"200F} \aliased\let\rlm\righttoleftmark % expandable +\immutable\edef\lefttorightmark{\tocharacter"200E} \aliased\let\lrm\lefttorightmark % expandable +\immutable\edef\righttoleftmark{\tocharacter"200F} \aliased\let\rlm\righttoleftmark % expandable \permanent\protected\def\setdirection[#1]% todo: symbolic names {\clf_setdirection#1\relax} @@ -96,11 +96,11 @@ \c!break=\v!both, % experimental value, maybe \v!no will be default (bad name too) \c!fences=\v!yes] -\permanent\protected\edef\bidilre{\normalUchar"202A} -\permanent\protected\edef\bidirle{\normalUchar"202B} -\permanent\protected\edef\bidipop{\normalUchar"202C} -\permanent\protected\edef\bidilro{\normalUchar"202D} -\permanent\protected\edef\bidirlo{\normalUchar"202E} +\permanent\protected\edef\bidilre{\tocharacter"202A} +\permanent\protected\edef\bidirle{\tocharacter"202B} +\permanent\protected\edef\bidipop{\tocharacter"202C} +\permanent\protected\edef\bidilro{\tocharacter"202D} +\permanent\protected\edef\bidirlo{\tocharacter"202E} \permanent\protected\def\dirlre{\ifcase\directionsbidimode\or\bidilre\or\textdirection\directionlefttoright\fi} \permanent\protected\def\dirrle{\ifcase\directionsbidimode\or\bidirle\or\textdirection\directionrighttoleft\fi} diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt index 1ea4f47154b..365556e9ff2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt @@ -49,11 +49,10 @@ local setwhd = nuts.setwhd local setkern = nuts.setkern local setoffsets = nuts.setoffsets local setglyphdata = nuts.setglyphdata +local getparstate = nuts.getparstate local hpack_nodes = nuts.hpack -local nodecodes = nodes.nodecodes - local nodepool = nuts.pool local new_kern = nodepool.kern @@ -69,35 +68,44 @@ local nextglyph = nuts.traversers.glyph local setcoloring = nuts.colors.set local variables = interfaces.variables -local v_default = variables.default -local v_margin = variables.margin -local v_auto = variables.auto -local v_first = variables.first -local v_keep = variables.keep -local v_last = variables.last +local v_default = variables.default +local v_margin = variables.margin +local v_auto = variables.auto +local v_first = variables.first +local v_keep = variables.keep +local v_yes = variables.yes +local v_last = variables.last local texget = tex.get local texset = tex.set -local unsetvalue = attributes.unsetvalue -local glyph_code = nodecodes.glyph -local hlist_code = nodecodes.hlist -local glue_code = nodecodes.glue -local kern_code = nodecodes.kern -local par_code = nodecodes.par +local unsetvalue = attributes.unsetvalue + +local nodecodes = nodes.nodecodes +local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local glue_code = nodecodes.glue +local kern_code = nodecodes.kern +local par_code = nodecodes.par local actions = { } +local busyactions = { } initials.actions = actions +initials.busyactions = actions -local a_initial = attributes.private("initial") +local a_initial = attributes.private("initial") local category = characters.category +local levels = { } +local getlevel = tex.getnestlevel or function() return tex.getnest("prv") end + local function set(par,specification) enableaction("processors","typesetters.initials.handler") if trace_initials then report_initials("enabling initials") end + levels[getlevel()] = true setprop(par,a_initial,specification) end @@ -113,6 +121,7 @@ interfaces.implement { { "location" }, { "enabled", "boolean" }, { "method" }, + { "continue" }, { "distance" ,"dimen" }, { "hoffset" ,"dimen" }, { "voffset" ,"dimen" }, @@ -131,8 +140,9 @@ interfaces.implement { -- todo: prevent linebreak .. but normally a initial ends up at the top of -- a page so this has a low priority -actions[v_default] = function(head,setting) +actions[v_default] = function(head,settings) local skip = false + local busy = false -- begin of par local first = getnext(head) local indent = false @@ -146,21 +156,21 @@ actions[v_default] = function(head,setting) first = getnext(first) end if first and getid(first) == glyph_code then - local ma = setting.ma or 0 - local ca = setting.ca - local ta = setting.ta + local ma = settings.ma or 0 + local ca = settings.ca + local ta = settings.ta local last = first - local distance = setting.distance or 0 - local voffset = setting.voffset or 0 - local hoffset = setting.hoffset or 0 + local distance = settings.distance or 0 + local voffset = settings.voffset or 0 + local hoffset = settings.hoffset or 0 local parindent = texget("parindent") local baseline = texget("baselineskip",false) - local lines = tonumber(setting.n) or 0 - local dynamic = setting.dynamic - local font = setting.font - local scale = setting.glyphscale - local method = settings_to_hash(setting.method) - local length = tonumber(setting.m) or 1 + local lines = tonumber(settings.n) or 0 + local dynamic = settings.dynamic + local font = settings.font + local scale = settings.glyphscale + local method = settings_to_hash(settings.method) + local length = tonumber(settings.m) or 1 -- -- 1 char | n chars | skip first quote | ignore punct | keep punct -- @@ -311,7 +321,7 @@ actions[v_default] = function(head,setting) -- first = dropper -- - if setting.location == v_margin then + if settings.location == v_margin then -- okay else if lines == 0 then -- safeguard, not too precise @@ -324,6 +334,28 @@ actions[v_default] = function(head,setting) if trace_initials then report_initials("setting hangafter to %i and hangindent to %p",hangafter,hangindent) end + if settings.continue == v_yes then + local state = { + lines = lines, + hangindent = hangindent, + parindent = indent and parindent, + } + busy = function(head) + local lines = state.lines + local done = getparstate(head,true).prevgraf or lines + if done < lines then + texset("hangafter",-(lines - done),true) + texset("hangindent",state.hangindent,true) + if state.parindent then + insertafter(first,first,new_kern(-state.parindent)) + end + state.lines = lines - done + return busy + else + return false + end + end + end texset("hangafter",hangafter,true) texset("hangindent",hangindent,true) -- local hsize = texget("hsize",false) @@ -340,25 +372,62 @@ actions[v_default] = function(head,setting) insertafter(first,first,new_kern(-parindent)) end end - return head + return head, busy end -- we can count ... when all done, we can disable ... +-- function initials.handler(head,groupcode) +-- if getid(head) == par_code and startofpar(head) then +-- local settings = getprop(head,a_initial) +-- if settings then +-- disableaction("processors","typesetters.initials.handler") +-- local alternative = settings.alternative or v_default +-- local action = actions[alternative] or actions[v_default] +-- if action then +-- if trace_initials then +-- report_initials("processing initials, alternative %a",alternative) +-- end +-- return action(head,settings) +-- end +-- end +-- end +-- return head +-- end + +-- doesn't work well nested but no sane user will do that + +local busy = false + function initials.handler(head,groupcode) if getid(head) == par_code and startofpar(head) then - local settings = getprop(head,a_initial) - if settings then - disableaction("processors","typesetters.initials.handler") - local alternative = settings.alternative or v_default - local action = actions[alternative] or actions[v_default] - if action then - if trace_initials then - report_initials("processing initials, alternative %a",alternative) + if busy then + busy = busy(head) + end + if not busy then + local settings = getprop(head,a_initial) + if not settings or settings.continue ~= v_yes then + levels[getlevel()] = nil + if not next(levels) then + disableaction("processors","typesetters.initials.handler") + if trace_initials then + report_initials("disabling initials") + end + end + end + if settings then + local alternative = settings.alternative or v_default + local action = actions[alternative] or actions[v_default] + if action then + if trace_initials then + report_initials("processing initials, alternative %a",alternative) + end + head, busy = action(head,settings) + return head end - return action(head,settings) end end end return head end + diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl index 0a128b0d639..009986a525d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl @@ -58,6 +58,7 @@ \c!n=3, \c!m=1, \c!method=\v!none, + \c!continue=\v!no, % yes will handle single line cases % \c!font=Bold sa 4, % \c!font=Bold ht \measure{initial:n}, \c!font=Bold cp \measure{initial:n}, @@ -73,9 +74,15 @@ \namedinitialparameter{#1}\c!before \enforced\edef\typo_initial_handle{\typo_initial_handle_indeed{#1}{}}} -\permanent\tolerant\protected\def\setinitial[#1]#*[#2]% +\permanent\tolerant\protected\def\setinitial[#1]#*[#S#2]% {\enforced\edef\typo_initial_handle{\typo_initial_handle_indeed{#1}{#2}}} +%D \starttyping +%D \framed +%D [width=10cm,align=normal,strut=no,toffset=1ex] +%D {\placeinitial \flushinitial \samplefile{ward}} +%D \stoptyping + \permanent\tolerant\protected\def\flushinitial % when used inside a mechanism that forgets {\typo_initial_handle} @@ -102,12 +109,14 @@ \protected\def\typo_initial_handle_indeed#1#2% {\dontleavehmode \begingroup - \edef\currentinitial{#1}% + \cdef\currentinitial{#1}% \setupcurrentinitial[#2]% \resetfontfeature % might be needed in more places - \doifelsenothing{\initialparameter\c!style} - {\definedfont[\initialparameter\c!font]} - {\useinitialstyleparameter\c!style}% + \ifempty{\initialparameter\c!style}% + \definedfont[\initialparameter\c!font]% + \else + \useinitialstyleparameter\c!style + \fi \useinitialcolorparameter\c!color \edef\p_voffset{\initialparameter\c!voffset}% \scratchcounter \initialparameter\c!n\relax @@ -118,6 +127,7 @@ n \scratchcounter m \numexpr\initialparameter\c!m\relax method {\initialparameter\c!method}% + continue {\initialparameter\c!continue}% distance \dimexpr\initialparameter\c!distance\relax hoffset \dimexpr\initialparameter\c!hoffset\relax voffset \scratchvoffset @@ -171,8 +181,8 @@ \installtexexperiment {autoforgetinitials} - {\settrue \c_initial_synchronize} - {\setfalse\c_initial_synchronize} + {\c_initial_synchronize\conditionaltrue} + {\c_initial_synchronize\conditionalfalse} % \setupbodyfont[dejavu,9pt] % diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt index ecc1396a17a..6279cf480fd 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt @@ -86,26 +86,26 @@ local new_direction = nodepool.direction local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes +local directioncodes = tex.directioncodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local math_code = nodecodes.math -local dir_code = nodecodes.dir -local par_code = nodecodes.par -local penalty_code = nodecodes.penalty +local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local math_code = nodecodes.math +local dir_code = nodecodes.dir +local par_code = nodecodes.par +local penalty_code = nodecodes.penalty -local parfillskip_code = gluecodes.parfillskip -local parfillleftskip_code = gluecodes.parfillleftskip +local parfillskip_code = gluecodes.parfillskip +local parfillleftskip_code = gluecodes.parfillleftskip -local directioncodes = tex.directioncodes -local lefttoright_code = directioncodes.lefttoright -local righttoleft_code = directioncodes.righttoleft +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft -local maximum_stack = 0xFF +local maximum_stack = 0xFF -local a_directions = attributes.private('directions') +local a_directions = attributes.private('directions') local directions = typesetters.directions local setcolor = directions.setcolor @@ -695,7 +695,8 @@ end local function resolve_neutral(list,size,start,limit,orderbefore,orderafter) -- N1, N2 - for i=start,limit do + local i = start + while i <= limit do local entry = list[i] if b_s_ws_on[entry.direction] then -- this needs checking diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-fkr.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-fkr.lmt index 3491c9effaf..2b2160d0b18 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-fkr.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-fkr.lmt @@ -12,9 +12,6 @@ local getnext = nuts.getnext local getattr = nuts.getattr local isglyph = nuts.isglyph -local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph - local fontdata = fonts.hashes.identifiers local getkernpair = fonts.handlers.otf.getkern @@ -23,7 +20,9 @@ local new_kern = nuts.pool.fontkern local enableaction = nodes.tasks.enableaction -local a_extrakern = attributes.private("extrafontkern") +local glyph_code = nodes.nodecodes.glyph + +local a_extrakern = attributes.private("extrafontkern") -- 0=none 1=min 2=max 3=mixed @@ -91,10 +90,11 @@ end do local variables = interfaces.variables - local unsetvalue = attributes.unsetvalue local enabled = false local setattribute = tex.setattribute + local unsetvalue = attributes.unsetvalue + local values = { [variables.none ] = 0, [variables.min ] = 1, diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt index 10d802cf3c7..2aaddea96f9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt @@ -51,13 +51,14 @@ local getprop = nuts.getprop local setprop = nuts.setprop local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local par_code = nodecodes.par -local spaceskip_code = nodes.gluecodes.spaceskip +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local par_code = nodecodes.par + +local spaceskip_code = nodes.gluecodes.spaceskip local nextglyph = nuts.traversers.glyph local nextdisc = nuts.traversers.disc @@ -82,14 +83,14 @@ local tracerrule = nodes.tracers.pool.nuts.rule local actions = { } firstlines.actions = actions -local a_firstline = attributes.private('firstline') +local a_firstline = attributes.private('firstline') local texget = tex.get local variables = interfaces.variables -local v_default = variables.default -local v_line = variables.line -local v_word = variables.word +local v_default = variables.default +local v_line = variables.line +local v_word = variables.word local function set(par,specification) enableaction("processors","typesetters.firstlines.handler") diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl index a62646ffff9..e614fc10ffe 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl @@ -74,7 +74,7 @@ \protected\def\typo_firstline_handle_indeed#1% {\dontleavehmode \begingroup - \edef\currentfirstline{#1}% + \cdef\currentfirstline{#1}% \usefirstlinestyleandcolor\c!style\c!color \clf_setfirstline alternative {\firstlineparameter\c!alternative}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt index 45dde497934..06268b93231 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt @@ -6,9 +6,6 @@ if not modules then modules = { } end modules ['typo-hid'] = { license = "see context related readme files" } -local a_hidecontent = attributes.system("hidecontent") -local specialskips = nodes.specialskipcodes -local glue_code = nodes.nodecodes.glue local nuts = nodes.nuts local getattr = nuts.getattr local getnext = nuts.getnext @@ -24,6 +21,12 @@ local setwhd = nuts.setwhd local setattrlist = nuts.setattrlist local enableaction = nodes.tasks.enableaction +local specialskips = nodes.specialskipcodes + +local glue_code = nodes.nodecodes.glue + +local a_hidecontent = attributes.system("hidecontent") + function nodes.handlers.wipe(head,groupcode,line) if getattr(line,a_hidecontent) then flushlist(head) diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-inj.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-inj.lmt index 238524a94a3..a1a5fb9e470 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-inj.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-inj.lmt @@ -19,9 +19,8 @@ local showall = false local settings_to_array = utilities.parsers.settings_to_array -local variables = interfaces.variables -local v_next = variables.next -local v_previous = variables.previous +local v_next = interfaces.variables.next +local v_previous = interfaces.variables.previous local ctx_domarkinjector = context.domarkinjector local ctx_doactivateinjector = context.doactivateinjector diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl index 04c4f677cc4..0898e4ec50d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl @@ -51,7 +51,7 @@ \permanent \protected\def\checkpreviousinjector [#1]{\clf_checkinjector{#1}{\v!previous}} %permanent \protected\def\checknextinjector [#1]{\clf_checknextinjector{#1}} %permanent \protected\def\checkpreviousinjector [#1]{\clf_checkpreviousinjector{#1}} -\permanent\tolerant\protected\def\setinjector [#1]#*[#2]#*[#3]{\clf_setinjector{#1}{#2}{#3}} +\permanent\tolerant\protected\def\setinjector [#1]#*[#2]#*[#S#3]{\clf_setinjector{#1}{#2}{#3}} \permanent\tolerant\protected\def\showinjector [#1]{\clf_showinjector{#1}} \permanent\protected\def\domarkinjector#1#2% called at the lua end diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt index c26d4a824a0..5995a5521e2 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt @@ -6,69 +6,81 @@ if not modules then modules = { } end modules ['typo-itc'] = { license = "see context related readme files" } --- very old code ... - local tonumber = tonumber +local tand = math.tand local trace_italics = false trackers.register("typesetters.italics", function(v) trace_italics = v end) local report_italics = logs.reporter("nodes","italics") -local threshold = 0.5 directives.register("typesetters.italics.threshold", function(v) threshold = v == true and 0.5 or tonumber(v) end) - typesetters.italics = typesetters.italics or { } local italics = typesetters.italics -local variables = interfaces.variables +typesetters.corrections = typesetters.corrections or { } +local corrections = typesetters.corrections + local settings_to_hash = utilities.parsers.settings_to_hash local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local disc_code = nodecodes.disc -local math_code = nodecodes.math +local glyph_code = nodecodes.glyph +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local disc_code = nodecodes.disc +local math_code = nodecodes.math + +local end_math_code = nodes.mathcodes.endmath +local font_kern_code = nodes.kerncodes.fontkern +local italic_kern_code = nodes.kerncodes.italiccorrection +local left_kern_code = nodes.kerncodes.leftcorrectionkern +local right_kern_code = nodes.kerncodes.rightcorrectionkern +local spaceskip_code = nodes.gluecodes.spaceskip +local xspaceskip_code = nodes.gluecodes.xspaceskip local enableaction = nodes.tasks.enableaction local nuts = nodes.nuts +local tonut = nodes.tonut local nodepool = nuts.pool local getprev = nuts.getprev local getnext = nuts.getnext local getid = nuts.getid +local getsubtype = nuts.getsubtype local getchar = nuts.getchar local getdisc = nuts.getdisc -local getattr = nuts.getattr -local setattr = nuts.setattr -local getattrlist = nuts.getattrlist local setattrlist = nuts.setattrlist local setdisc = nuts.setdisc local isglyph = nuts.isglyph +local isnextglyph = nuts.isnextglyph +local issimilarglyph = nuts.issimilarglyph +local isitalicglyph = nuts.isitalicglyph +local firstitalicglyph = nuts.firstitalicglyph +local hasglyphoption = nuts.hasglyphoption +local hasdiscoption = nuts.hasdiscoption local setkern = nuts.setkern local getkern = nuts.getkern +local setglue = nuts.setglue +local getglue = nuts.getglue local getheight = nuts.getheight local getoptions = nuts.getoptions +local getslant = nuts.getslant +local getcornerkerns = nuts.getcornerkerns +local xscaled = nuts.xscaled +local yscaled = nuts.yscaled local insertnodeafter = nuts.insertafter -local remove_node = nuts.remove +local insertnodebefore = nuts.insertbefore local endofmath = nuts.endofmath +local findnode = nuts.findnode -local texgetattribute = tex.getattribute -local texsetattribute = tex.setattribute -local a_italics = attributes.private("italics") -local a_mathitalics = attributes.private("mathitalics") - -local unsetvalue = attributes.unsetvalue +local traverseitalic = nuts.traverseitalic local new_correction_kern = nodepool.italickern -local new_correction_glue = nodepool.glue - -local no_correction_code = tex.glyphoptioncodes.noitaliccorrection +----- new_correction_glue = nodepool.glue local fonthashes = fonts.hashes local fontdata = fonthashes.identifiers -local italicsdata = fonthashes.italics +----- italicsdata = fonthashes.italics local exheights = fonthashes.exheights local chardata = fonthashes.characters @@ -76,202 +88,266 @@ local ispunctuation = characters.is_punctuation local implement = interfaces.implement -local forcedvariant = false +local no_correction_code = tex.glyphoptioncodes.noitaliccorrection +local math_check_italic_code = tex.userglyphoptioncodes.mathcheckitalic +local text_check_italic_code = tex.userglyphoptioncodes.textcheckitalic +local disc_check_italic_code = tex.userdiscoptioncodes .textcheckitalic -function typesetters.italics.forcevariant(variant) - forcedvariant = variant -end +local mathokay = false +local textokay = false +local kernokay = false + +-- We don't drive this by attributes because most likely it is a document +-- property. + +local exfactormath = 1.25 -- these need checking because not we go unscaled +local exfactortext = 0.50 -- these need checking because not we go unscaled +local spacefactor = 0 + +directives.register("typesetters.italics.threshold", function(v) + exfactortext = v == true and 0.50 or tonumber(v) +end) + +directives.register("typesetters.italics.threshold.math", function(v) + exfactormath = v == true and 1.25 or tonumber(v) +end) + +-- function typesetters.italics.forcevariant(variant) +-- end -- We use the same key as the tex font handler. So, if a value has already be set, we --- use that one. +-- use that one. Contrary to \MKIV\ we don't cache the kern value because we share the +-- character data in compact mode as well as in slant mode. We do however cache the +-- intermediate (partial) italic value. Instead of attributes we now set bits in the +-- glyph and discretionary options which is more efficient and we had these anyway. + +local function getmultiplier(tfmdata,current) + local multiplier + local slant = getslant(current) + if slant and slant ~= 0 then + multiplier = slant/1000 + else + local properties = tfmdata.properties + local italicangle = properties.useditalicangle or 0 + if italicangle == 0 then + slant = properties.usedslant or 0 + if slant and slant ~= 0 then + multiplier = slant/1000 + else + -- We take the median of all valid italic/slanted on my disk. + italicangle = -12 + multiplier = tand(12) + end + else + multiplier = tand(-italicangle) + end + end + return multiplier +end -local function setitalicinfont(font,char) - local tfmdata = fontdata[font] +local function getleftitalic(font,char,current) + local tfmdata = fontdata[font] local character = tfmdata.characters[char] if character then local italic = character.italic if not italic then - local autoitalicamount = tfmdata.properties.autoitalicamount or 0 - if autoitalicamount ~= 0 then + local multiplier = getmultiplier(tfmdata,current) + if multiplier ~= 0 then + local lsb = character._lsb_ + if lsb == false then + return 0, 0 + end local description = tfmdata.descriptions[char] - if description then - italic = description.italic - if not italic then + if not lsb then + if description then local boundingbox = description.boundingbox - italic = boundingbox[3] - description.width + autoitalicamount - if italic < 0 then -- < 0 indicates no overshoot or a very small auto italic - italic = 0 + if boundingbox then + lsb = boundingbox[1] + character._lsb_ = lsb + else + character._lsb_ = false + return 0, 0 end + else + character._lsb_ = false + return 0, 0 end - if italic ~= 0 then - italic = italic * tfmdata.parameters.hfactor + end + if lsb ~= 0 then + local factor = tfmdata.parameters.hfactor + local italic = xscaled(current,lsb * factor) + local extra = xscaled(current,description.height * multiplier * spacefactor * factor) + if trace_italics then + report_italics("setting left italic correction of %C of font %a to %p",char,font,italic) end + return -italic, extra end end - -- we don't want to do this each time so we also set zero here - if trace_italics then - report_italics("setting italic correction of %C of font %a to %p",char,font,italic) - end - if not italic then - italic = 0 - end - character.italic = italic end - return italic - else - return 0 end + return 0, 0 end --- todo: clear attribute +-- bb3 > width : shape sticks out : we we need to add +-- bb3 < width : we could have a negative correction -local function correction_okay(n) - return not (getoptions(n) & no_correction_code == no_correction_code) +local function getrightitalic(font,char,current) + local tfmdata = fontdata[font] + local character = tfmdata.characters[char] + if character then + local italic = character.italic + if italic then + return italic, 0 + else + local multiplier = getmultiplier(tfmdata,current) + if multiplier ~= 0 then + local rsb = character._rsb_ + if rsb == false then + return 0, 0 + end + local description = tfmdata.descriptions[char] + if not rsb then + if description then + local boundingbox = description.boundingbox + if boundingbox then + rsb = boundingbox[3] - description.width + character._rsb_ = rsb + else + character._rsb_ = false + return 0, 0 + end + else + character._rsb_ = false + return 0, 0 + end + end + if rsb > 0 then + local factor = tfmdata.parameters.hfactor + local italic = xscaled(current,rsb * factor) + local extra = xscaled(current,description.height * multiplier * spacefactor * factor) + if trace_italics then + report_italics("setting right italic correction of %C of font %a to %p",char,font,italic) + end + return italic, extra + else + -- < 0 indicates no overshoot or a very small auto italic + end + end + return 0, 0 + end + else + return 0, 0 + end end -local function okay(data,current,font,prevchar,previtalic,char,what) - if getoptions(current) & no_correction_code == no_correction_code then +-- The left and right correction kerns will be done in a second pass because we have +-- to deal with the left side anyway due to lack of a next glyph at injection time. + +-- callback.register("italic_correction", function(node,kern,subtype) +-- if node and subtype == italic_kern_code then +-- node = tonut(node) +-- local char, id = isglyph(node) +-- if char then +-- kern = getrightitalic(id,char,node) +-- elseif id == disc_code then +-- -- for now we forget about it +-- end +-- end +-- return kern +-- end) + +callback.register("italic_correction", function(node,kern,subtype) + if not kernokay then + enableaction("processors","typesetters.corrections.handler") + kernokay = true if trace_italics then - report_italics("ignoring %p between %s italic %C and italic %C, %s",previtalic,what,prevchar,char,"disabled") + report_italics("enabling kern italics") end - return false - elseif data then + end + return kern +end) + +local function report_ignored(previous,current,why) + report_italics("%s correction between %C and %C, %s","ignoring",getchar(previous),getchar(current),why) +end + +local function report_obeyed(previous,current,why) + report_italics("%s correction between %C and %C, %s","inserting",getchar(previous),getchar(current),why) +end + +local function report_math(kern,mathchar,char,why) + report_italics("%s italic %p between math %C and punctuation %C, %s",kern,mathchar,char,why) +end + +local function injection_okay(previous,current) + if hasglyphoption(current,no_correction_code) then if trace_italics then - report_italics("ignoring %p between %s italic %C and italic %C, %s",previtalic,what,prevchar,char,"no data") + report_ignored(previous,current,"disabled") end return false else - if threshold then - -- if getid(current) == glyph_code then + if exfactortext and exfactortext > 0 then + -- hm, check previous .. probably not ok yet while current and getid(current) ~= glyph_code do current = getprev(current) end if current then - local ht = getheight(current) - local ex = exheights[font] - local th = threshold * ex - if ht <= th then - if trace_italics then - report_italics("ignoring correction between %s italic %C and regular %C, height %p less than threshold %p",prevchar,what,char,ht,th) + local char, id = isglyph(current) + if char then + local height = getheight(current) -- chardata[id][char].height or 0 + local exheight = yscaled(current, exheights[id]) + if height <= exfactortext*exheight then + if trace_italics then + report_ignored(previous,current,"threshold") + end + return false end - return false end - else - -- maybe backtrack to glyph end end if trace_italics then - report_italics("inserting %p between %s italic %C and regular %C",previtalic,what,prevchar,char) + report_obeyed(previous,current,"enabled") end return true end end --- maybe: with_attributes(current,n) : --- --- local function correction_kern(kern,n) --- return with_attributes(new_correction_kern(kern),n) --- end - local function correction_kern(kern,n) local k = new_correction_kern(kern) if n then --- local a = getattrlist(n) --- if a then -- maybe not --- setattrlist(k,a) -- can be a marked content (border case) --- end - setattrlist(k,n) -- can be a marked content (border case) + setattrlist(k,n) end return k end -local function correction_glue(glue,n) - local g = new_correction_glue(glue) - if n then --- local a = getattrlist(n) --- if a then -- maybe not --- setattrlist(g,a) -- can be a marked content (border case) --- end - setattrlist(g,n) -- can be a marked content (border case) - end - return g -end - -local mathokay = false -local textokay = false -local enablemath = false -local enabletext = false +-- The code below now assumes the non-italic math model to be used so instead of +-- nilling a kern (italic correction) we now compensate for the right corner kern. +-- +-- [math: ] is now just [math: ] +----- function domath(head,last) local function domath(head,current) - current = endofmath(current) - local next = getnext(current) - if next then - local char, id = isglyph(next) - if char and correction_okay(next) then - -- we can have an old font where italic correction has been applied - -- or a new one where it hasn't been done ... actually, we now always - -- have one under detailed engine control - local kern = getprev(current) - if kern and getid(kern) == kern_code then - local glyph = getprev(kern) - if glyph and getid(glyph) == glyph_code then - -- [math: ] : we remove the correction when we have - -- punctuation - if ispunctuation[char] then - local a = getattr(glyph,a_mathitalics) - if a then - local i = getkern(kern) - local c, f = isglyph(glyph) - if getheight(next) < 1.25*exheights[f] then - if i == 0 then - if trace_italics then - report_italics("%s italic %p between math %C and punctuation %C","ignoring",i,c,char) - end - else - if trace_italics then - report_italics("%s italic between math %C and punctuation %C","removing",i,c,char) - end - setkern(kern,0) -- or maybe a small value or half the ic - end - -- elseif i == 0 then - -- local d = chardata[f][c] - -- local i = d.italic - -- if i == 0 then - -- if trace_italics then - -- report_italics("%s italic %p between math %C and punctuation %C","ignoring",i,c,char) - -- end - -- else - -- setkern(kern,i) - -- if trace_italics then - -- report_italics("%s italic %p between math %C and punctuation %C","setting",i,c,char) - -- end - -- end - elseif trace_italics then - report_italics("%s italic %p between math %C and punctuation %C","keeping",k,c,char) + if exfactormath and exfactormath > 0 then + -- local current = endofmath(last) + local next = getnext(current) + if not hasglyphoption(next,no_correction_code) then -- check node and id too + local char, id = isglyph(next) + if char and ispunctuation[char] then + local glyph = getprev(current) + if hasglyphoption(glyph,math_check_italic_code) then -- check node and id too + local ll, lr = getcornerkerns(glyph) + if lr ~= 0 then + -- unscaled + local height = chardata[id][char].height or 0 + local exheight = yscaled(current, exheights[id]) + if height < exfactormath*exheight then + insertnodeafter(head,current,correction_kern(lr,glyph)) + if trace_italics then + report_math(lr,c,char,"injecting") end end end end - -- else - -- local glyph = kern - -- if glyph and getid(glyph) == glyph_code then - -- -- [math: ] : we add the correction when we have - -- -- no punctuation - -- if not ispunctuation[char] then - -- local a = getattr(glyph,a_mathitalics) - -- if a and (a < 100 or a > 100) then - -- if a > 100 then - -- a = a - 100 - -- else - -- a = a + 100 - -- end - -- if trace_italics then - -- report_italics("%s italic %p between math %C and non punctuation %C","adding",a,getchar(glyph),char) - -- end - -- insertnodeafter(head,glyph,correction_kern(a,glyph)) - -- end - -- end - -- end end end end @@ -281,323 +357,257 @@ end local function mathhandler(head) local current = head while current do - if getid(current) == math_code then + current = findnode(current,math_code,begin_math_code) + if current then current = domath(head,current) + current = getnext(current) end - current = getnext(current) end return head end +local function injectafter(head,glyph,font,char,where) + local italic, extra = getrightitalic(font,char,glyph) + if italic ~= 0 then + -- we could have a .01 pt threshold but correction doesn't happen often + local kern = correction_kern(italic,glyph) + insertnodeafter(head,glyph,kern) + if extra > 0 then + -- todo helper: isspace + local next = getnext(kern) + if next and getid(next) == glue_code then + local subtype = getsubtype(next) + if subtype == spaceskip_code or subtype == xspaceskip_code then + local width, stretch, shrink = getglue(next) + setglue(next,width+extra,stretch,shrink) + end + end + end + if trace_italics then + report_italics("inserting %p between %s italic %C ",italic,where,char) + end + end +end + +local function fixleftitalic(current) + local prev = getnext(current) + local char, id = isglyph(prev) + if char then + local italic, extra = getleftitalic(id,char,prev) + setkern(current,italic) + end + return current +end + +local function fixrightitalic(current) + local prev = getprev(current) + local char, id = isglyph(prev) + if char then + local italic, extra = getrightitalic(id,char,prev) + setkern(current,italic) + end + return current +end + local function texthandler(head) - local prev = nil - local prevchar = nil - local prevhead = head - local previtalic = 0 - local previnserted = nil - - local pre = nil - local pretail = nil - - local post = nil - local posttail = nil - local postchar = nil - local posthead = nil - local postitalic = 0 - local postinserted = nil - - local replace = nil - local replacetail = nil - local replacechar = nil - local replacehead = nil - local replaceitalic = 0 - local replaceinserted = nil - - local current = prevhead - local lastfont = nil - local lastattr = nil + -- yes : slantedglyph end + -- nop : slantedglyph kern + -- nop : slantedglyph similarglyph + -- nop : slantedglyph samefont + -- nop : slantedglyph glue similarglyph + -- nop : slantedglyph glue samefont + -- yes : slantedglyph glue + + -- local current = head + + -- local current = firstitalicglyph(head,true) -- no discretionaries (yet) as we assume a leading glyph + local current = firstitalicglyph(head) + + if not current then + return head + end + + local currentdisc = nil + + local prevglyph = nil + local prevchar = nil + local prevfont = nil + + local prehead = nil + local pretail = nil + + local postglyph = nil + local posthead = nil + local posttail = nil + local postfont = nil + local postchar = nil + + local replaceglyph = nil + local replacehead = nil + local replacetail = nil + local replacefont = nil + local replacechar = nil + + local function flush() + if prevglyph then + injectafter(head,prevglyph,prevfont,prevchar,"glyph") + prevglyph = nil + replaceglyph = nil + postglyph = nil + else + local updatedisc = false + if replaceglyph then + injectafter(replacehead,replaceglyph,replacefont,replacechar,"replace") + replaceglyph = nil + updatedisc = true + end + if postglyph then + injectafter(posthead,postglyph,postfont,postchar,"post") + postglyph = nil + updatedisc = true + end + if updatedisc then + setdisc(currentdisc,prehead,posthead,replacehead) + end + end + end + + if false then +-- if true then + local p = getprev(current) + if not p or getid(p) ~= glue_code then + local char, id = isglyph(current) -- isitalicglyph(current) + if char then + local italic = getleftitalic(id,char,current) + if italic ~= 0 and current == head then + head = insertnodebefore(head,current,correction_kern(italic,current)) + end + end + end + end while current do - local char, id = isglyph(current) + local nxt, char, id = isnextglyph(current) if char then - local font = id - local data = italicsdata[font] - if font ~= lastfont then - if previtalic ~= 0 then - if okay(data,current,font,prevchar,previtalic,char,"glyph") then - insertnodeafter(prevhead,prev,correction_kern(previtalic,current)) - end - elseif previnserted and data then - if trace_italics then - report_italics("deleting last correction before %s %C",char,"glyph") - end - remove_node(prevhead,previnserted,true) - else - -- - if replaceitalic ~= 0 then - if okay(data,replace,font,replacechar,replaceitalic,char,"replace") then - insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current)) - end - replaceitalic = 0 - elseif replaceinserted and data then - if trace_italics then - report_italics("deleting last correction before %s %C","replace",char) - end - remove_node(replacehead,replaceinserted,true) - end - -- - if postitalic ~= 0 then - if okay(data,post,font,postchar,postitalic,char,"post") then - insertnodeafter(posthead,post,correction_kern(postitalic,current)) - end - postitalic = 0 - elseif postinserted and data then - if trace_italics then - report_italics("deleting last correction before %s %C","post",char) - end - remove_node(posthead,postinserted,true) - end + if not hasglyphoption(current,text_check_italic_code) then + prevglyph = nil + replaceglyph = nil + postglyph = nil + elseif not prevglyph then + -- nothing to do + local data = isitalicglyph(current) + if data then + prevglyph = current + prevchar = char + prevfont = id + replaceglyph = nil + postglyph = nil end - -- - lastfont = font - end - if data then - local attr = forcedvariant or getattr(current,a_italics) - if attr and attr > 0 then - local cd = data[char] - if not cd then - -- this really can happen - previtalic = 0 - else - previtalic = cd.italic - if not previtalic then - previtalic = setitalicinfont(font,char) -- calculated once - -- previtalic = 0 - end - if previtalic ~= 0 then - lastfont = font - lastattr = attr - prev = current - -- prevhead = head - prevchar = char - end - end + elseif issimilarglyph(current,prevglyph) then + -- nothing to do + prevglyph = current + prevchar = char + prevfont = id + replaceglyph = nil + postglyph = nil + else + local fine = injection_okay(prevglyph,current) + if fine then + flush() else - previtalic = 0 + prevglyph = nil + replaceglyph = nil + postglyph = nil + end + -- local data = fine and (italicsdata[id] or getslant(current)) + local data = isitalicglyph(current) + if data then + prevglyph = current + prevchar = char + prevfont = id end - else - previtalic = 0 end - previnserted = nil - replaceinserted = nil - postinserted = nil elseif id == disc_code then - previnserted = nil - previtalic = 0 - replaceinserted = nil - replaceitalic = 0 - postinserted = nil - postitalic = 0 - updated = false - replacefont = nil - postfont = nil - pre, post, replace, pretail, posttail, replacetail = getdisc(current,true) - if replace then - local current = replacetail - while current do - local char, id = isglyph(current) - if char then - if correction_okay(current) then - local font = id - if font ~= lastfont then - local data = italicsdata[font] - if data then - local attr = forcedvariant or getattr(current,a_italics) - if attr and attr > 0 then - local cd = data[char] - if not cd then - -- this really can happen - replaceitalic = 0 - else - replaceitalic = cd.italic - if not replaceitalic then - replaceitalic = setitalicinfont(font,char) -- calculated once - -- replaceitalic = 0 - end - if replaceitalic ~= 0 then - lastfont = font - lastattr = attr - replacechar = char - replacehead = replace - updated = true - end - end - end - end - replacefont = font + prevglyph = nil + replaceglyph = nil + postglyph = nil + if hasdiscoption(current,disc_check_italic_code) then + -- if not hasglyphoption(current,no_correction_code) then -- checked in the glyph itself + prehead, posthead, replacehead, pretail, posttail, replacetail = getdisc(current,true) + if replacetail then + local char, id = isglyph(replacetail) + if char then + local data = isitalicglyph(replacetail) + if data then + replaceglyph = replacetail + replacechar = char + replacefont = id end - break - else - current = getprev(current) end - else - current = getprev(current) end - end - end - if post then - local current = posttail - while current do - local char, id = isglyph(current) - if char then - if correction_okay(current) then - local font = id - if font ~= lastfont then - local data = italicsdata[font] - if data then - local attr = forcedvariant or getattr(current,a_italics) - if attr and attr > 0 then - local cd = data[char] - if not cd then - -- this really can happen - -- postitalic = 0 - else - postitalic = cd.italic - if not postitalic then - postitalic = setitalicinfont(font,char) -- calculated once - -- postitalic = 0 - end - if postitalic ~= 0 then - lastfont = font - lastattr = attr - postchar = char - posthead = post - updated = true - end - end - end - end - postfont = font + if posttail then + local char, id = isglyph(posttail) + if char then + local data = isitalicglyph(replacetail) + if data then + postglyph = posttail + postchar = char + postfont = id end - break - else - current = getprev(current) end - else - current = getprev(current) end - end + currentdisc = current + -- end end - if replacefont or postfont then - lastfont = replacefont or postfont + elseif id == kern_code then + local subtype = getsubtype(current) +-- if subtype == italic_kern_code or subtype == right_kern_code then +-- fixrightitalic(current) +-- prevglyph = nil +-- replaceglyph = nil +-- postglyph = nil +-- elseif subtype == left_kern_code then +-- fixleftitalic(current) +-- prevglyph = nil +-- replaceglyph = nil +-- postglyph = nil +-- end + if subtype == italic_kern_code or subtype == right_kern_code or subtype == left_kern_code then + prevglyph = nil + replaceglyph = nil + postglyph = nil end - if updated then - setdisc(current,pre,post,replace) - end - elseif id == kern_code then -- how about fontkern ? - previnserted = nil - previtalic = 0 - replaceinserted = nil - replaceitalic = 0 - postinserted = nil - postitalic = 0 elseif id == glue_code then - if previtalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and glue",previtalic,"glyph",prevchar) - end - previnserted = correction_glue(previtalic,current) -- maybe just add ? else problem with penalties - previtalic = 0 - insertnodeafter(prevhead,prev,previnserted) - else - if replaceitalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and glue",replaceitalic,"replace",replacechar) - end - replaceinserted = correction_kern(replaceitalic,current) -- needs to be a kern - replaceitalic = 0 - insertnodeafter(replacehead,replace,replaceinserted) - end - if postitalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and glue",postitalic,"post",postchar) - end - postinserted = correction_kern(postitalic,current) -- needs to be a kern - postitalic = 0 - insertnodeafter(posthead,post,postinserted) - end - end + -- selective correction elseif id == math_code then - -- is this still needed ... the current engine implementation has been redone - previnserted = nil - previtalic = 0 - replaceinserted = nil - replaceitalic = 0 - postinserted = nil - postitalic = 0 + flush() + current = endofmath(current) if mathokay then current = domath(head,current) - else - current = endofmath(current) - end - elseif previtalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and whatever",previtalic,"glyph",prevchar) + -- else + -- current = endofmath(current) end - insertnodeafter(prevhead,prev,correction_kern(previtalic,current)) - previnserted = nil - previtalic = 0 - replaceinserted = nil - replaceitalic = 0 - postinserted = nil - postitalic = 0 + prevglyph = nil + replaceglyph = nil + postglyph = nil else - if replaceitalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and whatever",replaceitalic,"replace",replacechar) - end - insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current)) - previnserted = nil - previtalic = 0 - replaceinserted = nil - replaceitalic = 0 - postinserted = nil - postitalic = 0 - end - if postitalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and whatever",postitalic,"post",postchar) - end - insertnodeafter(posthead,post,correction_kern(postitalic,current)) - previnserted = nil - previtalic = 0 - replaceinserted = nil - replaceitalic = 0 - postinserted = nil - postitalic = 0 - end + flush() end - current = getnext(current) + current = nxt end - if lastattr and lastattr > 1 then -- more control is needed here - if previtalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and end of list",previtalic,"glyph",prevchar) - end - insertnodeafter(prevhead,prev,correction_kern(previtalic,current)) - else - if replaceitalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and end of list",replaceitalic,"replace",replacechar) - end - insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current)) - end - if postitalic ~= 0 then - if trace_italics then - report_italics("inserting %p between %s italic %C and end of list",postitalic,"post",postchar) - end - insertnodeafter(posthead,post,correction_kern(postitalic,current)) + -- if lastattr and lastattr > 1 then -- more control is needed here + flush() + return head +end + +function corrections.handler(head) + if kernokay then + for current, subtype in traverseitalic(head) do + if subtype == italic_kern_code or subtype == right_kern_code then + fixrightitalic(current) + elseif subtype == left_kern_code then + fixleftitalic(current) end end end @@ -607,15 +617,19 @@ end function italics.handler(head) if textokay then return texthandler(head) - elseif mathokay then - return mathhandler(head) else - return head, false + -- fast loop for math + if mathokay then + return mathhandler(head) + end + return head end end -enabletext = function() - enableaction("processors","typesetters.italics.handler") +local enabletext = function() + if enable then + enable() + end if trace_italics then report_italics("enabling text/text italics") end @@ -623,8 +637,10 @@ enabletext = function() textokay = true end -enablemath = function() - enableaction("processors","typesetters.italics.handler") +local enablemath = function() + if enable then + enable() + end if trace_italics then report_italics("enabling math/text italics") end @@ -632,90 +648,30 @@ enablemath = function() mathokay = true end -function italics.enabletext() +function italics.enabletext() -- math and text if enabletext then enabletext() end end -function italics.enablemath() +function italics.enablemath() -- only math if enablemath then enablemath() end end -function italics.set(n) - if enabletext then - enabletext() - end - if n == variables.reset then - texsetattribute(a_italics,unsetvalue) - else - texsetattribute(a_italics,tonumber(n) or unsetvalue) - end -end - -function italics.reset() - texsetattribute(a_italics,unsetvalue) -end +-- maybe a table and also thresholds -implement { - name = "setitaliccorrection", - actions = italics.set, - arguments = "string" -} - -implement { - name = "resetitaliccorrection", - actions = italics.reset, -} - -local function setupitaliccorrection(option) -- no grouping ! +local function setitaliccorrection(factor) + factor = tonumber(factor) or 0 if enabletext then enabletext() end - local options = settings_to_hash(option) - local variant = unsetvalue - if options[variables.text] then - variant = 1 - elseif options[variables.always] then - variant = 2 - end - -- maybe also keywords for threshold - if options[variables.global] then - forcedvariant = variant - texsetattribute(a_italics,unsetvalue) - else - forcedvariant = false - texsetattribute(a_italics,variant) - end - if trace_italics then - report_italics("forcing %a, variant %a",forcedvariant or "-",variant ~= unsetvalue and variant) - end + spacefactor = factor end implement { - name = "setupitaliccorrection", - actions = setupitaliccorrection, - arguments = "string" -} - --- for manuals: - -local stack = { } - -implement { - name = "pushitaliccorrection", - actions = function() - table.insert(stack,{forcedvariant, texgetattribute(a_italics) }) - end -} - -implement { - name = "popitaliccorrection", - actions = function() - local top = table.remove(stack) - forcedvariant = top[1] - texsetattribute(a_italics,top[2]) - end + name = "setitaliccorrection", + actions = setitaliccorrection, + arguments = "argument", } diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-itc.mklx b/Master/texmf-dist/tex/context/base/mkxl/typo-itc.mklx index 67753efd50c..05d5bdf61bf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-itc.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-itc.mklx @@ -18,39 +18,78 @@ %D The brave might try: %D %D \starttyping -%D \definefontfeature[default][default][itlc=yes,textitalics=yes] -%D \setupitaliccorrection[global,always] +%D \definefontfeature[default][default][itlc=yes] % is now default +%D \setitaliccorrection %D \stoptyping \registerctxluafile{typo-itc}{autosuffix} -\definesystemattribute[italics] [public] -\definesystemattribute[mathitalics][public] +\installcorenamespace{italics} -% \let\/=/ -% \let\emphasiscorrection\donothing +\def\typo_italic_set#1% + {\bitwiseflip\glyphoptions \textcheckitalicglyphoptioncode + \bitwiseflip\discretionaryoptions\textcheckitalicdiscoptioncode + \clf_setitaliccorrection{#1}} + +\def\typo_italic_reset + {\bitwiseflip\glyphoptions -\textcheckitalicglyphoptioncode + \bitwiseflip\discretionaryoptions-\textcheckitalicdiscoptioncode} + +\permanent\tolerant\protected\def\setitaliccorrection[#1]% + {\ifcstok{#1}\v!reset + \typo_italic_reset + \orelse\ifcsname\??italics#1\endcsname + \expandafter\typo_italic_set\expandafter{\lastnamedcs}% + \fi} + +\defcsname\??italics\v!yes \endcsname{0} +\defcsname\??italics\v!small \endcsname{0.1} +\defcsname\??italics\v!medium\endcsname{0.2} +\defcsname\??italics\v!big \endcsname{0.3} + +\permanent\protected\def\resetitaliccorrection + {\typo_italic_reset} + +\permanent\protected\def\setupitaliccorrection% kind of obsolete + {\setitaliccorrection} \permanent\protected\def\italiccorrection - {\ifnum\c_attr_italics<\plusone\normalitaliccorrection\fi} + {\ifbitwiseand\glyphoptions\textcheckitalicglyphoptioncode\else + \normalitaliccorrection + \fi} \pushoverloadmode \aliased\let\/\italiccorrection % replaces the primitive + % \aliased\let\explicititaliccorrection\italiccorrection % replaces the primitive \popoverloadmode -% 1 = end of word -% 2 = end of word and end of a list +% only for manuals ... obsolete + +\permanent\protected\def\pushitaliccorrection{}% \typo_italic_reset +\permanent\protected\def\popitaliccorrection {}% \typo_italic_set + +%D Correcting for weird shapes. + +%D \starttyping +%D \showglyphs \showfontitalics \showfontkerns +%D +%D \setupbodyfont[bonum] +%D +%D \startTEXpage[offset=1ts,width=5em] +%D \setupitaliccorrection[italic] +%D \dontleavehmode +%D \ruledhbox{\it\shapecorrection[both] f}\quad +%D \ruledhbox{\it\shapecorrection[both]ff} +%D \stopTEXpage +%D \stoptyping -\permanent\protected\def\setitaliccorrection [#code]{\clf_setitaliccorrection#code\relax} % todo: public implementor -\permanent\protected\def\resetitaliccorrection {\clf_resetitaliccorrection} % todo: public implementor -\permanent\protected\def\setupitaliccorrection[#settings]{\clf_setupitaliccorrection{#settings}} % todo: public implementor +\installcorenamespace{shapecorrection} -% global : no attributes, just always (faster and less memory) -% text : only text -% always : text and boxes -% none : - +\defcsname\??shapecorrection\v!left \endcsname{\groupedcommandcs\forcedleftcorrection\relax} +\defcsname\??shapecorrection\v!right\endcsname{\groupedcommandcs\relax \forcedrightcorrection} +\defcsname\??shapecorrection\v!both \endcsname{\groupedcommandcs\forcedleftcorrection\forcedrightcorrection} +\defcsname\??shapecorrection \endcsname{\groupedcommandcs\relax \forcedrightcorrection} -\appendtoks - \c_attr_italics\attributeunsetvalue -\to \everymathematics +\permanent\tolerant\protected\def\shapecorrection[#1]{\begincsname\??shapecorrection#1\endcsname} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl index 5a10cfc9d82..53ae11429a1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl @@ -68,7 +68,7 @@ \newbox \b_typo_items_symbols \newbox \b_typo_items_texts -\permanent\tolerant\protected\def\items[#1]#:#2% +\permanent\tolerant\protected\def\items[#S#1]#:#2% {\bgroup \setupitems[#1]% \edef\p_typo_items_alternative{\itemsparameter\c!alternative}% @@ -182,15 +182,16 @@ \scratchwidth\d_typo_items_text_width \useitemsstyleandcolor\c!textstyle\c!textcolor \typo_items_make{\processcommalist[#1]\typo_items_item}}% - \ifempty\p_typo_items_symbol - \setbox\b_typo_items_symbols\emptyhbox - \else - \setbox\b_typo_items_symbols\hbox - {\c_typo_items_m\zerocount - \let\m_typo_items_align\p_typo_items_align - \scratchwidth\d_typo_items_symbol_width - \useitemsstyleandcolor\c!style\c!color - \typo_items_make{\dorecurse\c_typo_items_n{\typo_items_item{\strut\m_typo_items_symbol\recurselevel}}}}% + \setbox\b_typo_items_symbols + \ifempty\p_typo_items_symbol + \emptyhbox + \else + \hbox + {\c_typo_items_m\zerocount + \let\m_typo_items_align\p_typo_items_align + \scratchwidth\d_typo_items_symbol_width + \useitemsstyleandcolor\c!style\c!color + \typo_items_make{\dorecurse\c_typo_items_n{\typo_items_item{\strut\m_typo_items_symbol{##1}}}}}% \fi} % alternatives: @@ -235,7 +236,7 @@ \typo_items_construct_items_boxes{#1}% \noindent\hbox\bgroup \ifvoid\b_typo_items_symbols \else - \llap{\box\b_typo_items_symbols\hskip\d_typo_items_distance}% + \llap{\box\b_typo_items_symbols\kern\d_typo_items_distance}% \fi \box\b_typo_items_texts \egroup} diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt index 65068d89733..ec0717a2245 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt @@ -35,6 +35,7 @@ local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid local getfont = nuts.getfont +local getxscale = nuts.getxscale local getsubtype = nuts.getsubtype local getchar = nuts.getchar local getdisc = nuts.getdisc @@ -53,11 +54,13 @@ local setglue = nuts.setglue local setkern = nuts.setkern local setchar = nuts.setchar local setglue = nuts.setglue -- todo +local setattrlist = nuts.setattrlist local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue -local new_kern = nodepool.kern +local unsetvalue = attributes.unsetvalue + +local new_kern = nodepool.kern -- fontkern local new_glue = nodepool.glue local nodecodes = nodes.nodecodes @@ -66,26 +69,26 @@ local gluecodes = nodes.gluecodes local disccodes = nodes.disccodes local listcodes = nodes.listcodes -local glyph_code = nodecodes.glyph -local kern_code = nodecodes.kern -local disc_code = nodecodes.disc -local glue_code = nodecodes.glue -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local math_code = nodecodes.math +local glyph_code = nodecodes.glyph +local kern_code = nodecodes.kern +local disc_code = nodecodes.disc +local glue_code = nodecodes.glue +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local math_code = nodecodes.math -local boxlist_code = listcodes.box -local unknownlist_code = listcodes.unknown +local boxlist_code = listcodes.box +local unknownlist_code = listcodes.unknown -local discretionarydisc_code = disccodes.discretionary -local automaticdisc_code = disccodes.automatic +local discretionarydisc_code = disccodes.discretionary +local automaticdisc_code = disccodes.automatic -local fontkern_code = kerncodes.fontkern -local userkern_code = kerncodes.userkern +local fontkern_code = kerncodes.fontkern +local userkern_code = kerncodes.userkern -local userskip_code = gluecodes.userskip -local spaceskip_code = gluecodes.spaceskip -local xspaceskip_code = gluecodes.xspaceskip +local userskip_code = gluecodes.userskip +local spaceskip_code = gluecodes.spaceskip +local xspaceskip_code = gluecodes.xspaceskip local fonthashes = fonts.hashes local chardata = fonthashes.characters @@ -99,8 +102,10 @@ local tracers = nodes.tracers local setcolor = tracers.colors.set local resetcolor = tracers.colors.reset -local v_max = interfaces.variables.max -local v_auto = interfaces.variables.auto +local setattrlist = nuts.setattrlist + +local v_max = interfaces.variables.max +local v_auto = interfaces.variables.auto typesetters = typesetters or { } local typesetters = typesetters @@ -109,12 +114,13 @@ local kerns = typesetters.kerns or { } typesetters.kerns = kerns local report = logs.reporter("kerns") -local trace_ligatures = false trackers.register("typesetters.kerns.ligatures", function(v) trace_ligatures = v end) +local trace_ligatures = false trackers.register("typesetters.kerns.ligatures", function(v) trace_ligatures = v end) local trace_ligatures_d = false trackers.register("typesetters.kerns.ligatures.details", function(v) trace_ligatures_d = v end) kerns.mapping = kerns.mapping or { } kerns.factors = kerns.factors or { } -local a_kerns = attributes.private("kern") + +local a_kerns = attributes.private("kern") local contextsetups = fonts.specifiers.contextsetups @@ -203,33 +209,35 @@ end -- can be optimized .. the prev thing .. but hardly worth the effort -local function kern_injector(fillup,kern) +local function kern_injector(fillup,kern,template) + local n if fillup then - local g = new_glue(kern) - setfield(g,"stretch",kern) - setfield(g,"stretchorder",1) - return g + n = new_glue(kern) + setfield(n,"stretch",kern) + setfield(n,"stretchorder",1) else - return new_kern(kern) + n = new_kern(kern) end + setattrlist(n,template) + return n end -- a simple list injector, no components and such .. just disable ligatures in -- kern mode .. maybe not even hyphenate ... anyway, the next one is for simple -- sublists .. beware: we can have char -1 -local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyph +local function inject_begin(boundary,prev,keeptogether,krn,ok,scale) -- prev is a glyph local char, id = isglyph(boundary) if char then if keeptogether and keeptogether(boundary,prev) then -- keep 'm else - local prevchar = isglyph(prev) - if prevchar and prevchar > 0 then - local font = getfont(boundary) - local data = chardata[font][prevchar] + local prevchar, prevfont = isglyph(prev) + if prevchar and prevchar > 0 and prevfont == id then + local data = chardata[id][prevchar] local kerns = data and data.kerns - local kern = new_kern((kerns and kerns[char] or 0) + quaddata[font]*krn) + local kern = new_kern(scale*((kerns and kerns[char] or 0) + quaddata[id]*krn)) + setattrlist(kern,boundary) setlink(kern,boundary) return kern, true end @@ -245,7 +253,7 @@ local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyp end if inject then -- not yet ok, as injected kerns can be overlays (from node-inj.lua) - setkern(boundary,getkern(boundary) + quaddata[getfont(prev)]*krn,userkern_code) + setkern(boundary,getkern(boundary) + scale*quaddata[getfont(prev)]*krn) -- ,userkern_code) return boundary, true end end @@ -253,20 +261,21 @@ local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyp return boundary, ok end -local function inject_end(boundary,next,keeptogether,krn,ok) +local function inject_end(boundary,next,keeptogether,krn,ok,scale) local tail = find_node_tail(boundary) local char, id = isglyph(tail) if char then if keeptogether and keeptogether(tail,two) then -- keep 'm else - local nextchar = isglyph(tail) - if nextchar and nextchar > 0 then - local font = getfont(tail) - local data = chardata[font][nextchar] + -- base mode + local nextchar, nextfont = isglyph(tail) + if nextchar and nextchar > 0 and nextfont == id then + local data = chardata[id][nextchar] local kerns = data and data.kerns - local kern = (kerns and kerns[char] or 0) + quaddata[font]*krn - setlink(tail,new_kern(kern)) + local kern = new_kern(scale*((kerns and kerns[char] or 0) + quaddata[id]*krn)) + setattrlist(kern,boundary) + setlink(tail,kern) return boundary, true end end @@ -281,7 +290,7 @@ local function inject_end(boundary,next,keeptogether,krn,ok) end if inject then -- not yet ok, as injected kerns can be overlays (from node-inj.lua) - setkern(tail,getkern(tail) + quaddata[getfont(next)]*krn,userkern_code) + setkern(tail,getkern(tail) + scale*quaddata[getfont(next)]*krn) -- ,userkern_code) return boundary, true end end @@ -295,13 +304,15 @@ local function process_list(head,keeptogether,krn,font,okay) local pid = nil local kern = 0 local mark = font and markdata[font] + local scale = 1 while start do local char, id = isglyph(start) if char then if not font then - font = id -- getfont(start) - mark = markdata[font] - kern = quaddata[font]*krn + font = id -- getfont(start) + mark = markdata[font] + kern = quaddata[font]*krn + scale = getxscale(start) end if prev then if mark[char] then @@ -317,7 +328,7 @@ local function process_list(head,keeptogether,krn,font,okay) end if inject then -- not yet ok, as injected kerns can be overlays (from node-inj.lua) - setkern(prev,getkern(prev) + kern,userkern_code) + setkern(prev,getkern(prev) + scale*kern) -- ,userkern_code) okay = true end end @@ -331,17 +342,19 @@ local function process_list(head,keeptogether,krn,font,okay) -- if kerns then -- print("it happens indeed, basemode kerns not yet injected") -- end - insertnodebefore(head,start,new_kern((kerns and kerns[char] or 0) + kern)) + local kern = new_kern(scale*((kerns and kerns[char] or 0) + kern)) + setattrlist(kern,start) + insertnodebefore(head,start,kern) okay = true end end end + pid = glyph_code + else + pid = id end - if start then - prev = start - pid = id - start = getnext(start) - end + prev = start + start = getnext(start) end return head, okay, prev end @@ -378,6 +391,7 @@ function kerns.handler(head) local prevfont = nil local prevmark = nil local done = false + local scale = 1 while start do -- fontkerns don't get the attribute but they always sit between glyphs so -- are always valid bound .. disc nodes also sometimes don't get them @@ -396,6 +410,7 @@ function kerns.handler(head) elseif char then -- id == glyph_code local font = id -- more readable local mark = markdata[font] + scale = getxscale(start) if keepligature and keepligature(start) then -- keep 'm else @@ -434,7 +449,7 @@ function kerns.handler(head) end if inject then -- not yet ok, as injected kerns can be overlays (from node-inj.lua) - setkern(prev,getkern(prev) + quaddata[font]*krn,userkern_code) + setkern(prev,getkern(prev) + scale*quaddata[font]*krn) -- ,userkern_code) end end elseif previd == glyph_code then @@ -446,10 +461,10 @@ function kerns.handler(head) local data = chardata[font][prevchar] local kerns = data and data.kerns local kern = (kerns and kerns[char] or 0) + quaddata[font]*krn - insertnodebefore(head,start,kern_injector(fillup,kern)) + insertnodebefore(head,start,kern_injector(fillup,scale*kern,start)) end else - insertnodebefore(head,start,kern_injector(fillup,quaddata[font]*krn)) + insertnodebefore(head,start,kern_injector(fillup,scale*quaddata[font]*krn,start)) end end prev = start @@ -482,7 +497,7 @@ function kerns.handler(head) pglyph = prev and getid(prev) == glyph_code end if pglyph then - pre, okay = inject_begin(pre,prev,keeptogether,krn,okay) + pre, okay = inject_begin(pre,prev,keeptogether,krn,okay,scale) end pre, okay = process_list(pre,keeptogether,krn,false,okay) if okay then @@ -496,7 +511,7 @@ function kerns.handler(head) nglyph = next and getid(next) == glyph_code end if nglyph then - post, okay = inject_end(post,next,keeptogether,krn,okay) + post, okay = inject_end(post,next,keeptogether,krn,okay,scale) end post, okay = process_list(post,keeptogether,krn,false,okay) if okay then @@ -510,21 +525,22 @@ function kerns.handler(head) pglyph = prev and getid(prev) == glyph_code end if pglyph then - replace, okay = inject_begin(replace,prev,keeptogether,krn,okay) + replace, okay = inject_begin(replace,prev,keeptogether,krn,okay,scale) end if not next then next = getnext(start) nglyph = next and getid(next) == glyph_code end if nglyph then - replace, okay = inject_end(replace,next,keeptogether,krn,okay) + replace, okay = inject_end(replace,next,keeptogether,krn,okay,scale) end replace, okay = process_list(replace,keeptogether,krn,false,okay) if okay then indeed = true end elseif prevfont then - replace = new_kern(quaddata[prevfont]*krn) + replace = new_kern(scale*quaddata[prevfont]*krn) + setattrlist(replace,start) indeed = true end if indeed then @@ -559,11 +575,11 @@ function kerns.handler(head) -- special case local b, f = closest_bound(start,getprev) if b then - insertnodebefore(head,start,kern_injector(fillup,quaddata[f]*krn)) + insertnodebefore(head,start,kern_injector(fillup,scale*quaddata[f]*krn,start)) end local b, f = closest_bound(start,getnext) if b then - insertnodeafter(head,start,kern_injector(fillup,quaddata[f]*krn)) + insertnodeafter(head,start,kern_injector(fillup,scale*quaddata[f]*krn,start)) end end bound = false diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-krn.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-krn.mkxl index 4c6aea256f8..8ec6ff3cc24 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-krn.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-krn.mkxl @@ -28,7 +28,7 @@ \installcommandhandler \??characterkerning {characterkerning} \??characterkerning \permanent\protected\def\setcharacterkerning[#1]% - {\edef\currentcharacterkerning{#1}% + {\cdef\currentcharacterkerning{#1}% \ifx\currentcharacterkerning\s!reset \resetcharacterkerning \else @@ -62,7 +62,7 @@ %D Here we need to keep the groupedcommand solution as it is used as modifier. \appendtoks - \frozen\instance\setuevalue{\currentcharacterkerning}% + \frozen\instance\protected\edefcsname\currentcharacterkerning\endcsname {\doifelsenextoptional {\typo_kerning_apply_yes{\currentcharacterkerning}}% {\typo_kerning_apply_nop{\currentcharacterkerning}}}% @@ -75,12 +75,12 @@ {\groupedcommand{\typo_kerning_apply_nop_indeed{#1}}\donothing} \def\typo_kerning_apply_yes_indeed#1#2% - {\edef\currentcharacterkerning{#1}% + {\cdef\currentcharacterkerning{#1}% \setupcurrentcharacterkerning[\c!factor=#2]% \typo_kerning_set} \def\typo_kerning_apply_nop_indeed#1% - {\edef\currentcharacterkerning{#1}% + {\cdef\currentcharacterkerning{#1}% \typo_kerning_set} \definecharacterkerning [\v!kerncharacters] [\c!factor=.125] @@ -120,7 +120,7 @@ \pushoverloadmode -\enforced\permanent\tolerant\protected\def\stretched[#1]#:#2% +\enforced\permanent\tolerant\protected\def\stretched[#S#1]#:#2% {\begingroup \let\currentcharacterkerning\v!stretched \ifparameter#1\or diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt index 21aead80c3f..8ff52e9ae35 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt @@ -69,9 +69,10 @@ end -- Just because we can, we also have a setter ... -local dimension_value = tokens.values.dimension -local scanstring = tokens.scanners.string -local scandimension = tokens.scanners.dimension +local scanstring = tokens.scanners.string +local scandimension = tokens.scanners.dimension + +local dimension_value = tokens.values.dimension interfaces.implement { name = "languagecharwidth", diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt index 55b9a9ca732..d1e054ee477 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt @@ -15,10 +15,10 @@ local nuts = nodes.nuts local tonut = nodes.tonut local tonode = nodes.tonode -local left_box_code = nodes.listcodes.left -local right_box_code = nodes.listcodes.right -local local_box_code = nodes.listcodes["local"] -local hlist_code = nodes.nodecodes.hlist +local left_box_code = nodes.listcodes.left +local right_box_code = nodes.listcodes.right +local local_box_code = nodes.listcodes["local"] +local hlist_code = nodes.nodecodes.hlist -- some can go: @@ -43,8 +43,8 @@ local traverse_list = nuts.traversers.list local expandmacro = token.expandmacro -local dimension_value = tokens.values.dimension -local integer_value = tokens.values.integer +local dimension_value = tokens.values.dimension +local integer_value = tokens.values.integer local implement = interfaces.implement @@ -54,7 +54,7 @@ local typesetters = typesetters typesetters.localboxes = typesetters.localboxes or { } local localboxes = typesetters.localboxes -local a_localboxesmark = attributes.private("localboxesmark") +local a_localboxesmark = attributes.private("localboxesmark") local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl index 57186856fed..36f38e50e35 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl @@ -65,7 +65,7 @@ \appendtoks \global\advanceby\c_typo_localboxes\plusone \global\expandafter\integerdef\csname\??localboxesattribute\currentlocalboxes\endcsname\c_typo_localboxes - \gletcsname\??localboxesnamespace\number\c_typo_localboxes\endcsname\currentlocalboxes + \gletcsname\??localboxesnamespace\the\c_typo_localboxes\endcsname\currentlocalboxes \to \everydefinelocalboxes %D The optional argument forces setting the \quote {whole} paragraph properties (which is needed @@ -89,7 +89,7 @@ \permanent\protected\def\localboxcommand {\ifcsname\??localboxesnamespace\number\localboxindex\endcsname - %\edef\currentlocalboxes{\lastnamedcs}% + %\cdef\currentlocalboxes{\lastnamedcs}% \expandafter\let\expandafter\currentlocalboxes\lastnamedcs \setbox\localboxcontentbox\hbox {\uselocalboxesstyleandcolor\c!style\c!color % sometimes redundant @@ -114,7 +114,7 @@ \def\typo_localboxes_zero#1#2#3% {\ifcsname\??localboxesattribute#2\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#2}% + \cdef\currentlocalboxes{#2}% \edef\currentlocalboxeslocation{#1}% \typo_localboxes_localbox index \c_typo_localboxes_index @@ -135,7 +135,7 @@ \def\typo_localboxes_asis#1#2#3% {\ifcsname\??localboxesattribute#2\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#2}% + \cdef\currentlocalboxes{#2}% \edef\currentlocalboxeslocation{#1}% \typo_localboxes_localbox index \c_typo_localboxes_index @@ -167,7 +167,7 @@ \permanent\tolerant\protected\def\resetlocalbox[#1]% {\ifcsname\??localboxesattribute#1\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#1}% + \cdef\currentlocalboxes{#1}% \ifcsname\??localboxesresetters\localboxesparameter\c!location\endcsname \edef\currentlocalboxeslocation{\lastnamedcs}% \typo_localboxes_localbox index \c_typo_localboxes_index {}% @@ -176,7 +176,7 @@ \def\typo_localboxes_box#1% {\dowithnextboxcontent - {\edef\currentlocalboxes{#1}% + {\cdef\currentlocalboxes{#1}% \uselocalboxesstyleandcolor\c!style\c!color} {\ifcsname\??localboxeslocations\namedlocalboxesparameter{#1}\c!location\endcsname \expandafter\lastnamedcs @@ -196,7 +196,7 @@ \csname\??localboxeslocations\v!left\expandafter\endcsname \fi{#1}{\unhbox\nextbox}}% \hbox\bgroup - \edef\currentlocalboxes{#1}% + \cdef\currentlocalboxes{#1}% \uselocalboxesstyleandcolor\c!style\c!color \enforced\def\stoplocalbox{\removeunwantedspaces\egroup}% \ignorespaces} @@ -267,7 +267,7 @@ {\dontleavehmode \ifcsname\??localboxesattribute#1\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#1}% + \cdef\currentlocalboxes{#1}% \edef\currentlocalboxeslocation{\localboxesparameter\c!location}% \ifx\currentlocalboxeslocation\v!right\localrightbox\orelse\ifx\currentlocalboxeslocation\v!left\localleftbox\else\localmiddlebox\fi index \c_typo_localboxes_index diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt index 2a0182e28f5..7b0449e7823 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt @@ -60,9 +60,9 @@ local nuts = nodes.nuts local nodecodes = nodes.nodecodes local listcodes = nodes.listcodes -local hlist_code = nodecodes.hlist -local kern_code = nodecodes.kern -local linelist_code = listcodes.line +local hlist_code = nodecodes.hlist +local kern_code = nodecodes.kern +local linelist_code = listcodes.line local tonut = nodes.tonut local tonode = nodes.tonode @@ -97,7 +97,7 @@ local new_hlist = nodepool.hlist local new_rule = nodepool.rule local new_glue = nodepool.glue -local righttoleft_code = tex.directioncodes.righttoleft +local righttoleft_code = tex.directioncodes.righttoleft local setmetatableindex = table.setmetatableindex diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt index cf0ef39b23a..25907bad53e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt @@ -39,24 +39,24 @@ local variables = interfaces.variables local conditionals = tex.conditionals local systemmodes = tex.systemmodes -local v_top = variables.top -local v_depth = variables.depth -local v_local = variables["local"] -local v_global = variables["global"] -local v_left = variables.left -local v_right = variables.right -local v_inner = variables.inner -local v_outer = variables.outer -local v_margin = variables.margin -local v_edge = variables.edge -local v_default = variables.default -local v_normal = variables.normal -local v_yes = variables.yes -local v_continue = variables.continue -local v_first = variables.first -local v_text = variables.text -local v_paragraph = variables.paragraph -local v_line = variables.line +local v_top = variables.top +local v_depth = variables.depth +local v_local = variables["local"] +local v_global = variables["global"] +local v_left = variables.left +local v_right = variables.right +local v_inner = variables.inner +local v_outer = variables.outer +local v_margin = variables.margin +local v_edge = variables.edge +local v_default = variables.default +local v_normal = variables.normal +local v_yes = variables.yes +local v_continue = variables.continue +local v_first = variables.first +local v_text = variables.text +local v_paragraph = variables.paragraph +local v_line = variables.line local nuts = nodes.nuts local tonode = nuts.tonode @@ -91,10 +91,10 @@ local nodecodes = nodes.nodecodes local listcodes = nodes.listcodes local whatsitcodes = nodes.whatsitcodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local whatsit_code = nodecodes.whatsit -local userdefined_code = whatsitcodes.userdefined +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local whatsit_code = nodecodes.whatsit +local userdefined_code = whatsitcodes.userdefined local nodepool = nuts.pool @@ -115,9 +115,9 @@ local addtoline = paragraphs.addtoline local moveinline = paragraphs.moveinline local calculatedelta = paragraphs.calculatedelta -local a_linenumber = attributes.private('linenumber') +local a_linenumber = attributes.private('linenumber') -local inline_mark = nodepool.userids["margins.inline"] +local inline_mark = nodepool.userids["margins.inline"] local jobpositions = job.positions local getposition = jobpositions.get diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl index 85161c942ef..58e99693df5 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl @@ -136,7 +136,7 @@ \c!align=\margindataparameter\c!align] \appendtoks - \frozen\instance\setuevalue\currentmargindata{\margindata[\currentmargindata]}% + \frozen\instance\protected\edefcsname\currentmargindata\endcsname{\margindata[\currentmargindata]}% \to \everydefinemargindata \newconditional\inhibitmargindata % This one is used at the Lua end! @@ -148,7 +148,7 @@ \mutable\lettonothing\currentmarginreference \appendtoks - \settrue\inhibitmargindata + \inhibitmargindata\conditionaltrue \to \everyforgetall \appendtoks @@ -183,20 +183,18 @@ \expandafter\typo_margins_data_yes \fi} -\permanent\tolerant\protected\def\typo_margins_data_nop[#name]#spacer[#dataparameters]#spacer[#textparameters]#:#content% +\permanent\tolerant\protected\def\typo_margins_data_nop[#name]#spacer[#S#dataparameters]#spacer[#S#textparameters]#:#content% {} -\permanent\tolerant\protected\def\typo_margins_data_yes[#name]#spacer[#dataparameters]#spacer[#textparameters]#:#content% - {\setfalse\inhibitmargindata % flushing afterwards +\permanent\tolerant\protected\def\typo_margins_data_yes[#name]#spacer[#S#dataparameters]#spacer[#S#textparameters]#:#content% + {\inhibitmargindata\conditionalfalse % flushing afterwards \begingroup - %\settrue\inhibitmargindata % no flushing in here + %\inhibitmargindata\conditionaltrue % no flushing in here \def\currentmargindata{#name}% \let\currentmarginframed\currentmargindata \ifparameter#dataparameters\or \setupcurrentmargindata[#dataparameters]% \fi - % \doifelsenothing{#content}\donefalse\donetrue - % \doifelsetext{#content}\donetrue\donefalse \ifparameter#content\donefalse\or\donetrue\else\donefalse\fi \global\advanceby\c_typo_margins_n\plusone \ifdone @@ -209,7 +207,7 @@ \dotagmargintext\c_typo_margins_n \ifcsname\currentmarginframedhash\s!parent\endcsname \setbox\nextbox\naturalhbox \currentmarginreference \bgroup - \the\everymargindatacontent + \expand\everymargindatacontent \usemargindatastyleandcolor\c!style\c!color \setupcurrentmarginframed[\c!location=\v!normal,#textparameters]% \typo_margins_data_synchronize @@ -229,7 +227,7 @@ \ifempty\currentmargindatawidth \setbox\nextbox\naturalhbox \currentmarginreference \bgroup \typo_margins_data_synchronize - \the\everymargindatacontent + \expand\everymargindatacontent \usemargindatastyleandcolor\c!style\c!color \ifempty\currentmargindatastrut \else \synchronizestrut\currentmargindatastrut @@ -245,7 +243,7 @@ \typo_margins_data_synchronize \dosetraggedcommand{\margindataparameter\c!align}% \vtop \bgroup - \the\everymargindatacontent + \expand\everymargindatacontent \usemargindatastyleandcolor\c!style\c!color \hsize\currentmargindatawidth \raggedcommand @@ -409,8 +407,8 @@ % The following sort of works okay but is to be avoided ... it will disappear from lmtx: -\permanent\tolerant\protected\def\defineinmargin[#name]#spacer[#location]#spacer[#align]#spacer[#settings]% not completely compatible - {\ifarguments\else +\permanent\tolerant\protected\def\defineinmargin[#name]#spacer[#location]#spacer[#align]#spacer[#S#settings]% not completely compatible + {\ifparameter#1\else \definemargindata[#name][\c!location=#location,\c!align=#align,#settings]% \definemarginframed[#name][#location][\c!align=#align,#settings]% \fi} @@ -469,7 +467,7 @@ \executeifdefined{\headalternativeparameter\c!margintext}\margintext { \ifconditional\headshownumber \headnumbercontent - \hskip\headnumberdistance + \hkern\headnumberdistance \fi \headtextcontent } diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.lmt index 5834f9ff06a..167856beea1 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.lmt @@ -20,9 +20,8 @@ local nuts = nodes.nuts local tonut = nodes.tonut local tonode = nodes.tonode -local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc +local glyph_code = nodes.nodecodes.glyph +local disc_code = nodes.nodecodes.disc local getnext = nuts.getnext local getid = nuts.getid @@ -36,16 +35,17 @@ local setfont = nuts.setfont local nextnode = nuts.traversers.node -local unsetvalue = attributes.unsetvalue local prvattribute = attributes.private local texgetbox = tex.getbox local currentfont = font.current -local a_overloads = attributes.private("overloads") local n_overloads = 0 local t_overloads = { } +local a_overloads = prvattribute("overloads") +local unsetvalue = attributes.unsetvalue + local overloaded = { } local function markasoverload(a) diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt index f8ba6822253..fea0ad3c704 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt @@ -16,14 +16,14 @@ local parbuilders = builders.paragraphs local nodes = nodes local nodecodes = nodes.nodecodes -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local glue_code = nodecodes.glue -local kern_code = nodecodes.kern -local penalty_code = nodecodes.penalty - -local unsetvalue = attributes.unsetvalue -local a_keeptogether = attributes.private("keeptogether") +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local glue_code = nodecodes.glue +local kern_code = nodecodes.kern +local penalty_code = nodecodes.penalty + +local unsetvalue = attributes.unsetvalue +local a_keeptogether = attributes.private("keeptogether") local nuts = nodes.nuts diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-plc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-plc.mkxl index e6e90db73c8..521a341a6bf 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-plc.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-plc.mkxl @@ -21,7 +21,7 @@ \permanent\protected\def\placeholder[#1]% {\begingroup - \edef\currentplaceholder{#1}% + \cdef\currentplaceholder{#1}% \placeholderparameter\c!before \useplaceholderstyleandcolor\c!style\c!color \placeholderparameter\c!text diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt index 090cbb5b622..75b5b727a7a 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt @@ -14,12 +14,6 @@ local enableaction = nodes.tasks.enableaction local nuts = nodes.nuts local tonut = nodes.tonut -local nodecodes = nodes.nodecodes -local gluecodes = nodes.gluecodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue -local spaceskip_code = gluecodes.spaceskip - local new_kern = nuts.pool.kern local insertafter = nuts.insertafter @@ -36,15 +30,19 @@ local getwidth = nuts.getwidth local setwidth = nuts.setwidth local findattribute = nuts.findattribute -local glyph_code = nodes.nodecodes.glyph +local glyph_code = nodes.nodecodes.glyph +local glue_code = nodes.nodecodes.glue +local spaceskip_code = nodes.gluecodes.spaceskip local parameters = fonts.hashes.parameters local categories = characters.categories local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue -local period = 0x2E +local unsetvalue = attributes.unsetvalue + +local period = 0x2E + local factor = 0.5 -- alternative: tex.getlccode and tex.getuccode @@ -62,7 +60,8 @@ trackers.register("typesetters.periodkerns",function(v) trace = v end) periodkerns.mapping = periodkerns.mapping or { } periodkerns.factors = periodkerns.factors or { } -local a_periodkern = attributes.private("periodkern") + +local a_periodkern = attributes.private("periodkern") storage.register("typesetters/periodkerns/mapping", periodkerns.mapping, "typesetters.periodkerns.mapping") storage.register("typesetters/periodkerns/factors", periodkerns.factors, "typesetters.periodkerns.factors") diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl index aceab268523..686740c5c28 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl @@ -28,7 +28,7 @@ \installcommandhandler \??periodkerning {periodkerning} \??periodkerning \permanent\protected\def\setperiodkerning[#1]% - {\edef\currentperiodkerning{#1}% + {\cdef\currentperiodkerning{#1}% \ifx\currentperiodkerning\s!reset \resetperiodkerning \else diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-prc.mklx b/Master/texmf-dist/tex/context/base/mkxl/typo-prc.mklx index f9a8f8e5efb..b69f9df821d 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-prc.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-prc.mklx @@ -66,7 +66,7 @@ %D \LUA\ end we do check for a processor being registered anyway. \permanent\protected\def\applyprocessor#tag% - {\def\currentprocessor{#tag}% + {\cdef\currentprocessor{#tag}% \ifcsname\??processorcheck\currentprocessor\endcsname \expandafter\typo_processor_apply \else diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-rep.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-rep.lmt index 683b483efda..930a27cf975 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-rep.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-rep.lmt @@ -37,12 +37,11 @@ local nodecodes = nodes.nodecodes local chardata = characters.data local collected = false -local a_stripping = attributes.private("stripping") - local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue -local v_reset = interfaces.variables.reset +local a_stripping = attributes.private("stripping") +local unsetvalue = attributes.unsetvalue +local v_reset = interfaces.variables.reset -- todo: other namespace -> typesetters diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt index 0de0221ef83..9f48c7d3ce4 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt @@ -24,12 +24,12 @@ local implement = interfaces.implement local texsetattribute = tex.setattribute -local v_flushleft = variables.flushleft -local v_middle = variables.middle -local v_flushright = variables.flushright -local v_yes = variables.yes -local v_no = variables.no -local v_auto = variables.auto +local v_flushleft = variables.flushleft +local v_middle = variables.middle +local v_flushright = variables.flushright +local v_yes = variables.yes +local v_no = variables.no +local v_auto = variables.auto local nuts = nodes.nuts @@ -54,18 +54,19 @@ local takebox = nuts.takebox local nextlist = nuts.traversers.list local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local disc_code = nodecodes.disc -local kern_code = nodecodes.kern -local glue_code = nodecodes.glue -local penalty_code = nodecodes.penalty -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local par_code = nodecodes.par -local dir_code = nodecodes.dir - local kerncodes = nodes.kerncodes -local fontkern_code = kerncodes.font + +local glyph_code = nodecodes.glyph +local disc_code = nodecodes.disc +local kern_code = nodecodes.kern +local glue_code = nodecodes.glue +local penalty_code = nodecodes.penalty +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local par_code = nodecodes.par +local dir_code = nodecodes.dir + +local fontkern_code = kerncodes.font local nodepool = nuts.pool local new_kern = nodepool.kern @@ -80,7 +81,7 @@ local enableaction = nodes.tasks.enableaction local nofrubies = 0 local rubylist = { } -local a_ruby = attributes.private("ruby") +local a_ruby = attributes.private("ruby") local rubies = { } typesetters.rubies = rubies diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl index 79760c32880..8e5d12e7feb 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl @@ -43,7 +43,7 @@ {\dontleavehmode \begingroup \enforced\let\ruby\noruby - \edef\currentruby{#1}% + \cdef\currentruby{#1}% \edef\p_location{\rubyparameter\c!location}% % \enforced\let|\relax \enforced\letcharcode\barasciicode\relax @@ -111,7 +111,7 @@ {\dontleavehmode \begingroup \enforced\aliased\startruby\begingroup - \edef\currentruby{#1}% + \cdef\currentruby{#1}% \clf_startruby align {\rubyparameter\c!align}% stretch {\rubyparameter\c!stretch}% diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-scr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-scr.mkxl index 159b0be6b58..74abe5a45ba 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-scr.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-scr.mkxl @@ -76,7 +76,7 @@ \protected\def\typo_scripts_low[#1]#2% {\dontleavehmode \begingroup - \edef\currentlow{#1}% + \cdef\currentlow{#1}% \typo_scripts_distance\lowparameter \setbox\scratchbox\runninghbox\bgroup \lower\lowparameter\c!down\hbox\bgroup @@ -102,7 +102,7 @@ \protected\def\typo_scripts_high[#1]#2% {\dontleavehmode \begingroup - \edef\currenthigh{#1}% + \cdef\currenthigh{#1}% \typo_scripts_distance\highparameter \setbox\scratchbox\runninghbox\bgroup \raise\highparameter\c!up\hbox\bgroup @@ -162,7 +162,7 @@ \tolerant\protected\def\typo_scripts_lowhigh[#1]#*[#2]#:#3#4% todo: align .. [#1] is compatible hack {\dontleavehmode \runninghbox\bgroup - \edef\currentlowhigh{#1}% + \cdef\currentlowhigh{#1}% \typo_scripts_distance\lowhighparameter \dostarttagged\t!subsup\currentlowhigh \setbox\plusfour\hpack{\typo_scripts_lowhigh_low_high\lower\c!down\t!sub{#3}}% @@ -251,7 +251,7 @@ \protected\def\typo_scripts_lowmidhigh[#1]#2#3#4% {\dontleavehmode \runninghbox\bgroup - \edef\currentlowmidhigh{#1}% + \cdef\currentlowmidhigh{#1}% \dostarttagged\t!subsup\currentlowmidhigh \uselowmidhighstyleandcolor\c!style\c!color \setstrut diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt index 139468a1929..6e88c2f2367 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt @@ -24,7 +24,7 @@ local scaninteger = scan.integer local scanboolean = scan.boolean local scanstring = scan.string -local bpfactor = number.dimenfactors.bp +local bpfactor = number.dimenfactors.bp local context = context diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl index 12d3c0115a8..7dd1949e0d9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl @@ -152,16 +152,17 @@ \relax \pushparagraphtweak{shift}}} -\permanent\protected\tolerant\def\startshapedparagraph[#1]% no grouping +\permanent\protected\tolerant\def\startshapedparagraph[#S#1]% no grouping {\begingroup \lettonothing\currentshapedparagraph \setupshapedparagraph[#1]% \setlocalhsize - \doifsomething{\shapedparagraphparameter\c!text} - {\global\setbox\b_spac_shapes\vpack\bgroup - \forgetall - \shapedparagraphparameter\c!text - \egroup}% + \ifempty{\shapedparagraphparameter\c!text}\else + \global\setbox\b_spac_shapes\vpack\bgroup + \forgetall + \shapedparagraphparameter\c!text + \egroup + \fi \ifvoid\b_spac_shapes \ifnum\shapedparagraphparameter\c!lines>\zerocount \spac_shapes_lines @@ -181,7 +182,7 @@ \newbox \shapetextbox \newinteger\shapetextindex -\permanent\protected\def\startshapetext[#1]% +\permanent\protected\def\startshapetext[#S#1]% {\begingroup \global\shapetextindex\zerocount \global\setbox\shapetextbox\vbox\bgroup diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt index f06ac7913d8..a7bbbae437c 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt @@ -19,7 +19,10 @@ local chardata = fonthashes.characters local quaddata = fonthashes.quads local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue + +local unsetvalue = attributes.unsetvalue + +local xscaled = font.xscaled local v_reset = interfaces.variables.reset @@ -29,6 +32,7 @@ local getnext = nuts.getnext local getprev = nuts.getprev local getattr = nuts.getattr local isglyph = nuts.isglyph +local getlanguage = nuts.getlanguage local insertnodebefore = nuts.insertbefore local insertnodeafter = nuts.insertafter @@ -41,8 +45,7 @@ local nodepool = nuts.pool local new_penalty = nodepool.penalty local new_glue = nodepool.glue -local nodecodes = nodes.nodecodes -local math_code = nodecodes.math +local math_code = nodes.nodecodes.math local somespace = nodes.somespace local somepenalty = nodes.somepenalty @@ -58,7 +61,7 @@ local spacings = typesetters.spacings spacings.mapping = spacings.mapping or { } spacings.numbers = spacings.numbers or { } -local a_spacings = attributes.private("spacing") +local a_spacings = attributes.private("spacing") storage.register("typesetters/spacings/mapping", spacings.mapping, "typesetters.spacings.mapping") @@ -75,7 +78,6 @@ end function spacings.handler(head) local _, start = findattribute(head, a_spacings) if start then - local done = false -- head is always begin of par (whatsit), so we have at least two prev nodes -- penalty followed by glue while start do @@ -87,79 +89,82 @@ function spacings.handler(head) if data then local map = data.characters[char] if map then - local font = id - local left = map.left - local right = map.right - local alternative = map.alternative - local quad = quaddata[font] - local prev = getprev(start) - if not chardata[font][char] then - report_spacing("missing character %C in font %i",char,font) - end - if left and left ~= 0 and prev then - local ok = false - local prevprev = getprev(prev) - if alternative == 1 then - if somespace(prev,true) then - if somepenalty(prevprev,10000) then - if trace_spacing then - report_spacing("removing penalty and space before %C (left)",char) - end - head = remove_node(head,prev,true) - head = remove_node(head,prevprev,true) - else - if trace_spacing then - report_spacing("removing space before %C (left)",char) + local language = data.language or 0 +-- if language == 0 or languages.registered[language].number == getlanguage(start) then + if language == 0 or languages.numbers[language] == getlanguage(start) then + local font = id + local left = map.left + local right = map.right + local alternative = map.alternative + local quad = xscaled(quaddata[font]) + local prev = getprev(start) + if not chardata[font][char] then + report_spacing("missing character %C in font %i",char,font) + end + if left and left ~= 0 and prev then + local ok = false + local prevprev = getprev(prev) + if alternative == 1 then + if somespace(prev,true) then + if somepenalty(prevprev,10000) then + if trace_spacing then + report_spacing("removing penalty and space before %C (left)",char) + end + head = remove_node(head,prev,true) + head = remove_node(head,prevprev,true) + else + if trace_spacing then + report_spacing("removing space before %C (left)",char) + end + head = remove_node(head,prev,true) end - head = remove_node(head,prev,true) end + ok = true + else + ok = not (somespace(prev,true) and somepenalty(prevprev,true)) or somespace(prev,true) end - ok = true - else - ok = not (somespace(prev,true) and somepenalty(prevprev,true)) or somespace(prev,true) - end - if ok then - if trace_spacing then - report_spacing("inserting penalty and space before %C (left)",char) + if ok then + if trace_spacing then + report_spacing("inserting penalty and space before %C (left)",char) + end + insertnodebefore(head,start,new_penalty(10000)) + insertnodebefore(head,start,new_glue(left*quad)) end - insertnodebefore(head,start,new_penalty(10000)) - insertnodebefore(head,start,new_glue(left*quad)) end - end - local next = getnext(start) - if right and right ~= 0 and next then - local ok = false - local nextnext = getnext(next) - if alternative == 1 then - if somepenalty(next,10000) then - if somespace(nextnext,true) then + local next = getnext(start) + if right and right ~= 0 and next then + local ok = false + local nextnext = getnext(next) + if alternative == 1 then + if somepenalty(next,10000) then + if somespace(nextnext,true) then + if trace_spacing then + report_spacing("removing penalty and space after %C right",char) + end + head = remove_node(head,next,true) + head = remove_node(head,nextnext,true) + end + elseif somespace(next,true) then if trace_spacing then - report_spacing("removing penalty and space after %C right",char) + report_spacing("removing space after %C (right)", char) end head = remove_node(head,next,true) - head = remove_node(head,nextnext,true) end - elseif somespace(next,true) then + ok = true + else + ok = not (somepenalty(next,10000) and somespace(nextnext,true)) or somespace(next,true) + end + if ok then if trace_spacing then - report_spacing("removing space after %C (right)", char) + report_spacing("inserting penalty and space after %C (right)",char) end - head = remove_node(head,next,true) + insertnodeafter(head,start,new_glue(right*quad)) + insertnodeafter(head,start,new_penalty(10000)) end - ok = true - else - ok = not (somepenalty(next,10000) and somespace(nextnext,true)) or somespace(next,true) - end - if ok then - if trace_spacing then - report_spacing("inserting penalty and space after %C (right)",char) - end - insertnodeafter(head,start,new_glue(right*quad)) - insertnodeafter(head,start,new_penalty(10000)) end end end end - done = true end elseif id == math_code then start = endofmath(start) -- weird, can return nil .. no math end? @@ -168,19 +173,16 @@ function spacings.handler(head) start = getnext(start) end end - if done then - -- unsetattributes(a_spacings,head) - end end return head end local enabled = false -function spacings.define(name) +function spacings.define(name,parent) local data = numbers[name] if data then - -- error + -- error, already defined else local number = #mapping + 1 local data = { @@ -190,6 +192,10 @@ function spacings.define(name) } mapping[number] = data numbers[name] = data + if parent and parent ~= "" then + -- could be dynamic i.e. metatable inheritance but maybe only as option + table.merge(data.characters,unpack(utilities.parsers.settings_to_array(parent))) + end end end @@ -197,8 +203,12 @@ function spacings.setup(name,char,settings) local data = numbers[name] if not data then -- error - else + elseif char > 0 then data.characters[char] = settings + else + for k, v in next, settings do + data[k] = v + end end end @@ -241,6 +251,7 @@ implement { { "left", "number" }, { "right", "number" }, { "alternative", "integer" }, + { "language", "string" }, } } } diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.mkxl index 42825b02272..2a1c7f2b856 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.mkxl @@ -32,23 +32,34 @@ \setup_p_characterspacing [\c!left=0, \c!right=0, - \c!alternative=0] + \c!alternative=0, + \c!language=0] -\permanent\protected\def\definecharacterspacing[#1]% - {\clf_definecharacterspacing{#1}} +\permanent\tolerant\protected\def\definecharacterspacing[#1]#*[#2]% + {\clf_definecharacterspacing{#1}{#2}} -\permanent\tolerant\protected\def\setupcharacterspacing[#1]#*[#2]#*[#3]% todo: #2 list +\permanent\tolerant\protected\def\setupcharacterspacing[#1]#*[#S#2]#*[#S#3]% todo: #2 list {\begingroup - \setupcurrent_p_characterspacing[#3]% - \clf_setupcharacterspacing - {#1}% - \numexpr#2\relax - {% - left \direct_p_characterspacingparameter\c!left\space - right \direct_p_characterspacingparameter\c!right\space - alternative \direct_p_characterspacingparameter\c!alternative - }% - \relax + \ifchknumber#2\or + \setupcurrent_p_characterspacing[#3]% + \clf_setupcharacterspacing + {#1}% + \numexpr#2\relax + {% + left \direct_p_characterspacingparameter\c!left\space + right \direct_p_characterspacingparameter\c!right\space + alternative \direct_p_characterspacingparameter\c!alternative\space + }% + \relax + \else + \setupcurrent_p_characterspacing[#2]% + \clf_setupcharacterspacing + {#1}% + \zerocount + {% + language {\direct_p_characterspacingparameter\c!language}% + }% + \fi \endgroup} \permanent\protected\def\setcharacterspacing[#1]% we can store the attribute if we want speed @@ -75,4 +86,9 @@ \setupcharacterspacing [frenchpunctuation] ["00AB] [\c!right=.25,\c!alternative=1] % guillemotleft/leftguillemot % strip following space(char) \setupcharacterspacing [frenchpunctuation] ["00BB] [\c!left =.25,\c!alternative=1] % guillemotright/rightguillemot % strip preceding space(char) +% \definecharacterspacing [myspacing][frenchspacing] +% +% \setupcharacterspacing [myspacing] ["27E8] [alternative=1,right=0.25] +% \setupcharacterspacing [myspacing] ["27E9] [alternative=1,left=0.25] + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt index b8d0d1cd97e..95af214b5e9 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt @@ -31,13 +31,13 @@ local categories = characters.categories local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local kern_code = nodecodes.kern -local penalty_code = nodecodes.penalty -local glue_code = nodecodes.glue -local math_code = nodecodes.math -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist +local glyph_code = nodecodes.glyph +local kern_code = nodecodes.kern +local penalty_code = nodecodes.penalty +local glue_code = nodecodes.glue +local math_code = nodecodes.math +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist local nuts = nodes.nuts @@ -70,11 +70,13 @@ local new_kern = nodepool.kern local new_hlist = nodepool.hlist ----- new_penalty = nodepool.penalty -local a_characters = attributes.private("characters") -local a_suspecting = attributes.private('suspecting') -local a_suspect = attributes.private('suspect') +local a_characters = attributes.private("characters") +local a_suspecting = attributes.private('suspecting') +local a_suspect = attributes.private('suspect') + +local unsetvalue = attributes.unsetvalue + local texsetattribute = tex.setattribute -local unsetvalue = attributes.unsetvalue local enabled = false local enableaction = nodes.tasks.enableaction @@ -261,19 +263,25 @@ end local function showsuspects(head) -- we inject before so we're okay with a loop + local pickup = false for current, id, subtype in nextnode, head do - if id == glyph_code then + if current == pickup then + pickup = false + elseif id == glyph_code then local a = getattr(current,a_suspect) if a then - head, current = mark(head,current,id,colors[a]) + head = mark(head,current,id,colors[a]) end elseif id == glue_code then local a = getattr(current,a_suspect) if a then - head, current = mark(head,current,id,colors[a]) + head = mark(head,current,id,colors[a]) end elseif id == math_code then - current = endofmath(current) + pickup = endofmath(current) + if pickup == current then + pickup = false + end elseif id == hlist_code or id == vlist_code then local list = getlist(current) if list then diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-sus.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-sus.mkxl index 7b62b8acac4..8a52d1f525e 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-sus.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-sus.mkxl @@ -18,6 +18,8 @@ \registerctxluafile{typo-sus}{} +\unprotect + \permanent\protected\def\showsuspects{\enabletrackers[typesetters.suspects]} %D The suspicious spacing will be colored in the text. There can be false @@ -47,5 +49,5 @@ %D \showsample{foo\nobreakspace bar} %D \stoptabulate -\endinput +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt index 53e5763919a..953a3448266 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt @@ -57,36 +57,38 @@ local flushnode = nuts.flush local traverselist = nuts.traverselist local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local rule_code = nodecodes.rule -local dir_code = nodecodes.dir -local disc_code = nodecodes.disc -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist -local math_code = nodecodes.math -local glue_code = nodecodes.glue -local kern_code = nodecodes.kern -local penalty_code = nodecodes.penalty - -local line_code = nodes.listcodes.line -local fontkern_code = nodes.kerncodes.fontkern -local parfillskip_code = nodes.gluecodes.parfillrightskip -local baselineskip_code = nodes.gluecodes.baselineskip + +local glyph_code = nodecodes.glyph +local rule_code = nodecodes.rule +local dir_code = nodecodes.dir +local disc_code = nodecodes.disc +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist +local math_code = nodecodes.math +local glue_code = nodecodes.glue +local kern_code = nodecodes.kern +local penalty_code = nodecodes.penalty + +local line_code = nodes.listcodes.line +local fontkern_code = nodes.kerncodes.fontkern +local parfillskip_code = nodes.gluecodes.parfillrightskip +local baselineskip_code = nodes.gluecodes.baselineskip local new_direction = nuts.pool.direction -local runningrule = tex.magicconstants.runningrule +local runningrule = tex.magicconstants.runningrule ----------------- local synchronize = typesetters.synchronize or { } typesetters.synchronize = synchronize or { } -local a_synchronize = attributes.private("synchronize") local registervalue = attributes.registervalue local getvalue = attributes.getvalue local hasvalues = attributes.hasvalues +local a_synchronize = attributes.private("synchronize") + local trace = false -- local trace = true local report = logs.reporter("parallel") @@ -367,8 +369,8 @@ do local getbox = nuts.getbox local setbox = nuts.setbox - local direct_value = tokens.values.direct - local none_value = tokens.values.none + local direct_value = tokens.values.direct + local none_value = tokens.values.none interfaces.implement { name = "hsplit", diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl index 3f71fa43d62..1f964eb2dbe 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl @@ -150,10 +150,10 @@ {\let\typo_sync_rule\vrule} {\let\typo_sync_rule\novrule} -\tolerant\protected\def\typo_synchronize#1#*[#2]#:#3#4% +\tolerant\protected\def\typo_synchronize#1#*[#S#2]#:#3#4% {\dontleavehmode \begingroup - \def\currentsynchronize{#1}% + \cdef\currentsynchronize{#1}% \setupcurrentsynchronize[#2]% \scratchdistance\synchronizeparameter\c!distance \dontcomplain @@ -231,10 +231,10 @@ \endgroup \space} -\tolerant\protected\def\placesynchronize[#1]#*[#2]% +\tolerant\protected\def\placesynchronize[#1]#*[#S#2]% {\dontleavehmode \begingroup - \def\currentsynchronize{#1}% + \cdef\currentsynchronize{#1}% \setupcurrentsynchronize[#2]% \scratchdistance\synchronizeparameter\c!distance \clf_synchronizesteps diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt index e5431cffc6e..8f507ae0326 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt @@ -20,17 +20,15 @@ local utfbyte = utf.byte local splitmethod = utilities.parsers.splitmethod -local nodecodes = nodes.nodecodes -local glyph_code = nodecodes.glyph -local glue_code = nodecodes.glue +local glyph_code = nodes.nodecodes.glyph +local glue_code = nodes.nodecodes.glue local fontcharacters = fonts.hashes.characters ----- unicodes = fonts.hashes.unicodes local categories = characters.categories -- nd -local variables = interfaces.variables -local v_text = variables.text -local v_number = variables.number +local v_text = interfaces.variables.text +local v_number = interfaces.variables.number local nuts = nodes.nuts local tonut = nuts.tonut @@ -69,8 +67,8 @@ typesetters.characteralign = characteralign local trace_split = false trackers.register("typesetters.characteralign", function(v) trace_split = true end) local report = logs.reporter("aligning") -local a_characteralign = attributes.private("characteralign") -local a_character = attributes.private("characters") +local a_characteralign = attributes.private("characteralign") +local a_character = attributes.private("characters") local enabled = false @@ -78,9 +76,9 @@ local datasets = false local implement = interfaces.implement -local comma = 0x002C -local period = 0x002E -local punctuationspace = 0x2008 +local comma = 0x002C +local period = 0x002E +local punctuationspace = 0x2008 local validseparators = { [comma] = true, diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl index f3d9e54e0d3..6b106454540 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl @@ -133,7 +133,7 @@ \def\typo_charalign_pass {\hbox\bgroup\signalcharacteralign\plusone\scratchcounter\let\next} -\permanent\tolerant\protected\def\startcharacteralign[#1]% +\permanent\tolerant\protected\def\startcharacteralign[#S#1]% {\doifelseassignment{#1}\typo_charalign_start_one\typo_charalign_start_two{#1}} \def\typo_charalign_start_one#1#2\stopcharacteralign @@ -249,12 +249,12 @@ [tnum=yes, lnum=no] -\newconditional\c_tabl_ntb_char_align_auto_font \settrue\c_tabl_ntb_char_align_auto_font +\newconditional\c_tabl_ntb_char_align_auto_font \c_tabl_ntb_char_align_auto_font\conditionaltrue \installtexdirective % yes or no ? {typesetters.characteralign.autofont} - {\settrue \c_tabl_ntb_char_align_auto_font} - {\setfalse\c_tabl_ntb_char_align_auto_font} + {\c_tabl_ntb_char_align_auto_font\conditionaltrue} + {\c_tabl_ntb_char_align_auto_font\conditionalfalse} \def\m_font_feature_auto_tabnum{system:tabnum} diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-txt.mklx b/Master/texmf-dist/tex/context/base/mkxl/typo-txt.mklx index 270cc94e028..187908bb974 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-txt.mklx +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-txt.mklx @@ -196,7 +196,7 @@ %D This is used in the beginners manual. One needs to set the font size to an %D acceptable value for this to work. -\permanent\tolerant\protected\def\startnicelyfilledbox[#1]% +\permanent\tolerant\protected\def\startnicelyfilledbox[#S#1]% {\vbox\bgroup \forgetall \letdummyparameter\c!width \hsize @@ -208,22 +208,25 @@ \setbox\scratchbox\vbox to \dummyparameter\c!height \bgroup \hsize\dummyparameter\c!width\relax \emergencystretch10\scratchoffset - \parfillskip\zeropoint + \parfillskip\zeroskip + \parfillleftskip\zeroskip \leftskip \scratchoffset \rightskip\scratchoffset} \permanent\protected\def\stopnicelyfilledbox {\egroup \vbox to \dummyparameter\c!height \bgroup - \doifelse{\dummyparameter\c!strut}\v!yes - {\dorecurse{\boxlines\scratchbox}% - {\boxlineht\scratchbox\recurselevel\strutht - \boxlinedp\scratchbox\recurselevel\strutdp - \boxline\scratchbox\recurselevel - \vss}}% - {\dorecurse{\boxlines\scratchbox}% - {\boxline\scratchbox\recurselevel - \vss}}% + \ifcstok{\dummyparameter\c!strut}\v!yes + \dorecurse{\boxlines\scratchbox}% + {\boxlineht\scratchbox\recurselevel\strutht + \boxlinedp\scratchbox\recurselevel\strutdp + \boxline\scratchbox\recurselevel + \vss}% + \else + \dorecurse{\boxlines\scratchbox}% + {\boxline\scratchbox\recurselevel + \vss}% + \fi \unskip \egroup \egroup} diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt index b77e2753221..f747c035650 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt @@ -8,10 +8,10 @@ if not modules then modules = { } end modules ['typo-wrp'] = { -- begin/end par wrapping stuff ... more to come -local boundary_code = nodes.nodecodes.boundary -local glyph_code = nodes.nodecodes.glyph -local wordboundary_code = nodes.boundarycodes.word -local userboundary_code = nodes.boundarycodes.user +local boundary_code = nodes.nodecodes.boundary +local glyph_code = nodes.nodecodes.glyph +local wordboundary_code = nodes.boundarycodes.word +local userboundary_code = nodes.boundarycodes.user local nuts = nodes.nuts @@ -45,7 +45,7 @@ local report = logs.reporter("paragraphs","wrappers") -- -- ... boundary [strut: hlist] [break: glue penalty] boundary -local a_crlf = attributes.private("crlf") +local a_crlf = attributes.private("crlf") local function remove_dangling_crlf(head,tail) if head and tail then @@ -92,7 +92,7 @@ typesetters.tighten = tighten local trace_tighten trackers.register("typesetters.tighten",function(v) trace_tighten = v end) local report = logs.reporter("typesetters","tighten") -local a_tightfit_boundary = tex.boundaries.system("c_tightfit_boundary") -- private, not defined with \defineboundary +local a_tightfit_boundary = tex.boundaries.system("c_tightfit_boundary") -- private, not defined with \defineboundary local function bbcompensation(font,char) local tfmdata = fontdata[font] @@ -140,7 +140,7 @@ implement { end } -local dimension_value = tokens.values.dimension +local dimension_value = tokens.values.dimension local texgetnest = tex.getnest implement { diff --git a/Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt b/Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt index 73846f2b61c..aeb5faad5a3 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt +++ b/Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt @@ -207,13 +207,7 @@ function debugger.showstats(printer,threshold) realtime = realtime + real end totaltime = totaltime + total - if line < 0 then - line = 0 - end - -- if name = "a" then - -- -- weird name - -- end - dataset[#dataset+1] = { real, total, count, name, source, line } + dataset[#dataset+1] = { real, total, count, name, source, line < 0 and 0 or line } end end end diff --git a/Master/texmf-dist/tex/context/base/mkxl/util-jsn.lmt b/Master/texmf-dist/tex/context/base/mkxl/util-jsn.lmt new file mode 100644 index 00000000000..b49e6e1eb92 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/util-jsn.lmt @@ -0,0 +1,469 @@ +if not modules then modules = { } end modules ['util-jsn'] = { + version = 1.001, + comment = "companion to m-json.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- Of course we could make a nice complete parser with proper error messages but +-- as json is generated programmatically errors are systematic and we can assume +-- a correct stream. If not, we have some fatal error anyway. So, we can just rely +-- on strings being strings (apart from the unicode escape which is not in 5.1) and +-- as we first catch known types we just assume that anything else is a number. +-- +-- Reminder for me: check usage in framework and extend when needed. Also document +-- it in the cld lib documentation. +-- +-- Upgraded for handling the somewhat more fax server templates. + +if utilities and utilities.json then + return json +end + +local P, V, R, S, C, Cc, Cs, Ct, Cg = lpeg.P, lpeg.V, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Ct, lpeg.Cg +----- Cf = lpeg.Cf +local lpegmatch = lpeg.match +local format, gsub = string.format, string.gsub +local formatters = string.formatters +local utfchar = utf.char +local concat, sortedkeys = table.concat, table.sortedkeys + +local tonumber, tostring, rawset, type, next = tonumber, tostring, rawset, type, next + +local json = utilities.json or { } +utilities.json = json + +do + + -- \\ \/ \b \f \n \r \t \uHHHH + + local lbrace = P("{") + local rbrace = P("}") + local lparent = P("[") + local rparent = P("]") + local comma = P(",") + local colon = P(":") + local dquote = P('"') + + local whitespace = lpeg.patterns.whitespace + local optionalws = whitespace^0 + + local escapes = { + ["b"] = "\010", + ["f"] = "\014", + ["n"] = "\n", + ["r"] = "\r", + ["t"] = "\t", + } + + -- todo: also handle larger utf16 + + local escape_un = P("\\u")/"" * (C(R("09","AF","af")^-4) / function(s) + return utfchar(tonumber(s,16)) + end) + + local escape_bs = P([[\]]) / "" * (P(1) / escapes) -- if not found then P(1) is returned i.e. the to be escaped char + + local jstring = dquote * Cs((escape_un + escape_bs + (1-dquote))^0) * dquote + local jtrue = P("true") * Cc(true) + local jfalse = P("false") * Cc(false) + local jnull = P("null") * Cc(nil) + local jnumber = (1-whitespace-rparent-rbrace-comma)^1 / tonumber + + local key = jstring + +-- local jsonconverter = { "value", +-- hash = lbrace * Cf(Ct("") * (V("pair") * (comma * V("pair"))^0 + optionalws),rawset) * rbrace, +-- pair = Cg(optionalws * key * optionalws * colon * V("value")), +-- array = Ct(lparent * (V("value") * (comma * V("value"))^0 + optionalws) * rparent), +-- -- value = optionalws * (jstring + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber + #rparent) * optionalws, +-- value = optionalws * (jstring + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber) * optionalws, +-- } + + local jsonconverter = { "value", + hash = lbrace * Cg(Ct("") * ((V("pair") * (comma * V("pair"))^0 + optionalws))) * rbrace, + pair = ((optionalws * key * optionalws * colon * V("value")) % rawset), + array = Ct(lparent * (V("value") * (comma * V("value"))^0 + optionalws) * rparent), + -- value = optionalws * (jstring + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber + #rparent) * optionalws, + value = optionalws * (jstring + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber) * optionalws, + } + + -- local jsonconverter = { "value", + -- hash = lbrace * Cf(Ct("") * (V("pair") * (comma * V("pair"))^0 + optionalws),rawset) * rbrace, + -- pair = Cg(optionalws * V("string") * optionalws * colon * V("value")), + -- array = Ct(lparent * (V("value") * (comma * V("value"))^0 + optionalws) * rparent), + -- string = jstring, + -- value = optionalws * (V("string") + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber) * optionalws, + -- } + + -- lpeg.print(jsonconverter) -- size 181 + + function json.tolua(str) + return lpegmatch(jsonconverter,str) + end + + function json.load(filename) + local data = io.loaddata(filename) + if data then + return lpegmatch(jsonconverter,data) + end + end + +end + +do + + -- It's pretty bad that JSON doesn't allow the trailing comma ... it's a + -- typical example of a spec that then forces all generators to check for + -- this. It's a way to make sure programmers keep jobs. + + local escaper + + local f_start_hash = formatters[ '%w{' ] + local f_start_array = formatters[ '%w[' ] + local f_start_hash_new = formatters[ "\n" .. '%w{' ] + local f_start_array_new = formatters[ "\n" .. '%w[' ] + local f_start_hash_key = formatters[ "\n" .. '%w"%s" : {' ] + local f_start_array_key = formatters[ "\n" .. '%w"%s" : [' ] + + local f_stop_hash = formatters[ "\n" .. '%w}' ] + local f_stop_array = formatters[ "\n" .. '%w]' ] + + local f_key_val_seq = formatters[ "\n" .. '%w"%s" : %s' ] + local f_key_val_str = formatters[ "\n" .. '%w"%s" : "%s"' ] + local f_key_val_num = f_key_val_seq + local f_key_val_yes = formatters[ "\n" .. '%w"%s" : true' ] + local f_key_val_nop = formatters[ "\n" .. '%w"%s" : false' ] + local f_key_val_null = formatters[ "\n" .. '%w"%s" : null' ] + + local f_val_num = formatters[ "\n" .. '%w%s' ] + local f_val_str = formatters[ "\n" .. '%w"%s"' ] + local f_val_yes = formatters[ "\n" .. '%wtrue' ] + local f_val_nop = formatters[ "\n" .. '%wfalse' ] + local f_val_null = formatters[ "\n" .. '%wnull' ] + local f_val_empty = formatters[ "\n" .. '%w{ }' ] + local f_val_seq = f_val_num + + -- no empty tables because unknown if table or hash + + local t = { } + local n = 0 + + local function is_simple_table(tt) -- also used in util-tab so maybe public + local l = #tt + if l > 0 then + for i=1,l do + if type(tt[i]) == "table" then + return false + end + end + local nn = n + n = n + 1 t[n] = "[ " + for i=1,l do + if i > 1 then + n = n + 1 t[n] = ", " + end + local v = tt[i] + local tv = type(v) + if tv == "number" then + n = n + 1 t[n] = v + elseif tv == "string" then + n = n + 1 t[n] = '"' + n = n + 1 t[n] = lpegmatch(escaper,v) or v + n = n + 1 t[n] = '"' + elseif tv == "boolean" then + n = n + 1 t[n] = v and "true" or "false" + elseif v then + n = n + 1 t[n] = tostring(v) + else + n = n + 1 t[n] = "null" + end + end + n = n + 1 t[n] = " ]" + local s = concat(t,"",nn+1,n) + n = nn + return s + end + return false + end + + local function tojsonpp(root,name,depth,level,size) + if root then + local indexed = size > 0 + n = n + 1 + if level == 0 then + if indexed then + t[n] = f_start_array(depth) + else + t[n] = f_start_hash(depth) + end + elseif name then + if tn == "string" then + name = lpegmatch(escaper,name) or name + elseif tn ~= "number" then + name = tostring(name) + end + if indexed then + t[n] = f_start_array_key(depth,name) + else + t[n] = f_start_hash_key(depth,name) + end + else + if indexed then + t[n] = f_start_array_new(depth) + else + t[n] = f_start_hash_new(depth) + end + end + depth = depth + 1 + if indexed then -- indexed + for i=1,size do + if i > 1 then + n = n + 1 t[n] = "," + end + local v = root[i] + local tv = type(v) + if tv == "number" then + n = n + 1 t[n] = f_val_num(depth,v) + elseif tv == "string" then + v = lpegmatch(escaper,v) or v + n = n + 1 t[n] = f_val_str(depth,v) + elseif tv == "table" then + if next(v) then + local st = is_simple_table(v) + if st then + n = n + 1 t[n] = f_val_seq(depth,st) + else + tojsonpp(v,nil,depth,level+1,#v) + end + else + n = n + 1 + t[n] = f_val_empty(depth) + end + elseif tv == "boolean" then + n = n + 1 + if v then + t[n] = f_val_yes(depth,v) + else + t[n] = f_val_nop(depth,v) + end + else + n = n + 1 + t[n] = f_val_null(depth) + end + end + elseif next(root) then + local sk = sortedkeys(root) + for i=1,#sk do + if i > 1 then + n = n + 1 t[n] = "," + end + local k = sk[i] + local v = root[k] + local tv = type(v) + local tk = type(k) + if tv == "number" then + if tk == "number" then + n = n + 1 t[n] = f_key_val_num(depth,k,v) + elseif tk == "string" then + k = lpegmatch(escaper,k) or k + n = n + 1 t[n] = f_key_val_num(depth,k,v) + end + elseif tv == "string" then + if tk == "number" then + v = lpegmatch(escaper,v) or v + n = n + 1 t[n] = f_key_val_str(depth,k,v) + elseif tk == "string" then + k = lpegmatch(escaper,k) or k + v = lpegmatch(escaper,v) or v + n = n + 1 t[n] = f_key_val_str(depth,k,v) + elseif i > 1 then + n = n - 1 + end + elseif tv == "table" then + local l = #v + if l > 0 then + local st = is_simple_table(v) + if not st then + tojsonpp(v,k,depth,level+1,l) + elseif tk == "number" then + n = n + 1 t[n] = f_key_val_seq(depth,k,st) + elseif tk == "string" then + k = lpegmatch(escaper,k) or k + n = n + 1 t[n] = f_key_val_seq(depth,k,st) + end + elseif next(v) then + tojsonpp(v,k,depth,level+1,0) + elseif i > 1 then + n = n - 1 + -- we don't know if we have a hash or string + end + elseif tv == "boolean" then + if tk == "number" then + n = n + 1 + if v then + t[n] = f_key_val_yes(depth,k) + else + t[n] = f_key_val_nop(depth,k) + end + elseif tk == "string" then + k = lpegmatch(escaper,k) or k + n = n + 1 + if v then + t[n] = f_key_val_yes(depth,k) + else + t[n] = f_key_val_nop(depth,k) + end + elseif i > 1 then + n = n - 1 + end + else + if tk == "number" then + n = n + 1 + t[n] = f_key_val_null(depth,k) + elseif tk == "string" then + k = lpegmatch(escaper,k) or k + n = n + 1 + t[n] = f_key_val_null(depth,k) + elseif i > 1 then + n = n - 1 + end + end + end + end + n = n + 1 + if indexed then + t[n] = f_stop_array(depth-1) + else + t[n] = f_stop_hash(depth-1) + end + end + end + + local function tojson(value,n) + local kind = type(value) + if kind == "table" then + local done = false + local size = #value + if size == 0 then + for k, v in next, value do + if done then + -- n = n + 1 ; t[n] = "," + n = n + 1 ; t[n] = ',"' + else + -- n = n + 1 ; t[n] = "{" + n = n + 1 ; t[n] = '{"' + done = true + end + n = n + 1 ; t[n] = lpegmatch(escaper,k) or k + n = n + 1 ; t[n] = '":' + t, n = tojson(v,n) + end + if done then + n = n + 1 ; t[n] = "}" + else + n = n + 1 ; t[n] = "{}" + end + elseif size == 1 then + -- we can optimize for non tables + n = n + 1 ; t[n] = "[" + t, n = tojson(value[1],n) + n = n + 1 ; t[n] = "]" + else + for i=1,size do + if done then + n = n + 1 ; t[n] = "," + else + n = n + 1 ; t[n] = "[" + done = true + end + t, n = tojson(value[i],n) + end + n = n + 1 ; t[n] = "]" + end + elseif kind == "string" then + n = n + 1 ; t[n] = '"' + n = n + 1 ; t[n] = lpegmatch(escaper,value) or value + n = n + 1 ; t[n] = '"' + elseif kind == "number" then + n = n + 1 ; t[n] = value + elseif kind == "boolean" then + n = n + 1 ; t[n] = tostring(value) + else + n = n + 1 ; t[n] = "null" + end + return t, n + end + + -- escaping keys can become an option + + local function jsontostring(value,pretty) + -- todo optimize for non table + local kind = type(value) + if kind == "table" then + if not escaper then + local escapes = { + ["\\"] = "\\u005C", + ["\""] = "\\u0022", + } + for i=0,0x1F do + escapes[utfchar(i)] = format("\\u%04X",i) + end + escaper = Cs( ( + (R('\0\x20') + S('\"\\')) / escapes + + P(1) + )^1 ) + + end + -- local to the closure (saves wrapping and local functions) + t = { } + n = 0 + if pretty then + tojsonpp(value,name,0,0,#value) + value = concat(t,"",1,n) + else + t, n = tojson(value,0) + value = concat(t,"",1,n) + end + t = nil + n = 0 + return value + elseif kind == "string" or kind == "number" then + return lpegmatch(escaper,value) or value + else + return tostring(value) + end + end + + json.tostring = jsontostring + + function json.tojson(value) + return jsontostring(value,true) + end + +end + +local tmp = [[ { "t\nt t" : "foo bar", "a" : true, "b" : [ 123 , 456E-10, { "a" : true, "b" : [ 123 , 456 ] } ] } ]] +tmp = json.tolua(tmp) +inspect(tmp) +tmp = json.tostring(tmp,true) +inspect(tmp) +tmp = json.tolua(tmp) +inspect(tmp) +tmp = json.tostring(tmp) +inspect(tmp) +inspect(json.tostring(true)) + +-- local s = [[\foo"bar"]] +-- local j = json.tostring { s = s } +-- local l = json.tolua(j) +-- inspect(j) +-- inspect(l) +-- print(s==l.s) + +-- if not package.loaded.json then +-- package.loaded.json = json +-- end + +return json diff --git a/Master/texmf-dist/tex/context/base/mkxl/util-prs.lmt b/Master/texmf-dist/tex/context/base/mkxl/util-prs.lmt new file mode 100644 index 00000000000..9b1d377151b --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkxl/util-prs.lmt @@ -0,0 +1,897 @@ +if not modules then modules = { } end modules ['util-prs'] = { + version = 1.001, + comment = "companion to luat-lib.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local lpeg, table, string = lpeg, table, string +local P, R, V, S, C, Ct, Cs, Carg, Cc, Cp = lpeg.P, lpeg.R, lpeg.V, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg, lpeg.Cc, lpeg.Cp +----- Cg, Cf = lpeg.Cg, lpeg.Cf +local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns +local concat, gmatch, find = table.concat, string.gmatch, string.find +local tonumber, tostring, type, next, rawset = tonumber, tostring, type, next, rawset +local mod, div = math.mod, math.div + +utilities = utilities or {} +local parsers = utilities.parsers or { } +utilities.parsers = parsers +local patterns = parsers.patterns or { } +parsers.patterns = patterns + +local setmetatableindex = table.setmetatableindex +local sortedhash = table.sortedhash +local sortedkeys = table.sortedkeys +local tohash = table.tohash + +local hashes = { } +parsers.hashes = hashes +-- we share some patterns + +local digit = R("09") +local space = P(' ') +local equal = P("=") +local colon = P(":") +local comma = P(",") +local lbrace = P("{") +local rbrace = P("}") +local lparent = P("(") +local rparent = P(")") +local lbracket = P("[") +local rbracket = P("]") +local period = S(".") +local punctuation = S(".,:;") +local spacer = lpegpatterns.spacer +local whitespace = lpegpatterns.whitespace +local newline = lpegpatterns.newline +local anything = lpegpatterns.anything +local endofstring = lpegpatterns.endofstring + +local nobrace = 1 - (lbrace + rbrace ) +local noparent = 1 - (lparent + rparent) +local nobracket = 1 - (lbracket + rbracket) + +-- we could use a Cf Cg construct or from now a % + +local escape, left, right = P("\\"), P('{'), P('}') + +-- lpegpatterns.balanced = P { +-- [1] = ((escape * (left+right)) + (1 - (left+right)) + V(2))^0, +-- [2] = left * V(1) * right +-- } +lpegpatterns.balanced = P { + ((escape * (left+right)) + (1 - (left+right)) + V(2))^0, + left * V(1) * right +} + +local nestedbraces = P { lbrace * (nobrace + V(1))^0 * rbrace } +local nestedparents = P { lparent * (noparent + V(1))^0 * rparent } +local nestedbrackets = P { lbracket * (nobracket + V(1))^0 * rbracket } +local spaces = space^0 +local argument = Cs((lbrace/"") * ((nobrace + nestedbraces)^0) * (rbrace/"")) +local content = (1-endofstring)^0 + +lpegpatterns.nestedbraces = nestedbraces -- no capture +lpegpatterns.nestedparents = nestedparents -- no capture +lpegpatterns.nestedbrackets = nestedbrackets -- no capture +lpegpatterns.nested = nestedbraces -- no capture +lpegpatterns.argument = argument -- argument after e.g. = +lpegpatterns.content = content -- rest after e.g = + +local value = lbrace * C((nobrace + nestedbraces)^0) * rbrace + + C((nestedbraces + (1-comma))^0) + +local key = C((1-equal-comma)^1) +local pattern_a = (space+comma)^0 * (key * equal * value + key * C("")) +local pattern_c = (space+comma)^0 * (key * equal * value) +local pattern_d = (space+comma)^0 * (key * (equal+colon) * value + key * C("")) + +local key = C((1-space-equal-comma)^1) +local pattern_b = spaces * comma^0 * spaces * (key * ((spaces * equal * spaces * value) + C(""))) + +-- "a=1, b=2, c=3, d={a{b,c}d}, e=12345, f=xx{a{b,c}d}xx, g={}" : outer {} removes, leading spaces ignored + +local hash = { } + +local function set(key,value) + hash[key] = value +end + +local pattern_a_s = (pattern_a/set)^1 +local pattern_b_s = (pattern_b/set)^1 +local pattern_c_s = (pattern_c/set)^1 +local pattern_d_s = (pattern_d/set)^1 + +patterns.settings_to_hash_a = pattern_a_s +patterns.settings_to_hash_b = pattern_b_s +patterns.settings_to_hash_c = pattern_c_s +patterns.settings_to_hash_d = pattern_d_s + +function parsers.make_settings_to_hash_pattern(set,how) + if how == "strict" then + return (pattern_c/set)^1 + elseif how == "tolerant" then + return (pattern_b/set)^1 + else + return (pattern_a/set)^1 + end +end + +function parsers.settings_to_hash(str,existing) + if not str or str == "" then + return { } + elseif type(str) == "table" then + if existing then + for k, v in next, str do + existing[k] = v + end + return exiting + else + return str + end + else + hash = existing or { } + lpegmatch(pattern_a_s,str) + return hash + end +end + +function parsers.settings_to_hash_colon_too(str) + if not str or str == "" then + return { } + elseif type(str) == "table" then + return str + else + hash = { } + lpegmatch(pattern_d_s,str) + return hash + end +end + +function parsers.settings_to_hash_tolerant(str,existing) + if not str or str == "" then + return { } + elseif type(str) == "table" then + if existing then + for k, v in next, str do + existing[k] = v + end + return exiting + else + return str + end + else + hash = existing or { } + lpegmatch(pattern_b_s,str) + return hash + end +end + +function parsers.settings_to_hash_strict(str,existing) + if not str or str == "" then + return nil + elseif type(str) == "table" then + if existing then + for k, v in next, str do + existing[k] = v + end + return exiting + else + return str + end + elseif str and str ~= "" then + hash = existing or { } + lpegmatch(pattern_c_s,str) + return next(hash) and hash + end +end + +local separator = comma * space^0 +local value = lbrace * C((nobrace + nestedbraces)^0) * rbrace + + C((nestedbraces + (1-comma))^0) +local pattern = spaces * Ct(value*(separator*value)^0) + +-- "aap, {noot}, mies" : outer {} removed, leading spaces ignored + +patterns.settings_to_array = pattern + +-- we could use a weak table as cache + +function parsers.settings_to_array(str,strict) + if not str or str == "" then + return { } + elseif type(str) == "table" then + return str + elseif strict then + if find(str,"{",1,true) then + return lpegmatch(pattern,str) + else + return { str } + end + elseif find(str,",",1,true) then + return lpegmatch(pattern,str) + else + return { str } + end +end + +function parsers.settings_to_numbers(str) + if not str or str == "" then + return { } + end + if type(str) == "table" then + -- fall through + elseif find(str,",",1,true) then + str = lpegmatch(pattern,str) + else + return { tonumber(str) } + end + for i=1,#str do + str[i] = tonumber(str[i]) + end + return str +end + +local value = lbrace * C((nobrace + nestedbraces)^0) * rbrace + + C((nestedbraces + nestedbrackets + nestedparents + (1-comma))^0) +local pattern = spaces * Ct(value*(separator*value)^0) + +function parsers.settings_to_array_obey_fences(str) + return lpegmatch(pattern,str) +end + +-- inspect(parsers.settings_to_array_obey_fences("url(http://a,b.c)")) + +-- this one also strips end spaces before separators +-- +-- "{123} , 456 " -> "123" "456" + +-- local separator = space^0 * comma * space^0 +-- local value = P(lbrace * C((nobrace + nestedbraces)^0) * rbrace) +-- + C((nestedbraces + (1-(space^0*(comma+P(-1)))))^0) +-- local withvalue = Carg(1) * value / function(f,s) return f(s) end +-- local pattern_a = spaces * Ct(value*(separator*value)^0) +-- local pattern_b = spaces * withvalue * (separator*withvalue)^0 + +local cache_a = { } +local cache_b = { } + +function parsers.groupedsplitat(symbol,withaction) + if not symbol then + symbol = "," + end + local pattern = (withaction and cache_b or cache_a)[symbol] + if not pattern then + local symbols = S(symbol) + local separator = space^0 * symbols * space^0 + local value = + lbrace + * C((nobrace + nestedbraces)^0) + -- * rbrace + * (rbrace * (#symbols + P(-1))) -- new per 2023-03-11 + + + C((nestedbraces + (1-(space^0*(symbols+P(-1)))))^0) + if withaction then + local withvalue = Carg(1) * value / function(f,s) return f(s) end + pattern = spaces * withvalue * (separator*withvalue)^0 + cache_b[symbol] = pattern + else + pattern = spaces * Ct(value*(separator*value)^0) + cache_a[symbol] = pattern + end + end + return pattern +end + +local pattern_a = parsers.groupedsplitat(",",false) +local pattern_b = parsers.groupedsplitat(",",true) + +function parsers.stripped_settings_to_array(str) + if not str or str == "" then + return { } + else + return lpegmatch(pattern_a,str) + end +end + +function parsers.process_stripped_settings(str,action) + if not str or str == "" then + return { } + else + return lpegmatch(pattern_b,str,1,action) + end +end + +-- parsers.process_stripped_settings("{123} , 456 ",function(s) print("["..s.."]") end) +-- parsers.process_stripped_settings("123 , 456 ",function(s) print("["..s.."]") end) + +local function set(t,v) + t[#t+1] = v +end + +local value = P(Carg(1)*value) / set +local pattern = value*(separator*value)^0 * Carg(1) + +function parsers.add_settings_to_array(t,str) + return lpegmatch(pattern,str,nil,t) +end + +function parsers.hash_to_string(h,separator,yes,no,strict,omit) + if h then + local t = { } + local tn = 0 + local s = sortedkeys(h) + omit = omit and tohash(omit) + for i=1,#s do + local key = s[i] + if not omit or not omit[key] then + local value = h[key] + if type(value) == "boolean" then + if yes and no then + if value then + tn = tn + 1 + t[tn] = key .. '=' .. yes + elseif not strict then + tn = tn + 1 + t[tn] = key .. '=' .. no + end + elseif value or not strict then + tn = tn + 1 + t[tn] = key .. '=' .. tostring(value) + end + else + tn = tn + 1 + t[tn] = key .. '=' .. value + end + end + end + return concat(t,separator or ",") + else + return "" + end +end + +function parsers.array_to_string(a,separator) + if a then + return concat(a,separator or ",") + else + return "" + end +end + +-- function parsers.settings_to_set(str,t) -- tohash? -- todo: lpeg -- duplicate anyway +-- if str then +-- t = t or { } +-- for s in gmatch(str,"[^, ]+") do -- space added +-- t[s] = true +-- end +-- return t +-- else +-- return { } +-- end +-- end + +----- pattern = Cf(Ct("") * Cg(C((1-S(", "))^1) * S(", ")^0 * Cc(true) )^1,rawset) +local pattern = Ct("") * (C((1-S(", "))^1) * S(", ")^0 * Cc(true) % rawset)^1 + +function parsers.settings_to_set(str) + return str and lpegmatch(pattern,str) or { } +end + +hashes.settings_to_set = table.setmetatableindex(function(t,k) -- experiment, not public + local v = k and lpegmatch(pattern,k) or { } + t[k] = v + return v +end) + +function parsers.settings_to_set(str) + return str and lpegmatch(pattern,str) or { } +end + +local pattern = Ct((C((1-S(", "))^1) * S(", ")^0)^1) + +hashes.settings_to_list = table.setmetatableindex(function(t,k) -- experiment, not public + local v = k and lpegmatch(pattern,k) or { } + t[k] = v + return v +end) + +-- inspect(hashes.settings_to_set["a,b, c, d"]) +-- inspect(hashes.settings_to_list["a,b, c, d"]) + +-- as we use a next, we are not sure when the gc kicks in + +getmetatable(hashes.settings_to_set ).__mode = "kv" -- could be an option (maybe sharing makes sense) +getmetatable(hashes.settings_to_list).__mode = "kv" -- could be an option (maybe sharing makes sense) + +function parsers.simple_hash_to_string(h, separator) + local t = { } + local tn = 0 + for k, v in sortedhash(h) do + if v then + tn = tn + 1 + t[tn] = k + end + end + return concat(t,separator or ",") +end + +local str = Cs(lpegpatterns.unquoted) + C((1-whitespace-equal)^1) +----- setting = Cf( Carg(1) * (whitespace^0 * Cg(str * whitespace^0 * (equal * whitespace^0 * str + Cc(""))))^1,rawset) +local setting = Carg(1) * (whitespace^0 * (str * whitespace^0 * (equal * whitespace^0 * str + Cc(""))) % rawset)^1 +local splitter = setting^1 + +function parsers.options_to_hash(str,target) + return str and lpegmatch(splitter,str,1,target or { }) or { } +end + +-- inspect(parsers.options_to_hash([[aaaa bbbb cccc=dddd eeee=ffff]])) -- mtx-context + +local splitter = lpeg.tsplitat(" ") + +function parsers.options_to_array(str) + return str and lpegmatch(splitter,str) or { } +end + +-- for chem (currently one level) + +local value = P(lbrace * C((nobrace + nestedbraces)^0) * rbrace) + + C(digit^1 * lparent * (noparent + nestedparents)^1 * rparent) + + C((nestedbraces + (1-comma))^1) + + Cc("") -- new +local pattern_a = spaces * Ct(value*(separator*value)^0) + +local function repeater(n,str) + if not n then + return str + else + local s = lpegmatch(pattern_a,str) + if n == 1 then + return unpack(s) + else + local t = { } + local tn = 0 + for i=1,n do + for j=1,#s do + tn = tn + 1 + t[tn] = s[j] + end + end + return unpack(t) + end + end +end + +local value = P(lbrace * C((nobrace + nestedbraces)^0) * rbrace) + + (C(digit^1)/tonumber * lparent * Cs((noparent + nestedparents)^1) * rparent) / repeater + + C((nestedbraces + (1-comma))^1) + + Cc("") -- new +local pattern_b = spaces * Ct(value*(separator*value)^0) + +function parsers.settings_to_array_with_repeat(str,expand) -- beware: "" => { } + if expand then + return lpegmatch(pattern_b,str) or { } + else + return lpegmatch(pattern_a,str) or { } + end +end + +-- + +local value = lbrace * C((nobrace + nestedbraces)^0) * rbrace +local pattern = Ct((space + value)^0) + +function parsers.arguments_to_table(str) + return lpegmatch(pattern,str) +end + +-- temporary here (unoptimized) + +function parsers.getparameters(self,class,parentclass,settings) + local sc = self[class] + if not sc then + sc = { } + self[class] = sc + if parentclass then + local sp = self[parentclass] + if not sp then + sp = { } + self[parentclass] = sp + end + setmetatableindex(sc,sp) + end + end + parsers.settings_to_hash(settings,sc) +end + +function parsers.listitem(str) + return gmatch(str,"[^, ]+") +end + +-- + +local pattern = Cs { "start", + start = V("one") + V("two") + V("three"), + rest = (Cc(",") * V("thousand"))^0 * (P(".") + endofstring) * anything^0, + thousand = digit * digit * digit, + one = digit * V("rest"), + two = digit * digit * V("rest"), + three = V("thousand") * V("rest"), +} + +lpegpatterns.splitthousands = pattern -- maybe better in the parsers namespace ? + +function parsers.splitthousands(str) + return lpegmatch(pattern,str) or str +end + +-- print(parsers.splitthousands("11111111111.11")) + +local optionalwhitespace = whitespace^0 + +lpegpatterns.words = Ct((Cs((1-punctuation-whitespace)^1) + anything)^1) +lpegpatterns.sentences = Ct((optionalwhitespace * Cs((1-period)^0 * period))^1) +lpegpatterns.paragraphs = Ct((optionalwhitespace * Cs((whitespace^1*endofstring/"" + 1 - (spacer^0*newline*newline))^1))^1) + +-- local str = " Word1 word2. \n Word3 word4. \n\n Word5 word6.\n " +-- inspect(lpegmatch(lpegpatterns.paragraphs,str)) +-- inspect(lpegmatch(lpegpatterns.sentences,str)) +-- inspect(lpegmatch(lpegpatterns.words,str)) + +-- handy for k="v" [, ] k="v" + +local dquote = P('"') +local equal = P('=') +local escape = P('\\') +local separator = S(' ,') + +local key = C((1-equal)^1) +local value = dquote * C((1-dquote-escape*dquote)^0) * dquote + +----- pattern = Cf(Ct("") * Cg(key * equal * value) * separator^0,rawset)^0 * P(-1) -- was wrong +----- pattern = Cf(Ct("") * (Cg(key * equal * value) * separator^0)^1,rawset)^0 * P(-1) +local pattern = Ct("") * (((key * equal * value) * separator^0) % rawset)^0 * P(-1) + +function parsers.keq_to_hash(str) + if str and str ~= "" then + return lpegmatch(pattern,str) + else + return { } + end +end + +-- inspect(lpeg.match(pattern,[[key="value" foo="bar"]])) + +local defaultspecification = { separator = ",", quote = '"' } + +-- this version accepts multiple separators and quotes as used in the +-- database module + +function parsers.csvsplitter(specification) + specification = specification and setmetatableindex(specification,defaultspecification) or defaultspecification + local separator = specification.separator + local quotechar = specification.quote + local numbers = specification.numbers + local separator = S(separator ~= "" and separator or ",") + local whatever = C((1 - separator - newline)^0) + if quotechar and quotechar ~= "" then + local quotedata = nil + for chr in gmatch(quotechar,".") do + local quotechar = P(chr) + local quoteitem = (1 - quotechar)^0 + local quoteword = quotechar * (numbers and (quoteitem/tonumber) or C(quoteitem)) * quotechar + if quotedata then + quotedata = quotedata + quoteword + else + quotedata = quoteword + end + end + whatever = quotedata + whatever + end + local parser = Ct((Ct(whatever * (separator * whatever)^0) * S("\n\r")^1)^0 ) + return function(data) + return lpegmatch(parser,data) + end +end + +-- local crap = [[ +-- first,second,third,fourth +-- "1","2","3","4" +-- "5","6","7","8" +-- ]] + +-- local mycsvsplitter = parsers.csvsplitter { numbers = true } + +-- local list = mycsvsplitter(crap) inspect(list) + +-- and this is a slightly patched version of a version posted by Philipp Gesang + +function parsers.rfc4180splitter(specification) + specification = specification and setmetatableindex(specification,defaultspecification) or defaultspecification + local numbers = specification.numbers + local separator = specification.separator --> rfc: COMMA + local quotechar = P(specification.quote) --> DQUOTE + local dquotechar = quotechar * quotechar --> 2DQUOTE + / specification.quote + local separator = S(separator ~= "" and separator or ",") + local whatever = (dquotechar + (1 - quotechar))^0 + local escaped = quotechar + * (numbers and (whatever/tonumber) or Cs(whatever)) + * quotechar + local non_escaped = C((1 - quotechar - newline - separator)^1) + local field = escaped + non_escaped + Cc("") + local record = Ct(field * (separator * field)^1) + local headerline = record * Cp() + local morerecords = (newline^(specification.strict and -1 or 1) * record)^0 + local headeryes = Ct(morerecords) + local headernop = Ct(record * morerecords) + return function(data,getheader) + if getheader then + local header, position = lpegmatch(headerline,data) + local data = lpegmatch(headeryes,data,position) + return data, header + else + return lpegmatch(headernop,data) + end + end +end + +-- local mycsvsplitter = parsers.rfc4180splitter { numbers = true } +-- +-- local crap = [[ +-- first,second,third,fourth +-- "1","2","3","4" +-- "a","b","c","d" +-- "foo","bar""baz","boogie","xyzzy" +-- ]] +-- +-- local list, names = mycsvsplitter(crap,true) inspect(list) inspect(names) +-- local list, names = mycsvsplitter(crap) inspect(list) inspect(names) + +local function ranger(first,last,n,action) + if not first then + -- forget about it + elseif last == true then + for i=first,n or first do + action(i) + end + elseif last then + for i=first,last do + action(i) + end + else + action(first) + end +end + +local cardinal = (lpegpatterns.hexadecimal + lpegpatterns.cardinal) / tonumber +local spacers = lpegpatterns.spacer^0 +local endofstring = lpegpatterns.endofstring + +local stepper = spacers * ( cardinal * ( spacers * S(":-") * spacers * ( cardinal + Cc(true) ) + Cc(false) ) + * Carg(1) * Carg(2) / ranger * S(", ")^0 )^1 + +local stepper = spacers * ( cardinal * ( spacers * S(":-") * spacers * ( cardinal + (P("*") + endofstring) * Cc(true) ) + Cc(false) ) + * Carg(1) * Carg(2) / ranger * S(", ")^0 )^1 * endofstring -- we're sort of strict (could do without endofstring) + +function parsers.stepper(str,n,action) + local ts = type(str) + if type(n) == "function" then + if ts == "number" then + n(str) + elseif ts == "table" then + for i=1,#str do + n(str[i]) + end + else + lpegmatch(stepper,str,1,false,n or print) + end + elseif ts == "string" then + lpegmatch(stepper,str,1,n,action or print) + end +end + +-- parsers.stepper("1,7-",9,function(i) print(">>>",i) end) +-- parsers.stepper("1-3,7,8,9") +-- parsers.stepper("1-3,6,7",function(i) print(">>>",i) end) +-- parsers.stepper(" 1 : 3, ,7 ") +-- parsers.stepper("1:4,9:13,24:*",30) +-- parsers.stepper(1,print) +-- parsers.stepper({1,3,4},print) + +local pattern_math = Cs((P("%")/"\\percent " + P("^") * Cc("{") * lpegpatterns.integer * Cc("}") + anything)^0) +local pattern_text = Cs((P("%")/"\\percent " + (P("^")/"\\high") * Cc("{") * lpegpatterns.integer * Cc("}") + anything)^0) + +patterns.unittotex = pattern + +function parsers.unittotex(str,textmode) + return lpegmatch(textmode and pattern_text or pattern_math,str) +end + +local pattern = Cs((P("^") / "" * lpegpatterns.integer * Cc("") + anything)^0) + +function parsers.unittoxml(str) + return lpegmatch(pattern,str) +end + +-- print(parsers.unittotex("10^-32 %"),utilities.parsers.unittoxml("10^32 %")) + +local cache = { } +local spaces = lpegpatterns.space^0 +local dummy = function() end + +setmetatableindex(cache,function(t,k) + local separator = S(k) -- was P + local value = (1-separator)^0 + local pattern = spaces * C(value) * separator^0 * Cp() + t[k] = pattern + return pattern +end) + +local commalistiterator = cache[","] + +function parsers.iterator(str,separator) + local n = #str + if n == 0 then + return dummy + else + local pattern = separator and cache[separator] or commalistiterator + local p = 1 + return function() + if p <= n then + local s, e = lpegmatch(pattern,str,p) + if e then + p = e + return s + end + end + end + end +end + +-- for s in parsers.iterator("a b c,b,c") do +-- print(s) +-- end + +local function initialize(t,name) + local source = t[name] + if source then + local result = { } + for k, v in next, t[name] do + result[k] = v + end + return result + else + return { } + end +end + +local function fetch(t,name) + return t[name] or { } +end + +local function process(result,more) + for k, v in next, more do + result[k] = v + end + return result +end + +----- name = C((1-S(", "))^1) +----- parser = (Carg(1) * name / initialize) * (S(", ")^1 * (Carg(1) * name / fetch))^0 +----- merge = Cf(parser,process) +local name = Carg(1) * C((1-S(", "))^1) +local parser = S(", ")^1 * (name / fetch) +local merge = (name / initialize) * (parser % process)^0 + +function parsers.mergehashes(hash,list) + return lpegmatch(merge,list,1,hash) +end + +-- local t = { +-- aa = { alpha = 1, beta = 2, gamma = 3, }, +-- bb = { alpha = 4, beta = 5, delta = 6, }, +-- cc = { epsilon = 3 }, +-- } +-- inspect(parsers.mergehashes(t,"aa, bb, cc")) + +function parsers.runtime(time) + if not time then + time = os.runtime() + end + local days = div(time,24*60*60) + time = mod(time,24*60*60) + local hours = div(time,60*60) + time = mod(time,60*60) + local minutes = div(time,60) + local seconds = mod(time,60) + return days, hours, minutes, seconds +end + +-- + +local spacing = whitespace^0 +local apply = P("->") +local method = C((1-apply)^1) +local token = lbrace * C((1-rbrace)^1) * rbrace + C(anything^1) + +local pattern = spacing * (method * spacing * apply + Carg(1)) * spacing * token + +function parsers.splitmethod(str,default) + if str then + return lpegmatch(pattern,str,1,default or false) + else + return default or false, "" + end +end + +-- print(parsers.splitmethod(" foo -> {bar} ")) +-- print(parsers.splitmethod("foo->{bar}")) +-- print(parsers.splitmethod("foo->bar")) +-- print(parsers.splitmethod("foo")) +-- print(parsers.splitmethod("{foo}")) +-- print(parsers.splitmethod()) + +local p_year = lpegpatterns.digit^4 / tonumber + +-- local pattern = Cf( Ct("") * +-- ( +-- ( Cg(Cc("year") * p_year ) +-- * S("-/") * Cg(Cc("month") * cardinal) +-- * S("-/") * Cg(Cc("day") * cardinal) +-- ) + +-- ( Cg(Cc("day") * cardinal) +-- * S("-/") * Cg(Cc("month") * cardinal) +-- * S("-/") * Cg(Cc("year") * p_year ) +-- ) + +-- ( Cg(Cc("year") * p_year ) +-- * S("-/") * Cg(Cc("month") * cardinal) +-- ) + +-- ( Cg(Cc("month") * cardinal) +-- * S("-/") * Cg(Cc("year") * p_year ) +-- ) +-- ) +-- * ( +-- P(" ") * Cg(Cc("hour") * cardinal) +-- * P(":") * Cg(Cc("min") * cardinal) +-- * (P(":") * Cg(Cc("sec") * cardinal))^-1 +-- + P(-1) ) +-- , rawset) + +local pattern = Ct("") * ( + ( + ( (Cc("year") * p_year ) % rawset + * S("-/") * (Cc("month") * cardinal) % rawset + * S("-/") * (Cc("day") * cardinal) % rawset + ) + + ( (Cc("day") * cardinal) % rawset + * S("-/") * (Cc("month") * cardinal) % rawset + * S("-/") * (Cc("year") * p_year ) % rawset + ) + + ( (Cc("year") * p_year ) % rawset + * S("-/") * (Cc("month") * cardinal) % rawset + ) + + ( (Cc("month") * cardinal) % rawset + * S("-/") * (Cc("year") * p_year ) % rawset + ) + ) + * ( + P(" ") * (Cc("hour") * cardinal) % rawset + * P(":") * (Cc("min") * cardinal) % rawset + * (P(":") * (Cc("sec") * cardinal) % rawset)^-1 + + P(-1) ) +) + +lpegpatterns.splittime = pattern + +function parsers.totime(str) + return lpegmatch(pattern,str) +end + +-- inspect(parsers.totime("2019-03-05")) +-- inspect(parsers.totime("2019-03-05 12:12:12")) +-- print(os.time(parsers.totime("2019-03-05 12:12:12"))) +-- print(os.time(parsers.totime("2019/03/05 12:12:12"))) +-- print(os.time(parsers.totime("05-03-2019 12:12:12"))) +-- print(os.time(parsers.totime("05/03/2019 12:12:12"))) diff --git a/Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.lua b/Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.lua deleted file mode 100644 index b2ae731a78c..00000000000 --- a/Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.lua +++ /dev/null @@ -1,14 +0,0 @@ --- This is just an example. We support both an xml format as well --- as lua tables. - -return { - { - filename = "CoatedFOGRA39.icc", - id = "FOGRA39", - info = "Coated FOGRA39 (ISO 12647-2:2004)", - checksum = "74ff62f330bf0dbe4495b5720542d511", - url = "http://www.color.org", - outputcondition = "", - version = "21000000", - } -} diff --git a/Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml b/Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml deleted file mode 100644 index 96b8b54c590..00000000000 --- a/Master/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml +++ /dev/null @@ -1,427 +0,0 @@ - - - - - - - - - - - - default - default_cmyk.icc - CMYK - prtr - Artifex PS CMYK Profile - de955d740998369ea1051a4e3e84eb90 - 42000000 - - - - default - default_gray.icc - GRAY - scnr - - - - default - default_rgb.icc - RGB - mntr - - - - default - lab.icc - Lab - spac - - - - default - ps_cmyk.icc - CMYK - prtr - U.S. Web Coated (SWOP) v2 - 79d7e984ea3ac74eed7cc92bf6b22a0d - 21000000 - - - - default - ps_gray.icc - GRAY - mntr - - - - default - ps_rgb.icc - RGB - mntr - - - - default - sgray.icc - GRAY - scnr - - - - default - srgb.icc - RGB - mntr - - - - - - srgb.icc - RGB - mntr - Custom - sRGB IEC61966-2.1 - 1d3fda2edb4a89ab60a23c5f7c7d81dd - 21000000 - http://www.color.org - - - - - - - Probev1_ICCv2.icc - CMYK - prtr - Custom - Probev1_ICCv2.icc - 7d8357d5cb86990465b3d7d4ef359404 - 20000000 - http://www.color.org - - - - - Probev1_ICCv4.icc - CMYK - prtr - Custom - Probev1_ICCv4.icc - 915f373c10daf2e295c0e707d3beb856 - 40000000 - http://www.color.org - - - - - Probe2_ICCv4 - CMYK - prtr - Custom - Probev2_ICCv4.icc - cd8ccdb2b8ee902100cfc45a75b84579 - 40000000 - >http://www.color.org - - - - - - - - CoatedFOGRA39.icc - CMYK - prtr - FOGRA39 - Coated FOGRA39 (ISO 12647-2:2004) - 74ff62f330bf0dbe4495b5720542d511 - 21000000 - http://www.color.org - - - - - GRACoL2006_Coated1v2.icc - CMYK - prtr - CGATS TR 006 - GRACoL2006_Coated1v2.icc - cc7a6196271b13dbae4622aa1fa0fca9 - 20000000 - http://www.color.org - - - - - ISOcoated_v2_300_eci.icc - CMYK - prtr - FOGRA39 - ISO Coated v2 300% (ECI) - e14f5db955711d914d877df35ad7a1b5 - 24000000 - http://www.color.org - Offset printing, according to ISO 12647-2:2004/Amd 1, OFCOM, paper type 1 or 2 = coated art, 115 g/m2, tone value increase curves A (CMY) and B (K) - - - - ISOcoated_v2_eci.icc - CMYK - prtr - FOGRA39 - ISO Coated v2 (ECI) - bda07efcacf5377e91edacb0454ea7e5 - 2400000 - http://www.color.org - Offset printing, according to ISO 12647-2:2004/Amd 1, OFCOM, paper type 1 or 2 = coated art, 115 g/m2, tone value increase curves A (CMY) and B (K) - - - - ISOnewspaper26v4.icc - CMYK - prtr - IFRA26 - ISOnewspaper26v4 - bca21a6afa3a4b5cef9ca8e91565c1b7 - 2400000 - http://www.color.org - Newspaper Coldset-Offset printing according to ISO/DIS 12647-3:2004, standard newsprint 45g/m2, screen ruling 40 l/cm, see readme - - - - ISOnewspaper26v4_gr.icc - CMYK - prtr - IFRA26 - ISOnewspaper26v4_gr - 45dabde250dbbc2b4ab1ddaab1380892 - 2400000 - http://www.color.org - Newspaper Coldset-Offset printing according to ISO/DIS 12647-3:2004, standard newsprint 45g/m2, screen ruling 40 l/cm, see readme - - - - ISOuncoated.icc - CMYK - prtr - FOGRA29 - ISO Uncoated - c62d711cf39488a1fc60e8be18a9d6d7 - 2000000 - http://www.color.org - Offset printing according to ISO/DIS 12647-2:2003, OFCOM, paper type 4 = white, uncoated, 120 g/m2, screen ruling 60 cm-1, positive-acting plates, see readme - - - - ISOuncoatedyellowish.icc - CMYK - prtr - FOGRA30 - ISO Uncoated Yellowish - 06db2a1b6d1eff0a49aaf350888a170e - 2400000 - http://www.color.org - Offset printing according to ISO/DIS 12647-2:2004, OFCOM, paper type 5 = slightly yellowish, uncoated, 120 g/m2, screen ruling 60 cm-1, positive-acting plates, see readme - - - - ISOwebcoated.icc - CMYK - prtr - FOGRA28 - ISO Web Coated - 0bf2ede138b0272421b629b6c8c4deaf - 2000000 - http://www.color.org - Offset printing according to ISO/DIS 12647-2:2003, OFCOM, paper type 3 = low weight coated web offset, 60 g/m2, screen ruling 60 cm-1, positive-acting plates, see readme - - - - JapanColor2001Coated.icc - CMYK - prtr - JC200103 - Japan Color 2001 Coated - 4cb167869183b59bbad20fb90ccf3e0c - 2100000 - http://www.color.org - - - - - JapanColor2002Newspaper.icc - CMYK - prtr - JCN2002 - Japan Color 2002 Newspaper - fa5be8d5b4eb756bf1399afc2cda7d1c - 2100000 - http://www.color.org - - - - - JapanWebCoated.icc - CMYK - prtr - JCW2003 - Japan Web Coated (Ad) - f8607e551233cefdda26d7d6baaa2a4f - 2100000 - http://www.color.org - - - - - SNAP-2007.icc - CMYK - prtr - CGATS TR 002 - SNAP 2007 - 8d48c9b10937672a0690b724e0527247 - 4100000 - http://www.color.org - - - - - SWOP2006_Coated3v2.icc - CMYK - prtr - CGATS TR 003 - SWOP2006_Coated3v2.icc - 7fbad4c0ae1cb7195c34bfc20e623437 - 2000000 - http://www.color.org - - - - - SWOP2006_Coated5v2.icc - CMYK - prtr - CGATS TR 005 - SWOP2006_Coated5v2.icc - 34f7c3c809b926b173ee54e13d655bee - 2000000 - http://www.color.org - - - - - UncoatedFOGRA29.icc - CMYK - prtr - FOGRA29 - Uncoated FOGRA29 (ISO 12647-2:2004) - e3d8676356f2709a7b120036b7ada996 - 2100000 - http://www.color.org - - - - - WebCoatedFOGRA28.icc - CMYK - prtr - FOGRA28 - Web Coated FOGRA28 (ISO 12647-2:2004) - 6e3b77d09d3613bc52ba7f63048d4638 - 2100000 - http://www.color.org - - - - - - - PSR_LWC_PLUS_V2_PT.icc - CMYK - prtr - Custom - PSR_LWC_PLUS_V2_PT - 2373b50219e8df70c70f2e0e798c2e38 - 2400000 - http://www.eci.org - Gravure printing according to ISO 12647-4, paper type LWC (light weight coated) plus - - - - PSR_LWC_STD_V2_PT.icc - CMYK - prtr - Custom - PSR_LWC_STD_V2_PT - 0964b3ca5390dfaf7723527bbb7cec37 - 2400000 - http://www.eci.org - Gravure printing according to ISO 12647-4, paper type LWC (light weight coated) standard - - - - PSR_SC_PLUS_V2_PT.icc - CMYK - prtr - Custom - PSR_SC_PLUS_V2_PT - aa767f70696059557917c050d3ebc6ba - 2400000 - http://www.eci.org - Gravure printing according to ISO 12647-4, paper type SC (super-calendered) plus - - - - PSR_SC_STD_V2_PT.icc - CMYK - prtr - Custom - PSR_SC_STD_V2_PT - 6d978234223b29cde94dd3a5c3624504 - 2400000 - http://www.eci.org - Gravure printing according to ISO 12647-4, paper type SC (super-calendered) standard - - - - PSRgravureMF.icc - CMYK - prtr - Custom - PSRgravureMF - 728f70371f82e930637e60c760876a3d - 2000000 - http://www.eci.org - Gravure printing according to ISO 12647-4, paper type MF (machine finished), 55 g/m2 - - - - - - diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/antykwa-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/antykwa-math.lfg index 975ada70e11..abdc20a7e79 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/antykwa-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/antykwa-math.lfg @@ -163,12 +163,15 @@ if common then tweak = "addequals", force = true, }, + { + tweak = "addfourier", + }, { tweak = "keepbases", -- list = { 0x302 } list = "default" }, -} + } common.mathematics.helpers.copyrecipes(recipes) @@ -181,6 +184,10 @@ return { author = "Hans, Mojca, Aditya, Mikael", copyright = "ConTeXt development team", mathematics = { +parameters = { + RadicalKernAfterExtensible = 100, + RadicalKernBeforeExtensible = 100, +}, mapfiles = { "antt-rm.map", "antt-mi.map", diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/bonum-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/bonum-math.lfg index 13be0e69d15..c46e6c3494b 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/bonum-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/bonum-math.lfg @@ -16,8 +16,10 @@ return { AccentTopShiftUp = -15, FlattenedAccentTopShiftUp = -15, AccentBaseDepth = 50, - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, DisplayOperatorMinHeight = 1900, -- 1250 in font SubscriptShiftDown = 201, -- 231 in font SuperscriptShiftUp = 364, -- 334 in font @@ -57,6 +59,10 @@ return { source = { first = 0x1D736 }, -- bold italic alpha filename = "texgyrebonummath-companion.otf", }, + { + source = { first = 0x02980 }, -- triplebar + filename = "TeXGyreBonumMath-Companion.otf", + }, }, }, presets.smalldigits { factor = 0.95 }, @@ -290,10 +296,10 @@ return { }, } }, - { - tweak = "addbars", - advance = 0.475, - }, + -- { + -- tweak = "addbars", + -- advance = 0.475, + -- }, { tweak = "addactuarian", }, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/cambria-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/cambria-math.lfg index 15fad23c45b..04538443204 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/cambria-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/cambria-math.lfg @@ -15,6 +15,8 @@ return { DisplayOperatorMinHeight = 2800, -- 2500 in font PrimeShiftUp = "1.25*SuperscriptShiftUp", PrimeShiftUpCramped = "1.25*SuperscriptShiftUp", + RadicalVerticalGap = 100, -- "RadicalVerticalGap", --345, 166 + RadicalDisplayStyleVerticalGap = 200, -- "RadicalVerticalGap", --345, 166 }, tweaks = { aftercopying = { @@ -75,16 +77,22 @@ return { { tweak = "radicaldegreeanchors", list = { - [0x221A] = { location = "left", hfactor = -0.15, vfactor = .75 }, - ["0x221A.variants.*"] = { location = "left", hfactor = -0.1, vfactor = .15 }, - ["0x221A.variants.1"] = { location = "left", hfactor = -0.1, vfactor = .55 }, - ["0x221A.variants.2"] = { location = "left", hfactor = -0.1, vfactor = .375 }, - ["0x221A.variants.3"] = { location = "left", hfactor = -0.1, vfactor = .275 }, - ["0x221A.variants.4"] = { location = "left", hfactor = -0.1, vfactor = .22 }, - ["0x221A.variants.5"] = { location = "left", hfactor = -0.1, vfactor = .175 }, - ["0x221A.parts.bottom"] = { location = "left", hfactor = -0.1, vfactor = 0.95 }, + [0x221A] = { location = "left", hfactor = -0.15, vfactor = 0.75 }, + ["0x221A.variants.*"] = { location = "left", hfactor = -0.1, vfactor = 0.15 }, + ["0x221A.variants.1"] = { location = "left", hfactor = -0.1, vfactor = 0.55 }, + ["0x221A.variants.2"] = { location = "left", hfactor = -0.1, vfactor = 0.375 }, + ["0x221A.variants.3"] = { location = "left", hfactor = -0.1, vfactor = 0.275 }, + ["0x221A.variants.4"] = { location = "left", hfactor = -0.1, vfactor = 0.22 }, + ["0x221A.variants.5"] = { location = "left", hfactor = -0.1, vfactor = 0.175 }, + ["0x221A.parts.bottom"] = { location = "left", hfactor = -0.1, vfactor = 0.95 }, } }, +{ + tweak = "wipevariants", + list = { + [0x221A] = 1, + }, +}, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. -- { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/color-latin.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/color-latin.lfg index c7d24cc1d51..b0443568eb6 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/color-latin.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/color-latin.lfg @@ -8,6 +8,7 @@ local shapes = { } local default = { } local upper = { } local lower = { } +local accents = { } for k, v in next, characters.data do local sh = v.shcode @@ -19,6 +20,9 @@ for k, v in next, characters.data do shapes[sh] = { sh, k } end end +-- if v.category == ".." then +-- accents[1][k] = .. +-- end end for i=1,26 do @@ -35,6 +39,12 @@ end -- ... -- } +local accents = { -- todo + [1] = { + "0x0300:0x0311", + }, +} + return { name = "color-latin", version = "1.00", @@ -45,5 +55,6 @@ return { default = default, upper = upper, lower = lower, + accents = accents, } } diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/common-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/common-math.lfg index 5c7ade3fbee..c7347413d7b 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/common-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/common-math.lfg @@ -1,3 +1,18 @@ + +local kerns = {} +mathematics.tweaks.kernsets = kerns + +local punctuation = table.setmetatableindex(function(t,k) + local v = { + [0x2C] = k, -- , + [0x2E] = k, -- . + } + t[k] = v + return v +end) + +kerns[".,"] = punctuation + return { name = "common-math", version = "1.00", @@ -206,7 +221,7 @@ return { "digitsnormal", "digitssansserifbold", "digitssansserifnormal", - -- + -- -- -- We don't do these (one can use all=true) because now we can get -- more details about what gets italics. -- @@ -221,15 +236,16 @@ return { -- "latinsupplement", -- mathematics.tweaks.subsets.dotless, + mathematics.tweaks.subsets.letterlike, } } end, moveintegrals = function(parameters) return { - tweak = "movelimits", - factor = parameters.factor or 1, + tweak = "movelimits", + factor = parameters.factor or 1, icfactor = parameters.icfactor or 1, - list = mathematics.tweaks.subsets.integrals, + list = mathematics.tweaks.subsets.integrals, } end, wipeitalics = function(parameters) @@ -312,6 +328,129 @@ return { }, } end, + addmathkerns = function(parameters) + local factor = parameters.factor or 1 + return { + tweak = "kernpairs", + list = { + + [0x1D436] = punctuation[factor * -0.05], -- italic C + [0x1D439] = punctuation[factor * -0.15], -- italic F + [0x1D43B] = punctuation[factor * -0.05], -- italic H + [0x1D43D] = punctuation[factor * -0.15], -- italic J + [0x1D43E] = punctuation[factor * -0.05], -- italic K + [0x1D440] = punctuation[factor * -0.05], -- italic M + [0x1D441] = punctuation[factor * -0.05], -- italic N + [0x1D443] = punctuation[factor * -0.15], -- italic P + [0x1D446] = punctuation[factor * -0.05], -- italic S + [0x1D447] = punctuation[factor * -0.05], -- italic T + [0x1D448] = punctuation[factor * -0.15], -- italic U + [0x1D449] = punctuation[factor * -0.20], -- italic V + [0x1D44A] = punctuation[factor * -0.15], -- italic W + [0x1D44B] = punctuation[factor * -0.05], -- italic X + [0x1D44C] = punctuation[factor * -0.20], -- italic Y + [0x1D44D] = punctuation[factor * -0.05], -- italic Z + [0x1D453] = punctuation[factor * -0.10], -- italic f + [0x1D457] = punctuation[factor * -0.10], -- italic j + [0x1D45F] = punctuation[factor * -0.10], -- italic r + [0x00393] = punctuation[factor * -0.10], -- upright Gamma + [0x003A0] = punctuation[factor * -0.05], -- upright Pi + [0x003A5] = punctuation[factor * -0.15], -- upright Upsilon + [0x003A8] = punctuation[factor * -0.05], -- upright Psi + [0x1D6FF] = punctuation[factor * -0.10], -- italic delta + [0x1D708] = punctuation[factor * -0.10], -- italic nu + [0x1D70E] = punctuation[factor * -0.10], -- italic sigma + [0x1D70F] = punctuation[factor * -0.10], -- italic tau + [0x1D46A] = punctuation[factor * -0.05], -- bold italic C + [0x1D46D] = punctuation[factor * -0.15], -- bold italic F + [0x1D46F] = punctuation[factor * -0.05], -- bold italic H + [0x1D471] = punctuation[factor * -0.15], -- bold italic J + [0x1D472] = punctuation[factor * -0.05], -- bold italic K + [0x1D474] = punctuation[factor * -0.05], -- bold italic M + [0x1D475] = punctuation[factor * -0.05], -- bold italic N + [0x1D477] = punctuation[factor * -0.15], -- bold italic P + [0x1D47A] = punctuation[factor * -0.10], -- bold italic S + [0x1D47B] = punctuation[factor * -0.05], -- bold italic T + [0x1D47C] = punctuation[factor * -0.15], -- bold italic U + [0x1D47D] = punctuation[factor * -0.20], -- bold italic V + [0x1D47E] = punctuation[factor * -0.15], -- bold italic W + [0x1D47F] = punctuation[factor * -0.05], -- bold italic X + [0x1D480] = punctuation[factor * -0.20], -- bold italic Y + [0x1D481] = punctuation[factor * -0.05], -- bold italic Z + [0x1D487] = punctuation[factor * -0.10], -- bold italic f + [0x1D48B] = punctuation[factor * -0.10], -- bold italic j + [0x1D493] = punctuation[factor * -0.10], -- bold italic r + [0x1D6AA] = punctuation[factor * -0.15], -- bold upright Gamma + [0x1D6B7] = punctuation[factor * -0.05], -- bold upright Pi + [0x1D6BC] = punctuation[factor * -0.15], -- bold upright Ypsilon + [0x1D6BF] = punctuation[factor * -0.05], -- bold upright Psi + [0x1D739] = punctuation[factor * -0.10], -- bold italic delta + [0x1D742] = punctuation[factor * -0.10], -- bold italic nu + [0x1D748] = punctuation[factor * -0.10], -- bold italic sigma + [0x1D749] = punctuation[factor * -0.10], -- bold italic tau + + -- kind of special and font specific + + -- [0x1D451] = { -- italic d + -- [0x1D44C] = .11, -- italic Y + -- [0x1D449] = -.11, -- italic Z + -- [0x1D453] = -.32, -- italic f + -- [0x1D457] = -.21, -- italic j + -- }, + -- [0x1D485] = { -- bold italic d + -- [0x1D480] = .10, -- italic Y + -- [0x1D481] = -.10, -- italic Z + -- [0x1D487] = -.31, -- italic f + -- [0x1D48B] = -.21, -- italic j + -- }, + + -- kern character with a slash + + -- [0x00393] = { [0x2F]=-0.05 }, -- upright Gamma + -- [0x003A0] = { [0x2F]=-0.05 }, -- upright Pi + -- [0x003A5] = { [0x2F]=-0.05 }, -- upright Ypsilon + -- [0x003A8] = { [0x2F]=-0.05 }, -- upright Psi + -- [0x1D436] = { [0x2F]=-0.05 }, -- C (bold) italic C + -- [0x1D439] = { [0x2F]=-0.05 }, -- F (bold) italic F + -- [0x1D43B] = { [0x2F]=-0.05 }, -- H (bold) italic H + -- [0x1D43D] = { [0x2F]=-0.05 }, -- J (bold) italic J + -- [0x1D43E] = { [0x2F]=-0.05 }, -- K (bold) italic K + -- [0x1D440] = { [0x2F]=-0.05 }, -- M (bold) italic M + -- [0x1D441] = { [0x2F]=-0.10 }, -- N (bold) italic N + -- [0x1D443] = { [0x2F]=-0.05 }, -- P (bold) italic P + -- [0x1D446] = { [0x2F]=-0.05 }, -- S (bold) italic S + -- [0x1D447] = { [0x2F]=-0.05 }, -- T (bold) italic T + -- [0x1D448] = { [0x2F]=-0.05 }, -- U (bold) italic U + -- [0x1D449] = { [0x2F]=-0.10 }, -- V (bold) italic V + -- [0x1D44A] = { [0x2F]=-0.10 }, -- W (bold) italic W + -- [0x1D44B] = { [0x2F]=-0.10 }, -- X (bold) italic X + -- [0x1D44C] = { [0x2F]=-0.10 }, -- Y (bold) italic Y + -- [0x1D44D] = { [0x2F]=-0.05 }, -- Z (bold) italic Z + + -- [0x1D6AA] = { [0x2F]=-0.05 }, -- upright Gamma + -- [0x1D6B7] = { [0x2F]=-0.05 }, -- upright Pi + -- [0x1D6BC] = { [0x2F]=-0.05 }, -- upright Ypsilon + -- [0x1D6BF] = { [0x2F]=-0.05 }, -- upright Psi + -- [0x1D46A] = { [0x2F]=-0.05 }, -- C (bold) italic C + -- [0x1D46D] = { [0x2F]=-0.05 }, -- F (bold) italic F + -- [0x1D46F] = { [0x2F]=-0.05 }, -- H (bold) italic H + -- [0x1D471] = { [0x2F]=-0.05 }, -- J (bold) italic J + -- [0x1D472] = { [0x2F]=-0.05 }, -- K (bold) italic K + -- [0x1D474] = { [0x2F]=-0.05 }, -- M (bold) italic M + -- [0x1D475] = { [0x2F]=-0.10 }, -- N (bold) italic N + -- [0x1D477] = { [0x2F]=-0.05 }, -- P (bold) italic P + -- [0x1D47A] = { [0x2F]=-0.05 }, -- S (bold) italic S + -- [0x1D47B] = { [0x2F]=-0.05 }, -- T (bold) italic T + -- [0x1D47C] = { [0x2F]=-0.05 }, -- U (bold) italic U + -- [0x1D47D] = { [0x2F]=-0.10 }, -- V (bold) italic V + -- [0x1D47E] = { [0x2F]=-0.10 }, -- W (bold) italic W + -- [0x1D47F] = { [0x2F]=-0.10 }, -- X (bold) italic X + -- [0x1D480] = { [0x2F]=-0.10 }, -- Y (bold) italic Y + -- [0x1D481] = { [0x2F]=-0.05 }, -- Z (bold) italic Z + + }, + } + end, }, }, }, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/concrete-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/concrete-math.lfg index 3c8f363916b..7765c66b178 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/concrete-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/concrete-math.lfg @@ -9,11 +9,16 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - DelimiterPercent = 90, - DelimiterShortfall = 400, - PrimeShiftUp = "1.2*SuperscriptShiftUp", - PrimeShiftUpCramped = "1.2*SuperscriptShiftUp", - PrimeBaselineDropMax = "0.5*SuperscriptBaselineDropMax", + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, + DelimiterPercent = 90, + DelimiterShortfall = 400, + PrimeShiftUp = "1.2*SuperscriptShiftUp", + PrimeShiftUpCramped = "1.2*SuperscriptShiftUp", + PrimeBaselineDropMax = "0.5*SuperscriptBaselineDropMax", + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --152, 75 }, tweaks = { aftercopying = { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/dejavu-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/dejavu-math.lfg index bd355c3b56f..8e2a9b86695 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/dejavu-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/dejavu-math.lfg @@ -16,8 +16,10 @@ return { AccentTopShiftUp = -25, FlattenedAccentTopShiftUp = -25, AccentBaseDepth = 30, - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1333 in font SubscriptShiftDown = 177, -- 277 in font SuperscriptShiftUp = 428, -- 381 in font @@ -138,6 +140,7 @@ return { { tweak = "copyaccents", }, + presets.addmathkerns { }, { tweak = "checkspacing", }, @@ -152,7 +155,7 @@ return { }, { tweak = "replacerules", - fraction = { height = .254, yoffset = .746 }, + fraction = { height = .254, yoffset = .746, leftoffset = .1, rightoffset = .1, }, radical = { height = .17, leftoffset = .1, rightoffset = .1, yoffset = .485, yscale = .65 }, stacker = { height = .254, yoffset = .746 }, }, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/ebgaramond-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/ebgaramond-math.lfg index 20bf48460d0..85c27db7ffc 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/ebgaramond-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/ebgaramond-math.lfg @@ -16,8 +16,10 @@ return { FlattenedAccentBaseHeight = 620, -- 420 in font (maybe some misunderstanding in the font regarding accents and heights) FlattenedAccentTopShiftUp = -25, -- was 075 AccentBaseDepth = 75, - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, SubscriptShiftDown = 200, -- 250 in font SuperscriptShiftUp = 400, -- 430 in font SubscriptShiftDownWithSuperscript = "1.25*SubscriptShiftDown", -- trial and error @@ -25,6 +27,7 @@ return { PrimeShiftUp = "1.2*SuperscriptShiftUp", PrimeShiftUpCramped = "1.2*SuperscriptShiftUp", PrimeBaselineDropMax = "0.5*SuperscriptBaselineDropMax", + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --150, 65 }, tweaks = { aftercopying = { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/erewhon-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/erewhon-math.lfg index 91f084e9b64..7e9001e2cba 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/erewhon-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/erewhon-math.lfg @@ -13,14 +13,19 @@ return { mathematics = { parameters = { AccentBaseDepth = 60, - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, SubscriptShiftDown = 200, -- 220 in font SuperscriptShiftUp = 400, -- 400 in font SubscriptShiftDownWithSuperscript = "1.2*SubscriptShiftDown", -- unclear original value, trial and error - PrimeShiftUp = "1.1*SuperscriptShiftUp", - PrimeShiftUpCramped = "1.1*SuperscriptShiftUp", + PrimeShiftUp = "1*SuperscriptShiftUp", + PrimeShiftUpCramped = "1*SuperscriptShiftUp", PrimeBaselineDropMax = "0.5*SuperscriptBaselineDropMax", + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --170, 69 + -- RadicalDisplayStyleVerticalGap = 55,--"RadicalVerticalGap", --170, 69 + -- RadicalVerticalGap = 55, }, tweaks = { aftercopying = { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/euler-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/euler-math.lfg index 23d92b0479d..58dbad767ea 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/euler-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/euler-math.lfg @@ -24,14 +24,16 @@ return { RadicalDegreeBottomRaisePercent = 60, RadicalKernAfterDegree = -500, RadicalRuleThickness = 60, -- 60 in font - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1500 in font PrimeRaisePercent = 75, -- 50 default PrimeRaiseComposedPercent = 10, -- 25 default -- RadicalKernAfterExtensible = 0, -- 0 default -- RadicalKernBeforeExtensible = 0, -- 0 default - + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --148, 50 }, tweaks = { aftercopying = { @@ -51,11 +53,26 @@ return { feature = "pagellaovereuler", filename = "texgyrepagella-math.otf", list = { - -- { source = { first = 0x02100, last = 0x0210D } }, -- no 0x2210E - -- { source = { first = 0x0210F, last = 0x02BFF } }, - { source = { first = 0x02100, last = 0x02BFF } }, - { source = { first = 0x1D400, last = 0x1D7FF } }, - { source = { first = 0x1D538, last = 0x1D550 } }, + -- { source = { first = 0x02100, last = 0x0210D } }, -- no 0x2210E + -- { source = { first = 0x0210F, last = 0x02BFF } }, + -- { source = { first = 0x02100, last = 0x02BFF } }, + -- { source = { first = 0x1D400, last = 0x1D7FF } }, + -- { source = { first = 0x1D538, last = 0x1D550 } }, + + -- { source = { first = 0x0007B, last = 0x0007D } }, -- { } + -- { source = { first = 0x0005B, last = 0x0005D } }, -- [ ] + -- { source = { first = 0x00028, last = 0x00029 } }, -- ( ) + -- { source = { first = 0x02100, last = 0x02BFF } }, -- symbols -- has snippets of {} () [] + -- + -- or (probably even more) + -- + -- Maybe not needed, Daniel have added some symbols and alphabets. If you need more + -- (read: miss shapes) let us know. + -- + -- { source = { first = 0x02100, last = 0x0239A } }, -- symbols -- has snippets of {} () [] + -- { source = { first = 0x023B5, last = 0x02BFF } }, -- symbols -- has snippets of {} () [] + -- + -- { source = { first = 0x1D400, last = 0x1D7FF } }, -- various alphabets }, }, { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/fira-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/fira-math.lfg new file mode 100644 index 00000000000..e66271d0a46 --- /dev/null +++ b/Master/texmf-dist/tex/context/fonts/mkiv/fira-math.lfg @@ -0,0 +1,23 @@ +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + +return { + name = "fira-math", + version = "0.10", + comment = "Goodies that complement fira.", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "ConTeXt development team", + mathematics = { + parameters = { + PrimeShiftUp = "0.7*SuperscriptShiftUp", + }, + tweaks = { + aftercopying = { + presets.moveintegrals { }, + presets.moveitalics { correct = true }, + presets.wipeanchors { }, + presets.wipeitalics { }, + }, + }, + }, +} diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/fontawesome.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/fontawesome.lfg new file mode 100644 index 00000000000..3090a58705b --- /dev/null +++ b/Master/texmf-dist/tex/context/fonts/mkiv/fontawesome.lfg @@ -0,0 +1,30 @@ +return { + name = "fontawesome", + version = "1.00", + comment = "Goodies that deal with the ever changing filenames.", + author = "Hans Hagen", + copyright = "ConTeXt development team", + filenames = { + ["FontAwesomeBrandsRegular.otf"] = { + "fontawesome5brandsregular400.otf", + "fontawesome6brandsregular400.otf", + "fontawesome7brandsregular400.otf", + "fontawesome8brandsregular400.otf", + "fontawesome9brandsregular400.otf", + }, + ["FontAwesomeFreeRegular.otf"] = { + "fontawesome5freeregular400.otf", + "fontawesome6freeregular400.otf", + "fontawesome7freeregular400.otf", + "fontawesome8freeregular400.otf", + "fontawesome9freeregular400.otf", + }, + ["FontAwesomeFreeSolid.otf"] = { + "fontawesome5freesolid900.otf", + "fontawesome6freesolid900.otf", + "fontawesome7freesolid900.otf", + "fontawesome8freesolid900.otf", + "fontawesome9freesolid900.otf", + }, + }, +} diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/gfsneohellenic-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/gfsneohellenic-math.lfg new file mode 100644 index 00000000000..7525462e960 --- /dev/null +++ b/Master/texmf-dist/tex/context/fonts/mkiv/gfsneohellenic-math.lfg @@ -0,0 +1,109 @@ +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + +-- Initial support for the font. +-- Tell us if something looks weird. +return { + name = "gfsneohellenic", + version = "1.00", + comment = "Goodies that complement gfsneohellenicmath.", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "ConTeXt development team", + mathematics = { + parameters = { + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, + }, + tweaks = { + aftercopying = { + { + tweak = "version", + expected = "Version 1.02", + }, + { + tweak = "fixprimes", + factor = 0.825, + smaller = true, + fake = 0.8, + }, + presets.scripttocalligraphic { }, + presets.rsfstoscript { }, + presets.rsfsuprighttoscript { }, + presets.moderntocalligraphic { }, + presets.eulertocalligraphic { }, + presets.xitsarabic { rscale = 0.80 }, + presets.fallbacks { }, + presets.moveitalics { correct = true }, + presets.moveitalics { correct = true, letters = true }, + presets.moveintegrals { }, + presets.wipeanchors { }, + presets.wipeitalics { }, + { + tweak = "checkaccents", + }, + { + tweak = "kerns", + list = { + ["0x7D.parts.top"] = { topright = -0.25 }, -- right brace top + ["0x7D.parts.bottom"] = { bottomright = -0.25 }, -- right brace bottom + ["0x7D.variants.*"] = { topright = -0.25, bottomright = -0.25 }, -- right brace variants + ["0x29.parts.top"] = { topright = -0.3, }, -- right parenthesis top + ["0x29.parts.bottom"] = { bottomright = -0.3 }, -- right parenthesis bottom + ["0x29.variants.*"] = { topright = -0.15, bottomright = -0.15 }, -- right parenthesis variants + ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top + ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom + ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants + [0x27E9] = { topright = -0.2, bottomright = -0.2 }, -- angles + ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 }, + [0x27EB] = { topright = -0.2, bottomright = -0.2 }, + ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 }, + + }, + }, + { + tweak = "flattenaccents", + }, + { + tweak = "checkspacing", + }, + { + tweak = "fixradicals", + }, + { + tweak = "addscripts", + }, + { + tweak = "accentdimensions", + }, + { + tweak = "addrules", + }, + -- Font has extensible minus, but it looks like the LM one + -- { + -- tweak = "replacerules", + -- -- minus = true, -- we have an extensible + -- fraction = { height = .15, yoffset = .85 }, + -- radical = { height = .15, yoffset = .823, leftoffset = .065, rightoffset = .065, leftoverlap = 0.03 }, + -- stacker = { height = .15, yoffset = .85 }, + -- }, + { + tweak = "addfourier", + variant = 1, + }, + { + tweak = "addprimed", + }, + }, + }, + bigs = { + 1, 2, 3, 4 + }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, + }, +} diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/iwona-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/iwona-math.lfg index 2754e15777a..76131ad8ef7 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/iwona-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/iwona-math.lfg @@ -95,6 +95,9 @@ if common then factor = 1.0, -- accent base height fake = 0.9, -- replace multiples with this width proportion }, + { + tweak = "addfourier", + }, { tweak = "addequals", force = true, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/kpfonts-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/kpfonts-math.lfg index 628dd13b657..1286bcf7873 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/kpfonts-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/kpfonts-math.lfg @@ -12,12 +12,17 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, AccentBaseDepth = 30, DelimiterPercent = 90, DelimiterShortfall = 400, PrimeShiftUp = "1.15*SuperscriptShiftUp", PrimeShiftUpCramped = "1.15*SuperscriptShiftUp", SubscriptShiftDownWithSuperscript = "1.2*SubscriptShiftDown", -- unclear original value, trial and error + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --170, 62 }, tweaks = { aftercopying = { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/kurier-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/kurier-math.lfg index a7290d0cafb..96154194ab3 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/kurier-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/kurier-math.lfg @@ -95,6 +95,9 @@ if common then factor = 1.0, -- accent base height fake = 0.9, -- replace multiples with this width proportion }, + { + tweak = "addfourier", + }, { tweak = "addequals", force = true, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/libertinus-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/libertinus-math.lfg index 02afa0e90b4..e605ca6ff6f 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/libertinus-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/libertinus-math.lfg @@ -16,16 +16,21 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - FractionRuleThickness = 50, - OverbarRuleThickness = 50, - UnderbarRuleThickness = 50, - AccentTopShiftUp = -35, - FlattenedAccentTopShiftUp = -35, - AccentBaseDepth = 10, - DelimiterPercent = 90, - DelimiterShortfall = 400, - PrimeShiftUp = "1.2*SuperscriptShiftUp", - PrimeShiftUpCramped = "1.2*SuperscriptShiftUp", + FractionRuleThickness = 50, + OverbarRuleThickness = 50, + UnderbarRuleThickness = 50, + AccentTopShiftUp = -35, + FlattenedAccentTopShiftUp = -35, + AccentBaseDepth = 10, + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, + PrimeShiftUp = "1.2*SuperscriptShiftUp", + PrimeShiftUpCramped = "1.2*SuperscriptShiftUp", + -- RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --170, 90 + RadicalDisplayStyleVerticalGap = 50,-- 170 + RadicalVerticalGap = 50,-- 90 }, tweaks = { aftercopying = { @@ -110,6 +115,12 @@ return { -- as well as the variants here. None in libertinus. -- We now copy these to the not wide slots so that we can set these to stretch as well, -- if only because it is less confusing and more consistent. + { + tweak = "dimensions", + list = { + [0x305] = { height = .8, yoffset = -.2 }, -- widehat + }, + }, { tweak = "copyaccents", }, @@ -137,9 +148,9 @@ return { { tweak = "accentdimensions", }, - { - tweak = "addrules", - }, + -- { + -- tweak = "addrules", + -- }, { tweak = "addbars", advance = 0.5, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/minion-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/minion-math.lfg index ab58d0dc6f2..535d5b88307 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/minion-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/minion-math.lfg @@ -26,10 +26,15 @@ return { }, mathematics = { parameters = { + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, SubscriptShiftDown = 200, -- 250 in font SubscriptShiftDownWithSuperscript = "1.40*SubscriptShiftDown", -- 1.5* in math-act PrimeShiftUp = "1.15*SuperscriptShiftUp", PrimeShiftUpCramped = "1.15*SuperscriptShiftUp", + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --104, 54 }, tweaks = { aftercopying = { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/modern-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/modern-math.lfg index ef99513b960..6f1ab45871a 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/modern-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/modern-math.lfg @@ -4,6 +4,8 @@ local common = fonts.goodies.load("common-math.lfg") local presets = common.mathematics.tweaks.presets +local punctuation = mathematics.tweaks.kernsets[".,"] + return { name = "latin modern math", version = "1.00", @@ -13,12 +15,14 @@ return { mathematics = { parameters = { FractionNumeratorDisplayStyleShiftUp = 600, -- used to be a function - AccentTopShiftUp = -60, - FlattenedAccentTopShiftUp = -60, + AccentTopShiftUp = -30, + FlattenedAccentTopShiftUp = -30, AccentSuperscriptDrop = 100, -- drop the superscripts if accents are present. Amount in percentage of height of accent(?) AccentSuperscriptPercent = 0, - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, -- MS + DelimiterDisplayShortfall = 400, SubscriptShiftDown = 150, -- 247 in font (multiplied to be consistent with cm) SubscriptShiftDownWithSuperscript = 247, -- relates to the previous one (see math-act) -- SubscriptTopMax = 344, -- 344 in font .8 exheight @@ -28,20 +32,91 @@ return { -- SuperscriptBottomMaxWithSubscript = 344, -- 344 in font .8 exheight -- SuperscriptBottomMin = 108, -- 108 in font .25 exheight SuperscriptShiftUp = 413, -- 363 in font (multiplied with 4.9547/4.3536, got 413) - SuperscriptShiftUpCramped = 413, -- 289 in font (no distinction, old TeX) - PrimeShiftUp = "1.1*SuperscriptShiftUp", - PrimeShiftUpCramped = "1.1*SuperscriptShiftUp", + SuperscriptShiftUpCramped = 329, -- 289 in font (no distinction, old TeX) + PrimeShiftUp = "1.05*SuperscriptShiftUp", + PrimeShiftUpCramped = "1.05*SuperscriptShiftUp", -- PrimeRaisePercent = 0, -- set to 0 in math-act -- PrimeRaiseComposedPercent = 0, -- set to 0 in math-act + RadicalDisplayStyleVerticalGap = 120,--"RadicalVerticalGap" too small, 148, 50 + -- RadicalVerticalGap = 50,-- Going smaller looks too cramped }, tweaks = { aftercopying = { { tweak = "version", - expected = "Version 1.958", + expected = "Version 1.959", }, { - tweak = "addmirrors", + tweak = "replacealphabets", + list = { + { + -- source = { first = 0x02980 }, -- triplebar + filename = "LatinModernMath-Companion.otf", + feature = "ss01", + unicodes = { + 0x00028, -- left parenthesis + 0x00029, -- right parenthesis + 0x0005B, -- left bracket + 0x0005D, -- right bracket + 0x027EE, -- left flattened parenthesis + 0x027EF, -- right falttened parenthesis + 0x02308, -- left ceiling + 0x02309, -- right ceiling + 0x0230A, -- left floor + 0x0230B, -- right floor + 0x027E6, -- left white bracket + 0x027E7, -- right white bracket + }, + }, + { + -- source = { first = 0x02980 }, -- triplebar + filename = "LatinModernMath-Companion.otf", + feature = "ss02", + unicodes = { + 0x0007B, -- left brace + 0x0007D, -- right brace + }, + }, + { + filename = "LatinModernMath-Companion.otf", + feature = "ss03", + unicodes = { + 0x0221A, -- radical + }, + }, + { + -- source = { first = 0x02980 }, -- triplebar + filename = "LatinModernMath-Companion.otf", + unicodes = { + 0x0002F, -- solidus + -- 0x00028, -- left parenthesis + -- 0x00029, -- right parenthesis + -- 0x0005B, -- left bracket + 0x0005C, -- reverse solidus + -- 0x0005D, -- right bracket + -- 0x0007B, -- left brace + 0x0007C, -- single vertical bar + -- 0x0007D, -- right brace + 0x02016, -- double vertical bar + -- 0x02308, -- left ceiling + -- 0x02309, -- right ceiling + -- 0x0230A, -- left floor + -- 0x0230B, -- right floor + -- 0x027E6, -- left white bracket + -- 0x027E7, -- right white bracket + 0x027E8, -- left angle + 0x027E9, -- right angle + 0x027EA, -- left double angle + 0x027EB, -- right double angle + -- 0x027EE, -- left flattened parenthesis + -- 0x027EF, -- right flattened parenthesis + 0x02980, -- triple vertical bar + }, + }, + }, + }, + { + tweak = "addmirrors", --bidi }, presets.scripttocalligraphic { }, presets.rsfstoscript { }, @@ -50,14 +125,17 @@ return { presets.eulertocalligraphic { }, presets.xitsarabic { rscale = 0.80 }, presets.fallbacks { }, - presets.moveitalics { correct = true }, presets.moveitalics { correct = true, letters = true }, + presets.moveitalics { correct = true, list = mathematics.tweaks.subsets.letterlike }, presets.moveintegrals { factor = 1.4, icfactor = 0.8 }, -- the icfactor is due to the very slanted integral. presets.wipeanchors { }, presets.wipeitalics { }, { tweak = "checkaccents", }, + { + tweak = "wipeweirdones", + }, { tweak = "dimensions", list = { @@ -131,13 +209,88 @@ return { [0x1D4B3] = { anchor = 0.95 }, -- script X [0x1D4B4] = { anchor = 0.9 }, -- script Y [0x1D4B5] = { anchor = 1 }, -- script Z - ["0x7C.variants.1"]={ squeeze = 0.90, height = 0.90, depth = 0.90 }, - ["0x7C.variants.2"]={ squeeze = 0.85, height = 0.85, depth = 0.85 }, - ["0x7C.variants.3"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.4"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.5"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.6"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.7"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + -- ["0x7C.variants.1"]={ squeeze = 0.90, height = 0.90, depth = 0.90 }, + -- ["0x7C.variants.2"]={ squeeze = 0.85, height = 0.85, depth = 0.85 }, + -- ["0x7C.variants.3"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + -- ["0x7C.variants.4"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + -- ["0x7C.variants.5"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + -- ["0x7C.variants.6"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + -- ["0x7C.variants.7"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + }, + }, + { + tweak = "kernpairs", + list = { + -- Values taken from lmmi10 + [0x1D436] = punctuation[-0.07], -- italic C + [0x1D439] = punctuation[-0.14], -- italic F + [0x1D43B] = punctuation[-0.06], -- italic H + [0x1D43D] = punctuation[-0.17], -- italic J + [0x1D43E] = punctuation[-0.06], -- italic K + [0x1D440] = punctuation[-0.05], -- italic M + [0x1D441] = punctuation[-0.06], -- italic N + [0x1D443] = punctuation[-0.14], -- italic P + [0x1D446] = punctuation[-0.08], -- italic S + [0x1D447] = punctuation[-0.08], -- italic T + [0x1D448] = punctuation[-0.14], -- italic U + [0x1D449] = punctuation[-0.21], -- italic V + [0x1D44A] = punctuation[-0.15], -- italic W + [0x1D44B] = punctuation[-0.06], -- italic X + [0x1D44C] = punctuation[-0.21], -- italic Y + [0x1D44D] = punctuation[-0.07], -- italic Z + [0x1D451] = { -- italic d + [0x1D44C] = .11, -- italic Y + [0x1D449] = -.11, -- italic Z + [0x1D453] = -.32, -- italic f (DEK) + [0x1D453] = -.22, -- italic f (this one wins here) + [0x1D457] = -.21, -- italic j (DEK) + [0x1D457] = -.11, -- italic j (this one wins here) + }, + [0x1D453] = punctuation[-0.09], -- italic f + [0x1D457] = punctuation[-0.12], -- italic j + [0x1D45F] = punctuation[-0.12], -- italic r + [0x00393] = punctuation[-0.15], -- upright Gamma + [0x003A0] = punctuation[-0.06], -- upright Pi + [0x003A5] = punctuation[-0.15], -- upright Ypsilon + [0x003A8] = punctuation[-0.08], -- upright Psi + [0x1D6FF] = punctuation[-0.12], -- italic delta + [0x1D708] = punctuation[-0.10], -- italic nu + [0x1D70E] = punctuation[-0.09], -- italic sigma + [0x1D70F] = punctuation[-0.10], -- italic tau + -- Values taken from lmmib10 (same ratios) + [0x1D46A] = punctuation[-0.07], -- bold italic C + [0x1D46D] = punctuation[-0.15], -- bold italic F + [0x1D46F] = punctuation[-0.06], -- bold italic H + [0x1D471] = punctuation[-0.17], -- bold italic J + [0x1D472] = punctuation[-0.06], -- bold italic K + [0x1D474] = punctuation[-0.05], -- bold italic M + [0x1D475] = punctuation[-0.06], -- bold italic N + [0x1D477] = punctuation[-0.14], -- bold italic P + [0x1D47A] = punctuation[-0.09], -- bold italic S + [0x1D47B] = punctuation[-0.08], -- bold italic T + [0x1D47C] = punctuation[-0.14], -- bold italic U + [0x1D47D] = punctuation[-0.21], -- bold italic V + [0x1D47E] = punctuation[-0.15], -- bold italic W + [0x1D47F] = punctuation[-0.06], -- bold italic X + [0x1D480] = punctuation[-0.21], -- bold italic Y + [0x1D481] = punctuation[-0.08], -- bold italic Z + [0x1D485] = { -- bold italic d + [0x1D480] = .10, -- italic Y + [0x1D481] = -.10, -- italic Z + [0x1D487] = -.31, -- italic f + [0x1D48B] = -.21, -- italic j + }, + [0x1D487] = punctuation[-0.09], -- bold italic f + [0x1D48B] = punctuation[-0.12], -- bold italic j + [0x1D493] = punctuation[-0.11], -- bold italic r + [0x1D6AA] = punctuation[-0.16], -- bold upright Gamma + [0x1D6B7] = punctuation[-0.06], -- bold upright Pi + [0x1D6BC] = punctuation[-0.15], -- bold upright Ypsilon + [0x1D6BF] = punctuation[-0.08], -- bold upright Psi + [0x1D739] = punctuation[-0.11], -- bold italic delta + [0x1D742] = punctuation[-0.10], -- bold italic nu + [0x1D748] = punctuation[-0.09], -- bold italic sigma + [0x1D749] = punctuation[-0.10], -- bold italic tau }, }, -- Accents are a mess. We migrate the extensibles from the combiners to the base accent @@ -158,17 +311,35 @@ return { ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.05 }, } }, + { + tweak = "radicalbodymargins", + list = { + -- [0x221A] = { left = 0.025 }, + ["0x221A.variants.*"] = { left = 0.05 }, + ["0x221A.variants.1"] = { left = 0 }, + ["0x221A.variants.2"] = { left = 0 }, + ["0x221A.variants.3"] = { left = 0 }, + ["0x221A.variants.4"] = { left = 0 }, + ["0x221A.variants.5"] = { left = 0 }, + ["0x221A.variants.6"] = { left = 0.025 }, + ["0x221A.variants.7"] = { left = 0.025 }, + ["0x221A.variants.8"] = { left = 0.025 }, + ["0x221A.variants.9"] = { left = 0.025 }, + ["0x221A.variants.10"] = { left = 0.025 }, + ["0x221A.parts.bottom"] = { left = 0.10 }, + } + }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. --- { --- tweak = "dimensions", --- list = { --- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat --- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde --- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve --- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck --- }, --- }, + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat + -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. { @@ -219,6 +390,10 @@ return { [0x1D4B5] = { bottomright = -0.05, }, -- script Z -- [0x00393] = { bottomright = -0.20, }, -- upright Gamma + [0x02207] = { bottomright = -0.20, }, -- nabla + [0x1D6C1] = { bottomright = -0.20, }, -- bold nabla + [0x1D6FB] = { bottomright = -0.25, }, -- italic nabla + [0x1D735] = { bottomright = -0.25, }, -- bold italic nabla -- ["0x7D.parts.top"] = { topright = -0.25 }, -- right brace top ["0x7D.parts.bottom"] = { bottomright = -0.25 }, -- right brace bottom @@ -233,7 +408,6 @@ return { ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 }, [0x27EB] = { topright = -0.2, bottomright = -0.2 }, ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 }, - }, }, { @@ -333,24 +507,48 @@ return { tweak = "replacerules", -- minus = true, -- we have an extensible fraction = { height = .15, yoffset = .85 }, - radical = { height = .15, yoffset = .85, leftoffset = .065, rightoffset = .065, leftoverlap = 0.023, -rightoverlap = 0.023 -}, + radical = { height = .15, yoffset = .85, leftoffset = .065, rightoffset = .065, leftoverlap = 0.023, rightoverlap = 0.023 }, stacker = { height = .15, yoffset = .85 }, }, - { - tweak = "addbars", - advance = 0.52, - }, + -- This is gone: + -- { + -- tweak = "addbars", + -- advance = 0.52, + -- }, + -- And instead we now have this: + -- { + -- tweak = "fixvariants", + -- list = { + -- -- watch out, showglyphs is now fuzzy + -- [0x0028] = { template = 0x005B, index = 1, yoffset = .03 }, + -- [0x0029] = { template = 0x005D, index = 1, yoffset = .03 }, + -- [0x007C] = { template = 0x005B, index = 1, yoffset = .03 }, + -- [0x2016] = { template = 0x005B, index = 1, yoffset = .03 }, + -- [0x2980] = { template = 0x005B, index = 1, yoffset = .03 }, + -- } + -- }, + -- { + -- tweak = "addbars", + -- advance = 0.52, + -- check = true, + -- -- variant = 1, + -- }, { tweak = "addactuarian", }, + -- { + -- comment = "demo", + -- tweak = "radicalbodymargins", + -- list = { + -- ["delimited right annuity.parts.bottom"] = { right = 1 }, + -- } + -- }, { tweak = "addfourier", variant = 1, }, { - tweak = "addprimed", + tweak = "addprimed", }, { tweak = "addequals", @@ -361,12 +559,26 @@ rightoverlap = 0.023 feature = "emulatelmtx", comment = "this is for mkiv", }, --- { tweak = "inspect", slot = 0x2212 }, --- { tweak = "inspect", slot = 0x003D }, + -- { tweak = "inspect", slot = 0x2212 }, + -- { tweak = "inspect", slot = 0x003D }, + -- + -- only for testing + -- + { + tweak = "dimensions", + feature = "mathforme", + list = { + [0x58] = { -- upright X + -- scale = 0.5, + xoffset = 0.5, + yoffset = 0.5, + }, + } + }, }, }, bigslots = { - 1, 4, 6, 7 -- In fact, 7 is the last one. + 2, 4, 6, 7 -- In fact, 7 is the last one. }, }, } diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/newcomputermodern-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/newcomputermodern-math.lfg index 12c6e8b23b3..6f253524648 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/newcomputermodern-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/newcomputermodern-math.lfg @@ -70,8 +70,10 @@ return { end, NoLimitSupFactor = 0, NoLimitSubFactor = 1200, - DelimiterPercent = 90, - DelimiterShortfall = 400, + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, -- MS + DelimiterDisplayShortfall = 400, AccentTopShiftUp = -60, FlattenedAccentTopShiftUp = -60, SubscriptBaselineDropMin = 50, -- 200 in font (multiplied by 0.59999/2.39868) @@ -79,9 +81,10 @@ return { SubscriptShiftDownWithSuperscript = 247, -- relates to the previous one (see math-act) SuperscriptBaselineDropMax = 386, -- 250 in font (multiplied by 4.6333/2.99 (values in cm/values in lm)) SuperscriptShiftUp = 413, -- 363 in font (multiplied with 4.9547/4.3536, got 413) - SuperscriptShiftUpCramped = 413, -- 289 in font (no distinction, old TeX) + SuperscriptShiftUpCramped = 329, -- 289 in font (same factor as uncramped one (no distinction, old TeX) PrimeShiftUp = "1.1*SuperscriptShiftUp", PrimeShiftUpCramped = "1.1*SuperscriptShiftUp", + RadicalDisplayStyleVerticalGap = 100,--"RadicalVerticalGap" too small, 148, 50 }, tweaks = { aftercopying = { @@ -158,6 +161,14 @@ return { radical = { height = .15, yoffset = .823, leftoffset = .065, rightoffset = .065, leftoverlap = 0.03 }, stacker = { height = .15, yoffset = .85 }, }, + { + tweak = "fixvariants", + list = { + [0x007C] = { template = 0x005B, index = 1, yoffset = .03 }, + [0x2016] = { template = 0x005B, index = 1, yoffset = .03 }, + [0x2980] = { template = 0x005B, index = 1, yoffset = .03 }, + } + }, { tweak = "addfourier", variant = 1, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/pagella-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/pagella-math.lfg index 05e6fad814a..1de0cfa95ec 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/pagella-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/pagella-math.lfg @@ -16,14 +16,16 @@ return { AccentTopShiftUp = 10, FlattenedAccentTopShiftUp = 10, AccentBaseDepth = 80, - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1500 in font SuperscriptShiftUp = 386, -- 354 in font SubscriptShiftDown = 200, -- 232 in font SubscriptShiftDownWithSuperscript = "1.4*SubscriptShiftDown", -- 1.5* in math-act - PrimeShiftUp = "1.3*SuperscriptShiftUp", - PrimeShiftUpCramped = "1.3*SuperscriptShiftUp", + PrimeShiftUp = "1.1*SuperscriptShiftUp", + PrimeShiftUpCramped = "1.1*SuperscriptShiftUp", }, tweaks = { aftercopying = { @@ -58,7 +60,18 @@ return { { source = "uppercasegreekbold", target = "uppercasegreekbold" }, { source = "digitsnormal", target = "digitsnormal" }, -- - { source = { first = 0x02100, last = 0x02BFF } }, -- symbols + -- either + -- + -- { source = { first = 0x0007B, last = 0x0007D } }, -- { } + -- { source = { first = 0x0005B, last = 0x0005D } }, -- [ ] + -- { source = { first = 0x00028, last = 0x00029 } }, -- ( ) + -- { source = { first = 0x02100, last = 0x02BFF } }, -- symbols -- has snippets of {} () [] + -- + -- or (probably even more) + -- + { source = { first = 0x02100, last = 0x0239A } }, -- symbols -- has snippets of {} () [] + { source = { first = 0x023B5, last = 0x02BFF } }, -- symbols -- has snippets of {} () [] + -- { source = { first = 0x1D400, last = 0x1D7FF } }, -- various alphabets }, }, @@ -69,7 +82,15 @@ return { tweak = "fixoldschool", feature = "euleroverpagella", }, - + { + tweak = "replacealphabets", + list = { + { + source = { first = 0x02980 }, -- triplebar + filename = "TeXGyrePagellaMath-Companion.otf", + }, + }, + }, presets.scripttocalligraphic { }, presets.rsfstoscript { }, presets.rsfsuprighttoscript { }, @@ -85,6 +106,9 @@ return { { tweak = "checkaccents", }, + { + tweak = "wipeweirdones", + }, { tweak = "parameters", feature = "euleroverpagella", @@ -185,6 +209,7 @@ return { ["0x2A0C.parts.bottom"] = { bottomright = -0.05 }, -- iiiint }, }, + presets.addmathkerns { }, { tweak = "checkspacing", }, @@ -203,10 +228,11 @@ return { { tweak = "addarrows", }, - { - tweak = "addbars", - advance = 0.2, - }, +-- { +-- tweak = "addbars", +-- advance = 0.2, +-- variant = 2, +-- }, { tweak = "replacerules", fraction = { height = .215, yoffset = .785 }, @@ -231,9 +257,9 @@ return { tweak = "addfourier", variant = 1, }, - { - tweak = "addprimed", - }, +-- { +-- tweak = "addprimed", +-- }, { tweak = "kernpairs", list = { diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/schola-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/schola-math.lfg index 42c2bbcc21b..5bca0e19b7c 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/schola-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/schola-math.lfg @@ -110,6 +110,7 @@ return { { tweak = "copyaccents", }, + presets.addmathkerns { }, { tweak = "checkspacing", }, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/stixtwo-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/stixtwo-math.lfg index 881de752381..811daffdbea 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/stixtwo-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/stixtwo-math.lfg @@ -52,11 +52,16 @@ return { AccentBaseDepth = 30, FlattenedAccentTopShiftUp = 0, RadicalKernAfterDegree = -500, - DelimiterPercent = 90, - DelimiterShortfall = 400, + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1800 in font PrimeShiftUp = "1.3*SuperscriptShiftUp", PrimeShiftUpCramped = "1.3*SuperscriptShiftUp", + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --170, 85 +-- SuperscriptSnap = 1000, +-- SubscriptSnap = 500, }, tweaks = { aftercopying = { @@ -76,13 +81,34 @@ return { tweak = "replacealphabets", list = { { - source = "uppercasescript", - target = "uppercasecalligraphic", + source = "uppercasescript", + target = "uppercasecalligraphic", + unicode = "uppercasescript", }, { - source = "uppercasescript", - target = "uppercasescript", - feature = "ss01", + source = "uppercasescript", + target = "uppercasescript", + feature = "ss01", + }, + { + source = { first = 0xE17D, last = 0xE195 }, + target = "uppercasesansgreek", + unicode = "uppercasegreeknormal", + }, + { + source = { first = 0xE196, last = 0xE1AE }, -- maybe last = E1B3 + target = "lowercasesansgreek", + unicode = "lowercasegreeknormal", + }, + { + source = { first = 0xE1BF, last = 0xE1D7 }, + target = "uppercaseitalicsansgreek", + unicode = "uppercasegreekitalic", + }, + { + source = { first = 0xE1D8, last = 0xE1F0 }, -- maybe last = E1F5 + target = "lowercaseitalicsansgreek", + unicode = "lowercasegreekitalic", }, }, }, @@ -199,10 +225,6 @@ return { { tweak = "fixslashes", }, - { -- already exists, but not good spacing - tweak = "addbars", - advance = 0.4, - }, { tweak = "replacerules", minus = { @@ -251,6 +273,11 @@ return { } } }, +{ + tweak = "addbars", + advance = 0.3, + check = true, -- only add triples +}, -- this is the mkiv section { tweak = "emulatelmtx", diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/termes-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/termes-math.lfg index 7dfc73207ab..5d25fe19740 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/termes-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/termes-math.lfg @@ -15,11 +15,13 @@ return { AccentTopShiftUp = -15, FlattenedAccentTopShiftUp = -15, AccentBaseDepth = 50, - DelimiterPercent = 90, + DelimiterPercent = 85, DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) - SuperscriptShiftUp = 310, -- 339 - SubscriptShiftDown = 200, -- 222 + SuperscriptShiftUp = 310, -- 339 + SubscriptShiftDown = 200, -- 222 SubscriptShiftDownWithSuperscript = "1.40*SubscriptShiftDown", -- 1.5* in math-act PrimeShiftUp = "1.35*SuperscriptShiftUp", PrimeShiftUpCramped = "1.35*SuperscriptShiftUp", @@ -37,6 +39,15 @@ return { { tweak = "addmirrors", }, + { + tweak = "replacealphabets", + list = { + { + source = { first = 0x02980 }, -- triplebar + filename = "TeXGyreTermesMath-Companion.otf", + }, + }, + }, presets.scripttocalligraphic { }, presets.rsfstoscript { rscale = 0.97 }, presets.rsfsuprighttoscript { rscale = 0.97 }, @@ -116,6 +127,7 @@ return { tweak = "copyaccents", }, -- So far for the accents. + presets.addmathkerns { }, { tweak = "checkspacing", }, @@ -141,10 +153,10 @@ return { -- radical = { height = .2, yoffset = .8 }, -- stacker = { height = .2, yoffset = .8 }, -- }, - { - tweak = "addbars", - advance = 0.3, - }, + -- { + -- tweak = "addbars", + -- advance = 0.3, + -- }, { tweak = "addactuarian", }, diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-antykwa.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-antykwa.mkiv index 413223df1b2..09431ca8426 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-antykwa.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-antykwa.mkiv @@ -13,20 +13,25 @@ \starttypescriptcollection[antykwa-torunska] - \startsetups[antykwa] - \setmathfenceparameter\c!alternative{1}% - \stopsetups - - % cond => -cont as in iwona - - \startsetups[antykwa-light] \directsetup{antykwa}\stopsetups - \startsetups[antykwa-cond] \directsetup{antykwa}\stopsetups - \startsetups[antykwa-light-cond] \directsetup{antykwa}\stopsetups - % these long names are obsolete and will go away - \startsetups[antykwa-torunska] \directsetup{antykwa}\stopsetups - \startsetups[antykwa-torunska-light] \directsetup{antykwa}\stopsetups - \startsetups[antykwa-torunska-cond] \directsetup{antykwa}\stopsetups - \startsetups[antykwa-torunska-light-cond]\directsetup{antykwa}\stopsetups + \pushglobalsetups + + \startsetups[\s!math:antykwa] + \setmathfenceparameter\c!alternative{1}% + \setupmathradical[\c!leftmargin=.05mq,\c!mindepth=.05mx]% + \stopsetups + + % cond => -cont as in iwona + + \startsetups[\s!math:antykwa-light] \fastsetup{\s!math:antykwa}\stopsetups + \startsetups[\s!math:antykwa-cond] \fastsetup{\s!math:antykwa}\stopsetups + \startsetups[\s!math:antykwa-light-cond] \fastsetup{\s!math:antykwa}\stopsetups + % these long names are obsolete and will go away + \startsetups[\s!math:antykwa-torunska] \fastsetup{\s!math:antykwa}\stopsetups + \startsetups[\s!math:antykwa-torunska-light] \fastsetup{\s!math:antykwa}\stopsetups + \startsetups[\s!math:antykwa-torunska-cond] \fastsetup{\s!math:antykwa}\stopsetups + \startsetups[\s!math:antykwa-torunska-light-cond]\fastsetup{\s!math:antykwa}\stopsetups + + \popglobalsetups % these fetaures make the loaded base font unique: diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-cambria.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-cambria.mkiv index c8906df2c60..85f6766acdd 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-cambria.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-cambria.mkiv @@ -17,6 +17,14 @@ \starttypescriptcollection[cambria] + \pushglobalsetups + + \startsetups[\s!math:cambria] + \setupmathradical[\c!leftmargin=.05mq,\c!mindepth=.05mx]% + \stopsetups + + \popglobalsetups + % microsoft: cambria.ttc cambriab.ttf cambriai.ttf cambriaz.ttf % ascender : cambmath.ttf cambria.ttf cambriab.ttf cambriai.ttf cambriaz.ttf diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv index 46c73956f39..b84d0a7d5fe 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv @@ -65,9 +65,11 @@ \starttypescriptcollection[ebgaramond] -% \startsetups[ebgaramond] -% % \setmathfenceparameter \c!alternative{1}% -% \stopsetups + % \pushglobalsetups + % \startsetups[ebgaramond] + % % \setmathfenceparameter \c!alternative{1}% + % \stopsetups + % \popglobalsetups \doifunknownfontfeature {ebgaramond-math-bold} {\definefontfeature[ebgaramond-math-bold][boldened]} diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-erewhon.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-erewhon.mkiv index 660b4c58a06..94921609aa7 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-erewhon.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-erewhon.mkiv @@ -17,6 +17,12 @@ \starttypescriptcollection[erewhon] + \pushglobalsetups + \startsetups[\s!math:erewhon] + \setupmathradical[\c!leftmargin=.1mq,mindepth=0.1mx]% + \stopsetups + \popglobalsetups + %\definefontfeature[default-slanted-erewhon][default][slant=.2] %\definefontfeature[none-slanted-erewhon] [none] [slant=.2] diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-fira.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-fira.mkiv new file mode 100644 index 00000000000..1b9f782bf7e --- /dev/null +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-fira.mkiv @@ -0,0 +1,31 @@ +%D \module +%D [ file=type-imp-fira, +%D version=2023.07.22, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Fira, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\starttypescriptcollection[fira] + + \usetypescriptfile[dejavu] + + \starttypescript [\s!math] [fira] [\s!name] + \definefontsynonym [\s!MathRoman] [\s!file:firamath-regular.otf] [\s!features={\s!math\mathsizesuffix,fira:mathextra,mathextra},\s!goodies=fira-math] + \definefontsynonym [\s!MathRomanBold] [\s!file:firamath-regular.otf] [\s!features={\s!math\mathsizesuffix,fira-math-bold,fira:mathextra,mathextra},\s!goodies=fira-math] + \stoptypescript + + \starttypescript[fira] + \definetypeface[\typescriptone][\s!rm][\s!serif][dejavu] [\s!default] + \definetypeface[\typescriptone][\s!ss][\s!sans] [dejavu] [\s!default] + \definetypeface[\typescriptone][\s!tt][\s!mono] [dejavu] [\s!default] + \definetypeface[\typescriptone][\s!mm][\s!math] [\typescriptone][\s!default] + \stoptypescript + +\stoptypescriptcollection + diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-gfsneohellenic.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-gfsneohellenic.mkiv new file mode 100644 index 00000000000..6d6089bb6e3 --- /dev/null +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-gfsneohellenic.mkiv @@ -0,0 +1,35 @@ + +\starttypescriptcollection[gfsneohellenic] + + \doifunknownfontfeature {gfsneohellenic-math-bold} {\definefontfeature[gfsneohellenic-math-bold][boldened]} + + \starttypescript [\s!serif] [gfsneohellenic,gfsneohellenic-nt] [\s!name] + \definefontsynonym [\s!Serif] [\s!file:GFSNeohellenic] [\s!features=\s!default] + \definefontsynonym [\s!SerifItalic] [\s!file:GFSNeohellenicIt] [\s!features=\s!default] + \definefontsynonym [\s!SerifBold] [\s!file:GFSNeohellenicBold] [\s!features=\s!default] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:GFSNeohellenicBoldIt] [\s!features=\s!default] + \stoptypescript + + \starttypescript [\s!math] [gfsneohellenic,gfsneohellenic-nt][\s!name] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55] + \stoptypescript + + \starttypescript [\s!math] [gfsneohellenic][\s!name] + \definefontsynonym [\s!MathRoman] [\s!file:GFSNeohellenicMath.otf][\s!features={\s!math\mathsizesuffix,gfsneohellenic:mathextra,mathextra},\s!goodies=gfsneohellenic-math] + \definefontsynonym [\s!MathRomanBold][\s!file:GFSNeohellenicMath.otf][\s!features={\s!math\mathsizesuffix,gfsneohellenic-math-bold,gfsneohellenic:mathextra,mathextra},\s!goodies=gfsneohellenic-math] + \stoptypescript + + \starttypescript [\s!math] [gfsneohellenic-nt][\s!name] + \definefontsynonym [\s!MathRoman] [\s!file:GFSNeohellenicMath.otf][\s!features={\s!math\mathsizesuffix,gfsneohellenic:mathextra,mathextra}] + \definefontsynonym [\s!MathRomanBold][\s!file:GFSNeohellenicMath.otf][\s!features={\s!math\mathsizesuffix,gfsneohellenic-math-bold,gfsneohellenic:mathextra,mathextra}] + \stoptypescript + + \starttypescript [gfsneohellenic,gfsneohellenic-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] + % \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] + \quittypescriptscanning + \stoptypescript + +\stoptypescriptcollection diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-iwona.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-iwona.mkiv index e682622652d..ab2e5d547a4 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-iwona.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-iwona.mkiv @@ -1,6 +1,6 @@ %D \module %D [ file=type-imp-iwona, -%D version=2010.06.21, +%D version=2023.11.05, % 2010.06.21, %D title=\CONTEXT\ Typescript Macros, %D subtitle=Iwona, %D author=Mojca Miklavec \& Hans Hagen \& Mikael Sundqvist, @@ -13,17 +13,21 @@ \starttypescriptcollection[iwona] - \startsetups[iwona] - \setmathfenceparameter\c!alternative{1}% - \stopsetups + \pushglobalsetups - \startsetups[iwona-light] \directsetup{antykwa}\stopsetups - \startsetups[iwona-medium] \directsetup{antykwa}\stopsetups - \startsetups[iwona-heavy] \directsetup{antykwa}\stopsetups - \startsetups[iwona-cond] \directsetup{antykwa}\stopsetups - \startsetups[iwona-light-cond] \directsetup{antykwa}\stopsetups - \startsetups[iwona-medium-cond]\directsetup{antykwa}\stopsetups - \startsetups[iwona-heavy-cond] \directsetup{antykwa}\stopsetups + \startsetups[\s!math:iwona] + \setmathfenceparameter\c!alternative{1}% + \stopsetups + + \startsetups[\s!math:iwona-light] \fastsetup{\s!math:iwona}\stopsetups + \startsetups[\s!math:iwona-medium] \fastsetup{\s!math:iwona}\stopsetups + \startsetups[\s!math:iwona-heavy] \fastsetup{\s!math:iwona}\stopsetups + \startsetups[\s!math:iwona-cond] \fastsetup{\s!math:iwona}\stopsetups + \startsetups[\s!math:iwona-light-cond] \fastsetup{\s!math:iwona}\stopsetups + \startsetups[\s!math:iwona-medium-cond]\fastsetup{\s!math:iwona}\stopsetups + \startsetups[\s!math:iwona-heavy-cond] \fastsetup{\s!math:iwona}\stopsetups + + \popglobalsetups \definefontfeature[virtualmath-iwona] [virtualmath][virtualweight=iwona] \definefontfeature[virtualmath-iwona-light] [virtualmath][virtualweight=iwona-light] @@ -35,78 +39,82 @@ \definefontfeature[virtualmath-iwona-medium-nt][virtualmath][virtualweight=iwona-medium-nt] \definefontfeature[virtualmath-iwona-heavy-nt] [virtualmath][virtualweight=iwona-heavy-nt] - \starttypescript [\s!sans] [iwona,iwona-light,iwona-medium,iwona-heavy,iwona-cond,iwona-light-cond,iwona-medium-cond,iwona-heavy-cond,iwona,iwona-light-nt,iwona-medium-nt,iwona-heavy-nt,iwona-cond-nt,iwona-light-cond-nt,iwona-medium-cond-nt,iwona-heavy-cond-nt] - - \definefontsynonym [Iwona-Regular] [\s!file:Iwona-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-Italic] [\s!file:Iwona-Italic] [\s!features=\s!default] - \definefontsynonym [Iwona-Bold] [\s!file:Iwona-Bold] [\s!features=\s!default] - \definefontsynonym [Iwona-BoldItalic] [\s!file:Iwona-BoldItalic] [\s!features=\s!default] - \definefontsynonym [Iwona-Light-Regular] [\s!file:IwonaLight-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-Light-Italic] [\s!file:IwonaLight-Italic] [\s!features=\s!default] - \definefontsynonym [Iwona-Medium-Regular] [\s!file:IwonaMedium-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-Medium-Italic] [\s!file:IwonaMedium-Italic] [\s!features=\s!default] - \definefontsynonym [Iwona-Heavy-Regular] [\s!file:IwonaHeavy-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-Heavy-Italic] [\s!file:IwonaHeavy-Italic] [\s!features=\s!default] - - \definefontsynonym [Iwona-CondRegular] [\s!file:IwonaCond-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-CondItalic] [\s!file:IwonaCond-Italic] [\s!features=\s!default] - \definefontsynonym [Iwona-CondBold] [\s!file:IwonaCond-Bold] [\s!features=\s!default] - \definefontsynonym [Iwona-CondBoldItalic] [\s!file:IwonaCond-BoldItalic] [\s!features=\s!default] - \definefontsynonym [Iwona-CondLight-Regular] [\s!file:IwonaCondLight-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-CondLight-Italic] [\s!file:IwonaCondLight-Italic] [\s!features=\s!default] - \definefontsynonym [Iwona-CondMedium-Regular] [\s!file:IwonaCondMedium-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-CondMedium-Italic] [\s!file:IwonaCondMedium-Italic] [\s!features=\s!default] - \definefontsynonym [Iwona-CondHeavy-Regular] [\s!file:IwonaCondHeavy-Regular] [\s!features=\s!default] - \definefontsynonym [Iwona-CondHeavy-Italic] [\s!file:IwonaCondHeavy-Italic] [\s!features=\s!default] - + \starttypescript [\s!sans] [% + iwona,iwona-light,iwona-medium,iwona-heavy,iwona-cond,% + iwona-nt,iwona-light-nt,iwona-medium-nt,iwona-heavy-nt% + ] + + \definefontsynonym [Iwona-Regular] [\s!file:Iwona-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-Italic] [\s!file:Iwona-Italic] [\s!features=\s!default] + \definefontsynonym [Iwona-Bold] [\s!file:Iwona-Bold] [\s!features=\s!default] + \definefontsynonym [Iwona-BoldItalic] [\s!file:Iwona-BoldItalic] [\s!features=\s!default] + \definefontsynonym [Iwona-Light] [\s!file:IwonaLight-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-LightItalic] [\s!file:IwonaLight-Italic] [\s!features=\s!default] + \definefontsynonym [Iwona-Medium] [\s!file:IwonaMedium-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-MediumItalic] [\s!file:IwonaMedium-Italic] [\s!features=\s!default] + \definefontsynonym [Iwona-Heavy] [\s!file:IwonaHeavy-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-HeavyItalic] [\s!file:IwonaHeavy-Italic] [\s!features=\s!default] + \stoptypescript + + \starttypescript [\s!sans] [% + iwona-cond,iwona-light-cond,iwona-medium-cond,iwona-heavy-cond,% + iwona-cond-nt,iwona-light-cond-nt,iwona-medium-cond-nt,iwona-heavy-cond-nt% + ] + \definefontsynonym [Iwona-Cond-Regular] [\s!file:IwonaCond-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-Italic] [\s!file:IwonaCond-Italic] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-Bold] [\s!file:IwonaCond-Bold] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-BoldItalic] [\s!file:IwonaCond-BoldItalic] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-Light] [\s!file:IwonaCondLight-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-LightItalic] [\s!file:IwonaCondLight-Italic] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-Medium] [\s!file:IwonaCondMedium-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-MediumItalic] [\s!file:IwonaCondMedium-Italic] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-Heavy] [\s!file:IwonaCondHeavy-Regular] [\s!features=\s!default] + \definefontsynonym [Iwona-Cond-HeavyItalic] [\s!file:IwonaCondHeavy-Italic] [\s!features=\s!default] \stoptypescript % [all] is redundant - \starttypescript [\s!math][iwona][\s!all] + \starttypescript [\s!math][iwona,iwona-cond][\s!all] \definefontsynonym[\s!MathRoman] [iwonamath@iwona-math] \definefontsynonym[\s!MathRomanBold][iwonamediummath@iwona-medium-math] \stoptypescript - \starttypescript [\s!math][iwona-light][\s!all] + \starttypescript [\s!math][iwona-light,iwona-light-cond][\s!all] \definefontsynonym[\s!MathRoman] [iwonalightmath@iwona-light-math] - \definefontsynonym[\s!MathRomanBold][iwonamath@kurier-medium-math] + \definefontsynonym[\s!MathRomanBold][iwonamath@iwona-math] \stoptypescript - \starttypescript [\s!math][iwona-medium][\s!all] + \starttypescript [\s!math][iwona-medium,iwona-medium-cond][\s!all] \definefontsynonym[\s!MathRoman] [iwonamediummath@iwona-medium-math] - \definefontsynonym[\s!MathRomanBold][kurierheavymath@kurier-heavy-math] + \definefontsynonym[\s!MathRomanBold][iwonaheavymath@iwona-heavy-math] \stoptypescript - \starttypescript [\s!math][iwona-heavy][\s!all] + \starttypescript [\s!math][iwona-heavy,iwona-heavy-cond][\s!all] \definefontsynonym[\s!MathRoman][iwonaheavymath@iwona-heavy-math] \stoptypescript - \starttypescript [\s!math][iwona-nt][\s!all] + \starttypescript [\s!math][iwona-nt,iwona-cond-nt][\s!all] \definefontsynonym[\s!MathRoman] [iwonamathnt@iwona-math-nt] \definefontsynonym[\s!MathRomanBold][iwonamediummathnt@iwona-medium-math-nt] \stoptypescript - \starttypescript [\s!math][iwona-light-nt][\s!all] + \starttypescript [\s!math][iwona-light-nt,iwona-light-cond-nt][\s!all] \definefontsynonym[\s!MathRoman] [iwonalightmathnt@iwona-light-math-nt] - \definefontsynonym[\s!MathRomanBold][iwonamathnt@kurier-medium-math-nt] + \definefontsynonym[\s!MathRomanBold][iwonamathnt@iwona-math-nt] \stoptypescript - \starttypescript [\s!math][iwona-medium-nt][\s!all] + \starttypescript [\s!math][iwona-medium-nt,iwona-medium-cond-nt][\s!all] \definefontsynonym[\s!MathRoman] [iwonamediummathnt@iwona-medium-math-nt] - \definefontsynonym[\s!MathRomanBold][kurierheavymathnt@kurier-heavy-math-nt] + \definefontsynonym[\s!MathRomanBold][iwonaheavymathnt@iwona-heavy-math-nt] \stoptypescript - \starttypescript [\s!math][iwona-heavy-nt][\s!all] + \starttypescript [\s!math][iwona-heavy-nt,iwona-heavy-cond-nt][\s!all] \definefontsynonym[\s!MathRoman][iwonaheavymathnt@iwona-heavy-math-nt] \stoptypescript - \starttypescript [\s!math] [iwona,iwona-light,iwona-medium,iwona-heavy-nt,iwona-nt,iwona-light-nt,iwona-medium-nt,iwona-heavy-nt] [\s!all] + \starttypescript [\s!math] [% + iwona,iwona-light,iwona-medium,iwona-heavy,% + iwona-nt,iwona-light-nt,iwona-medium-nt,iwona-heavy-nt,% + iwona-cond,iwona-light-cond,iwona-medium-cond,iwona-heavy-cond,% + iwona-cond-nt,iwona-light-cond-nt,iwona-medium-cond-nt,iwona-heavy-cond-nt,% + ] [\s!all] \loadfontgoodies[iwona-math] \stoptypescript - \starttypescript [\s!sans] [iwona-light,iwona-light-nt] [\s!name] - \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Iwona-Light-Regular] - \definefontsynonym [\s!SansItalic] [Iwona-Light-Italic] - \definefontsynonym [\s!SansBold] [Iwona-Medium-Regular] - \definefontsynonym [\s!SansBoldItalic] [Iwona-Medium-Italic] - \stoptypescript - \starttypescript [\s!sans] [iwona,iwona-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-Regular] @@ -115,52 +123,65 @@ \definefontsynonym [\s!SansBoldItalic] [Iwona-BoldItalic] \stoptypescript + \starttypescript [\s!sans] [iwona-light,iwona-light-nt] [\s!name] + \setups[\s!font:\s!fallback:\s!sans] + \definefontsynonym [\s!Sans] [Iwona-Light] + \definefontsynonym [\s!SansItalic] [Iwona-LightItalic] + \definefontsynonym [\s!SansBold] [Iwona-Medium] + \definefontsynonym [\s!SansBoldItalic] [Iwona-MediumItalic] + \stoptypescript + \starttypescript [\s!sans] [iwona-medium,iwona-medium-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Iwona-Medium-Regular] - \definefontsynonym [\s!SansItalic] [Iwona-Medium-Italic] - \definefontsynonym [\s!SansBold] [Iwona-Heavy-Regular] - \definefontsynonym [\s!SansBoldItalic] [Iwona-Heavy-Italic] + \definefontsynonym [\s!Sans] [Iwona-Medium] + \definefontsynonym [\s!SansItalic] [Iwona-MediumItalic] + \definefontsynonym [\s!SansBold] [Iwona-Heavy] + \definefontsynonym [\s!SansBoldItalic] [Iwona-HeavyItalic] \stoptypescript \starttypescript [\s!sans] [iwona-heavy,iwona-heavy-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Iwona-Heavy-Regular] - \definefontsynonym [\s!SansItalic] [Iwona-Heavy-Italic] - \definefontsynonym [\s!SansBold] [Iwona-Heavy-Regular] - \definefontsynonym [\s!SansBoldItalic] [Iwona-Heavy-Italic] + \definefontsynonym [\s!Sans] [Iwona-Heavy] + \definefontsynonym [\s!SansItalic] [Iwona-HeavyItalic] + \definefontsynonym [\s!SansBold] [Iwona-Heavy] + \definefontsynonym [\s!SansBoldItalic] [Iwona-HeavyItalic] \stoptypescript \starttypescript [\s!sans] [iwona-light-cond,iwona-light-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Iwona-CondLight-Regular] - \definefontsynonym [\s!SansItalic] [Iwona-CondLight-Italic] - \definefontsynonym [\s!SansBold] [Iwona-CondMedium-Regular] - \definefontsynonym [\s!SansBoldItalic] [Iwona-CondMedium-Italic] + \definefontsynonym [\s!Sans] [Iwona-Cond-Light] + \definefontsynonym [\s!SansItalic] [Iwona-Cond-LightItalic] + \definefontsynonym [\s!SansBold] [Iwona-Cond-Medium] + \definefontsynonym [\s!SansBoldItalic] [Iwona-Cond-MediumItalic] \stoptypescript \starttypescript [\s!sans] [iwona-cond,iwona-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Iwona-CondRegular] - \definefontsynonym [\s!SansItalic] [Iwona-CondItalic] - \definefontsynonym [\s!SansBold] [Iwona-CondBold] - \definefontsynonym [\s!SansBoldItalic] [Iwona-CondBoldItalic] + \definefontsynonym [\s!Sans] [Iwona-Cond-Regular] + \definefontsynonym [\s!SansItalic] [Iwona-Cond-Italic] + \definefontsynonym [\s!SansBold] [Iwona-Cond-Bold] + \definefontsynonym [\s!SansBoldItalic] [Iwona-Cond-BoldItalic] \stoptypescript \starttypescript [\s!sans] [iwona-medium-cond,iwona-medium-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Iwona-CondMedium-Regular] - \definefontsynonym [\s!SansItalic] [Iwona-CondMedium-Italic] - \definefontsynonym [\s!SansBold] [Iwona-CondHeavy-Regular] - \definefontsynonym [\s!SansBoldItalic] [Iwona-CondHeavy-Italic] - \stoptypescript - - \starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium,iwona-nt,iwona-light-nt,iwona-heavy-nt,iwona-medium-nt] - \definetypeface[\typescriptone][\s!ss][\s!sans] [\typescriptone] [\s!default] - \definetypeface[\typescriptone][\s!rm][\s!serif][modern] [\s!default] - \definetypeface[\typescriptone][\s!tt][\s!mono] [modern] [\s!default] - \definetypeface[\typescriptone][\s!mm][\s!math] [\typescriptone] [\s!default][text=ss] + \definefontsynonym [\s!Sans] [Iwona-Cond-Medium] + \definefontsynonym [\s!SansItalic] [Iwona-Cond-MediumItalic] + \definefontsynonym [\s!SansBold] [Iwona-Cond-Heavy] + \definefontsynonym [\s!SansBoldItalic] [Iwona-Cond-HeavyItalic] + \stoptypescript + + \starttypescript [% + iwona,iwona-light,iwona-medium,iwona-heavy,% + iwona-nt,iwona-light-nt,iwona-medium-nt,iwona-heavy-nt,% + iwona-cond,iwona-light-cond,iwona-medium-cond,iwona-heavy-cond,% + iwona-cond-nt,iwona-light-cond-nt,iwona-medium-cond-nt,iwona-heavy-cond-nt% + ] + \definetypeface[\typescriptone][\s!ss][\s!sans] [\typescriptone][\s!default] + \definetypeface[\typescriptone][\s!rm][\s!serif][modern] [\s!default] + \definetypeface[\typescriptone][\s!tt][\s!mono] [modern] [\s!default] + \definetypeface[\typescriptone][\s!mm][\s!math] [\typescriptone][\s!default][text=ss] \quittypescriptscanning \stoptypescript diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-kurier.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-kurier.mkiv index 3f68cbfadd3..3040107c3f6 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-kurier.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-kurier.mkiv @@ -1,9 +1,9 @@ %D \module %D [ file=type-imp-kurier, -%D version=2021.10.24, +%D version=2023.11.5, % 2021.10.24, %D title=\CONTEXT\ Typescript Macros, %D subtitle=Kurier, -%D author=Hans Hagen & Mikael Sundqvist, +%D author=Hans Hagen \& Mikael Sundqvist, %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C @@ -11,19 +11,23 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\starttypescriptcollection [kurier] +\starttypescriptcollection[kurier] - \startsetups[kurier] - \setmathfenceparameter\c!alternative{1}% - \stopsetups + \pushglobalsetups - \startsetups[kurier-light] \directsetup{antykwa}\stopsetups - \startsetups[kurier-medium] \directsetup{antykwa}\stopsetups - \startsetups[kurier-heavy] \directsetup{antykwa}\stopsetups - \startsetups[kurier-cond] \directsetup{antykwa}\stopsetups - \startsetups[kurier-light-cond] \directsetup{antykwa}\stopsetups - \startsetups[kurier-medium-cond]\directsetup{antykwa}\stopsetups - \startsetups[kurier-heavy-cond] \directsetup{antykwa}\stopsetups + \startsetups[\s!math:kurier] + \setmathfenceparameter\c!alternative{1}% + \stopsetups + + \startsetups[\s!math:kurier-light] \fastsetup{\s!math:kurier}\stopsetups + \startsetups[\s!math:kurier-medium] \fastsetup{\s!math:kurier}\stopsetups + \startsetups[\s!math:kurier-heavy] \fastsetup{\s!math:kurier}\stopsetups + \startsetups[\s!math:kurier-cond] \fastsetup{\s!math:kurier}\stopsetups + \startsetups[\s!math:kurier-light-cond] \fastsetup{\s!math:kurier}\stopsetups + \startsetups[\s!math:kurier-medium-cond]\fastsetup{\s!math:kurier}\stopsetups + \startsetups[\s!math:kurier-heavy-cond] \fastsetup{\s!math:kurier}\stopsetups + + \popglobalsetups \definefontfeature[virtualmath-kurier] [virtualmath][virtualweight=kurier] \definefontfeature[virtualmath-kurier-light] [virtualmath][virtualweight=kurier-light] @@ -35,77 +39,82 @@ \definefontfeature[virtualmath-kurier-medium-nt][virtualmath][virtualweight=kurier-medium-nt] \definefontfeature[virtualmath-kurier-heavy-nt] [virtualmath][virtualweight=kurier-heavy-nt] - \starttypescript [\s!sans] [kurier-light,kurier,kurier-medium,kurier-heavy,kurier-light-nt,kurier-nt,kurier-medium-nt,kurier-heavy-nt] - \definefontsynonym [Kurier-Light] [\s!file:kurierlightregular] [\s!features=\s!default] - \definefontsynonym [Kurier-LightItalic] [\s!file:kurierlightitalic] [\s!features=\s!default] - \definefontsynonym [Kurier-Regular] [\s!file:kurierregular] [\s!features=\s!default] - \definefontsynonym [Kurier-Italic] [\s!file:kurieritalic] [\s!features=\s!default] - \definefontsynonym [Kurier-Medium] [\s!file:kuriermediumregular] [\s!features=\s!default] - \definefontsynonym [Kurier-MediumItalic] [\s!file:kuriermediumitalic] [\s!features=\s!default] - \definefontsynonym [Kurier-Bold] [\s!file:kurierbold] [\s!features=\s!default] - \definefontsynonym [Kurier-BoldItalic] [\s!file:kurierbolditalic] [\s!features=\s!default] - \definefontsynonym [Kurier-Heavy] [\s!file:kurierheavyregular] [\s!features=\s!default] - \definefontsynonym [Kurier-HeavyItalic] [\s!file:kurierheavyitalic] [\s!features=\s!default] - \stoptypescript - - \starttypescript [\s!sans] [kurier-lightcond,kurier-cond,kurier-mediumcond,kurier-lightcond-nt,kurier-cond-nt,kurier-mediumcond-nt] - \definefontsynonym [Kurier-CondLight] [\s!file:kuriercondlightregular] [\s!features=\s!default] - \definefontsynonym [Kurier-CondLightItalic] [\s!file:kuriercondlightitalic] [\s!features=\s!default] - \definefontsynonym [Kurier-CondRegular] [\s!file:kuriercondregular] [\s!features=\s!default] - \definefontsynonym [Kurier-CondItalic] [\s!file:kurierconditalic] [\s!features=\s!default] - \definefontsynonym [Kurier-CondMedium] [\s!file:kuriercondmediumregular] [\s!features=\s!default] - \definefontsynonym [Kurier-CondMediumItalic] [\s!file:kuriercondmediumitalic] [\s!features=\s!default] - \definefontsynonym [Kurier-CondBold] [\s!file:kuriercondbold] [\s!features=\s!default] - \definefontsynonym [Kurier-CondBoldItalic] [\s!file:kuriercondbolditalic] [\s!features=\s!default] - \definefontsynonym [Kurier-CondHeavy] [\s!file:kuriercondheavyregular] [\s!features=\s!default] - \definefontsynonym [Kurier-CondHeavyItalic] [\s!file:kuriercondheavyitalic] [\s!features=\s!default] - \stoptypescript + \starttypescript [\s!sans] [% + kurier,kurier-light,kurier-medium,kurier-heavy,kurier-cond,% + kurier-nt,kurier-light-nt,kurier-medium-nt,kurier-heavy-nt% + ] + \definefontsynonym [Kurier-Regular] [\s!file:kurierregular] [\s!features=\s!default] + \definefontsynonym [Kurier-Italic] [\s!file:kurieritalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Bold] [\s!file:kurierbold] [\s!features=\s!default] + \definefontsynonym [Kurier-BoldItalic] [\s!file:kurierbolditalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Light] [\s!file:kurierlightregular] [\s!features=\s!default] + \definefontsynonym [Kurier-LightItalic] [\s!file:kurierlightitalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Medium] [\s!file:kuriermediumregular] [\s!features=\s!default] + \definefontsynonym [Kurier-MediumItalic] [\s!file:kuriermediumitalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Heavy] [\s!file:kurierheavyregular] [\s!features=\s!default] + \definefontsynonym [Kurier-HeavyItalic] [\s!file:kurierheavyitalic] [\s!features=\s!default] + \stoptypescript + + \starttypescript [\s!sans] [% + kurier-cond,kurier-light-cond,kurier-medium-cond,kurier-heavy-cond,% + kurier-cond-nt,kurier-light-cond-nt,kurier-medium-cond-nt,kurier-heavy-cond-nt% + ] + \definefontsynonym [Kurier-Cond-Regular] [\s!file:kuriercondregular] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-Italic] [\s!file:kurierconditalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-Bold] [\s!file:kuriercondbold] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-BoldItalic] [\s!file:kuriercondbolditalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-Light] [\s!file:kuriercondlightregular] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-LightItalic] [\s!file:kuriercondlightitalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-Medium] [\s!file:kuriercondmediumregular] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-MediumItalic] [\s!file:kuriercondmediumitalic] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-Heavy] [\s!file:kuriercondheavyregular] [\s!features=\s!default] + \definefontsynonym [Kurier-Cond-HeavyItalic] [\s!file:kuriercondheavyitalic] [\s!features=\s!default] + \stoptypescript + + % [all] is redundant \starttypescript [\s!math][kurier][\s!all] \definefontsynonym[\s!MathRoman] [kuriermath@kurier-math] \definefontsynonym[\s!MathRomanBold][kuriermediummath@kurier-medium-math] \stoptypescript - \starttypescript [\s!math][kurier-light][\s!all] + \starttypescript [\s!math][kurier-light,kurier-light-cond][\s!all] \definefontsynonym[\s!MathRoman] [kurierlightmath@kurier-light-math] \definefontsynonym[\s!MathRomanBold][kuriermath@kurier-math] \stoptypescript - \starttypescript [\s!math][kurier-medium][\s!all] + \starttypescript [\s!math][kurier-medium,kurier-medium-cond][\s!all] \definefontsynonym[\s!MathRoman] [kuriermediummath@kurier-medium-math] \definefontsynonym[\s!MathRomanBold][kurierheavymath@kurier-heavy-math] \stoptypescript - \starttypescript [\s!math][kurier-heavy][\s!all] + \starttypescript [\s!math][kurier-heavy,kurier-heavy-cond][\s!all] \definefontsynonym[\s!MathRoman][kurierheavymath@kurier-heavy-math] \stoptypescript - \starttypescript [\s!math][kurier-nt][\s!all] + \starttypescript [\s!math][kurier-nt,kurier-cond-nt][\s!all] \definefontsynonym[\s!MathRoman] [kuriermathnt@kurier-math-nt] \definefontsynonym[\s!MathRomanBold][kuriermediummathnt@kurier-medium-math-nt] \stoptypescript - \starttypescript [\s!math][kurier-light-nt][\s!all] + \starttypescript [\s!math][kurier-light-nt,kurier-light-cond-nt][\s!all] \definefontsynonym[\s!MathRoman] [kurierlightmathnt@kurier-light-math-nt] \definefontsynonym[\s!MathRomanBold][kuriermathnt@kurier-math-nt] \stoptypescript - \starttypescript [\s!math][kurier-medium-nt][\s!all] + \starttypescript [\s!math][kurier-medium-nt,kurier-medium-cond-nt][\s!all] \definefontsynonym[\s!MathRoman] [kuriermediummathnt@kurier-medium-math-nt] \definefontsynonym[\s!MathRomanBold][kurierheavymathnt@kurier-heavy-math-nt] \stoptypescript - \starttypescript [\s!math][kurier-heavy-nt][\s!all] + \starttypescript [\s!math][kurier-heavy-nt,kurier-heavy-cond-nt][\s!all] \definefontsynonym[\s!MathRoman][kurierheavymathnt@kurier-heavy-math-nt] \stoptypescript - \starttypescript [\s!math] [kurier,kurier-light,kurier-medium,kurier-heavy,kurier-nt,kurier-light-nt,kurier-medium-nt,kurier-heavy-nt] [\s!all] + \starttypescript [\s!math] [% + kurier,kurier-light,kurier-medium,kurier-heavy,% + kurier-nt,kurier-light-nt,kurier-medium-nt,kurier-heavy-nt,% + kurier-cond,kurier-light-cond,kurier-medium-cond,kurier-heavy-cond,% + kurier-cond-nt,kurier-light-cond-nt,kurier-medium-cond-nt,kurier-heavy-cond-nt,% + ] [\s!all] \loadfontgoodies[kurier-math] \stoptypescript - \starttypescript [\s!sans] [kurier-light,kurier-light-nt] - \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Kurier-Light] - \definefontsynonym [\s!SansItalic] [Kurier-LightItalic] - \definefontsynonym [\s!SansBold] [Kurier-Medium] - \definefontsynonym [\s!SansBoldItalic] [Kurier-MediumItalic] - \stoptypescript - - \starttypescript [\s!sans] [kurier,kurier-nt] + \starttypescript [\s!sans] [kurier,kurier-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-Regular] \definefontsynonym [\s!SansItalic] [Kurier-Italic] @@ -113,7 +122,15 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-BoldItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-medium,kurier-medium-nt] + \starttypescript [\s!sans] [kurier-light,kurier-light-nt] [\s!name] + \setups[\s!font:\s!fallback:\s!sans] + \definefontsynonym [\s!Sans] [Kurier-Light] + \definefontsynonym [\s!SansItalic] [Kurier-LightItalic] + \definefontsynonym [\s!SansBold] [Kurier-Medium] + \definefontsynonym [\s!SansBoldItalic] [Kurier-MediumItalic] + \stoptypescript + + \starttypescript [\s!sans] [kurier-medium,kurier-medium-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-Medium] \definefontsynonym [\s!SansItalic] [Kurier-MediumItalic] @@ -121,43 +138,48 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-HeavyItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-heavy,kurier-heavy-nt] + \starttypescript [\s!sans] [kurier-heavy,kurier-heavy-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-Heavy] \definefontsynonym [\s!SansItalic] [Kurier-HeavyItalic] \definefontsynonym [\s!SansBold] [Kurier-Heavy] - \definefontsynonym [\s!SansBoldItalic] [Kurier-Heavy] + \definefontsynonym [\s!SansBoldItalic] [Kurier-HeavyItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-lightcond,kurier-lightcond-nt] + \starttypescript [\s!sans] [kurier-light-cond,kurier-light-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Kurier-CondLight] - \definefontsynonym [\s!SansItalic] [Kurier-CondLightItalic] - \definefontsynonym [\s!SansBold] [Kurier-CondMedium] - \definefontsynonym [\s!SansBoldItalic] [Kurier-CondMediumItalic] + \definefontsynonym [\s!Sans] [Kurier-Cond-Light] + \definefontsynonym [\s!SansItalic] [Kurier-Cond-LightItalic] + \definefontsynonym [\s!SansBold] [Kurier-Cond-Medium] + \definefontsynonym [\s!SansBoldItalic] [Kurier-Cond-MediumItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-cond,kurier-cond-nt] + \starttypescript [\s!sans] [kurier-cond,kurier-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Kurier-CondRegular] - \definefontsynonym [\s!SansItalic] [Kurier-CondItalic] - \definefontsynonym [\s!SansBold] [Kurier-CondBold] - \definefontsynonym [\s!SansBoldItalic] [Kurier-CondBoldItalic] + \definefontsynonym [\s!Sans] [Kurier-Cond-Regular] + \definefontsynonym [\s!SansItalic] [Kurier-Cond-Italic] + \definefontsynonym [\s!SansBold] [Kurier-Cond-Bold] + \definefontsynonym [\s!SansBoldItalic] [Kurier-Cond-BoldItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-mediumcond,kurier-mediumcond-nt] + \starttypescript [\s!sans] [kurier-medium-cond,kurier-medium-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] - \definefontsynonym [\s!Sans] [Kurier-CondMedium] - \definefontsynonym [\s!SansItalic] [Kurier-CondMediumItalic] - \definefontsynonym [\s!SansBold] [Kurier-CondHeavy] - \definefontsynonym [\s!SansBoldItalic] [Kurier-CondHeavyItalic] - \stoptypescript - - \starttypescript [kurier-light,kurier,kurier-medium,kurier-heavy,kurier-lightcond,kurier-cond,kurier-mediumcond,kurier-light,kurier-nt,kurier-medium-nt,kurier-heavy-nt,kurier-lightcond-nt,kurier-cond-nt,kurier-mediumcond-nt] - \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] - \definetypeface [\typescriptone] [\s!rm] [\s!serif] [modern] [\s!default] - \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] - \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default][text=ss] + \definefontsynonym [\s!Sans] [Kurier-Cond-Medium] + \definefontsynonym [\s!SansItalic] [Kurier-Cond-MediumItalic] + \definefontsynonym [\s!SansBold] [Kurier-Cond-Heavy] + \definefontsynonym [\s!SansBoldItalic] [Kurier-Cond-HeavyItalic] + \stoptypescript + + \starttypescript [% + kurier,kurier-light,kurier-medium,kurier-heavy,% + kurier-nt,kurier-light-nt,kurier-medium-nt,kurier-heavy-nt,% + kurier-cond,kurier-light-cond,kurier-medium-cond,kurier-heavy-cond,% + kurier-cond-nt,kurier-light-cond-nt,kurier-medium-cond-nt,kurier-heavy-cond-nt% + ] + \definetypeface[\typescriptone][\s!ss][\s!sans] [\typescriptone][\s!default] + \definetypeface[\typescriptone][\s!rm][\s!serif][modern] [\s!default] + \definetypeface[\typescriptone][\s!tt][\s!mono] [modern] [\s!default] + \definetypeface[\typescriptone][\s!mm][\s!math] [\typescriptone][\s!default][text=ss] \quittypescriptscanning \stoptypescript diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv index a995bc42fc2..4aa3861c388 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv @@ -28,6 +28,16 @@ \starttypescriptcollection[latinmodern] + \pushglobalsetups + + \startsetups[\s!math:modern] + \fencemuskip\zeromuskip + \stopsetups + + \startsetups[\s!math:latinmodern]\fastsetup{modern}\stopsetups + + \popglobalsetups + \doifunknownfontfeature {lm-math-bold} {\definefontfeature[lm-math-bold][boldened]} \starttypescript [\s!serif] [simple] [\s!name] diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-plex.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-plex.mkiv index 1e94306bcc3..71f23028347 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-plex.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-plex.mkiv @@ -41,6 +41,8 @@ \definetypescriptprefix [f:narrowplexsans] [\s!default] \definetypescriptprefix [f:narrowplexmono] [\s!none] + \doifunknownfontfeature {plex-math-bold} {\definefontfeature[plex-math-bold][boldened]} + % thin \starttypescript [\s!sans,\s!serif,\s!mono] [plex-thin] [\s!name] @@ -73,7 +75,7 @@ % regular - \starttypescript [\s!sans,\s!serif,\s!mono] [plex] [\s!name] + \starttypescript [\s!sans,\s!serif,\s!mono] [plex,plex-nt] [\s!name] \setups[\s!font:\s!fallback:\typescriptone] \edefinefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}] \edefinefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}] @@ -121,13 +123,40 @@ \edefinefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}] \stoptypescript + % Maybe not since it also scales primes + \starttypescript [\s!math] [plex] [\s!name] + \checkedmapfontsize[plex][\s!script] [.65]% 70 + \checkedmapfontsize[plex][\s!scriptscript][.50]% 55 + \stoptypescript + + \starttypescript [\s!math] [plex] [\s!name] + \definefontsynonym [\s!MathRoman] [\s!file:IBMPlexMath.otf][\s!features={\s!math\mathsizesuffix,plex:mathextra,mathextra},\s!goodies=plex-math] + \definefontsynonym [\s!MathRomanBold][\s!file:IBMPlexMath.otf][\s!features={\s!math\mathsizesuffix,plex-math-bold,plex:mathextra,mathextra},\s!goodies=plex-math] + \stoptypescript + + \starttypescript [\s!math] [plex-nt] [\s!name] + \definefontsynonym [\s!MathRoman] [\s!file:IBMPlexMath.otf][\s!features={\s!math\mathsizesuffix,plex:mathextra,mathextra}] + \definefontsynonym [\s!MathRomanBold][\s!file:IBMPlexMath.otf][\s!features={\s!math\mathsizesuffix,plex-math-bold,plex:mathextra,mathextra}] + \stoptypescript + % done \starttypescript[plex,plex-thin,plex-extralight,plex-light,plex,plex-text,plex-medium,plex-semibold,plex-bold] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] +\doifelsefileexists{IBMPlexMath.otf} { + \definetypeface [\typescriptone] [\s!mm] [\s!math] [plex] [\s!default] +} { \definetypeface [\typescriptone] [\s!mm] [\s!math] [bookman] [\s!default] [\s!rscale=1.03] +} + \stoptypescript + + \starttypescript[plex-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [plex-nt] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [plex-nt] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [plex-nt] [\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [plex-nt] [\s!default] \stoptypescript % Here's Taco's variant as used in the ConTeXt Group Journal. @@ -233,7 +262,6 @@ \edefinefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-regular] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps] \stoptypescript - % For now, as some day plex will have cjk, hebrew, devanagari and arabic. The abstraction is not needed but % this way we can add more id needed without much code. @@ -358,14 +386,22 @@ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] +\doifelsefileexists{IBMPlexMath.otf} { + \definetypeface [\typescriptone] [\s!mm] [\s!math] [plex] [\s!default] +} { \definetypeface [\typescriptone] [\s!mm] [\s!math] [bookman] [\s!default] [\s!rscale=1.03] +} \stoptypescript \starttypescript[ibmplexnarrow,ibmplexnarrow-thin,ibmplexnarrow-extralight,ibmplexnarrow-light] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] +\doifelsefileexists{IBMPlexMath.otf} { + \definetypeface [\typescriptone] [\s!mm] [\s!math] [plex] [\s!default] +} { \definetypeface [\typescriptone] [\s!mm] [\s!math] [bookman] [\s!default] [\s!rscale=1.03] +} \stoptypescript \stoptypescriptcollection diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-source.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-source.mkiv index ab94727e80d..b772e81ac7a 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-source.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-source.mkiv @@ -64,3 +64,67 @@ \stoptypescript \stoptypescriptcollection + + +% \starttext +% +% \definetypescriptprefix [b:as:extralight][regular] +% \definetypescriptprefix [b:as:light] [semibold] +% \definetypescriptprefix [b:as:regular] [bold] +% \definetypescriptprefix [b:as:medium] [bold] +% \definetypescriptprefix [b:as:semibold] [black] +% \definetypescriptprefix [b:as:bold] [black] +% \definetypescriptprefix [b:as:black] [black] +% +% \doloopoverlist {,display,caption,smtext,subhead} { +% \definetypescriptprefix [u:adobesource#1] [#1] +% \definetypescriptprefix [n:adobesource#1] [-regular] +% \definetypescriptprefix [i:adobesource#1] [-it] +% \definetypescriptprefix [b:adobesource#1] [-\typescriptprefix{b:as:regular}] +% \definetypescriptprefix [bi:adobesource#1] [-\typescriptprefix{b:as:regular}it] +% \doloopoverlist {extralight,light,regular,medium,semibold,bold,black} { +% \definetypescriptprefix [b:adobesource#1##1] [-\typescriptprefix{b:as:##1}] +% \definetypescriptprefix [bi:adobesource#1##1] [-\typescriptprefix{b:as:##1}it] +% } +% } +% +% \starttypescript [adobesource,adobesourcedisplay,adobesourcelight,adobesourcedisplaylight] +% % +% \writestatus{Serif} {file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix {n:\typescriptone}} +% \writestatus{SerifBold} {file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix {b:\typescriptone}} +% \writestatus{SerifItalic} {file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix {i:\typescriptone}} +% \writestatus{SerifBoldItalic}{file:sourceserif4 \typescriptprefix{u:\typescriptone} \typescriptprefix{bi:\typescriptone}} +% % +% \definefontsynonym[Serif] [file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{n:\typescriptone}.otf] +% \definefontsynonym[SerifBold] [file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{b:\typescriptone}.otf] +% \definefontsynonym[SerifItalic] [file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{i:\typescriptone}.otf] +% \definefontsynonym[SerifBoldItalic][file:sourceserif4\typescriptprefix{u:\typescriptone}\typescriptprefix{bi:\typescriptone}.otf] +% % +% \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] +% \definetypeface [\typescriptone] [ss] [sans] [dejavu] [default] +% \definetypeface [\typescriptone] [tt] [mono] [dejavu] [default] +% \definetypeface [\typescriptone] [mm] [math] [dejavu] [default] +% \stoptypescript +% +% % \usetypescriptfile[adobesource] +% +% \usebodyfont[adobesource] +% \usebodyfont[adobesourcedisplay] +% +% \setupbodyfont[adobesource] +% +% % \starttext +% +% {\switchtobodyfont[adobesource]normal \it italic \bf bold \bi bolditalic} +% +% \startoverlay +% {\switchtobodyfont[adobesource]this is a test} +% {\red\switchtobodyfont[adobesourcedisplay]this is a test} +% \stopoverlay +% +% \startoverlay +% {\switchtobodyfont[adobesource]\bf this is a test} +% {\red\switchtobodyfont[adobesourcedisplay]\bf this is a test} +% \stopoverlay +% +% \stoptext diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-texgyre.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-texgyre.mkiv index c4f28fcc4a9..15b7f603c47 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-texgyre.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-texgyre.mkiv @@ -39,6 +39,11 @@ \definetypescriptprefix [f:cursor] [cursor] \definetypescriptprefix [f:chorus] [chorus] + \definetypescriptprefix [f:pagella-nt] [pagella] + \definetypescriptprefix [f:termes-nt] [termes] + \definetypescriptprefix [f:bonum-nt] [bonum] + \definetypescriptprefix [f:schola-nt] [schola] + \definetypescriptprefix [f:palatino] [pagella] \definetypescriptprefix [f:times] [termes] \definetypescriptprefix [f:helvetica] [heros] @@ -57,6 +62,11 @@ \definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:chorus] [TeXGyreChorus] + \definetypescriptprefix [n:pagella-nt] [TeXGyrePagella] + \definetypescriptprefix [n:termes-nt] [TeXGyreTermes] + \definetypescriptprefix [n:bonum-nt] [TeXGyreBonum] + \definetypescriptprefix [n:schola-nt] [TeXGyreSchola] + \definetypescriptprefix [n:palatino] [TeXGyrePagella] \definetypescriptprefix [n:times] [TeXGyreTermes] \definetypescriptprefix [n:helvetica] [TeXGyreHeros] @@ -66,7 +76,8 @@ \definetypescriptprefix [n:courier] [TeXGyreCursor] \definetypescriptprefix [n:chancery] [TeXGyreChorus] - \starttypescript [\s!serif,\s!sans] [adventor,bonum,bookman,heros,helvetica,pagella,palatino,schola,schoolbook,termes,times] + \starttypescript [\s!serif,\s!sans] [adventor,bonum,bookman,heros,helvetica,pagella,palatino,schola,schoolbook,termes,times,% + pagella-nt,termes-nt,bonum-nt,schola-nt] \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!default,\s!goodies=texgyre-text] \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!default,\s!goodies=texgyre-text] \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!default,\s!goodies=texgyre-text] @@ -88,7 +99,8 @@ \definefontsynonym [TeXGyreChorus-MediumItalic] [\s!file:texgyrechorus-mediumitalic] [\s!features=\s!default] \stoptypescript - \starttypescript [\s!serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [\s!name] + \starttypescript [\s!serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook,% + pagella-nt,termes-nt,bonum-nt,schola-nt] [\s!name] \definefontsynonym [\s!Serif] [\typescriptprefix{n:\typescripttwo}-Regular] \definefontsynonym [\s!SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic] \definefontsynonym [\s!SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold] diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-xcharter.mkiv b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-xcharter.mkiv index 7d1a88241bd..45070c40dbd 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-xcharter.mkiv +++ b/Master/texmf-dist/tex/context/fonts/mkiv/type-imp-xcharter.mkiv @@ -13,6 +13,12 @@ \starttypescriptcollection[xcharter] + \pushglobalsetups + \startsetups[\s!math:xcharter] + \setupmathradical[\c!leftmargin=.05mq,mindepth=0.1mx]% + \stopsetups + \popglobalsetups + % \definefontfeature[default-slanted-xcharter][default][slant=.2] % \definefontfeature[none-slanted-xcharter] [none] [slant=.2] diff --git a/Master/texmf-dist/tex/context/fonts/mkiv/xcharter-math.lfg b/Master/texmf-dist/tex/context/fonts/mkiv/xcharter-math.lfg index cc4e992d465..7614a311350 100644 --- a/Master/texmf-dist/tex/context/fonts/mkiv/xcharter-math.lfg +++ b/Master/texmf-dist/tex/context/fonts/mkiv/xcharter-math.lfg @@ -12,11 +12,16 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { + DelimiterPercent = 85, + DelimiterShortfall = 400, + DelimiterDisplayPercent = 90, + DelimiterDisplayShortfall = 400, SubscriptShiftDown = 200, -- 300 in font SubscriptShiftDownWithSuperscript = "1.3*SubscriptShiftDown", -- 1.5* in math-act PrimeShiftUp = "1.2*SuperscriptShiftUp", PrimeShiftUpCramped = "1.2*SuperscriptShiftUp", PrimeBaselineDropMax = "0.5*SuperscriptBaselineDropMax", + RadicalDisplayStyleVerticalGap = "RadicalVerticalGap", --178, 73 }, tweaks = { aftercopying = { diff --git a/Master/texmf-dist/tex/context/fonts/mkxl/type-imp-euler.mkxl b/Master/texmf-dist/tex/context/fonts/mkxl/type-imp-euler.mkxl index a2e066f6b36..a4d91a9958a 100644 --- a/Master/texmf-dist/tex/context/fonts/mkxl/type-imp-euler.mkxl +++ b/Master/texmf-dist/tex/context/fonts/mkxl/type-imp-euler.mkxl @@ -21,11 +21,24 @@ \definefontfeature[pagellaovereuler][pagellaovereuler=yes] \definefontfeature[euleroverpagella][euleroverpagella=yes] +\definefontfeature[eulerregular] [default][compose=yes] +\definefontfeature[eulerbold] [default][compose=yes,weight=.3] +\definefontfeature[euleritalic] [default][compose=yes,slant=.2] +\definefontfeature[eulerbolditalic][default][compose=yes,slant=.2,weight=.3] + \starttypescriptcollection[pagella-eulernova] + % \starttypescript [\s!serif] [eulernova] [\s!name] + % \setups[\s!font:\s!fallback:\s!serif] + % \definefontsynonym [\s!Serif] [\s!file:euler-math.otf] [\s!features=\s!default] + % \stoptypescript + \starttypescript [\s!serif] [eulernova] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym [\s!Serif] [\s!file:euler-math.otf] [\s!features=\s!default] + \definefontsynonym [\s!Serif] [file:euler-math.otf] [features=eulerregular] + \definefontsynonym [\s!SerifBold] [file:euler-math.otf] [features=eulerbold] + \definefontsynonym [\s!SerifItalic] [file:euler-math.otf] [features=euleritalic] + \definefontsynonym [\s!SerifBoldItalic] [file:euler-math.otf] [features=eulerbolditalic] \stoptypescript \starttypescript [\s!math] [eulernova] [\s!name] @@ -56,14 +69,16 @@ \starttypescript [pagella-with-euler,euleroverpagella] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [pagella] [\s!default] - \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.9] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default] [\s!rscale=0.85] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.85] \definetypeface [\typescriptone] [\s!mm] [\s!math] [euleroverpagella] [\s!default] \quittypescriptscanning \stoptypescript - \starttypescript [euler-with-pagella,pagellaovereuler] + \starttypescript [euler-with-pagella,pagellaovereuler,euler] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [eulernova] [\s!default] - \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.9] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default] [\s!rscale=0.85] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.85] \definetypeface [\typescriptone] [\s!mm] [\s!math] [pagellaovereuler] [\s!default] \quittypescriptscanning \stoptypescript diff --git a/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml b/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml index 996ca4f058c..ee5101ef4c5 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml @@ -257,6 +257,8 @@ + + @@ -14461,24 +14463,28 @@ + + + + @@ -14495,6 +14501,7 @@ + @@ -14641,6 +14648,9 @@ + + + @@ -15344,6 +15354,17 @@ + + + + + + + + + + + @@ -45625,6 +45646,12 @@ + + + + + + @@ -46528,6 +46555,12 @@ + + + + + + @@ -48179,6 +48212,10 @@ + + + + diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-align.xml b/Master/texmf-dist/tex/context/interface/mkiv/i-align.xml index 46afca89732..67b7082816f 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-align.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-align.xml @@ -61,6 +61,8 @@ + + diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf b/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf index ee5d4853c99..989f3e3b8b9 100644 Binary files a/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf and b/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf differ diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-framed.xml b/Master/texmf-dist/tex/context/interface/mkiv/i-framed.xml index ad8080a9d47..84a69053e83 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-framed.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-framed.xml @@ -57,24 +57,28 @@ + + + + @@ -91,6 +95,7 @@ + @@ -241,6 +246,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-graphics.xml b/Master/texmf-dist/tex/context/interface/mkiv/i-graphics.xml index 518706f35cb..bb93cd5bda4 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-graphics.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-graphics.xml @@ -251,6 +251,17 @@ + + + + + + + + + + + diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf b/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf index 1160ae482c2..6dd10d1ae72 100644 Binary files a/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf and b/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-textrule.xml b/Master/texmf-dist/tex/context/interface/mkiv/i-textrule.xml index addbc13162d..69bb13a12c8 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-textrule.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-textrule.xml @@ -48,6 +48,12 @@ + + + + + + diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-thinrule.xml b/Master/texmf-dist/tex/context/interface/mkiv/i-thinrule.xml index bc150083a5f..16dac7cf49d 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-thinrule.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-thinrule.xml @@ -55,6 +55,12 @@ + + + + + + diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-verbatim.xml b/Master/texmf-dist/tex/context/interface/mkiv/i-verbatim.xml index 20f1bb8730a..6ac7d1a579b 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-verbatim.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-verbatim.xml @@ -201,6 +201,10 @@ + + + + diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-asymptote.lua b/Master/texmf-dist/tex/context/modules/mkiv/m-asymptote.lua index 9a93e166d14..6a38b50f658 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/m-asymptote.lua +++ b/Master/texmf-dist/tex/context/modules/mkiv/m-asymptote.lua @@ -11,6 +11,7 @@ if not modules then modules = { } end modules ['m-asymptote'] = { local context = context local replacesuffix = file.replacesuffix +moduledata = moduledata or { } moduledata.asymptote = { } sandbox.registerrunner { diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-circuitikz.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-circuitikz.mkiv index 27ef72642c3..47d152746d6 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/m-circuitikz.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/m-circuitikz.mkiv @@ -130,8 +130,11 @@ \aliased\let\stopcircuitikz\relax -\permanent\protected\def\startcircuitikz#1\stopcircuitikz - {\starttikzpicture#1\stoptikzpicture} +% \permanent\protected\def\startcircuitikz#1\stopcircuitikz +% {\starttikzpicture#1\stoptikzpicture} + +\permanent\protected\def\startcircuitikz{\starttikzpicture} +\permanent\protected\def\stopcircuitikz {\stoptikzpicture} \stopmodule diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-escrito.lua b/Master/texmf-dist/tex/context/modules/mkiv/m-escrito.lua index b284aece47e..918393e2429 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/m-escrito.lua +++ b/Master/texmf-dist/tex/context/modules/mkiv/m-escrito.lua @@ -3451,7 +3451,6 @@ do end end end - i = i - 1 end return true end diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-graph.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-graph.mkiv index 8946732d063..db431af7094 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/m-graph.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/m-graph.mkiv @@ -66,10 +66,9 @@ label.rt(format("@j","1e-102"),(0, -2.5cm)) ; label.rt(format("@j","1e+102"),(2cm,-2.5cm)) ; label.rt(formatted("(@f,@f)",(1.23,4.56)),(0cm,-3.0cm)) ; - label.rt(formatted("(@i,@i)",(1.23,4.56)),(0cm,-3.5cm)) ; + label.rt(formatted("(@r,@r)",(1.23,4.56)),(0cm,-3.5cm)) ; label.rt(formatted("(@g,@g)",(1.23,4.56)),(0cm,-4.0cm)) ; label.rt(formatted("(@e,@e)",(1.23,4.56)),(0cm,-4.5cm)) ; - label.rt(formatted("(@j,@j)",(1.23,4.56)),(0cm,-5.0cm)) ; \stopMPpage % \startMPpage[instance=graph] diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv index 7686b0ec1d8..d81162a3cc0 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv @@ -58,8 +58,8 @@ buffers.scite = scite local f_def_color = formatters["\\definecolor[slxc%s][h=%02X%02X%02X]%%"] local f_fore_none = formatters["\\unexpanded\\def\\slx%s#1{{\\slxc%s#1}\\slxbreak}%%"] -local f_fore_bold = formatters["\\unexpanded\\def\\slx%s#1{{\\slxc%s\\bf#1}\\slxbreak}%%"] -local f_none_bold = formatters["\\unexpanded\\def\\slx%s#1{{\\bf#1}\\slxbreak}%%"] +local f_fore_bold = formatters["\\unexpanded\\def\\slx%s#1{{\\slxc%s\\slxbold#1}\\slxbreak}%%"] +local f_none_bold = formatters["\\unexpanded\\def\\slx%s#1{{\\slxbold#1}\\slxbreak}%%"] local f_none_none = formatters["\\unexpanded\\def\\slx%s#1{{#1}\\slxbreak}%%"] local f_texstyled = formatters["\\slx%s{%s}\\slxbreak"] local f_hanging = formatters["\\slxb{%r}%s\\slxe"] -- we need to round: lua 5.3 @@ -148,7 +148,7 @@ local function exportstyled(lexer,text) local result = lexers.lex(lexer,text,0) local start = 1 local whites = exportwhites() - local buffer = { } + local buffer, b = { }, 0 for i=1,#result,2 do local style = result[i] local position = result[i+1] @@ -157,9 +157,9 @@ local function exportstyled(lexer,text) if txt == "" then -- skip elseif whites[style] then - buffer[#buffer+1] = txt + b = b + 1 ; buffer[b] = txt else - buffer[#buffer+1] = f_texstyled(style,txt) + b = b + 1 ; buffer[b] = f_texstyled(style,txt) end start = position end @@ -369,6 +369,8 @@ moduledata.scite = scite \let\slxe \space \let\slxbreak\relax +\def\slxbold {\bf} % maybe contraststyle in verbatim + \let\slxL \letterleftbrace \let\slxR \letterrightbrace \let\slxM \letterdollar diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv index 61df89cfd0a..210d1f13da4 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv @@ -29,6 +29,11 @@ \startmodule[tikz] +\ifdefined\hoffset \else + \newdimen\hoffset + \newdimen\voffset +\fi + \ifdefined\pdflastxpos \else \unprotect \unexpanded\def\pdflastxpos{\numexpr\clf_lastxpos\relax} @@ -36,6 +41,21 @@ \protect \fi +\ifdefined\pdfstrcmp\else + + \startluacode + interfaces.implement { + name = "pdfstrcmp", + arguments = "2 strings", + public = true, + actions = function(a,b) + context((a < b and -1) or (a > b and 1) or 0) + end + } + \stopluacode + +\fi + \permanent\protected\def\starttikzinput {\pushcatcodetable \setcatcodetable\texcatcodes diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-abbreviations-logos.tex b/Master/texmf-dist/tex/context/modules/mkiv/s-abbreviations-logos.tex index d04706ca635..90b583d7541 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-abbreviations-logos.tex +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-abbreviations-logos.tex @@ -34,7 +34,7 @@ \logo [ACROBAT] {Acro\-bat} \logo [AFM] {afm} \logo [AI] {ai} -\logo [ALEPH] {Aleph} % {\mathematics{\aleph}} +\logo [ALEPH] {Aleph} \logo [ALGOL] {ALGOL} \logo [AMS] {ams} \logo [AMSLATEX] {\AmSLaTeX} @@ -46,7 +46,7 @@ \logo [ARABTEX] {Arab\TeXsuffix} \logo [ARM] {arm} \logo [ASCII] {ascii} -\logo [ASCIIMATH] {AsciiMath} +\logo [ASCIIMATH] {Ascii\-Math} \logo [ASCIITEX] {ascii\TeXsuffix} \logo [BACHOTEX] {Bacho\TeXsuffix} \logo [BASIC] {Basic} @@ -54,10 +54,11 @@ \logo [BLUESKY] {BlueSky} \logo [BMP] {bmp} \logo [BSD] {bsd} -\logo [CALCMATH] {CalcMath} +\logo [CALCMATH] {Calc\-Math} \logo [CCODE] {C} \logo [CD] {cd} \logo [CDROM] {cdrom} +\logo [CFF] {cff} \logo [CID] {cid} \logo [CJK] {cjk} \logo [CLANG] {clang} @@ -75,7 +76,7 @@ \logo [CSS] {css} \logo [CSV] {csv} \logo [CTAN] {ctan} -\logo [CTXTOOLS] {ctxtools} +\logo [CTXTOOLS] {ctx\-tools} \logo [CURL] {Curl} \logo [CWEB] {cweb} \logo [DAC] {dac} @@ -169,27 +170,19 @@ \logo [KVM] {kvm} \logo [LAMSTEX] {\LamSTeX} \logo [LATEX] {\LaTeX} -%logo [LATEXTE] {\LaTeX2e} -%logo [LATEXTN] {\LaTeX2.09} \logo [LCD] {lcd} \logo [LINUX] {linux} \logo [LISP] {Lisp} \logo [LMX] {lmx} \logo [LPEG] {lpeg} \logo [LUA] {Lua} -% \logo [LUAJIT] {Lua\wordboundary JIT} -% \logo [LUAJITTEX] {Lua\wordboundary jit\TeXsuffix} -% \logo [LUAMETATEX] {\Lua\wordboundary Meta\wordboundary\TeXsuffix} -% \logo [LUATEX] {Lua\wordboundary\TeXsuffix} -% \logo [LUAMETAFUN] {\Lua\wordboundary\MetaFun} \logo [LUAJIT] {Lua\-JIT} \logo [LUAJITTEX] {Lua\-jit\-\TeXsuffix} \logo [LUAMETATEX] {\Lua\-Meta\-\TeXsuffix} \logo [LUATEX] {Lua\-\TeXsuffix} \logo [LUAMETAFUN] {\Lua\-\MetaFun} -\logo [LUATOOLS] {luatools} +\logo [LUATOOLS] {lua\-tools} \logo [MACOSX] {MacOSX} -%logo [MACROTEX] {Macro\TeXsuffix} \logo [MAKEMPY] {MakeMPY} \logo [MAPPING] {map} \logo [MAPS] {Maps} @@ -210,14 +203,14 @@ \logo [MPEG] {mpeg} \logo [MPLIB] {mplib} \logo [MPS] {mps} -\logo [MPTOPDF] {mptopdf} +\logo [MPTOPDF] {mp\-to\-pdf} \logo [MSDOS] {msdos} \logo [MSEXCEL] {MS~Excel} \logo [MSVC] {MSVC} \logo [MSWINDOWS] {MS~Windows} \logo [MSWORD] {MS~Word} \logo [MTXRUN] {mtxrun} -\logo [MTXTOOLS] {mtxtools} +\logo [MTXTOOLS] {mtx\-tools} \logo [MYSQL] {MySQL} \logo [NETPBM] {NetPBM} \logo [NGINX] {nginx} @@ -241,7 +234,7 @@ \logo [PDF] {pdf} \logo [PDFETEX] {pdfe\TeXsuffix} \logo [PDFTEX] {pdf\TeXsuffix} -\logo [PDFTOOLS] {pdftools} +\logo [PDFTOOLS] {pdf\-tools} \logo [PDFTOPS] {pdftops} \logo [PERL] {Perl} \logo [PERLTK] {Perl/Tk} @@ -254,6 +247,7 @@ \logo [POSIX] {posix} \logo [POSTGRESS] {Post\-gress} \logo [POSTSCRIPT] {Post\-Script} +\logo [POTRACE] {Potrace} \logo [PPCHTEX] {\PPCHTeX} \logo [PRAGMA] {Pragma ADE} \logo [PRESS] {press} @@ -271,7 +265,7 @@ \logo [READER] {Acro\-bat Reader} \logo [RELAXNG] {Relax\kern.125emNG} \logo [RGB] {rgb} -\logo [RLXTOOLS] {rlxtools} +\logo [RLXTOOLS] {rlx\-tools} \logo [RSYNC] {Rsync} \logo [RUBY] {Ruby} \logo [SCITE] {SciTE} @@ -309,10 +303,10 @@ \logo [TEXSPELL] {\TeXprefix spell} \logo [TEXSYNC] {texsync} \logo [TEXTMATE] {TextMate} -\logo [TEXTOOLS] {\TeXprefix tools} -\logo [TEXUTIL] {\TeXprefix util} -\logo [TEXWORK] {\TeXprefix work} -\logo [TEXWORKS] {\TeXprefix works} +\logo [TEXTOOLS] {\TeXprefix\-tools} +\logo [TEXUTIL] {\TeXprefix\-util} +\logo [TEXWORK] {\TeXprefix\-work} +\logo [TEXWORKS] {\TeXprefix\-works} \logo [TEXXET] {\TeX\XeT} \def\XeT{XeT} \logo [TFM] {tfm} \logo [THREED] {3D} @@ -320,7 +314,7 @@ \logo [TIFF] {tiff} \logo [TIFFINFO] {tiffinfo} \logo [TIFFTAGS] {tifftags} -\logo [TMFTOOLS] {tmftools} +\logo [TMFTOOLS] {tmf\-tools} \logo [TPIC] {tpic} \logo [TPM] {tpm} \logo [TRUETYPE] {TrueType} @@ -329,6 +323,7 @@ \logo [TUG] {tug} \logo [TUGBOAT] {Tug\-Boat} \logo [TUGNEWS] {Tug\-News} +\logo [TYPEZERO] {Type0} \logo [TYPEONE] {Type1} \logo [TYPETHREE] {Type3} \logo [UCS] {ucs} @@ -341,6 +336,7 @@ \logo [USENET] {usenet} \logo [UTF] {utf} \logo [VAX] {vax} +\logo [VERAPDF] {VeraPDF} \logo [VF] {vf} \logo [VMWARE] {VMWare} \logo [WDT] {wdt} @@ -348,8 +344,6 @@ \logo [WEBC] {web2c} \logo [WIKI] {Wiki} \logo [WINDOWS] {Windows} -%logo [WINNT] {WinNT} -%logo [WINNX] {Win9x} \logo [WTHREEC] {W3C} \logo [WWW] {www} \logo [WIKIPEDIA] {Wikipedia} % WikipediA (looks too weird) @@ -361,9 +355,8 @@ \logo [XINDY] {Xindy} \logo [XITS] {Xits} \logo [XML] {xml} -\logo [XMLTOOLS] {xmltools} +\logo [XMLTOOLS] {xml\-tools} \logo [XPATH] {xpath} -%logo [XPDFETEX] {xpdfe\TeXsuffix} \logo [XSL] {xsl} \logo [XSLFO] {xsl-fo} \logo [XSLT] {xslt} @@ -377,6 +370,6 @@ \logo [KB] {KB} \logo [MB] {MB} \logo [GB] {GB} -% \logo [TB] {TB} +%logo [TB] {TB} \stopmodule diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-evohome.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-evohome.mkiv index 06fd6fb76cb..b60ab91f144 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-evohome.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-evohome.mkiv @@ -133,123 +133,127 @@ function moduledata.evohome.history(specification) local year = years[y] - for m=minmonth,maxmonth do + if year then - local month = year.months[m] + for m=minmonth,maxmonth do - if month then + local month = year.months[m] - context.starttitle { title = "\\month{" .. m .. "}\\enspace" .. y } -- todo: function context.Month(m) end + if month then - for i=1,#zones do + context.starttitle { title = "\\month{" .. m .. "}\\enspace" .. y } -- todo: function context.Month(m) end - local zone = zones[i] - local where = zone.name - local mintemp = zone.min - local maxtemp = zone.max + for i=1,#zones do - -- context.startMPpage { offset = "10pt" } - context.startlinecorrection() - context.startMPcode() - context("linecap := butt; pickup pencircle scaled .5") + local zone = zones[i] + local where = zone.name + local mintemp = zone.min + local maxtemp = zone.max - context("fill (%s,%s) -- (%s,%s) -- (%s,%s) -- (%s,%s) -- cycle withcolor .8white ;", - 0, mintemp/scale, - 31 * 24, mintemp/scale, - 31 * 24, maxtemp/scale, - 0, maxtemp/scale - ) + -- context.startMPpage { offset = "10pt" } + context.startlinecorrection() + context.startMPcode() + context("linecap := butt; pickup pencircle scaled .5") - for i=0,abstemp do - context("draw (%s,%s) -- (%s,%s) withcolor .6white ;", - 0, i/scale, - 31 * 24, i/scale + context("fill (%s,%s) -- (%s,%s) -- (%s,%s) -- (%s,%s) -- cycle withcolor .8white ;", + 0, mintemp/scale, + 31 * 24, mintemp/scale, + 31 * 24, maxtemp/scale, + 0, maxtemp/scale ) - end - local days = month.days - if days then - local nd = os.nofdays(y,m) - for d=1,nd do - local day = days[d] - local xoffset = (d-1) * 24 - local wd = os.weekday(d,m,y) - local weekend = wd == 1 or wd == 7 - if not weekend then - -- okay - elseif mark == 1 then - context("draw (%s,%s) -- (%s,%s) ; ",xoffset, -17.5,xoffset, -32.5) - context("draw (%s,%s) -- (%s,%s) ; ",xoffset+24,-17.5,xoffset+24,-32.5) - elseif mark == 2 then - context("draw (%s,%s) -- (%s,%s) ; ",xoffset, -17.5,xoffset+24,-17.5) - context("draw (%s,%s) -- (%s,%s) ; ",xoffset, -32.5,xoffset+24,-32.5) - elseif mark == 3 then - context("draw unitsquare xysized (%s,%s) shifted (%s,%s) ; ",24,15,xoffset,-32.5) - end - context([[draw textext("%s") shifted (%s,%s) ; ]],d,xoffset + 12,-25) - if day then - for h=0,23 do - local hours = day.hours - if hours then - local hour = hours[h] - if hour then - local a = 0 - local n = 0 - local m = 0 - for minute, d in next, hour do - local v = d[where] - if v then - a = a + v - n = n + 1 - if v > m then - m = v + for i=0,abstemp do + context("draw (%s,%s) -- (%s,%s) withcolor .6white ;", + 0, i/scale, + 31 * 24, i/scale + ) + end + + local days = month.days + if days then + local nd = os.nofdays(y,m) + for d=1,nd do + local day = days[d] + local xoffset = (d-1) * 24 + local wd = os.weekday(d,m,y) + local weekend = wd == 1 or wd == 7 + if not weekend then + -- okay + elseif mark == 1 then + context("draw (%s,%s) -- (%s,%s) ; ",xoffset, -17.5,xoffset, -32.5) + context("draw (%s,%s) -- (%s,%s) ; ",xoffset+24,-17.5,xoffset+24,-32.5) + elseif mark == 2 then + context("draw (%s,%s) -- (%s,%s) ; ",xoffset, -17.5,xoffset+24,-17.5) + context("draw (%s,%s) -- (%s,%s) ; ",xoffset, -32.5,xoffset+24,-32.5) + elseif mark == 3 then + context("draw unitsquare xysized (%s,%s) shifted (%s,%s) ; ",24,15,xoffset,-32.5) + end + context([[draw textext("%s") shifted (%s,%s) ; ]],d,xoffset + 12,-25) + if day then + for h=0,23 do + local hours = day.hours + if hours then + local hour = hours[h] + if hour then + local a = 0 + local n = 0 + local m = 0 + for minute, d in next, hour do + local v = d[where] + if v then + a = a + v + n = n + 1 + if v > m then + m = v + end end end + if n > 0 then + a = a / n + else + a = 0 + end + local dx = xoffset + h + local dy = a/scale + local dm = m/scale + context("draw (%s,%s) -- (%s,%s) withcolor %s ; ", + dx, 0,dx,dy,weekend and "darkmagenta" or "darkblue") + context("draw (%s,%s) -- (%s,%s) withcolor %s ; ", + dx,dy,dx,dm,"darkred") end - if n > 0 then - a = a / n - else - a = 0 - end - local dx = xoffset + h - local dy = a/scale - local dm = m/scale - context("draw (%s,%s) -- (%s,%s) withcolor %s ; ", - dx, 0,dx,dy,weekend and "darkmagenta" or "darkblue") - context("draw (%s,%s) -- (%s,%s) withcolor %s ; ", - dx,dy,dx,dm,"darkred") end end end end + for d=0,30 do + local xoffset = d * 24 + context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+ 0,0,xoffset+ 0,-10) + context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+ 6,0,xoffset+ 6,-2.5) + context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+12,0,xoffset+12,-5) + context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+18,0,xoffset+18,-2.5) + end + local xoffset = 31 * 24 + context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset,0,xoffset,-10) end - for d=0,30 do - local xoffset = d * 24 - context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+ 0,0,xoffset+ 0,-10) - context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+ 6,0,xoffset+ 6,-2.5) - context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+12,0,xoffset+12,-5) - context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset+18,0,xoffset+18,-2.5) + + for i=0,abstemp,5 do + context([[draw textext.lft("%s") shifted (%s,%s) ; ]],i,-10,i/scale) + context("draw (%s,%s) -- (%s,%s) withcolor .2white ;",0,i/scale,31 * 24,i/scale) end - local xoffset = 31 * 24 - context("draw (%s,%s) -- (%s,%s) withcolor darkgray ; ",xoffset,0,xoffset,-10) - end - for i=0,abstemp,5 do - context([[draw textext.lft("%s") shifted (%s,%s) ; ]],i,-10,i/scale) - context("draw (%s,%s) -- (%s,%s) withcolor .2white ;",0,i/scale,31 * 24,i/scale) - end + context([[draw textext("\strut\month{%s}\enspace%s\enspace:\enspace%s") shifted (%s,%s) ; ]], m, y, where, 31 * 24 / 2, -50) + context([[draw textext.lft("\textdegree{}C") shifted (%s,%s) ; ]],-10,-25) - context([[draw textext("\strut\month{%s}\enspace%s\enspace:\enspace%s") shifted (%s,%s) ; ]], m, y, where, 31 * 24 / 2, -50) - context([[draw textext.lft("\textdegree{}C") shifted (%s,%s) ; ]],-10,-25) + context("currentpicture := currentpicture xsized TextWidth") ; - context("currentpicture := currentpicture xsized TextWidth") ; + context.stopMPcode() + context.stoplinecorrection() + -- context.stopMPpage() + end - context.stopMPcode() - context.stoplinecorrection() - -- context.stopMPpage() - end + context.stoptitle() - context.stoptitle() + end end diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-charts.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-charts.mkiv index 0f183e39d73..c1a39c07988 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-charts.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-charts.mkiv @@ -132,7 +132,7 @@ ctx_gap() ctx_setlegend(formatters["%03X"](r*0x10+i)) end - r = r * 0xFF + local r = r * 0xFF ctx_par() for i=0,0xF do ctx_setlegend(formatters["%0X"](i)) diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.lua b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.lua index 2a1d36e140c..1ad182f2a2e 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.lua +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.lua @@ -18,6 +18,7 @@ local v_yes = interfaces.variables.yes local v_no = interfaces.variables.no local c_name = interfaces.constants.name +local context = context local NC, NR, bold = context.NC, context.NR, context.bold function moduledata.fonts.features.showused(specification) @@ -308,12 +309,12 @@ function moduledata.fonts.features.showallfeatures(specification) context.starttabulate { "|T|T|Tc|T|T|Tp|" } - NC() context.bold("\\letterhash") - NC() context.bold("type") - NC() context.bold("\\letterhash steps") - NC() context.bold("feature") - NC() context.bold("script") - NC() context.bold("language") + NC() bold("\\letterhash") + NC() bold("type") + NC() bold("\\letterhash steps") + NC() bold("feature") + NC() bold("script") + NC() bold("language") NC() NR() context.HL() @@ -342,7 +343,7 @@ function moduledata.fonts.features.showallfeatures(specification) end NC() context(script) NC() context("% t",table.sortedkeys(languages)) - NC() context.NR() + NC() NR() end end else @@ -355,3 +356,78 @@ function moduledata.fonts.features.showallfeatures(specification) context.stoptabulate() end + +local function collect(tfmdata,id,specification,feature) + local validlookups, lookuplist = fonts.handlers.otf.collectlookups( + tfmdata.shared.rawdata, + feature, + specification.script or "math", + specification.language or "dflt" + ) + if lookuplist then + local descriptions = tfmdata.descriptions + for i=1,#lookuplist do + local lookup = lookuplist[i] + if lookup.type == "gsub_single" then + local steps = lookup.steps + context.startsubject { title = feature } + context.starttabulate { "|T|||T|" } + for i=1,lookup.nofsteps do + local c = steps[i].coverage + for k, v in table.sortedhash(c) do + NC() context(descriptions[k].name) + NC() context.showfontidchar(id,k) + NC() context.showfontidchar(id,v) + NC() context(descriptions[v].name) + NC() NR() + end + end + context.stoptabulate() + context.stopsubject() + elseif lookup.type == "gsub_alternate" then + local steps = lookup.steps + context.startsubject { title = feature } + context.starttabulate { "|T|||Tp|" } + for i=1,lookup.nofsteps do + local c = steps[i].coverage + for k, v in table.sortedhash(c) do + NC() context(descriptions[k].name) + NC() context.showfontidchar(id,k) + NC() + for i=1,#v do + if i > 1 then context(" ") end + context.showfontidchar(id,v[i]) + end + NC() + for i=1,#v do + if i > 1 then context(" ") end + context(descriptions[v[i]].name) + end + NC() NR() + end + end + context.stoptabulate() + context.stopsubject() + end + end + end +end + +function moduledata.fonts.features.showsubstitutions(specification) + specification = interfaces.checkedspecification(specification) + local id, cs = fonts.definers.internal(specification,"") + local tfmdata = fonts.hashes.identifiers[id] + local feature = specification.feature + if feature == "*" then + local features = tfmdata.shared.rawdata.resources.features + for k in table.sortedhash(features.gsub) do + collect(tfmdata,id,specification,k) + end + else + collect(tfmdata,id,specification,feature) + end +end + +-- moduledata.fonts.features.showsubstitutions { name = "xcharter-math.otf", feature = "cv06", script = "math", language = "dflt" } +-- moduledata.fonts.features.showsubstitutions { name = "xcharter-math.otf", feature = "*", script = "math", language = "dflt" } + diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.mkiv index 81d2b0dcdfc..7bf4c65d2fc 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-features.mkiv @@ -15,12 +15,15 @@ \registerctxluafile{s-fonts-features}{} -\installmodulecommandluasingle \showusedfeatures {moduledata.fonts.features.showused} -\installmodulecommandluasingle \showallkerns {moduledata.fonts.features.showallkerns} -\installmodulecommandluasingle \showbasekerns {moduledata.fonts.features.showbasekerns} -\installmodulecommandluasingle \showallligatures {moduledata.fonts.features.showallligatures} -\installmodulecommandluasingle \showfeatureset {moduledata.fonts.features.showfeatureset} -\installmodulecommandluasingle \showallfeatures {moduledata.fonts.features.showallfeatures} +\installmodulecommandluasingle \showusedfeatures {moduledata.fonts.features.showused} +\installmodulecommandluasingle \showallkerns {moduledata.fonts.features.showallkerns} +\installmodulecommandluasingle \showbasekerns {moduledata.fonts.features.showbasekerns} +\installmodulecommandluasingle \showallligatures {moduledata.fonts.features.showallligatures} +\installmodulecommandluasingle \showfeatureset {moduledata.fonts.features.showfeatureset} +\installmodulecommandluasingle \showallfeatures {moduledata.fonts.features.showallfeatures} +\installmodulecommandluasingle \showsubstitutions {moduledata.fonts.features.showsubstitutions} + +\unexpanded\def\showfontidchar#1#2{\glyph id #1 #2\relax} \def\kernpairheight{.8\strutht} \def\kernpairdepth {.8\strutdp} @@ -66,20 +69,26 @@ \starttext - \showusedfeatures \page +% \showusedfeatures \page + +% \definefontfeature[default-base][default][mode=base] - \definefontfeature[default-base][default][mode=base] +% \start +% \definedfont[Serif*default-base] +% \showbasekerns +% \page +% \stop - \start - \definedfont[Serif*default-base] - \showbasekerns - \page - \stop +% \start +% \bf +% \showallkerns +% \page +% \stop - \start - \bf - \showallkerns - \page - \stop + \showsubstitutions + [name=xcharter-math.otf, + feature=*, + script=math, + language=dflt] \stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv index 16ce91748d4..de5122ae694 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv @@ -112,8 +112,8 @@ % \showfontvariations % [font=file:AmstelvarAlpha-VF.ttf] -% \showfontvariations -% [font=file:bahnschrift.ttf] + \showfontvariations + [font=file:bahnschrift.ttf] % \showfontvariations % [font=file:junicodetwobetavf-roman.ttf] @@ -136,7 +136,7 @@ % [font=file:nupuram-vf.otf,features=malayalam-two,sample=test നൂപുരം] % [font=file:nupuram-vf.ttf,features=malayalam-two,sample=test നൂപുരം] -\showfontvariations - [font=file:robotoflex.ttf] +% \showfontvariations +% [font=file:robotoflex.ttf] \stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-inf-03.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-inf-03.mkiv index 8bd7b36993c..fb26d1ae311 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-inf-03.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-inf-03.mkiv @@ -174,6 +174,7 @@ local skipkeys = table.tohash { "_G", "_M", "_ENV", "", -- "global", "shortcuts", "_VERSION", "_COPYRIGHT", "_DESCRIPTION", "_NAME", "_PACKAGE", "__unload", + "__index", "__newindex", } local sameglobal = { diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-inf-04.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-inf-04.mkiv index 862bed72f29..3186e7f7b12 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-inf-04.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-inf-04.mkiv @@ -8,7 +8,7 @@ context.subject("Configuration files") - local configurations = resolvers.instance.specification + local configurations = resolvers.configurationfiles() context.starttabulate { "|Tl|Tl|" } for i=1,#configurations do diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.lua b/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.lua index a967f7934de..a0fc9c1b249 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.lua +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.lua @@ -34,18 +34,74 @@ local upperlimit = 0xF0000 local f_unicode = string.formatters["%U"] local f_slot = string.formatters["%s/%0X"] +-- do +-- +-- local chardata = characters.data +-- local blocks = characters.blocks +-- +-- local ismath = { } +-- +-- setmetatableindex(ismath,function(t,k) +-- local function add(t,b) +-- local m = blocks[b] +-- for i=m.first,m.last do +-- t[i] = b +-- end +-- end +-- -- add(t,"mathematicaloperators") +-- -- add(t,"miscellaneousmathematicalsymbolsa") +-- -- add(t,"miscellaneousmathematicalsymbolsb") +-- -- add(t,"miscellaneoussymbolsandarrows") +-- -- add(t,"miscellaneoustechnical") +-- -- add(t,"supplementalarrowsa") +-- -- add(t,"supplementalarrowsb") +-- -- add(t,"supplementalarrowsc") +-- -- add(t,"supplementalmathematicaloperators") +-- setmetatableindex(ismath) +-- return ismath[k] +-- end) +-- +-- local s = lpeg.P(" ") +-- -- local p = lpeg.Cs(lpeg.Cc("unim") * (lpeg.P(1) * ((1 - s)^0/"") * (s^0/""))^1) +-- local p = lpeg.Cs((lpeg.P(1) * ((1 - s)^0/"") * (s^0/""))^1) +-- +-- local function fakename(description) +-- return lpeg.match(p,description) +-- end +-- +-- local hash = { } +-- +-- for k,v in next, chardata do +-- if ismath[k] then +-- local description = v.description +-- if description then +-- local description = lower(description) +-- local somename = "unum" .. v.category .. fakename(description) +-- if hash[somename] then +-- print("!!!!!!!!!!!!!!!!!",somename,hash[somename],description) +-- else +-- hash[somename] = description +-- end +-- -- print(description,somename) +-- end +-- end +-- end +-- +-- end + function moduledata.math.characters.showlist(specification) specification = interfaces.checkedspecification(specification) local id = specification.number -- or specification.id local list = specification.list local showvirtual = specification.virtual == "all" - local check = specification.check == "yes" + local method = specification.method if not id then id = font.current() end if list == "" then list = nil end + local blocks = characters.blocks local tfmdata = fontdata[id] local characters = tfmdata.characters local descriptions = tfmdata.descriptions @@ -56,9 +112,17 @@ function moduledata.math.characters.showlist(specification) local gaps = mathematics.gaps local sorted = { } if type(list) == "string" then - sorted = utilities.parsers.settings_to_array(list) - for i=1,#sorted do - sorted[i] = tonumber(sorted[i]) + local b = blocks[list] + if b then + sorted = { } + for i=b.first,b.last do + sorted[#sorted+1] = gaps[i] or i + end + else + sorted = utilities.parsers.settings_to_array(list) + for i=1,#sorted do + sorted[i] = tonumber(sorted[i]) + end end elseif type(list) == "table" then sorted = list @@ -85,7 +149,7 @@ function moduledata.math.characters.showlist(specification) end end if check then - for k, v in table.sortedhash(blocks) do + for k, v in sortedhash(blocks) do if v.math then local first = v.first local last = v.last @@ -146,15 +210,74 @@ function moduledata.math.characters.showlist(specification) local luametatex = LUATEXENGINE == "luametatex" + -- todo: first create sparser table so no test needed + +if method == "manual" then + + context.starttabulate { "|T||||pl|" } + for _, unicode in next, sorted do + if not limited or unicode < upperlimit then + local code = gaps[unicode] or unicode -- move up + local char = characters[code] + local desc = descriptions[code] + local info = chardata[unicode] or chardata[code] + if char then + local mathclass = info.mathclass + local mathspec = info.mathspec + local mathsymbol = info.mathsymbol + local description = lower(info.description or no_description) + local names = { } + if mathclass or mathspec then + if mathclass then + names[info.mathname or ""] = mathclass + end + if mathspec then + for i=1,#mathspec do + local mi = mathspec[i] + names[mi.name or ""] = mi.class + end + end + end +-- print(description,fakename(description)) + if next(names) then + local doit = true + for k, v in sortedhash(names) do + context.NC() if doit then context("%U",unicode) end + context.NC() if doit then context.char(unicode) end + context.NC() if k ~= "" then context.tex(k) end + context.NC() context.ex(v) + context.NC() if doit then context(description) end + context.NC() + context.NR() + doit = false + end + else + local mathname = info.mathname + context.NC() context("%U",unicode) + context.NC() context.char(unicode) + context.NC() if mathname then context.tex(mathname) end + context.NC() context("ordinary") + context.NC() context(lower(description)) + context.NC() + context.NR() + end + end + end + end + context.stoptabulate() + +else + context.showmathcharactersstart() for _, unicode in next, sorted do if not limited or unicode < upperlimit then - local code = gaps[unicode] or unicode + local code = gaps[unicode] or unicode -- move up local char = characters[code] local desc = descriptions[code] local info = chardata[code] if char then - local commands = char.commands +-- context(utf.char(char.smaller)) + local commands = char.commands if commands and not showvirtual then -- skip else @@ -274,13 +397,15 @@ function moduledata.math.characters.showlist(specification) end end end - context.showmathcharactersstartlookupvariants() - local i = 0 - for variant, lookuptype in sortedhash(variants) do - i = i + 1 - context.showmathcharacterslookupvariant(i,f_unicode(variant),variant,lookuptype) + if next(variants) then + context.showmathcharactersstartlookupvariants() + local i = 0 + for variant, lookuptype in sortedhash(variants) do + i = i + 1 + context.showmathcharacterslookupvariant(i,f_unicode(variant),variant,lookuptype) + end + context.showmathcharactersstoplookupvariants() end - context.showmathcharactersstoplookupvariants() end context.showmathcharactersstopentry() end @@ -288,5 +413,8 @@ function moduledata.math.characters.showlist(specification) end end context.showmathcharactersstop() + +end + end end diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.mkiv index c9011fbe19b..236a5848543 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-math-characters.mkiv @@ -27,6 +27,11 @@ \let\showmathcharactersstopentry \relax \let\showmathcharactersentryhexdectit \gobblethreearguments \let\showmathcharactersentrywdhtdpic \gobblefourarguments +\ifcase\contextlmtxmode + \let\showmathcharactersentrywdhtdpicta \gobblefivearguments +\else + \let\showmathcharactersentrywdhtdpicta \gobbleoneargument +\fi \let\showmathcharactersentryresource \gobbleoneargument \let\showmathcharactersstartnext \relax \let\showmathcharactersnextentry \gobblethreearguments @@ -137,6 +142,7 @@ \c!check=, \c!alternative=default, \c!option=\v!all, + \c!method=\v!default, #1]% \directsetup{s-math-characters:\dummyparameter\c!alternative}% \doifelsenothing{\dummyparameter\c!bodyfont} @@ -148,6 +154,7 @@ check = "\dummyparameter\c!check", list = "\dummyparameter\c!list", option = "\dummyparameter\c!option", + method = "\dummyparameter\c!method", }}% \endgroup} @@ -191,7 +198,21 @@ } - \showmathfontcharacters +% \showmathfontcharacters + +% \showmathfontcharacters[list=0x2208] +% \showmathfontcharacters[list=0x2227] +% \showmathfontcharacters[list=0x31] + +\setupbodyfont[stixtwo,12pt] + +% \showmathfontcharacters[list=0x2205,method=manual] +% \showmathfontcharacters[list=lowercaseitalic,method=manual] +% \showmathfontcharacters[list=lowercasebolditalic,method=manual] +\showmathfontcharacters[list=uppercasedoublestruck,method=manual] +% \showmathfontcharacters[list=digitsnormal,method=manual] + +% \showmathfontcharacters[list={0x00303,0x02205,0x02208,0x02227,0x0291F},method=manual] \stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-math-parameters.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-math-parameters.mkiv index f2fde5d8384..58dc3c4047c 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-math-parameters.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-math-parameters.mkiv @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\continuewhenmkivmode + \startmodule[math-parameters] \registerctxluafile{s-math-parameters}{} diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-obsolete-tokens.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-obsolete-tokens.mkiv index 117282a6086..15edfdea312 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-obsolete-tokens.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-obsolete-tokens.mkiv @@ -20,6 +20,8 @@ %D This used to be in \type {toks-tra.lua}: +\continuewhenmkivmode + \startluacode if not modules then modules = { } end modules ['s-obsolete-tokens'] = { diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-banner.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-banner.mkiv index d93c033f28d..c0ed398e8e1 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-banner.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-banner.mkiv @@ -14,6 +14,8 @@ %D This style was made for the Bacho\TeX\ 2016 conference. The banner below %D the text advances through the title. +\pushoverloadmode + \startmodule[present-banner] \definecolor[maincolor] [b=.65] diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv index 900d8edc605..cf4fed5cfa7 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv @@ -14,6 +14,8 @@ %D In this style the table of contents is a bunch of rectangular blobs. The layout %D adapts itself upto 25 pages. This style was made for Bacho\TeX\ 2013. +\pushoverloadmode + \startmodule[present-tiles] \setupbodyfont[pagella,14.4pt] diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-wobbling.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-wobbling.mkiv index b296966e230..e12a2bea92c 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-wobbling.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-wobbling.mkiv @@ -14,6 +14,8 @@ %D This a bit old style and I should adapt it a bit but as it sort of works ok I'll %D not do that now. +\pushoverloadmode + \startmodule[present-wobbling] %setuppapersize[S6][S6] diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-setups-missing.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-setups-missing.mkiv index 53037a78db4..ab18631fa4f 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-setups-missing.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-setups-missing.mkiv @@ -1,6 +1,10 @@ % show missing translations \startluacode +local gsub = string.gsub +local find = string.find +local context = context + function interfaces.show_missing(whatinterfaces) whatinterfaces = whatinterfaces or interfaces.interfaces local list = dofile(resolvers.find_file("mult-def.lua")) @@ -14,7 +18,7 @@ function interfaces.show_missing(whatinterfaces) end NC() NR() HL() for kk, vv in next, v do - if not string.find(kk,"subsub") then + if not find(kk,"subsub") then local okay = true for i=1,#whatinterfaces do local int = whatinterfaces[i] @@ -27,9 +31,9 @@ function interfaces.show_missing(whatinterfaces) if not okay then for i=1,#whatinterfaces do local int = whatinterfaces[i] - local str = vv[int] + local str = context.ctxescape(vv[int] or "") context.NC() - if not str then + if str == "" then -- nothing elseif int == "en" then context.color( { "darkgreen" }, str ) @@ -81,9 +85,9 @@ function interfaces.show_missing_messages(whatinterfaces) context(kk) for i=1,#whatinterfaces do local int = whatinterfaces[i] - local str = vv[int] + local str = context.ctxescape(vv[int] or "") NC() - if not str then + if str == "" then -- nothing elseif int == "en" then context.color( { "darkgreen" }, str ) diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv index 14d751fcd53..772a8b918da 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv @@ -124,7 +124,8 @@ %D We use automatic indentation control, that is: no indentation after titles and %D skips. -\setupindenting[20pt,yes] +\setupindenting + [20pt,yes] %D We do not usually want indentation after lists. @@ -140,8 +141,7 @@ [indentnext=no, align=right] -%D We align them at the paragraph indentation and -%D pack them by default. +%D We align them at the paragraph indentation and pack them by default. \setupitemgroup [itemize] @@ -241,7 +241,7 @@ %D %D Not entirely a la \TUGBOAT: -% rule={\hrule width 5pc height .4pt depth 0pt\relax \kern \strutdepth}, +% rule={\hrule width 5pc height .4pt depth 0pt\relax \kern \strutdepth} \setupfootnotes [bodyfont=9pt] @@ -481,6 +481,18 @@ \endgroup \fi + \doif {\getvariable{tugboat}{columns}} {yes} { + \doifmodeelse {columnset} { + \stopcolumnset + } { + \doifmodeelse {pagecolumns} { + \stoppagecolumns + } { + \stopcolumns + } + } + } + \stoptext \stopsetups diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-xml-analyzers.lua b/Master/texmf-dist/tex/context/modules/mkiv/s-xml-analyzers.lua index 93c6c37b661..4f1e73a7c88 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-xml-analyzers.lua +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-xml-analyzers.lua @@ -14,6 +14,7 @@ local utfvalues = string.utfvalues local formatters = string.formatters local setmetatableindex = table.setmetatableindex local context = context +local ctxescaped = context.ctxescaped local NC, NR, HL, FL, LL, SL, TB = context.NC, context.NR, context.HL, context.TB, context.FL, context.LL, context.SL local sortedhash, sortedkeys, concat, sequenced = table.sortedhash, table.sortedkeys, table.concat, table.sequenced @@ -158,8 +159,12 @@ function moduledata.xml.analyzers.structure(filename) end local children = data.children local attributes = data.attributes - NC() context.bold("element") NC() context.darkred(name) NC() NR() - NC() context.bold("frequency") NC() context(data.n) NC() NR() + NC() context.bold("element") + NC() context.darkred(name) + NC() NR() + NC() context.bold("frequency") + NC() context(data.n) + NC() NR() if next(children) then local t = { } for k, v in next, children do @@ -186,8 +191,8 @@ function moduledata.xml.analyzers.characters(filename) analyze(filename) context.starttabulate { "|r|r|l|c|l|" } for c, n in table.sortedhash(char) do - NC() context.darkred("%s",n) - NC() context.darkgreen("%s",attr[c]) + NC() context.color({ "darkred" }, n) + NC() context.color({ "darkgreen" }, attr[c] or "") NC() context("%U",c) NC() context.char(c) NC() context("%s",chardata[c].description) diff --git a/Master/texmf-dist/tex/context/modules/mkiv/x-asciimath.lua b/Master/texmf-dist/tex/context/modules/mkiv/x-asciimath.lua index f158065aaa8..f263c2eb59d 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/x-asciimath.lua +++ b/Master/texmf-dist/tex/context/modules/mkiv/x-asciimath.lua @@ -24,7 +24,7 @@ local trace_digits = false if trackers then trackers.register("modules.asci local report_asciimath = logs.reporter("mathematics","asciimath") -local asciimath = { } +local asciimath = asciimath or { } local moduledata = moduledata or { } moduledata.asciimath = asciimath @@ -731,6 +731,32 @@ local reserved = { } +-- This is an undocumented option for Ton (math4all): + +-- \startluacode +-- if not asciimath then +-- asciimath = { +-- extras = { +-- ["GTK"] = { false, "\\text{\\it GTK}" }, -- proper kerning/spacing +-- } +-- } +-- end +-- \stopluacode +-- +-- \usemodule[asciimath] +-- \starttext +-- \asciimath{GTK} +-- stoptext + +local extras = asciimath.extras +if extras then + for k, v in next, extras do + if not reserved[k] then + reserved[k] = v + end + end +end + -- a..z A..Z : allemaal op italic alphabet -- en dan default naar upright "upr a" diff --git a/Master/texmf-dist/tex/context/modules/mkxl/m-circuitikz.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/m-circuitikz.mkxl index 27ef72642c3..0f98072edba 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/m-circuitikz.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/m-circuitikz.mkxl @@ -130,8 +130,11 @@ \aliased\let\stopcircuitikz\relax -\permanent\protected\def\startcircuitikz#1\stopcircuitikz - {\starttikzpicture#1\stoptikzpicture} +% \permanent\protected\def\startcircuitikz#1\stopcircuitikz +% {\starttikzpicture#1\stoptikzpicture} + +\protected\def\startcircuitikz{\starttikzpicture} +\protected\def\stopcircuitikz {\stoptikzpicture} \stopmodule diff --git a/Master/texmf-dist/tex/context/modules/mkxl/m-gimmicks.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/m-gimmicks.mkxl index bdf044488ac..a84f6b3006d 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/m-gimmicks.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/m-gimmicks.mkxl @@ -19,9 +19,9 @@ \protected\def\Mac {\dontleavehmode \begingroup - \scratchwidth \fontcharwd\font`M\relax - \scratchdistance\MacScale\fontcharwd\font`c\relax - \scratchoffset \dimexpr\fontcharht\font`M -\MacScale\fontcharht\font`c\relax + \scratchwidth \scaledfontcharwd\font`M\relax + \scratchdistance\MacScale\scaledfontcharwd\font`c\relax + \scratchoffset \dimexpr\scaledfontcharht\font`M -\MacScale\scaledfontcharht\font`c\relax \scratchdepth \MacRule\exheight \kern\scratchwidth \vrule diff --git a/Master/texmf-dist/tex/context/modules/mkxl/m-json.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/m-json.mkxl index 893abbe753a..27b63bf359a 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/m-json.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/m-json.mkxl @@ -13,7 +13,7 @@ \startmodule [json] -\registerctxluafile{util-jsn}{} +\registerctxluafile{util-jsn}{autosuffix} \registerctxluafile{util-tbs}{} % \def\u#1#2#3#4{\cldcontext{utf.char(0x#1#2#3#4)}} diff --git a/Master/texmf-dist/tex/context/modules/mkxl/m-mathfun.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/m-mathfun.mkxl deleted file mode 100644 index 8c956274c0b..00000000000 --- a/Master/texmf-dist/tex/context/modules/mkxl/m-mathfun.mkxl +++ /dev/null @@ -1,233 +0,0 @@ -%D \module -%D [ file=m-mathfun, -%D version=2021.02.20, -%D title=\CONTEXT\ Extra Modules, -%D subtitle=Wried Math Stuff, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Occasionaly some experiment results in some weird feature. It doesn't make sense -%D to make this core functionality but if also makes no sense to throw it away. By -%D making it a module the user can decide. It's actually an example of abusing a -%D \LUA\ interfacing mechanism that is meant for something else. - -\ifdefined\compute \else - \permanent\protected\def\compute{\thewithproperty\plusone} -\fi - -%D At some point this will move to \type {m-mathfun.lmt}: - -\startluacode - local type, load = type, load - local gmatch = string.gmatch - - local xmath = xmath - local xcomplex = xcomplex - local xdecimal = xdecimal - - local context = context - local ctx_mfunction = context.mfunctionlabeltext - - local scanoptional = tokens.scanners.optional - local scanargument = tokens.scanners.argument - - local createtoken = tokens.create - local defined = tokens.defined - - local implement = interfaces.implement - - local compute_code = 1 - - local function smart(what,name,kind) - if what == "value" or what == compute_code then - local temp = scanoptional() - if temp and temp ~= "" then - temp = "%" .. temp - else - temp = "%.6N" - end - if kind == "constant" then - context(temp,math[name]) - else - local code = scanargument() - local func = load("return "..name.."("..code..")","mathfunction","t",math) - if type(func) == "function" then - context(temp,func()) - else - context(code) - end - end - elseif kind == "constant" then - -- context[name]() -- recursion - name = "normal"..name - if defined(name) then - context(createtoken(name)) - else - context(name) - end - else - ctx_mfunction(name) - end - end - - local template = { name = false, usage = "value", public = true, protected = true, actions = false, overload = true } - - local function install(str,kind) - for name in gmatch(str,"[^ ,]+") do - template.name = name - template.actions = function(what) smart(what,name,kind) end - implement(template) - end - end - - local function mathexpr() - local temp = scanoptional() - local code = scanargument() - local func = load("return " .. code,"mathexpr","t",xmath) - if type(func) == "function" then - if temp and temp ~= "" then - temp = "%" .. temp - else - temp = "%.6N" - end - context(temp,func()) - else - context(code) - end - end - - local tostring = xdecimal.tostring - local toengstring = xdecimal.toengstring -- todo - - local function decimalexpr() - local temp = scanoptional() - local code = scanargument() - local func = load("return " .. code,"decimalexpr","t",xdecimal) - if type(func) == "function" then - local result = tostring(func()) - if temp and temp ~= "" then - context("%"..temp,result) - else - context(result) - end - else - context(code) - end - end - - local topair = xcomplex.topair - - local function complexexpr() - local temp = scanoptional() - local code = scanargument() - local func = load("return " .. code,"complexexpr","t",xcomplex) - if type(func) == "function" then - -- local result = tostring(func()) - -- if temp and temp ~= "" then - -- context("%"..temp,result) - -- else - -- context(result) - -- end - if temp and temp ~= "" then - temp = "%" .. temp - else - temp = "%.6N + %.6Ni" - end - local result = func() - context(temp,topair(result)) - else - context(code) - end - end - - implement { - name = "registermathfunction", - public = true, - protected = true, - actions = install, - arguments = { "optional", "optional" }, - } - - implement { - name = "mathexpr", - public = true, - actions = mathexpr, - } - - implement { - name = "decimalexpr", - public = true, - actions = decimalexpr, - } - - implement { - name = "complexexpr", - public = true, - actions = complexexpr, - } - - -- install("sind cosd tand sin cos tan") - -- install("sqrt") -\stopluacode - -\pushoverloadmode - - \ifdefined\normalpi \else\let\normalpi\pi \fi - - \registermathfunction[sind,cosd,tand,sin,cos,tan] - \registermathfunction[sqrt] - \registermathfunction[pi][constant] - -\popoverloadmode - -\continueifinputfile{m-mathfun.mkxl} - -% \pushoverloadmode -% \let\normalpi\pi -% \registermathfunction[sind,cosd,tand,sin,cos,tan] -% \registermathfunction[sqrt] -% \registermathfunction[pi][constant] -% \popoverloadmode - -\usemodule[scite] \setupbodyfont[dejavu] \setuplayout[tight] \setuppapersize[A5] - -% \mainlanguage[es] - -\starttext - -\startbuffer -$ \sin (x) = \luaexpr {math.sin(math.pi/2)} $ -$ \sin (x) = \luaexpr [.4N] {math.sin(math.pi/2)} $ -$ \sin (x) = \the\sin {pi/2} $ -$ \sind(x) = \luaexpr [.4N] {math.sind(120)} $ -$ \sind(x) = \the\sind[.4N] {120} $ -$ \sqrt(x) = \luaexpr {math.sqrt(2)} $ -$ \sqrt(x) = \luaexpr [.6N] {math.sqrt(2)} $ -$ \sqrt(x) = \the\sqrt {2} $ -$ \sqrt(x) = \the\sqrt[.3N] {2} $ -$ \sqrt(x) = \compute\sqrt[.3N] {2} $ -$ \sind(x) = \luaexpr [.4N] {math.pi} $ -$ \pi = \compute\pi[.4N] $ -$ \pi = \mathexpr[.40N]{pi} $ -$ \pi = \mathexpr[.80N]{sqrt(11)} $ -$ \pi = \decimalexpr[.80N]{sqrt(11)} $ -$ \pi = \decimalexpr{sqrt(11)} $ -$ c = \complexexpr{123 + new(456,789)} $ -\stopbuffer - -Take your choice: - -\typebuffer[option=TEX] - -And get: - -\startlines - \getbuffer -\stoplines - -\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/m-oldmath.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/m-oldmath.mkxl index db223b2d337..836fcb4a62a 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/m-oldmath.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/m-oldmath.mkxl @@ -17,25 +17,29 @@ \mathgroupingmode \zerocount -\permanent\protected\def\eqalign#1% rather plain, is this used at all ... - {\dontleavehmode - \mskip\thinmuskip\vcenter\bgroup % \vcenter \s!class \mathwrappercode \bgroup - \mathsurround\zeropoint % \math_eqalign_set_defaults - \ialign - {\strut - \hfil - \mathbeginclass\mathordcode - \mathendclass \mathordcode - \startforceddisplaymath\aligncontent\stopforceddisplaymath - \aligntab - \mathbeginclass\mathordcode - \mathendclass \mathordcode - \startforceddisplaymath\aligncontent\stopforceddisplaymath - \hfil - \crcr - #1% - \crcr}% - \egroup\mskip\thinmuskip} % \egroup +\ifdefined\eqalign \else + + \permanent\protected\def\eqalign#1% rather plain, is this used at all ... + {\dontleavehmode + \mskip\thinmuskip\vcenter\bgroup % \vcenter \s!class \mathwrappercode \bgroup + \mathsurround\zeropoint % \math_eqalign_set_defaults + \ialign + {\strut + \hfil + \mathbeginclass\mathordcode + \mathendclass \mathordcode + \startforceddisplaymath\aligncontent\stopforceddisplaymath + \aligntab + \mathbeginclass\mathordcode + \mathendclass \mathordcode + \startforceddisplaymath\aligncontent\stopforceddisplaymath + \hfil + \crcr + #1% + \crcr}% + \egroup\mskip\thinmuskip} % \egroup + +\fi %D Obsolete: diff --git a/Master/texmf-dist/tex/context/modules/mkxl/m-polynomial.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/m-polynomial.mkxl new file mode 100644 index 00000000000..a62196ac837 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/m-polynomial.mkxl @@ -0,0 +1,900 @@ +%D \module +%D [ file=m-polynomial, +%D version=2023.8.18, +%D title=\CONTEXT\ Math Module, +%D subtitle=Polynomials, +%D author={Mikael Sundqvist & Hans Hagen}, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% maybe just m-polynomial like m-matrix + +% built-in +% +% alternative=align:normal % uses align mechanism (carry over spacing) +% alternative=align:split % uses align mechanism +% alternative=text:normal % not aligned +% alternative=text:align % uses alignhere etc +% alternative=default % same as text:align (can be normal instead) +% alternative=none % only processing +% +% user: +% +% alternative=somename % \startsetups[math:polynomial:somename] + +\startluacode +if not tex.issetup then -- will become a faster helper + + function tex.issetup(n) -- will become a faster helper + return tex.isdefined(tokens.getters.macro("??setup") .. ":" .. n) + end + +end + +local tonumber = tonumber + +local context = context +local copytable = table.copy +local round = math.round + +local shows = { } +local helpers = { } + +local implement = interfaces.implement + +local v_none = interfaces.variables.none + +local ctx_NC = context.NC +local ctx_NR = context.NR +local ctx_startcolor = context.startcolor +local ctx_stopcolor = context.stopcolor + +local result = { + n = 0, + numerator = { }, + denominator = { }, + steps = { }, +} + +do + + local function show(t,split,symbol,mark) + local n = #t + local done = false + for i=n,1,-1 do + local tn = t[i] + ctx_NC() + if not tn or tn == 0 then + if split then + ctx_NC() + end + else + if mark then ctx_startcolor { mark } end + if done and tn > 0 then + context("+") + end + if tn < 0 then + context("-") + tn = - tn + end + if split then + if mark then ctx_stopcolor() end + ctx_NC() + if mark then ctx_startcolor { mark } end + end + if i > 1 then + if tn ~= 1 then + context("%.3N",tn) + end + context(symbol) + else + context("%.3N",tn) + end + if i > 2 then + context("^{%s}",i-1) + end + if mark then ctx_stopcolor() end + done = true + end + end + ctx_NR() + end + + local function default(settings) + local split = settings.split + local symbol = settings.symbol or "x" + context.startalign { + n = (split and 2 or 1) * result.n, + align = "all:right", + } + local steps = result.steps + local previous = result.numerator + show(result.denominator,split,symbol,"blue") + show(result.numerator,split,symbol) + for i=1,#steps do + local current = steps[i].numerator + if previous then + show(helpers.subtract(previous,current),split,symbol,"red") + end + show(current,split,symbol) + previous = current + end + show(result.quotient,split,symbol,"green") + -- inspect(result) + context.stopalign() + end + + shows["align:normal"] = function(settings) default(settings,false) end + shows["align:split"] = function(settings) default(settings,true) end + +end + +do + + local function show(t,symbol) + local n = #t + local done = false + for i=n,1,-1 do + local tn = t[i] + if not tn or tn == 0 then + -- ignore + else + if done and tn > 0 then + context("+") + end + if tn < 0 then + context("-") + tn = - tn + end + if i > 1 then + if tn ~= 1 then + context("%.3N",tn) + end + context(symbol) + else + context("%.3N",tn) + end + if i > 2 then + context("^{%s}",i-1) + end + done = true + end + end + end + + helpers.show = show + + local function show_n_over_d(n,d,index,symbol) + local colors = result.colors + local c = colors and colors[index] + local cn = c and (c.ns or c.n) + local cd = c and (c.ds or c.d) + context.frac( + function() + if cn then + ctx_startcolor { cn } + show(n,symbol) + ctx_stopcolor() + else + show(n,symbol) + end + end, + function() + if cd then + ctx_startcolor { cd } + show(d,symbol) + ctx_stopcolor() + else + show(d,symbol) + end + end + ) + end + + local function show_what(w,what,index,symbol) + local colors = result.colors + local c = colors and colors[index] + local cw = c and c[what] + if cw then + ctx_startcolor { cw } + show(w,symbol) + ctx_stopcolor() + else + show(w,symbol) + end + end + + local function show_n(n,index,symbol) show_what(n,"n",index,symbol) end + local function show_d(d,index,symbol) show_what(d,"d",index,symbol) end + local function show_q(q,index,symbol) show_what(q,"q",index,symbol) end + + helpers.show_n = show_n + helpers.show_d = show_d + helpers.show_q = show_q + helpers.show_n_over_d = show_n_over_d + + local function lines(settings,align) + local steps = result.steps + local nofsteps = #steps + local colors = result.colors + local symbol = result.symbol or "x" + show_n_over_d(result.numerator,result.denominator,0,symbol) + if nofsteps > 0 then + if align then + context.alignhere() + end + context(steps[1].clipped and "≈" or "=") + for i=1,nofsteps do + local step = steps[i] + show_q(step.quotient,i,symbol) + if not helpers.iszero(step.numerator) then + context("+") + show_n_over_d(step.numerator,result.denominator,i,symbol) + end + if i < nofsteps then + if align then + context.breakhere() + end + context(step.clipped and "≈" or "=",symbol) + end + end + else + -- context.quad() + -- context.mtext("(no quotient)") + end + end + + shows["text:normal"] = function(settings) lines(settings,false) end + shows["text:align"] = function(settings) lines(settings,true) end + +end + +do + + local function subtract(n,d) + local t = { } + for i=1,#d do + t[i] = n[i] - d[i] + end + return t + end + + local function negate(v) + local t = { } + for i=1,#v do + t[i] = -v[i] + end + return t + end + + local function iszero(t) + for i=1,#t do + if t[i] ~= 0 then + return false + end + end + return true + end + + local function last(t) + for i=#t,1,-1 do + local ti = t[i] + if ti ~= 0 then + return i + end + end + return false + end + + local meps = -0.000001 + local peps = 0.000001 + + local function solve(settings) + local numerator = settings.numerator + local denominator = settings.denominator + if type(numerator) == "string" then + numerator = utilities.parsers.settings_to_array(numerator) + settings.numerator = numerator + end + if type(denominator) == "string" then + denominator = utilities.parsers.settings_to_array(denominator) + settings.denominator = denominator + end + local n = #numerator + local d = #denominator + for i=1,n do numerator [i] = tonumber(numerator [i]) or 0 end + for i=1,d do denominator[i] = tonumber(denominator[i]) or 0 end -- proper numbers + for i=1,n do denominator[i] = tonumber(denominator[i]) or 0 end + -- + if d > n then + logs.report("polynomial","denominator has a higher degree") + -- kind of fatal error + end + -- + local nlast = last(numerator) + local dlast = last(denominator) + local steps = { } + local quotient = { } + result = { + n = n, + numerator = numerator, + denominator = denominator, + steps = steps, + colors = settings.colors, + symbol = settings.symbol or "x", + } + for i=1,n do + quotient[i] = 0 + end + while nlast and dlast and nlast >= dlast do + numerator = copytable(numerator) + local shift = nlast - dlast + local nvalue = numerator[nlast] + local dvalue = denominator[dlast] + -- local factor = nvalue // dvalue + local factor = nvalue / dvalue + local clipped = false + for i=1,n do + local ni = numerator[i] + local di = denominator[i-shift] or 0 + local ni = ni - factor * di + if ni ~= 0 and ni > meps and ni < peps then + ni = 0 + clipped = true + end + numerator[i] = ni + end + quotient[shift+1] = factor + steps[#steps+1] = { + numerator = numerator, + factor = factor, + nvalue = nvalue, + dvalue = dvalue, + shift = shift, + quotient = copytable(quotient), + clipped = clipped + } + local l = last(numerator) + if l == nlast then + break + end + nlast = l + end + return result + end + + helpers.last = last + helpers.subtract = subtract + helpers.negate = negate + helpers.iszero = iszero + helpers.solve = solve + + shows[v_none] = function(settings) + -- + end + + shows.default = shows["text:normal"] + + local function tocolors(colors) + if type(colors) == "string" then + local list = utilities.parsers.settings_to_hash(colors) + local done = { } + for k, v in next, list do + done[tonumber(k) or 0] = utilities.parsers.settings_to_hash(v) + end + return done + end + end + + implement { + name = "polynomial", + arguments = { + { + { "alternative" }, + { "numerator" }, + { "denominator" }, + { "split", "boolean" }, + { "colors" }, + { "symbol" }, + }, + }, + actions = function(settings) + settings.colors = tocolors(settings.colors) + result = solve(settings) + local alternative = settings.alternative or "default" + if shows[alternative] then + shows[alternative](settings) + else + local s = "math:polynomial:" .. alternative + if tex.issetup(s) then + context.formatted.directsetup(s) + else + shows.default(settings) + end + end + end + } + + local show = helpers.show + + local function getcolor(n,what) + local colors = result.colors + local c = colors and colors[n] + return c and c[what] + end + + implement { + name = "polynomialsteps", + usage = "value", + actions = function() + return tokens.values.integer, #result.steps + end + } + + implement { + name = "polynomialfactor", + arguments = "integer", + actions = function(n) + local s = result.steps[n] + if s and s.factor then + context(round(s.factor)) + else + context(0) + end + end, + } + + implement { + name = "polynomialshift", + arguments = "integer", + actions = function(n) + local s = result.steps[n] + if s and s.shift then + context(round(s.shift)) + else + context(0) + end + end, + } + + +-- tokens.converters = { } +-- +-- local getexpansion = token.getexpansion +-- +-- function tokens.converters.tonumber(s) +-- return tonumber(s and getexpansion([[\noexpand\the\numexpr ]] .. s)) or 0 +-- end +-- +-- interfaces.implement { +-- name = "demo", +-- public = true, +-- arguments = "optional", +-- actions = function(s) +-- context(tokens.converters.tonumber(s)) +-- end +-- } + + + local function whatever(kind,s) + if kind == "-" then + s = helpers.negate(s) + end + if kind == "+" or kind == '-' then + for i=#s,1,-1 do + if s[i] < 0 then + break + elseif s[i] > 0 then + context("+") + break + end + end + end + helpers.show(s,result.symbol) + end + + implement { + name = "polynomialnumerator", + arguments = { "string", "integer" }, + actions = function(kind,n) + if n > 0 then + local s = result.steps[n] + if s then + whatever(kind,s.numerator) + end + else + whatever(kind,result.numerator) + end + end + } + + implement { + name = "polynomialdenominator", + arguments = { "string", "integer" }, + actions = function(kind,n) + whatever(kind,result.denominator) + end, + } + + implement { + name = "polynomialquotient", + arguments = { "string", "integer" }, + actions = function(kind,n) + if n > 0 then + local s = result.steps[n] + if s then + whatever(kind,s.quotient) + end + end + end, + } + + implement { + name = "polynomialstep", + arguments = { "string", "integer" }, + actions = function(kind,n) + local s = n > 0 and result.steps[n] or result + if s then + helpers.show_n_over_d(s.numerator,result.denominator,n,result.symbol) + end + end + } + + implement { + name = "polynomialquotientstep", + arguments = { "string", "integer" }, + actions = function(kind,n) + local s = result.steps[n] + if s then + local f = s.factor + if n > 1 then + local p = result.steps[n-1] + s = helpers.subtract(s.quotient,p.quotient) + else + s = s.quotient + end + if kind == "-" then + if f > 0 then + context("-") + else + s = helpers.negate(s) + context("+") + end + elseif kind == "+" then + if f > 0 then + context("+") + end + end + helpers.show_q(s,n,result.symbol) + end + end, + } + + implement { + name = "ifpolynomialclipped", + arguments = "integer", + usage = "condition", + public = true, + actions = function(n) + local s = result.steps[n] + return tokens.values.boolean, s and s.quotient + end, + } + + implement { + name = "ifpolynomialnumerator", + arguments = "integer", + usage = "condition", + public = true, + actions = function(n) + local s + if n > 0 then + s = result.steps[n] + else + s = result + end + return tokens.values.boolean, s and not helpers.iszero(s.numerator) + end + } + + implement { + name = "polynomialsymbol", + public = true, + protected = true, + actions = function() + context(result.symbol) + end, + } + +end + +\stopluacode + +\unprotect + +\installcorenamespace {polynomial} + +\installparameterhandler\??polynomial {polynomial} +\installsetuphandler \??polynomial {polynomial} + +\setuppolynomial + [\c!split=\v!no, + \c!alternative=text:align, + \c!symbol=x] + +\tolerant\protected\def\polynomial[#S#1]#*[#2]#*[#3]% + {\begingroup + \ifhastok={#1}% + \setupcurrentpolynomial[#1]% + \donetrue + \else + \donefalse + \fi + \clf_polynomial { + numerator \ifdone{#2}\else{#1}\fi + denominator \ifdone{#3}\else{#2}\fi + alternative {\polynomialparameter\c!alternative} + colors {\polynomialparameter\c!color} + symbol {\polynomialparameter\c!symbol} + split \ifcstok{\polynomialparameter\c!split}\v!yes true \else false\fi + }% + \endgroup} + +\tolerant\protected\def\polynomialsteps {\the\clf_polynomialsteps} +\tolerant\protected\def\polynomialfactor [#1]{\clf_polynomialfactor \numexpr\ifparameter#1\or#1\else\zerocount\fi\relax} +\tolerant\protected\def\polynomialshift [#1]{\clf_polynomialshift \numexpr\ifparameter#1\or#1\else\zerocount\fi\relax} + +\tolerant\def\module_polynomial_component[#1]#*[#2]#*[#3]% + {\ifarguments + \or + #1{}\zerocount + \or + #1{}\numexpr\ifparameter#2\or#2\else\zerocount\fi\relax + \else + #1{#2}\numexpr\ifparameter#3\or#3\else\zerocount\fi\relax + \fi} + +\protected\def\polynomialnumerator {\module_polynomial_component[\clf_polynomialnumerator ]} +\protected\def\polynomialdenominator {\module_polynomial_component[\clf_polynomialdenominator ]} +\protected\def\polynomialquotient {\module_polynomial_component[\clf_polynomialquotient ]} +\protected\def\polynomialquotientstep{\module_polynomial_component[\clf_polynomialquotientstep]} +\protected\def\polynomialstep {\module_polynomial_component[\clf_polynomialstep ]} + +\startsetups math:polynomial:complete + \frac { + \polynomialnumerator + } { + \polynomialdenominator + } + \alignhere + \localcontrolledrepeat \polynomialsteps { + = + \ifnum\currentloopiterator>\plusone + \polynomialquotient[\currentloopiterator - 1] + + \fi + \frac { + \polynomialquotientstep[\currentloopiterator] + (\polynomialdenominator) + \polynomialnumerator[+][\currentloopiterator - 1] +% \polynomialnumerator[-][\currentloopiterator - 1] + \polynomialquotientstep[-][\currentloopiterator] +% \polynomialquotientstep[+][\currentloopiterator] + (\polynomialdenominator) + } { + \polynomialdenominator + } + \breakhere + = + \polynomialquotient[\currentloopiterator] + \ifpolynomialnumerator\currentloopiterator + + + \frac { + \polynomialnumerator[\currentloopiterator] + } { + \polynomialdenominator + } + \fi + \ifnum\currentloopiterator<\polynomialsteps + \breakhere + \fi + } +\stopsetups + +\protect + +\continueifinputfile{m-polynomial.mkxl} + +\setuplayout[tight] + +\setuppapersize[A4,landscape][A4,landscape] + +\starttext + +\setuppolynomial[symbol=z] + +% \def\TempHack +% {\scratchcounter\setmathoptions\mathbinarycode +% \bitwiseflip\scratchcounter-\lookaheadforendclassoptioncode +% \setmathoptions\mathbinarycode\scratchcounter} +% +% \startformula +% \TempHack +% \polynomial +% [-5, -3, 3, -1, 1, 0, 2, -3, -2, -1, 4] +% [-8, -7, -5, 2, 8, -9, 1] +% \stopformula + +% \startformula +% \TempHack +% \polynomial +% [split=yes] +% [-5, -3, 3, -1, 1, 0, 2, -3, -2, -1, 4] +% [-8, -7, -5, 2, 8, -9, 1] +% \stopformula + +\def\TestPolynomial#1#2#3% + {\startformula + \polynomial + [alternative=#1] + [#2] + [#3] + \stopformula} + +% \page + +% \def\TestPolynomials#1#2% +% {\page +% \TestPolynomial{text:normal} {#1}{#2} +% \TestPolynomial{text:align} {#1}{#2} +% \TestPolynomial{align:normal}{#1}{#2} +% \TestPolynomial{align:split} {#1}{#2} +% \page +% } +% +% \TestPolynomials +% {7, -5, 2, 3} +% {3, 0, 1} +% +% \TestPolynomials +% {7, -5, 2, 3} +% {3, 0, 2.7} +% +% \TestPolynomials +% {7, -5, 2, 3} +% {3, 0, 1} + +\startformula +\polynomial + [color={1={n=red,d=green,q=blue},2={n=cyan,d=magenta,q=orange}}] + [7, -5, 2, 3, 2] + [3, 0, 1] +\stopformula + +\polynomial + [alternative=none, + color={1={n=red,d=green,q=blue},2={n=cyan,d=magenta,q=orange,ds=darkgray}}] + [7, -5, 2, 3, 2] + [3, 0, 1] + +numerator + +\startformula + \polynomialnumerator +\stopformula + +numerator 2 + +\startformula + \polynomialnumerator[2] +\stopformula + +denominator + +\startformula + \polynomialdenominator +\stopformula + +quotient 1/2/3 + +\startformula + \polynomialquotient[1]/ + \polynomialquotient[2]/ + \polynomialquotient[3] +\stopformula + +quotientstep 1/2/3 + +\startformula + \polynomialquotientstep[1]/ + \polynomialquotientstep[2]/ + \polynomialquotientstep[3] +\stopformula + +steps + +\startformula + \polynomialsteps +\stopformula + +factor + +\startformula + \polynomialfactor[2] +\stopformula +a +shift + +\startformula + \polynomialshift[2] +\stopformula + + +\startformula + \frac {\polynomialnumerator}{\polynomialdenominator} + = + \polynomialquotient[1] + + + \frac {\polynomialnumerator[1]}{\polynomialdenominator} +\stopformula + +\startformula +\polynomial + [alternative=complete, + color={1={n=red,d=green,q=blue},2={n=cyan,d=magenta,q=orange,ds=darkgray}}] + [7, -5, 2, 3, 2] + [3, 0, 1] +\stopformula + +% \ifpolynomialclipped1 YES \else NOP \fi + +\dorecurse\polynomialsteps{ + \startformula + \polynomialstep[#1] + \stopformula +} + +% \input tufte + +% \startformula +% \denominator +% \numerator[2] +% \frac{3x^3+2x^2-5x+7}{x^2+3} +% \alignhere +% = 3x + \frac{2x^2 - 14x + 7}{x^2+3} +% \breakhere +% = 3x + 2 + \frac{-14x+1}{x^2+3} +% \stopformula + +% \input tufte + +% \startformula +% \frac{3x^3+2x^2-5x+7}{x^2+3} +% \alignhere +% = 3x + \frac{2x^2 - 14x + 7}{x^2+3} +% \breakhere +% = 3x + 2 + \frac{-14x+1}{x^2+3} +% \stopformula + +% \input tufte + +% \TestPolynomials +% {-5, -3, 3, -1, 1, 0, 2, -3, -2, -1, 4} +% {-8, -7, -5, 2, 8, -9, 1} + +% \TestPolynomials +% {-1, 0, 1} +% {-1, 1} + +% \input tufte + +% \TestPolynomials +% {-1, 1} +% {-1, 0, 1} + +% \input tufte + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/m-tikz.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/m-tikz.mkxl index 29ef764c982..eddd54d7dbc 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/m-tikz.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/m-tikz.mkxl @@ -29,6 +29,11 @@ \startmodule[tikz] +\ifdefined\hoffset \else + \newdimen\hoffset + \newdimen\voffset +\fi + \ifdefined\pdflastxpos \else \unprotect \frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax} @@ -36,6 +41,24 @@ \protect \fi +\ifdefined\pdfstrcmp\else + + \startluacode + interfaces.implement { + name = "pdfstrcmp", + arguments = "2 strings", + usage = "value", + public = true, + actions = function(a,b) + return + tokens.values.integer, + (a < b and -1) or (a > b and 1) or 0 + end + } + \stopluacode + +\fi + \newcatcodetable \tikzcatcodes \startcatcodetable \tikzcatcodes @@ -60,19 +83,27 @@ \catcode\barasciicode \othercatcode \stopcatcodetable +\newinteger\tikzinputlevel + \permanent\protected\def\starttikzinput - {\pushoverloadmode - \pushcatcodetable - \setcatcodetable\tikzcatcodes - \pushmacro\meaning - \let\meaning\meaningless - \autoparagraphmode\zerocount} + {\advance\tikzinputlevel\plusone + \ifcase\tikzinputlevel\or + \pushoverloadmode + \pushcatcodetable + \setcatcodetable\tikzcatcodes + \pushmacro\meaning + \let\meaning\meaningless + \autoparagraphmode\zerocount + \fi} \permanent\protected\def\stoptikzinput {\autoparagraphmode\plusone - \popcatcodetable - \popmacro\meaning - \popoverloadmode} + \ifcase\tikzinputlevel\or + \popcatcodetable + \popmacro\meaning + \popoverloadmode + \fi + \advance\tikzinputlevel\minusone} \permanent\protected\def\tikzinputfile#1% {\starttikzinput @@ -89,6 +120,7 @@ \overloadmode\zerocount \newtoks\everytikzpicture +\newtoks\everyinsidetikzpicture % \appendtoks % \resetcharacterspacing @@ -96,6 +128,8 @@ \permanent\protected\def\starttikzsettings {\pushoverloadmode + \pushcatcodetable + \setcatcodetable\tikzcatcodes \pushmacro\meaning \let\meaning\meaningless \autoparagraphmode\zerocount} @@ -103,9 +137,10 @@ \permanent\protected\def\stoptikzsettings {\autoparagraphmode\plusone \popmacro\meaning + \popcatcodetable \popoverloadmode} -\permanent\protected\def\starttikzpicture +\permanent\tolerant\protected\def\starttikzpicture[#S#1]% {\dontleavehmode \hcontainer\bgroup \setcatcodetable\tikzcatcodes @@ -115,7 +150,8 @@ \let\meaning\meaningless % \pushoverloadmode \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi - \tikzpicture} + \tikzpicture[#1]% + \the\everyinsidetikzpicture} \permanent\protected\def\stoptikzpicture {\endtikzpicture @@ -149,6 +185,10 @@ \let\normalusepgflibrary \usepgflibrary \let\normalusetikzlibrary\usetikzlibrary +\installnamespace{pgfmhack} +\installnamespace{pgflhack} +\installnamespace{tikzhack} + \tolerant\protected\def\usepgfmodule[#1]#;#2% somehow both variants are used {\starttikzinput \normalusepgfmodule[#1#2]% @@ -164,6 +204,34 @@ \normalusetikzlibrary[#1#2]% \stoptikzinput} +\unprotect + +\protected\def\installsomethingtikzindeed#1#2#3#4% + {\defcsname#1:b:#2\endcsname{#3}% + \defcsname#1:a:#2\endcsname{#4}} + +\protected\def\usesomethingtikzindeed#1#2#3% + {\ifcsname#1:l:#3\endcsname\else + \letcsname#1:l:#3\endcsname\relax + \begincsname#1:b:#3\endcsname + \starttikzinput + #2[#3]% + \stoptikzinput + \begincsname#1:a:#3\endcsname + \fi} + +% somehow both variants [#1] and {#1} are used + +\protected\def\installtikzlibraryhacks{\installsomethingtikzindeed\????tikzhack} +\protected\def\installpgfmodulehacks {\installsomethingtikzindeed\????pgfmhack} +\protected\def\installpgflibraryhacks {\installsomethingtikzindeed\????pgflhack} + +\tolerant\protected\def\usepgfmodule [#1]#;#2{\usesomethingtikzindeed\????pgfmhack\normalusepgfmodule {#1#2}} +\tolerant\protected\def\usepgflibrary [#1]#;#2{\usesomethingtikzindeed\????pgflhack\normalusepgflibrary {#1#2}} +\tolerant\protected\def\usetikzlibrary[#1]#;#2{\usesomethingtikzindeed\????tikzhack\normalusetikzlibrary{#1#2}} + +\protect + \usepgfmodule[shapes] \usepgfmodule[plot] \usepgfmodule[matrix] @@ -172,4 +240,8 @@ \definefilesynonym [pgfplots] [tikz-pgfplots] \definefilesynonym [pgfplotstable] [tikz-pgfplotstable] +% Here come the hacks: + +\installtikzlibraryhacks{calendar}{}{\tikzinputfile{pgfcalendar.code.tex}} + \stopmodule diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-colors-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-colors-show.mkxl index 3658e632c4e..8db61dc343d 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/s-colors-show.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-colors-show.mkxl @@ -53,7 +53,7 @@ \hsize\localhsize \offinterlineskip \setuppalet[#1] - \tabskip\zeropoint + \tabskip\zeroskip \def\colo_palets_show_palet##1% {\doifelseinset\v!number{#2}{##1\hskip.5\emwidth}{}% \aligntab @@ -75,7 +75,7 @@ \hsize\localhsize \offinterlineskip \setuppalet[#1] - \tabskip\zeropoint + \tabskip\zeroskip \scratchwidth\zeropoint \doifinset\v!number{#2} {\def\colo_palets_show_palet##1% @@ -163,7 +163,7 @@ \hsize\localhsize \offinterlineskip \setuppalet - \tabskip\zeropoint + \tabskip\zeroskip \def\colorformatseparator{\strut\cr} \def\colo_groups_show_group##1% {\doifcolor{#1:##1}{\vbox @@ -190,7 +190,7 @@ \hsize\localhsize \offinterlineskip \setuppalet - \tabskip\zeropoint + \tabskip\zeroskip \def\colo_groups_show_group##1% {\doifcolor{#1:##1} {\doifinset\v!number{#2} diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-outlines.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-outlines.mkxl new file mode 100644 index 00000000000..3096e328517 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-outlines.mkxl @@ -0,0 +1,240 @@ +%D \module +%D [ file=s-fonts-outlines, +%D version=2024.01.05, +%D title=\CONTEXT\ Style File, +%D subtitle=Showing Outlines, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module is mostly used for debugging a font and might evolve accordingly. The +%D current interface is minimalistic. It was made when debugging some cff issues with +%D old type one fonts that we needed to support. +%D +%D Processing all fonts on my disk results in some 2500 pages and the highest memory +%D usage I ever encountered with \LUAMETATEX: when we start with an empty cache we +%D need some 30 GB and for a final run more than 10; much relates to \LUA\ allocating +%D beforehand (doubling table memory as they grow) and garbage collection. + +\startbuffer[samplefonttext] + a\\b\\c\\d\\e\\f\\g\\h\\i\\j\\k\\l\\m\\n\\o\\p\\q\\r\\s\\t\\u\\v\\w\\x\\y\\z\crlf + A\\B\\C\\D\\E\\F\\G\\H\\I\\J\\K\\L\\M\\N\\O\\P\\Q\\R\\S\\T\\U\\V\\W\\X\\Y\\Z\crlf + @\\1\\2\\3\\4\\5\\6\\7\\8\\9\\0\\(\\)\\[\\]\\\{\\\}\\&\\+\\-\\=\\<\\>\\% + \textslash\\\textbackslash\\\texthash\\\textpercent\\_\\-\\*\\!\\?\\,\\.\\:\\;% +\stopbuffer + +\startbuffer[samplefont] + \framed + [offset=overlay, + frame=off, + align=middle] + {\def\\{\kern.2\emwidth}% + \getbuffer[samplefonttext]}% +\stopbuffer + +\startMPdefinitions + +presetparameters "samplefont" [ + name = "", + labels = false, + buffer = "samplefont" +] ; + +def lmt_samplefont = applyparameters "samplefont" "lmt_do_samplefont" enddef ; + +vardef lmt_do_samplefont = + image ( + pushparameters "samplefont" ; + + save sample ; string sample ; sample := "\getbuffer[" & (getparameter "buffer") & "]" ; + save banner ; string banner ; banner := "\strut\tttf " & (getparameter "name") ; + + save p ; picture p[] ; + + p[1] := lmt_outline [ text = sample ] ; + p[2] := textext(sample) ; + p[3] := textext.ulft(banner) ; + + p[1] := (p[1] shifted - center p[1]) scaled 20 ; + p[2] := (p[2] shifted - center p[2]) scaled 20 ; + p[3] := p[3] scaled 4 ; + + save c ; string c[] ; + + c[1] := "middlered" ; c[4] := "middlemagenta" ; + c[2] := "middlegreen" ; c[5] := "middlecyan" ; + c[3] := "middleblue" ; c[6] := "middleyellow" ; + + save n ; numeric n ; n := 1 ; + + for i within p[1] : + drawpath pathpart i ; + drawpoints pathpart i withcolor c[n] ; + n := if n == 6 : 1 else : n + 1 fi ; + endfor ; + + if (getparameter "labels") : + + save defaultfont ; string defaultfont ; defaultfont := "Mono" ; + save defaultscale ; numeric defaultscale ; defaultscale := .4 ; + + c[1] := "darkred" ; c[4] := "darkmagenta" ; + c[2] := "darkgreen" ; c[5] := "darkcyan" ; + c[3] := "darkblue" ; c[6] := "darkyellow" ; + + n := 1 ; + + for i within p[1] : + drawpointlabels pathpart i withcolor c[n] ; + n := if n == 6 : 1 else : n + 1 fi ; + endfor ; + + fi ; + + draw p[2] + shifted (0,-1.1*bbheight(p2)) ; + + draw p[3] + shifted urcorner currentpicture ; + + popparameters ; + ) +enddef ; + +\stopMPdefinitions + +\starttexdefinition protected samplefont[#1] + \begingroup + \getdummyparameters[name=dejavuserif.otf,buffer=samplefont,labels=no,#1] + \writestatus{fontfile}{\dummyparameter{name}} + \definedfont[\dummyparameter{name}] + \iffontchar\font`a\relax + \startMPpage[offset=2ts] + draw lmt_samplefont [ + buffer = "\dummyparameter{buffer}", + name = "\dummyparameter{name}", + labels = \ifcstok{\dummyparameter{labels}}{yes}true\else false\fi + ] ; + \stopMPpage + \else + \writestatus{fontfile}{\dummyparameter{name} has no 'a'} + \fi + \endgroup +\stoptexdefinition + +\continueifinputfile{s-fonts-outlines.mkxl} + +% \enabledirectives[fonts.cff.flatten] + +\starttext +% \disabledirectives[fonts.streams.pack] +% \enabletrackers[fonts.cff.charstrings] +% \samplefont[name=gentiumbookplusitalic.ttf,labels=yes] % missing contours +% \samplefont[name=lmr10.afm,labels=yes] +% \samplefont[name=ibmplexmath.otf] +\samplefont[name=sab.afm] +\samplefont[name=creditsuissetyperoman.ttf] +\samplefont[name=calibri.ttf] +% \samplefont[name=lmmonoprop10-regular.otf] +% \samplefont[name=texgyrepagella-regular.otf] +% \samplefont[name=lmmonoltcond10-regular.otf] +% \samplefont[name=lmsans10-boldoblique.otf] +% \samplefont[name=sourcecodevariableitalic.otf] +% \samplefont[name=sourcecodevariableroman.otf] +% \samplefont[name=sourcehansansextralight.otf] +% \samplefont[name=notosanscjkkrlight.otf] +% \samplefont[name=notosanscjkscdemilight.otf] +% \samplefont[name=notosanscjktclight.otf] +% \samplefont[name=dfminchopstdw5.otf] +\stoptext + +%D I might look into some of the crashes but some of these fonts are experimental +%D and might be produced manually. Also some are plain ugly due to their state of +%D development, but it's what I had to test at some point, so they stuck around and +%D I have no motivation to sort out the mess. + +\starttext + +\startluacode + local todo = { + + ["adobeblank.otf"] = "useless", + ["adobeblank2.otf"] = "useless", + ["lastresort.ttf"] = "useless", + + ["sourcecodevariableitalic.otf"] = "crash", + ["sourcecodevariableroman.otf"] = "crash", + ["sourcehansansextralight.otf"] = "crash", + ["sourceserif4displaylight.otf"] = "crash", + ["notosanscjkkrlight.otf"] = "crash", + ["notosanscjkscdemilight.otf"] = "crash", + ["notosanscjktclight.otf"] = "crash", + ["junicodetwobetaregularvf.otf"] = "crash", + ["junicodetwobetabold.otf"] = "crash", + ["dfminchopstdw5.otf"] = "crash", + ["alegreyasansthin.otf"] = "crash", + ["alegreyasansthinitalic.otf"] = "crash", + + + ["lte52172.ttf"] = "crash", + ["avkv.ttf"] = "crash", + ["tirekv.ttf"] = "crash", + + ["bhb.afm"] = "crash", + ["bhd.afm"] = "crash", + ["bhh.afm"] = "crash", + ["bhl.afm"] = "crash", + ["bhm.afm"] = "crash", + ["a.afm"] = "crash", + ["myriadmmitweight400width600.afm"] = "crash", + ["myriadmmitweight700width600.afm"] = "crash", + ["myriadmmweight400width600.afm"] = "crash", + ["myriadmmweight700width600.afm"] = "crash", + + } + + local skip = { + ["^arial"] = "bugged", + ["^myriad"] = "bugged", + ["^junicode"] = "bugged", + ["^noto"] = "big", + ["^source"] = "big", + ["^amiri"] = "bugged", + } + + local function isbad(name) + if todo[name] then + return todo[name] + else + for k, v in next, skip do + if string.find(name,k) then + return v + end + end + end + return false + end + + fonts.names.load() + local data = fonts.names.data + for k, v in table.sortedhash(data.files) do + local bad = isbad(k) + if bad then + context.writestatus("fontfile","skipping '" .. k .. "' : " .. bad) + else + local s = string.lower(file.suffix(k)) + if s == "otf" or s == "ttf" or s == "afm" then + -- if s == "otf" then + -- if s == "ttf" then + -- if s == "afm" then + context.showsampleFont { name = k } + end + end + end +\stopluacode + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-show.mkxl index 32f50c48407..f8560d57dde 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-show.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-show.mkxl @@ -21,10 +21,10 @@ \gdef\module_fonts_show_prepare#1% {\iftok{#1}\emptytoks - \edef\m_module_fonts_show_title{\the\bodyfontsize}% + \edef\m_module_fonts_show_title{\the\bodyfontsize}% \else - \switchtobodyfont[#1]% - \edef\m_module_fonts_show_title{#1}% + \switchtobodyfont[#1]% + \edef\m_module_fonts_show_title{#1}% \fi \ifempty\fontclass \edef\m_module_fonts_show_title{[\m_module_fonts_show_title]}% @@ -97,23 +97,25 @@ \fi \fi \integerdef\c_module_fonts_font_id\fontid\font - \doifelsenothing{#2} - {\module_fonts_show_font_indeed{#1}\zerocount} - {\doifelse{#2}\v!all - {\dostepwiserecurse\zerocount{255}\plusone - {\scratchcounterone \recurselevel - \scratchcountertwo \numexpr\scratchcounterone*256\relax - \scratchcounterthree\numexpr\scratchcountertwo+255\relax - \doloop - {\iffontchar\font\scratchcountertwo - \module_fonts_show_font_indeed{#1}\scratchcounterone - \exitloop - \orelse\ifnum\scratchcountertwo=\scratchcounterthree - \exitloop - \else - \advanceby\scratchcountertwo\plusone - \fi}}} - {\processcommalist[#2]{\module_fonts_show_font_indeed{#1}}}}% + \ifempty{#2}% + \module_fonts_show_font_indeed{#1}\zerocount + \orelse\ifcstok{#2}\v!all + \dostepwiserecurse\zerocount{255}\plusone + {\scratchcounterone \recurselevel + \scratchcountertwo \numexpr\scratchcounterone*256\relax + \scratchcounterthree\numexpr\scratchcountertwo+255\relax + \doloop + {\iffontchar\font\scratchcountertwo + \module_fonts_show_font_indeed{#1}\scratchcounterone + \exitloop + \orelse\ifnum\scratchcountertwo=\scratchcounterthree + \exitloop + \else + \advanceby\scratchcountertwo\plusone + \fi}}% + \else + \processcommalist[#2]{\module_fonts_show_font_indeed{#1}}% + \fi \egroup} \gdef\module_fonts_show_font_indeed#1#2% made some 50% faster but still slow @@ -131,7 +133,7 @@ \setstrut \setfontid\c_module_fonts_font_id \offinterlineskip - \unexpanded\def\wrapbox##1% + \protected\def\wrapbox##1% {\vpack to \scratchdimenone {\vss \hpack to \scratchdimenone @@ -147,12 +149,12 @@ \fi \hss\copy##1\hss} \vss}}% - \unexpanded\def\textbox##1% + \protected\def\textbox##1% {\vpack to \scratchdimentwo {\hsize\scratchdimenthree ##1% \par}}% - \unexpanded\def\scratchnum + \protected\def\scratchnum {\blue \tinyfont \hfill @@ -224,11 +226,14 @@ \protected\def\dodocommand##1##2% {\starttextrule{\tttf #1 ##1 ##2} \nobreak\getvalue{##2}% - \doifelsenothing{#4} - {\dododocommand\zerocount} - {\doifelse{#4}\v!all - {\dostepwiserecurse\zerocount{255}\plusone{\normalexpanded{\dododocommand{\recurselevel}}}} - {\processcommalist[#4]{\dododocommand}}}% + \ifempty{#4}% + \dododocommand\zerocount + \orelse\ifcstok{#4}\v!all + \dostepwiserecurse\zerocount{255}\plusone + {\normalexpanded{\dododocommand{\recurselevel}}}% + \else + \processcommalist[#4]{\dododocommand}% + \fi \par \nobreak \stoptextrule} \protected\def\docommand##1% @@ -243,7 +248,9 @@ \permanent\protected\tolerant\gdef\showligatures[#1]% we keep it around for compatibility reasons {\bgroup \def\module_fonts_show_ligature##1{\hbox{\showglyphs##1}}% - \doifsomething{#1}{\definedfont[#1*default]}% + \ifempty{#1}\else + \definedfont[#1*default]% + \fi \starttabulate[|*{7}{c|}] \NC\type{ff} \NC\type{fi} @@ -292,7 +299,7 @@ \NC \type {\extraspace} \NC \the\fontextraspace \font \NC\NR \stoptabulate} -\unexpanded\gdef\module_fonts_show_minimal_baseline#1% to be used in a 10 column tabulate +\protected\gdef\module_fonts_show_minimal_baseline#1% to be used in a 10 column tabulate {\setbox\scratchbox\ruledhbox{#1}% \normalexpanded { \NC \ruledhbox{#1}% @@ -366,7 +373,7 @@ \permanent\protected\gdef\otfstepcharcommand#1#2#3% font char class {\otfstepspace - \doif{#3}{mark}{\underbar}{U+\hexnumber{#2}}:% + \iftok{#3}{mark}\expandafter\underbar\fi{U+\hexnumber{#2}}:% \setbox\scratchbox\hbox{\ctxlua{nodes.tracers.fontchar(#1,#2)}}% \ifzeropt\wd\scratchbox \scratchwidth.125\onepoint @@ -394,7 +401,7 @@ \hangindent\emwidth \hangafter\plusone \dontleavehmode\detokenize{#1}\removeunwantedspaces - \doifsomething{#2}{,\space\detokenize{#2}}\endgraf + \ifempty{#2}\else,\space\detokenize{#2}\fi\endgraf \endgroup \blank} diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-games-2023.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-games-2023.mkxl new file mode 100644 index 00000000000..d513916c927 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-games-2023.mkxl @@ -0,0 +1,224 @@ +%D \module +%D [ file=s-games-2023, +%D version=2023.12.20, +%D title=\CONTEXT\ Style File, +%D subtitle=A Simple Card Game, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This style is a side track of the 2023 X-mas card which is similar +%D but on a 100 by 100 grid. Because the shapes are rather nice and +%D intriguing we decided to see if we could make it into a match them +%D game. So here it is. Maybe at the 2023 \CONTEXT\ meeting we will +%D play a bit with different formulas. + +\startluacode + local sin, cos, tan, log = math.sin, math.cos, math.tan, math.log + + local N = 20 + local M = 0 + + M = math.random(100)/100 + + local mybitmaps = { + [1] = function(x,y) + x = x + M + y = y + M + local z = sin(x*x) - cos(y*y) + if z > 0 then + return '1' + else + return '0' + end + end, + [2] = function(x,y) + x = x + M + y = y + M + local z = sin(x*x) + cos(y*y) + tan(x*y) + if z > 0 then + return '1' + else + return '0' + end + end, + [3] = function(x,y) + x = x + M + y = y + M + local z = tan(x*x) + tan(y*y) + tan(y*x) + if z > 0 then + return '1' + else + return '0' + end + end, + [4] = function(x,y) + x = x + M + y = y + M + local z = sin(sin(x*x)) - sin(sin(y*y)) + if z > 0 then + return '1' + else + return '0' + end + end, + [5] = function(x,y) + x = x + M + y = y + M + local z = (100*(log(x*x) - log(y*y))) // 2 + if (z % 2) == 1 then + return '1' + else + return '0' + end + end + } + + local mybitmap = mybitmaps[1] + -- local mybitmap = mybitmaps[4] + + -- generate a N * N bitmap of "1" and "0" and store it + + function MP.setmybitmap(n) + N = n + potrace.setbitmap("MyBitMap",potrace.contourplot(N,N,mybitmap)) + M = M + math.pi/24 + end +\stopluacode + +\definecolor[colortwo][h=0057b7] % the ukraine flag colors +\definecolor[colorone][h=ffd700] % yellowish and blueish + +\setMPvariables[whatever][n=100,a=1] + +\startuseMPgraphic{whatever}{n,a} + MP.setmybitmap(\MPvar{n}); + % let potrace generate outlines from the stored bitmap + picture r ; r := image ( + draw lmt_potraced [ + stringname = "MyBitMap", + value = "1", + size = 0, + ] ; + ) xysized (10cm,10cm) ; + setbounds r to + boundingbox r + enlarged 5mm + ; + % actually it's one path as we used &&& + if \MPvar{a} = 2 : + draw boundingbox r + withcolor .5white + withpen pencircle scaled 5 ; + draw r + withcolor .3white ; + else : + fill boundingbox r + withcolor "colorone" ; + draw r + withcolor "colortwo" ; + fi ; +\stopuseMPgraphic + +\protected\def\MakeSet#1#2#3#4#5{ + \dorecurse{#1} { + \startTEXpage[offset=1cm] + \vbox \bgroup + \offinterlineskip + \dorecurse{#2} {% + \hbox \bgroup + \dorecurse{#3} {% + \useMPgraphic{whatever}{n=#4,a=#5}% + \hskip5mm + }% + \unskip + \egroup + \vskip5mm + }% + \removelastskip + \egroup + \stopTEXpage + } +} + +\setuplayout[tight] + +\startbuffer[game-2023] + +\page \setupwhitespace[big] + +\subject{The addendum to the 2023 X-mas card} + +This is a \quote {find matching shapes} game for all ages, inspired by the +\PRAGMA\ 2023 X-mas card. You can invent the rules yourself but this is how we +played it during the holidays: + +\startitemize + \startitem + We took the (3 by 5, 12 page, complexity 20) version and printed two + copies on 160-200 gram paper. Any decent printer will scale to fit and it + looks quite okay on a proper inkjet printer. + \stopitem + \startitem + The print is cut into rectangles. You don't need to be too precise but try + to get through the middle of the white lines. Shuffle the cards and make a + stack. + \stopitem + \startitem + Best let one person lay out the cards slowly till there are some six by + four on the table and at some point matching pairs will show up. + \stopitem + \startitem + Add more card if needed. After a while players will start calling the + cards names, because human pattern recognition kicks in. + \stopitem + \startitem + When a player extracts a match the emptyt spaces will be filled with new + samples. + \stopitem + \startitem + Of course once you run out of new cards to lay out, the collection of + pairs speeds up. Some players can catch up at the end. + \stopitem +\stopitemize + +Nothing prohibits to play with three copies and we can make it as complex as +needed. Afterwards you can try to figure out the logic behind the shapes. If +there is demand more variants can be provided and we can introduce more +randomness. Just ask for it on the mailing list. + +\blank + +\startlines +Hans Hagen & Ton Otten +PRAGMA ADE, Hasselt NL +December 2023 +\stoplines + +\page + +\stopbuffer + +\continueifinputfile{s-games-2023.mkxl} + +\setupbodyfont[dejavu] \setupwhitespace[big] + +\starttext + +\MakeSet {100}{1}{1} {10} {1} % 8 * 24 +\MakeSet {100}{1}{1} {15} {1} % 8 * 24 +\MakeSet {100}{1}{1} {20} {1} % 8 * 24 +% \MakeSet {8}{6}{4} {10} {1} % 8 * 24 +% \MakeSet{10}{5}{3} {15} {1} % 10 * 15 +% \MakeSet{10}{5}{3} {15} {1} % 10 * 15 +% \MakeSet{1}{40}{30} {20} {1} % 10 * 12 +% \MakeSet{1}{40}{30} {15} {1} % 10 * 12 +% \MakeSet{1}{40}{30} {20} {1} % 10 * 12 + +% \getbuffer[game-2023] + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-math-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-math-show.mkxl new file mode 100644 index 00000000000..6eb5e0d51a1 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-math-show.mkxl @@ -0,0 +1,140 @@ +%D \module +%D [ file=math-run, +%D version=2023.05.18, +%D title=\CONTEXT\ Math Macros, +%D subtitle=Runtime loaded commands, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\permanent\tolerant\protected\gdef\showmathmargins[#1]% + {\bgroup + \par + \c_attr_visual\attributeunsetvalue + \ruledhbox to \hsize \bgroup + \setbox\scratchbox\hbox to \hsize\bgroup + \scratchheight2\lineheight + \scratchwidth \onepoint + \infofont + \ifcstok{#1}\v!all + \llap\bgroup + \setupinterlinespace + \vbox yoffset -\lineheight\bgroup + \forgetall + \setstrut + % \llap{\the \c_strc_math_n_of_lines \enspace \#l}\par + \llap{\withoutpt\d_strc_math_first_left \enspace fl}\par + \llap{\withoutpt\d_strc_math_last_left \enspace ll}\par + \llap{\withoutpt\d_strc_math_max_left \enspace ml}\par + \llap{\withoutpt\d_strc_formulas_number \enspace wd}\par + \egroup + \quad + \egroup + \fi + \ifzeropt\s_strc_formulas_margin_left\else + \bgroup\darkred + \srule \s!width \scratchwidth \s!height \scratchheight + \kern-\scratchwidth + \vrule \s!width \s_strc_formulas_margin_left + \kern-\scratchwidth + \srule \s!width \scratchwidth \s!height \scratchheight + \egroup + \fi + \ifdim\d_math_strc_hangindent>\zeropoint + \bgroup\darkred + \vrule \s!width \d_math_strc_hangindent \s!depth 2\exheight \s!height-\exheight + \kern-\d_math_strc_hangindent + \egroup + \fi + \bgroup\darkgray + \leaders\vrule\hfill + \egroup + \bgroup\darkgreen + \srule \s!width \scratchwidth \s!height \scratchheight + \egroup + \bgroup\darkgray + \leaders\vrule\hfill + \egroup + \ifdim\d_math_strc_hangindent<\zeropoint + \bgroup\darkblue + \kern\d_math_strc_hangindent + \vrule \s!width -\d_math_strc_hangindent \s!depth 2\exheight \s!height-\exheight + \egroup + \fi + \ifzeropt\s_strc_formulas_margin_right\else + \bgroup\darkblue + \srule \s!width \scratchwidth \s!height \scratchheight + \kern-\scratchwidth + \vrule \s!width \s_strc_formulas_margin_right + \kern-\scratchwidth + \srule \s!width \scratchwidth \s!height \scratchheight + \egroup + \fi + \ifcstok{#1}\v!all + \rlap\bgroup + \setupinterlinespace + \quad + \vbox yoffset -\lineheight\bgroup + \forgetall + \setstrut + \rlap{fr\enspace\withoutpt\d_strc_math_first_right}\par + \rlap{lr\enspace\withoutpt\d_strc_math_last_right }\par + \rlap{mr\enspace\withoutpt\d_strc_math_max_right }\par + \rlap + {\formulaparameter\c!location:\enspace + p=\the\c_strc_math_positioning\enspace + a=\the\c_strc_math_ragged_status\enspace + l=\the\c_strc_math_number_location\enspace + v=\the\c_strc_math_number_variant}\par + \egroup + \egroup + \fi + \global\c_strc_math_positioning\zerocount + \egroup + \ht\scratchbox1.2\exheight + \dp\scratchbox0.4\exheight + \strut + \box\scratchbox + \kern-\hsize + \hbox to \hsize \bgroup + \white + \infofont + \kern\s_strc_formulas_margin_left + \quad + [\the\s_strc_formulas_margin_left]% + \hss + [\c!split=\iftok{\formulaparameter\c!split}\emptytoks\v!yes \else\formulaparameter\c!split\fi]% + \quad + [\c!align=\iftok{\formulaparameter\c!align}\emptytoks\v!middle\else\formulaparameter\c!align\fi]% + \ifcstok{#1}\v!all\else + \quad + [\c!location=\formulaparameter\c!location]% + \fi + \hss + [\the\s_strc_formulas_margin_right]% + \quad + \kern\s_strc_formulas_margin_right + \egroup + \egroup + \par + \egroup} + +\protect + +\continueifinputfile{s-math-show.mkxl} + +\showmathmargins[all] + +\starttext + +\startformula + a + b = c +\stopformula + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-math-tweaks.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-math-tweaks.mkxl index 8a70d431fcc..bf21b9609d8 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/s-math-tweaks.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-math-tweaks.mkxl @@ -174,7 +174,7 @@ \setbox\scratchbox\ruledhbox { \im { \resetmathattributes - \widehat{\Uchar#1} + \widehat{\tocharacter#1} \showmathalphabettweaks_check_scripts } } @@ -186,7 +186,7 @@ \im { \resetmathattributes \left( - \Uchar#1 + \tocharacter#1\relax \showmathalphabettweaks_check_scripts \right) } @@ -292,6 +292,18 @@ \removeunwantedspaces \stoptexdefinition +\starttexdefinition protected showmathvarianttweaks +\dm { + \dorecurse {\nofmathvariants "28} { + \char \getmathvariant ##1 "28 + \char \getmathvariant ##1 "7B + \char \getmathvariant ##1 "7C + \char \getmathvariant ##1 "7D + \char \getmathvariant ##1 "29 + } +} +\stoptexdefinition + \protect \stopmodule @@ -349,7 +361,54 @@ \showmathaccenttweaks \showmathfencetweaks \showmathmiddletweaks + \showmathvarianttweaks } \stoptext +% \setupbodyfont[10pt] % we need to use LatinModern! +% +% \starttext +% +% \setupmathematics[integral=limits] +% +% \mathlimitsmode 1 +% +% \startTEXpage[offset=1ts] \showboxes \showglyphs +% \dontleavehmode +% \ruledhbox{\dm{\left|\integral^{!!!!!!!!!!!}\right|}} +% \ruledhbox{\dm{\left|\integral^{!!!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!!} \right|}} +% \ruledhbox{\dm{\left|\integral^{!} \right|}} +% \blank +% \dontleavehmode +% \ruledhbox{\dm{\left|\integral_{!!!!!!!!!!!}\right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!} \right|}} +% \blank +% \dontleavehmode +% \ruledhbox{\dm{\left|\integral_{!} ^{!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!!}^{!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!} ^{!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!} ^{!!!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!!}^{!!!!!!!!!} \right|}} +% \ruledhbox{\dm{\left|\integral_{!!!!!!!}^{!!!!!!!!!!!!!!!}\right|}} +% \ruledhbox{\dm{\left|\integral^{\mtext{for demanding}}_{\mtext{integral freaks}}\right|}} +% \stopTEXpage +% +% \stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-system-macros.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-system-macros.mkxl index 597af1a7b20..3b1f6ae61fd 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/s-system-macros.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-system-macros.mkxl @@ -131,6 +131,7 @@ local s = file.suffix(filename) local b = file.basename(filename) if s ~= "lua" and s ~= "lmt" then +-- todo: newfloat etc local d = io.loaddata(filename) -- we could make a nice lpeg for m in gmatch(d,"\n[\\a-z]*[exg]*def\\([a-zA-Z_]+)") do diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.lmt b/Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.lmt new file mode 100644 index 00000000000..fb73ee74742 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.lmt @@ -0,0 +1,2176 @@ +local setmetatableindex, sortedhash, concat = table.setmetatableindex, table.sortedhash, table.concat +local sub, gsub, count = string.sub, string.gsub, string.count +local lpegmatch = lpeg.match + +local context = context + +local moduledata = moduledata or { } +moduledata.engine = moduledata.engine or { } + +local primitives = token.getprimitives() +local commandnames = tokens.commands +local origins = tex.getprimitiveorigins() +local commandhash = { } +local keywords = setmetatableindex("number") + +for i=1,#primitives do + local p = primitives[i] + commandhash[p[3]] = p +end + +local result = setmetatableindex(function(t,k) + local v = setmetatableindex(function(t,k) + local v = "" + t[k] = v + return v + end) + t[k]= v + return v +end) + +local function TODO(t,k) + local v = "TODO" + t[k] = v + return v +end + +local function newsyntax(t) + return setmetatableindex(t or { }, TODO) +end + +local function newresult(t) + return t or { } +end + +local category = setmetatableindex(function(t,k) + local v = "unset" -- might go + t[k]= v + return v +end) + +local syntax = setmetatableindex(function(t,k) + local v = newsyntax() + t[k]= v + return v +end) + +local function equals(...) + local t = { ... } + table.insert(t,#t,"[=]") + return concat(t," ") +end + +local function sequence(...) + return concat({ ... }," ") +end + +local function optional(s) + return "[" .. s .. "]" +end + +local function choice(t,...) + return "( " .. concat(type(t) == "table" and t or { t, ... }," | ") .. ")" +end + +local function repeated(...) + return "n * ( " .. concat({ ... }," ") .. ")" +end + +local function keyword(s) + keywords[s] = keywords[s] + 1 + return s +end + +local s_dimension = "dimension" +local s_integer = "integer" +local s_cardinal = "cardinal" +local s_index = "index" +local s_float = "float" +local s_glue = "glue" +local s_muglue = "muglue" +local s_tokens = "{tokens}" +local s_token = "token" +local s_toks = "toks" +local s_mathstyle = "mathstyle" +local s_mathchar = "mathchar" +local s_quantity = "quantity" +local s_delimiter = "delimiter" +local s_nucleus = "nucleus" +local s_box = "box" +local s_cs = "cs" +local s_mathparameter = "mathparameter" +local s_filler = "fi[n*l]" +local s_fontchar = s_integer +local s_character = "character" +local s_font = choice("font",s_integer) +local s_mathtokens = choice("mathatom",s_tokens) +local s_filename = choice("{filename}","filename") +local s_boxreference = choice(s_index,s_box) +local s_number = choice(s_integer,s_float) +local s_family = "family" +local s_rule = "rule" +local s_glyph = "glyph" +local s_todo = "TODO" + +local s_expression = [==[tokens\relax]==] +local s_conditional = [==[\if...]==] +local s_tokens_or = [==[tokens\or]==] +local s_tokens_relax = [==[tokens\relax]==] +local s_tokens_endcs = [==[tokens\endcsname]==] +local s_tokens_endlc = [==[tokens\endlocalcontrol]==] +local s_parameter_or = [==[parameter\or]==] + +local c_tokens = "tokens" + +local r_dimension = { "", s_dimension } +local r_glue = { "", s_glue } +local r_integer = { "", s_integer } +local r_muglue = { "", s_muglue } +local r_toks = { "", s_toks } +local r_tokens = { "", c_tokens } + +local function setdefaultresult(syntax, value) + local default = { } + for k in next, syntax do + default[k] = value + end + return default +end + +local function setsyntaxfromresult(t) + local s = newsyntax() + for k, v in next, t do + s[k] = v and concat(v," [=] ") or false + end + return s +end + +local compares = { + [0x003C] = "less", + [0x003D] = "equal", + [0x003E] = "greater", + [0x0021] = "negate next", + [0x2208] = "element", + [0x2209] = "not element", + [0x2260] = "not equal", + [0x2264] = "not greater", + [0x2265] = "not less", + [0x2270] = "not greater", + [0x2271] = "not less", +} + +moduledata.engine.compares = compares + +local s_comparison = table.sortedkeys(compares) for i=1,#s_comparison do s_comparison[i] = utf.char(s_comparison[i]) end + +local o_equal = optional("=") +local s_comparison = choice(s_comparison) +local o_preamble = optional("preamble") + +-- start of syntax specification + +syntax.accent = newsyntax { + accent = sequence( + optional(sequence(keyword("xoffset"),s_dimension)), + optional(sequence(keyword("yoffset"),s_dimension)), + s_integer, + s_character + ) +} + +syntax.alignmenttab = newsyntax { + aligntab = false, +} + +syntax.aftersomething = newsyntax { + afterassigned = s_tokens, + afterassignment = s_token, + aftergroup = s_token, + aftergrouped = s_tokens, + atendofgroup = s_token, + atendofgrouped = s_tokens, + atendoffile = s_token, + atendoffiled = sequence(optional(keyword("reverse")),s_tokens), +} + +result.association = newresult { + associateunit = { s_cs, s_integer } +} + +syntax.association = setsyntaxfromresult(result.association) + + +syntax.begingroup = newsyntax { + begingroup = false, + beginmathgroup = false, + beginsimplegroup = false, +} + +syntax.arithmic = newsyntax { + advance = sequence(s_quantity,optional(keyword("by")),s_quantity), + divide = sequence(s_quantity,optional(keyword("by")),s_quantity), + multiply = sequence(s_quantity,optional(keyword("by")),s_quantity), + advanceby = sequence(s_quantity,s_quantity), + divideby = sequence(s_quantity,s_quantity), + multiplyby = sequence(s_quantity,s_quantity), + edivide = sequence(s_quantity,s_quantity), + edivideby = sequence(s_quantity,s_quantity), + rdivide = sequence(s_quantity,s_quantity), + rdivideby = sequence(s_quantity,s_quantity), +} + +syntax.beginlocal = newsyntax { + beginlocalcontrol = false, + localcontrol = s_tokens_endlc, + localcontrolled = s_tokens, + localcontrolledloop = sequence(s_integer,s_integer,s_integer,s_tokens), + expandedloop = sequence(s_integer,s_integer,s_integer,s_tokens), + unexpandedloop = sequence(s_integer,s_integer,s_integer,s_tokens), + localcontrolledrepeat = sequence(s_integer,s_tokens), + expandedrepeat = sequence(s_integer,s_tokens), + unexpandedrepeat = sequence(s_integer,s_tokens), + localcontrolledendless = s_tokens, + expandedendless = s_tokens, + unexpandedendless = s_tokens, +} + +syntax.beginparagraph = newsyntax { + indent = false, + noindent = false, + parattribute = sequence(s_integer,o_equal,s_integer), + quitvmode = false, + snapshotpar = s_cardinal, + undent = false, + wrapuppar = sequence(optional(keyword("reverse")),s_tokens), +} + +result.beginparagraph = newresult { + indent = false, + noindent = false, + parattribute = false, + quitvmode = false, + snapshotpar = r_integer, + undent = false, + wrapuppar = false, +} + +syntax.boundary = newsyntax { + boundary = sequence(o_equal,s_integer), + noboundary = false, + mathboundary = sequence(o_equal,s_integer), + optionalboundary = sequence(o_equal,s_integer), -- linebreak optionals + pageboundary = sequence(o_equal,s_integer), + protrusionboundary = sequence(o_equal,s_integer), + wordboundary = false, +} + +syntax.caseshift = newsyntax { + lowercase = s_tokens, + uppercase = s_tokens, +} + +syntax.catcodetable = newsyntax { + initcatcodetable = s_integer, + savecatcodetable = s_integer, +} + +syntax.charnumber = newsyntax { + char = s_integer, + glyph = sequence( + optional(sequence(keyword("xoffset"),s_dimension)), + optional(sequence(keyword("yoffset"),s_dimension)), + optional(sequence(keyword("scale"),s_integer)), + optional(sequence(keyword("xscale"),s_integer)), + optional(sequence(keyword("yscale"),s_integer)), + optional(sequence(keyword("left"),s_dimension)), + optional(sequence(keyword("right"),s_dimension)), + optional(sequence(keyword("raise"),s_dimension)), + optional(sequence(keyword("options"),s_integer)), + optional(sequence(keyword("font"),s_integer)), + optional(sequence(keyword("id"),s_integer)), + s_integer + ), +} + +syntax.combinetoks = newsyntax { + etoks = sequence(s_toks,s_tokens), + etoksapp = sequence(s_toks,s_tokens), + etokspre = sequence(s_toks,s_tokens), + gtoksapp = sequence(s_toks,s_tokens), + gtokspre = sequence(s_toks,s_tokens), + toksapp = sequence(s_toks,s_tokens), + tokspre = sequence(s_toks,s_tokens), + xtoks = sequence(s_toks,s_tokens), + xtoksapp = sequence(s_toks,s_tokens), + xtokspre = sequence(s_toks,s_tokens), +} + +result.convert = newresult { + tocharacter = { s_integer, c_tokens }, + csactive = { s_token, c_tokens }, + csstring = { s_token, c_tokens }, + detokened = { choice(s_cs,s_tokens,s_toks,s_tok), c_tokens }, + detokenized = { s_tokens, c_tokens }, + directlua = { s_tokens, c_tokens }, + expanded = { s_tokens, c_tokens }, + fontname = { s_font, c_tokens }, + fontspecifiedname = { s_font, c_tokens }, + formatname = { "", c_tokens }, + jobname = { "", c_tokens }, + luabytecode = { s_integer, c_tokens }, + luaescapestring = { s_tokens, c_tokens }, + luafunction = { s_integer, c_tokens }, + luatexbanner = { "", c_tokens }, + meaning = { s_token, c_tokens }, + meaningasis = { s_token, c_tokens }, + meaningful = { s_token, c_tokens }, + meaningfull = { s_token, c_tokens }, + meaningles = { s_token, c_tokens }, + meaningless = { s_token, c_tokens }, + number = { s_integer, c_tokens }, + romannumeral = { s_integer, c_tokens }, + semiexpanded = { s_tokens, c_tokens }, + futureexpandis = { s_todo }, + futureexpandisap = { s_todo }, + string = { s_token, c_tokens }, + todimension = { s_dimension, c_tokens }, + tohexadecimal = { s_integer, c_tokens }, + tointeger = { s_integer, c_tokens }, + tomathstyle = { s_mathstyle, c_tokens }, + toscaled = { s_dimension, c_tokens }, + tosparsedimension = { s_dimension, c_tokens }, + tosparsescaled = { s_dimension, c_tokens }, +} + +syntax.convert = newsyntax { } for k in next, result.convert do syntax.convert[k] = "" end + +syntax.csname = newsyntax { + begincsname = s_tokens_endcs, + csname = s_tokens_endcs, + futurecsname = s_tokens_endcs, + lastnamedcs = false, +} + +syntax.def = newsyntax { + cdef = sequence(s_cs,o_preamble, s_tokens), + cdefcsname = sequence(s_tokens_endcs,o_preamble, s_tokens), + def = sequence(s_cs,o_preamble, s_tokens), + defcsname = sequence(s_tokens_endcs,o_preamble, s_tokens), + edef = sequence(s_cs,o_preamble, s_tokens), + edefcsname = sequence(s_tokens_endcs,o_preamble, s_tokens), + gdef = sequence(s_cs,o_preamble, s_tokens), + gdefcsname = sequence(s_tokens_endcs,o_preamble, s_tokens), + xdef = sequence(s_cs,o_preamble, s_tokens), + xdefcsname = sequence(s_tokens_endcs,o_preamble, s_tokens), +} + +result.definecharcode = newresult { + Udelcode = { s_integer, s_integer }, -- todo + Umathcode = { s_integer, s_integer }, -- todo + amcode = { s_integer, s_integer }, + catcode = { s_integer, s_integer }, + delcode = { s_integer, s_integer }, -- todo + hccode = { s_integer, s_integer }, + hmcode = { s_integer, s_integer }, + lccode = { s_integer, s_integer }, + mathcode = { s_integer, s_integer }, -- todo + sfcode = { s_integer, s_integer }, + uccode = { s_integer, s_integer }, +} + +syntax.definecharcode = setsyntaxfromresult(result.definecharcode) + +syntax.definefamily = newsyntax { + scriptfont = sequence(s_family,s_font), + scriptscriptfont = sequence(s_family,s_font), + textfont = sequence(s_family,s_font), +} + +result.definefamily = setdefaultresult(syntax.definefamily, { s_family, s_integer }) + +syntax.definefont = newsyntax { + font = sequence(s_cs,s_filename,optional(choice(sequence("at",s_dimension),sequence("scaled",s_integer)))), +} + +result.definefont = newresult { + font = r_tokens +} + +syntax.delimiternumber = newsyntax { + delimiter = s_integer, + Udelimiter = sequence(s_integer,s_integer,s_integer), +} + +syntax.discretionary = newsyntax { + ["-"] = false, + automaticdiscretionary = false, + discretionary = sequence( + optional(keyword("penalty"),s_integer), + optional(keyword("postword")), + optional(keyword("preword")), + optional(keyword("break")), + optional(keyword("nobreak")), + optional(keyword("options"),s_integer), + optional(keyword("class"),s_integer), + sequence(s_tokens,s_tokens,s_tokens) + ), + explicitdiscretionary = false, +} + +syntax.endcsname = newsyntax { + endcsname = false, +} + +syntax.endgroup = newsyntax { + endgroup = false, + endmathgroup = false, + endsimplegroup = false, +} + +syntax.endjob = newsyntax { + ["dump"] = false, + ["end"] = false, +} + +syntax.endlocal = newsyntax { + endlocalcontrol = false, +} + +syntax.endparagraph = newsyntax { + par = false, +} + +syntax.endtemplate = newsyntax { + aligncontent = false, + cr = false, + crcr = false, + noalign = s_tokens, + omit = false, + span = false, +} + +syntax.equationnumber = newsyntax { + eqno = s_tokens, + leqno = s_tokens, +} + +syntax.expandafter = newsyntax { + expand = s_token, + expandactive = s_token, + expandafter = sequence(s_token,s_token), + expandafterpars = s_token, + expandafterspaces = s_token, + expandcstoken = s_token, + expandedafter = sequence(s_token,s_tokens), + expandparameter = s_integer, + expandtoken = s_token, + expandtoks = s_tokens, + futureexpand = sequence(s_token,s_token,s_token), + futureexpandafterspaces = sequence(s_token,s_token,s_token), + futureexpandafterpars = sequence(s_token,s_token,s_token), + semiexpand = s_token, + unless = false, +} + +syntax.explicitspace = newsyntax { + [" "] = false, +} + +syntax.getmark = newsyntax { + botmark = false, + botmarks = s_integer, + currentmarks = s_integer, + firstmark = false, + firstmarks = s_integer, + splitbotmark = false, + splitbotmarks = s_integer, + splitfirstmark = false, + splitfirstmarks = s_integer, + topmark = false, + topmarks = s_integer, +} + +syntax.halign = newsyntax { + halign = sequence( + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(sequence(keyword("callback"),s_integer)), + optional(keyword("discard")), + optional(keyword("noskips")), + optional(keyword("reverse")), + optional(sequence(keyword("to"),s_dimension)), + optional(sequence(keyword("spread"),s_dimension)), + s_tokens + ), +} + +syntax.hmove = newsyntax { + moveleft = sequence(s_dimension,s_box), + moveright = sequence(s_dimension,s_box), +} + +syntax.hyphenation = newsyntax { + hjcode = sequence(s_integer,o_equal,s_integer), + hyphenation = s_tokens, + hyphenationmin = sequence(o_equal,s_integer), + patterns = s_tokens, + postexhyphenchar = sequence(o_equal,s_integer), + posthyphenchar = sequence(o_equal,s_integer), + preexhyphenchar = sequence(o_equal,s_integer), + prehyphenchar = sequence(o_equal,s_integer), +} + +result.hyphenation = newresult { + -- TODO +} + +do + + local vrule = sequence( + optional(sequence(keyword("attr"),s_integer,o_equal,s_integer)), + optional(sequence(keyword("width"),s_dimension)), + optional(sequence(keyword("height"),s_dimension)), + optional(sequence(keyword("depth"),s_dimension)), + optional(sequence(keyword("left"),s_dimension)), + optional(sequence(keyword("right"),s_dimension)), + optional(sequence(keyword("top"),s_dimension)), + optional(sequence(keyword("bottom"),s_dimension)), + optional(sequence(keyword("xoffset"),s_dimension)), + optional(sequence(keyword("yoffset"),s_dimension)) + ) + + local rule = sequence(vrule,sequence( + optional(sequence(keyword("font"),s_integer)), + optional(sequence(keyword("fam"),s_integer)), + optional(sequence(keyword("char"),s_integer)) + )) + + syntax.hrule = newsyntax { + nohrule = rule, + virtualhrule = vrule, + hrule = rule, + } + +end + +syntax.hskip = newsyntax { + hfil = false, + hfill = false, + hfilneg = false, + hskip = sequence( + s_dimension, + optional(sequence(keyword("plus"),choice(s_dimension,s_filler))), + optional(sequence(keyword("minus"),choice(s_dimension,s_filler))) + ), + hss = false, +} + +-- needs checking, first version + +syntax.iftest = newsyntax { + ["else"] = false, + ["fi"] = false, + ["if"] = false, + ifabsdim = sequence(s_dimension,s_comparison,s_dimension), + ifabsfloat = sequence(s_float,s_comparison,s_float), + ifabsnum = sequence(s_integer,s_comparison,s_integer), + ifarguments = false, + ifboolean = s_integer, + ifcase = s_integer, + ifcat = s_token, + ifchkdim = s_tokens_or, + ifchkdimension = s_tokens_or, + ifchknum = s_tokens_or, + ifchknumber = s_tokens_or, + ifcmpdim = sequence(s_dimension,s_dimension), + ifcmpnum = sequence(s_integer,s_integer), + ifcondition = s_conditional, + ifcsname = s_tokens_endcs, + ifcstok = s_tokens_relax, + ifdefined = s_token, + ifdim = sequence(s_dimension,s_comparison,s_dimension), + ifdimexpression = s_tokens_relax, + ifdimval = s_tokens_or, + ifempty = choice(s_token,s_tokens), + iffalse = false, + ifflags = s_cs, + iffloat = sequence(s_float,s_comparison,s_float), + iffontchar = sequence(s_integer,s_integer), + ifhaschar = sequence(s_token,s_tokens), + ifhastok = sequence(s_token,s_tokens), + ifhastoks = s_tokens_relax, + ifhasxtoks = s_tokens_relax, + ifhbox = s_boxreference, + ifhmode = false, + ifinalignment = false, + ifincsname = s_tokens_endcs, + ifinner = false, + ifinsert = s_integer, + ifintervaldim = sequence(s_dimension,s_dimension,s_dimension), + ifintervalfloat = sequence(s_integer,s_integer,s_integer), + ifintervalnum = sequence(s_float,s_float,s_float), + iflastnamedcs = false, + ifmathparameter = s_integer, + ifmathstyle = s_mathstyle, + ifmmode = false, + ifnum = sequence(s_integer,s_comparison,s_integer), + ifnumexpression = s_tokens_relax, + ifnumval = s_tokens_or, + ifodd = s_integer, + ifparameter = s_parameter_or, + ifparameters = false, + ifrelax = s_token, + iftok = s_tokens_relax, + iftrue = false, + ifvbox = s_boxreference, + ifvmode = false, + ifvoid = s_boxreference, + ifx = s_token, + ifzerodim = s_dimension, + ifzerofloat = s_float, + ifzeronum = s_integer, + ["or"] = false, + ["orelse"] = false, + ["orunless"] = false, +} + +syntax.ignoresomething = newsyntax { + ignorearguments = false, + ignorenestedupto = s_token, + ignorepars = false, + ignorerest = false, + ignorespaces = false, + ignoreupto = s_token, +} + +-- result.ignoresomething = newresult { +-- -- TODO +-- } + +syntax.input = newsyntax { + endinput = false, + input = s_filename, + eofinput = sequence(s_tokens, s_filename), + scantokens = s_tokens, + scantextokens = s_tokens, + tokenized = s_tokens, + quitloop = false, + quitloopnow = false, + retokenized = sequence(optional(keyword("catcodetable")),s_tokens), +} + +syntax.insert = newsyntax { + insert = s_integer +} + +result.internaldimension = { + boxmaxdepth = r_dimension, + delimitershortfall = r_dimension, + displayindent = r_dimension, + displaywidth = r_dimension, + emergencyextrastretch = r_dimension, + emergencystretch = r_dimension, + glyphxoffset = r_dimension, + glyphyoffset = r_dimension, + hangindent = r_dimension, + hfuzz = r_dimension, + hsize = r_dimension, + ignoredepthcriterion = r_dimension, + lineskiplimit = r_dimension, + mathsurround = r_dimension, + maxdepth = r_dimension, + nulldelimiterspace = r_dimension, + overfullrule = r_dimension, + pageextragoal = r_dimension, + parindent = r_dimension, + predisplaysize = r_dimension, + pxdimen = r_dimension, + scriptspace = r_dimension, + shortinlinemaththreshold = r_dimension, + splitmaxdepth = r_dimension, + tabsize = r_dimension, + vfuzz = r_dimension, + vsize = r_dimension, +} + +syntax.internaldimension = setsyntaxfromresult(result.internaldimension) + +result.internalglue = { + abovedisplayshortskip = r_glue, + abovedisplayskip = r_glue, + additionalpageskip = r_glue, + baselineskip = r_glue, + belowdisplayshortskip = r_glue, + belowdisplayskip = r_glue, + emergencyleftskip = r_glue, + emergencyrightskip = r_glue, + initialpageskip = r_glue, + initialtopskip = r_glue, + leftskip = r_glue, + lineskip = r_glue, + mathsurroundskip = r_glue, + maththreshold = r_glue, + parfillleftskip = r_glue, + parfillrightskip = r_glue, + parfillskip = r_glue, + parinitleftskip = r_glue, + parinitrightskip = r_glue, + parskip = r_glue, + rightskip = r_glue, + spaceskip = r_glue, + splittopskip = r_glue, + tabskip = r_glue, + topskip = r_glue, + xspaceskip = r_glue, +} + +syntax.internalglue = setsyntaxfromresult(result.internalglue) + +result.internalinteger = { + adjdemerits = r_integer, + adjustspacing = r_integer, + adjustspacingshrink = r_integer, + adjustspacingstep = r_integer, + adjustspacingstretch = r_integer, + alignmentcellsource = r_integer, + alignmentwrapsource = r_integer, + automatichyphenpenalty = r_integer, + automigrationmode = r_integer, + autoparagraphmode = r_integer, + binoppenalty = r_integer, + brokenpenalty = r_integer, + catcodetable = r_integer, + clubpenalty = r_integer, + day = r_integer, + defaulthyphenchar = r_integer, + defaultskewchar = r_integer, + delimiterfactor = r_integer, + discretionaryoptions = r_integer, + displaywidowpenalty = r_integer, + doubleadjdemerits = r_integer, + doublehyphendemerits = r_integer, + endlinechar = r_integer, + errorcontextlines = r_integer, + escapechar = r_integer, + eufactor = r_integer, + exceptionpenalty = r_integer, + exhyphenchar = r_integer, + exhyphenpenalty = r_integer, + explicithyphenpenalty = r_integer, + fam = r_integer, + finalhyphendemerits = r_integer, + firstvalidlanguage = r_integer, + floatingpenalty = r_integer, + globaldefs = r_integer, + glyphdatafield = r_integer, + glyphoptions = r_integer, + glyphscale = r_integer, + glyphscriptfield = r_integer, + glyphscriptscale = r_integer, + glyphscriptscriptscale = r_integer, + glyphslant = r_integer, + glyphstatefield = r_integer, + glyphtextscale = r_integer, + glyphxscale = r_integer, + glyphyscale = r_integer, + glyphweight = r_integer, + hangafter = r_integer, + hbadness = r_integer, + holdinginserts = r_integer, + holdingmigrations = r_integer, + hyphenationmode = r_integer, + hyphenpenalty = r_integer, + interlinepenalty = r_integer, + language = r_integer, + lastlinefit = r_integer, + lefthyphenmin = r_integer, + linebreakcriterion = r_integer, + linebreakoptional = r_integer, + linebreakpasses = r_integer, + linedirection = r_integer, + linepenalty = r_integer, + localbrokenpenalty = r_integer, + localinterlinepenalty = r_integer, + localpretolerance = r_integer, + localtolerance = r_integer, + looseness = r_integer, + luacopyinputnodes = r_integer, + mathbeginclass = r_integer, + mathcheckfencesmode = r_integer, + mathdictgroup = r_integer, + mathdictproperties = r_integer, + mathdirection = r_integer, + mathdisplaymode = r_integer, + mathdisplaypenaltyfactor = r_integer, + mathdisplayskipmode = r_integer, + mathdoublescriptmode = r_integer, + mathendclass = r_integer, + matheqnogapstep = r_integer, + mathfontcontrol = r_integer, + mathgluemode = r_integer, + mathgroupingmode = r_integer, + mathinlinepenaltyfactor = r_integer, + mathleftclass = r_integer, + mathlimitsmode = r_integer, + mathnolimitsmode = r_integer, + mathpenaltiesmode = r_integer, + mathpretolerance = r_integer, + mathrightclass = r_integer, + mathrulesfam = r_integer, + mathrulesmode = r_integer, + mathscriptsmode = r_integer, + mathslackmode = r_integer, + mathspacingmode = r_integer, + mathsurroundmode = r_integer, + mathtolerance = r_integer, + maxdeadcycles = r_integer, + month = r_integer, + newlinechar = r_integer, + normalizelinemode = r_integer, + normalizeparmode = r_integer, + nospaces = r_integer, + orphanpenalty = r_integer, + outputbox = r_integer, + outputpenalty = r_integer, + overloadmode = r_integer, + parametermode = r_integer, + pardirection = r_integer, + pausing = r_integer, + postdisplaypenalty = r_integer, + postinlinepenalty = r_integer, + postshortinlinepenalty = r_integer, + prebinoppenalty = r_integer, + predisplaydirection = r_integer, + predisplaygapfactor = r_integer, + predisplaypenalty = r_integer, + preinlinepenalty = r_integer, + prerelpenalty = r_integer, + preshortinlinepenalty = r_integer, + pretolerance = r_integer, + protrudechars = r_integer, + relpenalty = r_integer, + righthyphenmin = r_integer, + savinghyphcodes = r_integer, + savingvdiscards = r_integer, + setfontid = r_integer, + setlanguage = r_integer, + shapingpenaltiesmode = r_integer, + shapingpenalty = r_integer, + shortinlineorphanpenalty = r_integer, + showboxbreadth = r_integer, + showboxdepth = r_integer, + shownodedetails = r_integer, + singlelinepenalty = r_integer, + spacefactormode = r_integer, + spacefactorshrinklimit = r_integer, + spacefactorstretchlimit = r_integer, + supmarkmode = r_integer, + textdirection = r_integer, + time = r_integer, + tolerance = r_integer, + tracingadjusts = r_integer, + tracingalignments = r_integer, + tracingassigns = r_integer, + tracingcommands = r_integer, + tracingexpressions = r_integer, + tracingfullboxes = r_integer, + tracinggroups = r_integer, + tracinghyphenation = r_integer, + tracingifs = r_integer, + tracinginserts = r_integer, + tracinglevels = r_integer, + tracinglists = r_integer, + tracinglostchars = r_integer, + tracingmacros = r_integer, + tracingmarks = r_integer, + tracingmath = r_integer, + tracingnesting = r_integer, + tracingnodes = r_integer, + tracingonline = r_integer, + tracingoutput = r_integer, + tracingpages = r_integer, + tracingparagraphs = r_integer, + tracingpasses = r_integer, + tracingpenalties = r_integer, + tracingrestores = r_integer, + tracingstats = r_integer, + uchyph = r_integer, + variablefam = r_integer, + vbadness = r_integer, + widowpenalty = r_integer, + year = r_integer, +} + +syntax.internalinteger = setsyntaxfromresult(result.internalinteger) + +result.internalmuglue = { + medmuskip = r_muglue, + pettymuskip = r_muglue, + thickmuskip = r_muglue, + thinmuskip = r_muglue, + tinymuskip = r_muglue, +} + +syntax.internalmuglue = setsyntaxfromresult(result.internalmuglue) + +result.internaltoks = { + errhelp = r_toks, + everybeforepar = r_toks, + everycr = r_toks, + everydisplay = r_toks, + everyeof = r_toks, + everyhbox = r_toks, + everyjob = r_toks, + everymath = r_toks, + everymathatom = r_toks, + everypar = r_toks, + everytab = r_toks, + everyvbox = r_toks, + output = r_toks, +} + +syntax.internaltoks = setsyntaxfromresult(result.internaltoks) + +syntax.italiccorrection = newsyntax { + ["/"] = false, + italiccorrection = false, + leftcorrection = false, + rightcorrection = false, +} + +syntax.kern = newsyntax { + kern = s_dimension, + hkern = s_dimension, + vkern = s_dimension, +} + +syntax.leader = newsyntax { + cleaders = sequence(choice(s_box,s_rule,s_glyph),s_glue), + gleaders = sequence(choice(s_box,s_rule,s_glyph),s_glue), + leaders = sequence(choice(s_box,s_rule,s_glyph),s_glue), + uleaders = sequence(optional(sequence(keyword("callback"), s_integer)),choice(s_box,s_rule,s_glyph),s_glue), + xleaders = sequence(choice(s_box,s_rule,s_glyph),s_glue), +} + +syntax.legacy = newsyntax { + shipout = s_tokens +} + +syntax.let = newsyntax { + futuredef = sequence(s_cs,s_cs), + futurelet = sequence(s_cs,o_equal,s_cs), + glet = s_cs, + gletcsname = s_tokens_endcs, + glettonothing = s_cs, + let = s_cs, + letcharcode = s_cs, + letcsname = s_tokens_endcs, + letfrozen = s_cs, + letprotected = s_cs, + lettolastnamedcs = s_cs, + lettonothing = s_cs, + swapcsvalues = sequence(s_cs,s_cs), + unletfrozen = s_cs, + unletprotected = s_cs, +} + +syntax.localbox = newsyntax { + localleftbox = s_box, + localmiddlebox = s_box, + localrightbox = s_box, +} + +syntax.luafunctioncall = newsyntax { + luabytecodecall = s_integer, + luafunctioncall = s_integer, +} + +do + + local split = sequence( + optional(keyword("attr"),s_integer,s_integer), + optional(keyword("to"),s_dimension), + optional(keyword("upto"),s_dimension), + s_tokens + ) + + local make = sequence( + optional(sequence(keyword("target"),s_integer)), + optional(sequence(keyword("to"),s_dimension)), + optional(sequence(keyword("adapt"),s_scale)), + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(sequence(keyword("anchor"),s_integer)), + optional(sequence(keyword("axis"),s_integer)), + optional(sequence(keyword("shift"),s_dimension)), + optional(sequence(keyword("spread"),s_dimension)), + optional(sequence(keyword("source"),s_integer)), + optional(sequence(keyword("direction"),s_integer)), + optional(keyword("delay")), + optional(sequence(keyword("orientation"),s_integer)), + optional(sequence(keyword("xoffset"),s_dimension)), + optional(sequence(keyword("xmove"),s_dimension)), + optional(sequence(keyword("yoffset"),s_dimension)), + optional(sequence(keyword("ymove"),s_dimension)), + optional(keyword("reverse")), + optional(keyword("retain")), + optional(keyword("container")), + optional(keyword("mathtext")), + optional(sequence(keyword("class"),s_integer)), + s_tokens + ) + + syntax.makebox = newsyntax { + box = s_boxreference, + copy = s_boxreference, + dbox = make, + dpack = make, + dsplit = split, + hbox = make, + hpack = make, + insertbox = s_integer, + insertcopy = s_integer, + lastbox = false, + localleftboxbox = false, + localmiddleboxbox = false, + localrightboxbox = false, + tpack = make, + tsplit = split, + vbox = make, + vpack = make, + vsplit = split, + vtop = make, + } + +end + +syntax.mathaccent = newsyntax { + mathaccent = s_tokens, -- overloaded in conetext + Umathaccent = sequence( + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(keyword("center")), + optional(sequence(keyword("class"),s_integer)), + optional(keyword("exact")), + optional(sequence(keyword("source"),s_integer)), + optional(keyword("stretch")), + optional(keyword("shrink")), + optional(sequence(keyword("fraction"),s_integer)), + optional(keyword("fixed")), + optional(keyword("keepbase")), + optional(keyword("nooverflow")), + optional(keyword("base")), + choice( + sequence(keyword("both"),optional(keyword("fixed")),s_character,optional(keyword("fixed")),s_character), + sequence(keyword("bottom"),optional(keyword("fixed")),s_character), + sequence(keyword("top"),optional(keyword("fixed")),s_character), + sequence(keyword("overlay"),s_character), + s_character + ) + ), +} + +syntax.mathcharnumber = newsyntax { + Umathchar = s_integer, + mathclass = s_integer, + mathdictionary = sequence(s_integer,s_mathchar), + mathchar = s_integer, +} + +syntax.mathchoice = newsyntax { + mathdiscretionary = sequence(optional(sequence(keyword("class"),s_integer)),s_tokens,s_tokens,s_tokens), + mathstack = s_tokens, + mathchoice = sequence(s_tokens,s_tokens,s_tokens,s_tokens), +} + +syntax.mathcomponent = newsyntax { + mathatom = sequence( + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(sequence(keyword("all"),s_integer)), + optional(sequence(keyword("leftclass"),s_integer)), + optional(keyword("limits")), + optional(sequence(keyword("rightclass"),s_integer)), + optional(sequence(keyword("class"),s_integer)), + optional(keyword("unpack")), + optional(keyword("unroll")), + optional(keyword("single")), + optional(sequence(keyword("source"),s_integer)), + optional(keyword("textfont")), + optional(keyword("mathfont")), + optional(sequence(keyword("options"),s_integer)), + optional(keyword("nolimits")), + optional(keyword("nooverflow")), + optional(keyword("void")), + optional(keyword("phantom")), + optional(keyword("continuation")), + optional(s_integer) + ), + mathbin = s_tokens, + mathclose = s_tokens, + mathinner = s_tokens, + mathop = s_tokens, + mathopen = s_tokens, + mathord = s_tokens, + mathpunct = s_tokens, + mathrel = s_tokens, + overline = s_tokens, + underline = s_tokens, +} + +do + + local fence = sequence( + optional(keyword("auto")), + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(keyword("axis")), + optional(sequence(keyword("bottom"),s_dimension)), + optional(sequence(keyword("depth"),s_dimension)), + optional(sequence(keyword("factor"),s_integer)), + optional(sequence(keyword("height"),s_dimension)), + optional(keyword("noaxis")), + optional(keyword("nocheck")), + optional(keyword("nolimits")), + optional(keyword("nooverflow")), + optional(sequence(keyword("leftclass"),s_integer)), + optional(keyword("limits")), + optional(keyword("exact")), + optional(keyword("void")), + optional(keyword("phantom")), + optional(sequence(keyword("class"),s_integer)), + optional(sequence(keyword("rightclass"),s_integer)), + optional(keyword("scale")), + optional(sequence(keyword("source"),s_integer)), + optional(keyword("top")), + s_delimiter + ) + + syntax.mathfence = newsyntax { + Uleft = fence, + Umiddle = fence, + Uoperator = fence, + Uright = fence, + Uvextensible = fence, + left = fence, + middle = fence, + right = fence, + } + +end + +do + + local options = sequence( + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(sequence(keyword("class"),s_integer)), + optional(keyword("center")), + optional(keyword("exact")), + optional(keyword("proportional")), + optional(keyword("noaxis")), + optional(keyword("nooverflow")), + optional(sequence(keyword("style"),s_mathstyle)), + optional(sequence(keyword("source"),s_integer)), + optional(sequence(keyword("hfactor"),s_integer)), + optional(sequence(keyword("vfactor"),s_integer)), + optional(keyword("font")), + optional(sequence(keyword("thickness"),s_dimension)) + ) + + -- needs checking + + syntax.mathfraction = newsyntax { + Uabove = sequence(s_dimension,options), + Uabovewithdelims = sequence(s_delimiter,s_delimiter,s_dimension,options), + Uatop = sequence(s_dimension,options), + Uatopwithdelims = sequence(s_delimiter,s_delimiter,s_dimension,options), + Uover = sequence(options), + Uoverwithdelims = sequence(s_delimiter,s_delimiter,options), + Uskewed = sequence(s_delimiter,options), + Uskewedwithdelims = sequence(s_delimiter,s_delimiter,s_delimiter,options), + Ustretched = sequence(s_delimiter,options), + Ustretchedwithdelims = sequence(s_delimiter,s_delimiter,s_delimiter,options), + above = s_dimension, + abovewithdelims = sequence(s_delimiter,s_delimiter,s_dimension), + atop = s_dimension, + atopwithdelims = sequence(s_delimiter,s_delimiter,s_dimension), + over = false, + overwithdelims = sequence(s_delimiter,s_delimiter), + } + +end + +syntax.mathmodifier = newsyntax { + Umathadapttoleft = false, + Umathadapttoright = false, + Umathlimits = false, + Umathnoaxis = false, + Umathnolimits = false, + Umathopenupdepth = s_dimension, + Umathopenupheight = s_dimension, + Umathphantom = false, + Umathsource = sequence(optional(s_nucleus),s_integer), + Umathuseaxis = false, + Umathvoid = false, + displaylimits = false, + limits = false, + nolimits = false, +} + +do + + local options = sequence( + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(keyword("bottom")), + optional(keyword("exact")), + optional(keyword("top")), + optional(sequence(keyword("style"),s_mathstyle)), + optional(sequence(keyword("source"),s_integer)), + optional(keyword("stretch")), + optional(keyword("shrink")), + optional(sequence(keyword("width"),s_dimension)), + optional(sequence(keyword("height"),s_dimension)), + optional(sequence(keyword("depth"),s_dimension)), + optional(keyword("left")), + optional(keyword("middle")), + optional(keyword("right")), + optional(keyword("nooverflow")) + ) + + syntax.mathradical = newsyntax { + Udelimited = sequence(options,s_delimiter,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens), + Udelimiterover = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens), + Udelimiterunder = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens), + Uhextensible = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens), + Uoverdelimiter = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens), + Uradical = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens), + Uroot = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens,s_mathtokens), + Urooted = sequence(options,s_delimiter,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens,s_mathtokens), + Uunderdelimiter = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens), + radical = sequence(options,s_delimiter,optional(s_delimiter),optional(s_delimiter),s_mathtokens,s_mathtokens), + } + +end + +syntax.mathscript = newsyntax { + nosubprescript = false, + nosubscript = false, + nosuperprescript = false, + nosuperscript = false, + primescript = s_mathtokens, + shiftedsubprescript = s_mathtokens, + shiftedsubscript = s_mathtokens, + shiftedsuperprescript = s_mathtokens, + shiftedsuperscript = s_mathtokens, + subprescript = s_mathtokens, + subscript = s_mathtokens, + superprescript = s_mathtokens, + superscript = s_mathtokens, + noatomruling = false, + nonscript = false, +} + +syntax.mathshiftcs = newsyntax { + Ustartdisplaymath = false, + Ustartmath = false, + Ustartmathmode = false, + Ustopdisplaymath = false, + Ustopmath = false, + Ustopmathmode = false, +} + +syntax.mathstyle = newsyntax { + givenmathstyle = s_mathstyle, + allcrampedstyles = false, + alldisplaystyles = false, + allmainstyles = false, + allmathstyles = false, + allscriptscriptstyles = false, + allscriptstyles = false, + allsplitstyles = false, + alltextstyles = false, + alluncrampedstyles = false, + allunsplitstyles = false, + crampeddisplaystyle = false, + crampedscriptscriptstyle = false, + crampedscriptstyle = false, + crampedtextstyle = false, + displaystyle = false, + scaledmathstyle = s_integer, + scriptscriptstyle = false, + scriptstyle = false, + textstyle = false, +} + +result.mathstyle = setdefaultresult(result.mathstyle, r_integer) + +result.mathstyle.Ustyle = { s_mathstyle, s_integer } +result.mathstyle.scaledmathstyle = { s_mathstyle, s_integer } + +syntax.message = newsyntax { + message = s_tokens, + errmessage = s_tokens, +} + +syntax.mkern = newsyntax { + mkern = s_dimension +} + +syntax.mskip = newsyntax { + mathatomskip = s_muglue, + mskip = s_muglue, +} + +syntax.noexpand = newsyntax { + noexpand = s_token +} + +syntax.parameter = newsyntax { + alignmark = false, + parametermark = false, +} + +syntax.penalty = newsyntax { + hpenalty = s_integer, + penalty = s_integer, + vpenalty = s_integer, +} + +syntax.prefix = newsyntax { + aliased = false, + constant = false, + constrained = false, + deferred = false, + enforced = false, + frozen = false, + global = false, + immediate = false, + immutable = false, + inherited = false, + instance = false, + long = false, + mutable = false, + noaligned = false, + outer = false, + overloaded = false, + permanent = false, + protected = false, + retained = false, + semiprotected = false, + tolerant = false, + untraced = false, +} + +syntax.register = newsyntax { + count = sequence(s_boxreference,o_equal,s_integer), + attribute = sequence(s_boxreference,o_equal,s_integer), + dimen = sequence(s_boxreference,o_equal,s_dimension), + skip = sequence(s_boxreference,o_equal,s_glue), + muskip = sequence(s_boxreference,o_equal,s_muglue), + toks = sequence(s_boxreference,o_equal,s_tokens), + float = sequence(s_boxreference,o_equal,s_float), +} + +result.register = newresult { + count = { s_boxreference, s_integer }, + attribute = { s_boxreference, s_integer }, + dimen = { s_boxreference, s_dimension }, + skip = { s_boxreference, s_glue }, + muskip = { s_boxreference, s_muglue }, + toks = { s_boxreference, s_tokens }, + float = { s_boxreference, s_float }, +} + +syntax.relax = newsyntax { + norelax = false, + relax = false, +} + +syntax.removeitem = newsyntax { + unboundary = false, + unkern = false, + unpenalty = false, + unskip = false, +} + +syntax.auxiliary = newsyntax { + insertmode = s_integer, + interactionmode = s_integer, + prevdepth = s_dimension, + prevgraf = s_integer, + spacefactor = s_integer, +} + +result.auxiliary = newresult { + insertmode = r_integer, + interactionmode = r_integer, + prevdepth = r_dimension, + prevgraf = r_integer, + spacefactor = r_integer, +} + +syntax.setbox = newsyntax { + setbox = sequence(s_boxreference,o_equal,o_box) +} + +syntax.boxproperty = newsyntax { + boxadapt = sequence(s_boxreference,o_equal,s_integer), -- scaled + boxanchor = sequence(s_boxreference,o_equal,s_integer), + boxanchors = sequence(s_boxreference,o_equal,s_integer,s_integer), -- check + boxattribute = sequence(s_boxreference,s_integer,o_equal,s_integer), + boxdirection = sequence(s_boxreference,o_equal,s_integer), + boxfreeze = sequence(s_boxreference,o_equal,s_integer), + boxfinalize = sequence(s_boxreference,o_equal,s_integer), + boxgeometry = sequence(s_boxreference,o_equal,s_integer), + boxlimitate = sequence(s_boxreference,o_equal,s_integer), + boxorientation = sequence(s_boxreference,o_equal,s_integer), + boxrepack = s_boxreference, + boxshift = sequence(s_boxreference,o_equal,s_dimension), + boxshrink = s_boxreference, + boxsource = sequence(s_boxreference,o_equal,s_integer), + boxstretch = s_boxreference, + boxtarget = sequence(s_boxreference,o_equal,s_integer), + boxtotal = s_boxreference, + boxvadjust = sequence(s_boxreference,s_tokens), -- todo: pre/post etc + boxxmove = sequence(s_boxreference,o_equal,s_dimension), + boxxoffset = sequence(s_boxreference,o_equal,s_dimension), + boxymove = sequence(s_boxreference,o_equal,s_dimension), + boxyoffset = sequence(s_boxreference,o_equal,s_dimension), + dp = sequence(s_boxreference,o_equal,s_dimension), + ht = sequence(s_boxreference,o_equal,s_dimension), + wd = sequence(s_boxreference,o_equal,s_dimension), +} + +-- boxadapt : zero +-- boxfreeze : width or total +-- boxrepack : width or total +-- boxvadjust : 0x1 = preadjust 0x2 = postadjust 0x4 = premigrate 0x8 = postmigrate + +result.boxproperty = newresult { + boxadapt = { s_boxreference, s_dimension }, + boxanchor = { s_boxreference, s_integer }, + boxanchors = { s_boxreference, s_integer }, + boxattribute = { sequence(s_boxreference,s_integer), s_integer }, + boxdirection = { s_boxreference, s_integer }, + boxfreeze = { s_boxreference, s_integer }, + boxgeometry = { s_boxreference, s_integer }, + boxlimitate = { s_boxreference, s_integer }, + boxorientation = { s_boxreference, s_integer }, + boxrepack = { s_boxreference, s_dimension }, + boxshift = { s_boxreference, s_dimension }, + boxshrink = { s_boxreference, s_dimension }, + boxsource = { s_boxreference, s_integer }, + boxstretch = { s_boxreference, s_dimension }, + boxtarget = { s_boxreference, s_integer }, + boxtotal = { s_boxreference, s_dimension }, + boxvadjust = { s_boxreference, s_cardinal }, + boxxmove = { s_boxreference, s_dimension }, + boxxoffset = { s_boxreference, s_dimension }, + boxymove = { s_boxreference, s_dimension }, + boxyoffset = { s_boxreference, s_dimension }, + dp = { s_boxreference, s_dimension }, + ht = { s_boxreference, s_dimension }, + wd = { s_boxreference, s_dimension }, +} + +syntax.setfont = newsyntax { + nullfont = false, +} + +result.setresult.setfont = newresult { + nullfont = r_tokens, +} + + +syntax.fontproperty = newsyntax { + cfcode = sequence(s_font,s_integer,o_equal,s_integer), + efcode = sequence(s_font,s_integer,o_equal,s_integer), + fontdimen = sequence(s_font,s_integer,o_equal,s_dimension), + hyphenchar = sequence(s_font,o_equal,s_integer), + lpcode = sequence(s_font,s_integer,o_equal,s_dimension), + rpcode = sequence(s_font,s_integer,o_equal,s_dimension), + scaledfontdimen = sequence(s_font,o_equal,s_integer), + skewchar = sequence(s_font,o_equal,s_integer), +} + +result.fontproperty = newresult { + cfcode = { sequence(s_font,s_integer), s_integer }, + efcode = { sequence(s_font,s_integer), s_integer }, + fontdimen = { sequence(s_font,s_integer), s_dimension }, + hyphenchar = { s_font, s_integer }, + lpcode = { sequence(s_font,s_integer), s_dimension }, + rpcode = { sequence(s_font,s_integer), s_dimension }, + scaledfontdimen = { s_font, s_integer }, + skewchar = { s_font, s_integer }, +} + +syntax.interaction = newsyntax { + batchmode = false, + errorstopmode = false, + nonstopmode = false, + scrollmode = false, +} + +syntax.mark = newsyntax { + clearmarks = s_integer, + flushmarks = false, + mark = s_tokens, + marks = sequence(s_integer,s_tokens), + setmarks = s_integer, +} + + +do + + local dimension = { s_mathstyle, s_dimension } + local integer = { s_mathstyle, s_integer } + local variant = { "", s_mathstyle } + + + result.mathparameter = newresult { + Umathaccentbasedepth = dimension, + Umathaccentbaseheight = dimension, + Umathaccentbottomovershoot = dimension, + Umathaccentbottomshiftdown = dimension, + Umathaccentextendmargin = dimension, + Umathaccentsuperscriptdrop = dimension, + Umathaccentsuperscriptpercent = integer, + Umathaccenttopovershoot = dimension, + Umathaccenttopshiftup = dimension, + Umathaccentvariant = variant, + Umathaxis = dimension, + Umathbottomaccentvariant = variant, + Umathconnectoroverlapmin = dimension, + Umathdegreevariant = variant, + Umathdelimiterextendmargin = dimension, + Umathdelimiterovervariant = variant, + Umathdelimiterpercent = integer, + Umathdelimitershortfall = dimension, + Umathdelimiterundervariant = variant, + Umathdenominatorvariant = variant, + Umathexheight = dimension, + Umathextrasubpreshift = dimension, + Umathextrasubprespace = dimension, + Umathextrasubshift = dimension, + Umathextrasubspace = dimension, + Umathextrasuppreshift = dimension, + Umathextrasupprespace = dimension, + Umathextrasupshift = dimension, + Umathextrasupspace = dimension, + Umathflattenedaccentbasedepth = dimension, + Umathflattenedaccentbaseheight = dimension, + Umathflattenedaccentbottomshiftdown = dimension, + Umathflattenedaccenttopshiftup = dimension, + Umathfractiondelsize = dimension, + Umathfractiondenomdown = dimension, + Umathfractiondenomvgap = dimension, + Umathfractionnumup = dimension, + Umathfractionnumvgap = dimension, + Umathfractionrule = dimension, + Umathfractionvariant = variant, + Umathhextensiblevariant = variant, + Umathlimitabovebgap = dimension, + Umathlimitabovekern = dimension, + Umathlimitabovevgap = dimension, + Umathlimitbelowbgap = dimension, + Umathlimitbelowkern = dimension, + Umathlimitbelowvgap = dimension, + Umathnolimitsubfactor = integer, + Umathnolimitsupfactor = integer, + Umathnumeratorvariant = variant, + Umathoperatorsize = dimension, + Umathoverbarkern = dimension, + Umathoverbarrule = dimension, + Umathoverbarvgap = dimension, + Umathoverdelimiterbgap = dimension, + Umathoverdelimitervariant = variant, + Umathoverdelimitervgap = dimension, + Umathoverlayaccentvariant = variant, + Umathoverlinevariant = variant, + Umathpresubshiftdistance = dimension, + Umathpresupshiftdistance = dimension, + Umathprimeraise = dimension, + Umathprimeraisecomposed = dimension, + Umathprimeshiftdrop = dimension, + Umathprimeshiftup = dimension, + Umathprimespaceafter = dimension, + Umathprimevariant = variant, + Umathprimewidth = dimension, + Umathquad = dimension, + Umathradicaldegreeafter = dimension, + Umathradicaldegreebefore = dimension, + Umathradicaldegreeraise = dimension, + Umathradicalextensibleafter = dimension, + Umathradicalextensiblebefore = dimension, + Umathradicalkern = dimension, + Umathradicalrule = dimension, + Umathradicalvariant = variant, + Umathradicalvgap = dimension, + Umathruledepth = dimension, + Umathruleheight = dimension, + Umathskeweddelimitertolerance = dimension, + Umathskewedfractionhgap = dimension, + Umathskewedfractionvgap = dimension, + Umathspaceafterscript = dimension, + Umathspacebeforescript = dimension, + Umathstackdenomdown = dimension, + Umathstacknumup = dimension, + Umathstackvariant = variant, + Umathstackvgap = dimension, + Umathsubscriptvariant = variant, + Umathsubshiftdistance = dimension, + Umathsubshiftdown = dimension, + Umathsubshiftdrop = dimension, + Umathsubsupshiftdown = dimension, + Umathsubsupvgap = dimension, + Umathsubtopmax = dimension, + Umathsupbottommin = dimension, + Umathsuperscriptvariant = dimension, + Umathsupshiftdistance = dimension, + Umathsupshiftdrop = dimension, + Umathsupshiftup = dimension, + Umathsupsubbottommax = dimension, + Umathtopaccentvariant = variant, + Umathunderbarkern = dimension, + Umathunderbarrule = dimension, + Umathunderbarvgap = dimension, + Umathunderdelimiterbgap = dimension, + Umathunderdelimitervariant = variant, + Umathunderdelimitervgap = dimension, + Umathunderlinevariant = variant, + Umathvextensiblevariant = variant, + Umathxscale = integer, + Umathyscale = integer, + + copymathatomrule = false, -- todo + copymathparent = false, -- todo + copymathspacing = false, -- todo + letmathatomrule = false, -- todo + letmathparent = false, -- todo + letmathspacing = false, -- todo + resetmathspacing = false, + setdefaultmathcodes = false, + setmathatomrule = false, -- todo + setmathdisplaypostpenalty = false, -- todo + setmathdisplayprepenalty = false, -- todo + setmathignore = false, -- todo + setmathoptions = false, -- todo + setmathpostpenalty = false, -- todo + setmathprepenalty = false, -- todo + setmathspacing = false, -- todo + } + + local s = setsyntaxfromresult(result.mathparameter) + + s.copymathatomrule = sequence(s_integer,s_integer) + s.copymathparent = sequence(s_integer,s_integer) + s.copymathspacing = sequence(s_integer,s_integer) + s.letmathatomrule = sequence(s_integer,s_integer,s_integer,s_integer,s_integer) + s.letmathparent = sequence(s_integer,s_integer) + s.letmathspacing = sequence(s_integer,s_integer,s_integer,s_integer,s_integer) + s.resetmathspacing = false + s.setdefaultmathcodes = false + s.setmathatomrule = sequence(s_integer,s_integer,s_mathstyle,s_integer,s_integer) + s.setmathdisplaypostpenalty = sequence(s_integer,o_equal,s_integer) + s.setmathdisplayprepenalty = sequence(s_integer,o_equal,s_integer) + s.setmathignore = sequence(s_mathparameter,s_integer) + s.setmathoptions = sequence(s_integer,o_equal,s_integer) + s.setmathpostpenalty = sequence(s_integer,o_equal,s_integer) + s.setmathprepenalty = sequence(s_integer,o_equal,s_integer) + s.setmathspacing = sequence(s_integer,s_integer,s_mathstyle,s_glue) + + syntax.mathparameter = s + +end + +do + + result.pageproperty = newresult { + deadcycles = r_integer, + insertdepth = { s_integer, s_dimension }, + insertdistance = { s_integer, s_dimension }, + insertheight = { s_integer, s_dimension }, + insertheights = r_dimension, + insertlimit = { s_integer, s_dimension }, + insertmaxdepth = { s_integer, s_dimension }, + insertmultiplier = { s_integer, s_integer }, + insertpenalties = r_integer, + insertpenalty = { s_integer, s_integer }, + insertstorage = { s_integer, s_integer }, + insertstoring = r_integer, + insertwidth = { s_integer, s_dimension }, + pagedepth = r_dimension, + pageexcess = r_dimension, + pagefilllstretch = r_dimension, + pagefillstretch = r_dimension, + pagefilstretch = r_dimension, + pagefistretch = r_dimension, + pagegoal = r_dimension, + pagelastdepth = r_dimension, + pagelastfilllstretch = r_dimension, + pagelastfillstretch = r_dimension, + pagelastfilstretch = r_dimension, + pagelastheight = r_dimension, + pagelastshrink = r_dimension, + pagelaststretch = r_dimension, + pageshrink = r_dimension, + pagestretch = r_dimension, + pagetotal = r_dimension, + pagevsize = r_dimension, + } + + syntax.pageproperty = setsyntaxfromresult(result.pageproperty) + +end + +syntax.specification = newsyntax { + clubpenalties = sequence(optional(keyword("options"),s_integer),s_integer,repeated(s_integer)), + displaywidowpenalties = sequence(optional(keyword("options"),s_integer),s_integer,repeated(s_integer)), + interlinepenalties = sequence(optional(keyword("options"),s_integer),s_integer,repeated(s_integer)), + mathbackwardpenalties = sequence(optional(keyword("options"),s_integer),s_integer,repeated(s_integer)), + mathforwardpenalties = sequence(optional(keyword("options"),s_integer),s_integer,repeated(s_integer)), + orphanpenalties = sequence(optional(keyword("options"),s_integer),s_integer,repeated(s_integer)), + parpasses = sequence( + optional(keyword("options"),s_integer), + repeated( + optional(sequence(keyword("adjdemerits"),s_integer)), + optional(sequence(keyword("adjustspacing"),s_integer)), + optional(sequence(keyword("adjustspacingstep"),s_integer)), + optional(sequence(keyword("adjustspacingshrink"),s_integer)), + optional(sequence(keyword("adjustspacingstretch"),s_integer)), + optional(sequence(keyword("badness"),s_integer)), + optional(sequence(keyword("classes"),s_integer)), + optional(sequence(keyword("callback"),s_integer)), + optional(sequence(keyword("doubleadjdemerits"),s_integer)), + optional(sequence(keyword("doublehyphendemerits"),s_integer)), + optional(sequence(keyword("emergencystretch"),s_dimension)), + optional(sequence(keyword("extrahyphenpenalty"),s_integer)), + optional(sequence(keyword("finalhyphendemerits"),s_integer)), + optional(sequence(keyword("identifier"),s_integer)), + optional(sequence(keyword("ifadjustspacing"),s_integer)), + optional(sequence(keyword("looseness"),s_integer)), + optional(sequence(keyword("linebreakcriterium"),s_integer)), + optional(sequence(keyword("linebreakoptional"),s_integer)), + optional(sequence(keyword("linepenalty"),s_integer)), + optional(keyword("next")), + optional(sequence(keyword("orphanpenalty"),s_integer)), + optional(keyword("quit")), + optional(keyword("skip")), + optional(sequence(keyword("threshold"),s_dimension)), + optional(sequence(keyword("tolerance"),s_integer)) + ) + ), + parshape = sequence(optional(keyword("options"),s_integer),s_integer,repeated(sequence(s_dimension,s_dimension))), + widowpenalties = sequence(optional(keyword("options"),s_integer),s_integer,repeated(s_integer)), +} + +result.specification = setdefaultresult(syntax.specification, r_integer) + +syntax.shorthanddef = newsyntax { + Umathchardef = sequence(s_cs,s_integer), + Umathdictdef = sequence(s_cs,s_integer,s_integer), + attributedef = sequence(s_cs,s_integer), + chardef = sequence(s_cs,s_integer), + countdef = sequence(s_cs,s_integer), + dimendef = sequence(s_cs,s_integer), + dimensiondef = sequence(s_cs,s_integer), + floatdef = sequence(s_cs,s_integer), + fontspecdef = sequence(s_cs,s_font), + gluespecdef = sequence(s_cs,s_integer), + integerdef = sequence(s_cs,s_integer), + luadef = sequence(s_cs,s_integer), + mathchardef = sequence(s_cs,s_integer), + mugluespecdef = sequence(s_cs,s_integer), + muskipdef = sequence(s_cs,s_integer), + parameterdef = sequence(s_cs,s_integer), + positdef = sequence(s_cs,s_integer), + skipdef = sequence(s_cs,s_integer), + toksdef = sequence(s_cs,s_integer), +} + +result.someitem = newresult { + mathcharclass = { s_integer, s_integer }, + mathcharfam = { s_integer, s_integer }, + mathcharslot = { s_integer, s_integer }, + badness = { "", s_integer }, + currentgrouplevel = { "", s_integer }, + currentgrouptype = { "", s_integer }, + currentifbranch = { "", s_integer }, + currentiflevel = { "", s_integer }, + currentiftype = { "", s_integer }, + currentloopiterator = { "", s_integer }, + currentloopnesting = { "", s_integer }, + currentstacksize = { "", s_integer }, + dimexpr = { s_expression, s_dimension }, + dimexpression = { s_expression, s_dimension }, + floatexpr = { s_expression, s_float }, + fontcharba = { s_fontchar, s_dimension }, + fontchardp = { s_fontchar, s_dimension }, + fontcharht = { s_fontchar, s_dimension }, + fontcharic = { s_fontchar, s_dimension }, + fontcharta = { s_fontchar, s_dimension }, + fontcharwd = { s_fontchar, s_dimension }, + fontid = { s_font, s_integer }, + fontmathcontrol = { s_font, s_integer }, + fontspecid = { s_font, s_integer }, + fontspecifiedsize = { s_font, s_integer }, + fontspecscale = { s_font, s_integer }, + fontspecslant = { s_font, s_integer }, + fontspecxscale = { s_font, s_integer }, + fontspecyscale = { s_font, s_integer }, + fontspecweight = { s_font, s_integer }, + fonttextcontrol = { s_font, s_integer }, + glueexpr = { s_expression, s_glue }, + glueshrink = { s_glue, s_dimension }, + glueshrinkorder = { s_glue, s_dimension }, + gluestretch = { s_glue, s_integer}, + gluestretchorder = { s_glue, s_integer}, + gluetomu = { s_glue, s_glue }, + glyphxscaled = { "", s_integer }, + glyphyscaled = { "", s_integer }, + indexofcharacter = { s_integer, s_integer }, + indexofregister = { s_integer, s_integer }, + inputlineno = { "",s_integer }, + insertprogress = { s_integer, s_dimension },-- check + lastarguments = { "", s_integer }, + lastatomclass = { "", s_integer }, + lastboundary = { "", s_integer }, + lastchkdimension = { "", s_dimension }, + lastchknumber = { "", s_integer }, + lastkern = { "", s_dimension }, + lastleftclass = { "", s_integer }, + lastloopiterator = { "", s_integer }, + lastnodesubtype = { "", s_integer }, + lastnodetype = { "", s_integer }, + lastpageextra = { "", s_dimension }, + lastparcontext = { "", s_integer }, + lastpenalty = { "", s_integer }, + lastrightclass = { "", s_integer }, + lastskip = { "", s_glue }, + leftmarginkern = { "", s_dimension }, -- check + luatexrevision = { "", s_tokens }, + luatexversion = { "", s_tokens }, + mathatomglue = { "", s_glue }, + mathmainstyle = { "", s_integer }, + mathscale = { "", s_integer }, + mathstackstyle = { "", s_integer }, + mathstyle = { "", s_integer }, + mathstylefontid = { "", s_integer }, + muexpr = { s_expression, s_muglue }, + mutoglue = { s_muglue, s_glue }, + nestedloopiterator = { "", s_integer }, + numericscale = { s_number, s_integer }, + numericscaled = { s_number, s_integer }, + numexpr = { s_expression, s_integer }, + numexpression = { s_expression, s_integer }, + overshoot = { "", s_dimension }, + parametercount = { "", s_integer }, + parameterindex = { "", s_integer }, + parshapedimen = { s_integer, s_dimension }, + parshapeindent = { s_integer, s_dimension }, + parshapelength = { "", s_dimension }, + previousloopiterator = { "", s_integer }, + rightmarginkern = { "", s_dimension }, -- check + scaledemwidth = { s_font, s_dimension }, + scaledexheight = { s_font, s_dimension }, + scaledextraspace = { s_font, s_dimension }, + scaledfontcharba = { s_fontchar, s_dimension }, + scaledfontchardp = { s_fontchar, s_dimension }, + scaledfontcharht = { s_fontchar, s_dimension }, + scaledfontcharic = { s_fontchar, s_dimension }, + scaledfontcharta = { s_fontchar, s_dimension }, + scaledfontcharwd = { s_fontchar, s_dimension }, + scaledinterwordshrink = { s_font, s_dimension }, + scaledinterwordspace = { s_font, s_dimension }, + scaledinterwordstretch = { s_font, s_dimension }, + scaledmathaxis = { s_mathstyle, s_dimension }, + scaledmathemwidth = { s_mathstyle, s_dimension }, + scaledmathexheight = { s_mathstyle, s_dimension }, + scaledslantperpoint = { s_font, s_dimension }, +} + +syntax.someitem = setsyntaxfromresult(result.someitem) + +syntax.the = newsyntax { + detokenize = s_tokens, + expandeddetokenize = s_tokens, + protecteddetokenize = s_tokens, + protectedexpandeddetokenize = s_tokens, + the = s_dimension, + thewithoutunit = s_quantity, + unexpanded = s_tokens, +} + +syntax.unhbox = newsyntax { + unhbox = s_integer, + unhcopy = s_integer, + unhpack = s_integer, +} + +syntax.unvbox = newsyntax { + insertunbox = s_integer, + insertuncopy = s_integer, + pagediscards = false, + splitdiscards = false, + unvbox = s_integer, + unvcopy = s_integer, + unvpack = s_integer, +} + +syntax.vadjust = newsyntax { + vadjust = sequence( + optional(keyword("pre")), + optional(keyword("post")), + optional(keyword("baseline")), + optional(keyword("before")), + optional(sequence(keyword("index"),s_integer)), + optional(keyword("after")), + optional(sequence(keyword("attr"),s_integer,s_integer)), + optional(sequence(keyword("depth"),choice(keyword("after"),keyword("before"),keyword("check"),keyword("last")))), + s_tokens + ) +} + +syntax.valign = newsyntax { + valign = syntax.halign.halign +} + +syntax.vcenter = newsyntax { + vcenter = syntax.makebox.dbox +} + +syntax.vmove = newsyntax { + raise = syntax.hmove.moveleft, + lower = syntax.hmove.moveright, +} + +syntax.vrule = newsyntax { + novrule = syntax.hrule.hrule, + srule = syntax.hrule.hrule, + virtualvrule = syntax.hrule.virtualhrule, + vrule = syntax.hrule.hrule, +} + +syntax.vskip = newsyntax { + vfil = false, + vfill = false, + vfilneg = false, + vskip = syntax.hskip.hskip, + vss = false, +} + +syntax.xray = newsyntax { + show = s_token, + showbox = s_boxreference, + showgroups = false, + showifs = false, + showlists = false, + showstack = false, + showthe = s_quantity, + showtokens = s_tokens, +} + +-- so far + +local striplines = utilities.strings.striplines + +for cmd, chrs in next, syntax do + for chr, str in next, chrs do + if not str then + chrs[chr] = "" + elseif str ~= "" then + chrs[chr] = striplines(str,"prune and to space") + end + end +end + +for cmd, chrs in next, result do + for chr, str in next, chrs do + if str then + local s1 = str[1] + local s2 = str[2] + if not s1 then + str[1] = "" + elseif s1 ~= "" then + str[1] = striplines(s1,"prune and to space") + end + if not s2 then + str[2] = "" + elseif s2 ~= "" then + str[2] = striplines(s2,"prune and to space") + end + end + end +end + +-- end of syntax specification + +do + + local P = lpeg.P + local R = lpeg.R + local Cmt = lpeg.Cmt + + local space = lpeg.patterns.whitespace + local unspace = lpeg.patterns.whitespace^0 + local word = R("az","AZ")^1 + local utfchar = lpeg.patterns.utf8character + + local p_enhance = ( + P("[") * unspace / "" / context.SyntaxLeftBracket + + unspace * P("]") / "" / context.SyntaxRightBracket + + P("{") * unspace / "" / context.SyntaxLeftBrace + + unspace * P("}") / "" / context.SyntaxRightBrace + + P("(") * unspace / "" / context.SyntaxLeftParenthesis + + unspace * P(")") / "" / context.SyntaxRightParenthesis + + unspace * P("|") * unspace / "" / context.SyntaxBar + + P("character") / context.SyntaxCharacter + + P("token") / context.SyntaxToken + + P("tokens") / context.SyntaxTokens + + P("integer") / context.SyntaxInteger + + P("quantity") / context.SyntaxQuantity + + P("preamble") / context.SyntaxPreamble + + P("dimension") / context.SyntaxDimension + + P("glue") / context.SyntaxGlue + + P("muglue") / context.SyntaxMuglue + + P("float") / context.SyntaxFloat + + P("font") / context.SyntaxFont + + P("mathstyle") / context.SyntaxMathstyle + + P("tokenlist") / context.SyntaxTokenlist + + P("box") / context.SyntaxBox + + P("rule") / context.SyntaxRule + + P("toks") / context.SyntaxToks + + P("float") / context.SyntaxFloat + + P("cs") / context.SyntaxCs + + P("conditional") / context.SyntaxConditional + + P("\\") * (word / context.tex) + + space^1 / context.space + + utfchar / context.type + + )^1 + + local compact = false + local compact = true + + local cmd = setmetatableindex("table") + local lst = { } + local cat = { } + local org = { } + + for i=1,#primitives do + local l = primitives[i] + local n = gsub(commandnames[l[1]],"_","") + local p = l[3] + local t = { + syntax[n][p] or false, + result[n][p] or false, + } + cmd[n][p] = t + lst[p] = t + cat[p] = category[n] + org[p] = l[4] + end + local tag = { } + for k, v in next, origins do + tag[k] = sub(v,1,1) + end + + moduledata.engine.data = { + cmd = cmd, + lst = lst, + org = org, + cat = cat, + } + + local function specification(k,v,done) + local s = v[1] + local r = v[2] + local d = done[s] + context.formatted.startPrimitive("%s \\tex{%s}",tag[commandhash[k][4]],k) + if s and s ~= "" then + if d then + context(" see \\tex{%s}",done[s]) + r = false + else + lpegmatch(p_enhance,s) + if compact and count(s," ") > 2 then + done[s] = k + end + end + else + context.allowbreak(false) + end + if r and r ~= "" then + if s and s ~= "" then + context["break"](false) + end + context.strut() + if r[1] and r[1] ~= "" then + context.llap("> ") + lpegmatch(p_enhance,r[1]) + context(" : ") + else + context.llap(": ") + end + lpegmatch(p_enhance,r[2]) + else + context.allowbreak(false) + end + context.stopPrimitive() + end + + function moduledata.engine.specification(k) + local v = lst[k] + if v then + context.startpacked() + specification(k,v,{}) + context.stoppacked() + else + print("no command " .. k) + end + end + + function moduledata.engine.allspecifications() + for k, v in sortedhash(cmd) do + local done = { } + context.startSyntax { title = k } + for k, v in sortedhash(v) do + specification(k,v,done) + end + context.stopSyntax() + + table.save("s-system-syntax-check.lua",{ + syntax = syntax, + result = result, + keywords = keywords, + compares = compares, + }) + + end + end + +end + +do + + function moduledata.engine.codes(name) + local t = type(name) == "table" and name or tex[name] + if t then + local l = { } + for k, v in table.sortedhash(t) do + if tonumber(k) then + l[#l+1] = k + end + end + local m = l[#l] + local f = (m > 0xFFFF and "0x%08X") or (m > 0x00FF and "0x%04X") or "0x%02X" + context.starttabulate { "|lT|l|" } + for i=1,#l do + local li = l[i] + context.NC() + context(f,li) + context.NC() + context(t[li]) + context.NC() + context.NR() + end + context.stoptabulate() + end + end + +end diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.mkxl new file mode 100644 index 00000000000..7d1a4aecf30 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-system-syntax.mkxl @@ -0,0 +1,293 @@ +%D \module +%D [ file=s-system-syntax, +%D version=2023.8.18, +%D title=\CONTEXT\ Style File, +%D subtitle=\LUAMETATEX\ Syntax, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% \futureexpandis +% \futureexpandisap + +\registerctxluafile{s-system-syntax}{} + +\definehead + [Syntax] + [subsubsubsection] + [style=\tta\bf, + numberwidth=2fs, + after=\blank\startpacked, + aftersection=\stoppacked] + +\definenarrower[Arguments][left=4fs] + +\definedescription + [Primitive] + [headstyle=\ttbf, + width=fit, + alternative=top, + align={broad,flushleft,verytolerant}, + inbetween=\startnarrower[2*left], + after=\stopnarrower] + +\definestartstop [SyntaxToken] [style=\ttsl] +\definestartstop [SyntaxTokens] [style=\ttsl] +\definestartstop [SyntaxInteger] [style=\ttsl] +\definestartstop [SyntaxDimension] [style=\ttsl] +\definestartstop [SyntaxGlue] [style=\ttsl] +\definestartstop [SyntaxMuglue] [style=\ttsl] +\definestartstop [SyntaxFloat] [style=\ttsl] +\definestartstop [SyntaxQuantity] [style=\ttsl] +\definestartstop [SyntaxPreamble] [style=\ttsl] +\definestartstop [SyntaxCharacter] [style=\ttsl] +\definestartstop [SyntaxChar] [style=\ttsl] +\definestartstop [SyntaxFont] [style=\ttsl] +\definestartstop [SyntaxMathstyle] [style=\ttsl] +\definestartstop [SyntaxTokenlist] [style=\ttsl] +\definestartstop [SyntaxCs] [style=\tt,left=\texescape] +\definestartstop [SyntaxBox] [style=\ttsl] +\definestartstop [SyntaxRule] [style=\ttsl] +\definestartstop [SyntaxToks] [style=\ttsl] +\definestartstop [SyntaxConditional] [style=\tt] + +\protected\def\SyntaxGlyph#1{{\ttbf\glyph raise -.25ex yscale 1440 #1}} + +\protected\def\SyntaxLeftBracket {\SyntaxGlyph\leftbracketasciicode\thinspace} +\protected\def\SyntaxLeftBrace {\SyntaxGlyph\leftbraceasciicode\thinspace} +\protected\def\SyntaxLeftParenthesis {\SyntaxGlyph\leftparentasciicode\thinspace} +\protected\def\SyntaxRightBracket {\thinspace\SyntaxGlyph\rightbracketasciicode} +\protected\def\SyntaxRightBrace {\thinspace\SyntaxGlyph\rightbraceasciicode} +\protected\def\SyntaxRightParenthesis {\thinspace\SyntaxGlyph\rightparentasciicode} +\protected\def\SyntaxBar {\thinspace\SyntaxGlyph\barasciicode\thinspace} + +\startbuffer[engine:syntax:preambleparameters] +\starttabulate[|c|||] +\NC \type{#n} \NC parameter \NC index \type{1} upto \type{E} \NC \NR +\TB +\NC \type{#0} \NC throw away parameter \NC increment index \NC \NR +\NC \type{#-} \NC ignore parameter \NC keep index \NC \NR +\TB +\NC \type{#*} \NC gobble white space \NC \NC \NR +\NC \type{#+} \NC keep (honor) the braces \NC \NC \NR +\NC \type{#.} \NC ignore pars and spaces \NC \NC \NR +\NC \type{#,} \NC push back space when no match \NC \NC \NR +\NC \type{#/} \NC remove leading and trailing spaces and pars \NC \NC \NR +\NC \type{#=} \NC braces are mandate \NC \NC \NR +\NC \type{#^} \NC keep leading spaces \NC \NC \NR +\NC \type{#_} \NC braces are mandate and kept (obey) \NC \NC \NR +\TB +\NC \type{#@} \NC par delimiter \NC only for internal usage \NC \NR +\TB +\NC \type{#:} \NC pick up scanning here \NC \NC \NR +\NC \type{#;} \NC quit scanning \NC \NC \NR +\TB +\NC \type{#L} \NC left delimiter token \NC followed by token \NC \NR +\NC \type{#R} \NC right delimiter token \NC followed by token \NC \NR +\TB +\NC \type{#G} \NC gobble token \NC followed by token \NC \NR +\NC \type{#M} \NC gobble token and spaces \NC followed by token \NC \NR +\TB +\NC \type{#S} \NC nest square brackets \NC only inner pairs \NC \NR +\NC \type{#X} \NC nest angle brackets \NC only inner pairs \NC \NR +\NC \type{#P} \NC nest parentheses \NC only inner pairs \NC \NR +\stoptabulate +\stopbuffer + +\startbuffer[engine:syntax:bodyparameters] +\starttabulate[|l|||] +\NC \type{#n} \NC parameter \NC index \type{1} upto \type{E} in macro body \NC \NR +\TB +\NC \type{#I} \NC current iterator \NC \type {\currentloopiterator} \NC \NR +\NC \type{#P} \NC parent iterator \NC \type {\previousloopiterator 1} \NC \NR +\NC \type{#G} \NC grandparent iterator \NC \type {\previousloopiterator 2} \NC \NR +\TB +\NC \type{#H} \NC hash escape \NC \type {#} \NC \NR +\NC \type{#S} \NC space escape \NC \ruledhbox to \interwordspace{\novrule height .8\strutht} \NC \NR +\NC \type{#T} \NC tab escape \NC \type {\t} \NC \NR +\NC \type{#L} \NC newline escape \NC \type {\n} \NC \NR +\NC \type{#R} \NC return escape \NC \type {\r} \NC \NR +\NC \type{#X} \NC backslash escape \NC \tex {} \NC \NR +\TB +\NC \type{#N} \NC nbsp \NC \type {U+00A0} (under consideration) \NC \NR +%NC \type{#Z} \NC zwj \NC \type {U+200B} (under consideration) \NC \NR +%NC \type{#-} \NC zwnj \NC \type {U+200C} (under consideration) \NC \NR +%NC \type{#+} \NC zwj \NC \type {U+200D} (under consideration) \NC \NR +%NC \type{#>} \NC l2r \NC \type {U+200E} (under consideration) \NC \NR +%NC \type{#<} \NC r2l \NC \type {U+200F} (under consideration) \NC \NR +%NC \type{#U} \NC unicode \NC \type {XXXXXX} (under consideration) \NC \NR +\stoptabulate +\stopbuffer + +\startbuffer[engine:syntax:glyphoptions] + \ctxlua{moduledata.engine.codes("glyphoptioncodes")} +\stopbuffer + +\startbuffer[engine:syntax:mathoptions] + \ctxlua{moduledata.engine.codes("mathoptioncodes")} +\stopbuffer + +\startbuffer[engine:syntax:mathcontrolcodes] + \ctxlua{moduledata.engine.codes("mathcontrolcodes")} +\stopbuffer + +\startbuffer[engine:syntax:classoptioncodes] + \ctxlua{moduledata.engine.codes("classoptioncodes")} +\stopbuffer + +\startbuffer[engine:syntax:partriggercodes] + \ctxlua{moduledata.engine.codes("partriggercodes")} +\stopbuffer + +\startbuffer[engine:syntax:parcontextcodes] + \ctxlua{moduledata.engine.codes("parcontextcodes")} +\stopbuffer + +\startbuffer[engine:syntax:frozenparcodes] + \ctxlua{moduledata.engine.codes("frozenparcodes")} +\stopbuffer + +\startbuffer[engine:syntax:frozenparcodes] + \ctxlua{moduledata.engine.codes("frozenparcodes")} +\stopbuffer + +\startbuffer[engine:syntax:normalizelinecodes] + \ctxlua{moduledata.engine.codes("normalizelinecodes")} +\stopbuffer + +\startbuffer[engine:syntax:normalizeparcodes] + \ctxlua{moduledata.engine.codes("normalizeparcodes")} +\stopbuffer + +\startbuffer[engine:syntax:listgeometrycodes] + \ctxlua{moduledata.engine.codes("listgeometrycodes")} +\stopbuffer + +\startbuffer[engine:syntax:protrusionboundarycodes] + \ctxlua{moduledata.engine.codes("protrusionboundarycodes")} +\stopbuffer + +\startbuffer[engine:syntax:shapingpenaltiescodes] + \ctxlua{moduledata.engine.codes("shapingpenaltiescodes")} +\stopbuffer + +\startbuffer[engine:syntax:automigrationcodes] + \ctxlua{moduledata.engine.codes("automigrationcodes")} +\stopbuffer + +\startbuffer[engine:syntax:autoparagraphcodes] + \ctxlua{moduledata.engine.codes("autoparagraphcodes")} +\stopbuffer + +\startbuffer[engine:syntax:textcontrolcodes] + \ctxlua{moduledata.engine.codes(tex.gettextcontrolvalues())} +\stopbuffer + +\startbuffer[engine:syntax:discoptioncodes] + \ctxlua{moduledata.engine.codes("discoptioncodes")} +\stopbuffer + +\startbuffer[engine:syntax:mathgluecodes] + \ctxlua{moduledata.engine.codes(tex.getmathgluevalues())} +\stopbuffer + +\continueifinputfile{s-system-syntax.mkxl} + +\usemodule[abbreviations-logos] +\usemodule[system-tokens] + +\setupbodyfont + [dejavu,10pt] + +\setuplayout + [tight] + +\starttext + +\starttitle[title=Primitives] + +This is a preliminary overview of the \LUAMETATEX\ primitives. The presentation +is mostly for myself and kind of informal. The primitives are describes in more +detail in the (yet incomplete) \quote {primitives} manual. + +\vkern\lineheight % bah, I need to fix this : \pagediscards + +\startpagecolumns[page=no] + \startluacode + moduledata.engine.allspecifications() + \stopluacode +\stoppagecolumns + +\stoptitle + +\starttitle[title=Registers] + +Currently we have these upper bounds for the register but they can be lowered +because we don't need that many. + +\starttabulate[||||] +\NC count \NC integer \NC \cldcontext{tex.magicconstants.max_integer_register_index} \NC \NR +\NC dimen \NC dimension \NC \cldcontext{tex.magicconstants.max_dimension_register_index} \NC \NR +\NC skip \NC glue \NC \cldcontext{tex.magicconstants.max_glue_register_index} \NC \NR +\NC muskip \NC glue \NC \cldcontext{tex.magicconstants.max_muglue_register_index} \NC \NR +\NC attribute \NC integer \NC \cldcontext{tex.magicconstants.max_attribute_register_index} \NC \NR +\NC toks \NC tokenlist \NC \cldcontext{tex.magicconstants.max_toks_register_index} \NC \NR +\NC box \NC box \NC \cldcontext{tex.magicconstants.max_box_register_index} \NC \NR +\NC float \NC posit \NC \cldcontext{tex.magicconstants.max_float_register_index} \NC \NR +\stoptabulate + +\stoptitle + +\starttitle[title=Preamble and escapes] + +These parameter specifiers can end up in preambles: + +\getbuffer[engine:syntax:preambleparameters] + +These parameter escapes can end up in bodies and text: + +\getbuffer[engine:syntax:bodyparameters] + +\stoptitle + +\starttitle[title=Comparing values] + +The following tokens can be used in a comparison: + +\startluacode + context.starttabulate { "|c||" } + for k, v in table.sortedhash(moduledata.engine.compares) do + context.NC() context.formatted.type("%C",k) context.NC() context(v) context.NC() context.NR() + end + context.stoptabulate() +\stopluacode + +\stoptitle + +% test: + +% \def \foo{test#Itest} \writestatus{I}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Ptest} \writestatus{P}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Gtest} \writestatus{G}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Htest} \writestatus{H}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Stest} \writestatus{S}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Ttest} \writestatus{T}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Ltest} \writestatus{L}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Rtest} \writestatus{R}{\foo} \meaning \foo \par \showluatokens\foo +% \def \foo{test#Xtest} \writestatus{X}{\foo} \meaning \foo \par \showluatokens\foo + +% \edef\foo{test#Itest} \writestatus{I}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Ptest} \writestatus{P}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Gtest} \writestatus{G}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Htest} \writestatus{H}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Stest} \writestatus{S}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Ttest} \writestatus{T}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Ltest} \writestatus{L}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Rtest} \writestatus{R}{\foo} \meaning \foo \par \showluatokens\foo +% \edef\foo{test#Xtest} \writestatus{X}{\foo} \meaning \foo \par \showluatokens\foo + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-system-tokens.lmt b/Master/texmf-dist/tex/context/modules/mkxl/s-system-tokens.lmt index c19f6699eff..43c22878839 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/s-system-tokens.lmt +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-system-tokens.lmt @@ -34,16 +34,20 @@ function moduledata.system.tokens.collect() local primitives = tex.primitives() collected = { } - for i=0,#allcommands do - local codes = { } - local kind, min, max, fixedvalue = getrange(i) - if min and whatever[kind] and max >= 0 and max <= 256 then - for i=min,max do - codes[i] = false - end + -- 0 and 110 missing + + for k, v in table.sortedhash(allcommands) do + if type(k) == "number" then + local codes = { } + local kind, min, max, fixedvalue = getrange(k) + if min and whatever[kind] and max >= 0 and max <= 256 then + for i=min,max do + codes[i] = false + end + end + collected[k] = codes + collected[v] = codes end - collected[i] = codes - collected[allcommands[i]] = codes end for i=1,#primitives do diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-system-units.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-system-units.mkxl new file mode 100644 index 00000000000..3523aaabce7 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-system-units.mkxl @@ -0,0 +1,90 @@ +%D \module +%D [ file=s-system-units.mkxl, +%D version=2023.08.16, +%D title=\CONTEXT\ Style File, +%D subtitle=System Units, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% \definepalet +% [unitclasses] +% [1=darkred, % tex +% 2=darkblue, % pdftex +% 3=darkgreen, % luametatex +% 4=darkgray] % user + +\unprotect + +\newdimension \unitsmapwidth + +\permanent\tolerant\protected\def\showunitsmap[#1]% + {\vpack\bgroup \forgetall + \ttx \setupinterlinespace + \global\unitsmapwidth40\emwidth + \hpack to \unitsmapwidth\bgroup + \kern\emwidth + \localcontrolledloop\alowercaseasciicode\zlowercaseasciicode \plusone + {\hss\char\currentloopiterator\hss}% + \egroup + \ifcstok{#1}\v!tight\globaldonefalse\else\globaldonetrue\fi + \localcontrolledloop\alowercaseasciicode\zlowercaseasciicode\plusone + {\ifglobaldone\globalfoundtrue\else\globalfoundfalse\fi + \setbox\scratchbox\hpack to \unitsmapwidth\bgroup + \char\currentloopiterator + \bf + \hss + \localcontrolledloop\alowercaseasciicode\zlowercaseasciicode\plusone + {\scratchcounter\associateunit\numexpr + (\previousloopiterator\plusone-\alowercaseasciicode)*26+% + (\currentloopiterator -\alowercaseasciicode)% + \relax + \hss + \ifzeronum\scratchcounter + \kern\emwidth + \else + \begingroup + \ifcase\scratchcounter\or\darkred\or\darkblue\or\darkgreen\else\darkgray\fi + \char\previousloopiterator\plusone + \char\currentloopiterator + \endgroup + \globalfoundtrue + \fi + \hss}% + \egroup + \ifglobalfound + \box\scratchbox + \fi}% + \egroup} + +\permanent\protected\def\showunitsmaplegend + {\hpack\bgroup + \ttx\setstrut\white + \unitsmapwidth.25\unitsmapwidth + \backgroundline[darkred] {\strut\hbox to \unitsmapwidth{\hss tex\hss}}% + \backgroundline[darkblue] {\strut\hbox to \unitsmapwidth{\hss pdftex\hss}}% + \backgroundline[darkgreen]{\strut\hbox to \unitsmapwidth{\hss luametatex\hss}}% + \backgroundline[darkgray] {\strut\hbox to \unitsmapwidth{\hss context\hss}}% + \egroup} + +\protect + +\continueifinputfile{s-system-units.mkxl} + +\starttext + +\startTEXpage[offset=1ts] + \showunitsmap + \showunitsmaplegend +\stopTEXpage + +\startTEXpage[offset=1ts] + \showunitsmap[tight] + \showunitsmaplegend +\stopTEXpage + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-text-tests.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-text-tests.mkxl index 6766a7a0927..e21c3a5b3a3 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/s-text-tests.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-text-tests.mkxl @@ -15,6 +15,28 @@ %D Here we collect some tests that later will become proper macros. +\starttext + \setuppapersize[S4] + \showmakeup[line] + \def\Test#1{\start\setupheadertexts[\string#1]#1\samplefile{ward}\page\stop} + + \Test\notragged + \Test\raggedleft + \Test\raggedcenter + \Test\raggedright + \Test\veryraggedleft + \Test\veryraggedcenter + \Test\veryraggedright + \Test\raggedwidecenter + \Test\centeredlastline + \Test\flushedrightlastline + \Test\ttraggedright + \Test\forgetragged + \Test\raggedslanted +\stoptext + +% fonts + \usebodyfont[bonum] \usebodyfont[cambria] \usebodyfont[concrete] diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-columns.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-columns.mkxl new file mode 100644 index 00000000000..917d8a4e6c4 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-columns.mkxl @@ -0,0 +1,831 @@ +%D \module +%D [ file=s-tugboat-columns, +%D version=2023-08-10, +%D title=\CONTEXT\ Style File, +%D subtitle=\TUGBOAT\ base style, +%D author={Hans Hagen and others}, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] + +\startmodule[tugboat-columns] + +% \startmode[columns] +% \widowpenalty 0 +% \clubpenalty 0 +% % \hyphenpenalty 0 +% % \finalhyphendemerits 0 +% % \doublehyphendemerits0 +% \stopmode +% +% \startnotmode[columns] +% \widowpenalty 100000 +% \clubpenalty 100000 +% % \finalhyphendemerits 100000 +% % \doublehyphendemerits100000 +% \stopnotmode + +% \enablemode[columns] + +% \startsetups columns:figure:before +% \startlinecorrection[blank] +% \stopsetups +% +% \startsetups columns:figure:after +% \stoplinecorrection +% \stopsetups + +%D This file is derived t-tugboat by Aditya Mahajan which in turn is derived from +%D older files. As Mikael and I work on and experiment with math, par building, page +%D building, etc.\ we decided to look (again) into the \TUGBOAT\ style, also because +%D write articles for it. We use page columns because with a few tricks we don't +%D need to adapt the source too much; we prefer single columns and that shows. + +\enablemode[tugboat] + +%D Karl wants: + +\enabletrackers[builders.hpack.quality] +\enabletrackers[builders.hpack.collect] +\enabletrackers[builders.hpack.overflow] + +%D We store the information about the article in variables. We can pick up some from +%D \type {rugboat.dates} once I know which ones. + +\setvariables + [tugboat] + [type=article, + % + year=1900, + volume=0, + number=0, + page=1001, + % + title=ConTeXt style for TUGboat, + subtitle=, + keywords=, + author=T. Boat, + address={Harbour Master KB \\ Harbour St. 1 \\ 8061XX Hasselt NL}, + email={tugboat@tug.org}] + +%D \TUGBOAT\ uses slightly different interline space than the default. So we change +%D the interline space. Keep in mind that the engine does not really have a concept +%D of lines beyond baseline skip that interacts with the previous depth and current +%D height. There's a lot of attention to spacing in \CONTEXT\ so don't mess it up +%D with vertical skips and such, use \type {\blank} instead. + +\definebodyfontenvironment [8pt] [interlinespace=9.5pt, big=9pt, small=7pt] +\definebodyfontenvironment [9pt] [interlinespace=11pt, big=10pt, small=8pt] +\definebodyfontenvironment [10pt] [interlinespace=12pt, big=12pt, small=9pt] +\definebodyfontenvironment [12pt] [interlinespace=14pt, big=14.4pt,small=10pt] +\definebodyfontenvironment [14.4pt] [interlinespace=18pt, big=14.4pt,small=12pt] + +%D We use italic rather than slanted for emphasis. + +\setupbodyfontenvironment + [default] + [em=italic] + +%D \TUGBOAT\ uses Computer Modern fonts, and \CONTEXT\ uses Latin Modern by default. +%D So, we just specify the font size. + +\setupbodyfont + [10pt] + +%D We break after these chars in urls, not before. + +\sethyphenatedurlafter / +\sethyphenatedurlafter . +\sethyphenatedurlafter _ + +%D The layout is based on the letter paper format. This means that we get somewhat +%D wider columns than on A4, but we can't make the margins narrower, which would +%D ease some constraints. + +\setuppapersize + [letter] + [letter] + +\setuplayout + [topspace=3.8pc,% was 3.5pc + header=1pc, + headerdistance=1.5pc, + height=middle, + footerdistance=2pc, + footer=1pc, + bottomspace=3pc, + % + backspace=6pc, + width=middle, + cutspace=6pc, + % + margin=4pc, + margindistance=1pc] + +%D We have several column mechanisms and they all serve a different purpose. Here we +%D use pagecolumns. They support much of what we can do in single columns, but of +%D course there are exceptions. Floats can go into columns of aremoved to the top or +%D bottom when there is no room. We don't span mid column. Notes can go in columns +%D or at the end. We can start with a single column (for titles and such). +%D +%D This mechanism will be improved over time in sync with additional features in the +%D \LUAMETATEX\ engine. This means that older documents might render differently +%D (hopefully better). It is no problem to use more than two columns but this is +%D what \TUGBOAT\ needs: + +\setuppagecolumns + [n=2, + distance=1.5pc] + +\setuppagenumbering + [location=, + alternative=doublesided] + +%D In \TUGBOAT\ different articles are glued together to form the final journal, so +%D we do not want each article to occupy even number of pages. + +%D TODO: this needs checking with page columns: + +\installpagebreakhandler {last} {} + +%D We use automatic indentation control, that is: no indentation after titles and +%D skips. Normally we dont'use indentation in \CONTEXT\ articles but prefer +%D whitespace. Quite often we have short sentences and indentation just looks bad +%D on successive ones. + +\setupindenting + [20pt,yes] + +%D We do not usually want indentation after lists. + +\setupenumerations [indentnext=no] +\setupdescriptions [indentnext=no] + +%D And these. We typeset itemizations ragged right. + +\setupitemgroup + [itemize] + [indentnext=no, + align=right] + +%D We align them at the paragraph indentation and pack them by default. + +\setupitemgroup + [itemize] + [each] + [margin=1pc, + width=1em, + distance=0pt] + +\setupitemgroup + [itemize] + [1] + [packed] + +%D This a good opportunity to play with the additional passes in the par builder. +%D The following values are experimental + +% \setupalign +% [tolerant] + +\startsetups align:pass:quality:1 +\parpasses 6 + classes \indecentparpassclasses + threshold 0.025pt + tolerance 250 + extrahyphenpenalty 50 + orphanpenalty 5000 + % font driven + next ifadjustspacing + threshold 0.025pt + classes \tightparpassclasses + tolerance 300 + adjustspacing 3 + orphanpenalty 5000 + next ifadjustspacing + threshold 0.025pt + tolerance 350 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + orphanpenalty 5000 + emergencystretch .25\bodyfontsize + % otherwise, factors 1000 + next + threshold 0.025pt + classes \tightparpassclasses + tolerance 300 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 10 + adjustspacingstretch 15 + orphanpenalty 5000 + next + threshold 0.025pt + tolerance 350 + adjustspacing 3 + adjustspacingstep 1 + adjustspacingshrink 20 + adjustspacingstretch 40 + orphanpenalty 5000 + emergencystretch .25\bodyfontsize + % whatever + next + threshold 0.025pt + tolerance 3000 + orphanpenalty 5000 + emergencystretch .25\bodyfontsize +\relax\stopsetups + +\setupalignpass[quality:1] + +%D We don't want this ugly extreme stretching between elements when we end a page +%D and package it. + +\setuplayout + [limitstretch=yes] + +\setuplayout + [vz=2] + +\setupalign + [depth] + +%D The question is: do we prefer a \CONTEXT\ look and feel or go for the more \LATEX +%D ish one used in \TUGBOAT. Because no grid typesetting is expected we suppose that +%D it doesn't matter much. We also definitely will use properly spaced tables, so +%D we're already different. + +\definevspacingamount[tugbeforesection] [8pt plus 1pt minus 1pt][\lineheight] +\definevspacingamount[tugaftersection] [4pt plus 1pt minus 1pt][.5\lineheight] + +\setuphead + [section,subsection,subsubsection, + subject,subsubject,subsubsubject] + [style=bold, + align=right, + before={\blank[tugbeforesection]}, + after={\blank[tugaftersection]}] + +%D We define a logical skip. This is equal to the \type {topsep} in the normal style, +%D and most environments should have this skip. + +\definevspacingamount[tugsmallamount] [3pt plus 1pt minus 1pt][.5\lineheight] +\definevspacingamount[tugmediumamount][9pt plus 3pt minus 3pt][.5\lineheight] +\definevspacingamount[tuglargeamount] [10pt plus 4pt minus 4pt][\lineheight] + +\defineblank[tugblank] [tugsmallamount] +\defineblank[tugsmall] [tugsmallamount] +\defineblank[tugmedium][tugmediumamount] +\defineblank[tuglarge] [tuglargeamount] +\defineblank[tughalf] [halfline] + +\setupblank + [tugblank] + +\setupitemize + [1] + [before={\blank[tugblank]}, + after={\blank[tugblank]}, + inbetween={\blank[tugblank]}] + +\setuplines + [before={\blank[tugblank]}, + after={\blank[tugblank]}, + inbetween={\blank[tugblank]}] + +%D Because we don't want to mess up originals too much we have a few hacks: + +\setuplinecorrection + [before={\blank[tugblank]}, + after={\blank[tugblank]}] + +%D \TUGBOAT\ uses a smaller font size for verbatim typesetting. + +%D TODO: tb uses 9pt for verbatim, which looks a bit funny and it messes up the spacing +%D but in lmtx we can actually play with \glyphxscale + +\definefontfile[modern-condensed][modern-condensed] + +\definetypeface + [narrowtt] [tt] + [mono] [modern-condensed] [default] [features=none] + +\definefont[TugBoatVerbatimFont][Mono*none sa .9] + +\setuptyping + [option=none, + align=hangright, + style=narrowtt, + before={\blank[tugblank]}, + after={\blank[tugblank]}] + +% An uglier variant: + +\startsetups[tugboat:verbatim:tight] + \setuptyping + [style=TugBoatVerbatimFont, + bodyfont=9pt, % hm + blank=halfline, + lines=hyphenated] +\stopsetups + +%D Do not colorize code. + +\setuptyping[LUA][option=] +\setuptyping[TEX][option=] +\setuptyping[MP] [option=] + + +% %D Tiny line numbers in numbered code (not text size) +% +% \setuplinenumbering[style=\tfxx] % \infofont would be really tiny +% +% %D \section{Figure captions} +% %D +% %D \TUGBOAT\ uses a smaller font size for captions, too; \type {\small} gives 8pt, +% %D and we want 9pt, so we have to manually fix the baselines. +% +% \setupcaptions +% [headstyle=\AcroFontBold, +% style={\AcroFont\advance\baselineskip by -1pt}, +% align=right] +% +% %D We like a colon after the caption label. +% +% \let\floatcaptionsuffix=: +% +% % Prefer floats in text. +% +% \setupfloat[figure][align=middle,default=here] +% \setupfloat[table] [align=middle,default=here] + + +%D Not entirely a la \TUGBOAT: + +\protected\def\MyFootNoteRule + {\hrule width 5pc height .4pt depth 0pt\relax \kern \strutdepth} + +\setupfootnotes +% [bodyfont=8pt, + [bodyfont=9pt, + location=columns, + rule=on, + rulecommand=\MyFootNoteRule] + +% \setupnotation +% [footnote] + +\setupnotations + [location=joinedup, + width=fit, + headstyle=normal, + distance=.5em] + +%D We define a standard description and enumeration environment. + +\definedescription + [description] + [location=hanging, + width=broad, + before={\blank[tugblank]}, + after={\blank[tugblank]}] + +\defineenumeration + [enumeration] + [location=hanging, + width=broad, + before={\blank[tugblank]}, + after={\blank[tugblank]}] + +%D We need to get rid of some structure in case we include something also used +%D otherwise. This assumes that we always start at the section level. + +\setuphead + [chapter] + [page=, + before=, + after=, + incrementnumber=no, + placehead=no] + +%D More or less like plain BibTeX + ltugboat. + +\setupbtx + [default:list:numbering] + [left={[}, + right={]}] + +\setupbtxlist + [default] + [width=2em, + style={\frenchspacing}, + align={raggedright,verystrict}] + +%D Instead of color, we use weighted gray scales (will become an option): + +\setupcolors + [conversion=always] + +%D English it is. + +\mainlanguage + [en] + +%D We define some logical skips + +\defineblank [tugbefore] [big] +\defineblank [tuginbetween][big] +\defineblank [tugafter] [tugbefore] + +%D Some real macros: + +\protected\def\StopAbstract + {} + +\protected\def\StartAbstract + {\dostartbuffer[abstract][StartAbstract][StopAbstract]} + +\startsetups tugboat:abstract:setup + + \setuptolerance % really? we need an example + [horizontal,tolerant] + + \setupnarrower + [before={\blank[tughalf]}, + after={\blank[tuglarge]}, + middle=4.875pc] + +\stopsetups + +%D Headers and footers are different for normal issues and proceedings. + +\startsetups tugboat:banner:text:article + +% {\sl TUGboat},\space +% Volume \getvariable{tugboat}{volume}\space +% (\getvariable{tugboat}{year}),\space +% No.\space\getvariable{tugboat}{number} + +\stopsetups + +\def\postissno{Proceedings of the \tubyear\ Annual Meeting} + +\startsetups tugboat:banner:text:proceedings + + \setups[tugboat:banner:text:article] + \thinspace\emdash\thinspace + \postissno + +\stopsetups + +\startsetups tugboat:banner:setup:article + + \setupheadertexts + [\setups{tugboat:banner:text:article}] + [pagenumber] + +% There are no footers in regular articles +% +% \setupfootertexts +% [][\getvariable{tugboat}{author}] +% [\getvariable{tugboat}{title}][] + +\stopsetups + +\startsetups tugboat:banner:setup:proceedings + + \setupheadertexts + [][\getvariable{tugboat}{title}] + [\getvariable{tugboat}{author}][] + + \setupfootertexts + [\setups{tugboat:banner:text:proceedings}] + [pagenumber] + +\stopsetups + +%D Article is default so, + +\setups[tugboat:banner:setup:article] + +%D It all starts here: + +\permanent\protected\def\StartArticle{\directsetup{tugboat:\getvariable{tugboat}{type}:start}} +\permanent\protected\def\StopArticle {\directsetup{tugboat:article:stop}} + +\startsetups tugboat:introduction:article + + \start + \enforced\protected\def\\{\unskip\space\&\space\ignorespaces} + \hbox{\indent\getvariable{tugboat}{author}}% really \indent here? + \par + \stop + +\stopsetups + +\startsetups tugboat:introduction:proceedings + + \blank[20pt] + + \start + \switchtobodyfont[12pt] + \enforced\protected\def\\{\unskip\space\&\space\ignorespaces} + \getvariable{tugboat}{author} + \par + \stop + + \start + \switchtobodyfont[9pt] + \enforced\protected\def\\{\unskip,\space\ignorespaces} + \getvariable{tugboat}{address} + \par + \start + \tt + \getvariable{tugboat}{email} + \stop + \par + \stop + +\stopsetups + +\startsetups tugboat:columns:presets + + % whatever + +\stopsetups + +\startsetups tugboat:article:start + + \starttext + + \setups{tugboat:columns:presets} + + \setups{tugboat:banner:setup:\getvariable{tugboat}{type}} + + \startpagecolumns + + \setupheadertexts + [\setups{tugboat:banner:text:article}] + [pagenumber] + + \setuppagenumber + [number=\getvariable{tugboat}{page}] + + % \snaptogrid \vbox \bgroup + \vbox \bgroup % \dbox ? + \forgetall + \hrule height .6pt + \blank[halfline] + \start + \enforced\let\\\par + \start + \bf + \getvariable{tugboat}{title} + \stop + \par + \blank[halfline] + \hskip20pt\getvariable{tugboat}{author} + \stop + + \doifelsebufferempty {abstract} { + % no abstract + } { + \blank[line] + + \enforced\let\\\endgraf + \setups[tugboat:abstract:setup] + \startsubject[title={Abstract}] + \getbuffer[abstract] + \stopsubject + } + \egroup + +\stopsetups + +\startsetups tugboat:proceedings:start + + \starttext + + \setups{tugboat:banner:setup:\getvariable{tugboat}{type}} + + \setupheader + [state=empty] + + \setuppagenumber + [number=\getvariable{tugboat}{page}] + + % \snaptogrid \vbox \bgroup + \vbox \bgroup % \dbox ? + + \forgetall + + \start + \switchtobodyfont[14.4pt] + \enforced\let\\\par + \getvariable{tugboat}{title} + \par + \stop + + \setups{tugboat:introduction:\getvariable{tugboat}{type}} + + \blank[tugmedium] + + \enforced\let\\\par + + \doifelsebufferempty {abstract} { + % no abstract + } { + \setups[tugboat:abstract:setup] + + \midaligned{\bf Abstract} + + \startnarrower[middle] + \getbuffer[abstract] + \stopnarrower + } + \egroup + + \startpagecolumns + +\stopsetups + +\def\signaturewidth{13pc} + +\startsetups tugboat:affiliation:article + + \blank[line] + + % \snaptogrid \vbox \bgroup + \vbox \bgroup % \dbox ? + + \forgetall + + \leftskip=\dimexpr\textwidth-\signaturewidth\relax + + \enforced\let\\\par + + \noindent\llap { + $\diamond$\enspace + } + \getvariable{tugboat}{author} + \par + + \getvariable{tugboat}{address} + \par + + {\tt\getvariable{tugboat}{email}} + + \egroup + +\stopsetups + +\startsetups tugboat:affiliation:proceedings + + % nothing fancy at the end + +\stopsetups + +\startsetups tugboat:article:stop + + \setups{tugboat:affiliation:\getvariable{tugboat}{type}} + + \blank[line] + + \startpacked + \placenotes[endnotes] + \stoppacked + + % Karl: what does \writelastpage do + + \ifdefined\writelastpage + \begingroup + \count0 = \realpageno % an integerdef + \writelastpage{+1}% + \endgroup + \fi + + \stoppagecolumns + + \page + + \stoptext + +\stopsetups + +%D Normal word spacing, really? + +\setuptolerance + [strict] + +%D Use this in documents: + +% \setuptolerance +% [verytolerant,stretch] + +%D Language stuff. + +\setuplanguage + [lefthyphenmin=2, + rightthyphenmin=3] + +%D A hack to read tugboat.dates settings. I need an example. + +\doifelsefileexists {../tugboat.dates} { + + \pushoverloadmode + + \newcount\issueseqno + \newif \ifPrelimDraft + + % \pushmacro\vol + % \pushmacro\issyear + + \def\vol #1, #2.{\xdef\tubvol {#1}% + \xdef\tubnum {#2}} + \def\issyear #1.{\xdef\tubyear{#1}} + + \input {../tugboat.dates} + + % \popmacro\vol + % \popmacro\issyear + + \popoverloadmode + + \setevariables + [tugboat] + [year=\tubyear, + volume=\tubvol, + number=\tubnum, + page=\the\count0] + +} { + % nothing +} + +\def\tubyear{1234} +\def\tubvol {5} +\def\tubnum {6} + +\def\issyear #1.{\def\tubyear{#1}} +\def\vol #1, #2.{\def\tubvol {#1}% + \def\tubnum {#2}} + +\stopmodule + +%D Good bye. + +\continueifinputfile{s-tugboat-columns.mkxl} + +\setupexternalfigures[location={local,global,default}] + +\StartArticle + + \StartAbstract + \input bryson + \StopAbstract + +% \dorecurse{30}{\input ward \par} \page + +% \startitemize +% \startitem \input ward \stopitem +% \startitem \input ward \stopitem +% \stopitemize + + + \samplefile{tufte}\par + \samplefile{tufte} + + As we see \doifelsemode {columns} {in \in {table} [demo-1]} {below} we can have + more than one cell in a row. + + \startplacetable[mode=columns,reference=demo-1] + \starttabulate[|||||] + \expandedloop 1 10 1 {% + \NC one \the\currentloopiterator \NC one more \NC and even 1 mode \NC and way more 1 now \NC \NR + \NC two \the\currentloopiterator \NC two more \NC and even 2 mode \NC and way more 2 now \NC \NR + }% + \stoptabulate + \stopplacetable + + \samplefile{tufte} + + \startplacefigure[mode=columns,reference=demo-2] + \externalfigure[cow.pdf][height=2cm,width=\textwidth] + \stopplacetable + + \samplefile{tufte}\par + \samplefile{tufte} + + \starttyping + test test test test test test + test test test test test test test test test test test test test test test test test test + test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test + test test test test test test test test test test test test test test test test test test + \stoptyping + + \samplefile{tufte} + + \dorecurse{10}{\samplefile{zapf}\blank} + +\StopArticle diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-exceptions.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-exceptions.mkxl new file mode 100644 index 00000000000..e6022d0e5ee --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-exceptions.mkxl @@ -0,0 +1,9 @@ +\startmodule[tugboat-exceptions] + +\startexceptions +% post-script +% data-base +% data-bases +\stopexceptions + +\stopmodule diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-logos.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-logos.mkxl new file mode 100644 index 00000000000..fd4d9d52a3f --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat-logos.mkxl @@ -0,0 +1,83 @@ + +%D This is a bit of a mess. We have logos defined in \CONTEXT\ but \TUGBOAT\ uses +%D some scaling. Let's see if we can handle that. + +\startmodule[tugboat-logos] + +\setupsorting + [logo] + [style=Camel] + +\unprotect \pushoverloadmode + +\protected\def\Dash {\unskip\thinspace\emdash\thinspace\ignorespaces} % |=| +\protected\def\slash{/\penalty\zerocount\hskip\zeropoint\relax} % |/| + +%D This needs a cleanup ... if we define a document in context speak it should also +%D process in another style. + +\definefont[AcroFont] [Serif*default sa .90] +\definefont[AcroFontBold] [SerifBold*default sa .90] +\definefont[AcroFontSmall][Serif*default sa .80] + +\protected\def\acro {\triggergroupedcommandcs\AcroFont } +\protected\def\acrobf {\triggergroupedcommandcs\AcroFontBold } +\protected\def\acrosmall{\triggergroupedcommandcs\AcroFontSmall} + +%D TugBoat likes it this way: + +\logo[API] {API} +\logo[CD] {CD} +\logo[CMYK] {CMYK} +\logo[CPU] {CPU} +\logo[DVI] {DVI} +\logo[FTP] {FTP} +\logo[HTTP] {HTTP} +\logo[IO] {I/O} +\logo[ISO] {ISO} +\logo[KPSE] {KPSE} +\logo[LINUX] {Linux} +\logo[LPEG] {Lpeg} +\logo[MF] {{\definedfont[logo10]META\-FONT}} +\logo[MPLIB] {MPlib} +\logo[NFSS] {NFSS} +\logo[PASCAL] {Pascal} +\logo[PDF] {PDF} +\logo[POSIX] {POSIX} +\logo[RGB] {RGB} +\logo[TDS] {TDS} +\logo[TEXBOOK] {{\sl The \TeX book}} +\logo[TFM] {TFM} +\logo[TRUETYPE] {True\-Type} +\logo[TYPEONE] {Type~1} +\logo[UTF] {UTF} +\logo[WEBC] {Web2C} +\logo[XML] {XML} +\logo[XPATH] {XPath} +\logo[XSLT] {XSLT} +\logo[XSLTPROC] {XSLTPROC} + +%D Already defined logos will not be redefined: + +\usemodule[abbreviations-logos] + +\protect \popoverloadmode + +\stopmodule + +\continueifinputfile{s-tugboat-logos.mkxl} + +\logo[KARL] {Karl Berry} + +\startTEXpage[offset=1ts] + \showglyphs + \startlines[before=,after=] + X \CONTEXT + X \ZIP + X \XPATH + X \TEX + X \LATEX + X \KARL + X \acro{Karl Berry} + \stoplines +\stopTEXpage diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat.mkxl new file mode 100644 index 00000000000..13c73e4808a --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-tugboat.mkxl @@ -0,0 +1,7 @@ +\startmodule[tugboat] + +\usemodule[tugboat-columns] +\usemodule[tugboat-logos] +\usemodule[tugboat-exceptions] + +\stopmodule diff --git a/Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.lmt b/Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.lmt new file mode 100644 index 00000000000..0d9c6a5e887 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.lmt @@ -0,0 +1,2304 @@ +if not modules then modules = { } end modules ['x-asciimath'] = { + version = 1.001, + comment = "companion to x-asciimath.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- Some backgrounds are discussed in 'x-asciimath.mkiv'. This is a third version. I +-- first tried a to make a proper expression parser but it's not that easy. First we +-- have to avoid left recursion, which is not that trivial (maybe a future version +-- of lpeg will provide that), and second there is not really a syntax but a mix of +-- expressions and sequences with some fuzzy logic applied. Most problematic are +-- fractions and we also need to handle incomplete expressions. So, instead we (sort +-- of) tokenize the string and then do some passes over the result. Yes, it's real +-- ugly and unsatisfying code mess down here. Don't take this as an example. + +-- todo: spaces around all elements in cleanup? +-- todo: filter from files listed in tuc file + +local trace_mapping = false if trackers then trackers.register("modules.asciimath.mapping", function(v) trace_mapping = v end) end +local trace_details = false if trackers then trackers.register("modules.asciimath.details", function(v) trace_details = v end) end +local trace_digits = false if trackers then trackers.register("modules.asciimath.digits", function(v) trace_digits = v end) end + +local report_asciimath = logs.reporter("mathematics","asciimath") + +local asciimath = asciimath or { } +local moduledata = moduledata or { } +moduledata.asciimath = asciimath + +if not characters then + require("char-def") + require("char-ini") + require("char-ent") +end + +local next, type = next, type +local concat, insert, remove = table.concat, table.insert, table.remove +local rep, gmatch, gsub, find = string.rep, string.gmatch, string.gsub, string.find +local utfchar, utfbyte = utf.char, utf.byte + +local lpegmatch, patterns = lpeg.match, lpeg.patterns +local S, P, R, C, V, Cc, Ct, Cs, Carg = lpeg.S, lpeg.P, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc, lpeg.Ct, lpeg.Cs, lpeg.Carg + +local sortedhash = table.sortedhash +local sortedkeys = table.sortedkeys +local formatters = string.formatters + +local entities = characters.entities or { } + +local xmltext = xml.text +local xmlpure = xml.pure +local xmlinclusion = xml.inclusion +local xmlcollected = xml.collected + +local lxmlgetid = lxml.getid + +-- todo: use private unicodes as temporary slots ... easier to compare + +local s_lparent = "\\left\\lparent" +local s_lbrace = "\\left\\lbrace" +local s_lbracket = "\\left\\lbracket" +local s_langle = "\\left\\langle" +local s_lfloor = "\\left\\lfloor" +local s_lceil = "\\left\\lceil" +local s_left = "\\left." + +local s_rparent = "\\right\\rparent" +local s_rbrace = "\\right\\rbrace" +local s_rbracket = "\\right\\rbracket" +local s_rangle = "\\right\\rangle" +local s_rfloor = "\\right\\rfloor" +local s_rceil = "\\right\\rceil" +local s_right = "\\right." + +----- s_mslash = "\\middle/" + +local s_lbar = "\\left\\|" +local s_mbar = "\\middle\\|" +local s_rbar = "\\right\\|" + +local s_lnothing = "\\left ." -- space fools checker +local s_rnothing = "\\right ." -- space fools checker + +local reserved = { + + ["prod"] = { false, "\\prod" }, + ["sinh"] = { false, "\\sinh" }, + ["cosh"] = { false, "\\cosh" }, + ["tanh"] = { false, "\\tanh" }, + ["sum"] = { false, "\\sum" }, + ["int"] = { false, "\\int" }, + ["sin"] = { false, "\\sin" }, + ["cos"] = { false, "\\cos" }, + ["tan"] = { false, "\\tan" }, + ["csc"] = { false, "\\csc" }, + ["sec"] = { false, "\\sec" }, + ["cot"] = { false, "\\cot" }, + ["log"] = { false, "\\log" }, + ["det"] = { false, "\\det" }, + ["lim"] = { false, "\\lim" }, + ["mod"] = { false, "\\mod" }, + ["gcd"] = { false, "\\gcd" }, + ["min"] = { false, "\\min" }, + ["max"] = { false, "\\max" }, + ["ln"] = { false, "\\ln" }, + + -- ["atan"] = { false, "\\atan" }, -- extra + -- ["acos"] = { false, "\\acos" }, -- extra + -- ["asin"] = { false, "\\asin" }, -- extra + + ["arctan"] = { false, "\\arctan" }, -- extra + ["arccos"] = { false, "\\arccos" }, -- extra + ["arcsin"] = { false, "\\arcsin" }, -- extra + + ["arctanh"] = { false, "\\arctanh" }, -- extra + ["arccosh"] = { false, "\\arccosh" }, -- extra + ["arcsinh"] = { false, "\\arcsinh" }, -- extra + + ["and"] = { false, "\\text{and}" }, + ["or"] = { false, "\\text{or}" }, + ["if"] = { false, "\\text{if}" }, + + ["sqrt"] = { false, "\\asciimathsqrt", "unary" }, + ["root"] = { false, "\\asciimathroot", "binary" }, + -- ["\\frac"] = { false, "\\frac", "binary" }, + ["frac"] = { false, "\\frac", "binary" }, + ["stackrel"] = { false, "\\asciimathstackrel", "binary" }, + ["hat"] = { false, "\\widehat", "unary" }, + ["bar"] = { false, "\\overline", "unary" }, + ["overbar"] = { false, "\\overline", "unary" }, + ["overline"] = { false, "\\overline", "unary" }, + ["underline"] = { false, "\\underline", "unary" }, + ["overbrace"] = { false, "\\overbrace", "unary" }, + ["underbrace"]= { false, "\\underbrace", "unary" }, + ["overset"] = { false, "\\overset", "unary" }, + ["underset"] = { false, "\\underset", "unary" }, + ["obrace"] = { false, "\\overbrace", "unary" }, + ["ubrace"] = { false, "\\underbrace", "unary" }, + ["ul"] = { false, "\\underline", "unary" }, + ["vec"] = { false, "\\overrightarrow", "unary" }, + ["dot"] = { false, "\\dot", "unary" }, -- 0x2D9 + ["ddot"] = { false, "\\ddot", "unary" }, -- 0xA8 + + -- binary operators + + ["+"] = { true, "+" }, + ["-"] = { true, "-" }, + ["*"] = { true, "⋅" }, + ["**"] = { true, "⋆" }, + ["////"] = { true, "⁄⁄" }, -- crap + ["//"] = { true, "⁄" }, -- \slash + ["\\"] = { true, "\\" }, + ["xx"] = { true, "×" }, + ["times"] = { true, "×" }, + ["-:"] = { true, "÷" }, + ["@"] = { true, "∘" }, + ["circ"] = { true, "∘" }, + ["o+"] = { true, "⊕" }, + ["ox"] = { true, "⊗" }, + ["o."] = { true, "⊙" }, + ["^^"] = { true, "∧" }, + ["vv"] = { true, "∨" }, + ["nn"] = { true, "∩" }, + ["uu"] = { true, "∪" }, + + -- big operators + + ["^^^"] = { true, "⋀" }, + ["vvv"] = { true, "⋁" }, + ["nnn"] = { true, "⋂" }, + ["uuu"] = { true, "⋃" }, + ["int"] = { true, "∫" }, + ["oint"] = { true, "∮" }, + + -- brackets + + ["("] = { true, "(" }, + [")"] = { true, ")" }, + ["["] = { true, "[" }, + ["]"] = { true, "]" }, + ["{"] = { true, "{" }, + ["}"] = { true, "}" }, + + -- binary relations + + ["="] = { true, "=" }, + ["eq"] = { true, "=" }, + ["!="] = { true, "≠" }, + ["ne"] = { true, "≠" }, + ["neq"] = { true, "≠" }, + ["<"] = { true, "<" }, + ["lt"] = { true, "<" }, + [">"] = { true, ">" }, + ["gt"] = { true, ">" }, + ["<="] = { true, "≤" }, + ["le"] = { true, "≤" }, + ["leq"] = { true, "≤" }, + [">="] = { true, "≥" }, + ["ge"] = { true, "≥" }, + ["geq"] = { true, "≥" }, + ["-<"] = { true, "≺" }, + [">-"] = { true, "≻" }, + ["in"] = { true, "∈" }, + ["!in"] = { true, "∉" }, + ["sub"] = { true, "⊂" }, + ["sup"] = { true, "⊃" }, + ["sube"] = { true, "⊆" }, + ["supe"] = { true, "⊇" }, + ["-="] = { true, "≡" }, + ["~="] = { true, "≅" }, + ["~~"] = { true, "≈" }, + ["prop"] = { true, "∝" }, + + -- arrows + + ["rarr"] = { true, "→" }, + ["->"] = { true, "→" }, + ["larr"] = { true, "←" }, + ["harr"] = { true, "↔" }, + ["uarr"] = { true, "↑" }, + ["darr"] = { true, "↓" }, + ["rArr"] = { true, "⇒" }, + ["lArr"] = { true, "⇐" }, + ["hArr"] = { true, "⇔" }, + ["|->"] = { true, "↦" }, + + -- logical + + ["not"] = { true, "¬" }, + ["=>"] = { true, "⇒" }, + ["iff"] = { true, "⇔" }, + ["AA"] = { true, "∀" }, + ["EE"] = { true, "∃" }, + ["_|_"] = { true, "⊥" }, + ["TT"] = { true, "⊤" }, + ["|--"] = { true, "⊢" }, + ["|=="] = { true, "⊨" }, + + -- miscellaneous + + ["del"] = { true, "∂" }, + ["grad"] = { true, "∇" }, + ["+-"] = { true, "±" }, + ["O/"] = { true, "∅" }, + ["oo"] = { true, "∞" }, + ["aleph"] = { true, "ℵ" }, + ["angle"] = { true, "∠" }, + ["/_"] = { true, "∠" }, + [":."] = { true, "∴" }, + ["..."] = { true, "..." }, -- ldots + ["ldots"] = { true, "..." }, -- ldots + ["cdots"] = { true, "⋯" }, + ["vdots"] = { true, "⋮" }, + ["ddots"] = { true, "⋱" }, + ["diamond"] = { true, "⋄" }, + ["square"] = { true, "□" }, + ["|__"] = { true, "⌊" }, + ["__|"] = { true, "⌋" }, + ["|~"] = { true, "⌈" }, + ["~|"] = { true, "⌉" }, + + -- more + + ["_="] = { true, "≡" }, + + -- bonus + + ["prime"] = { true, "′" }, -- bonus + ["'"] = { true, "′" }, -- bonus + ["''"] = { true, "″" }, -- bonus + ["'''"] = { true, "‴" }, -- bonus + + -- special + + ["%"] = { false, "\\mathpercent" }, + ["&"] = { false, "\\mathampersand" }, + ["#"] = { false, "\\mathhash" }, + ["$"] = { false, "\\mathdollar" }, + + -- blackboard + + ["CC"] = { true, "ℂ" }, + ["NN"] = { true, "ℕ" }, + ["QQ"] = { true, "ℚ" }, + ["RR"] = { true, "ℝ" }, + ["ZZ"] = { true, "ℤ" }, + + -- greek lowercase + + ["alpha"] = { true, "α" }, + ["beta"] = { true, "β" }, + ["gamma"] = { true, "γ" }, + ["delta"] = { true, "δ" }, + ["epsilon"] = { true, "ε" }, + ["varepsilon"] = { true, "ɛ" }, + ["zeta"] = { true, "ζ" }, + ["eta"] = { true, "η" }, + ["theta"] = { true, "θ" }, + ["vartheta"] = { true, "ϑ" }, + ["iota"] = { true, "ι" }, + ["kappa"] = { true, "κ" }, + ["lambda"] = { true, "λ" }, + ["mu"] = { true, "μ" }, + ["nu"] = { true, "ν" }, + ["xi"] = { true, "ξ" }, + ["pi"] = { true, "π" }, + ["rho"] = { true, "ρ" }, + ["sigma"] = { true, "σ" }, + ["tau"] = { true, "τ" }, + ["upsilon"] = { true, "υ" }, + ["phi"] = { true, "ϕ" }, + ["varphi"] = { true, "φ" }, + ["chi"] = { true, "χ" }, + ["psi"] = { true, "ψ" }, + ["omega"] = { true, "ω" }, + + -- greek uppercase + + ["Gamma"] = { true, "Γ" }, + ["Delta"] = { true, "Δ" }, + ["Theta"] = { true, "Θ" }, + ["Lambda"] = { true, "Λ" }, + ["Xi"] = { true, "Ξ" }, + ["Pi"] = { true, "Π" }, + ["Sigma"] = { true, "Σ" }, + ["Phi"] = { true, "Φ" }, + ["Psi"] = { true, "Ψ" }, + ["Omega"] = { true, "Ω" }, + + -- blackboard + + ["bbb a"] = { true, "𝕒" }, + ["bbb b"] = { true, "𝕓" }, + ["bbb c"] = { true, "𝕔" }, + ["bbb d"] = { true, "𝕕" }, + ["bbb e"] = { true, "𝕖" }, + ["bbb f"] = { true, "𝕗" }, + ["bbb g"] = { true, "𝕘" }, + ["bbb h"] = { true, "𝕙" }, + ["bbb i"] = { true, "𝕚" }, + ["bbb j"] = { true, "𝕛" }, + ["bbb k"] = { true, "𝕜" }, + ["bbb l"] = { true, "𝕝" }, + ["bbb m"] = { true, "𝕞" }, + ["bbb n"] = { true, "𝕟" }, + ["bbb o"] = { true, "𝕠" }, + ["bbb p"] = { true, "𝕡" }, + ["bbb q"] = { true, "𝕢" }, + ["bbb r"] = { true, "𝕣" }, + ["bbb s"] = { true, "𝕤" }, + ["bbb t"] = { true, "𝕥" }, + ["bbb u"] = { true, "𝕦" }, + ["bbb v"] = { true, "𝕧" }, + ["bbb w"] = { true, "𝕨" }, + ["bbb x"] = { true, "𝕩" }, + ["bbb y"] = { true, "𝕪" }, + ["bbb z"] = { true, "𝕫" }, + + ["bbb A"] = { true, "𝔸" }, + ["bbb B"] = { true, "𝔹" }, + ["bbb C"] = { true, "ℂ" }, + ["bbb D"] = { true, "𝔻" }, + ["bbb E"] = { true, "𝔼" }, + ["bbb F"] = { true, "𝔽" }, + ["bbb G"] = { true, "𝔾" }, + ["bbb H"] = { true, "ℍ" }, + ["bbb I"] = { true, "𝕀" }, + ["bbb J"] = { true, "𝕁" }, + ["bbb K"] = { true, "𝕂" }, + ["bbb L"] = { true, "𝕃" }, + ["bbb M"] = { true, "𝕄" }, + ["bbb N"] = { true, "ℕ" }, + ["bbb O"] = { true, "𝕆" }, + ["bbb P"] = { true, "ℙ" }, + ["bbb Q"] = { true, "ℚ" }, + ["bbb R"] = { true, "ℝ" }, + ["bbb S"] = { true, "𝕊" }, + ["bbb T"] = { true, "𝕋" }, + ["bbb U"] = { true, "𝕌" }, + ["bbb V"] = { true, "𝕍" }, + ["bbb W"] = { true, "𝕎" }, + ["bbb X"] = { true, "𝕏" }, + ["bbb Y"] = { true, "𝕐" }, + ["bbb Z"] = { true, "ℤ" }, + + -- fraktur + + ["fr a"] = { true, "𝔞" }, + ["fr b"] = { true, "𝔟" }, + ["fr c"] = { true, "𝔠" }, + ["fr d"] = { true, "𝔡" }, + ["fr e"] = { true, "𝔢" }, + ["fr f"] = { true, "𝔣" }, + ["fr g"] = { true, "𝔤" }, + ["fr h"] = { true, "𝔥" }, + ["fr i"] = { true, "𝔦" }, + ["fr j"] = { true, "𝔧" }, + ["fr k"] = { true, "𝔨" }, + ["fr l"] = { true, "𝔩" }, + ["fr m"] = { true, "𝔪" }, + ["fr n"] = { true, "𝔫" }, + ["fr o"] = { true, "𝔬" }, + ["fr p"] = { true, "𝔭" }, + ["fr q"] = { true, "𝔮" }, + ["fr r"] = { true, "𝔯" }, + ["fr s"] = { true, "𝔰" }, + ["fr t"] = { true, "𝔱" }, + ["fr u"] = { true, "𝔲" }, + ["fr v"] = { true, "𝔳" }, + ["fr w"] = { true, "𝔴" }, + ["fr x"] = { true, "𝔵" }, + ["fr y"] = { true, "𝔶" }, + ["fr z"] = { true, "𝔷" }, + + ["fr A"] = { true, "𝔄" }, + ["fr B"] = { true, "𝔅" }, + ["fr C"] = { true, "ℭ" }, + ["fr D"] = { true, "𝔇" }, + ["fr E"] = { true, "𝔈" }, + ["fr F"] = { true, "𝔉" }, + ["fr G"] = { true, "𝔊" }, + ["fr H"] = { true, "ℌ" }, + ["fr I"] = { true, "ℑ" }, + ["fr J"] = { true, "𝔍" }, + ["fr K"] = { true, "𝔎" }, + ["fr L"] = { true, "𝔏" }, + ["fr M"] = { true, "𝔐" }, + ["fr N"] = { true, "𝔑" }, + ["fr O"] = { true, "𝔒" }, + ["fr P"] = { true, "𝔓" }, + ["fr Q"] = { true, "𝔔" }, + ["fr R"] = { true, "ℜ" }, + ["fr S"] = { true, "𝔖" }, + ["fr T"] = { true, "𝔗" }, + ["fr U"] = { true, "𝔘" }, + ["fr V"] = { true, "𝔙" }, + ["fr W"] = { true, "𝔚" }, + ["fr X"] = { true, "𝔛" }, + ["fr Y"] = { true, "𝔜" }, + ["fr Z"] = { true, "ℨ" }, + + -- script + + ["cc a"] = { true, "𝒶" }, + ["cc b"] = { true, "𝒷" }, + ["cc c"] = { true, "𝒸" }, + ["cc d"] = { true, "𝒹" }, + ["cc e"] = { true, "ℯ" }, + ["cc f"] = { true, "𝒻" }, + ["cc g"] = { true, "ℊ" }, + ["cc h"] = { true, "𝒽" }, + ["cc i"] = { true, "𝒾" }, + ["cc j"] = { true, "𝒿" }, + ["cc k"] = { true, "𝓀" }, + ["cc l"] = { true, "𝓁" }, + ["cc m"] = { true, "𝓂" }, + ["cc n"] = { true, "𝓃" }, + ["cc o"] = { true, "ℴ" }, + ["cc p"] = { true, "𝓅" }, + ["cc q"] = { true, "𝓆" }, + ["cc r"] = { true, "𝓇" }, + ["cc s"] = { true, "𝓈" }, + ["cc t"] = { true, "𝓉" }, + ["cc u"] = { true, "𝓊" }, + ["cc v"] = { true, "𝓋" }, + ["cc w"] = { true, "𝓌" }, + ["cc x"] = { true, "𝓍" }, + ["cc y"] = { true, "𝓎" }, + ["cc z"] = { true, "𝓏" }, + + ["cc A"] = { true, "𝒜" }, + ["cc B"] = { true, "ℬ" }, + ["cc C"] = { true, "𝒞" }, + ["cc D"] = { true, "𝒟" }, + ["cc E"] = { true, "ℰ" }, + ["cc F"] = { true, "ℱ" }, + ["cc G"] = { true, "𝒢" }, + ["cc H"] = { true, "ℋ" }, + ["cc I"] = { true, "ℐ" }, + ["cc J"] = { true, "𝒥" }, + ["cc K"] = { true, "𝒦" }, + ["cc L"] = { true, "ℒ" }, + ["cc M"] = { true, "ℳ" }, + ["cc N"] = { true, "𝒩" }, + ["cc O"] = { true, "𝒪" }, + ["cc P"] = { true, "𝒫" }, + ["cc Q"] = { true, "𝒬" }, + ["cc R"] = { true, "ℛ" }, + ["cc S"] = { true, "𝒮" }, + ["cc T"] = { true, "𝒯" }, + ["cc U"] = { true, "𝒰" }, + ["cc V"] = { true, "𝒱" }, + ["cc W"] = { true, "𝒲" }, + ["cc X"] = { true, "𝒳" }, + ["cc Y"] = { true, "𝒴" }, + ["cc Z"] = { true, "𝒵" }, + + -- bold + + ["bb a"] = { true, "𝒂" }, + ["bb b"] = { true, "𝒃" }, + ["bb c"] = { true, "𝒄" }, + ["bb d"] = { true, "𝒅" }, + ["bb e"] = { true, "𝒆" }, + ["bb f"] = { true, "𝒇" }, + ["bb g"] = { true, "𝒈" }, + ["bb h"] = { true, "𝒉" }, + ["bb i"] = { true, "𝒊" }, + ["bb j"] = { true, "𝒋" }, + ["bb k"] = { true, "𝒌" }, + ["bb l"] = { true, "𝒍" }, + ["bb m"] = { true, "𝒎" }, + ["bb n"] = { true, "𝒏" }, + ["bb o"] = { true, "𝒐" }, + ["bb p"] = { true, "𝒑" }, + ["bb q"] = { true, "𝒒" }, + ["bb r"] = { true, "𝒓" }, + ["bb s"] = { true, "𝒔" }, + ["bb t"] = { true, "𝒕" }, + ["bb u"] = { true, "𝒖" }, + ["bb v"] = { true, "𝒗" }, + ["bb w"] = { true, "𝒘" }, + ["bb x"] = { true, "𝒙" }, + ["bb y"] = { true, "𝒚" }, + ["bb z"] = { true, "𝒛" }, + + ["bb A"] = { true, "𝑨" }, + ["bb B"] = { true, "𝑩" }, + ["bb C"] = { true, "𝑪" }, + ["bb D"] = { true, "𝑫" }, + ["bb E"] = { true, "𝑬" }, + ["bb F"] = { true, "𝑭" }, + ["bb G"] = { true, "𝑮" }, + ["bb H"] = { true, "𝑯" }, + ["bb I"] = { true, "𝑰" }, + ["bb J"] = { true, "𝑱" }, + ["bb K"] = { true, "𝑲" }, + ["bb L"] = { true, "𝑳" }, + ["bb M"] = { true, "𝑴" }, + ["bb N"] = { true, "𝑵" }, + ["bb O"] = { true, "𝑶" }, + ["bb P"] = { true, "𝑷" }, + ["bb Q"] = { true, "𝑸" }, + ["bb R"] = { true, "𝑹" }, + ["bb S"] = { true, "𝑺" }, + ["bb T"] = { true, "𝑻" }, + ["bb U"] = { true, "𝑼" }, + ["bb V"] = { true, "𝑽" }, + ["bb W"] = { true, "𝑾" }, + ["bb X"] = { true, "𝑿" }, + ["bb Y"] = { true, "𝒀" }, + ["bb Z"] = { true, "𝒁" }, + + -- sans + + ["sf a"] = { true, "𝖺" }, + ["sf b"] = { true, "𝖻" }, + ["sf c"] = { true, "𝖼" }, + ["sf d"] = { true, "𝖽" }, + ["sf e"] = { true, "𝖾" }, + ["sf f"] = { true, "𝖿" }, + ["sf g"] = { true, "𝗀" }, + ["sf h"] = { true, "𝗁" }, + ["sf i"] = { true, "𝗂" }, + ["sf j"] = { true, "𝗃" }, + ["sf k"] = { true, "𝗄" }, + ["sf l"] = { true, "𝗅" }, + ["sf m"] = { true, "𝗆" }, + ["sf n"] = { true, "𝗇" }, + ["sf o"] = { true, "𝗈" }, + ["sf p"] = { true, "𝗉" }, + ["sf q"] = { true, "𝗊" }, + ["sf r"] = { true, "𝗋" }, + ["sf s"] = { true, "𝗌" }, + ["sf t"] = { true, "𝗍" }, + ["sf u"] = { true, "𝗎" }, + ["sf v"] = { true, "𝗏" }, + ["sf w"] = { true, "𝗐" }, + ["sf x"] = { true, "𝗑" }, + ["sf y"] = { true, "𝗒" }, + ["sf z"] = { true, "𝗓" }, + + ["sf A"] = { true, "𝖠" }, + ["sf B"] = { true, "𝖡" }, + ["sf C"] = { true, "𝖢" }, + ["sf D"] = { true, "𝖣" }, + ["sf E"] = { true, "𝖤" }, + ["sf F"] = { true, "𝖥" }, + ["sf G"] = { true, "𝖦" }, + ["sf H"] = { true, "𝖧" }, + ["sf I"] = { true, "𝖨" }, + ["sf J"] = { true, "𝖩" }, + ["sf K"] = { true, "𝖪" }, + ["sf L"] = { true, "𝖫" }, + ["sf M"] = { true, "𝖬" }, + ["sf N"] = { true, "𝖭" }, + ["sf O"] = { true, "𝖮" }, + ["sf P"] = { true, "𝖯" }, + ["sf Q"] = { true, "𝖰" }, + ["sf R"] = { true, "𝖱" }, + ["sf S"] = { true, "𝖲" }, + ["sf T"] = { true, "𝖳" }, + ["sf U"] = { true, "𝖴" }, + ["sf V"] = { true, "𝖵" }, + ["sf W"] = { true, "𝖶" }, + ["sf X"] = { true, "𝖷" }, + ["sf Y"] = { true, "𝖸" }, + ["sf Z"] = { true, "𝖹" }, + + -- monospace + + ["tt a"] = { true, "𝚊" }, + ["tt b"] = { true, "𝚋" }, + ["tt c"] = { true, "𝚌" }, + ["tt d"] = { true, "𝚍" }, + ["tt e"] = { true, "𝚎" }, + ["tt f"] = { true, "𝚏" }, + ["tt g"] = { true, "𝚐" }, + ["tt h"] = { true, "𝚑" }, + ["tt i"] = { true, "𝚒" }, + ["tt j"] = { true, "𝚓" }, + ["tt k"] = { true, "𝚔" }, + ["tt l"] = { true, "𝚕" }, + ["tt m"] = { true, "𝚖" }, + ["tt n"] = { true, "𝚗" }, + ["tt o"] = { true, "𝚘" }, + ["tt p"] = { true, "𝚙" }, + ["tt q"] = { true, "𝚚" }, + ["tt r"] = { true, "𝚛" }, + ["tt s"] = { true, "𝚜" }, + ["tt t"] = { true, "𝚝" }, + ["tt u"] = { true, "𝚞" }, + ["tt v"] = { true, "𝚟" }, + ["tt w"] = { true, "𝚠" }, + ["tt x"] = { true, "𝚡" }, + ["tt y"] = { true, "𝚢" }, + ["tt z"] = { true, "𝚣" }, + + ["tt A"] = { true, "𝙰" }, + ["tt B"] = { true, "𝙱" }, + ["tt C"] = { true, "𝙲" }, + ["tt D"] = { true, "𝙳" }, + ["tt E"] = { true, "𝙴" }, + ["tt F"] = { true, "𝙵" }, + ["tt G"] = { true, "𝙶" }, + ["tt H"] = { true, "𝙷" }, + ["tt I"] = { true, "𝙸" }, + ["tt J"] = { true, "𝙹" }, + ["tt K"] = { true, "𝙺" }, + ["tt L"] = { true, "𝙻" }, + ["tt M"] = { true, "𝙼" }, + ["tt N"] = { true, "𝙽" }, + ["tt O"] = { true, "𝙾" }, + ["tt P"] = { true, "𝙿" }, + ["tt Q"] = { true, "𝚀" }, + ["tt R"] = { true, "𝚁" }, + ["tt S"] = { true, "𝚂" }, + ["tt T"] = { true, "𝚃" }, + ["tt U"] = { true, "𝚄" }, + ["tt V"] = { true, "𝚅" }, + ["tt W"] = { true, "𝚆" }, + ["tt X"] = { true, "𝚇" }, + ["tt Y"] = { true, "𝚈" }, + ["tt Z"] = { true, "𝚉" }, + + -- some more undocumented + + ["dx"] = { false, { "d", "x" } }, -- "{dx}" "\\left(dx\\right)" + ["dy"] = { false, { "d", "y" } }, -- "{dy}" "\\left(dy\\right)" + ["dz"] = { false, { "d", "z" } }, -- "{dz}" "\\left(dz\\right)" + + -- fences + + ["(:"] = { true, "(:" }, + ["{:"] = { true, "{:" }, + ["[:"] = { true, "[:" }, + ["("] = { true, "(" }, + ["["] = { true, "[" }, + ["{"] = { true, "{" }, + ["<<"] = { true, "⟨" }, -- why not <: + ["|_"] = { true, "⌊" }, + ["|~"] = { true, "⌈" }, + ["⟨"] = { true, "⟨" }, + ["〈"] = { true, "⟨" }, + ["〈"] = { true, "⟨" }, + + [":)"] = { true, ":)" }, + [":}"] = { true, ":}" }, + [":]"] = { true, ":]" }, + [")"] = { true, ")" }, + ["]"] = { true, "]" }, + ["}"] = { true, "}" }, + [">>"] = { true, "⟩" }, -- why not :> + ["~|"] = { true, "⌉" }, + ["_|"] = { true, "⌋" }, + ["⟩"] = { true, "⟩" }, + ["〉"] = { true, "⟩" }, + ["〉"] = { true, "⟩" }, + + ["lparent"] = { true, "(" }, + ["lbracket"] = { true, "[" }, + ["lbrace"] = { true, "{" }, + ["langle"] = { true, "⟨" }, + ["lfloor"] = { true, "⌊" }, + ["lceil"] = { true, "⌈" }, + + ["rparent"] = { true, ")" }, + ["rbracket"] = { true, "]" }, + ["rbrace"] = { true, "}" }, + ["rangle"] = { true, "⟩" }, + ["rfloor"] = { true, "⌋" }, + ["rceil"] = { true, "⌉" }, + + -- a bit special: + +-- ["\\frac"] = { true, "frac" }, + + -- now it gets real crazy, only these two: + + [">"] = { true, ">" }, + ["<"] = { true, "<" }, + + -- extra: + + -- also, invisible times + + ["dd"] = { false, "{\\tf d}" }, + ["ee"] = { false, "{\\tf e}" }, + ["xxx"] = { true, utfchar(0x2063) }, -- invisible times + +} + +-- This is an undocumented option for Ton (math4all): + +-- \startluacode +-- if not asciimath then +-- asciimath = { +-- extras = { +-- ["GTK"] = { false, "\\text{\\it GTK}" }, -- proper kerning/spacing +-- } +-- } +-- end +-- \stopluacode +-- +-- \usemodule[asciimath] +-- \starttext +-- \asciimath{GTK} +-- stoptext + +local extras = asciimath.extras +if extras then + for k, v in next, extras do + if not reserved[k] then + reserved[k] = v + end + end +end + +-- a..z A..Z : allemaal op italic alphabet +-- en dan default naar upright "upr a" + +for k, v in next, characters.data do + local name = v.mathname + if name and not reserved[name] then + local char = { true, utfchar(k) } + reserved[ name] = char + -- reserved["\\" .. name] = char + end + -- local spec = v.mathspec + -- if spec then + -- for i=1,#spec do + -- local name = spec[i].name + -- if name and not reserved[name] then + -- reserved[name] = { true, utfchar(k) } + -- end + -- end + -- end +end + +reserved.P = nil +reserved.S = nil + + +local isbinary = { + ["\\frac"] = true, + ["\\root"] = true, + ["\\asciimathroot"] = true, + ["\\asciimathstackrel"] = true, + ["\\overset"] = true, + ["\\underset"] = true, +} + +local isunary = { -- can be taken from reserved + ["\\sqrt"] = true, + ["\\asciimathsqrt"] = true, + ["\\text"] = true, -- mathoptext + ["\\mathoptext"] = true, -- mathoptext + ["\\asciimathoptext"] = true, -- mathoptext + ["\\hat"] = true, -- widehat + ["\\widehat"] = true, -- widehat + ["\\bar"] = true, -- + ["\\overbar"] = true, -- + ["\\overline"] = true, -- + ["\\underline"] = true, -- + ["\\vec"] = true, -- overrightarrow + ["\\overrightarrow"] = true, -- overrightarrow + ["\\dot"] = true, -- + ["\\ddot"] = true, -- + + ["\\overbrace"] = true, + ["\\underbrace"] = true, + ["\\obrace"] = true, + ["\\ubrace"] = true, +} + +local isfunny = { + ["\\sin"] = true, +} + +local isinfix = { + ["^"] = true, + ["_"] = true, +} + +local isstupid = { + ["\\prod"] = true, + ["\\sinh"] = true, + ["\\cosh"] = true, + ["\\tanh"] = true, + ["\\sum"] = true, + ["\\int"] = true, + ["\\sin"] = true, + ["\\cos"] = true, + ["\\tan"] = true, + ["\\csc"] = true, + ["\\sec"] = true, + ["\\cot"] = true, + ["\\log"] = true, + ["\\det"] = true, + ["\\lim"] = true, + ["\\mod"] = true, + ["\\gcd"] = true, + ["\\min"] = true, + ["\\max"] = true, + ["\\ln"] = true, + + -- ["\\atan"] = true, + -- ["\\acos"] = true, + -- ["\\asin"] = true, + + ["\\arctan"] = true, + ["\\arccos"] = true, + ["\\arcsin"] = true, + + ["\\arctanh"] = true, + ["\\arccosh"] = true, + ["\\arcsinh"] = true, + + ["f"] = true, + ["g"] = true, +} + +local isleft = { + [s_lparent] = true, + [s_lbrace] = true, + [s_lbracket] = true, + [s_langle] = true, + [s_lfloor] = true, + [s_lceil] = true, + [s_left] = true, +} + +local isright = { + [s_rparent] = true, + [s_rbrace] = true, + [s_rbracket] = true, + [s_rangle] = true, + [s_rfloor] = true, + [s_rceil] = true, + [s_right] = true, +} + +local issimplified = { +} + +-- + +-- special mess (we have a generic one now but for the moment keep this) +-- special mess (we have a generic one now but for the moment keep this) + +local d_one = R("09") +local d_two = d_one * d_one +local d_three = d_two * d_one +local d_four = d_three * d_one +local d_split = P(-1) + Carg(2) * (S(".") /"") + +local d_spaced = (Carg(1) * d_three)^1 + +local digitized_1 = Cs ( ( + d_three * d_spaced * d_split + + d_two * d_spaced * d_split + + d_one * d_spaced * d_split + + P(1) + )^1 ) + +local p_fourbefore = d_four * d_split +local p_fourafter = d_four * P(-1) + +local p_beforecomma = d_three * d_spaced^0 * d_split + + d_two * d_spaced^0 * d_split + + d_one * d_spaced^0 * d_split + + d_one * d_split + +local p_aftercomma = p_fourafter + + d_three * d_spaced + + d_two * d_spaced + + d_one * d_spaced + +local digitized_2 = Cs ( + p_fourbefore * (p_aftercomma^0) + + p_beforecomma * ((p_aftercomma + d_one^1)^0) + ) + +local p_fourbefore = d_four * d_split +local p_fourafter = d_four +local d_spaced = (Carg(1) * (d_three + d_two + d_one))^1 +local p_aftercomma = p_fourafter * P(-1) + + d_three * d_spaced * P(1)^0 + + d_one^1 + +-- local digitized_3 = Cs ( +-- p_fourbefore * p_aftercomma^0 + +-- p_beforecomma * p_aftercomma^0 +-- ) + +local digitized_3 = Cs((p_fourbefore + p_beforecomma) * p_aftercomma^0) + +local splitmethods = { + digitized_1, + digitized_2, + digitized_3, +} + +local splitmethod = nil +local symbolmethod = nil +local digitseparator = utfchar(0x2008) +local digitsymbol = "." + +local v_yes_digits = interfaces and interfaces.variables.yes or true + +function asciimath.setup(settings) + splitmethod = splitmethods[tonumber(settings.splitmethod) or 0] + if splitmethod then + digitsymbol = settings.symbol + if not digitsymbol or digitsymbol == "" then + digitsymbol = "." + end + local separator = settings.separator + -- if separator == true or not interfaces or interfaces.variables.yes then + if separator == true or separator == nil or separator == v_yes_digits then + digitseparator = utfchar(0x2008) + elseif type(separator) == "string" and separator ~= "" then + digitseparator = separator + else + splitmethod = nil + end + if digitsymbol ~= "." then + symbolmethod = lpeg.replacer(".",digitsymbol) + else + symbolmethod = nil + end + end +end + +local collected_digits = { } +local collected_filename = "asciimath-digits.lua" + +function numbermess(s) + if splitmethod then + local d = lpegmatch(splitmethod,s,1,digitseparator,digitsymbol) + if not d and symbolmethod then + d = lpegmatch(symbolmethod,s) + end + if d then + if trace_digits and s ~= d then + collected_digits[s] = d + end + return d + end + end + return s +end + +-- asciimath.setup { splitmethod = 3, symbol = "," } +-- local t = { +-- "0.00002", +-- "1", "12", "123", "1234", "12345", "123456", "1234567", "12345678", "123456789", +-- "1.1", +-- "12.12", +-- "123.123", +-- "1234.123", +-- "1234.1234", +-- "12345.1234", +-- "1234.12345", +-- "12345.12345", +-- "123456.123456", +-- "1234567.1234567", +-- "12345678.12345678", +-- "123456789.123456789", +-- "0.1234", +-- "1234.0", +-- "1234.00", +-- "0.123456789", +-- "100.00005", +-- "0.80018", +-- "10.80018", +-- "100.80018", +-- "1000.80018", +-- "10000.80018", +-- } +-- for i=1,#t do print(formatters["%-20s : [%s]"](t[i],numbermess(t[i]))) end + +statistics.register("asciimath",function() + if trace_digits then + local n = table.count(collected_digits) + if n > 0 then + table.save(collected_filename,collected_digits) + return string.format("%s digit conversions saved in %s",n,collected_filename) + else + os.remove(collected_filename) + end + end +end) + +local p_number_base = patterns.cpnumber or patterns.cnumber or patterns.number +local p_number = C(p_number_base) +----- p_number = p_number_base +local p_spaces = patterns.whitespace + +local p_utf_base = patterns.utf8character +local p_utf = C(p_utf_base) +-- local p_entity = (P("&") * C((1-P(";"))^2) * P(";"))/ entities + +-- entities["gt"] = ">" +-- entities["lt"] = "<" +-- entities["amp"] = "&" +-- entities["dquot"] = '"' +-- entities["quot"] = "'" + +local p_onechar = p_utf_base * P(-1) + +----- p_number = Cs((patterns.cpnumber or patterns.cnumber or patterns.number)/function(s) return (gsub(s,",","{,}")) end) + +local sign = P("-")^-1 +local digits = R("09")^1 +local integer = sign * digits +local real = digits * (S(".") * digits)^-1 +local float = real * (P("E") * integer)^-1 + +-- local number = C(float + integer) +-- local p_number = C(float) +local p_number = float / numbermess + +local k_reserved = sortedkeys(reserved) +local k_commands = { } +local k_unicode = { } + +asciimath.keys = { + reserved = k_reserved +} + +local k_reserved_different = { } +local k_reserved_words = { } + +for k, v in sortedhash(reserved) do + local replacement = v[2] + if v[1] then + k_unicode[k] = replacement + else + k_unicode[k] = k -- keep them ... later we remap these + if k ~= replacement then + k_reserved_different[#k_reserved_different+1] = k + end + end + if find(k,"^[a-zA-Z]+$") then + k_unicode["\\"..k] = replacement + else + k_unicode["\\"..k] = k -- dirty trick, no real unicode (still needed ?) + end + if not find(k,"[^a-zA-Z]") then + k_reserved_words[#k_reserved_words+1] = k + end + k_commands[k] = replacement +end + +local p_reserved = + lpeg.utfchartabletopattern(k_reserved_different) / k_commands + +local p_unicode = +-- lpeg.utfchartabletopattern(table.keys(k_unicode)) / k_unicode + lpeg.utfchartabletopattern(k_unicode) / k_unicode + +local p_texescape = patterns.texescape + +local function texescaped(s) + return lpegmatch(p_texescape,s) or s +end + +local p_text = + P("text") + * p_spaces^0 + * Cc("\\asciimathoptext") + * ( -- maybe balanced + Cs( P("{") * ((1-P("}"))^0/texescaped) * P("}") ) + + Cs((P("(")/"{") * ((1-P(")"))^0/texescaped) * (P(")")/"}")) + ) + + Cc("\\asciimathoptext") * Cs(Cc("{") * (C(patterns.undouble)/texescaped) * Cc("}")) + +local m_left = { + ["(:"] = s_langle, + ["{:"] = s_left, + ["[:"] = s_left, + ["("] = s_lparent, + ["["] = s_lbracket, + ["{"] = s_lbrace, + ["⟨"] = s_langle, + ["⌈"] = s_lceil, + ["⌊"] = s_lfloor, + + -- ["<<"] = s_langle, -- why not <: + -- ["|_"] = s_lfloor, + -- ["|~"] = s_lceil, + -- ["〈"] = s_langle, + -- ["〈"] = s_langle, + + -- ["lparent"] = s_lparent, + -- ["lbracket"] = s_lbracket, + -- ["lbrace"] = s_lbrace, + -- ["langle"] = s_langle, + -- ["lfloor"] = s_lfloor, + -- ["lceil"] = s_lceil, +} + +local m_right = { + [":)"] = s_rangle, + [":}"] = s_right, + [":]"] = s_right, + [")"] = s_rparent, + ["]"] = s_rbracket, + ["}"] = s_rbrace, + ["⟩"] = s_rangle, + ["⌉"] = s_rceil, + ["⌋"] = s_rfloor, + + -- [">>"] = s_rangle, -- why not :> + -- ["~|"] = s_rceil, + -- ["_|"] = s_rfloor, + -- ["〉"] = s_rangle, + -- ["〉"] = s_rangle, + + -- ["rparent"] = s_rparent, + -- ["rbracket"] = s_rbracket, + -- ["rbrace"] = s_rbrace, + -- ["rangle"] = s_rangle, + -- ["rfloor"] = s_rfloor, + -- ["rceil"] = s_rceil, +} + +local islimits = { + ["\\sum"] = true, + -- ["∑"] = true, + ["\\prod"] = true, + -- ["∏"] = true, + ["\\lim"] = true, +} + +local p_left = + lpeg.utfchartabletopattern(m_left) / m_left +local p_right = + lpeg.utfchartabletopattern(m_right) / m_right + +-- special cases + +-- local p_special = +-- C("/") +-- + P("\\ ") * Cc("{}") * p_spaces^0 * C(S("^_")) +-- + P("\\ ") * Cc("\\space") +-- + P("\\\\") * Cc("\\backslash") +-- + P("\\") * (R("az","AZ")^1/entities) +-- + P("|") * Cc("\\|") +-- +-- faster but also uglier: + +local p_special = + P("|") * Cc("\\|") -- s_mbar -- maybe always add left / right as in mml ? + + P("\\") * ( + ( + P(" ") * ( + Cc("{}") * p_spaces^0 * C(S("^_")) + + Cc("\\space") + ) + ) + + P("\\") * Cc("\\backslash") + -- + (R("az","AZ")^1/entities) + + C(R("az","AZ")^1) + ) + +-- open | close :: {: | :} + +local u_parser = Cs ( ( + patterns.doublequoted + + P("text") * p_spaces^0 * P("(") * (1-P(")"))^0 * P(")") + -- -- todo: balanced + P("\\frac") / "frac" + -- bah + p_unicode + + p_utf_base +)^0 ) + +local a_parser = Ct { "tokenizer", + tokenizer = ( + p_spaces + + p_number + + p_text + -- + Ct(p_open * V("tokenizer") * p_close) -- {: (a+b,=,1),(a+b,=,7) :} + -- + Ct(p_open * V("tokenizer") * p_close_right) -- { (a+b,=,1),(a+b,=,7) :} + -- + Ct(p_open_left * V("tokenizer") * p_right) -- {: (a+b,=,1),(a+b,=,7) } + + Ct(p_left * V("tokenizer") * p_right) -- { (a+b,=,1),(a+b,=,7) } + + p_special + + p_reserved + -- + p_utf - p_close - p_right + + (p_utf - p_right) + )^1, +} + +local collapse = nil +local serialize = table.serialize +local f_state = formatters["level %s : %s : intermediate"] + +local function show_state(t,level,state) + report_asciimath(serialize(t,f_state(level,state))) +end + +local function show_result(original,unicoded,texcoded) + report_asciimath("original > %s",original) + report_asciimath("unicoded > %s",unicoded) + report_asciimath("texcoded > %s",texcoded) +end + +local function collapse_matrices(t) + local n = #t + if n > 4 and t[3] == "," then + local l1 = t[1] + local r1 = t[n] + if isleft[l1] and isright[r1] then + local l2 = t[2] + local r2 = t[n-1] + if type(l2) == "table" and type(r2) == "table" then + -- we have a matrix + local valid = true + for i=3,n-2,2 do + if t[i] ~= "," then + valid = false + break + end + end + if valid then + for i=2,n-1,2 do + local ti = t[i] + local tl = ti[1] + local tr = ti[#ti] + if isleft[tl] and isright[tr] then + -- ok + else + valid = false + break + end + end + if valid then + local omit = l1 == s_left and r1 == s_right + if omit then + t[1] = "\\startmatrix" + else + t[1] = l1 .. "\\startmatrix" + end + for i=2,n-1 do + if t[i] == "," then + t[i] = "\\NR" + else + local ti = t[i] + ti[1] = "\\NC" + for i=2,#ti-1 do + if ti[i] == "," then + ti[i] = "\\NC" + end + end + ti[#ti] = nil + end + end + if omit then + t[n] = "\\NR\\stopmatrix" + else + t[n] = "\\NR\\stopmatrix" .. r1 + end + end + end + end + end + end + return t +end + +local function collapse_bars(t) + local n, i, l, m = #t, 1, false, 0 + while i <= n do + local current = t[i] + if current == "\\|" then + if l then + m = m + 1 + t[l] = s_lbar + t[i] = s_rbar + t[m] = { unpack(t,l,i) } + l = false + else + l = i + end + elseif not l then + m = m + 1 + t[m] = current + end + i = i + 1 + end + if l then + -- problem: we can have a proper nesting +local d = false +for i=1,m do + local ti = t[i] + if type(ti) == "string" and find(ti,"\\left",1,true) then + d = true + break + end +end +if not d then + local tt = { s_lnothing } -- space fools final checker + local tm = 1 + for i=1,m do + tm = tm + 1 + tt[tm] = t[i] + end + tm = tm + 1 + tt[tm] = s_mbar + for i=l+1,n do + tm = tm + 1 + tt[tm] = t[i] + end + tm = tm + 1 + tt[tm] = s_rnothing -- space fools final checker + m = tm + t = tt +end + elseif m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_pairs(t) + local n, i = #t, 1 + while i < n do + local current = t[i] + if current == "/" and i > 1 then + local tl = t[i-1] + local tr = t[i+1] + local tn = t[i+2] + if type(tl) == "table" then + if isleft[tl[1]] and isright[tl[#tl]] then + tl[1] = "" -- todo: remove + tl[#tl] = nil + end + end + if type(tr) == "table" then + if tn == "^" then + -- brr 1/(1+x)^2 + elseif isleft[tr[1]] and isright[tr[#tr]] then + tr[1] = "" -- todo: remove + tr[#tr] = nil + end + end + i = i + 2 + elseif current == "," or current == ";" then + -- t[i] = current .. "\\thinspace" -- look sbad in (a,b) + i = i + 1 + else + i = i + 1 + end + end + return t +end + +local function collapse_parentheses(t) + local n, i = #t, 1 + if n > 2 then + while i < n do + local current = t[i] + if type(current) == "table" and isleft[t[i-1]] and isright[t[i+1]] then + local c = #current + if c > 2 and isleft[current[1]] and isright[current[c]] then + remove(current,c) + remove(current,1) + end + i = i + 3 + else + i = i + 1 + end + end + end + return t +end + +local function collapse_stupids(t) + local n, m, i = #t, 0, 1 + while i <= n do + m = m + 1 + local current = t[i] + if isstupid[current] then + local one = t[i+1] + if type(one) == "table" then + one = collapse(one,level) + t[m] = current .. "{" .. one .. "}" +-- t[m] = current .. "\\begingroup" .. one .. "\\endgroup" + i = i + 2 + else + t[m] = current + i = i + 1 + end + else + t[m] = current + i = i + 1 + end + end + if i == n then -- yes? + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_signs(t) + local n, m, i = #t, 0, 1 + while i <= n do + m = m + 1 + local current = t[i] + if isunary[current] then + local one = t[i+1] + if not one then +-- m = m + 1 + t[m] = current .. "{}" -- error + return t +-- break + end + if type(one) == "table" then + if isleft[one[1]] and isright[one[#one]] then + remove(one,#one) + remove(one,1) + end + one = collapse(one,level) + elseif one == "-" and i + 2 <= n then -- or another sign ? or unary ? + local t2 = t[i+2] + if type(t2) == "string" then + one = one .. t2 + i = i + 1 + end + end + t[m] = current .. "{" .. one .. "}" + i = i + 2 + elseif i + 2 <= n and isfunny[current] then + local one = t[i+1] + if isinfix[one] then + local two = t[i+2] + if two == "-" then -- or another sign ? or unary ? + local three = t[i+3] + if three then + if type(three) == "table" then + three = collapse(three,level) + end + t[m] = current .. one .. "{" .. two .. three .. "}" + i = i + 4 + else + t[m] = current + i = i + 1 + end + else + t[m] = current + i = i + 1 + end + else + t[m] = current + i = i + 1 + end + else + t[m] = current + i = i + 1 + end + end + if i == n then -- yes? + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_binaries(t) + local n, m, i = #t, 0, 1 + while i <= n do + m = m + 1 + local current = t[i] + if isbinary[current] then + local one = t[i+1] + local two = t[i+2] + if not one then + t[m] = current .. "{}{}" -- error +return t +-- break + end + if type(one) == "table" then + if isleft[one[1]] and isright[one[#one]] then + remove(one,#one) + remove(one,1) + end + one = collapse(one,level) + end + if not two then + t[m] = current .. "{" .. one .. "}{}" +return t +-- break + end + if type(two) == "table" then + if isleft[two[1]] and isright[two[#two]] then + remove(two,#two) + remove(two,1) + end + two = collapse(two,level) + end + t[m] = current .. "{" .. one .. "}{" .. two .. "}" + i = i + 3 + else + t[m] = current + i = i + 1 + end + end + if i == n then -- yes? + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_infixes_1(t) + local n, i = #t, 1 + while i <= n do + local current = t[i] + if isinfix[current] then + local what = t[i+1] + if what then + if type(what) == "table" then + local f, l = what[1], what[#what] + if isleft[f] and isright[l] then + remove(what,#what) + remove(what,1) + end + t[i+1] = collapse(what,level) -- collapse ? + end + i = i + 2 + else + break + end + else + i = i + 1 + end + end + return t +end + +function collapse_limits(t) + local n, m, i = #t, 0, 1 + while i <= n do + m = m + 1 + local current = t[i] + if islimits[current] then + local one, two, first, second = nil, nil, t[i+1], t[i+3] + if first and isinfix[first] then + one = t[i+2] + if one then + -- if type(one) == "table" then + -- if isleft[one[1]] and isright[one[#one]] then + -- remove(one,#one) + -- remove(one,1) + -- end + -- one = collapse(one,level) + -- end + if second and isinfix[second] then + two = t[i+4] + -- if type(two) == "table" then + -- if isleft[two[1]] and isright[two[#two]] then + -- remove(two,#two) + -- remove(two,1) + -- end + -- two = collapse(two,level) + -- end + end + if two then + t[m] = current .. "\\limits" .. first .. "{" .. one .. "}" .. second .. "{" .. two .. "}" + i = i + 5 + else + t[m] = current .. "\\limits" .. first .. "{" .. one .. "}" + i = i + 3 + end + else + t[m] = current + i = i + 1 + end + else + t[m] = current + i = i + 1 + end + else + t[m] = current + i = i + 1 + end + end + if i == n then -- yes? + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_tables(t) + local n, m, i = #t, 0, 1 + while i <= n do + m = m + 1 + local current = t[i] + if type(current) == "table" then + if current[1] == "\\NC" then + t[m] = collapse(current,level) + else + t[m] = "{" .. collapse(current,level) .. "}" + end + i = i + 1 + else + t[m] = current + i = i + 1 + end + end + if i == n then -- yes? + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_infixes_2(t) + local n, m, i = #t, 0, 1 + while i < n do + local current = t[i] + if isinfix[current] and i > 1 then + local tl = t[i-1] + local tr = t[i+1] + local ti = t[i+2] + local tn = t[i+3] + if ti and tn and isinfix[ti] then + t[m] = tl .. current .. "{" .. tr .. "}" .. ti .. "{" .. tn .. "}" + i = i + 4 + else + t[m] = tl .. current .. "{" .. tr .. "}" + i = i + 2 + end + else + m = m + 1 + t[m] = current + i = i + 1 + end + end + if i == n then + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_fractions_1(t) + local n, m, i = #t, 0, 1 + while i < n do + local current = t[i] + if current == "/" and i > 1 then + local tl = t[i-1] + local tr = t[i+1] + t[m] = "\\frac{" .. tl .. "}{" .. tr .. "}" + i = i + 2 + if i < n then + m = m + 1 + t[m] = t[i] + i = i + 1 + end + else + m = m + 1 + t[m] = current + i = i + 1 + end + end + if i == n then + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_fractions_2(t) + local n, m, i = #t, 0, 1 + while i < n do + local current = t[i] + if current == "⁄" and i > 1 then -- \slash + if i < n and t[i+1] == "⁄" then + -- crap for +-- t[m] = s_left .. "\\vfrac{" .. t[i-1] .. "}{" .. t[i+2] .. "}" .. s_right +-- t[m] = "\\fenced[asciimath:vfrac]{" .. t[i-1] .. "\\fence" .. t[i+2] .. "}" + t[m] = "\\hfrac{" .. t[i-1] .. "}{" .. t[i+2] .. "}" + i = i + 3 + else +-- t[m] = s_left .. "\\vfrac{" .. t[i-1] .. "}{" .. t[i+1] .. "}" .. s_right +-- t[m] = "\\fenced[asciimath:vfrac]{" .. t[i-1] .. "\\fence" .. t[i+1] .. "}" + t[m] = "\\hfrac{" .. t[i-1] .. "}{" .. t[i+1] .. "}" + i = i + 2 + end + if i < n then + m = m + 1 + t[m] = t[i] + i = i + 1 + end + else + m = m + 1 + t[m] = current + i = i + 1 + end + end + if i == n then + m = m + 1 + t[m] = t[n] + end + if m < n then + for i=n,m+1,-1 do + t[i] = nil + end + end + return t +end + +local function collapse_result(t) + local n = #t + if t[1] == s_left and t[n] == s_right then -- see bar .. space needed there + return concat(t," ",2,n-1) + else + return concat(t," ") + end +end + +collapse = function(t,level) + -- check + if not t then + return "" + end + -- tracing + if trace_details then + if level then + level = level + 1 + else + level = 1 + end + show_state(t,level,"parsed") + end + -- steps + t = collapse_matrices (t) if trace_details then show_state(t,level,"matrices") end + t = collapse_bars (t) if trace_details then show_state(t,level,"bars") end + t = collapse_stupids (t) if trace_details then show_state(t,level,"stupids") end + t = collapse_pairs (t) if trace_details then show_state(t,level,"pairs") end + t = collapse_parentheses(t) if trace_details then show_state(t,level,"parentheses") end + t = collapse_signs (t) if trace_details then show_state(t,level,"signs") end + t = collapse_binaries (t) if trace_details then show_state(t,level,"binaries") end + t = collapse_infixes_1 (t) if trace_details then show_state(t,level,"infixes (1)") end + t = collapse_limits (t) if trace_details then show_state(t,level,"limits") end + t = collapse_tables (t) if trace_details then show_state(t,level,"tables") end + t = collapse_infixes_2 (t) if trace_details then show_state(t,level,"infixes (2)") end + t = collapse_fractions_1(t) if trace_details then show_state(t,level,"fractions (1)") end + t = collapse_fractions_2(t) if trace_details then show_state(t,level,"fractions (2)") end + -- done + return collapse_result(t) +end + +-- todo: cache simple ones, say #str < 10, maybe weak + +local context = context +local ctx_mathematics = context and context.mathematics or report_asciimath +local ctx_type = context and context.type or function() end +local ctx_inleft = context and context.inleft or function() end + +local function convert(str,totex) + local unicoded = lpegmatch(u_parser,str) or str + local texcoded = collapse(lpegmatch(a_parser,unicoded)) + if trace_mapping then + show_result(str,unicoded,texcoded) + end + if totex then + ctx_mathematics(texcoded) + else + return texcoded + end +end + +local n = 0 +local p = ( + (S("{[(") + P("\\left" )) / function() n = n + 1 end + + (S("}])") + P("\\right")) / function() n = n - 1 end + + p_utf_base +)^0 + +-- faster: +-- +-- local p = ( +-- (S("{[(") + P("\\left" )) * Cc(function() n = n + 1 end) +-- + (S("}])") + P("\\right")) * Cc(function() n = n - 1 end) +-- + p_utf_base +-- )^0 + +local function invalidtex(str) + n = 0 + lpegmatch(p,str) + if n == 0 then + return false + elseif n < 0 then + return formatters["too many left fences: %s"](-n) + elseif n > 0 then + return formatters["not enough right fences: %s"](n) + end +end + +local collected = { } +local indexed = { } + +-- bonus + +local p_reserved_spaced = + C(lpeg.utfchartabletopattern(k_reserved_words)) / " %1 " + +local p_text = + C(P("text")) / " %1 " + * p_spaces^0 + * ( -- maybe balanced + (P("{") * (1-P("}"))^0 * P("}")) + + (P("(") * (1-P(")"))^0 * P(")")) + ) + + patterns.doublequoted + +local p_expand = Cs((p_text + p_reserved_spaced + p_utf_base)^0) +local p_compress = patterns.collapser + +local function cleanedup(str) + return lpegmatch(p_compress,lpegmatch(p_expand,str)) or str +end + +-- so far + +local function register(s,cleanedup,collected,shortname) + local c = cleanedup(s) + local f = collected[c] + if f then + f.count = f.count + 1 + f.files[shortname] = (f.files[shortname] or 0) + 1 + if s ~= c then + f.cleanedup = f.cleanedup + 1 + end + f.dirty[s] = (f.dirty[s] or 0) + 1 + else + local texcoded = convert(s) + local message = invalidtex(texcoded) + if message then + report_asciimath("%s: %s : %s",message,s,texcoded) + end + collected[c] = { + count = 1, + files = { [shortname] = 1 }, + texcoded = texcoded, + message = message, + cleanedup = s ~= c and 1 or 0, + dirty = { [s] = 1 } + } + end +end + +local function wrapup(collected,indexed) + local n = 0 + for k, v in sortedhash(collected) do + n = n + 1 + v.n= n + indexed[n] = k + end +end + +function collect(fpattern,element,collected,indexed) + local element = element or "am" + local mpattern = formatters["<%s>(.-)"](element,element) + local filenames = resolvers.findtexfile(fpattern) + if filenames and filenames ~= "" then + filenames = { filenames } + else + filenames = dir.glob(fpattern) + end + local cfpattern = gsub(fpattern,"^%./",lfs.currentdir()) + local cfpattern = gsub(cfpattern,"\\","/") + local wildcard = string.split(cfpattern,"*")[1] + if not collected then + collected = { } + indexed = { } + end + for i=1,#filenames do + filename = gsub(filenames[i],"\\","/") + local splitname = (wildcard and wildcard ~= "" and string.split(filename,wildcard)[2]) or filename + local shortname = gsub(splitname or file.basename(filename),"^%./","") + if shortname == "" then + shortname = filename + end + local fullname = resolvers.findtexfile(filename) or filename + if fullname ~= "" then + for s in gmatch(io.loaddata(fullname),mpattern) do + register(s,cleanedup,collected,shortname) + end + end + end + wrapup(collected,indexed) + return collected, indexed +end + +function filter(root,pattern,collected,indexed) + if not pattern or pattern == "" then + pattern = "am" + end + if not collected then + collected = { } + indexed = { } + end + for c in xmlcollected(root,pattern) do + register(xmltext(c),cleanedup,collected,xmlinclusion(c) or "" ) + end + wrapup(collected,indexed) + return collected, indexed +end + +asciimath.convert = convert +asciimath.reserved = reserved +asciimath.collect = collect +asciimath.filter = filter +asciimath.invalidtex = invalidtex +asciimath.cleanedup = cleanedup + +-- sin(x) = 1 : 3.3 uncached 1.2 cached , so no real gain (better optimize the converter then) + +local uncrapped = { + ["%"] = "\\mathpercent", + ["&"] = "\\mathampersand", + ["#"] = "\\mathhash", + ["$"] = "\\mathdollar", + ["^"] = "\\Hat{\\enspace}", -- terrible hack ... tex really does it sbest to turn any ^ into a superscript + ["_"] = "\\underline{\\enspace}", +} + +local function convert(str,nowrap) + mathematics.lastinput = str + if str ~= "" then + local unicoded = lpegmatch(u_parser,str) or str + if lpegmatch(p_onechar,unicoded) then + ctx_mathematics(uncrapped[unicoded] or unicoded) + else + local texcoded = collapse(lpegmatch(a_parser,unicoded)) + if trace_mapping then + show_result(str,unicoded,texcoded) + end + if #texcoded == 0 then + report_asciimath("error in asciimath: %s",str) + else + local message = invalidtex(texcoded) + if message then + report_asciimath("%s: %s : %s",message,str,texcoded) + ctx_type(formatters["<%s>"](message)) + elseif nowrap then + context(texcoded) + else + ctx_mathematics(texcoded) + end + end + end + end +end + +local context = context + +if not context then + +-- trace_mapping = true +-- trace_details = true + +-- report_asciimath(cleanedup([[ac+sinx+xsqrtx+sinsqrtx+sinsqrt(x)]])) +-- report_asciimath(cleanedup([[a "αsinsqrtx" b]])) +-- convert([[a "αsinsqrtx" b]]) +-- report_asciimath(cleanedup([[a "α" b]])) +-- report_asciimath(cleanedup([[//4]])) + +-- convert("leq\\leq") +-- convert([[\^{1/5}log]]) +-- convert("sqrt") +-- convert("^") + +-- convert[[\frac{a}{b}]] +-- convert[[frac{a}{b}]] + +-- convert("frac{a}{b}") +-- convert("\\sin{a}{b}") +-- convert("sin{a}{b}") +-- convert("1: rightarrow") +-- convert("2: \\rightarrow") + +-- convert("((1,2,3),(4,5,6),(7,8,9))") + +-- convert("1/(t+x)^2") + +-- convert("AA a > 0 ^^ b > 0 | {:log_g:} a + {:log_g:} b") +-- convert("AA a > 0 ^^ b > 0 | {:log_g:} a + {:log_g:} b") + +-- convert("10000,00001") +-- convert("4/18*100text(%)~~22,2") +-- convert("4/18*100text(%)≈22,2") +-- convert("62541/(197,6)≈316,05") + +-- convert([[sum x]]) +-- convert([[sum^(1)_(2) x]]) +-- convert([[lim_(1)^(2) x]]) +-- convert([[lim_(1) x]]) +-- convert([[lim^(2) x]]) + +-- convert([[{: rangle]]) +-- convert([[\langle\larr]]) +-- convert([[langlelarr]]) +-- convert([[D_f=[0 ,→〉]]) +-- convert([[ac+sinx+xsqrtx]]) +-- convert([[ac+\alpha x+xsqrtx-cc b*pi**psi-3alephx / bb X]]) +-- convert([[ac+\ ^ x+xsqrtx]]) +-- convert([[d/dx(x^2+1)]]) +-- convert([[a "αsinsqrtx" b]]) +-- convert([[a "α" b]]) +-- convert([[//4]]) +-- convert([[ {(a+b,=,1),(a+b,=,7)) ]]) + +-- convert([[ 2/a // 5/b = (2 b) / ( a b) // ( 5 a ) / ( a b ) = (2 b ) / ( 5 a ) ]]) +-- convert([[ (2+x)/a // 5/b ]]) + +-- convert([[ ( 2/a ) // ( 5/b ) = ( (2 b) / ( a b) ) // ( ( 5 a ) / ( a b ) ) = (2 b ) / ( 5 a ) ]]) + +-- convert([[ (x/y)^3 = x^3/y^3 ]]) + +-- convert([[ {: (1,2) :} ]]) +-- convert([[ {: (a+b,=,1),(a+b,=,7) :} ]]) +-- convert([[ { (a+b,=,1),(a+b,=,7) :} ]]) +-- convert([[ {: (a+b,=,1),(a+b,=,7) } ]]) +-- convert([[ { (a+b,=,1),(a+b,=,7) } ]]) + +-- convert([[(1,5 ±sqrt(1,25 ),0 )]]) +-- convert([[1//2]]) +-- convert([[(p)/sqrt(p)]]) +-- convert([[u_tot]]) +-- convert([[u_tot=4,4 L+0,054 T]]) + +-- convert([[ [←;0,2] ]]) +-- convert([[ [←;0,2⟩ ]]) +-- convert([[ ⟨←;0,2 ) ]]) +-- convert([[ ⟨←;0,2 ] ]]) +-- convert([[ ⟨←;0,2⟩ ]]) + +-- convert([[ x^2(x-1/16)=0 ]]) +-- convert([[ y = ax + 3 - 3a ]]) +-- convert([[ y= ((1/4)) ^x ]]) +-- convert([[ x=\ ^ (1/4) log(0 ,002 )= log(0,002) / (log(1/4) ]]) +-- convert([[ x=\ ^glog(y) ]]) +-- convert([[ x^ (-1 1/2) =1/x^ (1 1/2)=1/ (x^1*x^ (1/2)) =1/ (xsqrt(x)) ]]) +-- convert([[ x^2(10 -x)>2 x^2 ]]) +-- convert([[ x^4>x ]]) + + return + +end + +interfaces.implement { + name = "asciimath", + actions = convert, + arguments = "string" +} + +interfaces.implement { + name = "texasciimath", + actions = convert, + arguments = { "string", true }, +} + +interfaces.implement { + name = "xmlasciimath", + actions = function(id) + convert(xmlpure(lxmlgetid(id))) + end, + arguments = "string" +} + +local ctx_typebuffer = context.typebuffer +local ctx_mathematics = context.mathematics +local ctx_color = context.color + +local sequenced = table.sequenced +local assign_buffer = buffers.assign + +local show = { } +asciimath.show = show + +local collected, indexed, ignored = { }, { }, { } + +local color = { "darkred" } + +function show.ignore(n) + if type(n) == "string" then + local c = collected[n] + n = c and c.n + end + if n then + ignored[n] = true + end +end + +function show.count(n,showcleanedup) + local v = collected[indexed[n]] + local count = v.count + local cleanedup = v.cleanedup + if not showcleanedup or cleanedup == 0 then + context(count) + elseif count == cleanedup then + ctx_color(color,count) + else + context("%s+",count-cleanedup) + ctx_color(color,cleanedup) + end +end + +local h = { } +local am = { "am" } + +function show.nofdirty(n) + local k = indexed[n] + local v = collected[k] + local n = v.cleanedup + h = { } + if n > 0 then + for d, n in sortedhash(v.dirty) do + if d ~= k then + h[#h+1] = { d, n } + end + end + end + context(#h) +end + +function show.dirty(m,wrapped) + local d = h[m] + if d then + ctx_inleft(d[2]) + if wrapped then + assign_buffer("am",'"' .. d[1] .. '"') + else + assign_buffer("am",d[1]) + end + ctx_typebuffer(am) + end +end + +function show.files(n) + context(sequenced(collected[indexed[n]].files," ")) +end + +function show.input(n,wrapped) + if wrapped then + assign_buffer("am",'"' .. indexed[n] .. '"') + else + assign_buffer("am",indexed[n]) + end + ctx_typebuffer(am) +end + +function show.result(n) + local v = collected[indexed[n]] + if ignored[n] then + context("ignored") + elseif v.message then + ctx_color(color, v.message) + else + ctx_mathematics(v.texcoded) + end +end + +function show.load(str,element) + collected, indexed, ignored = { }, { }, { } + local t = utilities.parsers.settings_to_array(str) + for i=1,#t do + asciimath.collect(t[i],element or "am",collected,indexed) + end +end + +function show.filter(id,element) + collected, indexed, ignored = { }, { }, { } + asciimath.filter(lxmlgetid(id),element or "am",collected,indexed) +end + +function show.max() + context(#indexed) +end + +function show.statistics() + local usedfiles = { } + local noffiles = 0 + local nofokay = 0 + local nofbad = 0 + local nofcleanedup = 0 + for k, v in next, collected do + if ignored[v.n] then + nofbad = nofbad + v.count + elseif v.message then + nofbad = nofbad + v.count + else + nofokay = nofokay + v.count + end + nofcleanedup = nofcleanedup + v.cleanedup + for k, v in next, v.files do + local u = usedfiles[k] + if u then + usedfiles[k] = u + 1 + else + noffiles = noffiles + 1 + usedfiles[k] = 1 + end + end + end + local NC = context.NC + local NR = context.NR + local EQ = context.EQ + context.starttabulate { "|B||" } + NC() context("files") EQ() context(noffiles) NC() NR() + NC() context("formulas") EQ() context(nofokay+nofbad) NC() NR() + NC() context("uniques") EQ() context(#indexed) NC() NR() + NC() context("cleanedup") EQ() context(nofcleanedup) NC() NR() + NC() context("errors") EQ() context(nofbad) NC() NR() + context.stoptabulate() +end + +function show.save(name) + table.save(name ~= "" and name or "dummy.lua",collected) +end diff --git a/Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.mkxl new file mode 100644 index 00000000000..a5eb5b5963b --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/x-asciimath.mkxl @@ -0,0 +1,497 @@ +%D \module +%D [ file=x-asciimath, +%D version=2014.06.01, % 2006.04.24, % 1999.11.06, +%D title=\CONTEXT\ Modules, +%D subtitle=AsciiMath, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{x-asciimath}{autosuffix} + +%D When the Math4All project started, we immediately started using content \MATHML. +%D Because in school math there is often a reference to calculator input, we also +%D provided what we called \quote {calcmath}: a predictable expression based way +%D entering math. At some point \OPENMATH\ was also used but that was later +%D abandoned because editing is more cumbersome. +%D +%D Due to limitations in the web variant (which is independent of rendering for +%D paper but often determines the coding of document, not seldom for the worse) the +%D switch was made to presentational \MATHML. But even that proved to be too complex +%D for rendering on the web, so it got converted to so called \ASCIIMATH\ which +%D can be rendered using some \JAVASCRIPT\ magic. However, all the formulas (and +%D we're talking of tens of thousands of them) were very precisely coded by the main +%D author. Because in intermediate stages of the editing (by additional authors) a +%D mixture of \MATHML\ and \ASCIIMATH\ was used, we wrote the first version of this +%D module. As reference we took \url +%D {http://www1.chapman.edu/~jipsen/mathml/asciimath.html} and. The idea was to +%D stick to \MATHML\ as reference and if needed use \ASCIIMATH\ as annotation. +%D +%D Eventually we ended up with supporting several math encodings in \CONTEXT\ that +%D could be used mixed: content \MATHML\ (preferred), presentation \MATHML\ (often +%D messy), \OPENMATH\ (somewhat minimalistic) calcmath (handy for students who are +%D accustomed to calculators), \ASCIIMATH\ (to make web support easier) and of +%D course \TEX. +%D +%D The first version had some limitations as we didn't want to support all quirks of +%D \ASCIIMATH\ and also because I was not really in the mood to write a complex parser +%D when a bit of sane coding can work equally well. Some comments from that version: +%D +%D \startnarrower +%D \startitemize +%D \item We support only the syntactically clear variants and as long as lpeg does +%D not support left recursion this is as far as we want to go. +%D \item The parser is rather insensitive for spaces but yet the advice is to avoid +%D weird coding like \type {d/dxf(x)} but use \type {d/dx f(x)} instead. After +%D all we're not in a compact coding cq.\ parser challenge. +%D \item We also don't support the somewhat confusing \type {sqrt sqrt 2} nor \type +%D {root3x} (although the second one kind of works). A bit of defensive coding +%D does not hurt. +%D \item We can process \type {a/b/c/d} but it's not compatible with the default +%D behaviour of \ASCIIMATH. Use grouping instead. Yes, we do support the somewhat +%D nonstandard grouping token mix. +%D \item You should use explicit \type {text(..)} directives as one can never be sure +%D what is a reserved word and not. +%D \stopitemize +%D +%D Actually, as the only parsing sensitive elements of \TEX\ are fractions (\type {\over} +%D and friends, a restricted use of \TEX\ coding is probably as comprehensive and +%D parsable. The webpage with examples served as starting point so anything beyond +%D what can be found there isn't supported. +%D \stopnarrower +%D +%D Then in 2014 something bad happened. Following the fashion of minimal encoding +%D (which of course means messy encoding of complex cases and which can make authors +%D sloppy too) the web based support workflow of the mentioned project ran into some +%D limitations and magically one day all carefully coded \MATHML\ was converted into +%D \ASCIIMATH. As there was no way to recover the original thousands of files and +%D tens of thousands of formulas we were suddenly stuck with \ASCIIMATH. Because the +%D conversion had be done automagically, we also saw numerous errors and were forced +%D to come up with some methods to check formulas. Because \MATHML\ poses some +%D restrictions it has predictable rendering; \ASCIIMATH\ on the other hand enforces +%D no structure. Also, because \MATHML\ has to be valid \XML\ it always processes. +%D Of course, during the decade that the project had run we also had to built in +%D some catches for abuse but at least we had a relatively stable and configurable +%D subsystem. So, in order to deal with less predictable cases as well as extensive +%D checking, a new \ASCIIMATH\ parser was written, one that could also be used to +%D trace bad coding. +%D +%D Because the formal description is incomplete, and because some links to resources +%D are broken, and because some testing on the web showed that sequences of characters +%D are interpreted that were not mentioned anywhere (visible), and because we noticed +%D that the parser was dangerously tolerant, the new code is quite different from the +%D old code. +%D +%D One need to keep in mind that because spaces are optional, the only robust way to +%D edit \ASCIIMATH\ is to use a \WYSIWYG\ editor and hope that the parser doesn't +%D change ever. Keys are picked up from spaceless sequences and when not recognized +%D a (sequence) of characters is considered to be variables. So, \type {xsqrtx} is +%D valid and renders as \type {$x\sqrt{x}$}, \type {xx} becomes \type {×} (times) +%D but \type {ac} becomes \type {$a c$} (a times c). We're lucky that \type {AC} is +%D not turned into Alternating Current, but who knows what happens a few years from +%D now. So, we do support this spaceless mess, but users are warned: best use a +%D spacy sequence. The extra amount of spaces (at one byte each) an author has to +%D include in his|/|her active writing time probably stays below the size of one +%D holiday picture. Another complication is that numbers (in Dutch) use commas instead +%D of periods, but vectors use commas as well. We also hav esome different names for +%D functions which then can conflict with the expectations about collapsed variables. +%D +%D It must be noted that simplified encodings (that seem to be the fashion today) +%D can demand from applications to apply fuzzy logic to make something work out +%D well. Because we have sequential data that gets rendered, sometimes wrong input +%D gets obscured simply by the rendering: like the comma's in numbers as well as +%D for separators (depending on space usage), or plain wrong symbols that somehow +%D get a representation anyway. This in itself is more a side effect of trying to +%D use the simplified encoding without applying rules (in the input) or to use it +%D beyong its intended usage, which then of course can lead to adapted parsers and +%D catches that themselves trigger further abuse. Imagine that instead of developing +%D new cars, planes, space ships, mobile phones, computers we would have adapted +%D horse cars, kites, firework, old fashioned phones and mechanical calculators in a +%D similar way: patch upon patch of traditional means for sure would not have +%D worked. So, when you use \ASCIIMATH\ best check immediately how it gets rendered +%D in the browser as well as on paper. And be prepared to check the more complex +%D code in the future again. We don't offer any guarantees but of course will try to +%D keep up. +%D +%D In retrospect I sometimes wonder if the energy put into constantly adapting to +%D the fashion of the day pays off. Probably not. It definitely doesn't pay of. +%D +%D More complex crap: +%D +%D 1: $x + \stackrel{comment}{\stackrel{\utfchar{"23DE}}{yyyyyyyy}} = y$ \blank +%D 2: \asciimath{x + stackrel{\utfchar{"23DE}}{yyyyyyyy} = y} \blank +%D 3: \asciimath{x + stackrel{yyyyyyyy}{\utfchar{"23DE}} = y} \blank +%D 4: \asciimath{x + stackrel{"comment"}{stackrel{\utfchar{"23DE}}{yyyyyyyy}} = y} \blank + +\usemodule[mathml-basics] + +\startmodule[asciimath] + +\unprotect + +\writestatus{asciimath}{beware, this is an experimental (m4all only) module} + +%D Hacks: + +\permanent\protected\def\asciimathoptext #1{\ifmmode\mathoptext{#1}\else#1\fi} +\permanent\protected\def\asciimathoptexttraced #1{\ifmmode\mathoptext{\color[darkgreen]{#1}}\else\color[darkgreen]{#1}\fi} +\permanent\protected\def\asciimathstackrel #1#2{\mathematics{\mathop{\math_relax_limits\mover{#2}{#1}}}} +\permanent\protected\def\asciimathroot #1#2{\sqrt[#1]{#2}} +\permanent\protected\def\asciimathsqrt #1{\sqrt{#1}} + +%D The core commands: + +\installsetuponlycommandhandler {asciimath} {asciimath} + +\appendtoks + \ctxlua{moduledata.asciimath.setup { + splitmethod = "\asciimathparameter\c!splitmethod", + separator = "\asciimathparameter\c!separator", + symbol = "\asciimathparameter\c!symbol", + }}% +\to \everysetupasciimath + +\newtoks\everyasciimath + +% \appendtoks +% \ignorediscretionaries % yes or no +% \to \everyasciimath + +% \appendtoks +% \enableautofences +% \enableautofencemode +% \to \everyasciimath + +\permanent\tolerant\protected\def\asciimath[#1]#:#2% + {\mathematics + [#1]% + {\expand\everyasciimath + \clf_texasciimath{\detokenize\expandafter{\normalexpanded{#2}}}}} + +\permanent\tolerant\protected\def\xmlasciimath[#1]#:#2% + {\mathematics + [#1]% + {\expand\everyasciimath + \clf_xmlasciimath{#2}}} + +\permanent\protected\def\ctxmoduleasciimath#1% + {\ctxlua{moduledata.asciimath.#1}} + +%D Some tracing commands. Using tex commands is 10\% slower that directly piping +%D from \LUA, but this is non|-|critical code. + +\permanent\protected\def\ShowAsciiMathLoad [#1]{\ctxlua{moduledata.asciimath.show.load("#1")}} +\permanent\protected\def\ShowAsciiMathIgnore[#1]{\ctxlua{moduledata.asciimath.show.ignore("#1")}} +\permanent\protected\def\ShowAsciiMathXML #1#2{\ctxlua{moduledata.asciimath.show.filter("#1","#2")}} +\permanent\protected\def\ShowAsciiMathStats {\ctxlua{moduledata.asciimath.show.statistics()}} +\permanent\protected\def\ShowAsciiMathMax {\ctxlua{moduledata.asciimath.show.max()}} + +\permanent\protected\def\ShowAsciiMathResult#1% + {\begingroup + \blank + % if we are in vmode, we don't get positions i.e. a smaller tuc file + \inleft{\ttbf#1\hfill\ctxlua{moduledata.asciimath.show.count(#1,true)}}% + \dontleavehmode + \begingroup + \ttbf + \ctxlua{moduledata.asciimath.show.files(#1)} + \endgroup + \blank[\v!medium,\v!samepage] + \startcolor[darkblue] + \ctxlua{moduledata.asciimath.show.input(#1,true)} + \stopcolor + \blank[medium,samepage] + \doifmode{asciimath:show:dirty} { + \dorecurse{\ctxlua{moduledata.asciimath.show.nofdirty(#1)}} { + \ctxlua{moduledata.asciimath.show.dirty(\recurselevel,true)} + \blank[\v!medium,\v!samepage] + } + } + \ctxlua{moduledata.asciimath.show.result(#1)} + \blank + \endgroup} + +\permanent\protected\def\ShowAsciiMathStart + {\begingroup + \let\asciimathoptext\asciimathoptexttraced + \setuptyping[\v!buffer][\c!before=,\c!after=] + \setupmargindata[\v!left][\c!style=]} + +\permanent\protected\def\ShowAsciiMathStop + {\endgroup} + +\permanent\tolerant\protected\def\ShowAsciiMath[#1]#*[#2]% + {\ifparameter#1\or + \ShowAsciiMathStart + \ShowAsciiMathLoad[#1] + \ifparameter#2\or + \ShowAsciiMathIgnore[#2] + \fi + \dorecurse{\ShowAsciiMathMax}{\ShowAsciiMathResult\recurselevel} + \page + \ShowAsciiMathStats + \ShowAsciiMathStop + \fi} + +\permanent\protected\def\xmlShowAsciiMath#1#2% + {\ifparameter#1\or + \ShowAsciiMathStart + \ShowAsciiMathXML{#1}{#2}% + \dorecurse{\ShowAsciiMathMax}{\ShowAsciiMathResult\recurselevel} + \page + \ShowAsciiMathStats + \ShowAsciiMathStop + \fi} + +\permanent\tolerant\protected\def\ShowAsciiMathSave[#1]% + {\ctxlua{moduledata.asciimath.show.save("#1")}} + +% extras: + +% if not then we need an extra class + +% \inherited\setmathspacing \mathclosecode \mathmiddlecode \alldisplaystyles \thickmuskip +% \inherited\setmathspacing \mathclosecode \mathmiddlecode \allunsplitstyles \pettymuskip + +\protect + +\startsetups asciimath:layout + + \setupbodyfont + % [pagella,10pt] + [dejavu,10pt] + + \setuplayout + [backspace=35mm, + leftmargin=20mm, + rightmargindistance=0pt, + leftmargindistance=5mm, + cutspace=1cm, + topspace=1cm, + bottomspace=1cm, + width=middle, + height=middle, + header=0cm, + footer=1cm] + + \setupheadertexts + [] + + \setupfootertexts + [\currentdate][\pagenumber] + + \setupalign + [flushleft,verytolerant,stretch] + + \dontcomplain + +\stopsetups + +\stopmodule + +\continueifinputfile{x-asciimath.mkxl} + +%D This will become an extra. + +\starttext + +\setups[asciimath:layout] + +% \enabletrackers[modules.asciimath.mapping] +% \enabletrackers[modules.asciimath.detail] + +% \starttext +% \enablemode[asciimath:show:dirty] +% \ShowAsciiMath[e:/temporary/asciimath/*.xml] +% % \ShowAsciiMathSave[e:/temporary/asciimath/asciimath.lua] +% \stoptext + +\subject{Some tests} + +\enabletrackers[modules.asciimath.mapping] + +\showglyphs + +\asciimath{x + (a/b)//(d/c) + x} + +% $\mathoptext{\meaning|!}$ + +\asciimath{a text(|) b} + +% a \asciimathoptext{{|}} b + +% {\left.{\left\lparent \frac{a}{b} \right\rparent}\middle/{\left\lparent \frac{d}{c} \right\rparent}\right.} +% \vfrac + % {\left.{\left\lparent \frac{a}{b} \right\rparent}} + % {{\left\lparent \frac{d}{c} \right\rparent}\right.} + +% \protected\def\MyAsciiMath#1{\startformula\asciimath{#1}\stopformula} +% +% \startlines +% \MyAsciiMath{x^2 / 10 // z_12^34 / 20} +% \MyAsciiMath{{:{:x^2:} / 10:} // {:{:z_12^34 :} / 20:}} +% \MyAsciiMath{x^2+y_1+z_12^34} +% \MyAsciiMath{sin^-1(x)} +% \MyAsciiMath{d/dx f(x)=lim_(h->0) (f(x+h)-f(x))/h} +% \MyAsciiMath{f(x)=sum_(n=0)^oo(f^((n))(a))/(n!)(x-a)^n} +% \MyAsciiMath{int_0^1 f(x)dx} +% \MyAsciiMath{int^1_0 f(x)dx} +% \MyAsciiMath{a//b} +% \MyAsciiMath{a//\alpha} +% \MyAsciiMath{(a/b)/(d/c)} +% \MyAsciiMath{((a*b))/(d/c)} +% \MyAsciiMath{[[a,b],[c,d]]((n),(k))} +% \MyAsciiMath{1/x={(1,text{if } x!=0),(text{undefined},if x=0):}} +% \MyAsciiMath{{ (1,2), (x,(x + text(x))) }} +% \MyAsciiMath{{(1,2),(x,(x+text(x))),(x,text(x))}} +% \MyAsciiMath{{(1,2),(x,(x+text(x))),(x,x text(x))}} +% \MyAsciiMath{{(1,2/2),(x,(x+x^22+sqrt(xx))),(x,x text(xyz))}} +% \MyAsciiMath{{(1,2/2),(x,(x+x^22+sqrt(xx))),(x,text(xyz)+1+text(hans))}} +% \MyAsciiMath{<> text{and} {:(x,y),(u,v):}} +% \MyAsciiMath{(a,b] = {x text(in) RR | a < x <= b}} +% \MyAsciiMath{a/b / c/d = (a * d) / (b * d) / (b * c) / (b * d) = (a * d) / (b * c)} +% \MyAsciiMath{ (a/b) // (c/d) = ( (a * d) / (b * d) ) // ( (b * c) / (b * d) ) = (a * d) / (b * c)} +% \MyAsciiMath{sin(x+1)_3^2/b / c/d} +% \MyAsciiMath{{:{:sin(x+1)_3^2:}/b:} / {:c/d:}} +% \MyAsciiMath{cos(a) + sin(x+1)_3^2/b / c/d = (a * d) / (b * d) / (b * c) / (b * d) = (a * d) / (b * c)} +% \MyAsciiMath{S_(11)} +% \MyAsciiMath{f(x)} +% \MyAsciiMath{sin(x)} +% \MyAsciiMath{sin(x+1)} +% \MyAsciiMath{sin^-1(x)} +% \MyAsciiMath{sin(2x)} +% \MyAsciiMath{a_2^2} +% \MyAsciiMath{( (S_(11),S_(12),S_(1n)),(vdots,ddots,vdots),(S_(m1),S_(m2),S_(mn)) ]} +% \MyAsciiMath{frac a b} +% \MyAsciiMath{sin(x)/2 // cos(x)/pi} +% \MyAsciiMath{a/13 // c/d} +% \MyAsciiMath{a/b // c/d} +% \MyAsciiMath{x} +% \MyAsciiMath{x^2} +% \MyAsciiMath{sqrt x} +% \MyAsciiMath{sqrt (x)} +% \MyAsciiMath{root 2 x} +% \MyAsciiMath{x+x} +% \MyAsciiMath{x/3} +% \MyAsciiMath{x^2 / 10} +% \MyAsciiMath{x^2 / 10 // z_12^34 / 20} +% \MyAsciiMath{a^23} +% \MyAsciiMath{a^{:b^23:}+3x} +% \MyAsciiMath{a/b / c/d} +% \MyAsciiMath{sin(x)/b / c/d} +% \MyAsciiMath{sin(x)/b // c/d} +% \MyAsciiMath{a/b / c/d = (a * d) / (b * d) / (b * c) / (b * d) = (a * d) / (b * c) } +% \MyAsciiMath{{:{:x^2:} / 10:} // {:{:z_12^34 :} / 20:}} +% \MyAsciiMath{x^2+y_1+z_12^34} +% \MyAsciiMath{sin^-1(x)} +% \MyAsciiMath{d/dx f(x)=lim_(h->0) (f(x+h)-f(x))/h} +% \MyAsciiMath{f(x)=sum_(n=0)^oo(f^((n))(a))/(n!)(x-a)^n} +% \MyAsciiMath{int_0^1 f(x)dx} +% \MyAsciiMath{int^1_0 f(x)dx} +% \MyAsciiMath{2x} +% \MyAsciiMath{a//b} +% \MyAsciiMath{a//\alpha} +% \MyAsciiMath{(a/b)/(d/c)} +% \MyAsciiMath{((a*b))/(d/c)} +% \MyAsciiMath{[[a,b],[c,d]]((n),(k))} +% \MyAsciiMath{1/x={(1,text{if } x!=0),(text{undefined},if x=0):}} +% \MyAsciiMath{{ (1,2), (x,(x + text(x))) }} +% \MyAsciiMath{{(1,2),(x,(x+text(x))),(x,text(x))}} +% \MyAsciiMath{{(1,2),(x,(x+text(x))),(x,x text(x))}} +% \MyAsciiMath{{(1,2/2),(x,(x+x^22+sqrt(xx))),(x,x text(xyz))}} +% \MyAsciiMath{{(1,2/2),(x,(x+x^22+sqrt(xx))),(x,text(xyz)+1+text(hans))}} +% \MyAsciiMath{<> text{and} {:(x,y),(u,v):}} +% \MyAsciiMath{(a,b] = {x text(in) RR | a < x <= b}} +% \MyAsciiMath{x^-2} +% \MyAsciiMath{x^2(x-1/16)=0} +% \MyAsciiMath{y= ((1/4)) ^x} +% \MyAsciiMath{log (0,002) / (log(1/4))} +% \MyAsciiMath{x=ax+b \ oeps} +% \MyAsciiMath{x=\ ^ (1/4) log(x)} +% \MyAsciiMath{x=\ ^ (1/4) log(0 ,002 )= log(0,002) / (log(1/4))} +% \MyAsciiMath{x^ (-1 1/2) =1/x^ (1 1/2)=1/ (x^1*x^ (1/2)) =1/ (xsqrt(x))} +% \MyAsciiMath{x^2(10 -x)>2 x^2} +% \MyAsciiMath{x^4>x} +% \stoplines + +% \setupasciimath[splitmethod=3,symbol={{,}}] +% +% \startlines +% \asciimath{sqrt 1} +% \asciimath{sqrt 1.2} +% \asciimath{sqrt 1.2} +% \asciimath{1} +% \asciimath{12} +% \asciimath{123} +% \asciimath{1234} +% \asciimath{12345} +% \asciimath{123456} +% \asciimath{1234567} +% \asciimath{12345678} +% \asciimath{123456789} +% \asciimath{1.1} +% \asciimath{12.12} +% \asciimath{1234.123} +% \asciimath{1234.1234} +% \asciimath{12345.1234} +% \asciimath{1234.12345} +% \asciimath{12345.12345} +% \asciimath{123456.123456} +% \asciimath{1234567.1234567} +% \asciimath{12345678.12345678} +% \asciimath{123456789.123456789} +% \asciimath{0.1234} +% \asciimath{1234.0} +% \asciimath{1234.00} +% \asciimath{0.123456789} +% \stoplines + +% \definemixedcolumns[asciimath][n=3,balance=yes] +% +% \startluacode +% local asciimath = moduledata.asciimath +% local variables = { "w", "x", "y", "z", "p", "q", "r" } +% local constants = { "a", "b", "c" } +% local functions = { "g", "h", "i" } +% local iterators = { "i", "j", "k" } +% local vectors = { "A", "B", "C", "D", "E", "P", "Q", "R" } +% local reserved = { } +% local reserved = { +% -- "vdots","ddots","oint", +% "grad", "prod", "prop", "sube", "supe", "sum", +% "vvv", "nnn", "uuu", "sub", "sup", +% "iff", "int", "del", +% "sinh", "cosh", "tanh", "sin", "cos", "tan", "csc", "sec", "cot", +% "atan", "asin", "acos", "arctan", "arcsin", "arccos", +% "log", "ln", "det", "lim", "mod", "gcd", -- "lcm", +% "min", "max", +% "xx", "in", "ox", "vv", "nn", "uu", "oo", "bb", +% "not", "and", "or", "if", +% "AA", "EE", "TT", +% "sqrt", "root", "frac", "stackrel", +% "hat", "overbar", "underline", "vec", +% "dx", "dy", "dz", +% } +% for c=1,#constants do +% for r=1,#reserved do +% context.startmixedcolumns { "asciimath" } +% for v1=1,#variables do +% for v2=1,#variables do +% local str = constants[c] .. variables[v1] .. reserved[r] .. variables[v2] +% context.type(str) +% context.quad() +% commands.asciimath(str) +% context.par() +% end +% end +% context.stopmixedcolumns() +% context.blank() +% end +% end +% \stopluacode + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.lmt b/Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.lmt new file mode 100644 index 00000000000..41a43cacde7 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.lmt @@ -0,0 +1,364 @@ +if not modules then modules = { } end modules ['x-calcmath'] = { + version = 1.001, + comment = "companion to x-calcmath.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- this really needs to be redone + +local next, type = next, type +local format, lower, upper, gsub, sub = string.format, string.lower, string.upper, string.gsub, string.sub +local concat = table.concat +local lpegmatch = lpeg.match + +local calcmath = { } +local moduledata = moduledata or { } +moduledata.calcmath = calcmath + +local context = context + +local list_1 = { + "median", "min", "max", "round", "ln", "log", + "sin", "cos", "tan", "sinh", "cosh", "tanh" +} +local list_2 = { + "int", "sum", "prod" +} +local list_3 = { + "f", "g" +} +local list_4 = { + "pi", "inf" +} + +local list_1_1 = { } +local list_2_1 = { } +local list_2_2 = { } +local list_2_3 = { } +local list_4_1 = { } + +local frozen = false + +local function freeze() + for k=1,#list_1 do + local v = list_1[k] + list_1_1[v] = "\\".. upper(v) .." " + end + for k=1,#list_2 do + local v = list_2[k] + list_2_1[v .. "%((.-),(.-),(.-)%)"] = "\\" .. upper(v) .. "^{%1}_{%2}{%3}" + list_2_2[v .. "%((.-),(.-)%)"] = "\\" .. upper(v) .. "^{%1}{%2}" + list_2_3[v .. "%((.-)%)"] = "\\" .. upper(v) .. "{%1}" + end + for k=1,#list_4 do + local v = list_4[k] + list_4_1[v] = "\\" .. upper(v) + end + frozen = true +end + +local entities = { + ['gt'] = '>', + ['lt'] = '<', +} + +local symbols = { + ["<="] = "\\LE ", + [">="] = "\\GE ", + ["=<"] = "\\LE ", + ["=>"] = "\\GE ", + ["=="] = "\\EQ ", + ["<" ] = "\\LT ", + [">" ] = "\\GT ", + ["="] = "\\EQ ", +} + +local function nsub(str,tag,pre,post) + return (gsub(str,tag .. "(%b())", function(body) + return pre .. nsub(sub(body,2,-2),tag,pre,post) .. post + end)) +end + +local function totex(str,mode) + if not frozen then freeze() end + local n = 0 + -- crap + str = gsub(str,"%s+",' ') + -- xml + str = gsub(str,"&(.-);",entities) + -- ...E... + str = gsub(str,"([%-%+]?[%d%.%+%-]+)E([%-%+]?[%d%.]+)", "{\\SCINOT{%1}{%2}}") + -- ^-.. + str = gsub(str,"%^([%-%+]*%d+)", "^{%1}") + -- ^(...) + str = nsub(str,"%^", "^{", "}") + -- 1/x^2 + repeat + str, n = gsub(str,"([%d%w%.]+)/([%d%w%.]+%^{[%d%w%.]+})", "\\frac{%1}{%2}") + until n == 0 + -- todo: autoparenthesis + -- int(a,b,c) + for k, v in next, list_2_1 do + repeat str, n = gsub(str,k,v) until n == 0 + end + -- int(a,b) + for k, v in next, list_2_2 do + repeat str, n = gsub(str,k,v) until n == 0 + end + -- int(a) + for k, v in next, list_2_3 do + repeat str, n = gsub(str,k,v) until n == 0 + end + -- sin(x) => {\\sin(x)} + for k, v in next, list_1_1 do + repeat str, n = gsub(str,k,v) until n == 0 + end + -- mean + str = nsub(str, "mean", "\\OVERLINE{", "}") + -- (1+x)/(1+x) => \\FRAC{1+x}{1+x} + repeat + str, n = gsub(str,"(%b())/(%b())", function(a,b) + return "\\FRAC{" .. sub(a,2,-2) .. "}{" .. sub(b,2,-2) .. "}" + end ) + until n == 0 + -- (1+x)/x => \\FRAC{1+x}{x} + repeat + str, n = gsub(str,"(%b())/([%+%-]?[%.%d%w]+)", function(a,b) + return "\\FRAC{" .. sub(a,2,-2) .. "}{" .. b .. "}" + end ) + until n == 0 + -- 1/(1+x) => \\FRAC{1}{1+x} + repeat + str, n = gsub(str,"([%.%d%w]+)/(%b())", function(a,b) + return "\\FRAC{" .. a .. "}{" .. sub(b,2,-2) .. "}" + end ) + until n == 0 + -- 1/x => \\FRAC{1}{x} + repeat + str, n = gsub(str,"([%.%d%w]+)/([%+%-]?[%.%d%w]+)", "\\FRAC{%1}{%2}") + until n == 0 + -- times + str = gsub(str,"%*", " ") + -- symbols -- we can use a table substitution here + str = gsub(str,"([<>=][<>=]*)", symbols) + -- functions + str = nsub(str,"sqrt", "\\SQRT{", "}") + str = nsub(str,"exp", "e^{", "}") + str = nsub(str,"abs", "\\left|", "\\right|") + -- d/D + str = nsub(str,"D", "{\\FRAC{\\MBOX{d}}{\\MBOX{d}x}{(", ")}}") + str = gsub(str,"D([xy])", "\\FRAC{{\\RM d}%1}{{\\RM d}x}") + -- f/g + for k,v in next, list_3 do -- todo : prepare k,v + str = nsub(str,"D"..v,"{\\RM "..v.."}^{\\PRIME}(",")") + str = nsub(str,v,"{\\RM "..v.."}(",")") + end + -- more symbols + for k,v in next, list_4_1 do + str = gsub(str,k,v) + end + -- parenthesis (optional) + if mode == 2 then + str = gsub(str,"%(", "\\left(") + str = gsub(str,"%)", "\\right)") + end + -- csnames + str = gsub(str,"(\\[A-Z]+)", lower) + -- report + return str +end + +calcmath.totex = totex + +function calcmath.tex(str,mode) + context(totex(str)) +end + +function calcmath.xml(id,mode) + context(totex(lxml.id(id).dt[1],mode)) +end + +-- work in progress ... lpeg variant + +if false then + + -- todo: + + -- maybe rewrite to current lpeg, i.e. string replacement and no Cc's + + -- table approach we have now is less efficient but more flexible + + -- D \frac {\rm d} {{\rm d}x} + -- Dx Dy \frac {{\rm d}y} {{\rm d}x} + -- Df Dg {\rm f}^{\prime} + -- f() g() {\rm f}() + + -- valid utf8 + + local S, P, R, C, V, Cc, Ct = lpeg.S, lpeg.P, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc, lpeg.Ct + + local space = S(" \n\r\t")^0 + local integer = P("-")^-1 * R("09")^1 + local realpart = P("-")^-1 * R("09")^1 * S(".")^1 * R("09")^1 + local number = Cc("number") * C(integer) * space + local real = Cc("real") * C(realpart) * space + local float = Cc("float") * C(realpart) * lpeg.P("E") * lpeg.C(integer) * space + local identifier = Cc("identifier") * C(R("az","AZ")) * space + local compareop = Cc("compare") * C(P("<") + P("=") + P(">") + P(">=") + P("<=") + P(">") + P("<")) * space + local factorop = Cc("factor") * C(S("+-^_,")) * space + local termop = Cc("term") * C(S("*/")) * space + local constant = Cc("constant") * C(P("pi") + lpeg.P("inf")) * space + local functionop = Cc("function") * C(R("az")^1) * space + local open = P("(") * space + local close = P(")") * space + + local grammar = P { + "expression", + expression = Ct(V("factor") * ((factorop+compareop) * V("factor"))^0), + factor = Ct(V("term") * (termop * V("term"))^0), + term = Ct( + float + real + number + + (open * V("expression") * close) + + (functionop * open * (V("expression") * (P(",") * V("expression"))^0) * close) + + (functionop * V("term")) + + constant + identifier + ), + } + + local parser = space * grammar * -1 + + local function has_factor(t) + for i=1,#t do + if t[i] == "factor" then + return true + end + end + end + + -- can be sped up if needed ... + + function totex(t) + if t then + local one = t[1] + if type(one) == "string" then + local two, three = t[2], t[3] + if one == "number" then + context(two) + elseif one == "real" then + context(two) + elseif one == "float" then + context("\\scinot{",two,"}{",three,"}") + elseif one == "identifier" then + context(two) + elseif one == "constant" then + context("\\"..two) + elseif one == "function" then + if two == "sqrt" then + context("\\sqrt{") + totex(three) + context("}") + elseif two == "exp" then + context(" e^{") + totex(three) + context("}") + elseif two == "abs" then + context("\\left|") + totex(three) + context("\\right|") + elseif two == "mean" then + context("\\overline{") + totex(three) + context("}") + elseif two == "int" or two == "prod" or two == "sum" then + local four, five = t[4], t[5] + if five then + context("\\"..two.."^{") -- context[two]("{") + totex(three) + context("}_{") + totex(four) + context("}") + totex(five) + elseif four then + context("\\"..two.."^{") + totex(three) + context("}") + totex(four) + elseif three then + context("\\"..two.." ") -- " " not needed + totex(three) + else + context("\\"..two) + end + else + context("\\"..two.."(") + totex(three) + context(")") + end + end + else + local nt = #t + local hasfactor = has_factor(t) + if hasfactor then + context("\\left(") + end + totex(one) + for i=2,nt,3 do + local what, how, rest = t[i], t[i+1], t[i+2] + if what == "factor" then + if how == '^' or how == "_" then + context(how) + context("{") + totex(rest) + context("}") + else + context(how) + totex(rest) + end + elseif what == "term" then + if how == '/' then + context("\\frac{") + totex(rest) + context("}{") + totex(t[i+3] or "") + context("}") + elseif how == '*' then + context("\\times") + totex(rest) + else + context(how) + totex(three) + end + elseif what == "compare" then + if two == ">=" then + context("\\ge") + elseif two == "<=" then + context("\\le") + elseif two == ">" then + context(">") + elseif two == "<" then + context("<") + end + totex(three) + end + end + if hasfactor then + context("\\right)") + end + end + end + end + + calcmath = { } + + function calcmath.parse(str) + return lpegmatch(parser,str) + end + + function calcmath.tex(str) + str = totex(lpegmatch(parser,str)) + return (str == "" and "[error]") or str + end + +end diff --git a/Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.mkxl new file mode 100644 index 00000000000..2e7beddd0a7 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/x-calcmath.mkxl @@ -0,0 +1,80 @@ +%D \module +%D [ file=m-calcmath, +%D version=2006.04.24, % 1999.11.06, +%D title=\CONTEXT\ Modules, +%D subtitle=Calculator Math, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Lua code. + +\registerctxluafile{x-calcmath}{} + +\def\ctxmodulecalcmath#1{\ctxlua{moduledata.calcmath.#1}} + +%D Interface: + +\unprotect + +\protected\def\inlinecalcmath #1{\mathematics{\ctxmodulecalcmath{tex(\!!bs#1\!!es,1)}}} +\protected\def\displaycalcmath#1{\startformula\ctxmodulecalcmath{tex(\!!bs#1\!!es,2)}\stopformula} + +\let\calcmath\inlinecalcmath + +\let\icm\inlinecalcmath +\let\dcm\displaycalcmath + +\startxmlsetups xml:cam:define + \xmlsetsetup {\xmldocument} {cam:*} {*} + \xmlsetsetup {\xmldocument} {(icm|dcm)} {cam:*} +\stopxmlsetups + +\xmlregisterns{cam}{calcmath} + +\xmlregistersetup{xml:cam:define} + +% tex -> lua -> tex -> lua -> tex +% \mathematics{\ctxmodulecalcmath{xml(\!!bs\xmlflush{#1}\!!es,1)}} +% tex -> lua -> tex +% \mathematics{\ctxmodulecalcmath{xml("#1",1)}}% + +\startxmlsetups cam:i + \mathematics{\ctxmodulecalcmath{xml("#1",1)}}% +\stopxmlsetups + +\startxmlsetups cam:d + \startformula\ctxmodulecalcmath{xml("#1",2)}\stopformula +\stopxmlsetups + +\startxmlsetups cam:icm + \mathematics{\ctxmodulecalcmath{xml("#1",1)}} +\stopxmlsetups + +\startxmlsetups cam:dcm + \startformula\ctxmodulecalcmath{xml("#1",2)}\stopformula +\stopxmlsetups + +\protect \endinput + +\starttext + +% \calcmath{sin(x) + x^2 + x^(1+x) + 1/x^2 + mean(x+mean(y))} +% \calcmath{int(a,b,c)} +% \calcmath{(1+x)/(1+x) + (1+x)/(1+(1+x)/(1+x))} +% \calcmath{10E-2} +% \calcmath{(1+x)/x} +% \calcmath{(1+x)/12} +% \calcmath{(1+x)/-12} +% \calcmath{1/-12} +% \calcmath{12x/(1+x)} +% \calcmath{exp(x+exp(x+1))} +% \calcmath{abs(x+abs(x+1)) + pi + inf} +% \calcmath{Dx Dy} +% \calcmath{D(x+D(y))} +% \calcmath{Df(x)} +% \calcmath{g(x)} diff --git a/Master/texmf-dist/tex/context/modules/mkxl/x-mathml.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/x-mathml.mkxl index adabf777c3a..48bc3f4f06d 100644 --- a/Master/texmf-dist/tex/context/modules/mkxl/x-mathml.mkxl +++ b/Master/texmf-dist/tex/context/modules/mkxl/x-mathml.mkxl @@ -85,8 +85,8 @@ \xmlmapvalue {mml:math:display} {block} {\displaymathematics} % before this showed up \xmlmapvalue {mml:math:display} {inline} {\inlinemathematics } -\xmlmapvalue {mml:math:dir} {ltr} {\setfalse\c_math_right_to_left\math_basics_synchronize_direction} -\xmlmapvalue {mml:math:dir} {rtl} {\settrue \c_math_right_to_left\math_basics_synchronize_direction} +\xmlmapvalue {mml:math:dir} {ltr} {\c_math_right_to_left\conditionalfalse\math_basics_synchronize_direction} +\xmlmapvalue {mml:math:dir} {rtl} {\c_math_right_to_left\conditionaltrue\math_basics_synchronize_direction} \edef\mmlconstantone {1} \edef\mmlconstantfalse{false} @@ -136,7 +136,7 @@ \stopxmlsetups -\setfalse\mmlignoredelimiter % alternatively we could turn it on/off inside the start/stop and ignore \left\right\middle otherwise +\newconditional\mmlignoredelimiter % alternatively we could turn it on/off inside the start/stop and ignore \left\right\middle otherwise \let\mmlleftdelimiter \autofenceopen \let\mmlmiddledelimiter \autofencemiddle @@ -734,10 +734,10 @@ % inverse -\setfalse\xmlinversefunction +\newconditional\xmlinversefunction \startxmlsetups mml:apply:inverse - \settrue\xmlinversefunction + \xmlinversefunction\conditionaltrue \xmlsetup{#1}{mml:\xmlfilter{#1}{/mml:apply/*[2]/tag()}} \stopxmlsetups @@ -819,6 +819,8 @@ \setupMMLappearance[piece][\c!separator=] +\let\theMMLpieceseparator\empty + \startxmlsetups mml:piecewise \processaction [\MMLpieceseparator] @@ -826,7 +828,9 @@ \v!no=>\def\theMMLpieceseparator{&}, \s!default=>\def\theMMLpieceseparator{&}, \s!unknown=>\def\theMMLpieceseparator{\,\,\hbox{\MMLpieceseparator}\,\,}] - \cases{\xmlflush{#1}} + \startcases + \xmlflush{#1} + \stopcases \stopxmlsetups \startxmlsetups mml:piece @@ -1035,11 +1039,22 @@ \setupMMLappearance[root][\c!symbol=\v!yes] +% \startxmlsetups mml:root +% \xmldoifelse {#1} {/mml:degree} { +% \root +% \doifnot\MMLrootsymbol\v!no{\MMLcreset\xmltext{#1}{/mml:degree}} +% \of +% } { +% \sqrt +% } +% {\MMLcreset\xmlall{#1}{/!(mml:degree\string|mml:root)}} +% \stopxmlsetups + \startxmlsetups mml:root \xmldoifelse {#1} {/mml:degree} { - \root + \sqrt [ \doifnot\MMLrootsymbol\v!no{\MMLcreset\xmltext{#1}{/mml:degree}} - \of + ] } { \sqrt } @@ -1076,6 +1091,23 @@ \def\mmlforallexistslist{mml:bvar\string|mml:forall\string|mml:exists\string|mml:condition} +% \definemathfence +% [weirdfences] +% [bar] +% [\c!right=] + +% \definemathalignment +% [weirdforall] +% [\c!location=\v!packed, +% \c!fences=weirdfences, +% \c!m=1, +% \c!n=1, +% \c!align=1:\v!left] + +% \startxmlsetups mml:forallexists:step +% \NC \xmlflush{#1} \NR +% \stopxmlsetups + \startxmlsetups mml:forallexists \normalsubscript{\xmlconcat{#1}{/mml:bvar}{\MMLseparator,}} \xmldoifelse {#1} {/mml:condition} { @@ -1093,10 +1125,11 @@ \else % special case \left\vert - \matrix { - \xmlconcat{#1}{/!(\mmlforallexistslist)}{\hfill\crcr} - } + \plainmatrix{\xmlconcat{#1}{/!(\mmlforallexistslist)}{\hfill\crcr}} \right. +% \startweirdforall +% \xmlcommand{#1}{/!(\mmlforallexistslist)/}{mml:forallexists:step} +% \stopweirdforall \fi } { :\xmlfirst{#1}{/!(\mmlforallexistslist)} @@ -1161,6 +1194,8 @@ \startxmlsetups mml:approx \xmlsetup{#1}{mml:relation} \stopxmlsetups \startxmlsetups mml:factorof \xmlsetup{#1}{mml:relation} \stopxmlsetups +%D This needs to be adapted and can nwo use the alignhere mechanism: + \startxmlsetups mml:relation \edef\mmlapplyaction{\xmlfilter{#1}{/*/tag()}} \MMLcreset \xmlsetup{#1}{mml:relation:\xmlattdef{#1}{align}{\MMLrelationalign}} @@ -1341,7 +1376,7 @@ % {\mr D}\normalsubscript{ \DD\normalsubscript{ \begingroup - \setfalse\mmllistdelimiters + \mmllistdelimiters\conditionalfalse \xmlall{#1}{/mml:list} \endgroup } @@ -1413,13 +1448,13 @@ \relax % needed \stopxmlsetups -\settrue\mmllistdelimiters +\newconditional\mmllistdelimiters \mmllistdelimiters\conditionaltrue \startxmlsetups mml:list \begingroup \ifconditional\mmllistdelimiters\left [\fi \begingroup - \settrue\mmllistdelimiters + \mmllistdelimiters\conditionaltrue \xmlconcat{#1}{/!mml:list}{\MMLseparator,} \endgroup \ifconditional\mmllistdelimiters\right]\fi @@ -1457,7 +1492,7 @@ \def\mmlstackedsubscripts#1% {\vbox - {\baselineskip\zeropoint % hack, taco vragen + {\baselineskip\zeroskip \halign{\startimath\scriptstyle\hss\alignmark\alignmark\hss\stopimath\cr#1\crcr}}} % unfinished @@ -1607,7 +1642,7 @@ \doifelse\MMLvectordirection\v!horizontal { \left(\xmlconcat{#1}{/*}{\MMLseparator\MMLvectorseparator}\right) } { - \MMLcreset\left(\matrix{\xmlconcat{#1}{/*}{\MMLseparator\MMLvectorseparator}}\right) + \MMLcreset\left(\plainmatrix{\xmlconcat{#1}{/*}{\MMLseparator\MMLvectorseparator}}\right) } \else \overrightarrow{\charhtstrut\mmlfirst{#1}} @@ -1615,16 +1650,16 @@ \endgroup \stopxmlsetups -\settrue\MMCdelmatrix % ( ) when true +\newconditional\MMCdelmatrix \MMCdelmatrix\conditionaltrue % ( ) when true \startxmlsetups mml:matrix \begingroup \MMLcreset \ifconditional\MMCdelmatrix - \left(\matrix{\xmlcommand{#1}{/mml:matrixrow}{mml:matrixrow:do}}\right) + \left(\plainmatrix{\xmlcommand{#1}{/mml:matrixrow}{mml:matrixrow:do}}\right) \else - \settrue\MMCdelmatrix - \matrix{\xmlcommand{#1}{/mml:matrixrow}{mml:matrixrow:do}} + \MMCdelmatrix\conditionaltrue + \plainmatrix{\xmlcommand{#1}{/mml:matrixrow}{mml:matrixrow:do}} \fi \endgroup \stopxmlsetups @@ -1642,7 +1677,7 @@ \startxmlsetups mml:determinant \begingroup - \setfalse\MMCdelmatrix + \MMCdelmatrix\conditionalfalse \left|\mmlsecond{#1}\right| \endgroup \stopxmlsetups @@ -1676,11 +1711,11 @@ \xmlflushcontext{#1} } { \xmldoifelse {#1} {.[oneof(@encoding,'calcmath','cm')]} { - \expanded{\calcmath{\xmlflush{#1}}} + \normalexpanded{\calcmath{\xmlflush{#1}}} } { \xmldoifelse {#1} {.[oneof(@encoding,'asciimath','am')]} { \ifdefined\asciimath - \expanded{\asciimath{\xmlflushpure{#1}}} + \normalexpanded{\asciimath{\xmlflushpure{#1}}} \else \hbox{\tt no am loaded} \fi @@ -1750,10 +1785,10 @@ \startxmlsetups mml:function \ifempty\MMLpowerelement \ifconditional\xmlinversefunction\normalsuperscript{-1}\fi - \setfalse\xmlinversefunction + \xmlinversefunction\conditionalfalse \else \normalsuperscript{\ifconditional\xmlinversefunction-\fi\MMLpowerelement} - \setfalse\xmlinversefunction + \xmlinversefunction\conditionalfalse \glettonothing\MMLpowerelement \fi \xmlsetup{#1}{mml:function:argument} @@ -1896,9 +1931,9 @@ \begingroup \setmmlmathcolor{#1} \ifxmlatt{#1}{maxsize}{1} - \settrue\mmlignoredelimiter + \mmlignoredelimiter\conditionaltrue \orelse\ifxmlatt{#1}{stretchy}{false} - \settrue\mmlignoredelimiter + \mmlignoredelimiter\conditionaltrue \fi \ifxmlattempty{#1}{lspace}\else \hskip\xmllastatt\relax % todo: check for dimension @@ -1992,16 +2027,16 @@ [frame=off,strut=no,background={\mmlmenclosenotation}] % offset is kind of undefined { \startpickupmath - \expanded{\doifelseinset {mml:enclose:longdiv} {\mmlmenclosenotation}} { + \normalexpanded{\doifelseinset {mml:enclose:longdiv} {\mmlmenclosenotation}} { \overline{\left)\strut\xmlflush{#1}\right.} } { - \expanded{\doifelseinset {mml:enclose:actuarial} {\mmlmenclosenotation}} { + \normalexpanded{\doifelseinset {mml:enclose:actuarial} {\mmlmenclosenotation}} { \overline{\left.\strut\xmlflush{#1}\right\vert} } { - \expanded{\doifelseinset {mml:enclose:radical} {\mmlmenclosenotation}} { + \normalexpanded{\doifelseinset {mml:enclose:radical} {\mmlmenclosenotation}} { \sqrt{\xmlflush{#1}} } { - \expanded{\doifelseinset {mml:enclose:rule} {\mmlmenclosenotation}} { + \normalexpanded{\doifelseinset {mml:enclose:rule} {\mmlmenclosenotation}} { \overline{\strut\xmlflush{#1}} } { \xmlflush{#1} diff --git a/Master/texmf-dist/tex/context/modules/third/mtx-install-imp-modules.lua b/Master/texmf-dist/tex/context/modules/third/mtx-install-imp-modules.lua new file mode 100644 index 00000000000..8580fcde791 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/third/mtx-install-imp-modules.lua @@ -0,0 +1,74 @@ +-- from the context garden + +-- incorrectly packaged: metaducks, sudoku, aquamints + +return { + name = "mtx-install-imp-modules", + version = "1.01", + comment = "Third party modules", + author = "Hans Hagen & others", + copyright = "ConTeXt development team", + lists = { + ["pocketdiary"] = { url = "modules", zips = { "PocketDiary-V2.zip", "Environment-for-collating-marks.zip", "Collection-of-calendars-based-on-PocketDiary-module.zip" } }, + ["collating-marks"] = { url = "modules", zips = { "Environment-for-collating-marks.zip" } }, + ["construction-plan"] = { url = "modules", zips = { "t-construction-plan.zip" } }, + ["account"] = { url = "modules", zips = { "t-account.zip" } }, + ["algorithmic"] = { url = "modules", zips = { "t-algorithmic.zip" } }, + ["animation"] = { url = "modules", zips = { "t-animation.zip" } }, -- probably obsolete + ["annotation"] = { url = "modules", zips = { "t-annotation.zip" } }, + -- ["aquamints"] = { url = "modules", zips = { "aquamints.zip" } }, -- obsolete (fonts) + ["bibmod-doc"] = { url = "modules", zips = { "bibmod-doc.zip" } }, + -- ["bnf-0.3"] = { url = "modules", zips = { "t-bnf-0.3.zip" } }, + ["bnf"] = { url = "modules", zips = { "t-bnf.zip" } }, + ["chromato"] = { url = "modules", zips = { "t-chromato.zip" } }, + -- ["cmscbf"] = { url = "modules", zips = { "t-cmscbf.zip" } }, -- obsolete (fonts) + -- ["cmttbf"] = { url = "modules", zips = { "t-cmttbf.zip" } }, -- obsolete (fonts) + ["crossref"] = { url = "modules", zips = { "t-crossref.zip" } }, + ["cyrillicnumbers"] = { url = "modules", zips = { "t-cyrillicnumbers.zip" } }, -- probably obsolete + -- ["degrade"] = { url = "modules", zips = { "t-degrade.zip" } }, -- obsolete, early version of grph-downsample + ["enigma"] = { url = "modules", zips = { "enigma.zip" } }, + ["fancybreak"] = { url = "modules", zips = { "t-fancybreak.zip" } }, + ["filter"] = { url = "modules", zips = { "t-filter.zip" } }, + ["french"] = { url = "modules", zips = { "t-french.zip" } }, -- probably obsolete + ["fullpage"] = { url = "modules", zips = { "t-fullpage.zip" } }, + ["gantt"] = { url = "modules", zips = { "t-gantt.zip" } }, + -- ["gfsdidot"] = { url = "modules", zips = { "gfsdidot.zip" } }, -- obsolete (fonts) + ["gm"] = { url = "modules", zips = { "t-gm.zip" } }, -- probably obsolete + ["gnuplot"] = { url = "modules", zips = { "t-gnuplot.zip" } }, + ["greek"] = { url = "modules", zips = { "t-greek.zip" } }, + -- ["grph-downsample"] = { url = "modules", zips = { "grph-downsample.lua.zip" } }, -- doesn’t work with LMTX + ["gs"] = { url = "modules", zips = { "t-gs.zip" } }, -- probably obsolete + ["high"] = { url = "modules", zips = { "high.zip" } }, + -- ["handlecsv"] = { url = "modules", zips = { "t-handlecsv.zip" } }, -- has top level files + ["inifile"] = { url = "modules", zips = { "t-inifile.zip" } }, + ["karnaugh"] = { url = "modules", zips = { "karnaugh.zip" } }, + ["layout"] = { url = "modules", zips = { "t-layout.zip" } }, -- probably obsolete + ["letter"] = { url = "modules", zips = { "t-letter.zip" } }, + ["letterspace"] = { url = "modules", zips = { "t-letterspace.mkiv.zip" } }, + ["lettrine"] = { url = "modules", zips = { "t-lettrine.zip" } }, + ["lua-widow-control"] = { url = "modules", zips = { "lua-widow-control.zip" } }, -- we wipe the non context stuff + ["mathsets"] = { url = "modules", zips = { "t-mathsets.zip" } }, + -- ["metaducks"] = { url = "modules", zips = { "metaducks.zip" } }, -- has top level files + ["pararef"] = { url = "modules", zips = { "pararef.zip" } }, + -- ["presvoz"] = { url = "modules", zips = { "presvoz.zip" } }, -- has top level files + ["pret-c.lua"] = { url = "modules", zips = { "pret-c.lua.zip" } }, + ["rst"] = { url = "modules", zips = { "t-rst.zip" } }, + ["rsteps"] = { url = "modules", zips = { "t-rsteps.zip" } }, + ["simplebib"] = { url = "modules", zips = { "t-simplebib.zip" } }, + -- ["simplefonts"] = { url = "modules", zips = { "t-simplefonts.zip" } }, -- obsolete (confuses users) + ["simpleslides"] = { url = "modules", zips = { "t-simpleslides.zip" } }, + ["squares"] = { url = "modules", zips = { "squares.zip" } }, + -- ["stormfontsupport"] = { url = "modules", zips = { "stormfontsupport.zip" } }, -- obsolete (fonts) + ["sudoku"] = { url = "modules", zips = { "sudoku.zip" } }, + -- ["taspresent"] = { url = "modules", zips = { "t-taspresent.zip" } }, -- obsolete (early version of simpleslides) + -- ["texshow"] = { url = "modules", zips = { "u-texshow.zip" } }, + ["title"] = { url = "modules", zips = { "t-title.zip" } }, + ["transliterator"] = { url = "modules", zips = { "t-transliterator.zip" } }, -- probably obsolete + ["typearea"] = { url = "modules", zips = { "t-typearea.zip" } }, -- probably obsolete + -- ["typescripts"] = { url = "modules", zips = { "t-typescripts.zip" } }, -- obsolete (fonts) + -- ["urwgaramond"] = { url = "modules", zips = { "f-urwgaramond.zip" } }, -- obsolete (fonts) + -- ["urwgothic"] = { url = "modules", zips = { "f-urwgothic.zip" } }, -- obsolete (fonts) + ["vim"] = { url = "modules", zips = { "t-vim.zip" } }, + ["visualcounter"] = { url = "modules", zips = { "t-visualcounter.zip" } }, + } +} diff --git a/Master/texmf-dist/tex/context/modules/third/mtx-install-imp-tikz.lua b/Master/texmf-dist/tex/context/modules/third/mtx-install-imp-tikz.lua new file mode 100644 index 00000000000..33929bddba2 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/third/mtx-install-imp-tikz.lua @@ -0,0 +1,50 @@ +local function wipers(s) + return { + "tex/context/third/" ..s.. "/**", + "doc/context/third/" ..s.. "/**", + "source/context/third/" ..s.. "/**", + + "tex/context/" ..s.. "/**", + "doc/context/" ..s.. "/**", + "source/context/" ..s.. "/**", + + "scripts/" ..s.. "/**", + } +end + +local defaults = { + "tex/latex/**", + "tex/plain/**", + + "doc/latex/**", + "doc/plain/**", + "doc/generic/**", + + "source/latex/**", + "source/plain/**", + -- "source/generic/**", +} + +return { + name = "mtx-install-imp-tikz", + version = "1.00", + comment = "Tikz", + author = "Hans Hagen & others", + copyright = "ConTeXt development team", + lists = { + ["tikz"] = { + url = "ctan", + zips = { + "graphics/pgf/base/pgf.tds.zip", + "graphics/pgf/contrib/pgfplots.tds.zip", + "graphics/pgf/contrib/circuitikz.tds.zip", + }, + wipes = { + wipers("pgf"), + wipers("pgfplots"), + wipers("circuitikz"), + defaults, + } + }, + }, +} diff --git a/Master/texmf-dist/tex/context/patterns/common/lang-hy.rme b/Master/texmf-dist/tex/context/patterns/common/lang-hy.rme new file mode 100644 index 00000000000..fff218f7178 --- /dev/null +++ b/Master/texmf-dist/tex/context/patterns/common/lang-hy.rme @@ -0,0 +1,3 @@ +% generated by mtxrun --script pattern --convert + +% no comment \ No newline at end of file diff --git a/Master/texmf-dist/tex/context/patterns/common/lang-id.rme b/Master/texmf-dist/tex/context/patterns/common/lang-id.rme new file mode 100644 index 00000000000..fff218f7178 --- /dev/null +++ b/Master/texmf-dist/tex/context/patterns/common/lang-id.rme @@ -0,0 +1,3 @@ +% generated by mtxrun --script pattern --convert + +% no comment \ No newline at end of file diff --git a/Master/texmf-dist/tex/context/patterns/mkiv/lang-hy.lua b/Master/texmf-dist/tex/context/patterns/mkiv/lang-hy.lua new file mode 100644 index 00000000000..adf6c9d232e --- /dev/null +++ b/Master/texmf-dist/tex/context/patterns/mkiv/lang-hy.lua @@ -0,0 +1,20 @@ +return { + ["comment"]="% generated by mtxrun --script pattern --convert", + ["exceptions"]={ + ["n"]=0, + }, + ["metadata"]={ + ["mnemonic"]="hy", + ["source"]="hyph-hy", + ["texcomment"]="% no comment", + }, + ["patterns"]={ + ["characters"]="աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցփքօև", + ["data"]="և1ա և1ե և1է և1ը և1ի և1ո և1օ ա1բա ա1բե ա1բէ ա1բը ա1բի ա1բո ա1բօ ա1գա ա1գե ա1գէ ա1գը ա1գի ա1գո ա1գօ ա1դա ա1դե ա1դէ ա1դը ա1դի ա1դո ա1դօ ա1զա ա1զե ա1զէ ա1զը ա1զի ա1զո ա1զօ ա1թա ա1թե ա1թէ ա1թը ա1թի ա1թո ա1թօ ա1ժա ա1ժե ա1ժէ ա1ժը ա1ժի ա1ժո ա1ժօ ա1լա ա1լե ա1լէ ա1լը ա1լի ա1լո ա1լօ ա1խա ա1խե ա1խէ ա1խը ա1խի ա1խո ա1խօ ա1ծա ա1ծե ա1ծէ ա1ծը ա1ծի ա1ծո ա1ծօ ա1կա ա1կե ա1կէ ա1կը ա1կի ա1կո ա1կօ ա1հա ա1հե ա1հէ ա1հը ա1հի ա1հո ա1հօ ա1ձա ա1ձե ա1ձէ ա1ձը ա1ձի ա1ձո ա1ձօ ա1ղա ա1ղե ա1ղէ ա1ղը ա1ղի ա1ղո ա1ղօ ա1ճա ա1ճե ա1ճէ ա1ճը ա1ճի ա1ճո ա1ճօ ա1մա ա1մե ա1մէ ա1մը ա1մի ա1մո ա1մօ ա1յա ա1յե ա1յէ ա1յը ա1յի ա1յո ա1յօ ա1նա ա1նե ա1նէ ա1նը ա1նի ա1նո ա1նօ ա1շա ա1շե ա1շէ ա1շը ա1շի ա1շո ա1շօ ա1չա ա1չե ա1չէ ա1չը ա1չի ա1չո ա1չօ ա1պա ա1պե ա1պէ ա1պը ա1պի ա1պո ա1պօ ա1ջա ա1ջե ա1ջէ ա1ջը ա1ջի ա1ջո ա1ջօ ա1ռա ա1ռե ա1ռէ ա1ռը ա1ռի ա1ռո ա1ռօ ա1սա ա1սե ա1սէ ա1սը ա1սի ա1սո ա1սօ ա1վա ա1վե ա1վէ ա1վը ա1վի ա1վո ա1վօ ա1տա ա1տե ա1տէ ա1տը ա1տի ա1տո ա1տօ ա1րա ա1րե ա1րէ ա1րը ա1րի ա1րո ա1րօ ա1ցա ա1ցե ա1ցէ ա1ցը ա1ցի ա1ցո ա1ցօ ա1փա ա1փե ա1փէ ա1փը ա1փի ա1փո ա1փօ ա1քա ա1քե ա1քէ ա1քը ա1քի ա1քո ա1քօ ե1բա ե1բե ե1բէ ե1բը ե1բի ե1բո ե1բօ ե1գա ե1գե ե1գէ ե1գը ե1գի ե1գո ե1գօ ե1դա ե1դե ե1դէ ե1դը ե1դի ե1դո ե1դօ ե1զա ե1զե ե1զէ ե1զը ե1զի ե1զո ե1զօ ե1թա ե1թե ե1թէ ե1թը ե1թի ե1թո ե1թօ ե1ժա ե1ժե ե1ժէ ե1ժը ե1ժի ե1ժո ե1ժօ ե1լա ե1լե ե1լէ ե1լը ե1լի ե1լո ե1լօ ե1խա ե1խե ե1խէ ե1խը ե1խի ե1խո ե1խօ ե1ծա ե1ծե ե1ծէ ե1ծը ե1ծի ե1ծո ե1ծօ ե1կա ե1կե ե1կէ ե1կը ե1կի ե1կո ե1կօ ե1հա ե1հե ե1հէ ե1հը ե1հի ե1հո ե1հօ ե1ձա ե1ձե ե1ձէ ե1ձը ե1ձի ե1ձո ե1ձօ ե1ղա ե1ղե ե1ղէ ե1ղը ե1ղի ե1ղո ե1ղօ ե1ճա ե1ճե ե1ճէ ե1ճը ե1ճի ե1ճո ե1ճօ ե1մա ե1մե ե1մէ ե1մը ե1մի ե1մո ե1մօ ե1յա ե1յե ե1յէ ե1յը ե1յի ե1յո ե1յօ ե1նա ե1նե ե1նէ ե1նը ե1նի ե1նո ե1նօ ե1շա ե1շե ե1շէ ե1շը ե1շի ե1շո ե1շօ ե1չա ե1չե ե1չէ ե1չը ե1չի ե1չո ե1չօ ե1պա ե1պե ե1պէ ե1պը ե1պի ե1պո ե1պօ ե1ջա ե1ջե ե1ջէ ե1ջը ե1ջի ե1ջո ե1ջօ ե1ռա ե1ռե ե1ռէ ե1ռը ե1ռի ե1ռո ե1ռօ ե1սա ե1սե ե1սէ ե1սը ե1սի ե1սո ե1սօ ե1վա ե1վե ե1վէ ե1վը ե1վի ե1վո ե1վօ ե1տա ե1տե ե1տէ ե1տը ե1տի ե1տո ե1տօ ե1րա ե1րե ե1րէ ե1րը ե1րի ե1րո ե1րօ ե1ցա ե1ցե ե1ցէ ե1ցը ե1ցի ե1ցո ե1ցօ ե1փա ե1փե ե1փէ ե1փը ե1փի ե1փո ե1փօ ե1քա ե1քե ե1քէ ե1քը ե1քի ե1քո ե1քօ է1բա է1բե է1բէ է1բը է1բի է1բո է1բօ է1գա է1գե է1գէ է1գը է1գի է1գո է1գօ է1դա է1դե է1դէ է1դը է1դի է1դո է1դօ է1զա է1զե է1զէ է1զը է1զի է1զո է1զօ է1թա է1թե է1թէ է1թը է1թի է1թո է1թօ է1ժա է1ժե է1ժէ է1ժը է1ժի է1ժո է1ժօ է1լա է1լե է1լէ է1լը է1լի է1լո է1լօ է1խա է1խե է1խէ է1խը է1խի է1խո է1խօ է1ծա է1ծե է1ծէ է1ծը է1ծի է1ծո է1ծօ է1կա է1կե է1կէ է1կը է1կի է1կո է1կօ է1հա է1հե է1հէ է1հը է1հի է1հո է1հօ է1ձա է1ձե է1ձէ է1ձը է1ձի է1ձո է1ձօ է1ղա է1ղե է1ղէ է1ղը է1ղի է1ղո է1ղօ է1ճա է1ճե է1ճէ է1ճը է1ճի է1ճո է1ճօ է1մա է1մե է1մէ է1մը է1մի է1մո է1մօ է1յա է1յե է1յէ է1յը է1յի է1յո է1յօ է1նա է1նե է1նէ է1նը է1նի է1նո է1նօ է1շա է1շե է1շէ է1շը է1շի է1շո է1շօ է1չա է1չե է1չէ է1չը է1չի է1չո է1չօ է1պա է1պե է1պէ է1պը է1պի է1պո է1պօ է1ջա է1ջե է1ջէ է1ջը է1ջի է1ջո է1ջօ է1ռա է1ռե է1ռէ է1ռը է1ռի է1ռո է1ռօ է1սա է1սե է1սէ է1սը է1սի է1սո է1սօ է1վա է1վե է1վէ է1վը է1վի է1վո է1վօ է1տա է1տե է1տէ է1տը է1տի է1տո է1տօ է1րա է1րե է1րէ է1րը է1րի է1րո է1րօ է1ցա է1ցե է1ցէ է1ցը է1ցի է1ցո է1ցօ է1փա է1փե է1փէ է1փը է1փի է1փո է1փօ է1քա է1քե է1քէ է1քը է1քի է1քո է1քօ ը1բա ը1բե ը1բէ ը1բը ը1բի ը1բո ը1բօ ը1գա ը1գե ը1գէ ը1գը ը1գի ը1գո ը1գօ ը1դա ը1դե ը1դէ ը1դը ը1դի ը1դո ը1դօ ը1զա ը1զե ը1զէ ը1զը ը1զի ը1զո ը1զօ ը1թա ը1թե ը1թէ ը1թը ը1թի ը1թո ը1թօ ը1ժա ը1ժե ը1ժէ ը1ժը ը1ժի ը1ժո ը1ժօ ը1լա ը1լե ը1լէ ը1լը ը1լի ը1լո ը1լօ ը1խա ը1խե ը1խէ ը1խը ը1խի ը1խո ը1խօ ը1ծա ը1ծե ը1ծէ ը1ծը ը1ծի ը1ծո ը1ծօ ը1կա ը1կե ը1կէ ը1կը ը1կի ը1կո ը1կօ ը1հա ը1հե ը1հէ ը1հը ը1հի ը1հո ը1հօ ը1ձա ը1ձե ը1ձէ ը1ձը ը1ձի ը1ձո ը1ձօ ը1ղա ը1ղե ը1ղէ ը1ղը ը1ղի ը1ղո ը1ղօ ը1ճա ը1ճե ը1ճէ ը1ճը ը1ճի ը1ճո ը1ճօ ը1մա ը1մե ը1մէ ը1մը ը1մի ը1մո ը1մօ ը1յա ը1յե ը1յէ ը1յը ը1յի ը1յո ը1յօ ը1նա ը1նե ը1նէ ը1նը ը1նի ը1նո ը1նօ ը1շա ը1շե ը1շէ ը1շը ը1շի ը1շո ը1շօ ը1չա ը1չե ը1չէ ը1չը ը1չի ը1չո ը1չօ ը1պա ը1պե ը1պէ ը1պը ը1պի ը1պո ը1պօ ը1ջա ը1ջե ը1ջէ ը1ջը ը1ջի ը1ջո ը1ջօ ը1ռա ը1ռե ը1ռէ ը1ռը ը1ռի ը1ռո ը1ռօ ը1սա ը1սե ը1սէ ը1սը ը1սի ը1սո ը1սօ ը1վա ը1վե ը1վէ ը1վը ը1վի ը1վո ը1վօ ը1տա ը1տե ը1տէ ը1տը ը1տի ը1տո ը1տօ ը1րա ը1րե ը1րէ ը1րը ը1րի ը1րո ը1րօ ը1ցա ը1ցե ը1ցէ ը1ցը ը1ցի ը1ցո ը1ցօ ը1փա ը1փե ը1փէ ը1փը ը1փի ը1փո ը1փօ ը1քա ը1քե ը1քէ ը1քը ը1քի ը1քո ը1քօ ի1բա ի1բե ի1բէ ի1բը ի1բի ի1բո ի1բօ ի1գա ի1գե ի1գէ ի1գը ի1գի ի1գո ի1գօ ի1դա ի1դե ի1դէ ի1դը ի1դի ի1դո ի1դօ ի1զա ի1զե ի1զէ ի1զը ի1զի ի1զո ի1զօ ի1թա ի1թե ի1թէ ի1թը ի1թի ի1թո ի1թօ ի1ժա ի1ժե ի1ժէ ի1ժը ի1ժի ի1ժո ի1ժօ ի1լա ի1լե ի1լէ ի1լը ի1լի ի1լո ի1լօ ի1խա ի1խե ի1խէ ի1խը ի1խի ի1խո ի1խօ ի1ծա ի1ծե ի1ծէ ի1ծը ի1ծի ի1ծո ի1ծօ ի1կա ի1կե ի1կէ ի1կը ի1կի ի1կո ի1կօ ի1հա ի1հե ի1հէ ի1հը ի1հի ի1հո ի1հօ ի1ձա ի1ձե ի1ձէ ի1ձը ի1ձի ի1ձո ի1ձօ ի1ղա ի1ղե ի1ղէ ի1ղը ի1ղի ի1ղո ի1ղօ ի1ճա ի1ճե ի1ճէ ի1ճը ի1ճի ի1ճո ի1ճօ ի1մա ի1մե ի1մէ ի1մը ի1մի ի1մո ի1մօ ի1յա ի1յե ի1յէ ի1յը ի1յի ի1յո ի1յօ ի1նա ի1նե ի1նէ ի1նը ի1նի ի1նո ի1նօ ի1շա ի1շե ի1շէ ի1շը ի1շի ի1շո ի1շօ ի1չա ի1չե ի1չէ ի1չը ի1չի ի1չո ի1չօ ի1պա ի1պե ի1պէ ի1պը ի1պի ի1պո ի1պօ ի1ջա ի1ջե ի1ջէ ի1ջը ի1ջի ի1ջո ի1ջօ ի1ռա ի1ռե ի1ռէ ի1ռը ի1ռի ի1ռո ի1ռօ ի1սա ի1սե ի1սէ ի1սը ի1սի ի1սո ի1սօ ի1վա ի1վե ի1վէ ի1վը ի1վի ի1վո ի1վօ ի1տա ի1տե ի1տէ ի1տը ի1տի ի1տո ի1տօ ի1րա ի1րե ի1րէ ի1րը ի1րի ի1րո ի1րօ ի1ցա ի1ցե ի1ցէ ի1ցը ի1ցի ի1ցո ի1ցօ ի1փա ի1փե ի1փէ ի1փը ի1փի ի1փո ի1փօ ի1քա ի1քե ի1քէ ի1քը ի1քի ի1քո ի1քօ ո1բա ո1բե ո1բէ ո1բը ո1բի ո1բո ո1բօ ո1գա ո1գե ո1գէ ո1գը ո1գի ո1գո ո1գօ ո1դա ո1դե ո1դէ ո1դը ո1դի ո1դո ո1դօ ո1զա ո1զե ո1զէ ո1զը ո1զի ո1զո ո1զօ ո1թա ո1թե ո1թէ ո1թը ո1թի ո1թո ո1թօ ո1ժա ո1ժե ո1ժէ ո1ժը ո1ժի ո1ժո ո1ժօ ո1լա ո1լե ո1լէ ո1լը ո1լի ո1լո ո1լօ ո1խա ո1խե ո1խէ ո1խը ո1խի ո1խո ո1խօ ո1ծա ո1ծե ո1ծէ ո1ծը ո1ծի ո1ծո ո1ծօ ո1կա ո1կե ո1կէ ո1կը ո1կի ո1կո ո1կօ ո1հա ո1հե ո1հէ ո1հը ո1հի ո1հո ո1հօ ո1ձա ո1ձե ո1ձէ ո1ձը ո1ձի ո1ձո ո1ձօ ո1ղա ո1ղե ո1ղէ ո1ղը ո1ղի ո1ղո ո1ղօ ո1ճա ո1ճե ո1ճէ ո1ճը ո1ճի ո1ճո ո1ճօ ո1մա ո1մե ո1մէ ո1մը ո1մի ո1մո ո1մօ ո1յա ո1յե ո1յէ ո1յը ո1յի ո1յո ո1յօ ո1նա ո1նե ո1նէ ո1նը ո1նի ո1նո ո1նօ ո1շա ո1շե ո1շէ ո1շը ո1շի ո1շո ո1շօ ո1չա ո1չե ո1չէ ո1չը ո1չի ո1չո ո1չօ ո1պա ո1պե ո1պէ ո1պը ո1պի ո1պո ո1պօ ո1ջա ո1ջե ո1ջէ ո1ջը ո1ջի ո1ջո ո1ջօ ո1ռա ո1ռե ո1ռէ ո1ռը ո1ռի ո1ռո ո1ռօ ո1սա ո1սե ո1սէ ո1սը ո1սի ո1սո ո1սօ ո1վա ո1վե ո1վէ ո1վը ո1վի ո1վո ո1վօ ո1տա ո1տե ո1տէ ո1տը ո1տի ո1տո ո1տօ ո1րա ո1րե ո1րէ ո1րը ո1րի ո1րո ո1րօ ո1ցա ո1ցե ո1ցէ ո1ցը ո1ցի ո1ցո ո1ցօ ո1փա ո1փե ո1փէ ո1փը ո1փի ո1փո ո1փօ ո1քա ո1քե ո1քէ ո1քը ո1քի ո1քո ո1քօ օ1բա օ1բե օ1բէ օ1բը օ1բի օ1բո օ1բօ օ1գա օ1գե օ1գէ օ1գը օ1գի օ1գո օ1գօ օ1դա օ1դե օ1դէ օ1դը օ1դի օ1դո օ1դօ օ1զա օ1զե օ1զէ օ1զը օ1զի օ1զո օ1զօ օ1թա օ1թե օ1թէ օ1թը օ1թի օ1թո օ1թօ օ1ժա օ1ժե օ1ժէ օ1ժը օ1ժի օ1ժո օ1ժօ օ1լա օ1լե օ1լէ օ1լը օ1լի օ1լո օ1լօ օ1խա օ1խե օ1խէ օ1խը օ1խի օ1խո օ1խօ օ1ծա օ1ծե օ1ծէ օ1ծը օ1ծի օ1ծո օ1ծօ օ1կա օ1կե օ1կէ օ1կը օ1կի օ1կո օ1կօ օ1հա օ1հե օ1հէ օ1հը օ1հի օ1հո օ1հօ օ1ձա օ1ձե օ1ձէ օ1ձը օ1ձի օ1ձո օ1ձօ օ1ղա օ1ղե օ1ղէ օ1ղը օ1ղի օ1ղո օ1ղօ օ1ճա օ1ճե օ1ճէ օ1ճը օ1ճի օ1ճո օ1ճօ օ1մա օ1մե օ1մէ օ1մը օ1մի օ1մո օ1մօ օ1յա օ1յե օ1յէ օ1յը օ1յի օ1յո օ1յօ օ1նա օ1նե օ1նէ օ1նը օ1նի օ1նո օ1նօ օ1շա օ1շե օ1շէ օ1շը օ1շի օ1շո օ1շօ օ1չա օ1չե օ1չէ օ1չը օ1չի օ1չո օ1չօ օ1պա օ1պե օ1պէ օ1պը օ1պի օ1պո օ1պօ օ1ջա օ1ջե օ1ջէ օ1ջը օ1ջի օ1ջո օ1ջօ օ1ռա օ1ռե օ1ռէ օ1ռը օ1ռի օ1ռո օ1ռօ օ1սա օ1սե օ1սէ օ1սը օ1սի օ1սո օ1սօ օ1վա օ1վե օ1վէ օ1վը օ1վի օ1վո օ1վօ օ1տա օ1տե օ1տէ օ1տը օ1տի օ1տո օ1տօ օ1րա օ1րե օ1րէ օ1րը օ1րի օ1րո օ1րօ օ1ցա օ1ցե օ1ցէ օ1ցը օ1ցի օ1ցո օ1ցօ օ1փա օ1փե օ1փէ օ1փը օ1փի օ1փո օ1փօ օ1քա օ1քե օ1քէ օ1քը օ1քի օ1քո օ1քօ", + ["lefthyphenmin"]=1, + ["length"]=11409, + ["n"]=1428, + ["righthyphenmax"]=1, + }, + ["version"]="1.001", +} \ No newline at end of file diff --git a/Master/texmf-dist/tex/context/patterns/mkiv/lang-id.lua b/Master/texmf-dist/tex/context/patterns/mkiv/lang-id.lua new file mode 100644 index 00000000000..50184021b68 --- /dev/null +++ b/Master/texmf-dist/tex/context/patterns/mkiv/lang-id.lua @@ -0,0 +1,23 @@ +return { + ["comment"]="% generated by mtxrun --script pattern --convert", + ["exceptions"]={ + ["characters"]="abdeghiklmnoprstuw", + ["data"]="be-ra-be be-ra-hi be-rak be-ran-da be-ran-dal be-rang be-ra-ngas-an be-rang-sang be-ra-ngus be-ra-ni be-ran-tak-an be-ran-tam be-ran-tas be-ra-pa be-ras be-ren-deng be-re-ngut be-re-rot be-res be-re-wok be-ri be-ri-ngas be-ri-sik be-ri-ta be-rok be-ron-dong be-ron-tak be-ru-du be-ruk be-run-tun peng-eks-por peng-im-por te-ra te-rang te-ras te-ra-si te-ra-tai te-ra-wang te-ra-weh te-ri-ak te-ri-gu te-rik te-ri-ma te-ri-pang te-ro-bos te-ro-bos-an te-ro-mol te-rom-pah te-rom-pet te-ro-pong te-ro-wong-an te-ru-buk te-ru-na te-rus te-ru-si", + ["length"]=541, + ["n"]=55, + }, + ["metadata"]={ + ["mnemonic"]="id", + ["source"]="hyph-id", + ["texcomment"]="% no comment", + }, + ["patterns"]={ + ["characters"]="abcdefghijklmnopqrstuvwyz", + ["data"]="a1 e1 i1 o1 u1 2b1d 2b1j 2b1k 2b1n 2b1s 2b1t 2c1k 2c1n 2d1k 2d1n 2d1p 2f1d 2f1k 2f1n 2f1t 2g1g 2g1k 2g1n 2h1k 2h1l 2h1m 2h1n 2h1w 2j1k 2j1n 2k1b 2k1k 2k1m 2k1n 2k1r 2k1s 2k1t 2l1b 2l1f 2l1g 2l1h 2l1k 2l1m 2l1n 2l1s 2l1t 2l1q 2m1b 2m1k 2m1l 2m1m 2m1n 2m1p 2m1r 2m1s 2n1c 2n1d 2n1f 2n1j 2n1k 2n1n 2n1p 2n1s 2n1t 2n1v 2p1k 2p1n 2p1p 2p1r 2p1t 2r1b 2r1c 2r1f 2r1g 2r1h 2r1j 2r1k 2r1l 2r1m 2r1n 2r1p 2r1r 2r1s 2r1t 2r1w 2r1y 2s1b 2s1k 2s1l 2s1m 2s1n 2s1p 2s1r 2s1s 2s1t 2s1w 2t1k 2t1l 2t1n 2t1t 2w1t 2ng1g 2ng1h 2ng1k 2ng1n 2ng1s 2n3s2t .be2r3 .te2r3 .me2ng3 .pe2r3 2ng. 2ny. i2o1n a2ir 1ba1ga2i 2b1an. 2c1an. 2d1an. 2f1an. 2g1an. 2h1an. 2j1an. 2k1an. 2l1an. 2m1an. 2ng1an. 2n1an. 2p1an. 2r1an. 2s1an. 2t1an. 2v1an. 2z1an. 3an. .a2ta2u .ta3ng4an. .le3ng4an. .ja3ng4an. .ma3ng4an. .pa3ng4an. .ri3ng4an. .de3ng4an.", + ["lefthyphenmin"]=1, + ["length"]=807, + ["n"]=143, + ["righthyphenmax"]=1, + }, + ["version"]="1.001", +} \ No newline at end of file diff --git a/Master/texmf-dist/tex/context/sample/common/dijkstra.tex b/Master/texmf-dist/tex/context/sample/common/dijkstra.tex new file mode 100644 index 00000000000..88e6256c1aa --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/common/dijkstra.tex @@ -0,0 +1,3 @@ +As long as there were no machines, programming was no problem at all; when we had +a few weak computers, programming became a mild problem, and now we have gigantic +computers, programming had become an equally gigantic problem. diff --git a/Master/texmf-dist/tex/context/sample/common/knuth-gpt.tex b/Master/texmf-dist/tex/context/sample/common/knuth-gpt.tex new file mode 100644 index 00000000000..79cdca07a99 --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/common/knuth-gpt.tex @@ -0,0 +1,4 @@ +It's amazing how the confident tone lends credibility to all of that +made-up nonsense. Almost impossible for anybody without knowledge +of the book to believe that those \quotation {facts} aren't authorititative +and well researched. diff --git a/Master/texmf-dist/tex/context/sample/common/knuthmath.tex b/Master/texmf-dist/tex/context/sample/common/knuthmath.tex new file mode 100644 index 00000000000..9890bb2bae7 --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/common/knuthmath.tex @@ -0,0 +1,3 @@ +Many readers will skim over formulas on their first reading of your exposition. +Therefore, your sentences should flow smoothly when all but the simplest formulas +are replaced by \quotation {blah} or some other grunting noise. diff --git a/Master/texmf-dist/tex/context/sample/common/samples.tex b/Master/texmf-dist/tex/context/sample/common/samples.tex index df5b38211d6..598db20efb7 100644 --- a/Master/texmf-dist/tex/context/sample/common/samples.tex +++ b/Master/texmf-dist/tex/context/sample/common/samples.tex @@ -13,6 +13,7 @@ used in testing bibliographic references and citations. \HL \NC stork.tex \NC David F. Stork \NC Hal's Legacy\NC \NR \NC knuth.tex \NC Donald E. Knuth \NC \NC \NR +\NC knuthmath.tex \NC Donald E. Knuth \NC Mathematical Writing (1987), §1 item 13, p.3 \NC \NR \NC tufte.tex \NC Edward R. Tufte \NC \NC \NR \NC reich.tex \NC Steve Reich \NC City Life (1995) \NC \NR \NC materie.tex \NC Louis Andriessen \NC De Materie \NC \NR @@ -44,10 +45,10 @@ used in testing bibliographic references and citations. Quercus, London, 2006 \NC \NR %NC schwarzenegger.tex \NC Arnold Schwarzenegger \NC Several places on the World Wide Web. \NC \NR \NC carey.tex \NC Nessa Carey \NC The Epigenetics Revolution, - Columbia University Press, 2012, p. 195 \NC \NR + Columbia University Press, 2012, p.195 \NC \NR \NC waltham.tex \NC David Waltham \NC Lucky Planet, why earth is exceptional and what that means for life in the universe, - Icon Books Ltd, London, 2014, p. 168 \NC \NR + Icon Books Ltd, London, 2014, p.168 \NC \NR \NC sapolsky.tex \NC Robert M. Sapolsky \NC Why Zebras Don't Have Ulsters, St Martin's Press, 2004 \NC \NR \NC mcnish.tex \NC Hollie McNish \NC Poetry versus Orchestra, Hollie McNish and Metropole @@ -60,6 +61,7 @@ used in testing bibliographic references and citations. Rider, London, 2014. \NC \NR \NC poe.tex \NC Edgar Allan Poe \NC A dream within a dream, www.poetryfoundation.org. \NC \NR \NC gray.tex \NC John Gray \NC https://www.theguardian.com/books/2008/mar/15/society \NC \NR +\NC dijkstra.tex \NC Edsger Dijkstra \NC \NC \NR \stoptabulate % Tufte: This quote will always produce hyphenated text, apart from the content, @@ -91,4 +93,6 @@ used in testing bibliographic references and citations. % The Schwarzenegger letter was originally typeset at a width equivalent to 16.1cm in % a default ConTeXt setup. +% math-kontinuitet-sv.tex : persson|--|sundqvist.tex (infinitesimalkalkyl) + \stoptext diff --git a/Master/texmf-dist/tex/context/sample/math/math-knuth-dt.tex b/Master/texmf-dist/tex/context/sample/math/math-knuth-dt.tex new file mode 100644 index 00000000000..7babcaf76f3 --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/math/math-knuth-dt.tex @@ -0,0 +1,16 @@ +{\bf 15.} (This procedure maintains four integers $(A, B, C, D)$ with the +invariant meaning that \quotation{our remaining job is to output the continued +fraction for $(Ay + B)/(Cy + D)$, where $y$ is the input yet to come.}) Initially +set $j \leftarrow k \leftarrow 0$, $(A, B, C, D) \leftarrow (a, b, c, d)$; then +input $x_j$ and set $(A, B, C, D) \leftarrow (Ax_j + B, A, Cx_j + D, C)$, $j +\leftarrow j + 1$, one or more times until $C + D$ has the same sign as $C$. +(When $j > 1$ and the input has not terminated, we know that $1 < y < \infty$; +and when $C + D$ has the same sign as $C$ we know therefore that $(Ay + B)/(Cy + +D)$ lies between $(A + B)/(C + D)$ and $A/C$.) Now comes the general step: If no +integer lies strictly between $(A + B)/(C + D)$ and $A/C$, output $X_k \leftarrow +\lfloor A/C \rfloor$, and set $(A, B, C, D) \leftarrow (C, D, A - X_ k C, B - X_k +D)$, $k \leftarrow k + 1$; otherwise input $x_j$ and set $(A, B,C, D) \leftarrow +(Ax_j + B, A, Cx_j + D,C)$, $j \leftarrow j + 1$. The general step is repeated ad +infinitum. However, if at any time the \emph{final} $x_j$ is input, the algorithm +immediately switches gears: It outputs the continued fraction for $(Ax_j + +B)/(Cx_j + D)$, using Euclid's algorithm, and terminates. diff --git a/Master/texmf-dist/tex/context/sample/math/math-kontinuitet-sv.tex b/Master/texmf-dist/tex/context/sample/math/math-kontinuitet-sv.tex new file mode 100644 index 00000000000..0e633d6f2b8 --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/math/math-kontinuitet-sv.tex @@ -0,0 +1,8 @@ +Ett alternativt sätt att uttrycka att $f$ är kontinuerlig i $a$ är att $a\in D_f$ +och att det givet $\epsilon>0$ existerar $\delta>0$ sådant att +$\fenced[bar][size=0]{f(a+h) - f(a)} < \epsilon$ så snart +$\fenced[bar][size=0]{h} < \delta$ och $a+h$ tillhör definitionsmängden för $f$. +Ytterligare ett sätt att uttrycka att $f$ är kontinuerlig i $a$ är att det för +varje $\epsilon$-omgivning $B(f(a),\epsilon)$ av $f(a)$ finns en +$\delta$-omgivning $B(a,\delta)$ av $a$ så att $f$ avbildar $B(a,\delta)\cap D_f$ +in i $B(f(a),\epsilon)$, dvs.\ $f(B(a,\delta)) \subset B(f(a),\epsilon)$. diff --git a/Master/texmf-dist/tex/context/sample/third/alfredsson-sv.tex b/Master/texmf-dist/tex/context/sample/third/alfredsson-sv.tex new file mode 100644 index 00000000000..e31e26270e1 --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/third/alfredsson-sv.tex @@ -0,0 +1,6 @@ +Det var så förbannat kallt ute att det blev isbildning i näshåren på mig och så +småning om långt ut i mustascherna, som sakta styvnade. Någon ordentlig pälsmössa +hade jag inte, bara min engelska tyghatt, som jag drog ner så långt jag kunde och +till slut gav jag fan i hur det såg ut och knöt halsduken om. Halvspringande +knarrade jag fram över snön i allén för att hinna tillbaks till hotellet innan +jag helt koagulerade till en isstod. diff --git a/Master/texmf-dist/tex/context/sample/third/falstaff-sv.tex b/Master/texmf-dist/tex/context/sample/third/falstaff-sv.tex new file mode 100644 index 00000000000..94bee1532f8 --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/third/falstaff-sv.tex @@ -0,0 +1,5 @@ +För att stafva flerstafviga ord kräfvas ord med flera stafvelser. Sådana ord +kunna mot ringa kostnad anskaffas genom kommissionärer i landsorten eller också +genom att slå upp någon bok. Ett godt exempel på flerstafviga ord är +riksdagsmannautskottssuppleantbostadsstäderskevikariebarnbarnsbyxor. Detta ord är +dock ett af de lättare. Ett svårare ord är deremot lejon. diff --git a/Master/texmf-dist/tex/context/sample/third/lansburgh-letterspacing-sv.tex b/Master/texmf-dist/tex/context/sample/third/lansburgh-letterspacing-sv.tex new file mode 100644 index 00000000000..c62367aeb42 --- /dev/null +++ b/Master/texmf-dist/tex/context/sample/third/lansburgh-letterspacing-sv.tex @@ -0,0 +1,6 @@ +Spärrning av betonade (ej av filologiska eller andra skäl urskilda) ord eller +meningar inom löpande text är typografiskt störande i alla språk och bör undvikas +så mycket som möjligt. I engelskan är en sådan spärrning okänd och bör +automatiskt ersättas med kursiv, om detta kan ske utan principiella ingripanden i +manuskriptets disposition i övrigt. Samma gäller för franskan. Spärrning måste i +tyskan tolereras mera än i något annat språk. Svenskan intar en medelställning. diff --git a/Master/texmf-dist/tex/context/sample/third/readme.txt b/Master/texmf-dist/tex/context/sample/third/readme.txt index 24fc809e426..6a5ccc06ec1 100644 --- a/Master/texmf-dist/tex/context/sample/third/readme.txt +++ b/Master/texmf-dist/tex/context/sample/third/readme.txt @@ -126,3 +126,26 @@ vallejo-trilce-es.tex ------------------------------------------------------------------------------------ Poema XXXIII + +------------------------------------------------------------------------------------ +alfredsson-sv.tex +------------------------------------------------------------------------------------ + +Hans Alfredsson - En ond man + +------------------------------------------------------------------------------------ +falstaff-sv.tex +------------------------------------------------------------------------------------ + +En hvar sin egen professor eller Allt menskligt vetande i sammandrag. Kortfattad +encyklopedi af Falstaff Fakir + +------------------------------------------------------------------------------------ +lansburgh-letterspacing-sv +------------------------------------------------------------------------------------ + +% Lansburgh - Sättningsregler +% A paragraph on letterspacing + + + diff --git a/Master/texmf-dist/tex/context/test/mkiv/pdf-a1a-2005.mkiv b/Master/texmf-dist/tex/context/test/mkiv/pdf-a1a-2005.mkiv index ec767bf829c..3e921da6ee4 100644 --- a/Master/texmf-dist/tex/context/test/mkiv/pdf-a1a-2005.mkiv +++ b/Master/texmf-dist/tex/context/test/mkiv/pdf-a1a-2005.mkiv @@ -17,6 +17,9 @@ \placebookmarks[chapter][all][force=yes] +% \setupinteraction[title=MyTitle,subtitle=MySubject,author=MySelf] + +\nopdfcompression \starttext diff --git a/Master/texmf-dist/tex/context/test/mkiv/pdf-a3a.mkiv b/Master/texmf-dist/tex/context/test/mkiv/pdf-a3a.mkiv index 0013d7a3600..7256cada76d 100644 --- a/Master/texmf-dist/tex/context/test/mkiv/pdf-a3a.mkiv +++ b/Master/texmf-dist/tex/context/test/mkiv/pdf-a3a.mkiv @@ -1,6 +1,6 @@ % PDF/A-3a -\enabletrackers[structure.tags,backend.tags,backend.xmp] +% \enabletrackers[structure.tags,backend.tags,backend.xmp] \setupbackend [format=PDF/A-3a, @@ -8,10 +8,17 @@ profile={sRGB.icc,default_gray.icc}, level=0] -\setuptagging[state=start] +% \setupinteraction[state=start]% needed for attachment and such +% \setupattachment[method=hidden] + +\setupinteraction + [state=start, + author=Author, + title=Test, + subtitle=Subject, + description=Description] -\setupinteraction[state=start]% needed for attachment -%\setupattachment[method=hidden] +\setuptagging[state=start] \setupcolors[cmyk=no] \definecolor[rgbblack][b=0.01] @@ -19,8 +26,6 @@ \placebookmarks[chapter][all][force=yes] - - \starttext \starttextcolor[rgbblack] diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua index 66207339e17..e7d81549979 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua @@ -7,7 +7,7 @@ -- copyright = 'LuaTeX Development Team', -- } -LUATEXCOREVERSION = 1.120 -- we reflect the luatex version where changes happened +LUATEXCOREVERSION = 1.161 -- we reflect the luatex version where changes happened -- This file overloads some Lua functions. The readline variants provide the same -- functionality as LuaTeX <= 1.04 and doing it this way permits us to keep the @@ -33,8 +33,11 @@ if kpseused == 1 then local kpse_recordinputfile = kpse.record_input_file local kpse_recordoutputfile = kpse.record_output_file + local kpse_outputnameok = kpse.out_name_ok + local kpse_inputnameok = kpse.in_name_ok + local io_open = io.open - local io_popen = io.popen + local io_popen = kpse.popen or io.popen -- should have been be in the kpse namespace local io_lines = io.lines local fio_readline = fio.readline @@ -44,56 +47,48 @@ if kpseused == 1 then io.saved_lines = io_lines -- always readonly mt.saved_lines = mt_lines -- always readonly - local function luatex_io_open(name,how) - if not how then - how = 'r' - end - local f = io_open(name,how) - if f then - if type(how) == 'string' and find(how,'w') then - kpse_recordoutputfile(name,'w') - else - kpse_recordinputfile(name,'r') - end + -- The version below is different from the luatex one (which is probably made for + -- LaTeX) because read should not be the default (e.g. when how == 'q'). Also in + -- that version record doesn't always work for write. How about append? + + local function validinput(name,how) + if type(how) ~= "string" or how == "" then + how = "r" end - return f + return not find(how,"w") and kpse_inputnameok(name) and io_open(name,how) end - local function luatex_io_open_readonly(name,how) - if not how then - how = 'r' + local function validoutput(name,how) + return type(how) == "string" and find(how,"w") and kpse_outputnameok(name) and io_open(name,how) + end + + local function luatex_io_open(name,how) + local handle = validinput(name,how) + if handle then + kpse_recordinputfile(name,"r") else - how = gsub(how,'[^rb]','') - if how == '' then - how = 'r' + handle = validoutput(name,how) + if handle then + kpse_recordoutputfile(name,"w") end end - local f = io_open(name,how) - if f then - fio_recordfilename(name,'r') - end - return f + return handle end - local function luatex_io_popen(name,...) - local okay, found = kpse_checkpermission(name) - if okay and found then - return io_popen(found,...) + local function luatex_io_open_readonly(name,how) + local handle = validinput(name,how) + if handle then + kpse_recordinputfile(name,"r") end + return handle end - -- local function luatex_io_lines(name,how) - -- if name then - -- local f = io_open(name,how or 'r') - -- if f then - -- return function() - -- return fio_readline(f) - -- end - -- end - -- else - -- return io_lines() - -- end - -- end + -- local function luatex_io_popen(name,...) + -- local okay, found = kpse_checkpermission(name) + -- if okay and found then + -- return io_popen(found,...) + -- end + -- end -- For some reason the gc doesn't kick in so we need to close explicitly -- so that the handle is flushed. @@ -102,8 +97,9 @@ if kpseused == 1 then local function luatex_io_lines(name,how) if type(name) == "string" then - local f = io_open(name,how or 'r') - if f then + local handle = validinput(name,how) + if handle then + kpse_recordinputfile(name,"r") return function() local l = fio_readline(f) if not l then @@ -130,7 +126,8 @@ if kpseused == 1 then mt.lines = luatex_io_readline io.open = luatex_io_open - io.popen = luatex_io_popen + -- io.popen = luatex_io_popen + io.popen = io_popen else @@ -163,28 +160,31 @@ if saferoption == 1 then local reported = false end - os.execute = installdummy("os.execute") - os.spawn = installdummy("os.spawn") - os.exec = installdummy("os.exec") - os.setenv = installdummy("os.setenv") - os.tempdir = installdummy("os.tempdir") + os.execute = installdummy("os.execute") + os.spawn = installdummy("os.spawn") + os.exec = installdummy("os.exec") + os.setenv = installdummy("os.setenv") + os.tempdir = installdummy("os.tempdir") + + io.popen = installdummy("io.popen") + io.open = installdummy("io.open",luatex_io_open_readonly) - io.popen = installdummy("io.popen") - io.open = installdummy("io.open",luatex_io_open_readonly) + os.kpsepopen = io.popen -- because it's in the os namespace ... brr - os.rename = installdummy("os.rename") - os.remove = installdummy("os.remove") + os.rename = installdummy("os.rename") + os.remove = installdummy("os.remove") - io.tmpfile = installdummy("io.tmpfile") - io.output = installdummy("io.output") + io.tmpfile = installdummy("io.tmpfile") + io.output = installdummy("io.output") - lfs.chdir = installdummy("lfs.chdir") - lfs.lock = installdummy("lfs.lock") - lfs.touch = installdummy("lfs.touch") - lfs.rmdir = installdummy("lfs.rmdir") - lfs.mkdir = installdummy("lfs.mkdir") + lfs.chdir = installdummy("lfs.chdir") + lfs.lock = installdummy("lfs.lock") + lfs.touch = installdummy("lfs.touch") + lfs.rmdir = installdummy("lfs.rmdir") + lfs.mkdir = installdummy("lfs.mkdir") debug = nil + package.loaded.debug = nil -- os.[execute|os.spawn|os.exec] already are shellescape aware) @@ -198,6 +198,10 @@ if saferoption == 1 or shellescape ~= 1 then package.searchers[4] = nil package.searchers[3] = nil + if os.setenv then + os.setenv = function(...) end -- Great, this will fail for some usage. + end + ffi = require('ffi') if ffi then diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua index 5441fa0043b..340be1951a1 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2023-05-05 18:36 +-- merge date : 2024-02-27 09:18 do -- begin closure to overcome local limits and interference @@ -1341,19 +1341,22 @@ local function copy(t,tables) tables[t]=tcopy end for i,v in next,t do + local k if type(i)=="table" then if tables[i] then - i=tables[i] + k=tables[i] else - i=copy(i,tables) + k=copy(i,tables) end + else + k=i end if type(v)~="table" then - tcopy[i]=v + tcopy[k]=v elseif tables[v] then - tcopy[i]=tables[v] + tcopy[k]=tables[v] else - tcopy[i]=copy(v,tables) + tcopy[k]=copy(v,tables) end end local mt=getmetatable(t) @@ -1550,7 +1553,11 @@ local function do_serialize(root,name,depth,level,indexed) elseif tv=="number" then if tk=="number" then if hexify then - handle(format("%s [0x%X]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [0x%X]=%q,",depth,k,v)) + else + handle(format("%s [0x%X]=%s,",depth,k,v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k,v)) else @@ -1558,7 +1565,11 @@ local function do_serialize(root,name,depth,level,indexed) end elseif tk=="boolean" then if hexify then - handle(format("%s [%s]=0x%X,",depth,k and "true" or "false",v)) + if accurate then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + else + handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) else @@ -1567,7 +1578,11 @@ local function do_serialize(root,name,depth,level,indexed) elseif tk~="string" then elseif noquotes and not reserved[k] and lpegmatch(propername,k) then if hexify then - handle(format("%s %s=0x%X,",depth,k,v)) + if accurate then + handle(format("%s %s=%q,",depth,k,v)) + else + handle(format("%s %s=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s %s=%q,",depth,k,v)) else @@ -1575,7 +1590,11 @@ local function do_serialize(root,name,depth,level,indexed) end else if hexify then - handle(format("%s [%q]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [%q]=%q,",depth,k,v)) + else + handle(format("%s [%q]=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s [%q]=%q,",depth,k,v)) else @@ -3331,6 +3350,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -3339,6 +3359,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) @@ -4015,6 +4036,7 @@ end strings.formatters.add=add patterns.xmlescape=Cs((P("<")/"<"+P(">")/">"+P("&")/"&"+P('"')/"""+anything)^0) patterns.texescape=Cs((C(S("#$%\\{}"))/"\\%1"+anything)^0) +patterns.ctxescape=Cs((C(S("#$%\\{}|"))/"\\%1"+anything)^0) patterns.luaescape=Cs(((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0) patterns.luaquoted=Cs(Cc('"')*((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0*Cc('"')) add(formatters,"xml",[[lpegmatch(xmlescape,%s)]],{ xmlescape=patterns.xmlescape }) @@ -4085,6 +4107,20 @@ do return cache[s] end end +if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then + local t={ + ["#"]="#H", + ["\n"]="#L", + ['"']="#Q", + ["\r"]="#R", + [" "]="#S", + ["\t"]="#T", + ["\\"]="#X", + } + function string.texhashed(s) + return (gsub(s,".",t)) + end +end end -- closure @@ -9530,7 +9566,6 @@ function constructors.scale(tfmdata,specification) local stackmath=not properties.nostackmath local haskerns=properties.haskerns or properties.mode=="base" local hasligatures=properties.hasligatures or properties.mode=="base" - local realdimensions=properties.realdimensions local writingmode=properties.writingmode or "horizontal" local identity=properties.identity or "horizontal" local vfonts=target.fonts @@ -9626,6 +9661,13 @@ function constructors.scale(tfmdata,specification) if changed then local c=changed[unicode] if c and c~=unicode then + local cc=changed[c] + if cc then + while cc do + c=cc + cc=changed[c] + end + end if c then description=descriptions[c] or descriptions[unicode] or character character=characters[c] or character @@ -9646,26 +9688,6 @@ function constructors.scale(tfmdata,specification) local height=description.height local depth=description.depth local isunicode=description.unicode - if realdimensions then - if not height or height==0 then - local bb=description.boundingbox - local ht=bb[4] - if ht~=0 then - height=ht - end - if not depth or depth==0 then - local dp=-bb[2] - if dp~=0 then - depth=dp - end - end - elseif not depth or depth==0 then - local dp=-description.boundingbox[2] - if dp~=0 then - depth=dp - end - end - end if width then width=hdelta*width else width=scaledwidth end if height then height=vdelta*height else height=scaledheight end if depth and depth~=0 then @@ -10796,7 +10818,7 @@ local function tounicode16(unicode) return s_unknown else unicode=unicode-0x10000 - return f_double(idiv(k,0x400)+0xD800,unicode%0x400+0xDC00) + return f_double(idiv(unicode,0x400)+0xD800,unicode%0x400+0xDC00) end end local function tounicode16sequence(unicodes) @@ -10815,7 +10837,7 @@ local function tounicode16sequence(unicodes) t[l]=s_unknown else u=u-0x10000 - t[l]=f_double(idiv(k,0x400)+0xD800,u%0x400+0xDC00) + t[l]=f_double(idiv(u,0x400)+0xD800,u%0x400+0xDC00) end end return concat(t) @@ -12666,6 +12688,8 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst capheight=metrics.capheight or fontdata.maxy, ascender=metrics.typoascender, descender=metrics.typodescender, + ascent=metrics.winascent, + descent=metrics.windescent, platformnames=platformnames or nil, instancenames=instancenames or nil, tableoffsets=fontdata.tableoffsets, @@ -17664,21 +17688,25 @@ local function chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nof local current=readarray(f) local after=readarray(f) local noflookups=readushort(f) - local lookups=readlookuparray(f,noflookups,#current) - before=readcoveragearray(f,tableoffset,before,true) - current=readcoveragearray(f,tableoffset,current,true) - after=readcoveragearray(f,tableoffset,after,true) - return { - format="coverage", - rules={ - { - before=before, - current=current, - after=after, - lookups=lookups, + local lookups=current and readlookuparray(f,noflookups,#current) + if lookups then + before=readcoveragearray(f,tableoffset,before,true) + current=readcoveragearray(f,tableoffset,current,true) + after=readcoveragearray(f,tableoffset,after,true) + return { + format="coverage", + rules={ + { + before=before, + current=current, + after=after, + lookups=lookups, + } } } - } + else + report("confusing subtype %a in %a %s",subtype,"chainedcontext",what) + end else report("unsupported subtype %a in %a %s",subtype,"chainedcontext",what) end @@ -18407,7 +18435,7 @@ do end return features end - local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) setposition(f,lookupoffset) local noflookups=readushort(f) local lookups=readcardinaltable(f,noflookups,ushort) @@ -18424,12 +18452,12 @@ do subtables[j]=offset+readushort(f) end local markclass=band(flagbits,0x0010)~=0 + local markset=rshift(flagbits,8) if markclass then markclass=readushort(f) end - local markset=rshift(flagbits,8) if markset>0 then - markclass=markset + markclass=nofmarkclasses+markset end lookups[lookupid]={ type=lookuptype, @@ -18773,7 +18801,10 @@ do if not lookupstoo then return end - local lookups=readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local markclasses=fontdata.markclasses + local marksets=fontdata.marksets + local nofmarkclasses=(markclasses and #markclasses or 0)-(marksets and #marksets or 0) + local lookups=readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) if lookups then resolvelookups(f,lookupoffset,fontdata,lookups,lookuptypes,lookuphandlers,what,tableoffset) end @@ -18942,6 +18973,7 @@ function readers.gdef(f,fontdata,specification) end end if marksetsoffset~=0 then + local nofmarkclasses=fontdata.markclasses and #fontdata.markclasses or 0 marksetsoffset=tableoffset+marksetsoffset setposition(f,marksetsoffset) local format=readushort(f) @@ -18951,7 +18983,8 @@ function readers.gdef(f,fontdata,specification) for i=1,nofsets do local offset=sets[i] if offset~=0 then - marksets[i]=readcoverage(f,marksetsoffset+offset) + markclasses[nofmarkclasses+i]=readcoverage(f,marksetsoffset+offset) + marksets[i]={} end end end @@ -19997,6 +20030,8 @@ function readers.mvar(f,fontdata,specification) end end end +function readers.dsig(f,fontdata,specification) +end end -- closure @@ -21334,7 +21369,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_d local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf -otf.version=3.133 +otf.version=3.140 otf.cache=containers.define("fonts","otl",otf.version,true) otf.svgcache=containers.define("fonts","svg",otf.version,true) otf.pngcache=containers.define("fonts","png",otf.version,true) @@ -22218,7 +22253,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis if kind=="gsub_single" then for i=1,#steps do for unicode,data in next,steps[i].coverage do - if unicode~=data then + if unicode~=data and not changed[unicode] then changed[unicode]=data end if trace_singles then @@ -22231,7 +22266,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis for unicode,data in next,steps[i].coverage do local replacement=data[alternate] if replacement then - if unicode~=replacement then + if unicode~=replacement and not changed[unicode] then changed[unicode]=replacement end if trace_alternatives then @@ -22239,7 +22274,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis end elseif defaultalt=="first" then replacement=data[1] - if unicode~=replacement then + if unicode~=replacement and not changed[unicode] then changed[unicode]=replacement end if trace_alternatives then @@ -22247,7 +22282,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis end elseif defaultalt=="last" then replacement=data[#data] - if unicode~=replacement then + if unicode~=replacement and not changed[unicode] then changed[unicode]=replacement end if trace_alternatives then @@ -24657,6 +24692,29 @@ local function checklookups(fontdata,missing,nofmissing) report_unicodes("not unicoded: % t",sortedkeys(done)) end end + for k,v in next,descriptions do + local math=v.math + if math then + local variants=math.variants + local parts=math.parts + local unicode=v.unicode + if variants then + if unicode then + for i=1,#variants do + local v=descriptions[variants[i]] + if not v then + elseif v.unicode then + else + v.unicode=unicode + end + end + end + end + if parts then + parts[#parts//2+1].unicode=unicode + end + end + end end local firstprivate=fonts.privateoffsets and fonts.privateoffsets.textbase or 0xF0000 local puafirst=0xE000 @@ -24852,7 +24910,9 @@ local function unifyglyphs(fontdata,usenames) if colors then for i=1,#colors do local c=colors[i] - c.slot=indices[c.slot] + if c then + c.slot=indices[c.slot] + end end end end @@ -27661,7 +27721,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou if not marks[char] then baseindex=baseindex+componentindex componentindex=countcomponents(start,marks) - elseif not deletemarks then + elseif not deletemarks or (skiphash and skiphash[char]) then setligaindex(start,baseindex+getligaindex(start,componentindex)) if trace_marks then logwarning("%s: keep ligature mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start)) @@ -29382,17 +29442,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if last then local char,id=ischar(last,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n1 then + prev=getprev(prev) + end + n=n-1 + elseif skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end prev=getprev(prev) - elseif seq[n][char] then - if n>1 then - prev=getprev(prev) - end - n=n-1 elseif discfound then notmatchreplace[discfound]=true if notmatchpost[discfound] then @@ -29599,17 +29659,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if current then local char,id=ischar(current,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n