[luatex] getting previous glyphs

Norbert Preining preining at logic.at
Thu Dec 4 11:59:14 CET 2014

Hi Paul,

On Thu, 04 Dec 2014, Paul Isambert wrote:
> If I understand correctly, you want to turn every input of the form
>   KKK<uuuu>
> into
>   \ruby{KKK}{uuuu}


> A simple solution would be to use the process_input_buffer callback with a function like:
> function ruby (line)
>   return line:gsub("(K+)<(u+)>", "\\ruby{%1}{%2}")
> end

Ok, I guess I can work on that. The K+ is of course the problem,
I need to define some unicode ranges I guess, but other than that
it should be fine.

> You might have to use LPEG. Also, this won't work if the pattern crosses line ends, since

That is, as far as I see, no problem, because every line is a paragraph, no
intermediate line breaks in the input text file.

Thanks for the suggestion, I hope to find time to look into how
to actually implement this ;-)


PREINING, Norbert                               http://www.preining.info
JAIST, Japan                                 TeX Live & Debian Developer
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0  ACF0 6CAC A448 860C DC13

More information about the luatex mailing list