pgfkeys argument parsing does not work as expected #22

Closed
opened 2026-03-30 11:49:06 +00:00 by lukas · 0 comments
Owner

Line 713 in 4bc4c12
delegate common/.style={

contains

Line 717 in 4bc4c12
color/.style = {/kata/color,##1},

then this is used in a command/env

Line 943 in 4bc4c12
\pgfkeys{/kata/step,#1}%

with the following declared arguments/options

Lines 921 to 931 in 4bc4c12
\pgfkeys{
/kata/step,
first step/.is if = kata@step@first,
first step/.default = true,
phantom/.is if = kata@step@phantom,
phantom/.default = true,
phantom = false,
phantom/.append code={\ifkata@step@phantom\pgfkeysalso{/kata/style/step phantom}\fi},
/kata/forward/delegate common,
/kata/forward/append common,
}

when calling

  \begin{step}[color={stance=pink},first step]

this leads to

Package pgfkeys Error: I do not know the key '/kata/color/first step' and I am going to ignore it

apparently, the /kata/color which implicitly performs /kata/color/.cd leaks and the remaining arguments are parsed in that space as well.

Even

\begin{step}[color={stance=pink},color={waza=brown}]

is not working. Instead

\begin{step}[color={stance=pink},waza=brown]

works (which is not to be expected as a user).


The interesting part is how to fix this? How can I cd back to where I came from? And/Or scope the cd properly?

https://git.atticus-sullivan.de/lukas/kata/src/commit/4bc4c1264713dd97e2ca25925ef327ef3dea0444/kata.dtx#L713 contains https://git.atticus-sullivan.de/lukas/kata/src/commit/4bc4c1264713dd97e2ca25925ef327ef3dea0444/kata.dtx#L717 then this is used in a command/env https://git.atticus-sullivan.de/lukas/kata/src/commit/4bc4c1264713dd97e2ca25925ef327ef3dea0444/kata.dtx#L943 with the following declared arguments/options https://git.atticus-sullivan.de/lukas/kata/src/commit/4bc4c1264713dd97e2ca25925ef327ef3dea0444/kata.dtx#L921-L931 when calling ```tex \begin{step}[color={stance=pink},first step] ``` this leads to ``` Package pgfkeys Error: I do not know the key '/kata/color/first step' and I am going to ignore it ``` apparently, the `/kata/color` which implicitly performs `/kata/color/.cd` leaks and the remaining arguments are parsed in that space as well. Even ```tex \begin{step}[color={stance=pink},color={waza=brown}] ``` is not working. Instead ```tex \begin{step}[color={stance=pink},waza=brown] ``` works (which is not to be expected as a user). --- The interesting part is how to fix this? How can I `cd` back to where I came from? And/Or scope the `cd` properly?
lukas self-assigned this 2026-03-30 11:49:06 +00:00
lukas closed this issue 2026-03-30 14:36:56 +00:00
lukas added this to the 1.0.0 milestone 2026-04-12 09:42:26 +00:00
Sign in to join this conversation.
No description provided.