1

I have a wide table for which I use the landscape environment from pdflscape. Combined with the fancy header I use in the rest of the document, this looks a bit weird. Is there a way to have no headers on this specific page? I found this question but it only asks for suppressing the header on the first page.

Here is a MWE:

\documentclass{article}

\usepackage{pdflscape}
\usepackage{lipsum}

\usepackage{fancyhdr}
\renewcommand{\footrulewidth}{\headrulewidth} %  line width
\pagestyle{fancy}
\fancyhfoffset[L]{0cm} % left extra length
\fancyhfoffset[R]{0cm} % right extra length
\chead{Fancy header}

\lfoot{Fancy footer}


\begin{document}
\lipsum[2-6]

\begin{landscape}
    \begin{table}[]
        \centering
        \begin{tabular}{cc}
             This is the first column of a very wide table &  This is the second column \\
             row 1 & some text \\
             row 2 & Some more text \\
        \end{tabular}
        \caption{Caption}
        \label{tab:my_label}
    \end{table}
\end{landscape}

\lipsum[3-7]

\end{document}

Page 2 now looks like this:

enter image description here

But I would want it without the header.

0

2 Answers 2

1

You can use \thispagestyle{empty} or \thispagestyle{plain} after \begin{landscape}, but I suggest using sidewaystable.

\documentclass{article}

\usepackage{rotating}
\usepackage{lipsum}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
\renewcommand{\footrulewidth}{\headrulewidth} %  line width
\fancyhfoffset[L]{0cm} % left extra length
\fancyhfoffset[R]{0cm} % right extra length
\chead{\iffloatpage{}{Fancy header}}
\lfoot{\iffloatpage{}{Fancy footer}}


\begin{document}

\lipsum[2-6]

\begin{sidewaystable}
\centering

\begin{tabular}{cc}
  This is the first column of a very wide table &  This is the second column \\
  row 1 & some text \\
  row 2 & Some more text \\
\end{tabular}

\caption{Caption}
\label{tab:my_label}

\end{sidewaystable}

\lipsum[3-7]

\end{document}

enter image description here

1

I suggest you insert the instruction

\thispagestyle{plain}

immediately before \end{landscape}. That way, no header will be shown, and the footer will show just the page number.

If you want to suppress the footer with the page number as well, I suggest you replace \thispagestyle{plain} with

\thispagestyle{empty}

You must log in to answer this question.

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