[Tex/LaTex] How to input the symbol for Solar Mass


I need to put stellar mass data in units of Solar Mass, and I tried the M_{\odot}, but the console shows:

! missing $ inserted error.

I don't know what is wrong. Please help me out

Best Answer

TeX complains with missing $ inserted because of the underscore. _ is a special character dedicated for subscripts, which require math mode.

My first example is all math mode, the second one is typesetting the M in upright text mode, the third uses text mode for the subscript. Choose for yourself whether the solar mass should be typeset in math italic—as a variable—or upright—as having a defined meaning.