I have the following:
\newcommand{\makeWord}[1]{%
\newcommand{\#1}{\textrm{#1}}}
\makeWord{AdditiveGroup}
\newcommand{\AdditiveGroup}{\textrm{AdditiveGroup}}
Unfortunately, I did not properly define the makeWord macro. How do I fix this?
macros
I have the following:
\newcommand{\makeWord}[1]{%
\newcommand{\#1}{\textrm{#1}}}
\makeWord{AdditiveGroup}
\newcommand{\AdditiveGroup}{\textrm{AdditiveGroup}}
Unfortunately, I did not properly define the makeWord macro. How do I fix this?
Best Answer
\#1
is the two tokens\#
(which would typeset a#
) and1
so is a syntax error as the first argument of\newcommand
.Try
Note this will make a mathord token if used in math. If you want to make an operator like
\log
it needs to beor use the
amsopn
\DeclareMathOperator
command.