Skip to content

Commit

Permalink
Fix problem numbers in outline
Browse files Browse the repository at this point in the history
  • Loading branch information
kdkasad committed Dec 14, 2024
1 parent 8a1e5e3 commit 2d70fd6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Binary file modified examples/computer-science.pdf
Binary file not shown.
Binary file modified examples/english.pdf
Binary file not shown.
23 changes: 19 additions & 4 deletions khw.typ
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
let num = number
if number == auto {
_khw-problem-counter.step()
num = context _khw-problem-counter.display()
}

if (newpage == auto and _khw-newpages.get() == true) or (newpage == true) {
Expand All @@ -125,7 +124,15 @@
line(length: 100%)
if outlined {
show heading: it => none
heading(numbering: none)[#_khw-problem-prefix.get() #num]
context heading(numbering: none, {
_khw-problem-prefix.get()
[ ]
if number == auto {
_khw-problem-counter.display()
} else {
number
}
})
}
grid(
columns: (auto, 1fr),
Expand All @@ -143,13 +150,21 @@
_content
}
),
grid.cell(
context grid.cell(
align: if align-number == auto {
_khw-align-numbers.get()
} else {
align-number
},
text(size: 48pt, weight: "black", num)
text(
size: 48pt,
weight: "black",
if number == auto {
_khw-problem-counter.display()
} else {
number
}
)
),
)
line(length: 100%)
Expand Down

0 comments on commit 2d70fd6

Please sign in to comment.