Whenever I insert a reference to a label starting with eq: RefTeX seems to decide to surround it with (), e.g. it will insert (\ref{eq:1)) into the buffer. This is particularly annoying if I am using cleveref, because (\cref{eq:1}) is not at all right.
It is implied in one other place (the only place I've seen it mentioned) that this surprising/unexpected behaviour and may be due to my own customisations (of which there aren't many at all)... but if I start emacs with emacs -Q to disable all of them, it still occurs for both of the built-in reference formats (\ref and \pageref).
I'm using Emacs 24.5 with RefTex 24.4 on Ubuntu.
It would be very nice to stop/control this behaviour.
(...), it useseqrefforeq:...labels (even if I try to use non-refreference formats likepagerefor thecrefone I've defined). – huon Nov 13 '15 at 11:03\crefformat (added as you suggest in the answer that I linked in my question), it should just insert\crefinstead of trying to guess what I mean with the heuristics that don't apply to the more intelligent referencing packages. I also don't really want to force the\crefformat (not all the documents I work on use it). – huon Nov 13 '15 at 11:46ekey: this seems to be driven by theeq:prefix, for instance, if I use space to see all the labels in my file, RefTeX still inserts parens/eqrefif I choose aneq:...label.) – huon Nov 13 '15 at 11:48reftex-typekey-to-format-alistis relevant not only when theetype of labels is selected, but every time a label witheq:prefix is chosen. If in a document withcleverefyou always want to you only\crefyou only need to setreftex-label-alisttonilthere (add(set (make-variable-buffer-local 'reftex-label-alist) nil)in the hook of the other question, afterreftex-ref-style-activate) – giordano Nov 13 '15 at 12:49c(i.e. cleveref) with aneq:label still has surrounding parens. (reftex-label-alistis indeednil, perC-h v, but that also tells me the global value isnilso that doesn't seem to have changed the situation.) – huon Nov 14 '15 at 08:13(setq reftex-label-alist '(AMSTeX))in your init file? – giordano Nov 14 '15 at 14:09(\cref{eq:1}), i.e. parens. – huon Nov 14 '15 at 23:07(add-to-list 'reftex-typekey-to-format-alist '("e" . "~\\ref{%s}"))line your init file, either. – giordano Nov 15 '15 at 18:13init.elfile with each of the suggestions (as I've understood them), and tested them, and none worked. Do you see different behaviour? (I guess it's not the worst to have equations use\eqrefand everything else usecref: I can just alias the former to the latter, but it'd be nice to not have to do it.) – huon Nov 17 '15 at 12:25reftex-typekey-to-format-alistseems to work only in some conditions (the ones I was testing, of course). I updated the answer, should work now. – giordano Nov 17 '15 at 21:04\crefis now inserted without parens! However it seems to be unconditionally running the cleveref style hook, even in a document without cleveref. Seeinit6.el. – huon Nov 17 '15 at 23:55cleverefpackage, the variableTeX-active-stylescontains"cleveref"(issueC-h v TeX-active-styles RETin that buffer)? – giordano Nov 18 '15 at 10:05\usepackage{cleveref}and then closing/reopening emacs, but the caching inauto/*.elmeant it was sticking with the old list of packages. It works fine if I delete that file, or if I use separate files like the gist suggested. Thanks so much for working through this with me! – huon Nov 18 '15 at 11:23C-c C-nto force reparsing of the file;-)– giordano Nov 18 '15 at 12:10