When writing mathematics expression, I would like to remove the space around the symbol +
.
For a simple expression a+b
, I can do it by enclosing +
like a{+}b
. But it requires more labor work for complex expression like: a+b+c+d+e
.
I would like to ask whether there is a programmable way so that I can define a macro fooplus
:
\newcommand{\fooplus}[1]{do some thing here about +}
so that \fooplus{a+b+c+d+e}
produces the same result likea{+}b{+}c{+}d{+}e
?
Thanks for spending time to take a look at my question.
\newcommand\p{{+}}
and then write$a\p b\p c\p d\p e$
.\fooplus
inside math mode?+
. Make Characters Active via Macro in Math Mode should get you going. However, I would recommend you not do this. There is a reason why the binary spacing is different than the unary spacing. See the difference in$+5+7=12$
.\fooplus
.