-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Entry preview not rendering the citation properly #8372
Comments
Hi @adrianocorrea , thanks for creating this issue. @ThiloteE #8370 has just been created yesterday and is not merged yet into the main branch. |
Hi @calixtus , thank you for your prompt response.
|
I tested the pullrequest #8370 and the issue persists JabRef 5.5-PullRequest8370.22--2021-12-29--707c014 The interesting thing is that the |
Im a bit confused too, since the preview is constructed in the same way in the preview panel as well as in the preferences. |
Maybe the sample bibtex entry used in the preferences preview misses some fields? |
We know that the entry preview was working as expected until version 5.3. Do you know what changed in the entry preview code base between versions 5.3 and 5.4? Maybe running a diff between the versions code base could provide some insights on the source of the bug. |
I can't remember that we changed anything in the preview panel between versions 5.3 und 5.4 besides regular update of the csl-files. We'll investigate... |
git diff v5.3..v5.4 .\src\main\java\org\jabref\gui\preview
git diff v5.3..v5.4 .\src\main\java\org\jabref\logic\preview\
|
Edit:// If you change "number" to "issue" it's fine Options -> Preferences uses a different entry, it has the TestEntry: jabref/src/main/java/org/jabref/logic/util/TestEntry.java Lines 16 to 39 in bb011c9
|
Interesting.
I will create an issue at citeproc. I think the code that was changed for #8279 at michel-kraemer/citeproc-java@ad20fc4 could be the culprit, but Michel will know better. |
Ah and current behaviour is also this: when issue and number differ, then issue takes precedence over number.
--> only issue will show. |
As a general reminder about the difference between number and issue, the biblatex documentation (https://ctan.kako-dev.de/macros/latex/contrib/biblatex/doc/biblatex.pdf) on page 22 shows this:
and on page 23:
|
@ThiloteE Thanks for the in-depth analysis. I think you're right and the change in michel-kraemer/citeproc-java@ad20fc4 could be the cause for your issue. Let me quickly explain what changed: Previously, both builder.number(entries.get(FIELD_NUMBER));
if (entries.containsKey(FIELD_ISSUE)) {
builder.issue(entries.get(FIELD_ISSUE));
} else {
builder.issue(entries.get(FIELD_NUMBER));
} Now, due to duplicate series names in the preview (michel-kraemer/citeproc-java#111), builder.number(entries.get(FIELD_NUMBER));
builder.issue(entries.get(FIELD_ISSUE)); IMHO, this is the correct behaviour. Whether the selected CSL style (in this case APA) displays As a matter of fact, if you select the IEEE style, the entry should be displayed as follows:
Here,
So, from my point of view, Let me know if this helps! |
One possible solution could be to change the mapping as follows: if (type == CSLType.ARTICLE_JOURNAL) {
if (entries.containsKey(FIELD_NUMBER) && entries.containsKey(FIELD_ISSUE)) {
builder.number(entries.get(FIELD_NUMBER));
builder.issue(entries.get(FIELD_ISSUE));
} else if (entries.containsKey(FIELD_NUMBER)) {
// map number to issue!
builder.issue(entries.get(FIELD_NUMBER));
} else if (entries.containsKey(FIELD_ISSUE)) {
builder.issue(entries.get(FIELD_ISSUE));
}
} else {
builder.number(entries.get(FIELD_NUMBER));
builder.issue(entries.get(FIELD_ISSUE));
} This will lead to the following results: APA (
APA (
APA (
IEEE (
IEEE (
IEEE (
Of course, this does not allow users to specify an article number in BibTeX anymore (at least not how it is defined by CSL) but since What do you think? |
Thank you Michel! Sounds already pretty good! Would it be possible to map
This can be done with the citationstyleslanguage via choose commands (https://docs.citationstyles.org/en/stable/specification.html#choose). The number field in CSL can render both integers and non-integers according to https://docs.citationstyles.org/en/stable/specification.html#number. More specifically if i understand it correctly, there are commands that allow to test for numeric data before or after the mapping is done: https://docs.citationstyles.org/en/stable/specification.html#choose. The reasons are this:
So if users enter 'Spring' or 'Winter' or date (year) or something similar, it shows in addition to the number.
In general, i am more and more convinced that the number / issue thing is a mess. Absolutely confusing for end-users. Currently, both fields can hold integers and non-integers and the names of the fields are so closely related that without having read the documentation, many think issue and number are the same thing. |
@ThiloteE Thanks for the feedback! 👍 I have a few remarks/follow-up questions:
I'm not sure the logic should be this complex. If the user specifies both issue and number and they are both rendered in the result (even if they are similar), then it should be clear to the user that they need to remove one of them. I'm not sure if citeproc-java should automagically decide between those two based on a heuristic that applies in one case but maybe not in another.
This is true, but we cannot change the code of the APA style (or any other style for what it's worth).
I'm not sure I understand this. Can you explain in which case we would have duplication again? In my examples above, everything seems to be right, doesn't it?
Can you please give an example?
I absolutely agree. That's why I think we need a simple mapping that covers most of the cases and is understandable and transparent to the users. We will never be able to cover each and every corner case. The definition of number and issue in BibTeX and CSL is just too different. |
You are right.
To conclude, it is fine if both fields show, as to my new understanding, issue and number are two different things. I would say that the current behavior:
is better indeed and i very much would prefer now for citation-styles to adapt to this (unless we go back to merging the fields). I checked with Zotero and they probably opted not to correct the various citation-styles (so much work!), but rather to correct it within Zotero or within some conversion tool. They map issue to number, but then call the number field issue... Confusing? Yes, but they basically follow the definition of bibtex, not biblatex. There is no number field in Zotero. At least, i have not found it.
Not sure what is better. Create work for authors of citation-styles, or have proper differentiation. Things i read:
|
@ThiloteE Very nice summary! Thanks for the effort. From the perspective of citeproc-java, I would generally be fine with both options A and B, perhaps slightly leaning towards B. Are there other views? |
Leaning to Option B as well. Main Reason:
I will raise an issue at CSL to improve APA, let's see what they say and maybe we should notify Zotero too, just to make sure their current implementation is intentional, rather than something that has gone unnoticed. |
I'm wondering if this issue (and the one in citeproc-java) can be closed now? |
Probably yes. @adrianocorrea would you be able to confirm that what i describe below indeed does conform to APA 7th edition? I don't have access to the full manual right now so i can't cross-check. @michel-kraemer If the rendering down below is correct according to APA 7th edition, i don't think anything needs to change in citeproc. Let's wait for Adriana or somebody to confirm. Short summary:
=
=
=
=
= |
@adrianocorrea in short: Remove the page-range and the article number will be shown. If you want to have the page-range included, i would suggest to find out the issue-number |
If you are confused now, you will understand, why i was confused so much!! When standards have different words for the same thing 😅😅😅. Hahaha, sorry my drawing skills are not overly developed xD. But this should be it. The only thing i am not sure about now is, if it would be a good idea to map Biblatex Proposal to
Edit: I don't think the above proposals (in this post) are wise, as they would prevent individual citation styles to render both the article number and page ranges separately and also introduce an artificial hierarchy. If it were to be done like above, rendering something like this would not be easily possible: CSL In relation to supporting eid in CSL: Current behavior for IEEE Style in Biblatex Mode results in
|
So, to conclude from my side: Changes for Mapping/Rendering/Conversions relevant for Citeproc-Java (https://github.com/michel-kraemer/citeproc-java): Bibtex Mode:
Biblatex Mode:
I have based my proposals on these key comments and sources and these are the important ones!
Ps. I edited my last comment i am not sure if people receive notifications about edit. To be honest, i kinda want to delete most of my older comments, as they just confuse people now haha, but i guess it would be good if future generations were able to trace our decision-making, so i leave them. If you want to make it short, just don't read the old stuff in this thread xD |
Hoping for decision by dev-call and also for comment by @michel-kraemer Citeproc-Java specialist. |
Yes, sure. I have to admit I lost track of the many options you discussed and which of them are the preferred ones 😉, but if you can tell me (as precisely as possible) what I need to do, and someone from JabRef does confirm, I can implement it. |
Just throwing in some idea: We could extend our alias mapping BibTeX ↔ biblatex here that would also work for cleanup. Either way we need to pass down a bibatabsecontex (see comment in #7378 ) |
These ones:
At least for "Journal Article". But it would be nice if somebody else from Jabref could confirm first. I don't want to have made another mistake 😑, although i am fairly sure by now... |
Confirmed - I checked the source code of the package at https://ctan.org/tex-archive/macros/latex/contrib/biblatex-contrib/biblatex-ieee. Neither |
To summarize the best-of statements:
I know too less about the intended semantics of CSL's "number". Is it "number in the volume", "number in the issue", "number of the article"? It gets late here. I am worrying about following place of the conversion: How should the join be made? Should we take one of them or do a concatination of both are present? I would guess: If |
Do it the other way round. Biblatex Reason: "As a rule of thumb number is the right field in most circumstances." - biblatex documentation p. 40. Therefore: For CSL issue, take Biblatex If both Biblatex
Only, if taking both is technically not possible, .... show Biblatex (Remember, most journals still export in Bibtex mode and Bibtex does not know the issue field, so probably not many people will have extracted the seasons and months from the number field and moved it to issue field) |
We should make sure to enforce consistency with https://github.com/zepinglee/citeproc-lua/wiki/Bib-CSL-mapping |
We need to have call with @ThiloteE. Please write to my email when you have time. For me, after 20:30 CET would be great! Discussion points:
|
Fun fact: <term name="issue" form="short">
<single>no.</single>
<multiple>nos.</multiple>
</term> |
So we are currently waiting for the following issue to be fixed, correct? |
Yes. But #8607 will definitely be merged before next release. Can't wait forever for something that "might" happen. @adrianocorrea You already can try out the pull-request :-) It is downloadable from here: https://builds.jabref.org/pull/8607/merge/ As for me, I will monitor citation-style-language/styles#5827 and CSL apa-style with regard to issue/number/eid/page behaviour and if necessary will do a follow up pull-request. |
Woo-hoo! The number is back in APA! 😃 |
JabRef version
5.4 (latest release)
Operating system
Windows
Details on version and operating system
Windows 11 21H2
Checked with the latest development build
Steps to reproduce the behaviour
Save
.volume
andnumber
fields.Entry Preview
. Check if entry preview is set to the "American Psychological Association 7th Edition" style guide.You will notice that instead of showing the entry as "Smith, B., Jones, B., & Williams, J. (2016). Title of the test entry. BibTeX Journal, 34(3), 45–67. https://doi.org/10.1001/bla.blubb", the Entry Preview shows it as "Smith, B., Jones, B., & Williams, J. (2016). Title of the test entry. BibTeX Journal, 34, 45–67. https://doi.org/10.1001/bla.blubb" (i.e. without the
number
inside parenthesis). In theOptions
menu, however, the entry rendering appears to follow the style guide.Until version 5.3, the entry preview was showing as expected. The issue appears only in versions 5.4 and 5.5 (so far).
Appendix
BibTex source:
Screenshot of error:
The text was updated successfully, but these errors were encountered: