I'm using longtable and trying to use \marks. So far I've got no luck.



In the result \firstmark and \botmark are always empty. Am I doing something wrong or is this a bug/limitation of longtable/LaTeX?

1 Answer 1


Clearly it could only be a limitation in longtable as my packages don't have bugs but you might want to read

longtable changes the page heading

However apart from that the marks in your example will have no effect as they only ever have effect in tex if they are in the main vertical list (or can migrate to the main vertical list from horizontal mode). Marks in \parbox and friends do nothing unless the box is eventually unboxed.

Your marks are in a p columns which is a \parbox essentially. They need to be in lcr columns.

  • O.K. And I need to use \firstmark. But why is \firstmark=\botmark on the last page? Sep 7, 2012 at 9:36
  • Latex's output routine has \let\firstmark\botmark you are not supposed to use bare marks always marks with two fields accessed by leftmark and rightmark (not that I always follow the rules either) Sep 7, 2012 at 9:48
  • So how do I get the first and last element of a page with LaTeXs macros? Because even if I use \markboth and \rightmark and \leftmark in the example, on the last page it's still \rightmark==\leftmark. Sep 7, 2012 at 9:54
  • actually I may have been wrong to blame the standard output routine it may be a feature of the way longtable switches to the longtable output routine. I'll think about it. Have you got a MWE not using p cols that shows the problem (either here or just mail it to me:-) Sep 7, 2012 at 10:18
  • Just change the p-column to an l-column in the MWE. I'm still using TL2011/longtable 4.11, though. Sep 7, 2012 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .