Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rich-counters instead of headcount #11

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
#import "@preview/hydra:0.5.1": hydra
#import "@preview/equate:0.2.1": equate
#import "@preview/i-figured:0.2.4": reset-counters, show-equation
#import "@preview/headcount:0.1.0": reset-counter

#let mathcounter = counter("mathblocks") // counter for mathblocks
#let template(
// personal/subject related stuff
author: "Stuart Dent",
Expand Down Expand Up @@ -179,8 +177,6 @@ show heading: it => {
it
}
}
// from headcount for theorems
show heading: reset-counter(mathcounter, levels: 1)
// ------------------- other settings -------------------
// Settings for Chapter in the outline
show outline.entry.where(
Expand Down
10 changes: 7 additions & 3 deletions template/customization/great-theorems-customized.typ
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
// packages
#import "../../lib.typ": mathcounter
#import "@preview/great-theorems:0.1.1": *
#import "@preview/headcount:0.1.0": *
#import "@preview/rich-counters:0.2.2": rich-counter

// local
#import "colors.typ": *

// counter for mathblocks
#let mathcounter = rich-counter(
identifier: "mathblocks",
inherited_levels: 1
)

#let my_mathblock = mathblock.with(
radius: 0.3em,
inset: 0.8em,
counter: mathcounter,
numbering: dependent-numbering("1.1"),
breakable: false,
titlix: title => [(#title):],
)
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
Expand Up @@ -31,7 +31,7 @@
// equation settings
equate-settings: (breakable: true, sub-numbering: true, number-mode: "label"),
equation-numbering-pattern: "(1.1)",

// colors
cover-color: color1,
heading-color: color2,
Expand Down