-
Notifications
You must be signed in to change notification settings - Fork 728
zen-utbm-report:0.1.0 #3159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
zen-utbm-report:0.1.0 #3159
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
745509a
add utbm-report
langonne 2e1dfe7
add thumbnail. fix variable name
langonne 0d0cb75
Add categories field to typst.toml
langonne 1407970
set the correct path for the lib and add an example
langonne c96d7e0
change variables in snake_case to kebab-case
langonne d6303bb
Merge branch 'main' of https://github.com/langonne/packages
langonne c6d8553
fix path for logo
langonne 3cd4f77
remove pdf example
langonne 527f647
change variables in snake_case to kebab-case
langonne 4950ae1
rename package to zen-utbm-report
langonne 3699fae
remove gmf box
langonne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2025 langonne | ||
|
||
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# utbm-report | ||
|
||
Minimal, customizable Typst template for UTBM report submissions. | ||
|
||
> [!NOTE] | ||
> **Institution & logo attribution** | ||
> The template uses the **Université de Technologie de Belfort-Montbéliard (UTBM)** logo. | ||
> See [https://www.utbm.fr](https://www.utbm.fr) for the institution’s official website. | ||
> Use of this logo is subject to UTBM’s own policies, users should verify the authorization for their context. | ||
|
||
## Overview | ||
|
||
`utbm-report` provides a simple report wrapper with sensible defaults for UTBM coursework. It sets up the page, title area, optional outline. | ||
|
||
## Features | ||
|
||
- Pre-made cover page: automatically formatted, only requires title, subject, and authors | ||
|
||
- Semester detection: Spring or Autumn semester inferred automatically from the date | ||
|
||
- Built-in table of contents (“Sommaire”) | ||
|
||
## Install | ||
|
||
```typst | ||
#import "@preview/utbm-report:0.1.0": report | ||
``` | ||
|
||
## Quick Start | ||
|
||
Minimal usage: | ||
|
||
```typst | ||
#import "@preview/utbm-report:0.1.0": report | ||
|
||
#show: doc => report( | ||
doc_title: [My First UTBM Report], | ||
doc_author: ("Alice Martin", "Bob Dupont"), | ||
course_name: "IF2", | ||
doc | ||
) | ||
|
||
= Introduction | ||
|
||
Your content starts here. | ||
``` | ||
|
||
## Parameters | ||
|
||
`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**`)` | ||
|
||
| Parameter | Type / Example | Default | Notes | | ||
| ------------------- | ------------------------------------ | ----------------------- | ---------------------------------------- | | ||
| `doc_title` | content block: `[Title]` | `[Title]` | Shown on the title page. | | ||
| `doc_author` | `string`|`array` : `("Alice","Bob")` | `("Author1","Author2")` | Authors on the title page. | | ||
| `doc_date` | `auto` or `datetime type` | `auto` | Print date on cover; `auto` uses today. | | ||
| `page_paper` | string: `"a4"` | `"a4"` | Paper size. | | ||
| `page_numbering` | string: `"1"` | `"1"` | Page number format (e.g., `"1"`). | | ||
| `text_size` | length: `12pt` | `12pt` | Base text size. | | ||
| `text_lang` | language code: `"fr"` | `"fr"` | Sets text language (hyphenation, etc.). | | ||
| `text_font` | font family: `"New Computer Modern"` | `"New Computer Modern"` | Base font family. | | ||
| `par_justify` | bool | `true` | Paragraph justification toggle. | | ||
| `heading_numbering` | string: `"11"` | `"11"` | Heading numbering style (Typst pattern). | | ||
| `show_outline` | bool | `true` | Insert an outline (“Sommaire”) page. | | ||
| `outline_title` | string: `"Sommaire"` | `"Sommaire"` | Title used for the outline page. | | ||
| `course_name` | string | `"Course name"` | Appears on title area. | | ||
| `doc` | document content | *(required)* | Your report body. | | ||
|
||
## Full Example | ||
|
||
Paste this into a fresh `.typ` file: | ||
|
||
```typst | ||
#import "@preview/utbm-report:0.1.0": report | ||
|
||
#show: doc => report( | ||
doc_title: [Rapport TP n°1], | ||
doc_author: ("Alice Martin", "Bob Dupont"), | ||
doc_date: datetime(year: 2025, month: 9, day: 14), | ||
page_paper: "a4", | ||
page_numbering: "1", | ||
text_size: 12pt, | ||
text_lang: "fr", | ||
text_font: "New Computer Modern", | ||
par_justify: true, | ||
heading_numbering: "11", | ||
show_outline: true, | ||
outline_title: "Sommaire", | ||
course_name: "IF2", | ||
doc | ||
) | ||
|
||
= Introduction | ||
|
||
This template helps you meet UTBM conventions with minimal setup. | ||
|
||
== Motivation | ||
State the problem you are solving and the expected outcomes. | ||
|
||
= Methods | ||
|
||
Explain your approach, assumptions, and tools. | ||
|
||
== Algorithm | ||
Present your algorithm and its complexity. | ||
|
||
= Results | ||
|
||
Summarize the key findings, tables, or figures. | ||
|
||
= Conclusion | ||
|
||
Wrap up with lessons learned and potential improvements. | ||
``` | ||
|
||
## License | ||
|
||
MIT © langonne | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#let report( | ||
doc-title: [Title], | ||
doc-author: ("Author1", "Author2"), | ||
doc-date: auto, | ||
page-paper: "a4", | ||
page-numbering: "1", | ||
text-size: 12pt, | ||
text-lang: "fr", | ||
text-font: "New Computer Modern", | ||
par-justify: true, | ||
heading-numbering: "11", | ||
show-outline: true, | ||
outline-title: "Sommaire", | ||
course-name: "Course name", | ||
doc, | ||
) = { | ||
set document( | ||
title: doc-title, | ||
author: doc-author, | ||
date: doc-date, | ||
) | ||
set page( | ||
paper: page-paper, | ||
) | ||
set text( | ||
font: text-font, | ||
lang: text-lang, | ||
size: text-size, | ||
) | ||
set par( | ||
justify: par-justify, | ||
) | ||
set heading( | ||
numbering: heading-numbering, | ||
) | ||
let date = datetime.today() | ||
if type(doc-date) == datetime { | ||
date = doc-date | ||
} | ||
let year = date.display("[year repr:last_two]") | ||
let month = date.display("[month]") | ||
let semester = if month < "09" { | ||
text("P") | ||
} else { | ||
text("A") | ||
} | ||
v(15%) | ||
align(center)[ | ||
#image("../assets/utbm_logo.jpg", width: 40%) | ||
] | ||
align(center)[ | ||
#text(size: 20pt, weight: "bold")[#doc-title] | ||
#linebreak() | ||
#text(size: 20pt)[#course-name] | ||
#linebreak() | ||
#text( | ||
size: 20pt, | ||
)[ | ||
#if type(doc-author) == str { | ||
doc-author | ||
} else { | ||
box( | ||
width: 50%, | ||
par( | ||
justify: false, | ||
)[ | ||
#doc-author.join(" - ") | ||
], | ||
) | ||
} | ||
] | ||
] | ||
v(40%) | ||
align(center)[ | ||
#text(size: 16pt)[#semester#year] | ||
] | ||
if show-outline { | ||
pagebreak() | ||
outline( | ||
indent: auto, | ||
title: "Sommaire", | ||
) | ||
} | ||
pagebreak() | ||
set page( | ||
numbering: page-numbering, | ||
) | ||
doc | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "utbm-report" | ||
saecki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
version = "0.1.0" | ||
entrypoint = "template/lib.typ" | ||
authors = ["langonne <https://github.com/langonne>"] | ||
license = "MIT" | ||
description = "Minimalist & customizable for submitting UTBM's reports." | ||
repository = "https://github.com/langonne/utbm-report" | ||
keywords = ["UTBM","report"] | ||
categories = ["report"] | ||
|
||
[template] | ||
path = "template" | ||
entrypoint = "lib.typ" | ||
saecki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
thumbnail = "thumbnail.png" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.