[XeTeX] Having correct hyphenation for multiple languages in the same document

Gildas Hamel gweltaz at ucsc.edu
Tue Jul 20 06:31:47 CEST 2010


* George (pinkisntwell at gmail.com) wrote:
  |>  I'm trying to compile a document that has both English and Greek text.
  |>  I tried with polyglossia which uses the correct hyphenation for each
  |>  language but ignores my selection for the English font (and not for
  |>  the Greek for some reason). I try with plain xelatex and it uses the
  
I would use something like the following (or with \begin{greek}... \end{greek})

______________________________________
\documentclass[12pt]{article}                                                                                                             
\usepackage{fontspec}                                                           
\usepackage{polyglossia}         
\setdefaultlanguage{english}                                      
\setotherlanguage{greek}
\pagestyle {empty}                                                              
\usepackage[a4paper,margin=1.2in]{geometry}                                   
\setmainfont[Mapping=tex-text]{Linux Libertine O}                               
\newfontfamily\greekfont{Linux Libertine O}                                     
\newfontfamily\englishfont{Linux Libertine O}                                   
                                                                                
\begin {document}                                                               
                                                                                
        \section* {Εκπαίδευση}                                                  
                \begin {description}                                            
                \parindent=20pt                                                 
                        \item [2003--2009:] Τ.Ε.Ι. \textgreek{Πειραιά, Πτυχίο  
Ηλεκτρολογίας με βαθμό ``Λίαν Καλώς'',
6.74/10.
O τίτλος της Πτυχιακής μου Εργασίας ήταν ``Ανάλυση Μη Γραμμικών Κυκλωμάτων'' και παρουσίαζε
μεθόδους ανάλυσης κυρίως ηλεκτρονικών κυκλωμάτων σε
ηλεκτρονικό υπολογιστή.}
                 \end {description}                                             
                                                                                
\end {document}
_________________________________________

-- gildas



More information about the XeTeX mailing list