Skip to content

同一级标题采用不同的格式

同一级标题采用不同的格式

请问, 同一级标题采用不同的格式, 应该看哪里的资料?

建议是搓两个 counter,自己写个函数处理

typst
#let chapter(title) = {
  heading(
    level: 1,
    {
      counter("chapter").step()
      context counter("chapter").display("第一章")
      h(0.3em)
      title
    },
  )
}

#let subject(title) = {
  heading(
    level: 1,
    {
      counter("subject").step()
      context counter("subject").display("专题一")
      h(0.3em)
      title
    },
  )
}

#chapter("对")
#chapter("对")
#chapter("对")

#subject("好")

#chapter("对")
#chapter("对")

#subject("好")
Typst compiled imageTypst compiled imageTypst compiled image

贡献者

The avatar of contributor named as flaribbit flaribbit
The avatar of contributor named as QuadnucYard QuadnucYard
The avatar of contributor named as Y.D.X. Y.D.X.

页面历史

Comments
  • Latest
  • Oldest
  • Hottest

基于 MIT 许可发布