diff options
Diffstat (limited to 'tests/typ/math/syntax.typ')
| -rw-r--r-- | tests/typ/math/syntax.typ | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/tests/typ/math/syntax.typ b/tests/typ/math/syntax.typ index 8ffded29..26d3e444 100644 --- a/tests/typ/math/syntax.typ +++ b/tests/typ/math/syntax.typ @@ -1,23 +1,18 @@ -#set page(width: auto) -#show <table>: it => table( - columns: 2, - inset: 8pt, - ..it.text - .split("\n") - .map(line => (raw(line, lang: "typ"), text("Latin Modern Roman", eval(line)))) - .flatten() -) +// Test math syntax. -``` -Let $x in NN$ be ... -$ (1 + x/2)^2 $ -$ x arrow.l y $ -$ sum_(n=1)^mu 1 + (2pi(5 + n)) / k $ -$ { x in RR | x "is natural" and x < 10 } $ -$ sqrt(x^2) = frac(x, 1) $ -$ "profit" = "income" - "expenses" $ -$ x < #for i in range(5) [$ #i < $] y $ -$ 1 + 2 = #{1 + 2} $ -$ A subset.eq.not B $ -``` -<table> +--- +// Test Unicode math. +$ ∑_(i=0)^ℕ a ∘ b = \u{2211}_(i=0)^NN a compose b $ + +--- +// Test a few shorthands. +$ underline(f' : NN -> RR) \ + n |-> cases( + [|1|] &"if" n >>> 10, + 2 * 3 &"if" n != 5, + 1 - 0 thick &..., + ) $ + +--- +// Error: 1:3 expected dollar sign +$a |
