Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSS stylesheet #114

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add CSS stylesheet
Mark function idents and zero-width operator with appropriate classes
such that they can be selected with CSS and correct space around them
added.

Also move the cancel enclose style rule to the CSS stylesheet.

Fixes: #103
runarberg committed Jun 7, 2024
commit 4cfda6eb7a525efaf28c1c29b28eecd710fb230e
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ and include the **module**:

```html
<script type="module" src="mathup.js"></script>
<link rel="stylesheet" href="mathup.css" />
```

…the **custom element**:
@@ -38,6 +39,7 @@ and include the **module**:

```html
<script src="mathup.iife.js"></script>
<link rel="stylesheet" href="mathup.css" />
```

#### Usage
14 changes: 12 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -230,19 +230,29 @@ <h5>Client</h5>
>min</a
>)
</li>

<li>
Stylesheet (<a
href="https://cdn.jsdelivr.net/npm/mathup/dist/mathup.css"
download
>full</a
>; <em>not needed for custom element</em>)
</li>
</ul>

<p>…and include the <b>module</b>:</p>

<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">type</span>=<span class="hl-string">"module"</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;</code></pre>
<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">type</span>=<span class="hl-string">"module"</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;
&lt;<span class="hl-tag-name">link</span> <span class="hl-keyword">rel</span>=<span class="hl-string">"stylesheet"</span> <span class="hl-keyword">href</span>=<span class="hl-string">"mathup.css"</span> /&gt;</code></pre>

<p>…the <b>custom element</b>:</p>

<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">type</span>=<span class="hl-string">"module"</span> <span class="hl-keyword">src</span>=<span class="hl-string">"math-up-element.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;</code></pre>

<p>…or the <b>script</b>:</p>

<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.iife.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;</code></pre>
<pre><code>&lt;<span class="hl-tag-name">script</span> <span class="hl-keyword">src</span>=<span class="hl-string">"mathup.iife.js"</span>&gt;&lt;/<span class="hl-tag-name">script</span>&gt;
&lt;<span class="hl-tag-name">link</span> <span class="hl-keyword">rel</span>=<span class="hl-string">"stylesheet"</span> <span class="hl-keyword">href</span>=<span class="hl-string">"mathup.css"</span> /&gt;</code></pre>
</section>

<section id="usage">
147 changes: 147 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@
"jsdom": "^22.1.0",
"prettier": "3.0.3",
"rollup": "^4.3.0",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^5.2.2"
}
}
14 changes: 14 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import path from "node:path";

import babel from "@rollup/plugin-babel";
import terser from "@rollup/plugin-terser";
import copy from "rollup-plugin-copy";

