{{-- Math Input Guide — how authors write KaTeX in question/answer/hint/solution fields. KaTeX auto-render ignores by default, so the left column shows the literal markup and the right column shows the live-rendered result. --}}

Math is written with KaTeX. Wrap it in delimiters so it renders for students:

Inline math — use this by default

Wrap with $…$ (or \(…\)). Flows inside a sentence and keeps fractions a sensible size.

Type What is $\dfrac{3}{4}$ of 20? → What is $\dfrac{3}{4}$ of 20?

Display math — standalone only

Wrap with $$…$$ (or \[…\]). Centres on its own line, larger. Use only for a standalone equation.

Type $$\dfrac{3}{4} \times 20 = 15$$ →

$$\dfrac{3}{4} \times 20 = 15$$

Tip: default to inline $…$. Don't use $$…$$ inside a sentence — it forces a big, centred break. To show a literal dollar sign (money), escape it: \$5 → \$5.

Common building blocks

Left = what you type (inside $…$); right = what students see.

@php $rows = [ ['Fraction (inline)', '\dfrac{3}{4}', '$\dfrac{3}{4}$'], ['Fraction (small)', '\tfrac{3}{4}', '$\tfrac{3}{4}$'], ['Mixed number', '2\tfrac{1}{2}', '$2\tfrac{1}{2}$'], ['Power / exponent', 'x^2,\; 2^{10}', '$x^2,\; 2^{10}$'], ['Subscript', 'x_1,\; a_{n}', '$x_1,\; a_{n}$'], ['Square root', '\sqrt{16}', '$\sqrt{16}$'], ['Other roots', '\sqrt[3]{27}', '$\sqrt[3]{27}$'], ['Multiply', '3 \times 4,\; 3 \cdot 4', '$3 \times 4,\; 3 \cdot 4$'], ['Divide', '12 \div 4', '$12 \div 4$'], ['Plus / minus', '\pm,\; \mp', '$\pm,\; \mp$'], ['Percent', '50\%', '$50\%$'], ['Degrees', '90^\circ', '$90^\circ$'], ['Compare', '\le,\; \ge,\; \ne', '$\le,\; \ge,\; \ne$'], ['Approx / proportion', '\approx,\; \propto', '$\approx,\; \propto$'], ['Pi & area', '\pi r^2', '$\pi r^2$'], ['Brackets that grow', '\left(\dfrac{a}{b}\right)', '$\left(\dfrac{a}{b}\right)$'], ['Decimal / ratio', '3 : 4,\; 0.75', '$3 : 4,\; 0.75$'], ['Degrees Celsius', '25^\circ\text{C}', '$25^\circ\text{C}$'], ['Units with text', '5\ \text{cm}^2', '$5\ \text{cm}^2$'], ['Angle / triangle', '\angle ABC,\; \triangle', '$\angle ABC,\; \triangle$'], ]; @endphp @foreach ($rows as [$purpose, $code, $rendered]) @endforeach
Purpose You type Result
{{ $purpose }} {{ $code }} {!! $rendered !!}

Worked example

You type:
A recipe needs $\dfrac{2}{3}$ cup of sugar. For $4\tfrac{1}{2}$ batches, how much sugar is needed? Give the answer as $\square$ cups.
Students see:

A recipe needs $\dfrac{2}{3}$ cup of sugar. For $4\tfrac{1}{2}$ batches, how much sugar is needed? Give the answer as $\square$ cups.

Reminder: FIB answers are numeric/decimal only — fraction or mixed-number answers should be MCQ. Keep the question text verbatim from the source; explanatory wording goes in hints/solutions.

{{-- KaTeX auto-render. /
 are in the default ignore list, so the
         "you type" cells stay literal while the result cells render. --}}