Skip to content

Commit 40d8296

Browse files
committed
Nuova versione che rispetta il nuovo regolamento
L'ho utilizzata nella mia tesi. Ve la rendo disponibile :)
1 parent 0803833 commit 40d8296

File tree

6 files changed

+249
-59
lines changed

6 files changed

+249
-59
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,16 @@ Un punto di partenza per la scrittura di una tesi in [Typst](https://typst.app/h
33
[specifiche del DISI](https://github.com/csunibo/asciidoc-thesis/issues/2#issuecomment-1470158684).
44
Scopri di più sulla [wiki di
55
CSUnibo](https://csunibo.github.io/wiki/modelli-di-tesi/typst/index.html).
6+
7+
8+
## Build
9+
10+
```
11+
typst compile tesi.typ
12+
```
13+
14+
## Scrittura
15+
16+
```
17+
typst watch tesi.typ
18+
```

assets/logo_bw.png

50.1 KB
Loading

assets/logo_colored.png

54.9 KB
Loading

template.typ

+205-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,207 @@
1+
#import "@preview/big-todo:0.2.0": *
2+
#import "@preview/cetz:0.2.2"
3+
#import "@preview/codly:1.0.0": *
4+
#import "@preview/drafting:0.2.0": *
5+
#import "@preview/fletcher:0.4.2" as fletcher: node, edge
6+
#import "@preview/wrap-it:0.1.0": wrap-content
7+
#import "@preview/lovelace:0.2.0": *
18

2-
#let project(title: [], subtitle: [], author: [], professors: (), body) = {
3-
set document(author: author, title: title)
4-
set page(paper: "a4", margin: (inside: 3cm, outside: 2.5cm), numbering: none)
5-
set text(font: "New Computer Modern", lang: "it")
6-
set par(justify: true, leading: 0.75em)
7-
set text(size: 12pt)
8-
show par: set block(spacing: 1.6em)
9-
show link: underline
10-
show heading: it => block(it.body, below: 2em, above: 2em)
11-
align(center, [
12-
#v(15em)
13-
#heading(level: 1, outlined: false, text(size: 30pt, title))
14-
#v(2em)
15-
#heading(level: 2, outlined: false, text(size: 18pt, subtitle))
16-
#align(bottom, [
17-
#text(size: 18pt, emph(author))
18-
#v(1em)
19-
#if type(professors) == "string" {
20-
text(size: 16pt, professors)
21-
} else {
22-
text(size: 16pt, professors.join(", "))
23-
}
24-
#v(2em)
25-
#text(size: 16pt, datetime.today().display("[year]"))
26-
#v(2cm)
27-
])
28-
]) + body
9+
#let algorithm = algorithm.with(supplement: "Algoritmo")
10+
11+
12+
#let project(
13+
title: [],
14+
subtitle: [],
15+
author: [],
16+
professors: (),
17+
school: [],
18+
department: [],
19+
course: [],
20+
session: [],
21+
aa: [],
22+
abstract: [],
23+
dedication: [],
24+
final: false,
25+
body,
26+
) = {
27+
set document(author: author, title: title)
28+
set page(
29+
paper: "a4",
30+
margin: (x: 2.5cm, y: 1.25cm),
31+
numbering: none,
32+
)
33+
34+
set text(
35+
font: "Libertinus Serif",
36+
lang: "it",
37+
region: "it",
38+
size: 12pt,
39+
hyphenate: true,
40+
)
41+
42+
// Bozza header
43+
set page(header: if not final {
44+
box(
45+
width: 100%,
46+
stroke: 1pt + red,
47+
inset: .5em,
48+
align(
49+
center + horizon,
50+
text(fill: red, size: 18pt, [Bozza del #datetime.today().display("[day]/[month]/[year]")]),
51+
),
52+
)
53+
} else {
54+
none
55+
})
56+
57+
for logo in ("assets/logo_bw.png", "assets/logo_colored.png") {
58+
align(
59+
center,
60+
[
61+
62+
#image(logo, width: 6.5cm)
63+
#v(2em, weak: true)
64+
65+
#upper[Dipartimento di #text(department)]
66+
#v(2em, weak: true)
67+
68+
#text(size: 14pt, strong([Corso di #text(course)]))
69+
#line(stroke: (dash: "dotted", thickness: 1pt), length: 100%)
70+
#v(5em)
71+
72+
#heading(level: 1, outlined: false, text(size: 28pt, hyphenate: false, title))
73+
#v(2em)
74+
#heading(level: 2, outlined: false, text(size: 18pt, weight: "regular", hyphenate: false, subtitle))
75+
76+
#align(bottom)[
77+
#text(size: 14pt)[
78+
#grid(
79+
columns: (auto, 1fr, auto),
80+
align: (top + left),
81+
rows: 1,
82+
row-gutter: 2em,
83+
[
84+
*Relatore:* \
85+
#text(professors.at(0), hyphenate: false)
86+
],
87+
{ },
88+
[
89+
*Presentata da:* \
90+
#text(author)
91+
],
92+
{
93+
if professors.len() > 0 {
94+
let title = if professors.len() > 1 {
95+
"Correlatori:"
96+
} else {
97+
"Correlatore:"
98+
}
99+
text(size: 14pt, weight: "bold", title)
100+
linebreak()
101+
for professor in professors.slice(1) {
102+
text(professor, hyphenate: false)
103+
linebreak()
104+
}
105+
}
106+
},
107+
)
108+
109+
#v(2em, weak: true)
110+
111+
#line(stroke: (dash: "solid", thickness: 1pt), length: 100%)
112+
113+
Sessione #text(session) \
114+
Anno accademico #text(aa)
115+
]
116+
]
117+
],
118+
)
119+
120+
pagebreak()
121+
}
122+
123+
set page(margin: 2.5cm)
124+
show link: underline
125+
126+
set par(justify: true, leading: 0.75em)
127+
128+
show raw.where(block: false): box.with(
129+
stroke: (paint: gray, thickness: .5pt),
130+
outset: (y: .2em, x: -.2em),
131+
inset: (x: .5em),
132+
radius: .2em,
133+
)
134+
135+
counter(page).update(1) // reset page counter
136+
137+
show par: set block(spacing: 1.6em)
138+
show heading: set block(spacing: 1em)
139+
140+
if abstract != [] {
141+
align(
142+
horizon,
143+
{
144+
heading(level: 1, "Sommario")
145+
text(abstract)
146+
},
147+
)
148+
pagebreak()
149+
}
150+
151+
if dedication != [] and final {
152+
align(horizon + end, text(dedication))
153+
pagebreak()
154+
}
155+
156+
set page(numbering: "1")
157+
158+
outline(title: [ Indice dei contenuti ], indent: 20pt, depth: 2)
159+
160+
{
161+
show heading.where(level: 1): it => {
162+
pagebreak()
163+
v(8cm)
164+
set par(justify: false)
165+
show par: set block(spacing: 0cm)
166+
let c = counter(heading).display("1")
167+
// text(size: 40pt, c)
168+
v(1cm)
169+
text(size: 40pt, it.body, hyphenate: false)
170+
v(1cm)
171+
}
172+
173+
show heading.where(level: 2): it => {
174+
set text(size: 20pt)
175+
v(2cm)
176+
it
177+
}
178+
179+
show heading.where(level: 3): it => {
180+
set text(size: 14pt)
181+
it
182+
}
183+
184+
set heading(numbering: "1.1.")
185+
186+
set-page-properties()
187+
188+
show: codly-init.with()
189+
codly(
190+
number-format: none,
191+
zebra-fill: none,
192+
languages: (
193+
python: (name: "Python", icon: "", color: rgb("#3572A5")),
194+
),
195+
)
196+
197+
show: setup-lovelace
198+
199+
body
200+
201+
bibliography(
202+
"./bibliography.bib",
203+
// style: "association-for-computing-machinery",
204+
style: "institute-of-electrical-and-electronics-engineers"
205+
)
206+
}
29207
}

