[XeTeX] POLYGLOSSIA with Hebrew

François Charette firmicus at ankabut.net
Fri Apr 24 20:34:12 CEST 2009


Efraim Feinstein a écrit :
> Hi,
>
> sjo wrote:
>   
>> 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.
>>   
>>     
> 0. 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.
>   

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
---

> 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 "כג באפריל")
>   

Obviously a bug. (Strange since the macro clearly has a \space after
\day ...) I'll look into this.

> 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.
>   
As you can see above that was marked as "TODO" ;)

> 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.
>   
OK, thanks.

Best,

FC




More information about the XeTeX mailing list