25 Replies Latest reply on Sep 24, 2015 11:52 PM by Obi-wan Kenobi

    TOC Entries from First word of paragraphs

    Arddy Level 1

      Hi all. I'd appreciate your help in this matter.

       

      Currently my page format goes as -

       

      Heading

       

      1.     Subtitle. lorem ipsem asjdlffojsdlf asldfjlsjfklsf.

       

      These two have a paragraph style each, with the second one having automatically number each paragraph (hence the 1. + the indent).

       

      The Question - How do I get my TOC to show just the word "Subtitle" and not it's number and the rest of it's paragraph?

       

      Consider also - There are a few paragraphs that have the same style (to keep each paragraph numbered), but I don't want them to show on the TOC as they don't have a subtitle.

       

      Your help is very much appreciated. Thanks all.

        • 1. Re: TOC Entries from First word of paragraphs
          Peter Spier Most Valuable Participant (Moderator)

          I think you will need to show us some screen captures of the text where these headings appear, with non-printing characters visible, but by definition a paragraph has exactly one paragraph style applied, and the TOC module, while it can include the number or drop it for paragraphs that use a numbered list style, it always includes the entire text of the paragraph, and you cannot include some paragraphs, but not others, that use the same style.

          • 2. Re: TOC Entries from First word of paragraphs
            Arddy Level 1

            Thanks for replying. Apologies for not including screenshots earlier. Here are some screen shots featuring - desired results, current results, and the content/paragraphs I'm working with.

             

            Highlighted red are what I'd like to appear on TOC.Actual_Results.jpgparagraphs.jpgDesired_results.jpg

            • 3. Re: TOC Entries from First word of paragraphs
              Peter Spier Most Valuable Participant (Moderator)

              It's not entirely clear what's what there, and you haven't shown us the paragraph structure by making non-printing characters visible. That's vital information.

               

              If you always want just the first word of a longer paragraph to show in the TOC (remember, the TOC listing is going to include the entire paragraph), you could try defining a paragraph style to apply to the listing itself that uses a nested character style to make everything after the first word very small and apply a color of None, thus rendering it invisible, and hopefully reducing the physical size on the page enough that there would not be any extra "empty" line space full of invisible text between listings.

              • 4. Re: TOC Entries from First word of paragraphs
                Arddy Level 1

                Thanks again for replying.

                 

                Completely slipped my mind about showing the hidden characters. Sorry. Is this what you mean?

                paragaph.jpg

                 

                 

                Are there any other alternative methods?

                • 5. Re: TOC Entries from First word of paragraphs
                  Peter Spier Most Valuable Participant (Moderator)

                  That's what I mean. Those empty paragraphs are going to cause you trouble down the road. Use space before or space after to make space between paragraphs. It should be part of the style definition.

                   

                  It will depend on how the first word is isolated (and if you really are ALWAYS limiting the listing to one word), as far as how to make the TOC. There is no alternative I can think of using the built-in TOC feature, but I believe there is at least one script that can build a sort of TOC using cross-references and applied character styles. I don't think that works if the formatting is applied by Nested Style or GREP Style.

                  • 6. Re: TOC Entries from First word of paragraphs
                    Obi-wan Kenobi Adobe Community Professional

                    Hi Peter,

                     

                    I've not read all ( All my apologizes if I'm wrong!  ;-) ), but a simple grep style could seem to play the game as here [done quickly!]:

                     

                    Capture d’écran 2015-09-23 à 14.41.34.png

                    Capture d’écran 2015-09-23 à 14.41.48.png

                    • 7. Re: TOC Entries from First word of paragraphs
                      Obi-wan Kenobi Adobe Community Professional

                      … You can play with a simple simple regex using a condition after the generation of the TOC including the total para text, too!  ;-)

                      [Interesting if the paras are very long!]

                      • 8. Re: TOC Entries from First word of paragraphs
                        Peter Spier Most Valuable Participant (Moderator)

                        Obi-wan, I think that's what I had in mind, but perhaps there's an even better method (I just thought of this): Conditional text. One could use either a Nested or GREP style to add a condition to the part of the text you want hidden, then hide the condition.

                        • 9. Re: TOC Entries from First word of paragraphs
                          Obi-wan Kenobi Adobe Community Professional

                          I think (since a long time) that create a perfect and final TOC after its generation is not the good way! But do it in One click after generation using a regex set and a tool as Multi-Find/Change is simple and quick to play.

                          Here, the TOC would be based on the paras including the "words" (applying the char style with a grep style). After generation, a simple regex that applies a condition to the text after the "words" until the end of the paragraph would be enough and easy to be defined. After that, as you said, just hide the condition!  ;-)

                          • 10. Re: TOC Entries from First word of paragraphs
                            Obi-wan Kenobi Adobe Community Professional

                            Peter,

                             

                            I did it very quickly but it seems to work with nested styles! 

                            Capture d’écran 2015-09-23 à 15.56.05.png

                            Capture d’écran 2015-09-23 à 15.56.17.png

                            Capture d’écran 2015-09-23 à 16.01.58.png

                            • 11. Re: TOC Entries from First word of paragraphs
                              Peter Spier Most Valuable Participant (Moderator)

                              Whether a nested style will work is going to depend on the consistency of the text and the ability to trigger it, but it would be preferable, in my opinion, to GREP if it can be used.

                              • 12. Re: TOC Entries from First word of paragraphs
                                Obi-wan Kenobi Adobe Community Professional

                                Easy with Grep!

                                Grep style for the current Text

                                Grep style for the TOC

                                The only thing to do: place a "non-joiner" before the dot at the beginning of the paras we want to include in the TOC (the NJ defines the words in "bold"), then make a simple research on the NJ to apply the good para style (here: "Normal")

                                Capture d’écran 2015-09-23 à 16.27.20.png

                                 

                                Capture d’écran 2015-09-23 à 16.34.40.png

                                 

                                Capture d’écran 2015-09-23 à 16.27.53.png

                                • 13. Re: TOC Entries from First word of paragraphs
                                  Arddy Level 1

                                  You guys are amazing! Thank you so much for the help. Sorry I couldn't get back sooner- our timezone here placed us in sleep times when you guys were helping me .

                                   

                                  I have never ever used Conditional text or GREP in inDesign. I will give this a try myself and see how I go I'll get back to you guys as soon as I can.

                                   

                                  Thank you both very much!

                                   

                                  P.S Awesome name Obi-Wan LOL.

                                  • 14. Re: TOC Entries from First word of paragraphs
                                    Arddy Level 1

                                    Alright, I am making tracks with GREP styles.

                                     

                                    I understand what ^.+~j means, and am loving the fact that for every numbered paragraph, if I wanted something to be a subtitle I'd just have to put a nonjoiner before the full stop. Working great on that aspect.

                                     

                                    However I am having troubles with understanding how I can have the dotted lines in the TOC if the paragraphs are still there.

                                    • 15. Re: TOC Entries from First word of paragraphs
                                      Arddy Level 1

                                      Ok I got it! All done. You guys are amazing. Thank you very very much!

                                      • 16. Re: TOC Entries from First word of paragraphs
                                        Obi-wan Kenobi Adobe Community Professional

                                        You're welcome!  ;-)

                                        It remains you now to learn [and love] Grep! …

                                        • 17. Re: TOC Entries from First word of paragraphs
                                          Peter Spier Most Valuable Participant (Moderator)

                                          GREP is a very powerful tool, but I think completely unnecessary in this case. If you are inserting a non-joiner or other special character before your first full stop you could use ordinary nested styles to do the same thing more efficiently.

                                           

                                          Apply None up to 1 full stop, apply your character style that adds the condition up to 1 <tab or right indent tab, whichever you are using as the number separator>, and another style to add a dotted underline through the separator, if you want to add the leader that way.

                                          • 18. Re: TOC Entries from First word of paragraphs
                                            Arddy Level 1

                                            Thanks very much. I will also look at that method. If the GREP style is overkill I need to know another method to make it simpler. Thank you very much.

                                             

                                            Just want to clarify, either way, the unwanted paragraphs in the TOC will end up being - super small font and tracking + white colour?

                                             

                                            Thanks.

                                            • 19. Re: TOC Entries from First word of paragraphs
                                              Peter Spier Most Valuable Participant (Moderator)

                                              No, actually. The use of conditional text is actually a better solution as it hides the text, not just mask it, so you could have a dozen lines and they would disappear completely when the condition is hidden.

                                               

                                              Ordinary nested styles, when they can do the job, take less processing than GREP, so work more efficiently.

                                              • 20. Re: TOC Entries from First word of paragraphs
                                                Arddy Level 1

                                                Peter Spier,

                                                 

                                                When you say conditional text, are you referring to GREP? Apologies, my terminology is not yet up to scratch.

                                                 

                                                I'm not really understanding the difference between hiding the text and masking it, and which method does which.

                                                 

                                                Sorry but would you mind explaining that part again?

                                                • 21. Re: TOC Entries from First word of paragraphs
                                                  Peter Spier Most Valuable Participant (Moderator)

                                                  Sorry, been on the road all day...

                                                   

                                                  Conditional text is text to which a Condition is applied (there's a conditional text panel you can show). When the condition is visible, the text is visible, when hidden, the text is hidden. Typical uses would be to show/hide prices for wholesale/retail or different currency price sheets, or answers to study questions in a teachers' edition of a text book. You define (create and name) a condition, then you can assign that condition to text you select in any way you choose to make the selection.

                                                   

                                                  One way to assign the condition is to make it part of a character style, and you can assign that style using GREP, or as I recommended above, a nested style. You use the Conditional Text panel to create the conditions and to show or hide them by clicking the eyeball next to them as you would show or hide an object in the Layers panel. You might want to look up the Help topic on Conditional Text.

                                                  • 22. Re: TOC Entries from First word of paragraphs
                                                    Arddy Level 1

                                                    Thanks Peter Spier! I just had a look at the conditional text and I think it's awesome! I can't however, figure out how to put this conditional text into a character style. One step away from achieving your intending results I think ahah

                                                    • 23. Re: TOC Entries from First word of paragraphs
                                                      Peter Spier Most Valuable Participant (Moderator)

                                                      Ah, you're right. You can't apply the condition directly as part of a character style, but you can still do it in several steps.

                                                       

                                                      First define the character style, and in this case all it needs for attributes is a unique name. Once defined, apply it to the text as a nested style or GREP style in your listing paragraph style after the text you want to keep up to the separator character before your page number. After the TOC has been generated you can use Find/Change to search for this character style and apply the condition, then finally hide the condition in the panel (the condition must be visible for Find/Change to apply it).

                                                      • 24. Re: TOC Entries from First word of paragraphs
                                                        Arddy Level 1

                                                        I got it!!!! Thank you!

                                                         

                                                         

                                                        Sorry Obi-Wan. I have learnt a whole lot from GREP styles from you that was very helpful.

                                                         

                                                        However in this situation, I'd much rather have it completely disappear (the unwanted text) than to 'mask' it out with a 'font.'

                                                         

                                                        You both are super awesome, I've learnt heaps. Wish InDesign would add Conditional Text to Character and Paragraph styles. I can see so many amazing uses for this.

                                                         

                                                         

                                                        Thanks again!

                                                         

                                                        -Roger

                                                        • 25. Re: TOC Entries from First word of paragraphs
                                                          Obi-wan Kenobi Adobe Community Professional

                                                          Don't be sorry!  It's a solution I proposed you in post# 7-9 at the beginning of our discussion! So, you have now 3 tips to play your game!