5

I have a macro accepting several optional arguments in a comma separated list. I would like to assign a value containing a comma to a particular argument. Is there a way to "escape" this particular comma so that it will not be interpreted as the beginning of a new argument.

Here is an except of what I would like to achieve:

\begin{mymacro}[arg1=a,b,arg2=c]
% ...
\end{mymacro}

I would like to set arg1 to a,b and not, of course, seeing this interpreted as "arg1=a and b".

Thanks!

2
  • 2
    [arg1={a,b},arg2=c] Commented Sep 10, 2012 at 17:20
  • 3
    From the xkeyval package documentation (p 9): "When you want to use commas or equality signs in the value of a key, surround the value by braces, as shown in the example: \setkeys[my]{familya}{keya={some=text,other=text}}"
    – Werner
    Commented Sep 10, 2012 at 17:27

1 Answer 1

4

Well I guess that was a trivial question...

The answer is:

[arg1={a,b},arg2=c]

@Qrrbrbirlbel: thanks.

You must log in to answer this question.

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