* Alexey Romanov (2007-01-28) writes:

> I find that I often need, when editing papers, to change
> notation. Let's say I need to rename k to f. Obviously, simply using
> query-replace is not a good idea -- it will find all appearances of
> the letter k in the text.  Is there any way to do the same as
> query-replace -- but only within math and displaymath modes?

M-x query-replace-regexp-eval RET k RET (if (texmathp) "f" "k") RET

This will still find all appearances of "k" but only replace those
which are in math constructs (unless `texmathp', the function to check
that, fails).


auctex mailing list

Reply via email to