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

IsSortByPosition ignored #10663

Closed
2 tasks done
vigmond opened this issue Nov 23, 2023 · 14 comments
Closed
2 tasks done

IsSortByPosition ignored #10663

vigmond opened this issue Nov 23, 2023 · 14 comments

Comments

@vigmond
Copy link

vigmond commented Nov 23, 2023

JabRef version

5.11 (latest release)

Operating system

GNU / Linux

Details on version and operating system

OpenSuse 15.4

Checked with the latest development build (copy version output from About dialog)

  • 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. Edit jstyle file so that
    IsSortByPosition="true"
  2. Generate the bibliography

The bibliography will be alphabetical. Everything else is as expected.

Appendix

jstyle file:

NAME
Frontiers Journal Harvard Style

JOURNALS
Frontiers

PROPERTIES
Title="References"
IsSortByPosition="true"
IsNumberEntries="false"
ReferenceParagraphFormat="Text body"
ReferenceHeaderParagraphFormat="Heading 1"

CITATION
BibtexKeyCitations="false"
AuthorField="author/editor"
YearField="year"
MaxAuthors="2"
MaxAuthorsFirst="2"
AuthorSeparator=","
AuthorLastSeparator=""
AuthorLastSeparatorInText=" and "
EtAlString=" et al."
YearSeparator=" "
InTextYearSeparator=" "
BracketBefore="("
BracketAfter=")"
BracketBeforeInList="["
BracketAfterInList="] "
CitationSeparator=", "
UniquefierSeparator=","
GroupedNumbersSeparator="-"
MinimumGroupingCount="3"
FormatCitations="false"
CitationCharacterFormat="Default"
MultiCiteChronological="true"
LAYOUT
article=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author} (\year\uniq). \title, \journal \volume\begin{pages} : \format[FormatPagesForHTML]{\pages}\end{pages}.

book=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author}\begin{editor}\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\editor} (Ed.)\end{editor}, \year\uniq. \title. \publisher, \address.

incollection=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author} (\year\uniq). \title. In: \format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\editor} (Ed.), \booktitle, \publisher.

inbook=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author} (\year\uniq). \chapter. In: \format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\editor} (Ed.), \title, \publisher.

phdthesis=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author} (\year\uniq). \title, \school.

default=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author} (\year\uniq). \title, \journal \volume\begin{pages} : \format[FormatPagesForHTML]{\pages}\end{pages}.

@HarikaB11
Copy link

Hi @vigmond, I would like to work on this issue.

@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Nov 24, 2023
Copy link
Contributor

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@ThiloteE
Copy link
Member

@vigmond could you please provide screenshots of prior and expected output?

@HarikaB11 this is not marked as "good first issue". If at any point you feel this is too tough an issue, feel free to check out other issues from the projects page. We are looking forward to transition to CSL styles in LibreOffice/OpenOffice eventually, as there is an organisation behind them that actively maintaines their styles. They also do have a lot more styles.

@vigmond
Copy link
Author

vigmond commented Nov 24, 2023

Hi

Here is the screenshot. Note that the references inserted in the libreoffice document are in alphabetical order and not in the order in which they are cited.

Screenshot from 2023-11-24 11-29-43

@vigmond
Copy link
Author

vigmond commented Nov 26, 2023

The problem was reproduced on a MacBook Pro 14" M2 running Sonoma.

@vigmond
Copy link
Author

vigmond commented Dec 4, 2023

It works correctly if the in-text citation is a number and not AuthorYear (isNumberEntries=true).

@vigmond
Copy link
Author

vigmond commented Dec 4, 2023

Sorry but nevermind. It makes little sense to use Author date and then not sort the bibliography by author.

@Siedlerchr
Copy link
Member

For some info on the parameters see https://docs.jabref.org/cite/openofficeintegration

@koppor koppor removed the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Mar 20, 2024
@subhramit
Copy link
Member

Could anybody give a hint as to where the underlying issue could be? I checked CitationGroups.java and a few other probable places, but could find no issue.

@koppor
Copy link
Member

koppor commented Mar 24, 2024

@subhramit Maybe @antalk2 can share some knowledge from 2022. He rewrote much parts of the code in 2021/2022: https://github.com/JabRef/jabref/pulls?q=is%3Apr+author%3Aantalk2+sort%3Aupdated-desc. No one else touched these parts of JabRef then.

@Siedlerchr
Copy link
Member

There's also some documentation in our devdocs

@koppor
Copy link
Member

koppor commented Mar 25, 2024

Link to the general devdocs regarding LibreOffice integration: https://devdocs.jabref.org/code-howtos/openoffice/

@antalk2
Copy link
Contributor

antalk2 commented Mar 25, 2024

I am not sure what knowledge is needed that I could share. Or, what is the problem we are trying to solve.

As vigmond mentioned above: "It makes little sense to use Author date and then not sort the bibliography by author."

Nevertheless, I include pointers below to what I found, just in case.

Docs

According to

doc: https://devdocs.jabref.org/code-howtos/openoffice/overview.html#citation-styles
src:

* (2) Citations numbered in order of first appearance (`jstyle:IsSortByPosition`)

four styles are supported:

  • (1) jstyle:BibTeXKeyCitations
  • (2) Citations numbered in order of first appearance (jstyle:IsSortByPosition)
  • (3) Citations numbered according to their order in the sorted bibliography
  • (4) Author-year styles

(It is not spelled out above, but I believe (3) sorts as Author-year, and numbers the citations accordingly.)

Maybe the user documentation

Technical background

I think (but could not test now), I did not change this aspect.

In particular:

static void produceCitationMarkers(CitationGroups citationGroups, OOBibStyle style) {

calls

citationGroups.createPlainBibliographySortedByComparator(OOProcess.AUTHOR_YEAR_TITLE_COMPARATOR);

unconditionally.

@koppor
Copy link
Member

koppor commented Mar 25, 2024

@antalk2 Thank you so much for taking your time to help here. This should a bit guide newcomers to the code!

@vigmond Reading your comment and the comment by @antalk2, it seems, we just need to close issue, because it is a no-issue. - If I am mistaken, please comment here.

@koppor koppor closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants