I have a document that is mostly in normal layout, but two sections need to be in landscape. The contents of the page turn without problem, including table and section. What doesn't turn on those pages are the header and the footer, and I'd like those to turn as well. How can I do that?
\documentclass{article}
\usepackage{lastpage}
\usepackage{lscape}
\usepackage{titlesec}
\newpagestyle{newstyle}{
\setheadrule{0pt}
\sethead[\small{Report - \sectiontitle}]
[]
[]
{\small{Report - \sectiontitle}}
{}
{}
\setfoot[\small{\copyright~{} \year myself}][][\small{\thepage/\pageref{LastPage}}]{\small{\copyright~{} \year myself}}{}{\small{\thepage/\pageref{LastPage}}}
}
\titleformat{\section}
{\color{blue}\normalfont\Large\bfseries}
{\color{blue}\thesection}{1em}{}[\vspace{2pt}\titlerule]
\titleformat{\subsection}
{\color{blue}\normalfont\Large\bfseries}
{\color{blue}\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\color{blue}\normalfont\Large\bfseries}
{\color{blue}\thesubsubsection}{1em}{}
\pagestyle{newstyle}
\begin{document}
\begin{landscape}
\section{A section}
Some Text
\begin{table}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
foo & bar & bar & baz & foo & bar \\
\hline
a & a & a & a & a & a\\
\hline
\end{tabular}
\end{table}
\end{landscape}
\end{document}