My professor asked me to change all p,q variables to i,j variables in my paper. If I just search and replace it will have too many false positives, because it will highlight every word with letter p in it. I want to search only within math mode, but apparently my editor does not support this. Is there some lightweight editor, or maybe even web tool that can search and replace within only math mode? I want to do just this one task and get back to using my old editor.
I am looking for point-and-click solutions, not writing macros etc.
$and$$or every possibleamsmathenvironment combination? RegExp could help. Related: Using Regexp to replace math expression inside Latex File – Qrrbrbirlbel Jan 10 '13 at 12:43emacs:), which also has regexp's – nickpapior Jan 10 '13 at 12:46$,$$, and\begin{}-\end{}. Do I really have to write regular expressions? Isn't there an editor that can recognize math mode itself? – Sunny88 Jan 10 '13 at 12:48alignenvironment and replacingGby\mathbf{G}. Apparently LyX can search in only-math-mode: LyX – is there a way to substitute variables in math formulas?. Two notes: 1. Make a backup of your file before you RegExp the … out of it. 2. In the future, use macros for these kind of variable, say\varAand\varB. Then you only have to change their redefinition … – Qrrbrbirlbel Jan 10 '13 at 12:52$,$$or\begin{}/\end{}, writing a solution with regexps could prove quite painful. On the other hand, most TeX editors can recognize math-mode (at least for syntax highlighting), and should offer a way to do S&R in math-mode. – T. Verron Jan 10 '13 at 12:54