Added a manual file.

Resolves #3.
This commit is contained in:
orca 2024-02-04 08:25:38 +01:00
parent 926fc0d50b
commit 5347a9aabd
Signed by: orca
GPG Key ID: 6923B8DFED96A68A
4 changed files with 62 additions and 96 deletions

View File

@ -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.

View File

@ -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

View File

@ -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)
]

57
source/manual.typ Normal file
View File

@ -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.
] <orca>
#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 $
] <eq>
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.