plurimath 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +13 -0
- data/.github/workflows/release.yml +22 -0
- data/.hound.yml +5 -0
- data/.rubocop.yml +8 -0
- data/AsciiMath-Supported-Data.adoc +1994 -274
- data/Gemfile +2 -0
- data/Latex-Supported-Data.adoc +1875 -1868
- data/MathML-Supported-Data.adoc +280 -263
- data/README.adoc +22 -20
- data/lib/plurimath/asciimath/constants.rb +187 -141
- data/lib/plurimath/asciimath/parse.rb +104 -39
- data/lib/plurimath/asciimath/parser.rb +3 -1
- data/lib/plurimath/asciimath/transform.rb +1074 -238
- data/lib/plurimath/html/parse.rb +1 -1
- data/lib/plurimath/latex/constants.rb +3229 -1432
- data/lib/plurimath/latex/parse.rb +108 -85
- data/lib/plurimath/latex/parser.rb +11 -4
- data/lib/plurimath/latex/transform.rb +354 -99
- data/lib/plurimath/math/base.rb +15 -0
- data/lib/plurimath/math/formula.rb +90 -13
- data/lib/plurimath/math/function/bar.rb +35 -1
- data/lib/plurimath/math/function/base.rb +25 -4
- data/lib/plurimath/math/function/binary_function.rb +101 -19
- data/lib/plurimath/math/function/cancel.rb +8 -0
- data/lib/plurimath/math/function/ceil.rb +3 -0
- data/lib/plurimath/math/function/color.rb +15 -5
- data/lib/plurimath/math/function/f.rb +8 -0
- data/lib/plurimath/math/function/fenced.rb +95 -8
- data/lib/plurimath/math/function/floor.rb +15 -0
- data/lib/plurimath/math/function/font_style/bold.rb +19 -0
- data/lib/plurimath/math/function/font_style/double_struck.rb +19 -0
- data/lib/plurimath/math/function/font_style/fraktur.rb +19 -0
- data/lib/plurimath/math/function/font_style/italic.rb +37 -0
- data/lib/plurimath/math/function/font_style/monospace.rb +19 -0
- data/lib/plurimath/math/function/font_style/normal.rb +37 -0
- data/lib/plurimath/math/function/font_style/sans-serif.rb +19 -0
- data/lib/plurimath/math/function/font_style/script.rb +19 -0
- data/lib/plurimath/math/function/font_style.rb +18 -5
- data/lib/plurimath/math/function/frac.rb +33 -3
- data/lib/plurimath/math/function/g.rb +7 -0
- data/lib/plurimath/math/function/hat.rb +12 -0
- data/lib/plurimath/math/function/inf.rb +21 -0
- data/lib/plurimath/math/function/int.rb +23 -2
- data/lib/plurimath/math/function/left.rb +25 -1
- data/lib/plurimath/math/function/lim.rb +40 -2
- data/lib/plurimath/math/function/limits.rb +9 -0
- data/lib/plurimath/math/function/log.rb +55 -4
- data/lib/plurimath/math/function/longdiv.rb +12 -0
- data/lib/plurimath/math/function/mbox.rb +31 -0
- data/lib/plurimath/math/function/menclose.rb +46 -0
- data/lib/plurimath/math/function/merror.rb +12 -0
- data/lib/plurimath/math/function/mod.rb +19 -4
- data/lib/plurimath/math/function/msgroup.rb +37 -0
- data/lib/plurimath/math/function/msline.rb +12 -0
- data/lib/plurimath/math/function/multiscript.rb +19 -0
- data/lib/plurimath/math/function/norm.rb +17 -1
- data/lib/plurimath/math/function/obrace.rb +17 -0
- data/lib/plurimath/math/function/oint.rb +2 -2
- data/lib/plurimath/math/function/over.rb +12 -5
- data/lib/plurimath/math/function/overset.rb +34 -5
- data/lib/plurimath/math/function/phantom.rb +28 -0
- data/lib/plurimath/math/function/power.rb +27 -9
- data/lib/plurimath/math/function/power_base.rb +109 -11
- data/lib/plurimath/math/function/prod.rb +25 -4
- data/lib/plurimath/math/function/right.rb +22 -2
- data/lib/plurimath/math/function/root.rb +23 -1
- data/lib/plurimath/math/function/rule.rb +33 -0
- data/lib/plurimath/math/function/scarries.rb +12 -0
- data/lib/plurimath/math/function/scarry.rb +12 -0
- data/lib/plurimath/math/function/sqrt.rb +23 -1
- data/lib/plurimath/math/function/stackrel.rb +27 -0
- data/lib/plurimath/math/function/substack.rb +7 -0
- data/lib/plurimath/math/function/sum.rb +50 -2
- data/lib/plurimath/math/function/sup.rb +3 -0
- data/lib/plurimath/math/function/table/align.rb +5 -5
- data/lib/plurimath/math/function/table/array.rb +25 -6
- data/lib/plurimath/math/function/table/bmatrix.rb +18 -7
- data/lib/plurimath/math/function/table/matrix.rb +13 -5
- data/lib/plurimath/math/function/table/multline.rb +5 -5
- data/lib/plurimath/math/function/table/pmatrix.rb +5 -5
- data/lib/plurimath/math/function/table/split.rb +5 -5
- data/lib/plurimath/math/function/table/vmatrix.rb +5 -6
- data/lib/plurimath/math/function/table.rb +185 -27
- data/lib/plurimath/math/function/td.rb +22 -9
- data/lib/plurimath/math/function/ternary_function.rb +74 -9
- data/lib/plurimath/math/function/text.rb +36 -11
- data/lib/plurimath/math/function/tr.rb +23 -4
- data/lib/plurimath/math/function/ubrace.rb +17 -0
- data/lib/plurimath/math/function/ul.rb +29 -0
- data/lib/plurimath/math/function/unary_function.rb +81 -8
- data/lib/plurimath/math/function/underline.rb +12 -0
- data/lib/plurimath/math/function/underover.rb +107 -0
- data/lib/plurimath/math/function/underset.rb +39 -0
- data/lib/plurimath/math/function/vec.rb +7 -1
- data/lib/plurimath/math/number.rb +5 -5
- data/lib/plurimath/math/symbol.rb +51 -12
- data/lib/plurimath/math/unicode.rb +11 -0
- data/lib/plurimath/math.rb +7 -3
- data/lib/plurimath/mathml/constants.rb +224 -147
- data/lib/plurimath/mathml/parser.rb +24 -8
- data/lib/plurimath/mathml/transform.rb +249 -153
- data/lib/plurimath/omml/parser.rb +24 -4
- data/lib/plurimath/omml/transform.rb +219 -157
- data/lib/plurimath/utility.rb +342 -20
- data/lib/plurimath/version.rb +1 -1
- metadata +21 -6
- data/.github/workflows/test.yml +0 -33
- data/lib/plurimath/mathml/parse.rb +0 -68
- data/lib/plurimath/omml/constants.rb +0 -154
data/MathML-Supported-Data.adoc
CHANGED
@@ -1,270 +1,287 @@
|
|
1
|
-
|
1
|
+
== MathML Support
|
2
|
+
|
3
|
+
== Classes
|
4
|
+
|
5
|
+
=== Fonts
|
6
|
+
|
7
|
+
* `double-struck`
|
8
|
+
* `sans-serif`
|
9
|
+
* `monospace`
|
10
|
+
* `fraktur`
|
11
|
+
* `script`
|
12
|
+
* `bold`
|
13
|
+
|
14
|
+
=== Functions
|
15
|
+
|
16
|
+
* `stackrel`
|
17
|
+
* `underset`
|
18
|
+
* `mathfrak`
|
19
|
+
* `mathcal`
|
20
|
+
* `overset`
|
21
|
+
* `cancel`
|
22
|
+
* `obrace`
|
23
|
+
* `ubrace`
|
24
|
+
* `mathtt`
|
25
|
+
* `mathbf`
|
26
|
+
* `mathbb`
|
27
|
+
* `mathsf`
|
28
|
+
* `arctan`
|
29
|
+
* `arcsin`
|
30
|
+
* `arccos`
|
31
|
+
* `color`
|
32
|
+
* `floor`
|
33
|
+
* `tilde`
|
34
|
+
* `prod`
|
35
|
+
* `text`
|
36
|
+
* `norm`
|
37
|
+
* `sqrt`
|
38
|
+
* `cosh`
|
39
|
+
* `tanh`
|
40
|
+
* `sinh`
|
41
|
+
* `sech`
|
42
|
+
* `csch`
|
43
|
+
* `coth`
|
44
|
+
* `ddot`
|
45
|
+
* `ceil`
|
46
|
+
* `oint`
|
47
|
+
* `root`
|
48
|
+
* `frac`
|
49
|
+
* `log`
|
50
|
+
* `mod`
|
51
|
+
* `vec`
|
52
|
+
* `hat`
|
53
|
+
* `dot`
|
54
|
+
* `bar`
|
55
|
+
* `abs`
|
56
|
+
* `min`
|
57
|
+
* `max`
|
58
|
+
* `dim`
|
59
|
+
* `det`
|
60
|
+
* `csc`
|
61
|
+
* `cot`
|
62
|
+
* `lub`
|
63
|
+
* `lcm`
|
64
|
+
* `glb`
|
65
|
+
* `gcd`
|
66
|
+
* `exp`
|
67
|
+
* `sum`
|
68
|
+
* `cos`
|
69
|
+
* `tan`
|
70
|
+
* `sin`
|
71
|
+
* `int`
|
72
|
+
* `sec`
|
73
|
+
* `ln`
|
74
|
+
* `ul`
|
75
|
+
* `g`
|
76
|
+
* `f`
|
2
77
|
|
3
|
-
==== Classes
|
4
|
-
|===
|
5
|
-
| Functions | Fonts
|
6
78
|
|
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
|
-
| cot |
|
53
|
-
| lub |
|
54
|
-
| lcm |
|
55
|
-
| glb |
|
56
|
-
| gcd |
|
57
|
-
| exp |
|
58
|
-
| sum |
|
59
|
-
| cos |
|
60
|
-
| tan |
|
61
|
-
| sin |
|
62
|
-
| int |
|
63
|
-
| sec |
|
64
|
-
| ln |
|
65
|
-
| ul |
|
66
|
-
| g |
|
67
|
-
| f |
|
79
|
+
=== Tags
|
80
|
+
|
81
|
+
* `annotation_xml`
|
82
|
+
* `annotation-xml`
|
83
|
+
* `mmultiscripts`
|
84
|
+
* `maligngroup`
|
85
|
+
* `munderover`
|
86
|
+
* `annotation`
|
87
|
+
* `malignmark`
|
88
|
+
* `semantics`
|
89
|
+
* `mscarries`
|
90
|
+
* `menclose`
|
91
|
+
* `mlongdiv`
|
92
|
+
* `mphantom`
|
93
|
+
* `mfenced`
|
94
|
+
* `msgroup`
|
95
|
+
* `maction`
|
96
|
+
* `mpadded`
|
97
|
+
* `msubsup`
|
98
|
+
* `mscarry`
|
99
|
+
* `msline`
|
100
|
+
* `mspace`
|
101
|
+
* `mstack`
|
102
|
+
* `mstyle`
|
103
|
+
* `mtable`
|
104
|
+
* `munder`
|
105
|
+
* `merror`
|
106
|
+
* `msqrt`
|
107
|
+
* `mroot`
|
108
|
+
* `msrow`
|
109
|
+
* `mover`
|
110
|
+
* `mfrac`
|
111
|
+
* `math`
|
112
|
+
* `mrow`
|
113
|
+
* `msub`
|
114
|
+
* `msup`
|
115
|
+
* `mtd`
|
116
|
+
* `mtr`
|
117
|
+
* `mn`
|
118
|
+
* `mo`
|
119
|
+
* `mi`
|
120
|
+
* `ms`
|
121
|
+
|
122
|
+
=== Unicode symbols
|
123
|
+
|
68
124
|
|===
|
125
|
+
| Symbol code | Rendered symbol
|
69
126
|
|
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
|
-
|
127
|
+
| `\α` | α
|
128
|
+
| `\β` | β
|
129
|
+
| `\γ` | γ
|
130
|
+
| `\Γ` | Γ
|
131
|
+
| `\δ` | δ
|
132
|
+
| `\Δ` | Δ
|
133
|
+
| `\∆` | ∆
|
134
|
+
| `\ε` | ε
|
135
|
+
| `\ɛ` | ɛ
|
136
|
+
| `\ζ` | ζ
|
137
|
+
| `\η` | η
|
138
|
+
| `\θ` | θ
|
139
|
+
| `\Θ` | Θ
|
140
|
+
| `\ϑ` | ϑ
|
141
|
+
| `\ι` | ι
|
142
|
+
| `\κ` | κ
|
143
|
+
| `\λ` | λ
|
144
|
+
| `\Λ` | Λ
|
145
|
+
| `\μ` | μ
|
146
|
+
| `\ν` | ν
|
147
|
+
| `\ξ` | ξ
|
148
|
+
| `\Ξ` | Ξ
|
149
|
+
| `\π` | π
|
150
|
+
| `\Π` | Π
|
151
|
+
| `\ρ` | ρ
|
152
|
+
| `\ς` | ς
|
153
|
+
| `\σ` | σ
|
154
|
+
| `\Σ` | Σ
|
155
|
+
| `\τ` | τ
|
156
|
+
| `\υ` | υ
|
157
|
+
| `\φ` | φ
|
158
|
+
| `\Φ` | Φ
|
159
|
+
| `\ϕ` | ϕ
|
160
|
+
| `\χ` | χ
|
161
|
+
| `\ψ` | ψ
|
162
|
+
| `\Ψ` | Ψ
|
163
|
+
| `\ω` | ω
|
164
|
+
| `\Ω` | Ω
|
165
|
+
| `\⋅` | ⋅
|
166
|
+
| `\∙` | ∙
|
167
|
+
| `\·` | ·
|
168
|
+
| `\∗` | ∗
|
169
|
+
| `\⋆` | ⋆
|
170
|
+
| `\×` | ×
|
171
|
+
| `\⋉` | ⋉
|
172
|
+
| `\⋊` | ⋊
|
173
|
+
| `\⋈` | ⋈
|
174
|
+
| `\÷` | ÷
|
175
|
+
| `\∘` | ∘
|
176
|
+
| `\⊕` | ⊕
|
177
|
+
| `\⨁` | ⨁
|
178
|
+
| `\⊗` | ⊗
|
179
|
+
| `\⊙` | ⊙
|
180
|
+
| `\∑` | ∑
|
181
|
+
| `\∏` | ∏
|
182
|
+
| `\∏` | ∏
|
183
|
+
| `\∧` | ∧
|
184
|
+
| `\⋀` | ⋀
|
185
|
+
| `\∨` | ∨
|
186
|
+
| `\⋁` | ⋁
|
187
|
+
| `\∩` | ∩
|
188
|
+
| `\⋂` | ⋂
|
189
|
+
| `\∪` | ∪
|
190
|
+
| `\⋃` | ⋃
|
191
|
+
| `\≠` | ≠
|
192
|
+
| `\≤` | ≤
|
193
|
+
| `\≥` | ≥
|
194
|
+
| `\≺` | ≺
|
195
|
+
| `\≻` | ≻
|
196
|
+
| `\⪯` | ⪯
|
197
|
+
| `\⪰` | ⪰
|
198
|
+
| `\∈` | ∈
|
199
|
+
| `\∉` | ∉
|
200
|
+
| `\⊂` | ⊂
|
201
|
+
| `\⊃` | ⊃
|
202
|
+
| `\⊆` | ⊆
|
203
|
+
| `\⊇` | ⊇
|
204
|
+
| `\≡` | ≡
|
205
|
+
| `\≅` | ≅
|
206
|
+
| `\≈` | ≈
|
207
|
+
| `\∝` | ∝
|
208
|
+
| `\¬` | ¬
|
209
|
+
| `\∀` | ∀
|
210
|
+
| `\∃` | ∃
|
211
|
+
| `\⊥` | ⊥
|
212
|
+
| `\⊤` | ⊤
|
213
|
+
| `\⊢` | ⊢
|
214
|
+
| `\⊨` | ⊨
|
215
|
+
| `\〈` | 〈
|
216
|
+
| `\〉` | 〉
|
217
|
+
| `\⟨` | ⟨
|
218
|
+
| `\⟩` | ⟩
|
219
|
+
| `\∫` | ∫
|
220
|
+
| `\∮` | ∮
|
221
|
+
| `\∂` | ∂
|
222
|
+
| `\∇` | ∇
|
223
|
+
| `\±` | ±
|
224
|
+
| `\∅` | ∅
|
225
|
+
| `\∞` | ∞
|
226
|
+
| `\ℵ` | ℵ
|
227
|
+
| `\∴` | ∴
|
228
|
+
| `\∵` | ∵
|
229
|
+
| `\∠` | ∠
|
230
|
+
| `\△` | △
|
231
|
+
| `\′` | ′
|
232
|
+
| `\ \ ` |   
|
233
|
+
| `\ \ \ \ ` |     
|
234
|
+
| `\⌢` | ⌢
|
235
|
+
| `\⋯` | ⋯
|
236
|
+
| `\⋮` | ⋮
|
237
|
+
| `\⋱` | ⋱
|
238
|
+
| `\⋄` | ⋄
|
239
|
+
| `\□` | □
|
240
|
+
| `\⌊` | ⌊
|
241
|
+
| `\⌋` | ⌋
|
242
|
+
| `\⌈` | ⌈
|
243
|
+
| `\⌉` | ⌉
|
244
|
+
| `\ℂ` | ℂ
|
245
|
+
| `\ℕ` | ℕ
|
246
|
+
| `\ℚ` | ℚ
|
247
|
+
| `\ℝ` | ℝ
|
248
|
+
| `\ℤ` | ℤ
|
249
|
+
| `\↑` | ↑
|
250
|
+
| `\↓` | ↓
|
251
|
+
| `\←` | ←
|
252
|
+
| `\↔` | ↔
|
253
|
+
| `\⇒` | ⇒
|
254
|
+
| `\⇐` | ⇐
|
255
|
+
| `\⇔` | ⇔
|
256
|
+
| `\→` | →
|
257
|
+
| `\↣` | ↣
|
258
|
+
| `\↠` | ↠
|
259
|
+
| `\⤖` | ⤖
|
260
|
+
| `\↦` | ↦
|
261
|
+
| `\…` | …
|
262
|
+
| `\−` | −
|
263
|
+
| `\⁡` | ⁡
|
264
|
+
| `\⏞` | ⏞
|
265
|
+
| `\⏟` | ⏟
|
111
266
|
|
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
|
-
** \ψ
|
148
|
-
** \Ψ
|
149
|
-
** \ω
|
150
|
-
** \Ω
|
151
|
-
** \⋅
|
152
|
-
** \∙
|
153
|
-
** \·
|
154
|
-
** \∗
|
155
|
-
** \⋆
|
156
|
-
** \×
|
157
|
-
** \⋉
|
158
|
-
** \⋊
|
159
|
-
** \⋈
|
160
|
-
** \÷
|
161
|
-
** \∘
|
162
|
-
** \⊕
|
163
|
-
** \⨁
|
164
|
-
** \⊗
|
165
|
-
** \⊙
|
166
|
-
** \∑
|
167
|
-
** \∏
|
168
|
-
** \∏
|
169
|
-
** \∧
|
170
|
-
** \⋀
|
171
|
-
** \∨
|
172
|
-
** \⋁
|
173
|
-
** \∩
|
174
|
-
** \⋂
|
175
|
-
** \∪
|
176
|
-
** \⋃
|
177
|
-
** \≠
|
178
|
-
** \≤
|
179
|
-
** \≥
|
180
|
-
** \≺
|
181
|
-
** \≻
|
182
|
-
** \⪯
|
183
|
-
** \⪰
|
184
|
-
** \∈
|
185
|
-
** \∉
|
186
|
-
** \⊂
|
187
|
-
** \⊃
|
188
|
-
** \⊆
|
189
|
-
** \⊇
|
190
|
-
** \≡
|
191
|
-
** \≅
|
192
|
-
** \≈
|
193
|
-
** \∝
|
194
|
-
** \¬
|
195
|
-
** \∀
|
196
|
-
** \∃
|
197
|
-
** \⊥
|
198
|
-
** \⊤
|
199
|
-
** \⊢
|
200
|
-
** \⊨
|
201
|
-
** \〈
|
202
|
-
** \〉
|
203
|
-
** \⟨
|
204
|
-
** \⟩
|
205
|
-
** \∫
|
206
|
-
** \∮
|
207
|
-
** \∂
|
208
|
-
** \∇
|
209
|
-
** \±
|
210
|
-
** \∅
|
211
|
-
** \∞
|
212
|
-
** \ℵ
|
213
|
-
** \∴
|
214
|
-
** \∵
|
215
|
-
** \∠
|
216
|
-
** \△
|
217
|
-
** \′
|
218
|
-
** \  
|
219
|
-
** \    
|
220
|
-
** \⌢
|
221
|
-
** \⋯
|
222
|
-
** \⋮
|
223
|
-
** \⋱
|
224
|
-
** \⋄
|
225
|
-
** \□
|
226
|
-
** \⌊
|
227
|
-
** \⌋
|
228
|
-
** \⌈
|
229
|
-
** \⌉
|
230
|
-
** \ℂ
|
231
|
-
** \ℕ
|
232
|
-
** \ℚ
|
233
|
-
** \ℝ
|
234
|
-
** \ℤ
|
235
|
-
** \↑
|
236
|
-
** \↓
|
237
|
-
** \←
|
238
|
-
** \↔
|
239
|
-
** \⇒
|
240
|
-
** \⇐
|
241
|
-
** \⇔
|
242
|
-
** \→
|
243
|
-
** \↣
|
244
|
-
** \↠
|
245
|
-
** \⤖
|
246
|
-
** \↦
|
247
|
-
** \…
|
248
|
-
** \−
|
249
|
-
** \⁡
|
250
|
-
** \⏞
|
251
|
-
** \⏟
|
267
|
+
|===
|
252
268
|
|
253
269
|
=== Symbols
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
270
|
+
|
271
|
+
* `|`
|
272
|
+
* `/`
|
273
|
+
* `\`
|
274
|
+
* `~`
|
275
|
+
* `(`
|
276
|
+
* `)`
|
277
|
+
* `(:`
|
278
|
+
* `:)`
|
279
|
+
* `{`
|
280
|
+
* `}`
|
281
|
+
* `{:`
|
282
|
+
* `:}`
|
283
|
+
* `]`
|
284
|
+
* `[`
|
285
|
+
* `=`
|
286
|
+
* `+`
|
287
|
+
* `-`
|
data/README.adoc
CHANGED
@@ -15,28 +15,27 @@ gem "plurimath"
|
|
15
15
|
```
|
16
16
|
And then execute:
|
17
17
|
```shell
|
18
|
-
|
19
|
-
$ bundle install
|
18
|
+
$ bundle install
|
20
19
|
```
|
21
20
|
Or install it yourself as:
|
22
21
|
```shell
|
23
|
-
|
22
|
+
$ gem install plurimath
|
24
23
|
```
|
25
24
|
|
26
25
|
== Usage
|
27
26
|
|
28
27
|
Pass the string you want to convert and Math type of the string provided, which will give you **Plurimath::Math::Formula** object as output, Let's see some examples below.
|
29
28
|
|
30
|
-
=== Conversion Examples
|
29
|
+
=== *Conversion Examples*
|
31
30
|
|
32
|
-
|
33
|
-
[source, ruby]
|
31
|
+
===== Asciimath Formula Example
|
32
|
+
[source, ruby, indent=2]
|
34
33
|
----
|
35
34
|
asciimath = "sin(1)"
|
36
35
|
formula = Plurimath::Math.parse(asciimath, :asciimath)
|
37
36
|
----
|
38
|
-
|
39
|
-
[source, ruby]
|
37
|
+
===== MathML Formula Example
|
38
|
+
[source, ruby, indent=2]
|
40
39
|
----
|
41
40
|
mathml = <<~MATHML
|
42
41
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
@@ -48,8 +47,8 @@ mathml = <<~MATHML
|
|
48
47
|
MATHML
|
49
48
|
formula = Plurimath::Math.parse(mathml, "mathml")
|
50
49
|
----
|
51
|
-
|
52
|
-
[source, ruby]
|
50
|
+
===== Latex Formula Example
|
51
|
+
[source, ruby, indent=2]
|
53
52
|
----
|
54
53
|
latex = "\\sin{1}"
|
55
54
|
formula = Plurimath::Math.parse(latex, "latex")
|
@@ -57,20 +56,23 @@ formula = Plurimath::Math.parse(latex, "latex")
|
|
57
56
|
---
|
58
57
|
Since we have the object of **Plurimath::Formula**,We can generate **AsciiMath**, **MathMl** or **Latex** string from the formula object,All we have to do is call conversion function on formula object, see examples below.
|
59
58
|
|
60
|
-
|
61
|
-
[source, ruby]
|
59
|
+
===== AsciiMath Output conversion
|
60
|
+
[source, ruby, indent=2]
|
62
61
|
----
|
63
62
|
formula.to_asciimath
|
64
63
|
> sin(1)
|
65
64
|
----
|
66
|
-
|
67
|
-
[
|
65
|
+
*Note:*
|
66
|
+
Asciimath doesn't support link:AsciiMath-Supported-Data.adoc#symbols-inherited-from-latex[*following symbols*] but Latex does.So from Latex to Asciimath conversion we are returning latex's supported symbols if it's not supported in Asciimath.
|
67
|
+
|
68
|
+
===== Latex Output conversion
|
69
|
+
[source, ruby, indent=2]
|
68
70
|
----
|
69
71
|
formula.to_latex
|
70
72
|
> \\sin1
|
71
73
|
----
|
72
|
-
|
73
|
-
[source, ruby]
|
74
|
+
===== MathML Output conversion
|
75
|
+
[source, ruby, indent=2]
|
74
76
|
----
|
75
77
|
formula.to_mathml
|
76
78
|
> <math xmlns='http://www.w3.org/1998/Math/MathML'>
|
@@ -82,13 +84,13 @@ formula.to_mathml
|
|
82
84
|
----
|
83
85
|
=== Supported Content
|
84
86
|
--
|
85
|
-
|
87
|
+
link:AsciiMath-Supported-Data.adoc[AsciiMath Supported Data, target="_blank"]
|
86
88
|
--
|
87
89
|
|
88
90
|
--
|
89
|
-
|
91
|
+
link:MathML-Supported-Data.adoc[MathML Supported Data, target="_blank"]
|
90
92
|
--
|
91
93
|
|
92
94
|
--
|
93
|
-
|
94
|
-
--
|
95
|
+
link:Latex-Supported-Data.adoc[Latex Supported Data, target="_blank"]
|
96
|
+
--
|