How to organize the appearing of floats when afterpage is used?












1















earlier I asked how to rotate a page with a sidewaysfigure inside (question here). However I couldn't find a solution. I decided to use the landscape environment with afterpage, but when there's other floats near to the rotated one, the appearing order is altered.



In the following MWE, I expected to get the first page full of text, then the rotated figure, and finally the text and floats remaining.



How can I solve it?



documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{pdflscape}
usepackage{afterpage}
usepackage{rotating}
usepackage{graphics, graphicx}

begin{document}

blindtextpar%
%
afterpage{%
begin{landscape}
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-a}
caption{Figure a}
label{Fig:a}
end{figure}%
end{landscape}
clearpage%
}%
%
blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-b}
caption{Figure b}
label{Fig:b}
end{figure}
%
Blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-c}
caption{Figure c}
label{Fig:c}
end{figure}
end{document}









share|improve this question























  • figure b is only allowed to come [h]ere as you used the optional arguemt to prevent all other options so that forces it to appear in the text, and figure a you forced to come after that by using afterpage so I can't see what other order you would expect?

    – David Carlisle
    Feb 17 at 18:28











  • @DavidCarlisle I expected that the figure a comes first, because it was called first, and before the figures b and c there is a little of text explaining the figure content, then I think that is not correct to put all the floats inside the afterpage

    – Daniel Valencia C.
    Feb 17 at 19:32











  • as I explained before the content of afterpage is just an internal definition it is not interpreted at all so the first figure that tex sees is B, then A is only seen after the afterpage tokens are inserted at the start of the next page.

    – David Carlisle
    Feb 17 at 19:58











  • the whole point of floats is that they move that is why they have captions, so any text in the main document flow should refer indirectly to the figure via its label, not be written assuming that it appears in any particular place. I wouldn't use afterpage, but if you use it for one, and you want some other figures to be in the same sequence, you must use it for all.

    – David Carlisle
    Feb 17 at 20:02
















1















earlier I asked how to rotate a page with a sidewaysfigure inside (question here). However I couldn't find a solution. I decided to use the landscape environment with afterpage, but when there's other floats near to the rotated one, the appearing order is altered.



In the following MWE, I expected to get the first page full of text, then the rotated figure, and finally the text and floats remaining.



How can I solve it?



documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{pdflscape}
usepackage{afterpage}
usepackage{rotating}
usepackage{graphics, graphicx}

begin{document}

blindtextpar%
%
afterpage{%
begin{landscape}
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-a}
caption{Figure a}
label{Fig:a}
end{figure}%
end{landscape}
clearpage%
}%
%
blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-b}
caption{Figure b}
label{Fig:b}
end{figure}
%
Blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-c}
caption{Figure c}
label{Fig:c}
end{figure}
end{document}









share|improve this question























  • figure b is only allowed to come [h]ere as you used the optional arguemt to prevent all other options so that forces it to appear in the text, and figure a you forced to come after that by using afterpage so I can't see what other order you would expect?

    – David Carlisle
    Feb 17 at 18:28











  • @DavidCarlisle I expected that the figure a comes first, because it was called first, and before the figures b and c there is a little of text explaining the figure content, then I think that is not correct to put all the floats inside the afterpage

    – Daniel Valencia C.
    Feb 17 at 19:32











  • as I explained before the content of afterpage is just an internal definition it is not interpreted at all so the first figure that tex sees is B, then A is only seen after the afterpage tokens are inserted at the start of the next page.

    – David Carlisle
    Feb 17 at 19:58











  • the whole point of floats is that they move that is why they have captions, so any text in the main document flow should refer indirectly to the figure via its label, not be written assuming that it appears in any particular place. I wouldn't use afterpage, but if you use it for one, and you want some other figures to be in the same sequence, you must use it for all.

    – David Carlisle
    Feb 17 at 20:02














1












1








1








earlier I asked how to rotate a page with a sidewaysfigure inside (question here). However I couldn't find a solution. I decided to use the landscape environment with afterpage, but when there's other floats near to the rotated one, the appearing order is altered.



In the following MWE, I expected to get the first page full of text, then the rotated figure, and finally the text and floats remaining.



How can I solve it?



documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{pdflscape}
usepackage{afterpage}
usepackage{rotating}
usepackage{graphics, graphicx}

begin{document}

blindtextpar%
%
afterpage{%
begin{landscape}
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-a}
caption{Figure a}
label{Fig:a}
end{figure}%
end{landscape}
clearpage%
}%
%
blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-b}
caption{Figure b}
label{Fig:b}
end{figure}
%
Blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-c}
caption{Figure c}
label{Fig:c}
end{figure}
end{document}









share|improve this question














earlier I asked how to rotate a page with a sidewaysfigure inside (question here). However I couldn't find a solution. I decided to use the landscape environment with afterpage, but when there's other floats near to the rotated one, the appearing order is altered.



In the following MWE, I expected to get the first page full of text, then the rotated figure, and finally the text and floats remaining.



How can I solve it?



documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{pdflscape}
usepackage{afterpage}
usepackage{rotating}
usepackage{graphics, graphicx}

