Skip to content

Commit

Permalink
including header in page.typ (requires to load asset)
Browse files Browse the repository at this point in the history
  • Loading branch information
remigerme committed Jul 30, 2024
1 parent e70c6a6 commit cf180fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 10 additions & 0 deletions page.typ
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
doc
}

// Applying header and footer setup
#let apply-header-footer(doc, short-title: none) = {
set page(header: {
grid(columns: (1fr, 1fr),
align(horizon, smallcaps(text(fill: rgb("01426A"), size: 14pt, font: "New Computer Modern", weight: "regular")[#short-title])),
align(right, image("assets/logo-x-ip-paris.svg", height: 20mm)))
}, numbering: "1 / 1")
counter(page).update(1)
}


/********************/
/* TESTING TEMPLATE */
Expand Down
9 changes: 2 additions & 7 deletions template/report.typ
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sur plusieurs lignes]
// Subtitle on cover page
#let subtitle = "Un sous-titre pour expliquer ce titre"
// Short title on headers
#let short_title = "Rapport de stage"
#let short-title = "Rapport de stage"
#let author = "Rémi Germe"
#let date-start = datetime(year: 2024, month: 06, day: 05)
#let date-end = datetime(year: 2024, month: 09, day: 05)
Expand Down Expand Up @@ -39,12 +39,7 @@ sur plusieurs lignes]
#outline(title: [Template contents], indent: 1em, depth: 2)

// Defining header and page numbering (will pagebreak)
#set page(header: {
grid(columns: (1fr, 1fr),
align(horizon, smallcaps(text(fill: rgb("01426A"), size: 14pt, font: "New Computer Modern", weight: "regular")[#short_title])),
align(right, image("../assets/logo-x-ip-paris.svg", height: 20mm)))
}, numbering: "1 / 1")
#counter(page).update(1)
#show: polytechnique.page.apply-header-footer.with(short-title: short-title)

// Introduction
#heading(level: 1, numbering: none)[Introduction]
Expand Down

0 comments on commit cf180fd

Please sign in to comment.