[XeTeX] sting manipulation macros

Michiel Kamermans pomax at nihongoresources.com
Sun Oct 19 21:54:47 CEST 2008


Ross,
> It sounds like TeX's pattern-matching, and \ifx conditional,
> and other primitives such as \futurelet, are just what you want.
>
> Several LaTeX packages rely on per-character parsing, to decide
> what to do with specific kinds of data. Examine the internal
> coding of these packages to see how they work.
> Off the top of my head I can think of:
>
>    hyperref.sty   converting the input stream to PDF strings
>       e.g. for Bookmarks and other PDF elements;
>
>    Xy-pic  is full of parsers that interpret character strings
>            as programming code to include graphic elements.
>
>    musictex.tex
>    chess.sty
>       and similar packages, need this kind of processing.
Good recommendations, although my feature suggestion still stands... 
from a programming point of view, the standard TeX programming language 
is quite a pain (even Knuth admitted he'd have done it differently if he 
had the programming languages available that we do these days =). If 
there were a few simple wrapper macros available it would certainly make 
writing new packages that rely on string manipulation a remarkable lot 
less painful.

- Mike


More information about the XeTeX mailing list