[Tex/LaTex] How to write maths symbols

math-modesymbols

I have written in my work $X^{+},\,\rm{e}^{X},\,|X|^{p}$. Why is the second and third term not in italics?

Best Answer

Because you used \rm instead of \mathrm.

\rm is not a macro which accepts an argument, as you apparently thought. The macro which does that is \textrm{text} for text mode and \mathrm{text} for math mode. Instead, macro \rm changes the current font to roman, from the point in which the macro appears until the end of the current scope (which is the end of the math mode in your case, but more generally the end of the group in which \rm appears).

Macros \it, \bf and \tt, work in the same line than \rm, and they have also a version which accepts one parameter, which are \textit{} (but more frequently \emph{}), \textbf{} and \textt{}.

Those two-letter macros which change fonts and styles are deprecated and should not be used. They are maintained for backwards compatibility.

Related Question