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.

  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$}}
Let $f$ be a continuous function. ....
  • 2
    Sounds like an XY problem. No code makes it hard to say. Do not use \bf in LaTeX. It is over 30 years since it became obsolete and ought not be used.
    – cfr
    Aug 22, 2017 at 2:47
  • 1
    Please provide the code for a small document which we can compile to reproduce the problem. In tex.stackexchange.com/questions/365013/…, you provided code. That was good, but it was not at all minimal. Try to produce as small an example as possible, but which still shows the problem. Complete minimal examples are almost always needed. Fragments of code which you've favoured in recent questions (when you've provided any code at all) are generally not useful as examples, although they're great in explanations.
    – cfr
    Aug 22, 2017 at 2:52
  • You don't need to use floating environments like figure and table. Minipages and \captionof will do the trick. The marginnote package does not float, although it does have a tendency to overlap. Aug 22, 2017 at 14:52
  • @JohnKormylo The margin is blank on most pages. I want something very easy to use for a 400 page document. So I am not sure how minipages that needs to be set on each page or section, can help me do the same.
    – David R
    Aug 23, 2017 at 8:23
  • See also tex.stackexchange.com/questions/320065/… Aug 23, 2017 at 12:52


Your Answer

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

Browse other questions tagged or ask your own question.