We would like to define a macro \ellipsis
that takes four argument and has the following behaviour:
\ellipsis{x^{#DUMMY#}}{0}{5}{+}
and outputs:
the pattern string #DUMMY#
(which doesn't have to be this exact string) has to be replaced by the second and third argument. So the first argument is the definition of a macro all by itself.
We have tried a couple of things but always end up using two different macros to obtain the desired behaviour. For example doing
\newcommand{\ellipMacro}[1]{x^{#1}}
\newcommand{\ellip}[4]{\csuse{#1}{#2}#4\ldots #4 \csuse{#1}{#3}}
This uses the control sequence \csuse
from the package etoolbox (we are fine with using any packages).
We would like to do this in just one command, thus, the definition of the inner macro (x^{#DUMMY}
) needs to be placed within the definition of the larger macro.
Please include any ideas on how to do this you might have.
\ellipsis{x^{#DUMMY#}}{0}{5}{+}
there is nothing left to question inside of dummy as to what it does.#DUMMY#
is a placeholder, it should be substituted with the second and third arguments