]> git.eshelyaron.com Git - emacs.git/commitdiff
Extend prettify-symbols-alist in TeX mode
authorPaul Nelson <ultrono@gmail.com>
Sun, 30 Mar 2025 11:31:58 +0000 (13:31 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 8 Apr 2025 05:43:02 +0000 (07:43 +0200)
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Add
further math symbols, quotes and fractions.  (Bug#77381)

(cherry picked from commit ef6203b64aaf53cd986caf17bd49b6ffe840c93a)

lisp/textmodes/tex-mode.el

index ea318db977936ad42e152bc5e3400224651c95e2..038fb462f5150fd971782815b4e8013a9ee01741 100644 (file)
@@ -3132,9 +3132,14 @@ There might be text before point."
     ("\\bigcap" . ?⋂)
     ("\\bigcirc" . ?◯)
     ("\\bigcup" . ?⋃)
+    ("\\bigodot" . ?⨀)
+    ("\\bigoplus" . ?⨁)
+    ("\\bigotimes" . ?⨂)
+    ("\\bigsqcup" . ?⨆)
     ("\\bigstar" . ?★)
     ("\\bigtriangledown" . ?▽)
     ("\\bigtriangleup" . ?△)
+    ("\\biguplus" . ?⨄)
     ("\\bigvee" . ?⋁)
     ("\\bigwedge" . ?⋀)
     ("\\blacklozenge" . ?✦)
@@ -3151,12 +3156,11 @@ There might be text before point."
     ("\\bullet" . ?•)
     ("\\bumpeq" . ?≏)
     ("\\cap" . ?∩)
+    ("\\cdot" . ?⋅)
     ("\\cdots" . ?⋯)
     ("\\centerdot" . ?·)
     ("\\checkmark" . ?✓)
     ("\\chi" . ?χ)
-    ("\\cdot" . ?⋅)
-    ("\\cdots" . ?⋯)
     ("\\circ" . ?∘)
     ("\\circeq" . ?≗)
     ("\\circlearrowleft" . ?↺)
@@ -3233,11 +3237,15 @@ There might be text before point."
     ("\\hookleftarrow" . ?↩)
     ("\\hookrightarrow" . ?↪)
     ("\\iff" . ?⇔)
+    ("\\iiiint" . ?⨌)
+    ("\\iiint" . ?∭)
+    ("\\iint" . ?∬)
     ("\\imath" . ?ı)
     ("\\in" . ?∈)
     ("\\infty" . ?∞)
     ("\\int" . ?∫)
     ("\\intercal" . ?⊺)
+    ("\\jmath" . ?ȷ)
     ("\\langle" . 10216)          ; Literal ?⟨ breaks indentation.
     ("\\lbrace" . ?{)
     ("\\lbrack" . ?\[)
@@ -3270,6 +3278,7 @@ There might be text before point."
     ("\\rhd" . ?▷)
     ("\\ll" . ?≪)
     ("\\llcorner" . ?⌞)
+    ("\\lll" . ?⋘)
     ("\\lnapprox" . ?⋦)
     ("\\lneq" . ?≨)
     ("\\lneqq" . ?≨)
@@ -3347,6 +3356,8 @@ There might be text before point."
     ("\\nvdash" . ?⊬)
     ("\\nwarrow" . ?↖)
     ("\\odot" . ?⊙)
+    ("\\oiiint" . ?∰)
+    ("\\oiint" . ?∯)
     ("\\oint" . ?∮)
     ("\\ominus" . ?⊖)
     ("\\oplus" . ?⊕)
@@ -3455,10 +3466,12 @@ There might be text before point."
     ("\\vDash" . ?⊨)
     ("\\varepsilon" . ?ε)
     ("\\varphi" . ?φ)
+    ("\\varpi" . ?ϖ)
     ("\\varprime" . ?′)
     ("\\varpropto" . ?∝)
     ("\\varrho" . ?ϱ)
     ("\\varsigma" . ?ς)
+    ("\\vartheta" . ?ϑ)
     ("\\vartriangleleft" . ?⊲)
     ("\\vartriangleright" . ?⊳)
     ("\\vdash" . ?⊢)
@@ -3469,19 +3482,60 @@ There might be text before point."
     ("\\wedge" . ?∧)
     ("\\wp" . ?℘)
     ("\\wr" . ?≀)
-    ("\\Bbb{N}" . ?ℕ)                        ; AMS commands for blackboard bold
-    ("\\Bbb{P}" . ?ℙ)                        ; Also sometimes \mathbb.
+    ("\\Bbb{A}" . ?𝔸)                       ; AMS commands for blackboard bold
+    ("\\Bbb{B}" . ?𝔹)                       ; Also sometimes \mathbb.
+    ("\\Bbb{C}" . ?ℂ)
+    ("\\Bbb{D}" . ?𝔻)
+    ("\\Bbb{E}" . ?𝔼)
+    ("\\Bbb{F}" . ?𝔽)
+    ("\\Bbb{G}" . ?𝔾)
+    ("\\Bbb{H}" . ?ℍ)
+    ("\\Bbb{I}" . ?𝕀)
+    ("\\Bbb{J}" . ?𝕁)
+    ("\\Bbb{K}" . ?𝕂)
+    ("\\Bbb{L}" . ?𝕃)
+    ("\\Bbb{M}" . ?𝕄)
+    ("\\Bbb{N}" . ?ℕ)
+    ("\\Bbb{O}" . ?𝕆)
+    ("\\Bbb{P}" . ?ℙ)
     ("\\Bbb{Q}" . ?ℚ)
     ("\\Bbb{R}" . ?ℝ)
+    ("\\Bbb{S}" . ?𝕊)
     ("\\Bbb{T}" . ?𝕋)
+    ("\\Bbb{U}" . ?𝕌)
+    ("\\Bbb{V}" . ?𝕍)
+    ("\\Bbb{W}" . ?𝕎)
+    ("\\Bbb{X}" . ?𝕏)
+    ("\\Bbb{Y}" . ?𝕐)
     ("\\Bbb{Z}" . ?ℤ)
-    ("\\mathbb{N}" . ?ℕ)                     ; AMS commands for blackboard bold
-    ("\\mathbb{P}" . ?ℙ)                     ; Also sometimes \mathbb.
+    ("\\mathbb{A}" . ?𝔸)                    ; AMS commands for blackboard bold
+    ("\\mathbb{B}" . ?𝔹)                    ; Also sometimes \mathbb.
+    ("\\mathbb{C}" . ?ℂ)
+    ("\\mathbb{D}" . ?𝔻)
+    ("\\mathbb{E}" . ?𝔼)
+    ("\\mathbb{F}" . ?𝔽)
+    ("\\mathbb{G}" . ?𝔾)
+    ("\\mathbb{H}" . ?ℍ)
+    ("\\mathbb{I}" . ?𝕀)
+    ("\\mathbb{J}" . ?𝕁)
+    ("\\mathbb{K}" . ?𝕂)
+    ("\\mathbb{L}" . ?𝕃)
+    ("\\mathbb{M}" . ?𝕄)
+    ("\\mathbb{N}" . ?ℕ)
+    ("\\mathbb{O}" . ?𝕆)
+    ("\\mathbb{P}" . ?ℙ)
     ("\\mathbb{Q}" . ?ℚ)
     ("\\mathbb{R}" . ?ℝ)
+    ("\\mathbb{S}" . ?𝕊)
     ("\\mathbb{T}" . ?𝕋)
+    ("\\mathbb{U}" . ?𝕌)
+    ("\\mathbb{V}" . ?𝕍)
+    ("\\mathbb{W}" . ?𝕎)
+    ("\\mathbb{X}" . ?𝕏)
+    ("\\mathbb{Y}" . ?𝕐)
     ("\\mathbb{Z}" . ?ℤ)
     ("\\pm" . ?±)
+    ("\\pounds" . ?£)
     ("\\|" . ?‖)
     ("\\varkappa" . ?ϰ)
     ;; caligraphic
@@ -3685,7 +3739,59 @@ There might be text before point."
     ("\\textdivorced" . ?⚮)
     ("\\textlbrackdbl" . 10214) ; Literal ?⟦ breaks indentation
     ("\\textrbrackdbl" . 10215) ; Literal ?⟧ breaks indentation
-    ("\\textinterrobangdown" . ?⸘))
+    ("\\textinterrobangdown" . ?⸘)
+
+    ;; TeX quotes
+    ("``" . ?“)
+    ("''" . ?”)
+
+    ;; Unicode Fractions
+    ("\\frac{1}{2}" . "½")
+    ("\\frac{1}{3}" . "⅓")
+    ("\\frac{2}{3}" . "⅔")
+    ("\\frac{1}{4}" . "¼")
+    ("\\frac{3}{4}" . "¾")
+    ("\\frac{1}{5}" . "⅕")
+    ("\\frac{2}{5}" . "⅖")
+    ("\\frac{3}{5}" . "⅗")
+    ("\\frac{4}{5}" . "⅘")
+    ("\\frac{1}{6}" . "⅙")
+    ("\\frac{5}{6}" . "⅚")
+    ("\\frac{1}{7}" . "⅐")
+    ("\\frac{1}{8}" . "⅛")
+    ("\\frac{3}{8}" . "⅜")
+    ("\\frac{5}{8}" . "⅝")
+    ("\\frac{7}{8}" . "⅞")
+    ("\\frac{1}{9}" . "⅑")
+    ("\\frac{1}{10}" . "⅒")
+    ("\\tfrac{1}{2}" . "½")
+    ("\\tfrac{1}{3}" . "⅓")
+    ("\\tfrac{2}{3}" . "⅔")
+    ("\\tfrac{1}{4}" . "¼")
+    ("\\tfrac{3}{4}" . "¾")
+    ("\\tfrac{1}{5}" . "⅕")
+    ("\\tfrac{2}{5}" . "⅖")
+    ("\\tfrac{3}{5}" . "⅗")
+    ("\\tfrac{4}{5}" . "⅘")
+    ("\\tfrac{1}{6}" . "⅙")
+    ("\\tfrac{5}{6}" . "⅚")
+    ("\\tfrac{1}{7}" . "⅐")
+    ("\\tfrac{1}{8}" . "⅛")
+    ("\\tfrac{3}{8}" . "⅜")
+    ("\\tfrac{5}{8}" . "⅝")
+    ("\\tfrac{7}{8}" . "⅞")
+    ("\\tfrac{1}{9}" . "⅑")
+    ("\\tfrac{1}{10}" . "⅒")
+
+    ;; Other symbols
+    ("\\S" . ?§)
+    ("\\Finv" . ?Ⅎ)
+    ("\\Game" . ?⅁)
+    ("\\ " . 9141) ; Literal ?⎵ breaks indentation
+    ("\\lvert" . ?|)
+    ("\\rvert" . ?|)
+    ("\\lVert" . ?‖)
+    ("\\rVert" . ?‖))
   "A `prettify-symbols-alist' usable for (La)TeX modes.")
 
 (defun tex--prettify-symbols-compose-p (_start end _match)