Skip to content

Commit

Permalink
fix: fix pdfpc export
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeX4 committed May 27, 2024
1 parent 6012e78 commit 9017037
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions slide.typ
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,14 @@
}
}
let bodies = bodies.pos()
// update pdfpc
let update-pdfpc(curr-subslide) = locate(loc => [
#metadata((t: "NewSlide")) <pdfpc>
#metadata((t: "Idx", v: loc.page() - 1)) <pdfpc>
#metadata((t: "Overlay", v: curr-subslide - 1)) <pdfpc>
#metadata((t: "LogicalSlide", v: states.slide-counter.at(loc).first())) <pdfpc>
])
let page-preamble(curr-subslide) = locate(loc => {
[
#metadata((t: "NewSlide")) <pdfpc>
#metadata((t: "Idx", v: loc.page() - 1)) <pdfpc>
#metadata((t: "Overlay", v: curr-subslide - 1)) <pdfpc>
#metadata((t: "LogicalSlide", v: states.slide-counter.at(loc).first())) <pdfpc>
]
if self.reset-footnote {
counter(footnote).update(0)
}
Expand Down Expand Up @@ -636,7 +637,7 @@
it
}
})
header = _update-states(1) + header
header = _update-states(1) + update-pdfpc(1) + header
set page(..(self.page-args + page-extra-args + (header: header, footer: footer)))
setting(
page-preamble(1) + composer-with-side-by-side(..conts)
Expand All @@ -647,7 +648,7 @@
if self.handout {
self.subslide = repeat
let (conts, _) = _parse-content(self: self, index: repeat, ..bodies)
header = _update-states(1) + header
header = _update-states(1) + update-pdfpc(1) + header
set page(..(self.page-args + page-extra-args + (header: header, footer: footer)))
setting(
page-preamble(1) + composer-with-side-by-side(..conts)
Expand All @@ -663,7 +664,9 @@
let (conts, _) = _parse-content(self: self, index: i, ..bodies)
// update the counter in the first subslide
if i == 1 {
new-header = _update-states(repeat) + new-header
new-header = _update-states(repeat) + update-pdfpc(i) + new-header
} else {
new-header = update-pdfpc(i) + new-header
}
result.push({
set page(..(self.page-args + page-extra-args + (header: new-header, footer: footer)))
Expand Down

0 comments on commit 9017037

Please sign in to comment.