0

I am trying to fit an image in my text, but I can't figure out how to place it in the correct spot. Here is my code for this page:

\subsection{Over vector fields}

For this subsection, we will assume a vector field $F=\big\langle P, Q, R \big\langle$ with differentiable components and not necessarelly conservative.
\begin{wrapfigure}{r}{0.3\textwidth}
\centering
\includegraphics[width=.98\linewidth]{image001.png}
\caption{A positively oriented surface}
\end{wrapfigure}
Just as parametric curves have a direction, parametric surfaces have an orientation. At any point, any surface with 2 sides has 2 normal vectors, $\N$ and $-\N$. A surface $S$ with boundary curve $\partial S$ has positive orientation if the normal vectors and  $\partial S$ follow the right-hand rule on the right, and if the surface $S$ doesn't have a boundary curve (i.e. it is itself the boundary of a solid) it has positive orientation if the normal vectors point away from the solid it defines. If the normal vectors don\t follow these definition, the surface is said to have negative orientation.

And here is what it's giving me: enter image description here

I would like the image to be on the top left corner, with the first sentence not wrapping around the image. I've use basically the same lines of code to include an image before, and it worked perfectly, and I'm not sure what's going on.

3
  • 3
    Do you have a previously wrapped figure on the right? Because it looks to me what you are seeing is a result of a wrapfigure environment not finished before.
    – Archange
    Oct 28, 2021 at 15:02
  • 2
    Welcome to TeX.SE... Please post your MWE in executable format, i.e., from \documentclass to \end{document}
    – MadyYuvi
    Oct 28, 2021 at 15:02
  • Hi and welcome. Please give a fully compilable code with a complete but minimal preamble.
    – AndréC
    Oct 28, 2021 at 15:25

2 Answers 2

1

You can insert wrapfig into the middle of a paragraph, but you have to do it at the end of a line (not a sentence). Otherwise, you might as well use two paragraphs.

\documentclass{article}
\usepackage{graphicx}
\usepackage{wrapfig}

\begin{document}
\setcounter{section}{2}%
\subsection{Over vector fields}

For this subsection, we will assume a vector field $F=\big\langle P, Q, R \big\langle$ with differen-
\begin{wrapfigure}{l}{0.3\textwidth}
\centering
\includegraphics[width=.98\linewidth]{example-image}
\caption{A positively oriented surface}
\end{wrapfigure}
tiable components and not necessarelly conservative.
Just as parametric curves have a direction, parametric surfaces have an orientation. At any point, any surface with 2 sides has 2 normal vectors, $N$ and $-N$. A surface $S$ with boundary curve $\partial S$ has positive orientation if the normal vectors and  $\partial S$ follow the right-hand rule on the right, and if the surface $S$ doesn't have a boundary curve (i.e. it is itself the boundary of a solid) it has positive orientation if the normal vectors point away from the solid it defines. If the normal vectors don\t follow these definition, the surface is said to have negative orientation
\end{document}

demo

0

A bit of a workaround can be done with two minipages. Downside is, that you have to manualy "cut of" the text beside the Image and write the rest of it below.

\begingroup
\parfillskip=0pt
\begin{minipage}[t]{0.48\textwidth}
\begin{figure}[H] 
    \centering
        \includegraphics[width=1.00\textwidth]{image-a}
    \caption[VZ-caption]{Caption}% \protect \footnotemark}
    \label{fig:label}
\end{figure}
\end{minipage}
\hfill

\begin{minipage}[t]{0.48\textwidth}
TEXT-1
\end{minipage}
\par\endgroup 
TEXT-2

Use the \protect\footnotemark if you wanna put a footnote on the caption of the picture. Often useful;)

3
  • 1
    Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it).
    – dexteritas
    Oct 28, 2021 at 15:22
  • Thank you! This solved my problem.
    – Bin
    Oct 28, 2021 at 16:31
  • thx Dex i will learn ;) your welcome @Bin :)
    – Julian
    Oct 29, 2021 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.