Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in longtable (2024-04-26 v4.20) after a pagebreak #1495

Open
Reinhard-Jhr opened this issue Oct 17, 2024 · 9 comments
Open

bug in longtable (2024-04-26 v4.20) after a pagebreak #1495

Reinhard-Jhr opened this issue Oct 17, 2024 · 9 comments
Assignees
Labels
category tools fixed in dev Fixed in development branch, not in stable release

Comments

@Reinhard-Jhr
Copy link

After a pagebreak: \pagegoal=\maxdimen.

\endlongtable -> .... \dimen@\pagegoal\advance\dimen@\ht\LT@foot\pagegoal\dimen@ ....

After a pagebreak you cannot add a positive value to \dimen@. This will lead to the error message: dimension too large.
I don't understand why you need this code, because the next command is an \endgroup and \pagegoal will be resetted.

Minimal example showing the bug

\RequirePackage{latexbug}       % <--should be always the first line (see CONTRIBUTING)!
\documentclass{article}

  % Any preamble code goes here

\begin{document}

  % Demonstration of issue here
  
\end{document}

Log file (required) and possibly PDF file

@davidcarlisle
Copy link
Member

Could you please supply a test file, the code shown in your description is empty

Setting the value just before \endgroup does look suspicous but not necessarily wrong it depends when the output routine is fired I'd need to check, and a test file would help...

This specific arrangement is relatively new (v4.14) from 819fda9 so your test file presumably doesn't show the issue if you use

\usepackage{longtable}[=v4.13]

?

@davidcarlisle
Copy link
Member

The group is not necessarily wrong (\pagegoal settings are global so survive the \endgroup) However it is certainly true that you can not increase pagegoal when it is \maxdimen so something is not right here. A test file would help, as noted above.

@Reinhard-Jhr
Copy link
Author

Excuse me, but the problem occurs in a very complex table. Here, longtable is only used indirectly in an environment that also allows page breaks within table cells and more. But in the end it is only longtable code. Unfortunately I was not able to create a simple example that shows the error. Therefore, I am sending an excerpt from the log file created with \tracingall, from which the problem can be seen.

longtablebug.log

version 4.13 does not show the error. \endlongtable is defined completely differently there.

@davidcarlisle
Copy link
Member

davidcarlisle commented Oct 21, 2024

I can understand that making a minimal example is hard for this case. If you could send me privately the test file or put it in a private gh repository or whatever you find convenient, this would be really helpful, The file doesn't need to be minimal your full document would be OK. This is a tricky area and making any change without a test file showing the problem is a bit stressful:-).

That said, it looks like line 255

    \dimen@\pagegoal\advance\dimen@\ht\LT@foot\pagegoal\dimen@

should look like line 220

    \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@

what happens if you add a - before \ht on line 225?

@Reinhard-Jhr
Copy link
Author

If you subtract \ht\LT@foot no error message appears, but the value of \pagegoal is senseless large. At the first moment the following code seems to make more sense:

\ifdim\pagegoal=\maxdimen%
\pagegoal=\vsize\relax%
\fi%
\dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@%

But what value does \pagegoal get when the first box is entered in the current page? In addition, according to the TexBook, the value of \pagegoal cannot be changed, if it equals \maxdimen.

@davidcarlisle
Copy link
Member

But what value does \pagegoal get when the first box is entered in the current page?

Try the following plain tex test, the value is \maxdimen even immediately after \pagegoal=5pt

If you uncomment the % x then the 5pt is set and still visible after the group showing the global nature.

so

\ifdim\pagegoal=\maxdimen%
\pagegoal=\vsize\relax%
\fi%

wouldn't have a lot of effect it would be \maxdimen again before it was used. The error here is that you can't set any length to more than \maxdimen


% x

\showthe\pagegoal

{\pagegoal=5pt
 \showthe\pagegoal

}

\showthe\pagegoal

\bye

davidcarlisle added a commit that referenced this issue Oct 27, 2024
@davidcarlisle davidcarlisle mentioned this issue Oct 27, 2024
6 tasks
davidcarlisle added a commit that referenced this issue Oct 28, 2024
josephwright pushed a commit that referenced this issue Oct 28, 2024
josephwright pushed a commit that referenced this issue Oct 28, 2024
@FrankMittelbach FrankMittelbach added this to the Release 2024 Fall milestone Oct 28, 2024
@FrankMittelbach FrankMittelbach added the fixed in dev Fixed in development branch, not in stable release label Oct 28, 2024
@FrankMittelbach
Copy link
Member

I guess this is correctly classified as "fixed in dev", @davidcarlisle ?

@davidcarlisle
Copy link
Member

Yes as the PR is merged.

@FrankMittelbach
Copy link
Member

doesn't mean a thing ...sometimes ... could still be something open despite the merge ...anyway, good :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category tools fixed in dev Fixed in development branch, not in stable release
Projects
Status: Done in dev
Development

No branches or pull requests

3 participants