Skip to content

如何让引用的 label 缺失时仍然能编译?

如何让引用的 label 缺失时仍然能编译?

typst
#show ref: it => {
  if it.element == none {
    return text(fill: red, "<未找到引用" + str(it.target) + ">")
  }
  it
}

#figure(rect(), caption: "A sample figure") <fig2>
@fig1 @fig2
Typst compiled image

WARNING

以上规则会把引用的文献误判为缺失标签。目前区分这两种情况比较困难,需要自行扫描*.bibhack context机制

相关 issue:Downgrade missing references from errors to warning · Issue #4035 · typst/typst

What do you think?
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.5.1

基于 MIT 许可发布