tesi.pdf

128 KB
Binary file not shown.

tesi.typ

+31-32
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
1-
21
#import "template.typ": *
2+
#import "@preview/codly:1.0.0": *
33

44
#show: project.with(
5-
title: "Titolo Tesi",
6-
subtitle: "Sottotitolo tesi",
7-
author: "Autore Tesi",
8-
professors: "Prof. Mario Rossi"
5+
title: [
6+
#lorem(5)
7+
],
8+
author: "Pippo Baudo",
9+
professors: (
10+
"Prof. Lupo Lucio",
11+
"Prof. Gatto Silvestro",
12+
"Dott. Paperino"
13+
),
14+
department: "Dipartimento della Televisione dei Ragazzi",
15+
course: "Laurea in Scienze dell'Albero Azzurro",
16+
session: "di Luglio",
17+
aa: "2000/2001",
18+
abstract: [
19+
#lorem(100)
20+
],
21+
dedication: [
22+
A quella puntata della Melevisione interrotta a metà.
23+
],
24+
final: true,
925
)
1026

11-
#counter(page).update(0)
12-
#set page(numbering: "1")
13-
14-
= Abstract
15-
16-
#lorem(100)
17-
18-
#lorem(100)
19-
20-
#lorem(100)
21-
22-
#pagebreak()
23-
24-
= Dedica
27+
= Introduzione
2528

2629
#lorem(100)
2730

28-
#pagebreak()
31+
== Sotto-paragrafo 1
2932

30-
#outline(title: [ Indice dei Contenuti ], indent: 20pt)
33+
#lorem(100) @miur
3134

32-
#pagebreak()
35+
=== Sotto-sotto-paragrafo 1
3336

34-
= Contenuti
37+
```swift
38+
let x = 1
3539
36-
#lorem(100)
40+
if x == 1 {
41+
print("Hello, world!")
42+
}
43+
```
3744

38-
== Sottosezione 1
3945

40-
#lorem(100)
41-
42-
#lorem(100)
4346

44-
Esempio di bibliografia @miur.
4547

46-
#pagebreak()
4748

48-
// Bibliografia
4949

50-
#bibliography("bibliography.bib", style: "chicago-author-date")

0 commit comments

Comments
 (0)