7 Replies Latest reply on Nov 25, 2011 5:41 PM by ddsbleton

    Object Style within a Paragraph Style?

    ddsbleton Level 1

      Is it possible to assign an object style as a property of a paragraph style, such that any objects within a paragraph of that style get the object style automagically applied?

       

      Scenario:  I have a bunch of text that contains small inline graphics.  I've created an object style called "Inline image" and would like all of these inline images to get this object style.

       

      Things I've already tried:

       

      • using the Object panel in the Find/Change dialog.  This fails at the Find Object Format step because, I guess, there's nothing to find - the objects have no format.
      • using the GREP panel in the Find/Change dialog. This fails at the Change to step because, I guess, you can't use an object style as a change parameter.  I can FIND the objects just fine this way, via the ~a metacharacter.
      • weeping.  This fails at every step, but seems to be my only response to the problem.

       

      Thanks,

      Dennis

        • 1. Re: Object Style within a Paragraph Style?
          tonyharmer Level 3

          Object Styles can utilise Paragraph Styles, but not the other way around as far as I know.

           

          Question: What is the inline image, and it's purpose - also, what appearance are you trying to give it?

           

          Is it possible for you to post a screen shot?

           

          There might be another way to achieve the look you're after.

           

           

          • 2. Re: Object Style within a Paragraph Style?
            Peter Spier Most Valuable Participant (Moderator)

            How are the inline grahics created? Is there a way in your workflow for you to assign the object style (by making it the default for graphics, for example) at the time they are created?

            • 3. Re: Object Style within a Paragraph Style?
              ddsbleton Level 1

              Hi Tony and Peter,

               

              Thanks for your help.

               

              The inline images are small PDF images of keys on the computer keyboard. They are placed inline whenever keyboard shortcuts are discussed in the document (a software manual.

               

              The images tend to collide with descenders on the previous line.  Here's how they look without any styling:

               

              BadInline.png

               

              I could adjust the leading for the paragraph style, but this means large leading values, even in paragraphs where there are no inline images. My solution was to create an object styles for these images with a small negative Y offset, so as to drop them a bit below the baseline.  Now I'd like to apply this style to all of these objects at once, rather than one by one.  Here's how they look after applying my object style:

              GoodInline.png

               

              I could make this the default for graphics, which would help when I change them in the future.  The problem now, however, is that there are already hundreds of them in the book. Also, not all of the graphics are within text like this.  Many of them are large images that aren't inside the text flow.

               

              Thanks,

              Dennis

              • 4. Re: Object Style within a Paragraph Style?
                Peter Spier Most Valuable Participant (Moderator)

                There's potential her to do this with find/change, or maybe a GREP style...

                 

                You'll need to define a character style with baseline shift, then apply it to any anchored object marker in the paragraph.

                 

                For plain text you'd search for ^a or for GREP searc or a GREP style use ~a

                • 5. Re: Object Style within a Paragraph Style?
                  [Jongware] Most Valuable Participant

                  A GREP style is a good idea, and it definitely works with "~a" (the "anchored object" code).

                   

                  Seeing as your graphics are very closely cropped, you can also automatically add some white space to the left and right with an additional GREP style. Create a character style "whitespace" and set its tracking to +200. Apply this to the following GREP style:

                   

                  .~a

                   

                  -- you will see a bit of space appear between the previous character and the graphic, and (although not addressed in the GREP style) between the graphic and the next character as well.

                  • 6. Re: Object Style within a Paragraph Style?
                    tonyharmer Level 3

                    This whole exercise would work probably much better if those characters were actually glyphs - you may want to consider for the future.

                     

                    There are several keyboard fonts out there, such as: http://new.myfonts.com/fonts/linotype/mac-key-caps-pi/

                     

                    Or, if you wanted to use your own shapes, make your own font: http://www.fontlab.com/font-editor/typetool/

                     

                     

                    1 person found this helpful
                    • 7. Re: Object Style within a Paragraph Style?
                      ddsbleton Level 1

                      Excellent idea about the fonts.  That would save an enormous amount of hassle.

                       

                      I can't seem to find ANY that both look good and contain all of the keys on a modern machine, but I'll keep looking.

                       

                      Thanks,

                      Dennis