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

Indesign "Grep"

Return to Member Forum

  • Author
    Posts
    • #93984
      volander
      Member

      Hello,

      Im trying to make a grep in the “find and change” tab, that inserts a space before and after my paragraph.
      Can this be done?

    • #94044
      David Blatner
      Keymaster

      If you want space before and/or space after a paragraph, I suggest using the Space Before and Space After features. That is formatting, so you can build it into a paragraph style.

      But if you want to add a blank line between each paragraph, you could do a grep search for ^.+$ and replace it with \r$0 (that just puts a return before each paragraph)

    • #94047
      volander
      Member

      What im trying to do:

      First I created a paragraph style that used a rule below with offset to create a colored box behind my text. But my text (which is a headline) sometimes need some sort of linebreak. It also need to be able to be imported into a table of content. ToC doesn’t play well with hard breaks in my headline because it will interferer with the nextstyle, and soft breaks doesn’t work with the “rule below”.

      So my hack is: a paragraph style that uses a underline on the text with offset to create a colored box behind the text. Since the underline only will appear where there is text or blank spaces, I will insert blank spaces at the beginning of my paragraph and at the end. That means i cant use spacing, cause i need the colored box to start a bit before the text and after.

      Does it make sense? I don’t know if there is any easier way.

      Link below shows the effect i want to achieve.

      View post on imgur.com

    • #94049
      Peter Kahrel
      Participant

      In that case you can replace ^.+$ with \x20$0\x20 (\x20 is the space character). If you have just text there then that works. A safer method would be to replace ^(.) with \x20$1 and (.)$ with $1\x20.

      P.

    • #94054

      Hi Peter,

      If only 2 lines, 2 para rules.
      If more, 2 para rules + 1 grep style: [^\r]. + 1 regex: find \x20 replace by $0\x20 [I suppose each line is separated by a soft-return]

      (^/)

    • #94055
      Peter Kahrel
      Participant

      Michel — In the last example volander uses a character style, not a paragraph rule. And his image shows he just wants to add space at the start and the end of the paragraph (not before and after the paragraph).

      P.

    • #94056

      Peter,

      Volander seems to be bored by an “underlined” title!
      One way I use avoids, if his title has only 2 lines, to add “false spaces”, playing with 2 para rules (with no effect on the TOC)!

      (^/) ;-)

    • #94069
      David Blatner
      Keymaster

      volander: If you are using InDesign CC, you could use the Paragraph Shading feature:
      https://creativepro.com/indesign-cc-2015-available-shading-graphic-cells-more.php

    • #94071

      David,

      Why not if 1 line! … … but if 4? ;-)

      I often (maybe too often) think more globally because if this fixes this problem now, that won’t fix another more complex later!! …

      https://www.dropbox.com/s/zre3v170jyaffsa/Capture%20d%E2%80%99%C3%A9cran%202017-05-02%20%C3%A0%2012.21.16.png?dl=0

      (^/)

      Question: How post a screenshot here? =D

    • #94072
      David Blatner
      Keymaster

      I think you can add html for an image such as img src="https://www.dropbox.com/s/zre3v170jyaffsa/Capture%20d’écran%202017-05-02%20à%2012.21.16.png"
      (remove the ?dl=0 for dropbox)

      Let me try… here…

    • #94073
      David Blatner
      Keymaster

      No! It doesn’t work. That is sad. It will will from most other sites. I guess dropbox does not allow it?

      I believe you can also use some file services, such as imgur… you just include the URL here like https://imgur.com/54tYFOS

      View post on imgur.com

    • #94074

      David, if you have it, could you give me the name and the phone of the owner of InDesignSecrets! …
      I’m going to call him to tell him what I think about this problem!! =D

    • #94075
    • #94076

      Cool! Thanks, David!

      (^/)

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