Skip to content

Commit

Permalink
Merge pull request #11 from sebaseb98/rich-counters
Browse files Browse the repository at this point in the history
Use rich-counters instead of headcount
  • Loading branch information
sebaseb98 authored Nov 25, 2024
2 parents 4669b56 + 7673482 commit 2e4d65d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
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

0 comments on commit 2e4d65d

Please sign in to comment.