Why doesn't TeX hyphenate a really long word for which I've indicated some permissible hyphenation points?












3















Based on Automatic long word breaking in whole document I constructed an example of hyphenating a long word:



documentclass{report}
usepackage[english]{babel}
begin{document}
selectlanguage{english}
hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.
end{document}


However, it doesn't work. Can you help?










share|improve this question

























  • Actually, TeX is working exactly as it is supposed to. See my answer for an analysis of what's problematic about your paragraph that contains a 105-character word with only 2 permissible hyphenation points.

    – Mico
    59 mins ago











  • Another good way to improve the line-breaking is to load microtype with font expansion. It does not currently work in XeTeX, but can dramatically reduce the amount of hyphenation needed.

    – Davislor
    45 mins ago
















3















Based on Automatic long word breaking in whole document I constructed an example of hyphenating a long word:



documentclass{report}
usepackage[english]{babel}
begin{document}
selectlanguage{english}
hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.
end{document}


However, it doesn't work. Can you help?










share|improve this question

























  • Actually, TeX is working exactly as it is supposed to. See my answer for an analysis of what's problematic about your paragraph that contains a 105-character word with only 2 permissible hyphenation points.

    – Mico
    59 mins ago











  • Another good way to improve the line-breaking is to load microtype with font expansion. It does not currently work in XeTeX, but can dramatically reduce the amount of hyphenation needed.

    – Davislor
    45 mins ago














3












3








3








Based on Automatic long word breaking in whole document I constructed an example of hyphenating a long word:



documentclass{report}
usepackage[english]{babel}
begin{document}
selectlanguage{english}
hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.
end{document}


However, it doesn't work. Can you help?










share|improve this question
















Based on Automatic long word breaking in whole document I constructed an example of hyphenating a long word:



documentclass{report}
usepackage[english]{babel}
begin{document}
selectlanguage{english}
hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.
end{document}


However, it doesn't work. Can you help?







hyphenation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 37 mins ago









Mico

277k30378766




277k30378766










asked 3 hours ago









ViestursViesturs

1,67531123




1,67531123













  • Actually, TeX is working exactly as it is supposed to. See my answer for an analysis of what's problematic about your paragraph that contains a 105-character word with only 2 permissible hyphenation points.

    – Mico
    59 mins ago











  • Another good way to improve the line-breaking is to load microtype with font expansion. It does not currently work in XeTeX, but can dramatically reduce the amount of hyphenation needed.

    – Davislor
    45 mins ago



















  • Actually, TeX is working exactly as it is supposed to. See my answer for an analysis of what's problematic about your paragraph that contains a 105-character word with only 2 permissible hyphenation points.

    – Mico
    59 mins ago











  • Another good way to improve the line-breaking is to load microtype with font expansion. It does not currently work in XeTeX, but can dramatically reduce the amount of hyphenation needed.

    – Davislor
    45 mins ago

















Actually, TeX is working exactly as it is supposed to. See my answer for an analysis of what's problematic about your paragraph that contains a 105-character word with only 2 permissible hyphenation points.

– Mico
59 mins ago





Actually, TeX is working exactly as it is supposed to. See my answer for an analysis of what's problematic about your paragraph that contains a 105-character word with only 2 permissible hyphenation points.

– Mico
59 mins ago













Another good way to improve the line-breaking is to load microtype with font expansion. It does not currently work in XeTeX, but can dramatically reduce the amount of hyphenation needed.

– Davislor
45 mins ago





Another good way to improve the line-breaking is to load microtype with font expansion. It does not currently work in XeTeX, but can dramatically reduce the amount of hyphenation needed.

– Davislor
45 mins ago










1 Answer
1






active

oldest

votes


















3














The hyphenation directive doesn't just let you indicate some possible hyphenation points for a given "word" in the directive's argument. Instead, the hyphenation points you indicate are the only possible hyphenation points.



