TOC corrupted, includes text from chapter

My Table Of Contents shows the text from a chapter. It's as if the whole chapter text is interpreted as a Heading. This happens for just one chapter, all the other ones are okay. Repeated re-formatting doesn't help. Apparently there's something in there that makes the TOC think it belongs in there (TOC), which i can't make go away by normal means.

There _is_ a workaround: removing the whole text (not the title), and pasting it again from a simple text editor. But that makes me want to cry.

The file is a list of songs. The song title is on top of each song as a "Heading 1" style. The TOC is configured to use these. The normal text is styled "Default style". I am showing nonprinting characters, but that doesn't give me any clues.

I feel a bit stupid reporting this, as i haven't found a way of reproducing it yet. Sorry about that.

Kees

There _is_ a workaround: removing the whole text (not the title), and
pasting it again from a simple text editor. But that makes me want to cry.

Selecting text and hitting Ctrl + M (or going to Format → Clear direct
formatting) should have the same effect. Does it?

The file is a list of songs. The song title is on top of each song as a
"Heading 1" style. The TOC is configured to use these. The normal text
is styled "Default style". I am showing nonprinting characters, but that
doesn't give me any clues.

Go to one of lines included in TOC and open paragraph settings window (not
paragraph style settings!). Then in Outline & Numbering check what Outline
level is set. It should be "Body text".

Hi :) 
Hopefully Regina or someone are going to give an awesome elegant answer but my bodge-it methods might shake it loose.

1.  Can you start as though you are going to use the text-editor route but instead of pasting into a text-editor just re-paste back into the LibreOffice document?  However, when doing the re-pasting use
Shift Ctrl v
instead of just
Ctrl v
The use of the shift key gives you options such as "Paste as Unformatted text".  Does that work any better?

2.  If not then undo that and get back to the way it was before and then just select the text that is being picked up by the ToC and from the menus click on
Format - "Remove direct formatting"

3.  If that doesn't work then again select the area that is going wrong and use the styles to deliberately change it to something you blatantly don't want, such as "List style" and then change it back.

Regards from
Tom :slight_smile:

I had this problem when I migrated from 3.x to 4.0. IE. when I first started using LO.

I was also using "Heading n" and "Default Style". ISTR that the cut & paste method does not make any difference. I ended up retyping the little text which was affected.

It was at this point that I began to look more closely at styles. I began to use the OOoHeadings and OOotextbody settings we use for LO doco. I also had a look at the page style of each page as I was just blindly copying and pasting from other docs.

I know this doesn't really help and I haven't proved that my changes would have made any difference transitioning from 3.x to 4.0. It may be worth raising a bug report to see whether anyone bites :slight_smile:

Cheers

Hi :slight_smile:
I found a few documents that had originally been .docs were really painful to work with until i created a fresh new document and then used
Ctrl a
to select all in the old document and then "pasted as unformatted" in the new one and then apply styles.  I think i 'had' to do the same thing somewhere between 3.3.x branch and the 3.4.x but only for one or 2 weird documents.  That was around the time i first tried reading the "Getting Started with LibreOffice" chapter on styles. 
https://wiki.documentfoundation.org/Documentation/Publications
before reading that chapter i used to have to mess around with a lot of formatting and changing styles and retying but since reading it everything seems to work much more smoothly and easily.  It has saved me from hours of frustrations and fiddling.

Regards from
Tom :slight_smile:

"Mirosław Zalewski"

Selecting text and hitting Ctrl + M (or going to Format → Clear direct
formatting) should have the same effect.

Ctrl+M does not change outline level.

Helen's query reminded me of one I tried to post but at the time the list server decided my mail server was a spammer (the drawbacks to shared servers). Mine's a little more complex, though.

I belong to a radio theater group and often serve as director, which means I'm responsible for the scripts for those shows. There are some standard requirements for the script format, and I haven't been able to figure out how to make them happen automagically through formatting or styles. Would appreciate any help. Here is what I need:

1. Header on every page. No problem with that by itself, but see #2.

2. Every line numbered. Problem I've had here is (a) headers get the numbers, too, and (b) numbering needs to start over on each page.

3. Need a hanging indent, for spoken lines that don't fit on one physical line, but need a tab within the indent (between the line number and the text) so the character's name can be inserted. Don't remember the exact problem I've had with this, but it might not be one if item #2 can be resolved.

As I say, any help would be greatly appreciated!

Dave

Hi :slight_smile:
Templates?  Section breaks?

Getting Started Guide, Chapter 3
https://wiki.documentfoundation.org/Documentation/Publications

Who is betting that Brian and Regina have better answers?
Regards from
Tom :slight_smile:

I belong to a radio theater group and often serve as director, which means I'm responsible for the scripts for those shows. There are some standard requirements for the script format, and I haven't been able to figure out how to make them happen automagically through formatting or styles. Would appreciate any help. Here is what I need:

1. Header on every page. No problem with that by itself, but see #2.
2. Every line numbered. Problem I've had here is (a) headers get the numbers, too, ...

I'm puzzled. Are you using Insert | Header to create a real header? If so, I don't see that the header is included in line numbering.

... and (b) numbering needs to start over on each page.

o Go to Tools | Line Numbering... and tick "Show numbering".
o At the bottom, tick "Restart every new page".

3. Need a hanging indent, for spoken lines that don't fit on one physical line, but need a tab within the indent (between the line number and the text) so the character's name can be inserted.

o Go to right-click | Edit Paragraph Style... | Indents & Spacing | Indent.
o Set "Before text" to some suitable positive value.
o Set "First line" to the corresponding negative value.

For each speech, type the character name, press Tab, and then type the speech text. The Tab character will move the start of the text to the indented paragraph boundary.

I trust this helps.

Brian Barker

I belong to a radio theater group and often serve as director, which means I'm responsible for the scripts for those shows. There are some standard requirements for the script format, and I haven't been able to figure out how to make them happen automagically through formatting or styles. Would appreciate any help. Here is what I need:

1. Header on every page. No problem with that by itself, but see #2.
2. Every line numbered. Problem I've had here is (a) headers get the numbers, too, ...

I'm puzzled. Are you using Insert | Header to create a real header? If so, I don't see that the header is included in line numbering.

That was a few versions of LO ago, so it might have been a version-specific glitch. But yes, that's how I did it.

... and (b) numbering needs to start over on each page.

o Go to Tools | Line Numbering... and tick "Show numbering".
o At the bottom, tick "Restart every new page".

Thanks for this one. I'm so used to turning numbering on with the icon that I didn't even think to look for a menu item to give me more options (I don't recall seeing the toolbar in the past, either, which also has this option).

Separate question about formatting the numbers, though. I'm sure I'm missing something obvious, but I can't find anyplace to (a) eliminate the indent on the number, and (b) eliminate the period that follows. Best guess I have is that it's a combination of character and paragraph styles, but haven't found the magic combination, yet. All I want is a number flush with the left margin, no punctuation.

3. Need a hanging indent, for spoken lines that don't fit on one physical line, but need a tab within the indent (between the line number and the text) so the character's name can be inserted.

o Go to right-click | Edit Paragraph Style... | Indents & Spacing | Indent.
o Set "Before text" to some suitable positive value.
o Set "First line" to the corresponding negative value.

For each speech, type the character name, press Tab, and then type the speech text. The Tab character will move the start of the text to the indented paragraph boundary.

I overlooked the obvious here -- put a tab character in the indent section, so in theory that's where typing will begin after the auto-number is followed by a tab character. Just need to figure out the previous issue, now.

I trust this helps.

Everything helps -- we all need reminders now and then, and anything new is gravy!

Brian Barker

Dave

Disregard my comments about the number formatting. I just learned the difference between line numbering and outline numbering!

Dave