filled in a bunch more of the standard latex symbols

svn: r7945

original commit: 061533778a4bf3dd3682aff2b7fff81c109aa6a2
This commit is contained in:
Robby Findler 2007-12-11 02:57:27 +00:00
parent b6f32dfc9d
commit d6e768aafa
2 changed files with 125 additions and 29 deletions

View File

@ -1,13 +1,14 @@
#lang scheme/unit
(require (lib "string-constant.ss" "string-constants")
(lib "class.ss")
(lib "list.ss")
(lib "mred-sig.ss" "mred")
(lib "match.ss")
"../preferences.ss"
"sig.ss")
(require (lib "string-constant.ss" "string-constants")
(lib "class.ss")
(lib "list.ss")
(lib "mred-sig.ss" "mred")
(lib "match.ss")
"../preferences.ss"
"tex-table.ss"
"sig.ss")
(import mred^
[prefix finder: framework:finder^]
@ -948,33 +949,13 @@
#t)]
[TeX-compress
(let* ([shortcut-table
'(("lambda" "λ")
("forall" "\u2200")
("exists" "\u2203")
("in" "\u2208")
("Sigma" "\u2211")
("Pi" "\u220f")
("leq" "\u2264")
("geq" "\u2265")
("infty" "\u221e")
("leftarrow" "\u2190")
("rightarrow" "\u2192")
("Leftarrow" "\u21d0")
("Rightarrow" "\u21d2")
("wedge" "\u2227")
("vee" "\u2227")
("circ" "\u2218")
("models" "\u22a8")
("vdash" "\u22a2")
("dashv" "\u22a3"))]
[biggest (apply max (map (λ (x) (string-length (car x))) shortcut-table))])
(let* ([biggest (apply max (map (λ (x) (string-length (car x))) tex-shortcut-table))])
(λ (text event)
(let ([pos (send text get-start-position)])
(when (= pos (send text get-end-position))
(let ([slash (send text find-string "\\" 'backward pos (max 0 (- pos biggest 1)))])
(when slash
(let ([to-replace (assoc (send text get-text slash pos) shortcut-table)])
(let ([to-replace (assoc (send text get-text slash pos) tex-shortcut-table)])
(when to-replace
(send text begin-edit-sequence)
(send text delete (- slash 1) pos)

View File

@ -0,0 +1,115 @@
#lang scheme/base
(provide tex-shortcut-table)
(define tex-shortcut-table
'(("lambda" "λ")
("forall" "\u2200")
("exists" "\u2203")
("Sigma" "\u2211")
("Pi" "\u220f")
("infty" "\u221e")
("leftarrow" "\u2190")
("rightarrow" "\u2192")
("Leftarrow" "\u21d0")
("Rightarrow" "\u21d2")
("circ" "\u2218")
("alpha" "α")
("theta" "θ")
("tau" "τ")
("beta" "β")
("vartheta" "ϑ")
("pi" "π")
("upsilon" "υ")
("gamma" "γ")
("varpi" "ϖ")
("phi" "φ")
("delta" "δ")
("kappa" "κ")
("rho" "ρ")
("varphi" "ϕ")
("epsilon" "ϵ")
("lambda" "λ")
("varrho" "ϱ")
("chi" "χ")
("varepsilon" "ε")
("mu" "µ")
("sigma" "σ")
("psi" "ψ")
("zeta" "ζ")
("nu" "ν")
("varsigma" "ς")
("omega" "ω")
("eta" "η")
("xi" "ξ")
("Gamma" "Γ")
("Lambda" "Λ")
("Sigma" "Σ")
("Psi" "Ψ")
("Delta" "∆")
("Xi" "Ξ")
("Upsilon" "Υ")
("Omega" "Ω")
("Theta" "Θ")
("Pi" "Π")
("Phi" "Φ")
("pm" "±")
("cap" "∩")
("diamond" "◇")
("oplus" "⊕")
("mp" "∓")
("cup" "")
("bigtriangleup" "△")
("ominus" "⊖")
("times" "×")
("uplus" "⊎")
("bigtriangledown" "▽")
("otimes" "⊗")
("div" "÷")
("sqcap" "⊓")
("triangleleft" "▹")
("oslash" "⊘")
("ast" "")
("sqcup" "⊔")
("triangleright" "◃")
("odot" "⊙")
("star" "★")
("dagger" "†")
("bullet" "•")
("ddagger" "‡")
("wr" "≀")
("amalg" "⨿")
("leq" "≤")
("geq" "≥")
("equiv" "≡")
("models" "⊨")
("prec" "≺")
("succ" "≻")
("sim" "")
("perp" "⊥")
("preceq" "≼")
("succeq" "≽")
("simeq" "≃")
("ll" "≪")
("gg" "≫")
("asymp" "≍")
("parallel" "∥")
("subset" "⊂")
("supset" "⊃")
("approx" "≈")
("bowtie" "⋈")
("subseteq" "⊆")
("supseteq" "⊇")
("cong" "≌")
("sqsubsetb" "⊏")
("sqsupsetb" "⊐")
("\neq" "̸")
("smile" "⌣")
("sqsubseteq" "⊑")
("sqsupseteq" "⊒")
("doteq" "≐")
("frown" "⌢")
("in" "∈")
("ni" "∋")
("propto" "∝")
("vdash" "⊢")
("dashv" "⊣")))