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

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?

Table of contents have specific styles that apply to the entire line (ie. paragraph). If you change a single word, that is a character-level change that will not be reflected into the automatic generation of the ToC.

The only workaround I found for this was to enable manual editing of the ToC and italicize each word manually. Of course such changes are not practical if you have a large ToC, as they will be overwritten as soon as you update it again.

See also → Bug 30732 - [EasyHack] Character formatting not retained in entries of TOC, table lists, etc.

fdo#30732 · Status: ASSIGNED