By construction, you are not allowing TeX to hyphenate the three substrings



temporincididuntutlaboreetdolo
remagna
aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


if they occur inside the 105-character [!!] string



temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


Don't be surprised, then, that TeX does not insert hyphenation points in any of the three substrings.



If full justification of paragraphs is active, which is the case by default, TeX must also obey some fairly stringent rules regarding (a) how much inter-word whitespace is allowed to stretch and (b) the tolerance for under-full lines. For all practical purposes, it suffices to know that overstretched inter-word whitespace is penalized very heavily and that under-full lines are also penalized. To get a sense of just how badly whitespace would have to be stretched in order to line-break your superlong word at one of the two permissible hyphenation points, consider the first paragraph below. It is typeset under the sloppy directive, which suspends most of TeX's penalties related to (a) the stretchiness of inter-word whitespace and (b) under-full lines. Observe the huge interword spaces in the first two lines and a seriously under-full third line. Not just "sloppy", but an outright assault on one's eyes!!



To restore a semblance of decent typography, it's necessary to issue the directive raggedright; see the second paragraph. Note that the huge amounts of inter-word whitespace in the first two lines of the paragraph are gone -- at the non-negligible cost of having two additional grossly under-full lines. Observe that the 105-character word does get hyphenated if raggedright is in effect. This is because raggedright imposes a penalty for (seriously) over-full lines. By default, the raggedright setting disables most hyphenation operations, since each "act" of hyphenation carries a sizable TeX penalty. But, for the paragraph at hand, the over-full line carries a larger penalty than does the act of hyphenation.



Incidentally, if one omits the hyphenation instruction, TeX is able (somewhat surprisingly, to me at least) to find reasonably "decent" hyphenation points.



enter image description here



documentclass{report}
usepackage[english]{babel}
%%selectlanguage{english} % not needed
hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

usepackage{showframe} % to indicate edges of text block

begin{document}
sloppy
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

medskip
fussy % opposite of "sloppy"
raggedright % suspend full justification
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

