9

In my document I have a table that is quite big. I would like to have this table on a page with no header and no page number. How can I get this table on a \thispagestyle{empty}? Using it withing the table or tabular environment makes the page were the float is defined go empty and leaves the headers on the table.

For if it matters, I am using fancyhdr.

1

4 Answers 4

9

fancyhdr provides the \iffloatpage macro that can be used to customize header and footer for pages which contain only floats.

\documentclass{book}

\usepackage{fancyhdr}
\fancyhead{}
\fancyhead[LE,RO]{\iffloatpage{}{\slshape\rightmark}}
\fancyhead[LO,RE]{\iffloatpage{}{\slshape\leftmark}}
\fancyfoot{}
\fancyfoot[C]{\iffloatpage{}{\thepage}}
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
\pagestyle{fancy}

\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\blinddocument

\begin{table}[p]
\centering
(Table contents)
\caption{A table on a separate page}
\end{table}

\end{document}

EDIT: For those that want to use the \iffloatpage macro with KOMA-script's scrpage2 package instead of with fancyhdr, add the following to your preamble (thanks to Stefan Kottwitz for the tip):

\makeatletter
\newcommand*{\iffloatpage}[2]{\if@fcolmade #1\else #2\fi}
\makeatother

(The blindtext package is only used to add some dummy text to the example.)

2
  • @Peter: By default, the table should be vertically centered. Tweaking the positioning paramaters still won't "reclaim" the header space, unless the table is too large for a normal page to begin with. There may be hacks to achieve what you want, but that's over my head.
    – lockstep
    May 30, 2011 at 20:27
  • Thanks for that. I realized this immediately after I posted my comment, so therefore I removed it :)
    – Peter Smit
    May 31, 2011 at 4:14
4

When using the memoir document class the command mergepagefloatstyle can be used to separate pagestyles for regular pages and pages with only floats, similar to @lockstep's soltuion. For example

\mergepagefloatstyle{floatcomp}{ruled}{empty}

defines a new style floatcomp that will use the pagestyle ruled for regular pages and empty for float-only pages.

A MWE:

\documentclass{memoir}
\usepackage{kantlipsum}

% Define new style floatcomp that usees 'ruled' style for regular
% pages, and 'empty' for float-only pages.
\mergepagefloatstyle{floatcomp}{ruled}{empty}
% Use previously defined floatcomp style
\pagestyle{floatcomp}

\begin{document}

\kant[1-5]

\begin{table}[p]
\centering
(Table contents)
\caption{A table on a separate page}
\end{table}
\clearpage

\kant[10-13]

\end{document}
3

You can simply put the table on a page of its own without putting it inside a table environment. Then you can make use \thispagestyle{empty} before the table. To add the caption properly, use the \captionof command from the caption package.

2

Because there is no really satisfying answer to the question yet, I want to add an alternative to Alan's approach.

\clearpage
\thispagestyle{empty}
\begin{figure}
...
\end{figure}
\clearpage

This lets you keep the "float" as such, it just doesn't float anymore. That kinda sucks but this at least gives you another poison to choose from.

You must log in to answer this question.

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