I have a problem with the chapters in the headers. One or two pages before the start of the next chapter (e.g. we are in the last pages of Chapter 2), the header shows the name of the next chapter (e.g. Chapter 3).
Maybe it is \cleardoublepage?
Thanks
Here the code of the main file:
Code: Select all
\documentclass[12pt,b5paper]{book}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage{setspace}
\usepackage{tocloft}
\geometry{verbose,a4paper,tmargin=15mm,bmargin=30mm,lmargin=30mm,rmargin=20mm}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{amssymb}
\usepackage{chapterbib}
\usepackage{fancyhdr}
\usepackage{ifthen}
\usepackage[utf8x]{inputenc}
\usepackage{units}
\usepackage{sidecap}
\usepackage{xr}
\usepackage[round,numbers,sort&compress]{natbib}
\defaultbibliographystyle{unsrt}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\onehalfspacing
\usepackage{multirow}
\usepackage{xcolor,colortbl}
\usepackage[font=small,labelfont=bf]{caption}
\begin{document}
\newenvironment{mydef}[1]{\begin{definition} #1 \mbox{\\}
\rm}
{\end{definition}}
\cleardoublepage
\clearpage{\pagestyle{empty}\cleardoublepage}
\setcounter{tocdepth}{1}
\pagenumbering{arabic}
\cleardoublepage
\pagenumbering{arabic}
\input{ch1.tex}
\input{ch2.tex}
\end{document}
Code: Select all
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} \fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\ Chapter 1}
\fancyhead[RE]{\bfseries\ Chapter 1}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}
\chapter{Chapter1}
\newpage
aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb bbb bbb
\newpage
aaa
Code: Select all
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} \fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\ Chapter 2}
\fancyhead[RE]{\bfseries\ Chapter 2}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}
\chapter{Chapter2}
\newpage
aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb bbb bbb aaaa aaaa bbb bbb