|
27 | 27 | <h1>MathLive Test Cases</h1>
|
28 | 28 | </header>
|
29 | 29 | <main>
|
30 |
| - <div class="mathfield" id="mf">\sqrt{\smash[b]{\frac{a}{b}}}</div> |
31 |
| - <!-- \ce{ H2O } --> |
32 |
| - <!-- \ce{ CrO4^2- } \ce{ ^{227}_{90}Th+ } \ce{ {}^{227}_{90}Th+ } \ce{ KCr(SO4)2.12H2O } \ce{ C6H5-CHO } \ce{ X=Y#Z } \ce{ A\sbond B\dbond C\tbond D } \ce{ A\bond{-}B\bond{=}C\bond{#}D } \ce{ A\bond{~}B\bond{~-}C } --> |
33 |
| - <!-- \ce{ $x\,$ Na(NH4)HPO4 ->[\Delta](NaPO3)_{$x$} + $x\,$ NH3 ^ + $x\,$ H2O } --> |
34 |
| - <!-- \ce{ CO2 + C -> 2CO } --> |
35 |
| - <!-- \ce{ CO2 + C <=> 2CO } --> |
36 |
| - <!-- \ce{ H+ + OH- <=>> H2O } --> |
37 |
| - <!-- \ce{ CO2 + C ->[\alpha][\beta] 2CO } --> |
38 |
| - <!-- \ce{ $A$ ->C[+H2O] $B$ } --> |
39 |
| - <!-- \ce{ SO4^2- + Ba^2+ -> BaSO4 v } --> |
40 |
| - <!-- \ce{ Zn^2+ <=>[\ce{+ 2OH-}][\ce{+ 2H+}]$\underset{\text{amphoteric hydroxide}}{\ce{Zn(OH)2 v}}$<=>C[+2OH-][{+ 2H+}]$\underset{\text{tetrahydroxozincate}}{\cf{[Zn(OH)4]^2-}}$ } --> |
41 |
| - <!-- \ce{ Hg^2+ ->[\ce{I-}]$\underset{\mathrm{red}}{\ce{HgI2}}$->C[I-]$\underset{\mathrm{red}}{\ce{[Hg^{II}I4]^2-}}$ } --> |
| 30 | + <div class="mathfield" id="mf">\sqrt</div> |
42 | 31 | <!-- (x,,2) -->
|
43 | 32 | <!-- -123, 456.789, -->
|
44 | 33 | <!-- x_5 -->
|
@@ -98,6 +87,86 @@ <h1>Examples</h1>
|
98 | 87 |
|
99 | 88 | // prettier-ignore
|
100 | 89 | const TESTING_SAMPLES = [
|
| 90 | + { |
| 91 | + title: 'Chemistry', |
| 92 | + latex: '\\ce{ CrO4^2- }' |
| 93 | + }, |
| 94 | + { |
| 95 | + title: 'Chemistry', |
| 96 | + latex: '\\ce{ CrO4^2-}' |
| 97 | + }, |
| 98 | + { |
| 99 | + title: 'Chemistry', |
| 100 | + latex: '\\ce{^{227}_{90}Th+ }' |
| 101 | + }, |
| 102 | + { |
| 103 | + title: 'Chemistry', |
| 104 | + latex: '\\ce{ {}^{227}_{90}Th+ }' |
| 105 | + }, |
| 106 | + { |
| 107 | + title: 'Chemistry', |
| 108 | + latex: '\\ce{ KCr(SO4)2.12H2O }' |
| 109 | + }, |
| 110 | + { |
| 111 | + title: 'Chemistry', |
| 112 | + latex: '\\ce{ C6H5-CHO}' |
| 113 | + }, |
| 114 | + { |
| 115 | + title: 'Chemistry', |
| 116 | + latex: '\\ce{X=Y#Z }' |
| 117 | + }, |
| 118 | + { |
| 119 | + title: 'Chemistry', |
| 120 | + latex: '\\ce{A\\sbond B\\dbond C\\tbond D }' |
| 121 | + }, |
| 122 | + { |
| 123 | + title: 'Chemistry', |
| 124 | + latex: '\\ce{ A\\bond{-}B\\bond{=}C\\bond{#}D}' |
| 125 | + }, |
| 126 | + // { |
| 127 | + // title: 'Chemistry', |
| 128 | + // latex: '\\ce{ A\\bond{~}B\\bond{~-}C}' |
| 129 | + // }, |
| 130 | + { |
| 131 | + title: 'Chemistry', |
| 132 | + latex: '\\ce{$x\\,$ Na(NH4)HPO4 ->[\\Delta](NaPO3)_{$x$} + $x\\,$ NH3 ^ + $x\\,$ H2O }' |
| 133 | + }, |
| 134 | + { |
| 135 | + title: 'Chemistry', |
| 136 | + latex: '\\ce{ CO2 + C -> 2CO}' |
| 137 | + }, |
| 138 | + { |
| 139 | + title: 'Chemistry', |
| 140 | + latex: '\\ce{CO2 + C <=> 2CO }' |
| 141 | + }, |
| 142 | + { |
| 143 | + title: 'Chemistry', |
| 144 | + latex: '\\ce{H+ + OH- <=>> H2O }' |
| 145 | + }, |
| 146 | + { |
| 147 | + title: 'Chemistry', |
| 148 | + latex: '\\ce{ CO2 + C ->[\\alpha][\\beta] 2CO } ' |
| 149 | + }, |
| 150 | + { |
| 151 | + title: 'Chemistry', |
| 152 | + latex: '\\ce{ $A$ ->C[+H2O] $B$ } ' |
| 153 | + }, |
| 154 | + { |
| 155 | + title: 'Chemistry', |
| 156 | + latex: '\\ce{ SO4^2- + Ba^2+ -> BaSO4 v } ' |
| 157 | + }, |
| 158 | + { |
| 159 | + title: 'Chemistry', |
| 160 | + latex: '\\ce{ Zn^2+ <=>[\\ce{+ 2OH-}][\\ce{+ 2H+}]$\\underset{\\text{amphoteric hydroxide}}{\\ce{Zn(OH)2 v}}$<=>C[+2OH-][{+ 2H+}]$\\underset{\\text{tetrahydroxozincate}}{\\ce{[Zn(OH)4]^2-}}$ }' |
| 161 | + }, |
| 162 | + { |
| 163 | + title: 'Chemistry', |
| 164 | + latex: '\\ce{ Hg^2+ ->[\\ce{I-}]$\\underset{\\mathrm{red}}{\\ce{HgI2}}$->C[I-]$\\underset{\\mathrm{red}}{\\ce{[Hg^{II}I4]^2-}}$ } ' |
| 165 | + }, |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
101 | 170 | {
|
102 | 171 | title: 'Ordinary Symbols and letterShapeStyle',
|
103 | 172 | id: 'ordinary-1',
|
@@ -1256,12 +1325,12 @@ <h1>Examples</h1>
|
1256 | 1325 | });
|
1257 | 1326 | updateContent(mf);
|
1258 | 1327 | }
|
1259 |
| - // MathLive.renderMathInDocument({ |
1260 |
| - // onError: (err) => { |
1261 |
| - // console.error(err.latex, err.code + ' ' + (err.arg ?? '')); |
1262 |
| - // }, |
1263 |
| - // }); |
1264 |
| - if (false) { |
| 1328 | + MathLive.renderMathInDocument({ |
| 1329 | + onError: (err) => { |
| 1330 | + console.error(err.latex, err.code + ' ' + (err.arg ?? '')); |
| 1331 | + }, |
| 1332 | + }); |
| 1333 | + if (true) { |
1265 | 1334 | let error = [];
|
1266 | 1335 | let savedMathfieldContent;
|
1267 | 1336 | if (mf) {
|
|
0 commit comments