Bug 2437303 - pdflatex returns 1 when a longtable goes over a page
Summary: pdflatex returns 1 when a longtable goes over a page
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: texlive
Version: 44
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2436656
TreeView+ depends on / blocked
 
Reported: 2026-02-06 11:23 UTC by nvwarr
Modified: 2026-02-11 14:02 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-02-10 17:47:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
v4.27 of longtable.sty (16.37 KB, text/plain)
2026-02-09 19:56 UTC, Tom "spot" Callaway
no flags Details
yosys documentation illustrating build problem (1.69 MB, application/octet-stream)
2026-02-09 20:30 UTC, Gabriel Somlo
no flags Details
patched tools component package with latest upstream changes to array.sty longtable.sty and varioref.sty (6.09 MB, application/x-rpm)
2026-02-10 14:00 UTC, Tom "spot" Callaway
no flags Details

Description nvwarr 2026-02-06 11:23:48 UTC
longtable should allow tables to span multiple pages. With texlive-tools-svn76708-1.fc44.noarch, this causes pdflatex to return 1 rather than 0.

e.g. running pdflatex on the example at:
https://tex.stackexchange.com/questions/26462/make-a-table-span-multiple-pages/26483#26483

returns 1 on Fedora 44, where it returned 0 in the past. This breaks building documentation in a Makefile, as make gives up on the first run of pdflatex, where more are required to get references correct.


Reproducible: Always

Steps to Reproduce:
1. Have a latex file with a longtable that goes over the end of one page onto the next, like the example above
2. pdflatex filename ; echo retval $?

Actual Results:
retval 1

Expected Results:
retval 0

Additional Information:
Other variants of longtable have the same issue. The output PDF looks OK.

Comment 1 nvwarr 2026-02-06 11:56:17 UTC
\ignoreprimitiveerror=1 in the preample seems to help

Comment 2 Gabriel Somlo 2026-02-09 19:03:09 UTC
I'm running into this when building the (pdf manual portion of) the yosys RPM on ≥ f44.

Manually inserting `\ignoreprimitiveerror=1` into the (generated) .tex file and re-running does indeed work, but figuring out how to programmatically insert that statement into an autogenerated .tex file (by e.g. sphinx in my case) would mean unrolling several layers of nested makefiles, and would thus be a bit awkward...

Depending on how likely this is to be fixed, it could be worth trying to get upstream to figure out how to ensure `ignoreprimitives` gets automatically added to the generated tex, but I'm not competent enough to assess which course of action (push for upstream change vs. wait for an actual fix here) is more advisable :)

Any further clue much appreciated!

Comment 3 Tom "spot" Callaway 2026-02-09 19:55:45 UTC
Good news is that this issue is fixed in a later revision of longtable.sty. CTAN hasn't pushed this as an update to the "tools" component, which is where longtable.sty lives, but we can patch it in. I'll attach a copy of the latest longtable.sty for you to test with (replace it with the copy in /usr/share/texlive/texmf-dist/tex/latex/tools/)

Comment 4 Tom "spot" Callaway 2026-02-09 19:56:40 UTC
Created attachment 2128810 [details]
v4.27 of longtable.sty

Comment 5 Gabriel Somlo 2026-02-09 20:28:51 UTC
thanks for the prompt reply!

Unfortunately, if I brute-force overwrite `longtable.sty` with the version you provided (in the mock fedora-rawhide-x86_64 root directory I'm using to test), I now get an actual latex error:

```
[172 <./verilog_flow.pdf>]
! Undefined control sequence.
<argument> \__tbl_hook_use_protected:nV 
                                        {tbl/row/begin}\g__tbl_row_int 
l.10674 \begin{longtable}{\X{50}{100}\X{50}{100}}
                                                 
? 
```

instead of `latexmk` just reporting that `pdflatex: Command for 'pdflatex' gave return code 1` after the first pass...

Happy to keep testing things, if that helps.

Alternatively, here's a (somewhat more convoluted than OP's) reproducer for my issue:

```
CONFNAME=fedora-rawhide-x86_64

mock -r $CONFNAME --init
mock -r $CONFNAME --install \
        graphviz latexmk libfaketime pdf2svg python3-click python3-furo \
        python3-sphinx-latex python3-sphinxcontrib-bibtex \
        python3-sphinx-inline-tabs texlive-comment texlive-pgfplots \
        texlive-standalone rsync
(cd /var/lib/mock/$CONFNAME/root/builddir/build/BUILD; tar xfz /tmp/latex.tgz)
mock -r $CONFNAME --shell
	cd build/BUILD/latex/
	latexmk -pdf -dvi- -ps- yosyshqyosys
	echo $?
```

attaching `latex.tgz` which contains the sphinx-generated latex directory for the yosys docs. Note that the above works fine when `CONFNAME=fedora-43-x86_64` :)

Thanks again!

Comment 6 Gabriel Somlo 2026-02-09 20:30:08 UTC
Created attachment 2128812 [details]
yosys documentation illustrating build problem

