Skip to content

Commit

Permalink
Add danish logo and optimize some logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinggaard committed Dec 3, 2024
1 parent b880fb8 commit f12f3f1
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 25 deletions.
202 changes: 202 additions & 0 deletions AAUgraphics/aau_logo_da.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typst init @preview/classic-aau-report

**NOTE:**
The template tries to use the `Palatino Linotype` font, which is *not* available in Typst.
It is available [here](https://github.com/Tinggaard/classic-aau-report/tree/main/fonts)
It is available [here](https://github.com/Tinggaard/classic-aau-report/releases/tag/fonts) ([direct download](https://github.com/Tinggaard/classic-aau-report/releases/download/fonts/PalatinoLinotype.zip))

To use it in the *web-app*, put the `.ttf` files anywhere in the project tree.

Expand Down Expand Up @@ -86,7 +86,7 @@ Furthermore, the template exports the shawrules
To use it in an existing project, add the following show rule to the top of your file.

```typ
#import "@preview/classic-aau-report:0.1.0": project, frontmatter, mainmatter, backmatter, appendix
#import "@preview/classic-aau-report:0.1.1": project, frontmatter, mainmatter, backmatter, appendix
// Any of the below can be omitted, the defaults are either empty values or CS specific
#show: project.with(
Expand Down
30 changes: 10 additions & 20 deletions lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@
),
)

#let _custom-header(name: none) = context {
let matches = query(<heading>)
#let _is-chapter-page(tag) = {
let matches = query(tag)
let current = counter(page).get()
let is-chapter-page = matches.any(m =>
return matches.any(m =>
counter(page).at(m.location()) == current
)
}

if not is-chapter-page {
if calc.even(current.first()) {
#let _custom-header(name: none) = context {
if not _is-chapter-page(<heading>) {
if calc.even(here().page()) {
[#counter(page).display() of #counter(page).final().first()]
h(1fr)
[#name #hydra(1)]
Expand All @@ -46,25 +48,13 @@
}

#let _custom-footer = context {
let matches = query(<heading>)
let current = counter(page).get()
let is-chapter-page = matches.any(m =>
counter(page).at(m.location()) == current
)

if is-chapter-page {
if _is-chapter-page(<heading>) {
align(center, counter(page).display())
}
}

#let _frontmatter-custom-footer = context {
let matches = query(<frontmatter-heading>)
let current = counter(page).get()
let is-chapter-page = matches.any(m =>
counter(page).at(m.location()) == current
)

if is-chapter-page {
if _is-chapter-page(<frontmatter-heading>) {
align(center, counter(page).display(page.numbering))
}
}
Expand Down Expand Up @@ -278,7 +268,7 @@
grid(
columns: (50%, 50%),
rows: (3fr, 7fr, 30pt),
image("./AAUgraphics/aau_logo_en.svg", width: 90%),
image("./AAUgraphics/aau_logo_da.svg", width: 90%),
align(right + horizon)[
#strong(dk.department)\
Aalborg Universitet\
Expand Down
Binary file modified template/main.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion template/main.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/classic-aau-report:0.1.0": project, frontmatter, mainmatter, backmatter, appendix
#import "@preview/classic-aau-report:0.1.1": project, frontmatter, mainmatter, backmatter, appendix

#show: project.with(
meta: (
Expand Down
4 changes: 2 additions & 2 deletions typst.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "classic-aau-report"
version = "0.1.0"
version = "0.1.1"
entrypoint = "lib.typ"
authors = ["Jens Tinggaard <@Tinggaard>"]
license = "MIT"
description = "An example package."
description = "A report template for students at Aalborg University (AAU)"
repository = "https://github.com/Tinggaard/classic-aau-report"
keywords = [
"Semesterprojekt",
Expand Down

0 comments on commit f12f3f1

Please sign in to comment.