[XeTeX] POLYGLOSSIA with Hebrew

sjo sjo222 at gmail.com
Sun Nov 8 03:13:48 CET 2009


On Sat, Nov 7, 2009 at 2:55 AM, Vafa Khalighi <vafa at users.berlios.de> wrote:
>> The only problem remaining (mentioned in earlier posts) is that the
>> numbers do not follow hebrew numbering convention.
>
> What is hebrew numbering convention? I guess, that is irrelevant to  bidi
> and hence something that polyglossia might handle. If there is anything
> related to bidi, then let me know.
> Vafa

I believe it is more related to polyglossia than bidi.

There is a description of the hebrew numbering system and dates at
http://en.wikipedia.org/wiki/Hebrew_numerals

Here is one example that I would like to urgently fix in section
numbers, enumerations page numbers etc. but I don't have the Tex
programming knowledge to do it. The numerals for 15 and 16 should have
special forms — 15 should be ‫ט״ו‬, and 16 should be ‫ט״ז‬.

An earlier post from François Charette below indicates where the fix
should be applied. I would be grateful for any help of how to make the
changes.


======François Charette===================
Not being really knowledgeable of Hebrew, I had simply adapted the code
from Babel (file hebrew.ldf), expecting user feedback to further improve
it. In 18 months I only had one email with suggestions/fixes for the
Hebrew module (which have been applied). Again, if someone is willing
and able to submit improvements, I'd be very grateful!

FYI, the current code for Hebrew numerals is this

---
%Hebrew alphabetic numerals (primitive implementation -- the code in
Babel is more complex):
\def\heb at num@i#1{%

\ifcase#1\or\char"05D0\or\char"05D1\or\char"05D2\or\char"05D3\or\char"05D4%
          \or\char"05D5\or\char"05D6\or\char"05D7\or\char"05D8\fi
 \ifnum#1=\z@\hebnum at zero\fi}
\def\heb at num@ii#1{%

\ifcase#1\or\char"05D9\or\char"05DB\or\char"05DC\or\char"05DE\or\char"05E0%
          \or\char"05E1\or\char"05E2\or\char"05E4\or\char"05E6\fi
 \ifnum#1=\z@\fi\heb at num@i}
\def\heb at num@iii#1{%

\ifcase#1\or\char"05E7\or\char"05E8\or\char"05E9\or\char"05EA\or\char"05DA%
          \or\char"05DD\or\char"05DF\or\char"05E3\or\char"05E5\fi
 \ifnum#1=\z@\fi\heb at num@ii}
\def\heb at num@iv#1{%

\ifcase#1\or\char"05D0\char"05F3\or\char"05D1\char"05F3\or\char"05D2\char"05F3%

\or\char"05D3\char"05F3\or\char"05D4\char"05F3\or\char"05D5\char"05F3%

\or\char"05D6\char"05F3\or\char"05D7\char"05F3\or\char"05D8\char"05F3\fi
 \ifnum#1=\z@\fi\heb at num@iii}
%TODO [optionally]
% -insert gereshayim (\char"05F4) before last letter of a sequence of
two letters or more
% -insert geresh (\char"05F3) after letter if it is alone
> I have tried doing Hebrew with polyglossia and ran into two problems.
> 2. The date for today shows up 5769 but the 5 is a ה rather than a ש, etc.
>
This looks like oddness in \hebrewnumeral, which is used to generate
the numeric date.  It's using a chart similar to
http://www.inner.org/gematria/gemchart.php where the final letters
represent numbers between 500 and 900.  The heh-geresh represents 5000.
The nun sofit represents 700.  It's not the representation of Hebrew
numerals that most readers would be familiar with.

The other obvious strange things in the implementation are:
1. The Gregorian date as represented in Hebrew has no space between the
day number and the month name (it says "כגבאפריל" instead of "כג באפריל")
2. I would usually expect a gershayim indicating that the value is
numeric -- כ״ט = 29, instead of  כט.  In really old documents, all the
letters in the number might have upper dots attached.
3. The values used for 15 and 16 (yod-heh and yod-vav) are never used to
represent those numbers; it's usually tet-vav and tet-zayin.

These look like bugs (or, in the case of #0, an odd feature) in
Polyglossia (or whatever Polyglossia is using as its backend).  I'm not
much of a TeX expert, and I haven't looked into the source code to see
how correctable they are.


More information about the XeTeX mailing list