LaTeX Wrapfig doesn't put text beside figure

  • Thread starter Thread starter brotherbobby
  • Start date Start date
  • Tags Tags
    Figure Text
Click For Summary
SUMMARY

The discussion focuses on issues encountered while using the wrapfig package in LaTeX to position text alongside a figure. The user reports that the text appears above the figure instead of wrapping around it, despite being placed below the figure definition in the code. The user is utilizing TexMaker and seeks clarification on the behavior of wrapfig, particularly regarding its compatibility with lists such as enumerate and itemize.

PREREQUISITES
  • Understanding of LaTeX document preparation system
  • Familiarity with the wrapfig package
  • Basic knowledge of figure placement and text wrapping in LaTeX
  • Experience using TexMaker as a LaTeX editor
NEXT STEPS
  • Research the limitations of the wrapfig package, especially in relation to lists
  • Learn how to properly format figures and text in LaTeX using float and graphicx packages
  • Explore alternative methods for wrapping text around figures in LaTeX
  • Investigate the use of minipage or parbox for complex layouts in LaTeX
USEFUL FOR

This discussion is beneficial for LaTeX users, particularly those creating documents with figures and text, such as academic writers, researchers, and students in technical fields.

brotherbobby
Messages
755
Reaction score
170
TL;DR
Using the ##\text{wrapfig}## package, the text appears below and above the figure, but not alongside it.
1710146759537.png
I am new to ##\rm{LaTeX}##.

Using the ##\texttt{wrapfig}## package, the figure loads correctly to the right.

However, the text, though I typed much of it below where I specified the image to be, comes above it, not alongside it.


I cope and paste my code below. You will see much the text that appear above the figure are actually written below it. I was hoping the text will appear alongside it, in the white empty space to the left.


1710146897411.png


I am using ##\texttt{TexMaker}##. The figure is defined above from lines 62-66. The text comes below from lines 69-75. This text is meant to wrap around the image, but it doesn't, as you saw in the previous picture.


Request : Where have I gone wrong?
 
Physics news on Phys.org
Why is your wrapfigure 1.5\textwidth?

Also, please don’t post code as images. Use the code tags.
 
Orodruin said:
Why is your wrapfigure 1.5\textwidth?
So that the figure goes to the very right of the page. [r] or [R} is not doing it. 0.5 textwidth takes it to the middle.

Orodruin said:
Also, please don’t post code as images. Use the code tags.

[CODE title="\LaTeX Code" highlight="7-11, 14"]\textbf{Solution}
\begin{enumerate} [leftmargin=0pt] %
\begin{small}
{\fontfamily{ptm}\selectfont
\item (i) It's easy to do it using the method of distance-time. We note that the boy will only run for as long as his father walks. His father will walk home for a time of $t=\frac{x_H}{v_M}$, where $x_H, v_M$ are the distance to home and the man's walking speed, respectively. Hence, the boy covers a total distance of $s_B=\frac{v_B}{v_M}x_H= \frac{12}{4}\times 1.2 = 3.6$ km. \\

\begin{wrapfigure}{R}{1.5\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{2(a)}
\caption{\label{M&B}The man and boy problem situation}
\end{wrapfigure}


(ii) Let us start by drawing the problem situation. \\
The man has a speed of $v_M$ and the boy a speed of $v_B$. All distances are measured from the home H which is also the origin O.
The boy is shown with a red dot ({\color{red} {$\bullet$}}) and the man with a blue dot ({\color{blue}{$\bullet$}}).
At the beginning, they are both at a distance $x_H$ from home. After the $i^{\text{th}}$ motion, the man is at a distance of $(x_M)_i$ from H. \\
The stages are shown in green from $\mathbf{\color{OliveGreen}{0\rightarrow 5}}$. The situation starts in stage 0 when the man and the boy are both at a distance $x_H$ from home.

In stage 1, the boy covers the distance in a time $t_1=\frac{x_H}{v_B}$.

}
\end{small}
\end{enumerate}[/CODE]
 
brotherbobby said:
TL;DR Summary: Using the ##\text{wrapfig}## package, the text appears below and above the figure, but not alongside it.

Using the wrapfig package, the figure loads correctly to the right.

However, the text, though I typed much of it below where I specified the image to be, comes above it, not alongside it.

I read somewhere that ##\texttt{wrapfig}## doesn't work inside lists (Enumerate and itemize). If that's true, it's a big weakness. What is someone going to do if he wants to put an image and text around it againt a certain ##\texttt{\item}##?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 11 ·
Replies
11
Views
16K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K