12

I am running OS X Yosemite Beta 6 with MacTeX 2014. In general everything seems to be working, however, when I create a resume with moderncv with more that one page the page numbers are not displayed on the right hand side of the footer. Here is a minimal example:

\documentclass[sans, letterpaper,10pt]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}

\name{John}{Doe}
%\title{}
\address{street}{postcode city}
\mobile{+4~(11)~311~111}
\phone{+2~(345)~678~901}
\fax{+3~(456)~789~012}
\email{mail@yahoo.com}
\homepage{www.johndoe.com}
\extrainfo{additional info}
% \photo[64pt][0.4pt]{picture.png}
%\quote{}

\begin{document}
\makecvtitle

\section{Experience}

\subsection{My work}
\cvcomputer{One}{Bla, Bla, Bla}{Two}{Bla,Bla,Bla}

\newpage

\section{Foreign Languages}
\cvitemwithcomment{English}{Fluent}{Some description here}

\newpage

\section{Other Skills}
\cvitemwithcomment{Computers}{Very good}{Some description here}

\end{document}

I have also tried to compile the code with pdflatex, xelatex, and lualatex and they don't seem to have any effect on the behaviour of the moderncv.

I know similar questions have come here, but I didn't see a resolution being offered. People have suggested using \rfoot, but since the page numbers are defined in moderncv, I would like to find what goes wrong in my file.

Thanks,

Hooman

| improve this question | | | | |
  • Welcome to TeX.SE. Using \rfoot{} as you suggested does indeed work: \rfoot{Page \thepage}. If you also want a total count of the pages you can use \usepackage{lastpage} and \rfoot{Page \thepage\ of \pageref{LastPage}}. Or, perhaps add that as the additional info: \extrainfo{Page\ \thepage of \pageref{LastPage}}. – Peter Grill Oct 16 '14 at 7:24
  • Try the solution at Customizing moderncv numbering pages style and if that works for you perhaps we should close this question as a duplicate. – Peter Grill Oct 16 '14 at 7:29
  • 1
    I used the solution provided in Customizing moderncv numbering pages style and it still doesn't print the page numbers. While using the \rfoot{} solves the problem, my question is mainly that why this doesn't work out of the box. The package is supposed to put page numbers at the footer. What is the cause that they don't show up? – Hooman Oct 17 '14 at 4:46
  • Also I noticed that the solution provided there was for vertical justification of page numbers with the contents of the cfoot. This means that they were getting the page numbers. In my case, unless I used the workaround of \rfoot{Page\ \thepage}, I don't get a page number. – Hooman Oct 17 '14 at 4:55
  • Where exactly do you want the page number? – Peter Grill Oct 18 '14 at 1:15
18

I don't know why this is needed (seems as it should be the default behavior), but to obtain the page numbering you can add

\usepackage{lastpage}
\rfoot{\addressfont\itshape\textcolor{gray}{Page \thepage\ of \pageref{LastPage}}}

which yields:

enter image description here

| improve this answer | | | | |
  • 2
    As you said this should be the default behavior and according to the examples of moderncv package, the page numbers should appear there without the need for these two lines of code. However, I used this workaround and it worked for me. – Hooman Nov 6 '14 at 2:12
  • 3
    What do I have to change to get the page numbering centered? Never mind \cfoot does the trick – Max M Mar 9 '15 at 15:54

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.