\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}
- 1,134
- 2
- 9
- 27
4 Answers
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}
Adjust the value of width key if you find the figure looks small.
- 3,826
Using adjustbox combined with minipages provides more flexibility
Have a look here also -- Understanding minipages - aligning at top
With the first adjustbox
Without the first adjustbox
\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}
- 21,280
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}
- 79,712
- 3
- 50
- 120
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}
- 54,118
-
2Thanks for your answer. But I would like the figure besides the equation since now it takes a lot of space – Student Dec 13 '23 at 09:14
-






centerto center inside a float likefigure.centeradds vertical space around the image, so does the float. Replace\begin{center}by\centeringand remove\end{center}. – daleif Dec 13 '23 at 09:13