Some invoices need print a large list of items. In this case, and in my country, invoices must print the subtotal of the previous page for each break page, and add to the last subtotal the accumulated of amount of each items printed in the page.
For example, imagine the following table broken in two pages.
\begin{longtable}{cc}
Item 1 & 100 \$ \\
Item 2 & 100 \$ \\
Item 3 & 100 \$ \\
Item 4 & 100 \$ \\
Item 5 & 100 \$ \\
\end{longtable}
The invoice must show for each page with the subtotal before and the sum of amounts later:
Page 1:
Item 1 & 100 \$ \\
Item 2 & 100 \$ \\
Item 3 & 100 \$ \\
Subtotal: 300 \$.
Page 2:
Transport: 300 \$.
Item 4 & 100 \$ \\
Item 5 & 100 \$ \\
Transport + Subtotal: 500 \$.
I tried to accumulate the amount using fp in each line of the table, but it doesnt work. Print 0 for transport and transport + subtotal.
Example in ShareLatex with the problem
Thanks for any ideas!

$characters meant to do? Is this a typo for&? Or...? – cfr Jan 31 '14 at 23:59\$surely they're meant to produce a literal $ sign in the output - some currencies use that symbol at the end of the amount, unlike USD. – Chris H Apr 24 '14 at 10:04$signs were not preceded by backslashes ;). – cfr Apr 24 '14 at 13:19