Algorithm keeps appearing on the last page of my latex document The Next CEO of Stack...

How to make a software documentation "officially" citable?

Trouble understanding the speech of overseas colleagues

Opposite of a diet

Can the Reverse Gravity spell affect the Meteor Swarm spell?

Inappropriate reference requests from Journal reviewers

Why do remote companies require working in the US?

Is HostGator storing my password in plaintext?

Whats the best way to handle refactoring a big file?

Only print output after finding pattern

Rotate a column

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

WOW air has ceased operation, can I get my tickets refunded?

Why here is plural "We went to the movies last night."

What is the difference between "behavior" and "behaviour"?

How do I solve this limit?

Describing a person. What needs to be mentioned?

Term for the "extreme-extension" version of a straw man fallacy?

Horror movie/show or scene where a horse creature opens its mouth really wide and devours a man in a stables

Is it safe to use c_str() on a temporary string?

How to Reset Passwords on Multiple Websites Easily?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Apart from "berlinern", do any other German dialects have a corresponding verb?

Why were Madagascar and New Zealand discovered so late?

How can I open an app using Terminal?



Algorithm keeps appearing on the last page of my latex document



The Next CEO of Stack OverflowAlgorithm indent problem with sig-alternate document & algorithm(ic) packageAlgorithmic package in two different languages in same documentIf algorithm in LatexDoes parbox has any conflict with the loop in algorithm?How to use Function in latex algorithm?latex algorithm displaying problems: lines are overlappedHow to remove page number for the page includes “algorithm pseudo-code”?Algorithm In latex Elsevier templateDisable algorithm numbers for only certain algorithms in a documentlatex Algorithm












3















I am writing an algorithm with the algorithmic environment and Latex keeps pushing it on the last page, no matter what I do, this is just a short example.



documentclass[a4paper,10pt, twoside]{book}
usepackage{algorithm}
usepackage{algorithmic}
usepackage[utf8]{inputenc}


begin{document}
begin{algorithm}[h]
caption{my algorithm}
label{alg:example}
begin{algorithmic}
STATE REQUIRE (F, G, j)
STATE (B_{1} = {b_{1}[1],dots,b_{1}[|g_r|]})
STATE (B_{1})
FOR{(i=1) TO (n)}
STATE DO smoething...
STATE
ENDFOR
ENDFOR
end{algorithmic}
end{algorithm}
end{document}


The problem is that the algorithm is one page long, so I tried to put the h argument, and then after the algorithm a newpage, so that everything else comes after it. But still it just ignores all my command and puts in on the last page, no matter what I try :S










share|improve this question


















  • 1





    Welcome to TeX.SX! Obviously algorithm is an environment with floating enabled.

    – user31729
    Oct 5 '14 at 11:39











  • What Christian means is that you shouldn't specify h in the optional argument of the algorithm environment. Let that environment "float".

    – jubobs
    Oct 5 '14 at 11:42













  • @Jubobs: Yes, I was too quick ;-) More over, the code does not compile at all

    – user31729
    Oct 5 '14 at 11:43











  • Ok sorry for putting an uncompilable code there, I just tried to copy as fast as possible a short example. my fault. Oh wow it worked... But isn't figure also an floating environment, because I-ve seen a lot of examples using the htb arguments for figures?

    – user63716
    Oct 5 '14 at 11:48











  • [h] tells latex the float isn't allowed at the top of a page (as no t) or bottom (no b) or on a page of floats (no p) which gives latex very few places to place it so holding it to the end is quite likely

    – David Carlisle
    Oct 5 '14 at 11:49
















3















I am writing an algorithm with the algorithmic environment and Latex keeps pushing it on the last page, no matter what I do, this is just a short example.



documentclass[a4paper,10pt, twoside]{book}
usepackage{algorithm}
usepackage{algorithmic}
usepackage[utf8]{inputenc}


