hyphenrules does not break words












3















Following the code used both here and here, using hyphenrules should inform polyglossia about breaking points within a word. The following code does not break the word in question. Why not? What can I do? I'm using version 1.43 of polyglossia.



documentclass{article}

usepackage{polyglossia}
setmainlanguage{english}

begin{hyphenrules}{english}
hyphenation{de-ri-va-tio-nal}
hyphenation{non-de-ri-va-tio-nal}
end{hyphenrules}

begin{document}

parbox{0pt}{hspace{0pt}non-derivational}

end{document}


enter image description here










share|improve this question


















  • 2





    Isn't this the standard 'LaTeX won't hyphenate words already containing a hyphen' issue (cf. tex.stackexchange.com/q/2706/35864)? If you try nonderivational you get all the break points you wish for.

    – moewe
    Feb 16 at 20:03


















3















Following the code used both here and here, using hyphenrules should inform polyglossia about breaking points within a word. The following code does not break the word in question. Why not? What can I do? I'm using version 1.43 of polyglossia.



documentclass{article}

usepackage{polyglossia}
setmainlanguage{english}

begin{hyphenrules}{english}
hyphenation{de-ri-va-tio-nal}
hyphenation{non-de-ri-va-tio-nal}
end{hyphenrules}

begin{document}

parbox{0pt}{hspace{0pt}non-derivational}

end{document}


enter image description here










share|improve this question


















  • 2





    Isn't this the standard 'LaTeX won't hyphenate words already containing a hyphen' issue (cf. tex.stackexchange.com/q/2706/35864)? If you try nonderivational you get all the break points you wish for.

    – moewe
    Feb 16 at 20:03
















3












3








3








Following the code used both here and here, using hyphenrules should inform polyglossia about breaking points within a word. The following code does not break the word in question. Why not? What can I do? I'm using version 1.43 of polyglossia.



documentclass{article}

usepackage{polyglossia}
setmainlanguage{english}

begin{hyphenrules}{english}
hyphenation{de-ri-va-tio-nal}
hyphenation{non-de-ri-va-tio-nal}
end{hyphenrules}

begin{document}

parbox{0pt}{hspace{0pt}non-derivational}

end{document}


enter image description here










share|improve this question














Following the code used both here and here, using hyphenrules should inform polyglossia about breaking points within a word. The following code does not break the word in question. Why not? What can I do? I'm using version 1.43 of polyglossia.



documentclass{article}

usepackage{polyglossia}
setmainlanguage{english}

begin{hyphenrules}{english}
hyphenation{de-ri-va-tio-nal}
hyphenation{non-de-ri-va-tio-nal}
end{hyphenrules}

begin{document}

parbox{0pt}{hspace{0pt}non-derivational}

end{document}


enter image description here







hyphenation polyglossia






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 16 at 18:49









SverreSverre

10.8k948148




10.8k948148








  • 2





    Isn't this the standard 'LaTeX won't hyphenate words already containing a hyphen' issue (cf. tex.stackexchange.com/q/2706/35864)? If you try nonderivational you get all the break points you wish for.

    – moewe
    Feb 16 at 20:03
















  • 2





    Isn't this the standard 'LaTeX won't hyphenate words already containing a hyphen' issue (cf. tex.stackexchange.com/q/2706/35864)? If you try nonderivational you get all the break points you wish for.

    – moewe
    Feb 16 at 20:03










2




2





Isn't this the standard 'LaTeX won't hyphenate words already containing a hyphen' issue (cf. tex.stackexchange.com/q/2706/35864)? If you try nonderivational you get all the break points you wish for.

– moewe
Feb 16 at 20:03







Isn't this the standard 'LaTeX won't hyphenate words already containing a hyphen' issue (cf. tex.stackexchange.com/q/2706/35864)? If you try nonderivational you get all the break points you wish for.

– moewe
Feb 16 at 20:03












2 Answers
2






active

oldest

votes


















1














TeX doesn't hyphenate words that contain a hyphen (precisely the current hyphenchar for the current font).



