Latex help needed, about text between 2 images

  • Context: LaTeX 
  • Thread starter Thread starter fluidistic
  • Start date Start date
  • Tags Tags
    Images Latex Text
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 5K views
fluidistic
Gold Member
Messages
3,934
Reaction score
286
Latex "help" needed, about text between 2 images

I'm having troubles to place a text between 2 images.
The code looks like this:

Code:
\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\centering
\includegraphics[width=\textwidth]{vvalue}
\caption{value1}
\label{test1}
\end{minipage}
\hspace{0.0cm}
\begin{minipage}[b]{0.45\linewidth}
\centering
\includegraphics[width=\textwidth]{wvalue}
\caption{value2}
\label{test2}
\end{minipage}
\end{figure}

Some text here.

\centerline{\includegraphics[scale=0.36, resolution=900]{test126}}

What is displayed is: "Some text here", then the first image and then the last image. I would like the "Some text here" to be placed in between the two images.

I have tried google and some suggestions, such as using \usepackage{float} and adding an "[H]" at the end of the \centerline line.
Also tried \par \bigskip in between the two images. No luck so far.
 
Physics news on Phys.org
Problem "fixed".
I added more text prior to this part of the document in such a way that now the images and the text are displayed in the middle of a page. The text is now "magically" displayed between the 2 images...
 
fluidistic said:
Problem "fixed".
I added more text prior to this part of the document in such a way that now the images and the text are displayed in the middle of a page. The text is now "magically" displayed between the 2 images...
That's not a good fix. Add more text elsewhere and the problem will reappear. Your first figure is a figure: It's a float. It goes where LaTeX thinks it should go. Your second figure is not a figure. It's just part of the document. It goes where you put it.

Aside: It looks like you are using cargo cult techniques with your LaTeX. Why do you have two captions for that figure environment?

There are a number of ways to "fix" this problem. I'd suggest making the whole enchilada one big "figure". Make a long descriptive caption that describes all three images that comprise the figure. It's common to have very long captions. This might create a new problem if you have a list of figures in your front matter. That long, descriptive caption looks out of place in the list of figures. Use the optional argument to caption to fix this new problem:

\caption[Short title]{Short title. Detailed description of what's shown …}\label{fig:fig42}