2
\documentclass{article}

\usepackage{amsfonts,amsmath,amssymb,graphicx,amsthm,mathtools,systeme}
\usepackage{geometry}
\geometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=2.3cm}
\begin{document}




\noindent Let $D$ be the region bounded by the graphs of $y = x$, $y = 0$ and $x = 1$ as shown in the figure. Evaluate the following quantity:
\begin{equation*}
\int \int_{D}(x^2+3y^2+2xy)dxdy
\end{equation*}
\vspace{-0.8cm}
\begin{figure}[h]
\begin{center}
\includegraphics[scale=0.7]{int.jpg}
%\caption {\scriptsize The region $D$.}
\end{center}
\end{figure}
\vspace{-0.8cm}
\end{document} 

enter image description here

Student
  • 1,134
  • 2
  • 9
  • 27
  • yes Professor @campa – Student Dec 13 '23 at 08:56
  • Check https://ctan.org/pkg/wrapfig2 – Rmano Dec 13 '23 at 09:09
  • 3
    Unrelated don't use center to center inside a float like figure. center adds vertical space around the image, so does the float. Replace \begin{center} by \centering and remove \end{center}. – daleif Dec 13 '23 at 09:13
  • 1
    Another comment, the line length you are using (only having 1.5cm margins left and right) makes your text very hard to read. – daleif Dec 13 '23 at 09:14
  • @daleif I think it is clear to read. What is the alternative suggestion? – Student Dec 13 '23 at 09:20
  • 1
    Larger margins. One has to consentrate much harder to read such long lines. It is akin to reading a news paper and instead of 6 columns of text there are only two. Very annoying to read. – daleif Dec 13 '23 at 09:23
  • Where figure should be? In parallel to equation, but between paragraphs above and below equation? – Zarko Dec 13 '23 at 11:00

4 Answers4

7

wrapstuff is a good choice. But its documentation is in Chinese.

\documentclass{article}
\usepackage{graphicx,amsmath}
\usepackage{lipsum}
\usepackage{wrapstuff}
\begin{document}
\begin{wrapstuff}[type=figure, width=.2\textwidth]
  \centering
  \includegraphics[width=\textwidth]{example-image.jpg}
  \caption{Example Image}
\end{wrapstuff}
\noindent Let $D$ be the region bounded by the graphs of $y = x$, $y = 0$ and $x = 1$ as shown in the figure. Evaluate the following quantity:
\begin{equation*}
\iint_{D}(x^2+3y^2+2xy)dxdy
\end{equation*}
\lipsum[1]
\end{document} 

enter image description here

Adjust the value of width key if you find the figure looks small.

Stephen
  • 3,826
5

Using adjustbox combined with minipages provides more flexibility

Have a look here also -- Understanding minipages - aligning at top

With the first adjustbox

![enter image description here

Without the first adjustbox

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{amsmath}
\usepackage{adjustbox}

\begin{document}

\section{Having a picture problem?}
\adjustbox{valign=t}{\begin{minipage}[t]{0.6\linewidth}
        Let $D$ be the region bounded by the graphs of $y = x$, $y = 0$ and $x = 1$ as shown in the figure. Evaluate the following quantity:
        \begin{equation*}
            \int \int_{D}(x^2+3y^2+2xy)dxdy
        \end{equation*}
\end{minipage}}%
\hfill
\adjustbox{valign=t}{\begin{minipage}[t]{0.3\linewidth}
        \includegraphics[width=\linewidth]{foo}
\end{minipage}}


\end{document}

js bibra
  • 21,280
3

Another approach is to use paracol. The only problem is trying to align the equation and the figure, since they don't share a baseline.

\documentclass{article}

\usepackage{amsfonts,amsmath,amssymb,graphicx,amsthm,mathtools,systeme} \usepackage{geometry} \geometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=2.3cm} \usepackage{paracol} \begin{document}

\noindent Let $D$ be the region bounded by the graphs of $y = x$, $y = 0$ and $x = 1$ as shown in the figure. Evaluate the following quantity:

\hrule% show top \begin{paracol}{2} %\vfil% center in column \begin{equation} \int \int_{D}(x^2+3y^2+2xy)dxdy \end{equation} \switchcolumn \begin{figure}[t] \centering \includegraphics[width=\linewidth]{example-image} \caption {\scriptsize The region $D$.} \end{figure} \vspace{-\textfloatsep}% remove padding below figure \end{paracol} \hrule% show bottom \end{document}

demo

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
2

You can use float package with the option H for the figure. An observation. The double integral code is \iint and not \int \int.

\documentclass{article}

\usepackage{amsfonts,amssymb,graphicx,amsthm,mathtools,systeme} \usepackage{geometry} \usepackage{float} \geometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=2.3cm} \begin{document} \noindent Let $D$ be the region bounded by the graphs of $y = x$, $y = 0$ and $x = 1$ as shown in the figure. Evaluate the following quantity: \begin{equation} \iint_{D}(x^2+3y^2+2xy)dxdy \end{equation} \begin{figure}[H] \centering \includegraphics[scale=0.7]{example-image-b} %\caption {\scriptsize The region $D$.} \end{figure}

\end{document}

enter image description here

Sebastiano
  • 54,118