end{document}





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%2f472339%2fwhy-doesnt-tex-hyphenate-a-really-long-word-for-which-ive-indicated-some-permi%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    The hyphenation directive doesn't just let you indicate some possible hyphenation points for a given "word" in the directive's argument. Instead, the hyphenation points you indicate are the only possible hyphenation points.



    By construction, you are not allowing TeX to hyphenate the three substrings



    temporincididuntutlaboreetdolo
    remagna
    aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


    if they occur inside the 105-character [!!] string



    temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


    Don't be surprised, then, that TeX does not insert hyphenation points in any of the three substrings.



    If full justification of paragraphs is active, which is the case by default, TeX must also obey some fairly stringent rules regarding (a) how much inter-word whitespace is allowed to stretch and (b) the tolerance for under-full lines. For all practical purposes, it suffices to know that overstretched inter-word whitespace is penalized very heavily and that under-full lines are also penalized. To get a sense of just how badly whitespace would have to be stretched in order to line-break your superlong word at one of the two permissible hyphenation points, consider the first paragraph below. It is typeset under the sloppy directive, which suspends most of TeX's penalties related to (a) the stretchiness of inter-word whitespace and (b) under-full lines. Observe the huge interword spaces in the first two lines and a seriously under-full third line. Not just "sloppy", but an outright assault on one's eyes!!



    To restore a semblance of decent typography, it's necessary to issue the directive raggedright; see the second paragraph. Note that the huge amounts of inter-word whitespace in the first two lines of the paragraph are gone -- at the non-negligible cost of having two additional grossly under-full lines. Observe that the 105-character word does get hyphenated if raggedright is in effect. This is because raggedright imposes a penalty for (seriously) over-full lines. By default, the raggedright setting disables most hyphenation operations, since each "act" of hyphenation carries a sizable TeX penalty. But, for the paragraph at hand, the over-full line carries a larger penalty than does the act of hyphenation.



    Incidentally, if one omits the hyphenation instruction, TeX is able (somewhat surprisingly, to me at least) to find reasonably "decent" hyphenation points.



    enter image description here



    documentclass{report}
    usepackage[english]{babel}
    %%selectlanguage{english} % not needed
    hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

    usepackage{showframe} % to indicate edges of text block

    begin{document}
    sloppy
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

    medskip
    fussy % opposite of "sloppy"
    raggedright % suspend full justification
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

    end{document}





    share|improve this answer






























      3














      The hyphenation directive doesn't just let you indicate some possible hyphenation points for a given "word" in the directive's argument. Instead, the hyphenation points you indicate are the only possible hyphenation points.



      By construction, you are not allowing TeX to hyphenate the three substrings



      temporincididuntutlaboreetdolo
      remagna
      aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


      if they occur inside the 105-character [!!] string



      temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


      Don't be surprised, then, that TeX does not insert hyphenation points in any of the three substrings.



      If full justification of paragraphs is active, which is the case by default, TeX must also obey some fairly stringent rules regarding (a) how much inter-word whitespace is allowed to stretch and (b) the tolerance for under-full lines. For all practical purposes, it suffices to know that overstretched inter-word whitespace is penalized very heavily and that under-full lines are also penalized. To get a sense of just how badly whitespace would have to be stretched in order to line-break your superlong word at one of the two permissible hyphenation points, consider the first paragraph below. It is typeset under the sloppy directive, which suspends most of TeX's penalties related to (a) the stretchiness of inter-word whitespace and (b) under-full lines. Observe the huge interword spaces in the first two lines and a seriously under-full third line. Not just "sloppy", but an outright assault on one's eyes!!



      To restore a semblance of decent typography, it's necessary to issue the directive raggedright; see the second paragraph. Note that the huge amounts of inter-word whitespace in the first two lines of the paragraph are gone -- at the non-negligible cost of having two additional grossly under-full lines. Observe that the 105-character word does get hyphenated if raggedright is in effect. This is because raggedright imposes a penalty for (seriously) over-full lines. By default, the raggedright setting disables most hyphenation operations, since each "act" of hyphenation carries a sizable TeX penalty. But, for the paragraph at hand, the over-full line carries a larger penalty than does the act of hyphenation.



      Incidentally, if one omits the hyphenation instruction, TeX is able (somewhat surprisingly, to me at least) to find reasonably "decent" hyphenation points.



      enter image description here



      documentclass{report}
      usepackage[english]{babel}
      %%selectlanguage{english} % not needed
      hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

      usepackage{showframe} % to indicate edges of text block

      begin{document}
      sloppy
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

      medskip
      fussy % opposite of "sloppy"
      raggedright % suspend full justification
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

      end{document}





      share|improve this answer




























        3












        3








        3







        The hyphenation directive doesn't just let you indicate some possible hyphenation points for a given "word" in the directive's argument. Instead, the hyphenation points you indicate are the only possible hyphenation points.



        By construction, you are not allowing TeX to hyphenate the three substrings



        temporincididuntutlaboreetdolo
        remagna
        aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


        if they occur inside the 105-character [!!] string



        temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


        Don't be surprised, then, that TeX does not insert hyphenation points in any of the three substrings.



        If full justification of paragraphs is active, which is the case by default, TeX must also obey some fairly stringent rules regarding (a) how much inter-word whitespace is allowed to stretch and (b) the tolerance for under-full lines. For all practical purposes, it suffices to know that overstretched inter-word whitespace is penalized very heavily and that under-full lines are also penalized. To get a sense of just how badly whitespace would have to be stretched in order to line-break your superlong word at one of the two permissible hyphenation points, consider the first paragraph below. It is typeset under the sloppy directive, which suspends most of TeX's penalties related to (a) the stretchiness of inter-word whitespace and (b) under-full lines. Observe the huge interword spaces in the first two lines and a seriously under-full third line. Not just "sloppy", but an outright assault on one's eyes!!



        To restore a semblance of decent typography, it's necessary to issue the directive raggedright; see the second paragraph. Note that the huge amounts of inter-word whitespace in the first two lines of the paragraph are gone -- at the non-negligible cost of having two additional grossly under-full lines. Observe that the 105-character word does get hyphenated if raggedright is in effect. This is because raggedright imposes a penalty for (seriously) over-full lines. By default, the raggedright setting disables most hyphenation operations, since each "act" of hyphenation carries a sizable TeX penalty. But, for the paragraph at hand, the over-full line carries a larger penalty than does the act of hyphenation.



        Incidentally, if one omits the hyphenation instruction, TeX is able (somewhat surprisingly, to me at least) to find reasonably "decent" hyphenation points.



        enter image description here



        documentclass{report}
        usepackage[english]{babel}
        %%selectlanguage{english} % not needed
        hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

        usepackage{showframe} % to indicate edges of text block

        begin{document}
        sloppy
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

        medskip
        fussy % opposite of "sloppy"
        raggedright % suspend full justification
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

        end{document}





        share|improve this answer















        The hyphenation directive doesn't just let you indicate some possible hyphenation points for a given "word" in the directive's argument. Instead, the hyphenation points you indicate are the only possible hyphenation points.



        By construction, you are not allowing TeX to hyphenate the three substrings



        temporincididuntutlaboreetdolo
        remagna
        aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


        if they occur inside the 105-character [!!] string



        temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut


        Don't be surprised, then, that TeX does not insert hyphenation points in any of the three substrings.



        If full justification of paragraphs is active, which is the case by default, TeX must also obey some fairly stringent rules regarding (a) how much inter-word whitespace is allowed to stretch and (b) the tolerance for under-full lines. For all practical purposes, it suffices to know that overstretched inter-word whitespace is penalized very heavily and that under-full lines are also penalized. To get a sense of just how badly whitespace would have to be stretched in order to line-break your superlong word at one of the two permissible hyphenation points, consider the first paragraph below. It is typeset under the sloppy directive, which suspends most of TeX's penalties related to (a) the stretchiness of inter-word whitespace and (b) under-full lines. Observe the huge interword spaces in the first two lines and a seriously under-full third line. Not just "sloppy", but an outright assault on one's eyes!!



        To restore a semblance of decent typography, it's necessary to issue the directive raggedright; see the second paragraph. Note that the huge amounts of inter-word whitespace in the first two lines of the paragraph are gone -- at the non-negligible cost of having two additional grossly under-full lines. Observe that the 105-character word does get hyphenated if raggedright is in effect. This is because raggedright imposes a penalty for (seriously) over-full lines. By default, the raggedright setting disables most hyphenation operations, since each "act" of hyphenation carries a sizable TeX penalty. But, for the paragraph at hand, the over-full line carries a larger penalty than does the act of hyphenation.



        Incidentally, if one omits the hyphenation instruction, TeX is able (somewhat surprisingly, to me at least) to find reasonably "decent" hyphenation points.



        enter image description here



        documentclass{report}
        usepackage[english]{babel}
        %%selectlanguage{english} % not needed
        hyphenation{temporincididuntutlaboreetdolo-remagna-aliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut}

        usepackage{showframe} % to indicate edges of text block

        begin{document}
        sloppy
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

        medskip
        fussy % opposite of "sloppy"
        raggedright % suspend full justification
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiut aliquip ex ea commodo consequat.

        end{document}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 44 mins ago

























        answered 1 hour ago









        MicoMico

        277k30378766




        277k30378766






























            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%2f472339%2fwhy-doesnt-tex-hyphenate-a-really-long-word-for-which-ive-indicated-some-permi%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

            Loup dans la culture

            How to solve the problem of ntp “Unable to contact time server” from KDE?

            ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux