XeTeX - Old Content

From Wiki
Revision as of 13:36, 26 November 2004 by Adam (talk | contribs) (finished Document Encoding section)
Jump to navigation Jump to search

< Fonts in XeTeX >

XeTeX is a new TeX engine by Jonathan Kew and SIL International, which combines eTeX with pervasive Unicode support and advanced font support (multiple language, special AAT and OpenType font features, trivial font installation). It does this by leveraging Apple Advanced Typography support on MacOSX, so it gains its strength in features by sacrificing TeX's usual cross-platformness, and some backwards compatibility.

XeTeX and ConTeXt

XeTeX is a potential replacement for pdfeTeX in the ConTeXt workflow. It does not support all of the fancy PDF features found with pdfeTeX, but it supports most core features (see Limitations on this page). Common consensus is that for text with non-heavy mathematics needs, XeTeX should be an interesting alternative.

Installing XeTeX

The best and easiest way of installing XeTeX on MacOSX is by using Gerben Wierda's i-Installer. After XeTeX being installed and ConTeXt being updated, you should make a format with texexec:

texexec --make --xtx en

This will generate cont-en.xfmt, which will be used when running XeTeX and ConTeXt.

Running XeTeX

XeTeX is invoked with the --xtx switch in texexec. This loads the XeTeX-specific specials, typescripts and other commands, and actually runs ConTeXt within XeTeX. Technically, XeTeX is an eTeX-like processor, and outputs an .xdv file. After texexec's final XeTeX run, texexec runs xdv2pdf in order to create a PDF file.

texexec --xtx myfile.tex

Document Encoding

XeTeX is able to handle UTF-8 or UTF-16 documents natively, without any interference or configuration from ConTeXt. If you do want ConTeXt to process UTF-8 characters specially, then you can activate it with \enableregime[utf]. Be aware that you are then limited by the named glyphs that exist in the unicode vector files (unic-0xx). However, it is generally desirable to enter UTF documents without any regime notated, and let XeTeX work its magic.

You don't have to encode documents in UTF, though. ConTeXt allows you to use the regime of your choice because of its use of named glyphs, so documents in latin-1 or even MacRoman encoding can be supported, given the proper \enableregime[] command. For characters out of reach of the given regime, you can use accents (like \'e) and/or named glyphs (\eacute).

Although XeTeX would prefer that you key in documents in full Unicode, with things like and in the place of --- and , respectively. This is not always so feasible, so it provides a mechanism for inserting these "TeXish" ligatures. In a font specification, you need to insert mapping=tex-text as one of the font features. This is already done for all existing typescripts in type-xtx, but you should be aware of this concern if designing your own documents.

Features

From there, things proceed fairly normally. Fonts in XeTeX get their own page, as they introduce some new features. Here are some new features that might be of interest:

Unicode symbol sets 
While not exclusive to XeTeX, exactly, you get easy access to named Unicode symbols. XeTeX-specific commands switch to Apple-supplied default fonts for these symbols.
Basic Bi-directional text 
This was ushered in with XeTeX, but is fundamentally an eTeX feature. There is tentative support for direction changing with \pardir TRT and TLT, emulating Omega/Aleph's commands. These should be seen as low-level commands, to be intgrated with language switching, for example.
Alternate script number conversions 
Hans introduced some clever machinery into the conversion macros, allowing one to efficiently define a conversion vector (\defineconversionvector) for script-specific numbers. Arabic and Persian are provided.
More Unicode 
In the process of preparing XeTeX support in ConTeXt, many more Unicode glyphs were named and introduced into ConTeXt, including some Greek, Cyrillic, and Vietnamese.
Typescripts 

Limitations

(as of 26 November 2004)

Font metrics 
Line spacing 
Object reuse 
Bookmarks 
Specials 
Adam 01:15, 26 Nov 2004 (CET)