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

Support Citation Style Language (CSL) Styles in LO/OO #2146

Closed
georgd opened this issue Oct 9, 2016 · 22 comments · Fixed by #11477
Closed

Support Citation Style Language (CSL) Styles in LO/OO #2146

georgd opened this issue Oct 9, 2016 · 22 comments · Fixed by #11477

Comments

@georgd
Copy link

georgd commented Oct 9, 2016

This is a feature request as discussed in #1928.
Now that CSL CitationStyles are supported for preview, it seems a logical step to support them in LO/OO as well.

@Siedlerchr
Copy link
Member

Siedlerchr commented Oct 10, 2016

Yeah that would be nice and I think I read somewhere that zotero supports
them in LO or OO, too but requires a plugin

@koppor
Copy link
Member

koppor commented Oct 11, 2016

Refs #624

@georgd
Copy link
Author

georgd commented Oct 11, 2016

@Siedlerchr Zotero and the CSL project are very tightly tied together and it does use CitationStyles in LO/OO.
As for the plugin, literature management tools either provide plugins for inserting citations in authoring software (like Zotero) others have them pushed from the main program like JabRef does. Some provide both (like Citavi). The advantage of a plugin is that writers don’t have to go away from the text they’re writing for inserting a reference.

@Olifair
Copy link

Olifair commented Oct 12, 2016

Being able to use CSL with LO/OO would be really great.
This is the way Mendeley is using CSL : the LibreOffice plugin offers some buttons to insert a reference (which opens a search window, one can type first author year etc and is offered a choice), merge citation, insert bibliography, refresh, chose citation style etc). For this to work, Mendeley needs to be up and running.

@georgd
Copy link
Author

georgd commented Oct 18, 2016

While I’d prefer a LibreOffice plugin, I think enabling CSL with the current solution should have higher priority. That’s what this issue should track.

@rmzelle
Copy link

rmzelle commented Nov 21, 2016

@georgd, I'm very happy excited to see preliminary CSL support in JabRef.

A small suggestion: it might avoid confusion if you/JabRef would refer to CSL styles as, well, "CSL styles" (or "Citation Style Language styles"). I've never seen anybody use the term "CitationStyles" to refer to our project (the only exception would be our project domain name, http://citationstyles.org/, which was chosen for brevity).

Also, let us know if you have any questions where we (CSL developers) might be able to assist. E.g. apart from Zotero's official LibreOffice plugin, there are some alternative implementations that might be worth a look: https://zotero-odf-scan.github.io/zotero-odf-scan/, https://atom.io/packages/zotero-citations, and https://atom.io/packages/zotero-picker. (cc @adam3smith)

@koppor
Copy link
Member

koppor commented Nov 21, 2016

@bartsch-dev Can you do the renaming? 😇

We opt for "CSL styles" and try to use it in all documentation.

@koppor koppor changed the title Support CitationStyles in LO/OO Support CSL Styles in LO/OO Nov 21, 2016
@Olifair
Copy link

Olifair commented Feb 6, 2017

I agree with georged : the current solution is pretty workable (especially if one has two screens ;-), so including cls styles in the current citation layout for the reference list in Open/Liblreoffice would be really great. Basically it's the only thing that keeps me going with Mendeley in parallel :-(
I'm no help with programming, but I would be quite willing to test.
Cheers

Oliver

@cedmfr
Copy link

cedmfr commented Aug 24, 2017

Please improve the use between LO and Jabref both in connection to a document, inserting a citation, format a citation, inserting a reference list, format reference list and format its entries according to specific styles. Otherwise users have to use library in other software, what a pity for Jabref and all the work done !

@koppor
Copy link
Member

koppor commented Aug 24, 2017 via email

@Olifair
Copy link

Olifair commented Dec 21, 2017

