For making play cards, I need to make a table of 5 by 5 cells. First row and first column would always be the same. But the other cells would depend off the card.
So it would be nice to gave a command like: \test{3,1,6,1,2,2,3,2,4,3,4,3,5,7,5,4} that would generate table.
\documentclass{article}
\begin{document}
\newcommand\test[3][]%
{\begin{table}
\begin{tabular}{ c | c | c | c | c }
\hline
& lente & zomer & herfst & winter \\
\hline
B & 3 & 1 & 6 & 1 \\
G & 2 & 2 & #2 & #3 \\
D & 4 & 3 & 4 & 3 \\
S & 5 & 7 & 5 & 4 \\
\hline
\end{tabular}
\end{table}
}
\test{4}{6}
\end{document}
I can do this with more parameters, but why do I have to make 3 options for only 2 values? So I tested with:
\newcommand\test[1][]%
and the
\test{4}


\test{4}{6}like in your first example works without problem. What do you want different from this? – Werner Oct 16 '15 at 20:48\newcommand{\test}[2]{...}not\newcommand{\test}[2][]{...}. Note that the first doesn't have an extra[]. – Werner Oct 16 '15 at 20:54