[Tex/LaTex] How to prevent adding subscript from italicizing the text thereafter


When I try to add subscript(I write O_L and O_R to denote left and right ) in my text all the text after that becomes italicized. Any ideas what might be causing this?

Best Answer

What is causing this behavior is the difference between TeX's math mode and text mode. In math mode, each character is a separate entity. Mathematicians, unlike programmmers, don't believe in long expressive names. To a mathematician, a two-character identifier is one character too long.

It's not just your subscripted names that are subject to this treatment. Suppose you have some variable named 'foobar' and you want to use this name in some math expression. To you, that 'foobar' is just a multi-character identifier. That is not how TeX views things in math mode. In math mode, TeX views 'foobar' as if it were 'f*o*o*b*a*r', but with implicit rather than explicit multiplication. TeX will insert a small amount of space between each letter to show that each letter is indeed a separate entity and that these entities are connected by implicit multiplication.

You need to override this behavior whenever you have a multi-character identifier, a multi-character subscript, a multi-character superscript, or any other multi-character entity and TeX is in math mode. There are lots of ways to accomplish this. All of them temporarily throw TeX back into LR (text) mode. One simple approach is to put the entity in a box. Another, and my personal choice, is to use the \text command provided by the AMS math package. Then again, that is because I \RequirePackage{amsmath} or \usepackage{amsmath} in all of my LaTeX documents.

Related Question