[Top][All Lists]

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

Re: reftex-reference and insert \eqref{} not (\ref{})

From: Uwe Brauer
Subject: Re: reftex-reference and insert \eqref{} not (\ref{})
Date: Tue, 03 Dec 2019 22:46:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

   > Uwe Brauer <address@hidden> writes:

Thanks for you answer
   > AUCTeX has a style file for the mathtools package which contains[1]:

   >     (TeX-run-style-hooks "amsmath")

   > Yes, that would be expected (see below).

   > This is the problematic portion.  RefTeX has to consolidate all the
   > built-in and user options and it goes after the type key.  With your
   > setting above, you overwrite the setting for ?e key.  If you want to set
   > the label-format and/or magic words for built-in type keys, just do:

   >     (setq reftex-label-alist
   >           '((nil ?e "eq:%f" nil t
   >                  ("Equation" "Eq." "Eqn." "Gleichung"  "Gl."))))

Ok I changed by setting to 

(setq reftex-label-alist
        '((nil  ?e "eq:%f" "~(\\ref{%s})" t
           ("Equation" "Eq." "Eqn." "Gleichung"  "Gl."))
          ("\\step{*}{}"       ?P "st:" "~\\stepref{%s}" 2 ("Step" "St."))
          ("\\begin{step+}{*}" ?P "st:" "~\\stepref{%s}" 1000)
          ("axiom"   ?a "ax:%f:"  "~\\ref{%s}" nil ("Axiom"   "Ax.")-1)
          ("func"   ?F "fnc:%f:"  "~\\ref{%s}" nil ("Funci\'on"  "Fnc"))
          ("fact"   ?C "fct:%f:"  "~\\ref{%s}" nil ("Fact"   "Fct"))
          ("script"   ?T "scpt:%f:"  "~\\ref{%s}" nil ("Script"   "scpt")-1)
          ("thm" ?h "thr:%f:" "~\\ref{%s}" t   ("Theorem" "Theor." "Th.")-1)
          ("claim" ?k "clm:%f:" "~\\ref{%s}" t   ("Claim" "claim" )-1)
          ("example" ?E "ex:%f:" "~\\ref{%s}" t   ("Example" "Ejemplo")-1)
          ("ex" ?A "ex:%f:" "~\\ref{%s}" t   ("Ejercicio" "ejercicio")-1)
          ("cor" ?c "cor:%f:" "~\\ref{%s}" t   ("Corollary" "Cor." "C.")-1)
          ("Rem" ?R "rem:%f:" "~\\ref{%s}" t   ("Remark" "rem." "R.")-1)
          ("SaveListing" ?V "SvL:%f:" "~\\ref{%s}" t   ("SaveL" )-1)
          ("prop" ?p "prop:%f:" "~\\ref{%s}" t   ("Proposicion" "proposition" 
"prop." "P.")-1)
          ("sol" ?O "sol:%f:" "~\\ref{%s}" t   ("Solucion" "sol." "S.")-1)
          ("lstlisting" ?G "lstl:%f:" "~\\ref{%s}" t   ("lstlisting" "lst." 
          ("lem" ?L "lem:%f:" "~\\ref{%s}" nil   ("Lemma" "Lema" )-1)
          ("slide" ?l "slide:%f:" "~\\ref{%s}" t   ("slide" )-1)
          ("Slide" ?S "slide:%f:" "~\\ref{%s}" t   ("slide" )-1)
          ("\\myfig" ?f "fig:%f:" nil          2)
          ("defn" ?D "def:%f:" "~\\ref{%s}" nil   ("Definition" 
          ("enumerate" ?i "item:%f:" "~\\ref{%s}" nil
           (regexp "Items?" "Punkte?"))

And indeed 
(describe-variable 'reftex-label-alist) returns
((nil 101 "eq:%f:" "~(\\ref{%s})" t
      ("Equation" "Eq." "Eqn." "Gleichung" "Gl."))
 ("enumerate" 105 "item:%f:" "~\\ref{%s}" item
  (regexp "Items?" "Punkte?"))
 ("axiom" 97 "ax:%f:" "~\\ref{%s}" nil
  ("Axiom" "Ax."))
 ("func" 70 "fnc:%f:" "~\\ref{%s}" nil
  ("funci'on" "Fnc"))
 ("fact" 67 "fct:%f:" "~\\ref{%s}" nil
  ("Fact" "Fct"))
 ("script" 84 "scpt:%f:" "~\\ref{%s}" nil
  ("Script" "scpt"))
 ("titledquestion" 120 "exm:%f:" "~\\ref{%s}" nil
 ("claim" 107 "clm:%f:" "~\\ref{%s}" t
  ("Claim" "claim"))
 ("thm" 104 "thr:%f:" "~\\ref{%s}" t
  ("Theorem" "Theor." "Th."))
 ("example" 69 "ex:%f:" "~\\ref{%s}" t
  ("Example" "Ejemplo"))
 ("ex" 65 "ex:%f:" "~\\ref{%s}" t
  ("Ejercicio" "ejercicio"))
 ("cor" 99 "cor:%f:" "~\\ref{%s}" t
  ("Corollary" "Cor." "C."))
 ("rem" 82 "rem:%f:" "~\\ref{%s}" t
  ("Remark" "rem." "R."))
 ("SaveListing" 86 "SvL:%f:" "~\\ref{%s}" t
 ("prop" 112 "prop:%f:" "~\\ref{%s}" t
  ("Proposicion" "proposition" "prop." "P."))
 ("sol" 79 "sol:%f:" "~\\ref{%s}" t
  ("Solucion" "sol." "S."))
 ("lstlisting" 71 "lstl:%f:" "~\\ref{%s}" t
  ("lstlisting" "lst." "L."))
 ("lem" 76 "lem:%f:" "~\\ref{%s}" nil
  ("Lemma" "Lema"))
 ("slide" 108 "slide:%f:" "~\\ref{%s}" t
 ("Slide" 83 "slide:%f:" "~\\ref{%s}" t
 ("prop" 77 "prop:%f:" "~\\ref{%s}" t
  ("Proposicion" "prop." "P."))
 ("\\myfig" 102 "fig:%f:" nil 2)
 ("defn" 68 "def:%f:" "~\\ref{%s}" nil
  ("Definition" "Definici'on"))
 ("enumerate" 105 "item:%f:" "~\\ref{%s}" nil
  (regexp "Items?" "Punkte?")))
Original value was nil

But when I open the file I attached in an earlier message
and run reftex-reference 
and select e, 

Still (\ref{eq:testshowonly:2}) is inserted and not \eqref{eq:testshowonly:2}

I am really puzzled is this a bug?



Attachment: smime.p7s
Description: S/MIME cryptographic signature

reply via email to

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