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

Entry preview not rendering the citation properly #8372

Closed
2 tasks done
adrianocorrea opened this issue Dec 30, 2021 · 58 comments · Fixed by #8607
Closed
2 tasks done

Entry preview not rendering the citation properly #8372

adrianocorrea opened this issue Dec 30, 2021 · 58 comments · Fixed by #8607
Assignees
Labels
bib(la)tex entry-preview status: depends-on-external A bug or issue that depends on an update of an external library

Comments

@adrianocorrea
Copy link

JabRef version

5.4 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11 21H2

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Go to Options > Preferences > Entry Preview.
  2. Add "American Psychological Association 7th Edition" or "American Psychological Association 6th Edition".
  3. Click Save.
  4. Open a library containing an article with both volume and number fields.
  5. Double click the entry to see the 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 the Options 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:

@Article{,
  author  = {Smith, B. and Jones, B. and Williams, J.},
  journal = {BibTeX Journal},
  title   = {Title of the test entry},
  year    = {2016},
  number  = {3},
  pages   = {45--67},
  volume  = {34},
  doi     = {bla.blubb},
}

Screenshot of error:

2021-12-29-225615753

@calixtus
Copy link
Member

Hi @adrianocorrea , thanks for creating this issue.
Could you test please, what is being exportet via the right click menu?

@ThiloteE #8370 has just been created yesterday and is not merged yet into the main branch.

@adrianocorrea
Copy link
Author

adrianocorrea commented Dec 30, 2021

Hi @calixtus , thank you for your prompt response.
The export is consistent with the preview. The result is:

"Smith, B., Jones, B., & Williams, J. (2016). Title of the test entry. BibTeX Journal, 34, 45–67. https://doi.org/bla.blubb"

@ThiloteE
Copy link
Member

ThiloteE commented Dec 30, 2021

I tested the pullrequest #8370 and the issue persists

JabRef 5.5-PullRequest8370.22--2021-12-29--707c014
Windows 10 10.0 amd64
Java 16.0.2
JavaFX 17.0.1+1

The interesting thing is that the number is depicted correctly under options>preferences>entry preview, but wrongly at entry editor>preview, so i was hoping your pull-request was making a difference :D

@calixtus
Copy link
Member

Im a bit confused too, since the preview is constructed in the same way in the preview panel as well as in the preferences.

@Siedlerchr
Copy link
Member

Maybe the sample bibtex entry used in the preferences preview misses some fields?

@adrianocorrea
Copy link
Author

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.

@calixtus
Copy link
Member

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...

@calixtus
Copy link
Member

git diff v5.3..v5.4 .\src\main\java\org\jabref\gui\preview
shows little refactoring:

  • injection of IndexingTaskManager in the constructor
  • a bugfix for opening links inside the preview viewer

git diff v5.3..v5.4 .\src\main\java\org\jabref\logic\preview\

  • introduction of method containsCaseIndependent for search

@Siedlerchr
Copy link
Member

Siedlerchr commented Dec 31, 2021

Edit:// If you change "number" to "issue" it's fine
With issue field:
grafik

Options -> Preferences uses a different entry, it has the TestEntry:

BibEntry entry = new BibEntry(StandardEntryType.Article);
entry.setCitationKey("Smith2016");
entry.setField(StandardField.AUTHOR, "Smith, Bill and Jones, Bob and Williams, Jeff");
entry.setField(StandardField.EDITOR, "Taylor, Phil");
entry.setField(StandardField.TITLE, "Title of the test entry");
entry.setField(StandardField.NUMBER, "3");
entry.setField(StandardField.VOLUME, "34");
entry.setField(StandardField.ISSUE, "3");
entry.setField(StandardField.YEAR, "2016");
entry.setField(StandardField.PAGES, "45--67");
entry.setField(StandardField.MONTH, "July");
entry.setField(StandardField.FILE, ":testentry.pdf:PDF");
entry.setField(StandardField.JOURNAL, "BibTeX Journal");
entry.setField(StandardField.PUBLISHER, "JabRef Publishing");
entry.setField(StandardField.ADDRESS, "Trondheim");
entry.setField(StandardField.URL, "https://github.com/JabRef");
entry.setField(StandardField.DOI, "10.1001/bla.blubb");
entry.setField(StandardField.ABSTRACT,
"This entry describes a test scenario which may be useful in JabRef. By providing a test entry it is possible to see how certain things will look in this graphical BIB-file mananger.");
entry.setField(StandardField.COMMENT, "Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et " +
"dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. " +
"Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non " +
"proident, sunt in culpa qui officia deserunt mollit anim id est laborum.");
entry.putKeywords(Arrays.asList("KeyWord1", "KeyWord2", "KeyWord3", "Keyword4"), ';');