Comment 7 Tom "spot" Callaway 2026-02-09 20:35:38 UTC
Okay, that's weird. With the example case from stackexchange, on my rawhide instance, I get:

spot@triceratops:~$ pdflatex longtable-test.tex ; echo retval $?
This is pdfTeX, Version 3.141592653-2.6-1.40.27 (TeX Live 2025) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./longtable-test.tex
LaTeX2e <2025-06-01> patch level 1
L3 programming layer <2026-01-19>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2025/01/22 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty)
(/usr/share/texlive/texmf-dist/tex/latex/lipsum/lipsum.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)))
(/usr/share/texlive/texmf-dist/tex/latex/lipsum/lipsum.ltd.tex))
(./longtable-test.aux)

Package lipsum Warning: Unknown language 'latin'. Hyphenation patterns for
(lipsum)                'english' will be used instead.


Overfull \hbox (24.0pt too wide) in alignment at lines 13--28
 [] [] 

[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
[2] (./longtable-test.aux) )
(see the transcript file for additional information)</usr/share/texlive/texmf-d
ist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on longtable-test.pdf (2 pages, 21203 bytes).
Transcript written on longtable-test.log.
retval 0

****

I would expect that failure that you're seeing to also happen here. :/

Comment 8 nvwarr 2026-02-09 20:52:49 UTC
I think the problem is with the generated latex. I also have a similar case of a generated file and it also fails with the new longtable. The error message is like Gabriel's.

Comment 9 Gabriel Somlo 2026-02-09 21:52:25 UTC
FWIW, I found a way to modify yosys upstream sources (there's a config file that controls (some of) the generated latex file's preamble) and cause the addition of `\ignoreprimitiveerror=1`. That unsurprisingly results in the build succeeding.

The unpleasant surprise is that, with `\ignoreprimitiveerror=1`, previous versions (i.e., f43 and earlier) now fail to build properly... :(

Rather than start conditionally applying patches to the upstream sources depending on which fedora version I'm building for, I'm tempted to wait for a way to fix things here, pre-empting the need to tinker with upstream, if at all possible.

As mentioned earlier, I'm happy to keep testing any candidate fixes. Thanks much, as always!

Comment 10 nvwarr 2026-02-10 11:17:02 UTC
I can confirm that with the simple example I posted, the longtable.sty that Tom posted does the trick. This works with all our in-house documentation that was written in raw latex. However, I have two packages, for which the documentation is generated from xmlto which fail on \__tbl_hook_use_protected:nV. I wonder if that needs to have been defined in another file, so it is not enough to just install longtable.sty?

Comment 11 Tom "spot" Callaway 2026-02-10 13:56:38 UTC
I think nvwarr is right. More complex files use array.sty, which also got changes in the same space as longtable.sty (varioref.sty has changes too, but I think they're unrelated)

I'm going to attach a new texlive-tools RPM that has the updated array.sty, longtable.sty, and varioref.sty. If you can try to install that package and rerun the test, maybe this will work better? If you just need the .sty files, let me know, I can attach those too.

Comment 12 Tom "spot" Callaway 2026-02-10 14:00:18 UTC
Created attachment 2128893 [details]
patched tools component package with latest upstream changes to array.sty longtable.sty and varioref.sty

Comment 13 Tom "spot" Callaway 2026-02-10 14:15:59 UTC
(In reply to Gabriel Somlo from comment #5)

> attaching `latex.tgz` which contains the sphinx-generated latex directory
> for the yosys docs. 

Thanks, this was really helpful.

Before making any changes to texlive-tools:

Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1


Just changing longtable.sty:

! Undefined control sequence.
<argument> \__tbl_hook_use_protected:nV 
                                        {tbl/row/begin}\g__tbl_row_int 
l.10674 \begin{longtable}{\X{50}{100}\X{50}{100}}


Updating all of the modified sty files in tools (array.sty, longtable.sty, varioref.sty):

Output written on yosyshqyosys.pdf (550 pages, 3246222 bytes).
Transcript written on yosyshqyosys.log.

Comment 14 Gabriel Somlo 2026-02-10 15:36:02 UTC
(In reply to Tom "spot" Callaway from comment #13)

> Updating all of the modified sty files in tools (array.sty, longtable.sty,
> varioref.sty):
> 
> Output written on yosyshqyosys.pdf (550 pages, 3246222 bytes).
> Transcript written on yosyshqyosys.log.

I can confirm that using texlive-tools-svn76708-3.fc45.noarch.rpm with the rawhide mock container allows the unmodified upstream sources to build (well, so far, to make it past the place where the pdf manual is built).

Thanks again!

Comment 15 Tom "spot" Callaway 2026-02-10 17:47:49 UTC
This should be fixed in texlive-collection-latex-svn77034-3 (f44 and f45). Please reopen if not.

Comment 16 nvwarr 2026-02-11 14:02:01 UTC
This fixes all my cases. Thanks Tom!


Note You need to log in before you can comment on or make changes to this bug.