Wrapfig doesn't put text beside figure

  • LaTeX
  • Thread starter brotherbobby
  • Start date
  • Tags
    Figure Text
  • #1
brotherbobby
669
159
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
  • #2
Why is your wrapfigure 1.5\textwidth?

Also, please don’t post code as images. Use the code tags.
 
  • #3
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.

\LaTeX Code:
\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}
 
  • #4
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

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • Precalculus Mathematics Homework Help
Replies
13
Views
546
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
15K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • Introductory Physics Homework Help
Replies
20
Views
355
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
  • Feedback and Announcements
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
401
Back
Top