Marmare314 / lemmify

A library for typesetting mathematical theorems in typst.
GNU General Public License v3.0
15 stars 8 forks source link

Bug: ref-styling is not applied in default-theorems #27

Closed ProgramSnail closed 1 month ago

ProgramSnail commented 4 months ago

Hi, thank you for your work, this package is extremely useful.

Bug: default-theorems function has argument ref-styling, which is not used in new-theorems calls inside. So ref-styling is not applied as it should be.

#let default-theorems(
  group,
  lang: "en",
  thm-styling: thm-style-simple,
  proof-styling: thm-style-proof,
  thm-numbering: thm-numbering-heading,
  ***ref-styling: thm-ref-style-simple,***
  max-reset-level: 2
) = {
  let (proof, ..subgroup-map) = translations.at(lang)

  let (rules: rules-theorems, ..theorems) = new-theorems(
    group,
    subgroup-map,
    thm-styling: thm-styling,
    thm-numbering: thm-numbering
  )

  let (rules: rules-proof, proof) = new-theorems(
    group,
    (proof: translations.at(lang).at("proof")),
    thm-styling: proof-styling,
    thm-numbering: thm-numbering-proof,
    ref-numbering: thm-numbering
  )

  return (
    ..theorems,
    proof: use-proof-numbering(proof),
    rules: concat-fold((
      thm-reset-counter-heading.with(group, max-reset-level),
      rules-theorems,
      rules-proof
    ))
  )
}
Marmare314 commented 1 month ago

Thanks for the bug report, it will be fixed in the next version.