It is a pity that the CSL style implementaiton has not advanced in the last year. This is the main blocking point for researchers in natural sciences to use JabRef : when you write an article, your bibliography must be formatted after the journals specifications. Most scientists I know use Reference programmes mainly for this reason, to be able to do this easily without much fuss (and much less to organise their bibliography). CSL styles are available for many Journals, so if JabRef wants to attract this userbase, this feature should be on the top of the todo list. Sorry, I'm not a programmer, I can only help with testing. In the moment I'm using Mendeley, where this works nearly flawlessly (with Word as well as with Libreoffice writer), I have wanted to change to JabRef for two years now, but without the styles feature I won't change. There are too few JabRef styles and they are too complicated to program. I publish five to ten articles a year, nearly every time in a different journal .... now way that I spend everytime half a day to program the bibliography style. So I'm hoping for next year ...
Cheers
Oliver

@koppor
Copy link
Member

koppor commented Feb 16, 2018

@Olifair We currently have no money to pay someone for that (donations page). No one of the JabRef team gets paid for JabRef. Thus, working on this really depends on the availability of our personal free time. - We really welcome feedback on our volunteer work. In case you can spend some more time (other than reporting issues), we would really like to encourage you to check https://help.jabref.org/en/FAQcontributing - especially the part asking for improvement of our help pages. This would help JabRef getting better as a whole. 🥇

@ThiloteE
Copy link
Member

ThiloteE commented Aug 1, 2021

I think this issue is still relevant.

i read that @antalk2 is currently restructuring and improving the code for the Libre Office citation feature.

Any ideas how to make "import csl style for LO/OO implementation" work?

@antalk2
Copy link
Contributor

antalk2 commented Aug 2, 2021

