Skip to content

Commit

Permalink
ennui-ur-report:0.1.0 (#1605)
Browse files Browse the repository at this point in the history
  • Loading branch information
leana8959 authored Jan 23, 2025
1 parent e9b9f6f commit c785a41
Show file tree
Hide file tree
Showing 10 changed files with 1,009 additions and 0 deletions.
674 changes: 674 additions & 0 deletions packages/preview/ennui-ur-report/0.1.0/LICENSE

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions packages/preview/ennui-ur-report/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ennui-ur-report
Since University of Rennes doesn't have an official template.
This is a minimal, highly customizable, non-official attempt of one.

Feel free to open a PR if this template doesn't cover your use case, or you would like to add a
feature :)

## Namesake
ennui because it's boring. Also because inside out is a nice movie.

## Example
You can either use this as a simple handout, or a more sophisticated internship report.
Check out examples folder in the repository for these examples, or docs folder for the handbook.

## TODOS
- [x] pick a non canonical package name
- [x] update examples to package name and not relative path
- [ ] reimplement appendix when it is possible to figure out how to handle the counter
- [ ] show logo when coverpage is turned off? if so, what should the layout be?
112 changes: 112 additions & 0 deletions packages/preview/ennui-ur-report/0.1.0/assets/UNIVRENNES_LOGOnoir.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions packages/preview/ennui-ur-report/0.1.0/examples/compte-rendu.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This is both an example and a test

#import "@preview/ennui-ur-report:0.1.0": conf

#show: conf.with(
"Compte Rendu",
("John Doe", "Jane Doe"),
with-toc: false,
with-coverpage: false,
)

= Foo
== Bar
=== Baz

```bash
# Dangerous ! Boom !
:(){ :|:& };:
```
#lorem(50)
https://wikipedia.org

= Another heading
$
(lambda x. x) v -> v
$
#lorem(50)
51 changes: 51 additions & 0 deletions packages/preview/ennui-ur-report/0.1.0/examples/rapport-stage.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#import "@preview/ennui-ur-report:0.1.0": conf, style-author-default

#show: conf.with(
"Etude d'un Sujet Profondément Intéressant",
("John Doe", "Jane Doe"),
with-toc: true,
with-coverpage: true,
// Override the logo
layout-logo: logos => {
set align(center)
stack(
dir: ltr,
1.2fr,
logos.at("istic")(height: 2.7em),
3em,
logos.at("univ-rennes")(height: 3em),
1fr,
)
},
// Add a subtitle
subtitle: smallcaps[
#set text(1.1em)
#text(1.24em)[Rapport de Stage de L3 Informatique] \
ISTIC - Université de Rennes \
Année 2023 - 2024
],
// Add text to the author field
style-author: who => style-author-default[
#who \
Rennes \
Supervisé par Jean Dupont \
Du 2023 à 2024
],
)

= Foo
== Bar
=== Baz

```bash
# Dangerous ! Boom !
:(){ :|:& };:
```
#lorem(50)
https://wikipedia.org

= Another heading
$
(lambda x. x) v -> v
$
#lorem(50)
109 changes: 109 additions & 0 deletions packages/preview/ennui-ur-report/0.1.0/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#let layout-logo-default(opts) = {
let logo = opts.univ-rennes
align(center, logo(height: 4em))
}

#let style-title-default(it) = text(1.6em)[*#it*]
#let style-author-default(it) = text(1.4em)[#it]

/// Test
#let conf(
/// -> str
title,
/// -> str | array
author,
/// -> str
lang: "fr",
/// -> str
font: "New Computer Modern",
/// -> length
fontsize: 1em,
/// -> bool
with-coverpage: true,
/// -> bool
with-toc: true,
/// A lambda called with the university and ISTIC's logo by default
/// -> function
layout-logo: layout-logo-default,
/// Style `title` on cover page, no effect if cover page disabled
/// -> function
style-title: style-title-default,
/// Style `author` on cover page, no effect if cover page disabled
/// -> function
style-author: style-author-default,
/// A subtitle that would go over the title on the coverpage,
/// no effect if cover page disabled
subtitle: [],
/// Anything that you want to set before any content (including the cover page
/// and toc)
pre-show: x => x,
doc,
) = {
if type(author) == array {
author = author.join(", ")
}

set document(title: title, author: author)
set text(size: fontsize, lang: lang, font: font, hyphenate: true)
set par(justify: true)
set heading(numbering: "1.1 -")

show ref: underline
show ref: emph
show link: text.with(rgb("#0000EE"))
show link: underline
show link: emph

show: pre-show

if with-coverpage {
stack(
dir: ttb,
subtitle,
4em,
style-title(title),
5fr,
style-author(author),
1fr,
layout-logo((
univ-rennes: image.with("assets/UNIVRENNES_LOGOnoir.svg"),
istic: image.with("assets/istic.png"),
inria: image.with("assets/inria_logo_rouge.svg")
)),
)
pagebreak()
}

if with-toc {
// Separate toplevel outline entries
show outline.entry.where(level: 1): it => {
v(1.2em, weak: true)
strong(it)
}
outline(indent: auto)
pagebreak()
}

// Content starts here
set page(numbering: "1 / 1", number-align: right)
counter(page).update(1)

// Show a smaller title when the coverpage is not visible
if not with-coverpage {
let title-text = text(size: 2em)[#title]
let author-text = text(size: 1.2em)[#author]

show: box.with(width: 100%)
set align(center + bottom)
context if (
measure(title-text).width > page.width / 3 or measure(author-text).width > page.width / 3 or measure(author-text).width + measure(title-text).width > page.width
) {
stack(dir: ttb, title-text, 1em, author-text)
} else {
stack(dir: ltr, 7fr, title-text, 1fr, author-text, 7fr)
}
v(7em)
}

doc
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/preview/ennui-ur-report/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "ennui-ur-report"
version = "0.1.0"
entrypoint = "lib.typ"
authors = ["Léana 江 <@leana8959>"]
license = "GPL-3.0-or-later"
description = "A customizable, non official template for University of Rennes"
repository = "https://github.com/leana8959/univ-rennes.typ"
keywords = ["university", "rennes", "template", "france"]
categories = ["report"]
exclude = ["thumbnail.png"]

[template]
path = "examples/"
entrypoint = "rapport-stage.typ"
thumbnail = "thumbnail.png"

0 comments on commit c785a41

Please sign in to comment.