Ask Your Question

Bizarre Table of Contents - How to Fix

asked 2014-07-30 18:32:50 +0200

JimPlaxco gravatar image

updated 2014-07-30 21:48:43 +0200

manj_k gravatar image

Hello, I have a Writer document. I only use 2 text styles in the document: Heading 1 and Default Style. I create a table of contents. I set the number of levels to 1. I expected that my TOC would be a list of those lines of text that had been assigned the Heading 1 style. Instead not only do I get Heading 1 but a total of 22 pages worth of assorted Default Style lines as entries as well. I can see no rhyme or reason behind why LO decides to make some regular lines of text into TOC entries and not others.

On this page there are some instructions but that changed nothing. Also on that page is a link to an item Creating a Table of Contents located at but that page returns a database error

Bottom line: My question: How can I get LO to create a TOC that only indexes lines of text defined using the Heading 1 style? This is version of LibreOffice Writer on Windows 7 Thank you.

edit retag flag offensive close merge delete

6 Answers

Sort by » oldest newest most voted

answered 2014-07-31 11:52:42 +0200

ajlittoz gravatar image

ROSt52 is right when commenting that understanding the principles and implications of LO concepts about Styles & Formatting is rather hard at the beginning.

LO is very very versatile when it comes to Outline & Numbering. You can enter ANY styled paragraph in a TOC. All you have to do is configure the feature in the "Outline & Numbering" tab of the style definition dialog. You find there a drop^down menu to give the TOC style attribute: from body text (= not in TOC), level 1 to level 10.

Maybe during your direct formatting, you indirectly activated this feature. I don(t know (I didn't went through the doc) if there is key binding associated with it, but I already had surprises in the past when typing the wrong ctl-something for a combination that visually changed nothing on the screen, so that I could catch immediately my mis-typing.

edit flag offensive delete link more


ajlittoz - good points, particularly "Maybe during your direct formatting, you indirectly activated this feature" I did check a couple of lines to see if that was the case but it was not so indicated in the styles options dialog. I did note that a number of the lines included in the TOC were lines that contained html source code pasted in from an ascii file. Logically that should make no difference but who knows what is going on under the covers.

JimPlaxco gravatar imageJimPlaxco ( 2014-07-31 17:36:24 +0200 )edit

@ajlittoz, it is also worth noting that use of TAB to indent paragraph styles also affects the outline level, which can change what is included in the default TOC index (which is based on outline levels). I generally manually specify the styles to be included in a TOC (refer point 2 in my answer here).

oweng gravatar imageoweng ( 2015-03-07 07:52:42 +0200 )edit

answered 2014-07-31 02:58:59 +0200

ROSt52 gravatar image

updated 2014-07-31 03:06:39 +0200

Well, well, well, I remember days when I was sure that the computer is doing things in the wrong way.... at the end I had to apologize to the computer... also I never did.

If there is something, which I regard as very strong in Writer then it is the Styles & Formatting function. I agree it is a bit difficult to understand the function at the beginning but once understood, it is excellent. I read the manual (free of charge) several times, and played around a bit. My way of learning.

Recommendation - Set up all the styles you most need at the beginning - Use the styles function - Apply direct formatting only when needed

Have not too much frustration and always keep in mind that a computer only does what you tell him.

edit flag offensive delete link more


ROSt52 said: Make sure that you do not have any direct formatting in your document

My response: That is a serious LO Writer problem if, as you state, LO can not handle any direct formatting in a document. As you can see in the answer I posted that is exactly what I did to solve the problem. And note that none of the direct formatting had anything to do with the style's Outline & Numbering definition - which is the only part of a style's definition that has any relevance in this matter.

ROSt52 said: Go through your document and search for each line, which should be Heading 1 style, Place the cursor in these lines and double click on the paragraph Heading 1 style or ctrl+1

My response: That I had already done that should have been apparent from my original question.

ROSt52 said:. and always have ...(more)

JimPlaxco gravatar imageJimPlaxco ( 2014-07-31 03:27:58 +0200 )edit

answered 2015-01-11 12:19:27 +0200

Having problem with ToC. Need to move around multiple documents quickly and ToC has been invaluable. Some of the documents have script within them that is causing ToC to not recognise headings, enabling multiple headings with no links, cannot be corrected through Alt M. Cannot find any graphic representation of the ToC to edit. Programmers plaything users nightmare. Thanks for any help. G

edit flag offensive delete link more


Can you better describe your problem? If you expect help, give concrete examples of the bad behaviour you complain about.

ajlittoz gravatar imageajlittoz ( 2015-01-12 10:16:59 +0200 )edit

answered 2015-11-09 09:45:54 +0200

mikehg gravatar image

I just had the same problem on windows version , it gave me a 16 page table of contents including large swathes of text .. quite a large document and when I started to go through each section of text and choose the dropdown option to remove 'direct formatting' then update the table of contents it was correct up to the point id removed the direct formatting in the document. Note: I was having to remove direct formatting for everything including plain text in a paragraph which had been incuded in the table of contents. This was going to be very time consuming to go through the whole document removing direct formatting where it was messing up the table of contents .. so I installed apache open-office and loaded up the doc, updated the table of contents and all was good!

edit flag offensive delete link more


The ultimate "mass-reformatting" weapon is quite simple: just select all (ctl+A) your entire document, then clear direct formatting. It will blindly remove every any formatting addition to the styles, whether intentional or not. Don't save your document until you're satisfied with the result, so that ou can revert the changes.

ajlittoz gravatar imageajlittoz ( 2015-11-10 08:40:41 +0200 )edit

answered 2015-03-01 06:42:58 +0200

biggles gravatar image

where? is my answer?

edit flag offensive delete link more

answered 2014-07-30 20:28:27 +0200

JimPlaxco gravatar image

All I can say is that LibreOffice Writer is r-e-t-a-r-d-e-d!

I tried many alternative solutions since posting my original question, including swapping styles for headings and text, etc. but none of it worked. I was still getting default text lines in my table of contents every time I inserted a TOC into my document.

Recalling that LO is challenged when it comes to pasting styles I selected the entire document, right clicked, and selected "Clear Direct Formatting" thus throwing out all the bolding, italicizing, font-resizing, etc. that I had done manually on text in my document.

I then inserted a table of contents and it came out picture-perfect - not one single line of body text showed up in the TOC.

So is this a solution? Certainly not because it came at the price of throwing out the manual text formatting I had done. But at least now I have a clean table of contents.

Now the question is this - why would clearing all direct formatting have any impact what so ever on how LO Writer goes about building a table of contents?

edit flag offensive delete link more


You certainly should be able to apply manual formatting to body text without it upsetting your ToC. On my systems I can and I am unable to reproduce the problems you are having, but I am using Linux and OSX and newer versions of LO ( & It might be worth trying an updated version of LO (even though is still considered "fresh") and/or submitting a formal bug report.

mikebibo gravatar imagemikebibo ( 2014-07-31 05:15:55 +0200 )edit

As @mikebibo mentioned OS, I am using XP and had in no LibO version starting from ~ 3.4 - never such a problem. It is appears simple that Heading Style was directly format to look like a default paragraph style.

ROSt52 gravatar imageROSt52 ( 2014-07-31 09:27:26 +0200 )edit

This will remain an unanswered question. I never encountered this problem with OpenOffice Writer (I'm a newbie to LO Writer). In hindsight the only think I can think of as a possible source of the problem (which still leaves it an LO Writer problem) is that some of the text I pasted in perhaps had unicode/extended ascii chars that were "invisible" in my text editors (Textpad, Notepad++). and that these had some unpredictable effect on Writer that was undone when I cleared all direct formatting.

JimPlaxco gravatar imageJimPlaxco ( 2014-07-31 17:49:37 +0200 )edit

I don't have time this week but I could attempt to recreate the problem with two approaches: simply pasting a text block and then pasting-special the same text as unformatted text, then create the TOC and see what happens.

JimPlaxco gravatar imageJimPlaxco ( 2014-07-31 17:49:59 +0200 )edit
Login/Signup to Answer

Question Tools



Asked: 2014-07-30 18:32:50 +0200

Seen: 5,276 times

Last updated: Mar 01 '15