Allowing figures to break paragraphs
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.
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
add a comment |
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.
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
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
add a comment |
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.
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
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.
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
floats positioning paragraphs
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
In your example you had placed the figure after the first paragraph had been set.
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.
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 preventedp
and placed it too late in the document forh
,t
orb
the figure wasn't placed at all until it was flushed out into a forced float page by the implicitclearpage
atend{document}
– David Carlisle
Feb 2 at 22:26
add a comment |
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}
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
In your example you had placed the figure after the first paragraph had been set.
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.
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 preventedp
and placed it too late in the document forh
,t
orb
the figure wasn't placed at all until it was flushed out into a forced float page by the implicitclearpage
atend{document}
– David Carlisle
Feb 2 at 22:26
add a comment |
In your example you had placed the figure after the first paragraph had been set.
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.
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 preventedp
and placed it too late in the document forh
,t
orb
the figure wasn't placed at all until it was flushed out into a forced float page by the implicitclearpage
atend{document}
– David Carlisle
Feb 2 at 22:26
add a comment |
In your example you had placed the figure after the first paragraph had been set.
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.
In your example you had placed the figure after the first paragraph had been set.
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.
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 preventedp
and placed it too late in the document forh
,t
orb
the figure wasn't placed at all until it was flushed out into a forced float page by the implicitclearpage
atend{document}
– David Carlisle
Feb 2 at 22:26
add a comment |
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 preventedp
and placed it too late in the document forh
,t
orb
the figure wasn't placed at all until it was flushed out into a forced float page by the implicitclearpage
atend{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
add a comment |
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}
add a comment |
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}
add a comment |
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}
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}
edited Feb 2 at 22:03
answered Feb 2 at 21:58
user36296user36296
1
1
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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