2

I'm currently struggeling to extend a onesided longtable with fixed column widths to a double-sided layout (where the position of the columns changes depending on even/odd pages). My current approach would be to change the table to a onecolumn layout and switch the layout of the rows depending on left/right pages, but keeping the same row heights - thus avoiding instable solutions. This will most likely work - but I also need different table headers on the pages.

But longtable as is stores the table head in a box, so the headers are the same on every page. Is there a way to get different headers on even and odd pages with longtable?

Related: Is there a list environment with (double sided) page headers?

  • 1
    In theory yes: e.g. search the net for "longtable hack". You can also identify the first longtable row of a page through labels and then add the header simply to this row. In practice a sensible approach depends a lot on the concrete code and table. – Ulrike Fischer May 27 '13 at 09:58
  • @UlrikeFischer: My problem is much simpler than yours: I have two fixed headers (one for even and one for odd pages). Could I simply extend longtable to store two headers and then decide in the output routine which one to use? – Martin Schröder May 27 '13 at 10:19
  • Well you could extend longtable. But "simply"? The main problem is that there are not reliable hook. E.g. the following question was triggered by trying to get the first row of a longtable always in gray (in a table with alternating colors): http://tex.stackexchange.com/questions/89324/xcolor-and-everycr-problem. – Ulrike Fischer May 27 '13 at 10:45
  • @UlrikeFischer: One approach would be to define an additional header box for even pages and extend \LT@output to switch between the two boxes. This seems to work for simple cases. – Martin Schröder May 27 '13 at 11:05
  • Yes extending LT@output is what the longtable hack I already mentioned does. – Ulrike Fischer May 27 '13 at 11:24

0 Answers0