TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
O.K. And I need to use \firstmark. But why is \firstmark=\botmark on the last page? – Martin Schröder Sep 7 '12 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) – David Carlisle Sep 7 '12 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. – Martin Schröder Sep 7 '12 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:-) – David Carlisle Sep 7 '12 at 10:18
Just change the p-column to an l-column in the MWE. I'm still using TL2011/longtable 4.11, though. – Martin Schröder Sep 7 '12 at 10:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.