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

Grep character style addition

Return to Member Forum

  • Author
    Posts
    • #61110
      nicds
      Member

      Hi

      I've been battling to figure out how to find all words with a particular character style and add em dash instead of the space after.

      I'm setting a glossary and the first word or 2 of a line has a character style and then there needs to be an em dash before the rest of the sentence continues. (currently there is only a space)

      Example:

      adjectival phrase a phrase that describes a noun: the man coming through the door is the head of the school; adjectival phrases do not have a verb

      So there needs to be an em dash after “phrase” and before “a”.

      Thanks, any help is much appreciated.

    • #61113

      Find:

      ^(.+) (with font attribute Bold in Find Format)

      Change to:

      $1~_

      This will add the em dash right after the bold text. You can then change em-dash/space to just an em-dash.

    • #61120
      nicds
      Member

      Thank you so much. That works perfectly.

      Do you mind if I ask what the find part means – just so I can learn and possibly adapt it for other greps in the future?

    • #61121

      ^ Beginning of paragraph

      ( Start of group #1

      . any character wildcard

      + one or more of the preceding code, group, or character

      ) End of group #1

      The parentheses define one single numbered group, ready to be recalled in the Replace With expression as “$1”.

      For more complicated expressions you can try my very own WhatTheGrep script.

    • #61122
      nicds
      Member

      Thank you – that explains things perfectly.

      This is such a great help.

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