I have created an environment. I want some figures and text that are supposed to be beside the examples not float to the previous or the next page.
\newmdtheoremenv[
linecolor=orangelight,
linewidth=2pt,
topline=true,
rightline=true,
leftline=true]{eg}{ {\bf Example}}
For example, I have something like this but there is no guarantee that the figure and the example are on the same page.
\marginpar{Look at the intersection of etc \includegraphics[width=1.7in]{Fig1.pdf}
\captionof{figure}{Graph of $f$}}
\begin{eg}
Let $f$ be a continuous function. ....
\end{eg}
\bf
in LaTeX. It is over 30 years since it became obsolete and ought not be used.