I would want to "electrically" insert |
or \right|
when typing |
or \left|
in AucTeX and can't quite figure out how to add characters to AucTex-electric. A list of already defined completions can be found here. Can anyone help me with this issue?
Asked
Active
Viewed 126 times
2

Tim Hilt
- 297
- 1
- 11
1 Answers
3
Insert the following lisp snippet into your init-file:
(add-hook 'LaTeX-mode-hook
(lambda ()
(setq LaTeX-electric-left-right-brace t)
(local-set-key "|" 'LaTeX-insert-left-brace)))
Maybe, (setq LaTeX-electric-left-right-brace t)
is not really necessary since you have it already customized or hooked in. Nevertheless, it does not hurt if you keep it.

Tobias
- 32,569
- 1
- 34
- 75
-
Works beautifully! Thank you very much! – Tim Hilt Mar 15 '19 at 10:56