I created a header and footer using fancyhdr. I want to remove the footer from a particular page without touching the header. I tried changing the page styles but nothing worked. any idea?
[Tex/LaTex] Remove Footer without removing the header
fancyhdrheader-footerxetex
Related Solutions
exam.cls
uses its own mechanism for headers/footers. To modify the default rules in headers, you can patch \@fullhead
(for the first page) and \run@fullhead
(for other pages) to use whatever you choose, instead of the default \hrule
. A little example using a double rule:
\documentclass{exam}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@fullhead}{\hrule}{\hrule\vskip2pt\hrule height 2pt}{}{}
\patchcmd{\run@fullhead}{\hrule}{\hrule\vskip2pt\hrule height 2pt}{}{}
\makeatother
\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Math 115}{First Exam}{July 4, 1776}
\runningheader{Math 115}
{First Exam, Page \thepage\ of \numpages}
{July 4, 1776}
\firstpagefooter{}{}{}
\runningfooter{}{}{}
\begin{document}
test\clearpage
test
\end{document}
In the case of footers, one has to patch \@fullfoot
and \run@fullfoot
and invoke \runningfootrule
, \firstpagefootrule
.
One possibility is
\AtBeginDocument{%
\addtocontents{toc}{\protect\thispagestyle{empty}}%
\addtocontents{lof}{\protect\thispagestyle{empty}}%
}
in the preamble. If there are more than one page in the table of contents or list of figures you have to use \pagestyle{empty}
additionally.
Example:
\documentclass{report}
\usepackage{times}
\usepackage{fancyhdr}
\usepackage{graphicx}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{0.4pt}
\rhead{\fontsize{10}{12}\selectfont \textit{\textbf{2014-2015}}}
\lhead{\fontsize{10}{12}\selectfont \textit{\textbf{ECG SIMULATION AND ACQUISITION}}}
\rfoot{\fontsize{10}{12}\selectfont \textit{\textbf{\thepage}}}
\lfoot{\fontsize{10}{12}\selectfont \textit{\textbf{Dept. of ECE, RNSIT, BANGALORE}}}
\AtBeginDocument{%
\addtocontents{toc}{\protect\thispagestyle{empty}}%
\addtocontents{lof}{\protect\thispagestyle{empty}}%
}
\usepackage{blindtext}% dummy text
\begin{document}
%
\pagestyle{empty}
\tableofcontents
\listoffigures
%
\clearpage
\pagestyle{fancy}
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\begin{figure}
\fbox{Figure}
\caption{A figure}
\end{figure}
\end{document}
If you use a KOMA-Script class
\AfterTOCHead{\thispagestyle{empty}}
removes the header and footer from the first page of table of contents and all lists that are controlled by KOMA-Script.
Best Answer
Define a style where you only clear the footer:
You'll see that on page two only the headers appear, but the footer returns on page three.