Bug 157064 - Allow customization of the text reference style(s) from the bibliographic entry
Summary: Allow customization of the text reference style(s) from the bibliographic entry
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice, needsUXEval
Depends on:
Blocks: Bibliography
  Show dependency treegraph
 
Reported: 2023-09-02 13:24 UTC by Lucas
Modified: 2024-02-20 15:26 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Sketches of the proposed solution (326.49 KB, image/png)
2023-09-02 13:24 UTC, Lucas
Details
Bibliography-mark Label change test (407.14 KB, image/png)
2024-02-13 11:25 UTC, Lucas
Details
A new proposal to start the conversation (1.65 MB, application/pdf)
2024-02-13 12:06 UTC, Lucas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas 2023-09-02 13:24:13 UTC
Created attachment 189312 [details]
Sketches of the proposed solution

The idea is to support bibliographic entries such as:

   According to Author (Year, complement) ... 
	
   The Author also stated ....

   ... (AUTHOR, Year, Complement)

I think is sufficient to allow the bibliographic entry text to be editable as shown in the sketches attached to this proposal. 

+--------------------------------------------+
| Insert Bibliographic Entry                 |
+--------------------------------------------+
| Bibliographic Source                       |
|  ( ) Bibliographic Database                |
|  (x) Document Content                      |
| Entry                                      | 
|  Short Name [ SousaBrito2023             ] |
|  Text       [ Sousa-Brito (2023, p.10)   ] | <- editable
|                                            |
| [Help]         [New][Edit][Insert][Close]  |
+--------------------------------------------+
Comment 1 Dieter 2023-09-17 12:24:02 UTC
I'm not very familiar with bibliography in LO, because I use Zotero Plugin. I understand your idea, but does it mean you have to add a new entry everytime you refer to a different page?

cc: Design-Team for further input and decision.
Comment 2 Lucas 2023-09-18 00:22:20 UTC
Exactly. I want several entries in the text pointing to the same entry in the bibliography, like that:
+-------------------------------------------------+
| ...                                             |
|              word words words words             |
|              (SOUSA-BRITO, 2023, p.22)          | <- Entry1 
| ...                                             |
|    According to Sousa-Brito (2023, p.10), words | <- Entry2
| words words words words words words words words.|
| ...                                             |
| According to Sousa-Brito (2023, p.50), words    | <- Entry3
| words words words words words words words.      | 
| ...                                             |
| BIBLIOGRAPHY                                    |
|                                                 |
|    Sousa-Brito, 2023; Example Publication; ...  | <- Bibliography 
+-------------------------------------------------+

* Zotero allow this (the entry label can be edited). 

* LaTeX allow this thought the natbib package.
Comment 3 Heiko Tietze 2023-09-18 10:34:58 UTC
I think this is would be a great enhancement. Whether to allow modifications to the entry via "markup" (%year) or maybe even more user-friendly with tokens like known from the ToC entries ( "[R] ([Y])" would become "Sousa (2023)").

A question is if any implementation is limited by the file format considering cross-platform and -application compatibility.

And we have many tickets around this topic like:

