summaryrefslogtreecommitdiff
path: root/tex-conf.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-05-02 13:49:51 +0800
committerJSDurand <mmemmew@gmail.com>2022-05-02 13:49:51 +0800
commita4fc45b47fbe2c1d62a28b38d6f0c253d8df56c1 (patch)
tree306c764688cfb57976c2f45789c1ff608e7a7f83 /tex-conf.el
parent519475be66895e542fed4211ce6234e95eb92b63 (diff)
tex-conf: add parenthesis insertion
Diffstat (limited to 'tex-conf.el')
-rw-r--r--tex-conf.el8
1 files changed, 8 insertions, 0 deletions
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)))