Skip to content

Commit

Permalink
Merge pull request #4 from krestenlaust/add-background-image-to-front…
Browse files Browse the repository at this point in the history
…page

Add background picture to frontpage
  • Loading branch information
krestenlaust authored Nov 23, 2023
2 parents 3bc6afc + 8d87338 commit 55441d6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
15 changes: 8 additions & 7 deletions main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
// 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 — A Long Title for a Report",
title: "Explaining Quantum Mechanics to a Child, Like a Boss: Enable Understanding for Small People",
authors: (
(name: "Kresten", email: "kresten@gmail.com"),
(name: "Author 2", email: "mail1@mail.dk"),
(name: "Author 3", email: "mail2@mail.dk"),
(name: "Author 4", email: "mail3@mail.dk"),
(name: "Author 5", email: "mail4@mail.dk"),
(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"),
),
// 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: "AAUgraphics/frontpageImage.jpg",
logo: none,
)

// We generated the example code below so you can see how
Expand Down
54 changes: 29 additions & 25 deletions template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@
title: "Edit Title Here",
abstract: [],
authors: (),
groupname: "",
date: none,
logo: none,
body,
) = {
let aaublue = rgb(33, 26, 82)
// Set the document's basic properties.
set document(author: authors.map(a => a.name), title: title)
set page(numbering: "1", number-align: center)

set page(background: locate(loc =>
if loc.page() == 1 {
image("AAUgraphics/aau_waves.svg", width: 100%, height: 100%)
}
))

// Save heading and body font families in variables.
let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"
Expand All @@ -24,33 +32,29 @@
set heading(numbering: "1.1")

// Title page.
// The page can contain a logo if you pass one with `logo: "logo.png"`.
v(0.6fr)
if logo != none {
align(right, image(logo, width: 100%))
}
image("AAUgraphics/aau_wavesImage.svg", width: 100%, height: 20%)
v(9.6fr)

text(1.1em, date)
v(1.2em, weak: true)
text(font: sans-font, 2em, weight: 700, title)

// Author information.
pad(
top: 0.7em,
right: 20%,
grid(
columns: (1fr,) * calc.min(3, authors.len()),
gutter: 1em,
..authors.map(author => align(start)[
*#author.name* \
#author.email
]),
),
grid(
columns: (100%),
rows: (50%, 20%, 30%),
align(center + bottom, box(
fill: aaublue,
inset: 18pt,
radius: 1pt,
clip: false,
{
set text(fill: white, 12pt)
align(center)[
#text(font: sans-font, 2em, weight: 700, title)\ \
#groupname\
#((..authors.map(author => author.name)).join(", ", last: " and "))
]
}
)),
box(),
align(center)[
#image("AAUgraphics/aau_logo_circle_en.svg", width: 25%)
]
)

v(2.4fr)
pagebreak()

// Abstract page.
Expand Down

0 comments on commit 55441d6

Please sign in to comment.