@mathzetta/inlinemath 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,8 +60,8 @@ import '@mathzetta/inlinemath/fonts/fonts.css'; // optional: Latin Modern, th
60
60
 
61
61
  ```html
62
62
  <!-- or from the CDN -->
63
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/inlinemath.css">
64
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/fonts/fonts.css"> <!-- optional -->
63
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/inlinemath.css">
64
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/fonts/fonts.css"> <!-- optional -->
65
65
  ```
66
66
 
67
67
  ### Lite: drawing only
@@ -146,8 +146,8 @@ npm run build # dist/ (a few seconds)
146
146
 
147
147
  - **`dist/`** — Inline Math with everything inside, no import map or `node_modules` needed:
148
148
  - `inlinemath.js`, `markdown.js`, `cas.js` — ES modules (shared code in `dist/chunks/`);
149
- - `inlinemath.global.min.js` (183 KB, 62 KB gzipped) — a classic `<script>`: `window.InlineMath`, with Inline Math and the Markdown;
150
- - `inlinemath-cas.global.min.js` (323 KB, 104 KB gzipped) — the same plus the CAS (`InlineMath.mathCAS`, `casBlocks`, `stepsHTML`);
149
+ - `inlinemath.global.min.js` (207 KB, 71 KB gzipped) — a classic `<script>`: `window.InlineMath`, with Inline Math and the Markdown;
150
+ - `inlinemath-cas.global.min.js` (385 KB, 123 KB gzipped) — the same plus the CAS (`InlineMath.mathCAS`, `casBlocks`, `stepsHTML`);
151
151
  - `inlinemath.css` and `fonts/` — put both on the page.
152
152
 
153
153
  ```html
@@ -169,23 +169,23 @@ Every npm release's `dist/` is on jsDelivr (and unpkg); the bundles carry MathZe
169
169
  page needs nothing else:
170
170
 
171
171
  ```html
172
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/dist/fonts/fonts.css">
173
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/dist/inlinemath.css">
172
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/dist/fonts/fonts.css">
173
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/dist/inlinemath.css">
174
174
 
175
175
  <!-- a script tag: window.InlineMath -->
176
- <script src="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/dist/inlinemath.global.min.js"></script>
176
+ <script src="https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/dist/inlinemath.global.min.js"></script>
177
177
  <script>document.getElementById('out').innerHTML = InlineMath.toHTML('\\frac{d}{dx} x^2');</script>
178
178
 
179
179
  <!-- or modules: inlinemath.js, markdown.js, cas.js (the CAS one holds MathZetta CAS too) -->
180
180
  <script type="module">
181
- import { toHTML } from 'https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/dist/inlinemath.js';
182
- import { markdownToHTML } from 'https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/dist/markdown.js';
181
+ import { toHTML } from 'https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/dist/inlinemath.js';
182
+ import { markdownToHTML } from 'https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/dist/markdown.js';
183
183
  </script>