begin{document}
begin{algorithm}[h]
caption{my algorithm}
label{alg:example}
begin{algorithmic}
STATE REQUIRE (F, G, j)
STATE (B_{1} = {b_{1}[1],dots,b_{1}[|g_r|]})
STATE (B_{1})
FOR{(i=1) TO (n)}
STATE DO smoething...
STATE
ENDFOR
ENDFOR
end{algorithmic}
end{algorithm}
end{document}


The problem is that the algorithm is one page long, so I tried to put the h argument, and then after the algorithm a newpage, so that everything else comes after it. But still it just ignores all my command and puts in on the last page, no matter what I try :S










share|improve this question


















  • 1





    Welcome to TeX.SX! Obviously algorithm is an environment with floating enabled.

    – user31729
    Oct 5 '14 at 11:39











  • What Christian means is that you shouldn't specify h in the optional argument of the algorithm environment. Let that environment "float".

    – jubobs
    Oct 5 '14 at 11:42













  • @Jubobs: Yes, I was too quick ;-) More over, the code does not compile at all

    – user31729
    Oct 5 '14 at 11:43











  • Ok sorry for putting an uncompilable code there, I just tried to copy as fast as possible a short example. my fault. Oh wow it worked... But isn't figure also an floating environment, because I-ve seen a lot of examples using the htb arguments for figures?

    – user63716
    Oct 5 '14 at 11:48











  • [h] tells latex the float isn't allowed at the top of a page (as no t) or bottom (no b) or on a page of floats (no p) which gives latex very few places to place it so holding it to the end is quite likely

    – David Carlisle
    Oct 5 '14 at 11:49














3












3








3








I am writing an algorithm with the algorithmic environment and Latex keeps pushing it on the last page, no matter what I do, this is just a short example.



documentclass[a4paper,10pt, twoside]{book}
usepackage{algorithm}
usepackage{algorithmic}
usepackage[utf8]{inputenc}


begin{document}
begin{algorithm}[h]
caption{my algorithm}
label{alg:example}
begin{algorithmic}
STATE REQUIRE (F, G, j)
STATE (B_{1} = {b_{1}[1],dots,b_{1}[|g_r|]})
STATE (B_{1})
FOR{(i=1) TO (n)}
STATE DO smoething...
STATE
ENDFOR
ENDFOR
end{algorithmic}
end{algorithm}
end{document}


The problem is that the algorithm is one page long, so I tried to put the h argument, and then after the algorithm a newpage, so that everything else comes after it. But still it just ignores all my command and puts in on the last page, no matter what I try :S










share|improve this question














I am writing an algorithm with the algorithmic environment and Latex keeps pushing it on the last page, no matter what I do, this is just a short example.



documentclass[a4paper,10pt, twoside]{book}
usepackage{algorithm}
usepackage{algorithmic}
usepackage[utf8]{inputenc}


begin{document}
begin{algorithm}[h]
caption{my algorithm}
label{alg:example}
begin{algorithmic}
STATE REQUIRE (F, G, j)
STATE (B_{1} = {b_{1}[1],dots,b_{1}[|g_r|]})
STATE (B_{1})
FOR{(i=1) TO (n)}
STATE DO smoething...
STATE
ENDFOR
ENDFOR
end{algorithmic}
end{algorithm}
end{document}


The problem is that the algorithm is one page long, so I tried to put the h argument, and then after the algorithm a newpage, so that everything else comes after it. But still it just ignores all my command and puts in on the last page, no matter what I try :S







algorithms algorithmic






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 5 '14 at 11:36









user63716user63716

6113




