更好的展示定义与定理
我们推荐使用 lemmify,但在使用前需要进行配置:
1#import "@preview/lemmify:0.1.8": *2
3#let my-thm-style(4 thm-type,5 name,6 number,7 body,8) = block(width: 100%, breakable: true)[#{9 set align(left)10
11 strong(thm-type) + " "12 if number != none {13 let n = number.split(".").map(s => s.trim()).join(".")14 strong(n) + " "15 }16
17 if name != none {18 strong[(#name)] + " "19 }20 " " + body21}]22
23#let (24 theorem,25 lemma,26 proof,27 rules: thm-rules-thm,28) = default-theorems(29 "thm-group-thm",30 lang: "zh",31 thm-numbering: thm-numbering-heading.with(max-heading-level: 1),32 thm-styling: my-thm-style,33)34
35#let (definition, corollary, proposition, rules: thm-rules-def) = default-theorems(36 "thm-group-def",37 lang: "zh",38 thm-numbering: thm-numbering-heading.with(max-heading-level: 1),39 thm-styling: my-thm-style,40)41
42#let (43 remark,44 example,45 rules: thm-rules-example,46) = default-theorems(47 "thm-group",48 lang: "zh",49 thm-numbering: thm-numbering-heading.with(max-heading-level: 2),50 thm-styling: my-thm-style,51)后面主要是进行分组,不同组的编号不连续
接着,在每个需要写定理的文件(如果是一个文件的话,在这个文件即可)引入(注意是需要在定义完前文的内容后):
1#show: thm-rules-thm2#show: thm-rules-def3#show: thm-rules-example这样,我们就可以应用格式了,例如定义:
1#definition(name: "合取范式")[2 *合取范式*(Conjunctive Normal Form,简称 CNF)为子句的3 合取(形如 $c_1 and c_2 and dots and c_m$),一般记作 $psi, cal(F)$ 等符号。4 CNF 满足当且仅当所有其子句都满足。5]展示如下:
