Added the exercice math environment.

This commit is contained in:
orca 2024-02-04 07:11:49 +01:00
parent 574d4a44c9
commit 926fc0d50b
Signed by: orca
GPG Key ID: 6923B8DFED96A68A
4 changed files with 9 additions and 4 deletions

View File

@ -86,4 +86,6 @@
#lorem(30)
]
#lorem(10)
#exercise()[
#lorem(10)
]

View File

@ -19,4 +19,5 @@
#let definition-id = "Définition"
#let remark-id = "Remarque"
#let example-id = "Exemple"
#let exercise-id = "Exercice"
#let proof-id = "Démonstration"

View File

@ -55,8 +55,9 @@
#let definition(body, name: "") = math-block(name: name, id: definition-id, decoration: "outline", body)
#let remark(body, name: "") = math-block(name: name, id: remark-id, decoration: "none", body + v-space)
#let example(body, name: "") = math-block(name: name, id: example-id, decoration: "none", body + v-space)
#let remark(body, name: "") = math-block(name: name, id: remark-id, decoration: "none", body + v-space)
#let example(body, name: "") = math-block(name: name, id: example-id, decoration: "none", body + v-space)
#let exercise(body, name: "") = math-block(name: name, id: exercise-id, decoration: "none", body + v-space)
/* It takes the body of the proof, and formats it by adding the QED
symbol at the end, and the _#proof-id._ text at the front. */

View File

@ -2,7 +2,7 @@
// If something is unclear, check the Typst docs or file an issue.
// ===============================================================
#import "environments.typ": proposition, lemma, theorem, corollary, definition, remark, example, proof, numbered-equation
#import "environments.typ": proposition, lemma, theorem, corollary, definition, remark, example, exercise, proof, numbered-equation
// Configuration of the paper.
// ---------------------------
@ -43,6 +43,7 @@
show figure.where(kind: definition-id): it => it.body
show figure.where(kind: remark-id): it => it.body
show figure.where(kind: example-id): it => it.body
show figure.where(kind: exercise-id): it => it.body
show figure.where(kind: proof-id): it => it.body
/* Show headings like in amsart. */