I tried doing this:
\usepackage{amsmath}
$x^2 \text{something} y^2$
but that just came out like:
x^2somethingy^2
Anyone know how to fix this issue? I need to have text inside my math environment
For inline text between inline math expressions it is usually better to just stop and start the math
$x^2$ something $y^2$
then the interword spacing and line breaking matches the rest of the paragraph.
If that isn't possible then you can put them inside the \text
$x^2 \text{ something } y^2$
But this is essentially like putting the text fragment in \mbox
so it freezes all white space at its natural size, not allowing any stretch or shrink, and prevents line breaking.
\text
command:$x^2 \text{ something } y^2$
. (The spaces outside the argument of\text
continue to be ignored, of course.)$x^2\quad\text{something}\quad y^2$
. For example, when I have punctuation at the end of a line of displayed math, I put a\qquad
before the punctuation.