Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a large table that uses up the whole space on a page. Unfortunately, the table also covers the page number, which is shining through. I don't want to split the table across two pages, hence I want to suppress the page numbering for this single page. Here's my table source code:

\begin{table}
    \myfloatalign
    \begin{tabular}[t]{rrrrr}
        % lots
        % of
        % rows
    \end{tabular}
\end{table}

I tried to place a \thispagestyle{empty} right before the table, directly after the table and in various other places, but without success.

How do I suppress the page number of the page that contains the table?

share|improve this question
    
Do you have control on where the table will appear in the document, or do you want it to float freely? –  Gonzalo Medina Oct 29 '11 at 0:30

3 Answers 3

up vote 25 down vote accepted

The behaviour you expierence is because the table is typeset first on the current page, so a \thispagestyle before or after applies to that page, but then it floats to the next page where it is displayed.

In order to make this work use the floatpag package with \floatpagestyle{empty} to make all float pages have an empty style or use \thisfloatpagestyle{empty} inside the float, i.e. the table environment.

share|improve this answer
    
Thank you very much for your extensive answer. Your solution works perfectly well. –  Philip Oct 30 '11 at 16:26

You can change the page style for all float-only pages using the package fancyhdr. It provides the construction \iffloatpage{value for float page}{value for other pages}. See the documentation for fancyhdr, section 14.

Another option is to use float package and the provided H placement specifier to put your table on a non-floating page. Then you can use \thispagestyle on this page. Of course it means you are to control the placement of the table yourself...

share|improve this answer

You could use the afterpage package and its command \afterpage; the method is admittedly a bit kludgy, but I've used it over the years to very good effect in just the types of situations you describe.

... material before large table ...
\afterpage{ % execute argument of this command *after* end of current page
\clearpage % clear any pending floats
\begin{table}
...
\end{table}
\thispagestyle{empty}
\clearpage % force a page break
} % end of \afterpage{...} stuff
... remainder of document ...

The only way this might fail is if you already have other floats queued up, waiting to be typeset on a page, before you get to the \afterpage{} command. If that's the case, just issue a second \clearpage command. :-)

share|improve this answer

Your Answer

 
discard

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.