HOWTO use xelatex with mixed greek/english hyphenation

Xetex/xelatex is the current solution (among other things) to writing mixed greek and english text in latex, without explicitly changing the writing language (e.g. with \textlatin{}).

The following apply to texlive on Debian/lenny, but can be easily ported to any other Linux distribution.

First you need to fetch the hyphenation patterns and put them to right place. The utf8 file can be created from the iso88597 file with iconv, but is provided here for simplicity. The third file is to ensure others methods (e.g. grlatex) for writing greek in Latex, that use iso88597 encoding, do not break

 
      > wget http://www.softlab.ntua.gr/~mpapakyr/files/grlhyph/grlhyph.iso88597.tex
      > wget http://www.softlab.ntua.gr/~mpapakyr/files/grlhyph/grlhyph.utf8.tex
      > wget http://www.softlab.ntua.gr/~mpapakyr/files/grlhyph/grlhyph.tex
      > sudo ,  su , or your way of becoming root
      # mv grlhyph.iso88597.tex grlhyph.utf8.tex grlhyph.tex \
        /usr/share/texmf-texlive/tex/generic/hyphen
      # texhash
      


Then you have to create a new language for texlive:

      > wget http://www.softlab.ntua.gr/~mpapakyr/files/grlhyph/11gr.cnf
      > wget http://www.softlab.ntua.gr/~mpapakyr/files/grlhyph/grenglish.ldf
      > sudo ,  su , or your way of becoming root
      # mv 11gr.cnf /etc/texmf/language.d/
      # update-languages
      # mv grenglish.ldf /usr/share/texmf-texlive/tex/generic/babel/
      # texhash
      


Then recreate all formats:

      # fmtutil-sys --all
      


Finally, all you have to do is to tell babel to use the new language:

      \usepackage[english,grenglish]{babel}