/**
* @typedef {import("rollup").RollupOptions} RollupOptions
@@ -47,10 +50,21 @@ const defaultConfig = {
plugins: [terser()],
},
],

plugins: [
babel({
babelHelpers: "runtime",
}),

copy({
targets: [
{
src: path.resolve("./src/stylesheets/core.css"),
dest: path.resolve("dist/"),
rename: "mathup.css",
},
],
}),
],
};

50 changes: 26 additions & 24 deletions src/compiler/tokenizer/lexemes.js
Original file line number Diff line number Diff line change
@@ -82,6 +82,8 @@ export function isPunctOpen(char) {
return PUNCT_CLOSE_RE.test(char);
}

const FUNCTION_IDENT_ATTRS = { class: "mathup-function-ident" };

export const KNOWN_IDENTS = new Map([
["CC", { value: "ℂ" }],
["Delta", { value: "Δ", attrs: { mathvariant: "normal" } }],
@@ -102,25 +104,25 @@ export const KNOWN_IDENTS = new Map([
["alpha", { value: "α" }],
["beta", { value: "β" }],
["chi", { value: "χ" }],
["cos", { value: "cos" }],
["cosh", { value: "cosh" }],
["cot", { value: "cot" }],
["csc", { value: "csc" }],
["cos", { value: "cos", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["cosh", { value: "cosh", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["cot", { value: "cot", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["csc", { value: "csc", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["delta", { value: "δ" }],
["det", { value: "det" }],
["dim", { value: "dim" }],
["det", { value: "det", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["dim", { value: "dim", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["epsilon", { value: "ɛ" }],
["eta", { value: "η" }],
["gamma", { value: "γ" }],
["gcd", { value: "gcd" }],
["gcd", { value: "gcd", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["iota", { value: "ι" }],
["kappa", { value: "κ" }],
["lambda", { value: "λ" }],
["lcm", { value: "lcm" }],
["ln", { value: "ln" }],
["log", { value: "log" }],
["max", { value: "max" }],
["min", { value: "min" }],
["lcm", { value: "lcm", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["ln", { value: "ln", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["log", { value: "log", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["max", { value: "max", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["min", { value: "min", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["mu", { value: "μ" }],
["nu", { value: "ν" }],
["omega", { value: "ω" }],
@@ -130,12 +132,12 @@ export const KNOWN_IDENTS = new Map([
["pi", { value: "π" }],
["psi", { value: "ψ" }],
["rho", { value: "ρ" }],
["sec", { value: "sec" }],
["sec", { value: "sec", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["sigma", { value: "σ" }],
["sin", { value: "sin" }],
["sinh", { value: "sinh" }],
["tan", { value: "tan" }],
["tanh", { value: "tanh" }],
["sin", { value: "sin", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["sinh", { value: "sinh", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["tan", { value: "tan", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["tanh", { value: "tanh", attrs: { ...FUNCTION_IDENT_ATTRS } }],
["tau", { value: "τ" }],
["theta", { value: "θ" }],
["upsilon", { value: "υ" }],
@@ -148,10 +150,10 @@ export const KNOWN_OPS = new Map([
["!=", { value: "≠" }],
["!==", { value: "≢" }],
["!in", { value: "∉" }],
[".$", { value: "\u2061" }],
[".*", { value: "\u2062" }],
[".+", { value: "\u2064" }],
[".,", { value: "\u2063" }],
[".$", { value: "\u2061", attrs: { class: "mathup-function-application" } }],
[".*", { value: "\u2062", attrs: { class: "mathup-invisible-times" } }],
[".+", { value: "\u2064", attrs: { class: "mathup-invisible-add" } }],
[".,", { value: "\u2063", attrs: { class: "mathup-invisible-separator" } }],
["'", { value: "′", attrs: { lspace: 0, rspace: 0 } }],
["''", { value: "″", attrs: { lspace: 0, rspace: 0 } }],
["'''", { value: "‴", attrs: { lspace: 0, rspace: 0 } }],
@@ -318,6 +320,9 @@ export const KNOWN_PREFIX = new Map([
// Roots
["root", { name: "root", arity: 2 }],
["sqrt", { name: "sqrt" }],

// Enclose
["cancel", { name: "row", attrs: { class: "mathup-enclose-cancel" } }],
]);

export const KNOWN_COMMANDS = new Map([
@@ -356,7 +361,4 @@ export const KNOWN_COMMANDS = new Map([
["bg.red", { name: "background", value: "red" }],
["bg.white", { name: "background", value: "white" }],
["bg.yellow", { name: "background", value: "yellow" }],

// Enclose
["cancel", { name: "enclose", value: "updiagonalstrike" }],
]);
13 changes: 2 additions & 11 deletions src/compiler/transformer/transforms/styles.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/** @typedef {import("../index.js").Tag} Tag */

const UP_DIAGONAL_STROKE_BACKGROUND =
"linear-gradient(to bottom right, transparent calc(50% - 0.1ex), currentColor calc(50% - 0.05ex), currentColor calc(50% + 0.05ex), transparent calc(50% + 0.1ex))";

