Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using l3keys, is there any way to inspect the keys currently in a (sub)module? I'm looking for something like \clist_show, but for keys.

\keys_show sounded promising, but requires that you already know the keys that have been created: \keys_show:nn {<module>} {<key>}.

My ideal scenario would be:

\keys_show:n {module}
There are 4 keys in the key module 'module' (without outer braces):
>    {this} tl
>    {is}   tl
>    {a}    tl
>    {test} bool
share|improve this question
I know it can be done (at least to the effect), given @egreg's comment. –  Sean Allred Aug 11 '13 at 20:11
Update: a good complete solution for this might involve some trickery; the test egreg provided in his answer was much simpler in concept than I had imagined… –  Sean Allred Aug 11 '13 at 23:19
Right now, we don't keep track anywhere of the list of keys (this is similar to why you can't get a list of all macros defined at a given time in TeX). In principle we could add an option to collect all keys somewhere. –  Bruno Le Floch Aug 22 '13 at 10:30
add comment

1 Answer

up vote 6 down vote accepted

As Bruno says in a comment, the situation here is entirely the same as wanting to list all macros defined. Indeed, key definitions both in l3keys and other keyval packages are simply macro names in the 'appropriate' place. TeX doesn't provide us with a route to query the list of defined macros for 'all matching some wildcard scheme', so the only way to have such a command available is to do it 'by hand'. At present, that is not the case in l3keys. One can of course imagine doing this, but without a clear use case it is likely to add to the complexity of the code without any general benefit.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.