3

I am trying to remove the page numbering from a very wide and long table in landscape. When I try using \thispagestyle{empty}, this removes only the page numbering on the part of the table filling the first page only, leaving the other page numbers overlapping the table contents.

I have also tried using the package floatpag described here: Suppress page number for a single page that only contains one large table? But it makes no difference to the landscape page number position.

Please help me.

This is my script:

\documentclass[10pt]{article}
\usepackage[font=scriptsize]{caption}
\usepackage{graphicx}
\usepackage{pdflscape}
\newcounter{z}
\def\z{\stepcounter{z}[[[[[\thez]]]]]}
\makeatletter

\def\fudge#1#2{%
\addtolength\textheight{#1}%
\@colroom\textheight
\vsize\textheight
\@colht\textheight
\def\LS@rot{%
 \setbox\@outputbox\vbox{\hbox{\kern-#2\rotatebox{90}{\box\@outputbox}}}}%
\clearpage}

\makeatother


\usepackage{longtable}
\usepackage{fancyhdr}
\pagestyle{myheadings}


\begin{document}

\begin{landscape}
\fudge{3cm}{1.5cm}% 3cm longer and raise by 1.5cm
\advance\LTcapwidth by 360pt 
{\footnotesize  % Switch from 12pt to 11pt; otherwise, table won't fit
\setlength\LTleft{-100pt}            % default: \fill
\setlength\LTright{-30pt}           % default: \fill
\begin{longtable}{@{\extracolsep{\fill}}lllllllllllllll@{}}
\caption*{
\bf{All results}}
\tabularnewline \hline
col_1 & col_2 & col_3 & col_4 & col_5 & col_6 & col_7  & col_8 & col_9 & col_10 & col_11  & col_12 & col_13 & col_14 & col_15\\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
This & is & a & long & and & wide & table & bla & bla & bla & bla & bla & bla & bla & bla \\
\hline  
\end{longtable}}
\begin{flushleft} Results using a long and wide table \end{flushleft}
\end{landscape}

\end{document}
1
  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Oct 3 '13 at 15:40
3
 \thispagestyle{empty}

Only affects one page, use

\pagestyle{empty}

and then if necessary change back with

\pagestyle{myheadings}

after the table, although as noted in comments this should not be needed if you switch to empty page style inside the landscape region, as it should switch back automatically at the end of the environment.

3
  • Thank you David! I just had to put this after the landscape command, and if I do that I don't even need to reset the pagestyle... This is what worked: \begin{landscape} \pagestyle{empty} Oct 3 '13 at 15:43
  • 1
    Wouldn't \pagestyle{empty} after \begin{landscape} suffice?
    – egreg
    Oct 3 '13 at 15:43
  • @egreg yes, using the local grouping Oct 3 '13 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.