I am working on a table template with Latex3 and want to calculate the sum of a column. My Problem is that i can't pass more than 9 parameters, which is necessary since I don't know how big the table will be.
Spreadtab package won't work.
Here a example:
\documentclass[a4paper,12pt]{article}
\usepackage{xparse}
\usepackage{fp}
\def\one{1}
\def\two{2}
\def\three{3}
\def\four{4}
\def\five{5}
\def\six{6}
\def\seven{}
\def\eight{8}
\def\nine{9}
\def\ten{1}
\ExplSyntaxOn
\NewDocumentCommand{\calcsum}{O{0}O{0}O{0}O{0}O{0}O{0}O{0}O{0}O{0}} %Here i need more than 9 arguments
{ \fp_to_decimal:n {#1 + #2 + #3 + #4 + #5 + #6 + #7 + #8 + #9}}
\ExplSyntaxOff
\begin{document}
Result: \calcsum[\one][\two][\three][\four][\five][\six][\seven][\eight][\nine]
\end{document}
\seven
empty on purpose? (Similar question for\ten
.) Can you change the syntax to\calcsum[\one\two\three...\ten]
or similar with commas or other separator?\calcsum{\one+\two+\three}
?++
at the end. If you're able to feed\calcsum[\one][\two]...
, then you're surely able to feed\calcsum{\one,\two,...}
. In this case the solution is quite simple.