• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Create a toc with on one line the text of 2 styles

Explorer ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

In the book I have a style for "Chapter" (for the chapter number) and a style for the "chapter title" (for the title).

I have 2 different style because they come on 2 lines and with different style.

How can I get in the TOC Chapter the content of "chapter" followed on the same line by the contenbt of "chpter title" and the page number.

In fact, I woulmd need a paragraph style with no line feed carriage return at the end.

ex :

in the book :

 Chapter 12

 This is the title of this chapter

and in the TOC:

Chapter 12 Thjis is the title of this chapter ...... 25

Thank for any suggestion

 

Alain Elshocht

(PI removed by moderator. Do not add URLs/websites/email address to your signature or your account will be banned])
TOPICS
Feature request , How to

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 6 Correct answers

Community Expert , Dec 27, 2021 Dec 27, 2021

The really, really simple method is to generate the TOC and then apply a style to "Chapter 1" in each line. I have a number of books where the TOC needs just one or two tweaks after each update and it's not worth finding a completely automated solution.

 

A more advanced method would be to use the GREP style attached to the TOC1 (or whichever) paragraph style. You should be able to define "Chapter nn" as the target and apply a character style automatically.

 

However, I don't think you can combine t

...

Votes

Translate

Translate
Community Expert , Dec 27, 2021 Dec 27, 2021

We do this type of construct very frequently and have a free online tutorial for our students and clients at https://www.pubcom.com/tutorials/toc-2/  It shows how to format both the Section Headings and the TOC entries.

 

Benefits: easy one-click formatting of the section headings. Suitable for reuse in future layouts, templates, and database publishing. And it creates an accessible PDF, if you need that for your project.

 

  1. For the chapter INDD file, we make the entire text one paragraph in one
...

Votes

Translate

Translate
Guide , Dec 28, 2021 Dec 28, 2021

You could use only your "Chapter Title" for the TOC,

and set the TOC paragraph style with numbered list (for example Chapter ^#)

Votes

Translate

Translate
Guide , Dec 28, 2021 Dec 28, 2021

Schermata 2021-12-28 alle 09.14.37.png

Votes

Translate

Translate
Community Expert , Dec 28, 2021 Dec 28, 2021

I would have thought "Chapter nn" should be a Numbering style. (Bullets and Numbering). The easy part is doing this in the TOC, the difficult is the headers, which have to start with a Forced Line Break for them to start right indented under the numbering, but these days Forced Line Break can be ignored in the TOC (Would be nice if that could be an option in the numbering style but ^n doesn't work there)

Votes

Translate

Translate
Community Expert , Dec 29, 2021 Dec 29, 2021

@Lukas Engqvist  and @vladan saveljic both suggested using the numbered heading method, which can be very helpful when making long technical documents with many chapters.

 

I created a new demonstration of this method (TOC-3) at www.PubCom.com/tutorials/toc-3

 

Note for those making accessible PDFs:
Ensure that the paragraph style's Export Tags are set to <H2> or another heading level. Numbered headings usually are NOT numbered lists.

 

Votes

Translate

Translate
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Which Adobe App or Service are you asking about?

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

oops sorry, I'm using InDesign

 

Alain Elshocht

(PI removed by moderator. Do not add URLs/websites/email address to your signature or your account will be banned])

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

[Moderator moved from Using the Community (forums) to InDesign.]

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

 

InDesign 2021

Alain Elshocht

(PI removed by moderator. Do not add URLs/websites/email address to your signature or your account will be banned])

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

The really, really simple method is to generate the TOC and then apply a style to "Chapter 1" in each line. I have a number of books where the TOC needs just one or two tweaks after each update and it's not worth finding a completely automated solution.

 

A more advanced method would be to use the GREP style attached to the TOC1 (or whichever) paragraph style. You should be able to define "Chapter nn" as the target and apply a character style automatically.

 

However, I don't think you can combine two paragraphs/styles in one TOC line. That would be another job for GREP or a script, to combine two entries into one for each line. It might be worth re-thinking your chapter heading layout if a simple numbering of the TOC lines isn't enough.


╟ Word & InDesign to Kindle & EPUB: a Guide to Pro Results (Amazon) ╢

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Of course, I just needed to ask the question to find a solution

I Have "Chapter # This is the chapter Title"

I put the text in two boxes, a small one for "Chapter" and a larger for "This is the Chapter Title" with a style for each box.

