TeX lish

jbr May 2009 - I recently needed to place some exotic characters in an interface I have written. I wanted a fairly general purpose way of including various things. Since I'm a long time TeX user I am familiar with its notation. I found this very nice file containing the unicode translations [L1 ] and edited it to remove tcl special characters and comments. There is a little code at the bottom to facilitate mappings:

 array set texlish {
        α alpha ι iota          ϱ varrho
        β beta          κ kappa σ sigma
        γ gamma λ lambda        ς varsigma
        δ delta μ mu            τ tau
        ϵ epsilon       ν nu            υ upsilon
        ε varepsilon    ξ xi            ϕ phi
        ζ zeta          ο o             φ varphi
        η eta           π pi            χ chi
        θ theta ϖ varpi ψ psi
        ϑ vartheta      ρ rho           ω omega
        Γ Gamma Ξ Xi            Φ Phi
        Δ Delta Π Pi            Ψ Psi
        Θ Theta Σ Sigma Ω Omega
        Λ Lambda        Υ Upsilon
        ℵ aleph ′ prime         ∀ forall
        ℏ hbar          ∅ emptyset      ∃ exists
        ı imath ∇ nabla ¬ neg
        j jmath         √ surd          ♭ flat
        ℓ ell           ⊤ top           ♮ natural
        ℘ wp            ⊥ bot           ♯ sharp
        ℜ Re            ∥ |             ♣ clubsuit
        ℑ Im            ∠ angle ♢ diamondsuit
        ∂ partial       △ triangle      ♡ heartsuit
        ∞ infty         ♠ spadesuit
        □ Box           ◇ Diamond
        ∑ sum           ⋂ bigcap        ⨀ bigodot
        ∏ prod          ⋃ bigcup        ⨂ bigotimes
        ∐ coprod        ⨆ bigsqcup      ⨁ bigoplus
        ∫ int           ⋁ bigvee        ⨄ biguplus
        ∮ oint          ⋀ bigwedge
        ± pm            ∩ cap              ∨ vee
        ∓ mp            ∪ cup              ∧ wedge
        ∖ setminus      ⊎ uplus    ⊕ oplus
        ⋅ cdot          ⊓ sqcap    ⊖ ominus
        × times ⊔ sqcup    ⊗ otimes
        ∗ ast           ◁ triangleleft     ⊘ oslash
        ⋆ star          ▷ triangleright   ⊙ odot
        ⋄ diamond       ≀ wr               † dagger
        ∘ circ          ◯ bigcirc          ‡ ddagger
        ∙ bullet        △ bigtriangleup   ⨿ amalg
        ÷ div           ▽ bigtriangledown ⊴ unlhd
        ⊲ lhd           ⊳ rhd              ⊵ unrhd
        ≤ leq           ≥ geq           ≡ equiv
        ≺ prec          ≻ succ          ∼ sim
        ≼ preceq        ≽ succeq        ≃ simeq
        ≪ ll            ≫ gg            ≍ asymp
        ⊂ subset        ⊃ supset        ≈ approx
        ⊆ subseteq      ⊇ supseteq      ≅ cong
        ⊑ sqsubseteq    ⊒ sqsupseteq    ⋈ bowtie
        ∈ in            ∋ ni            ∝ propto
        ⊢ vdash ⊣ dashv ⊨ models
        ⌣ smile ∣ mid           ≐ doteq
        ⌢ frown ∥ parallel      ⊥ perp
        ⊏ sqsubset      ⊐ sqsupset      ⨝ Join
        ≮ not<            ≯ not>            ≠ not=
        ≰ notleq          ≱ notgeq          ≢ notequiv
        ⊀ notprec         ⊁ notsucc         ≁ notsim
        ⋠ notpreceq       ⋡ notsucceq       ≄ notsimeq
        ⊄ notsubset       ⊅ notsupset       ≉ notapprox
        ⊈ notsubseteq     ⊉ notsupseteq   ≇ notcong
        ⋢ notsqsubseteq ⋣ notsqsupseteq ≭ notasymp
        ← leftarrow           ⟵  longleftarrow          ↑ uparrow
        ⇐ Leftarrow           ⟸  Longleftarrow          ⇑ Uparrow
        → rightarrow          ⟶  longrightarrow ↓ downarrow
        ⇒ Rightarrow          ⟹  Longrightarrow ⇓ Downarrow
        ↔ leftrightarrow     ⟷  longleftrightarrow      ↕ updownarrow
        ⇔ Leftrightarrow     ⟺  Longleftrightarrow      ⇕ Updownarrow
        ↦ mapsto              ⟼  longmapsto             ↗ nearrow
        ↩ hookleftarrow      ↪ hookrightarrow           ↘ searrow
        ↼ leftharpoonup      ⇀ rightharpoonup           ↙ swarrow
        ↽ leftharpoondown    ⇁ rightharpoondown ↖ nwarrow
        ⇌ rightleftharpoons  ↝ leadsto
        [ lbrack        ⌊ lfloor        ⌈ lceil ⟦ [![
        \{ lbrace       ⟨ langle        ⟪ langle!langle
        ] rbrack        ⌋ rfloor        ⌉ rceil ⟧ ]!]
        \} rbrace       ⟩ rangle        ⟫ rangle!rangle
        ≠ ne or neq
        ≤ le
        ≥ ge
        → to
        ← gets
        ∋ owns
        ∧ land
        ∨ lor
        ¬ lnot
        ∣ vert
        ∥ Vert
        ⋮ vdots
        ⋯ cdots
        ⋱ ddots
        ’ '
        ‘ `
        ” ''
        “ ``
        ‐ -
        – --
        — ---
        − $-$
        ′ $'$
        ″ $''$
        ‴ $'''$
        ⁗ $''''$
        ff ff
        fi fi
        fl fl
        ffi ffi
        ffl ffl
        ¡ !`
        ¿ ?`
        œ oe
        Œ OE
        æ ae
        Æ AE
        å aa
        Å AA
        ø o
        Ø O
        ł l
        Ł L
        ß ss
        § S
        ¶ P
        † dag
        ‡ ddag
        © copyright
        £ pounds
        … ldots
        ◌́  '
        ◌̀  `
        ◌̂  ^
        ◌̈  \"
        ◌̃  ~
        ◌̄  =
        ◌̇  .
        ◌̆  u
        ◌̌  v
        ◌̋  H
        ◌͡  t
        ◌̧  c
        ◌̣  d
        ◌̱  b
 }


 proc arraymap { A string { char % } } {
    upvar $A a

    set map {}
    foreach { to from } [array get a] { lappend map $char$from $to }

    string map $map $string
 }


 puts [arraymap texlish "alpha %alpha"]