Skip to content

Commit

Permalink
Merge pull request #7 from krestenlaust/abstract-page
Browse files Browse the repository at this point in the history
Abstract page
  • Loading branch information
krestenlaust authored Nov 23, 2023
2 parents 8d309da + f7a2a1e commit d9de7e6
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 17 deletions.
28 changes: 18 additions & 10 deletions main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,28 @@
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Explaining Quantum Mechanics to a Child, Like a Boss: Enable Understanding for Small People",
authors: (
(name: "Kresten Mellemnavn Efternavn", email: "kresten@gmail.com"),
(name: "Peter Petersen", email: "mail1@mail.dk"),
(name: "Anders Andersen", email: "mail2@mail.dk"),
(name: "Lasse Lassesen", email: "mail3@mail.dk"),
(name: lorem(5), email: "mail4@mail.dk"),
meta: (
title: "Explaining Quantum Mechanics to a Child, Like a Boss: Enable Understanding for Small People",
theme: "Scientific Theme",
project_period: "Fall Semester 2010",
project_group: "cs-23-sw-1-p1-15",
participants: (
(name: "Kresten Mellemnavn Efternavn", email: "kresten@gmail.com"),
(name: "Peter Petersen", email: "mail1@mail.dk"),
(name: "Anders Andersen", email: "mail2@mail.dk"),
(name: "Lasse Lassesen", email: "mail3@mail.dk"),
(name: lorem(5), email: "mail4@mail.dk"),
),
supervisor: (
(name: "Anders And", email: "abc@abc.com"),
(name: "Mickey Mouse", email: "abc@abc.com"),
),
date: "Christmas Eve",
),
// Insert your abstract after the colon, wrapped in brackets.
// Example: `abstract: [This is my abstract...]`
abstract: lorem(59),
groupname: "cs-23-sw-1-p1-15",
date: "November 22, 2023",
logo: none,
department: "Computer Science",
)

// We generated the example code below so you can see how
Expand Down
59 changes: 52 additions & 7 deletions template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@
abstract: [],
authors: (),
groupname: "",
department: "",
date: none,
logo: none,
meta: (
title: "Edit Title Here",
theme: "Scientific Theme",
project_period: "Fall Semester 2010",
project_group: "group 1",
participants: (),
supervisor: (),
date: "Christmas Eve",
),
body,
) = {
let aaublue = rgb(33, 26, 82)
let snake_to_pascalcase(str) = str.split("_").map(str => upper(str.slice(0, 1)) + lower(str.slice(1))).join(" ")

// Set the document's basic properties.
set document(author: authors.map(a => a.name), title: title)
set document(author: meta.participants.map(a => a.name), title: meta.title)
set page(numbering: "1", number-align: center)

set page(background: locate(loc =>
Expand Down Expand Up @@ -43,9 +54,9 @@
{
set text(fill: white, 12pt)
align(center)[
#text(font: sans-font, 2em, weight: 700, title)\ \
#groupname\
#((..authors.map(author => author.name)).join(", ", last: " and "))
#text(font: sans-font, 2em, weight: 700, meta.title)\ \
#meta.project_group\
#((..meta.participants.map(author => author.name)).join(", ", last: " and "))
]
}
)),
Expand All @@ -58,8 +69,42 @@
pagebreak()

// Abstract page.
v(1fr)
align(center)[
//v(1fr)
grid(
columns: (50%, 50%),
rows: (30%, 70%),
box(width: 100%, height: 100%, {
image("AAUgraphics/aau_logo_en.svg")
}),
box(width: 100%, height: 100%, {
align(right + horizon)[
*#(department)*\
Aalborg University\
http://cs.aau.dk
]
}),
box(width: 100%, height: 100%)[
#(meta.pairs().map(data =>
[*#(snake_to_pascalcase(data.at(0))):*\ #(
if type(data.at(1)) == array {
data.at(1).map(d => [#(d.name)]).join("\n")
} else {
data.at(1)
}
)]
).join("\n\n"))
\
*Copies:* 1\ \
*Page Numbers:* #(locate(loc => counter(page).final(loc)))\ \
],
box(width: 100%, height: 100%, stroke: black, inset: 8pt)[
*Abstract:*\
#abstract
]
)
align(center)[
#heading(
outlined: false,
numbering: none,
Expand Down

0 comments on commit d9de7e6

Please sign in to comment.