I have a document with hundreds of longtables throuhout it. While checking the final document it turned out that the headers are putting wrong section names just as described here. A possible solution to this has been presented here, namely to make a small change in longtable.sty. This however did not work for me as it generated several unwanted page breaks just out of nowhere.

The source of the problem is described in the answer linked to above:

\topmark is set by the final iteration of the LT output routine, but not passed on to the standard routine. The standard routine would just pick up the mark again as the final table section is re-considered by the page breaker

So here is my question: How could I edit longtable.sty so that longtables do not make a mess? Does anyone know how to pass \topmark from the LT output routine to the standard routine (whatever it means...)?

  • 1
    Please post a minimal compilable example that gives rise to the problems you are encountering.
    – Mico
    Nov 10, 2015 at 8:21
  • 1
    You'd need to more or less rewrite longtable to do a complete fix. (There is a reason that bug has been open for 20 years) In any particular document, changing longtable isn't required as it it always(?) easier just to add a suitable \markboth after the table to force the correct headings. In most cases removing the vbox as in the referenced questsion will work as an automatic fix, although there is a theoretical possibility that you get an unexpected page break. Again an example that shows this theoretical possibility happens would be useful. Nov 10, 2015 at 9:17
  • @Mico A MWE is posted in the linked question. Here's the link again: tex.stackexchange.com/questions/277344
    – Dominik
    Nov 10, 2015 at 12:42


Browse other questions tagged .