Ask Your Question
0

How can I keep italicized words in headings from changing to regular text in table-of-contents?

asked 2019-06-15 09:56:29 +0200

Losi Led gravatar image

updated 2019-06-17 13:28:51 +0200

erAck gravatar image

I have headings that contain certain words that are italicized (scientific names). This works fine in the section headings, but in the table of contents, the entire entry is in regular text (without italics). If I change the TOC contents style to italics, then the entire entry is in italics.

Is there a way to keep the same words italicized in the TOC as in the section headings?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2019-06-15 18:22:29 +0200

RGB-es gravatar image

For the TOC (it still fails with fields), recent versions of LibO can do that automatically... sort of. If you are not seeing the italics, manually update the TOC with right click → update index. Weird thing is: this only works if the italics was applied as direct formatting! If you used a character style to apply the italics, it will be ignored. See also:

Bug 87604 - Table of Contents should retain direct formatting (and character style)

Reading this and similar reports, my impression is that a better solution for this problem will never be implemented... :(

edit flag offensive delete link more

Comments

@RGB-es: we strongly advocate use of styles and condemn direct formatting. In the present solution (workaround?) as I read it from the bug report, only some (not all) direct formatting is transferred to the TOC. This goes against the "official" philosophy. One of the comments alluded/suggested a list of checkboxes so that user could select which attributes to transfer. But I feel this is very complicated because it could in the end be available on a level basis (per Heading n instead of global settings).

The only attribute which should not be transferred is font size change IMHO. In my case, I need to change fontface for technical words so that they stand out from surrounding terms. No way and I don't want to manual edit my TOC.

ajlittoz gravatar imageajlittoz ( 2019-06-15 20:28:50 +0200 )edit

@ajlittoz Indeed! I hate direct formatting, it's too dangerous! The impossibility to properly transfer valid formatting to the TOC or fields is a real problem and completely cuts out Writer as an option for many technical documents. At least we always have (Xe)LaTeX for that, oh well.

RGB-es gravatar imageRGB-es ( 2019-06-15 21:35:47 +0200 )edit
0

answered 2019-06-15 10:53:15 +0200

ajlittoz gravatar image

Unfortunately not.

The TOC engine collects only raw text from the heading paragraph. All formatting, be it character style or direct formatting, note anchor, index entry, …) is wiped off before synthesis of the new paragraphs forming the TOC.

I also need this and found no automatic way of doing it.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-06-15 09:56:29 +0200

Seen: 35 times

Last updated: Jun 15