From 2a3595c69494cf9d8cf08b46044f84a703f26ce8 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Thu, 23 Nov 2023 11:50:49 +0100 Subject: [PATCH 1/5] Top of abstract page --- main.typ | 1 + template.typ | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/main.typ b/main.typ index cf8d497..7f672aa 100644 --- a/main.typ +++ b/main.typ @@ -15,6 +15,7 @@ // Example: `abstract: [This is my abstract...]` abstract: lorem(59), groupname: "cs-23-sw-1-p1-15", + department: "Computer Science", date: "November 22, 2023", logo: none, ) diff --git a/template.typ b/template.typ index c9669ed..ed6bc0c 100644 --- a/template.typ +++ b/template.typ @@ -6,6 +6,7 @@ abstract: [], authors: (), groupname: "", + department: "", date: none, logo: none, body, @@ -58,8 +59,22 @@ pagebreak() // Abstract page. - v(1fr) -align(center)[ + //v(1fr) + grid( + columns: (50%, 50%), + rows: (20%, 80%), + 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 + ] + }) + ) + align(center)[ #heading( outlined: false, numbering: none, From 2e3685ea09676a13537a28f462a73ca0c829e3d7 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Thu, 23 Nov 2023 12:01:41 +0100 Subject: [PATCH 2/5] Almost finished styling abstract page --- template.typ | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/template.typ b/template.typ index ed6bc0c..4b7b428 100644 --- a/template.typ +++ b/template.typ @@ -62,17 +62,48 @@ //v(1fr) grid( columns: (50%, 50%), - rows: (20%, 80%), + rows: (30%, 70%), box(width: 100%, height: 100%, { image("AAUgraphics/aau_logo_en.svg") }), box(width: 100%, height: 100%, { align(right + horizon)[ - **#(department)**\ + *#(department)*\ Aalborg University\ http://cs.aau.dk ] - }) + }), + box(width: 100%, height: 100%)[ + *Title:*\ + #title\ \ + + *Theme:*\ + Scientific Theme\ \ + + *Project Period:*\ + Fall Semester 2010\ \ + + *Project Group:*\ + #groupname\ \ + + *Participants(s):*\ + Todo\ \ + + *Supervisor(s):*\ + Supervisor 1\ + Supervisor 2\ \ + + *Copies:* 1\ \ + + *Page Numbers:* Todo\ \ + + *Date of Completion:*\ + #date\ \ + ], + box(width: 100%, height: 100%, stroke: black, inset: 8pt)[ + *Abstract:*\ + #abstract + ] ) align(center)[ #heading( From f1c9174a28cfbe3d6cad430fdda0c0fedf83034e Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Thu, 23 Nov 2023 15:41:08 +0100 Subject: [PATCH 3/5] Generalized elements on abstract page --- main.typ | 24 ++++++++++++++---------- template.typ | 53 ++++++++++++++++++++++++++-------------------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/main.typ b/main.typ index 7f672aa..85c7ca2 100644 --- a/main.typ +++ b/main.typ @@ -3,21 +3,25 @@ // 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: (), + 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", department: "Computer Science", - date: "November 22, 2023", - logo: none, ) // We generated the example code below so you can see how diff --git a/template.typ b/template.typ index 4b7b428..342cef5 100644 --- a/template.typ +++ b/template.typ @@ -8,12 +8,22 @@ 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 => @@ -44,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 ")) ] } )), @@ -74,31 +84,20 @@ ] }), box(width: 100%, height: 100%)[ - *Title:*\ - #title\ \ - - *Theme:*\ - Scientific Theme\ \ - - *Project Period:*\ - Fall Semester 2010\ \ - - *Project Group:*\ - #groupname\ \ - - *Participants(s):*\ - Todo\ \ - - *Supervisor(s):*\ - Supervisor 1\ - Supervisor 2\ \ - + #(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:* Todo\ \ - - *Date of Completion:*\ - #date\ \ ], box(width: 100%, height: 100%, stroke: black, inset: 8pt)[ *Abstract:*\ From c59eee528fd52257240fb3587839bbdbf5a18f81 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Thu, 23 Nov 2023 19:26:40 +0100 Subject: [PATCH 4/5] Page number added --- template.typ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template.typ b/template.typ index 342cef5..5c4b5eb 100644 --- a/template.typ +++ b/template.typ @@ -97,7 +97,7 @@ \ *Copies:* 1\ \ - *Page Numbers:* Todo\ \ + *Page Numbers:* #(locate(loc => counter(page).final(loc)))\ \ ], box(width: 100%, height: 100%, stroke: black, inset: 8pt)[ *Abstract:*\ From f7a2a1e24f58851001da2c84a16c0689c5fe780c Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Thu, 23 Nov 2023 20:06:29 +0100 Subject: [PATCH 5/5] Added superviser example --- main.typ | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.typ b/main.typ index 85c7ca2..857fb3f 100644 --- a/main.typ +++ b/main.typ @@ -15,7 +15,10 @@ (name: "Lasse Lassesen", email: "mail3@mail.dk"), (name: lorem(5), email: "mail4@mail.dk"), ), - supervisor: (), + 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.