[XeTeX] POLYGLOSSIA with Hebrew

sjo sjo222 at gmail.com
Fri Nov 6 04:04:24 CET 2009


On Thu, Nov 5, 2009 at 12:30 AM, Jonathan Kew <jfkthame at googlemail.com> wrote:
> On 4 Nov 2009, at 22:01, sjo wrote:
>
>> \renewcommand{\thesection}{\alph{section}}
>> \renewcommand{\thepage}{\alph{page}}
>>
>> Section and Page don't work with for me. I get an X with a box around
>> it where the section and page numbers should appear.
>
> Sounds like trying to print Hebrew letters with a font that doesn't support
> them. Check what font is being used in the context where these appear.
>
> JK

A sample file with polyglossia/hebrew that works is provided below.
[Section, footnote, page numbers are all in Hebrew, although
\hebrewtoday is in English, not Hebrew for some reason. It seems that
I must use \newfontinstance, as \newfontfamily does not work to set
the hebrew font; I am not sure why this is needed].

If I reverse matters so that \setdefaultlanguage is english and
\setotherlanguage is hebrew, then numbers are in arabic, not hebrew.
\renewcommand\theenumi works to set the numbers to hebrew in
enumeration, but the same does not work for section or page numbers
(see commented out code below).

So what I cannot get to work is a polyglossia document with the
default language english --- other language hebrew so that in a
\hebrew environment we get hebrew numbering and in the default
(english) section we get english numbering. Perhaps this is not
possible or even advisable.


====
\documentclass{article}
\listfiles %puts package versions at end of log file
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[numerals=hebrew]{hebrew}
\setotherlanguage{english}
\newfontinstance\hebrewfont[Script=Hebrew,Scale=1]{Ezra SIL}
\textwidthfootnoterule
%\renewcommand\theenumi{\alph{enumi}}%Hebrew numbers for enumeration
%\renewcommand{\thesection}{\alph{section}}%Hebrew numbers for section
%\renewcommand{\thepage}{\alph{page}}%%Hebrew page numbers

\begin{document}
\begin{english}
Here is some English with a footnote\footnote{English}.
\end{english}

שלום אבגדהוז \LR{mixed in with english} אבגדה

\hebrewtoday

\section{להשוות אותם כלל}
\begin{enumerate}
\item
תוכנת וורד מיועדת לעוסקיםא בהקלדה פשוטהב, עיצוב דפים שונים כמו מודעות
\item
תוכנת , וכן קשה מאד {ב} ללמוד אותן.
אין להשוות אותם כלל לפשטות השימוש בתכנת וורדג.\footnote{
להשוות אותם כלל}
\end{enumerate}

\section{להשוות אותם כלל}

תוכנת , וכן קשה מאד {ב} ללמוד אותן
\end{document}


More information about the XeTeX mailing list