pgfkeys ".estore in" handler does not work as expected
The .estore in
handler is for cases when the value can depend on a macro that's likely to receive different values between the setting and the usage of the created macro. Such macros should be safe for full expansion.
Indeed, one has to be aware of the fact that .estore in
uses \edef
and several typesetting macros don't survive it: \textsc
is one of them, together with all font selection macros.
With maintitle/.store in=\@wgetdoc@title@maintitle,
when you do
maintitle=Hello world,
you just perform
\def\@wgetdoc@title@maintitle{Hello world}
and you need no expansion; when \@wgetdoc@title@maintitle
is used, it will expand to Hello world
.
It would be good if pgfkeys
provided also a .protectedestore in
handler, at least in a LaTeX context; alas, there is nothing like this and you wouldn't need it anyway.
I'd avoid all those blank lines in the code and protect end-of-lines more carefully.
\textsc
(and many other text formatting macros) is unexpandable and causes to be processed in time which is often referred to early expansion. That's causing the problem.
If you need an expansion before the macro storing, you can use the /.expand once
,/.expand twice
and /.expanded
handlers instead and use store in
.
Also there is a bug report waiting to be fixed about /.estore in