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-Style for this anyone?

Return to Member Forum

  • Author
    Posts
    • #61886
      mlunden
      Member

      I would like to have a GREP-Style to make the just first first Character fat followed by 1-3 digits then 1 space and repeate 2 times more! Se textimage below! Any fast GREP-STYLIST out there to help?

    • #61887

      Tricky. You cannot do it the way you envisage: apply your Bold style to three items in a row but not to the stuff between them. You can apply it selectively to (uppercase) followed-by “digits uppercase digits uppercase digits”, but that only works for the first item. To use this same trick for (uppercase digits) APPLY_HERE (digits uppercase digits), you need a variable-length lookbehind because there may be one, two, or three digits after that first uppercase. Of course you can add a GREP style for each of the three possibilities; but then you have to add, uh, (3 x 2) six more possibilities for the third part.

      So I propose the reverse: apply bold to the entire string of uppercase/3 digits; then, apply Regular again to just the digits. (Oh–and I see a single '+' in there as well!) That would be

      1. Bold to

      bud{1,3} ud{1,3}+? ud{1,3}b

      2. Regular to

      (?<=bu)d{1,3}+?s

      Note that this works on the small sample you provided, but may have side effects if there are any more uppercase-digit combinations in your text.

      It's simpler if you can be sure it's just these three 'L', 'D', and 'H' (followed by one to three digits) that should be bolded, and they do not occur more than three times (i.e., never something like “L10 H20 D30 L40” — but guessing what they stand for, I think it's safe to assume that):

      b[LHD]d{1,3}b

      If this line is always a separate paragraph, consider creating a paragraph style specifically for it.

    • #62166
      RedMoFo
      Member

      Why not find/replace '#L' '#D' & '#H' and insert a non-printing character before each, eg. end nested style here (^h). Then add nested styles to your Paragraph Style which changes each instance to a bold character style. You will obviously need to use a unique paragraph style for the dimensions part of your listing, otherwise all words following a space beginning with Cap LDH will appear bold too.

      If all your listings are as per your example, you could simply use the existing space as the trigger for the nested style. Not as sexy as GREP, but it'll do the job!

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