Marmare314 / lemmify

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

Expose subgroup to thm-styling to allow styling theorems, proofs etc. differently #31

Open luewolf opened 3 months ago

luewolf commented 3 months ago

default-theorems(thm-styling: ...) expects a function that allows overriding the layout of theorems, proofs and so on. The function has the signature (thm-type, name, number, body) => content. It would be great if using this function would allow us to pick different layouts and styles depending on whether it is applied to a theorem, an example, a lemma and so on. Unfortunately, thm-type contains the localized name of the subgroup, making comparisons that work independently of language difficult. Thus, the function signature should be extended to also include the non-localized theorem type (aka subgroup).

Marmare314 commented 2 months ago

The way I intended for this to work is to provide different stylings to each group. But this is of course more work than just checking the thm-type parameter, since they have to be created manually. So maybe thm-type should be provided non-localized and can then be localized in the styling function.