From a4fc45b47fbe2c1d62a28b38d6f0c253d8df56c1 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 2 May 2022 13:49:51 +0800 Subject: tex-conf: add parenthesis insertion --- tex-conf.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tex-conf.el') diff --git a/tex-conf.el b/tex-conf.el index 64fb0af..7d42aa2 100644 --- a/tex-conf.el +++ b/tex-conf.el @@ -256,6 +256,7 @@ where the macro part is without the backslash.") (cons "+" "oplus") (cons "o" "circ") (list "{" "{" "}") + (list "(" "(" ")") (list "b" "lvert" "rvert"))) ;;;###autoload @@ -272,6 +273,13 @@ The list is in the variable `durand-o-things-list'" ((not (consp associated)) ;; length = 1 (insert (format "\\%s" (assoc-default thing durand-o-things-list #'string=)))) + ((and (null (cddr associated)) + (string= (car associated) "(")) + ;; special treatment for the parenthesis + (insert (format "\\left%s" (car associated))) + (save-excursion + (insert + (format "\\right%s" (cadr associated))))) ((null (cddr associated)) ;; length = 2 (insert (format "\\left\\%s" (car associated))) -- cgit v1.2.3-18-g5258