12 Replies Latest reply on May 30, 2014 3:53 AM by Peter Spier

    Question: adding prefixes to TOC chapter entries?

    Lukas_101 Level 1

      Hello I wonder if someone can help me figure out how to format Table of Contents entries to include a prefix.

       

      I would like each of the chapter entries in my TOC to include prefixes of the words Chapter 1, Chapter 2 ... etc.

       

      For example. Just say my first chapter is called 'Aseptic Technique'.

      Currently the chapter title 'Aseptic Technique' is formatted with a unique paragraph style called 'Chapter Title', and that paragraph style is included in the 'Styles in Table of Contents'.

       

      So at the moment my TOC simply shows the words 'Aseptic Technique' followed by the page number.

       

      I want the TOC entry to say: 'Chapter 1 Aseptic Technique'

       

      But I dont want the words 'Chapter 1' to be shown on the actual chapter title page.

       

      Also, I want to be able to add unique styling to the prefixes (I suppose with character styles). So that I can make the 'Chapter 1' styled slightly differently to 'Aseptic Technique', while both appear on the same line.

       

      Is it possible to do this? I know that I can simply click on the table of contents and make the changes directly, buts thats not ideal because if I click 'update Table of Contents' then all the edits are lost. I want the prefixes to be added dynamically so that they stay in place even if chapter titles are edited in future.

       

      Thanks for any help.

        • 1. Re: Question: adding prefixes to TOC chapter entries?
          Migintosh Level 4

          I have a way to do it, but it's kind of a lot of work for a small payoff. All the work happens once, and you can generate your TOC as many times as you want and it will work each time, so it may be worth it (or not…it's up to you). It also depends on a few if-then things that might not work for what you're doing, and it's not foolproof, so just keep that in mind. Also, someone will probably give you a way better answer than this, so there's that.

           

          First, if all of your chapters start at the beginning of a page, this will work. If a chapter starts in the middle of a page, and if your chapter head is in the middle of a text frame (with the end of the previous chapter showing in the same frame), you will have to make an adjustment. Anyway, here goes:

           

          1. Make a section start on each page where you have a new chapter (don't restart the page numbering).
          2. In the Section Marker: field, type Chapter 1 (there will be a section start for each chapter, so Chapter 2, Chapter 3, etc.).
          3. Make a new text frame on the page with the chapter head.
          4. Go to Window>Output>Attributes and check the Nonprinting box. This will keep the chapter prefix from printing or showing up on your PDF if you export.
          5. Insert the nonprinting text frame into your story just before the chapter head. If the new chapter begins in a new text frame that is not part of a story that continues from the previous chapter, click the out port of the nonprinting frame and then click into the frame that begins your chapter. If your chapters all run through one story, insert the nonprinting frame between the previous and current chapters (let's say chapters 4 & 5). Click the outport of the end of chapter 4 and then on the nonprinting frame. Then connect the nonprinting frame to the first frame of chapter 5.
          6. The chapter head should now be in the nonprinting frame. Place the cursor before the first character of the chapter head and go to Type>Insert Special Character>Markers>Section Marker. This will add what ever you typed into the field in step 2 to the beginning of your chapter head.
          7. With the cursor between the section marker and the start of the chapter head, go to Type>Insert Special Character>Other>End Nested Style Here, and then add a space.
          8. Now, make the size of the nonprinting frame small so that the chapter head jumps out of the nonprinting frame to the first frame of the chapter. If you turn on your hidden characters, the space should still be in the nonprinting frame.

           

          That's the setup. Now you need to make a character style for the treatment you would like in the actual TOC for the words Chapter 1 (etc.). Make a paragraph style for the TOC that has a nested style that begins with the character style up to the first End Nested Style Here character, and your TOC should look the way you want.

           

          P.S. if you want to start the new chapter in the middle of a story in the middle of a page, you would have to break the story into a new frame. It can continue through one story, but in order to put the nonprinting frame into the story, the new chapter has to be at the beginning of a frame, so this isn't for everyone.

           

          A different way to do step 8 is to replace the space with a line break, but then you would have to do a find/change each time your TOC is generated and replace the line break with nothing. The advantage to this is that if you change your styles and it forces the story to shift, the section marker won't jump onto the printing frame, or vise versa. The downside is that you have to run the find/change each time, so it's a toss up.

          • 2. Re: Question: adding prefixes to TOC chapter entries?
            Willi Adelberger Most Valuable Participant

            You can specify the paragraph styles, you use in your TOC, as numbered list, and it will add this item automatically.

            • 3. Re: Question: adding prefixes to TOC chapter entries?
              Lukas_101 Level 1

              Migintosh Thanks so much for that write up. I need to sit down and work through your guide and see if I can make it function in the way I want. I think your work around should be applicable to my case, because I have my chapter titles in their own frames at the beginning of each chapter document, rather than midway through a document...

               

              I had actually investigated section headers and also nested styles.. but I had not been able to get them working. I hadn't discovered the 'non-printing box' feature though.. So I will look at that.

               

              @Willi Adelberger. Are you saying that it is possible to create a customized list that would have the prefixes (Chapter 1, Chapter 2.. etc..) rather than numbers or bullet points? I dont see the controls for creating anything like that inside the paragraph style editing window?

              • 4. Re: Question: adding prefixes to TOC chapter entries?
                Willi Adelberger Most Valuable Participant

                Of course, I don't see any problem:

                TOC-List.png

                • 5. Re: Question: adding prefixes to TOC chapter entries?
                  Lukas_101 Level 1

                  @Willi Adelberger Wow thats exactly what I was after. Thank you so much. I didn't realize it was possible to customize lists in that way. That method allowed me to apply separate styles the prefix and chapter title portions of the TOC entries, exactly like I needed to. And the prefixes update automatically to reflect the appropriate chapter number.

                   

                  Thanks Willi.

                   

                  Migintosh Thanks also for your help. Your method was actually similar to where I had ended up myself... but in the end, the bullet method proposed by Willi is much easier.

                  • 6. Re: Question: adding prefixes to TOC chapter entries?
                    Lukas_101 Level 1

                    @Willi Adelberger using your method I currently have my TOC prefixes styled as follows:

                     

                    Numbering Style -> Number:  Chapter ^#^>^B^>

                     

                    Where the prefix 'Chapter # B' are formatted with a unique character style. The remainder of the TOC entry (the chapter title) is formatted with the settings specified in the paragraph style.

                     

                    Is there a way to specify the bullet displayed with this method? I would like to use a square shaped glyph from a different font as a bullet. Im wondering if I can somehow specify the exact glyph from a different font to go at the point ^B as shown above.

                     

                    Hope that makes sense? Thanks again.

                    • 7. Re: Question: adding prefixes to TOC chapter entries?
                      Willi Adelberger Most Valuable Participant

                      You have to use a bullet of the very same font and style and write it before the Chapter in the number field. Although it is possible to use a character style for the whole number, it is not possible to change the style or color inside the number section.

                      If you need a specific glyph there you might add one to the font with a font editing tool as far as it is allowed.

                      • 8. Re: Question: adding prefixes to TOC chapter entries?
                        Lukas_101 Level 1

                        "If you need a specific glyph there you might add one to the font with a font editing tool as far as it is allowed."

                         

                        Ok this sounds like it could work. But how is it possible to call the added glyph in the number field? e.g. at the moment if I use ^B it calls the default bullet character for the font specified in the character style. How can I call a different specific glyph in that font? Can I call a glyph into the number field by its 'unicode' or 'GID' or something like that?

                        • 9. Re: Question: adding prefixes to TOC chapter entries?
                          Migintosh Level 4

                          I have another clumsy workaround if you want to consider it. If there's a way to do it better, don't do it like this.

                           

                          If your font has the glyph you want to use as a bullet (whether it came that way or you used Willi's suggestion to edit the font with a font editor), you can swap out the bullet for the glyph if you convert the bullets and numbers to live text, but you may not want to do that. If you do, I'd do it as a last step before exporting to PDF, then don't save the ID file so that the saved version has the automatic bullets and numbers.

                           

                          When you have automatic bullets and numbers, only the live text is selectable, as you can see here:

                          Screen Shot 2014-05-30 at 12.42.51 AM.png

                          If I want to use the glyph to the left, I can place it into a text frame with the glyphs pallet, select it and copy it to the clip board. I copied the 12pt glyph. The larger one is just to show you what the glyph looks like. What you do next is select the text with the list applied and go to Type>Bullets & Numbered Lists>Convert Bullets and Numbering to Text. When you select all, it will all be selectable, like this:

                          Screen Shot 2014-05-30 at 12.43.02 AM.png

                          You then find the regular bullet (~8) and replace it with the contents of the clipboard with formatting (from the drop-down under Other, or ~c), and you get this:

                          Screen Shot 2014-05-30 at 12.43.20 AM.png

                          Not a great solution, but it works.

                          • 10. Re: Question: adding prefixes to TOC chapter entries?
                            Peter Spier Most Valuable Participant (Moderator)

                            Why not just paste the glyph into the dialog whee you want it? In the same way that you can type the word Chapter, you can paste a bullet glyph if it has a unique Unicode position in the font. If it's an "alternate" glyph that shares a value this most likely will not work.

                            • 11. Re: Question: adding prefixes to TOC chapter entries?
                              Migintosh Level 4

                              When I paste the glyph I used into the field, it pasted as ^B and showed on the page as a regular bullet. Do you know of a way to specify a unicode or GID in the field?

                              • 12. Re: Question: adding prefixes to TOC chapter entries?
                                Peter Spier Most Valuable Participant (Moderator)

                                Unfortunately, no. This is the case of the alternate glyph sharing the Unicode value. You run into the same problem in Find/Change.