diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/s-reg-01.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/s-reg-01.tex | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/s-reg-01.tex b/Master/texmf-dist/tex/context/base/s-reg-01.tex new file mode 100644 index 00000000000..123b97384d8 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/s-reg-01.tex @@ -0,0 +1,50 @@ +%D \module +%D [ file=s-reg-01, +%D version=2005.04.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Extra Regime Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D \macros +%D {showregime} +%D +%D This code is moved from the kernel to here. (We could make it +%D auto-loadable). + +\startluacode +--[[ldx-- +<p>The following code is rather <l n='context'/> specific.</p> +--ldx]]-- + +function regimes.show(regime) + regime = regimes.synonyms[regime] or regime + local r = regimes.data[regime] + if r then + tex.sprint(tc,"\\starttabulate[|rT|T|rT|lT|lT|lT|]") + for k, v in ipairs(r) do + tex.sprint(tex.ctxcatcodes, string.format("\\NC %s\\NC\\getvalue{%s}\\NC %s\\NC %s\\NC %s\\NC %s\\NC\\NR", k, + characters.contextname(v), characters.hexindex(v), characters.contextname(v), + characters.category(v), characters.description(v))) + end + tex.sprint(tex.ctxcatcodes,"\\stoptabulate") + else + tex.sprint(tex.ctxcatcodes,"unknown regime " .. regime) + end +end +\stopluacode + +\unprotect + +\def\showregime + {\dosingleempty\doshowregime} + +\def\doshowregime[#1]% + {\ctxlua{regimes.show("#1")}} + +\protect \endinput |