You have to evaluate the code after LaTeX-mode
is activated, otherwise you get the error Symbol's function definition is void: TeX-add-symbols
. You can add that function to the hook of LaTeX-mode
. In order to override possible other eqref
macro definitions, you should add a dummy (ignore)
to the definition of the macro. This code, in your .emacs
, does the trick:
(add-hook 'LaTeX-mode-hook
'(lambda ()
(TeX-add-symbols '("eqref" TeX-arg-ref (ignore)))))