Although I use LaTeX a lot, I still have a lot to learn about it, and I still have many questions which remain unanswered. One in particular bothers me: when and why must I use curly brackets when giving arguments to a function like \cos
or \sin
?
I tend to use curly brackets everywhere and write \cos{x}
, because that's how it was written on documents I used to teach myself. However, I see a lot of LaTeX documents where the syntax is simply \cos x
.
Does it have any importance? Maybe when writing a lot of these functions at a time, like r\sin \theta d\phi
?
Thanks for your help!
Best Answer
Note that the braces are not just not required, they should not be used as
\cos
does not take an argument the braces form a group and force the term to lose any special math class that it would otherwise have.\cos
is a "\mathop
" operator and(
is a "\mathopen
" but a term surrounded by{
..}
is always a "\mathord
". TeX uses different space between a\mathop
and a\mathopen
than between a\mathop
an a\mathord
(becauselog(x)
does not need any space butlog x
does).Compare
which produces