Suppose I have to write $\sum a_g$ such that $g \in G$ then can I start with "dollar sign" and then write whole thing and end "dollar sign" in last without italicising or any effect on my text "such that".
Like $this gets italicised$....
1 Answer
Do you mean something like: $\{n\in\mathbb N; n\text{ is even}\}$?
Typeset as: $\{n\in\mathbb N; n\text{ is even}\}$
I will add that it is also mentioned here (warning - contains lot of MathJax, do not open from slow mobile devices): MathJax basic tutorial and quick reference
In my personal opinion there is not much reason to use this in inline text. It makes sense when you want to define some set and want to have it as a single formula. Or when you use centered formulas $$2\mathbb N = \{n\in\mathbb N; n\text{ is even}\}.$$
But I would write: "Consider all sums $\sum\limits_{n\in A} a_n$ where $A\subseteq 2\mathbb N$." (without using \text) rather than "Consider all sums $\sum\limits_{n\in A} a_n\text{ where }A\subseteq 2\mathbb N$." (which uses \text). (The first one was typeset as Consider all sums $\sum\limits_{n\in A} a_n$ where $A\subseteq 2\mathbb N$.
The second one was typeset as Consider all sums $\sum\limits_{n\in A} a_n\text{ where }A\subseteq 2\mathbb N$.
)
Although they might look similar, I think that distinguishing what is text and what is mathematical formula is useful.