I use book class, modify the header-footer using fancyhdr and customize cleardoublepage. The only thing that works bad is the header of the appendix.
Now the header of appendix becomes Chapter A, Chapter B, etc instead of Appendix A, Appendix B, etc.
Code: Select all
\documentclass[a4paper,twoside,11pt]{book}
\usepackage[margin=30mm]{geometry}
\usepackage[colorlinks,bookmarksnumbered,bookmarksopen]{hyperref}
\usepackage{xcolor,bera}
\usepackage{lipsum}
\usepackage{makeidx}
\makeindex
%------------------------ Header & Footer ------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
%\fancyheadoffset[LE,RO]{\marginparsep+\marginparwidth}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhead[RO,LE]{\small\sf\color{black}\rightmark}
\fancyhead[LO,RE]{\small\tt\color{black}\leftmark} %chapter label
\fancyfoot[RO,LE]{\thepage}
\renewcommand{\headrulewidth}{2pt}
\addtolength{\headheight}{\headrulewidth}
\renewcommand{\headrule}{{\color{gray}%
\vskip\headrulewidth\hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyfoot[RO,LE]{\thepage}%
\renewcommand{\headrulewidth}{0pt}%
}
%------------------------ ClearDoublePage ------------------------
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\begin{center}
{\bf\huge\ Intentionally left blank.}%
\end{center}
\vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
%
\renewcommand\part{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
%
\renewcommand\@endpart{
\if@twoside
\if@openright
\ifodd\c@page\else
\cleardoublepage
\fi
\fi
\fi
\if@tempswa
\twocolumn
\fi%
}
\makeatother
%----------------------- Parskip -----------------------
\setlength{\parskip}{0.5em}
\begin{document}
\frontmatter
\title{I love \LaTeXe}
\author{yoyoimut}
\date{\today}
\maketitle
\tableofcontents
\mainmatter
\part{Getting started}
\chapter{Introduction to Lipsum}
\section{Lipsum One}
\lipsum[1-10]
\section{Lipsum Two}
\lipsum[1-10]
\appendix
\part{Appendix}
\chapter{What is Lipsum?}
\section{Lipsum Appendix 1}
\lipsum[1-10]
\section{Lipsum Appendix 2}
\lipsum[1-10]
\backmatter
\printindex
\end{document}
I attach my complete source code (but not so complicated) here so you can easily try it. Actually the code of redefining cleardoublepage is taken from this forum. But I no longer remember where the link is. I don't know the mechanism of the code as well. So please help me to solve this problem.
Thank you in advance.
regards,
Yoyoimut