How can I typeset the increment "+=" symbol? It should act as a relation (like =), but should not have extra space between the "+" and "=".
[Tex/LaTex] How to typeset the c++ increment symbol in LaTeX
relation-symbolssymbols
relation-symbolssymbols
How can I typeset the increment "+=" symbol? It should act as a relation (like =), but should not have extra space between the "+" and "=".
Best Answer
It depends on what you consider right. The first thing to note is that the symbol should represent a relation. TeX puts no space between two consecutive relations (and no line break either). So
will produce
If you prefer a (font dependent) negative kerning, just add it; changing the above definitions into
you'd get
Experiment and decide. Having a macro means you can do whatever you want of the symbol, without changing anything in the document body.