Hans Hagen wrote:
Marcin Borkowski wrote:
Hello!
I was just wondering, whether something like this is possible in luatex - and if not, if it might be implemented;). I'd like to be able to transform somehow the input right *before* TeX sees it. What I mean is e.g. a transformation using regexps. Application I have in mind is as follows: in Polish, there are a few prepositions which are one-letter words; it's a bad custom to leave them hanging at the end of a line. Such an option could automatically put ties (~) instead of spaces after them - a feature sometimes requested by Polish TeX users.
input parsing is not needed here, it's easier to to do this on the node list; remind me in a few months (it's rather trivial to implmenent since the infrastructure is already in mkiv)
Hans is right, the node list should be altered instead of the input, because you can never be sure that "\TEX\ i \METAFONT\" is not hidden inside a definition somewhere. There actually is a way to modify the input lines just before they are parsed by luatex, but that is really only suitable for converting 8-bit encodings to utf-8. (I was going to post an example abusing that method, but there are way many things that can go wrong, so I changed my mind) Best wishes, Taco