[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] change \eqref to (\ref)

From: Arash Esbati
Subject: Re: [AUCTeX-devel] change \eqref to (\ref)
Date: Tue, 21 Feb 2017 13:26:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2

Hi Uwe,

Uwe Brauer <address@hidden> writes:

> A colleague of mine is looking for a lisp solution to replace
> \eqref to (\ref)
> The following function does this
> (defun my-eqref-2-ref ()
>   (interactive)
>   (save-excursion
>   (query-replace-regexp
> "\\\\eqref{\\([0-9,A-Z,a-z]*\\|[0-9,A-Z,a-z]*:[0-9,A-Z,a-z]*:[0-9,A-Z,a-z]*\\)}"
> "(\\\\ref{\\1})" nil)))

I would do something like this:

    (defun my-eqref-2-ref ()
        ;; Optional:
        (goto-char (point-min))

It should cover most cases.  latex.el does this for \label:


which is probably even more robust.

Best, Arash

reply via email to

[Prev in Thread] Current Thread [Next in Thread]