begin{document}

blindtextpar%
%
afterpage{%
begin{landscape}
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-a}
caption{Figure a}
label{Fig:a}
end{figure}%
end{landscape}
clearpage%
}%
%
blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-b}
caption{Figure b}
label{Fig:b}
end{figure}
%
Blindtextpar%
%
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{example-image-c}
caption{Figure c}
label{Fig:c}
end{figure}
end{document}






floats rotating afterpage






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 17 at 18:17









Daniel Valencia C.Daniel Valencia C.

1,108618




1,108618













  • figure b is only allowed to come [h]ere as you used the optional arguemt to prevent all other options so that forces it to appear in the text, and figure a you forced to come after that by using afterpage so I can't see what other order you would expect?

    – David Carlisle
    Feb 17 at 18:28











  • @DavidCarlisle I expected that the figure a comes first, because it was called first, and before the figures b and c there is a little of text explaining the figure content, then I think that is not correct to put all the floats inside the afterpage

    – Daniel Valencia C.
    Feb 17 at 19:32











  • as I explained before the content of afterpage is just an internal definition it is not interpreted at all so the first figure that tex sees is B, then A is only seen after the afterpage tokens are inserted at the start of the next page.

    – David Carlisle
    Feb 17 at 19:58











  • the whole point of floats is that they move that is why they have captions, so any text in the main document flow should refer indirectly to the figure via its label, not be written assuming that it appears in any particular place. I wouldn't use afterpage, but if you use it for one, and you want some other figures to be in the same sequence, you must use it for all.

    – David Carlisle
    Feb 17 at 20:02



















  • figure b is only allowed to come [h]ere as you used the optional arguemt to prevent all other options so that forces it to appear in the text, and figure a you forced to come after that by using afterpage so I can't see what other order you would expect?

    – David Carlisle
    Feb 17 at 18:28











  • @DavidCarlisle I expected that the figure a comes first, because it was called first, and before the figures b and c there is a little of text explaining the figure content, then I think that is not correct to put all the floats inside the afterpage

    – Daniel Valencia C.
    Feb 17 at 19:32











  • as I explained before the content of afterpage is just an internal definition it is not interpreted at all so the first figure that tex sees is B, then A is only seen after the afterpage tokens are inserted at the start of the next page.

    – David Carlisle
    Feb 17 at 19:58











  • the whole point of floats is that they move that is why they have captions, so any text in the main document flow should refer indirectly to the figure via its label, not be written assuming that it appears in any particular place. I wouldn't use afterpage, but if you use it for one, and you want some other figures to be in the same sequence, you must use it for all.

    – David Carlisle
    Feb 17 at 20:02

















figure b is only allowed to come [h]ere as you used the optional arguemt to prevent all other options so that forces it to appear in the text, and figure a you forced to come after that by using afterpage so I can't see what other order you would expect?

– David Carlisle
Feb 17 at 18:28





figure b is only allowed to come [h]ere as you used the optional arguemt to prevent all other options so that forces it to appear in the text, and figure a you forced to come after that by using afterpage so I can't see what other order you would expect?

– David Carlisle
Feb 17 at 18:28













@DavidCarlisle I expected that the figure a comes first, because it was called first, and before the figures b and c there is a little of text explaining the figure content, then I think that is not correct to put all the floats inside the afterpage

– Daniel Valencia C.
Feb 17 at 19:32





@DavidCarlisle I expected that the figure a comes first, because it was called first, and before the figures b and c there is a little of text explaining the figure content, then I think that is not correct to put all the floats inside the afterpage

– Daniel Valencia C.
Feb 17 at 19:32













as I explained before the content of afterpage is just an internal definition it is not interpreted at all so the first figure that tex sees is B, then A is only seen after the afterpage tokens are inserted at the start of the next page.

– David Carlisle
Feb 17 at 19:58





as I explained before the content of afterpage is just an internal definition it is not interpreted at all so the first figure that tex sees is B, then A is only seen after the afterpage tokens are inserted at the start of the next page.

– David Carlisle
Feb 17 at 19:58













the whole point of floats is that they move that is why they have captions, so any text in the main document flow should refer indirectly to the figure via its label, not be written assuming that it appears in any particular place. I wouldn't use afterpage, but if you use it for one, and you want some other figures to be in the same sequence, you must use it for all.

– David Carlisle
Feb 17 at 20:02





the whole point of floats is that they move that is why they have captions, so any text in the main document flow should refer indirectly to the figure via its label, not be written assuming that it appears in any particular place. I wouldn't use afterpage, but if you use it for one, and you want some other figures to be in the same sequence, you must use it for all.

– David Carlisle
Feb 17 at 20:02










1 Answer
1






active

oldest

votes


















2














You were explictly forcing A to come after B, if I understand you correctly you want something more like



enter image description here



documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{pdflscape}
usepackage{afterpage}
usepackage{rotating}
usepackage{graphics, graphicx}

begin{document}

