To add Outline Levels 1/2 to Indexes at Levels 1/2

asked 2016-10-28 05:59:12 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello All -

I am using LibreOffice 5.2 on Ubuntu and trying to see how to best solve this issue.

I would like add Outline Levels 1/2 to 4 Index entries I have so the items in the 4 indexes, when inserted at Level 3, show up under the Outline Levels 1/2 added at levels 1/2 in those Indexes.

I have been able to do this manually to get the desired effect.

However, I wanted to see whether one or both of the following are true:

  1. If this could be done as part of feature already in LO 5.2
  2. Or whether this needed to be done programmatically through a macro?

If programmatically through a macro then I assume the following rough pseudocode would be necessary:

  1. Check the 4 indexes and if any item in those indexes appear at Levels 1/2 then move them to Level 3 if they are not in Outline Levels 1/2.
  2. For each Outline Level 1/2 add to the 4 Indexes at Levels 1/2.

I am a programmer and was hoping to write it in Basic using the XDocumentIndexes. I am assuming there is a Outline Index or some interface to access the Outlines also.

I assume Basic would be best language as it is the default language? I am a good Python programmer.

However, I assume setup is already there for Basic in LO.

Would appreciate hearing from you on how to best accomplish this. If LO already has this feature then how do I use it? And if programming, then where would be a good place to start in accessing the Indexes please.

Thank you for your help and suggestions.


edit retag flag offensive close merge delete


You might take a look at OOME_3_0.pdf, by Andrew Pitonyak. His site is site link. Section 14.13 has some examples for table of contents.

mark_t gravatar imagemark_t ( 2016-10-28 14:49:43 +0200 )edit

Thanks Mark. Going through it now. Is there a way to request this as a feature in LO - ie adding the Outlines to Indexes with a choice of Levels and to which Indexes.

monosij gravatar imagemonosij ( 2016-10-30 19:36:20 +0200 )edit

Is it not easy to just use the lower level of heading and set the format to the same as outline format? You could take a look at the LibreOffice Bugzilla (google search) and submit a bug as enhancement request, but search for any existing report first before posting.

mark_t gravatar imagemark_t ( 2016-10-30 23:03:50 +0200 )edit

By 'to just use the lower level of heading and set the format to the same as outline format?' - do you mean lower 'evel as to set the Index entry to the lower level ie 3?

Also not sure how to (or what you mean by) set the format to the 'Outline format'. Do you mean for the Indexes? Is that even possible as I had not seen. And if so will it not show all levels of Outline not just 1 and 2 which is all i want.

monosij gravatar imagemonosij ( 2016-10-31 06:13:18 +0200 )edit

Not sure if this is what you meant but attached example, Untitled 30.odt, of what I thought you were describing. Although the text "Outline 3" and "Outline 3a" look the same, only "Outline 3a" is shown in the table of contents.

mark_t gravatar imagemark_t ( 2016-10-31 16:46:06 +0200 )edit

Hi Mark - What I want is not with TOC but with Indexes. I have 4 Indexes (Emails/Documents/Invoices/Comparisons). I would like Levels 1/2 of TOC to show up in ALL 4 Indexes. And I will always add the 4 Index entries at Level 3. Hope that helps.

monosij gravatar imagemonosij ( 2016-10-31 19:11:40 +0200 )edit