# Difference between \xx{} and \mathxx{}?

What is the difference between math font \xx{} and \mathxx{} where xx=rm, bf, cal?

When I use them it seems that the \xx{} formats all the words after it.

But \mathxx{} formats only what is between brackets {}.

Is this correct?

-
What you noted is the cause why \bf, \rm etc. should not be used any longer, but rather \textbf{}, \textrm{} etc. and this will also distinguish them clearly from \mathbf{} etc. as well as text to \math mode, so the answer is yes, it is correct –  Christian Hupfer Jul 13 '14 at 14:43
–  egreg Jul 13 '14 at 14:46
Oh, I forgot: Welcome to TeX.SX –  Christian Hupfer Jul 13 '14 at 14:46
Newer versions of the KOMA classes explicitly shipout warnings if the code encounters \bf etc. command, this as tiny remark –  Christian Hupfer Jul 13 '14 at 14:49

Commands like \bf are obsolete in LaTeX. See, e.g., Always \textrm, never \rm? A counterexample?. Moreover, the proper usage is {\bf your text}, because it is a global switch. In math mode you can use \mathxx or also \textxx. In particular, in the former spaces are omitted, in the latter they behave like in normal text.