# [texhax] class options with spaces

Arno Trautmann Arno.Trautmann at gmx.de
Wed Aug 5 20:20:40 CEST 2009

Joseph Wright wrote:
> Arno Trautmann wrote:
>> I need the possibility to define class options that take an argument
>> with spaces, such as
>>
>> \documentclass[use=section one]{myclass}
>>
>> I try this using xkeyval:
>>
>> \DeclareOptionX{use}{\def\use at content{#1}}
>>
>> but the content of \use at content will be ”sectionone“. Is it possible to
>> save the spaces? I didn’t find anything in the xkeyval doc and
>> everything I tried (grouping in input etc.) was not successfull.
>
> Only if you load one of the kernel patches before \documentclass. Both
> kvoptions and xkeyval have patches for the problem.

Thank you very much, I didn’t know that! It works fine – but only at
user level :(
There is no way to use the patch in the class so the user won’t need to

So I might try it the other way round: As I want to compare the argument
of the class option to the argument of a user level macro, it should
work if I remove the spaces from the latter one. Maybe the better
question is:

given:
\documentclass[use=section one]{}
\usermacro{section one}

how can I compare the two using e.g. \ifthenelse{\equal{}{}} ?

cheers
Arno

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://tug.org/pipermail/texhax/attachments/20090805/b8269961/attachment-0001.bin>