Skip to content

如何在 .typ 文件内著录参考文献,而不拆分出 .bib 等文件?

如何在 .typ 文件内著录参考文献,而不拆分出 .bib 等文件?

bibliography也接受原始bytes作为源,例如:

typst
Cite them as usual: @key

#let bib = ```bib
@misc{key,
  title = {Title},
}
```.text
#bibliography(bytes(bib), style: "gb-7714-2015-numeric")
Typst compiled image

来源:How to insert bibliography entries as code to avoid importing .bib file

其它用法

若同时使用 BibLaTeX .bib和 Hayagriva .yaml两种格式,可组成列表一并输入。

typst
#set text(lang: "zh")

正常引用即可@work-bib @work-yaml

#bibliography(
  (
    ```bib
    @article{work-bib,
      title = {A work from BibLaTeX},
    }
    ```.text,
    ```yaml
    work-yaml:
      type: article
      title: A work from Hayagriva
      parent:
        type: periodical
    ```.text,
  ).map(bytes),
  style: "gb-7714-2015-numeric",
)
Typst compiled image
Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.8.0

基于 MIT 许可发布