Latex help needed, about text between 2 images

  • Context: LaTeX 
  • Thread starter Thread starter fluidistic
  • Start date Start date
  • Tags Tags
    Images Latex Text
Click For Summary
SUMMARY

The discussion focuses on placing text between two images in LaTeX using the figure environment. The user initially attempted to insert text between images using various methods, including the \usepackage{float} and [H] options, but encountered issues with LaTeX's float handling. The solution proposed involves consolidating the images and text into a single figure environment with a long descriptive caption, which addresses the float placement issue while maintaining clarity in the document structure.

PREREQUISITES
  • Familiarity with LaTeX document structure and environments
  • Understanding of figure placement and float behavior in LaTeX
  • Knowledge of the \caption command and its optional arguments
  • Experience with using packages like float in LaTeX
NEXT STEPS
  • Research how to create complex figures in LaTeX using the subfigure package
  • Learn about the \caption command and its optional arguments for better figure management
  • Explore the graphicx package for advanced image handling in LaTeX
  • Investigate LaTeX float placement strategies and best practices
USEFUL FOR

LaTeX users, document authors, and technical writers who need to manage image and text placement effectively in their documents.

fluidistic
Gold Member
Messages
3,932
Reaction score
283
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}
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K