GeneralGetting figure to definitely appear just after \item

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
yogester
Posts: 5
Joined: Mon Oct 20, 2008 12:23 am

Getting figure to definitely appear just after \item

Post by yogester »

I have been playing around trying to get this graphic to appear just after the "3." but it always insists on running before it.

Can anyone suggest a solution? Floating graphics have always been a bug bear for me! They never seem to go where I want them to!

Here is the output:-

Image

Here is the code:-

Code: Select all

\pagebreak

\item

\begin{figure}[htp!]
\centering
\epsfig{file=eng210graph.eps,width=0.9\linewidth,clip=}
\caption{Temperature Gradient Diagram of Proposed Spray Chiller}
\end{figure}


\item

\begin{align*}
	LMTD &= \dfrac{\theta_i - \theta_o}{ln \left(\tfrac{\theta_i}{\theta_o}\right)} \nonumber \\
	&= \dfrac{(22 + 10) - (7-10)}{ln \left(\tfrac{32}{17}\right)} \nonumber \\
	&= 23.7 \; ^\circ C \nonumber
\end{align*}
Thanks so much guys!!

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: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Getting figure to definitely appear just after \item

Post by Stefan Kottwitz »

Hi yogester,

you don't need to use the figure environment if the graphic is not intended to float, though it's possible to use figure. Perhaps have a look at Prevent floating of figures or tables, there are some possible solutions explained.
One possibility is using the float package:

Code: Select all

\usepackage{float}
...
\begin{figure}[H]
...
Another possibility is not to use figure, just \includegraphics and \captionof from the caption package:

Code: Select all

\usepackage{caption}
...
\item \includegraphics[width=0.9\linewidth]{eng210graph.eps}
\captionof{figure}{Temperature Gradient Diagram of Proposed Spray Chiller}
The caption package is very useful to customize your captions. Just to get an impression try

Code: Select all

\usepackage[font=small,labelfont=bf]{caption}
Stefan
LaTeX.org admin
yogester
Posts: 5
Joined: Mon Oct 20, 2008 12:23 am

Re: Getting figure to definitely appear just after \item

Post by yogester »

Thanks Stefan!

I ended up just putting a $\;$ after the 3. and that seemed to make the graph stay where I wanted it to be. Again, another naughty LaTeX hack..... :oops:

I wanted to use the figure environment because I wanted the captions. Didn't know about the ability to to do \captionof - very cool! Thanks for the tip!

Andrew
Post Reply