## LaTeX forum ⇒ Page Layout ⇒ Table overlapping with my page number!!

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
rexkykwok
Posts: 6
Joined: Wed Feb 24, 2010 7:55 pm

### Table overlapping with my page number!!

Hi all,

I have created a table with captions which is good enough to fit into 1 single page but however just a bit too long to have the captions overlapping with the page number. I have tried to get rid of the page number on that specific page by using \thispagestyle{empty} within the table description, but unfortunately it has blanked out the page number in the previous page instead.

Any suggestions are much appreciated. Please excuse my naive question as I am relatively new to the latex world!

Regards,
Rex

LaTeXguide.org • LaTeX-Cookbook.net

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

### Table overlapping with my page number!!

Hi,

the fancyhdr package offers the \iffloatpage command to deal with those situations. Please refer to the package documentation for further information.
1,1,2,3,5,8,13,21,34,55,89,144,233,...

rexkykwok
Posts: 6
Joined: Wed Feb 24, 2010 7:55 pm

### Re: Table overlapping with my page number!!

I have already input the following:

\iffloatpage{\thispagestyle{empty}}{\thispagestyle{plain}}

also I have defined my table position with \begin{table}[P] but still not showing me the correct outcome. Have I missed anything?

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

### Re: Table overlapping with my page number!!

Can you please post a compilable version of a document including the complete preamble that you are using and the offending table?
1,1,2,3,5,8,13,21,34,55,89,144,233,...

rexkykwok
Posts: 6
Joined: Wed Feb 24, 2010 7:55 pm

### Re: Table overlapping with my page number!!

Here's the command I have used:

\documentclass[a4paper,12pt,oneside]{report}
\usepackage{fancyhdr}
\iffloatpage{\thispagestyle{empty}}{\thispagestyle{plain}}
\begin{document}
\begin{table}[P]
\centering
\footnotesize{
\begin{tabular*}{\textwidth}{l l c c}
.
.
.
\end{tabular*}\\
}
\end{table}
\end{document}

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

### Table overlapping with my page number!!

You have to use something like the following (from your code I assumed that the page style for the whole document is plain; if that's not the case, you will have to do the necessary modifications):

\documentclass[a4paper,12pt,oneside]{report}
\usepackage{fancyhdr}

\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[C]{\iffloatpage{}{\thepage}}
\pagestyle{plain}

\begin{document}

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text

\begin{table}[p]
\centering
\rule{10cm}{20cm}
\caption{text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text}
\end{table}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

rexkykwok
Posts: 6
Joined: Wed Feb 24, 2010 7:55 pm

### Re: Table overlapping with my page number!!

It does the trick! Thanks gmedina.

rexkykwok
Posts: 6
Joined: Wed Feb 24, 2010 7:55 pm

### Re: Table overlapping with my page number!!

Firstly thanks for the help on this issue previously.

Sorry for bumping this thread again but I am facing a similar issue currently and I think it would be easiest if I reopen this thread.

Instead of having all float page to have no page number, I would like to get rid of the number on "selected" float page only. It's a request from my examiners (on my thesis) as they would like to have page number on all the pages, except those which has long table or big figures which covers the whole page.

Many thanks again for any help in advance.

justdeath
Posts: 69
Joined: Mon Sep 05, 2011 10:27 am

### Re: Table overlapping with my page number!!

Ouch: viewtopic.php?f=47&t=15166

You should read the documentation ... or search the forum.

Nikolay

nan-tze
Posts: 1
Joined: Tue Oct 18, 2011 4:18 pm

### Table overlapping with my page number!!

Nikolay,

"Ouch", the thread you link to doesn't answer rexkykwok's question- the question was how to set custom pagestyles for a float page, and the thread you linked to explains how to set custom pagestyles for a particular text page, but setting \thispagestyle before/in a float just changes the pagestyle for the page in the text, and doesn't affect the float page. Like it says in the fancyhdr documentation, "There is no \thispagestyle for float pages and any change of the page style will at least also affect the page before the float page."

Using \iffloat with fancyhdr you can set the pagestyle for all floats, but neither the documentation nor any forum post that I can find gives an explanation of how to set float-page pagestyle for a single page, or change the iffloat arguments mid-document.

If it's not obvious, I'm trying to do exactly the same thing. rexkykwok, if you found a solution from another source, could you let me know?

Here's a MWE. I'm sorry it's long but the problem comes when the float gets bumped to a later point in the text, so the MWE only works if I put lots of blah's in. I tried setting \thispagestyle within the float (which the documentation correctly states will not work) and I tried
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.5pt}}, but it seems to only work in the preamble, whereas I want to be able to turn it off and on again.

\documentclass{report}

\usepackage{graphicx}
\usepackage{fancyhdr}

\renewcommand{\headrulewidth}{0pt} % and the line
}

\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
\renewcommand{\footrulewidth}{0pt}

\fancyhf{}

\cfoot{\thepage}

\begin{document}

\begin{chapter}{Chapter title}

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

\newpage
\begin{figure}
\begin{center}
\thispagestyle{plain}
\rule[5cm]{10cm}{20cm}
\end{center}
\end{figure}
\newpage

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\end{chapter}
\end{document}