1

Why does picinpar paragaph text overlap the caption of the figure whenever I put equations in the paragraph?

\documentclass[a4paper,10pt]{book}

\usepackage{graphics}
\usepackage{graphicx}
\usepackage{picinpar}
\usepackage{lipsum}
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{siunitx}

\begin{document}

\lipsum[75]

\begin{figwindow}[3,l,\includegraphics[width=5cm]{example-image-a}, {Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.} \label{fig:example-image-a}]
Blabla

\begin{equation}
 \begin{split}
   5 m + 2 m                    & = (5+2) m         = 7 m \\
   5{\times}4 + 2{\times}4      & = (5+2){\times}4  = 28 \\
   5 x + 2 x    & = (5+2) x         = 7 x \\
 \end{split}
\end{equation}

Blabla

\begin{equation}
 \begin{split}
   5 m + 2 m                    & = (5+2) m         = 7 m \\
   5{\times}4 + 2{\times}4      & = (5+2){\times}4  = 28 \\
   5 x + 2 x    & = (5+2) x         = 7 x \\
 \end{split}
\end{equation}

Blabla

\begin{equation}
 \begin{split}
   5 m + 2 m                    & = (5+2) m         = 7 m \\
   5{\times}4 + 2{\times}4      & = (5+2){\times}4  = 28 \\
   5 x + 2 x    & = (5+2) x         = 7 x \\
 \end{split}
\end{equation}

Blabla

\begin{equation}
 \begin{split}
   5 m + 2 m                    & = (5+2) m         = 7 m \\
   5{\times}4 + 2{\times}4      & = (5+2){\times}4  = 28 \\
   5 x + 2 x    & = (5+2) x         = 7 x \\
 \end{split}
\end{equation}

Blabla

\begin{equation}
 \begin{split}
   5 m + 2 m                    & = (5+2) m         = 7 m \\
   5{\times}4 + 2{\times}4      & = (5+2){\times}4  = 28 \\
   5 x + 2 x    & = (5+2) x         = 7 x \\
 \end{split}
\end{equation}

\end{figwindow}

\lipsum[75]

\end{document}

Paragraph text overlaps with caption text if equations are used.

Edit:

I'm using Overleaf.

Edit:

This is how my real document looks:

This problem in my "real" document.

Edit:

This is the result after deleting blank lines before equations.

Result after deleting blank lines before equations.

  • 1
    Are you open to other solutions that doesn't use (the legacy) picinpar package? – Werner Feb 01 '16 at 20:06
  • 1
    possibly unrelated but you should never have a blank line before a displayed equation the spacing will always be wrong in that case. – David Carlisle Feb 01 '16 at 20:19
  • @Werner Yes, as long as it's not something like using tabular and manually adjusting the amount of paragraph text that goes beside the picture-caption set. BTW, I used wrapfigure before, but I changed this one instance to picinpar because of a problem of wrapfigures next to lists. – Leonardo Castro Feb 01 '16 at 20:54
  • @LeonardoCastro: Why do you use this layout in the first place? What is the preferred wrapping? What do you mean by "manually adjusting the amount of paragraph text that goes beside the picture-caption set"? – Werner Feb 01 '16 at 20:57
  • If the real caption is that big, you might put it beside the image and avoid the whole problem. – John Kormylo Feb 01 '16 at 22:54
  • 1
    See also http://tex.stackexchange.com/questions/208429/problem-with-wrapfig-and-itemize?s=2|0.3261 and http://tex.stackexchange.com/questions/281949/how-to-prevent-parpic-from-cutting-into-every-paragraph-inside-a-proof-environm – John Kormylo Feb 01 '16 at 23:01
  • @Werner I mean that, in the solution, the compiler must automatically "decide" which lines should be indented to not overlap image and caption. – Leonardo Castro Feb 02 '16 at 10:14
  • @Werner A solution that I don't want is, for intance, starting a twocolumn section with columnbreak in a specified line. – Leonardo Castro Feb 02 '16 at 10:17
  • @Werner I just want the image to stay left with its caption and everything else to dodge them. – Leonardo Castro Feb 02 '16 at 10:21
  • @Werner In my real code, there is a paragraph text with some equations in the middle. In this example, I stuffed the paragraph with equations for the problem to be more evident. But note that a "Blabla" text also overlaps the caption. – Leonardo Castro Feb 02 '16 at 10:25
  • @JohnKormylo My real caption is not that big, but the problem is still. I'm gonna edit the question to show part of my real document. – Leonardo Castro Feb 02 '16 at 10:28
  • @DavidCarlisle I have tried deleting the blank lines before the equations, but the result is still worse. I'm gonna edit the question again to show you. – Leonardo Castro Feb 02 '16 at 10:53

0 Answers0