8 Replies Latest reply on Apr 26, 2012 11:55 AM by TᴀW

    Applying multiple paragraph styles

    Janus Bahs Jacquet Level 1

      I’ve been searching high and low for some kind of pointers on how to achieve this, but—much to my surprise—I can’t seem to find any mentions of it anywhere, even though it seems like such a basic, simple thing.

       

      I’m setting a book that has hundreds of block quotes in four different styles (regular quote, dialogue quote, verse quote, and verse quote with translation). These four types need to be laid out differently, so I have four different paragraph styles set up for them. Each block quote can contain one, two, or more paragraphs, and it can follow and be followed by text in (at least) two different styles of body text.

       

      To separate the block quotes from the rest of the text, I apply a 1 mm space before the first paragraph, and a 1.5 mm space after the last paragraph, regardless of which type of block quote the paragraph belongs to.

       

      I would really, really like to be able to this without having to go through each and every instance of block quote and manually add space-before and space-after overrides to the first and last paragraphs, ’cause that’s a major pain in a certain part of my anatomy.

       

      Ideally, I would create a “first” paragraph pseudo-style that defines *only* the space before and a “last” paragraph pseudo-style that defines *only* the space after, and then I’d simply apply these pseudo-styles on top of the paragraph styles already applied—a sort of CSS-like approach to style overrides. But that, unfortunately, isn’t possible in InDesign, since paragraph styles can’t be stacked (for whatever reason).

       

      Does anyone have a good way of doing this, other than manually? I find it very, very hard to believe that I should be the first to ever struggle with this issue—surely anyone who’s ever set an academic book must have experienced similar problems.

       

      (Scripting would be fine, though I’m almost a complete beginner at InDesign scripting.)

       

      Edit: Just found this thread on here, which looks at it from a slightly different angle, the suggestion being to add paragraphs around the quotes. This is doable, I suppose, but it is (in my eyes) a hack—and it would still mean going through hundreds of block quotes, adding extra paragraphs.

        • 1. Re: Applying multiple paragraph styles
          BobLevine MVP & Adobe Community Professional

          You’ll need different styles for that.

           

           

           

          Create a new first blockquote style based on the other one and just add the space before.

           

           

           

          And yes, this is so much easier in CSS by using something like h1+p

           

           

           

          Bob

          • 2. Re: Applying multiple paragraph styles
            Janus Bahs Jacquet Level 1

            That’s what I’ve been doing—there’s just one problem: in my case here, I end up with 16 different paragraph styles just for quotes. That’s horribly messy.

            • 3. Re: Applying multiple paragraph styles
              peter minneapolis Level 4

              jbjacquet wrote:

               

              That’s what I’ve been doing—there’s just one problem: in my case here, I end up with 16 different paragraph styles just for quotes. That’s horribly messy.

              If specific paragraph styles always precede and follow the quote paragraph styles, consider adding space after to the preceding and space before to the following style, if this doesn't upset how they're already used.

               

              I don't know CSS, so it's interesting to see how its ability could work here. Consider posting a formal paragraph style enhancement request here: Adobe - Feature Request/Bug Report Form.

               

               

              HTH

               

               

              Regards,

               

               

              Peter

              _______________________

              Peter Gold

              KnowHow ProServices

              • 4. Re: Applying multiple paragraph styles
                Janus Bahs Jacquet Level 1
                If specific paragraph styles always precede and follow the quote paragraph styles, consider adding space after to the preceding and space before to the following style, if this doesn't upset how they're already used.

                Unfortunately, the specific paragraph styles that always precede and follow the quoted sections are the regular body text styles, so that would upset a whole lot of things. :-(

                • 5. Re: Applying multiple paragraph styles
                  TᴀW Adobe Community Professional & MVP

                  Hi jbjacquet,

                   

                  I know exactly what you're talking about.

                   

                  At first, I wrote a script that changes paragraph styles based on what

                  comes before and what comes after, but that was still really fiddly to

                  get to work with the problem you're describing. (The script is available

                  on www.FreelanceBookDesign.com and is great for other things).

                   

                  So then I wrote a script that does exactly what you're looking for!

                   

                  Say you've got a para style called blockQuote, and another called

                  bulletList.

                   

                  Define both styles to have say 3mm above and 3mm space below.

                   

                  Run the script.

                   

                  The script will go through the entire document, and find all instances

                  of consecutive paragraphs with say the blockQuote style. It will then

                  create and apply, as necessary, 3 extra paragraph styles:

                   

                  blockQuoteStart

                  blockQuoteMiddle

                  blockQuoteEnd

                   

                  The difference between these is simply whether they have space above,

                  below, or not at all.

                   

                  It's really great and saves a lot of time!

                   

                  Incidentally, what we're looking for (and I've already filed a feature

                  request for this, but please do so as well), is the equivalent of Words

                  "Don't add space between paragraphs of the same style."

                   

                  Anyway, if you're interested in this script (I haven't actually put it

                  on the website yet), please contact me offline: admin (at)

                  freelancebookdesign.com

                   

                  HTH,

                  Ariel

                  1 person found this helpful
                  • 6. Re: Applying multiple paragraph styles
                    TᴀW Adobe Community Professional & MVP

                    By the way, I should add that the when the script creates the 3 extra

                    paragraph styles, it bases them on the original style. So if you need to

                    change the formatting of the blockQuote style say, you only have to do

                    it once: to the main blockQuote style. The others (blockQuoteStart,

                    Middle and End) follow suit. Not quite "pseudo styles" because that

                    doesn't exist in InDesign, but close enough.

                     

                    Ariel

                    • 7. Re: Applying multiple paragraph styles
                      peter minneapolis Level 4

                      Arïel wrote:

                       

                      Hi jbjacquet,

                       

                      I know exactly what you're talking about.

                       

                      At first, I wrote a script that changes paragraph styles based on what

                      comes before and what comes after, but that was still really fiddly to

                      get to work with the problem you're describing. (The script is available

                      on www.FreelanceBookDesign.com and is great for other things).

                       

                      So then I wrote a script that does exactly what you're looking for!

                       

                      Say you've got a para style called blockQuote, and another called

                      bulletList.

                       

                      Define both styles to have say 3mm above and 3mm space below.

                       

                      Run the script.

                       

                      The script will go through the entire document, and find all instances

                      of consecutive paragraphs with say the blockQuote style. It will then

                      create and apply, as necessary, 3 extra paragraph styles:

                       

                      blockQuoteStart

                      blockQuoteMiddle

                      blockQuoteEnd

                       

                      The difference between these is simply whether they have space above,

                      below, or not at all.

                       

                      It's really great and saves a lot of time!

                       

                      Incidentally, what we're looking for (and I've already filed a feature

                      request for this, but please do so as well), is the equivalent of Words

                      "Don't add space between paragraphs of the same style."

                       

                      Anyway, if you're interested in this script (I haven't actually put it

                      on the website yet), please contact me offline: admin (at)

                      freelancebookdesign.com

                       

                      HTH,

                      Ariel

                       

                      Great to have a script when there's nothing else that will do the job. But, it would be greater if InDesign had a built-in ability to do it. I've mentioned several times on these fora that FrameMaker's "structured" side has the ability to apply paragraph styles or properties according to rules you create. The gotcha is that you need to do some non-trivial setup work with the structured FM mode, not the "vanilla" mode.

                       

                      Structured FM can work with an EDD (Element Definition Document) which is the equivalent of a DTD (Document Type Definition) in SGML, XML, and other similar languages. An EDD or DTD is composed of rules about what's legal in a document. The rules processor is always on. It can warn when rules are violated, and it can perform some operations when the rules processor detects the need to perform them.

                       

                      In this case, context rules are in play. Within the general context rules there's a set of list-specific rules that can easily manage your requirements. You'd use a rule that tests the location of a paragraph within a list and changes the space above the first or space below the last paragraph, and doesn't affect the notfirst/notlast paragraphs in the list. Unlike a script, it's always "on," so moving a first or last paragraph to a position within the list automatically removes their first/last paragraph special properties, and automatically applies them to the new first and/or last paragraph.

                       

                      InDesign's XML can work with a DTD, but InDesign lacks the always-looking-for-opportunities-to-apply rules mechanism. So, if you think it would be a good idea to add this ability to InDesign, add your request to mine and others, here: Adobe - Feature Request/Bug Report Form. If InDesign developers can make it work without a DTD and XML markup, it's likely to happen sooner. If a DTD and XML markup are required to make it work, it'll have a much lower priority until ID-XML users become a majority.

                       

                      In the meantime, a great script is just the right thing!

                       

                       

                      HTH

                       

                       

                      Regards,

                       

                       

                      Peter

                      _______________________

                      Peter Gold

                      KnowHow ProServices

                      • 8. Re: Applying multiple paragraph styles
                        TᴀW Adobe Community Professional & MVP

                        I agree that it would be better to have this built in, and I've already

                        filed a feature request. Thanks, though, for your overview of how it

                        works in Framemaker. Is Framemaker still being developed for Windows, by

                        the way? I've sometimes wondered if it wouldn't suit me better than

                        InDesign, seeing as most of my work is long document, aka books.

                         

                        In my feature request, though, I suggested that InDesign have some sort

                        of conditional paragraph style mechanism that would be very similar to

                        CSS rules -- that way it would be good for print, AND when exporting to

                        ePub it could be carried through into the ePub CSS so it would work

                        there too.

                         

                        Ariel