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 to find parentheses touching italic text even if they are not italic?

Return to Member Forum

  • Author
    Posts
    • #1201502
      Olaf Nelson
      Member

      I thought I’d seen something similar to this but I can’t find it.
      Some of the publishers I work for require that parentheses be italicized if the text immediately inside BOTH of them is italic (even if not all text inside is). The writers and editors don’t seem to get it, so I end up with a lot of pairs that are not italic at all when they should be, other pairs with one of each, etc. I Would like to be able to do a search for any PAIR of ( and ) where the ( is followed by an italic character AND the ) is preceded by an italic character.
      Other publishers I work for require that no parentheses be italicized unless they’re in a string of text that is italic inside AND outside of them, so I guess that would be a similar operation, though spaces or punctuation immediately before or after the parentheses could mess it up if they’re not italic.

      It would be nice to be able to do the same thing to look for italic (or bold etc.) characters followed immediately by , ? ! etc. that need to be italicized. I asked about this at PepCon in Chicago years ago and was told there’s no way to do it because it involves searching for multiple styles at once. In other words, you can search for a string in italics that’s followed by a comma, but won’t find any where the comma isn’t also italic. I feel like I’ve seen something to the contrary since, but my hunts are coming up empty.

      In the past I’ve done it with character styles by making an italic style that’s a bright color (or highlighted using a fat offset colored underline) and another style in a contrasting color that gets applied to all the parentheses (or commas or whatever). Then I have to look through the whole thing for places where they butt up against each other. A search would be better for many reasons.

    • #14323576
      David Blatner
      Keymaster

      Hi Olaf, sorry your forum comment got lost in the moderation queue. Weird. Did you get an answer already?

      Yeah, there’s still no great way to do this. I think someone (Peter Kahrel?) had a script that would convert formatting to tags, and then you could run a grep find/change, and then it would swap it back to formatted text, but now I can’t find it.

      I did write up something that might help, here:
      https://indesignsecrets.com/grep-findchange-on-formatted-text-solution-to-a-big-problem.php

    • #14323459
      Olaf Nelson
      Member

      I might play around with various ways of using tags, but I wish ID could just do what I need. Thanks for the link to that post. I missed it when it was new. Always nice to know I’m not the only one with whatever problem I’m experiencing.

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