1

I'm trying to configure my spacemacs install to use it with reftex. Actually, I want to change the automatic labels of equation and such so that they include the file name in the label. The end of my .spacemacs is the following

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
[snip]
 '(reftex-extra-bindings t)
 '(reftex-use-external-file-finders t)
 '(reftex-label-alist
   (quote
    (("multline" 109 "eq_%f:" "~\\ref{%s}" t ("Equation"))
     ("equation" 122 "eq_%f:" "~\\eqref{%s}" t ("Equation")))))
 '(reftex-plug-into-AUCTeX t)
 '(ring-bell-function (quote ignore)))

The very same code under emacs works like a charm. In spacemacs, I can't obtain automatic numbering and not even the prefix with the file name.

Any idea ?

  • 1
    I think the issue is that spacemacs does (setq reftex-plug-into-AUCTeX '(nil nil t t t) in the function latex/init-reftex in the file layers/+lang/latex/packages.el. You can test this by changing the line 158 to (setq reftex-plug-into-AUCTeX t) in that file and see if it helps. Next, you would have to find out how to make it permanent. Disclaimer: I don't use spacemacs. – Arash Esbati Jan 30 '17 at 12:14
  • I don't know how you guess that but it works !! Thanks. – Laurent D. Jan 30 '17 at 12:22
  • My lucky day ;-). You're welcome. You should write an answer to your question and mark it as accepted so that it is closed. I will not do it since I'm not sure how to make permanent changes to spacemacs defaults -- I can imagine that the file will be overwritten with next update of spacemacs. – Arash Esbati Jan 30 '17 at 12:37
1

As mentioned by Arah, it suffices to change the line number 158 of ./.emacs.d/layers/+lang/latex/packages.el from

(setq reftex-plug-into-AUCTeX '(nil nil t t t))

to

(setq reftex-plug-into-AUCTeX t)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.