Bug 90621 - FORMATTING: Custom character styles are not applied in bibliographies
Summary: FORMATTING: Custom character styles are not applied in bibliographies
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: notBibisectable, regression
Depends on:
Blocks: Bibliography
  Show dependency treegraph
 
Reported: 2015-04-14 20:53 UTC by Rastus Vernon
Modified: 2023-12-09 10:46 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The structure line with the author part selected. (8.69 KB, image/png)
2016-01-03 17:55 UTC, Rastus Vernon
Details
The book entry type selected. (22.63 KB, image/png)
2016-01-03 17:56 UTC, Rastus Vernon
Details
Test document (29.35 KB, application/vnd.oasis.opendocument.text-flat-xml)
2016-01-03 18:22 UTC, Rastus Vernon
Details
Screenshot of test document (22.49 KB, image/png)
2016-01-03 18:23 UTC, Rastus Vernon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rastus Vernon 2015-04-14 20:53:43 UTC
When a character style is specified for the selected part on the structure line¹, in the entries tab of the window to modify a bibliography, the character style is applied only if it is one of the character styles that come with LibreOffice. If the character style was created by the user, it is not applied.

Steps to reproduce:

1. Create a new document in LibreOffice Writer.
2. Insert a bibliography.
3. Insert a bibliography entry (with type book) somewhere in the document, either from the bibliography database or from the document itself.
4. Open the dialog to modify the bibliography.
5. In the entries tab, select the book entry type and select one of the parts on the structure line.
6. Change the character style to one of the character styles in the drop-down menu.
7. Close the dialog and update the bibliography if needed.
8. Observe the style of the part you set a character style for. It should be applied.
9. Create a new character style.
10. Repeat steps 4 to 7, with the new character style you have created.
11. This time, the character style should not be applied.

Remark: if the document, at this point, is saved as a flat ODT file and is examined in a text editor, the custom character style will be seen (text:style-name="_34__20_Style_20_name") in the text:bibliography-entry-template element for the book entry template. This might mean that the change is saved, but that custom character styles are not rendered in bibliographies.

1: https://help.libreoffice.org/Writer/Entries_bibliography#Character_Style
Comment 1 Buovjaga 2015-04-17 18:29:20 UTC

*** This bug has been marked as a duplicate of bug 77919 ***
Comment 2 Rastus Vernon 2015-04-18 18:26:58 UTC
This is not a duplicate of bug 77919, if I understand correctly. That bug is about the entries section of the bibliography not showing current character styles (custom or not) and removing them when saving, while the present bug is about custom character styles not being displayed in the bibliography. I doubt fixing bug 77919 would fix this bug, but I can't know for sure.
Comment 3 Buovjaga 2015-04-18 18:41:28 UTC
Sorry about that!

Reproduced with latest master.

Luckily, this was not reproduced on 3.6.7, so a regression bibisect can be performed.

Win 7 Pro 64-bit Version: 5.0.0.0.alpha0+ (x64)
Build ID: 211c12b9c64facd1c12f637a5229bd6a6feb032a
TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-18_01:51:17
Locale: fi_FI

Ubuntu 14.10 64-bit
Version 3.6.7.2 (Build ID: e183d5b)
Comment 4 Robinson Tryon (qubit) 2015-12-14 05:32:33 UTC Comment hidden (obsolete)
Comment 5 Joel Madero 2016-01-03 17:08:52 UTC
I need some clarification to bibisect this.

> 5. In the entries tab, select the book entry type and select one of the
> parts on the structure line.

I'm not sure if I understand this correctly - can you explain clearer what it means?

> 6. Change the character style to one of the character styles in the
> drop-down menu.

I believe I do this.

> 7. Close the dialog and update the bibliography if needed.

When I reopen the dialog the character style is set back to <none> which leads me to believe I'm doing something wrong.

> 8. Observe the style of the part you set a character style for. It should be
> applied.
That doesn't happen for me (tested on various versions)

If you can clarify I can try to bibisect. Also a test document might help. Thanks
Comment 6 Rastus Vernon 2016-01-03 17:55:57 UTC
Created attachment 121697 [details]
The structure line with the author part selected.
Comment 7 Rastus Vernon 2016-01-03 17:56:47 UTC
Created attachment 121698 [details]
The book entry type selected.
Comment 8 Rastus Vernon 2016-01-03 18:22:40 UTC
Created attachment 121700 [details]
Test document

Test document with a bibliography and a bibliography entry. The bibliography is configured so that the "Author" structure element has character style "Strong Emphasis". This means "Artymiak, Jacek" should be in bold when the document is opened.
Comment 9 Rastus Vernon 2016-01-03 18:23:03 UTC
Created attachment 121701 [details]
Screenshot of test document
Comment 10 Rastus Vernon 2016-01-03 18:29:46 UTC
> > 5. In the entries tab, select the book entry type and select one of the
> > parts on the structure line.
> 
> I'm not sure if I understand this correctly - can you explain clearer what it means?

The "Book" entry type is in the list of entry types under the "Type" header (see book_entry_type.png), but the reproduction steps work with any entry type. Attachment structure_line_author.png shows the structure line with the author part selected.

> > 7. Close the dialog and update the bibliography if needed.
> 
> When I reopen the dialog the character style is set back to <none> which leads me to believe I'm doing something wrong.

That's bug 77919.

> > 8. Observe the style of the part you set a character style for. It should be
> > applied.
> That doesn't happen for me (tested on various versions)

It does for me on LibreOffice 5.0.4.2 (see test document and screenshot of test document). That might be because the style was removed when you reopened the dialog.

> If you can clarify I can try to bibisect. Also a test document might help. Thanks

I attached a test document which has reproduction steps 1 to 8 done.
Comment 11 Rastus Vernon 2016-08-06 18:31:12 UTC
Update: this is still an issue on LibreOffice 5.2.0.
Comment 12 Philipp Kewisch [:Fallen] 2016-10-28 11:10:10 UTC
This (and bug 77919) could use some attention. I didn't have this 3 years ago with OpenOffice, I was able to apply text styles there. I wanted to switch back to OOo for the Bibliography, but for some reason opening my document now crashes OOo so I can't even work around.

I think this deserves higher importance, because the bibliography table is often the last thing people do when writing papers. If that is just a few days before due date, it is hard to find time to search for alternatives or fixes.

Is there a workaround editing the xml files? All I need is that exporting to PDF does the right thing. Where in the xml files do I need to look?
Comment 13 Rastus Vernon 2016-11-21 05:55:20 UTC
(In reply to Philipp Kewisch [:Fallen] from comment #12)
> This (and bug 77919) could use some attention. I didn't have this 3 years
> ago with OpenOffice, I was able to apply text styles there. I wanted to
> switch back to OOo for the Bibliography, but for some reason opening my
> document now crashes OOo so I can't even work around.
> 
> I think this deserves higher importance, because the bibliography table is
> often the last thing people do when writing papers. If that is just a few
> days before due date, it is hard to find time to search for alternatives or
> fixes.
> 
> Is there a workaround editing the xml files? All I need is that exporting to
> PDF does the right thing. Where in the xml files do I need to look?

From what I have seen, the XML files are fine, but the character styles are not rendered in bibliographies. One "solution" is to do formatting manually, at the end, though this is tedious.

You can also use the Zotero extension, which can generate bibliographies and is generally more powerful than LibreOffice's integrated support for bibliographies. It doesn't use character styles, though.
Comment 14 QA Administrators 2017-11-22 15:41:09 UTC Comment hidden (obsolete)
Comment 15 Rastus Vernon 2017-11-26 04:19:53 UTC
Update: I was able to reproduce the bug on LibreOffice 5.4.3.2 using the test document and reproduction steps 9 to 11.
Comment 16 Buovjaga 2018-07-08 19:33:46 UTC
I tried bibisecting this with 42max on Ubuntu 14.04, but unfortunately there are crashes with launching and creating a new style. These prevent getting any meaningful result.

Continuing with git bisect skip would have been insanity. I walked in the commits, backwards from the first known bad commit with "git reset --hard HEAD~100" (various values used) and then bouncing back and forth (git checkout back to the crashing one) when I ran into good territory. The border is just good<->crash.

Anyway ,the earliest bad commit in the repo is d4e1a1073fc3d8d51aae700fb004a1adeb7dba2c
Comment 17 QA Administrators 2019-07-09 02:44:20 UTC Comment hidden (obsolete)
Comment 18 QA Administrators 2021-07-09 04:02:34 UTC Comment hidden (obsolete)
Comment 19 Stéphane Guillou (stragu) 2021-12-19 15:00:24 UTC
reproduced with:

Version: 7.3.0.0.beta1 / LibreOffice Community
Build ID: 436f14c25ec1847646b953cf13d0db4f7ca3be57
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 20 dolezvo1 2023-12-09 10:43:05 UTC
This has been really bothering me personally, I'll try to look into it if I find the time.