|
1 | 1 | // The project function defines how your document looks.
|
2 | 2 | // It takes your content and some metadata and formats it.
|
3 | 3 | // Go ahead and customize it to your liking!
|
4 |
| -#let project(title: "", authors: (), logo: none, date: none, body) = { |
| 4 | +#let project( |
| 5 | + course: "Fundamentals of Data Structures", |
| 6 | + title: "", |
| 7 | + title_size: 3em, |
| 8 | + cover_image_padding: 1em, |
| 9 | + cover_image_size: 50%, |
| 10 | + semester: "2023-2024 Spring & Summer", |
| 11 | + author: none, |
| 12 | + date: none, |
| 13 | + cover_comments: none, |
| 14 | + cover_comments_size: 1.35em, |
| 15 | + body |
| 16 | +) = { |
5 | 17 | // Set the document's basic properties.
|
6 |
| - set document(author: authors, title: title) |
| 18 | + set document(author: (author), title: title) |
7 | 19 | set page(numbering: "1", number-align: center)
|
8 | 20 | set text(font: "New Computer Modern", lang: "en", size: 12pt)
|
9 | 21 | show math.equation: set text(weight: 400)
|
10 | 22 |
|
11 |
| - // Set paragraph spacing. |
12 | 23 | show par: set block(above: 1.2em, below: 1.2em)
|
13 | 24 |
|
14 | 25 | set par(leading: 0.75em)
|
15 | 26 |
|
16 |
| - // Title page. |
17 |
| - // The page can contain a logo if you pass one with `logo: "logo.png"`. |
| 27 | + // Cover Page |
18 | 28 | v(0.6fr)
|
19 |
| - if logo != none { |
20 |
| - align(right, image(logo, width: 26%)) |
21 |
| - } |
22 |
| - v(9.6fr) |
23 | 29 |
|
24 | 30 | box(
|
25 | 31 | width: 100%,
|
26 | 32 | align(center)[
|
27 | 33 | #text(2em, weight: 900)[
|
28 |
| - Fundamentals of Data Structures |
| 34 | + #course |
29 | 35 | ]
|
30 | 36 |
|
31 |
| - #text(3em, weight: 700)[ |
| 37 | + #text(title_size, weight: 700)[ |
32 | 38 | #title
|
33 | 39 | ]
|
34 | 40 |
|
35 |
| - #v(1em) |
36 |
| - #image("./images/ZJU-Logo.png", width: 50%) |
37 |
| - #v(2em) |
| 41 | + #v(cover_image_padding) |
| 42 | + #image("./images/ZJU-Logo.png", width: cover_image_size) |
| 43 | + #v(cover_image_padding) |
38 | 44 |
|
39 |
| - #text(1.35em)[ |
40 |
| - Date: #date |
| 45 | + #if (cover_comments == none) [ |
| 46 | + #text(cover_comments_size)[ |
| 47 | + #v(1em) |
| 48 | + #if (author != none) [ |
| 49 | + Author: #author |
| 50 | + ] |
41 | 51 |
|
42 |
| - 2023-2024 Spring & Summer Semester |
43 |
| - ] |
| 52 | + Date: #date |
44 | 53 |
|
45 |
| - #v(12em) |
| 54 | + #semester Semester |
| 55 | + ] |
| 56 | + ] else [ |
| 57 | + #cover_comments |
| 58 | + ] |
46 | 59 | ]
|
47 | 60 | )
|
48 | 61 |
|
49 |
| - // Author information. |
50 |
| - // pad( |
51 |
| - // top: 0.7em, |
52 |
| - // right: 20%, |
53 |
| - // grid( |
54 |
| - // columns: (1fr,) * calc.min(3, authors.len()), |
55 |
| - // gutter: 1em, |
56 |
| - // ..authors.map(author => align(start, strong(author))), |
57 |
| - // ), |
58 |
| - // ) |
59 |
| - |
60 | 62 | v(2.4fr)
|
61 | 63 | pagebreak()
|
62 | 64 |
|
|
0 commit comments