arobase wrote:but the minus sign seems smaller than the plus sign.
This is a text plus and a text dash, not a math plus and a math minus.
arobase wrote:Using $+=$ and same for '-' is balanced, but it puts an undesired space between '+' and "=". Is there a fix?
There's a predefined spacing around relation operators. This is meaningful, but in your case when you combine two operators you get too much space inbetween. The space would go if you change the meaning of the operators: if you hide a relation operator in braces, it looses that meaning and works like an ordinary math expression.
So this would work:
Code: Select all
\newcommand{\incr}[2]{#1 ${+}{=}$ #2}
\newcommand{\decr}[2]{#1 ${-}{=}$ #2}
However, you are still working in text mode. I would use math mode for such expressions. And wenn all in math mode, I would define a relation operator +=, which automatically has the correct spacing to the left and to the right.
Stefan