# Chapter title on even header and section title in odd header

I wanted to put the title of the chapter on even header and the title of the section of the chapter to the odd pages.

My headers are now are using this code:

 \begin{document}

\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages

\setstretch{1.3} % Line spacing of 1.3

% Define the page headers using the FancyHdr package and set up for one-sided printing
\rhead{\thepage} % Sets the right side header to show the page number

\pagestyle{fancy} % Finally, use the "fancy" page style to implement the FancyHdr headers


Moreover, chapters are in separate files and called in a main file.

-

You can simply use the selectors E and O for even and odd pages. Here is a MWE:

\documentclass{book}
\usepackage{lipsum}
\usepackage{fancyhdr}

\fancyfoot{}

\begin{document}

\pagestyle{fancy}

\chapter{Chapter}
\section{section}

\lipsum
\lipsum

\end{document}


Here is the output:

You can modify the way chapter and section are displayed by redefining \chaptermark and \sectionmark.

-
I used it but nothing happen. –  ali amidi Jan 12 '13 at 16:53