How to create an alphabetical index from toc headings

How do I create an alphabetical index from table of contents headings

It would help to know your OS name, exact LO version and document save format.

Basically, there is no automatic way of creating such a thing.

You can however “tag” your document with required information:

  1. select a heading
  2. Insert>TOC & Index>Index Entry
    The heading is already entered in Key but you can modify the entry if you prefer another wording
  3. Insert

Repeat for every heading.

Insert your alphabetical index where you need/want it.

Note that you have only one alphabetical index in Writer. This means that if you use the index feature for “standard” alphabetical index, your headings will be included in this global index. You cannot isolate them in a separate table (just like you can’t build independent indexes).

Hi Ajlittoz,

many thanks for your help. The info you need is below and the save format is standard .odt

I understand your suggested method, but I have a large document with many (~150) “Headings 1”. I thought that creating an alphabetical index from the Heading 1 texts would be an automatic affair. Maybe on the style sheet for Heading 1 “Add this text to the alphabetical index” or something similar. But it seems not to be…

Is there any other way to automatically add Heading 1 texts to the index? Macros, scripts or Python?

Thanks again for your help.

Otto

Probably but I never wrote a macro, not having the need for it because of careful planning and preparation of my documents.

Modify the style sheet for headings adding a checkbox: “Add this text to the alphabetical index”

I may be simple-minded but I assume there is an API to add a text to the alphabetical index so it ought to be easy for someone knowing the framework:

if (checkbox(addindex) is TRUE):
    addIndexText(getHeadingText())

Is this a request for a new feature? This site is manned by users like you. Feature requests must be channelled to TDF Bugzilla where developers can (may?) take note of it. However, considering the number of backlogged bugs, don’t hope for a quick implementation. The (too) concise specification you gave is IMHO rather a “regression” in the general ODF philosophy because it “locks” headings in a specific role. The ley point is what you consider a “heading”. Technically, it is any paragraph (style) attached to an outline level. This rather large definition allows many interesting “tricks” which should not be prevented by your proposal.

Just not the trick I was expecting :wink:

I don’t really see that. It would just be another property of any text block. Or not?

I’ve submitted this as a bug tdf#168200

Thanks again for your help!

de facto not so accurate, and somehow a bit misleading.
it’s more likely a bunch of serial posters hammering a flow of naive newcomers :wink:
with a touch of obscure privileges behind the scene Understanding Discourse Trust Levels
Leader badge on Ask LibreOffice

with a bit of AI you may be lucky enough to end up with
LibreOffice: BaseIndexMark Service Reference
LibreOffice Developer's Guide: Chapter 7 - Text Documents - The Document Foundation Wiki