latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.92k stars 265 forks source link

longtable 4.16 : dimension too large when inside vbox ; works in 4.13 #670

Open ysalmon opened 3 years ago

ysalmon commented 3 years ago

Brief outline of the bug

longtable causes a Dimension too large error when it is typeset in a vbox

Minimal example showing the bug

(firsthead and head are identical due to example minimisation ; same for foot and lastfoot)

\RequirePackage{latexbug}
\documentclass{article}
\usepackage{longtable}
\begin{document}
\vbox{\begin{longtable}{|l|l|l|l|l|l|}
\hline
\textbf{classe}&\textbf{Copies}&\textbf{Note min}&\textbf{Note max}&\textbf{Moyenne}&\textbf{ecart-type}\\\hline\endfirsthead
\hline
\textbf{classe}&\textbf{Copies}&\textbf{Note min}&\textbf{Note max}&\textbf{Moyenne}&\textbf{ecart-type}\\\hline\endhead
\hline\endfoot
\endlastfoot
MPSI1&16&2.40&16.03&7.75&3.78\\\hline
\end{longtable}}

\end{document}

Removing the vbox around makes it compile. No problem with the 4.13 version of longtable.

Log file (required) and possibly PDF file

fiches_juin.log

davidcarlisle commented 3 years ago

Thanks for the file. the newer code checks the amount on the page in a better way to avoid over-runs when there are floats, or shrinkable glue on the page, but \pagegoal is \maxdimen inside the box as the box hasn't yet been added to the page and the calculation overflows (and would do the wrong thing anyway)

I need to detect this case and avoid the error, but will need to think where to do that.

\vbox{\dimendef\pagegoal=0 \pagegoal=0pt

will get your document working (but that is not a fix, just a quick workaround)

ysalmon commented 3 years ago

Thank you so much for this quick workaround !

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity.

josephwright commented 1 year ago

Is this one that needs v5?

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity.

rdicosmo commented 9 months ago

Motivation for reopening

I would kindly like to reopen this issue, as it is still unsolved, and it turns out that now the bug prevents using longtable inside a beamer block.

Minimal example reused in beamer

\documentclass{beamer}
\usepackage{longtable}
\begin{document}
\begin{frame}
    \begin{longtable}{|l|l|l|l|l|l|}
      \hline
      \textbf{classe}&\textbf{Copies}&\textbf{Note min}&\textbf{Note max}&\textbf{Moyenne}&\textbf{ecart-type}\\\hline\endfirsthead
      \hline
      \textbf{classe}&\textbf{Copies}&\textbf{Note min}&\textbf{Note max}&\textbf{Moyenne}&\textbf{ecart-type}\\\hline\endhead
      \hline\endfoot
      \endlastfoot
      MPSI1&16&2.40&16.03&7.75&3.78\\\hline
    \end{longtable}
\end{frame}
\end{document}

Log file

bugreport.log

josephwright commented 9 months ago

@rdicosmo A longtable simply doesn't make sense in a beamer slide

rdicosmo commented 9 months ago

I agree :-) But this worked until 4.13, and it was practical sometimes to paste into slides material from an article. Getting this strange new error when upgrading LaTeX is puzzling and makes one loose quite a bit of time to chase down what's happening :-(