Skip to content

Commit 64b0a8e

Browse files
authored
zen-utbm-report:0.1.0 (#3159)
1 parent 8ad5787 commit 64b0a8e

File tree

7 files changed

+274
-0
lines changed

7 files changed

+274
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 langonne
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# zen-utbm-report
2+
3+
Minimal, customizable Typst template for UTBM report submissions.
4+
5+
**Institution & logo attribution**
6+
The template uses the **Université de Technologie de Belfort-Montbéliard (UTBM)** logo.
7+
See [https://www.utbm.fr](https://www.utbm.fr) for the institution’s official website.
8+
Use of this logo is subject to UTBM’s own policies, users should verify the authorization for their context.
9+
10+
## Overview
11+
12+
`zen-utbm-report` provides a simple report wrapper with sensible defaults for UTBM coursework. It sets up the page, title area, optional outline.
13+
14+
## Features
15+
16+
- Pre-made cover page: automatically formatted, only requires title, subject, and authors
17+
18+
- Semester detection: Spring or Autumn semester inferred automatically from the date
19+
20+
- Built-in table of contents (“Sommaire”)
21+
22+
## Install
23+
24+
```typst
25+
#import "@preview/zen-utbm-report:0.1.0": report
26+
```
27+
28+
## Quick Start
29+
30+
Minimal usage:
31+
32+
```typst
33+
#import "@preview/zen-utbm-report:0.1.0": report
34+
35+
#show: doc => report(
36+
doc-title: [My First UTBM Report],
37+
doc-author: ("Alice Martin", "Bob Dupont"),
38+
course-name: "IF2",
39+
doc
40+
)
41+
42+
= Introduction
43+
44+
Your content starts here.
45+
```
46+
47+
## Parameters
48+
49+
`report(`**doc-title**, **doc-author**, **doc-date**, **page-paper**, **page-numbering**, **text-size**, **text-lang**, **text-font**, **par-justify**, **heading-numbering**, **show-outline**, **outline-title**, **course-name**, **doc**`)`
50+
51+
| Parameter | Type / Example | Default | Notes |
52+
| ------------------- | ------------------------------------ | ----------------------- | ---------------------------------------- |
53+
| `doc-title` | content block: `[Title]` | `[Title]` | Shown on the title page. |
54+
| `doc-author` | `string`|`array` : `("Alice","Bob")` | `("Author1","Author2")` | Authors on the title page. |
55+
| `doc-date` | `auto` or `datetime type` | `auto` | Print date on cover; `auto` uses today. |
56+
| `page-paper` | string: `"a4"` | `"a4"` | Paper size. |
57+
| `page-numbering` | string: `"1"` | `"1"` | Page number format (e.g., `"1"`). |
58+
| `text-size` | length: `12pt` | `12pt` | Base text size. |
59+
| `text-lang` | language code: `"fr"` | `"fr"` | Sets text language (hyphenation, etc.). |
60+
| `text-font` | font family: `"New Computer Modern"` | `"New Computer Modern"` | Base font family. |
61+
| `par-justify` | bool | `true` | Paragraph justification toggle. |
62+
| `heading-numbering` | string: `"11"` | `"11"` | Heading numbering style (Typst pattern). |
63+
| `show-outline` | bool | `true` | Insert an outline (“Sommaire”) page. |
64+
| `outline-title` | string: `"Sommaire"` | `"Sommaire"` | Title used for the outline page. |
65+
| `course-name` | string | `"Course name"` | Appears on title area. |
66+
| `doc` | document content | *(required)* | Your report body. |
67+
68+
## Full Example
69+
70+
Paste this into a fresh `.typ` file:
71+
72+
```typst
73+
#import "@preview/zen-utbm-report:0.1.0": report
74+
75+
#show: doc => report(
76+
doc-title: [Rapport TP n°1],
77+
doc-author: ("Alice Martin", "Bob Dupont"),
78+
doc-date: datetime(year: 2025, month: 9, day: 14),
79+
page-paper: "a4",
80+
page-numbering: "1",
81+
text-size: 12pt,
82+
text-lang: "fr",
83+
text-font: "New Computer Modern",
84+
par-justify: true,
85+
heading-numbering: "11",
86+
show-outline: true,
87+
outline-title: "Sommaire",
88+
course-name: "IF2",
89+
doc
90+
)
91+
92+
= Introduction
93+
94+
This template helps you meet UTBM conventions with minimal setup.
95+
96+
== Motivation
97+
State the problem you are solving and the expected outcomes.
98+
99+
= Methods
100+
101+
Explain your approach, assumptions, and tools.
102+
103+
== Algorithm
104+
Present your algorithm and its complexity.
105+
106+
= Results
107+
108+
Summarize the key findings, tables, or figures.
109+
110+
= Conclusion
111+
112+
Wrap up with lessons learned and potential improvements.
113+
```
114+
115+
## License
116+
117+
MIT © langonne
118+
119+
607 KB
Loading
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#let report(
2+
doc-title: [Title],
3+
doc-author: ("Author1", "Author2"),
4+
doc-date: auto,
5+
page-paper: "a4",
6+
page-numbering: "1",
7+
text-size: 12pt,
8+
text-lang: "fr",
9+
text-font: "New Computer Modern",
10+
par-justify: true,
11+
heading-numbering: "11",
12+
show-outline: true,
13+
outline-title: "Sommaire",
14+
course-name: "Course name",
15+
doc,
16+
) = {
17+
set document(
18+
title: doc-title,
19+
author: doc-author,
20+
date: doc-date,
21+
)
22+
set page(
23+
paper: page-paper,
24+
)
25+
set text(
26+
font: text-font,
27+
lang: text-lang,
28+
size: text-size,
29+
)
30+
set par(
31+
justify: par-justify,
32+
)
33+
set heading(
34+
numbering: heading-numbering,
35+
)
36+
let date = datetime.today()
37+
if type(doc-date) == datetime {
38+
date = doc-date
39+
}
40+
let year = date.display("[year repr:last_two]")
41+
let month = date.display("[month]")
42+
let semester = if month < "09" {
43+
text("P")
44+
} else {
45+
text("A")
46+
}
47+
v(15%)
48+
align(center)[
49+
#image("assets/utbm_logo.jpg", width: 40%)
50+
]
51+
align(center)[
52+
#text(size: 20pt, weight: "bold")[#doc-title]
53+
#linebreak()
54+
#text(size: 20pt)[#course-name]
55+
#linebreak()
56+
#text(
57+
size: 20pt,
58+
)[
59+
#if type(doc-author) == str {
60+
doc-author
61+
} else {
62+
box(
63+
width: 50%,
64+
par(
65+
justify: false,
66+
)[
67+
#doc-author.join(" - ")
68+
],
69+
)
70+
}
71+
]
72+
]
73+
v(40%)
74+
align(center)[
75+
#text(size: 16pt)[#semester#year]
76+
]
77+
if show-outline {
78+
pagebreak()
79+
outline(
80+
indent: auto,
81+
title: "Sommaire",
82+
)
83+
}
84+
pagebreak()
85+
set page(
86+
numbering: page-numbering,
87+
)
88+
doc
89+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#import "@preview/zen-utbm-report:0.1.0": report
2+
3+
#show: doc => report(
4+
doc-title: [My First UTBM Report],
5+
doc-author: ("Alice Martin", "Bob Dupont"),
6+
course-name: "IF2",
7+
doc,
8+
)
9+
10+
= Introduction
11+
12+
This template helps you meet UTBM conventions with minimal setup.
13+
14+
== Motivation
15+
State the problem you are solving and the expected outcomes.
16+
17+
= Methods
18+
19+
Explain your approach, assumptions, and tools.
20+
21+
== Algorithm
22+
Present your algorithm and its complexity.
23+
24+
= Results
25+
26+
Summarize the key findings, tables, or figures.
27+
28+
= Conclusion
29+
30+
Wrap up with lessons learned and potential improvements.
105 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "zen-utbm-report"
3+
version = "0.1.0"
4+
entrypoint = "lib.typ"
5+
authors = ["langonne <https://github.com/langonne>"]
6+
license = "MIT"
7+
description = "Minimalist & customizable for submitting UTBM's reports."
8+
repository = "https://github.com/langonne/zen-utbm-report"
9+
keywords = ["UTBM","report"]
10+
categories = ["report"]
11+
12+
[template]
13+
path = "template"
14+
entrypoint = "example.typ"
15+
thumbnail = "thumbnail.png"

0 commit comments

Comments
 (0)