@ThiloteE
Copy link
Member

ThiloteE commented Dec 31, 2021

Interesting.

  • When changing number = {3}, to issue = {3}, it is depicted correctly in the entry editor>preview.
  • When BOTH number = {3}, AND issue = {3}, are present, then it is depicted correctly.
  • When only number field is present, then it is depicted wrongly.

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.

@ThiloteE
Copy link
Member

Ah and current behaviour is also this:

when issue and number differ, then issue takes precedence over number.
Example:

@Article{test,
issue = {99},
number = {3},
}

--> only issue will show.

@ThiloteE
Copy link
Member

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:

issue field (literal)
The issue of a journal. This field is intended for journals whose individual issues
are identified by a designation such as ‘Spring’ or ‘Summer’ rather than the month
or a number. The placement of issue is similar to month and number. Integer
ranges and short designators are better written to the number field. See also month,
number and §§ 2.3.10 and 2.3.11.

and on page 23:

number field (literal)
The number of a journal or the volume/number of a book in a series. See also
issue as well as §§ 2.3.7, 2.3.10, 2.3.11. With @patent entries, this is the number or
record token of a patent or patent request. Normally this field will be an integer or an
integer range, but it may also be a short designator that is not entirely numeric such
as “S1”, “Suppl. 2”, “3es”. In these cases the output should be scrutinised carefully.
Since number is—maybe counterintuitively given its name—a literal field, sorting
templates will not treat its contents as integers, but as literal strings, which means
that “11” may sort between “1” and “2”. If integer sorting is desired, the field can be
declared an integer field in a custom data model (see § 4.5.4). But then the sorting of
non-integer values is not well defined.

@michel-kraemer
Copy link
Contributor

@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 issue and number were mapped to the CSL field issue. Additionally, number was also mapped to number:

builder.number(entries.get(FIELD_NUMBER));
if (entries.containsKey(FIELD_ISSUE)) {
    builder.issue(entries.get(FIELD_ISSUE));
} else {
    builder.issue(entries.get(FIELD_NUMBER));
}

https://github.com/michel-kraemer/citeproc-java/blob/f4f6da7089653eef21848ef0994e45c720923ff3/citeproc-java/src/main/java/de/undercouch/citeproc/bibtex/BibTeXConverter.java#L245-L250

