I am typesetting a document with Latex, in which I want the page numbers at right bottom. The following MWE works fine, except that the chapter title pages have number in the center.
\documentclass[12 pt, oneside]{extbook} %extarticle provides additional font-sizes
%formatting header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[CE, CO]{\scriptsize Qualitative Analysis of Sanskrit E-learning Systems}
\fancyfoot[RO, LE]{\thepage}
\usepackage[english]{babel}
\usepackage{blindtext}
\pagestyle{fancy}
\begin{document}
\frontmatter
\pagestyle{plain}
\blindtext[10]
\pagestyle{fancy}
\fancyhead[CE, CO]{\scriptsize Table of Contents}
\tableofcontents
\mainmatter
\pagestyle{fancy}
\fancyhead[CE, CO]{\scriptsize Chapter1}
\chapter{chapter1}
\blindtext[20]
\fancyhead[CE, CO]{\scriptsize Chapter2}
\chapter{chapter2}
\blindtext[20]
\end{document}
On searching to resolve this problem, I found this bit of code to redefine the plain pagestyle.
%Redefining plain style for chapter title pages
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
}
But if I add this code, it removes header line (headrule) from all pages.
Here is the complete MWE
\documentclass[12 pt, oneside]{extbook} %extarticle provides additional font-sizes
%formatting header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[CE, CO]{\scriptsize Qualitative Analysis of Sanskrit E-learning Systems}
\fancyfoot[RO, LE]{\thepage}
%Redefining plain style for chapter title pages
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
}
\usepackage[english]{babel}
\usepackage{blindtext}
\pagestyle{fancy}
\begin{document}
\frontmatter
\pagestyle{plain}
\blindtext[10]
\pagestyle{fancy}
\fancyhead[CE, CO]{\scriptsize Table of Contents}
\tableofcontents
\mainmatter
\pagestyle{fancy}
\fancyhead[CE, CO]{\scriptsize Chapter1}
\chapter{chapter1}
\blindtext[20]
\fancyhead[CE, CO]{\scriptsize Chapter2}
\chapter{chapter2}
\blindtext[20]
\end{document}
What do I do to retain headrule on pages other than the plain pages? (To clarify, I want plain pages with no header, but page numbers on the right bottom, fancy pages with header text, headrule, and page numbers on right bottom).
O
/E
) placement inoneside
mode doesn't make sense;fancyhdr
will warn you about this.