# [XeTeX] headers wrong with polyglossia and/or bidi

Jonathan Kew jfkthame at googlemail.com
Tue Sep 22 10:01:15 CEST 2009

On 22 Sep 2009, at 08:29, Gildas Hamel wrote:

> I'm encountering the following problem for a work in which I'm using
> Greek and Hebrew: the information in the page headers is printed in
> reverse order. My preamble follows. I also attach to my email an
> example with about 3 pages of text and the pdf with wrong headers in
> pages 2-3.
>
> %!TEX TS-program = xelatex
> %!TEX encoding = UTF-8 Unicode
> \TeXXeTstate=1
> \documentclass[11pt]{book}
> %\usepackage{bidi}
> \usepackage{polyglossia}
> \setdefaultlanguage{english}
> \usepackage{fontspec}
> \setotherlanguage[variant=ancient]{greek}
> \setotherlanguage{hebrew}
> \setromanfont[Mapping=tex-text,
> 		Numbers=OldStyle]
> 			{Junicode}
> \newfontfamily\hebrewfont[Script=Hebrew,Scale=0.9]{NewJerusalemU}
> \newfontfamily\greekfont[Scale=0.96]{GFS Porson Regular}
> \begin{document}
> \chapter{Cana}
> \section{John 2.1--11}
> Text with Greek, English, and some Hebrew...
> \end{document}
>
>
> If I remove \setotherlanguage{hebrew}, the headers look fine, but
> the phrases in Hebrew are of course wrong (same effect with the bidi
> package).  The solution may be most obvious and simple but I cannot
> see it and would be grateful for any help.

Offhand, this seems to me like a bug (in polyglossia? bidi?) -- I
can't see why the headers should flip to RL layout just because you've
said you'll be using fragments of Hebrew. A couple of ideas you could
try to work around the problem:

* What if you exchange the order of your \setotherlanguage commands,
to put Hebrew before Greek? (Maybe the last one will "win" in terms of
setting directionality in the headers. Unlikely, but you never know!)

* Presumably you could load a package (such as fancyhdr) that allows
you to redefine the headers, and use this to "wrap" their content in
\beginL...\endL commands (or the \LR{...} macro if that's equivalent).
I'm not really familiar with the exact details but it seems like this
should let you regain control of the directionality there.

JK



More information about the XeTeX mailing list