6113








  • 1





    Welcome to TeX.SX! Obviously algorithm is an environment with floating enabled.

    – user31729
    Oct 5 '14 at 11:39











  • What Christian means is that you shouldn't specify h in the optional argument of the algorithm environment. Let that environment "float".

    – jubobs
    Oct 5 '14 at 11:42













  • @Jubobs: Yes, I was too quick ;-) More over, the code does not compile at all

    – user31729
    Oct 5 '14 at 11:43











  • Ok sorry for putting an uncompilable code there, I just tried to copy as fast as possible a short example. my fault. Oh wow it worked... But isn't figure also an floating environment, because I-ve seen a lot of examples using the htb arguments for figures?

    – user63716
    Oct 5 '14 at 11:48











  • [h] tells latex the float isn't allowed at the top of a page (as no t) or bottom (no b) or on a page of floats (no p) which gives latex very few places to place it so holding it to the end is quite likely

    – David Carlisle
    Oct 5 '14 at 11:49














  • 1





    Welcome to TeX.SX! Obviously algorithm is an environment with floating enabled.

    – user31729
    Oct 5 '14 at 11:39











  • What Christian means is that you shouldn't specify h in the optional argument of the algorithm environment. Let that environment "float".

    – jubobs
    Oct 5 '14 at 11:42













  • @Jubobs: Yes, I was too quick ;-) More over, the code does not compile at all

    – user31729
    Oct 5 '14 at 11:43











  • Ok sorry for putting an uncompilable code there, I just tried to copy as fast as possible a short example. my fault. Oh wow it worked... But isn't figure also an floating environment, because I-ve seen a lot of examples using the htb arguments for figures?

    – user63716
    Oct 5 '14 at 11:48











  • [h] tells latex the float isn't allowed at the top of a page (as no t) or bottom (no b) or on a page of floats (no p) which gives latex very few places to place it so holding it to the end is quite likely

    – David Carlisle
    Oct 5 '14 at 11:49








1




1





Welcome to TeX.SX! Obviously algorithm is an environment with floating enabled.

– user31729
Oct 5 '14 at 11:39





Welcome to TeX.SX! Obviously algorithm is an environment with floating enabled.

– user31729
Oct 5 '14 at 11:39













What Christian means is that you shouldn't specify h in the optional argument of the algorithm environment. Let that environment "float".

– jubobs
Oct 5 '14 at 11:42







What Christian means is that you shouldn't specify h in the optional argument of the algorithm environment. Let that environment "float".

– jubobs
Oct 5 '14 at 11:42















@Jubobs: Yes, I was too quick ;-) More over, the code does not compile at all

– user31729
Oct 5 '14 at 11:43





@Jubobs: Yes, I was too quick ;-) More over, the code does not compile at all

– user31729
Oct 5 '14 at 11:43













Ok sorry for putting an uncompilable code there, I just tried to copy as fast as possible a short example. my fault. Oh wow it worked... But isn't figure also an floating environment, because I-ve seen a lot of examples using the htb arguments for figures?

– user63716
Oct 5 '14 at 11:48





Ok sorry for putting an uncompilable code there, I just tried to copy as fast as possible a short example. my fault. Oh wow it worked... But isn't figure also an floating environment, because I-ve seen a lot of examples using the htb arguments for figures?

– user63716
Oct 5 '14 at 11:48













[h] tells latex the float isn't allowed at the top of a page (as no t) or bottom (no b) or on a page of floats (no p) which gives latex very few places to place it so holding it to the end is quite likely

– David Carlisle
Oct 5 '14 at 11:49





[h] tells latex the float isn't allowed at the top of a page (as no t) or bottom (no b) or on a page of floats (no p) which gives latex very few places to place it so holding it to the end is quite likely

– David Carlisle
Oct 5 '14 at 11:49










1 Answer
1






active

oldest

votes


















0














begin{algorithm}[!]


This solved the problem





share








New contributor




Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















    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%2f204649%2falgorithm-keeps-appearing-on-the-last-page-of-my-latex-document%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









    0














    begin{algorithm}[!]


    This solved the problem





    share








    New contributor




    Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      begin{algorithm}[!]


      This solved the problem





      share








      New contributor




      Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        begin{algorithm}[!]


        This solved the problem





        share








        New contributor




        Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        begin{algorithm}[!]


        This solved the problem






        share








        New contributor




        Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.








        share


        share






        New contributor




        Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 7 mins ago









        Mohamed SalamaMohamed Salama

        1




        1




        New contributor




        Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Mohamed Salama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            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%2f204649%2falgorithm-keeps-appearing-on-the-last-page-of-my-latex-document%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

            Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

            How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

            Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...