[XeTeX] polyglossia becoming reality...

Jonathan Kew jonathan_kew at sil.org
Thu Jan 10 12:53:35 CET 2008


On 10 Jan 2008, at 10:34 am, François Charette wrote:

> By the way: when trying test1.tex I have encountered two problems I
> cannot solve:
>
> * The command \today in Latvian does not print the year. I don't
> understand why.

If you add \relax before \number\year, it prints OK. The problem is  
that "\inlineextras at latvian" ends with the macro    "\local at hyphenmins 
{latvian}{2}{2}", which in turn expands to something ending with  
"\lefthyphenmin=2\righthyphenmin=2". When TeX reads this, it looks  
ahead past the final "2", to see if the number continues.... which it  
does, if the next thing it finds is "\number\year"!

You can show this is the problem by changing \today in gloss-latvian  
to say

       \number\year.\thinspace gada\showthe\righthyphenmin%

which will show "22008" as the value of \righthyphenmin at that point!

To fix this better, modify \local at hyphenmins in polyglossia.sty to  
add a \relax:

\newcommand{\local at hyphenmins}[3]{%
    \@ifundefined{#1hyphenmins}%
       {\lefthyphenmin=#2\righthyphenmin=#3\relax}%
       {\csname #1hyphenmins\endcsname}%

Then the individual gloss files don't need to watch out for initial  
numbers in this situation.

JK





More information about the XeTeX mailing list