# [XeTeX] bidi or arabxetex problem with fancyhdr

Mehdi Omidali mehdioa at gmail.com
Sun Jul 13 19:06:55 CEST 2008

I compiled the following lines with xelatex (0.999.2 on both windows and linux)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[openany,twoside]{book}
\usepackage{arabxetex}
\setromanfont[Mapping=tex-text,Scale=1]{Times New Roman}

\usepackage{fancyhdr}
\pagestyle{fancy}
% with this we ensure that the chapter and section
\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection\ #1}}
\fancyhf{} % delete current header and footer
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{%
}
\begin{document}
\pagenumbering{arabic}
\pagestyle{fancy}
\begin{farsi}
\chapter{First}
\section{first}
\newpage

\section{second}
\newpage

\section{third}

\newpage

\section{forth}
\newpage
\section{fifth}

\chapter{Second}
\section{sixth}
\end{farsi}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This code works without any problem but if you comment the second chapter, then
numbers of pages 5 and 6 will be printed on the top right of pages.
Any clue what is happening?