How to control Table of Contents?

I added the screenshot to the main description of the problem. I get the same reilt. I still need tpo know how I can control the width of the TOC.

This leads to nowhere unless you attach a long awaited sample file for detailed technical analysis.

I showed a screenshot that shows I am setting the column width to 1, not 2. But i agree, the program behaves as if it were 2. But when I set it to 2, the width gets still narrower. I see now that precise the screenshhot that shows that the columns are set to 1 has disappeaded. I try to attach it again.

As far as I am concerned, I HAVE done everything you ask; I simply do not know what to do else, or different. The things still is that I need to control the width of the TOC, and there is more somewhere to that than determining the width of the columns, which does not work. There is MORE than controls that width, and I am asking WHAT?

I perfectly understand your request to control the TOC. Something is presently wrong. But you should realise that you don’t send a picture of you to an MD to diagnose an illness. You go personally to his office.

This is the same here. I need to access to the internals of your document, i.e. to the effective formatting, to be able to identify the defect. No offense here but you’re a newbie with Writer. You may come from M$ Word (or other suite) where things are done differently. I suspect something called direct formatting which is a first-thought-of manner of driving a document processor because it feels obvious and this plagues the document structure with hard to remove directives which override your later formatting actions.

I can do no more with screenshots, however detailed they are. Attach a faulty sample file or you’ll be doomed to find the cause of the mishap by yourself.

I do not know what “direct formatting” is, so I left it alone… I have no experience with WORD on this matter. I uploaded the beginning of a translation that uses the same styles. The translated text is copied/pasted into the existing text, so the styles are not affected. I will add my comments to the original question, as I made some interesting discoveries that might be helpful… My comments to that effect are not showing.

The default settings for TOC are pretty good. You need to fiddle with the settings only if this default is too far from what you want. But as a start, you should at least get the default TOC.

Creating a TOC is a two-step process: marking the text and inserting the TOC.

##Marking step

You must tell Writer which paragraphs will end up in the TOC. You do this with styles in the Heading n family, where n=1 for the first level (usually chapter), 2 for sub-chapter, up to level 10 (I never saw any paper nequiring such a deep numbering but this is better than artificially limiting to, say, 5 levels).

Apply one of these styles to the heading paragraphs in your text.

Unless you made a typo, there is no headline x built-in paragraph style. If they are custom styles, you need to specifically configure them so that they are recognised by the TOC engine. Considering your question, I think this is yet beyond your skill.

##Inserting TOC

Put the cursor where you want the TOC and Insert>Table of Contents & Index>TOC, Index or Bibliography.

The dialog opens in the Type tab and Table of Contents should be preselected. Customise the Title if you want (it is preset at “Table of Contents”). Since the default settings make common sense, push OK.

You can come back to this dialog by right-clicking in the existing TOC and Edit Index.

The other tabs (you call them pages) in this dialog are meant for customising the TOC appearance:

  • Entries describe how the heading paragraph are “converted” in the TOC

    The Structure line is a template for the TOC entry. You can format it differently per level if you feel like it by selecting a level in the Level column. Clicking on the Help button explains the meaning of the cryptic E# and others. They are associated with a button under the Structure line.

    The Entry Text and Page No. button are disables because you can insert only once the heading (E) and the page number (#) in a TOC entry.

  • Stylesallows you to change the “styling” of TOC entries

    Entries defines the contents of the entries and Styles the appearance of entries through the use of a specific paragraph style.

  • Columnssets the number of column for the TOC

    It is quite unusual to typeset TOC in multi-column because the headings (entries) are relatively wide. It is more common to do it with indexes because the entry is frequently a word or short sequence of words followed by a page number.

  • Backgroundis where you change the background of the TOC

    You may see a light gray background after you’ve inserted your TOC. This is not a “real” background (it does not print) but a reminder that the TOC was automatically created by Writer and is not directly editable.

Try first to get a default TOC. If you need to customise it and don’t succeed, come back here to ask for further help.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer) or comment the relevant answer.

EDIT 2020-05-31

I just realised a document was attached! Too much screenshots tend to clutter the view and mask the details. Add to that that the document was captioned “image description”. Then, apologies if the document has been there for days.

Your document is full of direct formatting, i.e. formatting hand-made outside styles. You probably did something on your TOC: changing margins, styles or something else, but you did not “regenerate” your TOC.

The attached document contains 2 TOCs: the first one has the expected formatting while the second one shows the same asymmetric formatting as in the screenshots. I right-clicked on it and Update index. The TOC was reformatted correctly.