/**
* @param {string} name
* @param {string} value
@@ -26,15 +23,9 @@ export function applyStyles(styles, tag) {
const combinedStyles = new Map();

for (const [name, value] of styles) {
if (
name === "background" ||
(name === "enclose" && value === "updiagonalstrike")
) {
if (name === "background") {
const currentValue = combinedStyles.get("background");
const backgroundValue =
name === "background"
? withCustomProperty(name, value)
: UP_DIAGONAL_STROKE_BACKGROUND;
const backgroundValue = withCustomProperty(name, value);

if (currentValue) {
combinedStyles.set("background", `${currentValue},${backgroundValue}`);
18 changes: 0 additions & 18 deletions src/compiler/transformer/transforms/styles.test.js
Original file line number Diff line number Diff line change
@@ -54,24 +54,6 @@ test("applyStyles overrides backgrounds", (t) => {
});
});

test("applyStyles stacks enclose over backgrounds", (t) => {
const styles = new Map([
["enclose", "updiagonalstrike"],
["background", "red"],
]);
const tag = {
tag: "mrow",
};

t.deepEqual(applyStyles(styles, tag), {
tag: "mrow",
attrs: {
style:
"background:linear-gradient(to bottom right, transparent calc(50% - 0.1ex), currentColor calc(50% - 0.05ex), currentColor calc(50% + 0.05ex), transparent calc(50% + 0.1ex)),var(--mathup-background-red, red);",
},
});
});

test("applyStyles conserves existing attrs", (t) => {
const styles = new Map([["color", "red"]]);
const tag = {
73 changes: 73 additions & 0 deletions src/custom-element.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,77 @@ import mathup from "./index.js";

const MATHML_NS = "http://www.w3.org/1998/Math/MathML";

// Replace with (when available):
// import stylesheet from "./stylesheets/core.css" with { type: "css" };
const stylesheet = new CSSStyleSheet();
stylesheet.replaceSync(`
:is(
mo.mathup-function-application,
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> :is(
.mathup-function-ident,
:is(msub, msup, msubsup, munder, mover, munderover):has(
> .mathup-function-ident:first-child
)
)
)
+ :is(
mi,
mn,
:is(mrow, msub, msup, msubsup, munder, mover, munderover):has(
> :is(mn, mi):first-child
)
),
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> :is(
mi,
mo.mathup-function-application,
mo.mathup-invisible-times
)
+ :is(
.mathup-function-ident,
:is(msub, msup, msubsup, munder, mover, munderover):has(
> .mathup-function-ident:first-child
)
),
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> :is(
mi,
mn,
mo.mathup-invisible-add,
mo.mathup-invisible-times,
:is(mrow, msub, msup, msubsup, munder, mover, munderover):has(
> :is(mi, mn):first-child
)
)
+ mfrac,
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> mfrac
+ :is(
mi,
mn,
mfrac,
mroot,
msqrt,
mo.mathup-invisible-times,
:is(mrow, msub, msup, msubsup, munder, mover, munderover):has(
> :is(mi, mn):first-child
)
) {
padding-inline-start: 0.35ex;
}
.mathup-enclose-cancel {
background: linear-gradient(
to bottom right,
transparent calc(50% - 0.1ex),
currentColor calc(50% - 0.05ex),
currentColor calc(50% + 0.05ex),
transparent calc(50% + 0.1ex)
);
}
`);

const template = document.createElement("template");
{
const slot = document.createElement("slot");
@@ -21,6 +92,8 @@ export default class MathUpElement extends HTMLElement {
super();

const shadow = this.attachShadow({ mode: "open" });
shadow.adoptedStyleSheets = [stylesheet];

const shadowRoot =
/** @type {DocumentFragment} */
(template.content.cloneNode(true));
78 changes: 78 additions & 0 deletions src/stylesheets/core.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* Space beween function ident and parentless parameter: sin θ */
:is(
mo.mathup-function-application, /* sin .$ θ */
/* Prevent sin/cos */
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> :is(
.mathup-function-ident,
:is(msub, msup, msubsup, munder, mover, munderover):has(
/* log_b n, sin^2 θ */
> .mathup-function-ident:first-child
)
)
)
+ :is(
mi,
mn,
:is(mrow, msub, msup, msubsup, munder, mover, munderover):has(
/* sin x^2 */
> :is(mn, mi):first-child
)
),

/* Space between ident and function ident: a sin */
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> :is(
mi,
mo.mathup-function-application, /* cos .$ sin */
mo.mathup-invisible-times /* a .* sin */
)
+ :is(
.mathup-function-ident,
:is(msub, msup, msubsup, munder, mover, munderover):has(
/* a sin^2 */
> .mathup-function-ident:first-child
)
),

