From 5347a9aabd363fb158482d16f6a70c73ba0bcaf2 Mon Sep 17 00:00:00 2001 From: orca Date: Sun, 4 Feb 2024 08:25:38 +0100 Subject: [PATCH] Added a manual file. Resolves #3. --- README.md | 4 +- makefile | 6 +-- source/example.typ | 91 ---------------------------------------------- source/manual.typ | 57 +++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 96 deletions(-) delete mode 100644 source/example.typ create mode 100644 source/manual.typ diff --git a/README.md b/README.md index 1e1c458..62f2ec7 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,6 @@ When there will be updates, run `git pull`. ## How to get started -See the `source/example.typ` file for an example of it's usage. +See the `source/manual.typ` file for an example of it's usage. -Run `make example` to compile it. +Run `make manual` to compile it. diff --git a/makefile b/makefile index 701133e..fed5cdc 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ TARGET := ./main.pdf SOURCE := ./source/user/main.typ -EXAMPLE := ./source/example.typ +MANUAL := ./source/manual.typ PDF_VIEWER := zathura TYPST_FLAGS := --root ./source @@ -16,7 +16,7 @@ clean: watch: @typst w $(TYPST_FLAGS) $(SOURCE) $(TARGET) &> /dev/null & -example: $(EXAMPLE) +manual: $(MANUAL) @typst c $(TYPST_FLAGS) $< $(TARGET) -.PHONY: build view clean watch example +.PHONY: build view clean watch manual diff --git a/source/example.typ b/source/example.typ deleted file mode 100644 index c8c5cbd..0000000 --- a/source/example.typ +++ /dev/null @@ -1,91 +0,0 @@ -#import "template/template.typ": * - -#show: paper => configuration( - title: lorem(5), - authors: ( - ( - name: "Lorem ipsum.", - affiliation: "Lorem institute", - email: "lorem.ipsum@example.org", - ), - ), - abstract: lorem(35), - paper -) - -= #lorem(6) - -#lorem(70) - -= #lorem(5) -#lorem(30) - -#definition(name: lorem(2))[ - #lorem(5) - - #lorem(18) -] - -== #lorem(4) - -#lorem(50) - -#theorem(name: lorem(1))[ - #lorem(4) - - #lorem(20) - - #numbered-equation[ - $ integral.double_S arrow(A) dot arrow(dif S) $ - ] - - #lorem(7) -] - -== #lorem(4) - -#lorem(40) - -#proposition[ - #lorem(10) - - $ integral_(a)^(+ oo) f(x) dif x $ - - #lorem(6) - - $ sum f(n) $ - - #lorem(12) -] - -#lorem(30) - -= #lorem(4) - -#lorem(20) - -== #lorem(7) - -#lorem(20) - -#remark(name: lorem(2))[ - #lorem(30) -] - -#lorem(10) - -#lemma[ - #lorem(13) -] - -#proof[ - #lorem(25) -] - -#example[ - #lorem(30) -] - -#exercise()[ - #lorem(10) -] diff --git a/source/manual.typ b/source/manual.typ new file mode 100644 index 0000000..eac9158 --- /dev/null +++ b/source/manual.typ @@ -0,0 +1,57 @@ +#import "template/template.typ": * + +#show: paper => configuration( + title: "Short guide to math-typst.", + authors: ( + ( + name: "Orca", + affiliation: "git.disroot.org/orca/math-typst", + email: "orcinus_orca@disroot.org", + ), + ), + abstract: "This PDF explains how to use math-typst.", + paper +) + += Introduction + +This packages aims to provide a good enough interface for writing a mathematical course in it. + +As of now, it consists of the most used mathematical environments in courses #footnote[The environments provided are: `proposition`, `lemma`, `theorem`, `corollary`, +`definition`, `remark`, `example`, `exercise`, `proof`, and `numbered-equation`.]. + += How to use + +With the exception of `proof`, environments behave like `theorem`. Simply type the environment name followed by it's body +in square brackets. You may name the particular environment by appending `(name: "The name")` after the environment name. + +== Example + +#theorem(name: "Orca")[ + Let $P in ZZ[X]$ and $N in NN^*$ be such that for all $n in NN$, if $n >= N$, then $P(n)$ is prime. + We have that $P$ is constant. +] + +#proof[ + Let's consider + + $ P: x |-> sum_(i = 0)^(deg P) a_i x^i, " with " a_i in ZZ " for " i in [|0, deg P|]. $ + + Suppose there exists $N in NN^*$ such that for all $n >= N$, $P(n)$ is prime. + + We have, for $alpha, beta in NN^*$, + + #numbered-equation(name: "E")[ + $ P(alpha + beta) = P(alpha) + k beta, " with " k in ZZ $ + ] + + The equation @eq follows from the definition of $P$ and the binomial theorem. + + In particular, if $alpha >= N$ and $beta = n abs(P(alpha))$ with $n in NN^*$, then $P(alpha)$ divides $P(alpha + beta)$. + + Since they're both primes, we have $epsilon P(alpha) = P(alpha + beta)$, with $epsilon in {-1, 1}$ and $n$ a variable. + + We then find that $P - epsilon P(alpha)$ cancels an infinite amount of times, showing that $P$ is constant. +] + +Unfortunately, it seems like the theorem @orca is not useful at all.