What is a "deserialisation error" and how do I resolve it?

I have got the bibliograhy working in my project with

#bibliography("bibliography.bib", style: "iso-690-author-date" )

However, I would like to use an alternative style which is not one of the styles incorporated in typst, e.g. “New Oxford Style Manual Author Date”. I have accessed the CSL style from the Zotero repository, and have uploaded it into an “Assets” folder within the project root.

If I modify the code like so:

#bibliography("bibliography.bib", style: "./Assets/new-oxford-style-manual-author-date.csl" )

the project fails to complie with the following error:

If I remove the .csl , it returns “Unknown style”.

Could someone please explain what a “deserialisation error” is and how to correct it… or to put it more generally how to get Typst to recognise a CSL style not incorporated in Typst.

:slight_smile:
Mark

I can reproduce your description with https://www.zotero.org/styles/new-oxford-style-manual-author-date.

This style is a dependent CSL style. Dependent CSL styles are aliases for independent styles, and Typst only supports independent styles.

This style contains the following line, so it’s an alias for https://www.zotero.org/styles/new-harts-rules-author-date. You can use that style instead. The output should be identical.

    <link href="http://www.zotero.org/styles/new-harts-rules-author-date" rel="independent-parent"/>

However, I agree that the error message can be improved. I’ve just opened Improve the error message for dependent CSL styles (v0.15 regression) · Issue #8695 · typst/typst · GitHub.

1 Like

Thanks
:slight_smile:
Mark

Isn’t it more like, dependent styles extend other styles? Not necessarily as an alias/producing the same result?

But if the link is the only substantive thing in the style, there should be no difference of course. Just: keep an eye open for differences to what you expect when switching – assuming I got that right.

Here’s the description in the CSL spec.

A dependent style is an alias for an independent style. Its contents are limited to style metadata, and doesn’t include any formatting instructions (the sole exception is that dependent styles can specify an overriding style locale). By linking dependent styles for journals that share the same citation style (e.g., “Nature Biotechnology”, “Nature Nanotechnology”, etc.) to a single independent style (e.g., “Nature Journals”), there is no need to duplicate formatting instructions.

1 Like