blindtextpar%
%
afterpage{%
begin{landscape}
begin{figure}
centering
includegraphics[width=0.7linewidth]{example-image-a}
caption{Figure a}
label{Fig:a}
end{figure}%
end{landscape}
begin{figure}
centering
includegraphics[width=0.7linewidth]{example-image-b}
caption{Figure b}
label{Fig:b}
end{figure}
begin{figure}
centering
includegraphics[width=0.7linewidth]{example-image-c}
caption{Figure c}
label{Fig:c}
end{figure}
}%
%
blindtextpar%
%

%
Blindtextpar%
%
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%2f475367%2fhow-to-organize-the-appearing-of-floats-when-afterpage-is-used%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









    2














    You were explictly forcing A to come after B, if I understand you correctly you want something more like



    enter image description here



    documentclass[12pt,a4paper]{article}
    usepackage{blindtext}
    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}
    usepackage{pdflscape}
    usepackage{afterpage}
    usepackage{rotating}
    usepackage{graphics, graphicx}

    begin{document}

    blindtextpar%
    %
    afterpage{%
    begin{landscape}
    begin{figure}
    centering
    includegraphics[width=0.7linewidth]{example-image-a}
    caption{Figure a}
    label{Fig:a}
    end{figure}%
    end{landscape}
    begin{figure}
    centering
    includegraphics[width=0.7linewidth]{example-image-b}
    caption{Figure b}
    label{Fig:b}
    end{figure}
    begin{figure}
    centering
    includegraphics[width=0.7linewidth]{example-image-c}
    caption{Figure c}
    label{Fig:c}
    end{figure}
    }%
    %
    blindtextpar%
    %

    %
    Blindtextpar%
    %
    end{document}





    share|improve this answer




























      2














      You were explictly forcing A to come after B, if I understand you correctly you want something more like



      enter image description here



      documentclass[12pt,a4paper]{article}
      usepackage{blindtext}
      usepackage[utf8]{inputenc}
      usepackage[T1]{fontenc}
      usepackage{pdflscape}
      usepackage{afterpage}
      usepackage{rotating}
      usepackage{graphics, graphicx}

      begin{document}

      blindtextpar%
      %
      afterpage{%
      begin{landscape}
      begin{figure}
      centering
      includegraphics[width=0.7linewidth]{example-image-a}
      caption{Figure a}
      label{Fig:a}
      end{figure}%
      end{landscape}
      begin{figure}
      centering
      includegraphics[width=0.7linewidth]{example-image-b}
      caption{Figure b}
      label{Fig:b}
      end{figure}
      begin{figure}
      centering
      includegraphics[width=0.7linewidth]{example-image-c}
      caption{Figure c}
      label{Fig:c}
      end{figure}
      }%
      %
      blindtextpar%
      %

      %
      Blindtextpar%
      %
      end{document}





      share|improve this answer


























        2












        2








        2







        You were explictly forcing A to come after B, if I understand you correctly you want something more like



        enter image description here



        documentclass[12pt,a4paper]{article}
        usepackage{blindtext}
        usepackage[utf8]{inputenc}
        usepackage[T1]{fontenc}
        usepackage{pdflscape}
        usepackage{afterpage}
        usepackage{rotating}
        usepackage{graphics, graphicx}

        begin{document}

        blindtextpar%
        %
        afterpage{%
        begin{landscape}
        begin{figure}
        centering
        includegraphics[width=0.7linewidth]{example-image-a}
        caption{Figure a}
        label{Fig:a}
        end{figure}%
        end{landscape}
        begin{figure}
        centering
        includegraphics[width=0.7linewidth]{example-image-b}
        caption{Figure b}
        label{Fig:b}
        end{figure}
        begin{figure}
        centering
        includegraphics[width=0.7linewidth]{example-image-c}
        caption{Figure c}
        label{Fig:c}
        end{figure}
        }%
        %
        blindtextpar%
        %

        %
        Blindtextpar%
        %
        end{document}





        share|improve this answer













        You were explictly forcing A to come after B, if I understand you correctly you want something more like



        enter image description here



        documentclass[12pt,a4paper]{article}
        usepackage{blindtext}
        usepackage[utf8]{inputenc}
        usepackage[T1]{fontenc}
        usepackage{pdflscape}
        usepackage{afterpage}
        usepackage{rotating}
        usepackage{graphics, graphicx}

        begin{document}

        blindtextpar%
        %
        afterpage{%
        begin{landscape}
        begin{figure}
        centering
        includegraphics[width=0.7linewidth]{example-image-a}
        caption{Figure a}
        label{Fig:a}
        end{figure}%
        end{landscape}
        begin{figure}
        centering
        includegraphics[width=0.7linewidth]{example-image-b}
        caption{Figure b}
        label{Fig:b}
        end{figure}
        begin{figure}
        centering
        includegraphics[width=0.7linewidth]{example-image-c}
        caption{Figure c}
        label{Fig:c}
        end{figure}
        }%
        %
        blindtextpar%
        %

        %
        Blindtextpar%
        %
        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 17 at 18:32









        David CarlisleDavid Carlisle

        492k4111371885




        492k4111371885






























            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%2f475367%2fhow-to-organize-the-appearing-of-floats-when-afterpage-is-used%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

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?