[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}
\newfontinstance\farsifont[Script=Arabic,Scale=1]{Scheherazade}

\usepackage{fancyhdr}
\pagestyle{fancy}
% with this we ensure that the chapter and section
% headings are in lowercase.
\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection\ #1}}
\fancyhf{} % delete current header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\leftmark}
\fancyhead[RE]{\bfseries\rightmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % space for the rule
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0pt} % and the line
}
\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?




More information about the XeTeX mailing list