# Chapter title on even-numbered pages and section title on odd-numbered pages for one side document

I need to display chapter title on even-numbered pages and section title on odd-numbered pages for one side document. I easily could get that for two side document. But for one side document, it either displays chapter title or section title on all pages, but not both on alternate pages. I have tried by the code shown below.

\documentclass[a4paper,12pt,oneside]{book}

\usepackage{fancyhdr}

\usepackage{lipsum}

\begin{document}

\pagestyle{fancy}

\fancyhf{}

\renewcommand{\chaptermark}[1]{\markboth{#1}{}}

\renewcommand{\sectionmark}[1]{\markright{#1}{}}

\cfoot{\thepage}

\lipsum

\lipsum

\end{document}

• A oneside documenta does not have left and right pages. What you want does not make sense. Jan 30 '18 at 7:28

How's this:

\documentclass[a4paper,12pt,oneside]{book}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{\def\thechaptername{#1}}
\renewcommand{\sectionmark}[1]{\def\thesectionname{#1}}

\cfoot{\thepage}

\begin{document}
\chapter{One}
\section{First}
\lipsum
\lipsum
\section{Second}
\lipsum
\lipsum
\chapter{Two}
\section{twofer}
\lipsum
\end{document}

• It works perfectly. Jan 30 '18 at 12:04

Suggestion:

\documentclass[a4paper,12pt,oneside]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}