What are the differences between choice and multichoice in LaTeX3

expl3latex3

When I was reading the interface3.pdf or the source3.pdf about the key-value part, I got confused when I saw <key>.choice: and <key>.multichoice:.

The explanations and examples of these two command are very similar and from the information given, I thought <key>.choice: can do the job of <key>.multichoice:, so what is the "extraordinary" function of <key>.multichoice:?

Best Answer

The difference is that .choice: is a key which accepts exactly one value, whereas .multichoice: means a key can be multi-valued. So if a user gives

some-key = a , some-key = b

a .choice: key will be set only to b, whereas a .multichoice: key is set to a,b. More typically, a user might give

some-key = {a,b}

which would (almost certainly) be an error for a .choice: key but which would apply both a and b for .multichoice:.

Related Question