Generalkeeping text with a figure

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
dmt
Posts: 82
Joined: Sat Mar 15, 2008 8:13 pm

keeping text with a figure

Post by dmt »

I'm creating an exam using the exam class which I think uses redefine list environments.

Anyway, I want to include a figure in one of my problems, but I want to ensure that the figure appears under the first line of text in the problem, and if there isn't space for it on the page, I want the text to move with the figure.

Using just the figure environment moves the figure to the next page but leaves the text behind. How do I force them together?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

keeping text with a figure

Post by Stefan Kottwitz »

Hi dmt,

you probably don't need the figure environment, because the figure doesn't need to be able to float. Have a look here for possible solutions: Prevent floating of figures or tables. Further you could put the figure and the text together into one minipage environment.

Stefan
LaTeX.org admin
dmt
Posts: 82
Joined: Sat Mar 15, 2008 8:13 pm

Re: keeping text with a figure

Post by dmt »

Thanks, that was really helpful. The float package had a nice option H that works well here.
Post Reply