[XeTeX] Defining a ligature-like macro

Will Robertson wspr81 at gmail.com
Thu Nov 16 03:40:35 CET 2006


On 11/16/06, James Crippen <jcrippen at gmail.com> wrote:
> What I'd like to have is something like a ligature such that when I
> type "kh", depending on some variable setting I either get "kh" or
> "\ul{k}" (or a similar macro) as the output.

This is unfortunately impossible in TeX and XeTeX. Perhaps future
versions of pdfTeX, which incorporate Omega, will be able to do such
things.

Font mappings can only adjust one unicode string with another, so
while it will allow you to just write "kh" and have different unicode
glyphs come out, that will only work if you have a font with those
unicode characters.

The "proper" way to do it would be to just use a font that contains
the correct underscore diacritics, and to remap your keyboard with
Ukelele so that it's convenient to type the characters you need.

Will


More information about the XeTeX mailing list