General remarks on your document:

  • Nearly all your document is paragraph-styled Default Style which means you formatted it manually (direct formatting). Be prepared for hard time when you come to proof-reading. You won’t control formatting from a single location and you can’t guarantee consistency across the book.

  • Some paragraphs are under Text Body style which is the normal style for the document discourse. They probably happened to be typed after some Heading n paragraphs because they cause an automatic switch to Text Body. But, again, they suffer direct formatting.

  • Vertical spacing is done with empty paragraphs instead of spacing included within style definition. If you use them to synchronise with page boundaries, any edit will ruin your alignment. Again, hard time when proofreading.

  • You chose to style your chapters with Heading 2 and subchapters with Heading 4. This is quite an unusual choice. The standard way is Heading 1 and Heading 2. If your choice was motivated by a disagreement with default formatting, remember you can always customise the built-in styles to fit your taste. This may also avoid some formatting “glitches” in the TOC.

  • Your chapters are manually numbered. What if you want to reorder them? You’ll have to manually hunt for the headings and change them all. The automated way uses Tools>Chapter Numbering to enable the feature and customise it to your need.

  • You copied your chapter heading into the header. But since there can be only one header per page style, you had to create one page style per chapter, only to be able to change the header title. This can be also automated using fields, but it would work better with a more conventional use of Heading n styles. A single page style for all chapters is enough then. And you can even improve the device by including the page break to the style in the Heading 1 style (or whatever you use for your chapter title.

  • When you copied the chapter heading for chapter 1 “Det overordnede mål”, you also copied its style Heading 2. When the TOC is built, the TOC collection engine notices this paragraph at start of chapter page 2 and adds it in the TOC. You then have a false duplication of chapters (one with the manual number, the other without) one page apart. Restyle the header with style Header and this will be fixed.

Golden rule:

Even if you have a short deadline, read the Writer guide and learn how to use styles, all styles (paragraph, character and page at least), from what I suspect your needs are based on the sample. You may estimate it a waste of time. This is not. What you spend reading is regained ten fold afterwards because you’ll be more effective and more efficient, needing only to concentrate on your task as an author.

I have some news. But the problem still exists. I am translating this book, and was working without the front page. I would send you the first few chapters of the translation instead of the whole 350 page book, and I discovered something that gives a hint to the problem: when I made the TOC on normal width default with (standard format), the TOC came out fine, well adjusted to the page width, as seen at first. I then inserted the style for the width I want and always used, did not change anything, but let the TOC develop on this, smaller, page, and I recreated the error! Although the columns were still set at 1, the TOC now came out disported, as if it were set to 2 columns. This indicated that the error is somewhat linked to the use of the built-in style “PaperBackIndex”. When I use the style "default, let the TOC develop, and THEN change the size of the page, the TOC follows nicely and gives me the result I want.

I attach the beginning of the translation.

Apologies, didn’t read fully your comment after discovering the attached file.

You are right, there is also a problem with page style PaperBackIndex. Open it for modification and go to the Columns tab. It is defined as a 2-column layout with 9 cm and 3 cm respectively. Revert to 1 column and the issue is fixed. Nevertheless, read my remarks in my edited answer.

ajlittoz ( May 31 '0) gave the solution: “You are right, there is also a problem with page style PaperBackIndex. Open it for modification and go to the Columns tab. It is defined as a 2-column layout with 9 cm and 3 cm respectively. Revert to 1 column and the issue is fixed.”

Yes, it was. Thanks for the help. I do not understand how to acknowledge this. The instructions make no sense to me.

If styles were logically described, so were easy to create and modify, this would not be such a problem, but the guide is CRAP for an un-insworn to read and understand.

I do not understand how to acknowledge this. The instructions make no sense to me.

@mowence: To acknowledge that the answer contributes to solve your issue, click the grey-filled circle with a tick mark to the left of the answer, below the number. The fill color will change to green.

To acknowledge that the answer provides useful info towards the issue, click the ^ (up arrowhead) above the number to “upvote”. The number will increase. (If at any time you find that an answer is counterproductive or given with bad intentions, it is also possible to downvote.)

And also don’t click twice. It may take some time before the mark turns green. Even if you don’t see the change, it is scheduled to happen. Clicking twice cancels the acknowledge (as you did).

The answer is now old enough that I can acknowledge on asker’s behalf, which I did based on the given verbal confirmation from @mowence. Nothing more to do :-).