6 Replies Latest reply on Jun 22, 2011 4:05 AM by MizCharli

    Insert white space in paragraph style?


      Is it possible to incorporate an inserted white space (en character) into a paragraph style?


      I have created a paragraph style for chapter titles. The chapter and number are centered horizontally on the page with a thick-thin line (spanner) on each side --  sort of like this,except that I'm using the dash to create the line in this example:


      -------------------------------------  Chapter 2  ------------------------------------


      The inserted white spaces are before and after "Chapter 2."  However, when I try to apply the paragraph style to another title, the spaces are not there.


      (The thick-thin line was created as an underline to the text and offset to be vertically centered with the text.  Would it make a difference if I created the thick-thin line as a graphic?)


      Oh, and I also tried creating an object style, but it doesn't seem to recognize the spaces, either.  I know SOMEthing will work, but my little-by-little learning hasn't come across the solution yet.



        • 1. Re: Insert white space in paragraph style?
          Peter Spier Most Valuable Participant (Moderator)

          You cannot add text by using a style, but you can do it with Find/Change.

          If all of the headings share the single style, and that style is used nowhere else, the following GREP should work, I think:


          Find \w.+\w[.!:?]?

          Change to ~>$0~>


          This should pick up the full paragraph starting with the first "word" character and ending with either the last word character OR a period, exclamation point, colon or question mark, if one appears, and add a an en-space on either side. Running it more than once on the same text will add another set of spaces, so it would be best to use Find, then either Change and Find or Find next, depending on if the addition is needed, rather than change all. I tried adding negative look behind and look ahead to eliminate paragraphs that already had the spaces, but that just ends up inserting new spaces after the first character and before the last.


          It will ignore any other punctuation or white space on either end, so it won't ick up whatever you are using to create the rules (if I knew what that was, maybe I could figure out a way to put spaces inthe wrong places if they already exist).  Note that in the present form it will NOT include any sort of quotation marks or an inverted question or exclamation in someting like Spanish text and the space would be inserted between that and the first letter or between the last letter/punctuation and a close quote, so if you have more complex headings, you need to cover more bases in the GREP.

          • 2. Re: Insert white space in paragraph style?
            [Jongware] Most Valuable Participant

            Do it like this:


            1. Make the big line a paragraph rule ABOVE. Set it to "Column" (full) width, and set its vertical offset to the right position.

            2. Add a Paragraph Rule BELOW. Set this to the same vertical offset, but make it slightly (or a lot ) thicker. Set its color to [Paper]. Set the width to "Text", not "Column". Then set the Left and Right indent to the negative value of the approx. width of the white space you want left and right -- something like "-2 mm".

            3. You're done!


            chapter line.png

            • 3. Re: Insert white space in paragraph style?
              Peter Spier Most Valuable Participant (Moderator)

              See, that's much better. Jongware is finishing his day, and I'm just getting started, so I'm still asleep.

              • 4. Re: Insert white space in paragraph style?
                Peter Spier Most Valuable Participant (Moderator)

                Of course that works in this situation where the heading is all on one line, but it gets screwed up when the heading wraps to a second line, so it isn't a complete panacea.

                • 5. Re: Insert white space in paragraph style?
                  MizCharli Level 1

                  Thanks so much for both your answers.  I'll check them out and let you know what works for me.

                  • 6. Re: Insert white space in paragraph style?
                    MizCharli Level 1

                    This will show you what a newbie I am:


                    The paragraph rules was the solution, for sure, but I was not getting the effect of the left and right indents.  So I made the rule below the color cyan to see where the problem was, and it turns out - aha! - I had the offset in the wrong direction.  Back to the color "paper" and we're in business.


                    Thank you!


                    (more questions coming in another thread or two)