/* Space before fractions: a b/c */
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> :is(
mi,
mn,
mo.mathup-invisible-add, /* a .+ b/c */
mo.mathup-invisible-times, /* a .* b/c */
:is(mrow, msub, msup, msubsup, munder, mover, munderover):has(
/* a^2 b/c */
> :is(mi, mn):first-child
)
)
+ mfrac,

/* Space after fractions: b/c d */
:not(mfrac, msub, msup, msubsup, munder, mover, munderover)
> mfrac
+ :is(
mi,
mn,
mfrac,
mroot,
msqrt,
mo.mathup-invisible-times, /* b/c .* d */
:is(mrow, msub, msup, msubsup, munder, mover, munderover):has(
/* b/c d^2 */
> :is(mi, mn):first-child
)
) {
padding-inline-start: 0.35ex;
}

.mathup-enclose-cancel {
background: linear-gradient(
to bottom right,
transparent calc(50% - 0.1ex),
currentColor calc(50% - 0.05ex),
currentColor calc(50% + 0.05ex),
transparent calc(50% + 0.1ex)
);
}
Binary file modified test/snapshots/accents.js.snap
Binary file not shown.
Binary file modified test/snapshots/basics.js.snap
Binary file not shown.
8 changes: 4 additions & 4 deletions test/snapshots/colors.js.md
Original file line number Diff line number Diff line change
@@ -96,18 +96,18 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 1
'<math><mi style="background:linear-gradient(to bottom right, transparent calc(50% - 0.1ex), currentColor calc(50% - 0.05ex), currentColor calc(50% + 0.05ex), transparent calc(50% + 0.1ex));color:var(--mathup-color-red, red);">a</mi></math>'
'<math><mrow class="mathup-enclose-cancel"><mi style="color:var(--mathup-color-red, red);">a</mi></mrow></math>'

> Snapshot 2
'<math><mi style="color:var(--mathup-color-red, red);background:linear-gradient(to bottom right, transparent calc(50% - 0.1ex), currentColor calc(50% - 0.05ex), currentColor calc(50% + 0.05ex), transparent calc(50% + 0.1ex));">𝐚</mi></math>'
'<math><mrow class="mathup-enclose-cancel" style="color:var(--mathup-color-red, red);"><mi>𝐚</mi></mrow></math>'

## Cancel and background

> Snapshot 1
'<math><mi style="background:linear-gradient(to bottom right, transparent calc(50% - 0.1ex), currentColor calc(50% - 0.05ex), currentColor calc(50% + 0.05ex), transparent calc(50% + 0.1ex)),var(--mathup-background-red, red);">a</mi></math>'
'<math><mrow class="mathup-enclose-cancel"><mi style="background:var(--mathup-background-red, red);">a</mi></mrow></math>'

> Snapshot 2
'<math><mi style="background:var(--mathup-background-red, red),linear-gradient(to bottom right, transparent calc(50% - 0.1ex), currentColor calc(50% - 0.05ex), currentColor calc(50% + 0.05ex), transparent calc(50% + 0.1ex));">𝐚</mi></math>'
'<math><mrow class="mathup-enclose-cancel" style="background:var(--mathup-background-red, red);"><mi>𝐚</mi></mrow></math>'
Binary file modified test/snapshots/colors.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion test/snapshots/enclosed.js.md
Original file line number Diff line number Diff line change
@@ -8,4 +8,4 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 1
'<math><mi style="background:linear-gradient(to bottom right, transparent calc(50% - 0.1ex), currentColor calc(50% - 0.05ex), currentColor calc(50% + 0.05ex), transparent calc(50% + 0.1ex));">x</mi></math>'
'<math><mrow class="mathup-enclose-cancel"><mi>x</mi></mrow></math>'
Binary file modified test/snapshots/enclosed.js.snap
Binary file not shown.
Binary file modified test/snapshots/fonts.js.snap
Binary file not shown.
Binary file modified test/snapshots/fractions.js.snap
Binary file not shown.
Binary file modified test/snapshots/groupings.js.snap
Binary file not shown.
Binary file modified test/snapshots/identifiers.js.snap
Binary file not shown.
Binary file modified test/snapshots/matrices.js.snap
Binary file not shown.
Binary file modified test/snapshots/numbers.js.snap
Binary file not shown.
Binary file modified test/snapshots/operators.js.snap
Binary file not shown.
Binary file modified test/snapshots/options.js.snap
Binary file not shown.
Binary file modified test/snapshots/roots.js.snap
Binary file not shown.
12 changes: 6 additions & 6 deletions test/snapshots/standard-functions.js.md
Original file line number Diff line number Diff line change
@@ -8,37 +8,37 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 1
'<math><mi>tan</mi><mo>=</mo><mfrac><mi>sin</mi><mi>cos</mi></mfrac></math>'
'<math><mi class="mathup-function-ident">tan</mi><mo>=</mo><mfrac><mi class="mathup-function-ident">sin</mi><mi class="mathup-function-ident">cos</mi></mfrac></math>'

