I am very new to using LaTeX to write equation. And I am now learning how to create my own command. I am going to write a command \Listn
to help me to do this:
\Listn{\sumup}{(#1)}{+}
$\sumup{n}$\\
\Listn{\sumupaf}{a_{#1}f(x_{#1})}{\times}
$\sumupaf{k+1}$
will give me
Then I try to create \Listn
\providecommand{\Define}[2]{\providecommand{#1}{}\renewcommand{#1}[1]{#2}}
\providecommand{\List}[3]{{#1{1}}#2{#1{2}}#2\cdots#2{#1{#3}}}
\providecommand{\Listn}[4]{\Define\f{#2}\Define{#1}{\List{\f}{#3}{#4}}}
But the fourth argument must be filled manually, like this:
\Listn{\sumup}{(#1)}{+}{#1}
$\sumup{n}$\\
\Listn{\sumupaf}{a_{#1}f(x_{#1})}{\times}{#1}
$\sumupaf{k+1}$
If I want to eliminate the fourth argument, I would like to have
\providecommand{\argument}{#1}
which is impossible.
Are there any method to overcome this?
!
in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the!
to turn it into an image again.