LaTeX Wrapfig doesn't put text beside figure

  • Thread starter Thread starter brotherbobby
  • Start date Start date
  • Tags Tags
    Figure Text
AI Thread Summary
The discussion revolves around issues with the LaTeX wrapfig package, specifically regarding the placement of text in relation to a figure. The user is experiencing a problem where text intended to wrap around a figure instead appears above it. The figure is correctly positioned to the right, but the text does not align as expected. The user is utilizing TexMaker and has provided code snippets, expressing confusion about the dimensions used in the wrapfigure command, particularly the use of 1.5\textwidth, which they believe should push the figure further to the right. There is a mention that wrapfig may not function properly within lists, which raises concerns about its limitations for users wanting to integrate images with text in specific list contexts. The discussion highlights the need for clarity on how to effectively use the wrapfig package to achieve the desired layout in LaTeX documents.
brotherbobby
Messages
749
Reaction score
169
TL;DR Summary
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
5
Views
4K
Replies
11
Views
16K
Replies
14
Views
3K
Replies
5
Views
5K
Replies
2
Views
5K
Replies
4
Views
3K
Back
Top