Force all floats to appear at top of page [duplicate]












2
















This question already has an answer here:




  • Override positioning of all figures

    1 answer




Is there any easy and global way of forcing all floats (figures, tables etc) to appear on the top of pages only?
Meaning, I want to avoid placing at every figure etc the [t] explicitly.










share|improve this question













marked as duplicate by Werner floats
Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 28 at 19:02


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 2





    maybe try makeatletter deffps@figure{t} deffps@table{t} makeatother

    – samcarter
    Jan 28 at 18:21


















2
















This question already has an answer here:




  • Override positioning of all figures

    1 answer




Is there any easy and global way of forcing all floats (figures, tables etc) to appear on the top of pages only?
Meaning, I want to avoid placing at every figure etc the [t] explicitly.










share|improve this question













marked as duplicate by Werner floats
Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 28 at 19:02


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 2





    maybe try makeatletter deffps@figure{t} deffps@table{t} makeatother

    – samcarter
    Jan 28 at 18:21
















2












2








2









This question already has an answer here:




  • Override positioning of all figures

    1 answer




Is there any easy and global way of forcing all floats (figures, tables etc) to appear on the top of pages only?
Meaning, I want to avoid placing at every figure etc the [t] explicitly.










share|improve this question















This question already has an answer here:




  • Override positioning of all figures

    1 answer




Is there any easy and global way of forcing all floats (figures, tables etc) to appear on the top of pages only?
Meaning, I want to avoid placing at every figure etc the [t] explicitly.





This question already has an answer here:




  • Override positioning of all figures

    1 answer








floats






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 28 at 18:11









bonanzabonanza

8031524




8031524




marked as duplicate by Werner floats
Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 28 at 19:02


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Werner floats
Users with the  floats badge can single-handedly close floats questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 28 at 19:02


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 2





    maybe try makeatletter deffps@figure{t} deffps@table{t} makeatother

    – samcarter
    Jan 28 at 18:21
















  • 2





    maybe try makeatletter deffps@figure{t} deffps@table{t} makeatother

    – samcarter
    Jan 28 at 18:21










2




2





maybe try makeatletter deffps@figure{t} deffps@table{t} makeatother

– samcarter
Jan 28 at 18:21







maybe try makeatletter deffps@figure{t} deffps@table{t} makeatother

– samcarter
Jan 28 at 18:21












2 Answers
2






active

oldest

votes


















3














You can use, as samcarter said in her comment



makeatletter
deffps@figure{t}
makeatother


so that the default for figures will be [t]. More generally,



makeatletter
deffps@<float type>{t}
makeatother


so that the default for <float type> will be [t].



If you want this to affect all floats, then use:



