Allowing figures to break paragraphs












5















As it seems, the placement option [!htb] only allows the figure to be placed between paragraphs. But what if the best placement is "inside" a paragraph? See, for instance:



documentclass{article}
usepackage{graphicx}
usepackage{lipsum}

begin{document}

lipsum[1]

begin{figure}[!htb]
includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
caption{Some caption}
end{figure}

end{document}


On the left side of the figure above I show the output of the minimal example above. As you can see, I'm left with an undesirable blank space. In my view, the optimal placement would be the one on the right side, but currently my code don't see breaking the text as an option. Why not? Is there a way to make it happen? Of course it'd work if I manually broke the paragraph, but I want LaTeX to automatically recognize this placement situation.



enter image description here



PS: I tried to use the wrapfig package, but apparently it only works for cases where the figure "coexists" with the text on the same line.










share|improve this question























  • figures can be placed mid-paragraph, or mid-sentence, but you have placed it at the end of the docuemnt, so it isn't clear what other outcome you expect in this case.

    – David Carlisle
    Feb 2 at 21:57
















5















As it seems, the placement option [!htb] only allows the figure to be placed between paragraphs. But what if the best placement is "inside" a paragraph? See, for instance:



documentclass{article}
usepackage{graphicx}
usepackage{lipsum}

begin{document}

lipsum[1]

begin{figure}[!htb]
includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
caption{Some caption}
end{figure}

end{document}


On the left side of the figure above I show the output of the minimal example above. As you can see, I'm left with an undesirable blank space. In my view, the optimal placement would be the one on the right side, but currently my code don't see breaking the text as an option. Why not? Is there a way to make it happen? Of course it'd work if I manually broke the paragraph, but I want LaTeX to automatically recognize this placement situation.



enter image description here



PS: I tried to use the wrapfig package, but apparently it only works for cases where the figure "coexists" with the text on the same line.










share|improve this question























  • figures can be placed mid-paragraph, or mid-sentence, but you have placed it at the end of the docuemnt, so it isn't clear what other outcome you expect in this case.

    – David Carlisle
    Feb 2 at 21:57














5












5








5








As it seems, the placement option [!htb] only allows the figure to be placed between paragraphs. But what if the best placement is "inside" a paragraph? See, for instance:



documentclass{article}
usepackage{graphicx}
usepackage{lipsum}

begin{document}

lipsum[1]

begin{figure}[!htb]
includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
caption{Some caption}
end{figure}

end{document}


On the left side of the figure above I show the output of the minimal example above. As you can see, I'm left with an undesirable blank space. In my view, the optimal placement would be the one on the right side, but currently my code don't see breaking the text as an option. Why not? Is there a way to make it happen? Of course it'd work if I manually broke the paragraph, but I want LaTeX to automatically recognize this placement situation.



enter image description here



PS: I tried to use the wrapfig package, but apparently it only works for cases where the figure "coexists" with the text on the same line.










share|improve this question














As it seems, the placement option [!htb] only allows the figure to be placed between paragraphs. But what if the best placement is "inside" a paragraph? See, for instance:



documentclass{article}
usepackage{graphicx}
usepackage{lipsum}

begin{document}

lipsum[1]

begin{figure}[!htb]
includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
caption{Some caption}
end{figure}

end{document}


On the left side of the figure above I show the output of the minimal example above. As you can see, I'm left with an undesirable blank space. In my view, the optimal placement would be the one on the right side, but currently my code don't see breaking the text as an option. Why not? Is there a way to make it happen? Of course it'd work if I manually broke the paragraph, but I want LaTeX to automatically recognize this placement situation.



enter image description here



PS: I tried to use the wrapfig package, but apparently it only works for cases where the figure "coexists" with the text on the same line.







floats positioning paragraphs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 2 at 21:52









Pericles CarvalhoPericles Carvalho

261




261













  • figures can be placed mid-paragraph, or mid-sentence, but you have placed it at the end of the docuemnt, so it isn't clear what other outcome you expect in this case.

    – David Carlisle
    Feb 2 at 21:57



















  • figures can be placed mid-paragraph, or mid-sentence, but you have placed it at the end of the docuemnt, so it isn't clear what other outcome you expect in this case.

    – David Carlisle
    Feb 2 at 21:57

















figures can be placed mid-paragraph, or mid-sentence, but you have placed it at the end of the docuemnt, so it isn't clear what other outcome you expect in this case.

– David Carlisle
Feb 2 at 21:57





figures can be placed mid-paragraph, or mid-sentence, but you have placed it at the end of the docuemnt, so it isn't clear what other outcome you expect in this case.

– David Carlisle
Feb 2 at 21:57










2 Answers
2






active

oldest

votes


















7














In your example you had placed the figure after the first paragraph had been set.



enter image description here



documentclass{article}
usepackage{graphicx}
usepackage{lipsum}

begin{document}

begin{figure}[bp!]
includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
caption{Some caption}
end{figure}

