[XeTeX] Where to start

Jonathan Kew jonathan_kew at sil.org
Fri Feb 8 15:10:34 CET 2008


On 8 Feb 2008, at 1:36 pm, Peter Dyballa wrote:

> Could this template of a preamble provide the necessary hints? It's  
> meant to be useful for XeLaTeX and LaTeX files, processed by XeTeX,  
> pdfTeX, or pre-pdfTeX, i.e. using dvips (dvipfm support is still  
> missing), so from the differences you might be able to find you're  
> missing.

I expect it works fine, but as an introduction it's FAR too complicated!

If someone wants to get started with XeLaTeX, there's no need to  
clutter the preamble with all the various options for other engines;  
that's just confusing and intimidating.

Here is a simplified starting point:

   % -----------------------------------------------------
   \TeXXeTstate=1
   \documentclass{article}

   % packages to support xelatex:
   \usepackage{fontspec,xunicode,xltxtra}

   % install these TrueType/OpenType fonts in
   %   ~/Library/Fonts   (Mac OS X)
   %   c:\windows\fonts  (Windows)
   %   ~/.fonts          (Linux)
   % (they're all available online), then select them with:
   \defaultfontfeatures{Mapping=tex-text}
   \setmainfont{Charis SIL} % your choice of font
   \newfontfamily{\grk}
     [Scale=MatchLowercase]{Gentium} % pick a font for Greek
   \newfontfamily{\heb}{Ezra SIL} % and one for Hebrew

   % other commonly-used packages:
   \usepackage{hyperref}
   \usepackage{graphicx}
   % etc.... whatever your LaTeX document will need

   \title{A short document}
   \author{Just Me}

   \begin{document}
   \maketitle

   This is a very short document.

   We can include {\grk Καλημέρα κόσμε} in Greek,
   or even {\heb\beginR שלום עולם\endR} in Hebrew.

   \end{document}
   % -----------------------------------------------------

For more extensive multilingual support, look into the new  
polyglossia package (as well as bidi.sty for right-to-left text).

JK



More information about the XeTeX mailing list