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 Help

Return to Member Forum

  • Author
    Posts
    • #62045
      valroze
      Member

      I am currently formatting a book that has crazy superscript and subscript requirements. It is equivalent to a medical dictionary. Anyway the current grep expression I am having trouble with is superscripting for references. For example,

      prenatal exposure and exposure to acetaminophen in the first year of life has also been linked to development of asthma later in life. [9, 10, 11, 12, 13]

      All of the numbers in brackets have to be superscripted. I have used Grep for making the brackets disappear but I can only get the 9 to be superscript. Sometimes I can get the 9 and one comma or the 9 and 13. Another problem I am facing is that all of the references are placed inbetween brackets but some are formatted like the one above and some are formatted like:

      [4-6]

      The grep expressions I am currently using are

      style: disappear

      (?<=d)]

      Style: Disappear

      [(?=/d)

      Style: superscript

      (?<=[)d+(?=])

      I've tried a lot of other combinations but haven't figured it out. Any ideas?

    • #62046
      Anonymous
      Inactive

      [ 0123456789,-]+(?=])

      I think this might work for you, It just superscripts any combination of digits, space, commas and dashes that are preceding a close bracket.

      some good advice about s from jongware:

      (Note that I inserted the — probably — missing backslashes ;) The forum software removes single s, so to get you must type \).

    • #62047
      valroze
      Member

      Thank you SO very much! Exactly what I needed. I overthink these way too much. And as far as the s go I thought my keyboard was broken there for a min. =) Thanks for the heads up.

    • #62053
      Anonymous
      Inactive

      It's easier to do this with a Nested Style

    • #62054
      valroze
      Member

      The nested style would not work because many of these are throughout the paragraph. In fact the sentence I gave you as an example is smack dab in the middle of a paragraph. I also needed a way to make the brackets disappear. Thank you for the input anyway! Believe me it is much appreciated.

    • #62055
      valroze
      Member

      Is it possible for me to make sure the superscript reference digits don't break from the preceeding sentence? They are splitting off from that sentence and I can't have them seperating.

    • #62058

      Add “No Break” in the character style you are applying.

Viewing 6 reply threads
  • You must be logged in to reply to this topic.
Forum Ads