Skip to content

Commit 1317362

Browse files
committed
feat: provide more options of cover
1 parent 067534c commit 1317362

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

document/project-report.typ

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#import "template.typ": *
22

3-
// Take a look at the file `template.typ` in the file panel
4-
// to customize this template and discover how it works.
53
#show: project.with(
64
title: "Projects 1: ???",
7-
date: "2024/03/04",
8-
authors: (
9-
"Anonymous",
10-
),
5+
date: "2024/03/14",
6+
author: "memset0",
7+
// cover_comments: [something], // If cover_comments is assigned, it will be used as the cover's original comments
118
)
129

1310
= *Chapter 1*: Introduction

document/template.typ

+32-30
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,64 @@
11
// The project function defines how your document looks.
22
// It takes your content and some metadata and formats it.
33
// 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+
) = {
517
// Set the document's basic properties.
6-
set document(author: authors, title: title)
18+
set document(author: (author), title: title)
719
set page(numbering: "1", number-align: center)
820
set text(font: "New Computer Modern", lang: "en", size: 12pt)
921
show math.equation: set text(weight: 400)
1022

11-
// Set paragraph spacing.
1223
show par: set block(above: 1.2em, below: 1.2em)
1324

1425
set par(leading: 0.75em)
1526

16-
// Title page.
17-
// The page can contain a logo if you pass one with `logo: "logo.png"`.
27+
// Cover Page
1828
v(0.6fr)
19-
if logo != none {
20-
align(right, image(logo, width: 26%))
21-
}
22-
v(9.6fr)
2329

2430
box(
2531
width: 100%,
2632
align(center)[
2733
#text(2em, weight: 900)[
28-
Fundamentals of Data Structures
34+
#course
2935
]
3036

31-
#text(3em, weight: 700)[
37+
#text(title_size, weight: 700)[
3238
#title
3339
]
3440

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)
3844

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+
]
4151

42-
2023-2024 Spring & Summer Semester
43-
]
52+
Date: #date
4453

45-
#v(12em)
54+
#semester Semester
55+
]
56+
] else [
57+
#cover_comments
58+
]
4659
]
4760
)
4861

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-
6062
v(2.4fr)
6163
pagebreak()
6264

0 commit comments

Comments
 (0)