Consider we have a long paragraph in a .tex
file that includes displayed-math formula. For example
This is a long paragraph that includes many sentences with a few math equations.
For example, this is the Einstein mass-energy formula
\begin{equation}
E=mC^2,
\end{equation}
while this one is the Newton's second law:
\begin{equation}
F=ma.
\end{equation}
We can add a few more sentences but I think it is in a good shape by now.
Using vim
, I want to wrap the lines of the whole paragraph (not one line at a time) without wrapping the displayed math equations. Is it possible? I tried gqip
but it wraps the equations, as well.
P.S.: I know that gqip
does not wrap "citations". For example, if there is a
\cite{reference1,reference2,reference3,reference4,reference5,reference6}
in the paragraph then it will not be wrapped by gqip
. I am actually looking for something like this.