# [luatex] find breakpoints in a word

Taco Hoekwater taco at elvenkind.com
Thu Jun 23 11:34:26 CEST 2011


On 06/23/11 11:12, Paul Isambert wrote:
>
>
> 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.

This is the way to go, but note that this may find breakpoints that
are not actually going to be used (e.g. \hbox{office} does have
breakpoints).

> 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.

That is not true. Ligatures may change the node list in fairly complex
ways (because the disc nodes have contain extra branches to allow
ligatures), but they cannot alter the chosen hyphenation points, so
there is no need to call tex.ligaturing() if you are only interested in
the actual breakpoints.

Best wishes,
Taco