0

I saw a post today about flowing text around figures. In the comments, the insbox package was recommended. I got excited when I looked at the sample insbox output on CTAN. I immediately decided to use this package on one of my documents.

However, I quickly learned that it is not working perfectly for me. There are 3 issues demonstrated in my MWE below.

  1. The box does not respect the bottom margin.

  2. The box does not respect the right margin.

  3. Only one line of the paragraph extends to the right margin, even though I specified two lines in the InsertBoxR command.

I'm guessing that issue 1 is a known limitation. I'm not sure what kind of fix I would like... maybe move the entire paragraph to the next page?

I'm guessing that issues 2 and 3 are bugs. Neither of these issues are apparent in the CTAN demo.

Is there a way to overcome these 3 issues with the insbox package?

\documentclass{article}
\input{insbox.tex}
\usepackage{lipsum}
\usepackage{mwe}
\begin{document}

\lipsum[1-4]

\InsertBoxR{2}{\rule{1in}{2in}}

\lipsum[5]

\end{document}

MWE Output

2
  • 1
    if you look in the code you can see that insbox is from Jan 1996 / Feb 1998. So you shouldn't expect wonders here. Feb 6, 2020 at 23:37
  • @UlrikeFischer: LaTeX has conditioned me to have high expectations :-) I was hopeful that I was missing something obvious.
    – James
    Feb 7, 2020 at 12:04

1 Answer 1

2

For the first point, it is up to you to insert box at a place where there remains enough vertical space to fit the box height.

For points 2 and 3 consists of: a) putting the image in a \parbox of the relevant width; b) enclosing the \InsertBox command and the paragraph with shorter lines in a group; c) add a blank line after this group.

\documentclass{article}
\input{insbox.tex}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{mwe}
\begin{document}

\lipsum[1-4]

{\InsertBoxR{2}{\parbox{1in}{\rule{1in}{2in}}}
\lipsum[5] }

\lipsum[6-8]

\end{document} 

enter image description here

enter image description here

1
  • Thank you for helping with issues 2 and 3! I understand your statement about issue 1, but am disappointed because this means I'll have to fiddle with the box placements every time I change a document that results in repagination.
    – James
    Feb 6, 2020 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .