You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I create a title for a table of content and keep the text on the same line?

I want the first word or words of a paragraph to be the title that appears in the table of contents. However, when I select that text and pick a header style it automatically puts the remainder of the paragraph on the next line. How can this be avoided? I want to be able to use different styles in one paragraph.

Posted on Apr 10, 2020 4:35 AM

Reply
3 replies

Apr 12, 2020 3:18 AM in response to matthijs80

Hi matthijs80,


When all else fails, cheat. Tested in Pages 8.1 This may not work if later versions of Pages are smarter than we are.


Copy the first word or words of a paragraph and paste above the opening paragraph. Press return to make that an individual paragraph.


Change the paragraph style of each paragraph that you want to appear in the Table of Contents to Heading


Format Panel > Text to reduce the Font size to suit your layout (I used 5 pt)


Now set the font colour of those paragraphs to white (or whatever background you have) and Menu > View Hide Invisibles


Those altered Heading paragraphs will still appear in the Table of Contents:


Happy Paging!

Ian.

Apr 10, 2020 11:36 AM in response to matthijs80

"I want to be able to use different styles in one paragraph."


A "Paragraph style", as implied by the name, applied to a paragraph.


A Header is a particular type of 'paragraph,'


The end of a paragraph is determined by a 'paragraph break', contained in the 'return' character entered at that point. The return also forces the text following it down one or more lines, depending on the 'space after paragraph' setting.


I don't know it it's possible to set a zero or negative value for the 'space after' the Heading style paragraph you use for chapter headings, but you could try setting a 0 or negative value for space after for that style.


A second possibility, also not tested, would be to apply the header style (as it is now), then select everything after the part you want in the TOC and set the character style of the selection to match the font and weight in the body paragraphs. While this might work to make the body of the text fit your desired appearance, I suspect it would not produce a satisfactory TOC result.


Regards,

Barry

How do I create a title for a table of content and keep the text on the same line?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.