I have a spreadtab with a rather complex header and footer that is used at several places in my document. The actual content consists of only a few simple lines. I would like to define a new environment (or macro), so that I do not have to repeat the header and footer for each table.

The only working approach I found is the following, based on https://tex.stackexchange.com/a/312860/102921 and https://tex.stackexchange.com/a/207313/102921.



\usepackage{array, environ, spreadtab, xpatch}



        & @Heading 1 & @Heading 1 & @Heading 1 \\\hline % here is a complex header
        @ Total & \STcopy{>}{sum(b2:[0,-1])} &  & \\\hline % end a complex footer

        @ Label 1 & 1000 & 500 & 800 \\\hline 
        @ Label 2 & 2000 & 1500 & 1800 \\\hline
        % At most 10 of such lines per table

Is there a way without using temporary files? Because the final document will have of the order of 100 of such tables, I am a bit worried about speed.


You must log in to answer this question.

Browse other questions tagged .