lipsum[1]


end{document}


Note I used ! here as the figure takes up more space than normally allowed on text pages. You had omitted p which makes it much harder to place the figure.






share|improve this answer
























  • Thanks, but I don't understand... Shouldn't LaTeX search for the best placement regardless of the position in which I put the figure in the code? Why simply putting the figure below the text in the code would make such a mess?

    – Pericles Carvalho
    Feb 2 at 22:13











  • @PericlesCarvalho LaTeX does not have the whole document in memory once a page break decision is made it can not go back

    – David Carlisle
    Feb 2 at 22:22











  • @PericlesCarvalho in fact as you prevented p and placed it too late in the document for h, t or b the figure wasn't placed at all until it was flushed out into a forced float page by the implicit clearpage at end{document}

    – David Carlisle
    Feb 2 at 22:26



















4














If you place your figure early enough in your text, it can be placed within the paragraph




  • if the available space permits this (your figure seems to be very tall, this might conflict with the allowed fraction of floats per page...)


  • and you don't have empty lines around your figure, these would add an additional paragraph within your text





documentclass{article}
usepackage{graphicx}
usepackage{lipsum}

begin{document}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas. Mauris ut
begin{figure}[hb!]
includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
caption{Some caption}
end{figure}
leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur- abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.



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%2f473103%2fallowing-figures-to-break-paragraphs%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









    7














    In your example you had placed the figure after the first paragraph had been set.



    enter image description here



    documentclass{article}
    usepackage{graphicx}
    usepackage{lipsum}

    begin{document}

    begin{figure}[bp!]
    includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
    caption{Some caption}
    end{figure}

    lipsum[1]


    end{document}


    Note I used ! here as the figure takes up more space than normally allowed on text pages. You had omitted p which makes it much harder to place the figure.






    share|improve this answer
























    • Thanks, but I don't understand... Shouldn't LaTeX search for the best placement regardless of the position in which I put the figure in the code? Why simply putting the figure below the text in the code would make such a mess?

      – Pericles Carvalho
      Feb 2 at 22:13











    • @PericlesCarvalho LaTeX does not have the whole document in memory once a page break decision is made it can not go back

      – David Carlisle
      Feb 2 at 22:22











    • @PericlesCarvalho in fact as you prevented p and placed it too late in the document for h, t or b the figure wasn't placed at all until it was flushed out into a forced float page by the implicit clearpage at end{document}

      – David Carlisle
      Feb 2 at 22:26
















    7














    In your example you had placed the figure after the first paragraph had been set.



    enter image description here



    documentclass{article}
    usepackage{graphicx}
    usepackage{lipsum}

    begin{document}

    begin{figure}[bp!]
    includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
    caption{Some caption}
    end{figure}

    lipsum[1]


    end{document}


    Note I used ! here as the figure takes up more space than normally allowed on text pages. You had omitted p which makes it much harder to place the figure.






    share|improve this answer
























    • Thanks, but I don't understand... Shouldn't LaTeX search for the best placement regardless of the position in which I put the figure in the code? Why simply putting the figure below the text in the code would make such a mess?

      – Pericles Carvalho
      Feb 2 at 22:13











    • @PericlesCarvalho LaTeX does not have the whole document in memory once a page break decision is made it can not go back

      – David Carlisle
      Feb 2 at 22:22











    • @PericlesCarvalho in fact as you prevented p and placed it too late in the document for h, t or b the figure wasn't placed at all until it was flushed out into a forced float page by the implicit clearpage at end{document}

      – David Carlisle
      Feb 2 at 22:26














    7












    7








    7







    In your example you had placed the figure after the first paragraph had been set.



    enter image description here



    documentclass{article}
    usepackage{graphicx}
    usepackage{lipsum}

    begin{document}

    begin{figure}[bp!]
    includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
    caption{Some caption}
    end{figure}

    lipsum[1]


    end{document}


    Note I used ! here as the figure takes up more space than normally allowed on text pages. You had omitted p which makes it much harder to place the figure.






    share|improve this answer













    In your example you had placed the figure after the first paragraph had been set.



    enter image description here



    documentclass{article}
    usepackage{graphicx}
    usepackage{lipsum}

    begin{document}

    begin{figure}[bp!]
    includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
    caption{Some caption}
    end{figure}

    lipsum[1]


    end{document}


    Note I used ! here as the figure takes up more space than normally allowed on text pages. You had omitted p which makes it much harder to place the figure.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 2 at 22:01









    David CarlisleDavid Carlisle

    499k4111451895




    499k4111451895













    • Thanks, but I don't understand... Shouldn't LaTeX search for the best placement regardless of the position in which I put the figure in the code? Why simply putting the figure below the text in the code would make such a mess?

      – Pericles Carvalho
      Feb 2 at 22:13











    • @PericlesCarvalho LaTeX does not have the whole document in memory once a page break decision is made it can not go back

      – David Carlisle
      Feb 2 at 22:22











    • @PericlesCarvalho in fact as you prevented p and placed it too late in the document for h, t or b the figure wasn't placed at all until it was flushed out into a forced float page by the implicit clearpage at end{document}

      – David Carlisle
      Feb 2 at 22:26



















    • Thanks, but I don't understand... Shouldn't LaTeX search for the best placement regardless of the position in which I put the figure in the code? Why simply putting the figure below the text in the code would make such a mess?

      – Pericles Carvalho
      Feb 2 at 22:13











    • @PericlesCarvalho LaTeX does not have the whole document in memory once a page break decision is made it can not go back

      – David Carlisle
      Feb 2 at 22:22











    • @PericlesCarvalho in fact as you prevented p and placed it too late in the document for h, t or b the figure wasn't placed at all until it was flushed out into a forced float page by the implicit clearpage at end{document}

      – David Carlisle
      Feb 2 at 22:26

















    Thanks, but I don't understand... Shouldn't LaTeX search for the best placement regardless of the position in which I put the figure in the code? Why simply putting the figure below the text in the code would make such a mess?

    – Pericles Carvalho
    Feb 2 at 22:13





    Thanks, but I don't understand... Shouldn't LaTeX search for the best placement regardless of the position in which I put the figure in the code? Why simply putting the figure below the text in the code would make such a mess?

    – Pericles Carvalho
    Feb 2 at 22:13













    @PericlesCarvalho LaTeX does not have the whole document in memory once a page break decision is made it can not go back

    – David Carlisle
    Feb 2 at 22:22





    @PericlesCarvalho LaTeX does not have the whole document in memory once a page break decision is made it can not go back

    – David Carlisle
    Feb 2 at 22:22













    @PericlesCarvalho in fact as you prevented p and placed it too late in the document for h, t or b the figure wasn't placed at all until it was flushed out into a forced float page by the implicit clearpage at end{document}

    – David Carlisle
    Feb 2 at 22:26





    @PericlesCarvalho in fact as you prevented p and placed it too late in the document for h, t or b the figure wasn't placed at all until it was flushed out into a forced float page by the implicit clearpage at end{document}

    – David Carlisle
    Feb 2 at 22:26











    4














    If you place your figure early enough in your text, it can be placed within the paragraph




    • if the available space permits this (your figure seems to be very tall, this might conflict with the allowed fraction of floats per page...)


    • and you don't have empty lines around your figure, these would add an additional paragraph within your text





    documentclass{article}
    usepackage{graphicx}
    usepackage{lipsum}

    begin{document}

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
    adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique
    senectus et netus et malesuada fames ac turpis egestas. Mauris ut
    begin{figure}[hb!]
    includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
    caption{Some caption}
    end{figure}
    leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur- abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.



    end{document}





    share|improve this answer






























      4














      If you place your figure early enough in your text, it can be placed within the paragraph




      • if the available space permits this (your figure seems to be very tall, this might conflict with the allowed fraction of floats per page...)


      • and you don't have empty lines around your figure, these would add an additional paragraph within your text





      documentclass{article}
      usepackage{graphicx}
      usepackage{lipsum}

      begin{document}

      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
      adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique
      senectus et netus et malesuada fames ac turpis egestas. Mauris ut
      begin{figure}[hb!]
      includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
      caption{Some caption}
      end{figure}
      leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur- abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.



      end{document}





      share|improve this answer




























        4












        4








        4







        If you place your figure early enough in your text, it can be placed within the paragraph




        • if the available space permits this (your figure seems to be very tall, this might conflict with the allowed fraction of floats per page...)


        • and you don't have empty lines around your figure, these would add an additional paragraph within your text





        documentclass{article}
        usepackage{graphicx}
        usepackage{lipsum}

        begin{document}

        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
        adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique
        senectus et netus et malesuada fames ac turpis egestas. Mauris ut
        begin{figure}[hb!]
        includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
        caption{Some caption}
        end{figure}
        leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur- abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.



        end{document}





        share|improve this answer















        If you place your figure early enough in your text, it can be placed within the paragraph




        • if the available space permits this (your figure seems to be very tall, this might conflict with the allowed fraction of floats per page...)


        • and you don't have empty lines around your figure, these would add an additional paragraph within your text





        documentclass{article}
        usepackage{graphicx}
        usepackage{lipsum}

        begin{document}

        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
        adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique
        senectus et netus et malesuada fames ac turpis egestas. Mauris ut
        begin{figure}[hb!]
        includegraphics[width=textwidth,height=0.8textheight]{example-image-a}
        caption{Some caption}
        end{figure}
        leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur- abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.



        end{document}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 2 at 22:03

























        answered Feb 2 at 21:58









        user36296user36296

        1




        1






























            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%2f473103%2fallowing-figures-to-break-paragraphs%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

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

            A Topological Invariant for $pi_3(U(n))$