How can I have alternating page numbers in the footer (using fancyhdr) in the form of (left footer) page x of y -nextpage- (right footer)page x2 of y? I now have

\cfoot{\thepage\ of \pageref{LastPage}}

But note that on the pages where the chapter starts for some reason the numbering does not apply. I am using the report class

  • When a chapter starts, pagestyle plain is used. You get to know how to redefine that one in section 7 of the fancyhdr manual.
    – Johannes_B
    Jun 14 '15 at 18:41
  • 2
    What is x2 of y then? If left page is 10 then x2 is 11?
    – user31729
    Jun 14 '15 at 19:22

Something like this? The pagestyle is patched into the \chapter command, however, this must be done after \tableofcontents has been issued, otherwise, this would be applied there too.



  \fancyfoot[LE,RO]{\thepage~of \pageref{LastPage}}%


% Now patch the command

\chapter{My first chapter}


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.