From c645fc870c45951cf94d2c4ecfdfaf870e9ffbfb Mon Sep 17 00:00:00 2001 From: Maxime Augier Date: Wed, 18 Sep 2024 14:40:21 +0200 Subject: [PATCH] Exos --- README.md | 9 +++++---- exo/0.1.0/lib.typ | 36 ++++++++++++++++++++++++++++++++++++ exo/0.1.0/typst.toml | 7 +++++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 exo/0.1.0/lib.typ create mode 100644 exo/0.1.0/typst.toml diff --git a/README.md b/README.md index c1911c6..ff2ad30 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,12 @@ git clone ~/.local/share/typst/packages/y-sec ## Templates: - - [Slides](slides) - - [Test écrit](exam) ([exemple](exam/demo.typ), [pdf](exam/demo.pdf)) - - [Laboratoire](lab) + - [Slides](slides/0.1.0) + - [Test écrit](exam/0.2.0) ([exemple](exam/0.2.0/demo.typ), [pdf](exam/0.2.0/demo.pdf)) + - [Laboratoire](lab/0.1.0) + - [Feuille d'exercices](exo/0.1.0) -## Options de compilation: +## Options de compilation pour exams/labs: Choisir le mode de rendu avec `typst compile --input mode=` diff --git a/exo/0.1.0/lib.typ b/exo/0.1.0/lib.typ new file mode 100644 index 0000000..2e53ace --- /dev/null +++ b/exo/0.1.0/lib.typ @@ -0,0 +1,36 @@ +#let exercice(course: "Course", title: "Title", doc) = { + + set text(font: "Carlito") + + set page(header: context { + if counter(page).get().first() > 1 { text(size: 0.8em)[#course - #title]} }, + footer: [], + numbering: "1 / 1" + ) + + set par(first-line-indent: 2em) + + set heading(numbering: "1.1. ") + + show heading: set block(spacing: + 1.5em) + + set enum(indent: 1em, numbering: "1.a.") + + show link: set text(fill: blue.darken(20%)) + + v(10em) + + + + align(center, text(size: 1.7em, course)) + + align(center, text(size: 1.5em, title)) + + v(5em) + + + doc + } + + diff --git a/exo/0.1.0/typst.toml b/exo/0.1.0/typst.toml new file mode 100644 index 0000000..95ea43c --- /dev/null +++ b/exo/0.1.0/typst.toml @@ -0,0 +1,7 @@ +[package] +name = "exo" +version = "0.1.0" +entrypoint = "lib.typ" +authors = ["Maxime Augier "] +license = "MIT" +description = "Exercise sheet"