refactor, add template, add license

This commit is contained in:
Gaspard Jankowiak 2025-12-15 09:10:29 +01:00
commit 482bc0a088
5 changed files with 116 additions and 4 deletions

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Gaspard Jankowiak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -13,9 +13,9 @@
* Macros * Macros
*/ */
// Frame for table, no vertical lines, top and bottom are bold // stroke helper function for table, no vertical lines, top and bottom are bold
// s: stroke, to specify e.g. the width and color of strokes // s: stroke, to specify e.g. the width and color of strokes
#let frame(s) = (x, y) => ( #let horiz-only(s) = (x, y) => (
left: none, left: none,
right: none, right: none,
top: if y > 0 { s } else { 2*s }, top: if y > 0 { s } else { 2*s },

85
template/exam.typ Normal file
View file

@ -0,0 +1,85 @@
#import "@local/exam:0.2.0": exam, exercise, exercise-items, mtext, horiz-only
// General configuration
#show: exam.with(
title: "Exam",
course-title: [Abstract Binary Computation & Elegant Finite Graphs],
// Top left header
institution: [Super University],
// Top right header
course-short-title: "ABC & EFG",
date: "1. January 1970",
// Exam details, appears below the title
course-code: "π",
duration-minutes: "90",
// Configure personal information fields
ask-trainer-name: false,
ask-group: true,
ask-student-number: false,
// Configure language, either "de" or "en"
language: "en",
// custom instructions
// instructions: none,
// change font-size
// font-size: 12pt,
// custom paper size
// paper-size: "a4",
// custom numbering of exercises
// exercise-numbering: "1",
)
// First exercise
#exercise("Relations and their properties", 2)
Consider the relation $R subset NN^2$, defined as follows:
$ (x, y) in R #h(0.5cm) <==> #h(0.5cm) x + y #mtext[is odd]. $
Is $R$ reflexive? transitive? symmetric? antisymmetric?
// Second exercise
#exercise("Properties of functions", 3)
Let $f : (0, +infinity) (0, +infinity)$ with $f (x) = e^(-x)$.
// Several sub-questions
#exercise-items((
(1, [Is $f$ injective?]), // The first argument is the number
// of points the item is worth
(1, [Is $f$ surjective?]),
(2, [Is $f$ bijective?]),
))
// Third exercise
#exercise("Logical operators", 3.14)
Consider the following truthtable:
#align(center, table(
stroke: horiz-only(0.5pt),
columns: (auto, auto, auto),
align: center,
[$A$], [$B$], [$A or B$],
[1], [1], [1],
[1], [0], [1],
[0], [1], [1],
[0], [0], [1],
))
// More sub-questions
// override-points to false, so that the exercise total points are not recomputed.
#exercise-items(override-points: false, numbering: "i)", (
(1, [Is the truthtable correct?]),
(1, [If not, fix it.]),
))

BIN
thumbnail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

View file

@ -1,8 +1,14 @@
[package] [package]
name = "exam" name = "exam"
version = "0.1.0" version = "0.2.0"
entrypoint = "lib.typ" entrypoint = "src/lib.typ"
authors = ["Gaspard Jankowiak"] authors = ["Gaspard Jankowiak"]
license = "MIT" license = "MIT"
description = "Exams for NAWI Graz." description = "Exams for NAWI Graz."
compiler = "0.14.0" compiler = "0.14.0"
categories = ["layout", "office"]
[template]
path = "template"
entrypoint = "exam.typ"
thumbnail = "thumbnail.png"