I have the following example. It's magic because defining a macro ones (\ParametersAGAaAA and \ParametersAGAa) seems to interact to each other. Is this because \ParametersAGAa is part of the string \ParametersAGAaAA? \PutLongTableRows is resetted through \renewcommand{\PutLongtableRows}{} each time before the result is written to \Parameters...


    \setsepchar{#1}% LISTOFITEMS SEP CHAR
    \readlist\z{#2}% READ THE LIST INTO \z
    \foreachitem\tmp\in\z{% LISTOFITEMS DO LOOP


    \AddLongtableRow{5,1; 5,2}
    \AddLongtableRow{5,3; 5,4}

    \AddLongtableRow{5,9; 5,8    ;5,7   }
    \AddLongtableRow{5,6; 5,5    ;5,4}

        \caption{Tab 1}
        5,5 &85,6 \\\hline

        \caption{Tab 2}
        5,3 &5,2 &5,1 \\\hline

The first table show up nonsense since the \ParametersAGAaAA came up to be written also to \ParametersAGAa. But there was no command to do so. Maybe I have a misunderstanding - however \ParametersAGAaAA and \ParametersAGAa should be independent from each other? Why is \ParametersAGAa overwritten with \ParametersAGAaAA

  • 1
    TeX offers a macro expansion mechanism. With the first \newcommand{\ParametersAGAa}{\PutLongtableRows} you are not giving \ParametersAGAa the present value of \PutLongtableRows but simply instructing TeX to replace ParametersAGAa by \PutLongtableRows once it finds it.
    – campa
    Feb 14, 2020 at 10:07
  • Thx, knowing this it absolutely makes sense!
    – konsens
    Feb 14, 2020 at 19:38

1 Answer 1


This is because macro defined by \newcommand expands its definition during the macro are used, no during defining. So when you use \ParametersAGAa it is equal last definition of\PutLongtableRows, that respects \ParametersAGAaAA.

To avoid that use internal TeX command \let instead of \newcommand:




Of course, no any interaction between macros with similar names is possible.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .