Skip to content

Commit 38d2fc2

Browse files
modern-se-kul-thesis:0.1.0 (#3107)
1 parent cef9582 commit 38d2fc2

25 files changed

+1035
-0
lines changed

modern-se-kul-thesis/0.1.0/LICENSE

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) 2024 Benjamin Eeckhout
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: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# The `modern-se-kul-thesis` Package
2+
<div align="center">Version 0.1.0</div>
3+
4+
This is an unofficial typst template for doing a thesis at the engineering science faculty at KU Leuven.
5+
This was made by trying to as closely follow the Latex template [here](https://eng.kuleuven.be/docs/kulemt).
6+
## Usage
7+
8+
You can use this template in the web editor by going to "start from template" and searching for "modern-se-kul-thesis".
9+
Alternatively, you can use this template locally by running:
10+
```typ
11+
typst init @preview/modern-se-kul-thesis
12+
```
13+
This will then create a basic folder structure with some fields pre-filled.
14+
15+
## Configuration
16+
- `title`: The title of the thesis.
17+
- `subtitle`: An optional subtitle.
18+
- `academic-year`: Can be a starting year (e.g. 2025) or a tuple of start and end year (e.g. 2025,2027)
19+
- `authors`: An array of all the authors.
20+
- `promotors`: An array of all the promotors.
21+
- `assessors`: An array of all the assessors.
22+
- `supervisors`: An array of all the supervisors.
23+
- `degree: An array containing`: the name of your master, elective and the specified color in hsv (default is for computer science).
24+
- `language`: "en" or "nl".
25+
- `electronic-version`: A boolean toggle to set the thesis as electronic.
26+
- `english-master`: A boolean toggle to use the template for the English master.
27+
- `list-of-figures`: Toggle to add a list of figures.
28+
- `list-of-listings`: Toggle to add a list of listings (code blocks).
29+
- `font-size`: Font size toggle.
30+
- `preface`: The preface of your thesis goes here.
31+
- `abstract`: The abstract of your thesis goes here.
32+
- `dutch-summary`: The dutch summary of your thesis goes here.
33+
- `abbreviations`: The abbreviations used in your thesis go here.
34+
- `symbols`: The symbols used in your thesis go here.
35+
- `bibliography`: The bibliography of your thesis goes here.
36+
- `appendices`: The appendices of your thesis goes here.
37+
- `logo`: The logo of the university for the front page
38+
```typ
39+
#import "@preview/modern-se-kul-thesis:0.1.0": template
40+
#show: template.with(
41+
title: [The main title],
42+
subtitle: [The subtitle],
43+
academic-year: 2025,
44+
authors: ("an Author",),
45+
promotors: ("a promotor",),
46+
assessors: ("an assessor",),
47+
supervisors: ("a supervisor",),
48+
degree: (
49+
elective: "Software engineering",
50+
master: "Computer Science",
51+
color: (0, 0, 1, 0),
52+
),
53+
language: "en",
54+
electronic-version: false,
55+
english-master: false,
56+
list-of-figures: true,
57+
list-of-listings: false,
58+
font-size: 11pt,
59+
preface: [#lorem(100)],
60+
abstract: [#lorem(100)],
61+
dutch-summary: [#lorem(100)],
62+
abbreviations: [WIP: Work in progress],
63+
symbols: [$Omega$:Ohm],
64+
bibliography: include bibliography.bib,
65+
appendices: [#lorem(100)],
66+
logo: [Temp]
67+
)
68+
// Put your thesis content here
69+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#let submission-text(degree, elective) = (
2+
"en": [
3+
Thesis submitte as part of the degree Master of Science: #degree, with elective #elective
4+
],
5+
"nl" : [
6+
Thesis voorgedragen tot het behalen van de graad van Master of Science in de ingenieurswetenschappen: #degree, hoofdoptie #elective
7+
]
8+
)
9+
10+
#let copyright = (
11+
"tm": [#sym.copyright Copyright KU Leuven],
12+
"en" :[
13+
Without written permission of the supervisors and the author it is forbidden to reproduce or adapt in any form or by any means any part of this publication. Requests for obtaining the right to reproduce or utilize parts of this publication should be addressed to the Departement Computerwetenschappen, Celestijnenlaan 200A bus 2402, B-3001 Heverlee, +32-16-327700 or by email #link("mailto:[email protected]").
14+
#v(1em)
15+
A written permission of the supervisors is also required to use the methods, products, schematics and programmes described in this work for industrial or commercial use, and for submitting this publication in scientific contests.],
16+
17+
"nl": [Zonder voorafgaande schriftelijke toestemming van zowel de promotoren als de auteur is overnemen, kopiëren, gebruiken of realiseren van deze uitgave of gedeelten ervan verboden. Voor aanvragen tot of informatie i.v.m. het overnemen en/of gebruik en/of realisatie van gedeelten uit deze publicatie, wend u tot het Departement Computerwetenschappen, Celestijnenlaan 200A bus 2402, B-3001 Heverlee, +32-16- 327700 of via e-mail #link("mailto:[email protected]").
18+
19+
#v(1em)
20+
21+
Voorafgaande schriftelijke toestemming van de promotoren is eveneens vereist voor het aanwenden van de in deze masterproef beschreven (originele) methoden, producten, schakelingen en programma's voor industrieel of commercieel nut en voor de inzending van deze publicatie ter deelname aan wetenschappelijke prijzen of wedstrijden.])
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#import "components/abstract.typ": insert-abstract
2+
#import "components/bibliography.typ": insert-bibliography
3+
#import "components/copyright.typ": insert-copyright
4+
#import "components/cover-page.typ": insert-cover-page
5+
#import "components/declaration-of-originality.typ": insert-dec-of-orig
6+
// #import "components/keywords.typ": insert-keywords
7+
#import "components/preface.typ": insert-preface
8+
#import "components/outline.typ": (
9+
insert-heading-outline, insert-image-outline, insert-listing-outline,
10+
)
11+
#import "components/list-of-abbrvs-symbols.typ": insert-list-of-abbrv-symbol
12+
// #import "components/figure-outline.typ": insert-figure-outline
13+
#import "components/appendix.typ": insert-appendices
14+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#let insert-abstract(abstract, lang: "en") = context {
2+
heading(
3+
level: 1,
4+
numbering: none,
5+
outlined: true,
6+
if lang == "en" {
7+
"Abstract"
8+
} else {
9+
"Samenvatting"
10+
},
11+
)
12+
if abstract != none {
13+
abstract
14+
} else {
15+
let t = if lang == "nl" {
16+
"PLAATSHOUDER VOOR SAMENVATTING"
17+
} else {
18+
"PLACEHOLDER FOR ABSTRACT"
19+
}
20+
text(purple, size: 3em)[#t]
21+
set text(red)
22+
lorem(200)
23+
}
24+
}
25+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#let insert-appendices(appendices) = {
2+
set heading(numbering: "A.1", supplement: "Appendix")
3+
// let heading-number = "1.1.1."
4+
// let heading-spacing = context h(
5+
// measure(heading-number).width - measure(heading-number).width,
6+
// )
7+
pagebreak(weak: true, to: "odd")
8+
page(
9+
footer: context [#align(center)[#(
10+
(here().page-numbering())(here().page())
11+
)]],
12+
header: none,
13+
)[
14+
#set align(center)
15+
#v(40%)
16+
#text(size: 2.5em, weight: "semibold")[Appendices]
17+
]
18+
19+
pagebreak(weak: true, to: "odd")
20+
21+
// shoddy hack, but it works
22+
// show heading: it => {
23+
// if it.level == 1 { it } else {
24+
// let size = if it.level == 2 {
25+
// 1.1em
26+
// } else { 1em }
27+
// set text(size, weight: "bold")
28+
// let first-number = numbering(it.numbering, counter(heading).get().first())
29+
//
30+
// let heading-number = (first-number, ..counter(heading).get().slice(1))
31+
// .map(str)
32+
// .join(".")
33+
// [#linebreak()#heading-number #heading-spacing #it.body#linebreak()]
34+
// }
35+
// }
36+
set heading(numbering: "A.1")
37+
counter(heading).update(0)
38+
appendices
39+
}
40+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
// Bibliography
3+
#let insert-bibliography(bib, lang: "en") = {
4+
if bib != none {
5+
show heading: it => {
6+
pagebreak(to: "odd", weak: true)
7+
pad(top: 1em + 35mm, bottom: 2em, text(
8+
size: 1.7em,
9+
)[#it.body])
10+
}
11+
heading(
12+
level: 1,
13+
numbering: none,
14+
if lang == "en" {
15+
"Bibliography"
16+
} else {
17+
"Bibliografie"
18+
},
19+
outlined: true,
20+
)
21+
set bibliography(title: none)
22+
set par(spacing: 1em)
23+
show bibliography: set text(size: 0.9em)
24+
show link: it => text(fill: rgb(238, 34, 153), weight: "semibold")[#it]
25+
bib
26+
}
27+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#import "../../assets/text-blobs.typ": copyright
2+
/// inserts the copyright page
3+
/// -> content
4+
#let insert-copyright(
5+
/// Whether the thesis is done during an English master
6+
/// -> bool
7+
english-master,
8+
/// The language of the thesis
9+
/// -> Str
10+
lang,
11+
) = {
12+
// Copyright
13+
set align(left + bottom)
14+
set par(justify: true, first-line-indent: 0pt)
15+
show link: it => [#text(font: "Nimbus Mono PS", weight: 300)[#it]]
16+
set text(hyphenate: false)
17+
copyright.tm + v(2em)
18+
if lang == "en" {
19+
copyright.en + v(2em)
20+
}
21+
if not english-master {
22+
copyright.nl
23+
}
24+
25+
// par(first-line-indent: 0pt, leading: 5pt, justify: true)[
26+
// text(hyphenate: false, size: 10.5pt)[
27+
// #copyright-text
28+
// ]
29+
// ]
30+
v(7%)
31+
}

0 commit comments

Comments
 (0)