[Tex/LaTex] In “math-mode line” non-math type

formattingmath-mode

I'd like to type non-math text inside of the bracket math text lines, or know of a better way to do what I'm trying to do.

In the following, I don't literally type \nomath. I don't know what I need to type there in order to make this work.

This is what I type (the dashes are disappearing, I don't know why):

\begin{document}

\[ K=L \]

\[ A = B \nomath or \nomath A_1 = B_1\]

\end{document}

This is what I get:

K=L

A=B

or

A_1=B_1

This is what I want:

K=L

A=B or A_1=B_1

What I'd like for the or word to be in non-math text mode, with everything around it following the normal rules according to the dashes and brackets. Can anyone help me?

Best Answer

If you use the amsmath package, you should be able to write something like

\[A = B \text{ or } A_1 = B_1\]

You'll have to manually add space around the or. You can do it as I did or you can do it as:

\[A = B \quad \text{or} \quad A_1 = B_1\]

EDIT 1

Here's a complete MWE:

\documentclass{article}
\usepackage{amsmath}
\pagestyle{empty}
\begin{document}

\[A = B \text{ or } A_1 = B_1\]

\[A = B \quad \text{or} \quad A_1 = B_1\]

\end{document}

EDIT 2

A comparison of \mbox{...} vs \text{...}

\[ A_{\mbox{Hi}} \text{ vs } A_{\text{Hi}}\]

If you want to know more about the differences between these, you should probably post another question.

Or see Difference between various methods for producing text in math mode