[XeTeX] again russian, german, english...

Jonathan Kew jonathan_kew at sil.org
Fri Feb 10 23:36:29 CET 2006

On 10 Feb 2006, at 2:28 pm, Martin Henning wrote:

> On Feb 10, 2006, at 11:12 AM, Will Robertson wrote:
>> I'm going to go out on a limb and say that babel is making things  
>> a *lot* harder than they need to be; you should ditch it and do  
>> the language selection with more low-level methods. (What they  
>> are, I don't know. I do remember Jonathan complaining about  
>> Babel's way of doing things before now, however.)
> right... the whole font encoding stuff seems to be a problem,  
> that's why my fonts get substituted etc.
>> Take a look at my modified version of your example document,  
>> attached. Ignore the line spacing and lists for now; that can be  
>> easily corrected later. If you've got a font that contains  
>> accented and Cyrillic characters, you want to use that font for  
>> everything!
> right... but now i need hyphenation :) is it possible to 'simply'  
> include three hyphenations files and then define some new language  
> selection commands which only apply proper hyphenation? your  
> variant with only one font looks of course nice, but without proper  
> hyphenation i can't possibly write a document for university :)

Here's my attempt at a quick-and-dirty hack to switch hyphenation  
languages without the rest of the Babel baggage getting in the way.  
Try adding this to your preamble:

   \expandafter\ifx\csname l@#1\endcsname\relax
     \errmessage{Sorry, I don't know how to hyphenate `#1'}%
     \language\csname l@#1\endcsname

Then use \hyphlanguage{russian}, \hyphlanguage{german}, etc. to  
select the hyphenation you want for any given paragraph, without  
affecting fonts or the other things that Babel does.

(You may still want to load Babel to set Russian as the primary  
language, if you want "Contents", "Bibliography", etc. to appear in  
their Russian version.)

>> By the way: The pdfsync package only works for pdflatex, as far as  
>> I'm aware. And you won't find some of that hyperref stuff working,  
>> either.
> hm - everything worked for me, all links etc. just the pdf- 
> bookmarks are completely messed up. as jonathan already pointed  
> out... won't work with xetex right now :( is there a way to  
> generate that later? somehow? my document is not very large,  
> possibly i could do it by hand...

If you have a full Acrobat package, I believe you can use that to add  
bookmarks to a document, and can use AppleScript to automate the  
process. Don't know whether it handles Unicode properly, though...  
I'd hope so, but haven't tried.


More information about the XeTeX mailing list