Commit 88afeeea authored by Tassilo Horn's avatar Tassilo Horn
Browse files

Add a prettify-symbols-alist for (La)TeX

* tex-mode.el (tex-prettify-symbols-alist): New variable holding
an alist suitable as prettify-symbols-alist in (La)TeX modes.
parent 82a3da21
......@@ -2943,6 +2943,461 @@ There might be text before point."
(setq-local syntax-propertize-function
(syntax-propertize-rules doctex-syntax-propertize-rules)))
;;; Prettify Symbols Support
(defvar tex-prettify-symbols-alist
'( ;; Lowercase Greek letters.
("\\alpha" . ?α)
("\\beta" . ?β)
("\\gamma" . ?γ)
("\\delta" . ?δ)
("\\epsilon" . ?ε)
("\\zeta" . ?ζ)
("\\eta" . ?η)
("\\theta" . ?θ)
("\\iota" . ?ι)
("\\kappa" . ?κ)
("\\lambda" . ?λ)
("\\mu" . ?μ)
("\\nu" . ?ν)
("\\xi" . ?ξ)
;; There is no \omicron becase it looks like a latin o.
("\\pi" . ?π)
("\\rho" . ?ρ)
("\\sigma" . ?σ)
("\\tau" . ?τ)
("\\upsilon" . ?υ)
("\\phi" . ?φ)
("\\chi" . ?χ)
("\\psi" . ?ψ)
("\\omega" . ?ω)
;; Uppercase Greek letters.
("\\Gamma" . ?Γ)
("\\Delta" . ?Δ)
("\\Lambda" . ?Λ)
("\\Phi" . ?Φ)
("\\Pi" . ?Π)
("\\Psi" . ?Ψ)
("\\Sigma" . ?Σ)
("\\Theta" . ?Θ)
("\\Upsilon" . ?Υ)
("\\Xi" . ?Ξ)
("\\Omega" . ?Ω)
;; Other math symbols (taken from leim/quail/latin-ltx.el).
("\\Box" . ?)
("\\Bumpeq" . ?)
("\\Cap" . ?)
("\\Cup" . ?)
("\\Diamond" . ?)
("\\Downarrow" . ?)
("\\H{o}" . ?ő)
("\\Im" . ?)
("\\Join" . ?)
("\\Leftarrow" . ?)
("\\Leftrightarrow" . ?)
("\\Ll" . ?)
("\\Lleftarrow" . ?)
("\\Longleftarrow" . ?)
("\\Longleftrightarrow" . ?)
("\\Longrightarrow" . ?)
("\\Lsh" . ?)
("\\Re" . ?)
("\\Rightarrow" . ?)
("\\Rrightarrow" . ?)
("\\Rsh" . ?)
("\\Subset" . ?)
("\\Supset" . ?)
("\\Uparrow" . ?)
("\\Updownarrow" . ?)
("\\Vdash" . ?)
("\\Vert" . ?)
("\\Vvdash" . ?)
("\\aleph" . ?)
("\\amalg" . ?)
("\\angle" . ?)
("\\approx" . ?)
("\\approxeq" . ?)
("\\ast" . ?)
("\\asymp" . ?)
("\\backcong" . ?)
("\\backepsilon" . ?)
("\\backprime" . ?)
("\\backsim" . ?)
("\\backsimeq" . ?)
("\\backslash" . ?\\)
("\\barwedge" . ?)
("\\because" . ?)
("\\beth" . ?)
("\\between" . ?)
("\\bigcap" . ?)
("\\bigcirc" . ?)
("\\bigcup" . ?)
("\\bigstar" . ?)
("\\bigtriangledown" . ?)
("\\bigtriangleup" . ?)
("\\bigvee" . ?)
("\\bigwedge" . ?)
("\\blacklozenge" . ?)
("\\blacksquare" . ?)
("\\blacktriangle" . ?)
("\\blacktriangledown" . ?)
("\\blacktriangleleft" . ?)
("\\blacktriangleright" . ?)
("\\bot" . ?)
("\\bowtie" . ?)
("\\boxminus" . ?)
("\\boxplus" . ?)
("\\boxtimes" . ?)
("\\bullet" . ?)
("\\bumpeq" . ?)
("\\cap" . ?)
("\\cdots" . ?)
("\\centerdot" . ?·)
("\\checkmark" . ?)
("\\chi" . ?χ)
("\\circ" . ?)
("\\circeq" . ?)
("\\circlearrowleft" . ?)
("\\circlearrowright" . ?)
("\\circledR" . ?®)
("\\circledS" . ?)
("\\circledast" . ?)
("\\circledcirc" . ?)
("\\circleddash" . ?)
("\\clubsuit" . ?)
("\\coloneq" . ?)
("\\complement" . ?)
("\\cong" . ?)
("\\coprod" . ?)
("\\cup" . ?)
("\\curlyeqprec" . ?)
("\\curlyeqsucc" . ?)
("\\curlypreceq" . ?)
("\\curlyvee" . ?)
("\\curlywedge" . ?)
("\\curvearrowleft" . ?)
("\\curvearrowright" . ?)
("\\dag" . ?)
("\\dagger" . ?)
("\\daleth" . ?)
("\\dashv" . ?)
("\\ddag" . ?)
("\\ddagger" . ?)
("\\ddots" . ?)
("\\diamond" . ?)
("\\diamondsuit" . ?)
("\\divideontimes" . ?)
("\\doteq" . ?)
("\\doteqdot" . ?)
("\\dotplus" . ?)
("\\dotsquare" . ?)
("\\downarrow" . ?)
("\\downdownarrows" . ?)
("\\downleftharpoon" . ?)
("\\downrightharpoon" . ?)
("\\ell" . ?)
("\\emptyset" . ?)
("\\eqcirc" . ?)
("\\eqcolon" . ?)
("\\eqslantgtr" . ?)
("\\eqslantless" . ?)
("\\equiv" . ?)
("\\exists" . ?)
("\\fallingdotseq" . ?)
("\\flat" . ?)
("\\forall" . ?)
("\\frown" . ?)
("\\ge" . ?)
("\\geq" . ?)
("\\geqq" . ?)
("\\geqslant" . ?)
("\\gets" . ?)
("\\gg" . ?)
("\\ggg" . ?)
("\\gimel" . ?)
("\\gnapprox" . ?)
("\\gneq" . ?)
("\\gneqq" . ?)
("\\gnsim" . ?)
("\\gtrapprox" . ?)
("\\gtrdot" . ?)
("\\gtreqless" . ?)
("\\gtreqqless" . ?)
("\\gtrless" . ?)
("\\gtrsim" . ?)
("\\gvertneqq" . ?)
("\\hbar" . ?)
("\\heartsuit" . ?)
("\\hookleftarrow" . ?)
("\\hookrightarrow" . ?)
("\\iff" . ?)
("\\imath" . ?ı)
("\\in" . ?)
("\\infty" . ?)
("\\int" . ?)
("\\intercal" . ?)
("\\langle" . 10216) ; Literal ?⟨ breaks indentation.
("\\lbrace" . ?{)
("\\lbrack" . ?\[)
("\\lceil" . ?)
("\\ldots" . ?)
("\\le" . ?)
("\\leadsto" . ?)
("\\leftarrow" . ?)
("\\leftarrowtail" . ?)
("\\leftharpoondown" . ?)
("\\leftharpoonup" . ?)
("\\leftleftarrows" . ?)
;; ("\\leftparengtr" ?〈), see bug#12948.
("\\leftrightarrow" . ?)
("\\leftrightarrows" . ?)
("\\leftrightharpoons" . ?)
("\\leftrightsquigarrow" . ?)
("\\leftthreetimes" . ?)
("\\leq" . ?)
("\\leqq" . ?)
("\\leqslant" . ?)
("\\lessapprox" . ?)
("\\lessdot" . ?)
("\\lesseqgtr" . ?)
("\\lesseqqgtr" . ?)
("\\lessgtr" . ?)
("\\lesssim" . ?)
("\\lfloor" . ?)
("\\lhd" . ?)
("\\rhd" . ?)
("\\ll" . ?)
("\\llcorner" . ?)
("\\lnapprox" . ?)
("\\lneq" . ?)
("\\lneqq" . ?)
("\\lnsim" . ?)
("\\longleftarrow" . ?)
("\\longleftrightarrow" . ?)
("\\longmapsto" . ?)
("\\longrightarrow" . ?)
("\\looparrowleft" . ?)
("\\looparrowright" . ?)
("\\lozenge" . ?)
("\\lq" . ?)
("\\lrcorner" . ?)
("\\ltimes" . ?)
("\\lvertneqq" . ?)
("\\maltese" . ?)
("\\mapsto" . ?)
("\\measuredangle" . ?)
("\\mho" . ?)
("\\mid" . ?)
("\\models" . ?)
("\\mp" . ?)
("\\multimap" . ?)
("\\nLeftarrow" . ?)
("\\nLeftrightarrow" . ?)
("\\nRightarrow" . ?)
("\\nVDash" . ?)
("\\nVdash" . ?)
("\\nabla" . ?)
("\\napprox" . ?)
("\\natural" . ?)
("\\ncong" . ?)
("\\ne" . ?)
("\\nearrow" . ?)
("\\neg" . ?¬)
("\\neq" . ?)
("\\nequiv" . ?)
("\\newline" . ?)
("\\nexists" . ?)
("\\ngeq" . ?)
("\\ngeqq" . ?)
("\\ngeqslant" . ?)
("\\ngtr" . ?)
("\\ni" . ?)
("\\nleftarrow" . ?)
("\\nleftrightarrow" . ?)
("\\nleq" . ?)
("\\nleqq" . ?)
("\\nleqslant" . ?)
("\\nless" . ?)
("\\nmid" . ?)
;; ("\\not" ?̸) ;FIXME: conflict with "NOT SIGN" ¬.
("\\notin" . ?)
("\\nparallel" . ?)
("\\nprec" . ?)
("\\npreceq" . ?)
("\\nrightarrow" . ?)
("\\nshortmid" . ?)
("\\nshortparallel" . ?)
("\\nsim" . ?)
("\\nsimeq" . ?)
("\\nsubset" . ?)
("\\nsubseteq" . ?)
("\\nsubseteqq" . ?)
("\\nsucc" . ?)
("\\nsucceq" . ?)
("\\nsupset" . ?)
("\\nsupseteq" . ?)
("\\nsupseteqq" . ?)
("\\ntriangleleft" . ?)
("\\ntrianglelefteq" . ?)
("\\ntriangleright" . ?)
("\\ntrianglerighteq" . ?)
("\\nvDash" . ?)
("\\nvdash" . ?)
("\\nwarrow" . ?)
("\\odot" . ?)
("\\oint" . ?)
("\\ominus" . ?)
("\\oplus" . ?)
("\\oslash" . ?)
("\\otimes" . ?)
("\\par" . ?)
("\\parallel" . ?)
("\\partial" . ?)
("\\perp" . ?)
("\\pitchfork" . ?)
("\\prec" . ?)
("\\precapprox" . ?)
("\\preceq" . ?)
("\\precnapprox" . ?)
("\\precnsim" . ?)
("\\precsim" . ?)
("\\prime" . ?)
("\\prod" . ?)
("\\propto" . ?)
("\\qed" . ?)
("\\quad" . ?)
("\\rangle" . 10217) ; Literal ?⟩ breaks indentation.
("\\rbrace" . ?})
("\\rbrack" . ?\])
("\\rceil" . ?)
("\\rfloor" . ?)
("\\rightarrow" . ?)
("\\rightarrowtail" . ?)
("\\rightharpoondown" . ?)
("\\rightharpoonup" . ?)
("\\rightleftarrows" . ?)
("\\rightleftharpoons" . ?)
;; ("\\rightparengtr" ?⦔) ;; Was ?〉, see bug#12948.
("\\rightrightarrows" . ?)
("\\rightthreetimes" . ?)
("\\risingdotseq" . ?)
("\\rtimes" . ?)
("\\sbs" . ?)
("\\searrow" . ?)
("\\setminus" . ?)
("\\sharp" . ?)
("\\shortmid" . ?)
("\\shortparallel" . ?)
("\\sim" . ?)
("\\simeq" . ?)
("\\smallamalg" . ?)
("\\smallsetminus" . ?)
("\\smallsmile" . ?)
("\\smile" . ?)
("\\spadesuit" . ?)
("\\sphericalangle" . ?)
("\\sqcap" . ?)
("\\sqcup" . ?)
("\\sqsubset" . ?)
("\\sqsubseteq" . ?)
("\\sqsupset" . ?)
("\\sqsupseteq" . ?)
("\\square" . ?)
("\\squigarrowright" . ?)
("\\star" . ?)
("\\straightphi" . ?φ)
("\\subset" . ?)
("\\subseteq" . ?)
("\\subseteqq" . ?)
("\\subsetneq" . ?)
("\\subsetneqq" . ?)
("\\succ" . ?)
("\\succapprox" . ?)
("\\succcurlyeq" . ?)
("\\succeq" . ?)
("\\succnapprox" . ?)
("\\succnsim" . ?)
("\\succsim" . ?)
("\\sum" . ?)
("\\supset" . ?)
("\\supseteq" . ?)
("\\supseteqq" . ?)
("\\supsetneq" . ?)
("\\supsetneqq" . ?)
("\\surd" . ?)
("\\swarrow" . ?)
("\\therefore" . ?)
("\\thickapprox" . ?)
("\\thicksim" . ?)
("\\to" . ?)
("\\top" . ?)
("\\triangle" . ?)
("\\triangledown" . ?)
("\\triangleleft" . ?)
("\\trianglelefteq" . ?)
("\\triangleq" . ?)
("\\triangleright" . ?)
("\\trianglerighteq" . ?)
("\\twoheadleftarrow" . ?)
("\\twoheadrightarrow" . ?)
("\\ulcorner" . ?)
("\\uparrow" . ?)
("\\updownarrow" . ?)
("\\upleftharpoon" . ?)
("\\uplus" . ?)
("\\uprightharpoon" . ?)
("\\upuparrows" . ?)
("\\urcorner" . ?)
("\\u{i}" . ?ĭ)
("\\vDash" . ?)
("\\varprime" . ?)
("\\varpropto" . ?)
;; ("\\varsigma" ?ς) ;FIXME: Looks reversed with the non\var.
("\\vartriangleleft" . ?)
("\\vartriangleright" . ?)
("\\vdash" . ?)
("\\vdots" . ?)
("\\vee" . ?)
("\\veebar" . ?)
("\\vert" . ?|)
("\\wedge" . ?)
("\\wp" . ?)
("\\wr" . ?)
("\\Bbb{N}" . ?) ; AMS commands for blackboard bold
("\\Bbb{P}" . ?) ; Also sometimes \mathbb.
("\\Bbb{R}" . ?)
("\\Bbb{Z}" . ?)
("--" . ?)
("---" . ?)
("\\ordfeminine" . ?ª)
("\\ordmasculine" . ?º)
("\\lambdabar" . ?ƛ)
("\\celsius" . ?)
("\\textmu" . ?µ)
("\\textfractionsolidus" . ?)
("\\textbigcircle" . ?)
("\\textmusicalnote" . ?)
("\\textdied" . ?)
("\\textcolonmonetary" . ?)
("\\textwon" . ?)
("\\textnaira" . ?)
("\\textpeso" . ?)
("\\textlira" . ?)
("\\textrecipe" . ?)
("\\textinterrobang" . ?)
("\\textpertenthousand" . ?)
("\\textbaht" . ?฿)
("\\textnumero" . ?)
("\\textdiscount" . ?)
("\\textestimated" . ?)
("\\textopenbullet" . ?)
("\\textlquill" . 8261) ; Literal ?⁅ breaks indentation.
("\\textrquill" . 8262) ; Literal ?⁆ breaks indentation.
("\\textcircledP" . ?)
("\\textreferencemark" . ?))
"A `prettify-symbols-alist' usable for (La)TeX modes.")
(run-hooks 'tex-mode-load-hook)
(provide 'tex-mode)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment