diff --git a/content/math/basic-math-notation/_index.md b/content/math/basic-math-notation/_index.md new file mode 100644 index 0000000..b5ea19d --- /dev/null +++ b/content/math/basic-math-notation/_index.md @@ -0,0 +1,490 @@ ++++ +title = "Basic math notation" +description = "Learn the names and meanings of plus, minus, times, divide, equals, brackets, and other signs used in number sentences." +template = "chapter.html" +weight = 1 +[extra] +subject = "math" +chapter_id = "basic-math-notation" +strand = "Number & Algebra" ++++ + +
+

+ In the last chapter you met number sentences — short lines that use digits and + special marks, like 3 + 4 = 7. This chapter is a guide to those marks: what each + one is called, how to say it out loud, and what it tells you to do. You do not need to be fast at + arithmetic yet; you only need to read the symbols like words on a sign. +

+ +

Digits, words, and spaces

+

+ The symbols 0 through 9 are called digits. Each + digit stands for a counting amount (zero through nine). When you write a bigger number, you put + digits side by side with no gap: 47 means four tens and seven ones. +

+

+ A full line of math often mixes words (in your head or in a story) with + symbols (on paper). “Three plus four equals seven” is the same idea as + 3 + 4 = 7. +

+ +
+ + + + + + + + + + + + + + + + + + + + +
SymbolNameSay it like this
0–9digits“zero”, “one”, … “nine”
(space)space between partspause between numbers and signs so the line is easy to read
+
+ +

Plus (+)

+

+ The plus sign looks like a small cross: +. It means + put together or add. +

+

+ Read 3 + 4 = 7 as: “three plus four equals seven.” You are + joining two groups into one total. +

+ +
+

Remember

+

The plus sign is not the letter “t”. It sits between the numbers you are combining.

+
+ +

Minus (−)

+

+ The minus sign is a short horizontal line: − (sometimes written + as a hyphen - on a keyboard). It means take away or + subtract. +

+

+ Read 7 − 3 = 4 as: “seven minus three equals four.” Start with + seven things, remove three, and count what is left. +

+ +
+

Minus or hyphen?

+

+ In a number sentence, the short line between numbers is a minus + sign. In ordinary writing, the same shape can join words (like “well-known”) — that + is a hyphen, not “take away.” Look at what is on each side: digits mean minus. +

+
+ +

Times (×)

+

+ The times sign looks like a tilted cross or letter x: ×. It + means multiply — many equal groups. +

+

+ Our main example is three groups of four makes twelve. You can spell that same + fact in several ways on paper: +

+ +

+ Read any of the lines above as: “three times four equals twelve,” or “three + groups of four.” +

+ +

Divide (÷)

+

+ The division sign is a dot with a line: ÷. It means + split into equal groups or share fairly. +

+

+ Take twelve shared into four equal piles; each pile has three. Again, the same + fact can look different on the page: +

+ +

+ Read 12 ÷ 4 = 3 or 12/4 = 3 as: “twelve divided by four + equals three.” Twelve dots shared into four equal piles give three in each pile. +

+

+ A slash between two numbers is a quick way to write division or a fraction in one + line: 1/2 is “one half,” and 12/4 is the same sharing story as + twelve divided by four. In typeset math the numbers can sit one above the other: + \(\tfrac{1}{2}\) (one half) and \(\dfrac{12}{4} = 3\) (twelve over four equals three). +

+ +

Equals (=)

+

+ The equals sign is two parallel lines: =. It means + is the same amount as on both sides. +

+

+ Read a full sentence from left to right. In 5 + 2 = 7, the left side (five plus + two) has the same total as the right side (seven). The equals sign is the bridge between them. +

+ +
+

One sentence

+

+ Treat the whole line as one idea: “five plus two equals seven.” Do not stop reading at the plus + sign — finish at the number after the equals sign. +

+
+ +

Brackets ( )

+

+ Round brackets — also called parentheses — wrap part of a + sentence: ( and ). They mean: do this group + first, then use the result with the rest of the line. +

+

+ In (2 + 3) + 4, add two and three inside the brackets to get five, then add four + to get nine. Without brackets, 2 + 3 + 4 still totals nine, but brackets help + when the order would be unclear. +

+ +

Quick reference: the main four operations

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolNameMeaningExample
+plusput together3 + 4 = 7
−minustake away7 − 3 = 4
×timesequal groups3 × 4 = 12
÷divided byfair shares12 ÷ 4 = 3
=equalssame amount both sides5 + 2 = 7
( )bracketsthis part first(2 + 3) + 4 = 9
+
+ +

Less than and greater than (< >)

+

+ Sometimes we compare two amounts without adding or subtracting. The open mouth of the symbol + points at the bigger number. +

+ +

+ You may also see ≤ (less than or equal) and ≥ (greater than or + equal). The extra line means “or the same amount.” +

+ +

Comma and decimal point

+

+ In big numbers like 1,000, a comma groups digits in threes so + the number is easier to read — one thousand, not “one zero zero zero” as separate ideas. +

+

+ A decimal point . sits between a whole part and a smaller part. + 3.50 might mean three dollars and fifty cents: the part after the point is not + whole dollars. You will learn more about decimals later; for now, remember the dot splits the + number into two pieces. +

+ +

Fractions (½ and 1/2)

+

+ A fraction names part of a whole split into equal pieces. You + might see a single character like ½, or plain text with a slash + 1/2, or the same value written tall in math as \(\tfrac{1}{2}\) — all mean + one part out of two equal parts. +

+
+ +
One half shaded — ½ of the bar
+
+ +

Percent (%)

+

+ The percent sign % means out of one hundred. + 50% means fifty out of every hundred — half of the whole. If a test has 100 + points and you score 80, you might say you got 80%. +

+ +

And so on (…) and about (≈)

+

+ Three dots in a row … (an ellipsis) mean the pattern keeps + going the same way: 2, 4, 6, 8, … — two, four, six, eight, and so on. +

+

+ The sign ≈ means approximately or about — close + but not exact. 10 ÷ 3 ≈ 3 is a rough answer; the exact value is a bit more than + three. +

+ +

Signs you will meet later

+

+ As you grow, books will add more symbols: a colon for ratios, small numbers + above the line for powers, and pairs of letters in graphs. You do not need them yet; this chapter + is enough to read everyday number sentences. +

+ +

Try it yourself

+

+ Say each line out loud before you calculate. Cover the answer with your hand, then check: +

+ +
+ +
+

History

+

+ People counted with fingers and words long before they agreed on one way to write math. Ancient + Egyptians and Babylonians used pictures and marks for amounts. Over centuries, different + countries used different symbols for the same ideas. +

+

+ The equals sign (=) was popularised in the 1500s by Welsh mathematician + Robert Recorde. He chose two lines because “no two things can be more equal” than + parallel lines — a way to show both sides match. +

+

+ The plus and minus signs (+ and −) became common in Europe + around the same era, replacing longer Latin words. The times sign (×) and + division sign (÷) appeared later, when printing books needed short, clear marks + that fit on one line. +

+

+ Brackets grew important when formulas got longer — mathematicians needed a visible rule for + “which part first,” just like you do in (2 + 3) + 4. +

+ +

Derivation

+ +

Why symbols instead of only words?

+

+ Writing “three plus four equals seven” every time is long. Symbols are a shorthand: + the same meaning in less space, so you can compare many sentences quickly. +

+ +

What equals really says

+

+ If the left side of \(=\) counts to \(a\) and the right side counts to \(b\), then \(a = b\) + means both sides name the same number. If they were different, the sentence would + be false — like claiming \(3 + 4 = 8\) when seven dots are the true total. +

+ +

Why brackets change the order

+

+ Without a rule, \(2 + 3 \times 4\) could be read in two ways. Brackets fix one group: + \((2 + 3) \times 4 = 5 \times 4 = 20\). Later you will learn more order rules; for now, + brackets always mean “work inside first.” +

+ +

Checkpoints

+

Pause and answer in your head or with a partner.

+ +
+

Checkpoint

+

What is the name of the sign in \(7 - 3 = 4\)? What does it tell you to do?

+
+ +
+

Checkpoint

+

Say out loud: \(4 \times 2 = 8\). Which word goes with \(\times\)?

+
+ +
+

Checkpoint

+

In \((5 + 1) + 2\), which part do you work out first? What is the final total?

+
+ +
+

Checkpoint

+

Is \(6 > 2\) true? What does the open side of \(>\) point toward?

+
+ +
+

Checkpoint

+

What does \(50\%\) mean in words (“out of …”)?

+
+ +

Real-life applications

+ + +

Question bank

+ +

Easy

+ +
+ What is the plus sign? +
+

Answer: A cross-shaped mark + that means add or put together.

+
+
+ +
+ How do you say \(5 = 5\) out loud? +
+

Answer: “Five equals five.”

+
+
+ +
+ Which symbol means “take away”? +
+

Answer: Minus: − (or - on a keyboard).

+
+
+ +

Intermediate

+ +
+ Say \(9 \div 3 = 3\) in words. +
+

Answer: “Nine divided by three equals three.”

+
+
+ +
+ What does \(\times\) mean in \(4 \times 2\)? +
+

Answer: Multiply — four groups of two (or two groups of four), total eight.

+
+
+ +
+ Compute \((3 + 2) + 4\). +
+

Answer: \(9\).

+

Steps: Inside brackets: \(3 + 2 = 5\). Then \(5 + 4 = 9\).

+
+
+ +
+ Is \(4 < 9\) true or false? +
+

Answer: True — four is less than nine.

+
+
+ +

Difficult

+ +
+ Which is bigger: \(7\) or \(5\)? Write a true comparison using \(>\) or \(<\). +
+

Answer: Seven is bigger. Examples: \(7 > 5\) or \(5 < 7\).

+
+
+ +
+ What does \(1/2\) mean in words? +
+

Answer: One half — one part out of two equal parts.

+
+
+ +
+ A shirt costs \(20\) dollars. The tag says \(25\%\) off. What does \(25\%\) mean? +
+

Answer: Twenty-five out of every hundred — a quarter of the price is taken off (you will learn to compute the exact dollars later).

+
+
+ +

Hardcore

+ +
+ Write \(2 \times 3 + 1\) in words two ways: (a) if you multiply first, (b) if you add inside brackets as \((2 \times 3) + 1\) only — are the totals the same as \(2 \times (3 + 1)\)? +
+

Answer: \((2 \times 3) + 1 = 7\). \(2 \times (3 + 1) = 2 \times 4 = 8\). They are not the same — brackets change the result.

+

Explanation: Brackets show which group to do first; this is why notation matters.

+
+
+ +
+ Name two other symbols that can mean “multiply” besides \(\times\). +
+

Answer: Dot \(\cdot\) and asterisk \(*\) (on keyboards/calculators).

+
+
+ +
+ Read \(1{,}000 + 500 = 1{,}500\) aloud. What job does the comma do in \(1{,}000\)? +
+

Answer: “One thousand plus five hundred equals one thousand five hundred.” The comma groups digits in threes to show thousands.

+
+
+ +

References

+ +
diff --git a/content/math/basic-math-notation/chapter.scss b/content/math/basic-math-notation/chapter.scss new file mode 100644 index 0000000..3970b5e --- /dev/null +++ b/content/math/basic-math-notation/chapter.scss @@ -0,0 +1,38 @@ +// Symbol tables and fraction demo for basic math notation chapter + +.notation-symbol-table__glyph { + font-size: 1.35rem; + font-weight: 600; + font-family: var(--font-mono, ui-monospace, monospace); + text-align: center; + white-space: nowrap; +} + +.notation-fraction-demo { + margin: 1.25rem 0; + text-align: center; +} + +.notation-fraction-demo__bar { + display: inline-flex; + width: min(200px, 100%); + height: 28px; + border-radius: 6px; + overflow: hidden; + border: 2px solid rgba(15, 118, 110, 0.4); +} + +.notation-fraction-demo__part { + flex: 1; + background: rgba(20, 184, 166, 0.08); +} + +.notation-fraction-demo__part--on { + background: #0f766e; +} + +.notation-fraction-demo__caption { + margin-top: 0.5rem; + font-size: 0.9rem; + color: var(--muted); +} diff --git a/content/math/basic-math-notation/core.html b/content/math/basic-math-notation/core.html new file mode 100644 index 0000000..a5d45ec --- /dev/null +++ b/content/math/basic-math-notation/core.html @@ -0,0 +1,479 @@ +
+

+ In the last chapter you met number sentences — short lines that use digits and + special marks, like 3 + 4 = 7. This chapter is a guide to those marks: what each + one is called, how to say it out loud, and what it tells you to do. You do not need to be fast at + arithmetic yet; you only need to read the symbols like words on a sign. +

+ +

Digits, words, and spaces

+

+ The symbols 0 through 9 are called digits. Each + digit stands for a counting amount (zero through nine). When you write a bigger number, you put + digits side by side with no gap: 47 means four tens and seven ones. +

+

+ A full line of math often mixes words (in your head or in a story) with + symbols (on paper). “Three plus four equals seven” is the same idea as + 3 + 4 = 7. +

+ +
+ + + + + + + + + + + + + + + + + + + + +
SymbolNameSay it like this
0–9digits“zero”, “one”, … “nine”
(space)space between partspause between numbers and signs so the line is easy to read
+
+ +

Plus (+)

+

+ The plus sign looks like a small cross: +. It means + put together or add. +

+

+ Read 3 + 4 = 7 as: “three plus four equals seven.” You are + joining two groups into one total. +

+ +
+

Remember

+

The plus sign is not the letter “t”. It sits between the numbers you are combining.

+
+ +

Minus (−)

+

+ The minus sign is a short horizontal line: − (sometimes written + as a hyphen - on a keyboard). It means take away or + subtract. +

+

+ Read 7 − 3 = 4 as: “seven minus three equals four.” Start with + seven things, remove three, and count what is left. +

+ +
+

Minus or hyphen?

+

+ In a number sentence, the short line between numbers is a minus + sign. In ordinary writing, the same shape can join words (like “well-known”) — that + is a hyphen, not “take away.” Look at what is on each side: digits mean minus. +

+
+ +

Times (×)

+

+ The times sign looks like a tilted cross or letter x: ×. It + means multiply — many equal groups. +

+

+ Our main example is three groups of four makes twelve. You can spell that same + fact in several ways on paper: +

+ +

+ Read any of the lines above as: “three times four equals twelve,” or “three + groups of four.” +

+ +

Divide (÷)

+

+ The division sign is a dot with a line: ÷. It means + split into equal groups or share fairly. +

+

+ Take twelve shared into four equal piles; each pile has three. Again, the same + fact can look different on the page: +

+ +

+ Read 12 ÷ 4 = 3 or 12/4 = 3 as: “twelve divided by four + equals three.” Twelve dots shared into four equal piles give three in each pile. +

+

+ A slash between two numbers is a quick way to write division or a fraction in one + line: 1/2 is “one half,” and 12/4 is the same sharing story as + twelve divided by four. In typeset math the numbers can sit one above the other: + \(\tfrac{1}{2}\) (one half) and \(\dfrac{12}{4} = 3\) (twelve over four equals three). +

+ +

Equals (=)

+

+ The equals sign is two parallel lines: =. It means + is the same amount as on both sides. +

+

+ Read a full sentence from left to right. In 5 + 2 = 7, the left side (five plus + two) has the same total as the right side (seven). The equals sign is the bridge between them. +

+ +
+

One sentence

+

+ Treat the whole line as one idea: “five plus two equals seven.” Do not stop reading at the plus + sign — finish at the number after the equals sign. +

+
+ +

Brackets ( )

+

+ Round brackets — also called parentheses — wrap part of a + sentence: ( and ). They mean: do this group + first, then use the result with the rest of the line. +

+

+ In (2 + 3) + 4, add two and three inside the brackets to get five, then add four + to get nine. Without brackets, 2 + 3 + 4 still totals nine, but brackets help + when the order would be unclear. +

+ +

Quick reference: the main four operations

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolNameMeaningExample
+plusput together3 + 4 = 7
−minustake away7 − 3 = 4
×timesequal groups3 × 4 = 12
÷divided byfair shares12 ÷ 4 = 3
=equalssame amount both sides5 + 2 = 7
( )bracketsthis part first(2 + 3) + 4 = 9
+
+ +

Less than and greater than (< >)

+

+ Sometimes we compare two amounts without adding or subtracting. The open mouth of the symbol + points at the bigger number. +

+ +

+ You may also see ≤ (less than or equal) and ≥ (greater than or + equal). The extra line means “or the same amount.” +

+ +

Comma and decimal point

+

+ In big numbers like 1,000, a comma groups digits in threes so + the number is easier to read — one thousand, not “one zero zero zero” as separate ideas. +

+

+ A decimal point . sits between a whole part and a smaller part. + 3.50 might mean three dollars and fifty cents: the part after the point is not + whole dollars. You will learn more about decimals later; for now, remember the dot splits the + number into two pieces. +

+ +

Fractions (½ and 1/2)

+

+ A fraction names part of a whole split into equal pieces. You + might see a single character like ½, or plain text with a slash + 1/2, or the same value written tall in math as \(\tfrac{1}{2}\) — all mean + one part out of two equal parts. +

+
+ +
One half shaded — ½ of the bar
+
+ +

Percent (%)

+

+ The percent sign % means out of one hundred. + 50% means fifty out of every hundred — half of the whole. If a test has 100 + points and you score 80, you might say you got 80%. +

+ +

And so on (…) and about (≈)

+

+ Three dots in a row … (an ellipsis) mean the pattern keeps + going the same way: 2, 4, 6, 8, … — two, four, six, eight, and so on. +

+

+ The sign ≈ means approximately or about — close + but not exact. 10 ÷ 3 ≈ 3 is a rough answer; the exact value is a bit more than + three. +

+ +

Signs you will meet later

+

+ As you grow, books will add more symbols: a colon for ratios, small numbers + above the line for powers, and pairs of letters in graphs. You do not need them yet; this chapter + is enough to read everyday number sentences. +

+ +

Try it yourself

+

+ Say each line out loud before you calculate. Cover the answer with your hand, then check: +

+ +
+ +
+

History

+

+ People counted with fingers and words long before they agreed on one way to write math. Ancient + Egyptians and Babylonians used pictures and marks for amounts. Over centuries, different + countries used different symbols for the same ideas. +

+

+ The equals sign (=) was popularised in the 1500s by Welsh mathematician + Robert Recorde. He chose two lines because “no two things can be more equal” than + parallel lines — a way to show both sides match. +

+

+ The plus and minus signs (+ and −) became common in Europe + around the same era, replacing longer Latin words. The times sign (×) and + division sign (÷) appeared later, when printing books needed short, clear marks + that fit on one line. +

+

+ Brackets grew important when formulas got longer — mathematicians needed a visible rule for + “which part first,” just like you do in (2 + 3) + 4. +

+ +

Derivation

+ +

Why symbols instead of only words?

+

+ Writing “three plus four equals seven” every time is long. Symbols are a shorthand: + the same meaning in less space, so you can compare many sentences quickly. +

+ +

What equals really says

+

+ If the left side of \(=\) counts to \(a\) and the right side counts to \(b\), then \(a = b\) + means both sides name the same number. If they were different, the sentence would + be false — like claiming \(3 + 4 = 8\) when seven dots are the true total. +

+ +

Why brackets change the order

+

+ Without a rule, \(2 + 3 \times 4\) could be read in two ways. Brackets fix one group: + \((2 + 3) \times 4 = 5 \times 4 = 20\). Later you will learn more order rules; for now, + brackets always mean “work inside first.” +

+ +

Checkpoints

+

Pause and answer in your head or with a partner.

+ +
+

Checkpoint

+

What is the name of the sign in \(7 - 3 = 4\)? What does it tell you to do?

+
+ +
+

Checkpoint

+

Say out loud: \(4 \times 2 = 8\). Which word goes with \(\times\)?

+
+ +
+

Checkpoint

+

In \((5 + 1) + 2\), which part do you work out first? What is the final total?

+
+ +
+

Checkpoint

+

Is \(6 > 2\) true? What does the open side of \(>\) point toward?

+
+ +
+

Checkpoint

+

What does \(50\%\) mean in words (“out of …”)?

+
+ +

Real-life applications

+ + +

Question bank

+ +

Easy

+ +
+ What is the plus sign? +
+

Answer: A cross-shaped mark + that means add or put together.

+
+
+ +
+ How do you say \(5 = 5\) out loud? +
+

Answer: “Five equals five.”

+
+
+ +
+ Which symbol means “take away”? +
+

Answer: Minus: − (or - on a keyboard).

+
+
+ +

Intermediate

+ +
+ Say \(9 \div 3 = 3\) in words. +
+

Answer: “Nine divided by three equals three.”

+
+
+ +
+ What does \(\times\) mean in \(4 \times 2\)? +
+

Answer: Multiply — four groups of two (or two groups of four), total eight.

+
+
+ +
+ Compute \((3 + 2) + 4\). +
+

Answer: \(9\).

+

Steps: Inside brackets: \(3 + 2 = 5\). Then \(5 + 4 = 9\).

+
+
+ +
+ Is \(4 < 9\) true or false? +
+

Answer: True — four is less than nine.

+
+
+ +

Difficult

+ +
+ Which is bigger: \(7\) or \(5\)? Write a true comparison using \(>\) or \(<\). +
+

