Skip to content

Commit aa79f0b

Browse files
prometeu-thesis:0.1.0 (#3259)
1 parent efa6a2e commit aa79f0b

File tree

27 files changed

+664
-0
lines changed

27 files changed

+664
-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 chico ferreira
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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# prometeu-thesis
2+
3+
The unofficial Typst template for writing theses at the University of Minho (UMinho).
4+
5+
<img src="thumbnail.png" alt="Template cover thumbnail" width="300"/>
6+
7+
It is based on the [official LaTeX template provided by the Department of Informatics](https://web.di.uminho.pt/sitedi/latex/) and fully complies with the [university’s required formatting standards and guidelines](https://alunos.uminho.pt/PT/estudantes/Paginas/InfoUteisFormatacao.aspx).
8+
9+
This template closely follows the LaTeX version, while providing improvements in features, usability and presentation. It is designed to be as extensible, customizable, and comprehensible as possible right out of the box.
10+
11+
You can find the unmodified output of the template in [example.pdf](./example.pdf).
12+
13+
## How to use this template
14+
15+
### Setting up fonts
16+
17+
This template requires the following fonts: NewsGotT (001.005), NewsGotTBold (001.005) and NewsGoth Lt BT (2.001 mfgpctt 4.4).
18+
19+
Unfortunately, Typst [disallows font files to be bundled in packages](https://github.com/typst/packages/blob/main/docs/resources.md#fonts-are-not-supported-in-packages). The original fonts (.ttf files) should be grabbed from the zip file on the [official LaTeX template](https://web.di.uminho.pt/sitedi/latex/).
20+
21+
### Using on Typst Web
22+
23+
Create a new project by selecting "Start from template" and searching for this project. Then create a `fonts` folder in your project and add the three required fonts there.
24+
25+
### Using Locally
26+
27+
To work locally, first [install Typst](https://typst.app/open-source/), then initialize your project with:
28+
```
29+
typst init @preview/prometeu-thesis:0.1.0
30+
```
31+
32+
Make the required fonts available by either installing them system-wide (use `typst fonts` to verify detection) or by placing them in a folder of your choice (e.g., `./fonts`) and referencing it via your Typst LSP settings or use the CLI option `--font-path <folder>`.
33+
34+
---
35+
36+
Always ensure that the output generated by this template complies with the latest formatting standards.
37+
38+
## Current Limitations
39+
40+
Currently, this template only supports covers for Master's theses and does not yet accommodate Doctoral (PhD) theses, and it is only available in English (there is no Portuguese version yet). Contributions to expand support are welcome.
41+
42+
By default, the template includes only the required School of Engineering logos for the cover, but you can easily change these to your own school's logo. The official and high-resolution logos are available in the [official formatting guidelines](https://alunos.uminho.pt/PT/estudantes/Paginas/InfoUteisFormatacao.aspx).
43+
44+
## License
45+
46+
This template is provided under the [MIT License](./LICENSE).
47+
48+
The official logos located in [template/logos/uminho](./template/logos/uminho) are the property of Universidade do Minho. They are not covered by the [LICENSE](./LICENSE) included with this template and remain under the copyright of the university.
321 KB
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#let pantone1807 = rgb("990000")
2+
#let pantone159 = rgb("cc6633")
3+
#let pantonecoolgray7 = rgb("97999b")
4+
#let blueuminho = rgb("24A2DA")
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#import "colors.typ"
2+
3+
#let render-cover(
4+
author: [],
5+
title: [],
6+
date: [],
7+
supervisors: (),
8+
images: (),
9+
gray-images: (),
10+
school: [],
11+
degree: []
12+
) = [
13+
#set text(fill: colors.pantonecoolgray7)
14+
15+
#set page(margin: (top: 0mm, bottom: 10mm, left: 79mm, right: 0mm))
16+
#set par(spacing: 0pt)
17+
18+
#grid(
19+
columns: 2,
20+
..images.map(block.with(width: 26mm, height: 26mm)),
21+
)
22+
23+
#v(8.72mm)
24+
25+
#[
26+
#set par(leading: 0.4em)
27+
#set text(size: 14.5pt)
28+
*University of Minho*\
29+
#text(font: "NewsGoth Lt BT", school)
30+
]
31+
32+
#v(37.32mm)
33+
34+
#place(top + left, float: false, dy: 90mm)[
35+
#set text(size: 17pt)
36+
#set par(leading: 20.4pt - 0.75em, spacing: 25pt)
37+
38+
#author
39+
40+
*#title*
41+
]
42+
43+
#align(bottom, text(size: 10pt, date))
44+
45+
#page(fill: colors.pantonecoolgray7)[]
46+
47+
#grid(
48+
columns: 2,
49+
..gray-images.map(block.with(width: 26mm, height: 26mm)),
50+
column-gutter: 0.5mm,
51+
)
52+
53+
#v(8.72mm)
54+
55+
#[
56+
#set par(leading: 0.4em)
57+
#set text(size: 14.5pt)
58+
*University of Minho*\
59+
#text(font: "NewsGoth Lt BT", school)
60+
]
61+
62+
#place(top + left, float: false, dy: 90mm)[
63+
#set text(size: 17pt)
64+
#set par(leading: 20.4pt - 0.75em, spacing: 25pt)
65+
66+
#author
67+
68+
*#title*
69+
]
70+
71+
#place(top + left, float: false, dy: 180mm)[
72+
#set text(size: 14.5pt)
73+
#set par(leading: 16.8pt - 0.75em, spacing: 25pt)
74+
75+
#degree
76+
77+
Dissertation supervised by\
78+
#supervisors.map(text.with(weight: "bold")).join(linebreak())
79+
]
80+
81+
#align(bottom, text(size: 10pt, date))
82+
]
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#let chapter-count = counter("chapter counter")
2+
3+
#let part() = it => {
4+
set align(center + horizon)
5+
set text(25pt)
6+
pagebreak(weak: true)
7+
8+
grid(
9+
row-gutter: 1em,
10+
[Part #context counter(heading).display()],
11+
it.body,
12+
)
13+
14+
v(4em) // Move the part title up
15+
}
16+
17+
#let chapter(top: none) = it => {
18+
chapter-count.step()
19+
pagebreak(weak: true)
20+
block(inset: (top: 30mm, bottom: 15mm), {
21+
if top != none {
22+
block(text(15pt, top), below: 7mm)
23+
}
24+
block(text(18pt, it.body))
25+
})
26+
}
27+
28+
#let chapter-with-top() = chapter(top: [Chapter #context chapter-count.display()])
29+
30+
#let section() = it => {
31+
set text(16pt)
32+
set block(above: 2.5em, below: 1.5em)
33+
it
34+
}
35+
36+
#let format-heading(..nums) = {
37+
if nums.pos().len() == 1 {
38+
numbering("I", ..nums) // Part
39+
} else if nums.pos().len() == 2 {
40+
numbering("1", chapter-count.get().first()) // Chapter
41+
} else {
42+
numbering("1.1", ..chapter-count.get(), ..nums.pos().slice(2)) // Section
43+
}
44+
}
45+
46+
#let show-main-content = it => {
47+
// = Part
48+
// == Chapter
49+
// === Section
50+
show heading.where(level: 1): part()
51+
show heading.where(level: 2): chapter-with-top()
52+
show heading.where(level: 3): section()
53+
54+
// Use chapter-count to number chapters and sections
55+
set heading(numbering: format-heading)
56+
57+
it
58+
}
59+
60+
#let show-appendix(content) = {
61+
chapter-count.update(0)
62+
show heading.where(level: 2): set heading(numbering: (..) => chapter-count.display("A"))
63+
show heading.where(level: 2): chapter(top: [Appendix #context chapter-count.display("A")])
64+
content
65+
}
66+
67+
#let show-preamble(content) = {
68+
set page(numbering: "i")
69+
counter(page).update(1)
70+
71+
// Set level 1 heading to be chapters and level 2 headings to be sections (needed because of Part support)
72+
show heading.where(level: 1): chapter()
73+
show heading.where(level: 2): section()
74+
75+
// Preamble should not be included in the outline
76+
set heading(outlined: false)
77+
78+
content
79+
80+
chapter-count.update(0)
81+
counter(page).update(1)
82+
}
83+
84+
#let show-postamble(content) = {
85+
show heading.where(level: 1): chapter()
86+
set heading(numbering: none)
87+
88+
content
89+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#import "colors.typ"
2+
#import "cover.typ": render-cover
3+
#import "formatting.typ"
4+
5+
#let author-state = state("author", [])
6+
#let date-state = state("date", [])
7+
8+
#let thesis(
9+
author: "",
10+
title: [],
11+
date: [],
12+
supervisors: (),
13+
cover-images: (),
14+
cover-gray-images: (),
15+
school: [],
16+
degree: [],
17+
) = doc => {
18+
set text(font: "NewsGotT", size: 12pt)
19+
set par(leading: 0.95em, spacing: 1.9em)
20+
show footnote.entry: set text(size: 8pt)
21+
show link: set text(fill: colors.blueuminho)
22+
23+
set document(title: title, author: author)
24+
25+
author-state.update(author)
26+
date-state.update(date)
27+
28+
render-cover(
29+
author: author,
30+
title: title,
31+
date: date,
32+
supervisors: supervisors,
33+
images: cover-images,
34+
gray-images: cover-gray-images,
35+
school: school,
36+
degree: degree,
37+
)
38+
39+
// Fake italic as NewsGotT doesn't have an italic style
40+
// Change regex if italic is broken when changing lines
41+
show emph: it => {
42+
show regex("\S+"): it => box(skew(ax: -18.4deg, reflow: false, it))
43+
it
44+
}
45+
46+
set page(margin: 25mm, numbering: "1")
47+
48+
doc
49+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
= Appendices
2+
3+
== Support work
4+
5+
Auxiliary results which are not main-stream.
6+
7+
== Details of results
8+
9+
Details of results whose length would compromise readability of main text.
10+
11+
== Listings
12+
13+
Should this be the case.
14+
15+
#show raw: set block(
16+
fill: gray.lighten(80%),
17+
radius: 10pt,
18+
inset: 1.5em,
19+
)
20+
21+
#figure(
22+
```haskell
23+
factorial :: Integer -> Integer
24+
factorial 0 = 1
25+
factorial n = n * factorial (n-1)
26+
```,
27+
caption: [Factorial function],
28+
)
29+
30+
== Tooling
31+
32+
(Should this be the case)
33+
34+
Anyone using @latex should start using #link("https://typst.app/")[Typst].
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
clang:
2+
type: Book
3+
author:
4+
- name: "B.W. Kernighan"
5+
- name: "D.M. Ritchie"
6+
title: "The C Programming Language (ANSI C)"
7+
edition: "2nd"
8+
publisher:
9+
name: "Prentice Hall Software series"
10+
year: 1988
11+
keywords:
12+
- "Programming"
13+
- "Imperative"
14+
15+
functional:
16+
type: Web
17+
author:
18+
- name: "R. Bird"
19+
- name: "P. Wadler"
20+
title: "Introduction to Functional Programming"
21+
publisher:
22+
name: "Prentice-Hall"
23+
year: 1988
24+
keywords:
25+
- "Programming"
26+
- "Functional"
27+
28+
rustbook:
29+
type: Web
30+
title: "The Rust Programming Language"
31+
year: 2024
32+
url: "https://doc.rust-lang.org/book/"
33+
keywords:
34+
- "Rust"
35+
- "Programming"
36+
- "Systems Programming"
37+
38+
typstdocs:
39+
type: Web
40+
title: "Typst Documentation"
41+
publisher:
42+
name: "Typst"
43+
year: 2024
44+
url: "https://typst.app/docs/"
45+
keywords:
46+
- "Typst"
47+
- "Document Preparation"
48+
- "Typesetting"

0 commit comments

Comments
 (0)