summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/symb-run.mkiv
blob: 3d92c44166f2a16d61bd180a657ab0457d4da1f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
%D \module
%D   [       file=symb-run,
%D        version=2010.12.08, % 1998.07.20,
%D          title=\CONTEXT\ Symbol Libraries,
%D       subtitle=Runtime Macros,
%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.

\startluacode
    function commands.showsymbolset(collection,symbols)
        if type(symbols) == "string" then
            symbols = utilities.parsers.settings_to_array(symbols)
        end
        context.start()
        context.forcesymbolset { collection }
        context.starttabulate { "|lT|l|l|" }
        for i=1,#symbols do
            local symbol = symbols[i]
            context.NC()
            context(symbol)
            context.NC()
            context.symbol(symbol)
            context.NC()
            context.color (
                { "red" },
                context.nested.ruledhbox(
                    context.nested.color (
                        { "black" },
                        context.nested.symbol(symbol)
                    )
                )
            )
            context.NR()
        end
        context.stoptabulate()
        context.stop()
    end
\stopluacode

\unprotect

\unexpanded\gdef\showsymbolset
  {\dosingleargument\symb_show_set}

\gdef\symb_show_set[#1]%
  {\ctxcommand{showsymbolset("#1","\symbolset{#1}")}}

\protect \endinput