14

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

9
  • 1
    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}}. 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. 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? Oct 18 '14 at 1:15
23

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

6
  • 4
    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
  • For some reason xcolor complains: Error: undefined color 'true'. Using \pageref* instead of \pageref works. Jun 1 at 12:37
  • @AnthonyLabarre: Sounds like you should post a question including a fully compilable MWE including \documentclass and the appropriate packages that reproduces the problem. Sounds like a bug to me, but not sure without being able to reproduce it. Jun 2 at 4:23
  • @PeterGrill: I just discovered that the error was caused by the option linkcolor=true in \documentclass[11pt,a4paper,colorlinks,linkcolor=true]{moderncv}. This option does not cause any error if I remove the two lines you gave in your answer, however. Would you still prefer a new question? Jun 2 at 16:02

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.