27 Replies Latest reply on Mar 2, 2012 4:25 PM by Mary Posner

    Trouble with nested styles. Please help



      I'm working on redesigning a schedule listing of 50+ pages that I put together twice a year that needs to be completed by next week to be printed. I originally inherited an archaic file where you have to go through and individually bold certain text (and so on) through character styles. So I'm trying to create nested styles but I'm wondering if what I'm trying to do just isn't possible. Perhaps what I'd like to do is more complex than your normal nested style? I understand how to do nested styles and everytime I'm trying to set this up, it's giving me trouble.


      I hope I can explain what I want vs what is happening to me well enough for someone to understand.


      This is what I would like my file to appear like:



      I can't seem to add the "accounting" header section into the nested style. This appears as several headers under different names throughout my document (ie. Astronomy, Biology, Sociology) So for now, I've manually made it look the way I want it to be while trying to set up the nested styles.


      Also, the sub listings that appear as (P) or (C) I can't get get to unbold when I apply the nested style.



      I've tried several things and the only way I can get it close to what I want ends up looking like this (but the sub listings like (P) are bolded and I want them unbolded like the body copy.


      When I created the paragraph style I started with the body copy:



      Currently I only have 1 nested style that appears like this (because this is the best I can do to get as close to the look I want):



      So my question is, how do I get the header "Accounting" into the nested style to apply to all headers the same way and how do I get the (P) listings to appear as body copy. I've tried several things and I just can't get it to work.


      Any help would be greatly appreciated.


        • 1. Re: Trouble with nested styles. Please help
          Peter Spier Most Valuable Participant (Moderator)

          Show us this again, please, but with non-printing characters showing.


          It's not at all clear if this is a table, or tabbed text, and how many actual paragraphs are there. My instinct is the headers should be their own paragrahs and that there is no need for nested styles at all.

          • 2. Re: Trouble with nested styles. Please help
            the_small Level 1

            Hi Peter!


            Thank you for replying so quickly. Here are the hidden characters. If it turns out I don't need nested styles, then what would be a quicker and easier way to apply the different styles to the entire document other than going through and clicking each section by character styles?acc5.jpg

            • 3. Re: Trouble with nested styles. Please help
              Peter Spier Most Valuable Participant (Moderator)

              No character or nested styles needed here at all, just properly set-up paragraph styles. You'll need three styles, one for the main headings, which will use Paper colored text and a dark blue paragraph rule set to the appropriate weight and offset to make the blue bar (unless that bar is a separate object, which it does not need to be), one for the sub-headings, and oen for the tabulated text. All of the formatting can be set in the text options in the paragraph styles.


              A futher comment, though... there are  excess tab characters here, and some extra empty paragraphs. There is no point in having a tab with nothing following it at the end of a paragraph. I was going to say that the leading tabs are unnecessary, as well, but I see that some lines actually hava an entry that is flush left, so in this case they should stay. If that were not the case, a left indent built in the paragraph style would be better. To eliminate the blank paragraph after the heading, use Space After instead.

              • 4. Re: Trouble with nested styles. Please help
                the_small Level 1

                Ok thanks! It looks like because I have character styles that I set up to base on the nested styles, that messed up trying to create paragraph styles. I just tried deleting those character styles but it's still not working right. I then created a new document just for the heck of it and that seems to work with creating a paragraph style for the header but I can't do that with this project because there are 18 pages before this course listing section that I can't delete.


                And then how would the paragraph styles apply to where they need to go throughout the document without not selecting everything within the document?


                The tabs came from someone who gave me the copy. They have everything tabbed in an Excel document then hand it over to me.


                UPDATE: So I tried creating 3 new paragraph styles and applying them by "next style" and it just rotates through all 3 styles per each line instead of how I want it to. I don't understand how to make this work correctly but I know there has to be a way that I can just apply the styles without having to go through each section.

                • 5. Re: Trouble with nested styles. Please help
                  Peter Spier Most Valuable Participant (Moderator)

                  Because you don't always have the same number of paragraphs of each style you can't use a "next style" rotation. You can, though, select a large block of text at a time to which only one style needs to be applied, or if the heading will always be followed by the sub head, and that always followed by the tabular data, and only the last will have more than one paragraph, you can set the next styles for the first two, but leave the tabualr data set to same style, then selct from one heading to the last paragraph before the next one, right-click the heading style name, and choose Apply <stylename> and next style.


                  Unless you have some isolated text within one of these paragraphs that needs to have a different format from its paragraph style, you should select all the text and set the character style to [None].

                  • 6. Re: Trouble with nested styles. Please help
                    the_small Level 1

                    That makes sense. The heading will always be followed by a subhead and the subhead is always followed by the tabular data with a few exceptions along the way, however. Meaning, sometimes after a subhead there is a description that would be the body text of around 2-5 lines of body copy.If I take this route of the first 2 paragraph styles being set up as next styles, will it mess things up once I get to those road blocks along the way? Below is what I will run into sometimes (unless this wont be a problem):




                    I've tried setting it up the way you've suggested but when I try to apply, it will only apply one paragraph style to the entire selection and the header doesn't seem to rotate into the sub head/sub head into tabular text. I must be doing something wrong.


                    • 7. Re: Trouble with nested styles. Please help
                      Peter Spier Most Valuable Participant (Moderator)

                      Next style only comes into play when you are typing and hit Enter, or when selecting multiple paragraphs and right clicking a stylename and applying t5hat style and next style as outlined above, so an interveing paragrah style, though inconvenient, would not be a fatal condition for you.


                      If you are not able to select a range of paragraphs and apply a next style concurrently, either you are not doing it correctly, the next style is not defined correctly, or the syle is being applied, bu there is still an applied character style ath is masking it.

                      • 8. Re: Trouble with nested styles. Please help
                        the_small Level 1

                        Ohhh... I forgot to right click to apply "schedule head" to next style.


                        Now I've done that and I feel like I'm almost there but the first example is what it did for one instance. For some reason it didn't apply the sub head. Then I did the same thing to the next instance and it applied the sub head to the sub head and the tabular text.


                        ex. 1





                        • 9. Re: Trouble with nested styles. Please help
                          Peter Spier Most Valuable Participant (Moderator)

                          Are there empty paragraphs between the head and subhead still?


                          Is there a hard return, not a forced line break, between the subhead and the tabular data in the second example? Is the tabular style set as next style for the suhead style?


                          This only works when everything is set up properly. Extra empty paragraphs or line breaks where there should be paragraph breaks are deal-breakers.

                          • 10. Re: Trouble with nested styles. Please help
                            the_small Level 1

                            Hmmm...I'm beginning to worry that this just isn't clean copy and I've already told the person who gave me the copy how to hand it over to me once before. It's better now than it was before. It used to be handed to me in a word document in tables she set up. Now it's in Excel and probably still not how I want it to be.


                            Is there any way I can clean up the copy if this is what's giving me trouble within InDesign? Maybe Find/Change text? This has always been a frustrating project to begin with but since I was redesigning it, I was hoping it would be easier.


                            Here's the hidden characters on those 2 screen shots:




                            • 11. Re: Trouble with nested styles. Please help
                              Peter Spier Most Valuable Participant (Moderator)

                              The empty paragraph after the main headings is still there. You can remove extra paragraph breaks with Find/Change. There's a pre-built query for it called Multiple Return to Single Return in the dropdown list.


                              The second part of the probelm looks like you dont have the tabulated data style set ans the next next style for the subhead style, and you may not have the subhead style set as next for the main heading style.

                              • 12. Re: Trouble with nested styles. Please help
                                the_small Level 1

                                Ok I did the Find/Change on the returns and there were 231 instances.


                                I think I have the styles set but maybe I've done something wrong there too? I really do appreciate your help, it means a lot to me.


                                I've taken screen prints of the styles for you to see if I've done something wrong with them.





                                • 13. Re: Trouble with nested styles. Please help
                                  Peter Spier Most Valuable Participant (Moderator)

                                  That looks OK to me, are they working now?

                                  • 14. Re: Trouble with nested styles. Please help
                                    the_small Level 1

                                    No, it keeps applying like below. It seems to apply the header then bolded sub head for 2 rows and then just body text from there on. So I'm not sure if I'd have to apply this to each "header section" listing?


                                    When I look at the hidden characters, there's so many that aren't needed. UGH this is frustrating! lol


                                    • 15. Re: Trouble with nested styles. Please help
                                      the_small Level 1

                                      Just for reference, I'm showing you a longer screen print of a section to see how the paragraph styles apply when I selected all of this text.


                                      I selected the text, right clicked on "schedule head" in the paragraph styles and said "apply schedule head, then next style"




                                      same shot with all the hidden characters. (I can tell right now we don't need all those tabs in the header bar...)


                                      • 16. Re: Trouble with nested styles. Please help
                                        Peter Spier Most Valuable Participant (Moderator)

                                        OK, I was looking only at the "next style progression, and I'm thinking there may be some problems in the actual defintions that need to get straightened out. Can you send me a sample page? It would be much easier if I can see the actual style definition dialogs here, rather than make you post a dozen screen shots. I'll send you a private message with directions.


                                        In the meantime,  you can only apply the "style plus next style" up the the next subhead, then you would need to select that subhead and it's following text. That said, there may be some alternatives using find/change. If all the paragraphs to which your third style needs to be applied start with a tab, we can search for that leading tab and apply a paragraph style to any text that shows it. A page with representative text manually styled any way you can to make it look like the finished effect would let me see how many styles you really need. Projects like this need very careful analysis and setup top go quickly.

                                        • 17. Re: Trouble with nested styles. Please help
                                          Mary Posner Level 3

                                          Oof. Wouldn't it be easier to let Find/Change handle the styling for you? I'd style the first few lines with the three styles you're using and cut-and-paste the whole text into a new document, bringing just those three styles with it. It's just the most secure way to make sure you aren't messing up something elsewhere in the document. You might want to revert back to your original text, if that has the line breaks in the correct place. I see in your most recent sample, the return at the end of the course name has been replaced by a tab, and I think that's gonna give you grief.


                                          Highlight everything and apply your subhead (schedule bold) style. Don't worry if it looks wrong, we sort that out next.


                                          Using Find/Change, set the Find field to "RU0" and leave the Change To field blank. Under Change Format, select your schedule body style and change all. You'll want to run that again using "Note:" in the Find field.


                                          The main heads may (or may not) be a bit more challenging. In your original text, are these typed in all caps? Or is it a style with the all caps attribute applied? If it's the former, you can use GREP to look for a specific number of uppercase letters in a row and apply the schedule head style to it. I'd take a scan through your document and see where else you have strings of uppercase letters that you wouldn't want to change to the head format (such as in the days-the-class-meets column) - just look for the longest one that you don't want included.


                                          Again using Find/Change, but this time on the GREP tab, in Find what type "\u{6}" (if you want to find a string of six uppercase letters), leave the Change field blank, and set Change Format to your schedule head style.


                                          The above may not get every single line - you may have some that we're not seeing that don't fit these patterns, or if you have course names with a lot of really short words in them, the above GREP won't find them. but I think this will get you most of the way there.


                                          Give it a shot, see if it works for you.



                                          • 18. Re: Trouble with nested styles. Please help
                                            the_small Level 1

                                            Hi Mary! Thanks for your help as well. I've tried what you said above. Whenever I do find/change with the subheads (schedule bold) through each section I tried typing in the beginning of the sub head (AC*, AN*, AS*) it works sometimes but still bolds some of the RU0 tabbed copy. I also couldn't say "change all" because sometimes these (AC*, AN*, AS*) also appear in the body copy and can't be bolded.


                                            As far as the GREP tab, I did try that and it seemed to work in some spots but sometimes these headers are 2 words (i.e. Business Administration) but perhaps its like you said and it will only get me so far.

                                            • 19. Re: Trouble with nested styles. Please help
                                              Mary Posner Level 3

                                              You're not doing what I suggested. Don't use Find/Change to apply your subhead. Apply the subhead to EVERYTHING before you start. Then change the lines that contain RU0 or Note: to your body style.


                                              I don't see a problem with the GREP - as long as the raw, unstyled text for BUSINESS ADMINISTRATION is typed in the document just like that, in all caps, it will find it and apply the schedule head style. It only needs to find six consecutive caps, which there are here - in this case, it'll find a first group of six in BUSINESS, and also find a second and a third set of six in ADMINISTRATION, but if it applies the correct paragraph style three times on the same paragraph, there's no difference in the end result.


                                              If it *isn't* typed in all caps, you might need to look for a different solution.


                                              Can you post your file somewhere so's I can see what you're working with? Preferably with the raw text as you get it from your source.

                                              • 20. Re: Trouble with nested styles. Please help
                                                Peter Spier Most Valuable Participant (Moderator)

                                                Mary, and small, I've been looking at this for about an hour with the actual files. To say the least, its an absolute mess. The Excell file is not set up well for this AT ALL.


                                                All of that said, I can get about three quarters of the way there using Find/Change. this is going to look a little funky becasue I'm using <pre> tags to try to keep jive from screwing up the GREP...


                                                First, I formatted everything with the body style (the one that is used for the tabbed data).


                                                Next do a GREP search for ^\u\u+\s$  which finds all the main headings which consist of nothing but all caps and some trailing white space. Leave the change field blank and sett the Change formatting to the heading style.


                                                The subheads need to be dealt with in two steps because the first line also contains data that belongs in the tabbed data section. It looks to me as if ^(\u\u+\*\d+.+?)(\t.+) will find these lines, so you can replace with $1\r$2 and clear the formatting


                                                Now that these are divided you can look for ^\u\u+\*\d+ and leave the change field blank, but set the change formatting to the subhead style.


                                                In the PM you sent me you mentioned another formatting change, which I really didn't understand, and I'm not sure how to accomplish it, or waht it needs to apply to.

                                                • 21. Re: Trouble with nested styles. Please help
                                                  the_small Level 1

                                                  Finally figured it out! Thanks Peter for your help. I tried it your way and Mary came up with another way.


                                                  I truly appreciate all of your help and time on this. You have no idea how much this means to me. Thank you again! Your wonderful!


                                                  Now I can enjoy the weekend!

                                                  • 22. Re: Trouble with nested styles. Please help
                                                    Mary Posner Level 3

                                                    Peter and I did very similar things, only in a slightly different order and with slightly different Find statements. Also, there's a small error in Peter's first GREP search which causes it to fail. The "\s$" at the end should be "\s+$" -- there's more than one tab there, looking for only one white space followed by the end of the paragraph won't be found in the sample text. (Small shoutout here to Jongware for his What the GREP script - I didn't remember what the "$" did in the Find field, but WTG spelled it out for me.)


                                                    Here's what I did:


                                                    STEP 1:

                                                    Find/Change using the Text tab

                                                    Find: ^tRU01

                                                    Change to: %%%^p^tRU01

                                                    Change all


                                                    RESULT: The course name should be on its own line, now tagged with %%% at the end (we'll use this later); the next line should start (tab)RU01.


                                                    STEP 2: 

                                                    Select EVERYTHING, apply the schedule body paragraph style.


                                                    STEP 3:

                                                    Find/Change - GREP tab

                                                    Find: \u{6}

                                                    Change to: blank

                                                    Change Format: schedule head

                                                    Change all


                                                    RESULT: Finds any string of six consecutive uppercase letters and applies the schedule head paragraph style. Subject matter heads all have white type reversed out against a blue bar. Peter's code to look for caps followed by white spaces, with the above-mentioned fix, would also work here.


                                                    STEP 4:

                                                    Find/Change - GREP tab

                                                    Find: (.+)(%%%)

                                                    Change to: $1

                                                    Change Format: schedule bold

                                                    Change all


                                                    RESULT: Finds all the class title lines that we tagged earlier with %%%, applies the schedule bold paragraph style and removes the %%%.


                                                    This doesn't do the entire job - there's too much inconsistency in where the (P), (C) and (CoReq) items appear to effectively manipulate them using GREP, so the_small still has some manual work to do, but the above should apply the correct styles to all or almost all of the text she's working with.

                                                    • 23. Re: Trouble with nested styles. Please help
                                                      Peter Spier Most Valuable Participant (Moderator)

                                                      Thanks for spotting that transcription error in my first GREP statement...


                                                      A far as the lines with (P), (C), (CoReq) and sor forth, I had the benefit of having the sample file, which you did not, and saw that these paragraphs also carried the body text style, essentially freeing us from having to deal with them. That's one of the reasons I started by applying that style to everything first.

                                                      • 24. Re: Trouble with nested styles. Please help
                                                        Mary Posner Level 3

                                                        Yeah, I did. I PM'd the_small. <g> It's too hard to try to come up with a solution if you don't have the raw text to work with.


                                                        What I meant was that this will take care of all the styling, including the (P) etc stuff, just as yours did. The end results are identical. She's still going to have some manual cutting-and-pasting to do to get some items onto the correct lines, since the (P) line (when there is one) needs to tuck under the class title, before the (tab)RU01. Or maybe it's a (C) or maybe it's a (CoReq) and maybe it's in the next line right after RU01, and maybe it's five or six lines down. Like I said, not consistent enough of a pattern to effectively GREP it, although there are enough instances where it is a (P) and is on the next line that one could construct a GREP to manipulate those and leave the rest for manual intervention.


                                                        Like you said, though, the Excel document is really not set up well to make this an easy transition into InDesign.

                                                        • 25. Re: Trouble with nested styles. Please help
                                                          Peter Spier Most Valuable Participant (Moderator)



                                                          More than one way to skin a cat. I did spand some time trying to comoe up with a comprehensive GREP query to find those paragraphs with the parentheticals, but as you said, there was just enough inconsistency in terms of whether they had tabs or didn't have them, or any number of other little things, that I gave up. I guess you figured out what the extra indent Renee wanted was all about, which wasn't at all clear to me.


                                                          All in all, I think getting the degree of formatting done with find/change that both of us were able to achieve was a near miracle.

                                                          • 26. Re: Trouble with nested styles. Please help
                                                            Peter Spier Most Valuable Participant (Moderator)

                                                            And if I were starting from scratch, I think I'd do a lot of work onthe Excel file first, moving things to the left and onto new lines, merging cells, and the like. Of cpourse I have no idea how long the whole excel file really was, but I'd rather start with fairly clean data than go through all the head scratching trying to come up with ways to the formatting with GREP.

                                                            • 27. Re: Trouble with nested styles. Please help
                                                              Mary Posner Level 3

                                                              Actually, I don't know anything about an extra indent in this discussion. You mentioned something about another requirement further up this thread, but I don't know what it was.