I would like to replace instances of a single character variable, say x, throughout all my equations in a latex file, say the replacement is \x.
The equations are denoted by one of the following:
\begin{equation} \end{equation}
\[ \]
$ $
I could use :%s,x,\\x,gc but then I would have to confirm all instances of x that are not in math mode.
Is there any way to bound the range to be inside math modes only?
1GVG!sed '/begin{equation}/,/end{equation}/s/x/\\x/g'. I believe it's okay to different tools for different purposes. – Philippos Apr 10 '17 at 05:41