0

I'd like to automatically close \left( with \right) in LaTeX via AUCTeX in Emacs 27. The following should work:

(add-hook 'LaTeX-mode-hook
            (lambda () (set (make-local-variable 'TeX-electric-math)
                            (cons "\\left(" "\\right)"))))

But it doesn't. Any clues as to why it doesn't and how I could make it work?

PS: the solution here adds an extra parenthesis, so in the end you have \left(\right)).

Daniel
  • 99
  • 9
  • 1
    Have you seen the description for `LaTeX-electric-left-right-brace` in [the manual](https://www.gnu.org/software/auctex/manual/auctex.html#index-LaTeX_002delectric_002dleft_002dright_002dbrace)? – Arash Esbati Dec 10 '20 at 10:02
  • Blimey! Sorry for the bother! I had forgotten about `LaTeX-electric-left-right-brace`! The funny thing is, I have it in my `init`, but I had commented it out, can't remember why. Thank you! – Daniel Dec 11 '20 at 16:00

0 Answers0