# Insert a photo inline with some text and math environment (align)

I'm trying to get sth like:

I've been having problem with the picture-inline-with-text part. A little help please. The wrapfigure package (which is known to be better) doesn't work. Nothing is shown in the pdf output file.

The minipage works to some extent, but its always on the left side. I couldn't change it by editing the position parameter. Since I'm not quite familiar with this one. Maybe it could work. Hum?

The floatflt works, but its not compatible quite right with the math environment which means the equations is still in the middle of the page. And the photo is overprinted.

The cutwin package is apparently for only paragraphs with pure text.

Textpos is also not working with the math environment.

Here is the code:

\documentclass[a4paper,10pt, reqno]{amsbook}
\usepackage{wrapfig}
\usepackage{graphicx}
\graphicspath{{d:/ImagesforProjectLatex/}}

\begin{document}

\begin{solution}
\begin{wrapfigure}{r}{0.5\textwidth}
\begin{center}
\includegraphics[width=0.48\textwidth]{1}
\end{center}
\caption{A gull}
\end{wrapfigure}%\paragraph{}
Then nabla is applied from the left

\begin{align}
\nabla\times\strain\times\nabla &=& \parn{\e_1\p_1 + \e_2\p_2 + \e_3\cancel{\p_3}}\times\brak{x_2\e_1\e_3+x_1\e_2\e_3}\notag\\
&=&\p_1\parn{x_1}\e_3\e_3 - \p_2\parn{x_2}\e_3\e_3 = \bff{0}\quad \surd
\label{eq:}
\end{align}
\end{solution}
\end{document}


There is nothing wrong with the math part. So, the problem is only the photo.

-
Try to provide more details like -- what is \parn, \strain etc. Also, how the solution environment is defined? –  Harish Kumar Nov 7 '12 at 14:55
Welcome to TeX.SE. As Harish suggested, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem. –  Peter Grill Nov 7 '12 at 18:31

## Disclaimer: nothing floating here, i striped all unknown macros

Well i can't see a Problem in using minipage here. The order of the minipages depends on their occurrence in the code. The first will go left, the second right a.s.o. One should not forget to erase any white space between them. You may do something like:

\noindent\begin{minipage}[t]{.49\textwidth}% [t] means top
Then nabla is applied from the left
\begin{align}
\nabla\times\times\nabla &=& 1
\label{eq:}
\end{align}
\end{minipage}%<- This is obligate
\begin{minipage}[t]{.49\textwidth}%
\vspace{0pt}%<- Fake line
\includegraphics[width=0.48\textwidth]{1}
\end{minipage}


(Minipage is quite robust, but this doesn't float of course.)

Also wrapfigure will work. Use split form amsmath (for instance) to break lines. (Mathmode won't break like textlines.) If you don't beak it you will get overridden lines. But i really don't like the idea. Feel to too much like a half baked solution.

Another possibility is using multicols form themulticolpackage:

\begin{multicols}{2}
Then nabla is applied from the left
\begin{align}
\nabla\times\times\nabla &=& 1
\label{eq:}
\end{align}
\includegraphics[width=0.48\textwidth]{1}
\end{multicols}


At a glance:

\documentclass[a4paper,10pt, reqno]{amsbook}
\usepackage{mathtools}
\usepackage[demo]{graphicx}
\usepackage{multicol}
\usepackage{wrapfig}
\usepackage{capt-of}

\begin{document}

\noindent\begin{minipage}[t]{.49\textwidth}
Then nabla is applied from the left
\begin{align}
\nabla\times\times\nabla &=& 1
\label{eq:}
\end{align}
\end{minipage}%
\begin{minipage}[t]{.49\textwidth}%
\vspace{0pt}
\includegraphics[width=\textwidth]{1}
\captionof{figure}{Test}
\end{minipage}

\begin{multicols}{2}
Then nabla is applied from the left
\begin{align}
\nabla\times\times\nabla &=& 1
\label{eq:}
\end{align}
\includegraphics[width=0.48\textwidth]{1}
\end{multicols}

\begin{wrapfigure}[12]{r}{0.5\textwidth}
\includegraphics[width=0.48\textwidth]{1}
\caption{A gull}
\end{wrapfigure}
\noindent\begin{minipage}[t]{.4\textwidth}
$$\begin{split} \nabla\times\times\\ \nabla3\nabla = 1 \end{split} \label{eq:}$$
\end{minipage}

\end{document}


I use capt-of to allow caption outside their respective float environment.

-