11 Replies Latest reply on Oct 29, 2012 2:02 AM by [Jongware]

    Can I use "no break" as a nested style?

    Cheryl Graham Level 2

      I have a long paragraph that's nothing but people's names, separated by commas. I don't want any of the names to break, so I've created a Character Style called "No Break" and I can select a name and apply it to that name. But I'd rather not go through the entire paragraph and select every name, then apply the style. So I am trying to figure out how to use a Nested Style. I have selected my No Break Character style through one "," (comma), and then I'm trying to use a Repeat Nested Style, but when I do that, the entire paragraph gets overset.

       

      What am I missing? Is there a better way to achieve this?

        • 1. Re: Can I use "no break" as a nested style?
          [Jongware] Most Valuable Participant

          It's an interesting trick. I'm not using Nested styles to do the same, I use a GREP style, but the priciple is the same I guess.

           

          What I do is set the *entire* paragraph to No Break, as part of the Paragraph style. Then I create a Character style called "No No Break" (for obvious reasons; it has *not* "No Break" selected) and apply it to comma-space using a GREP style. I think you can use a Nested Style the same way, but if not, consider using the GREP style.

          • 2. Re: Can I use "no break" as a nested style?
            Cheryl Graham Level 2

            OK, I got that to work with a Nested Style. It seems backwards to do it that way, but it worked!

            • 3. Re: Can I use "no break" as a nested style?
              peter minneapolis Level 4

              If you temporarily include a character color in the no break character style while you're building the nested style, and have Preview checked, you'll probably quickly see the problem, and figure out the answer. But, here's what works for me (from Blatner Tools' Paragraph Style Report from dtptools.com):

               

              Nested Styles          [[None] up to 1 Characters], [nobreak up to 1 , ], [[None] through 1  ], repeat last 2 styles


              NOTE: None style up to 1 Characters, then nobreak style up to 1 comma, then None style through 1 space character, then repeat last 2 styles.

               

              This works whether the paragraph ends with a period or not, whether the text ends in a paragraph return or is the last line of the story.

               

               

              HTH

               

               

              Regards,

               

               

              Peter

              _______________________

              Peter Gold

              KnowHow ProServices

               

               

              Cheryl Graham wrote:

               

              I have a long paragraph that's nothing but people's names, separated by commas. I don't want any of the names to break, so I've created a Character Style called "No Break" and I can select a name and apply it to that name. But I'd rather not go through the entire paragraph and select every name, then apply the style. So I am trying to figure out how to use a Nested Style. I have selected my No Break Character style through one "," (comma), and then I'm trying to use a Repeat Nested Style, but when I do that, the entire paragraph gets overset.

               

              What am I missing? Is there a better way to achieve this?

              1 person found this helpful
              • 4. Re: Can I use "no break" as a nested style?
                Peter Spier Most Valuable Participant (Moderator)

                I prefer to use a different method. Instead of applying No Break, which is hard to detect, turn off hyphenation in the paragraph style and use a non-breaking space between parts of the name.

                 

                Find (?<!,) <there's a space entered there after the close parenthesis>

                Change to ~S

                 

                This finds all spaces not preceded by a comma and changes them to non-breaking.

                1 person found this helpful
                • 5. Re: Can I use "no break" as a nested style?
                  Peter Spier Most Valuable Participant (Moderator)

                  You could adapt this to be a GREP style by creating a No Break character style and applying it using that query, too, I think.

                  • 6. Re: Can I use "no break" as a nested style?
                    Cheryl Graham Level 2

                    Wow, Peter(s) - thanks so much. I'm going to try all of these suggestions.

                    • 7. Re: Can I use "no break" as a nested style?
                      Cheryl Graham Level 2

                      This finds all spaces not preceded by a comma and changes them to non-breaking.

                      I just realized somethihng - What about names such as W. H. Auden, or other three-named people?

                      • 8. Re: Can I use "no break" as a nested style?
                        Peter Spier Most Valuable Participant (Moderator)

                        As I said, it finds all spaces not preceded by a comma. That includes sapces preceded bu other punctuation or some alphanumeric character. Essentially, this forces the breaks to happen only after a comma, so you have to be sure your culumn is wide enough to hold the longest name.

                        • 9. Re: Can I use "no break" as a nested style?
                          Cheryl Graham Level 2

                          Peter Spier wrote:

                           

                          As I said, it finds all spaces not preceded by a comma. That includes sapces preceded bu other punctuation or some alphanumeric character. Essentially, this forces the breaks to happen only after a comma, so you have to be sure your culumn is wide enough to hold the longest name.

                          Of course. I need to take a break

                          • 10. Re: Can I use "no break" as a nested style?
                            peter minneapolis Level 4

                            Sometimes I wake up to seeing that I've focused attention on solving dependencies rather than prime causes. Looking back, I think it could have been interesting to ask how the name list is created, and if it's exported from a programmable application, perhaps a non-breaking space character could be inserted where needed, so InDesign wouldn't need to do anything special. IOW, consider change the input if you want different output. One effect of GREP or nested paragraph styles is the computation effort in addition to the composition engine's processing of other required composition properties. In large documents, there could be an overall ID performance hit. Just a thought.

                             

                            HTH

                             

                             

                            Regards,

                             

                             

                            Peter

                            _______________________

                            Peter Gold

                            KnowHow ProServices

                             

                            Cheryl Graham wrote:

                             

                            Peter Spier wrote:

                             

                            As I said, it finds all spaces not preceded by a comma. That includes sapces preceded bu other punctuation or some alphanumeric character. Essentially, this forces the breaks to happen only after a comma, so you have to be sure your culumn is wide enough to hold the longest name.

                            Of course. I need to take a break

                            • 11. Re: Can I use "no break" as a nested style?
                              [Jongware] Most Valuable Participant

                              You can test if Peter's suggestion works for you by selecting the entire paragraph and using GREP to replace the space with a hard space. Search for

                               

                              (?<!,)\u{20}

                               

                              and replace with

                               

                              ~s

                               

                              (Instead of "\u{20}" you can also type a single space, but it wouldn't show up in this post :-P)