qinglee / wrapstuff

Wrapping text around stuff
https://ctan.org/pkg/wrapstuff
LaTeX Project Public License v1.3c
11 stars 4 forks source link

Equations dissapear #13

Open ybeltukov opened 1 year ago

ybeltukov commented 1 year ago

Your package is a very nice replacement of wrapfig. However, there is an issue with equations:

A sequence of equations is broken by wrapstuff. Here is an example:

\documentclass{article}
\usepackage{graphicx}
\usepackage{wrapstuff}

\begin{document}

\begin{wrapstuff}
    \includegraphics[width=5.5cm]{example-image-a}
\end{wrapstuff}

Equation 1:
\begin{equation}
    x = y
\end{equation}
Equation 2:
\begin{equation}
    x = y
\end{equation}
Equation 3:
\begin{equation}
    x = y
\end{equation}

\end{document}

Only the last equation survives: Screenshot_20230124_002651

Also, if a paragraph starts with an equation, it produces the same error as in #11.

xkwxdyy commented 1 year ago

Add paragraphs after the first and the second equation may solve your problem?

\documentclass{article}
\usepackage{graphicx}
\usepackage{wrapstuff}

\begin{document}

\begin{wrapstuff}
    \includegraphics[width=5.5cm]{example-image-a}
\end{wrapstuff}

Equation 1:
\begin{equation}
    x = y
\end{equation}

Equation 2:
\begin{equation}
    x = y
\end{equation}

Equation 3:
\begin{equation}
    x = y
\end{equation}

\end{document}
image
ybeltukov commented 1 year ago

It is a possible workaround, however, it makes a wrong spacing, especially for nonzero \parskip. Up to now i can put \par\vskip-\parskip\noindent after each equation.

However, I'm faced with another problem:

\documentclass{article}
\usepackage{graphicx}
\usepackage{wrapstuff}

\begin{document}

\parskip=1cm % large value for the visualization

\begin{wrapstuff}
    \includegraphics[width=5.5cm]{example-image-a}
\end{wrapstuff}

Equation 1:
\begin{equation}
    x = y
\end{equation}
\vskip-\parskip\par\noindent
Equation 2:
\begin{equation}
    x = y
\end{equation}
\vskip-\parskip\par\noindent
Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text. Some other text.
\begin{equation}
    x = y
\end{equation}

\end{document}

Screenshot_20230124_103502

Probably, it is a separate issue because \vskip was not taken into account by wrapstuff. I hope that these issues can be resolved because wrapstuff is the only package I know, which automatically respect equations with arbitrary heights.

atxy-blip commented 8 months ago

@ybeltukov Up to now i can put \par\vskip-\parskip\noindent after each equation.

I have encountered the same problem and traced down to your issue. The walkaround provided above works after deleting the blank line between \end{wrapstuff} and Equation 1.

Looking forwards to an official fix : )