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 to group Dimensions

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #101307
      Alfonso Iacurci
      Participant

      Hello,

      I’m typesetting painting captions, where there are dimensions in in. and cm., for example:

      Use A: 48 1/4 × 40 3/8 in.

      Use B: (122.5 × 102.5 cm)

      At the moment, in many cases, these run onto the next line, is there a GREP style that will keep the full dimensions together? Please note, fractions are typeset as proper fractions.

      Many thanks in advance,
      Phil

    • #101312

      Hi Phil,

      Grep style:

      \d+.+?×.+?(in\.|cm)
      char style: + nobreak

      (^/)

    • #101313
      Alfonso Iacurci
      Participant

      Thank you so much!
      There’s one issue, sorry!

      Please see screen shot https://drive.google.com/open?id=18wkLz6-Is9rOF7VFyC1CjRdwvxTrQtJ8

      Rather than the dimensions being attached to the text that goes before it, ie the top caption in the screenshot (top text box) show’s the dims attached to ‘…panel,’, the dims should start on a new line. So both forms of dimensions should start on a new line, if they don’t fit as a group. I hope that makes sense?! You can see when the caption box is made narrow (bottom text box), the text disappears.

      Thank you Obi!
      P

    • #101320
      Graham Park
      Member

      Looks to me that you need to separate the No Breaks as separate GREP Styles one for the in and one for cm

      \d+.+x.+in\.

      \(.+cm\)

      If you want the first Dimension to be at eh start if a line I think you will need to do a FIND/REPLACE to add a break character (this adds a soft return before the in measure)
      Find
      (\d+.+ x.+in\.)
      Change to
      $0

      Now I will wait to Oni-wan to suggest a better way.

    • #101321
      Graham Park
      Member

      Should have combined these two
      \d+.+x.+in\.|\(.+cm\)

    • #101322

      [\d.]+\D+?×.+?(in\.|cm)

      (^/)

    • #101323

      This will be enough:

      [\d.]+\D+×.+?(in\.|cm)

      (without the first ?)

      (^/)

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