Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latex: Text cannot be placed below image

I'm having a problem with an image and some text. I have this code:

Some text...\\

\begin{figure}[ht]
\centering
\includegraphics[scale=0.75]{picture.jpg}
\caption{The caption}   
\label{fig:picture}
\end{figure}

Some more text...

Basically, I want this:

Some text. (Above image in the code)
[end of page / new page]
image
Some more text. (Below the image in the code)
[start of new section]

But, what the above code gives me is this:

Some text. (Above image in the code)
Some more text. (Below the image in the code)
[end of page / new page]
image
[start of new section]

Latex insists on putting everything but a new section above the image even though its below the image in the code. Its probably because the image floats on top - but whats my alternative? There's not enough space on the first page to display the image there, to I cannot use [h] as the float-alignment.

I can "hack it", by creating an empty new section, like \section*{}, but this creates some white-space, which looks weird. Any suggestions?

like image 533
Frederik Wordenskjold Avatar asked May 13 '10 15:05

Frederik Wordenskjold


People also ask

How do I put an image under text in LaTeX?

To definitely place a paragraph after a figure, use the command \FloatBarrier somewhere between the figure and the paragraph. It forces all figures defined before the command to render before that point in text. You will need to add \usepackage{placeins} in the preamble to use the command.

How do I write a figure below a paragraph in LaTeX?

Use the [h!] option to make the figure appear exactly where it is in the text instead of floating to someplace else. \begin{figure}[h!]

How do I put an image at the bottom of LaTeX?

Use \begin{figure}[b] ... \end{figure} .

How do I move a caption in LaTeX?

Alternatively, you can shift the caption to the left by inserting some space at the right of the sub-caption. In the above example, (a) and (b) are the controls, while (c) and (d) have spaces set to the right and left of the images, respectively. This enlarges the "images", thereby shifting the caption.


1 Answers

If you really need to have the figure in that place, use the float package:

In the preamble:

\usepackage{float}

then, in the text:

Some text...

\begin{figure}[H]
  \centering
  \includegraphics[scale=0.75]{picture.jpg}
  \caption{The caption}   
  \label{fig:picture}
\end{figure}

Some more text...

Even though, is more preferable to let LaTeX place the floats.


Another way to do the same thing is by using the caption package.

In the preamble:

\usepackage{caption}

then, in the text:

Some text...

\begin{center}
  \includegraphics[scale=0.75]{picture.jpg}\\
  \caption{figure}[LOF entry]{The caption}   
  \label{fig:picture}
\end{center}

Some more text...
like image 117
Alessandro Cuttin Avatar answered Oct 20 '22 00:10

Alessandro Cuttin