Page Layout ⇒ how to remove header & footer only on \part pages ?
how to remove header & footer only on \part pages ?
Hi all,
I want to remove header and footer on \part pages only.
But header and footer on \chapter pages must not be affected.
I used fancyhdr package in this case and any modification using \fancypagestyle{plain}{...} will modify \chapter pages too.
Is there anybody knowing this solution?
Thank you in advance.
regards,
latexian
I want to remove header and footer on \part pages only.
But header and footer on \chapter pages must not be affected.
I used fancyhdr package in this case and any modification using \fancypagestyle{plain}{...} will modify \chapter pages too.
Is there anybody knowing this solution?
Thank you in advance.
regards,
latexian
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: how to remove header & footer only on \part pages ?
what document class are you using? Simply modify the coresponding code... (of course, not on the .cls file itself)
1,1,2,3,5,8,13,21,34,55,89,144,233,...
how to remove header & footer only on \part pages ?
here is my code :gmedina wrote:what document class are you using? Simply modify the coresponding code... (of course, not on the .cls file itself)
Code: Select all
\documentclass[a4paper,twoside,10pt,final]{book}
\usepackage[margin=35mm]{geometry}
\usepackage{index}
\makeindex
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO,LE]{\small\sf \rightmark}
\fancyhead[LO,RE]{\small\tt \leftmark} %chapter label
\fancyfoot[RO,LE]{\thepage}
% modification for default plain
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyfoot[RO,LE]{\thepage}%
\renewcommand{\headrulewidth}{0pt}%
}
% making sure chapters or parts begin on odd pages.
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\begin{center}
{\bf\huge intentional left blank.}%
\end{center}
\vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
\title{I love mathematics jokes}
\author{latexian}
\date{\today}
\begin{document}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\part{Introduction}
\chapter{AAA}
\lipsum[1-18]
\chapter{BBB}
\lipsum[1-18]
\part{Advanced}
\chapter{CCC}
\lipsum[1-18]
\chapter{DDD}
\lipsum[1-18]
\appendix
\chapter{\LaTeX\ for beginner}
\lipsum[1-18]
\backmatter
\printindex
\end{document}
how to remove header & footer only on \part pages ?
Hi,
add this to the preamble:
add this to the preamble:
Code: Select all
\makeatletter
\renewcommand\part{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
\makeatother
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: how to remove header & footer only on \part pages ?
@gmedina,
Thanks for the code. It works.
I need a help more.
I already put the code, provided by fancyhdr, in the preamble to write "intentionally left blank." on even-numbered page for chapters ending on odd-numbered page.
However this setting does not work for the blank page right after the \part page. I want the blank page also contains the sentence "intentionally left blank." .
Thank you.
Thanks for the code. It works.
I need a help more.
I already put the code, provided by fancyhdr, in the preamble to write "intentionally left blank." on even-numbered page for chapters ending on odd-numbered page.
However this setting does not work for the blank page right after the \part page. I want the blank page also contains the sentence "intentionally left blank." .
Thank you.
how to remove header & footer only on \part pages ?
Hi,
add the following code
just before the \makeatother command in the code of my previous reply.
add the following code
Code: Select all
\renewcommand\@endpart{
\if@twoside
\if@openright
\ifodd\c@page\else
\cleardoublepage
\fi
\fi
\fi
\if@tempswa
\twocolumn
\fi}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: how to remove header & footer only on \part pages ?
@gmedina,
thank you for your help.
it works the way i want.
thank you for your help.
it works the way i want.