diff --git a/packages/preview/volt-internship-ensea/0.1.0/README.md b/packages/preview/volt-internship-ensea/0.1.0/README.md new file mode 100644 index 0000000000..98873930c8 --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/README.md @@ -0,0 +1,76 @@ +# ENSEA - Typst Internship Template (unofficial) + +Unofficial Typst template for internship reports at ENSEA, a French engineering school. + +## Usage + +Either use this template in the Typst web app: +```typst +#import "@preview/volt-internship-ensea:0.1.0": * +``` +or use the command line to initialize a new project based on this template: +```typst +typst init @preview/volt-internship-ensea:0.1.0 +``` + +## Default Values + +| Parameter | Default Value | Description | Mandatory | +|--------------------------|----------------|----------------------------------------|------------| +| `company-logo` | `none` | Path to the company logo | ✅ | +| `authors` | `none` | Name(s) of the report author(s) | ✅ | +| `student-info` | `none` | Information about the student(s) | ✅ | +| `title` | `none` | Title of the internship report | ✅ | +| `internship-details` | `none` | Company name, location, duration, etc. | ✅ | +| `enable-list-figures` | `true` | Enable the list of figures | ❌ | +| `enable-list-tables` | `false` | Enable the list of tables | ❌ | +| `enable-glossary` | `false` | Enable the glossary | ❌ | +| `enable-abstract` | `true` | Enable the abstract | ❌ | +| `enable-bibliography` | `true` | Enable the bibliography | ❌ | + +## Example + +```typst +#import "@preview/volt-internship-ensea:0.1.0": * + +#show: internship.with( + company-logo: "template/media/logo.png", + authors: ( + "Jean DUPONT", + ), + student-info: [*Élève ingénieur en X#super[ème] année* #linebreak() + Promotion 20XX #linebreak() + Année 20XX/20XX], + title: [#lorem(10)], + internship-details: [Stage effectué du *1er mars au 30 août 2025*, au sein de la société *TechSolutions*, située à Paris. + + Sous la responsabilité de : #linebreak() + - M. *Pierre LEFEVRE*, Directeur de la Stratégie #linebreak() + - Mme *Marie DUBOIS*, Responsable des Opérations #linebreak() + ], + enable-list-figures: false, + enable-bibliography: false, +) + += Introduction +#lorem(120) +``` + +

+ + +
+ + +
+ + +

+ +## Contributions + +If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. + +## License + +The Typst template is licensed under the [MIT license](https://github.com/Dawod-G/ENSEA_Typst-Template/blob/main/LICENSE.md). This license does not apply to the ENSEA logo or associated image files, which remain the property of ENSEA. \ No newline at end of file diff --git a/packages/preview/volt-internship-ensea/0.1.0/assets/logo-ENSEA.png b/packages/preview/volt-internship-ensea/0.1.0/assets/logo-ENSEA.png new file mode 100644 index 0000000000..afd3dc6a36 Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/assets/logo-ENSEA.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/template-internship.typ b/packages/preview/volt-internship-ensea/0.1.0/template-internship.typ new file mode 100644 index 0000000000..ff7da006aa --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/template-internship.typ @@ -0,0 +1,459 @@ +#import "@preview/glossy:0.8.0": * +#import "@preview/hydra:0.6.2": anchor, hydra + +// ============================ +// CONFIGURATION +// ============================ + +#let internship( + // Mandatory variable + company-logo: none, + authors: none, + student-info: none, + title: none, + internship-details: none, + // Optional variable + enable-list-figures: true, + enable-list-tables: false, + enable-list-appendices: false, + enable-glossary: false, + enable-abstract: true, + enable-bibliography: true, + enable-appendices: true, + body, +) = { + // Check if all mandatory variables are defined. + if company-logo == none { + panic( + "The `company-logo` variable must be defined. It should be a string representing the path to the company logo.", + ) + } + + if authors == none { + panic( + "The `authors` variable must be defined. It should be a list of strings representing the authors of the report.", + ) + } + + if student-info == none { + panic( + "The `student-info` variable must be defined. It should be a string with the student's information.", + ) + } + + if title == none { + panic( + "The `title` variable must be defined. It should be a string representing the title of the report.", + ) + } + + if internship-details == none { + panic( + "The `internship-details` variable must be defined. It should be a string describing the details of the internship.", + ) + } + + set document(author: authors, title: title) + + set page(paper: "a4", margin: auto, number-align: center) + + // if "weak: true", the page break is skipped if the current page is already empty + set pagebreak(weak: true) + + set text(font: "New Computer Modern", size: 10pt, lang: "fr", region: "fr") + // for English: lang: 'en' and region: 'us' + // For other languages/regions, refer to this page: + // lang: https://en.wikipedia.org/wiki/ISO_639 + // region: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + + // Display links in blue. + show link: set text(fill: blue.darken(40%)) + + set heading(numbering: "I.1.a.") + show heading: set text(hyphenate: false) + show heading: set par(justify: false) + + show heading.where(level: 1): set text(fill: rgb("A6004C")) + + // Config. of the spacing after headings + show heading.where(level: 1): set block(spacing: 1.5em) + show heading.where(level: 2): set block(spacing: 1.25em) + show heading.where(level: 3): set block(spacing: 1em) + + show heading: set heading(supplement: "Section") + show heading.where(level: 1): set heading(supplement: "Chapitre") + + show heading: it => [ + #underline()[#it] + ] + + show underline: set underline(stroke: 1pt, offset: 2pt) + + let outline-spacing = 1em + + set list(indent: 15pt, marker: [--]) // config. of lists + + set math.equation(numbering: "(1)") + + show figure.where(kind: image): set figure(supplement: "Figure") + + // Configure the figure caption alignment: + // if figure caption has more than one line, + // it makes it left-aligned + show figure.caption: it => { + layout(size => [ + #let text-size = measure(it.supplement + it.separator + it.body) + #let my-align + #if text-size.width < size.width { + my-align = center + } else { + my-align = left + } + #align(my-align, text(size: 8pt)[#emph(it)]) + ]) + } + + // Configure the raw block properties + show raw.where(block: true): set par(justify: false) + + // // From the INSA Typst Template by SkytAsul: + // // https://github.com/SkytAsul/INSA-Typst-Template + // show raw.line: it => if it.count > 1 { + // text(fill: luma(150), str(it.number)) + h(2em) + it.body + // } else { it } + + // Adapted from the Typst forum: + // https://forum.typst.app/t/how-to-change-numbering-in-appendix/1716/5 + let backmatter(content) = { + set heading(numbering: "A.1") + counter(heading).update(0) + state("backmatter").update(true) + content + } + + set figure( + numbering: n => { + let appx = state("backmatter", false).get() + let hdr = counter(heading).get() + let format = if appx { + "A.1" + } else { + "1.1" + } + let h = if appx { + hdr.at(0) + } else { + hdr.first() + } + numbering(format, h, n) + }, + ) + + // Reset figure and table counters to 0 at each level-1 heading + show heading.where(level: 1): hdr => { + counter(figure.where(kind: image)).update(0) + counter(figure.where(kind: table)).update(0) + hdr + } + + // First page configuration + align(center + horizon)[ + #block(text(weight: 700, size: 22pt, [*ENSEA*])) + + #block( + text( + weight: 700, + size: 16pt, + [*École Nationale Supérieure de l'Électronique et de ses Applications*], + ), + ) + + #block( + text( + weight: 400, + size: 14pt, + [Établissement public, sous tutelle du ministère de l'Enseignement Supérieur et de la Recherche #linebreak() + Habilité par la CTI à délivrer le diplôme d'Ingénieur #linebreak() + Membre de la Conférence des grandes écoles #linebreak() + Membre de CY-Alliance], + ), + ) + + #linebreak() + #stack( + dir: ltr, // left-to-right + spacing: 5em, // space between contents + image("assets/logo-ENSEA.png", height: 40mm), + image(company-logo, height: 40mm), + ) + + #linebreak() + #block( + text( + weight: 700, + size: 22pt, + [RAPPORT DE STAGE], + ), + ) + + #linebreak() + #block( + text( + weight: 700, + size: 16pt, + [#( + authors.map(strong).join(", ", last: " et ") + )], + ), + ) + + #block(text(weight: 400, size: 14pt, student-info)) + + #linebreak() + #block(text(weight: 700, size: 20pt, title)) + ] + + linebreak() + set par(justify: true) + block(text(weight: 400, size: 12pt, [#internship-details])) + + pagebreak() + // Definition of the following pages with different margins + set page( + margin: (top: 70pt, bottom: 1.5cm), + numbering: "1/1", + header-ascent: 10pt, + footer-descent: 10pt, + header: context [ + // to use #hydra outside of the page header, an #anchor must be placed + #anchor() + + #stack( + dir: ltr, + + align(left + horizon, image("assets/logo-ENSEA.png", height: 12mm)), + + align(center + horizon)[ + #text(size: 8pt)[ + #box(width: 75%)[ + #( + authors.join(", ", last: " et ") + ) \ + #title + ]] + ], + + align(right + horizon, image(company-logo, height: 12mm)), + ) + + #box(width: 100%, height: 1pt, fill: black) + ], + + footer: context [ + #place(top + left, dy: -5pt, box(width: 100%, height: 1pt, fill: black)) + + #stack( + dir: ltr, + + align(left + top)[#text(size: 8pt)[ + #box(width: 85%)[ + #emph(hydra(1)) + ] + ]], + + align(right + top)[#text(size: 8pt)[ + #box(width: 8%)[ + #counter(page).display(both: true) + ] + ]], + ) + ], + ) + + // From the Typst forum: + // https://forum.typst.app/t/how-can-i-switch-from-roman-to-arabic-page-numbers-without-breaking-the-total-page-count/4130 + // set page( + // numbering: (..n) => context { + // numbering("i/i", n.at(0), ..counter(page).at()) + // }, + // ) + + // Acknowledgements configuration + counter(page).update(1) + heading(numbering: none, outlined: false)[Remerciements] + import "template/acknowledgements.typ": acknowledgements + acknowledgements() + + pagebreak() + // Contents configuration + show outline.entry.where( + // make level 1 headings bold + level: 1, + ): it => { + // only apply to entries that are not for figures or tables + if it.element.func() == heading { + v(12pt, weak: true) + strong(it) + } else { + v(12pt, weak: true) + it + } + } + show outline.entry: set text(hyphenate: false) + show outline: set par(justify: false) + + if not (enable-list-appendices) { + outline( + title: [Table des matières #v(outline-spacing)], + indent: 1em, + // depth: 2, + ) + } else { + // From Reddit: + // https://www.reddit.com/r/typst/comments/1kaqxje/comment/mppn4ie/ + context { + let qrytarget = heading // ou figure, un label, un sélecteur, etc... + outline( + title: [Table des matières #v(outline-spacing)], + indent: 1em, + // depth: 2, + target: selector.or( + ..query(qrytarget) + .filter(it => it.supplement != [showAppendices]) + .map(it => it.func().where(supplement: it.supplement)), + ), + ) + } + } + + // Figure contents configuration + if (enable-list-figures) { + pagebreak() + heading(numbering: none)[Liste des figures] + v(outline-spacing) + outline(indent: 1em, title: none, target: figure.where(kind: image)) + } + + // Table contents configuration + if (enable-list-tables) { + pagebreak() + heading(numbering: none)[Liste des tableaux] + v(outline-spacing) + outline(indent: 1em, title: none, target: figure.where(kind: table)) + } + + if (enable-list-appendices) and (enable-appendices) { + pagebreak() + heading(numbering: none)[Liste des annexes] + v(outline-spacing) + outline( + indent: 1em, + title: none, + target: heading.where(supplement: [showAppendices]), + ) + } + + // Glossary configuration + let my-theme = ( + // Adapted from theme-basic: + // Renders the main glossary section as a single column + // Parameters: + // title: The glossary section title + // body: Content containing all groups and entries + section: (title, body) => { + heading(level: 1, title, numbering: none) + body + }, + // Renders a group of related glossary terms + // Parameters: + // name: Group name (empty string for ungrouped terms) + // index: Zero-based group index + // total: Total number of groups + // body: Content containing the group's entries + group: (name, index, total, body) => { + if name != "" and total > 1 { + heading(level: 2, name) + } + body + }, + // Renders a single glossary entry with term, definition, and page references + // Parameters: + // entry: Dictionary containing term data: + // - short: Short form of term + // - long: Long form of term (optional) + // - description: Term description (optional) + // - label: Term's dictionary label + // - pages: Linked page numbers where term appears + // index: Zero-based entry index within group + // total: Total entries in group + entry: (entry, index, total) => { + // Format the term parts + let term = text(weight: "bold", entry.short) + let long-form = if entry.long == none { + [ ] + } else { + [ (#entry.long) ] + } + + // Format the description with proper spacing + let description = if entry.description == none { + [] + } else { + [: #entry.description] + } + + // Create the complete entry with hanging indent + block( + spacing: 0.5em, + pad( + left: 1em, + bottom: 0.5em, + block([#term#entry.label#long-form#description]), + ), + ) + }, + ) + + if (enable-glossary) { + pagebreak() + glossary( + title: "Glossaire", + theme: my-theme, + sort: true, + ignore-case: false, + // show-all: true, + ) + } + + if (enable-abstract) { + pagebreak() + heading(outlined: false, numbering: none)[] + import "template/abstract.typ": abstract + abstract() + } + + // From the Typst forum: + // https://forum.typst.app/t/how-can-i-switch-from-roman-to-arabic-page-numbers-without-breaking-the-total-page-count/4130 + [#metadata("last-roman-page") ] + pagebreak() + // counter(page).update(1) + set page(numbering: "1/1") + + body + + // Bibliography configuration + if (enable-bibliography) { + pagebreak() + set par(justify: false) + show bibliography: set heading(numbering: "I.1.a.") + bibliography("template/references.bib", full: true) + } + + // Appendices configuration + if (enable-appendices) { + pagebreak() + show: backmatter // to change numbering style in Appendix + import "template/appendices.typ": annexes + annexes() + } +} diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/abstract.typ b/packages/preview/volt-internship-ensea/0.1.0/template/abstract.typ new file mode 100644 index 0000000000..c6d2c89826 --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/template/abstract.typ @@ -0,0 +1,37 @@ +#let abstract() = { + block( + fill: none, + stroke: rgb("CCCCCC"), + inset: 8pt, + outset: 5pt, + radius: 10pt, + [#heading(numbering: none, outlined: false)[Résumé] + #lorem(70) + + #underline()[*Mots clés*] : #lorem(5)], + ) + + v(2em + 1em) + + block( + fill: rgb("EEEEEE"), + stroke: none, + inset: 8pt, + outset: 5pt, + radius: 10pt, + [#heading(numbering: none, outlined: false)[Abstract] + #text( + fill: black, + lang: "en", + region: "us", + // for English: lang: 'en' and region: 'us' + // For other languages/regions, refer to this page: + // lang: https://en.wikipedia.org/wiki/ISO_639 + // region: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + )[ + #lorem(70) + + #underline()[*Keywords*]: #lorem(5)]], + ) +} + diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/acknowledgements.typ b/packages/preview/volt-internship-ensea/0.1.0/template/acknowledgements.typ new file mode 100644 index 0000000000..406763582e --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/template/acknowledgements.typ @@ -0,0 +1,5 @@ +#let acknowledgements() = { + text[ + #lorem(250) + ] +} diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/appendices.typ b/packages/preview/volt-internship-ensea/0.1.0/template/appendices.typ new file mode 100644 index 0000000000..55d28f6c0d --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/template/appendices.typ @@ -0,0 +1,67 @@ + +// In this file, use level 2 headings(`heading(level: 2)` or `==`) +// to properly organize the appendices under the "Appendices" chapter. + +// ============================ +// CONFIGURATION +// ============================ + +#let annexes() = { + counter(heading).update(0) + + // From Reddit: + // https://www.reddit.com/r/typst/comments/18exrv5/comment/kcrdfc3/ + set heading( + numbering: (..nums) => { + // Get the position of the title in the hierarchy + let nums = nums.pos() + + let level = nums.len() - 1 + + // Indentation could be calculated based on the level + // let indent = level * 1em + + // Define the number to display based on the position in the hierarchy + let num = nums.last() + + let style = ("1.", "A)", "1)").at(level) + + numbering(style, num) + }, + supplement: "showAppendices", // I hope no one will use the 'supplement' option for appendices ^_^ + ) + + // From the Polytechnique Typst Template by remigerme: + // https://github.com/remigerme/typst-polytechnique + let appendix(body, title: "Annexe") = { + // From https://github.com/typst/typst/discussions/3630 + set heading( + numbering: (..nums) => { + let vals = nums.pos() + let s = "" + if vals.len() == 1 { + s += title + " " + } + s += numbering("A.1.", ..vals) + s + }, + ) + + body + } + + show: appendix + + text[ + // ============================ + // START HERE + // ============================ + + = Une figure pour illustrer les "Annexes" + #figure(image("media/logo.png", width: 25%), caption: [Logo générique]) + + // ============================ + // STOP HERE + // ============================ + ] +} diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/glossary.yaml b/packages/preview/volt-internship-ensea/0.1.0/template/glossary.yaml new file mode 100644 index 0000000000..62503e0d30 --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/template/glossary.yaml @@ -0,0 +1,8 @@ +# Documentation available here: +# https://typst.app/universe/package/glossy +# https://github.com/swaits/typst-collection/tree/main/glossy + +ENSEA: + short: "ENSEA" + long: "École Nationale Supérieure de l'Électronique et de ses Applications" + description: "Une grande école d’ingénieurs française, rattachée à l'Université CY Cergy Paris, spécialisée en électronique, informatique et télécommunications." \ No newline at end of file diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/main-internship.typ b/packages/preview/volt-internship-ensea/0.1.0/template/main-internship.typ new file mode 100644 index 0000000000..6afb4d55a4 --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/template/main-internship.typ @@ -0,0 +1,110 @@ +#import "@preview/glossy:0.8.0": * +#show: init-glossary.with(yaml("glossary.yaml"), term-links: true) + +#import "@preview/volt-internship-ensea:0.1.0": * + +// ============================ +// VARIABLES TO MODIFY +// ============================ + +#show: internship.with( + // Path to the company logo + company-logo: "template/media/logo.png", + + // Name(s) of the report author(s) + authors: ( + "Jean DUPONT", + ), + + // Information about the student(s) + student-info: [*Élève ingénieur en X#super[ème] année* #linebreak() + Promotion 20XX #linebreak() + Année 20XX/20XX], + + // Title of the internship report + title: [#lorem(10)], + + // Company name, location, duration, etc. + internship-details: [Stage effectué du *1er mars au 30 août 2025*, au sein de la société *TechSolutions*, située à Paris. + + Sous la responsabilité de : #linebreak() + - M. *Pierre LEFEVRE*, Directeur de la Stratégie #linebreak() + - Mme *Marie DUBOIS*, Responsable des Opérations #linebreak() + ], + + // Enable the list of figures + enable-list-figures: true, + // Enable the list of tables + enable-list-tables: true, + // Enable the list of appendices + enable-list-appendices: true, + // Enable the glossary section + enable-glossary: true, + // Enable the abstract section + enable-abstract: true, + // Enable the bibliography + enable-bibliography: true, + // Enable the appendix section + enable-appendices: true, +) + +// ============================ +// START HERE +// DELETE THE LINES BELOW THIS COMMENT +// ============================ + += Introduction +#lorem(70) + +== Une figure pour illustrer la "Liste des figures" +#figure(image("media/logo-ENSEA.png", width: 25%), caption: [Logo de l'ENSEA]) + +== Une tableau pour illustrer la "Liste des tableaux" +#figure( + table( + columns: 3, + align: (center, left, right), + inset: 6pt, + stroke: 1pt, + fill: (none, none, none), + + // Header row + table.header([N°], [Nom de l'étudiant], [Note finale]), + + // Body + [001], [Alice Dupont], [16,5], + [002], [Bruno Lefèvre], [14,8], + [003], [Claire Noël], [12,7], + ), + caption: [Résultats des étudiants à l'examen], +) + +== Une citation pour illustrer la "Bibliographie" +Dans le traité "*Philosophiæ Naturalis Principia Mathematica*" @newton1833philosophiae, Newton énonce ses célèbres lois du mouvement et la loi de la gravitation universelle, posant ainsi les bases de la mécanique classique. + +// Insert a page break +#pagebreak() + += Titre de niveau 1 +#lorem(70) + +== Titre de niveau 2 +#lorem(50) + +=== Titre de niveau 3 +#lorem(35) + +```java +// HelloWorld.java +public class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} +``` + +// Insert a page break +#pagebreak() + += Conclusion +#lorem(350) diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/media/logo-ENSEA.png b/packages/preview/volt-internship-ensea/0.1.0/template/media/logo-ENSEA.png new file mode 100644 index 0000000000..afd3dc6a36 Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/template/media/logo-ENSEA.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/media/logo.png b/packages/preview/volt-internship-ensea/0.1.0/template/media/logo.png new file mode 100644 index 0000000000..608fdfaa34 Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/template/media/logo.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/template/references.bib b/packages/preview/volt-internship-ensea/0.1.0/template/references.bib new file mode 100644 index 0000000000..75bc8ef6b3 --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/template/references.bib @@ -0,0 +1,7 @@ +@book{newton1833philosophiae, + title={Philosophiae naturalis principia mathematica}, + author={Newton, Isaac}, + volume={1}, + year={1833}, + publisher={G. Brookman} +} \ No newline at end of file diff --git a/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-1.png b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-1.png new file mode 100644 index 0000000000..c83bb2800f Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-1.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-2.png b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-2.png new file mode 100644 index 0000000000..82427aa73c Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-2.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-3.png b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-3.png new file mode 100644 index 0000000000..09e5a74ee4 Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-3.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-4.png b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-4.png new file mode 100644 index 0000000000..43746311f1 Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-4.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-5.png b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-5.png new file mode 100644 index 0000000000..83f2c4ff8c Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-5.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-6.png b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-6.png new file mode 100644 index 0000000000..8f53165382 Binary files /dev/null and b/packages/preview/volt-internship-ensea/0.1.0/thumbnail-internship-6.png differ diff --git a/packages/preview/volt-internship-ensea/0.1.0/typst.toml b/packages/preview/volt-internship-ensea/0.1.0/typst.toml new file mode 100644 index 0000000000..f4530f8d01 --- /dev/null +++ b/packages/preview/volt-internship-ensea/0.1.0/typst.toml @@ -0,0 +1,18 @@ +[package] +name = "volt-internship-ensea" +version = "0.1.0" +compiler = "0.13.0" +entrypoint = "template-internship.typ" +authors = ["Dawod-G"] +license = "MIT" +description = "Unofficial Typst template for internship reports at ENSEA, a French engineering school." +repository = "https://github.com/Dawod-G/ENSEA_Typst-Template" +keywords = ["ensea", "school", "engineering", "report"] +categories = ["report"] +exclude = ["thumbnail-internship-1.png", "thumbnail-internship-2.png", "thumbnail-internship-3.png", "thumbnail-internship-4.png", "thumbnail-internship-5.png", "thumbnail-internship-6.png"] + + +[template] +path = "template" +entrypoint = "main-internship.typ" +thumbnail = "thumbnail-internship-1.png" \ No newline at end of file diff --git a/packages/preview/volt-lab-ensea/0.1.0/README.md b/packages/preview/volt-lab-ensea/0.1.0/README.md new file mode 100644 index 0000000000..1d5c6f6f02 --- /dev/null +++ b/packages/preview/volt-lab-ensea/0.1.0/README.md @@ -0,0 +1,63 @@ +# ENSEA - Typst Lab Template (unofficial) + +Unofficial Typst template for lab reports at ENSEA, a French engineering school. + +## Usage + +Either use this template in the Typst web app: +```typst +#import "@preview/volt-lab-ensea:0.1.0": * +``` +or use the command line to initialize a new project based on this template: +```typst +typst init @preview/volt-lab-ensea:0.1.0 +``` + +## Default Values + +| Parameter | Default Value | Description | +|-----------------|---------------|------------------------------------------------------| +| `title` | `none` | Title of the lab report | +| `authors` | `none` | Name(s) of the student(s) contributing to the report | +| `student-info` | `none` | Information about the student(s) | +| `lab-description`| `none` | Description of the lab objectives | + +All fields listed above are **mandatory**. + +## Example + +```typst +#import "@preview/volt-lab-ensea:0.1.0": * + +#show: report.with( + title: [#lorem(10)], + authors: ( + "Jean DUPONT", + "Marie DUBOIS", + ), + student-info: [*Élève ingénieur en X#super[ème] année* #linebreak() + Promotion 20XX #linebreak() + Année 20XX/20XX], + lab-description: [ + - #lorem(15) #linebreak() + - #lorem(15) #linebreak() + - #lorem(15) + ], +) + += Introduction +#lorem(120) +``` + +

