Is there an reason/advantage for writing the integration (and other argumentless commands) as:
\int{xdx}
instead of \int xdx
? I can see the first one gives a more comprehensible code, but are there any other reasons?
1 Answer
The braces are incorrect in general.
\int
does not take an argument so the braces form a group,
{xdx}
(or many would prefer {x\mathrm{d}x}
) is therefore a single atom in the mathlist of type \mathord
. In the case of xdx
the spacing will not be affected but for example {x+1}
differs from x+1
in that the spacing around the +
is frozen at its natural size, and linebreaking is suppressed. Probably you don't have integrals in inline math so this probably doesn't matter, but if the editor is routinely adding unneeded {}
into math mode, it isn't really helping.
\int
is a macro without argument, so\int{xdx}
is ... wrong, somehow. You might define a wrapper command which does typeset the differential together with the integral sign automatically\int{}
.f
after it completes, you could have an error if the result is\intf
. But no error if the result is\int{}f
. So, after asking to auto-complete, you don't need to worry to pressspace
.