# Using another font in page number causes incorrect page numbering in XeLaTeX

In the following code when we use another font for page number, the page number starts from 2 in the first page. The pages are numbered 2, 3, 4, 5. However, the log message during compilation shows that total four pages have been generated.

If the command \palladio is removed from the following two lines, the error disappears.

\makeoddfoot{plain}{}{}{{\palladio\thepage}}


(If the page style is changed to Ruled, the pages get numbered 1, 3, 4, 5.)

Here is the MWE from a much larger task.

\documentclass[twoside]{memoir}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}

% Times New Roman used
\setmainfont[Mapping=tex-text]{Times New Roman}

% Second font for page numbers

\pagestyle{plain}

\usepackage{lipsum}

\begin{document}

\chapter{First}

\lipsum[1-20]

\end{document}


I am attaching the output here though it is a bit big. As you can see, the usage of footers are just the opposite. The even footer is being used for the odd numbered pages and vice versa.
So, internally, the page numbers are correct.

Moreover, the chapter start page style is not plain.

I am using XeLaTeX in Ubuntu.

Update 1

Output of {\palladio 0123456789}.

$\text{Strange}^\infty$

• I used Arial I don't have pallatino and there is no problem. I am in windows 2) the plain style isn't changed by \makeevenfoot? Mar 6 '16 at 14:03
• Can you show the log-file of the MWE? Mar 6 '16 at 14:50
• I copied the URW Palladio L font file from my Ghostscript distribution; in this case I get “ÿ” in the first page, 1 in the second page and so on. What kind of font file is your copy? Mar 6 '16 at 14:56
• @egreg This is produced by fc-list: /usr/share/fonts/type1/gsfonts/p052023l.pfb: URW Palladio L:style=Italic Mar 6 '16 at 15:15
• Please see my update. Do I need to to vote to close the question? Is it a local issue? Mar 6 '16 at 15:16

The problem is not the font. In fact, I changed font when testing your code because I don't have Palladio, and it still showed your same result. You need to invert the position in the command, because basically it works like:

\makeoddfoot{plain}{ <left> }{ <center> }{ <right> }


So you need to switch your commands like this:

\makeoddfoot{plain}{{\palladio\thepage}}{}{}

• @Masroor In my document, even removing \palladio from the command will keep the wrong display of page numbers. So I don't know why in your case there is such a switch, to be honest. Mar 6 '16 at 14:53