aboutsummaryrefslogtreecommitdiff
path: root/test/typst-reader.typ
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-07-06 12:20:01 -0700
committerJohn MacFarlane <[email protected]>2023-07-06 12:20:20 -0700
commita2be4ac62bfd95ce8007af0de925a675bd782fa2 (patch)
treee7c5fa1e5bfed448ca558461263425104c7817a2 /test/typst-reader.typ
parent001531e604873f43ac41d7729f6fa6c0a86c0bbf (diff)
Add typst reader tests.
Closes #8942.
Diffstat (limited to 'test/typst-reader.typ')
-rw-r--r--test/typst-reader.typ28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/typst-reader.typ b/test/typst-reader.typ
new file mode 100644
index 000000000..3b7541be1
--- /dev/null
+++ b/test/typst-reader.typ
@@ -0,0 +1,28 @@
+#set page(width: 10cm, height: auto)
+#set heading(numbering: "1.")
+
+= Fibonacci sequence
+The Fibonacci sequence is defined through the
+recurrence relation $F_n = F_(n-1) + F_(n-2)$.
+It can also be expressed in _closed form:_
+
+$ F_n = round(1 / sqrt(5) phi.alt^n), quad
+ phi.alt = (1 + sqrt(5)) / 2 $
+
+#let count = 8
+#let nums = range(1, count + 1)
+#let fib(n) = (
+ if n <= 2 { 1 }
+ else { fib(n - 1) + fib(n - 2) }
+)
+
+The first #count numbers of the sequence are:
+
+#align(center, table(
+ columns: count,
+ ..nums.map(n => $F_#n$),
+ ..nums.map(n => str(fib(n))),
+))
+
+#include "undergradmath.typ"
+