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 question

Return to Member Forum

  • Author
    Posts
    • #59143
      Opo One
      Member

      Hi guys

      Im after some advice regarding creating a GREP to capatilise all numerals within a document. of course, i can just search for one number at a time but thats not really saving any time. Is there a way to search for all numbers 0-9 at once ?

      ive tried seperating all the characters with a * i.e. 1*2*3*4*5*6*7*8*9*0

      but that doesnt seem to work very well (im guessing that its only finding numbers with a space either side ?

      would be great to have a GREP for this as my client uses one font and we always have to captilise the numerals due to them hanging when left lower case.

      many thanks!

    • #59145

      (a) The proper OR code is the vertical line or “pipe”:

      a|e|o|i|u

      — this works for entire words:

      and|or|not|nor

      (b) For proper searching for a set of disjunct characters, you don't need to individually OR them, you can put them into an OR set; each single character in it will match:

      [aeoiu]

      (c) To search for a consecutive set of characters, you don't have to list them all. Rather than

      [0123456789]

      you can use this notation:

      [0-9]

      This notation is for characters, not for numbers, so search for

      [10-20]

      will search for the individual characters '1', '0 to 2', '0' and not for anyrthing from 'ten to twenty' :)

      (d) .. The above notation is useful, but searching for just digits is so common that they decided to assign a shortcut code to it:

      d

      in itself will match any single digit.

      So that's how you would do it with GREP. … Thing is, under normal circumstances you don't even need this. If you are using a font that has lowercase “oldstyle” or “medieval” digits as default, and the font comes with a separate style of “lining” digits, all you have to do is change the default in your paragraph style setup — it's in the Opentype Features panel, under “Figure Style”.

      If you are using a font that does not come with Opentype enabled digit styles, it will not work. But then GREP will not work either, 'cause there is nothing to change these digits to.

    • #59146
      Opo One
      Member

      wow, thank you for the quick response!

      I enabled Proportional Lining under the Opentype menu and yes! all figures are now UC as it were.

      one question though, is there a way to have this as the default without using paragraph or character styles, so you dont have to select all the copy and enable this feature every time ?

      :)

      ok so i re-read your post ;) and now i have changed this under the default paragraph style. this is great but is there a way to have this as an 'application' based default. i.e. so when you create a new doc you dont have to amend the default para style each time ?

    • #59151

      The default setting for Figure style is “the default for your current font”, and that default is, in my experience, tabular lining figures.

      But … if you want to change it nevertheless, all you have to do is change the setting while no document is open. As with every other setting in InDesign, that will make it sticky, for all new documents (of course existing documents will not be changed).

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