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

DOI parsing bug for citations of the same author and year #1838

Open
gvarnavi opened this issue Feb 5, 2025 · 2 comments
Open

DOI parsing bug for citations of the same author and year #1838

gvarnavi opened this issue Feb 5, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@gvarnavi
Copy link

gvarnavi commented Feb 5, 2025

Description

The following citation

[@10.1107/S0567739469001045; @10.1107/S0567739469001057]

seems to break the DOI linker -- resulting in a duplicate citation:

Image

Note the two dois resolve properly using the tool at the bottom of https://www.doi.org/

Additional notes

Contacted @rowanc1 re: this, was prompted to open issue for tracking.

@gvarnavi gvarnavi added the bug Something isn't working label Feb 5, 2025
@rowanc1
Copy link
Member

rowanc1 commented Feb 5, 2025

Thank you @gvarnavi, we will look into it!

@agoose77
Copy link
Contributor

agoose77 commented Feb 5, 2025

I may not have time to get to this before the rest of the team does, but I did the up-front digging.

In

references.cite.order.push(label);
references.cite.data[label] = {
label,
enumerator: `${references.cite.order.length}`,
doi: citeRenderer[label]?.getDOI(),
html: citeRenderer[label]?.render(),
url: citeRenderer[label]?.getURL(),
};
we are keying the references object by label, but the label that is populated from our DOI transforms is directly taken from the DOI resolution i.e. is not guaranteed to be unique.

Then, our site theme uses the label to pull-in the resolved citation data: https://github.com/jupyter-book/myst-theme/blob/dcd1c7bb7bdeefcbf6e474334d021076a59867ec/packages/myst-to-react/src/cite.tsx#L54

It seems to me that we should want our labels to be unique, and there's no need for them to be "small" when they're coming from DOIs. So, unless we consider it a feature to be able to do e.g.

See @10.1107/S0567739469001045, i.e. @Hoppe_1969

we could/should just use the identifier (DOI itself) as the label.

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

3 participants