Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I position a figure in Latex?

Tags:

latex

I want to have the picture exactly in a specific position in my text. I use the commands below

\begin{enumerate}
\item T.D. Lee(1957 Physics Nobel Laureate)
\begin{figure}
\begin{center}
\includegraphics[scale=0.5]{TdLee.eps}
\end{center}
\end{figure}

I have many figures like this. What happens is that I see figures and items in different order. Can you let me know which latex command i should use in order to have the picture under or right to the each item?

Thanks

Kurt

like image 814
user522558 Avatar asked Nov 27 '10 21:11

user522558


3 Answers

To work with the standard float system, you might try the h positioner (as mentioned in another answer) but with the ! modifier as in

\begin{figure}[h!]
  ...
\end{figure}

There is even another H positioner, like h! but tries harder. It needs the package float

\usepackage{float}
...
\begin{figure}[H]
  ...
\end{figure}

but even that doesn't work many times. However since you are doing this in a list, trying to use a float might not be the best for you.

You might try to create a minipage to house the figure. Or perhaps the way to do what you want might be to omit the figure environment all together but keep the center one if you want it.

like image 72
Joel Berger Avatar answered Oct 10 '22 08:10

Joel Berger


If you know exactly where you want the figure, don't use a float (that's what the "figure" environment is)...floats are there to.....wait for it.....float!

So if you know exactly where you want your figure, simply use \includegraphics:

\begin{enumerate}
\item T.D. Lee(1957 Physics Nobel Laureate)
\begin{center}
\includegraphics[scale=0.5]{TdLee.eps}
\end{center}
...
\end{enumerate}

You can also redefine the enumerate environment so that you do not have to surround each picture with a \begin{center}...\end{center} environment, but if you are interested in how to do that, I'll leave it for a separate question. (And unapologetically suggest that you ask it on the TeX Stack Exchange, where no TeX-related question is too small.)

like image 20
Yossi Farjoun Avatar answered Oct 10 '22 06:10

Yossi Farjoun


Try the h placement specifier. From here:

\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{TdLee.eps}
\end{figure}

It does not guarantee perfect placement, but it tries.

like image 4
Steve Tjoa Avatar answered Oct 10 '22 07:10

Steve Tjoa