similar to this question I want to use a function inside of a spreadtab region, but i do not want to use it out of a separate file but just simplify the usage and readability.
Unfortunately the usage of \newcommand
, \def
and \edef
does not expand the text into the region and therefore the text is not recognized by spreadtab as normal.
My first idea would be to be able to make a textual macro such as in C-Programming by #define
The command that I currently have in the non-working state is this:
\newcommand*{\pos}[4]{ :={#1} &@ #2 &@ #3 & :={#4}\,\EUR & :={[-4,0]*[-1,0]}\,\EUR\\}
This would be exactly what I would want to insert into the spreadtab region. It corresponds to one line of the table. The output when using pos
with
\pos{5}{text}{description}{10}
then is
:=5 @text @description 10€ :=[-4,0]*[-1,0]€
instead of the expected line that I get when inserting the text directly into the spreadtab region:
5.00 text description 10.00€ 50.00€
Is there a possibility to create something like a C-Macro where the text is inserted before the 'compilation'? Or is there any other command I could use to simplify the usage without having to write all formatting issues again and again?
Thanks in advance.