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

add chapter numbers to TOC entries

Engaged ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

Hi. Preparing a book for a client. I have used separate chapter number (appendix number) and chapter title styles. This is so that I can have the number and title paragraphs styled separately. However, when I run the TOC, I get this:

 

toc_as_is.png

 

But I would like to have this (aside from the squished page numbers, which I know how to fix):

 

toc_as_wanted.png

I have tried putting the chapter number style in the TOC spec with chapter name set as "run-in" but that doesn't seem to do the trick. Here is my current set up:

 

toc_main_setup.png

Numbered paragraphs are set to Full Paragraph. For what it's worth, here is the numbering specification for chapter number:

 

toc_chapter_number.pngOf course, I can add Chapter X and Appendix X manually... but I would really like to find some way of adding them automatically. In worst-case, I could go back and make all the chapter titles into numbered paragraphs... but since the numbered chapter numbers are not showing up, I'm not even sure that would work.

 

Advice? Thanks.

 

-Jeff 

 

TOPICS
How to

Views

278

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 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

I might be missing the point you already made, but you use the ToC generator to gather strings of text based on style, but then you also have to apply another ToC style to the text it gathers. Two styles are involved. Don't just leave it to style the text with the same style. Make a ToC style that applies the numbering to the original chapter style.

Mike Witherell

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 ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

Hi. Thanks much for your reply. Yup -- I'm aware of the two-style issue (one in the chapter and a corresponding one one in the TOC only) and that is not the point.  I've done many TOCs... but never had to include a chapter number before, so I have never encountered the problem.

 

For whatever reason, the content of the auto-numbered paragraph ChapNum located in the chapter (which says, essentially Chapter <num> and nothing else -- not even the chapter name) does not show up in the TOC. Evidently, this is an ongoing problem and has several mentions in the support pages (I saw the complaints after I posted). A section number CAN show up... but not an autonumbered chapter number. I'm sure people in the support group know better and can correct me (please!)... but <shame> I was in a hurry.

 

I solved the problem left-handed by creating TOC styles that auto-number the TOC title heads and -- wonder of wonders -- those numbers correspond to the Chapter numbers in the chapters. (They're not connected; it's simply a one-to-one correspondence.) I found this solution in a blog post out on the net. I should not have to do this, because it requires a little handwork to change from chapter to appendix. There is no good reason that I can think of that autonumbered section number paragraphs can appear in a TOC, but autonumbered chapter numbers paragraphs cannot. And yet... they don't. They simply do not appear, even when I put ChapNum into the TOC styles specification that reads the paragraph content from the book files.

 

There also seems to be a work-around where the entire chapter is assigned a section number, and then that is used in the TOC (because... section numbers), but the work-around seemed extremely complicated and was not well explained, while the solution that I found in the blog -- autonumbering the TOC styles themselves -- is simple and direct.

 

Again, thank you for taking the time to read and aswer. If anyone has a different -- or better -- answer to getting the autonumbered chapter number and the title of the chapter into the TOC, I'd still love to hear it because my solution is kind of a kludge.

 

-j

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 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

LATEST

You actually did the actual method--auto-numbering the TOC chapter styles.

 

It does mean that you typically need extra styles in your TOC that correspond with the document, but that would happen even in FrameMaker which can pick up the style numbering from the chapters.

For example, in the book:

  • The front matter titles would not have a chapter number. They might be named something like this: ChapTitle_NoNum
  • The regular chapters would have a chapter number. Example name: ChapTitle
  • The back matter may or may not have numbering.
    • If it doesn't, use the same styles as the front matter
    • If it does, create a custom styles. For example, ChapTitle_ Appendix

In the TOC Style, you would match the chapter styles to the appropriate TOC styles:

  • ChapTitle_NoNum would go to TOC_ChapTitleNoNum
  • ChapTitle would go to TOC_ChapTitle--this TOC style would have auto-number applied to it.
  • The back matter would depend on numbering
    • Again, if no numbering, use same TOC_ChapNoNum style
    • If unique number, for example: Appendix A, create a TOC style with that numbering and assign it

 

PS: Being left handed, I'm not sure how to take "solved the problem left-handed". 😁

David Creamer: Community Expert (ACI and ACE 1995-2023)

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 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

Hey Jeff:

 

The Run-In option isn't going to do what you want. It is used for multiple consecutive styles with same style assigned. For example, instead of:

TOC

Title        1

subhead  1

subhead  3

subhead  5

Title      11

 

you will get 

TOC

Title        1

subhead  1; subhead  3; subhead  5

Title      11

 

So it comes down to how you designed your chapter numbers and titles in the body of the document. If they need to be separate paragraphs for whatever reason, then they will come in to the TOC as separate paragraphs. Combining will be manual.

 

The two options from here are 1.) add auto-numbers to the TOC styles (you already figured that out and it would have been one of my suggestions) or 2.) edit the chapter numbers and titles in the body of the document so that they are one paragraph with a line break (and perhaps a character style to make the numbers look different—but that can become a different can of worms if you are not using a book file), and then remove the line break in the TOC (it's a checkbox so that it is automatic.)

 

Really, I think you are good to go.

 

~Barb 

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