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

Use GREP to set superscript

Tagged: ,

Return to Member Forum

  • Author
    Posts
    • #94606

      Hi Everyone,

      Long time reader, first time writer. The advice on this website is so great and has constantly dug me out of little InDesign holes. I’ve stumbled upon an issue that I can’t seem to get an answer to. I’m not really accustomed to GREP but I think it could have the solution I need. Any pointers would be great.

      I’m working with a long document of tables accompanied by text introductions. The document has been styled up beautifully, everything in its right place. This is a 500+ page doc full of figures, not the most sexy of briefs but it had to be done. We’ve just heard back from the client after about 2 months of it being proof-read (my sympathy to whoever had that job). It turns out that there are a series of units that need to be set in superscript (these unfortunately weren’t included in the initial copy). These are units such as m2/f3 (sorry I can’t set the text to superscript here).

      Now I could search for M2 and go one by one setting each to superscript but that would take forever and I’d more than likely miss a section. Is there a way to use GREP to get around this? I think my issue is that I can’t set all 2’s to superscript as that’ll mean all other figures in the tables will be displayed incorrectly. If I search out M2 and then apply a formatting style how can I avoid applying the superscript to the letter M? I’d really really appreciate any clues to help solve, what is for me this complex mystery.

      Thanks,
      Phil

    • #94612
      David Blatner
      Keymaster

      Hi Philip, not sure why your post was held for moderation. But it’s clear now.

      Yes, GREP can help! The easiest thing would likely be to use the GREP tab inside the Find/Change dialog box. For example, if you search for (?<=[\u])\d then it will find any single number that immediately follows any upper or lower case letter.

      But: it's just a single number. If you have x13, it will only find "1"

      More on the topic here:
      https://creativepro.com/auto-format-superscript-and-subscript-numbers-using-grep-styles.php
      or
      https://creativepro.com/quick-grep-to-superscript-ordinals.php

      • #94630

        I am lousy at GREP and would have done it the old-fashioned way.

        1) Search for any letter + two digits + slash and replace with the color red (or another color that wasn’t being used).

        2) Search for any digit that is color red and make superscript.

        3) Search for color red and make black.

        But that’s just me. I mainly work on books and there are so many variations of things, that some GREPS wouldn’t work. Like your example, David (no offense). For a cookbook, the vitamins B1, B6, B12 would be inferior. But if there are endnotes also in the job, those numbers next to a letter would be superscript. That sort of thing.

        But I know I definitely need to learn more about GREP and this site is a great place to learn it.

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