Now that CSL CitationStyles are supported for preview

  • I assume preview uses HTML.
    OOTextIntoOO.write is (going to be) used to emit markup into the document. It understands some basic HTML tags. Its parser is not very flexible, but easy to add new tags. Does not understand entities (probably should at least handle < > & Probably could be extended to emit what one sees in preview to be emitted into the document.
  • jabref currently only stores citation keys and pageinfo in the document. Zotero stores more. Pageinfo in jabref is currently "just text", zotero uses Locator+text (RTF/ODF-Scan accepts Locator encoded in text).
    Question: what do we need to store? Where do they belong? Pageinfo seems to belong to a citation.
    Does prefix and suffix belong to a citation, or a citation group? Zotero seems to allow them for each citation,
    but only shows for the first citation in a group and eventually throws away prefix and sufix provided for the second citation.
    Question: how to handle these extras with jstyle to make a switch between jstyle and CSL styles seamless?
    Are we adding a parallel implementation, or replace jstyle with CSL?
    In either case we need support to store/input/edit the extra information.
  • I do not know the requirements and services of CSL.
    • We could provide
      • a list of citation groups (in top-down left-to-right order), and the citation keys within each (We already use this)
      • details on cited sources as in the preview
      • extra information stored in the document (currently only pageinfo)
    • We need
      • markup for the citation groups (As an optimization, for newly inserted groups we may want a "preliminary" version)
      • markup for the bibliography

@koppor
Copy link
Member

koppor commented Aug 2, 2021

* I assume preview uses HTML.

Yes. However, CSL can do more: org.jabref.logic.citationstyle.CitationStyleOutputFormat: asciidoc, html, rtf, text, fo.

  [OOTextIntoOO.write](https://github.com/antalk2/jabref/blob/77fbf1eb170767a351cfb0e779ccd5b3a85f9474/src/main/java/org/jabref/model/openoffice/ootext/OOTextIntoOO.java#L148) is (going to be) used to emit markup into the document. It understands some basic HTML tags. Its parser is not very flexible, but easy to add new tags. Does not understand entities (probably should at least  handle `<`  `>`  `&` Probably could be extended to emit what one sees in preview to be emitted into the document.

Sounds good!

* jabref currently only stores citation keys and pageinfo in the document. Zotero stores more. Pageinfo in jabref is currently "just text", zotero uses  [Locator](https://zotero-odf-scan.github.io/zotero-odf-scan/)+text (RTF/ODF-Scan accepts Locator encoded in text).
  Question: what do we need to store? Where do they belong? Pageinfo seems to belong to a citation.

I have no clue about the "Pageinfo" usage of JabRef. Do you have one (since you intensively touched JabRef's code)?

Side note (requried for the next question): I quote from the Zotero page:

{ | Smith, (2012) | | |zu:2433:WQVBH98K}

  • Each marker is separated into five sections, separated by vertical lines ("pipes").
  • The first section may contain a citation prefix. (Example: "See")
  • The second section contains the authors (or title) and year of the cited item; this section only exists to show you which item is cited by the citation marker.
  • The third section may contain a locator, such as a page number. The fourth section may contain a citation suffix.
  • Finally, the fifth section contains a unique item identifier (consisting of a user/group ID and an item ID).

The "unique item identifier" is the BibTeX key in our case.

  Does prefix and suffix belong to a citation, or a citation group? Zotero seems to allow them for each citation,
  but only shows for the first citation in a group and eventually throws away prefix and sufix provided for the second citation.

We should follow the Zotero implementation.

  Question: how to handle these extras with jstyle to make a switch between jstyle and CSL styles seamless?

My dumb question would be: Can't we use the same format as Zotero? So that OO documents can be used with Zotero and JabRef interchangeably?

  Are we adding a parallel implementation, or replace jstyle with CSL?

My proposal would be: Switch to CSL only for JabRef 6.0 - and support jstyle in 5.x.

Reason: Even though there is the "Export-Filter-Editor" by @teertinker, there are not many jstyles. See https://jstyles.jabref.org/. - @teertinker Do you have another opinion?

  In either case we need support to store/input/edit the extra information.

I think, jstyle and CSL have the same information. - CSL is a language to render the bibliography items. jstyle is the same. - I don't know, how CSL handles the rendering of references to the bibliography items.

@adam3smith
Copy link

CSL Maintainer here -- I don't have a lot of time to provide feedback here (other than that we're always happy to have people use/implement CSL!), but a couple of notes:

{ | Smith, (2012) | | |zu:2433:WQVBH98K}

Is not at all an official Zotero format. It's the format a 3rd party add-on uses to convert documents edited in any software (e.g. Scrivener) to generate actual Zotero citations. You can look at what Zotero does in the LO Reference marks in a Zotero document: It's JSON that specifies basically the same information (plus, as noted above, the actual item information in CSL JSON format).

My dumb question would be: Can't we use the same format as Zotero? So that OO documents can be used with Zotero and JabRef interchangeably?

That would likely be possible as long as you embed the item info in CSL JSON format. E.g. Zotero and Mendeley can read each other's citations.

Also, to clarify some terminology: CSL/Citation Style language describes the specification and the collection of styles in CSL/XML format. The actual implementation is done in a citeproc. citeproc-js, as used by Zotero and Mendeley, is the most common one. I believe citeproc-java (which you're using?) is just a java-wrapper around that. There are several others (citeproc-php, citeproc-rs, citeproc-ruby etc.).
Zotero's integration in both Word and LO uses the RTF generated by citeproc-js.

@Siedlerchr
Copy link
Member

cc @mohit038 Might be of interest for you, some background information on the CSL stuff

@JabRef JabRef deleted a comment from github-actions bot Nov 14, 2021
@koppor koppor reopened this Nov 14, 2021
@koppor
Copy link
Member

koppor commented Nov 14, 2021

I assume that this is still an open issue

@ThiloteE
Copy link
Member

Yes it is. I have seen you or somebody else on the team created a tag for v6.0 and remembered the following:

My proposal would be: Switch to CSL only for JabRef 6.0 - and support jstyle in 5.x. (#2146 (comment))

@koppor
Copy link
Member

koppor commented Mar 10, 2022

Screenshot where it needs to be placed:

grafik

@koppor
Copy link
Member

koppor commented Mar 14, 2022

Note: Documentation of the current OpenOffice integration code is available at https://devdocs.jabref.org/code-howtos/openoffice/

@ThiloteE ThiloteE changed the title Support CSL Styles in LO/OO Support Citation Style Language (CSL) Styles in LO/OO May 6, 2022
@koppor
Copy link
Member

koppor commented Jun 6, 2022

The challange of this issue to get into OpenOffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants