How to use the character style from the text pulled into an index

I have a table of contents where I want to use the character style from the item it is pulling in. So for example: In my document I have “Chapter 2” where the word “Chapter” is not bold and the “2” is bold. In my TOC I want to have “Chapter 2” as one of the items shown with the same character style (i.e., “Chapter” not bold and “2” bold) as what I it shows in the text. How can I achieve this?

You can do this partially.

The structure line of the TOC dialog (Entries tab) allows you to apply a character style to an item (chpater number, heading or page number). The character style is applied to the entire item. This means that, if the captured number contains “Chapter”, both “Chapter” and the number proper will be decorated by the character style.

You can mitigate this when “Chapter” is not part of the number (which means word “Chapter” does appear in the heading). Enter “Chapter” in the text box preceding E# and give it its own character style (yes, you can even if the GUI is not very clear about it).

Any character style or direct formatting applied to the heading is not captured in the TOC line. So, as a last resort, if your “decoration” is sophisticated, untick Protected against manual changes in the Type tab and apply your caharacter styles and direct formatting directly onto TOC lines. Be aware that these manual changes won’t be kept through a TOC update and you’ll have to apply them again.

My “decorations” are indeed more sophisticated than this and I have dozens of headings. I am actually using certain paragraph styles for my headings that are then pulled into the TOC. The headings have a mix of italics and no formatting for the character styles. Do you think this is something that could be implemented as a feature request? Or is it too complicated?

I think that keeping the styling applied to the heading would be a good thing. Because of the style wiping on TOC update, I have “accepted” not to transfer my decorations from heading to TOC. But I’d really appreciate if they were also transferred.


Partial styling of the number is more complex because it comes basically from a list style (even if you are not aware of it). List styles presently don’t allow to apply separate styles on the number “components” (here, separators before and after). There are many things to complain about in list style formatting, not speaking of their sometimes erratic behaviour (e.g. what happens to right indent if you try to change it). Asking for an improvement in number formatting, i.e. the general list style formatting, needs a deep analysis and a clear specification. So, I doubt this can be implemented in the near future.


An enhancement request for styling capture can be filed at TDF Bugzilla but I fear rejection on the ground that this will impact a general mecanism for cross-reference fields. The reason could be formatting at the “citation” can be/is generally different from what it is at the source. But probably, we could suggest a new Refer using category requesting style forwarding or a check box for the same purpose.

Thanks. I made an enhancement request. (tdf#157414) Hopefully I worded it in a way that it won’t be rejected.

Link fixed by ajlittoz

I have updated the number to the correct one. Thanks.