-
Notifications
You must be signed in to change notification settings - Fork 7
/
Symbols.hs
147 lines (142 loc) · 3.41 KB
/
Symbols.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{-# LANGUAGE OverloadedStrings #-}
module Symbols
( unicodeToLatexMap,
latexToUnicodeMap,
)
where
import Data.Map.Strict (Map, fromList)
import Data.Text (Text, singleton)
-- | Map from Unicode symbols to Latex commands.
unicodeToLatexMap :: Map Char Text
unicodeToLatexMap = fromList symbols
-- | Map from Latex commands to Unicode symbols.
latexToUnicodeMap :: Map Text Text
latexToUnicodeMap = fromList [(y, singleton x) | (x, y) <- symbols]
symbols :: [(Char, Text)]
symbols =
[ ('¬', "\\neg"),
('±', "\\pm"),
('×', "\\times"),
('÷', "\\div"),
('…', "\\dots"),
('ℕ', "\\mathbb{N}"),
('ℚ', "\\mathbb{Q}"),
('ℝ', "\\mathbb{R}"),
('ℤ', "\\mathbb{Z}"),
('ℂ', "\\mathbb{C}"),
('←', "\\leftarrow"),
('↑', "\\uparrow"),
('→', "\\rightarrow"),
('↓', "\\downarrow"),
('↔', "\\leftrightarrow"),
('⇐', "\\Leftarrow"),
('⇒', "\\Rightarrow"),
('⇔', "\\Leftrightarrow"),
('↦', "\\mapsto"),
('∀', "\\forall"),
('∃', "\\exists"),
('∅', "\\emptyset"),
('∈', "\\in"),
('∉', "\\notin"),
('∋', "\\ni"),
('∎', "\\blacksquare"),
('∫', "\\int"),
('∑', "\\sum"),
('√', "\\sqrt"),
('∂', "\\partial"),
('∓', "\\mp"),
('∗', "\\ast"),
('∘', "\\circ"),
('∙', "\\bullet"),
('∝', "\\propto"),
('∞', "\\infty"),
('∥', "\\parallel"),
('∡', "\\measuredangle"),
('∧', "\\land"),
('∨', "\\lor"),
('∩', "\\cap"),
('∪', "\\cup"),
('⌈', "\\lceil"),
('⌉', "\\rceil"),
('⌊', "\\lfloor"),
('⌋', "\\rfloor"),
('⟨', "\\langle"),
('⟩', "\\rangle"),
('∴', "\\therefore"),
('∵', "\\because"),
('≈', "\\approx"),
('≠', "\\neq"),
('≡', "\\equiv"),
('≤', "\\leq"),
('≥', "\\geq"),
('⊂', "\\subset"),
('⊃', "\\supset"),
('⊆', "\\subseteq"),
('⊇', "\\supseteq"),
('⊢', "\\vdash"),
('⊤', "\\top"),
('⊥', "\\bot"),
('⊨', "\\vDash"),
('⋅', "\\cdot"),
('⋮', "\\vdots"),
('⋯', "\\cdots"),
('ℵ', "\\aleph"),
('α', "\\alpha"),
('Α', "A"),
('β', "\\beta"),
('Β', "B"),
('γ', "\\gamma"),
('Γ', "\\Gamma"),
('δ', "\\delta"),
('Δ', "\\Delta"),
('ε', "\\varepsilon"),
('ϵ', "\\epsilon"),
('Ε', "E"),
('ζ', "\\zeta"),
('Ζ', "Z"),
('η', "\\eta"),
('Η', "H"),
('θ', "\\theta"),
('ϑ', "\\vartheta"),
('Θ', "\\Theta"),
('ι', "\\iota"),
('Ι', "I"),
('κ', "\\kappa"),
('ϰ', "\\varkappa"),
('Κ', "K"),
('λ', "\\lambda"),
('Λ', "\\Lambda"),
('μ', "\\mu"),
('Μ', "M"),
('∇', "\\nabla"),
('ν', "\\nu"),
('Ν', "N"),
('ξ', "\\xi"),
('Ξ', "\\Xi"),
('ο', "o"),
('Ο', "O"),
('π', "\\pi"),
('Π', "\\Pi"),
('ρ', "\\rho"),
('ϱ', "\\varrho"),
('Ρ', "P"),
('σ', "\\sigma"),
('ς', "\\varsigma"),
('Σ', "\\Sigma"),
('τ', "\\tau"),
('Τ', "T"),
('υ', "\\upsilon"),
('Υ', "\\Upsilon"),
('φ', "\\varphi"),
('ϕ', "\\phi"),
('Φ', "\\Phi"),
('χ', "\\chi"),
('Χ', "X"),
('ψ', "\\psi"),
('Ψ', "\\Psi"),
('ω', "\\omega"),
-- Do not switch order of the two "\\Omega" entries! The /last/ one is used
-- in latexToUnicodeMap, which is what we want.
('Ω', "\\Omega"),
('Ω', "\\Omega")
]