* Bug 121945 - Include useful citation Styles /references (comment #12) in Writer by default and make them available with a drop-down button.
* Bug 121958 - Replace the Bibliography Database by a dialog to manually input new sources and to fetch from online sources via identifiers for citations/bibliography/references
* Bug 153350 - Allow user to change bibliography citation number structure
* Bug 73275 - EDITING: [UX] Make it easier to insert a bibliography entry
* Bug 92572 - Enable minimal ReferenceMarks support in Impress
(haven't read all in detail)

So perhaps consolidating the tickets makes sense.
Comment 4 Lucas 2024-02-13 11:25:38 UTC
Created attachment 192539 [details]
Bibliography-mark Label change test

(In reply to Heiko Tietze from comment #3)

> A question is if any implementation is 
> limited by the file format considering 
> cross-platform and -application compatibility.

The <text:bibliography-mark> contains the formatted label, but changing it on the XML file does nothing. LibreOffice Writer is ignoring the label inside the bibliography-mark. I suspect the file format will need a new version to instruct applications to use the label instead of recalculating it.
Comment 5 Lucas 2024-02-13 12:06:52 UTC
Created attachment 192543 [details]
A new proposal to start the conversation

(In reply to Heiko Tietze from comment #3)

> So perhaps consolidating the tickets makes sense.

I looked into that and drafted a proposal to start this conversation.
Comment 6 Heiko Tietze 2024-02-15 15:05:19 UTC
(In reply to Lucas from comment #5)
> I looked into that and drafted a proposal to start this conversation.
Awesome! Great work.

I read over the text and collect some idea. Please don't take any of these as a No, it's just what comes in mind while reading.

2.1 Support to Author-Year bibliographic styles is desirable
- and probably other styles as well
2.2 Support for back references is desirable
- isn't this solved with the alphabetical index? I've never seen a combination with the bibliography
2.3 Support for hyperlink styles is desirable
- "different colors for hyperlinks" - why would we need that? if it comes to different styles, ie. when to underline, sure
2.4 Better support for non-paged media, laws and regulation is desirable
- isn't it a violation of references if you bloat the bibliography with no inline reference?
2.5 Better support for external bibliographic databases is desirable
- desirable yes, but comments on https://design.blog.documentfoundation.org/2018/12/19/save-the-bibliography/ suggest to have at least a basic implementation 
2.6 Better presentation of bibliography in the dialog combos
2.7 Bibliographic support on Presentations and Drawings is also desirable

3.1 At its core, the bibliography is just an index not unlike the table of contents
- absolutely true, and perhaps we should start with this idea 
3.2 Index management and bibliographic formatting can be easily separated
3.3 An advanced internal bibliographic database may be overkill and unnecessary 
- see 2.5; in theory we could just let Zotero and co handle all bibliography (IIRC they require Java)

4.1 Separate the index from formatting through an HTTP API
- nice to have but unlikely the needed solution for 2.5; you give hints when it's not appropriate
4.2 The formatting will happen in the “Add/Edit Entry” dialog


I think we should create a test document what Zotero and co would do, and try to make this happen with internal methods. If we then consider to enhance it with, for example, external/online sources nothing stops us (but I'd still prefer to let 3rd party tools handle the advanced use case).

At least two of the many tickets regarding the bibliography discuss the topics from the UX POV (and I tagged it as need to add a mockup). Would be bug 153350 and bug 121958.
Comment 7 V Stuart Foote 2024-02-15 16:22:26 UTC
The RFC strawman is OK but lots of holes. 

Direction in LO really ought to be as with see also bug 121958 and the noted bug 121945--seamlessly integrate Citation Style Language (CSL) into LibreOffice to control of citation/bibliography and its application in response to CSL within field entries on an ODF document.  

Either some external API (e.g. Zotero's) or reimplement.

Extension of ODF 1.3 index-entry-bibliography and its bibliography-data-field and bibliography-type will likely be needed. [1]


=-ref-=
[1] https://docs.oasis-open.org/office/OpenDocument/v1.3/cs01/part3-schema/OpenDocument-v1.3-cs01-part3-schema.html#__RefHeading__1418764_253892949
Comment 8 Rafael Lima 2024-02-15 16:50:09 UTC
Implementing a full CSL processor would be a gigantic undertaking. It would also be hard to maintain over time.

As for open-source CSL processors, we have a few options:

https://citationstyles.org/developers/

Apparently citeproc-js is used by Mendeley / Zotero (in JavaScript).

https://github.com/juris-m/citeproc-js
Comment 9 Lucas 2024-02-19 04:13:18 UTC
(In reply to Heiko Tietze from comment #6)

> I read over the text and collect some idea. Please don't take any of these
> as a No, it's just what comes in mind while reading.

Of course: Debate is important to refine the ideas.

:)

I made a exploratory prototype to validate the abstraction that may answer some of the questions. The video is at: https://youtu.be/WP_D7JxR47A
Comment 10 Heiko Tietze 2024-02-19 08:13:15 UTC
(In reply to Lucas from comment #9)
> Of course: Debate is important to refine the ideas.
If you need to explain it's not easy to understand :-)

Seriously, every change is an improvement. But I think you tackle second level problems, and I believe we should stick to the very basics.

1. Store entries in an internal database (exists but is ugly)
2. Insert entries into document
3. Generate bibliography
2. and 3. don't support different formats such as IEEE vs APA.

3rd party tools provide all flexibility but have issues due to Java. Personally I'd rather solve this than invent the wheel new.
Comment 11 Lucas 2024-02-20 00:06:52 UTC
(In reply to Heiko Tietze from comment #10)

> If you need to explain it's not easy to understand :-)

Actually, the video is more about the programming. I programmed a mini database/formatter and the dialog to validate that the concept is sound. But it allows to see the proposed dialog working.

The abstraction is actually simple. The bibliographic database/formatter module will return the "Formatted Reference Label", the "Formatted Index Entry" and a "Duplicate Resolution Key" (which is a counter name). The index will use this information to resolve the conflicts and ask the database/formatter module to reformat the label/index entry with the appropriated resolution key. 

This is necessary because Author-Year bibliographic styles (such as APA and ABNT) require a counter to disambiguate two or more references of the same author in the same year. This also works for numeric bibliographic styles (such as IEEE) and for styles with an abbrev and a sequential.

It took me two days to program this prototype.
It is not that complicated.


> But I think you tackle second level problems,
> and I believe we should stick to the very basics.

When you talked in consolidating the Enhancement Requests I thought the idea was to make the plan to achieve a more complete solution.


> 3rd party tools provide all flexibility but have issues due to Java. 
> Personally I'd rather solve this than invent the wheel new

This was one of the points of my proposal.
A javaless/extensionless integration.
Comment 12 V Stuart Foote 2024-02-20 15:26:13 UTC
(In reply to Lucas from comment #11)

> 
> This was one of the points of my proposal.
> A javaless/extensionless integration.

+1, but implemented with ability to consume and reformat to ODF using CSL or we're back to limits of the current OOo era "bibliography" database.