2

After typesetting, the page numbers in my document fluctuates from right aligned to centre aligned. How can I ensure a specific and consistent page number alignment?

\documentclass[a4paper,12pt, oneside, final]{book}
\usepackage[UKenglish]{babel}% http://ctan.org/pkg/babel
\usepackage[UKenglish]{isodate}% http://ctan.org/pkg/isodate
%Original date format: \today \par
\cleanlookdateon% Remove ordinal day reference
%Modified date format: \today
%\usepackage[utf8]{inputenc}
\usepackage{microtype}
%\usepackage{graphicx}
\usepackage{picinpar,graphicx}
\usepackage{titlesec}
%\usepackage{secdot}
\usepackage{blindtext}
\usepackage{titlesec}
%\titlelabel{\thetitle.\quad}
\usepackage{floatflt}
\usepackage[inner=2.5cm, outer=2.5cm, top=2.5cm, bottom=2.5cm, bindingoffset=1cm]{geometry}
%\usepackage[english]{babel}
\usepackage[translate=babel]{glossaries}
\usepackage{tabularx}
\usepackage{tabulary}
\usepackage{fancyhdr}
\usepackage{fncychap}
\usepackage{paralist}
%\ChTitleUpperCase
\ChNameUpperCase
\ChNameVar{\centering\Huge\rm\bfseries}
\ChNumVar{\Huge}
\ChTitleVar{\centering\Huge\rm\bfseries}
\renewcommand{\cfttabfont}{Table }
\renewcommand{\cftfigfont}{Figure }
%usepackage{tocloft}
%\centering\Huge\rm\bfseries
%\usepackage{xcolor}
%\usepackage{color}\
%\usepackage{appendix}
%\autoref{app:...}
%\addtocontents{toc}{\cftpagenumberson{chapter}}
%\addtocontents{toc}{\cftpagenumberson}
%See MikTeX and Advanced LaTeX.pdf
%microtype is used for justification of paragraphs
%\usepackage{parskip}
%\usepackage[doublespacing]{setspace}
\setcounter{tocdepth}{5}
%\usepackage{parskip}
\usepackage[doublespacing]{setspace}
\usepackage{hyperref}
\usepackage{glossaries}
\usepackage{tocloft}
\renewcommand\cftchapaftersnum{.}% adds dot after chapter title in ToC
\renewcommand\cftchapdotsep{\cftdotsep}% adds leader dots from chapter titles to page numbers
\usepackage{etoolbox}
\makeatletter
% scale dots
\newcommand\mydot[1]{\scalebox{#1}{.}}
\patchcmd{\@dottedtocline}
  {\hbox{.}}
  {\hbox{\mydot{2}}}
  {}
  {}
% change separation between dots
\renewcommand\@dotsep{10} %default: 4.5
\makeatother
\fancyhf{}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\nouppercase{\rightmark}}
\fancyfoot[LE,RO]{\thepage}
\pagestyle{fancy}
\newcommand{\HRule}{\rule{\linewidth}{0.2mm}}
%\usepackage{tocloft}
%\setlength\cftparskip{-2pt}
%\setlength\cftbeforesecskip{1pt}
%\setlength\cftaftertoctitleskip{1pt}
\usepackage[titles]{tocloft}
\setlength{\cftbeforechapskip}{.1ex}
\setlength{\cftbeforesecskip}{-.5ex}
\usepackage{lipsum} % placeholder text
\usepackage[font=small,format=plain,labelfont=bf,up,textfont=pl,up]{caption}
8
  • In which consistent position do you desire the page numbering? By the way, since oneside is being used, the E, O modifiers for fancyhdr have no real effect. Mar 19, 2014 at 20:09
  • Welcome to the site! Could you make a copy of your file, and strip the copy down to a minimum working example? Presumably not all of your packages are necessary to demonstrate the problem? :)
    – cmhughes
    Mar 19, 2014 at 20:16
  • I usually place the page numbers at the bottom of the page and centre-align it. The text provided constitutes a minimum working example in my view as I intend to prepare a thesis. Hope this helps.
    – Donavon
    Mar 19, 2014 at 20:21
  • @Donavon change the line \fancyfoot[LE,RO]{\thepage} to \fancyfoot[C]{\thepage}. Mar 19, 2014 at 20:29
  • @GonzaloMedina That worked perfectly, thanks.
    – Donavon
    Mar 19, 2014 at 20:39

1 Answer 1

2

Change the line

\fancyfoot[LE,RO]{\thepage} 

to

\fancyfoot[C]{\thepage}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .