I want to perform simple arithmetic operations for a document in a table in the tabularx environment. There is a column for the quantity, a column for the unit price and a column for the total price, which is the result of the quantity and the unit price. At the end of the table, the total prices per row are to be summed up.
Is there a simple way how I can implement this requirement within the Tex document? Is it possible to access single values (e.q. the total sum) in a later part of the document?
Example-Code:
\begin{tabularx}{\textwidth}{c|X|r|r}
\hline
\tiny {Quantity} & \tiny {Description} & \tiny {Unit price} & \tiny {Quantity * Unit Price} \\ \hline
1 & Product 1 & 2,00 EUR &2,00 EUR \\
\hline
2 & Product 2 & 5,00 EUR & 10,00 EUR \\
\hline
3 & Product 3 & 4,00 EUR & 12,00 EUR \\
\hline
\multicolumn{ 3}{l}{ all round price } &24,00 EUR \\ \hline
\end{tabularx}
Thanks a lot in advance,
BR
Christoph
spreadtab
will be a good choice.\tiny
is a switch and does not take an argument. You might as well replace\tiny {Quantity}
with\tiny Quantity
, etc.