This seems like a very basic question and I'm sure it's been answered somewhere, but I can't find anything on it. The closest I've gotten is this question, but neither of the solutions in the accepted answer help my code.
I'm trying to branch based on the value of a namespace parameter. If I replace the \namedordefaulteraparameter{#1}{formatdecoration}
with a literal yes
, I get "y" as I'd expect, and just printing the value of that macro also gives me the "yes" it should. However, when I pass the macro to the test, I always get "n". I'm guessing that this is due to \doifsamestringelse
testing the values without expanding them, but no matter how many \expandafter
s I use or where I put them, I can't get the first result to be included. What am I missing?
\definenamespace[era][
type=module,
name=era,
command=yes,
setup=yes,
]
\setupera[
formatdecoration=yes,
]
\define[2]\namedordefaulteraparameter{%
\doifsomethingelse
{\namederaparameter{#1}{#2}}
{\namederaparameter{#1}{#2}}
{\eraparameter{#2}}%
}
\def\eradecorated[#1]#2{%
\doifsamestringelse{yes}{\namedordefaulteraparameter{#1}{formatdecoration}}
{y}
{n}%
}
I know I could do this pretty easily in Lua, but for something so simple, I don't see any reason to add that extra syntax.