1

I've searched and read the answers for this problem all over the web. However, it seems something else is wrong with my document. I'm using the book document class in latex. I have not used any \pagestyle{empty} or anything else anywhere. But why page numbering only appears on the first page of each chapter, instead of every page of the document? Please tell me how can I get it on all pages.

Here is my preamble:

\documentclass[a4paper,12pt,openany]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsthm,amssymb,amsmath}
\usepackage{bbm}
\usepackage[top=40mm, bottom=40mm, left=25mm, right=25mm]{geometry}
\usepackage{graphicx}
\usepackage{framed} 
\usepackage[pagebackref=false,colorlinks,linkcolor=blue,citecolor=blue]{hyperref}
\usepackage{fancyhdr}
\newcommand{\changefont}{\fontsize{7}{11}\selectfont}
\fancyhf{}
\fancyhead[LE,RO]{\changefont \slshape \rightmark} %section
\fancyhead[RE,LO]{\changefont \slshape \leftmark} %chapter
\pagestyle{fancy}
\usepackage{setspace}
\onehalfspacing
\usepackage{tocloft}

\usepackage{multirow}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{diagbox}
\usepackage[dvipsnames]{xcolor}
\usepackage[morefloats=100]{morefloats}
\usepackage{biblatex}
\addbibresource{MyReferences.bib}

And here is my document:

\begin{document}
\input{title}
\clearpage

\frontmatter

\addcontentsline{toc}{chapter}{Abstract}
\input{abstract}
\clearpage

\tableofcontents
\clearpage

\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\clearpage

\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
\clearpage 

\mainmatter

\include{chapter1/Introduction}
\include{chapter2/Definitions}
\include{chapter3/Background}
\include{chapter4/Methods}
\include{chapter5/Experiments}
\include{chapter6/Conclusion}

\printbibliography[heading=bibintoc, title={Bibliography}]

\appendix
\include{appendix1}
\include{appendix2}
\include{appendix3}
\include{appendix4}
\end{document}

Again, I have not used any \pagestyle{...} command in chapters or appendices.

4

The main page style is set to fancy via

\pagestyle{fancy}

Also the headers and footers (in order to set them to suit your needs) are completely cleared via

\fancyhf{}

You never use \thepage anywhere. Perhaps you're after

\fancyfoot[C]{\thepage}

as part of your style so that it matches the plain page style (set as the first page of every \chapter).

1
  • Thank you so much. It was \fancyfoot[C]{\thepage}. – leo Jan 24 at 6:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.