184
184
  ```
185
185
 
186
- `@0.2` follows the latest 0.2.x; `@0.2.0` pins a release.
186
+ `@0.4` follows the latest 0.4.x (a 0.x range never reaches the next minor version); `@0.4.0` pins a release.
187
187
 
188
- **The stylesheet is required** — the drawing is HTML laid out by `inlinemath.css` (10.4 KB, 3.2 KB
188
+ **The stylesheet is required** — the drawing is HTML laid out by `inlinemath.css` (10.5 KB, 3.2 KB
189
189
  gzipped): without it fractions, radicals and brackets don't line up. The classic builds
190
190
  (`*.global.min.js`) carry it and add it to the page themselves (`<style id="inlinemath-css">`; a
191
191
  `<link>` to `dist/inlinemath.css` is still fine, it is only added when absent); the ES modules
@@ -196,17 +196,17 @@ its Greek letters, which Latin Modern lacks, from New Computer Modern in the sam
196
196
  Greek never fetches those two; without the link the math is drawn in the system serif.
197
197
 
198
198
  Every build comes **with MathZetta inside, or without it** (`*.external.*`), with or without the
199
- CAS (MathZetta CAS). Sizes, gzipped:
199
+ CAS (MathZetta CAS). Sizes, gzipped (a module with the shared chunks it imports):
200
200
 
201
201
  | | ES module | classic `<script>` (`window.InlineMath`) |
202
202
  |---|---|---|
203
- | Lite (drawing only), MathZetta inside | `lite.js` 35 KB | `inlinemath-lite.global.min.js` 38 KB |
204
- | Lite with the calculator (`{{…}}` worked out) | `lite-calc.js` 48 KB | `inlinemath-lite-calc.global.min.js` 52 KB |
205
- | Lite without MathZetta | `lite.external.js` 8 KB | `inlinemath-lite.external.global.min.js` 11 KB |
206
- | Inline Math (+ Markdown in the classic build), MathZetta inside | `inlinemath.js` 51 KB, `markdown.js` 55 KB | `inlinemath.global.min.js` 62 KB |
207
- | …without MathZetta | `inlinemath.external.js` **12 KB**, `markdown.external.js` 15 KB | `inlinemath.external.global.min.js` 21 KB |
208
- | with the CAS, MathZetta inside | `cas.js` 90 KB | `inlinemath-cas.global.min.js` 104 KB |
209
- | with the CAS, without MathZetta | `cas.external.js` 50 KB | `inlinemath-cas.external.global.min.js` 63 KB |
203
+ | Lite (drawing only), MathZetta inside | `lite.js` 42 KB | `inlinemath-lite.global.min.js` 43 KB |
204
+ | Lite with the calculator (`{{…}}` worked out) | `lite-calc.js` 58 KB | `inlinemath-lite-calc.global.min.js` 60 KB |
205
+ | Lite without MathZetta | `lite.external.js` 9 KB | `inlinemath-lite.external.global.min.js` 12 KB |
206
+ | Inline Math (+ Markdown in the classic build), MathZetta inside | `inlinemath.js` 62 KB, `markdown.js` 66 KB | `inlinemath.global.min.js` 71 KB |
207
+ | …without MathZetta | `inlinemath.external.js` **13 KB**, `markdown.external.js` 17 KB | `inlinemath.external.global.min.js` 21 KB |
208
+ | with the CAS, MathZetta inside | `cas.js` 113 KB | `inlinemath-cas.global.min.js` 123 KB |
209
+ | with the CAS, without MathZetta | `cas.external.js` 62 KB | `inlinemath-cas.external.global.min.js` 74 KB |
210
210
 
211
211
  Without MathZetta, the page loads it once itself: a classic page puts a MathZetta `<script>` first —
212
212
  `mathzetta.min.js`, or the `maths-display` flavor, since speech, text and calculate are used (for
@@ -221,7 +221,7 @@ map (every name can point at the one MathZetta bundle). The fonts are 94 KB more
221
221
  "mathzetta/calculate": "https://cdn.jsdelivr.net/npm/mathzetta@1/build/mathzetta.esm.min.js" } }
222
222
  </script>
223
223
  <script type="module">
224
- import { toHTML } from 'https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.2/dist/inlinemath.external.js';
224
+ import { toHTML } from 'https://cdn.jsdelivr.net/npm/@mathzetta/inlinemath@0.4/dist/inlinemath.external.js';
225
225
  </script>
226
226
  ```
227
227
 
@@ -297,7 +297,8 @@ el.innerHTML = stepsHTML(mathCAS().solve('sqrt(x + 1) = x - 1', 'x', { steps: 'b
297
297
  ```
298
298
 
299
299
  Block functions: `simplify`, `expand`, `factor`, `cancel`, `diff(f, x[, n])`,
300
- `integrate(f, x[, a, b])`, `solve(eq, x)`, `approx(x[, digits])`; `d/dx …` and
300
+ `integrate(f, x[, a, b])`, `solve(eq, x)`, `limit(f, x, a[, right|left])` (or `limit(f, x -> a^+)`),
301
+ `approx(x[, digits])`; `d/dx …`, `\lim_{x \to a} …` and
301
302
  `∫ … dx` go to the CAS too; every other block is the calculator, as before.
302
303
  `stepsHTML` draws each step with the rewritten part highlighted and its
303
304
  explanation. `mathCAS({ rules, names })` uses rule files of your own;
@@ -309,7 +310,6 @@ playground: any input, any operation, detail level, and a live rule editor).
309
310
  ## What still needs doing
310
311
 
311
312
  **Notation MathZetta doesn't read yet** (Inline Math can only draw what parses):
312
- - **Evaluation bars:** `[F(x)]_0^1` reads as a power of a subscript, and `\left. F \right|_0^1` is rejected.
313
313
  - **Partial derivatives:** `\partial f / \partial x` becomes products.
314
314
  - **Derivative orders:** `f^{(4)}` becomes a power.
315
315
  - **Lists of answers:** `x = 2, x = -3` is rejected.