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
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
...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.
You could use only your "Chapter Title" for the TOC,
and set the TOC paragraph style with numbered list (for example Chapter ^#)
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)
@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.
Copy link to clipboard
Copied
Which Adobe App or Service are you asking about?
Copy link to clipboard
Copied
oops sorry, I'm using InDesign
Copy link to clipboard
Copied
[Moderator moved from Using the Community (forums) to InDesign.]
Copy link to clipboard
Copied
InDesign 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.
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
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.
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.
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.
Hope this helps!
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?
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.)
—
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!
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 ^#)
Copy link to clipboard
Copied
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. 🙂
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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)
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.