+ + +

+ +## Contributions + +If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. + +## License + +The Typst template is licensed under the [MIT license](https://github.com/Dawod-G/ENSEA_Typst-Template/blob/main/LICENSE.md). This license does not apply to the ENSEA logo or associated image files, which remain the property of ENSEA. \ No newline at end of file diff --git a/packages/preview/volt-lab-ensea/0.1.0/assets/logo-ENSEA.png b/packages/preview/volt-lab-ensea/0.1.0/assets/logo-ENSEA.png new file mode 100644 index 0000000000..afd3dc6a36 Binary files /dev/null and b/packages/preview/volt-lab-ensea/0.1.0/assets/logo-ENSEA.png differ diff --git a/packages/preview/volt-lab-ensea/0.1.0/template-lab.typ b/packages/preview/volt-lab-ensea/0.1.0/template-lab.typ new file mode 100644 index 0000000000..13b3e7f841 --- /dev/null +++ b/packages/preview/volt-lab-ensea/0.1.0/template-lab.typ @@ -0,0 +1,188 @@ +// ============================ +// CONFIGURATION +// ============================ + +#let report( + title: none, + authors: none, + student-info: none, + lab-description: none, + body, +) = { + // Check if all mandatory variables are defined. + if title == none { + panic( + "The `title` variable must be defined. It should be a string representing the title of the report.", + ) + } + + if authors == none { + panic( + "The `authors` variable must be defined. It should be a list of strings representing the authors of the report.", + ) + } + + if student-info == none { + panic( + "The `student-info` variable must be defined. It should be a string with the student's information.", + ) + } + + if lab-description == none { + panic("The `lab-description` variable must be defined. It should be a string describing the lab.") + } + + set document(author: authors, title: title) + + set page(paper: "a4", margin: auto, number-align: center) + + // if "weak: true", the page break is skipped if the current page is already empty + set pagebreak(weak: true) + + set text(font: "New Computer Modern", size: 10pt, lang: "fr", region: "fr") + // for English: lang: 'en' and region: 'us' + // For other languages/regions, refer to this page: + // lang: https://en.wikipedia.org/wiki/ISO_639 + // region: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + + // Display links in blue. + show link: set text(fill: blue.darken(40%)) + + set heading(numbering: "I.1.a.") + show heading: set text(hyphenate: false) + show heading: set par(justify: false) + + // Config. of the spacing after headings + show heading.where(level: 1): set block(spacing: 1.5em) + show heading.where(level: 2): set block(spacing: 1.25em) + show heading.where(level: 3): set block(spacing: 1em) + + show heading: it => [ + #underline()[#it] + ] + + show underline: set underline(stroke: 1pt, offset: 2pt) + set list(indent: 15pt, marker: [--]) // config. of lists + + set math.equation(numbering: "(1)") + + show figure.where(kind: image): set figure(supplement: "Figure") + + // Configure the figure caption alignment: + // if figure caption has more than one line, + // it makes it left-aligned + show figure.caption: it => { + layout(size => [ + #let text-size = measure(it.supplement + it.separator + it.body) + #let my-align + #if text-size.width < size.width { + my-align = center + } else { + my-align = left + } + #align(my-align, text(size: 8pt)[#emph(it)]) + ]) + } + + // Configure the raw block properties + show raw.where(block: true): set par(justify: false) + + // // From the INSA Typst Template by SkytAsul: + // // https://github.com/SkytAsul/INSA-Typst-Template + // show raw.line: it => if it.count > 1 { + // text(fill: luma(150), str(it.number)) + h(2em) + it.body + // } else { it } + + // First page configuration + align(center + horizon)[ + #block(text(weight: 700, size: 22pt, [*ENSEA*])) + + #block( + text( + weight: 700, + size: 16pt, + [*École Nationale Supérieure de l'Électronique et de ses Applications*], + ), + ) + + #linebreak() + #stack( + dir: ltr, // left-to-right + spacing: 5em, // space between contents + image("assets/logo-ENSEA.png", height: 40mm), + ) + + #linebreak() + #block(text(weight: 700, size: 22pt, title)) + + #linebreak() + #block( + text( + weight: 700, + size: 16pt, + [#( + authors.map(strong).join(", ", last: " et ") + )], + ), + ) + + #block(text(weight: 400, size: 14pt, student-info)) + + #align(left)[ + #linebreak() + #block( + text( + weight: 400, + size: 12pt, + [#underline[*Objectifs*] : #lab-description], + ), + ) + ] + ] + + pagebreak() + set par(justify: true) + + // Definition of the following pages with different margins + set page( + margin: (top: 70pt, bottom: 1.5cm), + numbering: "1/1", + header-ascent: 10pt, + footer-descent: 10pt, + header: context [ + #stack( + dir: ltr, + + align(left + horizon, image("assets/logo-ENSEA.png", height: 12mm)), + + align(right + bottom)[ + #text(size: 8pt)[ + #box(width: 88%)[ + #title + ]] + ], + ) + #box(width: 100%, height: 1pt, fill: black) + ], + + footer: context [ + #place(top + left, dy: -5pt, box(width: 100%, height: 1pt, fill: black)) + #stack( + dir: ltr, + + align(left + top)[#text(size: 8pt)[ + #box(width: 85%)[#( + authors.join(", ", last: " et ") + )]]], + + align(right + top)[#text(size: 8pt)[ + #box(width: 8%)[ + #counter(page).display(both: true) + ] + ]], + ) + ], + ) + counter(page).update(1) + body +} diff --git a/packages/preview/volt-lab-ensea/0.1.0/template/main-lab.typ b/packages/preview/volt-lab-ensea/0.1.0/template/main-lab.typ new file mode 100644 index 0000000000..c578b1c823 --- /dev/null +++ b/packages/preview/volt-lab-ensea/0.1.0/template/main-lab.typ @@ -0,0 +1,59 @@ +#import "@preview/volt-lab-ensea:0.1.0": * + +// ============================ +// VARIABLES TO MODIFY +// ============================ + +#show: report.with( + // Title of the lab report + title: [#lorem(10)], + + // Name(s) of the student(s) contributing to the report + authors: ( + "Jean DUPONT", + "Marie DUBOIS", + ), + + // Information about the student(s) + student-info: [*Élève ingénieur en X#super[ème] année* #linebreak() + Promotion 20XX #linebreak() + Année 20XX/20XX], + + // Description of the lab objectives + lab-description: [ + - #lorem(15) #linebreak() + - #lorem(15) #linebreak() + - #lorem(15) + ], +) + +// ============================ +// START HERE +// DELETE THE LINES BELOW THIS COMMENT +// ============================ + += Titre de niveau 1 +#lorem(70) + +== Titre de niveau 2 +#lorem(50) + +#figure(image("media/logo-ENSEA.png", width: 25%), caption: [Logo de l'ENSEA]) + +=== Titre de niveau 3 +#lorem(35) + +```java +// HelloWorld.java +public class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} +``` + +// Insert a page break +#pagebreak() + += Conclusion +#lorem(350) diff --git a/packages/preview/volt-lab-ensea/0.1.0/template/media/logo-ENSEA.png b/packages/preview/volt-lab-ensea/0.1.0/template/media/logo-ENSEA.png new file mode 100644 index 0000000000..afd3dc6a36 Binary files /dev/null and b/packages/preview/volt-lab-ensea/0.1.0/template/media/logo-ENSEA.png differ diff --git a/packages/preview/volt-lab-ensea/0.1.0/thumbnail-lab-1.png b/packages/preview/volt-lab-ensea/0.1.0/thumbnail-lab-1.png new file mode 100644 index 0000000000..78709f9415 Binary files /dev/null and b/packages/preview/volt-lab-ensea/0.1.0/thumbnail-lab-1.png differ diff --git a/packages/preview/volt-lab-ensea/0.1.0/thumbnail-lab-2.png b/packages/preview/volt-lab-ensea/0.1.0/thumbnail-lab-2.png new file mode 100644 index 0000000000..6a00c800f7 Binary files /dev/null and b/packages/preview/volt-lab-ensea/0.1.0/thumbnail-lab-2.png differ diff --git a/packages/preview/volt-lab-ensea/0.1.0/typst.toml b/packages/preview/volt-lab-ensea/0.1.0/typst.toml new file mode 100644 index 0000000000..053d3ce4dc --- /dev/null +++ b/packages/preview/volt-lab-ensea/0.1.0/typst.toml @@ -0,0 +1,16 @@ +[package] +name = "volt-lab-ensea" +version = "0.1.0" +entrypoint = "template-lab.typ" +authors = ["Dawod-G"] +license = "MIT" +description = "Unofficial Typst template for lab reports at ENSEA, a French engineering school." +repository = "https://github.com/Dawod-G/ENSEA_Typst-Template" +keywords = ["ensea", "school", "engineering", "report"] +categories = ["report"] +exclude = ["thumbnail-lab-1.png", "thumbnail-lab-2.png"] + +[template] +path = "template" +entrypoint = "main-lab.typ" +thumbnail = "thumbnail-lab-1.png" \ No newline at end of file