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

Duplicate keys in :alphabetic style #26

Closed
kellertuer opened this issue Jul 17, 2023 · 12 comments · Fixed by #31
Closed

Duplicate keys in :alphabetic style #26

kellertuer opened this issue Jul 17, 2023 · 12 comments · Fixed by #31
Labels
enhancement New feature or request

Comments

@kellertuer
Copy link
Contributor

kellertuer commented Jul 17, 2023

Consider my (little lazy) example

@techreport{deCasteljau:1959,
    AUTHOR      = {de Casteljau, Paul},
    institution   = {Enveloppe Soleau 40.040, Institute National de la Propriété Industrielle, Paris.},
    TITLE       = {Outillage methodes calcul},
    YEAR        = {1959}
}
@techreport{deCasteljau:1959b,
    AUTHOR      = {de Casteljau, Paul},
    INSTITUTION = {Enveloppe Soleau 40.040, Institute National de la Propriété Industrielle, Paris.},
    TITLE       = {Outillage methodes calcul - my lazy b},
    YEAR        = {1959}
}

and a temp.md.

[deCasteljau:1959](@cite), [deCasteljau:1959b](@cite)
```@bibliography
Pages = ["temp.md"]
Canonical=false
```

Then the resulting page looks like

Screenshot 2023-07-17 at 17 04 05

So the generated key clashes (considering them like hashes). They should at least be [Cas59a], and [Cas59b] I think?

I might be mistaken, but I think the Keys would also respect the prefix of the name so that it would actually be [dCa69] – but maybe I remember that wrongly as well. The main part of this issue is the clash in keys, since this might also happen for other “Key collisions” I think (same author last names first letters in the same year for example).

PS: I promise this is the last issue for now, I even managed to rework my references and have a PR at https://manoptjl.org/previews/PR281/ that is (besides checking that non canonical bibliographies exist on all pages with references) reworked and I think it is overall quite nice! I just stumbled about this issue here by accident, so it does not appear in my references.

@goerz
Copy link
Member

goerz commented Jul 17, 2023

You are absolutely correct! I thought I could slide this one by for the moment 😉

The way I was planning to fix this was to have a slightly smarter :alpha style. More specifically, one would have an AlphaStyle object that gets passed as style to CitationBibliography, and which would keep track of all generated labels, and modify them appropriately when there are duplications. Similar to (but simpler than) the approach in #13, and in fact a good example for a "stateful" style to be discussed in the documentation.

I'd prioritize this a bit more if someone actually wanted to use the :alpha style "in the wild", but it will be fixed eventually, in any case. (Just probably not in the next few weeks, due to conference travel.)

I promise this is the last issue for now

Not at all! Keep them coming!

I even managed to rework my references and have a PR at that is [...] reworked and I think it is overall quite nice!

When it's merged and the documentation is online, feel free to make a PR here to add Manopt to the list of examples.

@goerz goerz added the enhancement New feature or request label Jul 17, 2023
@kellertuer
Copy link
Contributor Author

I will use the alpha style “in the wild”! But no worries, for now I do not have such a collision and this is also really not urgent.

Yes once I have finished the PR (maybe this week), I will add it to the list of examples, for sure.

@lgoettgens
Copy link
Contributor

I am trying to convert Oscar.jl to the v1.0.0 and would like to stay with the :alpha mode that was decided on long ago. Unfortunately, there occur some collisions of the above form.
I think this is a blocker for us to use it until this is fixed.

@goerz
Copy link
Member

goerz commented Jul 27, 2023

Alright, I'll give it some priority

@lgoettgens
Copy link
Contributor

We change to https://juliadocs.org/DocumenterCitations.jl/v1.0.0/gallery/#Custom-style:-Citation-key-labels for the time being, as we can put working and distinct labels in the .bib file.

@goerz
Copy link
Member

goerz commented Jul 28, 2023

That’s definitely a workaround! It also has the benefit that you have the same labels in the docstrings as in the rendered documentation, when reading them in a text editor.

I might be able to push out a smarter :alpha style today, though.

@goerz
Copy link
Member

goerz commented Jul 29, 2023

Should be fixed in #31. Have a look if this works as expected, if you can

@lgoettgens
Copy link
Contributor

Should be fixed in #31. Have a look if this works as expected, if you can

I unfortunately will be out of office the whole week, and without any device running julia.

@goerz
Copy link
Member

goerz commented Jul 29, 2023

I'm okay with waiting a little bit…

@kellertuer
Copy link
Contributor Author

Thanks for working on that, due to conferences and travels, II will only have time around Wednesday to take a look, but if you are sure it works merge it without my feedback for sure.

@goerz
Copy link
Member

goerz commented Jul 30, 2023

Take your time, this is really for you guys' benefit, so it makes more sense to wait until you've had a chance to look at it 😉

@lgoettgens
Copy link
Contributor

Should be fixed in #31. Have a look if this works as expected, if you can

The preview in https://juliadocs.org/DocumenterCitations.jl/previews/PR31/gallery/#alphabetic_style looks great. Unfortunately, I cannot get it to work on my repo, but that may be due to my local setup.

@goerz goerz closed this as completed in #31 Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants