I am working on laTex files, I need to delete everything between two $ including newlines and keep only english text.
I am using a command like this to process the files:
find "." -name "*.tex" | xargs perl -pi -e 's/\$[^\$].*?\$/ /g' *
Example:
Then use the naturality formula 
    $t_{G^{n-1}M} G^{i+1} (\epsilon_{G^{n-i}M}) 
    = G^{i+1} (\epsilon_{G^{n-i}M}) t_{G^n M}$ on the left-hand side.
OutPut:
Then use the naturality formula 
 on the left-hand side.
another example from file:
EXAMPLE:
\begin{itemize}
\item $M$ is atomic and finitely generated;
\item $M$ is cancellative;
\item $(M, \le_L)$ and $(M, \le_R)$ are lattices;
\item there exists an element $\Delta \in M$, called {\it Garside element}, such that the set 
$L(\Delta)= \{ x \in M; x\le_L \Delta\}$ generates $M$ and is equal to $R(\Delta)= \{ x\in M; 
x\le_R \Delta\}$.
\end{itemize}
OUTPUT:
\begin{itemize}
\item   is atomic and finitely generated;
\item   is cancellative;
\item   and   are lattices;
\item there exists an element  , called {\it Garside element}, such that the set 
  generates   and is equal to $R(\Delta)= \{ x\in M; 
x\le_R \Delta\}$.
\end{itemize} 
if you can notice ( $R(\Delta)= { x\in M; x\le_R \Delta}$.) can not be removed!!
Example 2 from different file, the input same as the output nothing has changed :
    Using the fact that   is atomic and that $L(\Delta)= 
\{x \in M; x \le_L \Delta\} M \pi_L(a) \neq 1 a \neq 
1 k \partial_L^k(a)=1 k$ be the