Answer: Seven is bigger. Examples: \(7 > 5\) or \(5 < 7\).

+
+
+ +
+ What does \(1/2\) mean in words? +
+

Answer: One half — one part out of two equal parts.

+
+
+ +
+ A shirt costs \(20\) dollars. The tag says \(25\%\) off. What does \(25\%\) mean? +
+

Answer: Twenty-five out of every hundred — a quarter of the price is taken off (you will learn to compute the exact dollars later).

+
+
+ +

Hardcore

+ +
+ Write \(2 \times 3 + 1\) in words two ways: (a) if you multiply first, (b) if you add inside brackets as \((2 \times 3) + 1\) only — are the totals the same as \(2 \times (3 + 1)\)? +
+

Answer: \((2 \times 3) + 1 = 7\). \(2 \times (3 + 1) = 2 \times 4 = 8\). They are not the same — brackets change the result.

+

Explanation: Brackets show which group to do first; this is why notation matters.

+
+
+ +
+ Name two other symbols that can mean “multiply” besides \(\times\). +
+

Answer: Dot \(\cdot\) and asterisk \(*\) (on keyboards/calculators).

+
+
+ +
+ Read \(1{,}000 + 500 = 1{,}500\) aloud. What job does the comma do in \(1{,}000\)? +
+

Answer: “One thousand plus five hundred equals one thousand five hundred.” The comma groups digits in threes to show thousands.

+
+
+ +

References

+ +
diff --git a/content/math/directed-numbers-rates/_index.md b/content/math/directed-numbers-rates/_index.md index d384028..8088db2 100644 --- a/content/math/directed-numbers-rates/_index.md +++ b/content/math/directed-numbers-rates/_index.md @@ -2,7 +2,7 @@ title = "Directed numbers, rates & ratios" description = "Operate with negative numbers and solve ratio, rate, and proportion problems in context." template = "chapter.html" -weight = 1 +weight = 2 [extra] subject = "math" chapter_id = "directed-numbers-rates" diff --git a/data/math-curriculum.json b/data/math-curriculum.json index 5d6cd54..57ac57c 100644 --- a/data/math-curriculum.json +++ b/data/math-curriculum.json @@ -4,7 +4,8 @@ "intro": "Topic units across three strands. The map shows required prerequisites; the list follows a readable teaching order.", "graph": { "edges": [ - { "from": "counting-and-numbers", "to": "directed-numbers-rates" }, + { "from": "counting-and-numbers", "to": "basic-math-notation" }, + { "from": "basic-math-notation", "to": "directed-numbers-rates" }, { "from": "directed-numbers-rates", "to": "polynomials-expansion-factorisation" }, { "from": "polynomials-expansion-factorisation", "to": "algebraic-fractions-formulas" }, { "from": "polynomials-expansion-factorisation", "to": "linear-equations-two-unknowns" }, @@ -57,6 +58,13 @@ "status": "live", "curriculums": ["Foundation"] }, + { + "slug": "basic-math-notation", + "title": "Basic math notation", + "description": "Learn the names and meanings of plus, minus, times, divide, equals, brackets, and other signs used in number sentences.", + "status": "live", + "curriculums": ["Foundation"] + }, { "slug": "directed-numbers-rates", "title": "Directed numbers, rates & ratios", diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 49aba10..6b0212f 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -36,11 +36,23 @@ function mountFooterYear() { } } +function scheduleChapterMath() { + void import("./lib/render-math").then(({ renderBookMath }) => { + requestAnimationFrame(() => renderBookMath()); + }); +} + function mountChapterWidgets() { const article = document.querySelector("[data-chapter]"); const chapterKey = article?.dataset.chapter; const mounts = document.querySelectorAll("[data-widget]"); - if (!chapterKey || mounts.length === 0) return; + if (!article || !chapterKey) return; + + // KaTeX must run on widget-less chapters too (renderBookMath was only chained after widgets). + if (mounts.length === 0) { + scheduleChapterMath(); + return; + } void import("./generated/chapter-widgets").then(({ chapterWidgetLoaders }) => { const loadPromises: Promise[] = []; @@ -62,10 +74,7 @@ function mountChapterWidgets() { } void Promise.all(loadPromises).then(() => { - if (!document.querySelector(".book-prose")) return; - void import("./lib/render-math").then(({ renderBookMath }) => { - requestAnimationFrame(() => renderBookMath()); - }); + scheduleChapterMath(); }); }); }