Why can't I load my .csl file with typst.app like shown in the documentation?

I can’t figure out how to load a .csl file properly using typst.app.

#set cite(style: "apa.csl")
#set cite(style: "./apa.csl") // also tried this version, the file is in the project root
#set cite(style: "apa") // this works of course, but I want to modify the csl not load the default

Should work according to the documentation and a few samples I found. The .csl file is in the project root, next to the .typ.

But I get an error:

Failed to load CSL style (data did not match any variant of untagged enum Term)

The .csl is directly from the original repository. Is this not possible in the online version or am I doing something wrong?

Hello,

your first approach of loading the CSL file is correct. Typst uses Hayagriva to support CSL styles and there was a bug (187), a term used by the APA CSL was not supported. This fix will be available in Typst v0.12.

1 Like

Hi @a_w, thanks for your question! If you feel the response you got has sufficiently answered your question, be sure to give it a checkmark. This will help others find the solution in the future. Thanks!

I have also added the web-app tag and changed your post’s title from “Can’t load .csl file with typst.app” to “Why can’t I load my .csl file with typst.app like shown in the documentation?” as the question guidelines recommend this:

Good titles are questions you would ask your friend about Typst.

Thanks. I can confirm that 0.12 fixed this problem.