Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Paragraph Style to remove double paragraphs in a row

Return to Member Forum

  • Author
    Posts
    • #34311

      Hi
      I am running a web based template system that uses InDesign Server and it’s open for users to load in text etc.
      I need an automated way to remove two ‘returns’ in a row.
      I know I can do this several different ways by using find/change but how can I do it without doing this and preferably with a paragraph style. I understand the basics of GREP etc but I can’t work out a way to do this.
      Any ideas?

    • #34313

      Paragraph styles cannot remove text. (Nor add it — Space Above and Space Below don’t ‘add’ text.)

      Best to use a GREP search-and-replace, because the regular Find/Replace may mess up paragraph styling. Search for this:

      (?<=\r)\r

      and replace with nothing. This simply looks for a paragraph return which is preceded by another, and removes only the second one.

    • #34319
      David Blatner
      Keymaster

      Well, there is a crazy trick that can work… and even more automatically than a paragraph style. Make a character style that does one thing: set the leading to zero. Now edit your paragraph style and give it a GREP Style that applies that character style. The grep code to use is simply \r (backslash r).

      That will apply the character style to any paragraph that is empty (that is just a return character). And because the leading is zero, it will be as though the paragraph disappeared. (it will still be there, but it will take up no space.)

    • #34323

      Oh that’s deviously clever!

    • #70382

      Is there no way to remove 2 or more empty paragraph returns in a long run of flowing text? Why is it I can find them, but if I replace them with nothing, the following text will have its paragraph style changed?

      Mike Witherell in Maryland

    • #70387

      I have discovered that if your text has XML tags around it; the Find/Change of empty hard returns gets messed up.

Viewing 5 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads