I have the commands:
\def\tabfive{%
\renewcommand{\arraystretch}{1.1}
\begin{tabular}{p{0.18\linewidth}p{0.18\linewidth}p{0.18\linewidth}p{0.18\linewidth}p{0.18\linewidth}}
\fiveoptions
}
\def\tabfour{%
\renewcommand{\arraystretch}{1.1}
\begin{tabular}{p{0.23\linewidth}p{0.23\linewidth}p{0.23\linewidth}p{0.23\linewidth}}
\fouroptions
}
\def\tabend{\end{tabular}}
\def\fouroptions #1\\ { a) #1&b) #2&c) #3&d) #4~}
\def\fiveoptions #1\\ { a) #1&b) #2&c) #3&d) #4&e) #5~}
The usage is:
\tabfour
10 &
12 &
15 &
20\\
\tabend
\tabfive
10 &
12 &
15 &
18 &
20\\
\tabend
Is there a way to join this two commands in a commands named \mytab, with LaTeX choosing the right command in function of the number of alternatives?


