This is most likely a dupe of pgfkeys overeager in stripping away my braces
If I pass {[[
To]], [[
From]]}
to a macro as the value of an optional argument using pgfkeys
, the outermost bracket is stripped. This doesn't happen if I pass it as the single mandatory argument.
I've been using pgfkeys
for a while. It generally works well for me, and has the features I need, which may not be the case for other similar key packages. So I was wondering, assuming this is the issue as described in that other question, and not user error, can anyone suggest a workaround? Adding extra spaces to the \normalmacro
argument doesn't help. They all get stripped away.
For background, this is for use with LuaTeX, to pass arrays from TeX to Lua, but Lua is not needed to illustrate the issue.
Since an extra pair of braces makes no difference to the printed output here, the difference can only be seen in the \typeout
output to the terminal and console.
\documentclass[12pt]{scrartcl}
\usepackage{pgfkeys}
\newcommand\colnames{}
\pgfkeys
{
/foo/.is family, /foo,
default/.style =
{
colnames,
},
colnames/.estore in = \colnames,
colnames/.default = {},
}
\begin{document}
\NewDocumentCommand{\usingpgfkeys}{O{}}
{
\pgfkeys{/foo, default, #1}%
\typeout{USINGPGFKEYS RETURNS \colnames}\colnames
}
\usingpgfkeys[colnames={[[`To`]], [[`From`]]}]
\NewDocumentCommand{\normalmacro}{m}{\typeout{NORMALMACRO RETURNS #1}#1}
\normalmacro{{[[`To`]], [[`From`]]}}
\end{document}
{{[[<stuff>]]}}
. The issue is, that will be still wrong withpgfkeys
...