I am part of a team working collaboratively to prepare a large document containing tabular and multimedia content using LaTeX (publishing to PDF using lualatex), and we've hit a persistent problem with one page in our document having text content spill over the end of the page as follows:
We believe we've tracked down why, and the following is the MWE used to produce the above:
\documentclass[a4paper]{report}
\usepackage[margin=2.54cm]{geometry}
\usepackage{lipsum}
%\usepackage{showframe}
\usepackage{longtable}
\usepackage[draft]{graphicx}
%\graphicspath{ {Resources/} }
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\section{Section here}
\subsection{Subsection here}
\lipsum[1-2]
\begin{figure}
\caption{Caption 1}
\includegraphics[height=9.24cm]{image1.png}
\end{figure}
\subsection{Subsection here}
\lipsum[1]
\begin{figure}
\caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed consequat ex vitae}
\includegraphics[height=9.60cm]{image2.png}
\end{figure}
\lipsum[1-3]
\begin{longtable}{|p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|}
\cline{1-6}
& Text & Text & Text & Text & Text\\
\cline{1-6}
\end{longtable}
\lipsum[1-6]
\end{document}
The issue we're hitting appears to be the bug documented at https://www.latex-project.org/cgi-bin/ltxbugs2html?pr=tools/3512, caused by the longtable package incorrectly resetting the pagegoal erroneously when it follows a float.
There's a suggested fix on the issue, and this has been discussed before at Pagebreak doesn't work with floats and longtabu, but in both cases the fix now predates the current version of Longtable, and we would ideally like to avoid trying to maintain a patched version of Longtable across our whole team.
Is anyone aware of a document-local fix to this that we could use as an alternative?
longtable
here? Your table is small enough to fit onto a signlet page, thus a regulartabular
should work as well.