Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APA style does not format correctly with more than two authors (with same year in publications) #199

Open
1 task done
bpkleer opened this issue Aug 7, 2024 · 2 comments
Labels
bug Something isn't working citeproc compat This issue is related to one or more failing citeproc tests. spec compat This issue is related to an incompatibility with the CSL spec or some other spec.

Comments

@bpkleer
Copy link

bpkleer commented Aug 7, 2024

Description

I'm just new to typst and wanted to use it for a conference paper and stumbled upon an error with the APA style in the citatoion. It is quite common to have the same authors publishing more than one work, therefore, APA style indicates same authors same year with enumerations like Müller et al. (2001a) and Müller et al. (2001b).

This worked fine for me, if there were only two authors, as soon as I added a third author the citation was incorrect. I tested the problem locally (in the webapp it also showed the same bug). An example for reproduction is available on the link.

This is the underlying simple bib-file:

@Article{Citation1,
  author       = {Momo Müller and Sascha Schmidt},
  journaltitle = {Testjournal},
  number       = {1},
  title        = {Testtitle 1},
  pages        = {217--234},
  volume       = {4},
  year         = {2001},
}

@Article{Citation2,
  author       = {Müller, Momo and Schmidt, Sascha},
  journaltitle = {Testjournal},
  title        = {Testtitle 1},
  number       = {1},
  pages        = {217--234},
  volume       = {4},
  year         = {2001},
}

@Article{Citation3,
  author       = {Müller, Momo and Schmidt, Sascha and Pfeffer, Philipp},
  journaltitle = {Testjournal},
  title        = {Testtitle 1},
  number       = {1},
  pages        = {217--234},
  volume       = {4},
  year         = {2001},
}


@Article{Citation4,
  author       = {Müller, Momo and Schmidt, Sascha and Pfeffer, Philipp},
  journaltitle = {Testjournal},
  title        = {Testtitle 1},
  number       = {1},
  pages        = {217--234},
  volume       = {4},
  year         = {2001},
}

According to APA style, two entries with the same authors and year should be enumerated with a, b, etc. If the entry has two authors it works well, if there are three or more it doesn't work.

Two authors case

`@Citation1` => @Citation1

`@Citation2` => @Citation2

This leads correctly to the following format:
Captura de Tela 2024-08-07 às 12 55 47

Three authors case

However, if the entry has three (examples @Citation3 and @Citation4) or more authors, the reference shows weird behavior:

`@Citation3` => @Citation4

`@Citation3` => @Citation4

The shown references uses firstnames and from the last author only lastname and does not enumerated the year with 'a'/'b':
Captura de Tela 2024-08-07 às 12 56 50

Changing one of the years, the correct format is shown:
Captura de Tela 2024-08-07 às 12 58 20

I reproduced the bug also with the #cite() function, which can be assessed in the reprodcution URL.

Since it is quite common having the same

Reproduction URL

https://typst.app/project/wKSJe04nF_coz5Mbd7jjsK

Operating system

No response

Typst version

  • I am using the latest version of Typst
@bpkleer bpkleer added the bug Something isn't working label Aug 7, 2024
@Enivex
Copy link

Enivex commented Aug 7, 2024

This should probably be in the Hayagriva repository

@PgBiel

@laurmaedje laurmaedje transferred this issue from typst/typst Aug 7, 2024
@PgBiel
Copy link
Contributor

PgBiel commented Aug 8, 2024

Seems to be related to failing disambiguate_AndreaEg31, disambiguate_AndreaEg52 and disambiguate_FailWithYearSuffix3 CSL processor tests:

Test target/haya-cache/test-suite/processor-tests/humans/disambiguate_AndreaEg3.txt failed
Expected:
Smith, Brown & J. Jones (1980a); Smith, Brown & J. Jones (1980b)
Smith, Brown & J. Jones (1980a); Smith, Benson, et al. (1980)
Smith, Brown & J. Jones (1980a); Smith, Brown & A. Jones (1980)

Got:
John Smith, John Brown & Jones (1980); John Smith, John Brown & Jones (1980)
John Smith, John Brown & Jones (1980); John Smith, Benson, et al. (1980)
John Smith, John Brown & Jones (1980); John Smith, John Brown & Jones (1980)

[... other tests omitted ...]

Test target/haya-cache/test-suite/processor-tests/humans/disambiguate_AndreaEg5.txt failed
Expected:
Smith, Brown & J. Jones (1980a); Smith, Brown & J. Jones (1980b)
Smith, Brown & J. Jones (1980a); Smith, Benson, et al. (1980)
Smith, Brown & J. Jones (1980a); Smith, Brown & A. Jones (1980)

Got:
John Smith, John Brown & Jones (1980); John Smith, John Brown & Jones (1980)
John Smith, John Brown & Jones (1980); John Smith, Benson, et al. (1980)
John Smith, John Brown & Jones (1980); John Smith, John Brown & Jones (1980)

[... other tests omitted ...]

Test target/haya-cache/test-suite/processor-tests/humans/disambiguate_FailWithYearSuffix.txt failed
Expected:
(Caritas Europa et al. 2004a)
(Caritas Europa et al. 2004b)

Got:
(Caritas Europa, CCME, COMECE, ICMC, et al. 2004)
(Caritas Europa, CCME, COMECE, ICMC, et al. 2004)

Footnotes

  1. https://github.com/citation-style-language/test-suite/blob/4001cdada66cd30f2ba1b8ae45a8da20f407dec0/processor-tests/humans/disambiguate_AndreaEg3.txt

  2. https://github.com/citation-style-language/test-suite/blob/4001cdada66cd30f2ba1b8ae45a8da20f407dec0/processor-tests/humans/disambiguate_AndreaEg5.txt

  3. https://github.com/citation-style-language/test-suite/blob/4001cdada66cd30f2ba1b8ae45a8da20f407dec0/processor-tests/humans/disambiguate_FailWithYearSuffix.txt

@PgBiel PgBiel added spec compat This issue is related to an incompatibility with the CSL spec or some other spec. citeproc compat This issue is related to one or more failing citeproc tests. labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working citeproc compat This issue is related to one or more failing citeproc tests. spec compat This issue is related to an incompatibility with the CSL spec or some other spec.
Projects
None yet
Development

No branches or pull requests

3 participants