Print

Print


Hans Aberg writes:
 >   But, continuing this theme of non-deterministic parsing, have you tried
 > picking up say a whole word in advance, then doing some parsing of it
 > (expanding all macros in it, and replacing it with a word where TeX might
 > regonize it.
 >   More explicitly, one would type say
 >     <foo\a bar>
 > Then the "<" would pick up the whole "foo\a bar>", expanding the \a,
 > finally returning "foobar". Would it be possible to recognize a ligature
 > "ob" by this method? (The example is otherwise entirely hypothetical.)

it would but on the other hand it would not help as you

 a) need that > character there is not anything you could choose, eg
scanning up to the next space or so is no answer as you would run into
problems inside arguments etc

 b) there is this nasty case of \verb which modifies TeXs parsing and
you would kill that case as well

so again, unless you make everything "letter" and "other" except for
"\" and the start of shortref strings and essentially build your own
parser for all of the text (with the problem of handling nested groups
etc etc) there is no way to make this work

frank