Leonardo Freitas
2004-08-05 14:12:35 UTC
Hello,
I wanted to define the following command
\newcommand{\mycmd}[1][1]{\addtocounter{myctr}{#1}}
It is supposed to increase the value of myctr
by the ammount passed as a parameter where 1
is given as the default value.
LaTeX wasn't happy with this definition.
It gives an error message saying
""
and I cannot understand it.
1) Do someone know about this error, its reasons and the
proper way to fix it??
Anyway, I then tried something in TeX as
\def\mycmd#1{\addtocounter{myctr}{#1}}
This works fine but it does not have the default
value I need on the definition.
2) What should do to define default values in \def marcos
that are defining new commands with parameters??
Best Regards,
Leo
I wanted to define the following command
\newcommand{\mycmd}[1][1]{\addtocounter{myctr}{#1}}
It is supposed to increase the value of myctr
by the ammount passed as a parameter where 1
is given as the default value.
LaTeX wasn't happy with this definition.
It gives an error message saying
""
and I cannot understand it.
1) Do someone know about this error, its reasons and the
proper way to fix it??
Anyway, I then tried something in TeX as
\def\mycmd#1{\addtocounter{myctr}{#1}}
This works fine but it does not have the default
value I need on the definition.
2) What should do to define default values in \def marcos
that are defining new commands with parameters??
Best Regards,
Leo