# Why is the spacing for this completely whacky?

I have the following line:

$P(can't\,communicate) = \frac{\#\,of\,combinations\,of\,4\,different\,keys} {total\,possible\,arrangements} = \frac{\frac{10*9*8*7}{4}}{2025} = \frac{1260}{2025} = 0.62 = 62 \%$


This doesn't all fit on one line, so the "= 0.62 = 62 %" falls under a new line, but it is stretched across to fill the WHOLE LINE.

Why is this, and how can I stop it from happening? I just want it to look standard..

-

I think it is due to your spacing using \,. If you want to type text inside math environment use \text{} from amsmath. In your case you can use

 $P(\text{can't communicate}) = \frac{\#\text{ of combinations of 4 different keys}} {\text{total possible arrangements}} = \frac{\frac{10*9*8*7}{4}}{2025} = \frac{1260}{2025} = 0.62 = 62$


Since it is too long it is better if you don't use inline math and use some equation or align environment, e.g. (using the align environment from amsmath package)

 \begin{align}
P(\text{can't communicate})
& = \frac{\#\text{ of combinations of 4 different keys}}
{\text{total possible arrangements}}\\
& = \frac{\frac{10*9*8*7}{4}}{2025}\\
& = \frac{1260}{2025}\\
& = 0.62\\
& = 62 \%
\end{align}

-
Didn't know about \text within the math environment, that solves that. Thanks! – coffee Oct 11 '10 at 16:52