## The hyperbolic function

> Snapshot 1
'<math><mrow><mtable><mtr><mtd style="text-align: start"><mi>sinh</mi><mi>x</mi><mo>=</mo><mfrac><mrow><msup><mi>e</mi><mi>x</mi></msup><mo>−</mo><msup><mi>e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup></mrow><mn>2</mn></mfrac><mo>,</mo></mtd></mtr><mtr><mtd style="text-align: start"><mi>cosh</mi><mi>x</mi><mo>=</mo><mfrac><mrow><msup><mi>e</mi><mi>x</mi></msup><mo>+</mo><msup><mi>e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup></mrow><mn>2</mn></mfrac><mo>,</mo></mtd></mtr><mtr><mtd style="text-align: start"><mi>tanh</mi><mi>x</mi><mo>=</mo><mfrac><mrow><mi>sinh</mi><mi>x</mi></mrow><mrow><mi>cosh</mi><mi>x</mi></mrow></mfrac><mo>.</mo></mtd></mtr></mtable></mrow></math>'
'<math><mrow><mtable><mtr><mtd style="text-align: start"><mi class="mathup-function-ident">sinh</mi><mi>x</mi><mo>=</mo><mfrac><mrow><msup><mi>e</mi><mi>x</mi></msup><mo>−</mo><msup><mi>e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup></mrow><mn>2</mn></mfrac><mo>,</mo></mtd></mtr><mtr><mtd style="text-align: start"><mi class="mathup-function-ident">cosh</mi><mi>x</mi><mo>=</mo><mfrac><mrow><msup><mi>e</mi><mi>x</mi></msup><mo>+</mo><msup><mi>e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup></mrow><mn>2</mn></mfrac><mo>,</mo></mtd></mtr><mtr><mtd style="text-align: start"><mi class="mathup-function-ident">tanh</mi><mi>x</mi><mo>=</mo><mfrac><mrow><mi class="mathup-function-ident">sinh</mi><mi>x</mi></mrow><mrow><mi class="mathup-function-ident">cosh</mi><mi>x</mi></mrow></mfrac><mo>.</mo></mtd></mtr></mtable></mrow></math>'

## Logarithm change of base

> Snapshot 1
'<math><msub><mi>log</mi><mi>b</mi></msub><mi>x</mi><mo>=</mo><mfrac><mrow><msub><mi>log</mi><mi>k</mi></msub><mi>x</mi></mrow><mrow><msub><mi>log</mi><mi>k</mi></msub><mi>b</mi></mrow></mfrac></math>'
'<math><msub><mi class="mathup-function-ident">log</mi><mi>b</mi></msub><mi>x</mi><mo>=</mo><mfrac><mrow><msub><mi class="mathup-function-ident">log</mi><mi>k</mi></msub><mi>x</mi></mrow><mrow><msub><mi class="mathup-function-ident">log</mi><mi>k</mi></msub><mi>b</mi></mrow></mfrac></math>'

## Logarithm powers

> Snapshot 1
'<math><mi>ln</mi><msup><mi>x</mi><mn>2</mn></msup><mo>=</mo><mn>2</mn><mi>ln</mi><mi>x</mi></math>'
'<math><mi class="mathup-function-ident">ln</mi><msup><mi>x</mi><mn>2</mn></msup><mo>=</mo><mn>2</mn><mi class="mathup-function-ident">ln</mi><mi>x</mi></math>'