makeatletter
def@float#1{%
@ifnextchar[%
{@xfloat{#1}}%
{@xfloat{#1}[t]}}%
makeatother


Both methods will still allow you to use the optional argument to override the default.





Note that by doing this you are placing a big restriction on where LaTeX is allowed to place floats, so you might run into trouble. I'd suggest you use at least tp, to allow float-only pages, so LaTeX will have some room to work.






share|improve this answer
























  • Thanks so much! It seems to work fine for figures and tables, but not for algorithm2e or is this a non-floating environment?

    – bonanza
    Jan 28 at 18:25






  • 1





    @bonanza Hm... It seems that algorithm2e does define a floating environment, but uses some strange argument handling internally. The floating environment is not defined in the "usual" way. Try this and tell me if it worked: makeatletter edefalgorithm{% noexpand@protected@testoptnoexpandalgorithm expandafternoexpandcsnamestringalgorithmendcsname{t}% }% makeatother

    – Phelype Oleinik
    Jan 28 at 18:51











  • Works perfectly for algorithm2e, thanks!

    – bonanza
    Jan 28 at 20:08



















2














Load the float package and specify



floatplacement{<float>}{<specifier>}


where <float> is a defined float (like figure, table or defined via newfloat) and <specifier> covers what you would specify as the optional parameter to the float (from !, here, top, bottom, page, HERE).






share|improve this answer






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    You can use, as samcarter said in her comment



    makeatletter
    deffps@figure{t}
    makeatother


    so that the default for figures will be [t]. More generally,



    makeatletter
    deffps@<float type>{t}
    makeatother


    so that the default for <float type> will be [t].



    If you want this to affect all floats, then use:



    makeatletter
    def@float#1{%
    @ifnextchar[%
    {@xfloat{#1}}%
    {@xfloat{#1}[t]}}%
    makeatother


    Both methods will still allow you to use the optional argument to override the default.





    Note that by doing this you are placing a big restriction on where LaTeX is allowed to place floats, so you might run into trouble. I'd suggest you use at least tp, to allow float-only pages, so LaTeX will have some room to work.






    share|improve this answer
























    • Thanks so much! It seems to work fine for figures and tables, but not for algorithm2e or is this a non-floating environment?

      – bonanza
      Jan 28 at 18:25






    • 1





      @bonanza Hm... It seems that algorithm2e does define a floating environment, but uses some strange argument handling internally. The floating environment is not defined in the "usual" way. Try this and tell me if it worked: makeatletter edefalgorithm{% noexpand@protected@testoptnoexpandalgorithm expandafternoexpandcsnamestringalgorithmendcsname{t}% }% makeatother

      – Phelype Oleinik
      Jan 28 at 18:51











    • Works perfectly for algorithm2e, thanks!

      – bonanza
      Jan 28 at 20:08
















    3














    You can use, as samcarter said in her comment



    makeatletter
    deffps@figure{t}
    makeatother


    so that the default for figures will be [t]. More generally,



    makeatletter
    deffps@<float type>{t}
    makeatother


    so that the default for <float type> will be [t].



    If you want this to affect all floats, then use:



    makeatletter
    def@float#1{%
    @ifnextchar[%
    {@xfloat{#1}}%
    {@xfloat{#1}[t]}}%
    makeatother


    Both methods will still allow you to use the optional argument to override the default.





    Note that by doing this you are placing a big restriction on where LaTeX is allowed to place floats, so you might run into trouble. I'd suggest you use at least tp, to allow float-only pages, so LaTeX will have some room to work.






    share|improve this answer
























    • Thanks so much! It seems to work fine for figures and tables, but not for algorithm2e or is this a non-floating environment?

      – bonanza
      Jan 28 at 18:25






    • 1





      @bonanza Hm... It seems that algorithm2e does define a floating environment, but uses some strange argument handling internally. The floating environment is not defined in the "usual" way. Try this and tell me if it worked: makeatletter edefalgorithm{% noexpand@protected@testoptnoexpandalgorithm expandafternoexpandcsnamestringalgorithmendcsname{t}% }% makeatother

      – Phelype Oleinik
      Jan 28 at 18:51











    • Works perfectly for algorithm2e, thanks!

      – bonanza
      Jan 28 at 20:08














    3












    3








    3







    You can use, as samcarter said in her comment



    makeatletter
    deffps@figure{t}
    makeatother


    so that the default for figures will be [t]. More generally,



    makeatletter
    deffps@<float type>{t}
    makeatother


    so that the default for <float type> will be [t].



    If you want this to affect all floats, then use:



    makeatletter
    def@float#1{%
    @ifnextchar[%
    {@xfloat{#1}}%
    {@xfloat{#1}[t]}}%
    makeatother


    Both methods will still allow you to use the optional argument to override the default.





    Note that by doing this you are placing a big restriction on where LaTeX is allowed to place floats, so you might run into trouble. I'd suggest you use at least tp, to allow float-only pages, so LaTeX will have some room to work.






    share|improve this answer













    You can use, as samcarter said in her comment



    makeatletter
    deffps@figure{t}
    makeatother


    so that the default for figures will be [t]. More generally,



    makeatletter
    deffps@<float type>{t}
    makeatother


    so that the default for <float type> will be [t].



    If you want this to affect all floats, then use:



    makeatletter
    def@float#1{%
    @ifnextchar[%
    {@xfloat{#1}}%
    {@xfloat{#1}[t]}}%
    makeatother


    Both methods will still allow you to use the optional argument to override the default.





    Note that by doing this you are placing a big restriction on where LaTeX is allowed to place floats, so you might run into trouble. I'd suggest you use at least tp, to allow float-only pages, so LaTeX will have some room to work.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 28 at 18:21









    Phelype OleinikPhelype Oleinik

    22.4k54482




    22.4k54482













    • Thanks so much! It seems to work fine for figures and tables, but not for algorithm2e or is this a non-floating environment?

      – bonanza
      Jan 28 at 18:25






    • 1





      @bonanza Hm... It seems that algorithm2e does define a floating environment, but uses some strange argument handling internally. The floating environment is not defined in the "usual" way. Try this and tell me if it worked: makeatletter edefalgorithm{% noexpand@protected@testoptnoexpandalgorithm expandafternoexpandcsnamestringalgorithmendcsname{t}% }% makeatother

      – Phelype Oleinik
      Jan 28 at 18:51











    • Works perfectly for algorithm2e, thanks!

      – bonanza
      Jan 28 at 20:08



















    • Thanks so much! It seems to work fine for figures and tables, but not for algorithm2e or is this a non-floating environment?

      – bonanza
      Jan 28 at 18:25






    • 1





      @bonanza Hm... It seems that algorithm2e does define a floating environment, but uses some strange argument handling internally. The floating environment is not defined in the "usual" way. Try this and tell me if it worked: makeatletter edefalgorithm{% noexpand@protected@testoptnoexpandalgorithm expandafternoexpandcsnamestringalgorithmendcsname{t}% }% makeatother

      – Phelype Oleinik
      Jan 28 at 18:51











    • Works perfectly for algorithm2e, thanks!

      – bonanza
      Jan 28 at 20:08

















    Thanks so much! It seems to work fine for figures and tables, but not for algorithm2e or is this a non-floating environment?

    – bonanza
    Jan 28 at 18:25





    Thanks so much! It seems to work fine for figures and tables, but not for algorithm2e or is this a non-floating environment?

    – bonanza
    Jan 28 at 18:25




    1




    1





    @bonanza Hm... It seems that algorithm2e does define a floating environment, but uses some strange argument handling internally. The floating environment is not defined in the "usual" way. Try this and tell me if it worked: makeatletter edefalgorithm{% noexpand@protected@testoptnoexpandalgorithm expandafternoexpandcsnamestringalgorithmendcsname{t}% }% makeatother

    – Phelype Oleinik
    Jan 28 at 18:51





    @bonanza Hm... It seems that algorithm2e does define a floating environment, but uses some strange argument handling internally. The floating environment is not defined in the "usual" way. Try this and tell me if it worked: makeatletter edefalgorithm{% noexpand@protected@testoptnoexpandalgorithm expandafternoexpandcsnamestringalgorithmendcsname{t}% }% makeatother

    – Phelype Oleinik
    Jan 28 at 18:51













    Works perfectly for algorithm2e, thanks!

    – bonanza
    Jan 28 at 20:08





    Works perfectly for algorithm2e, thanks!

    – bonanza
    Jan 28 at 20:08











    2














    Load the float package and specify



    floatplacement{<float>}{<specifier>}


    where <float> is a defined float (like figure, table or defined via newfloat) and <specifier> covers what you would specify as the optional parameter to the float (from !, here, top, bottom, page, HERE).






    share|improve this answer




























      2














      Load the float package and specify



      floatplacement{<float>}{<specifier>}


      where <float> is a defined float (like figure, table or defined via newfloat) and <specifier> covers what you would specify as the optional parameter to the float (from !, here, top, bottom, page, HERE).






      share|improve this answer


























        2












        2








        2







        Load the float package and specify



        floatplacement{<float>}{<specifier>}


        where <float> is a defined float (like figure, table or defined via newfloat) and <specifier> covers what you would specify as the optional parameter to the float (from !, here, top, bottom, page, HERE).






        share|improve this answer













        Load the float package and specify



        floatplacement{<float>}{<specifier>}


        where <float> is a defined float (like figure, table or defined via newfloat) and <specifier> covers what you would specify as the optional parameter to the float (from !, here, top, bottom, page, HERE).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 28 at 18:59









        WernerWerner

        443k679761673




        443k679761673















            Popular posts from this blog

            How to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?