You can define a macro for this:



newcommand{hy}{-nobreakhspace{0pt}}


The nobreak (that is, penalty10000) disallows a break at the hspace, which on the other hand allows hyphenation for the following word part.



documentclass{article}

usepackage{polyglossia}
setmainlanguage{english}

makeatletter % babel has `allowhyphens
providecommand{allowhyphens}{ifvmodeelsenobreakhskipz@skipfi}
makeatother

newcommand{hy}{-allowhyphens}

begin{document}

parbox{0pt}{hspace{0pt}nonhy derivational}

end{document}


Here I use a safer definition, that does nothing if allowhyphens happens to be found in vertical mode. It is essentially the same as in babel.



enter image description here



Note that de-ri-va-tio-nal is very wrong for English hyphenation rules.






share|improve this answer
























  • I looked up in Bringhurst to find out about hyphenation rules in English, but he doesn't give them. What is wrong about it, by the way?

    – Sverre
    Feb 18 at 16:30






  • 1





    In AmEnglish derivation hyphenates as der-i-va-tion, according to Merriam-Webster. In BrEnglish it should be de-riv-a-tion

    – egreg
    Feb 18 at 16:50



















2














In German language this is a well known problem, because german language contains a lot of concatenated words, single words divided by -. For example: Baden-Württemberg.



If you need hyphenation in the single words you need to add local hyphenations with -.



In your case change non-derivational to non-de-ri-va-tio-nal.



Please see the following MWE



documentclass{article}

usepackage{polyglossia}
setmainlanguage{english}

begin{hyphenrules}{english}
hyphenation{de-ri-va-tio-nal}
hyphenation{non-de-ri-va-tio-nal}
end{hyphenrules}

begin{document}

parbox{0pt}{hspace{0pt}non-derivational}

No - in word:
parbox{0pt}{hspace{0pt}nonderivational}

With local hyphenations texttt{-}:
parbox{0pt}{hspace{0pt}non-de-ri-va-tio-nal}

end{document}


and its result:



resulting pdf






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475241%2fhyphenrules-does-not-break-words%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    TeX doesn't hyphenate words that contain a hyphen (precisely the current hyphenchar for the current font).



    You can define a macro for this:



    newcommand{hy}{-nobreakhspace{0pt}}


    The nobreak (that is, penalty10000) disallows a break at the hspace, which on the other hand allows hyphenation for the following word part.



    documentclass{article}

    usepackage{polyglossia}
    setmainlanguage{english}

    makeatletter % babel has `allowhyphens
    providecommand{allowhyphens}{ifvmodeelsenobreakhskipz@skipfi}
    makeatother

    newcommand{hy}{-allowhyphens}

    begin{document}

    parbox{0pt}{hspace{0pt}nonhy derivational}

    end{document}


    Here I use a safer definition, that does nothing if allowhyphens happens to be found in vertical mode. It is essentially the same as in babel.



    enter image description here



    Note that de-ri-va-tio-nal is very wrong for English hyphenation rules.






    share|improve this answer
























    • I looked up in Bringhurst to find out about hyphenation rules in English, but he doesn't give them. What is wrong about it, by the way?

      – Sverre
      Feb 18 at 16:30






    • 1





      In AmEnglish derivation hyphenates as der-i-va-tion, according to Merriam-Webster. In BrEnglish it should be de-riv-a-tion

      – egreg
      Feb 18 at 16:50
















    1














    TeX doesn't hyphenate words that contain a hyphen (precisely the current hyphenchar for the current font).



    You can define a macro for this:



    newcommand{hy}{-nobreakhspace{0pt}}


    The nobreak (that is, penalty10000) disallows a break at the hspace, which on the other hand allows hyphenation for the following word part.



    documentclass{article}

    usepackage{polyglossia}
    setmainlanguage{english}

    makeatletter % babel has `allowhyphens
    providecommand{allowhyphens}{ifvmodeelsenobreakhskipz@skipfi}
    makeatother

    newcommand{hy}{-allowhyphens}

    begin{document}

    parbox{0pt}{hspace{0pt}nonhy derivational}

    end{document}


    Here I use a safer definition, that does nothing if allowhyphens happens to be found in vertical mode. It is essentially the same as in babel.



    enter image description here



    Note that de-ri-va-tio-nal is very wrong for English hyphenation rules.






    share|improve this answer
























    • I looked up in Bringhurst to find out about hyphenation rules in English, but he doesn't give them. What is wrong about it, by the way?

      – Sverre
      Feb 18 at 16:30






    • 1





      In AmEnglish derivation hyphenates as der-i-va-tion, according to Merriam-Webster. In BrEnglish it should be de-riv-a-tion

      – egreg
      Feb 18 at 16:50














    1












    1








    1







    TeX doesn't hyphenate words that contain a hyphen (precisely the current hyphenchar for the current font).



    You can define a macro for this:



    newcommand{hy}{-nobreakhspace{0pt}}


    The nobreak (that is, penalty10000) disallows a break at the hspace, which on the other hand allows hyphenation for the following word part.



    documentclass{article}

    usepackage{polyglossia}
    setmainlanguage{english}

    makeatletter % babel has `allowhyphens
    providecommand{allowhyphens}{ifvmodeelsenobreakhskipz@skipfi}
    makeatother

    newcommand{hy}{-allowhyphens}

    begin{document}

    parbox{0pt}{hspace{0pt}nonhy derivational}

    end{document}


    Here I use a safer definition, that does nothing if allowhyphens happens to be found in vertical mode. It is essentially the same as in babel.



    enter image description here



    Note that de-ri-va-tio-nal is very wrong for English hyphenation rules.






    share|improve this answer













    TeX doesn't hyphenate words that contain a hyphen (precisely the current hyphenchar for the current font).



    You can define a macro for this:



    newcommand{hy}{-nobreakhspace{0pt}}


    The nobreak (that is, penalty10000) disallows a break at the hspace, which on the other hand allows hyphenation for the following word part.



    documentclass{article}

    usepackage{polyglossia}
    setmainlanguage{english}

    makeatletter % babel has `allowhyphens
    providecommand{allowhyphens}{ifvmodeelsenobreakhskipz@skipfi}
    makeatother

    newcommand{hy}{-allowhyphens}

    begin{document}

    parbox{0pt}{hspace{0pt}nonhy derivational}

    end{document}


    Here I use a safer definition, that does nothing if allowhyphens happens to be found in vertical mode. It is essentially the same as in babel.



    enter image description here



    Note that de-ri-va-tio-nal is very wrong for English hyphenation rules.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 16 at 22:12









    egregegreg

    722k8719143214




    722k8719143214













    • I looked up in Bringhurst to find out about hyphenation rules in English, but he doesn't give them. What is wrong about it, by the way?

      – Sverre
      Feb 18 at 16:30






    • 1





      In AmEnglish derivation hyphenates as der-i-va-tion, according to Merriam-Webster. In BrEnglish it should be de-riv-a-tion

      – egreg
      Feb 18 at 16:50



















    • I looked up in Bringhurst to find out about hyphenation rules in English, but he doesn't give them. What is wrong about it, by the way?

      – Sverre
      Feb 18 at 16:30






    • 1





      In AmEnglish derivation hyphenates as der-i-va-tion, according to Merriam-Webster. In BrEnglish it should be de-riv-a-tion

      – egreg
      Feb 18 at 16:50

















    I looked up in Bringhurst to find out about hyphenation rules in English, but he doesn't give them. What is wrong about it, by the way?

    – Sverre
    Feb 18 at 16:30





    I looked up in Bringhurst to find out about hyphenation rules in English, but he doesn't give them. What is wrong about it, by the way?

    – Sverre
    Feb 18 at 16:30




    1




    1





    In AmEnglish derivation hyphenates as der-i-va-tion, according to Merriam-Webster. In BrEnglish it should be de-riv-a-tion

    – egreg
    Feb 18 at 16:50





    In AmEnglish derivation hyphenates as der-i-va-tion, according to Merriam-Webster. In BrEnglish it should be de-riv-a-tion

    – egreg
    Feb 18 at 16:50











    2














    In German language this is a well known problem, because german language contains a lot of concatenated words, single words divided by -. For example: Baden-Württemberg.



    If you need hyphenation in the single words you need to add local hyphenations with -.



    In your case change non-derivational to non-de-ri-va-tio-nal.



    Please see the following MWE



    documentclass{article}

    usepackage{polyglossia}
    setmainlanguage{english}

    begin{hyphenrules}{english}
    hyphenation{de-ri-va-tio-nal}
    hyphenation{non-de-ri-va-tio-nal}
    end{hyphenrules}

    begin{document}

    parbox{0pt}{hspace{0pt}non-derivational}

    No - in word:
    parbox{0pt}{hspace{0pt}nonderivational}

    With local hyphenations texttt{-}:
    parbox{0pt}{hspace{0pt}non-de-ri-va-tio-nal}

    end{document}


    and its result:



    resulting pdf






    share|improve this answer






























      2














      In German language this is a well known problem, because german language contains a lot of concatenated words, single words divided by -. For example: Baden-Württemberg.



      If you need hyphenation in the single words you need to add local hyphenations with -.



      In your case change non-derivational to non-de-ri-va-tio-nal.



      Please see the following MWE



      documentclass{article}

      usepackage{polyglossia}
      setmainlanguage{english}

      begin{hyphenrules}{english}
      hyphenation{de-ri-va-tio-nal}
      hyphenation{non-de-ri-va-tio-nal}
      end{hyphenrules}

      begin{document}

      parbox{0pt}{hspace{0pt}non-derivational}

      No - in word:
      parbox{0pt}{hspace{0pt}nonderivational}

      With local hyphenations texttt{-}:
      parbox{0pt}{hspace{0pt}non-de-ri-va-tio-nal}

      end{document}


      and its result:



      resulting pdf






      share|improve this answer




























        2












        2








        2







        In German language this is a well known problem, because german language contains a lot of concatenated words, single words divided by -. For example: Baden-Württemberg.



        If you need hyphenation in the single words you need to add local hyphenations with -.



        In your case change non-derivational to non-de-ri-va-tio-nal.



        Please see the following MWE



        documentclass{article}

        usepackage{polyglossia}
        setmainlanguage{english}

        begin{hyphenrules}{english}
        hyphenation{de-ri-va-tio-nal}
        hyphenation{non-de-ri-va-tio-nal}
        end{hyphenrules}

        begin{document}

        parbox{0pt}{hspace{0pt}non-derivational}

        No - in word:
        parbox{0pt}{hspace{0pt}nonderivational}

        With local hyphenations texttt{-}:
        parbox{0pt}{hspace{0pt}non-de-ri-va-tio-nal}

        end{document}


        and its result:



        resulting pdf






        share|improve this answer















        In German language this is a well known problem, because german language contains a lot of concatenated words, single words divided by -. For example: Baden-Württemberg.



        If you need hyphenation in the single words you need to add local hyphenations with -.



        In your case change non-derivational to non-de-ri-va-tio-nal.



        Please see the following MWE



        documentclass{article}

        usepackage{polyglossia}
        setmainlanguage{english}

        begin{hyphenrules}{english}
        hyphenation{de-ri-va-tio-nal}
        hyphenation{non-de-ri-va-tio-nal}
        end{hyphenrules}

        begin{document}

        parbox{0pt}{hspace{0pt}non-derivational}

        No - in word:
        parbox{0pt}{hspace{0pt}nonderivational}

        With local hyphenations texttt{-}:
        parbox{0pt}{hspace{0pt}non-de-ri-va-tio-nal}

        end{document}


        and its result:



        resulting pdf







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 16 at 21:43

























        answered Feb 16 at 21:38









        KurtKurt

        38k847162




        38k847162






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475241%2fhyphenrules-does-not-break-words%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Can I use Tabulator js library in my java Spring + Thymeleaf project?