I'm defining a new command which should take an optional list of arguments (integers or ranges):
\doit[3,5-7,9]{something}
What I have so far:
\def\doit{\@ifnextchar[{\@with}{\@without}}
\def\@with[#1]#2{
...
}
\def\@without#1{
}
In the with case, how can I iterate over the optional arguments? How can I distinguish between integers and ranges? Do I need to do the parsing manually or there are tools which can help me?


pgfis able to handle such things. – bodo Jul 27 '12 at 11:20etoolboxoffers\docsvlistfor list-parsing. – cgnieder Jul 27 '12 at 11:40