TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

% ...

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


share|improve this question
[arg1={a,b},arg2=c] – Qrrbrbirlbel Sep 10 '12 at 17:20
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 Sep 10 '12 at 17:27
up vote 4 down vote accepted

Well I guess that was a trivial question...

The answer is:


@Qrrbrbirlbel: thanks.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.