For instance, is it correct to use $\sin\lvert x\rvert$
, not $\sin|x|$
, for the sine of the absolute value of $x$
? I think that since the argument of $\sin$
is $|x|$
, it makes more sense to have a thin space between the two, by analogy with the automatic thin space between $\sin$
and $x$
in $\sin x$
. Similarly, I think that it makes more logical sense to use $\sin\,(x+y)^2$
, not $\sin(x+y)^2$
, when the argument of $\sin$
is $(x+y)^2$
. But I could be going against established standards here.
What about $\sum_{i=1}^\infty(a_i+b_i)c_i$
versus $\sum_{i=1}^\infty\,(a_i+b_i)c_i$
, where the summand is $(a_i+b_i)c_i$
?
And what about $\int(x-1)^2\,dx$
versus $\int\,(x-1)^2\,dx$
for the indefinite integral of $(x-1)^2$
?
Best Answer
As egreg said, you must use
\lvert...\rvert
for absolute values or else internal spacing will be incorrect. If you want automatic sizing and correct spacing of absolute values, useor (better), with the mathtools package
You can thus choose the size of the absolute value (
\abs{...}
is normal size,\abs*{...}
is like\left...\right
and\abs[\bigg]
is like\biggl...\biggr
)Now, to your questions. There are various ways of handling the spacing of operators and delimiters, but a good and coherent rule to use is that a delimiter used as parenthesis (e.g. sin(x + y)) should not be preceded by a space (because the parenthesis already plays the same role as the space i.e. showing where the sine stops) whereas a delimiter used as an argument should be preceded by a thin space (e.g. ln |x| because it's the same shortcut for ln(|x|) as ln x is to ln(x)). More specifically, with this set of rules,
Yes, there should be a thin space between
\sin
and\abs{x}
because sin |x| is the sine applied to |x|. With the above command, you just have to type\sin{\abs{x}}
to do it automatically without side effects.Concerning
\sin(x+y)^2
, you should not be writing this as it is ambiguous, especially if your document is for students (is it\sin((x+y)^2)
or(\sin(x+y))^2
?) If you don't like to use two parenthesis in a row, you could use\sin[(x+y)^2]
.For
\sum
or\int
, the same applies and using{...}
for the "argument" prevents the introduction of manual\,
(alternatively, as big operators are special, you could always use\sum{...}
instead of\sum...
to have the additional space). Thus you would type$\sum_{i=1}^{\infty}{(a_i+b_i)c_i}$
but$\sum_{i=1}^{\infty}(a_i+b_i)$
and$\int{(x-1)^2\,dx}$
but$\int(f+g)$
.A few related links you might be interested in:
for more on math operator spacing problems see Too small space when using \DeclareMathOperator
for when to use
\,
see When one should use spacing line \quad or \,for when to use
\!
see What is the right way to use the `\!` spacing command?