Marmare314 / lemmify

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

Example is not working in typst 0.11 #24

Closed psads-git closed 2 months ago

psads-git commented 7 months ago

I am using the following code in typst 0.11, but getting the error below. Could you please help me? Thanks!

#import "@preview/lemmify:0.1.5": *

#example("xxx")[
  #lorem(100)
]
[2024-03-29T00:26:05Z INFO  typst_ts_compiler::service::diag::console] /x.typ: Compilation failed after 251.111µs

error: unknown variable: example
  ┌─ /tmp/x.typ:3:1
  │
3 │ #example("xxx")[
  │  ^^^^^^^
Marmare314 commented 2 months ago

You first need to create the theorem-functions like example and then apply the styling:

#import "@preview/lemmify:0.1.5": *

#let (
  theorem, lemma, corollary,
  remark, proposition, example,
  proof, rules: thm-rules
) = default-theorems("thm-group", lang: "en")

#show: thm-rules

#example(name: "xxx")[
  #lorem(100)
]
psads-git commented 2 months ago

That is it, @Marmare314. Thanks!