## Logarithm division

> Snapshot 1
'<math><mi>ln</mi><mfrac><mi>x</mi><mi>y</mi></mfrac><mo>=</mo><mi>ln</mi><mi>x</mi><mo>−</mo><mi>ln</mi><mi>y</mi></math>'
'<math><mi class="mathup-function-ident">ln</mi><mfrac><mi>x</mi><mi>y</mi></mfrac><mo>=</mo><mi class="mathup-function-ident">ln</mi><mi>x</mi><mo>−</mo><mi class="mathup-function-ident">ln</mi><mi>y</mi></math>'

## 2×2 determinants

> Snapshot 1
'<math><mrow><mi>det</mi><mrow><mo fence="true">(</mo><mi>A</mi><mo fence="true">)</mo></mrow></mrow><mo>=</mo><mrow><mo fence="true">|</mo><mtable><mtr><mtd><mi>a</mi></mtd><mtd><mi>b</mi></mtd></mtr><mtr><mtd><mi>c</mi></mtd><mtd><mi>d</mi></mtd></mtr></mtable><mo fence="true">|</mo></mrow><mo>=</mo><mrow><mi>a</mi><mi>d</mi></mrow><mo>−</mo><mrow><mi>c</mi><mi>d</mi></mrow></math>'
'<math><mrow><mi class="mathup-function-ident">det</mi><mrow><mo fence="true">(</mo><mi>A</mi><mo fence="true">)</mo></mrow></mrow><mo>=</mo><mrow><mo fence="true">|</mo><mtable><mtr><mtd><mi>a</mi></mtd><mtd><mi>b</mi></mtd></mtr><mtr><mtd><mi>c</mi></mtd><mtd><mi>d</mi></mtd></mtr></mtable><mo fence="true">|</mo></mrow><mo>=</mo><mrow><mi>a</mi><mi>d</mi></mrow><mo>−</mo><mrow><mi>c</mi><mi>d</mi></mrow></math>'

## Fermats little theorem

Binary file modified test/snapshots/standard-functions.js.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions test/snapshots/sub-supscripts.js.md
Original file line number Diff line number Diff line change
@@ -74,13 +74,13 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 1
'<math><msub><mrow><mo fence="true">(</mo><msup><mi>X</mi><mi>T</mi></msup><mo fence="true">)</mo></mrow><mrow><mi>i</mi><mo>⁣</mo><mi>j</mi></mrow></msub><mo>=</mo><msub><mi>X</mi><mrow><mi>j</mi><mo>⁣</mo><mi>i</mi></mrow></msub></math>'
'<math><msub><mrow><mo fence="true">(</mo><msup><mi>X</mi><mi>T</mi></msup><mo fence="true">)</mo></mrow><mrow><mi>i</mi><mo class="mathup-invisible-separator">⁣</mo><mi>j</mi></mrow></msub><mo>=</mo><msub><mi>X</mi><mrow><mi>j</mi><mo class="mathup-invisible-separator">⁣</mo><mi>i</mi></mrow></msub></math>'

## The natural logarithm

> Snapshot 1
'<math><mi>ln</mi><mi>x</mi><mo>=</mo><msubsup><mo>∫</mo><mn>1</mn><mi>x</mi></msubsup><mfrac><mn>1</mn><mi>t</mi></mfrac><mrow><mo rspace="0">𝑑</mo><mi>t</mi></mrow></math>'
'<math><mi class="mathup-function-ident">ln</mi><mi>x</mi><mo>=</mo><msubsup><mo>∫</mo><mn>1</mn><mi>x</mi></msubsup><mfrac><mn>1</mn><mi>t</mi></mfrac><mrow><mo rspace="0">𝑑</mo><mi>t</mi></mrow></math>'

## Powers of powers of two

Binary file modified test/snapshots/sub-supscripts.js.snap
Binary file not shown.
Binary file modified test/snapshots/under-overscrips.js.snap
Binary file not shown.
Binary file modified test/snapshots/whitespace.js.snap
Binary file not shown.