I have a tabular in my header, using fancyhdr and a longtable that take multiple pages. The longtable has been created by an environment that also sets some variables:


The problem I am facing is that on all pages where the longtable is not finished yet, the tabular in the header will use theses changes.

Is there a convenient way, inside my header, to reset all thoses variables that could have been set ?

For now, I redefined those specific variables in the header, but I find it quite dirty and not very robust.

  • 2
    "I find it quite dirty and not very robust." Welcome to the world of TeX programming:-) You are doing the right thing. Commented Dec 4, 2012 at 14:02

1 Answer 1


As I noted in the comments, you are doing the correct thing. LaTeX resets several things in the header but the list is rather ad-hoc and it's not that unusual that you need to ensure that the environment for any code that you put in the header is normalised.

Basically LaTeX currently restores the following things:

The document default font:


The normal space factor settings


Avoid writing label information on every page if a section head gets copied to a page heading


zero out baselines

  \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@


Default document colour


Thus you will see that there is no notion of a single global resetting or a possibility of arranging the document scope such that settings within the page do not leak to the heading code.

Most multi-line headings will then also call \@parboxrestore either directly or by putting the multi-line code in a parbox or minipage. That resets some additional parameters.

  \parindent\z@ \parskip\z@skip
  \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
  \parfillskip\@flushglue \lineskip\normallineskip

So an alternative to resetting (say) \tabcolsep explicitly in your heading code would be to add its reset to \@arrayparboxrestore That would mean that any tabular nested in a p column in the longtable would get the reset values rather than the values used in the outer longtable. So it depends on your requirements...

You must log in to answer this question.

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