[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] (old) TeX definitions and query-replace-regexp
From: |
Uwe Brauer |
Subject: |
[AUCTeX-devel] (old) TeX definitions and query-replace-regexp |
Date: |
Sat, 09 Aug 2014 21:15:41 +0200 |
User-agent: |
Gnus/5.13001 (Ma Gnus v0.10) XEmacs/21.5-b33 (linux) |
Hi
I am in a state of advanced desperation. I have a couple of old latex
files which contain a lot of definitions (with arguments) of the sort
\newcommand{\nv}[2]{\|#1\|_{H^{#2}}}
which are used in the document like this
$\nv{G^a}{s} \leq C_2$ and
so I just wanted to have a simple elisp function which replaces the \nv
calls by its definition.
I thought it should be something like this
(query-replace-regexp
"\\(\\\\nv{[a-z,A-Z,0-9]*\\^[a-z,A-Z,0-9]*}{[a-z,A-Z,0-9]*}\\)"
"\\\\|\\1\\\\|_{H^{\\2}}")
but it failed, I tried something simpler
(query-replace-regexp "\\(\\\\nv{G\\^a}{s}\\)" "\\\\|\\1\\\\|_{H^{\\2}}")
no success neither. I admit regexps drive me crazy and would appreciate
any help.
thanks
Uwe Brauer
smime.p7s
Description: S/MIME cryptographic signature
- [AUCTeX-devel] (old) TeX definitions and query-replace-regexp,
Uwe Brauer <=