Bug 170459 - Support specifying alternative text for the table-of-contents entry of a paragraph
Summary: Support specifying alternative text for the table-of-contents entry of a para...
Status: RESOLVED DUPLICATE of bug 32363
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:
Depends on:
Blocks: TableofContents-Indexes Writer-Styles-Heading ODF
  Show dependency treegraph
 
Reported: 2026-01-23 21:15 UTC by Eyal Rozenberg
Modified: 2026-01-26 09:13 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2026-01-23 21:15:34 UTC
Authors who write documents with multiple headings, and use tables-of-contents, sometimes  want to use _different text_ for the appearance of a heading in the ToC then its actual text in the document body.  For example, the in-body title might have some paranthetical text, or a verbose phrase taking up a full line or more than that; but for the ToC, the author can rely on the proximity of the parent heading, of child headings and of subsequent headings on the same level, to opt for something shorter. 

For comparison, see this popular Tex.SX question and answer about achieving this effect in LaTeX documents:

https://tex.stackexchange.com/q/174861/5640

Currently, this is not supported in LibreOffice; and I don't recall this feature being available in ODF (although I might have missed it).

I suggest we introduce it.

At the moment, users overcome this deficiency by manually modifying their  tables-of-contents; but - as the ToC needs occasional regeneration, they need to re-apply those edits multiple times. See also the discussion in bug 169210, comment #9.
Comment 1 Eyal Rozenberg 2026-01-23 21:30:44 UTC
Now, you might ask: "But what 'headings' do you mean, exactly? And what will we 'hang' these entries onto?"

Well, it needs to be whatever can make it into the Table of Contents. Which, in fact, means all paragraphs in the document, since one can have any paragraph style picked up for the ToC. So, actually, each paragraph should be able to have non-displayed content that serves as its ToC entry.
Comment 2 V Stuart Foote 2026-01-24 13:24:05 UTC
Wouldn't this require ODF TC action for massive changes to ODF Text document standards?


Flexible and dynamic ToC rebuilds would be nice. But no sense to implementing if we cause non-compliant paragraphs just to support a new feature.

Would rather our limited dev resources focus on meaningful deficiencies against ODF 1.4, and full compliance external formats that remain incomplete. SVGs for example.
Comment 3 Eyal Rozenberg 2026-01-24 15:37:08 UTC
(In reply to V Stuart Foote from comment #2)
> Wouldn't this require ODF TC action for massive changes to ODF Text document
> standards?

It may require ODF TC action for a minor change or two to the ODF standard, yes.

> Flexible and dynamic ToC rebuilds would be nice.

Indeed, although that's a separate bug. This one is just about support for different text for the ToC.

> Would rather our limited dev resources focus on meaningful deficiencies
> against ODF 1.4, and full compliance external formats that remain
> incomplete. SVGs for example.

Stuart, remember that the confirming a bug does not mean reallocating developer resources to implement it before doing other work.
Comment 4 RGB 2026-01-24 19:55:09 UTC
This is related to 

Bug 32363 - Possibility to create a "short title field" as alternative for long headings
Comment 5 Heiko Tietze 2026-01-26 09:01:37 UTC
(In reply to RGB from comment #4)
> Bug 32363 - Possibility to create a "short title field" as alternative for
> long headings

Nice finding. Otherwise also a duplicate of bug 169210 since we will not introduce a variable "replacement on toc" that allows to specify how this paragraph could be shown in the toc.

*** This bug has been marked as a duplicate of bug 32363 ***
Comment 6 Eyal Rozenberg 2026-01-26 09:13:04 UTC
(In reply to Heiko Tietze from comment #5)
> Otherwise also a duplicate of bug 169210 since we will not
> introduce a variable "replacement on toc" that allows to specify how this
> paragraph could be shown in the toc.

Strong disagree, but let's have this discussion on bug 32363.