Possible Duplicate:
What is the “correct” way of embedding text into math mode?
What formatting is perfect for word in an equation? Is \text{ text is here }
the best way? For example,
a = x_j \text{ for } i = 1, 2, \dots, M
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityPossible Duplicate:
What is the “correct” way of embedding text into math mode?
What formatting is perfect for word in an equation? Is \text{ text is here }
the best way? For example,
a = x_j \text{ for } i = 1, 2, \dots, M
Not sure whether this is an answer...
Spaces are gobbles and replaced with appropriate math spacing when in math mode. However, forced spacing always sets the same; there is no difference in the spacing between the following alternatives:
\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
$a = x_j \text{ for } i = 1, 2, \dots, M$ \par
$a = x_j\ \text{for } i = 1, 2, \dots, M$ \par
$a = x_j \text{ for}\ i = 1, 2, \dots, M$ \par
$a = x_j\ \text{for}\ i = 1, 2, \dots, M$ \par
$a = x_j \text{~for~} i = 1, 2, \dots, M$ \par
$a = x_j~\text{for~} i = 1, 2, \dots, M$ \par
$a = x_j \text{~for}~i = 1, 2, \dots, M$ \par
$a = x_j~\text{for}~i = 1, 2, \dots, M$
\end{document}
As such, it may be left up to user preference. That is, whether you consider the space before/after the text to form part of the text or not and what kind of spacing you use.
\mbox{ text is here }
, but this will not scale to where it's used. Some also use\ \text{text is here}\
.\
there to fix that?\
is there to add additional space, but I think$a = x_j \text{, for } i = ...
is better, but really up to you which to use.