How do I determine which type a legislation bibentry will have in CSL?

I am trying to modify the way the sources are shown in my Typst document. For this I am modifying a csl to fit my needs. In doing so I encountered a problem:

The type of field that Typst seems to forward from the .bib file to csl seems to be determined by some sort of ‘if field exists’ or maybe regex. It does not seem to use the stated type in the .bib. I was trying to modify the way a @legislation is shown, but depending on whether the url field is present and starts with an ‘https://’ it seems to fall into webpage or default (or maybe something else, I did only test for webpage and legislation).

This leads to two questions:

  • Is there an easy way to determine what type typst assigns to each bibentry before forwarding it to my csl?
  • Has someone found a way to target legislation with an csl that does not make me check certain markers in csl again to determine the entries that where supposed to be legislation?

All of this might not even help me though, as I still need to find a may to make legislation citable but still not show up in bibliography. Doing it through csl seems to create the problem of an newline where the entry got suppressed. I have not found a different way to do it though, without having to write custom bib management. Is there any better way? (The style guides do often require to exclude legislation from the bibliography…)

1 Like

+1, I also find it difficult to match entry types in bib and csl.

The biblatex::EntryTypehayagriva::EntryType logic lies in interop.rs.
And hayagriva::EntryType vs. citationberg::Kind logic lies in csl/taxonomy.rs.

Edit: I made A snippet to debug bibliography entries by showing what CSL receives.

Refs: (in Chinese, but you can ask in English if you want)

Perhaps you could use the footnote function for legislations (and omit them in your ref.bib).

1 Like

Thank you for the answer and the look into the sourcecode for the conversions. Starting from Zotero, which creates a .bib with entry types not supported by biblatex, then through biblatex, afterwards through hayagriva and finally to CSL does create some confusion.

And using (or abusing) footnotes for legislation does seem like the most promising way to get the desired result with legislation.

1 Like