How do I use a Hayagriva .yml bibliography file with a Typst .typ document?

CSShistory:
  type: video,
  title: "Peachpuffs and Lemonchiffons [CSSConfUS2014]"
  url:
    value: https://www.youtube.com/watch?v=HmStJQzclHc
    date: 2014-07-17
 author:
    - Alex Sexton

This is my Hayagriva file called mybib.yml in the same directory as the main Typst file, mydoc.typ.

In mydoc.typ, I have a section called == References in which I want to include this single reference. It has also been cited as #cite(CSShistory) in the text.
How do I link the mybib.yml file to the mydoc.typ file?

I tried #bibliography("mybib.yml") but I get errors on compiling.

Can someone pease help me.

How exactly are you citing? It is either #cite(<CSShistory>) or @CSShistory, the path to the YML file should work as-is.

1 Like

@xkevio: Thank you for so emphatically saying that it should work.

I now realize that the cause of the error was the terminal comma after video in the second line of the mybib.yml file as listed above. Removing the comma solved the problem. Cheers!

From https://typst.app/docs/reference/model/cite/#example:

This was already noted by
pirates long ago. @arrgh

Multiple sources say ...
@arrgh @netwok.

You can also call `cite`
explicitly. #cite(<arrgh>)

#bibliography("works.bib")

@Andrew: I am a BibTeX user trying out Hayagrva.

I looked at the link you have shown before posting, but did not see a Hayagriva file in the docs for arrgh or netwok.

The error I made was also because of my BibTeX habit of separating key values from the next key by commas.

Hmm. The Bibliography Function – Typst Documentation page does mention both, but I guess it won’t hurt explicitly mentioning it in Cite Function – Typst Documentation. See Mention types of supported bibliography formats for citing by Andrew15-5 · Pull Request #6354 · typst/typst · GitHub.

@chyavana, do you think an explicit mention of supported Hayagriva format on the page for cite would’ve solved your problem, or would you still have asked how to use it because of the comma and the change to the docs is not worth it?

@Andrew: A cautionary note to those coming in from BibTeX—where a precautionary terminal comma is prescribed—to avoid that very comma in Hayagriva would be helpful.

Also, a link to the Hayagriva examples page would be helpful.

What I was looking for was the Hayagriva source file: "works.yml" file.