0

I'd like to insert in my headers a book title on the odd page and a chapter title on the even page. How could I do that?

This is my MWE :

\documentclass[a4paper,12pt]{book}
\usepackage{lipsum}
\usepackage{libertine}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}


\usepackage{fancyhdr}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[LE,RO]{\footnotesize\scshape\thepage}
\fancyhead[CE]{\scshape\MakeTextLowercase{\leftmark}}
\fancyhead[CO]{\scshape\MakeTextLowercase{\chaptername~\thechapter}}



\begin{document}
\title{A book title}
\maketitle



\tableofcontents

\chapter{A chapter name}

\lipsum
\lipsum



\end{document}
domi
  • 1,473

1 Answers1

1

gave twoside option in documentclass

\documentclass[a4paper,12pt,twoside]{book}
\usepackage{lipsum}
\usepackage{libertine}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcase}


\usepackage{fancyhdr}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[LE,RO]{\footnotesize\scshape\thepage}
\fancyhead[CE]{\scshape\MakeTextLowercase{\leftmark }}
\fancyhead[CO]{\scshape\MakeTextLowercase{A book title}}



\begin{document}
\title{A book title}
\maketitle



\tableofcontents

\chapter{A chapter name}

\lipsum
\lipsum



\end{document}
Samjith
  • 490