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:Do not break words that begin with a capital and preceded by an apostrophe

Return to Member Forum

  • Author
    Posts
    • #73823
      Anonymous
      Inactive

      In french there are words with quotes like : l’Université.

      Is there a GREP that says to indesign : “Do not break words that begin with a capital and which are preceded by an apostrophe” ?

      Option “Hyphenate capitalised words” doesn’t work since InDesign doesn’t recognize such word as “capitalised words” and i don’t want to use the dictionary method.

      Can anyone help me please ? :/ I searched on the internet for hours in vain

      Thanks !

    • #73825
      Gert Verrept
      Member

      This is how I do it:
      1. Create a char style “NoBreak” (check in basic char format “No Break”, leave all the rest blank)
      2. In your para style, create a grep style with:

      Apply Style = NoBreak
      to Text = \d(?=’)|[\u](?=’)|(?<! )’

      Should do the trick

      • #73827
        Anonymous
        Inactive

        Thanks !

        I try but it doesn’t work. I did a screenshot but can not show it here.

        It’s a German closing quotation mark (guillemet allemand fermant) on the word “l’université” : Alt+Maj+’

        I tried to change the quote in your grep style with the right quote but im not good at all in grep style… :/

      • #73829

        If it’s a closing quotation mark, would that be the reason for the “false” hyphenation? It thinks that the end of a quotation is a valid point at which to break the line.
        Is that even the correct character to use in this situation?

        Chris.

      • #73831
        Anonymous
        Inactive

        No actually we have to use the quotation mark Alt+Maj+’ in french.

        Just use ‘ is not a typographical quote :/

      • #73832
        Anonymous
        Inactive

        What’s happening is that indesign treats the quote as a “word” so the word l’Université is seen as a non capitalized word…
        So even when you ask to not hyphenate capitalized words, it doesn’t work :/

    • #73826

      When this occurs, are the French words set as French in the Character panel (or in a style)?
      One would expect the French hyphenation dictionary to work correctly, but you might expect a non-French hyphenation dictionary to make mistakes.

      I tried out a bunch of text which included l’Université, and I could not cause it to hyphenate at the apostrophe, even with a text box that was only a few letters wide. The smallest hyphenation I got was:

      L’Uni-
      versi-

      Also, it would not hyphenate “d’une” at all.

      Good luck,
      Chris.

      • #73828
        Anonymous
        Inactive

        Thanks. Yes it’s set as French.

        It’s precisely what i don’t want : hyphenation on “l’Université”

        I don’t want hyphenation on any capitalised words and l’Université is a capitalised word but indesign doesn’t see it that way (because of the apostrophe)

      • #73830

        Ah I understand now.
        Disregard my other reply!

        And I can also replicate your behaviour, even with a “normal” apostrophe before Université – it still hyphenates, when the option is set to not hyphenate capitalised words.

      • #73837
        Anonymous
        Inactive

        Indeed :/

    • #73841

      I’d be very surprised if you’re the first person to be affected by this, but I can’t find anything else about it with a quick google.
      Let us know if you find anything else useful, please!

      Chris.

      • #73848
        Anonymous
        Inactive

        Sure !

        Since this is a typical french pb there is very little information about it (there is very little info in french for GREP GENERALY not only for this pb =)

        I only found one site in french that talks about it. It was an old post. I can’t find it anymore but the solution provide was to use the dictionary…

    • #73845
      Gert Verrept
      Member

      This one works with your marks. I working whole days with French text, never had a problem with the “NoBreak” character style. Below the grep style with the german quotes.

      \d(?=”)|[\u](?=”)|(?<! )”

      • #73846
        Anonymous
        Inactive

        I’m confused. It still doesn’t work :/

        I often use the NoBreak character style for compounds words and it works perfectly. So I don’t think i made a mistake there.

        I don’t understand why it works with you, not with me :/

    • #73852
      Gert Verrept
      Member

      OK. Maybe I’m not using the right quotes. What you can do to see if it’s the case:
      copy the grep style into a document and change all the quotes into those you need. Then, copy the string back into the grep style and test it.

      • #73854
        Anonymous
        Inactive

        Im sorry it still doesn’t work :/

        The first GREP you give was the good one with right quote : \d(?=’)|[\u](?=’)|(?<! )’
        but it still doesn’t work.

        Thanks for your help anyway !

    • #74959
      Wosven S
      Member

      “No Break” should be applied to “l'” AND “Université”, using this GREP:
      \d(?=’)|\d(?=”)|[\u]’[\u]+|(?<! )’

      Another way with long words like “Triffouillis-les-Oies” is using 2 character styles : “No Break” and “Break” ([None] / [Sans] doesn’t do the trick):
      GREP 1:
      “No Break”
      \d(?=’)|\d(?=”)|[\u]’[\u-]+|(?<! )’

      GREP 2:
      “Break”
      (?<=[\u-])-

      • #74979
        Alan Gilbertson
        Participant

        That’s elegant!

        For GREP expressions you’re posting in the forum, it’s helpful if you bracket them with an HTML code tag to make them stand out a bit.

    • #74960
      Anonymous
      Inactive

      Waouw !

      You know what ? It works ! Incredible ! =)

      I really want to thank you ! This is something i was looking for for a long time !

      By the way a very valuable GREP because there is not two of them on the net, to my knowledge.

      Thousand thanks !

    • #74991
      Masood Ahmad
      Participant

      Emmanuel, I also came up with a GREP code, try this one. It is small and working:

      GREP Style

      Apply Style: No Break
      To Text: [\u]'\u\w+

      I would like to hear from you whether it suits your requirements or not. At my end it is working fine.

      • #75012
        Anonymous
        Inactive

        It works perfectly !! Thank you very much !

        =)

    • #75010
      Wosven S
      Member

      Thanks for the tip Alan and your concise expression Masood.

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