typst / hayagriva

Rusty bibliography management.
Apache License 2.0
347 stars 54 forks source link

Et-al handling in `ieee` citation style #164

Open drupol opened 7 months ago

drupol commented 7 months ago

Description

Hello,

In the reference guide of the ieee citation style, I noticed the following in page 4:

NOTE: Use “et al.” when three or more names are given for a reference cited in the text.

The et al. replacement doesn't work in Typst. To illustrate that, I've created a simple page listing all the citation styles at : https://typst.app/project/pQH6zuFPPL_G4NlIOLx9K-

We can notice that in the IEEE style where there's more than 3 authors, the et al. is not displayed. Here's a screenshot:

image

Reproduction URL

https://typst.app/project/pQH6zuFPPL_G4NlIOLx9K-

Operating system

Linux

Typst version

Enivex commented 7 months ago

I suspect this may be the same issue as https://github.com/typst/typst/issues/3699

Edit: It may also be that the official CSL style hasn't been updated to reflect changes to the IEEE guidelines

JKRhb commented 7 months ago

While I was editing a CSL file, I had the impression that this might be caused by the fact that the author format uses the style defined in the bibliography element and not the one in the citation element.

So, if you have

  <bibliography et-al-min="4" et-al-use-first="1">
    ...
  </bibligraphy>

“et al.” is set for cited entries with more than three authors, but

  <citation et-al-min="4" et-al-use-first="1">
    ...
  </citation>

is ignored. Therefore, this could actually be a relatively simple fix.

notPlancha commented 1 month ago

for a quick fix find and replace et-al-min="7" to et-al-min="3" in ieee.csl. Fixes the inline refs but bibliography references also changes to et al after 3 authors.

Enivex commented 1 month ago

for a quick fix find and replace et-al-min="7" to et-al-min="3" in ieee.csl. Fixes the inline refs but bibliography references also changes to et al after 3 authors.

You can set separate styles for the bibliography and citations

notPlancha commented 3 weeks ago

You can set separate styles for the bibliography and citations

How?

Enivex commented 3 weeks ago

You can set separate styles for the bibliography and citations

How?

Cite and bibliography both have a style argument

notPlancha commented 3 weeks ago

Oh yea, thanks. For anyone passing by, you can do

#set cite(style: "modified-ieee.csl")

and call the bibliography with

#bibliography("refs.bib", style: "ieee")