I then create the TOC which comes with text attributes from the boxes.
I then use  the script "ClearStyleOverrides.jsx"

Done .... 🙂

I needed to have a 90% automatic way because the documnet will be translated into 27 languages using tools ...

 

Thank for the time spent to answer my question

 

Alain Elshocht

(PI removed by moderator. Do not add URLs/websites/email address to your signature or your account will be banned])

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

One way to do this is to create a non-printing "tag" frame to hold the text you will use in the TOC and give it a unique style name that you can include instead of using the two styles you have defined for chapter heads and titles, so for example, this tag would say "Chapter 12 This is the title of the chapter" (without the quotation marks). I usually do these tags in a big red character style so I can find them easily. In the TOC itself you can use any paragraph style you like and include nested or GREP styles to format parts of the listing differently.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Another solution could be: 1 style for chapter in the toc, but make a baseline shift to the next line and and another style for the next level with an inset of the space the text for chapter 1 would need.

 

Another solution would be, to make chapter and text part of the same paragraph, use inline style and nested style to get the difference and supress the forced return in the toc creation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

We do this type of construct very frequently and have a free online tutorial for our students and clients at https://www.pubcom.com/tutorials/toc-2/  It shows how to format both the Section Headings and the TOC entries.

 

Benefits: easy one-click formatting of the section headings. Suitable for reuse in future layouts, templates, and database publishing. And it creates an accessible PDF, if you need that for your project.

 

  1. For the chapter INDD file, we make the entire text one paragraph in one text frame, but we add a shift+enter after Chapter 1 (space) to force a line break to the next line.
     
  2. One paragraph style formats the entire paragraph of text but uses a nested character style to format the "Chapter 1" in a different font and have it apply to the text up through the first forced line break.
     
  3. Then, when building the TOC style, check the option to remove manual line breaks.  The TOC will now pick up the entire paragraph as one unit along with its corresponding page number.

 

Hope this helps!

 

 

|    Bevi Chagnon   |  Designer & Technologist for Accessible Documents
|    Classes & Books for Accessible InDesign, PDFs & MS Office |

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

This is a good solution if you are using a forced line return between two lines; but (unless I've misunderstood) it doesn't help if you are using actual "breaking" returns. I have a chapter number and chapter head (both text) that are currently on two lines. For the TOC, I want to combine them on one line, separated by a colon, and followed by the page #. Any ideas how to do this when using real returns vs. forced line returns?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

There isn't a simple solution, but the two basic options are:

 

1) Don't pull the chapter number paragraph, only the chapter title. And then in TOC styles, assign it auto-numbering.

 

2) Pull both styles and use zero leading on one to make them stack onto the same line; use indent spacing on the title to make it set inwards from the chapter number. (I can never remember which style to set to zero leading; I think it's the chapter name.)

 


╟ Word & InDesign to Kindle & EPUB: a Guide to Pro Results (Amazon) ╢

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

Thanks for this. I read something similar in the earlier bits of the thread, but this is much clearer, short and to the point. These two methods might work well in various instances. I'll give them a try. 🙂  I'm particularly curious about using the one that assigns auto-numbering. Appreciated!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

You could use only your "Chapter Title" for the TOC,

and set the TOC paragraph style with numbered list (for example Chapter ^#)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

LATEST

Thanks for adding this info to the thread. I didn't see it the first time around, and someone else answered me with similar information. I just wanted you to know I did finally see your post, too, and will be trying this. 🙂

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

Schermata 2021-12-28 alle 09.15.01.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

Schermata 2021-12-28 alle 09.14.37.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

I would have thought "Chapter nn" should be a Numbering style. (Bullets and Numbering). The easy part is doing this in the TOC, the difficult is the headers, which have to start with a Forced Line Break for them to start right indented under the numbering, but these days Forced Line Break can be ignored in the TOC (Would be nice if that could be an option in the numbering style but ^n doesn't work there)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

@Lukas Engqvist  and @vladan saveljic both suggested using the numbered heading method, which can be very helpful when making long technical documents with many chapters.

 

I created a new demonstration of this method (TOC-3) at www.PubCom.com/tutorials/toc-3

 

Note for those making accessible PDFs:
Ensure that the paragraph style's Export Tags are set to <H2> or another heading level. Numbered headings usually are NOT numbered lists.

 

|    Bevi Chagnon   |  Designer & Technologist for Accessible Documents
|    Classes & Books for Accessible InDesign, PDFs & MS Office |

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines