[luatex] find breakpoints in a word

Paul Isambert zappathustra at free.fr
Thu Jun 23 11:12:02 CEST 2011



Le 23/06/2011 10:59, Patrick Gundlach a écrit :
> Hi,
>
> I'd like to find out the breakpoints of a word (with Lua), such as
>
> \showhyphens{office}
>
> The ideal solution would be to get a string like "of-fice".
>
> I think I can do a call to tex.hyphenation and analyze the nodelist afterwards. But perhaps there is a clean solution already present.

You have to call tex.ligaturing too, because ligatures may change 
hyphenation. And you might get special kinds of disc nodes. See section 
6.5 of the manual.

> Patrick
>
>
> BTW: what is preferred: tex.lccode[x]=y or tex.setlccode(x,y)?

In the second case you can specify "global", whereas in the first case 
the assignment is necessary local. So in some cases the function 
approach is the only one that'll work.

Best,
Paul


More information about the luatex mailing list