I am using emacs to write LaTeX documents with AucTeX and cdlatex. Both of them have the same feature of automatically closing parens and dollar sign symbols. However, AucTeX obviously did a better job implenting that functionality, which is what I prefer to use.

That said, currently it's cdlatex that is doing the job of closing parens, which is very annoying. I tried to turn it off in cdlatex's customization but that just disables the functionality entirely. Is there a way to lift AucTex to a higher priority?

Here's my init:

;; this is more on the global side but I have it enabled anyways
(electric-pair-mode 1) ;; automatically close parens, etc.

(setq LaTeX-electric-left-right-brace 1) ;; automatic close tags
;; matching dollar sign
(add-hook 'LaTeX-mode-hook
      (lambda () (set (make-local-variable 'TeX-electric-math)(cons "$" "$"))))

(add-hook 'LaTeX-mode-hook 'turn-on-cdlatex) ;; enabled in AUCTeX LaTeX mode
;; (setq cdlatex-paired-parens nil)
(setq cdlatex-paired-parens "[{($")

Solution: As Stefan suggested below, I got it to work after adding the following lines to my init:

(eval-after-load 'cdlatex
    (lambda ()
        (substitute-key-definition 'cdlatex-pbb nil cdlatex-mode-map)
        (substitute-key-definition 'cdlatex-dollar nil cdlatex-mode-map)

1 Answer 1


I suggest you report this problem as a bug. It also prevents the use of the standard pairing minor mode electric-pair-mode.

As for a workaround, you could try

(substitute-key-definition 'cdlatex-pbb nil cdlatex-mode-map)
(substitute-key-definition 'cdlatex-dollar nil cdlatex-mode-map)
  • It worked! I did not realize that it a keybinding issue.
    – graduagrey
    Apr 8, 2020 at 20:15
  • @graduagrey: you might want to update the title of your question accordingly?
    – Stefan
    Apr 8, 2020 at 20:44
  • done! Thanks so much for your help.
    – graduagrey
    Apr 8, 2020 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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