Force all floats to appear at top of page [duplicate]
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.
floats
marked as duplicate by Werner
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.
add a comment |
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.
floats
marked as duplicate by Werner
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 trymakeatletter deffps@figure{t} deffps@table{t} makeatother
– samcarter
Jan 28 at 18:21
add a comment |
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.
floats
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
floats
asked Jan 28 at 18:11
bonanzabonanza
8031524
8031524
marked as duplicate by Werner
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
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 trymakeatletter deffps@figure{t} deffps@table{t} makeatother
– samcarter
Jan 28 at 18:21
add a comment |
2
maybe trymakeatletter 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
add a comment |
2 Answers
2
active
oldest
votes
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.
Thanks so much! It seems to work fine for figures and tables, but not foralgorithm2eor is this a non-floating environment?
– bonanza
Jan 28 at 18:25
1
@bonanza Hm... It seems thatalgorithm2edoes 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
add a comment |
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).
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Thanks so much! It seems to work fine for figures and tables, but not foralgorithm2eor is this a non-floating environment?
– bonanza
Jan 28 at 18:25
1
@bonanza Hm... It seems thatalgorithm2edoes 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
add a comment |
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.
Thanks so much! It seems to work fine for figures and tables, but not foralgorithm2eor is this a non-floating environment?
– bonanza
Jan 28 at 18:25
1
@bonanza Hm... It seems thatalgorithm2edoes 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
add a comment |
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.
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.
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 foralgorithm2eor is this a non-floating environment?
– bonanza
Jan 28 at 18:25
1
@bonanza Hm... It seems thatalgorithm2edoes 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
add a comment |
Thanks so much! It seems to work fine for figures and tables, but not foralgorithm2eor is this a non-floating environment?
– bonanza
Jan 28 at 18:25
1
@bonanza Hm... It seems thatalgorithm2edoes 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
add a comment |
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).
add a comment |
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).
add a comment |
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).
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).
answered Jan 28 at 18:59
WernerWerner
443k679761673
443k679761673
add a comment |
add a comment |
2
maybe try
makeatletter deffps@figure{t} deffps@table{t} makeatother– samcarter
Jan 28 at 18:21