typst / citationberg

A library for parsing CSL styles.
Apache License 2.0
33 stars 7 forks source link

Please support CSL-M #5

Open heprion opened 8 months ago

heprion commented 8 months ago

Recently I've been using Typst to write my graduation thesis, but I encountered a problem with the style of bibliography.

I am using the "gb-7714-2015-numeric". And I got this, "等“ for english reference instead of "et al".

#set text(lang: "zh")
#bibliography("ex01.bib", style:"gb-7714-2015-numeric")

image

if #set text(lang: "en"), I would get the opposite. "et al" for chinese reference.

image

So, I tried to use custom csl from Chinese-STD-GB-T-7714-related-csl.

image

I got this error:

"failed to load CSL style (duplicate field `layout`)".

I did some search, it seems that those csl files used CSL-M extension powered by citeproc-js.

image

Is there any possibility that citationberg gonna support that. Or If there is any other way can help me to the result that "等“ for chinese references and "et al" for english references.

Thanks for any help you can offer.

OrangeX4 commented 5 months ago

I have a proof of concept for solving this problem temporarily: https://typst.app/project/rN08qR13YfLociKdV7b1Mx

However, it's currently just a basic simple mapping substitution. It still needs to supplement this mapping table, and I hope it can handle some more special cases. https://github.com/nju-lug/modern-nju-thesis/issues/3

2catycm commented 4 months ago

Good issue,I am also encountering this