[Tex/LaTex] How to define a command that takes more than 18 arguments


This question is based on this answer.
It is a continuation of my previous qestion regarding list of values in latex.

According to first link there is a limitation on the number of arguments I have faced with.

I tried to use specified approach and it works well.

But what if I want to have more than 18 arguments?

Is it possible to use such approach recursively?

For example I want to define a function with 25 arguments. Is it possible to use next:



    % Access to arguments #1-#18 via \tempa-\tempr and to argument #19-#25 via #1-#7.

I tried to compile it but I got an error:

! Missing number, treated as zero.
<to be read again>
l.40 }  

So what I do wrong?

UPDATE 19.08.2015:

I have used next construction to achieve my goals:

\expandafter\let\csname temp\@roman\@tempcnta\endcsname\tmp
        Possible values: \ifthenelse{\equal{\tempi}{}}{}{& \tempi\\}
        \ifthenelse{\equal{\tempii}{}}{}{& \tempii\\}
        \ifthenelse{\equal{\tempiii}{}}{}{& \tempiii\\}
        \ifthenelse{\equal{\tempiv}{}}{}{& \tempiv\\}
        \ifthenelse{\equal{\tempv}{}}{}{& \tempv\\}
        \ifthenelse{\equal{\tempvi}{}}{}{& \tempvi\\}
        \ifthenelse{\equal{\tempvii}{}}{}{& \tempvii\\}
        \ifthenelse{\equal{\tempviii}{}}{}{& \tempviii\\}
        \ifthenelse{\equal{\tempix}{}}{}{& \tempix\\}
        \ifthenelse{\equal{\tempx}{}}{}{& \tempx\\}
        \ifthenelse{\equal{\tempxi}{}}{}{& \tempxi\\}
        \ifthenelse{\equal{\tempxii}{}}{}{& \tempxii\\}
        \ifthenelse{\equal{\tempxiii}{}}{}{& \tempxiii\\}
        \ifthenelse{\equal{\tempxiv}{}}{}{& \tempxiv\\}
        \ifthenelse{\equal{\tempxv}{}}{}{& \tempxv\\}
        \ifthenelse{\equal{\tempxvi}{}}{}{& \tempxvi\\}
        \ifthenelse{\equal{\tempxvii}{}}{}{& \tempxvii\\}
        \ifthenelse{\equal{\tempxviii}{}}{}{& \tempxviii\\}
      Default value: & \tempxix\\

\ParseOptMenuItemList takes values as a comma separated list.

Best Answer

Using multiple {} makes for a very hard to use interface different from all other latex commands, latex has standard facilities for handling arguments as comma separated lists (\usepackage{array,bm,graphics} for example).

The following produces

argument 24 is: [x]

on the terminal confirming that argument 24 (at least:-) has been captured.

\expandafter\let\csname temp\@roman\@tempcnta\endcsname\tmp
\typeout{argument 24 is: [\tempxxiv]}%



Related Question