19 Replies Latest reply: Sep 18, 2009 12:27 PM by peter at knowhowpro RSS

    cross-references and list levels

    Graeme Forbes

      I write documents in which there are numbered series of examples. Sometimes there's only one example to a number, sometimes two or three, in which case letters are used to sub-classify. So I might have this:

       

      on page 1,

       

      (1) blah blah blah

       

      but a few pages later

       

      (2)     a. yada yada

                b. yada yada yada

       

      and so on. I have two questions.

       

      (A) What's the best way of setting up the paragraph styles for this? At the moment I'm thinking that I want a single list, Examples, and three para styles, one for paras like (1) above, one for (2a), and one for (2b) (where the "2" shouldn't appear on the line).

       

      (B) How do I get cross-references to work? I can do them easily enough for "(1)", but I'm not sure about "(2a)" or "(2b)" (in the x-ref, the "2" does appear with the "b"). To make things more interesting, the parens and the letter in the x-ref are to be in the regular para font, but the number will be an old-style figure.

       

      Any pointers gratefully received.

       

      Graeme Forbes

        • 1. Re: cross-references and list levels
          pkahrel MVP

          You won't be able to do the subnumbering you want for your example sentences in a straightforward way. This is easy:

           

          (1)   Axcvbx cb
                  a.  Ccxvb
                  b.  Dcvcvxb

           

          But this is a bit more complicated:

           

          (2)   a.  Ccxvb
                  b.  Dcvcvxb

           

          You need three numbered paragraph styles for this. One style deals with numbers, so you'd set this:

           

          (1)  Abcdef
          (2)

           

          The second style is for the subnumbers of level a. In the style you set the required left indent, set the number style, set "Start at" to 1, and set leading to 0. Setting the leading to zero will move the line up, so that

           

          (2)  
                  a.  Ccxvb

           

          Will be displayed as

           

          (2)   a.  Ccxvb

           

          What looks like one paragraph is therefore in fact two separate paragraphs stacked on each other.

           

          The third paragraph style is for subnumbers b. and following. It is based on the a-subnumbers; the only difference is that "Start at" should be set to "Contuinue from previous" and leading set back to whatever the leading normally is in the examples.

           

          It's fairly easy to set up. To use it, you can either set a paragraph style's "Next style", though I think that that works only when you're typing. Otherwise a script can quicly apply the styles.

           

          Cross-references to such paragraphs need some setting up, too. When you include both parentheses in the paragraph style's numbering, any cross-reference to that number will always have the parentheses tight against the number. References to subnumbers would therefore always have the subnumber outside the parens: (2)a -- you can't insert anything between the number and the closing parenthesis.

           

          To get around this, in the paragraph style's number format use just the opening parenthesis, so that your examples will look like this with just the styles applied:

           

          (1   Axcvnb
          (2   a.   Bzxg
                b.

           

          Cross-references to those numbers now look like (1 and (2. To create a cross-ref to a sub-number, you need to create two cross-references: one to the main number (2, the other to the sub-number. Finally, add the closing parens to the example numbers and the cross-references manually. A script could sort that out quickly.

           

          At this stage you might wonder if it's worth the trouble... (A detailed description of numbered paragraph styles and x-refs is at http://blogs.adobe.com/indesigndocs/2009/04/)

           

          Peter

          • 2. Re: cross-references and list levels
            pkahrel MVP

            > References to subnumbers would therefore always have the subnumber outside the parens: (2)a -- you can't insert anything between the number and the closing parenthesis

             

            I just noticed that that's not true. When you include the closing parens in the paragraph style's number format, which would create cross-references of the form (2), you can indeed insert text between "2" and ")" -- but not another cross-reference, unfortunately. So you need to create a cross-ref of the form (2)a and then swap ")" and "a".

             

            Peter

            • 3. Re: cross-references and list levels
              pkahrel MVP

              "Look before you leap." (Confusius)

               

              You have to include the ) in the paragraph style's number format because you can't enter it manually, so the form of the cross-reference is always (2)b. Now you can delete ")" and insert a ) after "b". But each cross-reference update will insert ")" after the number again, so after each update you need to move ")" and subnumber.

               

              Peter

              • 4. Re: cross-references and list levels
                Graeme Forbes Community Member

                Peter:

                 

                Thanks very much for taking the time to spell all that out. Some good news and some bad news, I guess.

                 

                I thought I might have to do the 0-leading thing. In FrameMaker, you can give a paragraph format (style) the "run-in heading" property, which means the next paragraph starts on the same line. Probably just implements some leading trick under the hood.

                 

                The x-refs sound like they're going to be a hassle. FrameMaker has a definite advantage here, since it's got an x-ref building block that means roughly "enter the autonum of the selected paragraph, prefixed by the autonum of the most recent paragraph of format (style) such-and-such". So you only need to enter one xref, and you don't have to fiddle with the result (you can pick up just the "2" of "(2)" then put the parens back in round the "2a" in the x-ref format).

                 

                I will check if it's possible to change the likes of "(2)a" to "(2a)" with a grep style (i'm new to id -- Mac FrameMaker refugee -- and am only just getting the hang of grep styles). If not, I may look into the DTP Tools xref plug-in, which I think makes ID x-refs more FM-like.

                 

                The list organization and "(2a)"-style x-ref is a very standard style in academic writing -- pity ID doesn't handle it better. However, I have occasionally seen things like "(2)a" -- wonder if the authors or printers were using ID? It was x-refs that made me give up on every Mac word-processor I'd tried (all of them, I think -- who can forget FullWrite Professional? -- except 4D Write) and switch to FM in 1992. And now, in 2009, it feels like I'm going backwards.

                 

                Thanks again,

                Graeme

                 

                PS: Thanks also for the Bringhurst link. I had I and II in the series but didn't know about III and IV

                • 5. Re: cross-references and list levels
                  Graeme Forbes Community Member

                  I've made a bit of progress. Peter's idea of inserting adjacent x-refs to get "(1)a)" and then deleting the intervening paren doesn't look like it will work, since as soon as you delete the paren the x-ref  becomes "unresolved" and presumably won't update correctly. At least that saves me the sweat of having to make up a grep style to delete the paren automatically.

                   

                  So it looks like I have to use the same trick as I used in Framemaker: the real paragraph number for the numbered paras is a simple numeral, it goes at the end of the paragraph, is in a tiny point size, and is set to Invisible (or whatever ID calls that -- "paper"? "white"?). The apparent autonumber is actually an x-ref to the real number, and the parens are added in the x-ref format. A different x-ref format will then allow me to insert "(1" elsewhere in the text, and a third format to append "a)" to "(1". It would be useful if ID allowed you to toggle a particular color between visible and invisible, since occasionally it's nice to see what your genuine, very small, paranums are doing.

                   

                  So it still takes two separate x-ref insertions to assemble "(1a)". Pain. ID needs FM's "<paranumonly>[paraformat name]" building block.

                   

                  Peter's 0-leading idea works, tho' it's fiddly, quite tricky when you click to make sure you're affecting the the paragraph you want to. FM's "run-in head" property would be useful. I guess I have 3 feature requests to make tomorrow.

                  • 6. Re: cross-references and list levels
                    pkahrel MVP

                    Graeme,

                     

                    >as soon as you delete the paren the x-ref  becomes "unresolved" and presumably won't update correctly

                     

                    No, they're updated correctly, but the parens are re-inserted by the update so you'd have to remove them again.

                     

                    >the real paragraph number for the numbered paras is a simple numeral, it goes at the end of the paragraph, is in a tiny point size, and is set to Invisible

                     

                    I thought of that, too, and it's probably a better way to go. To make you life a bit easier, use a character style for those dummy numbers and use "Paper" for colour (probably combined with tiny point size). When you use a character style and when at some stage you wonder which examples have xref targets and which not, then you simply change the character style to use black and all your dummy numbers become visible. The only drawback is that those dummy numbers are static, so that when you add or remove example sentences, the dummy numbers bear no relation any longer with the real numbers. But that's always a problem, Frame and Latex have that, too.

                     

                    Use character styles for the xrefs, too. It then becomes easy to find these and to format them using a script.

                     

                    Because of all this hassle I gave up on using xrefs long ago and returned to static numbers.

                     

                    Peter

                    • 7. Re: cross-references and list levels
                      Graeme Forbes Community Member

                      >>as soon as you delete the paren the x-ref  becomes "unresolved" and presumably won't update correctly

                       

                      >No, they're updated correctly, but the parens are re-inserted by the update so you'd have to remove them again.

                       

                      Mea culpa, I should have checked this rather than just "presuming". Ok, so grep styles are back in the picture.

                       

                      >I thought of that, too, and it's probably a better way to go. To make you life a bit easier, use a character style for those dummy numbers and use "Paper" for colour (probably combined with tiny point size). When you use a character style and when at some stage you wonder which examples have xref targets and which not, then you simply change the character style to use black and all your dummy numbers become visible.

                       

                      Right, in FM I always used a char format called "Invisible Autonum" for just this purpose, forgot about that.

                       

                      >The only drawback is that those dummy numbers are static, so that when you add or remove example sentences, the dummy numbers bear no relation any longer with the real numbers. But that's always a problem, Frame and Latex have that, too.

                       

                      I hope I'm misunderstanding this. I don't see why the dummy numbers, i.e., the *real* autonumbers at the end of the paragraph, wouldn't update properly if I add or delete items to the Examples list. Right now the paragraphs with only the numerical autonum, the ones beginning (n), where (n) is the x-ref to the real autonum, are level 1 items of the Examples list, and paras with the "a" "b" "c" autonums are level 2, with reset to "a" triggered by the occurrence of a new level 1 para. I *think* this is the best way to organize it, but am open to correction.

                       

                      >Because of all this hassle I gave up on using xrefs long ago and returned to static numbers.

                       

                      I had a routine where if I added a new example in the middle of a document I'd search forward from that point for all occurrences of "(n)", where n was the length of the list before adding the new item, and change them to "(n+1)", then search for "(n-1)" and change to "(n)" and so on. Or if I was deleting an example, subtracting 1. This happened with some frequency and drove me up the wall. So FrameMaker's autonumbering was a godsend, even in its FM3 incarnation. Made it worth living with the non-breaking footnotes. It's starting to look like the only price I pay in loss of autonumbering power switching to ID is having to do 2 x-ref insertions to get "(1a)" out of "(1" and "a)". But in compensation I get footnotes that break across pages properly. Unless there's a hidden gotcha I still have to encounter.

                      • 8. Re: cross-references and list levels
                        peter at knowhowpro Community Member

                        IIRC, DTP Tools' cross-reference plug-in for ID can do the FM-like "look before the x-ref for the last instance of a different style" behavior. dtptools.com

                         

                        HTH

                         

                        Regards,

                         

                        Peter Gold

                        KnowHow ProServices

                        • 9. Re: cross-references and list levels
                          Graeme Forbes Community Member

                          Thanks, I emailed them about this but the guy who responded wasn't 

                          sure -- he asked for a sample, which I've sent.

                           

                          Best,

                          Graeme

                          • 10. Re: cross-references and list levels
                            pkahrel MVP

                            > I hope I'm misunderstanding this. I don't see why the dummy numbers, i.e., the *real* autonumbers at the end of the paragraph, wouldn't update properly

                             

                            There's only one place for the automatic paragraph number, and that's the beginning of the paragraph. Unfortunately, you can't have a setup where you get the number at the beginning and a copy of the number at the end of it. So that's the end of that idea.

                             

                            Please keep us informed on what you find about the DTP Tools.

                             

                            Peter

                            • 11. Re: cross-references and list levels
                              Graeme Forbes Community Member

                              >There's only one place for the automatic paragraph number, and that's the beginning of the paragraph. Unfortunately, you can't have a setup where you get the number at the beginning and a copy of the number at the end of it.

                               

                              Blast! I was assuming that the position options you get in "Bullets and Numbering" in Style Options meant far left or far right -- should have realized that "Center" makes no sense on this reading.

                               

                              So it seems the only proposal that survives is Peter's original one -- go with "(1)a)" and delete the middle paren. I'll  see what grep style I can conjure up for that.

                               

                              >Please keep us informed on what you find about the DTP Tools.

                               

                              I haven't heard back yet, tho' Peter Gold tells me he thinks they have a building block that would allow insertion of "(1)a" with one click, like FM's <variable>[paraformat]. That would still be worthwhile.

                              • 12. Re: cross-references and list levels
                                pkahrel MVP

                                GREP styles can be used to apply character styles to text you find using GREP expressions -- you can't change anything in the text you find (like deleting or inserting text) so that's no good for you. But what you can do is a simple GREP find/replace. Assuming you set the xref format to use a character style called "xref", do as follows to sort out cross-references of the form (2)a:

                                 

                                Find what: \)(\l)

                                Change to: $1)

                                 

                                And set the xref character style in the Find Format pane. Then do "Replace All" and store the contents of the Find/Change dialog as a query on disk. The GREP expressions say "Find ) followed by a lower-case letter and when both have char. style "xref", swap them."

                                 

                                Peter

                                • 13. Re: cross-references and list levels
                                  Graeme Forbes Community Member

                                  This was getting depressing, but, tara!, I got the following in an email from DTP Tools about their Cross-Reference Pro plug-in:

                                   

                                  >To get 1a use the following definition: <paranum numberonly="true"/><paranum includetrailingpunct="false"/>

                                   

                                  Just from this one example, it looks like the plug-in has the power to do everything  I want, so I'll be buying.

                                   

                                  Maybe my x-reffing needs are so recondite that it wouldn't be appropriate to ask that the main app have such a capacity. But I still think I'll ask for run-in headings,  since they're useful for many other things besides what I want them for.

                                   

                                  Thanks to Peter and Peter for all their help here.

                                  • 14. Re: cross-references and list levels
                                    Graeme Forbes Community Member

                                    I've come up with a solution that works within ID without need for plug-ins. If I simply autonumber the numerical paragraphs "(1", "(2" etc., instead of "(1)", (2)", etc., I can simply type the right paren and the m-dash or tab, and similarly if I autonumber the sublist entries "a", "b", I can type the period and the tab (instead of having them part of the autonumber format). Then to get "(1a)" I xref to the paranum "(1" and then follow immediately another xref to the para numbered "a" using an xref format that adds the right paren.

                                     

                                    The good news is that this gets rid of the intermediate paren that was messing things up in earlier suggestions.

                                     

                                    The bad news is that it still requires two uses of "insert cross-reference".

                                     

                                    So if the DTP Tools plug-in had a FrameMaker-like "<$paranum[paraformat name]>" building block that picks up the number of the paragraph with format paraformat name that occurs most recently before the currently selected paragraph, it would still be worth it. But at the moment things don't look too hopeful on that front. Will update after more experimentation.

                                    • 15. Re: cross-references and list levels
                                      Graeme Forbes Community Member

                                      So  finally I got an authoritative answer from DTP Tools, Their Cross References Pro plug-in does indeed have a FrameMaker-style "look back to the previous paragraph of style such-and-such" building block. It's "<paranum precedingpstyle="stylename" numberonly="true"/>". It's a pity they don't have  --- or at least I couldn't find -- an exhaustive list of their building-blocks anywhere on their website, or I'd have arrived at a solution a lot faster. Anyway, even tho' I could get the xrefs I want just using ID CS4's capacities, as I described in the previous post on this thread, the method's a bit ofa kludge and you need use "insert xref" twice to build, e.g., "(2c)" from "(2" and "c)". The plug-in is much better, and should also smooth conversion of old FM docs to ID, when I eventually get around to that.

                                      • 16. Re: cross-references and list levels
                                        peter at knowhowpro Community Member

                                        Graeme Forbes wrote:

                                         

                                        So  finally I got an authoritative answer from DTP Tools, Their Cross References Pro plug-in does indeed have a FrameMaker-style "look back to the previous paragraph of style such-and-such" building block. It's "<paranum precedingpstyle="stylename" numberonly="true"/>". It's a pity they don't have  --- or at least I couldn't find -- an exhaustive list of their building-blocks anywhere on their website, or I'd have arrived at a solution a lot faster. Anyway, even tho' I could get the xrefs I want just using ID CS4's capacities, as I described in the previous post on this thread, the method's a bit ofa kludge and you need use "insert xref" twice to build, e.g., "(2c)" from "(2" and "c)". The plug-in is much better, and should also smooth conversion of old FM docs to ID, when I eventually get around to that.

                                        Hi, Graeme:

                                         

                                        The precedingstyle building block is noted on page 17 of the Cross-References User Guide that's downloadable from this page:

                                         

                                        http://www.dtptools.com/product.asp?id=crin

                                         

                                        It's the last link at the bottom of the page.

                                         

                                        HTH

                                         

                                        Regards,

                                         

                                         

                                        Peter

                                        ______________________

                                        Peter Gold

                                        KnowHow ProServices

                                        • 17. Re: cross-references and list levels
                                          Graeme Forbes Community Member

                                          Well, there it is. I would *swear* I read that page! Thanks, Peter. They still need a complete listing, tho'. Or did I miss that too?

                                          • 18. Re: cross-references and list levels
                                            Graeme Forbes Community Member

                                            Thanks, Peter. Thought I'd read that page.

                                             

                                            Graeme

                                            • 19. Re: cross-references and list levels
                                              peter at knowhowpro Community Member

                                              Graeme Forbes wrote:

                                               

                                              Thanks, Peter. Thought I'd read that page.

                                               

                                              Graeme

                                              I suggested making a list to dtptools folks.


                                              Regards,

                                              Peter Gold
                                              KnowHow ProServices