Now, due to duplicate series names in the preview (michel-kraemer/citeproc-java#111), number is mapped to number and issue is mapped to issue:

builder.number(entries.get(FIELD_NUMBER));
builder.issue(entries.get(FIELD_ISSUE));

https://github.com/michel-kraemer/citeproc-java/blob/ad20fc45cae262bc5044bea4d1f6edfcc6be8d19/citeproc-java/src/main/java/de/undercouch/citeproc/bibtex/BibTeXConverter.java#L241-L242

IMHO, this is the correct behaviour.

Whether the selected CSL style (in this case APA) displays issue or not is up to the style and cannot be influenced by citeproc-java or JabRef.

As a matter of fact, if you select the IEEE style, the entry should be displayed as follows:

[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, Art. no. 3, 2016, doi: bla.blubb.

Here, number is rendered as Art. no., which is probably not what you want. If you change number to issue, it will be rendered as follows:

[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, 2016, doi: bla.blubb.

So, from my point of view, issue should be preferred here. I guess, the meaning/behaviour of issue and number is just slightly different in BibTeX and CSL.

Let me know if this helps!

@michel-kraemer
Copy link
Contributor

michel-kraemer commented Jan 1, 2022

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 (number only):

Smith, B., Jones, B., & Williams, J. (2016). Title of the test entry. BibTeX Journal, 34(3), 45–67. https://doi.org/bla.blubb

APA (issue only):

Smith, B., Jones, B., & Williams, J. (2016). Title of the test entry. BibTeX Journal, 34(3), 45–67. https://doi.org/bla.blubb

APA (number + issue):

Smith, B., Jones, B., & Williams, J. (2016). Title of the test entry. BibTeX Journal, 34(3), 45–67. https://doi.org/bla.blubb

IEEE (number only):

[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, 2016, doi: bla.blubb.

IEEE (issue only):

[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, 2016, doi: bla.blubb.

IEEE (number + issue):

[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, Art. no. 3, 2016, doi: bla.blubb.

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 number is defined differently in BibTeX anyhow, I guess this would be OK.

What do you think?

@ThiloteE
Copy link
Member

ThiloteE commented Jan 1, 2022

Thank you Michel!

Sounds already pretty good!

Would it be possible to map issue to number, but then delete it,

  • if issue is an integer, but not delete it, if issue is a non-integer
  • if both fields are similar?

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. is-numeric sounds good, so maybe there is a way, but i am not sure if and how this can be translated to JavaFX?

The reasons are this:

  1. With your proposal in Entry preview not rendering the citation properly  #8372 (comment), we would have the duplication again in IEEE (number + issue).

  2. biblatex documentation p. 40 (https://ctan.kako-dev.de/macros/latex/contrib/biblatex/doc/biblatex.pdf#subsubsection.2.3.10):

2.3.11 Journal Numbers and Issues
The words ‘number’ and ‘issue’ are often used synonymously by journals to refer
to the subdvision of a volume. The fact that biblatex’s data model has fields
of both names can sometimes lead to confusion about which field should be used.
First and foremost the word that the journal uses for the subdivsion of a volume
should be of minor importance, what matters is the role in the data model. As a rule
of thumb number is the right field in most circumstances. In the standard styles
number modifies volume, whereas issue modifies the date (year) of the entry.
Numeric identifiers and short designators that are not necessarily (entirely) numeric
such as ‘A’, ‘S1’, ‘C2’, ‘Suppl. 3’, ‘4es’ would go into the number field, because
they usually modify the volume. The output of—especially longer—non-numeric
input for number should be checked since it could potentially look odd with some
styles. The field issue can be used for designations such as ‘Spring’, ‘Winter’ or
‘Michaelmas term’ if that is commonly used to refer to the journal.

So if users enter 'Spring' or 'Winter' or date (year) or something similar, it shows in addition to the number.

  1. I found this when i read https://tex.stackexchange.com/questions/354759/biblatex-issue-number-of-journal-in-date
Some citation download tools on the web use issue inappropriately where number should be used. That is one of the reasons why you should always check downloaded entries thoroughly manually.

The following Biber sourcemap maps issue to number and then deletes it if the field only contains a number

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=issue, match=\regexp{\A[0-9]+\Z}, final]
      \step[fieldset=number, origfieldval]
      \step[fieldset=issue, null]
    }
  }
}

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.

@michel-kraemer
Copy link
Contributor

@ThiloteE Thanks for the feedback! 👍 I have a few remarks/follow-up questions:

Would it be possible to map issue to number, but then delete it,
if issue is an integer, but not delete it, if issue is a non-integer
if both fields are similar?

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 can be done with the citationstyleslanguage via choose commands

This is true, but we cannot change the code of the APA style (or any other style for what it's worth).

  1. With your proposal in Entry preview not rendering the citation properly Entry preview not rendering the citation properly  #8372 (comment), we would have the duplication again in IEEE (number + issue).

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?

So if users enter 'Spring' or 'Winter' or date (year) or something similar, it shows in addition to the number.

Can you please give an example?

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.

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.

@ThiloteE
Copy link
Member

ThiloteE commented Jan 2, 2022

You are right.

  1. My proposal to

    Would it be possible to map issue to number, but then delete it,
    
     if issue is an integer, but not delete it, if issue is a non-integer
     if both fields are similar?
    
    

    in Entry preview not rendering the citation properly  #8372 (comment) is flawed. Please don't do it.

  2. Before i was thinking that it would be best, if issue and number should be merged into one field (and hence my above proposal), but after reading up on it a little bit more, i think this may not necessarily be good. It is ok if both fields hold both integer and non-integer. Rather than merging issue and number, documentation should become more clear. Yes, indeed, there can be at least three different types of numbers: One for volume-number, one for issue-number and one for the article-number, therefore it is fine if both fields show, as they denote inherently different things. If i understand it correctly, the relationship between number and issue is this:

  • Relationship
    image

  • Example 1
    image

  • Example 2
    image

  • Example 3; Here, the journal does not provide any issues, but publishes the articles directly:
    image

    • The original Bibtex format only knows the number field. There is no 'issue' field.
      Edit: It is defined in the Bibtex docs page 10: https://ftp.gwdg.de/pub/ctan/biblio/bibtex/base/btxdoc.pdf
      number: The number of a journal, magazine, technical report, or of a work in a series. An issue of a journal or magazine is usually identified by its volume and number; the organization that issues a technical report usually gives it a number; and sometimes books are given numbers in a named series.

      Also, according to https://en.wikipedia.org/wiki/BibTeX, Number denotes:
      The "(issue) number" of a journal, magazine, or tech-report, if applicable. Note that this is not the "article number" assigned by some journals..

      So original bibtex somehow is a merger of both issue and number.
      Edit: So my interpretation would be that the number field in Bibtex is the same as the issue field in Biblatex and (article-) number is missing.

    • Biblatex knows both issue and (article-)numbers.

    • CSL knows both issue and (article-)number.

    So, depending on the style, number or issue could be omitted or included.

    The APA Style dictates to change the format in the following way:

    image

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:

builder.number(entries.get(FIELD_NUMBER));
builder.issue(entries.get(FIELD_ISSUE));

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.

  • Option A: If Jabref and Citeproc want to keep short term conformity with Zotero and bibtex and provide a workaround, i would say that the mapping you proposed in Entry preview not rendering the citation properly  #8372 (comment) is better than we have right now, but it also might lead to unintended problems with other styles that purely follow biblatex or that incorrectly miss one of the two. I am not too sure about the conformity with CSL, maybe somebody else knows better. This would be a centralised approach.

  • Option B: If you keep what we have currently without any changes (which is better for Biblatex conformity (and probably CSL?)), in the long term, people will adapt all the citation-styles to differentiate between issue and number. It will all depend on the citationstyle. This would be a decentralied approach and responsibility lies with the citation-styles.

Not sure what is better. Create work for authors of citation-styles, or have proper differentiation.

Things i read:

@Siedlerchr Siedlerchr added entry-preview status: depends-on-external A bug or issue that depends on an update of an external library labels Jan 4, 2022
@michel-kraemer
Copy link
Contributor

@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?

@ThiloteE
Copy link
Member

ThiloteE commented Jan 5, 2022

Leaning to Option B as well.

Main Reason:

  • Option B leads to better differentiation.
  • Both Option B and Option A might lead to more work, as there still could be potential problems with other citationstyles.
  • APA 7th edition would need to be changed anyway, regardless if option A or option B was chosen.
    • For APA 7th: Option A does not show both Issue + Number, when both are present.
    • For APA 7th: Option B does not show number, when only number is present.

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.

@michel-kraemer
Copy link
Contributor

I'm wondering if this issue (and the one in citeproc-java) can be closed now?

@ThiloteE
Copy link
Member

ThiloteE commented Jan 8, 2022

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:

  • The maintainers of the APA style at CSL held their heads high and maintained, the current code is correct. Michel, you also are of the opinion, that the current conversion mechanism that is employed by citeproc should be correct.

  • At CSL they mentioned that the (article-)number only shall be shown, if there is no page-range. If there is a page range, only issue shall be shown. Therefore (good job at citeproc 👍 ! ) the following holds true also in Jabref:

@Article{foo..in,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  title   = {issue + number + no-pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + number + no-pages. Bib(La)TeX Journal, 9issue, Article 3number.

@Article{foo..n,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  title   = {number + no-pages},
}

= Foo, B. (n.d.). number + no-pages. Bib(La)TeX Journal, Article 3number.

@Article{foo..i,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  title   = {issue + no-pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + no-pages. Bib(La)TeX Journal, 9issue.

@Article{foo..i,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  pages   = {45--67},
  title   = {issue + pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + pages. Bib(La)TeX Journal, 9issue, 45–67.

@Article{foo..n,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  pages   = {45--67},
  title   = {number + pages},
}

Foo, B. (n.d.). number + pages. Bib(La)TeX Journal, 45–67.

@Article{foo..in,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  pages   = {45--67},
  title   = {issue + number + pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + number + pages. Bib(La)TeX Journal, 9issue, 45–67.

@ThiloteE
Copy link
Member

ThiloteE commented Jan 8, 2022

@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

@ThiloteE ThiloteE added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jan 8, 2022
@ThiloteE ThiloteE self-assigned this Jan 8, 2022
@ThiloteE
Copy link
Member

ThiloteE commented Jan 17, 2022

bibtex vs biblatex vs csl conversion and rendering 2

@ThiloteE
Copy link
Member

ThiloteE commented Jan 17, 2022

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. eid definitely is a thing in Biblatex now and should work for the standard styles on ctan.

The only thing i am not sure about now is, if it would be a good idea to map Biblatex eid to the CSL page field instead of to number, because if we don't, we will have the same problem we just tried to solve, just with Biblatex, instead of with Bibtex. o.Ô, If JabRef properly supports eid in Biblatex Mode and if the article number (via eid) is present, it should show in the rendered citation.

Proposal to

  • map/render Biblatex eid in CSL page field.
  • OR map CSL number to the CSL page field.

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 issue (number), CSL (article) number, CSL page.

In relation to supporting eid in CSL: Current behavior for IEEE Style in Biblatex Mode results in eid not being rendered.
Here the tests:

@Article{foo..i,
  author       = {Foo, Bar},
  journaltitle = {Bib(La)TeX Journal},
  title        = {eid},
  eid          = {6eid},
}

Foo, B. (n.d.). eid. Bib(La)TeX Journal.

@Article{foo..n,
  author       = {Foo, Bar},
  journaltitle = {Bib(La)TeX Journal},
  title        = {eid + issue},
  eid          = {6eid},
  issue        = {9issue},
}

Foo, B. (n.d.). eid + issue. Bib(La)TeX Journal, 9issue.

@Article{foo..in,
  author       = {Foo, Bar},
  journaltitle = {Bib(La)TeX Journal},
  title        = {eid + issue + number},
  eid          = {6eid},
  issue        = {9issue},
  number       = {3number},
}

Foo, B. (n.d.). eid + issue + number. Bib(La)TeX Journal, 9issue, Article 3number.

@Article{foo..in,
  author       = {Foo, Bar},
  journaltitle = {Bib(La)TeX Journal},
  title        = {eid + issue + number + pages},
  eid          = {6eid},
  issue        = {9issue},
  number       = {3number},
  pages        = {45--67},
}

Foo, B. (n.d.). eid + issue + number + pages. Bib(La)TeX Journal, 9issue, 45–67.

@Article{foo..i,
  author       = {Foo, Bar},
  journaltitle = {Bib(La)TeX Journal},
  title        = {eid + issue + pages},
  eid          = {6eid},
  issue        = {9issue},
  pages        = {45--67},
}

Foo, B. (n.d.). eid + issue + pages. Bib(La)TeX Journal, 9issue, 45–67.

@Article{foo..n,
  author       = {Foo, Bar},
  journaltitle = {Bib(La)TeX Journal},
  title        = {eid + number},
  eid          = {6eid},
  number       = {3number},
}

Foo, B. (n.d.). eid + number. Bib(La)TeX Journal, Article 3number.

@Article{foo..n,
  author       = {Foo, Bar},
  number       = {3number},
  pages        = {45--67},
  title        = {eid + number + pages},
  eid          = {6eid},
  journaltitle = {Bib(La)TeX Journal},
}

Foo, B. (n.d.). eid + number + pages. Bib(La)TeX Journal, 45–67.

@Article{foo..n,
  author       = {Foo, Bar},
  journaltitle = {Bib(La)TeX Journal},
  title        = {eid + pages},
  eid          = {6eid},
  pages        = {45--67},
}

Foo, B. (n.d.). eid + pages. Bib(La)TeX Journal, 45–67.

@ThiloteE
Copy link
Member

ThiloteE commented Jan 20, 2022

So, to conclude from my side:

Changes for Mapping/Rendering/Conversions relevant for Citeproc-Java (https://github.com/michel-kraemer/citeproc-java):

Bibtex Mode:

  • Map or convert Bibtex number field field to CSL issue field.

Biblatex Mode:

  • Map or convert Biblatex number field AND Biblatex issue field to CSL issue field.

  • Map or convert Biblatex eid field to CSL number field.

    • The current implementation does not render Biblatex eid for a journal article.

I have based my proposals on these key comments and sources and these are the important ones!

  1. Key sources:
  1. Less important, but provide nice info:

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

@ThiloteE
Copy link
Member

Hoping for decision by dev-call and also for comment by @michel-kraemer Citeproc-Java specialist.

@michel-kraemer
Copy link
Contributor

michel-kraemer commented Jan 21, 2022

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.

@Siedlerchr
Copy link
Member

Just throwing in some idea: We could extend our alias mapping BibTeX ↔ biblatex here that would also work for cleanup.
https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/model/entry/EntryConverter.java

Either way we need to pass down a bibatabsecontex (see comment in #7378 )

@ThiloteE ThiloteE removed the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jan 27, 2022
@ThiloteE
Copy link
Member

which of them are the preferred ones

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...

@Siedlerchr
Copy link
Member

@koppor
Copy link
Member

koppor commented Jan 27, 2022

In relation to supporting eid in CSL: Current behavior for IEEE Style in Biblatex Mode results in eid not being rendered.

Confirmed - I checked the source code of the package at https://ctan.org/tex-archive/macros/latex/contrib/biblatex-contrib/biblatex-ieee. Neither ieee.bbx nor ieee.cbx contain eid. After we came to a conclusion here, we can write the author of that package - or just send him a patch :p. - Maybe, it does handle paper (see https://tex.stackexchange.com/a/445897/9075). Need to check.

@koppor
Copy link
Member

koppor commented Jan 27, 2022

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:

grafik

How should the join be made? Should we take one of them or do a concatination of both are present? I would guess: If issue is present, just use issue. Otherwise, move number to issue.

@ThiloteE
Copy link
Member

ThiloteE commented Jan 28, 2022

If issue is present, just use issue. Otherwise, move number to issue.

Do it the other way round. Biblatex number > Biblatex issue.

Reason: "As a rule of thumb number is the right field in most circumstances." - biblatex documentation p. 40.

Therefore:

For CSL issue, take Biblatex issue, if only Biblatex issue exists.
For CSL issue, take Biblatex number, if only Biblatex number exists.

If both Biblatex number AND Biblatex issue exist, take both or somehow let the citation style decide. This is because

  • I don't think I would want to say that issue is subordinate to number or vice versa. They sort of operate on a similar level. (Source: number vs issue number vs issue plk/biblatex#726 (comment))

Only, if taking both is technically not possible, .... show Biblatex number instead of Biblatex issue. The number field seems to be the more important one ("As a rule of thumb number is the right field in most circumstances.").

(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)

@Siedlerchr
Copy link
Member

We should make sure to enforce consistency with https://github.com/zepinglee/citeproc-lua/wiki/Bib-CSL-mapping

@koppor koppor assigned koppor and unassigned ThiloteE Feb 18, 2022
@koppor
Copy link
Member

koppor commented Feb 18, 2022

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:

  • Different BibTeX and BibLaTeX behavior? -- JabRef has support for these two modes, and they should be considered.
  • Write down test cases for different renderings in Java - This is a preparation required by us for the call. The basis is https://github.com/JabRef/jabref/pull/8454/files

@koppor
Copy link
Member

koppor commented Mar 28, 2022

Fun fact:

    <term name="issue" form="short">
      <single>no.</single>
      <multiple>nos.</multiple>
    </term>

Source: https://github.com/citation-style-language/locales/blob/c6e38e6963a9792332c63ea3c3c385176f76f7ea/locales-en-US.xml#L374

@adrianocorrea
Copy link
Author

So we are currently waiting for the following issue to be fixed, correct?
Issue vs Number APA 7th edition; Number and Issue not shown under certain conditions #5827

@ThiloteE
Copy link
Member

ThiloteE commented Aug 24, 2022

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.

@adrianocorrea
Copy link
Author

Woo-hoo! The number is back in APA! 😃
Thank you, @ThiloteE, @koppor, @michel-kraemer, @Siedlerchr, @mlep, @AEgit, and @calixtus for your dedication to solving this bug! You guys are awesome!
I am looking forward to the release of JabRef 5.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bib(la)tex entry-preview status: depends-on-external A bug or issue that depends on an update of an external library
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

8 participants