Skip to content

Commit

Permalink
use new hydra
Browse files Browse the repository at this point in the history
  • Loading branch information
lkndl committed Jan 10, 2024
1 parent 1e22d1c commit 1f42394
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions modules/template.typ
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

#import "styles.typ": *
#import "headers.typ": *
// #import "headers.typ": *
#import "footers.typ": *
#import "figures.typ": *
#import "front-matter.typ": *
#import "back-matter.typ": *
#import "@preview/hydra:0.3.0": hydra

// These are the fields you can or
// should pass to the template function
Expand Down Expand Up @@ -64,7 +65,7 @@

show: heading-styles.with(args.lang, args.numbering-depth)
show: caption-styles.with(supplement-position: "left")
show: header-styles
// show: header-styles


////////////////////////////////////////////////
Expand All @@ -84,12 +85,14 @@
////////////////////////////////////////////////
// some more main body setup
set page(
header: set-headers(
// all: [#args.author #sym.dot #args.short-title],
// this is overkill; for demonstration
even: [#get-open-section(level: 1)#h(1fr)#args.author #sym.dot #args.short-title],
odd: get-open-section(level: 2, descend-to-level: 3),
),
header: locate(loc => {
if calc.even(loc.page()) {
// this is overkill; for demonstration
emph[#hydra(1, loc: loc)#h(1fr)#args.author #sym.dot #args.short-title]
} else {
emph[#h(1fr)#hydra(2, loc: loc)]
}
}),
// footer: get-pagination(args.pagination-align)
)
// the intro maybe should start on a right-hand side, but in any case the right-hand pages must be "odd"!
Expand Down

0 comments on commit 1f42394

Please sign in to comment.