# How to add a short text in math-mode keeping spaces between words

I am writing the following:

$$p(Z_{n+m}=i for some m> 0|Z_{n}=i)=1$$


Compiling, the spaces between the words "i for some m" are removed giving as a result "iforsomem"

How can I prevent this?

Note that I cannot write something like

$p(Z_{n+m}=i$ for some $m> 0|Z_{n}=i)=1$


because I want it centered horizontally

• Use \usepackage{amsmath} and then you can have \text{ for some } or simply use (without amsmath) \mbox{ for some } Dec 11 '18 at 18:22
• Dec 11 '18 at 18:22
• Both ways did work. Thank you @Au101 Dec 12 '18 at 15:57

\usepackage{amsmath}

\begin{equation*}
\text{$p(Z_{n+m}=i$ for some $m>0 \mid Z_{n}=i)=1$}