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

Unexpectedly added period between author names and reference in prose-style citation #285

Open
1 task done
jakubkaczor opened this issue Mar 2, 2025 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@jakubkaczor
Copy link

jakubkaczor commented Mar 2, 2025

Description

Depending on citation style, an additional period is added between author names and a reference when using ”prose“ style. Here is an example using Association for Computing Machinery style.

bibliography.bib
@article{churchSetPostulatesFoundation1933,
	title = {A Set of Postulates For the Foundation of Logic},
	volume = {34},
	issn = {0003-486X},
	url = {https://www.jstor.org/stable/1968702},
	doi = {10.2307/1968702},
	pages = {839--864},
	number = {4},
	journaltitle = {Annals of Mathematics},
	author = {Church, Alonzo},
	urldate = {2025-01-06},
	date = {1933},
	note = {Publisher: Annals of Mathematics},
}
#set page(height: auto, width: 10cm)

= Good
@churchSetPostulatesFoundation1933

= Bad
#cite(form: "prose", <churchSetPostulatesFoundation1933>)

#bibliography("bibliography.bib", style: "association-for-computing-machinery")

Output

If I understand correctly, in the latest released version of CSL there is no way to describe how the prose-style citation should look like1, so I suppose this is Typst's invention.

I checked what suffix=". " attributes in Association for Computing Machinery CSL file cause this. I have found you need to remove 2 of them in order to fix it. Unfortunately, this also removes dots in bibliography, so it is not a viable solution.

An in-Typst workaround is

  // A hack around incorrectly added period after in-prose citation authors
  #show cite.where(form: "prose"): it => {
    show regex("\. \["): " ["
    it
  }

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Footnotes

  1. The cs:intext element was added in yet unreleased CSL 1.1. See https://github.com/citation-style-language/schema/pull/193.

@jakubkaczor jakubkaczor added the bug Something isn't working label Mar 2, 2025
@laurmaedje laurmaedje transferred this issue from typst/typst Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant