I want to create a macro that creates several tables. In the example below, the command that creates the tables \chungeltable will use one argument for each column in the table (More than 10 columns). Each argument contains a comma separated list which has to be the information of each row:
\chungeltable{1,2,3}{a,b,c}{one,two,three}{uno,dos,tres}{um, dois, três}{um,dois,treis}{Eins,zwei,drei}{Ett, två, tre}{un, deux, trois}{En, to, tre}
I'm using the following approach (See My previous question).
However, as it is not possible to define more than 10 arguments I am getting the error:
"kernel/bad-number-of-arguments"Function '\chungeltable' cannot be defined with 10 arguments"
Here is my table:
\documentclass{article}
\usepackage[a4paper,landscape]{geometry}
\usepackage{multirow,longtable}
\usepackage{xparse}
\NewDocumentCommand{\chungeltable}{mmmmmmmmmmm}
{%
\begingroup\scriptsize
\begin{longtable}{ | p{4cm} | p{3cm} | *{13}{l|} p{3cm} | }
\hline
\multirow{3}{*}{Name} &
\multirow{3}{*}{Description} &
\multicolumn{14}{c|}{Observation} \\
\cline{3-16}
& & \multicolumn{3}{c|}{A} & \multicolumn{3}{c|}{B} & \multicolumn{2}{c|}{C} &
\multicolumn{2}{c|}{D} & E & \multirow{2}{*}{F} & \multirow{2}{*}{G} & \multirow{2}{*}{Other} \\
\cline{3-13}
& & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & & & \\ \hline
\endhead
\chungeltablebody{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}{#a}{#b}
\end{longtable}
\endgroup
}
\ExplSyntaxOn
\NewDocumentCommand{\chungeltablebody}{mmmmmmmmmmm}
{
\tl_clear:N \l_tmpa_tl
\int_step_inline:nnnn { 1 } { 1 } { \clist_count:n { #1 } }
{
\tl_put_right:Nx \l_tmpa_tl
{
\clist_item:nn { #1 } { ##1 } &
\clist_item:nn { #2 } { ##1 } &
\clist_item:nn { #3 } { ##1 } &
\clist_item:nn { #4 } { ##1 } &
\clist_item:nn { #5 } { ##1 } &
\clist_item:nn { #6 } { ##1 } &
\clist_item:nn { #7 } { ##1 } &
\clist_item:nn { #8 } { ##1 } &
\clist_item:nn { #9 } { ##1 } &
\clist_item:nn { #a } { ##1 } &
\clist_item:nn { #b } { ##1 }
& & & & &
\exp_not:n { \\ \hline }
}
}
\tl_use:N \l_tmpa_tl
}
\ExplSyntaxOff
\begin{document}
\chungeltable{1,2,3}{a,b,c}{one,two,three}{uno,dos,tres}{um, dois, três}{um,dois,treis}{Eins,zwei,drei}{Ett, två, tre}{un, deux, trois}{En, to, tre}
\end{document}
My question is: How can I define more than 10 arguments in a table, where each argument represents the columns of the table and each item in the list represents the information in the rows?


#1to#9and the limit to at most 9 arguments is built in to tex and can not be extended in a macro package such as latex. – David Carlisle May 19 '17 at 15:20\chungeltablebodywith other command? like here If not, which approach would you recommend for a longtable like this? – Chüngel May 19 '17 at 16:42longtable? That is, does it have to span across page boundaries? – Steven B. Segletes May 22 '17 at 12:44