Πέμπτη, 16 Ιουλίου 2009

Greek (mis)Transliteration Problem in dblatex: An Analysis

In a comment in a previous post, Simos Xenitellis pointed out a problem with the xelatex backend of dblatex, asking whether it has been resolved in the new TL version.

Unfortunately, it turns out it is not. This is a more in-depth analysis of the problem to help whoever wants to try their hand on a fix. (Disclaimer: I 'm a novice to intermediate TeXnician, so please feel free to point out bugs and omissions in this analysis)

Everytime I see mis-transliteration (e.g., Τιτλε instead of Title) my instict points towards the direction of the greek option of babel combined with a unicode-oriented tex processor (like xetex).

Indeed after doing a
dblatex -d --backend=xetex --verbose mytestfile-el.xml
and inspecting the generated tex intermediate output, I found this was the case.

The problem is that babel's greek option stems from an ancient era of no unicode input, so it redefines the latin letters to greek counterparts e.g., "a" becomes "α" and so on (transliteration). So, whenever this option is used, one has to include the english words in the text within \textlatin{} to get them to display properly. Unfortunately we can't really expect dblatex to do that, since it is multilingual and adding this kind of hacks would soon lead to maintainance nightmare.

What can be done

An immediate workaround is to disable the use of babel altogether:

dblatex -P latex.babel.use=0 --backend=xetex --verbose mytestfile-el.xml
that gets rid of the mistransliteration, but also removes greek hyphenation (ouch). Fortunately we can get that from the xgreek package by greek guru TeXnician Apostolos Syropoulos. Unfortunately, this package is included first time in TexLive 2008 and nobody packages both TL 2008 and dblatex with xetex backend apart from gentoo (which means you get to build them from source no matter what :).

Therefore, the only seemingly sane solution for now is to package xgreek separately for TL 2007 and change the dblatex XSL scripts to add
\usepackage{xgreek}
if the lang parameter is "el" and the backend is "xetex". Any takers?

P.S., this would also solve this debian bug

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου