I would like to understand if pgfkeys already offers a way (although undocumented, as far as I could see) to obtain a list of defined keys in a path, that is

    /my/path/a = 1,
    /my/path/b/c = x,
\pgfkeysdefinedat{/my/path}{\thekeyslist} % missing macro
\thekeyslist      -> {a,b/c} % also acceptable with full path
% also acceptable -> {a,b}

(Ideally this would be packaged into a handler /.ls=\macro)

If this is not supported, I would like to know what's an idiomatic way of defining an handler that explicitly accumulates key names:

    /my/path/a/.track={code of key a},
    /my/path/b/.track={code of key b},
\thekeyslist -> {a,b}

Where /.track={code} is equivalent to /.code={code} but with the side-effect of accumulating the key name into /.ls.

Otherwise, as last resort,

    /my/path/a/.track={\thekeyslist}{code of key a},
    /my/path/b/.track={\thekeyslist}{code of key b},
\thekeyslist -> {/my/path/a,/my/path/b}

1 Answer 1


MarmotGhost has developed an experimental package for a question on topanswers.xyz/tex which can track the usage of, say, the .code handler.


\pgfkeys{install tracking for={.code}}
  /my/path/a/.code = #1,
  /my/path/b/c/.code = #1
\bracketset{action character=@}
\begin{forest} for tree={grow'=0,folder}


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .